algorithmic modeling for Rhino
Hello all.
I have just hit a little problem that I am scratching my head over and can't work out why it does what it does.
I have a bunch of surfaces, which I split using Surface Split. To begin with there are 13 surfaces and one curve in each set. After the split there are around 24-30 surfaces, which is just as expected
But when I evaluate all the resulting reparameterized surfaces at 0.5,0.5 to get their center point it seems each piece has that point still at the same location as the unsplit surface. How very odd!?
How can I find the midpoint of each fragment? Alternatively whats the best way to find which fragment is "inside" and "outside" the curve?
Tags:
Ok, I think I just worked out what is going on, but still have no solution. The problem seems that they are trimmed surfaces and so do not have all UV coordinates on the surface. Using Untrim does nothing to change that and the UV coordinates are still the same as the original surfaces.
Weirdly, the Area component places the centroids correctly and seperately for each fragment. Unfortunately the centroid is often not on the surface and is therefore not helpful.
I think if you do Graft on trimmed surfaces, the UV normalized will be individualized.
In addition, you can use the area component and project the centroid with surface Closest Point
Thank you Daniel, I think that was a good tip about Surface Closest Point. The grafting doesn't seem to make a difference. The only way I found to have seperate UVs of the fragments was to use Brep Edges and Boundary Surface to rebuild the surfaces, which is of course not very good, because it is really slow. But it seems like it does what I want now just using that second tip:
Hello Armin,
on the same logic (brep edges), much more complicated but should be faster:
instead of rebuilding the surfaces, get points in the middle of each edge and test if at least one is inside the curves.
Of course you might need to rebuild the trimmed surfaces later in your definition, in which case the above is pointless...
Thanks Nikos!
I was trying a very similar approach earlier, but somehow got stuck a little. Yours seems to work great! Just one little suggestion I would put another Larger Than just before Cull Pattern - I know anything above 1 is seen as "true" but I prefer to use proper Booleans.
But your solution is great, because it doesnt rely on Area, which in this case is really slow (see image below). So your solution is more than 10x faster :)
I hope this will serve u to continue!
The logic is:
selecting the two longer edges of each surface. Extract a central point in them (at 0.5) and obtain an intermediate point. In case of be out of the surface, do ClosestPoint to the two edges, and get intermediate point. It may not be perfect, but it seems that almost all points are near the center of the surface.
Thank you, again. Very interesting approach! It will not always be the same kind of surfaces (with 2 long edges), so it might not always work, but I will keep it in the patch along with the solution by Nikos and see which solution works best with different inputs.
Thanks everyone!!
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