algorithmic modeling for Rhino
hello! as you can see on the attached picture, the black closed curves contain other curves (the blue, ciel, light grey and orange ones). each color corresponds to a different layer (black=boundary, blue=subset_1, light grey=subset_2) etc. What i have been trying to do is to define in which border (black closed curve) each curve from the subsets is contained, in other words link every border to the curves that it contains. i have been trying to figure it out using area centroids and the containment component, but it works only with one point and multiple curves. any ideas? thank you!
Tags:
It's a bit tricky, but it can be done. The idea is to figure out which of the boundary curves contains any given curve (I used [Area Centroid] and [Point In Curves] to test for inclusion), and then use the index of the containment curve to set the path of that specific item:
--
David Rutten
david@mcneel.com
Tirol, Austria
This is exactly what i had in mind! thx, it works perfectly!
David,
I was interested in this definition of yours mostly due to the ability of the Point in Curves module that I had not realized returned index values. But then I made a very simple definition to quickly check this out and it did not return the index values I expected. Much typical troubleshooting and the mystery persists. Would you be able to clarify?
Your equality component plugs into the Relationship output instead of the Index output. Is that the mistake?
--
David Rutten
david@mcneel.com
Tirol, Austria
In addition, your Dispatch component operates on trees and lists. These data streams are mismatched. Flattening the L input seems to fix things.
--
David Rutten
david@mcneel.com
Tirol, Austria
David,
Thanks for looking at this. The problem I am having is the index output of the Points in a Curve module. I am attaching a screen shot of what I am getting in case it works differently when you open the definition. You get a nice set of indices where I get a list of: 0,-1,2 in a seeming random pattern. As for the dispatch, this actually was working as anticipated in that it gave the point groups within the three rectangles. I hope this makes sense.
Well you get -1 because some points are not inside any region.
Your equals component still looks at the [R] output instead of the [I] output. [R] will not tell you what you need to know in this case.
--
David Rutten
david@mcneel.com
Tirol, Austria
I get it. Sorry to be slow. My use of the R output was to test with the numbers referring to outside, coincident, and inside as a way to see what was happening after I became uncertain about what the Index output was giving me. Now it all makes sense. Thanks for your patience.
Hello David,
I am trying to use your input. I get -1 value. I cant avoid that.
Can you let me know how to remove -1 in this same grasshopper script.
Regards, E
I tried to repeat the procedure with points inside curves, however I can't seem to be able to get this to work with points that belong in two regions simultaneously. I tried to use the intersect component and feed it with the circles but the output was empty, it worked with 2 circles but not with more. Any ideas? Thanx!
and of course i forgot the .gh file...
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by