Jump to content

HazelG


Recommended Posts

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

Link to comment

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);

 

  • Like 2
Link to comment

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

 

  • Like 1
Link to comment

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 🙂

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...