PointQuery.distance_to_point should do this. Then we'd need to do a normal containment check (i.e. ray casts) to determine whether to make any distances negative. It might be nice to allow users to enable/disable the second stage. This would simplify the underlying implementation - in the first instance, we can just deal with the python-rust bridge twice and do
points = np.asarray(points)
distance = self._impl.distance(points) # to be implemented
if signed:
is_inside = self._impl.contains_many(points)
distance[is_inside] *= -1
return distance
If this proves to be a bottleneck, we can do it all in rust.
From @schlegelp
PointQuery.distance_to_point
should do this. Then we'd need to do a normal containment check (i.e. ray casts) to determine whether to make any distances negative. It might be nice to allow users to enable/disable the second stage. This would simplify the underlying implementation - in the first instance, we can just deal with the python-rust bridge twice and doIf this proves to be a bottleneck, we can do it all in rust.