Discretize arc to lines

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
pederlh
Registered Member
Posts: 2
Joined: Thu Nov 02, 2023 10:25 am

Discretize arc to lines

Post by pederlh » Thu Nov 02, 2023 10:43 am

Hi!
I wish to take an arc segment of a polyline and discretize it to a set number of straight lines. Does this functionality exist, or is there a quick workaround to achieve the same effect?

Thanks in advance!


QCAD version 3.28.2.2 (QCAD Professional)
macOS 14.0 Sonoma

User avatar
andrew
Site Admin
Posts: 8790
Joined: Fri Mar 30, 2007 6:07 am

Re: Discretize arc to lines

Post by andrew » Thu Nov 02, 2023 10:51 am

You can use the tool

Misc > Draw > Polygon Hull

Note that this is designed to generate polygon hulls of closed polylines. Open polylines are treated as implicitly closed for the interpretation of the inside option.

CVH
Premier Member
Posts: 4957
Joined: Wed Sep 27, 2017 4:17 pm

Re: Discretize arc to lines

Post by CVH » Thu Nov 02, 2023 12:09 pm

pederlh wrote:
Thu Nov 02, 2023 10:43 am
I wish to take an arc segment of a polyline and discretize it to a set number of straight lines.
Hi, I read that as 'I wish to take one arc segment of a polyline ...'
Then you should explode the polyline and address the single arc (or some to all acrs) with Split Entities(MS) => N equal parts.
Afterwards one can recombine the segments to one polyline.

Discretization based on segment length is another ballpark.
There is something by Shutterstock: https://www.qcad.org/rsforum/viewtopic. ... discretize
But again for arcs and rather dedicated for a custom task.

Discretization of arcs (circles) .. polyline arc-segments pops up now and then.
Given that there are build-in resources it seems rather odd that this is not a basic function.
(RArc.approximateWithLines(l,a) ; RArc.approximateWithLinesTan(l,a))

Regards,
CVH

pederlh
Registered Member
Posts: 2
Joined: Thu Nov 02, 2023 10:25 am

Re: Discretize arc to lines

Post by pederlh » Thu Nov 02, 2023 1:39 pm

I see, both comments are very useful. It is nice to have both maximum angle and specific number of parts as options.

I'm surprised that Polygon Hull doesn't have PH as shortcut already though (and no documentation), seems like a common operation.

CVH
Premier Member
Posts: 4957
Joined: Wed Sep 27, 2017 4:17 pm

Re: Discretize arc to lines

Post by CVH » Thu Nov 02, 2023 2:02 pm

The Misc section are indeed undocumented:
andrew wrote:
Mon Jan 03, 2022 10:33 am
The "Misc" menu is the overflow section of QCAD. It is intended for complemental tools not normally part of a CAD system as well as all incomplete, untranslated, undocumented or experimental tools that might or might not be useful for someone.
The preview seems crippled and I can not figure out the transfer function between tolerance and actual segmentation.
I understand that at the inside it are N whole segments and at the outside N-1 whole segments, starting and ending with a half segment.
IMHO N should be 3 given R=50, Sweep is 97.56122825 and tol=2 but it returns 4 segments.

Probably some mathematical rounding and/or comparing preference as the sagitta would be 2.000 within 1e-9 (RS.Pointtolerance).

Regards,
CVH

Post Reply

Return to “QCAD 'How Do I' Questions”