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

• Vectorworks, Inc Employee

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.

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

wicker006.vwx

• Vectorworks, Inc Employee

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

Edited by Stephan Moenninghoff
• Vectorworks, Inc Employee

Work on the list!

• Vectorworks, Inc Employee

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.

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?

• Vectorworks, Inc Employee

You need to make it predictable!

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

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

wicker007.vwx

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

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