HGVW Posted May 21, 2020 Share Posted May 21, 2020 Hello :) Does anyone know how I can equally divide a polyline into equal parts. I have a wiggly path that I applied a custom dashed line type to and would basically like to expand that so I can adjust it slightly and create paths for machining with. So either how you expand a line type to be a physical object or how to divide a freeform polyline into segments? Thanks in advance Quote Link to comment
Pat Stanford Posted May 21, 2020 Share Posted May 21, 2020 The following script will be a start. It will place a locus point at each point along a poly line. You can then use the split tool to divide the poly. Procedure MarkPolyDivisions; {May 21, 2020} {©2020 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {Inserts Locus Points at the distance along a poly to indicate the} {location the poly should be split into the number of segments} {entered in the dialog box.} {No Warranty Expressed or Implied. Use at your own risk.} {May cause drowsiness or loss of hair. Do not operate heavy} {machinery while using this script. See a doctor if symptoms} {persist.} Var H1:Handle; V1, V2:Vector; N1,N2:Integer; R1,R2:Real; B1:Boolean; Begin N1:=IntDialog('Number of Segments to Create:','3'); H1:=FSActlayer; R1:=HPerimN(H1); R2:=R1/N1; For N2:=1 to N1-1 do Begin B1:=PointAlongPoly(H1,N2*R2,V1,V2); Locus(V1.X,V1.Y); End; End; Run(MarkPolyDivisions); 2 Quote Link to comment
Benson Shaw Posted May 24, 2020 Share Posted May 24, 2020 a similar approach is to use the Duplicate Along Path command (edit menu) to place 2d or 3d loci on the path. Choose the Number of duplicates option rather than the distance. Then apply the Split tool in Point mode at each locus. total pain if many loci. Might be advantage to group the loci right after creation so that they can be deleted or classed for visibility control as the drawing evolves. -B 1 Quote Link to comment
HGVW Posted May 26, 2020 Author Share Posted May 26, 2020 Perfect, thank you both. I had been using the duplicate along path for rectangles, but then they don't follow the actual curvature of the line so these are great solutions. Also happy for my first post and to have such quick and helpful responses - thanks 🙂 Quote Link to comment
Pat Stanford Posted May 26, 2020 Share Posted May 26, 2020 Welcome to the club. Ask again the next time you get stuck. We are a pretty friendly bunch here. ;-) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.