FIX:offset error of auto hole-contour compensation

Jira: none

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: Id806eaab2ddcb44d89ef587765e5396939920f5a
This commit is contained in:
qing.zhang 2025-01-17 11:03:18 +08:00 committed by lane.wei
parent 519ceaad5a
commit dc81de37fd
17 changed files with 80 additions and 59 deletions

View File

@ -1,7 +1,7 @@
{
"name": "Bambulab",
"url": "http://www.bambulab.com/Parameters/vendor/BBL.json",
"version": "02.00.00.20",
"version": "02.00.00.21",
"force_update": "0",
"description": "the initial version of BBL configurations",
"machine_model_list": [

View File

@ -9,18 +9,6 @@
"chamber_temperatures": [
"60"
],
"counter_coef_2": [
"3860"
],
"counter_coef_3": [
"-32000"
],
"counter_limit_min": [
"-35000"
],
"counter_limit_max": [
"33000"
],
"filament_deretraction_speed": [
"nil",
"nil"
@ -93,18 +81,6 @@
"nil",
"nil"
],
"hole_coef_2": [
"-8000"
],
"hole_coef_3": [
"135000"
],
"hole_limit_min": [
"88000"
],
"hole_limit_max": [
"220000"
],
"nozzle_temperature": [
"270",
"270"
@ -118,6 +94,36 @@
"Bambu Lab H2D 0.6 nozzle",
"Bambu Lab H2D 0.8 nozzle"
],
"counter_coef_1": [
"0"
],
"counter_coef_2": [
"3860"
],
"counter_coef_3": [
"-32000"
],
"hole_coef_1": [
"0"
],
"hole_coef_2": [
"-8000"
],
"hole_coef_3": [
"135000"
],
"counter_limit_min": [
"-350000"
],
"counter_limit_max": [
"330000"
],
"hole_limit_min": [
"880000"
],
"hole_limit_max": [
"2200000"
],
"filament_start_gcode": [
"; filament start gcode\nM145 P1 ; set airduct mode to heating mode\n"
],

View File

@ -122,16 +122,16 @@
"135000"
],
"counter_limit_min": [
"-35000"
"-350000"
],
"counter_limit_max": [
"33000"
"330000"
],
"hole_limit_min": [
"88000"
"880000"
],
"hole_limit_max": [
"220000"
"2200000"
],
"filament_start_gcode": [
"; filament start gcode\nM145 P0 ; set airduct mode to cooling mode\nM142 P1 R35 S40 U0.3 V0.5 ; set chamber autocooling"

View File

@ -119,16 +119,16 @@
"145000"
],
"counter_limit_min": [
"-35000"
"-350000"
],
"counter_limit_max": [
"30000"
"300000"
],
"hole_limit_min": [
"88000"
"880000"
],
"hole_limit_max": [
"220000"
"2200000"
],
"filament_start_gcode": [
"; filament start gcode\nM145 P0 ; set airduct mode to cooling mode\nM142 P1 R35 S40 U0.3 V0.5 ; set chamber autocooling"

View File

@ -114,19 +114,19 @@
"-8000"
],
"hole_coef_3": [
"201150"
"151150"
],
"counter_limit_min": [
"-35000"
"-350000"
],
"counter_limit_max": [
"33000"
"330000"
],
"hole_limit_min": [
"88000"
"880000"
],
"hole_limit_max": [
"220000"
"2200000"
],
"filament_start_gcode": [
"; filament start gcode\nM145 P0 ; set airduct mode to cooling mode\nM142 P1 R35 S40 U0.3 V0.5 ; set chamber autocooling"

View File

@ -107,16 +107,16 @@
"197450"
],
"counter_limit_min": [
"-35000"
"-350000"
],
"counter_limit_max": [
"33000"
"330000"
],
"hole_limit_min": [
"88000"
"880000"
],
"hole_limit_max": [
"220000"
"2200000"
],
"filament_start_gcode": [
"; filament start gcode\nM145 P0 ; set airduct mode to cooling mode\nM142 P1 R35 S40 U0.3 V0.5 ; set chamber autocooling"

View File

@ -211,16 +211,16 @@
"280000"
],
"counter_limit_min": [
"-40000"
"-400000"
],
"counter_limit_max": [
"50000"
"500000"
],
"hole_limit_min": [
"80000"
"800000"
],
"hole_limit_max": [
"250000"
"2500000"
],
"circle_compensation_speed": [
"200"

View File

@ -133,5 +133,6 @@
"xy_contour_compensation": "0",
"xy_hole_compensation": "0",
"z_direction_outwall_speed_continuous": "0",
"enable_circle_compensation": "0"
"enable_circle_compensation": "0",
"circle_compensation_manual_offset": "0"
}

View File

@ -198,7 +198,7 @@ void Layer::make_perimeters(const AutoContourHolesCompensationParams &auto_conto
(*layerm)->fill_surfaces.surfaces.clear();
if (this->object()->config().enable_circle_compensation) {
SurfaceCollection copy_slices = (*layerm)->slices;
(*layerm)->auto_circle_compensation(copy_slices, auto_contour_holes_compensation_params);
(*layerm)->auto_circle_compensation(copy_slices, auto_contour_holes_compensation_params, scale_(this->object()->config().circle_compensation_manual_offset));
(*layerm)->make_perimeters(copy_slices, &(*layerm)->fill_surfaces, &(*layerm)->fill_no_overlap_expolygons, this->loop_nodes);
} else
(*layerm)->make_perimeters((*layerm)->slices, &(*layerm)->fill_surfaces, &(*layerm)->fill_no_overlap_expolygons, this->loop_nodes);
@ -227,7 +227,7 @@ void Layer::make_perimeters(const AutoContourHolesCompensationParams &auto_conto
//BBS
ExPolygons fill_no_overlap;
if (this->object()->config().enable_circle_compensation)
layerm_config->auto_circle_compensation(new_slices, auto_contour_holes_compensation_params);
layerm_config->auto_circle_compensation(new_slices, auto_contour_holes_compensation_params, scale_(this->object()->config().circle_compensation_manual_offset));
layerm_config->make_perimeters(new_slices, &fill_surfaces, &fill_no_overlap, this->loop_nodes);
// assign fill_surfaces to each layer

View File

@ -80,7 +80,7 @@ public:
void slices_to_fill_surfaces_clipped();
void prepare_fill_surfaces();
//BBS
void auto_circle_compensation(SurfaceCollection &slices, const AutoContourHolesCompensationParams &auto_contour_holes_compensation_params);
void auto_circle_compensation(SurfaceCollection &slices, const AutoContourHolesCompensationParams &auto_contour_holes_compensation_params, float manual_offset = 0.0f);
void make_perimeters(const SurfaceCollection &slices, SurfaceCollection* fill_surfaces, ExPolygons* fill_no_overlap, std::vector<LoopNode> &loop_nodes);
void process_external_surfaces(const Layer *lower_layer, const Polygons *lower_layer_covered);
double infill_area_threshold() const;

View File

@ -66,9 +66,10 @@ void LayerRegion::slices_to_fill_surfaces_clipped()
}
}
void LayerRegion::auto_circle_compensation(SurfaceCollection& slices, const AutoContourHolesCompensationParams &auto_contour_holes_compensation_params)
void LayerRegion::auto_circle_compensation(SurfaceCollection& slices, const AutoContourHolesCompensationParams &auto_contour_holes_compensation_params, float manual_offset)
{
int filament_idx = this->region().config().wall_filament;
// filament is 1 base
int filament_idx = this->region().config().wall_filament - 1;
double limited_speed = auto_contour_holes_compensation_params.circle_compensation_speed[filament_idx];
double counter_speed_coef = auto_contour_holes_compensation_params.counter_speed_coef[filament_idx] / 1e6;
@ -90,7 +91,7 @@ void LayerRegion::auto_circle_compensation(SurfaceCollection& slices, const Auto
Point center;
double diameter = 0;
if (surface.expolygon.contour.is_approx_circle(max_deviation, max_variance, center, diameter)) {
double offset_value = counter_speed_coef * limited_speed + counter_diameter_coef * diameter + counter_compensate_coef;
double offset_value = counter_speed_coef * limited_speed + counter_diameter_coef * diameter + counter_compensate_coef + manual_offset;
if (offset_value < counter_limit_min_value) {
offset_value = counter_limit_min_value;
} else if (offset_value > counter_limit_max_value) {
@ -106,7 +107,7 @@ void LayerRegion::auto_circle_compensation(SurfaceCollection& slices, const Auto
for (size_t i = 0; i < surface.expolygon.holes.size(); ++i) {
Polygon &hole = surface.expolygon.holes[i];
if (hole.is_approx_circle(max_deviation, max_variance, center, diameter)) {
double offset_value = hole_speed_coef * limited_speed + hole_diameter_coef * diameter + hole_compensate_coef;
double offset_value = hole_speed_coef * limited_speed + hole_diameter_coef * diameter + hole_compensate_coef + manual_offset ;
if (offset_value < hole_limit_min_value) {
offset_value = hole_limit_min_value;
} else if (offset_value > hole_limit_max_value) {

View File

@ -880,7 +880,7 @@ static std::vector<std::string> s_Preset_print_options {
"top_surface_line_width", "support_line_width", "infill_wall_overlap", "bridge_flow",
"elefant_foot_compensation", "xy_contour_compensation", "xy_hole_compensation", "resolution", "enable_prime_tower",
"prime_tower_width", "prime_tower_brim_width", "prime_tower_outer_first", "prime_tower_skip_points", "prime_volume",
"enable_circle_compensation", "circle_compensation_speed",
"enable_circle_compensation", "circle_compensation_speed", "circle_compensation_manual_offset",
"counter_coef_1", "counter_coef_2", "counter_coef_3", "hole_coef_1", "hole_coef_2", "hole_coef_3",
"counter_limit_min", "counter_limit_max", "hole_limit_min", "hole_limit_max", "diameter_limit",
"wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits",

View File

@ -686,7 +686,7 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionBool(false));
def = this->add("z_direction_outwall_speed_continuous", coBool);
def->label = L("Z direction outwall speed continuous");
def->label = L("Smoothing wall speed in z direction(experimental)");
def->category = L("Quality");
def->tooltip = L("Smoothing outwall speed in z direction to get better surface quality. Print time will increases. It is not work on spiral vase mode.");
def->mode = comAdvanced;
@ -4177,11 +4177,20 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionBool(false));
def = this->add("enable_circle_compensation", coBool);
def->label = L("Auto holes-contour compensation");
def->tooltip = L("enable_circle_compensation");
def->label = L("Auto Circle Holes-contour Compensation");
def->tooltip = L("Expirment feature to compensate the circle holes and circle contour. "
"This feature is used to improve the accuracy of the circle holes and contour within the diameter below 50mm. "
"Only support PLA Basic, PLA CF, PET CF, PETG CF and PETG HF.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("circle_compensation_manual_offset", coFloat);
def->label = L("User Customized Offset");
def->sidetext = L("mm");
def->tooltip = L("If you want to have tighter or looser assemble, you can set this value.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.0));
def = this->add("circle_compensation_speed", coFloats);
def->label = L("Circle Compensation Speed");
def->tooltip = L("circle_compensation_speed");

View File

@ -828,6 +828,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, xy_contour_compensation))
//BBS auto hole contour compensation
((ConfigOptionBool, enable_circle_compensation))
((ConfigOptionFloat, circle_compensation_manual_offset))
((ConfigOptionBool, flush_into_objects))
// BBS
((ConfigOptionBool, flush_into_infill))

View File

@ -922,7 +922,8 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "initial_layer_line_width"
|| opt_key == "inner_wall_line_width"
|| opt_key == "infill_wall_overlap"
|| opt_key == "enable_circle_compensation") {
|| opt_key == "enable_circle_compensation"
|| opt_key == "circle_compensation_manual_offset") {
steps.emplace_back(posPerimeters);
} else if (opt_key == "gap_infill_speed" || opt_key == "filter_out_gap_fill") {
// Return true if gap-fill speed has changed from zero value to non-zero or from non-zero value to zero.

View File

@ -732,6 +732,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
bool enable_auto_hole_and_contour_compensation = config->opt_bool("enable_circle_compensation");
toggle_field("xy_hole_compensation", !enable_auto_hole_and_contour_compensation);
toggle_field("xy_contour_compensation", !enable_auto_hole_and_contour_compensation);
toggle_line("circle_compensation_manual_offset", enable_auto_hole_and_contour_compensation);
}
void ConfigManipulation::update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config/* = false*/)

View File

@ -2037,6 +2037,7 @@ void TabPrint::build()
optgroup->append_single_option_line("xy_contour_compensation", "xy-hole-contour-compensation");
optgroup->append_single_option_line("elefant_foot_compensation", "parameter/elephant-foot");
optgroup->append_single_option_line("enable_circle_compensation");
optgroup->append_single_option_line("circle_compensation_manual_offset");
optgroup->append_single_option_line("precise_z_height");
optgroup = page->new_optgroup(L("Ironing"), L"param_ironing");