Grasshopper

algorithmic modeling for Rhino

not getting always the Closest pts in a point collection

Hi there,

Not sure what I am doing wrong, I can't get the closest points in a point collection uniformly from some grouped rhino geometries that are referenced from my rhino model.

As per the illustration attached, the green points supposed to be the closest point of each geometry member in each group, being not always the case unfortunately. My intention is to get all green points to be inside of the cube. A simple task that is not that clear for me obviously. I can use some help here. =)

Thank you so much guys for reading this!

Cheers,

Alan

Views: 431

Attachments:

Replies to This Discussion

I think your problem is with your tree branches not matching up. If you place a Shift Paths (PShift) component between your "Volume" component and your "Closest Point" (PT) component, you should be good.

Also, if all your boxes are made in a similar way and you are just trying to get the centroids of each interior face of the brep, you can just pull out the indices of the centroids that you want without doing closest point searches. The indices are probably all consistent anyways.

Hi Brian,

I already tried using shift paths in my volume component and my closest point component. Would you be able to show me how you would approach this data tree issue please?

The grouped items on rhino are exactly the same since they are a copy multiple from the original one. But as once David Rutten explained to me, the order of objects in the Rhino 3dm file is not meaningful and not persistent. You simply cannot rely on Rhino returning objects the same way each time you do a search. It'll return the same ones, but not necessarily in the same order.

Thanks!

Alan

Hi Alan,

Is your end goal to retrieve the centroids of the interior faces (pts), or get the interior faces themselves (srfs)?

Hi Brian,

I believe both are important, since I would like to keep consistent the normal direction of all the interior faces within all the members, so I was thinking doing is a cull pattern selection after this step, that's why closest point component is crucial for me so I could get after the closest surfaces to the closest point of each group geometries.

Gotcha. Well just modifying your script I would do something like the following (see attached). I just made sure you have enough bounding-box-centroids to match up with the number of faces you are measuring the distance to. To do this I just repeated the bounding box centroids and grafted them. You'll see if you look at the param viewers that the branches all line up nicely. 

There's probably a simpler way to do all of this, but this is what I would do for a quick fix.

best,

Brian

Attachments:

Hey Brian,

Thank you so much, your solution was a big help, I definitely missed the part of having enough bounding-box-centroids, which makes total sense! =)

I only added to your solution a length component to ensure same number of centroids per group in case they don't have same number of members (see attached). Thanks again! =)

Sincerely,

Alan

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