ros-industrial / noether

Tool path planning and surface segmenter
113 stars 44 forks source link

Fix raster ordering #167

Closed marip8 closed 2 years ago

marip8 commented 2 years ago

This PR fixes a bug in the raster organization modifier where the organizer was sorting waypoints by their global x positions and sorting tool paths by the global y positions of their first waypoints. This approach failed to organize rasters correctly when the tool paths are already nominally oriented along the x-axis and nominally stepping along the y-axis. This fix computes the average direction of travel of the first tool path, and sorts the waypoints in each tool path by distance along this vector. It then computes the raster direction by taking the cross product of first waypoint z-axis and the average direction of travel and sorts the tool paths by the distance of their first waypoint along this vector.

marip8 commented 2 years ago

@DavidMerzJr I updated per your comments and added the raster direction estimation technique we talked about

DavidMerzJr commented 2 years ago

Thanks for the contribution