Grasshopper

algorithmic modeling for Rhino

NURBS curve from random segments of a polygon

Hi everyone,

I'm trying to connect with "Nurbs Curve" some points on random segments of a polygon (as you can see in Test Nurbs curve.jpg). The basic rule is to connect all consecutive points (0-0-0; 1-1-1 etc.), by using the center point of the polygon as control point.

I have three problems:

1. I don't know how to obtain the nurbs curve. Tried to connect all the points and the center point into the "nurbs curve" component but it obviously doesn't work as I want. I'm sure it's a very banal problem, but I don't know how to figure it out...

2. sometimes (depending on the randomness seed), some points are overlapped (as in the jpg). I don't know why it happens and how to avoid it.

3. due to the "Random reduce" component (I guess) the point lists are not consecutive. So when I try to connect all the points I get randomly ordered lines.


Thanks!

Views: 1021

Attachments:

Replies to This Discussion

Hi

1. To get the NURBS node to work the way you want it you need to give it the right points in the right order. First a point on the edge of the polygon, then the center point and then a second point on the edge of the polygon. In the attached GH definition you see one way of doing that with the Weave node.

2. Some of the points overlap because a closed polyline always has the start point and the end point as the exact same point. You get overlapping points because you create a line to and from the same point. When you divide that zero length line, you get more points at the same spot. Instead of using the control points of the polyline to generate the geometry, I used the line segments. Then you avoid having overlapping points.

I maybe did something you didn't ask for in your post. I flipped every other line segment so that the connecting lines would not cross each other as much.

Thomas Holth

Attachments:

Thanks a lot Thomas!

1. "Weave", of course... Now it works perfectly.

2. Ok, done.

3. In this new version I used "Random" component instead of "Random reduce", and I noticed it mantains all the sets in order, just as I wanted.

No problem for the "flip curve". I didn't need it, but the more I see the more I learn! :)

Thanks again,

Roberto

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service