mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-30 00:45:26 -05:00
Size painted segmentation from the filament count, not the color palette (#15998)
multi_material_segmentation_by_painting sized its per-filament output from filament_colour, but apply_mm_segmentation reads one entry per filament_diameter. When the palette was shorter than the filament list, slicing an object painted with a filament that had no color read past the end and crashed. Size it from filament_diameter instead. Adds a regression test that paints one side of a cube with filament 2 while filament_colour has one entry.
This commit is contained in:
1 parent
ab24043937
commit
21d2856429
2 files changed
+33
-1
No files matched your search
@@ -2469,7 +2469,8 @@ std::vector<std::vector<ExPolygons>> segmentation_by_painting(const PrintObject
|
||||
|
||||
// Returns multi-material segmentation based on painting in multi-material segmentation gizmo
|
||||
std::vector<std::vector<ExPolygons>> multi_material_segmentation_by_painting(const PrintObject &print_object, const std::function<void()> &throw_on_cancel_callback) {
|
||||
const size_t num_facets_states = print_object.print()->config().filament_colour.size() + 1;
|
||||
// apply_mm_segmentation() reads one entry per filament_diameter, and filament_colour can be shorter.
|
||||
const size_t num_facets_states = print_object.print()->config().filament_diameter.size() + 1;
|
||||
const float max_width = float(print_object.config().mmu_segmented_region_max_width.value);
|
||||
const float interlocking_depth = float(print_object.config().mmu_segmented_region_interlocking_depth.value);
|
||||
const bool interlocking_beam = print_object.config().interlocking_beam.value;
|
||||
|
||||
Reference in new issue
Block a user