Precise wall enabled for all wall ordering types (#8247)

* Allow presice outer wall irrespective of wall ordering

* Fix precise wall IOI ordering spacing

* Enable for classic mode
This commit is contained in:
Ioannis Giannakas 2025-02-07 15:34:27 +00:00 committed by GitHub
parent 42577feeba
commit 03a9d3f5ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 9 deletions

View file

@ -1949,7 +1949,7 @@ void PerimeterGenerator::process_classic()
coord_t ext_perimeter_spacing = this->ext_perimeter_flow.scaled_spacing();
coord_t ext_perimeter_spacing2;
// Orca: ignore precise_outer_wall if wall_sequence is not InnerOuter
if(config->precise_outer_wall && this->config->wall_sequence == WallSequence::InnerOuter)
if(config->precise_outer_wall)
ext_perimeter_spacing2 = scaled<coord_t>(0.5f * (this->ext_perimeter_flow.width() + this->perimeter_flow.width()));
else
ext_perimeter_spacing2 = scaled<coord_t>(0.5f * (this->ext_perimeter_flow.spacing() + this->perimeter_flow.spacing()));
@ -2948,7 +2948,7 @@ void PerimeterGenerator::process_arachne()
if (is_topmost_layer && loop_number > 0 && config->only_one_wall_top)
loop_number = 0;
auto apply_precise_outer_wall = config->precise_outer_wall && this->config->wall_sequence == WallSequence::InnerOuter;
auto apply_precise_outer_wall = config->precise_outer_wall;
// Orca: properly adjust offset for the outer wall if precise_outer_wall is enabled.
ExPolygons last = offset_ex(surface.expolygon.simplify_p(surface_simplify_resolution),
apply_precise_outer_wall? -float(ext_perimeter_width - ext_perimeter_spacing )
@ -3177,12 +3177,22 @@ void PerimeterGenerator::process_arachne()
// Debug statement to print spacing values:
//printf("External threshold - Ext perimeter: %d Ext spacing: %d Int perimeter: %d Int spacing: %d\n", this->ext_perimeter_flow.scaled_width(),this->ext_perimeter_flow.scaled_spacing(),this->perimeter_flow.scaled_width(), this->perimeter_flow.scaled_spacing());
// Get searching thresholds. For an external perimeter we take the external perimeter spacing/2 plus the internal perimeter spacing/2 and expand by 3% to cover
// rounding errors
coord_t threshold_external = (this->ext_perimeter_flow.scaled_spacing()/2 + this->perimeter_flow.scaled_spacing()/2)*1.03;
// Expand by 3% to cover rounding issues
const float expand_factor = 1.03f;
// Get searching thresholds. For an external perimeter we take the external perimeter spacing/2 plus the internal perimeter spacing/2 and expand by the factor
// rounding errors. When precise wall is enabled, the external perimeter full spacing is used.
coord_t threshold_external = (apply_precise_outer_wall)
// Precise outer wall ⇒ use “full external spacing”
? ( this->ext_perimeter_flow.scaled_spacing()
+ this->perimeter_flow.scaled_spacing()/2.0 )
// Normal ⇒ half ext spacing + half int spacing
: ( this->ext_perimeter_flow.scaled_spacing()/2.0
+ this->perimeter_flow.scaled_spacing()/2.0 );
threshold_external *= expand_factor;
// For the intenal perimeter threshold, the distance is the internal perimeter spacing expanded by 3% to cover rounding errors.
coord_t threshold_internal = this->perimeter_flow.scaled_spacing() * 1.03;
// For the intenal perimeter threshold, the distance is the internal perimeter spacing expanded by the factor to cover rounding errors.
coord_t threshold_internal = this->perimeter_flow.scaled_spacing() * expand_factor;
// Re-order extrusions based on distance
// Alorithm will aggresively optimise for the appearance of the outermost perimeter

View file

@ -1011,8 +1011,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("precise_outer_wall",coBool);
def->label = L("Precise wall");
def->category = L("Quality");
def->tooltip = L("Improve shell precision by adjusting outer wall spacing. This also improves layer consistency.\nNote: This setting "
"will only take effect if the wall sequence is configured to Inner-Outer");
def->tooltip = L("Improve shell precision by adjusting outer wall spacing. This also improves layer consistency.");
def->set_default_value(new ConfigOptionBool{false});
def = this->add("only_one_wall_top", coBool);