Jump to content
Developer Wiki and Function Reference Links Read more... ×

Zig-Zag from NURBS curve

Recommended Posts

Hello, I'm looking for some hits how to solve the following problem.

I want to create a script that converts base curve (any Nurbs in 3D, green curve in the picture) into zigzag line around it, but on the same plane (red curve in the picture).

I thought it might work in following steps:

Base curve (green) -> Offest on both side -> divide curves into same number of points -> sorting points -> creating nurbs Curve based on sorted list

But this fails on sorting step.

I had other idea, using vectors:

base curve (green) -> points on curve -> Perpendicular Vectors from these points -> every 2nd Vector turn -180deg -> move point along vectors in both directions -> creating nurbs Curve based on moved points

But I don't know how to create adequate Vectors in 3D.


I will most grateful for any help/hints how to solve this.


Share this post

Link to post

You were on the right track. I don't think you need to do much sorting because the duplicates are all created in order. You need to target the relevant circles' indices. Each index is a poly vertex. Try the "every other" node.

Share this post

Link to post

Stephan, thanks for reply.

So I created this script, mayby you can help understand why it is not working.

It looks like after offsetting curve the first point on each curve is in different place (as circles show), so the final output is "shifted".


Share this post

Link to post
Posted (edited)

Oh, come on, you've done it. Just work on the reordering of those vertices. Very minimal, nice marionette.

Edited by Stephan Moenninghoff

Share this post

Link to post

You will need to find a way to align those vertices if you want to make an object from this Marionette network. Those vertices are going to realign. The offset fed into the index port of the Split List node is likely going to be different for different polylines.

  • Like 1

Share this post

Link to post

I know, started working on this just like you have send with "split list".

But still I don't understand why every new curve after using offset has different starting/first point. Is it random or somehow predictable?

Share this post

Link to post

Fine, it's working I think, thanks for help!

Any suggestions how I can do it in more efficient way will be appreciated.


Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.