Jump to content
GRZEGORZ

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.

Example1.jpg

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

wicker006.vwx

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

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.


 

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.

×
×
  • Create New...