ros-industrial / noether

Tool path planning and surface segmenter
111 stars 43 forks source link

Fixes plane slicer raster planner planning with coplanar mesh. #197

Closed rr-mark closed 10 months ago

rr-mark commented 10 months ago

Previously, when the mesh passed to PlaneSlicerRasterPlanner::planImpl is coplanar:

This causes the planImpl method to return an empty ToolPaths, which promptly crashes the modifier it is passed in to.

This PR replaces pca_vecs.col(2).normalized(), i.e. (pca.getEigenVectors().col(2) * scale.z()).normalized() with mesh_normal, i.e. pca.getEigenVectors().col(2).normalized(), which should have the same value as before when scale.z() is not zero, but which should be a valid unit vector when scale.z() is zero.