Which points are on the edge of which surface

Hi there!

Here’s a closed curve divided into lots of segments.
I cannot figure out a way to check which of the points from the divide curve component that coincides with which surfaces.

Would appreciate if someone has an idea.

points touching surfaces.gh (137.8 KB)

Hej Lars,

I don’t know if this would be a bit inefficient algorithmicwise, but why not checking each SurfaceClosestPoint for all the points in the list and all surfaces and then chose the closest one?
My concern is that this may be a lot of operations, but I guess that way it works.
But as far as I know this i how it’s done in rhinoscriptsyntax as well, so I guess that’s what I’d go for.

I am not able to do this in Grasshopper right now, but I might give this a try tomorrow?

T.

1 Like

points touching surfaces.gh (145.1 KB)
@lars.renklint, is this what you want to achieve?

1 Like

No matter how small I make the tolerance, I seem to get one extra point. :thinking:


points touching surfaces_2021May13a.gh (150.6 KB)

2 Likes

Thank you Tobias, measuring distances does the trick.

1 Like

Thank you Joseph, this is exactly what I’m looking for.

The extra point is probably because the very first point in the list is exactly in between two surfaces.

1 Like

Maybe I’m stretching it now…

But, what would the logic be for adding two more points to the list, one at each side of the surface?

I don’t understand that question?

P.S. Here is a way using Iso Curve to find the corresponding points on the opposite edge?


points touching surfaces_2021May14a.gh (154.8 KB)

P.P.S. The white group gives you the opposite points without using the Iso Curves (purple group).


points touching surfaces_2021May14a2.gh (158.6 KB)

Thanks a lot!
When I said I was stretching my luck I meant that I haven’t given it much effort yet. I’ll try to find those extra points and if I fail at least it will be easier to ask the right questions.

This is what I was getting at, an extra point in both ends:

Closest points worked perfectly.

I still don’t know what you mean? How about posting your code,?

P.S. Maybe this? (white group) I’m tired of guessing.


points touching surfaces_2021May15a2.gh (154.8 KB)