Grasshopper

algorithmic modeling for Rhino

I have a buch of closed Polysurfaces with none of them intersecting another. They are like cuttet out of one piece so some of them do "touch" their neighbor (if they have one) with at least one single surface.

What i wan't to do is to cull every closed Polysurface that does not have one, two or three direct neighbors, but i do not know how to solve this issue.

 

Does anyone have an idea? 

Thanks 

Views: 1891

Replies to This Discussion

You didn't post your model so I had to create my own...

Attachments:

Added two "filters" - best to preview one or the other, they are connected in series:

  1. the green group ("have neighbors") has a slider to show all (1) or, as you approach zero, only those with more and more neighbors.
  2. the white group ("my neighbors") has a 'list idx' slider to choose one of the filtered results and show all of its neighbors.

Attachments:

P.S.  'Scale' in the white group is superfluous and should be skipped/ignored.

P.P.S.  Oops...  that broke a feature - too hasty.

Attachments:

Fixed the cosmetic highlighting feature (yellow group inside "my neighbors") and modified the "FRAGMENTS" (blue group) to clarify the distinction between data (the "fragments") and the code to answer the original question.

Bumping the 'ArrBox' dimension from 5 up to 7 is still reasonably "fast" - ~6 secs.

Attachments:

Better.  With 'Jitter' on the arrayed fragments, before 'Reduce'.

Even better(?) would be to distinguish between neighbors who have adjacent faces (overlapped surfaces) vs. only shared edges?

Attachments:

There are several things to get faster performance

1. Use meshes

2. Sort closest pairs, rtree is always good option. If you do not care about speed, you will check intersection between each and and the rest.

3. Fastest method with decent output is:

    Line[] line = Rhino.Geometry.Intersect.Intersection.MeshMeshFast(x, y);

    if(line.Length > 0)
      A = true;

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