mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-15 00:13:00 +00:00
Fix Arachne duplicate extrusion caused by bead count mismatch (#14031)
* Add test for Arachne duplicate wall segment detection Add test cases that reproduce an issue where Arachne generates duplicate/coinciding extrusion segments at certain min_bead_width settings. Test configuration: - Profile: 0.28mm Extra Draft @BBL X1C (0.4mm nozzle, 0.28mm layer) - outer_wall_line_width: 0.42mm, inner_wall_line_width: 0.45mm - wall_loops: 2, precise_outer_wall: enabled - Test polygon: outer rectangle (0,0)-(20,20) with inner cutout (0.5,0.5)-(19.5,19.5) This creates a 0.5mm wide frame around the perimeter. Results: - 50% min_bead_width (0.20mm): FAILS - detects 4 duplicate segments (all 4 sides) - 60% min_bead_width (0.24mm): PASSES - no duplicates At 50%, Arachne generates two separate closed loops that share all 4 edges of the inner square. At 60%, Arachne generates a single closed loop. SVG output is exported to /tmp/opencode/ for visual debugging. * Fix Arachne duplicate extrusion caused by bead count mismatch WideningBeadingStrategy::compute() used optimal_width (inner wall width) to determine if a thin wall should produce a single bead. However, getOptimalBeadCount() uses optimal_width_outer (outer wall width) via RedistributeBeadingStrategy to decide the bead count. This inconsistency caused situations where getOptimalBeadCount() returned 2 beads, but compute() produced only 1 bead at full thickness. The single bead was then generated for both inner and outer contours, resulting in duplicate extrusion paths. Fix: Use getTransitionThickness(1) instead of optimal_width. This method returns the exact threshold for the 1-to-2 bead transition, ensuring consistency between bead count calculation and bead generation. Reproduces with: 50% min_bead_width, 0.42mm outer wall, 0.45mm inner wall, 0.5mm polygon inset creating ~0.38mm wall thickness. Fixes #13917 --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -26,7 +26,13 @@ std::string WideningBeadingStrategy::toString() const
|
||||
|
||||
WideningBeadingStrategy::Beading WideningBeadingStrategy::compute(coord_t thickness, coord_t bead_count) const
|
||||
{
|
||||
if (thickness < optimal_width) {
|
||||
// Use getTransitionThickness(1) to determine if this is a thin wall that should produce
|
||||
// a single bead. This ensures consistency with getOptimalBeadCount() which uses the same
|
||||
// threshold (via RedistributeBeadingStrategy) to decide between 1 and 2 beads.
|
||||
// Previously used optimal_width which could differ from the outer wall width used in
|
||||
// bead count calculations, causing inconsistency where bead_count=2 was requested but
|
||||
// only 1 bead was produced.
|
||||
if (thickness < getTransitionThickness(1)) {
|
||||
Beading ret;
|
||||
ret.total_thickness = thickness;
|
||||
if (thickness >= min_input_width) {
|
||||
|
||||
Reference in New Issue
Block a user