Ultimaker / CuraEngine

Powerful, fast and robust engine for converting 3D models into g-code instructions for 3D printers. It is part of the larger open source project Cura.
https://ultimaker.com/en/products/cura-software
GNU Affero General Public License v3.0
1.66k stars 871 forks source link

Slice error with multi-filament interlocking, with boundary avoidence = 0 #2101

Open Noisyfox opened 1 week ago

Noisyfox commented 1 week ago

Application Version 5.7.2

Platform N/A

Qt N/A

PyQt N/A

Display Driver N/A

Steps to Reproduce

  1. Add two objects that overlaps each other
  2. Apply different extruders
  3. Enable interlocking, with boundary avoidence = 0
  4. Make sure the bottom surface has two adjacent colors
  5. Slice

Actual Results Slice failed

Expected results Slice properly

Additional Information image

Noisyfox commented 1 week ago

When boundary avoidence set to 0, voxels below z=0 won't be removed, which caused this error.

Noisyfox commented 1 week ago

One quick solution is to change https://github.com/Ultimaker/CuraEngine/blob/2f395b07284f125eacd09e67cd61dcc669dcd26f/src/InterlockingGenerator.cpp#L203-L207

to

    auto voxel_emplacer = [&cells](GridPoint3 p)
    {
        if (p.z_< 0) return true;

        cells.emplace(p);
        return true;
    };