I am playing around with the DistancePlanPoint node, and have been struggling understanding why a point belonging to the plane was reporting a non-zero distance.
By noodling around a bit, I found out that this is fixed if I multiply by -1 the coordinates of the point that I input to DistancePlanPoint.
Is there something I’m missing in the (rather simple) logic of how DistancePlanPoint should be used, or is it a proper bug report that here comes with an easy fix? :)
hey, sorry for the late reply. I’ve looked at the code for the plane distance function and there seems to be a bug in Stride. the plane is stored in the so-called normal form (normal vector n + shortest distance to origin D). when the distance is calculated, it assumes that the plane is in Hessian normal form (assumes n is normalized), but it seems someone just mixed up the order in a subtraction term.
it will take a PR to fix that, so it will take a little while. you can work around it for now by wrapping it in a new operation. bonus hint: to flip the sign of a number or vector, we also have the - (Negate) node.
EDIT:
this is the proper fix, flipping the sign of the point gives the wrong sign of the distance. you have to implement the whole formula correctly: