Grzegorz Krzemien Posted May 13, 2019 Share Posted May 13, 2019 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. Quote Link to comment
Vectorworks, Inc Employee Stephan Moenninghoff Posted May 13, 2019 Vectorworks, Inc Employee Share Posted May 13, 2019 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. Quote Link to comment
Grzegorz Krzemien Posted May 13, 2019 Author Share Posted May 13, 2019 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 Quote Link to comment
Vectorworks, Inc Employee Stephan Moenninghoff Posted May 13, 2019 Vectorworks, Inc Employee Share Posted May 13, 2019 (edited) Oh, come on, you've done it. Just work on the reordering of those vertices. Very minimal, nice marionette. Edited May 13, 2019 by Stephan Moenninghoff Quote Link to comment
Vectorworks, Inc Employee Stephan Moenninghoff Posted May 13, 2019 Vectorworks, Inc Employee Share Posted May 13, 2019 Work on the list! Quote Link to comment
Vectorworks, Inc Employee Stephan Moenninghoff Posted May 13, 2019 Vectorworks, Inc Employee Share Posted May 13, 2019 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. 1 Quote Link to comment
Grzegorz Krzemien Posted May 13, 2019 Author Share Posted May 13, 2019 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? Quote Link to comment
Vectorworks, Inc Employee Stephan Moenninghoff Posted May 13, 2019 Vectorworks, Inc Employee Share Posted May 13, 2019 You need to make it predictable! 1 Quote Link to comment
Grzegorz Krzemien Posted May 13, 2019 Author Share Posted May 13, 2019 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 Quote Link to comment
Recommended Posts
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.