Snapmaker / Luban

An easy-to-use 3-in-1 software tailor-made for Snapmaker machines.
https://snapmaker.com/snapmaker-luban
GNU Affero General Public License v3.0
432 stars 114 forks source link

Bug: Wrong cutting order for laser #1758

Open daniel-starke opened 1 year ago

daniel-starke commented 1 year ago

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
parachvte commented 1 year ago

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.

daniel-starke commented 1 year ago

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.

parachvte commented 1 year ago

@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.

mutatrum commented 1 year ago

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 commented 1 year ago

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

mutatrum commented 1 year ago

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.

Galindorf commented 1 year ago

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.

end-me-please commented 1 year ago

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

disk2

viper0078 commented 1 year ago

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.