Fix belt brim emission: dropped first-contact bands, tool selection, inner-only predicate (A,B,C,D)

- Emit coincident belt_brim_by_layer bands even when the leading object layer
  has no InstanceVisit (zero-extrusion lead-in / no coinciding support), so the
  brim at first belt contact is no longer dropped.
- Register each coincident band's brim filament in ToolOrdering and emit each
  band exactly once, in its brim-filament pass; emit ordinary-layer aprons in
  the brim pass before object extrusion (correct tool, brim-first) instead of
  with whatever tool was active.
- has_belt_brim(): inner-only brims need brim_width>0 (leading/extra produce no
  inner geometry), fixing spurious prime-tower/spiral rejection; mirror in
  wants_brim. Single-extruder/single-object output is unchanged except
  previously-dropped bands now print.
This commit is contained in:
harrierpigeon
2026-08-06 15:40:04 -05:00
parent c1a90fc451
commit 1bd3404c03
5 changed files with 175 additions and 24 deletions
+27 -2
View File
@@ -1171,12 +1171,37 @@ bool PrintObject::has_belt_brim() const
return false;
if (m_config.brim_type == btNoBrim)
return false;
if (m_config.brim_width.value <= 0. && m_config.leading_brim_length.value <= 0.
&& m_config.extra_brim_width.value <= 0.)
// An inner-only brim has no leading/extra geometry: leading_brim_length and
// extra_brim_width both widen the OUTER ring, which btInnerOnly never emits, so it
// produces nothing unless brim_width itself is positive. Every other brim type is
// satisfied by any one of the three widths. Requiring the width here (instead of
// "any width") stops has_belt_brim() - and therefore Print::validate() - from
// rejecting the prime tower / spiral vase for a brim that would never be drawn.
if (m_config.brim_type == btInnerOnly) {
if (m_config.brim_width.value <= 0.)
return false;
} else if (m_config.brim_width.value <= 0. && m_config.leading_brim_length.value <= 0.
&& m_config.extra_brim_width.value <= 0.) {
return false;
}
return ! this->has_raft();
}
unsigned int PrintObject::belt_brim_filament() const
{
// 1-based, matching PrintRegion::outer_wall_filament_id and the raw values pushed
// into LayerTools::extruders in ToolOrdering::collect_extruders (the whole list is
// reindexed to 0-based later). Lowest positive outer-wall filament over the
// printing regions; 1 when none is explicitly set.
unsigned int brim_filament = 0;
for (size_t i = 0; i < this->num_printing_regions(); ++ i) {
const unsigned int f = this->printing_region(i).config().outer_wall_filament_id.value;
if (f > 0 && (brim_filament == 0 || f < brim_filament))
brim_filament = f;
}
return brim_filament == 0 ? 1u : brim_filament;
}
bool PrintObject::belt_brim_instances_compatible() const
{
// One set of bands is shared by every instance of this object, so they must all sit at