Luban icon indicating copy to clipboard operation
Luban copied to clipboard

Bug: Wrong cutting order for laser

Open daniel-starke opened this issue 1 year ago • 9 comments

Wrong cutting order for laser

Affected Version

Luban 4.4.0

To Reproduce

Steps to reproduce the behavior:

  1. Load an object with an inner path and outer path.
  2. Laser cut it.

Expected behavior

The inner path is cut before the outer path so that the whole object does not falls down before all inner parts are cut.

🌍 Your Environment

Platform:


- Operating System: Windows 7 x64
- Printer: Snapmaker A350

daniel-starke avatar Nov 12 '22 14:11 daniel-starke

Inside of an object, paths are not distinguished to be inner or outer path.

So if you want specific print order, you can design and separate the two objects, and specify their print order separately.

parachvte avatar Nov 15 '22 07:11 parachvte

I am aware of that workaround. Nevertheless, if a human can distinguish both, a program is also able to do so. The easiest way is the scan line algorithm.

daniel-starke avatar Nov 15 '22 19:11 daniel-starke

@daniel-starke you are right.

Here is scenarios to be considered,

  1. Nested path. We can have more than 2 path embracing each other, you will want to cut from the inner most to outer most path. This can be done by classic geometric algorithms.
  2. Overlapping path. If two paths overlap each other, we can not determine which one should be the first to cut; If two path overlap each other, and shaping a closed area, if we want the closed area to be the last to cut, it's a bit difficult to deal with.
  3. Open path. It's not a different scenario than 2, both open paths and closed paths can overlap.

To detect overlapping areas, we will need to calculate cross points over scan lines, and generate even more points. I think we can do simple no-overlapping path detection (like we did for CNC), and ignore overlapping ones.

parachvte avatar Nov 17 '22 03:11 parachvte

I ran into the same problem where I cut many small parts from a single sheet. The pathplanner cut off large segments which needed further cutting up, which resulted in misalignments. Furthermore, as the cutting started at the edge, the clamps holding down the plywood didn't serve any purpose anymore.

To solve the scenario's above, one way of solving it would be:

  1. Add intersection points for crossing paths. (optional, crossing paths would be an edge case I assume?);
  2. Start cutting in the center of the work piece;
  3. Only cut off a part that doesn't need any further cutting.
  4. It should not cut anything that doesn't add to point 3, e.g. no random cuts on other parts.

This should create a sort of spiralling path outwards, and solve the problems of premature disconnects, nested paths and overlapping paths.

Attached a file I used.

pill-cut

mutatrum avatar Dec 02 '22 11:12 mutatrum

Animated preview of how Luban routed the laser cut: pills-luban

mutatrum avatar Dec 03 '22 13:12 mutatrum

To have more control over the pathplanner would be highly beneficial. I've found some settings in Lightburn that would work in my case, by using the Order by Group as first priority: image Hope this helps.

mutatrum avatar Dec 03 '22 15:12 mutatrum

I am adding my voice to this request. I cut lacy works in paper and when the outline is cut first of course the fan blows the pieces out of alignment. The animated preview that @mutatrum posted is ridiculous... the amount of time wasted on that pathing! Time is money when it comes to laser work, especially if you are cutting things for other people.

Galindorf avatar Dec 19 '22 19:12 Galindorf

similar problem here. it seems to be impossible to cut this part properly.

disk2

end-me-please avatar Feb 04 '23 15:02 end-me-please

When importing a DXF file, I would like the cut order to follow the sort order of the objects in the DXF file. Or add an option to specify this behavior. This alone will satisfy my needs.

viper0078 avatar Apr 20 '23 09:04 viper0078