Jump to content

divide polyline into segments


Recommended Posts

is there an easy, fast way to divide a polyline into segments? i.e. lets say you have a polyline with curves - segment it by distance or number of points that convert it into a segmented polyline made up of straight lines? This would be incredibly useful for making clean nurbs lines that can be lofted with an equal number of segments. (currently I need this for recreating a ceiling from a point cloud object/file)

Edited by Samuel Derenboim
Link to comment
  • Vectorworks, Inc Employee

I think Even Divide can do this, but it may be restricted by object type:

 

http://app-help.vectorworks.net/2017/eng/index.htm#t=VW2017_Guide%2FObjects_edit2%2FDividing_Objects_Evenly.htm&rhsearch=Even divide&rhhlterm=Even divide&rhsyns=

 

If that fails, you could also duplicate a loci along the polyline as a path the desired number of times and then use the Split tool on each loci snap, but that would depend on how complex the shape you were working with was.

  • Like 1
Link to comment
  • Marionette Maven

Here's the Marionette script.

Currently, if you name the poly you want to divide up 'test' and run the script, it will cut it up into as many segments as the 'int' node specifies in the Object Info Palette  equally by length.

In order to use the resulting poly, you can just ungroup the result object to detach it from the Marionette network.

 

Also, if you want your result to be a NURBS curve at the end, you can simply add a 'Convert to NURBS' node to the result of the Polygon 3D node. (I recommend unchecking the "Keep Original Object" checkbox in the Object Info Palette with the 'Convert to NURBS' node selected, just to keep your drawing clean.)

 

MarionetteDivideCurve_MFarrell.vwx

  • Like 3
Link to comment
  • 1 year later...

Hi all,

 

I am still wondering: is it possible with Marionette to refer to a segment of a NURBS curve or a polyline without converting it to a segmentized NURBS? My goal is to have a 2D grid with curved lines (either NURBS curve or 2D-poly) and I want to offset only parts of a polyline. Say I have a curved line with a length of 200 meter, and I want to offset the segment between 50 and 125 meter. I am wondering, Is there a way to do this without segmentizing the original? Wouter

Link to comment

I know this is low tech - but it can work:

Duplicate in place the original curve(s). Isolate the dupes - eg Group it or move to a new layer. Apply the segment command to the duplicates. Offset any segments as needed. Class or or color or otherwise isolate the offsets.  If no longer needed, delete the duplicates.

 

-B

 

 

Link to comment
  • 2 years later...
  • 11 months later...
On 9/27/2016 at 1:45 PM, Marissa Farrell said:

Here's the Marionette script.

Currently, if you name the poly you want to divide up 'test' and run the script, it will cut it up into as many segments as the 'int' node specifies in the Object Info Palette  equally by length.

In order to use the resulting poly, you can just ungroup the result object to detach it from the Marionette network.

 

Also, if you want your result to be a NURBS curve at the end, you can simply add a 'Convert to NURBS' node to the result of the Polygon 3D node. (I recommend unchecking the "Keep Original Object" checkbox in the Object Info Palette with the 'Convert to NURBS' node selected, just to keep your drawing clean.)

 

MarionetteDivideCurve_MFarrell.vwx 189.92 kB · 185 downloads

 

Hello @Marissa Farrell

 

I have made much use of this script in the past... and am just trying to use it again now, in VW2021.

 

I'd previously used it in VW2018 and all worked excellently but something is going wrong in VW2021 and it is leaving me with a 3d polygon that seems to have infinite or very large dimensions.

 

Any clue what might be happening? I tried opening the marionette file that I previously had saved as VW2018 version, into 2021 and re-adding the command to the menu.

 

I notice that if I open the file linked at the top of this thread straight into 2021, the "wrapper" object doesn't appear.

Link to comment
  • Marionette Maven

@line-weight

I'm not seeing a wrapper in the original file that I shared, and I am also seeing that it behaves identically in 2022 to 2018, so I assume it also works correctly in 2021.

Can you give me more information as to what you're encountering? Possibly share a file, either here or by direct message?

More than happy to help you solve this issue!

Link to comment
14 minutes ago, Marissa Farrell said:

@line-weight

I'm not seeing a wrapper in the original file that I shared, and I am also seeing that it behaves identically in 2022 to 2018, so I assume it also works correctly in 2021.

Can you give me more information as to what you're encountering? Possibly share a file, either here or by direct message?

More than happy to help you solve this issue!

 

Thanks for the response!

 

Hmm... I wonder if I added the wrapper myself, so that I could add it as a menu command. If I did, I don't remember exactly what I did, and it's very likely that I did something wrong because I'm not any kind of Marionette expert at all. I've attached the file I've got (including version with wrapper) with this message.

 

 

MarionetteDivideCurve_MFarrell.vwx

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...