# 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:

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.

##### Link to comment
• Marionette Maven

If Jim's method fails, Marionette can surely help! I can write something up when I get into the office this morning

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

##### Link to comment

Marissa, Thank you so much, that looks awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

That looks exactly what i wanted to do !

Jim, your method only works with lines and arcs, Marissa made it possible with any polyline!

Marissa, did you code the divide curve tool? or does it come standard inside vw?

##### Link to comment
• Marionette Maven

The Divide Curve node ships with our default content.

It's located in the Marionette Content under Objects > NURBS > Operations - NURBS.

##### Link to comment
• Vectorworks, Inc Employee

She's good.

##### Link to comment

Hahaha, both of you are great. Thank you both for your insight in this matter.

After playing around a bit, i notice that can't do the same if i set the input parameter to a dimension function.  Maybe I'm doing something wrong?

##### Link to comment
• Marionette Maven

Here's a network that may be similar to what you're looking for. This one will divide the line by a dimension length, but there will be rounding involved, so the lengths may not be 100% accurate.

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

How do you use the Marionette that Marissa made?  I downloaded it and tried to use it with a poly line.  Seems to only run with the curve that came with it.  Can I use it on my own poly line or would that take customized programming?

##### Link to comment
• 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.)

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

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:

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.

##### Link to comment
• 2 weeks later...

Did you get a chance to look at this yet?

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

Reply to this topic...

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×
×

• KBASE
• #### MARIONETTE

×
• Create New...