Grasshopper

algorithmic modeling for Rhino

Hi all, I'm trying to connect a nurbs curve to a list of points, but am unsure of the best (or any) method) to order the points in a sequence, such that a "boundary" curve will be generated.

This is what is currently happening:

This is what I'd like to have as a result:

The idea, would be that with fewer point the more wavy/curvy the shape becomes as the program interpolates tangent points. Any pointers are very much appreciated - thanks for your time. 

Views: 3568

Attachments:

Replies to This Discussion

So you want to discard some of the points as well as order them? 

--

David Rutten

david@mcneel.com

Tirol, Austria

Hi David, thanks for your reply. Yes, I'd like to be able to adjust how many points are discarded - and as a result have the curve (boundary) change/adapt accordingly. 

There's nothing directly in GH which does this. Convex Hull may be a starting point, but you'll need to figure out how to proceed from there. Culling points based on distance to Convex Hull, then sorting the points along the hull and fitting a curve through them probably won't work.

Sounds like what you need is a Concave Hull algorithm, but you'll have to code that one up yourself.

--

David Rutten

david@mcneel.com

Tirol, Austria

Thanks for the clear response. At least I can stop scratching my head in uncertainty!

I attached a very bad Concave Hull algorithm in a VB component. It doesn't handle self-intersections at all and the decision metric for selecting which edges the move inwards is probably very stupid.

But this is all I have time for right now...

--

David Rutten

david@mcneel.com

Tirol, Austria

Attachments:

Mateusz also made this nice implementation of alpha shapes:

http://www.grasshopper3d.com/photo/alpha-shape

Ah, excellent.

--

David Rutten

david@mcneel.com

Tirol, Austria

So as soon as I saw this I started contemplating a bunch of recursive proximity and tangent tests... but then I thought a clumsier method might be faster.  Here it is! 

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service