Grasshopper

algorithmic modeling for Rhino

Finding all Enclosed Shapes within a set of Curves

Hi All,

I am trying to find a away to output every unbroken enclosed shape within a set of curves.

I.e. I want something that if I plug in the lines below I get:

  • Shape 1 defined by (1-2-4-5-3)
  • Shape 2 defined by (5-7-6-3)
  • Shape 3 defined by (4-8-7-5)
  • I dont want any combinations of shape 2 and 3 or 1 and 2 etc.

I know to start by identifying vertices... but i really have no clue where to go from there. Anyone have any ideas?

Cheers

LyndonJ

Views: 1645

Replies to This Discussion

Hi Tom,

Thanks for the reply - some good points there!

The reason I am trying to take the points afterwards is I am doing some preliminary designs for a dam upgrade - often modify things put lines in, take them out to check stability - so I want to export closed polylines for whatever I end up with.

I am actually using grasshopper to generate a file for another program which does stability analysis on soil structure - which is why i need the closed polylines.

A better example is this:

(Ignore the numbers in the shot above, I have used those to send material types (rock, soil etc) to this external program).

I did consider defining the middle points, but again due to the vast combinations I would end up with I think it might not be robust enough...

Cheers

Lyndon 

Hi Lyndon, if I understand correctly this is a way to do this:

-draw a big rectangular surface that comprehends all the curves, it has to be bigger than the bounding box of the curves

-<surface split> your surface with your curves

-cull the external undesired surface (the one with the biggest bounding box)

-extract and join the surface edges in  closed polylines

Would this work for you?

Hi Mire,

That probably would work! I might have to write something to match vertices between surfaces but that should be easily doable!

Will have a go, and report back this arvo. 11 month old is sick - so off work baby sitting today! Can have a crack between naps!

Hi Lyndon, this is akin to Mire's idea and adapted from the example in http://www.designcoding.net/detecting-inner-regions-in-grasshopper/ I don't know if it's as general as you require though.

Attachments:

Hi Ethan, 

That is perfect! Add a brep edges command and thats exactly what I needed.

Even spits out common vertices.

Thank you all for the help! This will make life much MUCH easier at work :)

Plugins options:

1.- Network Polygons from BullAnt plugin (http://www.food4rhino.com/project/bullant)... but its seems that is not working correctly (at least for me).

2.- Polyline Offset from Clipper plugin  also know as StudioAVW plugin (http://www.food4rhino.com/project/clipper). Then you can use a negative offset to get the close polyline in the original position.

Hi Manuel,

Thank you very much for the input!

I had been thinking about trying to write code for it which will take me forever and a day... so if i get get this running with plugins I would be stoked!

I will have a go later today, and let you know how i go.


Cheers

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service