Projecting Points Onto A Plane Given By A Normal And A Point
I am using the following function to try to project bunch of vertices onto a plane. Basically mapping a polyhedron to polygon. My plane is defined by a normal vector and a point (c
Solution 1:
Your formula
Proj(P) = P-((P-Centroid).n)n
is correct.
But your implementation
dotscalar = np.dot(np.subtract(centroid,vertex),normalvector)
is not. You swapped centroid
and vertex
. Thus, instead of moving the point onto the plane, your algorithm doubles its distance from the plane.
Post a Comment for "Projecting Points Onto A Plane Given By A Normal And A Point"