Grasshopper

algorithmic modeling for Rhino

I have a reoccurring issue here where I have a lot of curves that I have to manually move the curve seam to the point on the curve where it is at the the sharpest angle.

 

Attached is my first attempt on a single triangle using galapagos to find a point along the curve, but I'm not sure if my methodology is correct, and if it will be adaptable to the selection of 30+ curves.  One issue with the galapagos is it never actually finds the point, it gets close to the area of the point though.

 

Any help would be appreciated.

 

Thank you,

ryan

Views: 1925

Attachments:

Replies to This Discussion

Updated

Try this:

If you saw the previous one. I connected the wrong wire to the synchronous sort.

Attachments:

If you really want to use Galapagos, you should do something like that:

(set the number of digits to 6 in the slider)

The trick is just to test the angle between the point on curve, and the 2 points just before and after it.

It will probably faster to use Discontinuity if you only have sharp angles though.

(Just saw Danny's solution, even better).

thank you for the replies, I'm going to go over them and see what's going on with them.

 

I'll probably be back with some more questions. ;-)

 

thanks again!

ok, so I've got it worked out thanks to you guys and it's working wonderfully.

 

But now there is the question of how do I change those curve's start points to the point that it's found?

Attachments:

Hi Ryan,

 

with my method you would just need to set the C input to True on the Polyline Component to close it and thus make a new version of the triangle.

 

Hey Danny,

 

The curves that I am running this on are curves that are created elsewhere in my definition, or will be curves that are already created in Rhino.  So I can't really redraw/recreate the curves like your definition.

 

I did end up going with yours as you can tell by the latest uploads, I had to tweak it a little to just pick the most acute point on a bunch of curves. 

 

I'm just stuck now at the part of saying, take these curves and move their start point to this point.

 

Thanks again,

ryan

Because you have sorted all of the points from your referenced curves you can then recreate the new polyline. Unless your curves are not closed polylines

 

hmm, I don't think that will work because I'm dealing with polycurves, they are all closed though.  i don't think recreating the curves from the sorted points is going to work right.

 

thanks again for helping me out with this,

ryan

What about this?

EDIT: w should be set to true on the Shift Component for the curves

Attachments:

Woot!  i just added into the whole definition and that works!

 

Just so I understand what is going on,

  1. you simplified the tree of curves
  2. exploded them to get the points on the curves to test
  3. I'm getting confused from here on out with the shifting of the lists -1 and the evaluate curve sliders that are feeding into the 2pt Vector components.
  4. Then you are sorting the exploded segments and joining them back up using the analyzed point as the starting point.

Thank you sooooo much!

ryan

Just so you know

 

A Shift list with S=-1 W=False will remove the last point in a list.

A, B, C, D, E shift back one would become E, A, B, C, D. As the first and the last points of an exploded Polycurve are the same all this is doing is making the list unique.

 

The Point on curve component is enabling you to create a vector between the vertex point and a smidge along the curve. Where as the shift list -1 and point on the curve is getting a vecto between the vertex point and a smidge along the previous curve. Thus creating and angle at the vertex to compare with all the others.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service