noether icon indicating copy to clipboard operation
noether copied to clipboard

Possible bug with how VTK cutter and slicer is used to create rasters in plane raster planner?

Open srsidd opened this issue 7 months ago • 3 comments

I'm following the implementation for the planar raster planner and it looks like PCA is used to find the longest vector of the mesh, and the cut_direction is then to create rasters evenly spaced by the line_spacing_ parameter.

I have a use case where this does not seem right. The mesh I'm using is a rectangle, and I want the segments generated along the longest edge like this - image

The cut direction is being specified with a FixedDirectionGenerator. Going over the code, we generate a max_extent from the length of the principle axes. However, this seems incorrect, as this would generate a vector along X-axis (From the above pic), but the cut_direction is specifying that we generate raster segments along the Y-axis.

Tracing the code further, it seems like we loop through the number of planes and make cuts at start_loc * i * line_spacing. Considering the shape of this mesh, even a small line_spacing covers the entire mesh with a few raster segments. Why are we looping through the longest edge and trying to generate cuts / planes at locations that are outside the mesh? If I reduce my line_spacing_, the number of planes go up drastically, compared to the number of segments that cover the mesh.

To me, this seems like a bug and we should not be creating planes by longest PCA vector, but the direction specified by the cut_direction.

Would appreciate any feedback / advice on if my thought process is right here.

srsidd avatar Jul 10 '24 22:07 srsidd