Skip to content

Conversation

@marip8
Copy link
Member

@marip8 marip8 commented Dec 6, 2025

Issues

The plane slice raster planner is based on a pretty simple implementation idea: use a VTKCutter class to create planar cuts along a mesh and use a VTKStripper to extract points along those planar cuts to form tool path waypoints and segments.

Unfortunately, the VTKCutter + VTKStripper pipeline has several complicating limitations, specifically:

  • It does not create uniformly directed line segments
  • It does not join line segments in the correct order
  • It does not provide the line segments in any sort of order w.r.t. how the line segments are connected

The current implementation of the plane slice raster planner relies on code from several places to correct these shortcomings:

  • A few functions in the plane slice planner itself to try to merge and reorder segments
  • The RasterOrganizationModifier, which currently sorts waypoints along a tool path segment by projected distance along a reference direction computed

#178 and the findings in #271 illustrate that the waypoint sorting behavior in RasterOrganizationModifier is an issue that prevents the usage of raster planners on less planar meshes. #215 updates this behavior, but that change tends to break the plane slice raster planner on a variety of other parts.

#217, #219 and #271 also attempt to simplify the plane slice raster planner and modularize some of the functionality contained within it, but none of them fully address the problem.

Another issue with the plane slice planner is that it does not strictly enforce that raster lines point in the direction specified by the direction generator. The lines will be parallel to this direction vector, but not necessarily in the same direction (i.e., 180 degrees rotated). This restricts the number of applications where the plane slice planner can be effectively used.

Solution

After some investigation, I was able to identify the aforementioned issues in the VTKCutter + VTKStripper pipeline.
I implemented the following changes to solve these issues:

  • Disable the JoinContiguousSegments feature of VTKStripper to prevent segments from being joined incorrectly
  • Sorted all generated segments wrt the raster cut direction
  • Performed a topological sort on the segments to ensure that segments that share a common vertex (i.e., contiguous segments) are adjacent to one another in the data container
  • Merged adjacent segments that share a common vertex in a way that preserves correct ordering
  • Merged adjacent non-connected segments that are within a specified distance of one another to preserve "minimum hole size" feature
  • Replaced spline waypoint interpolation with linear interpolation to address Use linear interpolation instead of spline for points #219 and maintain "point spacing" feature

Results

Issues and PRs resolved with this PR

Replaces #215, #217, #219, #271.

@marip8
Copy link
Member Author

marip8 commented Dec 9, 2025

TODO:

  • Implement merge of very close points
  • Implement prune of segments less than min_segment_size
  • Fix min hole size merging

@marip8 marip8 force-pushed the update/plane-slice-planner branch from 18fb814 to 998f654 Compare December 12, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants