Find geometry from point (is_point_contained)

When I use the python method is_point_contained() for volumes, I can find a specific volume at any point. However, this method does not seem to work for surfaces or curves. I always get -1 as a result, even though i am sure the point is on the surface/curve.

Is there any other method I can use, when I want to find the entity specified by some coordinate?
Thanks for any help.
Best regards
Ingo

Hi Ingo,

Currently, we only support point containment for types volume and body. It looks like it would be an easy fix to support surfaces and curves as well. I will add that to our development list.

You could use a get_distance_between_entities and check if the returned distance is less than some tolerance.

Is that helpful?

Thanks,
Karl

Thank you very much for the quick response. Unfortunately, get_distance_between_entities does not really help, since I want to get a curve or surface id based on a coordinate triple, not an entity.

You might be able to use the get_closest_point() and closest_point_trimmed() methods (see below). If the distance between your triple and the closest point is > 0 (with floating-point tolerances considered) then it’s not on the curve / surface:

Curve

Surface