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
			
									
									
						Discretize arc to lines
Moderator: andrew
					Forum rules
			
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
		
		
	Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
- andrew
- Site Admin
- Posts: 8790
- Joined: Fri Mar 30, 2007 6:07 am
Re: Discretize arc to lines
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.
			
									
									
						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
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
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.
			
									
									
						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
The Misc section are indeed undocumented:
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
			
									
									
						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
