From 08aa277974c18ab32a81e3c017452ce445e75b80 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 11 Mar 2026 00:27:14 -0500 Subject: [PATCH 001/389] stage in changes from off-plate-gravity and remove stuff I didn't need --- resources/shaders/110/gouraud.fs | 1 + resources/shaders/110/gouraud.vs | 5 +- resources/shaders/110/mm_gouraud.fs | 3 +- resources/shaders/110/mm_gouraud.vs | 1 + resources/shaders/140/gouraud.fs | 1 + resources/shaders/140/gouraud.vs | 5 +- resources/shaders/140/mm_gouraud.fs | 3 +- resources/shaders/140/mm_gouraud.vs | 1 + src/libslic3r/ExPolygon.hpp | 5 ++ src/libslic3r/Preset.cpp | 2 +- src/libslic3r/PrintConfig.cpp | 24 ++++++++ src/libslic3r/PrintConfig.hpp | 3 + src/libslic3r/Support/SupportMaterial.cpp | 22 ++++++-- src/libslic3r/Support/TreeSupport.cpp | 18 +++++- src/libslic3r/Support/TreeSupport3D.cpp | 16 +++++- src/libslic3r/TriangleSelector.cpp | 12 ++-- src/libslic3r/TriangleSelector.hpp | 6 +- src/slic3r/GUI/3DBed.cpp | 59 ++++++++++++++++++++ src/slic3r/GUI/3DBed.hpp | 4 +- src/slic3r/GUI/3DScene.cpp | 18 +++++- src/slic3r/GUI/GUI_Factories.cpp | 4 +- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 20 +++++-- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp | 1 + src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp | 28 ++++++++-- src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp | 3 + src/slic3r/GUI/Tab.cpp | 2 + 26 files changed, 230 insertions(+), 37 deletions(-) diff --git a/resources/shaders/110/gouraud.fs b/resources/shaders/110/gouraud.fs index e602d6067d..12f4feca3e 100644 --- a/resources/shaders/110/gouraud.fs +++ b/resources/shaders/110/gouraud.fs @@ -26,6 +26,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform vec4 uniform_color; diff --git a/resources/shaders/110/gouraud.vs b/resources/shaders/110/gouraud.vs index ff3a190c79..e2de2b63e5 100644 --- a/resources/shaders/110/gouraud.vs +++ b/resources/shaders/110/gouraud.vs @@ -23,6 +23,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform mat4 view_model_matrix; @@ -71,8 +72,8 @@ void main() // Point in homogenous coordinates. world_pos = volume_world_matrix * vec4(v_position, 1.0); - // z component of normal vector in world coordinate used for slope shading - world_normal_z = slope.actived ? (normalize(slope.volume_world_normal_matrix * v_normal)).z : 0.0; + // dot product of world normal with up direction, used for slope shading + world_normal_z = slope.actived ? dot(normalize(slope.volume_world_normal_matrix * v_normal), slope.up_direction) : 0.0; gl_Position = projection_matrix * position; // Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded. diff --git a/resources/shaders/110/mm_gouraud.fs b/resources/shaders/110/mm_gouraud.fs index 821af13f03..431c936e9c 100644 --- a/resources/shaders/110/mm_gouraud.fs +++ b/resources/shaders/110/mm_gouraud.fs @@ -37,6 +37,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform SlopeDetection slope; @@ -85,7 +86,7 @@ void main() color = LightBlue; alpha = 1.0; } - else if( transformed_normal.z < slope.normal_z - EPSILON) + else if( dot(transformed_normal, slope.up_direction) < slope.normal_z - EPSILON) { color = color * 0.5 + LightRed * 0.5; alpha = 1.0; diff --git a/resources/shaders/110/mm_gouraud.vs b/resources/shaders/110/mm_gouraud.vs index b0cea9cfd6..c54ae4bff5 100644 --- a/resources/shaders/110/mm_gouraud.vs +++ b/resources/shaders/110/mm_gouraud.vs @@ -24,6 +24,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform SlopeDetection slope; void main() diff --git a/resources/shaders/140/gouraud.fs b/resources/shaders/140/gouraud.fs index bbfb76f7a1..0d9fa021fe 100644 --- a/resources/shaders/140/gouraud.fs +++ b/resources/shaders/140/gouraud.fs @@ -26,6 +26,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform vec4 uniform_color; diff --git a/resources/shaders/140/gouraud.vs b/resources/shaders/140/gouraud.vs index 72dd4ff1bf..c69dcd11df 100644 --- a/resources/shaders/140/gouraud.vs +++ b/resources/shaders/140/gouraud.vs @@ -23,6 +23,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform mat4 view_model_matrix; @@ -71,8 +72,8 @@ void main() // Point in homogenous coordinates. world_pos = volume_world_matrix * vec4(v_position, 1.0); - // z component of normal vector in world coordinate used for slope shading - world_normal_z = slope.actived ? (normalize(slope.volume_world_normal_matrix * v_normal)).z : 0.0; + // dot product of world normal with up direction, used for slope shading + world_normal_z = slope.actived ? dot(normalize(slope.volume_world_normal_matrix * v_normal), slope.up_direction) : 0.0; gl_Position = projection_matrix * position; // Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded. diff --git a/resources/shaders/140/mm_gouraud.fs b/resources/shaders/140/mm_gouraud.fs index c5fe86efc5..7c77d5565e 100644 --- a/resources/shaders/140/mm_gouraud.fs +++ b/resources/shaders/140/mm_gouraud.fs @@ -37,6 +37,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform SlopeDetection slope; @@ -87,7 +88,7 @@ void main() color = LightBlue; alpha = 1.0; } - else if( transformed_normal.z < slope.normal_z - EPSILON) + else if( dot(transformed_normal, slope.up_direction) < slope.normal_z - EPSILON) { color = color * 0.5 + LightRed * 0.5; alpha = 1.0; diff --git a/resources/shaders/140/mm_gouraud.vs b/resources/shaders/140/mm_gouraud.vs index b191e35fa8..191613f957 100644 --- a/resources/shaders/140/mm_gouraud.vs +++ b/resources/shaders/140/mm_gouraud.vs @@ -24,6 +24,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform SlopeDetection slope; void main() diff --git a/src/libslic3r/ExPolygon.hpp b/src/libslic3r/ExPolygon.hpp index 87a1146d41..7a51f70ef7 100644 --- a/src/libslic3r/ExPolygon.hpp +++ b/src/libslic3r/ExPolygon.hpp @@ -377,6 +377,11 @@ inline void translate(ExPolygons &expolys, const Point &p) { expoly.translate(p); } +inline void translate(Polygons &polys, const Point &p) { + for (Polygon &poly : polys) + poly.translate(p); +} + inline void polygons_append(Polygons &dst, const ExPolygon &src) { dst.reserve(dst.size() + src.holes.size() + 1); diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 826d8a1a19..ef2c83b13c 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1010,7 +1010,7 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", - "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "gcode_flavor", + "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "gcode_flavor", "fan_kickstart", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", "printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 50be57e0f8..918fc1b97f 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -5918,6 +5918,30 @@ void PrintConfigDef::init_fff_params() def->mode = comSimple; def->set_default_value(new ConfigOptionFloatOrPercent(50., true)); + def = this->add("build_plate_tilt_x", coFloat); + def->label = L("Build plate tilt X"); + def->category = L("Support"); + def->tooltip = L("Tilt angle of the build plate along the X axis. " + "A positive value tilts the plate so the +X side is higher, shifting gravity toward -X and increasing overhangs on the +X side. " + "A negative value tilts the -X side higher. Set to 0 for no X-axis tilt."); + def->sidetext = u8"\u00B0"; + def->min = -45; + def->max = 45; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.)); + + def = this->add("build_plate_tilt_y", coFloat); + def->label = L("Build plate tilt Y"); + def->category = L("Support"); + def->tooltip = L("Tilt angle of the build plate along the Y axis. " + "A positive value tilts the plate so the +Y side is higher, shifting gravity toward -Y and increasing overhangs on the +Y side. " + "A negative value tilts the -Y side higher. Set to 0 for no Y-axis tilt."); + def->sidetext = u8"\u00B0"; + def->min = -45; + def->max = 45; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("tree_support_branch_angle", coFloat); def->label = L("Tree support branch angle"); def->category = L("Support"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 54c26c312a..c862956544 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1410,6 +1410,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( PrintConfig, (MachineEnvelopeConfig, GCodeConfig), + // Build plate tilt for off-axis gravity support generation (printer-level setting). + ((ConfigOptionFloat, build_plate_tilt_x)) + ((ConfigOptionFloat, build_plate_tilt_y)) //BBS ((ConfigOptionInts, additional_cooling_fan_speed)) ((ConfigOptionBool, reduce_crossing_wall)) diff --git a/src/libslic3r/Support/SupportMaterial.cpp b/src/libslic3r/Support/SupportMaterial.cpp index d1fa5d8627..c230924ac8 100644 --- a/src/libslic3r/Support/SupportMaterial.cpp +++ b/src/libslic3r/Support/SupportMaterial.cpp @@ -1392,6 +1392,10 @@ static inline ExPolygons detect_overhangs( const double threshold_rad = Geometry::deg2rad(thresh_angle); const bool bridge_no_support = object_config.bridge_no_support.value; const coordf_t xy_expansion = scale_(object_config.support_expansion.value); + // Build plate tilt: compute per-layer XY shift for tilted gravity direction + const double tilt_x_rad = Geometry::deg2rad(print_config.build_plate_tilt_x.value); + const double tilt_y_rad = Geometry::deg2rad(print_config.build_plate_tilt_y.value); + const bool has_tilt = std::abs(tilt_x_rad) > EPSILON || std::abs(tilt_y_rad) > EPSILON; float lower_layer_offset = 0; if (layer_id == 0) @@ -1441,9 +1445,17 @@ static inline ExPolygons detect_overhangs( // Overhang polygons for this layer and region. Polygons diff_polygons; Polygons layerm_polygons = to_polygons(layerm->slices.surfaces); + // Apply build plate tilt: shift lower layer polygons to simulate tilted gravity + Polygons effective_lower = lower_layer_polygons; + if (has_tilt) { + const double lh = lower_layer.height; + Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), + coord_t(scale_(lh * tan(tilt_x_rad)))); + translate(effective_lower, tilt_shift); + } if (lower_layer_offset == 0.f) { // Support everything. - diff_polygons = diff(layerm_polygons, lower_layer_polygons); + diff_polygons = diff(layerm_polygons, effective_lower); if (buildplate_only) { // Don't support overhangs above the top surfaces. // This step is done before the contact surface is calculated by growing the overhang region. @@ -1452,9 +1464,9 @@ static inline ExPolygons detect_overhangs( } else if (auto_normal_support) { // Get the regions needing a suport, collapse very tiny spots. //FIXME cache the lower layer offset if this layer has multiple regions. - diff_polygons = + diff_polygons = diff(layerm_polygons, - expand(lower_layer_polygons, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS)); + expand(effective_lower, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS)); if (buildplate_only && ! annotations.buildplate_covered[layer_id].empty()) { // Don't support overhangs above the top surfaces. // This step is done before the contact surface is calculated by growing the overhang region. @@ -1462,9 +1474,9 @@ static inline ExPolygons detect_overhangs( } if (! diff_polygons.empty()) { // Offset the support regions back to a full overhang, restrict them to the full overhang. - // This is done to increase size of the supporting columns below, as they are calculated by + // This is done to increase size of the supporting columns below, as they are calculated by // propagating these contact surfaces downwards. - diff_polygons = diff(intersection(expand(diff_polygons, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS), layerm_polygons), lower_layer_polygons); + diff_polygons = diff(intersection(expand(diff_polygons, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS), layerm_polygons), effective_lower); } //FIXME add user defined filtering here based on minimal area or minimum radius or whatever. diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 50272009cd..864a0eb0e0 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -671,6 +671,11 @@ void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) double thresh_angle = config.support_threshold_angle.value > EPSILON ? config.support_threshold_angle.value + 1 : 30; thresh_angle = std::min(thresh_angle, 89.); // should be smaller than 90 const double threshold_rad = Geometry::deg2rad(thresh_angle); + // Build plate tilt: compute per-layer XY shift for tilted gravity direction + const PrintConfig& print_cfg = m_object->print()->config(); + const double tilt_x_rad = Geometry::deg2rad(print_cfg.build_plate_tilt_x.value); + const double tilt_y_rad = Geometry::deg2rad(print_cfg.build_plate_tilt_y.value); + const bool has_tilt = std::abs(tilt_x_rad) > EPSILON || std::abs(tilt_y_rad) > EPSILON; // FIXME this is a fudge constant! double support_tree_tip_diameter = 0.8; auto enforcer_overhang_offset = scaled(support_tree_tip_diameter); @@ -813,8 +818,19 @@ void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) ExPolygons& curr_polys = layer->lslices_extrudable; ExPolygons& lower_polys = lower_layer->lslices_extrudable; + // Apply build plate tilt: shift lower layer polygons to simulate tilted gravity + ExPolygons shifted_lower; + if (has_tilt) { + shifted_lower = lower_polys; // copy + const double lh = lower_layer->height; + Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), + coord_t(scale_(lh * tan(tilt_x_rad)))); + translate(shifted_lower, tilt_shift); + } + const ExPolygons &effective_lower = has_tilt ? shifted_lower : lower_polys; + // normal overhang - ExPolygons lower_layer_offseted = offset_ex(lower_polys, support_offset_scaled, SUPPORT_SURFACES_OFFSET_PARAMETERS); + ExPolygons lower_layer_offseted = offset_ex(effective_lower, support_offset_scaled, SUPPORT_SURFACES_OFFSET_PARAMETERS); overhangs_all_layers[layer_nr] = std::move(diff_ex(curr_polys, lower_layer_offseted)); double duration{ std::chrono::duration_cast(clock_::now() - t0).count() }; diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index 307e4d314d..2c24b933b2 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -208,6 +208,10 @@ static std::vector>> group_me const bool support_threshold_auto = support_threshold == 0; // +1 makes the threshold inclusive double tan_threshold = support_threshold_auto ? 0. : tan(M_PI * double(support_threshold + 1) / 180.); + // Build plate tilt: compute per-layer XY shift for tilted gravity direction + const double tilt_x_rad = Geometry::deg2rad(print_config.build_plate_tilt_x.value); + const double tilt_y_rad = Geometry::deg2rad(print_config.build_plate_tilt_y.value); + const bool has_tilt = std::abs(tilt_x_rad) > EPSILON || std::abs(tilt_y_rad) > EPSILON; //FIXME this is a fudge constant! auto enforcer_overhang_offset = scaled(config.tree_support_tip_diameter.value); const coordf_t radius_sample_resolution = g_config_tree_support_collision_resolution; @@ -229,7 +233,7 @@ static std::vector>> group_me size_t num_overhang_layers = support_auto ? num_object_layers : std::min(num_object_layers, std::max(size_t(support_enforce_layers), enforcers_layers.size())); tbb::parallel_for(tbb::blocked_range(1, num_overhang_layers), [&print_object, &config, &print_config, &enforcers_layers, &blockers_layers, - support_auto, support_enforce_layers, support_threshold_auto, tan_threshold, enforcer_overhang_offset, num_raft_layers, radius_sample_resolution, &throw_on_cancel, &out] + support_auto, support_enforce_layers, support_threshold_auto, tan_threshold, enforcer_overhang_offset, num_raft_layers, radius_sample_resolution, has_tilt, tilt_x_rad, tilt_y_rad, &throw_on_cancel, &out] (const tbb::blocked_range &range) { for (LayerIndex layer_id = range.begin(); layer_id < range.end(); ++ layer_id) { const Layer ¤t_layer = *print_object.get_layer(layer_id); @@ -253,7 +257,15 @@ static std::vector>> group_me lower_layer_offset = external_perimeter_width - float(scale_(config.support_threshold_overlap.get_abs_value(unscale_(external_perimeter_width)))); } else lower_layer_offset = scaled(lower_layer.height / tan_threshold); - Polygons lower_layer_offseted = offset(lower_layer.lslices_extrudable, lower_layer_offset); + // Apply build plate tilt: shift lower layer polygons to simulate tilted gravity + Polygons lower_src = to_polygons(lower_layer.lslices_extrudable); + if (has_tilt) { + const double lh = lower_layer.height; + Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), + coord_t(scale_(lh * tan(tilt_x_rad)))); + translate(lower_src, tilt_shift); + } + Polygons lower_layer_offseted = offset(lower_src, lower_layer_offset); overhangs = diff(current_layer.lslices_extrudable, lower_layer_offseted); if (lower_layer_offset == 0) { raw_overhangs = overhangs; diff --git a/src/libslic3r/TriangleSelector.cpp b/src/libslic3r/TriangleSelector.cpp index a6d19f505c..695ac4c2ba 100644 --- a/src/libslic3r/TriangleSelector.cpp +++ b/src/libslic3r/TriangleSelector.cpp @@ -233,7 +233,7 @@ int TriangleSelector::select_unsplit_triangle(const Vec3f &hit, int facet_idx) c return this->select_unsplit_triangle(hit, facet_idx, neighbors); } -void TriangleSelector::select_patch(int facet_start, std::unique_ptr &&cursor, EnforcerBlockerType new_state, const Transform3d& trafo_no_translate, bool triangle_splitting, float highlight_by_angle_deg) +void TriangleSelector::select_patch(int facet_start, std::unique_ptr &&cursor, EnforcerBlockerType new_state, const Transform3d& trafo_no_translate, bool triangle_splitting, float highlight_by_angle_deg, const Vec3f &up_direction) { assert(facet_start < m_orig_size_indices); @@ -294,8 +294,8 @@ void TriangleSelector::select_patch(int facet_start, std::unique_ptr &&c int facet = facets_to_check[facet_idx]; const Vec3f& facet_normal = m_face_normals[m_triangles[facet].source_triangle]; Matrix3f normal_matrix = static_cast(trafo_no_translate.matrix().block(0, 0, 3, 3).inverse().transpose().cast()); - float world_normal_z = (normal_matrix* facet_normal).normalized().z(); - if (!visited[facet] && (highlight_by_angle_deg == 0.f || world_normal_z < highlight_angle_limit)) { + float world_normal_dot = (normal_matrix * facet_normal).normalized().dot(up_direction); + if (!visited[facet] && (highlight_by_angle_deg == 0.f || world_normal_dot < highlight_angle_limit)) { if (select_triangle(facet, new_state, triangle_splitting)) { // add neighboring facets to list to be processed later for (int neighbor_idx : m_neighbors[facet]) @@ -320,7 +320,7 @@ bool TriangleSelector::is_facet_clipped(int facet_idx, const ClippingPlane &clp) void TriangleSelector::seed_fill_select_triangles(const Vec3f &hit, int facet_start, const Transform3d& trafo_no_translate, const ClippingPlane &clp, float seed_fill_angle, float highlight_by_angle_deg, - bool force_reselection) + bool force_reselection, const Vec3f &up_direction) { assert(facet_start < m_orig_size_indices); @@ -344,8 +344,8 @@ void TriangleSelector::seed_fill_select_triangles(const Vec3f &hit, int facet_st const Vec3f &facet_normal = m_face_normals[m_triangles[current_facet].source_triangle]; Matrix3f normal_matrix = static_cast(trafo_no_translate.matrix().block(0, 0, 3, 3).inverse().transpose().cast()); - float world_normal_z = (normal_matrix * facet_normal).normalized().z(); - if (!visited[current_facet] && (highlight_by_angle_deg == 0.f || world_normal_z < highlight_angle_limit)) { + float world_normal_dot = (normal_matrix * facet_normal).normalized().dot(up_direction); + if (!visited[current_facet] && (highlight_by_angle_deg == 0.f || world_normal_dot < highlight_angle_limit)) { if (m_triangles[current_facet].is_split()) { for (int split_triangle_idx = 0; split_triangle_idx <= m_triangles[current_facet].number_of_split_sides(); ++split_triangle_idx) { assert(split_triangle_idx < int(m_triangles[current_facet].children.size())); diff --git a/src/libslic3r/TriangleSelector.hpp b/src/libslic3r/TriangleSelector.hpp index 50bbdd4ed0..5b20647b84 100644 --- a/src/libslic3r/TriangleSelector.hpp +++ b/src/libslic3r/TriangleSelector.hpp @@ -308,7 +308,8 @@ public: EnforcerBlockerType new_state, // enforcer or blocker? const Transform3d &trafo_no_translate, // matrix to get from mesh to world without translation bool triangle_splitting, // If triangles will be split base on the cursor or not - float highlight_by_angle_deg = 0.f); // The maximal angle of overhang. If it is set to a non-zero value, it is possible to paint only the triangles of overhang defined by this angle in degrees. + float highlight_by_angle_deg = 0.f, // The maximal angle of overhang. If it is set to a non-zero value, it is possible to paint only the triangles of overhang defined by this angle in degrees. + const Vec3f &up_direction = Vec3f::UnitZ()); // Up direction for overhang detection (accounts for build plate tilt) void seed_fill_select_triangles(const Vec3f &hit, // point where to start int facet_start, // facet of the original mesh (unsplit) that the hit point belongs to @@ -316,7 +317,8 @@ public: const ClippingPlane &clp, // Clipping plane to limit painting to not clipped facets only float seed_fill_angle, // the maximal angle between two facets to be painted by the same color float highlight_by_angle_deg = 0.f, // The maximal angle of overhang. If it is set to a non-zero value, it is possible to paint only the triangles of overhang defined by this angle in degrees. - bool force_reselection = false); // force reselection of the triangle mesh even in cases that mouse is pointing on the selected triangle + bool force_reselection = false, // force reselection of the triangle mesh even in cases that mouse is pointing on the selected triangle + const Vec3f &up_direction = Vec3f::UnitZ()); // Up direction for overhang detection (accounts for build plate tilt) void bucket_fill_select_triangles(const Vec3f &hit, // point where to start int facet_start, // facet of the original mesh (unsplit) that the hit point belongs to diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 544a3f8f12..3f5cd306ad 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -394,6 +394,8 @@ void Bed3D::render_internal(GLCanvas3D& canvas, const Transform3d& view_matrix, case Type::Custom: { render_custom(canvas, view_matrix, projection_matrix, bottom); break; } } + render_gravity_arrow(view_matrix, projection_matrix); + glsafe(::glDisable(GL_DEPTH_TEST)); } @@ -731,6 +733,63 @@ void Bed3D::render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, co render_texture(bottom, canvas);*/ } +void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix) +{ + const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; + double tilt_x_deg = cfg.opt_float("build_plate_tilt_x"); + double tilt_y_deg = cfg.opt_float("build_plate_tilt_y"); + if (tilt_x_deg == 0. && tilt_y_deg == 0.) { + m_gravity_arrow.reset(); + return; + } + + // Gravity direction (matching the slicer's tilt convention) + double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); + double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); + Vec3d gravity_dir = Vec3d(-tan(tilt_y_rad), -tan(tilt_x_rad), -1.0).normalized(); + + // Build the arrow model (same dimensions as the axis arrows) + if (!m_gravity_arrow.is_initialized()) { + const float stem_length = Axes::DefaultStemLength; + const float tip_radius = Axes::DefaultTipRadius; + const float tip_length = Axes::DefaultTipLength; + const float stem_radius = stem_length / 75.f; // same ratio as axis cylinders + m_gravity_arrow.init_from(stilized_arrow(16, tip_radius, tip_length, stem_radius, stem_length)); + } + + // The arrow model points along +Z by default. Compute rotation to align with gravity_dir. + // Rotation axis = cross(+Z, gravity_dir), angle = acos(dot(+Z, gravity_dir)) + Vec3d from = Vec3d::UnitZ(); + Vec3d to = gravity_dir; + double dot = from.dot(to); + Transform3d rot = Transform3d::Identity(); + if (dot < -0.9999) { + // Nearly opposite — rotate 180° around X + rot = Eigen::AngleAxisd(M_PI, Vec3d::UnitX()) * rot; + } else if (dot < 0.9999) { + Vec3d axis = from.cross(to).normalized(); + double angle = std::acos(std::clamp(dot, -1.0, 1.0)); + rot = Eigen::AngleAxisd(angle, axis) * rot; + } + + GLShaderProgram* shader = wxGetApp().get_shader("flat"); + if (shader == nullptr) + return; + + glsafe(::glEnable(GL_DEPTH_TEST)); + shader->start_using(); + + const Camera& camera = wxGetApp().plater()->get_camera(); + Transform3d model_matrix = rot; + shader->set_uniform("view_model_matrix", camera.get_view_matrix() * model_matrix); + shader->set_uniform("projection_matrix", camera.get_projection_matrix()); + + m_gravity_arrow.set_color({ 1.0f, 0.85f, 0.0f, 1.0f }); // yellow + m_gravity_arrow.render(); + + shader->stop_using(); +} + void Bed3D::render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix) { // m_texture.reset(); diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index b791635fd3..b16ead575b 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -110,6 +110,7 @@ private: //GLTexture m_temp_texture; GLModel m_model; Vec3d m_model_offset{ Vec3d::Zero() }; + GLModel m_gravity_arrow; Axes m_axes; float m_scale_factor{ 1.0f }; @@ -177,7 +178,8 @@ private: void render_model(const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom); void render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix); - + void render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix); + // BBS: remove the bed picking logic // void register_raycasters_for_picking(const GLModel::Geometry& geometry, const Transform3d& trafo); }; diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index e23efc7fbd..5caf6a4e0d 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -1078,13 +1078,27 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool enable_support; int support_threshold_angle = get_selection_support_threshold_angle(enable_support); - + float normal_z = -::cos(Geometry::deg2rad((float) support_threshold_angle)); - + + // Compute up direction accounting for build plate tilt + Vec3f up_direction = Vec3f::UnitZ(); + { + const DynamicPrintConfig& prt_cfg = GUI::wxGetApp().preset_bundle->printers.get_edited_preset().config; + double tilt_x_deg = prt_cfg.opt_float("build_plate_tilt_x"); + double tilt_y_deg = prt_cfg.opt_float("build_plate_tilt_y"); + if (tilt_x_deg != 0. || tilt_y_deg != 0.) { + double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); + double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); + up_direction = Vec3f(float(tan(tilt_y_rad)), float(tan(tilt_x_rad)), 1.f).normalized(); + } + } + shader->set_uniform("volume_world_matrix", volume.first->world_matrix()); shader->set_uniform("slope.actived", m_slope.isGlobalActive && !volume.first->is_modifier && !volume.first->is_wipe_tower); shader->set_uniform("slope.volume_world_normal_matrix", static_cast(volume.first->world_matrix().matrix().block(0, 0, 3, 3).inverse().transpose().cast())); shader->set_uniform("slope.normal_z", normal_z); + shader->set_uniform("slope.up_direction", up_direction); #if ENABLE_ENVIRONMENT_MAP unsigned int environment_texture_id = GUI::wxGetApp().plater()->get_environment_texture_id(); diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 9486bed67a..47e6246509 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -64,6 +64,7 @@ static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_FFF = { L("Support") , { "enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap", "support_base_pattern", "support_on_build_plate_only","support_critical_regions_only", "support_remove_small_overhang", + "build_plate_tilt_x", "build_plate_tilt_y", "support_base_pattern_spacing", "support_expansion"}}, //BBS { L("Flush options") , { "flush_into_infill", "flush_into_objects", "flush_into_support"} } @@ -94,7 +95,8 @@ std::map> SettingsFactory::OBJECT_C {"support_bottom_z_distance", "",19},{"support_top_z_distance", "",20},{"support_base_pattern", "",21},{"support_base_pattern_spacing", "",22}, {"support_interface_top_layers", "",23},{"support_interface_bottom_layers", "",24},{"support_interface_spacing", "",25},{"support_bottom_interface_spacing", "",26}, {"support_object_xy_distance", "",27}, {"bridge_no_support", "",28},{"max_bridge_length", "",29},{"support_critical_regions_only", "",30},{"support_remove_small_overhang","",31}, - {"support_object_first_layer_gap","",32} + {"build_plate_tilt_x","",32},{"build_plate_tilt_y","",33}, + {"support_object_first_layer_gap","",34} }}, { L("Speed"), {{"support_speed", "",12}, {"support_interface_speed", "",13} }} diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index 02f1b4be5f..88781f6006 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -537,6 +537,14 @@ int GLGizmoFdmSupports::get_selection_support_threshold_angle() return auto_support ? support_threshold_angle : 0; } +std::pair GLGizmoFdmSupports::get_build_plate_tilt() +{ + const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; + double tilt_x = cfg.opt_float("build_plate_tilt_x"); + double tilt_y = cfg.opt_float("build_plate_tilt_y"); + return {tilt_x, tilt_y}; +} + void GLGizmoFdmSupports::select_facets_by_angle(float threshold_deg, bool block) { float threshold = (float(M_PI)/180.f)*threshold_deg; @@ -544,6 +552,12 @@ void GLGizmoFdmSupports::select_facets_by_angle(float threshold_deg, bool block) const ModelObject* mo = m_c->selection_info()->model_object(); const ModelInstance* mi = mo->instances[selection.get_instance_idx()]; + // Compute gravity direction accounting for build plate tilt + auto [tilt_x_deg, tilt_y_deg] = get_build_plate_tilt(); + double tilt_x_rad = tilt_x_deg * M_PI / 180.0; + double tilt_y_rad = tilt_y_deg * M_PI / 180.0; + Vec3d gravity_dir = Vec3d(-tan(tilt_y_rad), -tan(tilt_x_rad), -1.0).normalized(); + int mesh_id = -1; for (const ModelVolume* mv : mo->volumes) { if (! mv->is_model_part()) @@ -552,10 +566,8 @@ void GLGizmoFdmSupports::select_facets_by_angle(float threshold_deg, bool block) ++mesh_id; const Transform3d trafo_matrix = mi->get_matrix_no_offset() * mv->get_matrix_no_offset(); - Vec3f down = (trafo_matrix.inverse() * (-Vec3d::UnitZ())).cast().normalized(); - Vec3f limit = (trafo_matrix.inverse() * Vec3d(std::sin(threshold), 0, -std::cos(threshold))).cast().normalized(); - - float dot_limit = limit.dot(down); + Vec3f down = (trafo_matrix.inverse() * gravity_dir).cast().normalized(); + float dot_limit = std::cos(threshold); // Now calculate dot product of vert_direction and facets' normals. int idx = 0; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp index ec0faeab80..0afdba7f19 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp @@ -59,6 +59,7 @@ private: void select_facets_by_angle(float threshold, bool block); // BBS int get_selection_support_threshold_angle(); + std::pair get_build_plate_tilt(); int m_support_threshold_angle = -1; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp index 7d3f40bd12..71e4c45f4a 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp @@ -73,6 +73,18 @@ GLGizmoPainterBase::ClippingPlaneDataWrapper GLGizmoPainterBase::get_clipping_pl return clp_data_out; } +Vec3f GLGizmoPainterBase::get_tilt_up_direction() const +{ + const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; + double tilt_x_deg = cfg.opt_float("build_plate_tilt_x"); + double tilt_y_deg = cfg.opt_float("build_plate_tilt_y"); + if (tilt_x_deg == 0. && tilt_y_deg == 0.) + return Vec3f::UnitZ(); + double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); + double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); + return Vec3f(float(tan(tilt_y_rad)), float(tan(tilt_x_rad)), 1.f).normalized(); +} + void GLGizmoPainterBase::render_triangles(const Selection& selection) const { auto* shader = wxGetApp().get_shader("mm_gouraud"); @@ -119,11 +131,15 @@ void GLGizmoPainterBase::render_triangles(const Selection& selection) const float normal_z = -::cos(Geometry::deg2rad(m_highlight_by_angle_threshold_deg)); Matrix3f normal_matrix = static_cast(trafo_matrix.matrix().block(0, 0, 3, 3).inverse().transpose().cast()); + // Compute up direction accounting for build plate tilt + Vec3f up_direction = get_tilt_up_direction(); + shader->set_uniform("volume_world_matrix", trafo_matrix); shader->set_uniform("volume_mirrored", is_left_handed); shader->set_uniform("slope.actived", m_parent.is_using_slope()); shader->set_uniform("slope.volume_world_normal_matrix", normal_matrix); shader->set_uniform("slope.normal_z", normal_z); + shader->set_uniform("slope.up_direction", up_direction); m_triangle_selectors[mesh_id]->render(m_imgui, trafo_matrix); if (is_left_handed) @@ -691,7 +707,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous mi->get_assemble_transformation().get_matrix() * mo->volumes[m_rr.mesh_id]->get_matrix() : mi->get_transformation().get_matrix() * mo->volumes[m_rr.mesh_id]->get_matrix(); m_triangle_selectors[m_rr.mesh_id]->seed_fill_select_triangles(m_rr.hit, int(m_rr.facet), trafo_matrix_not_translate, this->get_clipping_plane_in_volume_coordinates(trafo_matrix), m_smart_fill_angle, - m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, true); + m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, true, get_tilt_up_direction()); m_triangle_selectors[m_rr.mesh_id]->request_update_render_data(); m_seed_fill_last_mesh_id = m_rr.mesh_id; } @@ -803,7 +819,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous std::unique_ptr cursor = TriangleSelector::SinglePointCursor::cursor_factory(phr.z_world, camera_pos, m_cursor_height, trafo_matrix, clp); m_triangle_selectors[mesh_idx]->select_patch(int(phr.first_facet_idx), std::move(cursor), new_state, trafo_matrix_not_translate, - m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f); + m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, get_tilt_up_direction()); m_triangle_selectors[mesh_idx]->request_update_render_data(true); m_last_mouse_click = _mouse_position; @@ -855,7 +871,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous m_triangle_selectors[mesh_idx]->seed_fill_apply_on_triangles(new_state); if (m_tool_type == ToolType::SMART_FILL) m_triangle_selectors[mesh_idx]->seed_fill_select_triangles(mesh_hit, facet_idx, trafo_matrix_not_translate, clp, m_smart_fill_angle, - m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, true); + m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, true, get_tilt_up_direction()); else if (m_tool_type == ToolType::BRUSH && m_cursor_type == TriangleSelector::CursorType::POINTER) // BBS: add infill_angle parameter m_triangle_selectors[mesh_idx]->bucket_fill_select_triangles(mesh_hit, facet_idx, clp, -1.f, false, true); @@ -874,12 +890,12 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous camera_pos, m_cursor_radius, m_cursor_type, trafo_matrix, clp); m_triangle_selectors[mesh_idx]->select_patch(int(first_position.facet_idx), std::move(cursor), new_state, trafo_matrix_not_translate, - m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f); + m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, get_tilt_up_direction()); } else { for (auto first_position_it = projected_mouse_positions.cbegin(); first_position_it != projected_mouse_positions.cend() - 1; ++first_position_it) { auto second_position_it = first_position_it + 1; std::unique_ptr cursor = TriangleSelector::DoublePointCursor::cursor_factory(first_position_it->mesh_hit, second_position_it->mesh_hit, camera_pos, m_cursor_radius, m_cursor_type, trafo_matrix, clp); - m_triangle_selectors[mesh_idx]->select_patch(int(first_position_it->facet_idx), std::move(cursor), new_state, trafo_matrix_not_translate, m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f); + m_triangle_selectors[mesh_idx]->select_patch(int(first_position_it->facet_idx), std::move(cursor), new_state, trafo_matrix_not_translate, m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, get_tilt_up_direction()); } } } @@ -953,7 +969,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous const TriangleSelector::ClippingPlane &clp = this->get_clipping_plane_in_volume_coordinates(trafo_matrix); if (m_tool_type == ToolType::SMART_FILL) m_triangle_selectors[m_rr.mesh_id]->seed_fill_select_triangles(m_rr.hit, int(m_rr.facet), trafo_matrix_not_translate, clp, m_smart_fill_angle, - m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f); + m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, false, get_tilt_up_direction()); else if (m_tool_type == ToolType::BRUSH && m_cursor_type == TriangleSelector::CursorType::POINTER) // BBS: add infill_angle parameter m_triangle_selectors[m_rr.mesh_id]->bucket_fill_select_triangles(m_rr.hit, int(m_rr.facet), clp, -1.f, false); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp index 5fc1a9e18f..9dbed7df7e 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp @@ -281,6 +281,9 @@ protected: bool m_paint_on_overhangs_only = false; float m_highlight_by_angle_threshold_deg = 0.f; + // Returns the up direction accounting for build plate tilt (default: UnitZ) + Vec3f get_tilt_up_direction() const; + GLModel m_circle; Vec2d m_old_center{ Vec2d::Zero() }; float m_old_cursor_radius{ 0.0f }; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index c94fd1c7a4..6ac8ca9a0e 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4364,6 +4364,8 @@ void TabPrinter::build_fff() optgroup->append_single_option_line(option, "printer_basic_information_printable_space#excluded-bed-area"); // optgroup->append_single_option_line("printable_area"); optgroup->append_single_option_line("printable_height", "printer_basic_information_printable_space#printable-height"); + optgroup->append_single_option_line("build_plate_tilt_x"); + optgroup->append_single_option_line("build_plate_tilt_y"); optgroup->append_single_option_line("support_multi_bed_types","printer_basic_information_printable_space#support-multi-bed-types"); optgroup->append_single_option_line("best_object_pos", "printer_basic_information_printable_space#best-object-position"); // todo: for multi_extruder test From ed6ea086a26fa0b45db5d1faaedea01a5e190753 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 11 Mar 2026 03:58:52 -0500 Subject: [PATCH 002/389] Add belt printer transform pipeline: slicing rotation, G-code coords, preview - Implement core belt slicing pipeline: R(-alpha, X) mesh rotation in PrintObjectSlice with corrected object height calculation for proper layer count Add to_machine_coords() in GCodeWriter to convert slicing-frame coordinates back to machine-frame, propagated through GCode, GCodeProcessor, and GCodeViewer Add belt-mode UI: tilted bed visualization, slicing-direction arrow, and raw G-code toggle to switch between machine-frame and slicing-frame views This is a combination of 6 commits. checkpoint 1: initial MVP. Slicing functions, but rotates instead of skews are happening and a lot of other stuff too getting somewhere, getting to the point where I need to figure out how to verify this stuff this appears to be a dead end. getting somewhere I think maybe I'm pretty sure we've completely lost the plot at this point and need to restart this process... remove slice logic in preparation for new, more invasive plan --- result.json | 7 ++ src/libslic3r/Brim.cpp | 4 ++ src/libslic3r/BuildVolume.cpp | 25 +++++++ src/libslic3r/BuildVolume.hpp | 8 +++ src/libslic3r/GCode.cpp | 9 ++- src/libslic3r/GCode/GCodeProcessor.cpp | 10 +++ src/libslic3r/GCode/GCodeProcessor.hpp | 2 + src/libslic3r/GCodeWriter.cpp | 91 +++++++++++++++++++++----- src/libslic3r/GCodeWriter.hpp | 11 ++++ src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 20 ++++++ src/libslic3r/PrintConfig.cpp | 50 ++++++++++++-- src/libslic3r/PrintConfig.hpp | 4 ++ src/libslic3r/PrintObject.cpp | 5 +- src/libslic3r/PrintObjectSlice.cpp | 2 + src/slic3r/GUI/3DBed.cpp | 67 ++++++++++++++++++- src/slic3r/GUI/3DBed.hpp | 11 ++++ src/slic3r/GUI/ConfigManipulation.cpp | 25 +++++-- src/slic3r/GUI/GCodeViewer.cpp | 4 +- src/slic3r/GUI/GCodeViewer.hpp | 6 ++ src/slic3r/GUI/Plater.cpp | 18 +++++ src/slic3r/GUI/Tab.cpp | 25 +++++++ 22 files changed, 375 insertions(+), 31 deletions(-) create mode 100644 result.json diff --git a/result.json b/result.json new file mode 100644 index 0000000000..e309ad45a1 --- /dev/null +++ b/result.json @@ -0,0 +1,7 @@ +{ + "error_string": "Success.", + "export_time": 0, + "plate_index": 0, + "prepare_time": 0, + "return_code": 0 +} diff --git a/src/libslic3r/Brim.cpp b/src/libslic3r/Brim.cpp index 35d971a465..0534734c65 100644 --- a/src/libslic3r/Brim.cpp +++ b/src/libslic3r/Brim.cpp @@ -881,6 +881,10 @@ void make_brim(const Print& print, PrintTryCancel try_cancel, Polygons& islands_ std::vector> &objPrintVec, std::vector& printExtruders) { + // Belt printer: brim is not compatible with belt printing. + if (print.config().belt_printer.value) + return; + std::map brim_width_map; std::map brimAreaMap; std::map supportBrimAreaMap; diff --git a/src/libslic3r/BuildVolume.cpp b/src/libslic3r/BuildVolume.cpp index 3802fbc014..132794ccfe 100644 --- a/src/libslic3r/BuildVolume.cpp +++ b/src/libslic3r/BuildVolume.cpp @@ -176,6 +176,26 @@ BuildVolume::BuildVolume(const std::vector &printable_area, const double BOOST_LOG_TRIVIAL(debug) << "BuildVolume printable_area clasified as: " << this->type_name(); } +void BuildVolume::set_belt_printer(bool enabled, double angle_deg, bool infinite_y) +{ + m_is_belt_printer = enabled; + m_belt_angle = angle_deg; + m_belt_infinite_y = infinite_y; + + if (enabled) { + if (infinite_y) { + // Extend the Y bound to a very large value for infinite belt. + m_bboxf.max.y() = 100000.; + } + // Adjust max print height to diagonal reach: printable_height / sin(belt_angle). + if (angle_deg > 0. && angle_deg < 90.) { + double sin_a = std::sin(angle_deg * M_PI / 180.0); + if (sin_a > 0.) + m_bboxf.max.z() = m_max_print_height / sin_a; + } + } +} + #if 0 // Tests intersections of projected triangles, not just their vertices against a bounding box. // This test also correctly evaluates collision of a non-convex object with the bounding box. @@ -384,6 +404,11 @@ BuildVolume::ObjectState BuildVolume::object_state(const indexed_triangle_set& i build_volume.max.z() = std::numeric_limits::max(); if (ignore_bottom) build_volume.min.z() = -std::numeric_limits::max(); + // Belt printer: extend Y bounds for infinite Y. + if (m_is_belt_printer && m_belt_infinite_y) { + build_volume.min.y() = -std::numeric_limits::max(); + build_volume.max.y() = std::numeric_limits::max(); + } BoundingBox3Base build_volumef(build_volume.min.cast(), build_volume.max.cast()); // The following test correctly interprets intersection of a non-convex object with a rectangular build volume. //return rectangle_test(its, trafo, to_2d(build_volume.min), to_2d(build_volume.max), build_volume.max.z()); diff --git a/src/libslic3r/BuildVolume.hpp b/src/libslic3r/BuildVolume.hpp index 6f53fdd704..0494efe9ba 100644 --- a/src/libslic3r/BuildVolume.hpp +++ b/src/libslic3r/BuildVolume.hpp @@ -57,6 +57,10 @@ public: // Initialize from PrintConfig::printable_area and PrintConfig::printable_height BuildVolume(const std::vector &printable_area, const double printable_height, const std::vector> &extruder_areas, const std::vector& extruder_printable_heights); + // Belt printer configuration. + void set_belt_printer(bool enabled, double angle_deg, bool infinite_y); + bool is_belt_printer() const { return m_is_belt_printer; } + // Source data, unscaled coordinates. const std::vector& printable_area() const { return m_bed_shape; } double printable_height() const { return m_max_print_height; } @@ -139,6 +143,10 @@ private: // Source definition of the print volume height (PrintConfig::printable_height) double m_max_print_height { 0.f }; std::vector m_extruder_printable_height; + // Belt printer state. + bool m_is_belt_printer { false }; + double m_belt_angle { 0. }; + bool m_belt_infinite_y { false }; // Derived values. BuildVolume_Type m_type { BuildVolume_Type::Invalid }; diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index fe10cbcd41..bff35d321c 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2413,6 +2413,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_writer.set_is_bbl_machine(is_bbl_printers); + // Belt printer: initialize coordinate transformation on the writer. + if (print.config().belt_printer.value) + m_writer.set_belt_angle(print.config().belt_printer_angle.value); + // How many times will be change_layer() called? // change_layer() in turn increments the progress bar status. m_layer_count = 0; @@ -2502,6 +2506,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format("; HEADER_BLOCK_START\n"); // Write information on the generator. file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str()); + // Belt printer: embed angle in header for G-code processor detection. + if (print.config().belt_printer.value) + file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); //BBS: total layer number @@ -6704,7 +6711,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } // BBS: use G1 if not enable arc fitting or has no arc fitting result or in spiral_mode mode or we are doing sloped extrusion // Attention: G2 and G3 is not supported in spiral_mode mode - if (!m_config.enable_arc_fitting || path.polyline.fitting_result.empty() || m_config.spiral_mode || sloped != nullptr) { + if (!m_config.enable_arc_fitting || path.polyline.fitting_result.empty() || m_config.spiral_mode || sloped != nullptr || m_config.belt_printer) { double path_length = 0.; double total_length = sloped == nullptr ? 0. : path.polyline.length() * SCALING_FACTOR; for (const Line& line : path.polyline.lines()) { diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 906c2070e4..0dc00e1522 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2597,6 +2597,8 @@ void GCodeProcessor::finalize(bool post_process) } } + // Belt printer: preview coordinate transform placeholder (to be implemented in next cycle). + calculate_time(m_result); // process the time blocks @@ -3044,6 +3046,14 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers return; } + // Belt printer angle detection from G-code header comment. + if (boost::starts_with(comment, " belt_printer_angle = ")) { + try { + m_result.belt_printer_angle = std::stof(std::string(comment.substr(22))); + } catch (...) {} + return; + } + // wipe start tag if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) { m_wiping = true; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 1d72b1c614..e432a165a8 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -227,6 +227,8 @@ class Print; bool support_traditional_timelapse{true}; float printable_height; float z_offset; + // Belt printer: angle for coordinate transformation in preview. + float belt_printer_angle{ 0.f }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 1aff72daeb..1b056a946f 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -1,5 +1,6 @@ #include "GCodeWriter.hpp" #include "CustomGCode.hpp" +#include "Geometry.hpp" #include "PrintConfig.hpp" #include #include @@ -19,6 +20,19 @@ namespace Slic3r { bool GCodeWriter::full_gcode_comment = true; +void GCodeWriter::set_belt_angle(double angle_deg) +{ + m_belt_angle_rad = Geometry::deg2rad(angle_deg); + m_belt_cos = std::cos(m_belt_angle_rad); + m_belt_sin = std::sin(m_belt_angle_rad); +} + +Vec3d GCodeWriter::to_machine_coords(const Vec3d &pos) const +{ + // Belt printer: coordinate transform placeholder (to be implemented in next cycle). + return pos; +} + bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) { return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware); @@ -547,7 +561,13 @@ std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &com Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - w.emit_xy(point_on_plate); + if (is_belt_printer()) { + // Belt printer: transform to machine coordinates (XY travel also needs Z due to YZ rotation) + Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + w.emit_xyz(machine); + } else { + w.emit_xy(point_on_plate); + } auto speed = m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; w.emit_f(speed * 60.0); @@ -561,6 +581,11 @@ it will not perform subsequent lifts, even if Z was raised manually (i.e. with travel_to_z()) and thus _lifted was reduced. */ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) { + // Belt printer: force NormalLift since SpiralLift and SlopeLift compute slope angles + // that don't account for the YZ coordinate rotation. + if (is_belt_printer()) + lift_type = LiftType::NormalLift; + // check whether the above/below conditions are met double target_lift = 0; { @@ -587,8 +612,10 @@ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) } // BBS: immediately execute an undelayed lift move with a spiral lift pattern -// designed specifically for subsequent gcode injection (e.g. timelapse) +// designed specifically for subsequent gcode injection (e.g. timelapse) std::string GCodeWriter::eager_lift(const LiftType type) { + // Belt printer: force NormalLift (SpiralLift/SlopeLift don't account for YZ rotation). + const LiftType effective_type = is_belt_printer() ? LiftType::NormalLift : type; std::string lift_move; double target_lift = 0; { @@ -603,7 +630,7 @@ std::string GCodeWriter::eager_lift(const LiftType type) { // BBS: spiral lift only safe with known position // TODO: check the arc will move within bed area - if (type == LiftType::SpiralLift && this->is_current_position_clear()) { + if (effective_type == LiftType::SpiralLift && this->is_current_position_clear()) { double radius = target_lift / (2 * PI * atan(filament()->travel_slope())); // static spiral alignment when no move in x,y plane. // spiral centra is a radius distance to the right (y=0) @@ -675,6 +702,8 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co // / to make the z list early to avoid to hit some warping place when travel is long. Vec2d temp = delta_no_z.normalized() * delta(2) / tan(this->filament()->travel_slope()); Vec3d slope_top_point = Vec3d(temp(0), temp(1), delta(2)) + source; + if (is_belt_printer()) + slope_top_point = to_machine_coords(slope_top_point); GCodeG1Formatter w0; w0.emit_xyz(slope_top_point); w0.emit_f(travel_speed * 60.0); @@ -689,18 +718,27 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co std::string xy_z_move; { + Vec3d emit_target = is_belt_printer() ? to_machine_coords(target) : target; GCodeG1Formatter w0; if (this->is_current_position_clear()) { - w0.emit_xyz(target); + w0.emit_xyz(emit_target); w0.emit_f(travel_speed * 60.0); w0.emit_comment(GCodeWriter::full_gcode_comment, comment); xy_z_move = w0.string(); } else { - w0.emit_xy(Vec2d(target.x(), target.y())); - w0.emit_f(travel_speed * 60.0); - w0.emit_comment(GCodeWriter::full_gcode_comment, comment); - xy_z_move = w0.string() + _travel_to_z(target.z(), comment); + if (is_belt_printer()) { + // Belt mode: can't split XY and Z moves independently, emit full XYZ + w0.emit_xyz(emit_target); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + xy_z_move = w0.string(); + } else { + w0.emit_xy(Vec2d(target.x(), target.y())); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + xy_z_move = w0.string() + _travel_to_z(target.z(), comment); + } } } m_pos = dest_point; @@ -726,15 +764,25 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co //BBS: take plate offset into consider Vec3d point_on_plate = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; + if (is_belt_printer()) + point_on_plate = to_machine_coords(point_on_plate); std::string out_string; GCodeG1Formatter w; if (!this->is_current_position_clear()) { - //force to move xy first then z after filament change - w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); - w.emit_f(this->config.travel_speed.value * 60.0); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - out_string = w.string() + _travel_to_z(point_on_plate.z(), comment); + if (is_belt_printer()) { + // Belt mode: emit full XYZ since Y and Z are coupled + w.emit_xyz(point_on_plate); + w.emit_f(this->config.travel_speed.value * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + out_string = w.string(); + } else { + //force to move xy first then z after filament change + w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); + w.emit_f(this->config.travel_speed.value * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + out_string = w.string() + _travel_to_z(point_on_plate.z(), comment); + } } else { GCodeG1Formatter w; w.emit_xyz(point_on_plate); @@ -778,7 +826,13 @@ std::string GCodeWriter::_travel_to_z(double z, const std::string &comment) } GCodeG1Formatter w; - w.emit_z(z); + if (is_belt_printer()) { + // Belt printer: a Z-only move in slicing frame needs to emit both Y and Z in machine coords. + Vec3d machine = to_machine_coords(Vec3d(m_pos.x() - m_x_offset, m_pos.y() - m_y_offset, z)); + w.emit_xyz(machine); + } else { + w.emit_z(z); + } w.emit_f(speed * 60.0); //BBS w.emit_comment(GCodeWriter::full_gcode_comment, comment); @@ -883,7 +937,12 @@ std::string GCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std: Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - w.emit_xy(point_on_plate); + if (is_belt_printer()) { + Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + w.emit_xyz(machine); + } else { + w.emit_xy(point_on_plate); + } if (!force_no_extrusion) w.emit_e(filament()->E()); //BBS @@ -924,6 +983,8 @@ std::string GCodeWriter::extrude_to_xyz(const Vec3d &point, double dE, const std Vec3d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset, point(2) }; GCodeG1Formatter w; + if (is_belt_printer()) + point_on_plate = to_machine_coords(point_on_plate); w.emit_xyz(point_on_plate); if (!force_no_extrusion) w.emit_e(filament()->E()); diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index dbc64694e2..10159d941f 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -125,6 +125,12 @@ public: void set_is_first_layer(bool bval) { m_is_first_layer = bval; } GCodeFlavor get_gcode_flavor() const { return config.gcode_flavor; } + // Belt printer: set the belt angle and precompute sin/cos for coordinate transformation. + void set_belt_angle(double angle_deg); + bool is_belt_printer() const { return m_belt_angle_rad != 0.; } + // Transform a point from the slicing frame to machine/world coordinates (inverse shear). + Vec3d to_machine_coords(const Vec3d &pos) const; + // Returns whether this flavor supports separate print and travel acceleration. static bool supports_separate_travel_acceleration(GCodeFlavor flavor); private: @@ -177,6 +183,11 @@ public: //SoftFever bool m_is_bbl_printers = false; + + // Belt printer coordinate transformation (YZ shear) + double m_belt_angle_rad = 0.; + double m_belt_cos = 1.0; + double m_belt_sin = 0.0; double m_current_speed; bool m_is_first_layer = true; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index ef2c83b13c..98532bccc7 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1010,7 +1010,7 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", - "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "gcode_flavor", + "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "gcode_flavor", "fan_kickstart", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", "printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 6463338f7d..f245cc32b6 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -565,6 +565,9 @@ std::vector Print::print_object_ids() const bool Print::has_infinite_skirt() const { + // Belt printer: no skirt support. + if (m_config.belt_printer.value) + return false; // Orca: unclear why (m_config.ooze_prevention && this->extruders().size() > 1) logic is here, removed. // return (m_config.draft_shield == dsEnabled && m_config.skirt_loops > 0) || (m_config.ooze_prevention && this->extruders().size() > 1); @@ -573,6 +576,9 @@ bool Print::has_infinite_skirt() const bool Print::has_skirt() const { + // Belt printer: no skirt support. + if (m_config.belt_printer.value) + return false; return (m_config.skirt_height > 0); } @@ -1194,6 +1200,16 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* if (extruders.empty()) return { L("No extrusions under current settings.") }; + // Belt printer validation: incompatible features. + if (m_config.belt_printer.value) { + for (const PrintObject *object : m_objects) { + if (object->config().raft_layers > 0) + return { L("Raft is not compatible with belt printer mode.") }; + } + if (m_config.draft_shield != dsDisabled) + return { L("Draft shield is not compatible with belt printer mode.") }; + } + if (nozzles < 2 && extruders.size() > 1) { auto ret = check_multi_filament_valid(*this); if (!ret.string.empty()) @@ -2501,6 +2517,10 @@ std::string Print::export_gcode(const std::string& path_template, GCodeProcessor void Print::_make_skirt() { + // Belt printer: skirt is not compatible. + if (m_config.belt_printer.value) + return; + // First off we need to decide how tall the skirt must be. // The skirt_height option from config is expressed in layers, but our // object might have different layer heights, so we need to find the print_z diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 918fc1b97f..7eea294d4e 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2,6 +2,7 @@ #include "PrintConfigConstants.hpp" #include "ClipperUtils.hpp" #include "Config.hpp" +#include "Geometry.hpp" #include "MaterialType.hpp" #include "I18N.hpp" #include "format.hpp" @@ -5923,10 +5924,11 @@ void PrintConfigDef::init_fff_params() def->category = L("Support"); def->tooltip = L("Tilt angle of the build plate along the X axis. " "A positive value tilts the plate so the +X side is higher, shifting gravity toward -X and increasing overhangs on the +X side. " - "A negative value tilts the -X side higher. Set to 0 for no X-axis tilt."); + "A negative value tilts the -X side higher. Set to 0 for no X-axis tilt. " + "In belt printer mode, this is automatically synced to the belt angle."); def->sidetext = u8"\u00B0"; - def->min = -45; - def->max = 45; + def->min = -90; + def->max = 90; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0.)); @@ -5937,11 +5939,41 @@ void PrintConfigDef::init_fff_params() "A positive value tilts the plate so the +Y side is higher, shifting gravity toward -Y and increasing overhangs on the +Y side. " "A negative value tilts the -Y side higher. Set to 0 for no Y-axis tilt."); def->sidetext = u8"\u00B0"; - def->min = -45; - def->max = 45; + def->min = -90; + def->max = 90; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("belt_printer", coBool); + def->label = L("Belt printer"); + def->category = L("Printable space"); + def->tooltip = L("Enable belt printer mode. Belt printers use a conveyor belt as the build surface, " + "tilted at an angle (typically 45 degrees). The slicer will rotate the slicing plane " + "and transform G-code coordinates for the tilted build surface."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + + def = this->add("belt_printer_angle", coFloat); + def->label = L("Belt angle"); + def->category = L("Printable space"); + def->tooltip = L("The tilt angle of the belt surface in degrees. " + "Most belt printers use a 45-degree angle. " + "This controls the rotation applied to the slicing plane and G-code coordinates."); + def->sidetext = u8"\u00B0"; + def->min = 0; + def->max = 90; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(45.)); + + def = this->add("belt_printer_infinite_y", coBool); + def->label = L("Infinite Y axis"); + def->category = L("Printable space"); + def->tooltip = L("Enable infinite Y axis for belt printers. " + "When enabled, the Y axis build volume limit is effectively removed, " + "allowing objects of any length to be printed along the belt direction."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(true)); + def = this->add("tree_support_branch_angle", coFloat); def->label = L("Tree support branch angle"); def->category = L("Support"); @@ -10823,10 +10855,16 @@ Polygons get_bed_excluded_area(const PrintConfig& cfg) { const Pointfs exclude_area_points = cfg.bed_exclude_area.values; + // Belt printer: project exclusion zone points from belt surface to machine-frame XY. + // On the belt surface, Z=0, so machine_Y = belt_Y * cos(angle). + const bool is_belt = cfg.belt_printer.value; + const double belt_cos = is_belt ? std::cos(Geometry::deg2rad(cfg.belt_printer_angle.value)) : 1.0; + Polygon exclude_poly; for (int i = 0; i < exclude_area_points.size(); i++) { auto pt = exclude_area_points[i]; - exclude_poly.points.emplace_back(scale_(pt.x()), scale_(pt.y())); + double y = is_belt ? pt.y() * belt_cos : pt.y(); + exclude_poly.points.emplace_back(scale_(pt.x()), scale_(y)); } exclude_poly.make_counter_clockwise(); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index c862956544..f36b5d3e93 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1413,6 +1413,10 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( // Build plate tilt for off-axis gravity support generation (printer-level setting). ((ConfigOptionFloat, build_plate_tilt_x)) ((ConfigOptionFloat, build_plate_tilt_y)) + // Belt printer settings (printer-level). + ((ConfigOptionBool, belt_printer)) + ((ConfigOptionFloat, belt_printer_angle)) + ((ConfigOptionBool, belt_printer_infinite_y)) //BBS ((ConfigOptionInts, additional_cooling_fan_speed)) ((ConfigOptionBool, reduce_crossing_wall)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index fc68fce76b..979953fb94 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -3391,7 +3391,9 @@ void PrintObject::update_slicing_parameters() { // Orca: updated function call for XYZ shrinkage compensation if (!m_slicing_params.valid) { - m_slicing_params = SlicingParameters::create_from_config(this->print()->config(), m_config, this->model_object()->max_z(), + coordf_t object_height = this->model_object()->max_z(); + // Belt printer: height adjustment placeholder (to be implemented in next cycle). + m_slicing_params = SlicingParameters::create_from_config(this->print()->config(), m_config, object_height, this->object_extruders(), this->print()->shrinkage_compensation()); } } @@ -3432,6 +3434,7 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full if (object_max_z <= 0.f) object_max_z = (float)model_object.raw_bounding_box().size().z(); + // Belt printer: height adjustment placeholder (to be implemented in next cycle). return SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); } diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 2d67ac0939..bba4593764 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -8,6 +8,7 @@ #include "Layer.hpp" #include "MultiMaterialSegmentation.hpp" #include "Print.hpp" +#include "Geometry.hpp" //BBS #include "ShortestPath.hpp" #include "libslic3r/Feature/Interlocking/InterlockingGenerator.hpp" @@ -139,6 +140,7 @@ static std::vector slice_volumes_inner( params_base.closing_radius = print_object_config.slice_closing_radius.value; params_base.extra_offset = 0; params_base.trafo = object_trafo; + // Belt printer: mesh transform placeholder (to be implemented in next cycle). //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. params_base.resolution = print_config.resolution <= 0.001 ? 0.0f : 0.0025; diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 3f5cd306ad..101279d744 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -387,14 +387,18 @@ void Bed3D::render_internal(GLCanvas3D& canvas, const Transform3d& view_matrix, m_model.set_color(m_is_dark ? DEFAULT_MODEL_COLOR_DARK : DEFAULT_MODEL_COLOR); + // Belt printer: bed view transform placeholder (to be implemented in next cycle). + Transform3d belt_view_matrix = view_matrix; + switch (m_type) { - case Type::System: { render_system(canvas, view_matrix, projection_matrix, bottom); break; } + case Type::System: { render_system(canvas, belt_view_matrix, projection_matrix, bottom); break; } default: - case Type::Custom: { render_custom(canvas, view_matrix, projection_matrix, bottom); break; } + case Type::Custom: { render_custom(canvas, belt_view_matrix, projection_matrix, bottom); break; } } render_gravity_arrow(view_matrix, projection_matrix); + render_slicing_plane(view_matrix, projection_matrix); glsafe(::glDisable(GL_DEPTH_TEST)); } @@ -738,6 +742,10 @@ void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; double tilt_x_deg = cfg.opt_float("build_plate_tilt_x"); double tilt_y_deg = cfg.opt_float("build_plate_tilt_y"); + // Belt printer: auto-derive gravity direction from belt angle if belt mode is active. + if (m_is_belt_printer && m_belt_angle > 0.f) { + tilt_x_deg = m_belt_angle; + } if (tilt_x_deg == 0. && tilt_y_deg == 0.) { m_gravity_arrow.reset(); return; @@ -790,6 +798,61 @@ void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform shader->stop_using(); } +void Bed3D::render_slicing_plane(const Transform3d& view_matrix, const Transform3d& projection_matrix) +{ + if (!m_is_belt_printer || m_belt_angle <= 0.f) + return; + + // Build a quad in the XZ plane (world frame) representing the belt slicing plane. + // The plane is tilted at belt_angle from horizontal, with normal (0, -sin(a), cos(a)). + // We render it as a semi-transparent quad centered on the build plate. + if (!m_slicing_plane.is_initialized()) { + const float half_size = 120.f; // mm, large enough to be visible + GLModel::Geometry init_data; + init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 }; + init_data.reserve_vertices(4); + init_data.reserve_indices(2); // 2 triangles + + // Quad corners in local frame (XY plane, will be rotated to match slicing plane) + Vec3f n = Vec3f::UnitZ(); + init_data.add_vertex(Vec3f(-half_size, -half_size, 0.f), n); + init_data.add_vertex(Vec3f( half_size, -half_size, 0.f), n); + init_data.add_vertex(Vec3f( half_size, half_size, 0.f), n); + init_data.add_vertex(Vec3f(-half_size, half_size, 0.f), n); + init_data.add_triangle(0, 1, 2); + init_data.add_triangle(0, 2, 3); + + m_slicing_plane.init_from(std::move(init_data)); + } + + GLShaderProgram* shader = wxGetApp().get_shader("flat"); + if (shader == nullptr) + return; + + glsafe(::glEnable(GL_DEPTH_TEST)); + glsafe(::glEnable(GL_BLEND)); + glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); + + shader->start_using(); + + // Show a tilted plane representing the slicing direction. + // The slicing plane is rotated by belt_angle about X from horizontal. + // Raise it slightly so it's visible above the bed surface. + double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); + Transform3d model_matrix = Transform3d::Identity(); + model_matrix.translate(Vec3d(0., 0., 30.)); + model_matrix.rotate(Eigen::AngleAxisd(angle_rad, Vec3d::UnitX())); + + shader->set_uniform("view_model_matrix", view_matrix * model_matrix); + shader->set_uniform("projection_matrix", projection_matrix); + + m_slicing_plane.set_color({ 0.2f, 0.6f, 1.0f, 0.3f }); // semi-transparent blue + m_slicing_plane.render(); + + glsafe(::glDisable(GL_BLEND)); + shader->stop_using(); +} + void Bed3D::render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix) { // m_texture.reset(); diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index b16ead575b..005dbff534 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -111,6 +111,7 @@ private: GLModel m_model; Vec3d m_model_offset{ Vec3d::Zero() }; GLModel m_gravity_arrow; + GLModel m_slicing_plane; // Debug: shows the intended slicing plane direction Axes m_axes; float m_scale_factor{ 1.0f }; @@ -120,6 +121,9 @@ private: std::vector> m_extruder_shapes; std::vector m_extruder_heights; bool m_is_dark = false; + // Belt printer state for rendering. + bool m_is_belt_printer = false; + float m_belt_angle = 0.f; public: Bed3D() = default; @@ -139,6 +143,12 @@ public: // Build volume geometry for various collision detection tasks. const BuildVolume& build_volume() const { return m_build_volume; } + BuildVolume& build_volume() { return m_build_volume; } + + // Belt printer bed settings. + void set_belt_printer(bool enabled, float angle_deg) { m_is_belt_printer = enabled; m_belt_angle = angle_deg; } + bool is_belt_printer() const { return m_is_belt_printer; } + float belt_angle() const { return m_belt_angle; } // Was the model provided, or was it generated procedurally? Type get_type() const { return m_type; } @@ -179,6 +189,7 @@ private: void render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom); void render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix); + void render_slicing_plane(const Transform3d& view_matrix, const Transform3d& projection_matrix); // BBS: remove the bed picking logic // void register_raycasters_for_picking(const GLModel::Geometry& geometry, const Transform3d& trafo); diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index f3f98a6fad..0b5e6d3906 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -575,9 +575,17 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co auto gcflavor = preset_bundle->printers.get_edited_preset().config.option>("gcode_flavor")->value; + // Belt printer: detect early since it affects multiple toggle decisions below. + bool is_belt_printer = false; + { + const auto *belt_opt = preset_bundle->printers.get_edited_preset().config.option("belt_printer"); + if (belt_opt) + is_belt_printer = belt_opt->value; + } + bool have_volumetric_extrusion_rate_slope = config->option("max_volumetric_extrusion_rate_slope")->value > 0; float have_volumetric_extrusion_rate_slope_segment_length = config->option("max_volumetric_extrusion_rate_slope_segment_length")->value; - toggle_field("enable_arc_fitting", !have_volumetric_extrusion_rate_slope); + toggle_field("enable_arc_fitting", !have_volumetric_extrusion_rate_slope && !is_belt_printer); toggle_line("max_volumetric_extrusion_rate_slope_segment_length", have_volumetric_extrusion_rate_slope); toggle_line("extrusion_rate_smoothing_external_perimeter_only", have_volumetric_extrusion_rate_slope); if(have_volumetric_extrusion_rate_slope) config->set_key_value("enable_arc_fitting", new ConfigOptionBool(false)); @@ -697,13 +705,20 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co } } - bool have_skirt = config->opt_int("skirt_loops") > 0; + // Belt printer: disable skirt, brim, raft, and draft shield controls. + bool have_skirt = config->opt_int("skirt_loops") > 0 && !is_belt_printer; toggle_field("skirt_height", have_skirt && config->opt_enum("draft_shield") != dsEnabled); toggle_line("single_loop_draft_shield", have_skirt); // ORCA: Display one wall if skirt enabled for (auto el : {"skirt_type", "min_skirt_length", "skirt_distance", "skirt_start_angle", "skirt_speed", "draft_shield"}) toggle_field(el, have_skirt); + if (is_belt_printer) { + toggle_field("skirt_loops", false); + toggle_field("skirt_height", false); + } - bool have_brim = (config->opt_enum("brim_type") != btNoBrim); + bool have_brim = (config->opt_enum("brim_type") != btNoBrim) && !is_belt_printer; + if (is_belt_printer) + toggle_field("brim_type", false); toggle_field("brim_object_gap", have_brim); toggle_field("brim_use_efc_outline", have_brim); bool have_brim_width = (config->opt_enum("brim_type") != btNoBrim) && config->opt_enum("brim_type") != btAutoBrim && @@ -724,7 +739,9 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co // Hide Elephant foot compensation layers if elefant_foot_compensation is not enabled toggle_line("elefant_foot_compensation_layers", config->opt_float("elefant_foot_compensation") > 0); - bool have_raft = config->opt_int("raft_layers") > 0; + bool have_raft = config->opt_int("raft_layers") > 0 && !is_belt_printer; + if (is_belt_printer) + toggle_field("raft_layers", false); bool have_support_material = config->opt_bool("enable_support") || have_raft; SupportType support_type = config->opt_enum("support_type"); diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 4814548a10..7df0b06ff5 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -2208,7 +2208,9 @@ void GCodeViewer::load_shells(const Print& print, bool initialized, bool force_p void GCodeViewer::render_toolpaths() { const Camera& camera = wxGetApp().plater()->get_camera(); - const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(static_cast(camera.get_view_matrix().matrix().cast())); + Matrix4f view = camera.get_view_matrix().matrix().cast(); + // Belt view: view matrix transform placeholder (to be implemented in next cycle). + const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(view); const libvgcode::Mat4x4 converted_projetion_matrix = libvgcode::convert(static_cast(camera.get_projection_matrix().matrix().cast())); #if VGCODE_ENABLE_COG_AND_TOOL_MARKERS m_viewer.set_cog_marker_scale_factor(m_cog_marker_fixed_screen_size ? 10.0f * m_cog_marker_size * camera.get_inv_zoom() : m_cog_marker_size); diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index dc928b822a..a299b93058 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -237,6 +237,9 @@ private: mutable bool m_no_render_path { false }; bool m_is_dark = false; + bool m_belt_view_enabled = false; + float m_belt_angle_deg = 0.f; + libvgcode::Viewer m_viewer; bool m_loaded_as_preview{ false }; @@ -336,6 +339,9 @@ public: void export_toolpaths_to_obj(const char* filename) const; + void set_belt_printer(bool enabled, float angle_deg) { m_belt_view_enabled = enabled; m_belt_angle_deg = angle_deg; } + bool is_belt_view() const { return m_belt_view_enabled && m_belt_angle_deg > 0.f; } + size_t get_extruders_count() { return m_extruders_count; } void push_combo_style(); void pop_combo_style(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index ef46801722..373ee2a3dc 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -10980,6 +10980,24 @@ void Plater::priv::set_bed_shape(const Pointfs &shape, Vec2d shape_position = partplate_list.get_current_shape_position(); bool new_shape = bed.set_shape(shape, printable_height, extruder_areas, extruder_heights, custom_model, force_as_custom, shape_position); + // Belt printer: configure build volume and bed rendering for belt mode. + { + const auto *belt_opt = config->option("belt_printer"); + bool is_belt = belt_opt && belt_opt->value; + if (is_belt) { + double belt_angle = config->opt_float("belt_printer_angle"); + bool infinite_y = config->opt_bool("belt_printer_infinite_y"); + bed.build_volume().set_belt_printer(true, belt_angle, infinite_y); + bed.set_belt_printer(true, static_cast(belt_angle)); + if (preview) + preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, static_cast(belt_angle)); + } else { + bed.set_belt_printer(false, 0.f); + if (preview) + preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(false, 0.f); + } + } + float prev_height_lid, prev_height_rod; partplate_list.get_height_limits(prev_height_lid, prev_height_rod); double height_to_lid = config->opt_float("extruder_clearance_height_to_lid"); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 6ac8ca9a0e..fafe46c952 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4366,6 +4366,9 @@ void TabPrinter::build_fff() optgroup->append_single_option_line("printable_height", "printer_basic_information_printable_space#printable-height"); optgroup->append_single_option_line("build_plate_tilt_x"); optgroup->append_single_option_line("build_plate_tilt_y"); + optgroup->append_single_option_line("belt_printer"); + optgroup->append_single_option_line("belt_printer_angle"); + optgroup->append_single_option_line("belt_printer_infinite_y"); optgroup->append_single_option_line("support_multi_bed_types","printer_basic_information_printable_space#support-multi-bed-types"); optgroup->append_single_option_line("best_object_pos", "printer_basic_information_printable_space#best-object-position"); // todo: for multi_extruder test @@ -5224,6 +5227,11 @@ void TabPrinter::toggle_options() auto gcf = m_config->option>("gcode_flavor")->value; toggle_line("enable_power_loss_recovery", is_BBL_printer || gcf == gcfMarlinFirmware); + + // Belt printer: show belt-specific settings only when belt_printer is enabled. + bool is_belt = m_config->opt_bool("belt_printer"); + toggle_line("belt_printer_angle", is_belt); + toggle_line("belt_printer_infinite_y", is_belt); } @@ -5395,6 +5403,23 @@ void TabPrinter::update_fff() m_use_silent_mode = m_config->opt_bool("silent_mode"); } + // Belt printer: auto-sync build_plate_tilt_x to belt_printer_angle when belt mode is active. + // When belt mode is off, reset build_plate_tilt_x to 0 if it was set by belt mode. + if (m_config->opt_bool("belt_printer")) { + double belt_angle = m_config->opt_float("belt_printer_angle"); + if (m_config->opt_float("build_plate_tilt_x") != belt_angle) { + m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(belt_angle)); + } + } else { + // Only reset if build_plate_tilt_x matches a typical belt angle (was set by auto-sync). + // Avoid clobbering a manually-set tilt value for non-belt tilted printers. + double current_tilt = m_config->opt_float("build_plate_tilt_x"); + double belt_angle = m_config->opt_float("belt_printer_angle"); + if (current_tilt != 0. && std::abs(current_tilt - belt_angle) < 0.01) { + m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(0.)); + } + } + toggle_options(); } From cb13a22e572db5b6a168be90c880d22a97326a85 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 12 Mar 2026 14:25:30 -0500 Subject: [PATCH 003/389] Part 2: Replace belt rotation w/ per-axis shear transforms and G-code axis remap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace monolithic belt rotation transform with independent per-axis shear controls (mode/angle/source-axis for X, Y, Z) and G-code axis remapping, giving full flexibility to match any belt printer's coordinate system - Remove all rotation mode logic and intermediate type+axes dropdowns, simplifying the pipeline to pure shear matrices while preserving the default behavior (Y += Z*cot(45deg) with identity remap) - Clean up GCodeWriter, GCodeProcessor, and GCodeViewer for the new shear-only model; expose 12 new settings in printer UI via Tab.cpp/Preset.cpp Implement belt printer tilted slicing Implement the core belt slicing pipeline that makes the slicer tilt-aware: Step 1: GCodeWriter::to_machine_coords() - R(+alpha, X) rotation from slicing frame to machine frame Step 2: PrintObject - belt-rotated object height calculation (y*sin(a) + z*cos(a)) for correct layer count Step 3: PrintObjectSlice - apply R(-alpha, X) rotation trafo so horizontal slice planes correspond to belt-parallel planes, with Z-shift computed from model volumes Step 4: GCodeProcessor - machine-frame preview (no transform needed) Step 5: 3DBed - rotate bed visualization about X by belt angle Fix: belt surface IS the build plate, no mesh rotation Currently still slicing perpendicular to the belt normal. Need to figure out why. Fix G-code Z sign: use R(-alpha, X) so Z+ is away from belt The previous R(+alpha, X) transform produced negative Z values (-y*sin(a) term dominated). Changed to R(-alpha, X) which gives machine_z = y*sin(a) + z*cos(a), always positive for points above the belt surface. Z increases with each layer as expected. reverting and changing slice methodology Add pink slicing direction arrow from origin Shows the effective slicing direction (gantry normal) as a pink arrow from the origin. Shorter and wider than the gravity arrow. Direction: R(+alpha, X) * Z = (0, -sin(a), cos(a)), which is the layer stacking direction in the original mesh frame. Fix slicing arrow visibility and add raw G-code toggle - Disable depth test for pink slicing arrow so it renders on top of the tilted bed geometry (was being occluded) - Remove unnecessary 5mm Z-offset from arrow position - Add m_belt_show_raw toggle to GCodeViewer - Add "Show raw G-code (slicing frame)" checkbox in legend when belt mode is active Implement to_machine_coords inverse rotation for belt printer G-code The slicing pipeline rotates the mesh by R(-alpha, X) and shifts Z to start at 0. The G-code output now undoes this transform via to_machine_coords: R(+alpha, X) * T(0,0,+z_shift), recovering the original machine-frame coordinates where Y is horizontal and Z is vertical. Changes: - GCodeWriter: implement to_machine_coords with inverse rotation + Z-shift - GCodeWriter: add belt_z_shift member and setter/getter - GCode.cpp: compute Z-shift from print objects (same logic as PrintObjectSlice) and pass to writer; write z_shift to G-code header - GCodeProcessor: parse belt_z_shift from G-code header - GCodeViewer: store belt_z_shift from processor result Wire raw G-code toggle to apply slicing-frame view transform When "Show raw G-code (slicing frame)" is checked in the preview legend, the view matrix is modified to apply R(-alpha, X) * T(0,0,-z_shift) to the toolpath rendering. This shows the G-code as it was during slicing: rotated part with horizontal layers. Default (unchecked): machine-frame view — upright part with tilted layers. Remove belt printer placeholder comment from GCodeProcessor The preview now correctly displays machine-frame G-code with the optional raw view toggle. No transform is needed in the processor. --- src/libslic3r/GCode.cpp | 27 ++++++++- src/libslic3r/GCode/GCodeProcessor.cpp | 9 ++- src/libslic3r/GCode/GCodeProcessor.hpp | 3 +- src/libslic3r/GCodeWriter.cpp | 16 +++++- src/libslic3r/GCodeWriter.hpp | 7 ++- src/libslic3r/PrintObject.cpp | 19 +++++-- src/libslic3r/PrintObjectSlice.cpp | 20 ++++++- src/slic3r/GUI/3DBed.cpp | 79 ++++++++++++++++++++++++-- src/slic3r/GUI/3DBed.hpp | 2 + src/slic3r/GUI/GCodeViewer.cpp | 20 ++++++- src/slic3r/GUI/GCodeViewer.hpp | 2 + 11 files changed, 183 insertions(+), 21 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index bff35d321c..d762da7ed4 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -8,6 +8,7 @@ #include "Exception.hpp" #include "ExtrusionEntity.hpp" #include "EdgeGrid.hpp" +#include "Geometry.hpp" #include "Geometry/ConvexHull.hpp" #include "GCode/PrintExtents.hpp" #include "GCode/Thumbnails.hpp" @@ -2414,8 +2415,28 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_writer.set_is_bbl_machine(is_bbl_printers); // Belt printer: initialize coordinate transformation on the writer. - if (print.config().belt_printer.value) + if (print.config().belt_printer.value) { m_writer.set_belt_angle(print.config().belt_printer_angle.value); + // Compute the Z-shift that was applied during slicing (same logic as PrintObjectSlice.cpp). + // This is needed by to_machine_coords() to undo the slicing transform. + // For multiple objects, use the minimum min_z_rotated across all objects. + double angle_rad = Geometry::deg2rad(print.config().belt_printer_angle.value); + Transform3d belt_rotation = Transform3d::Identity(); + belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); + double global_min_z = std::numeric_limits::max(); + for (const PrintObject *obj : print.objects()) { + Transform3d obj_trafo = belt_rotation * obj->trafo_centered(); + for (const ModelVolume *mv : obj->model_object()->volumes) { + if (! mv->is_model_part() && ! mv->is_modifier()) + continue; + BoundingBoxf3 bb = mv->mesh().bounding_box(); + bb = bb.transformed(obj_trafo * mv->get_matrix()); + global_min_z = std::min(global_min_z, bb.min.z()); + } + } + if (global_min_z != std::numeric_limits::max() && std::abs(global_min_z) > EPSILON) + m_writer.set_belt_z_shift(global_min_z); // typically negative + } // How many times will be change_layer() called? // change_layer() in turn increments the progress bar status. @@ -2507,8 +2528,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Write information on the generator. file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str()); // Belt printer: embed angle in header for G-code processor detection. - if (print.config().belt_printer.value) + if (print.config().belt_printer.value) { file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); + file.write_format("; belt_z_shift = %.4f\n", m_writer.belt_z_shift()); + } if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); //BBS: total layer number diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 0dc00e1522..a7a39b5b02 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2597,8 +2597,6 @@ void GCodeProcessor::finalize(bool post_process) } } - // Belt printer: preview coordinate transform placeholder (to be implemented in next cycle). - calculate_time(m_result); // process the time blocks @@ -3053,6 +3051,13 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers } catch (...) {} return; } + // Belt printer Z-shift for raw G-code toggle in preview. + if (boost::starts_with(comment, " belt_z_shift = ")) { + try { + m_result.belt_z_shift = std::stof(std::string(comment.substr(16))); + } catch (...) {} + return; + } // wipe start tag if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) { diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index e432a165a8..af68a5a6b7 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -227,8 +227,9 @@ class Print; bool support_traditional_timelapse{true}; float printable_height; float z_offset; - // Belt printer: angle for coordinate transformation in preview. + // Belt printer: angle and Z-shift for coordinate transformation in preview. float belt_printer_angle{ 0.f }; + float belt_z_shift{ 0.f }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 1b056a946f..119c9dd068 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -29,8 +29,20 @@ void GCodeWriter::set_belt_angle(double angle_deg) Vec3d GCodeWriter::to_machine_coords(const Vec3d &pos) const { - // Belt printer: coordinate transform placeholder (to be implemented in next cycle). - return pos; + if (!is_belt_printer()) + return pos; + + // Undo the slicing transform to recover machine-frame coordinates. + // Slicing applied: T(0,0,-min_z_rot) * R(-alpha, X) * original_pos + // Inverse: R(+alpha, X) * T(0,0,+min_z_rot) * slicing_pos + // + // First undo the Z-shift, then apply R(+alpha, X). + double sz = pos.z() + m_belt_z_shift; // undo T(0,0,-min_z_rot) + return Vec3d( + pos.x(), + pos.y() * m_belt_cos - sz * m_belt_sin, // R(+alpha, X) + pos.y() * m_belt_sin + sz * m_belt_cos + ); } bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 10159d941f..f9b5ed79ac 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -127,8 +127,10 @@ public: // Belt printer: set the belt angle and precompute sin/cos for coordinate transformation. void set_belt_angle(double angle_deg); + void set_belt_z_shift(double z_shift) { m_belt_z_shift = z_shift; } + double belt_z_shift() const { return m_belt_z_shift; } bool is_belt_printer() const { return m_belt_angle_rad != 0.; } - // Transform a point from the slicing frame to machine/world coordinates (inverse shear). + // Transform a point from the slicing frame to machine/world coordinates (inverse rotation). Vec3d to_machine_coords(const Vec3d &pos) const; // Returns whether this flavor supports separate print and travel acceleration. @@ -184,10 +186,11 @@ public: //SoftFever bool m_is_bbl_printers = false; - // Belt printer coordinate transformation (YZ shear) + // Belt printer coordinate transformation (inverse of slicing rotation) double m_belt_angle_rad = 0.; double m_belt_cos = 1.0; double m_belt_sin = 0.0; + double m_belt_z_shift = 0.; // Z-shift applied during slicing (min_z_rotated, typically negative) double m_current_speed; bool m_is_first_layer = true; diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 979953fb94..08ff847951 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -3392,7 +3392,13 @@ void PrintObject::update_slicing_parameters() // Orca: updated function call for XYZ shrinkage compensation if (!m_slicing_params.valid) { coordf_t object_height = this->model_object()->max_z(); - // Belt printer: height adjustment placeholder (to be implemented in next cycle). + if (this->print()->config().belt_printer.value) { + // After mesh rotation R(-alpha, X), effective height in the slicing + // direction is y_extent*sin(a) + z_extent*cos(a). + double angle_rad = Geometry::deg2rad(this->print()->config().belt_printer_angle.value); + BoundingBoxf3 bb = this->model_object()->raw_bounding_box(); + object_height = bb.size().y() * std::sin(angle_rad) + bb.size().z() * std::cos(angle_rad); + } m_slicing_params = SlicingParameters::create_from_config(this->print()->config(), m_config, object_height, this->object_extruders(), this->print()->shrinkage_compensation()); } @@ -3432,9 +3438,14 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full sort_remove_duplicates(object_extruders); //FIXME add painting extruders - if (object_max_z <= 0.f) - object_max_z = (float)model_object.raw_bounding_box().size().z(); - // Belt printer: height adjustment placeholder (to be implemented in next cycle). + if (object_max_z <= 0.f) { + BoundingBoxf3 bb = model_object.raw_bounding_box(); + object_max_z = (float)bb.size().z(); + if (print_config.belt_printer.value) { + double angle_rad = Geometry::deg2rad(print_config.belt_printer_angle.value); + object_max_z = (float)(bb.size().y() * std::sin(angle_rad) + bb.size().z() * std::cos(angle_rad)); + } + } return SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); } diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index bba4593764..2748151aa0 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -140,7 +140,25 @@ static std::vector slice_volumes_inner( params_base.closing_radius = print_object_config.slice_closing_radius.value; params_base.extra_offset = 0; params_base.trafo = object_trafo; - // Belt printer: mesh transform placeholder (to be implemented in next cycle). + if (print_config.belt_printer.value) { + double angle_rad = Geometry::deg2rad(print_config.belt_printer_angle.value); + // Rotate mesh by -alpha about X so horizontal slice planes = gantry-parallel planes. + // The gantry (XY) is tilted by belt_printer_angle; this rotation aligns it with horizontal. + Transform3d belt_rotation = Transform3d::Identity(); + belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); + params_base.trafo = belt_rotation * params_base.trafo; + // Compute Z-shift from model_volumes: find min-Z of all rotated meshes + // so the rotated geometry starts at Z=0 (the belt surface in slicing frame). + double min_z_rotated = std::numeric_limits::max(); + for (const ModelVolume *mv : model_volumes) { + if (!model_volume_needs_slicing(*mv)) continue; + BoundingBoxf3 bb = mv->mesh().bounding_box(); + bb = bb.transformed(params_base.trafo * mv->get_matrix()); + min_z_rotated = std::min(min_z_rotated, bb.min.z()); + } + if (min_z_rotated != std::numeric_limits::max() && std::abs(min_z_rotated) > EPSILON) + params_base.trafo = Eigen::Translation3d(0, 0, -min_z_rotated) * params_base.trafo; + } //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. params_base.resolution = print_config.resolution <= 0.001 ? 0.0f : 0.0025; diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 101279d744..858182946c 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -387,17 +387,18 @@ void Bed3D::render_internal(GLCanvas3D& canvas, const Transform3d& view_matrix, m_model.set_color(m_is_dark ? DEFAULT_MODEL_COLOR_DARK : DEFAULT_MODEL_COLOR); - // Belt printer: bed view transform placeholder (to be implemented in next cycle). - Transform3d belt_view_matrix = view_matrix; + // Belt printer: bed rotation is applied inside render_model() and render_default() + // using m_is_belt_printer and m_belt_angle members. switch (m_type) { - case Type::System: { render_system(canvas, belt_view_matrix, projection_matrix, bottom); break; } + case Type::System: { render_system(canvas, view_matrix, projection_matrix, bottom); break; } default: - case Type::Custom: { render_custom(canvas, belt_view_matrix, projection_matrix, bottom); break; } + case Type::Custom: { render_custom(canvas, view_matrix, projection_matrix, bottom); break; } } render_gravity_arrow(view_matrix, projection_matrix); + render_slicing_arrow(view_matrix, projection_matrix); render_slicing_plane(view_matrix, projection_matrix); glsafe(::glDisable(GL_DEPTH_TEST)); @@ -698,7 +699,13 @@ void Bed3D::render_model(const Transform3d& view_matrix, const Transform3d& proj if (shader != nullptr) { shader->start_using(); shader->set_uniform("emission_factor", 0.0f); - const Transform3d model_matrix = Geometry::assemble_transform(m_model_offset); + Transform3d model_matrix = Geometry::assemble_transform(m_model_offset); + // Belt printer: rotate the bed model about X so the belt tilt is visible. + // Negative angle: belt surface tilts downward away from the nozzle. + if (m_is_belt_printer && m_belt_angle > 0.f) { + double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); + model_matrix = Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX()) * model_matrix; + } shader->set_uniform("volume_world_matrix", model_matrix); shader->set_uniform("view_model_matrix", view_matrix * model_matrix); shader->set_uniform("projection_matrix", projection_matrix); @@ -798,6 +805,58 @@ void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform shader->stop_using(); } +void Bed3D::render_slicing_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix) +{ + if (!m_is_belt_printer || m_belt_angle <= 0.f) + return; + + // Build the arrow model: shorter and wider than the gravity arrow. + if (!m_slicing_arrow.is_initialized()) { + const float stem_length = 15.0f; // shorter than gravity arrow (25) + const float stem_radius = 1.0f; // wider than gravity arrow (~0.33) + const float tip_radius = 3.0f; // wider tip + const float tip_length = 5.0f; + m_slicing_arrow.init_from(stilized_arrow(16, tip_radius, tip_length, stem_radius, stem_length)); + } + + // The slicing direction: layers stack along the gantry normal. + // With mesh rotation R(-alpha, X), the slicing Z-axis in the original frame + // points in direction R(+alpha, X) * (0, 0, 1) = (0, -sin(alpha), cos(alpha)). + double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); + Vec3d slice_dir = Vec3d(0., -std::sin(angle_rad), std::cos(angle_rad)).normalized(); + + // Compute rotation to align +Z (arrow default) with slice_dir. + Vec3d from = Vec3d::UnitZ(); + double dot = from.dot(slice_dir); + Transform3d rot = Transform3d::Identity(); + if (dot < -0.9999) { + rot = Eigen::AngleAxisd(M_PI, Vec3d::UnitX()) * rot; + } else if (dot < 0.9999) { + Vec3d axis = from.cross(slice_dir).normalized(); + double angle = std::acos(std::clamp(dot, -1.0, 1.0)); + rot = Eigen::AngleAxisd(angle, axis) * rot; + } + + GLShaderProgram* shader = wxGetApp().get_shader("flat"); + if (shader == nullptr) + return; + + // Disable depth test so the arrow is always visible (not occluded by the tilted bed). + glsafe(::glDisable(GL_DEPTH_TEST)); + shader->start_using(); + + const Camera& camera = wxGetApp().plater()->get_camera(); + Transform3d model_matrix = rot; + shader->set_uniform("view_model_matrix", camera.get_view_matrix() * model_matrix); + shader->set_uniform("projection_matrix", camera.get_projection_matrix()); + + m_slicing_arrow.set_color({ 1.0f, 0.2f, 0.6f, 1.0f }); // pink + m_slicing_arrow.render(); + + shader->stop_using(); + glsafe(::glEnable(GL_DEPTH_TEST)); +} + void Bed3D::render_slicing_plane(const Transform3d& view_matrix, const Transform3d& projection_matrix) { if (!m_is_belt_printer || m_belt_angle <= 0.f) @@ -863,7 +922,15 @@ void Bed3D::render_default(bool bottom, const Transform3d& view_matrix, const Tr if (shader != nullptr) { shader->start_using(); - shader->set_uniform("view_model_matrix", view_matrix); + // Belt printer: rotate the default bed about X so the belt tilt is visible. + Transform3d view_model_matrix = view_matrix; + if (m_is_belt_printer && m_belt_angle > 0.f) { + double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); + Transform3d belt_rotation = Transform3d::Identity(); + belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); + view_model_matrix = view_matrix * belt_rotation; + } + shader->set_uniform("view_model_matrix", view_model_matrix); shader->set_uniform("projection_matrix", projection_matrix); glsafe(::glEnable(GL_DEPTH_TEST)); diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index 005dbff534..d01273961d 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -111,6 +111,7 @@ private: GLModel m_model; Vec3d m_model_offset{ Vec3d::Zero() }; GLModel m_gravity_arrow; + GLModel m_slicing_arrow; // Pink arrow showing the effective slicing direction GLModel m_slicing_plane; // Debug: shows the intended slicing plane direction Axes m_axes; @@ -189,6 +190,7 @@ private: void render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom); void render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix); + void render_slicing_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_slicing_plane(const Transform3d& view_matrix, const Transform3d& projection_matrix); // BBS: remove the bed picking logic diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 7df0b06ff5..dd66c918a7 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1271,6 +1271,7 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const m_max_print_height = gcode_result.printable_height; m_z_offset = gcode_result.z_offset; + m_belt_z_shift = gcode_result.belt_z_shift; // load_toolpaths(gcode_result, build_volume, exclude_bounding_box); @@ -2209,7 +2210,16 @@ void GCodeViewer::render_toolpaths() { const Camera& camera = wxGetApp().plater()->get_camera(); Matrix4f view = camera.get_view_matrix().matrix().cast(); - // Belt view: view matrix transform placeholder (to be implemented in next cycle). + // Belt "raw" view: apply slicing rotation to view matrix so toolpaths appear + // in the slicing frame (rotated part with horizontal layers). + if (m_belt_show_raw && m_belt_view_enabled && m_belt_angle_deg > 0.f) { + double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle_deg)); + // Apply R(-alpha, X) * T(0,0,-z_shift) to bring machine coords back to slicing frame. + Transform3d slicing_trafo = Transform3d::Identity(); + slicing_trafo.translate(Vec3d(0., 0., -static_cast(m_belt_z_shift))); + slicing_trafo = Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX()) * slicing_trafo; + view = (camera.get_view_matrix() * slicing_trafo).matrix().cast(); + } const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(view); const libvgcode::Mat4x4 converted_projetion_matrix = libvgcode::convert(static_cast(camera.get_projection_matrix().matrix().cast())); #if VGCODE_ENABLE_COG_AND_TOOL_MARKERS @@ -4406,6 +4416,14 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv if (m_nozzle_nums > 1 && (m_viewer.get_view_type() == libvgcode::EViewType::Summary || m_viewer.get_view_type() == libvgcode::EViewType::ColorPrint)) // ORCA show only on summary and filament tab render_legend_color_arr_recommen(window_padding); + // Belt printer: toggle for viewing raw slicing-frame G-code + if (m_belt_view_enabled) { + ImGui::Spacing(); + ImGui::Dummy({ window_padding, 0 }); + ImGui::SameLine(); + ImGui::Checkbox("Show raw G-code (slicing frame)", &m_belt_show_raw); + } + legend_height = ImGui::GetCurrentWindow()->Size.y; imgui.end(); ImGui::PopStyleColor(7); diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index a299b93058..4bd3746991 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -239,6 +239,8 @@ mutable bool m_no_render_path { false }; bool m_belt_view_enabled = false; float m_belt_angle_deg = 0.f; + float m_belt_z_shift = 0.f; + bool m_belt_show_raw = false; // Toggle: show raw slicing-frame G-code (rotated part) libvgcode::Viewer m_viewer; bool m_loaded_as_preview{ false }; From 719af2d81d1fb62206e978743151bee018191563 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 12 Mar 2026 20:47:28 -0500 Subject: [PATCH 004/389] Part 2.5: Add global shear transform, support clipping, and belt UI improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implement per-object global shear transform in PrintObject with layer Z-offset calculation, config invalidation, and fix for shared-object layer optimization breaking copied objects - Clip support layers to the transformed belt floor plane and begin work on tree support adaptation for sheared coordinate space - Improve belt UI: gray out inactive sub-options, add B keyboard shortcut for G-code viewer design-view toggle, fix mesh clipping through build plate after shear/scale transform y' = y + z·cot(α), while x' = x and z' = z getting closer to customizable variant getting closer X/Y/Z shear initial clean up UI add 1/sin(a) transform, idea taken from blackbelt cura plugin Things work now (turns out I've been using the wrong set of transforms) --- src/libslic3r/GCode.cpp | 31 ++---- src/libslic3r/GCode/GCodeProcessor.cpp | 8 -- src/libslic3r/GCode/GCodeProcessor.hpp | 3 +- src/libslic3r/GCodeWriter.cpp | 34 ++++--- src/libslic3r/GCodeWriter.hpp | 17 ++-- src/libslic3r/Preset.cpp | 6 +- src/libslic3r/PrintConfig.cpp | 135 +++++++++++++++++++++++++ src/libslic3r/PrintConfig.hpp | 54 ++++++++++ src/libslic3r/PrintObject.cpp | 101 ++++++++++++++++-- src/libslic3r/PrintObjectSlice.cpp | 78 +++++++++++--- src/slic3r/GUI/GCodeViewer.cpp | 22 ++-- src/slic3r/GUI/GCodeViewer.hpp | 3 +- src/slic3r/GUI/Tab.cpp | 51 ++++++++++ 13 files changed, 452 insertions(+), 91 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index d762da7ed4..02a233e988 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2411,31 +2411,19 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_is_role_based_fan_on.fill(false); m_fan_mover.release(); - + m_writer.set_is_bbl_machine(is_bbl_printers); - // Belt printer: initialize coordinate transformation on the writer. + // Belt printer: initialize coordinate transformation and axis remap on the writer. if (print.config().belt_printer.value) { m_writer.set_belt_angle(print.config().belt_printer_angle.value); - // Compute the Z-shift that was applied during slicing (same logic as PrintObjectSlice.cpp). - // This is needed by to_machine_coords() to undo the slicing transform. - // For multiple objects, use the minimum min_z_rotated across all objects. - double angle_rad = Geometry::deg2rad(print.config().belt_printer_angle.value); - Transform3d belt_rotation = Transform3d::Identity(); - belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); - double global_min_z = std::numeric_limits::max(); - for (const PrintObject *obj : print.objects()) { - Transform3d obj_trafo = belt_rotation * obj->trafo_centered(); - for (const ModelVolume *mv : obj->model_object()->volumes) { - if (! mv->is_model_part() && ! mv->is_modifier()) - continue; - BoundingBoxf3 bb = mv->mesh().bounding_box(); - bb = bb.transformed(obj_trafo * mv->get_matrix()); - global_min_z = std::min(global_min_z, bb.min.z()); - } - } - if (global_min_z != std::numeric_limits::max() && std::abs(global_min_z) > EPSILON) - m_writer.set_belt_z_shift(global_min_z); // typically negative + m_writer.set_axis_remap( + int(print.config().belt_gcode_remap_x.value), + int(print.config().belt_gcode_remap_y.value), + int(print.config().belt_gcode_remap_z.value)); + // Build volume extents for Rev remap mode. + BoundingBoxf bbox_bed(print.config().printable_area.values); + m_writer.set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), print.config().printable_height.value)); } // How many times will be change_layer() called? @@ -2530,7 +2518,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Belt printer: embed angle in header for G-code processor detection. if (print.config().belt_printer.value) { file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); - file.write_format("; belt_z_shift = %.4f\n", m_writer.belt_z_shift()); } if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index a7a39b5b02..7ac3a1ffc4 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3051,14 +3051,6 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers } catch (...) {} return; } - // Belt printer Z-shift for raw G-code toggle in preview. - if (boost::starts_with(comment, " belt_z_shift = ")) { - try { - m_result.belt_z_shift = std::stof(std::string(comment.substr(16))); - } catch (...) {} - return; - } - // wipe start tag if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) { m_wiping = true; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index af68a5a6b7..e432a165a8 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -227,9 +227,8 @@ class Print; bool support_traditional_timelapse{true}; float printable_height; float z_offset; - // Belt printer: angle and Z-shift for coordinate transformation in preview. + // Belt printer: angle for coordinate transformation in preview. float belt_printer_angle{ 0.f }; - float belt_z_shift{ 0.f }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 119c9dd068..d6bb5a0bb9 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -23,26 +23,32 @@ bool GCodeWriter::full_gcode_comment = true; void GCodeWriter::set_belt_angle(double angle_deg) { m_belt_angle_rad = Geometry::deg2rad(angle_deg); - m_belt_cos = std::cos(m_belt_angle_rad); - m_belt_sin = std::sin(m_belt_angle_rad); +} + +void GCodeWriter::set_axis_remap(int rx, int ry, int rz) +{ + m_remap_x = rx; + m_remap_y = ry; + m_remap_z = rz; +} + +void GCodeWriter::set_build_volume_max(const Vec3d &max) +{ + m_build_vol_max = max; } Vec3d GCodeWriter::to_machine_coords(const Vec3d &pos) const { if (!is_belt_printer()) return pos; - - // Undo the slicing transform to recover machine-frame coordinates. - // Slicing applied: T(0,0,-min_z_rot) * R(-alpha, X) * original_pos - // Inverse: R(+alpha, X) * T(0,0,+min_z_rot) * slicing_pos - // - // First undo the Z-shift, then apply R(+alpha, X). - double sz = pos.z() + m_belt_z_shift; // undo T(0,0,-min_z_rot) - return Vec3d( - pos.x(), - pos.y() * m_belt_cos - sz * m_belt_sin, // R(+alpha, X) - pos.y() * m_belt_sin + sz * m_belt_cos - ); + // BeltRemapAxis: 0-2 = +X/+Y/+Z, 3-5 = -X/-Y/-Z, 6-8 = Rev X/Y/Z + auto remap = [this, &pos](int r) -> double { + int axis = r % 3; + if (r < 3) return pos[axis]; + if (r < 6) return -pos[axis]; + return m_build_vol_max[axis] - pos[axis]; + }; + return { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; } bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index f9b5ed79ac..6074eb247c 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -127,10 +127,12 @@ public: // Belt printer: set the belt angle and precompute sin/cos for coordinate transformation. void set_belt_angle(double angle_deg); - void set_belt_z_shift(double z_shift) { m_belt_z_shift = z_shift; } - double belt_z_shift() const { return m_belt_z_shift; } bool is_belt_printer() const { return m_belt_angle_rad != 0.; } - // Transform a point from the slicing frame to machine/world coordinates (inverse rotation). + // Set axis remap for G-code output (BeltRemapAxis enum values). + void set_axis_remap(int rx, int ry, int rz); + // Set build volume extents for Rev remap mode (max X, Y, Z). + void set_build_volume_max(const Vec3d &max); + // Transform a point from the slicing frame to machine coordinates. Vec3d to_machine_coords(const Vec3d &pos) const; // Returns whether this flavor supports separate print and travel acceleration. @@ -186,11 +188,12 @@ public: //SoftFever bool m_is_bbl_printers = false; - // Belt printer coordinate transformation (inverse of slicing rotation) + // Belt printer state double m_belt_angle_rad = 0.; - double m_belt_cos = 1.0; - double m_belt_sin = 0.0; - double m_belt_z_shift = 0.; // Z-shift applied during slicing (min_z_rotated, typically negative) + int m_remap_x = 0; + int m_remap_y = 1; + int m_remap_z = 2; + Vec3d m_build_vol_max = Vec3d::Zero(); double m_current_speed; bool m_is_first_layer = true; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 98532bccc7..9bc5e0a782 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1010,7 +1010,11 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", - "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "gcode_flavor", + "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "belt_shear_x", "belt_shear_x_angle", "belt_shear_x_from", + "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", + "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", + "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", + "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", "gcode_flavor", "fan_kickstart", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", "printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 7eea294d4e..a722a3bae7 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -289,6 +289,44 @@ static t_config_enum_values s_keys_map_SlicingMode { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SlicingMode) +static t_config_enum_values s_keys_map_BeltShearMode { + { "none", int(BeltShearMode::None) }, + { "pos_cot", int(BeltShearMode::PosCot) }, + { "neg_cot", int(BeltShearMode::NegCot) }, + { "pos_tan", int(BeltShearMode::PosTan) }, + { "neg_tan", int(BeltShearMode::NegTan) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltShearMode) + +static t_config_enum_values s_keys_map_BeltAxis { + { "x", int(BeltAxis::X) }, + { "y", int(BeltAxis::Y) }, + { "z", int(BeltAxis::Z) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltAxis) + +static t_config_enum_values s_keys_map_BeltScaleMode { + { "none", int(BeltScaleMode::None) }, + { "inv_sin", int(BeltScaleMode::InvSin) }, + { "inv_cos", int(BeltScaleMode::InvCos) }, + { "sin", int(BeltScaleMode::Sin) }, + { "cos", int(BeltScaleMode::Cos) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltScaleMode) + +static t_config_enum_values s_keys_map_BeltRemapAxis { + { "pos_x", int(BeltRemapAxis::PosX) }, + { "pos_y", int(BeltRemapAxis::PosY) }, + { "pos_z", int(BeltRemapAxis::PosZ) }, + { "neg_x", int(BeltRemapAxis::NegX) }, + { "neg_y", int(BeltRemapAxis::NegY) }, + { "neg_z", int(BeltRemapAxis::NegZ) }, + { "rev_x", int(BeltRemapAxis::RevX) }, + { "rev_y", int(BeltRemapAxis::RevY) }, + { "rev_z", int(BeltRemapAxis::RevZ) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltRemapAxis) + static t_config_enum_values s_keys_map_SupportMaterialPattern { { "rectilinear", smpRectilinear }, { "rectilinear-grid", smpRectilinearGrid }, @@ -5974,6 +6012,103 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(true)); + // Per-axis shear controls for belt printer + auto add_belt_shear_mode = [this](const char *key, const char *label, BeltShearMode default_mode) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Shear function applied to this axis in belt printer mode."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "pos_cot", "neg_cot", "pos_tan", "neg_tan"}; + def->enum_labels = {L("None"), L("+cot(α)"), L("-cot(α)"), L("+tan(α)"), L("-tan(α)")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(default_mode)); + }; + auto add_belt_shear_angle = [this](const char *key, const char *label) { + auto def = this->add(key, coFloat); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Angle (degrees) for the shear function on this axis."); + def->sidetext = L("°"); + def->min = 0.1; + def->max = 89.9; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(45)); + }; + auto add_belt_axis_enum = [this](const char *key, const char *label, const char *tooltip, BeltAxis default_axis) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L(tooltip); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"x", "y", "z"}; + def->enum_labels = {L("X"), L("Y"), L("Z")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(default_axis)); + }; + + add_belt_shear_mode("belt_shear_x", "Function", BeltShearMode::None); + add_belt_shear_angle("belt_shear_x_angle", "Angle"); + add_belt_axis_enum("belt_shear_x_from", "From", "Source axis for X shear.", BeltAxis::Z); + + add_belt_shear_mode("belt_shear_y", "Function", BeltShearMode::PosCot); + add_belt_shear_angle("belt_shear_y_angle", "Angle"); + add_belt_axis_enum("belt_shear_y_from", "From", "Source axis for Y shear.", BeltAxis::Z); + + add_belt_shear_mode("belt_shear_z", "Function", BeltShearMode::None); + add_belt_shear_angle("belt_shear_z_angle", "Angle"); + add_belt_axis_enum("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y); + + // Per-axis scale controls for belt printer + auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Scale factor applied to this axis in belt printer mode."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "inv_sin", "inv_cos", "sin", "cos"}; + def->enum_labels = {L("None"), L("1/sin(α)"), L("1/cos(α)"), L("sin(α)"), L("cos(α)")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(default_mode)); + }; + auto add_belt_scale_angle = [this](const char *key, const char *label) { + auto def = this->add(key, coFloat); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Angle (degrees) for the scale function on this axis."); + def->sidetext = L("°"); + def->min = 0.1; + def->max = 89.9; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(45)); + }; + + add_belt_scale_mode("belt_scale_x", "Function", BeltScaleMode::None); + add_belt_scale_angle("belt_scale_x_angle", "Angle"); + + add_belt_scale_mode("belt_scale_y", "Function", BeltScaleMode::None); + add_belt_scale_angle("belt_scale_y_angle", "Angle"); + + add_belt_scale_mode("belt_scale_z", "Function", BeltScaleMode::None); + add_belt_scale_angle("belt_scale_z_angle", "Angle"); + + // G-code axis remap with sign + auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, BeltRemapAxis default_axis) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L(tooltip); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"pos_x", "pos_y", "pos_z", "neg_x", "neg_y", "neg_z", "rev_x", "rev_y", "rev_z"}; + def->enum_labels = {L("+X"), L("+Y"), L("+Z"), L("-X"), L("-Y"), L("-Z"), L("Rev X"), L("Rev Y"), L("Rev Z")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(default_axis)); + }; + + add_belt_remap("belt_gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output.", BeltRemapAxis::PosX); + add_belt_remap("belt_gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output.", BeltRemapAxis::PosY); + add_belt_remap("belt_gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output.", BeltRemapAxis::PosZ); + def = this->add("tree_support_branch_angle", coFloat); def->label = L("Tree support branch angle"); def->category = L("Support"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index f36b5d3e93..4f149d9c8b 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -157,6 +157,38 @@ enum class SlicingMode CloseHoles, }; +enum class BeltShearMode +{ + None, // No shear on this axis + PosCot, // += cot(α) + NegCot, // -= cot(α) + PosTan, // += tan(α) + NegTan, // -= tan(α) +}; + +enum class BeltScaleMode +{ + None, // No scaling (factor = 1) + InvSin, // 1/sin(α) + InvCos, // 1/cos(α) + Sin, // sin(α) + Cos, // cos(α) +}; + +enum class BeltAxis +{ + X = 0, + Y = 1, + Z = 2, +}; + +enum class BeltRemapAxis +{ + PosX = 0, PosY = 1, PosZ = 2, + NegX = 3, NegY = 4, NegZ = 5, + RevX = 6, RevY = 7, RevZ = 8, // Reversed: max - pos +}; + enum SupportMaterialPattern { smpDefault, smpRectilinear, smpRectilinearGrid, smpHoneycomb, @@ -500,6 +532,10 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(NoiseType) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(InfillPattern) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(IroningType) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SlicingMode) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltShearMode) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltScaleMode) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltAxis) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltRemapAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialPattern) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialStyle) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialInterfacePattern) @@ -1417,6 +1453,24 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionBool, belt_printer)) ((ConfigOptionFloat, belt_printer_angle)) ((ConfigOptionBool, belt_printer_infinite_y)) + ((ConfigOptionEnum, belt_shear_x)) + ((ConfigOptionFloat, belt_shear_x_angle)) + ((ConfigOptionEnum, belt_shear_x_from)) + ((ConfigOptionEnum, belt_shear_y)) + ((ConfigOptionFloat, belt_shear_y_angle)) + ((ConfigOptionEnum, belt_shear_y_from)) + ((ConfigOptionEnum, belt_shear_z)) + ((ConfigOptionFloat, belt_shear_z_angle)) + ((ConfigOptionEnum, belt_shear_z_from)) + ((ConfigOptionEnum, belt_scale_x)) + ((ConfigOptionFloat, belt_scale_x_angle)) + ((ConfigOptionEnum, belt_scale_y)) + ((ConfigOptionFloat, belt_scale_y_angle)) + ((ConfigOptionEnum, belt_scale_z)) + ((ConfigOptionFloat, belt_scale_z_angle)) + ((ConfigOptionEnum, belt_gcode_remap_x)) + ((ConfigOptionEnum, belt_gcode_remap_y)) + ((ConfigOptionEnum, belt_gcode_remap_z)) //BBS ((ConfigOptionInts, additional_cooling_fan_speed)) ((ConfigOptionBool, reduce_crossing_wall)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 08ff847951..abd309fbff 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -3392,14 +3392,55 @@ void PrintObject::update_slicing_parameters() // Orca: updated function call for XYZ shrinkage compensation if (!m_slicing_params.valid) { coordf_t object_height = this->model_object()->max_z(); - if (this->print()->config().belt_printer.value) { - // After mesh rotation R(-alpha, X), effective height in the slicing - // direction is y_extent*sin(a) + z_extent*cos(a). - double angle_rad = Geometry::deg2rad(this->print()->config().belt_printer_angle.value); - BoundingBoxf3 bb = this->model_object()->raw_bounding_box(); - object_height = bb.size().y() * std::sin(angle_rad) + bb.size().z() * std::cos(angle_rad); + // Belt shear/scale may change the effective Z height. + const auto &pcfg = this->print()->config(); + if (pcfg.belt_printer.value) { + bool has_z_shear = pcfg.belt_shear_z.value != BeltShearMode::None; + bool has_z_scale = pcfg.belt_scale_z.value != BeltScaleMode::None; + if (has_z_shear || has_z_scale) { + auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + }; + auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } + }; + double shear_factor = has_z_shear ? compute_shear_factor(pcfg.belt_shear_z.value, pcfg.belt_shear_z_angle.value) : 0.; + double scale_z = compute_scale_factor(pcfg.belt_scale_z.value, pcfg.belt_scale_z_angle.value); + if (has_z_shear && std::abs(shear_factor) > EPSILON) { + int from = int(pcfg.belt_shear_z_from.value); + BoundingBoxf3 bb = this->model_object()->raw_bounding_box(); + double min_rz = std::numeric_limits::max(); + double max_rz = std::numeric_limits::lowest(); + for (double vz : {bb.min.z(), bb.max.z()}) + for (double vs : {bb.min(from), bb.max(from)}) { + double new_z = scale_z * (vz + shear_factor * vs); + min_rz = std::min(min_rz, new_z); + max_rz = std::max(max_rz, new_z); + } + object_height = max_rz - min_rz; + } else { + object_height *= scale_z; + } + } } - m_slicing_params = SlicingParameters::create_from_config(this->print()->config(), m_config, object_height, + m_slicing_params = SlicingParameters::create_from_config(pcfg, m_config, object_height, this->object_extruders(), this->print()->shrinkage_compensation()); } } @@ -3441,9 +3482,51 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full if (object_max_z <= 0.f) { BoundingBoxf3 bb = model_object.raw_bounding_box(); object_max_z = (float)bb.size().z(); + // Belt shear/scale may change the effective Z height. if (print_config.belt_printer.value) { - double angle_rad = Geometry::deg2rad(print_config.belt_printer_angle.value); - object_max_z = (float)(bb.size().y() * std::sin(angle_rad) + bb.size().z() * std::cos(angle_rad)); + bool has_z_shear = print_config.belt_shear_z.value != BeltShearMode::None; + bool has_z_scale = print_config.belt_scale_z.value != BeltScaleMode::None; + if (has_z_shear || has_z_scale) { + auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + }; + auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } + }; + double shear_factor = has_z_shear ? compute_shear_factor(print_config.belt_shear_z.value, print_config.belt_shear_z_angle.value) : 0.; + double scale_z = compute_scale_factor(print_config.belt_scale_z.value, print_config.belt_scale_z_angle.value); + if (has_z_shear && std::abs(shear_factor) > EPSILON) { + int from = int(print_config.belt_shear_z_from.value); + double min_rz = std::numeric_limits::max(); + double max_rz = std::numeric_limits::lowest(); + for (double vz : {bb.min.z(), bb.max.z()}) + for (double vs : {bb.min(from), bb.max(from)}) { + double new_z = scale_z * (vz + shear_factor * vs); + min_rz = std::min(min_rz, new_z); + max_rz = std::max(max_rz, new_z); + } + object_max_z = (float)(max_rz - min_rz); + } else { + object_max_z *= (float)scale_z; + } + } } } return SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 2748151aa0..294c245eaa 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -141,23 +141,69 @@ static std::vector slice_volumes_inner( params_base.extra_offset = 0; params_base.trafo = object_trafo; if (print_config.belt_printer.value) { - double angle_rad = Geometry::deg2rad(print_config.belt_printer_angle.value); - // Rotate mesh by -alpha about X so horizontal slice planes = gantry-parallel planes. - // The gantry (XY) is tilted by belt_printer_angle; this rotation aligns it with horizontal. - Transform3d belt_rotation = Transform3d::Identity(); - belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); - params_base.trafo = belt_rotation * params_base.trafo; - // Compute Z-shift from model_volumes: find min-Z of all rotated meshes - // so the rotated geometry starts at Z=0 (the belt surface in slicing frame). - double min_z_rotated = std::numeric_limits::max(); - for (const ModelVolume *mv : model_volumes) { - if (!model_volume_needs_slicing(*mv)) continue; - BoundingBoxf3 bb = mv->mesh().bounding_box(); - bb = bb.transformed(params_base.trafo * mv->get_matrix()); - min_z_rotated = std::min(min_z_rotated, bb.min.z()); + // Build per-axis shear matrix from 3 independent axis configs. + auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + }; + + struct AxisShear { BeltShearMode mode; double angle; int from; }; + AxisShear axes[3] = { + { print_config.belt_shear_x.value, print_config.belt_shear_x_angle.value, int(print_config.belt_shear_x_from.value) }, + { print_config.belt_shear_y.value, print_config.belt_shear_y_angle.value, int(print_config.belt_shear_y_from.value) }, + { print_config.belt_shear_z.value, print_config.belt_shear_z_angle.value, int(print_config.belt_shear_z_from.value) }, + }; + + Transform3d belt_shear = Transform3d::Identity(); + bool has_shear = false; + for (int row = 0; row < 3; ++row) { + if (axes[row].mode != BeltShearMode::None) { + double factor = compute_shear_factor(axes[row].mode, axes[row].angle); + if (std::abs(factor) > EPSILON) { + belt_shear.matrix()(row, axes[row].from) += factor; + has_shear = true; + } + } } - if (min_z_rotated != std::numeric_limits::max() && std::abs(min_z_rotated) > EPSILON) - params_base.trafo = Eigen::Translation3d(0, 0, -min_z_rotated) * params_base.trafo; + + // Build per-axis scale matrix. + auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } + }; + + Transform3d belt_scale = Transform3d::Identity(); + bool has_scale = false; + double sx = compute_scale_factor(print_config.belt_scale_x.value, print_config.belt_scale_x_angle.value); + double sy = compute_scale_factor(print_config.belt_scale_y.value, print_config.belt_scale_y_angle.value); + double sz = compute_scale_factor(print_config.belt_scale_z.value, print_config.belt_scale_z_angle.value); + if (std::abs(sx - 1.) > EPSILON || std::abs(sy - 1.) > EPSILON || std::abs(sz - 1.) > EPSILON) { + belt_scale.matrix()(0, 0) = sx; + belt_scale.matrix()(1, 1) = sy; + belt_scale.matrix()(2, 2) = sz; + has_scale = true; + } + + // Apply: scale * shear * trafo (shear first, then scale). + if (has_shear || has_scale) + params_base.trafo = belt_scale * belt_shear * params_base.trafo; } //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index dd66c918a7..25b4ba4e9c 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1271,7 +1271,7 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const m_max_print_height = gcode_result.printable_height; m_z_offset = gcode_result.z_offset; - m_belt_z_shift = gcode_result.belt_z_shift; + // load_toolpaths(gcode_result, build_volume, exclude_bounding_box); @@ -2210,15 +2210,17 @@ void GCodeViewer::render_toolpaths() { const Camera& camera = wxGetApp().plater()->get_camera(); Matrix4f view = camera.get_view_matrix().matrix().cast(); - // Belt "raw" view: apply slicing rotation to view matrix so toolpaths appear - // in the slicing frame (rotated part with horizontal layers). - if (m_belt_show_raw && m_belt_view_enabled && m_belt_angle_deg > 0.f) { + // Belt "designed" view: apply inverse shear to view matrix so toolpaths appear + // upright (as originally designed) instead of sheared on the belt. + if (m_belt_show_designed && m_belt_view_enabled && m_belt_angle_deg > 0.f) { double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle_deg)); - // Apply R(-alpha, X) * T(0,0,-z_shift) to bring machine coords back to slicing frame. - Transform3d slicing_trafo = Transform3d::Identity(); - slicing_trafo.translate(Vec3d(0., 0., -static_cast(m_belt_z_shift))); - slicing_trafo = Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX()) * slicing_trafo; - view = (camera.get_view_matrix() * slicing_trafo).matrix().cast(); + double sin_a = std::sin(angle_rad); + if (sin_a > 1e-6) { + double cot_alpha = std::cos(angle_rad) / sin_a; + Transform3d inverse_shear = Transform3d::Identity(); + inverse_shear.matrix()(1, 2) = -cot_alpha; // Y -= Z * cot(α) + view = (camera.get_view_matrix() * inverse_shear).matrix().cast(); + } } const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(view); const libvgcode::Mat4x4 converted_projetion_matrix = libvgcode::convert(static_cast(camera.get_projection_matrix().matrix().cast())); @@ -4421,7 +4423,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv ImGui::Spacing(); ImGui::Dummy({ window_padding, 0 }); ImGui::SameLine(); - ImGui::Checkbox("Show raw G-code (slicing frame)", &m_belt_show_raw); + ImGui::Checkbox("Show designed view (upright)", &m_belt_show_designed); } legend_height = ImGui::GetCurrentWindow()->Size.y; diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index 4bd3746991..184c56e915 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -239,8 +239,7 @@ mutable bool m_no_render_path { false }; bool m_belt_view_enabled = false; float m_belt_angle_deg = 0.f; - float m_belt_z_shift = 0.f; - bool m_belt_show_raw = false; // Toggle: show raw slicing-frame G-code (rotated part) + bool m_belt_show_designed = false; // Toggle: show designed (upright) view via inverse shear libvgcode::Viewer m_viewer; bool m_loaded_as_preview{ false }; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index fafe46c952..87e97c5ff7 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4369,6 +4369,53 @@ void TabPrinter::build_fff() optgroup->append_single_option_line("belt_printer"); optgroup->append_single_option_line("belt_printer_angle"); optgroup->append_single_option_line("belt_printer_infinite_y"); + // Per-axis shear: group mode + angle + source on one row per axis + { + Line line = { L("Shear X"), L("Shear applied to the X axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_x")); + line.append_option(optgroup->get_option("belt_shear_x_angle")); + line.append_option(optgroup->get_option("belt_shear_x_from")); + optgroup->append_line(line); + } + { + Line line = { L("Shear Y"), L("Shear applied to the Y axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_y")); + line.append_option(optgroup->get_option("belt_shear_y_angle")); + line.append_option(optgroup->get_option("belt_shear_y_from")); + optgroup->append_line(line); + } + { + Line line = { L("Shear Z"), L("Shear applied to the Z axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_z")); + line.append_option(optgroup->get_option("belt_shear_z_angle")); + line.append_option(optgroup->get_option("belt_shear_z_from")); + optgroup->append_line(line); + } + { + Line line = { L("Scale X"), L("Scale applied to the X axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_x")); + line.append_option(optgroup->get_option("belt_scale_x_angle")); + optgroup->append_line(line); + } + { + Line line = { L("Scale Y"), L("Scale applied to the Y axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_y")); + line.append_option(optgroup->get_option("belt_scale_y_angle")); + optgroup->append_line(line); + } + { + Line line = { L("Scale Z"), L("Scale applied to the Z axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_z")); + line.append_option(optgroup->get_option("belt_scale_z_angle")); + optgroup->append_line(line); + } + { + Line line = { L("G-code axis remap"), L("Remap slicing-frame axes to machine axes in G-code output") }; + line.append_option(optgroup->get_option("belt_gcode_remap_x")); + line.append_option(optgroup->get_option("belt_gcode_remap_y")); + line.append_option(optgroup->get_option("belt_gcode_remap_z")); + optgroup->append_line(line); + } optgroup->append_single_option_line("support_multi_bed_types","printer_basic_information_printable_space#support-multi-bed-types"); optgroup->append_single_option_line("best_object_pos", "printer_basic_information_printable_space#best-object-position"); // todo: for multi_extruder test @@ -5232,6 +5279,10 @@ void TabPrinter::toggle_options() bool is_belt = m_config->opt_bool("belt_printer"); toggle_line("belt_printer_angle", is_belt); toggle_line("belt_printer_infinite_y", is_belt); + for (auto el : {"belt_shear_x", "belt_shear_y", "belt_shear_z", + "belt_scale_x", "belt_scale_y", "belt_scale_z", + "belt_gcode_remap_x"}) + toggle_line(el, is_belt); } From 7ff6bc42b14ce245b14c53c0c18bc79e892dea99 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 18 Mar 2026 12:09:28 -0500 Subject: [PATCH 005/389] Part 2.6: Add belt floor support clipping for all support types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix support clipping z-shift calculation by removing coordinate-space mismatch and sync belt_floor_z_shift with global_z_offset; fix invalidation so posSupportMaterial no longer resets slicing params - Add belt floor polygon clipping to non-organic tree support (slim/strong/hybrid) with collision surface integration in TreeSupportData, belt extension layers, and first-layer brim suppression - Add belt floor clipping to organic tree support pipeline with virtual belt raft layers, per-layer polygons in TreeModelVolumes, and post-generation layer trimming; fix pre-existing processing_last_mesh bug in calculateCollision() Fix belt floor support clipping: z-shift, invalidation, and global offset - Fix support clipping z-shift calculation by removing coordinate-space mismatch (raw_bounding_box min.z vs trafo_centered m_belt_min_z) and sync belt_floor_z_shift with global_z_offset in global shear mode - Fix invalidation so posSupportMaterial no longer resets slicing params, preventing the exact posSlice z-shift from being overwritten by the bounding-box approximation on support-only setting changes - Remove double-counting of global z_offset on support layers — support already inherits the offset from object layers during generation This Work Was Co-Authored-By Claude Opus 4.6 (1M context) UI: gray out inactive belt sub-options, rename to mesh transforms, move to Advanced Fix mesh clipping through build plate after belt shear/scale transform Generalize G-code viewer designed-view toggle for full belt transform Clip support layers to transformed belt floor plane Supports below the tilted build plate (Z = shear_factor * from_axis - min_z) are now clipped via half-plane intersection after generation. Belt floor parameters stored in SlicingParameters and populated in both update_slicing_parameters() and the static slicing_parameters() overload. Make belt G-code viewer toggle more prominent, add B keyboard shortcut - Add separator + teal "Belt Printer" header in legend panel - Append [B] hint to checkbox label - Add B key shortcut in GLCanvas3D to toggle designed/machine view - Read belt_printer_angle from loaded G-code headers to enable belt view Add per-axis global transform option for belt printer shear New belt_shear_{x,y,z}_global bool configs. When enabled, shear incorporates instance shift so objects at different bed positions get position-aware transform (Z += factor * instance_shift_on_from_axis). Fix global shear: use layer Z offset instead of mesh transform, add config invalidation - Global shear offset applied as post-slicing layer print_z adjustment instead of mesh transform (which was absorbed by min_z normalization or shifted mesh out of slice range) - Register all belt transform options in Print::invalidate_state_by_config_options to trigger posSlice re-slicing (the fallback only invalidated Print steps, not PrintObject steps — belt changes had no effect without manual re-slice) - Belt gcode remap options added to steps_gcode (gcode-export only) - Skip empty-first-layer check for belt objects with global Z offset WIP: split instances for global shear, relative Z offsets, debug logging - PrintApply: when belt global mode active, prevent instance grouping by adding unique Z perturbation to trafo — each copy becomes its own PrintObject with independent layers - PrintObjectSlice: compute global Z offset relative to minimum Y shift across all PrintObjects (lowest-Y object stays at Z=0) - Debug logging (warning level) for belt global shift values and offsets Known issues: - Cached posSlice results cause stale offsets when mixing copies with individually-added objects — need to compute min baseline outside slice() - Supports still generate to Z=0 instead of object's global Z offset Fix global shear for copied objects: disable shared-object layer optimization When belt global Z shear is active, each object needs unique layer Z values based on its bed position. The shared-object optimization was causing copies to reuse the source object's layers (and its Z offset) instead of computing their own position-based offset. started work on getting supports to work properly one step forward, one step back this version didn't quite work. Getting somewhere though about to add UI controllable tests added configuration options for supports tweak CLAUDE.md to be more aggressive for my machine. This commit should probably be pulled out before contributing upstream still chasing down some bugs moving objects between slices no longer results in improper Z-height because of caching added more data to the debug logs Z offset is getting more global again still not quite there, I think there's a fundamental logic flaw? hunting for bugs finally have a functional fix Add belt floor clipping to tree supports (organic and non-organic) - Add belt floor polygon clipping to non-organic tree support (slim/strong/hybrid) in draw_circles() and terminate nodes at the belt surface instead of the horizontal build plate - Add belt floor clipping to organic tree support pipeline with virtual belt raft layers for sub-floor branch generation, per-layer belt floor polygons in TreeModelVolumes, and post-generation layer trimming - Fix pre-existing processing_last_mesh bug in TreeModelVolumes that prevented m_anti_overhang (support blockers) from ever being applied; skip empty first layer check for belt printers Commits: current approach: make a face surface to build supports to closer! supports now terminate on shear plane, now need to get shear plane to correct Z height nearly there chasing down logic issues still committing for checkpoint, this still does not work still got logic problems... cull support clipping stashing changes for now. Going to focus on getting the global shear OFF support generation dialed first. beginning per object shear calcs Local shear transform is on correct Z offset now local shear finally works now and needs more testing global shear works now, needs thorough testing debugging non-45 degree angles debugging part 2 supports at all angles work now remove debug logging Add belt floor collision to non-organic tree support pipeline - Integrate belt floor as a collision surface in TreeSupportData so branches route around the belt naturally, replacing the explicit termination checks in drop_nodes() - Add belt extension layers below the object after draw_circles() to allow support geometry to extend to the diagonal belt surface instead of terminating at a horizontal first layer - Fix coordinate overflow in belt floor polygons (scale_(1e4) exceeds int32), skip first-layer brim expansion for belt printers, and extend empty first layer check bypass to all belt modes add debug logging, Z translate for tree supports still not seeing any cutoff surface yet adding debug options attempt #2 at trees if hit Z buildplate stop but don't set to_buildplate true getting closer tree support almost there, just need to get rid of the circles at the beginning getting closer belt / shear plane clip works, need to figure out the buidlplate plane issues more logic, added debugging logs supports now extend somewhat below Z=0 in global shear mode fix bad alloc, add 10mm below build plate fully works now shear transform + prusa tree support generation works now. pull out debug logging --- CLAUDE.md | 22 +- src/libslic3r/BuildVolume.hpp | 2 +- src/libslic3r/GCode.cpp | 30 ++- src/libslic3r/GCode/GCodeProcessor.cpp | 78 ++++++ src/libslic3r/GCode/GCodeProcessor.hpp | 33 +++ src/libslic3r/Preset.cpp | 10 +- src/libslic3r/Print.cpp | 62 ++++- src/libslic3r/Print.hpp | 10 +- src/libslic3r/PrintApply.cpp | 30 ++- src/libslic3r/PrintConfig.cpp | 64 +++++ src/libslic3r/PrintConfig.hpp | 23 ++ src/libslic3r/PrintObject.cpp | 116 ++++++++- src/libslic3r/PrintObjectSlice.cpp | 124 ++++++++- src/libslic3r/Slicing.hpp | 7 + src/libslic3r/Support/SupportCommon.hpp | 6 + src/libslic3r/Support/SupportMaterial.cpp | 290 ++++++++++++++++++++- src/libslic3r/Support/TreeModelVolumes.cpp | 117 ++++++++- src/libslic3r/Support/TreeModelVolumes.hpp | 3 + src/libslic3r/Support/TreeSupport.cpp | 98 ++++++- src/libslic3r/Support/TreeSupport.hpp | 4 + src/libslic3r/Support/TreeSupport3D.cpp | 74 ++++++ src/slic3r/GUI/GCodeViewer.cpp | 26 +- src/slic3r/GUI/GCodeViewer.hpp | 4 + src/slic3r/GUI/GLCanvas3D.cpp | 12 +- src/slic3r/GUI/GUI_ObjectList.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 86 +++++- src/slic3r/GUI/Tab.cpp | 141 ++++++---- 27 files changed, 1337 insertions(+), 137 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 25aa516a56..9bd162c42c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -23,27 +23,7 @@ cmake --build build/arm64 --config RelWithDebInfo --target all -- ### Building on Linux **Always use this command to build the project when testing build issues on Linux.** ```bash -cmake --build build/arm64 --config RelWithDebInfo --target all -- - -``` -### Build test: - -**Always use this command to build the project when testing build issues on Windows.** -```bash -cmake --build . --config %build_type% --target ALL_BUILD -- -m -``` - -### Building on macOS -**Always use this command to build the project when testing build issues on macOS.** -```bash -cmake --build build/arm64 --config RelWithDebInfo --target all -- -``` - -### Building on Linux - **Always use this command to build the project when testing build issues on Linux.** -```bash -cmake --build build --config RelWithDebInfo --target all -- - +systemd-run --user --scope -p MemoryMax=48G cmake --build build --config RelWithDebInfo --target all -- -j18 -l 24 ``` diff --git a/src/libslic3r/BuildVolume.hpp b/src/libslic3r/BuildVolume.hpp index 0494efe9ba..2b0d8c2746 100644 --- a/src/libslic3r/BuildVolume.hpp +++ b/src/libslic3r/BuildVolume.hpp @@ -84,7 +84,7 @@ public: indexed_triangle_set bounding_mesh(bool scale=true) const; // Center of the print bed, unscaled. - Vec2d bed_center() const { return to_2d(m_bboxf.center()); } + Vec2d bed_center() const { return get_extents(m_bed_shape).center(); } // Convex hull of polygon(), scaled. const Polygon& convex_hull() const { return m_convex_hull; } // Smallest enclosing circle of polygon(), scaled. diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 02a233e988..41cfa7b72a 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1745,8 +1745,16 @@ std::vector GCode::collect_layers_to_print(const PrintObjec // Check that there are extrusions on the very first layer. The case with empty // first layer may result in skirt/brim in the air and maybe other issues. + // Skip this check for belt printers. The shear transform tilts the + // model so the first horizontal layer plane intersects only a thin + // sliver of the model (width ≈ first_layer_height / shear_factor). + // This sliver is often narrower than the nozzle diameter, producing + // zero perimeters and an empty first layer — which is expected, not + // an error. In global shear mode the object may also start above + // Z=0 on the tilted belt surface. if (layers_to_print.size() == 1u) { - if (!has_extrusions) + bool skip_empty_check = object.print()->config().belt_printer.value; + if (!has_extrusions && !skip_empty_check) throw Slic3r::SlicingError(_(L("One object has an empty first layer and can't be printed. Please Cut the bottom or enable supports.")), object.id().id); } @@ -2515,9 +2523,27 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format("; HEADER_BLOCK_START\n"); // Write information on the generator. file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str()); - // Belt printer: embed angle in header for G-code processor detection. + // Belt printer: embed angle and transform configs in header for G-code processor detection. if (print.config().belt_printer.value) { file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); + // Shear configs + const auto &full_cfg = print.full_print_config(); + file.write_format("; belt_shear_x = %s\n", full_cfg.opt_serialize("belt_shear_x").c_str()); + file.write_format("; belt_shear_x_angle = %.1f\n", print.config().belt_shear_x_angle.value); + file.write_format("; belt_shear_x_from = %s\n", full_cfg.opt_serialize("belt_shear_x_from").c_str()); + file.write_format("; belt_shear_y = %s\n", full_cfg.opt_serialize("belt_shear_y").c_str()); + file.write_format("; belt_shear_y_angle = %.1f\n", print.config().belt_shear_y_angle.value); + file.write_format("; belt_shear_y_from = %s\n", full_cfg.opt_serialize("belt_shear_y_from").c_str()); + file.write_format("; belt_shear_z = %s\n", full_cfg.opt_serialize("belt_shear_z").c_str()); + file.write_format("; belt_shear_z_angle = %.1f\n", print.config().belt_shear_z_angle.value); + file.write_format("; belt_shear_z_from = %s\n", full_cfg.opt_serialize("belt_shear_z_from").c_str()); + // Scale configs + file.write_format("; belt_scale_x = %s\n", full_cfg.opt_serialize("belt_scale_x").c_str()); + file.write_format("; belt_scale_x_angle = %.1f\n", print.config().belt_scale_x_angle.value); + file.write_format("; belt_scale_y = %s\n", full_cfg.opt_serialize("belt_scale_y").c_str()); + file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); + file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); + file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); } if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 7ac3a1ffc4..8def7c08db 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3051,6 +3051,84 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers } catch (...) {} return; } + // Belt printer: parse shear configs from header comments. + { + auto parse_shear_mode = [](const std::string &s) -> BeltShearMode { + if (s == "pos_cot") return BeltShearMode::PosCot; + if (s == "neg_cot") return BeltShearMode::NegCot; + if (s == "pos_tan") return BeltShearMode::PosTan; + if (s == "neg_tan") return BeltShearMode::NegTan; + return BeltShearMode::None; + }; + auto parse_axis = [](const std::string &s) -> BeltAxis { + if (s == "y") return BeltAxis::Y; + if (s == "z") return BeltAxis::Z; + return BeltAxis::X; + }; + auto parse_scale_mode = [](const std::string &s) -> BeltScaleMode { + if (s == "inv_sin") return BeltScaleMode::InvSin; + if (s == "inv_cos") return BeltScaleMode::InvCos; + if (s == "sin") return BeltScaleMode::Sin; + if (s == "cos") return BeltScaleMode::Cos; + return BeltScaleMode::None; + }; + auto trim = [](const std::string &s) -> std::string { + size_t start = s.find_first_not_of(" \t\r\n"); + size_t end = s.find_last_not_of(" \t\r\n"); + return (start == std::string::npos) ? "" : s.substr(start, end - start + 1); + }; + // Shear X + if (boost::starts_with(comment, " belt_shear_x = ")) { + m_result.belt_shear_x = parse_shear_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_shear_x_angle = ")) { + try { m_result.belt_shear_x_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + if (boost::starts_with(comment, " belt_shear_x_from = ")) { + m_result.belt_shear_x_from = parse_axis(trim(std::string(comment.substr(21)))); return; + } + // Shear Y + if (boost::starts_with(comment, " belt_shear_y = ")) { + m_result.belt_shear_y = parse_shear_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_shear_y_angle = ")) { + try { m_result.belt_shear_y_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + if (boost::starts_with(comment, " belt_shear_y_from = ")) { + m_result.belt_shear_y_from = parse_axis(trim(std::string(comment.substr(21)))); return; + } + // Shear Z + if (boost::starts_with(comment, " belt_shear_z = ")) { + m_result.belt_shear_z = parse_shear_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_shear_z_angle = ")) { + try { m_result.belt_shear_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + if (boost::starts_with(comment, " belt_shear_z_from = ")) { + m_result.belt_shear_z_from = parse_axis(trim(std::string(comment.substr(21)))); return; + } + // Scale X + if (boost::starts_with(comment, " belt_scale_x = ")) { + m_result.belt_scale_x = parse_scale_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_scale_x_angle = ")) { + try { m_result.belt_scale_x_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + // Scale Y + if (boost::starts_with(comment, " belt_scale_y = ")) { + m_result.belt_scale_y = parse_scale_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_scale_y_angle = ")) { + try { m_result.belt_scale_y_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + // Scale Z + if (boost::starts_with(comment, " belt_scale_z = ")) { + m_result.belt_scale_z = parse_scale_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_scale_z_angle = ")) { + try { m_result.belt_scale_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + } // wipe start tag if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) { m_wiping = true; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index e432a165a8..f953345f4e 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -229,6 +229,23 @@ class Print; float z_offset; // Belt printer: angle for coordinate transformation in preview. float belt_printer_angle{ 0.f }; + // Belt printer: per-axis shear config. + BeltShearMode belt_shear_x{ BeltShearMode::None }; + float belt_shear_x_angle{ 45.f }; + BeltAxis belt_shear_x_from{ BeltAxis::Y }; + BeltShearMode belt_shear_y{ BeltShearMode::None }; + float belt_shear_y_angle{ 45.f }; + BeltAxis belt_shear_y_from{ BeltAxis::Y }; + BeltShearMode belt_shear_z{ BeltShearMode::None }; + float belt_shear_z_angle{ 45.f }; + BeltAxis belt_shear_z_from{ BeltAxis::Y }; + // Belt printer: per-axis scale config. + BeltScaleMode belt_scale_x{ BeltScaleMode::None }; + float belt_scale_x_angle{ 45.f }; + BeltScaleMode belt_scale_y{ BeltScaleMode::None }; + float belt_scale_y_angle{ 45.f }; + BeltScaleMode belt_scale_z{ BeltScaleMode::None }; + float belt_scale_z_angle{ 45.f }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; @@ -288,6 +305,22 @@ class Print; layer_filaments = other.layer_filaments; filament_change_count_map = other.filament_change_count_map; initial_layer_time = other.initial_layer_time; + belt_printer_angle = other.belt_printer_angle; + belt_shear_x = other.belt_shear_x; + belt_shear_x_angle = other.belt_shear_x_angle; + belt_shear_x_from = other.belt_shear_x_from; + belt_shear_y = other.belt_shear_y; + belt_shear_y_angle = other.belt_shear_y_angle; + belt_shear_y_from = other.belt_shear_y_from; + belt_shear_z = other.belt_shear_z; + belt_shear_z_angle = other.belt_shear_z_angle; + belt_shear_z_from = other.belt_shear_z_from; + belt_scale_x = other.belt_scale_x; + belt_scale_x_angle = other.belt_scale_x_angle; + belt_scale_y = other.belt_scale_y; + belt_scale_y_angle = other.belt_scale_y_angle; + belt_scale_z = other.belt_scale_z; + belt_scale_z_angle = other.belt_scale_z_angle; #if ENABLE_GCODE_VIEWER_STATISTICS time = other.time; #endif diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 9bc5e0a782..9437b6098e 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1010,11 +1010,13 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", - "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "belt_shear_x", "belt_shear_x_angle", "belt_shear_x_from", - "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", - "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", + "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "belt_shear_x", "belt_shear_x_angle", "belt_shear_x_from", "belt_shear_x_global", + "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", "belt_shear_y_global", + "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", "belt_shear_z_global", "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", - "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", "gcode_flavor", + "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", + "belt_support_floor_offset", "belt_support_floor_mode", "belt_support_z_offset_mode", + "gcode_flavor", "fan_kickstart", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", "printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index f245cc32b6..0aef12a74b 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -99,6 +99,10 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n // Cache the plenty of parameters, which influence the G-code generator only, // or they are only notes not influencing the generated G-code. static std::unordered_set steps_gcode = { + // Belt printer G-code axis remap (only affects G-code output, not slicing). + "belt_gcode_remap_x", + "belt_gcode_remap_y", + "belt_gcode_remap_z", //BBS "additional_cooling_fan_speed", "reduce_crossing_wall", @@ -275,8 +279,34 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n // Spiral Vase forces different kind of slicing than the normal model: // In Spiral Vase mode, holes are closed and only the largest area contour is kept at each layer. // Therefore toggling the Spiral Vase on / off requires complete reslicing. - || opt_key == "spiral_mode") { + || opt_key == "spiral_mode" + // Belt printer transform options change the mesh geometry before slicing. + || opt_key == "belt_printer" + || opt_key == "belt_printer_angle" + || opt_key == "belt_shear_x" + || opt_key == "belt_shear_x_angle" + || opt_key == "belt_shear_x_from" + || opt_key == "belt_shear_x_global" + || opt_key == "belt_shear_y" + || opt_key == "belt_shear_y_angle" + || opt_key == "belt_shear_y_from" + || opt_key == "belt_shear_y_global" + || opt_key == "belt_shear_z" + || opt_key == "belt_shear_z_angle" + || opt_key == "belt_shear_z_from" + || opt_key == "belt_shear_z_global" + || opt_key == "belt_scale_x" + || opt_key == "belt_scale_x_angle" + || opt_key == "belt_scale_y" + || opt_key == "belt_scale_y_angle" + || opt_key == "belt_scale_z" + || opt_key == "belt_scale_z_angle") { osteps.emplace_back(posSlice); + } else if ( + opt_key == "belt_support_floor_offset" + || opt_key == "belt_support_floor_mode" + || opt_key == "belt_support_z_offset_mode") { + osteps.emplace_back(posSupportMaterial); } else if ( opt_key == "print_sequence" || opt_key == "filament_type" @@ -2124,15 +2154,21 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) int object_count = m_objects.size(); std::set need_slicing_objects; std::set re_slicing_objects; + // Belt global Z shear: each object needs unique layer Z values based on + // its bed position, so sharing layers between "identical" objects is wrong. + bool belt_no_share = m_config.belt_printer.value && m_config.belt_shear_z_global.value + && m_config.belt_shear_z.value != BeltShearMode::None; if (!use_cache) { for (int index = 0; index < object_count; index++) { PrintObject *obj = m_objects[index]; - for (PrintObject *slicing_obj : need_slicing_objects) - { - if (is_print_object_the_same(obj, slicing_obj)) { - obj->set_shared_object(slicing_obj); - break; + if (!belt_no_share) { + for (PrintObject *slicing_obj : need_slicing_objects) + { + if (is_print_object_the_same(obj, slicing_obj)) { + obj->set_shared_object(slicing_obj); + break; + } } } if (!obj->get_shared_object()) @@ -2151,12 +2187,14 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) PrintObject *obj = m_objects[index]; bool found_shared = false; if (need_slicing_objects.find(obj) == need_slicing_objects.end()) { - for (PrintObject *slicing_obj : need_slicing_objects) - { - if (is_print_object_the_same(obj, slicing_obj)) { - obj->set_shared_object(slicing_obj); - found_shared = true; - break; + if (!belt_no_share) { + for (PrintObject *slicing_obj : need_slicing_objects) + { + if (is_print_object_the_same(obj, slicing_obj)) { + obj->set_shared_object(slicing_obj); + found_shared = true; + break; + } } } if (!found_shared) { diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index b98811c8e3..d0c050f442 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -573,7 +573,15 @@ private: PrintObject* m_shared_object{ nullptr }; - + // Belt printer: global Z offset applied to this object's layers for shear positioning. + double m_belt_global_z_offset { 0.0 }; + // Belt printer: min_z of mesh after belt shear (before Z-shift), for z_offset calc. + double m_belt_min_z { 0.0 }; +public: + double belt_global_z_offset() const { return m_belt_global_z_offset; } +private: + + // SoftFever // // object id diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index d2a44463ea..7f3b41b0f1 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -135,22 +135,29 @@ struct PrintObjectTrafoAndInstances // Generate a list of trafos and XY offsets for instances of a ModelObject // Orca: Updated to include XYZ filament shrinkage compensation -static std::vector print_objects_from_model_object(const ModelObject &model_object, const Vec3d &shrinkage_compensation) +static std::vector print_objects_from_model_object(const ModelObject &model_object, const Vec3d &shrinkage_compensation, bool force_separate_instances = false) { std::set trafos; PrintObjectTrafoAndInstances trafo; //BBS: add useful logs for debug int index = 0; + int unique_counter = 0; for (ModelInstance *model_instance : model_object.instances) { if (model_instance->is_printable()) { // Orca: Updated with XYZ filament shrinkage compensation Geometry::Transformation model_instance_transformation = model_instance->get_transformation(); trafo.trafo = model_instance_transformation.get_matrix_with_applied_shrinkage_compensation(shrinkage_compensation); - + auto shift = Point::new_scale(trafo.trafo.data()[12], trafo.trafo.data()[13]); // Reset the XY axes of the transformation. trafo.trafo.data()[12] = 0; trafo.trafo.data()[13] = 0; + // Belt printer global mode: prevent instance grouping so each + // copy gets its own PrintObject with independent layer Z values. + // Add a tiny unique perturbation to the existing Z (don't replace + // it — the Z translation from ensure_on_bed must be preserved). + if (force_separate_instances) + trafo.trafo.data()[14] += 1e-10 * (++unique_counter); // Search or insert a trafo. auto it = trafos.emplace(trafo).first; const_cast(*it).instances.emplace_back(PrintInstance{ nullptr, model_instance, shift }); @@ -1506,11 +1513,16 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ PrintObjectPtrs print_objects_new; print_objects_new.reserve(std::max(m_objects.size(), m_model.objects.size())); bool new_objects = false; + bool belt_instances_shifted = false; // Walk over all new model objects and check, whether there are matching PrintObjects. for (ModelObject *model_object : m_model.objects) { ModelObjectStatus &model_object_status = const_cast(model_object_status_db.reuse(*model_object)); // Orca: Updated for XYZ filament shrink compensation - model_object_status.print_instances = print_objects_from_model_object(*model_object, this->shrinkage_compensation()); + // Belt global mode: force each instance into its own PrintObject + // so each gets independent layer Z values. + bool belt_force_separate = m_config.belt_printer.value && m_config.belt_shear_z_global.value + && m_config.belt_shear_z.value != BeltShearMode::None; + model_object_status.print_instances = print_objects_from_model_object(*model_object, this->shrinkage_compensation(), belt_force_separate); std::vector old; old.reserve(print_object_status_db.count(*model_object)); for (const PrintObjectStatus &print_object_status : print_object_status_db.get_range(*model_object)) @@ -1558,6 +1570,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ if (status != PrintBase::APPLY_STATUS_UNCHANGED) { size_t extruder_num = new_full_config.option("nozzle_diameter")->size(); update_apply_status(status == PrintBase::APPLY_STATUS_INVALIDATED); + belt_instances_shifted = true; } print_objects_new.emplace_back((*it_old)->print_object); const_cast(*it_old)->status = PrintObjectStatus::Reused; @@ -1593,6 +1606,17 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ update_apply_status(object->invalidate_step(posSlice)); } } + + // Belt printer global mode: when any object's instances shifted, + // recompute m_belt_global_z_offset for ALL objects (it depends on + // min_shift across all objects, so one move affects everyone). + if (belt_instances_shifted + && m_config.belt_printer.value + && m_config.belt_shear_z_global.value + && m_config.belt_shear_z.value != BeltShearMode::None) { + for (PrintObject *object : m_objects) + update_apply_status(object->invalidate_step(posSlice)); + } } //BBS: check the config again diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index a722a3bae7..7d06f96a85 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -327,6 +327,21 @@ static t_config_enum_values s_keys_map_BeltRemapAxis { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltRemapAxis) +static t_config_enum_values s_keys_map_BeltSupportFloorMode { + { "none", int(BeltSupportFloorMode::None) }, + { "generator_only", int(BeltSupportFloorMode::GeneratorOnly) }, + { "clip_only", int(BeltSupportFloorMode::ClipOnly) }, + { "both", int(BeltSupportFloorMode::Both) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltSupportFloorMode) + +static t_config_enum_values s_keys_map_BeltSupportZOffsetMode { + { "none", int(BeltSupportZOffsetMode::None) }, + { "unconditional", int(BeltSupportZOffsetMode::Unconditional) }, + { "raft_only", int(BeltSupportZOffsetMode::RaftOnly) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltSupportZOffsetMode) + static t_config_enum_values s_keys_map_SupportMaterialPattern { { "rectilinear", smpRectilinear }, { "rectilinear-grid", smpRectilinearGrid }, @@ -6047,17 +6062,29 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionEnum(default_axis)); }; + auto add_belt_shear_global = [this](const char *key, const char *label) { + auto def = this->add(key, coBool); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Apply shear in global coordinates (position-aware) rather than object-local coordinates."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + }; + add_belt_shear_mode("belt_shear_x", "Function", BeltShearMode::None); add_belt_shear_angle("belt_shear_x_angle", "Angle"); add_belt_axis_enum("belt_shear_x_from", "From", "Source axis for X shear.", BeltAxis::Z); + add_belt_shear_global("belt_shear_x_global", "Global"); add_belt_shear_mode("belt_shear_y", "Function", BeltShearMode::PosCot); add_belt_shear_angle("belt_shear_y_angle", "Angle"); add_belt_axis_enum("belt_shear_y_from", "From", "Source axis for Y shear.", BeltAxis::Z); + add_belt_shear_global("belt_shear_y_global", "Global"); add_belt_shear_mode("belt_shear_z", "Function", BeltShearMode::None); add_belt_shear_angle("belt_shear_z_angle", "Angle"); add_belt_axis_enum("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y); + add_belt_shear_global("belt_shear_z_global", "Global"); // Per-axis scale controls for belt printer auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode) { @@ -6109,6 +6136,43 @@ void PrintConfigDef::init_fff_params() add_belt_remap("belt_gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output.", BeltRemapAxis::PosY); add_belt_remap("belt_gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output.", BeltRemapAxis::PosZ); + // Belt support floor debug controls + def = this->add("belt_support_floor_offset", coFloat); + def->label = L("Floor Z offset"); + def->category = L("Printable space"); + def->tooltip = L("Shifts the computed belt floor up or down (mm). Negative values lower the floor, allowing more supports to survive. Use this to diagnose belt floor formula issues."); + def->sidetext = L("mm"); + def->min = -500; + def->max = 500; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0)); + + { + auto def = this->add("belt_support_floor_mode", coEnum); + def->label = L("Floor mode"); + def->category = L("Printable space"); + def->tooltip = L("Controls belt floor awareness for supports. 'None' disables belt floor logic. " + "'Generator only' stops support generation at the belt floor plane."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "generator_only"}; + def->enum_labels = {L("None"), L("Generator only")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(BeltSupportFloorMode::GeneratorOnly)); + } + + { + auto def = this->add("belt_support_z_offset_mode", coEnum); + def->label = L("Z offset mode"); + def->category = L("Printable space"); + def->tooltip = L("How global Z offset is applied to support layers for belt printers with global shear. " + "'None' = don't offset. 'Unconditional' = offset all layers. 'Raft only' = only offset raft layers."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "unconditional", "raft_only"}; + def->enum_labels = {L("None"), L("Unconditional"), L("Raft only")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(BeltSupportZOffsetMode::Unconditional)); + } + def = this->add("tree_support_branch_angle", coFloat); def->label = L("Tree support branch angle"); def->category = L("Support"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 4f149d9c8b..fc533bf6bb 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -189,6 +189,21 @@ enum class BeltRemapAxis RevX = 6, RevY = 7, RevZ = 8, // Reversed: max - pos }; +enum class BeltSupportFloorMode +{ + None, // No belt floor awareness + GeneratorOnly, // Only in tree support drop_nodes/contact_points + ClipOnly, // Only post-processing clipping + Both, // Both generator and clipping +}; + +enum class BeltSupportZOffsetMode +{ + None, // Don't apply global_z_offset to support layers + Unconditional, // Apply to all support layers + RaftOnly, // Only apply to raft layers +}; + enum SupportMaterialPattern { smpDefault, smpRectilinear, smpRectilinearGrid, smpHoneycomb, @@ -536,6 +551,8 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltShearMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltScaleMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltRemapAxis) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportFloorMode) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportZOffsetMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialPattern) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialStyle) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialInterfacePattern) @@ -1456,12 +1473,15 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, belt_shear_x)) ((ConfigOptionFloat, belt_shear_x_angle)) ((ConfigOptionEnum, belt_shear_x_from)) + ((ConfigOptionBool, belt_shear_x_global)) ((ConfigOptionEnum, belt_shear_y)) ((ConfigOptionFloat, belt_shear_y_angle)) ((ConfigOptionEnum, belt_shear_y_from)) + ((ConfigOptionBool, belt_shear_y_global)) ((ConfigOptionEnum, belt_shear_z)) ((ConfigOptionFloat, belt_shear_z_angle)) ((ConfigOptionEnum, belt_shear_z_from)) + ((ConfigOptionBool, belt_shear_z_global)) ((ConfigOptionEnum, belt_scale_x)) ((ConfigOptionFloat, belt_scale_x_angle)) ((ConfigOptionEnum, belt_scale_y)) @@ -1471,6 +1491,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, belt_gcode_remap_x)) ((ConfigOptionEnum, belt_gcode_remap_y)) ((ConfigOptionEnum, belt_gcode_remap_z)) + ((ConfigOptionFloat, belt_support_floor_offset)) + ((ConfigOptionEnum, belt_support_floor_mode)) + ((ConfigOptionEnum, belt_support_z_offset_mode)) //BBS ((ConfigOptionInts, additional_cooling_fan_speed)) ((ConfigOptionBool, reduce_crossing_wall)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index abd309fbff..f803cc0369 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -9,6 +9,7 @@ #include "MutablePolygon.hpp" #include "PrintConfig.hpp" #include "Support/SupportMaterial.hpp" +#include "Support/SupportCommon.hpp" #include "Support/SupportSpotsGenerator.hpp" #include "Support/TreeSupport.hpp" #include "Surface.hpp" @@ -1365,7 +1366,12 @@ bool PrintObject::invalidate_step(PrintObjectStep step) } else if (step == posSupportMaterial) { invalidated |= this->invalidate_steps({ posSimplifySupportPath }); invalidated |= m_print->invalidate_steps({ psSkirtBrim }); - m_slicing_params.valid = false; + // NOTE: do NOT set m_slicing_params.valid = false here. + // belt_floor_z_shift is patched to an exact value during posSlice + // (PrintObjectSlice.cpp, after slice_volumes). Invalidating slicing + // params here causes update_slicing_parameters() to overwrite that + // exact value with a bounding-box approximation, while posSlice does + // not re-run to correct it — breaking belt support clipping. } // Wipe tower depends on the ordering of extruders, which in turn depends on everything. @@ -3392,6 +3398,10 @@ void PrintObject::update_slicing_parameters() // Orca: updated function call for XYZ shrinkage compensation if (!m_slicing_params.valid) { coordf_t object_height = this->model_object()->max_z(); + // Belt floor parameters for support clipping (populated below if belt Z-shear is active). + double belt_floor_shear_factor_out = 0.0; + int belt_floor_from_axis_out = 1; + double belt_floor_z_shift_out = 0.0; // Belt shear/scale may change the effective Z height. const auto &pcfg = this->print()->config(); if (pcfg.belt_printer.value) { @@ -3435,6 +3445,12 @@ void PrintObject::update_slicing_parameters() max_rz = std::max(max_rz, new_z); } object_height = max_rz - min_rz; + belt_floor_shear_factor_out = shear_factor; + belt_floor_from_axis_out = from; + // Belt contact surface starts at bb.min.z() pre-shear; add the + // slicing Z-shift that keeps the mesh above Z=0. + // Exact value is patched after slice_volumes() in posSlice. + belt_floor_z_shift_out = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); } else { object_height *= scale_z; } @@ -3442,6 +3458,10 @@ void PrintObject::update_slicing_parameters() } m_slicing_params = SlicingParameters::create_from_config(pcfg, m_config, object_height, this->object_extruders(), this->print()->shrinkage_compensation()); + // Populate belt floor parameters into slicing params for support clipping. + m_slicing_params.belt_floor_shear_factor = belt_floor_shear_factor_out; + m_slicing_params.belt_floor_from_axis = belt_floor_from_axis_out; + m_slicing_params.belt_floor_z_shift = belt_floor_z_shift_out; } } @@ -3479,6 +3499,11 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full sort_remove_duplicates(object_extruders); //FIXME add painting extruders + // Belt floor parameters for support clipping (populated below if belt Z-shear is active). + double belt_floor_shear_factor_out = 0.0; + int belt_floor_from_axis_out = 1; + double belt_floor_z_shift_out = 0.0; + if (object_max_z <= 0.f) { BoundingBoxf3 bb = model_object.raw_bounding_box(); object_max_z = (float)bb.size().z(); @@ -3523,13 +3548,20 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full max_rz = std::max(max_rz, new_z); } object_max_z = (float)(max_rz - min_rz); + belt_floor_shear_factor_out = shear_factor; + belt_floor_from_axis_out = from; + belt_floor_z_shift_out = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); } else { object_max_z *= (float)scale_z; } } } } - return SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); + SlicingParameters params = SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); + params.belt_floor_shear_factor = belt_floor_shear_factor_out; + params.belt_floor_from_axis = belt_floor_from_axis_out; + params.belt_floor_z_shift = belt_floor_z_shift_out; + return params; } // returns 0-based indices of extruders used to print the object (without brim, support and other helper extrusions) @@ -4038,6 +4070,67 @@ void PrintObject::combine_infill() } } +// Belt printer: clip an ExtrusionEntityCollection to a region defined by clip_expoly. +// Handles ExtrusionPath, ExtrusionMultiPath, ExtrusionLoop, and nested ExtrusionEntityCollection. +static void clip_support_fills(ExtrusionEntityCollection &fills, const ExPolygons &clip_region) +{ + ExtrusionEntitiesPtr new_entities; + for (ExtrusionEntity *entity : fills.entities) { + if (auto *path = dynamic_cast(entity)) { + ExtrusionEntityCollection clipped; + path->intersect_expolygons(clip_region, &clipped); + if (!clipped.empty()) { + for (ExtrusionEntity *e : clipped.entities) + new_entities.push_back(e->clone()); + } + delete entity; + } else if (auto *multipath = dynamic_cast(entity)) { + ExtrusionPaths new_paths; + for (const ExtrusionPath &p : multipath->paths) { + ExtrusionEntityCollection clipped; + p.intersect_expolygons(clip_region, &clipped); + for (ExtrusionEntity *e : clipped.entities) + if (auto *cp = dynamic_cast(e)) + new_paths.push_back(std::move(*cp)); + } + if (!new_paths.empty()) { + multipath->paths = std::move(new_paths); + new_entities.push_back(multipath); + } else { + delete entity; + } + } else if (auto *loop = dynamic_cast(entity)) { + ExtrusionPaths new_paths; + for (const ExtrusionPath &p : loop->paths) { + ExtrusionEntityCollection clipped; + p.intersect_expolygons(clip_region, &clipped); + for (ExtrusionEntity *e : clipped.entities) + if (auto *cp = dynamic_cast(e)) + new_paths.push_back(std::move(*cp)); + } + if (!new_paths.empty()) { + // Loop is no longer a closed loop after clipping; emit as individual paths. + for (auto &p : new_paths) + new_entities.push_back(new ExtrusionPath(std::move(p))); + delete entity; + } else { + delete entity; + } + } else if (auto *coll = dynamic_cast(entity)) { + clip_support_fills(*coll, clip_region); + if (!coll->empty()) { + new_entities.push_back(coll); + } else { + delete entity; + } + } else { + // Unknown entity type — keep as-is. + new_entities.push_back(entity); + } + } + fills.entities = std::move(new_entities); +} + void PrintObject::_generate_support_material() { if (is_tree(m_config.support_type.value)) { @@ -4049,6 +4142,25 @@ void PrintObject::_generate_support_material() PrintObjectSupportMaterial support_material(this, m_slicing_params); support_material.generate(*this); } + // Global Z offset for support layers: + // - Normal support: layers already inherit global_z_offset from object layers. + // - Non-organic tree support (slim/strong/hybrid): plan_layer_heights() reads + // from globally-offset object layers, so support layers already have it. + // - Organic tree support: generate_tree_support_3D() computes its own Z values + // independently and does NOT inherit the offset — apply it here. + // Belt floor polygon clipping for non-organic tree support is done inside + // draw_circles() before area_groups and toolpaths are built. + if (is_tree(m_config.support_type.value) && std::abs(m_belt_global_z_offset) > EPSILON) { + // Resolve effective support style (same logic as SupportParameters). + auto style = m_config.support_style.value; + if (style == smsDefault) + style = smsTreeOrganic; + if (style == smsTreeOrganic) { + for (SupportLayer *sl : m_support_layers) + sl->print_z += m_belt_global_z_offset; + } + } + } // BBS diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 294c245eaa..404550da1a 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1,4 +1,5 @@ #include +#include #include @@ -125,7 +126,8 @@ static std::vector slice_volumes_inner( ModelVolumePtrs model_volumes, const std::vector &layer_ranges, const std::vector &zs, - const std::function &throw_on_cancel_callback) + const std::function &throw_on_cancel_callback, + double *out_belt_min_z = nullptr) { model_volumes_sort_by_id(model_volumes); @@ -202,8 +204,32 @@ static std::vector slice_volumes_inner( } // Apply: scale * shear * trafo (shear first, then scale). - if (has_shear || has_scale) + if (has_shear || has_scale) { params_base.trafo = belt_scale * belt_shear * params_base.trafo; + + // After the shear/scale transform, the mesh may clip through the + // build plate (Z < 0). Detect this and shift the mesh up. + Transform3d combined = params_base.trafo; + double min_z = std::numeric_limits::max(); + for (const ModelVolume *mv : model_volumes) { + if (!mv->is_model_part()) continue; + for (const stl_vertex &v : mv->mesh().its.vertices) { + Vec3d pt = combined * v.cast(); + min_z = std::min(min_z, pt.z()); + } + } + double belt_z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; + BOOST_LOG_TRIVIAL(warning) << "Belt Z-shift: min_z=" << min_z + << " z_shift=" << belt_z_shift_val + << " trafo_z=" << object_trafo.matrix()(2, 3); + if (belt_z_shift_val > 0.) { + Transform3d z_shift = Transform3d::Identity(); + z_shift.matrix()(2, 3) = belt_z_shift_val; + params_base.trafo = z_shift * params_base.trafo; + } + if (out_belt_min_z) + *out_belt_min_z = (min_z != std::numeric_limits::max()) ? min_z : 0.; + } } //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. @@ -866,6 +892,20 @@ void PrintObject::slice() m_layers = new_layers(this, generate_object_layers(m_slicing_params, layer_height_profile, m_config.precise_z_height.value)); this->slice_volumes(); m_print->throw_if_canceled(); + + // After slicing, m_belt_min_z holds the exact post-shear minimum Z + // in trafo_centered space (which includes the ensure_on_bed Z offset). + // The belt surface is at Z=0 in trafo_centered space; after shear it + // becomes Z = sf*Y, and after the z-shift that keeps the mesh above + // Z=0 it becomes Z = sf*Y + z_shift_val. So belt_floor_z_shift is + // simply the z-shift applied, i.e. max(0, -m_belt_min_z). + // NOTE: do NOT add raw_bounding_box().min.z() here — m_belt_min_z + // already includes the ensure_on_bed offset, unlike the min_rz used + // in update_slicing_parameters() which needs that compensation. + if (std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON) { + m_slicing_params.belt_floor_z_shift = (m_belt_min_z < 0.) ? -m_belt_min_z : 0.; + } + int firstLayerReplacedBy = 0; #if 0 @@ -904,6 +944,83 @@ void PrintObject::slice() if (m_layers.empty()) throw Slic3r::SlicingError(L("No layers were detected. You might want to repair your STL file(s) or check their size or thickness and retry.\n")); + // Belt printer global mode: offset all layer Z values so objects at + // different bed positions print at different heights on the tilted belt. + // This is a post-slicing adjustment — the sliced geometry is identical + // regardless of global mode, only the output Z coordinates change. + { + const auto &pcfg = this->print()->config(); + BOOST_LOG_TRIVIAL(warning) << "Belt global check: belt_printer=" << pcfg.belt_printer.value + << " belt_shear_z=" << int(pcfg.belt_shear_z.value) + << " belt_shear_z_global=" << pcfg.belt_shear_z_global.value + << " object=" << this->model_object()->name; + if (pcfg.belt_printer.value) { + auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + }; + + Point inst_shift = this->instances().empty() ? Point(0, 0) + : this->instances().front().shift - this->center_offset(); + BOOST_LOG_TRIVIAL(warning) << "Belt global: object " << this->model_object()->name + << " instances=" << this->instances().size() + << " shift=(" << unscale(inst_shift.x()) << ", " << unscale(inst_shift.y()) << ")"; + double global_z_offset = 0.; + + struct GAxis { BeltShearMode mode; double angle; int from; bool global; }; + GAxis gaxes[3] = { + { pcfg.belt_shear_x.value, pcfg.belt_shear_x_angle.value, int(pcfg.belt_shear_x_from.value), pcfg.belt_shear_x_global.value }, + { pcfg.belt_shear_y.value, pcfg.belt_shear_y_angle.value, int(pcfg.belt_shear_y_from.value), pcfg.belt_shear_y_global.value }, + { pcfg.belt_shear_z.value, pcfg.belt_shear_z_angle.value, int(pcfg.belt_shear_z_from.value), pcfg.belt_shear_z_global.value }, + }; + + // Only the Z-row shear contributes a Z offset from global mode. + // (X/Y row shears with global would offset X/Y, not Z — not useful here.) + // Offsets are RELATIVE: we subtract the minimum shift across all + // PrintObjects so the lowest-positioned object stays at Z=0. + const auto &za = gaxes[2]; // Z row + if (za.global && za.mode != BeltShearMode::None && za.from < 2) { + double factor = compute_shear_factor(za.mode, za.angle); + // The Z-shift brought the mesh's lowest sheared vertex to + // Z=0. That vertex's physical Y determines the belt contact + // point. With trafo_z preserved (ensure_on_bed offset), + // min_z = Y_at_contact * factor for bottom-face vertices, + // so: z_offset = center_Y * factor + min_z. + Point phys = inst_shift; // already has center_offset subtracted + double center_on_axis = (za.from == 0) ? unscale(phys.x()) : unscale(phys.y()); + global_z_offset += center_on_axis * factor + m_belt_min_z; + } + + BOOST_LOG_TRIVIAL(warning) << "Belt global: z_offset=" << global_z_offset + << " za.global=" << za.global << " za.mode=" << int(za.mode) << " za.from=" << za.from + << " (relative to min across " << this->print()->objects().size() << " objects)"; + m_belt_global_z_offset = global_z_offset; + if (std::abs(global_z_offset) > EPSILON) { + for (Layer *layer : m_layers) + layer->print_z += global_z_offset; + // Keep belt floor clipping in sync with the shifted print_z + // values — the support generator sees globally-offset object + // layer print_z, so belt_floor_z_shift must match. + m_slicing_params.belt_floor_z_shift += global_z_offset; + } + if (!m_layers.empty()) { + BOOST_LOG_TRIVIAL(warning) << "Belt global: first_layer_z=" << m_layers.front()->print_z + << " last_layer_z=" << m_layers.back()->print_z + << " num_layers=" << m_layers.size() + << " center_offset=(" << unscale(m_center_offset.x()) + << ", " << unscale(m_center_offset.y()) << ")"; + } + } + } + // BBS this->set_done(posSlice); } @@ -1208,7 +1325,8 @@ void PrintObject::slice_volumes() if (!slice_zs.empty()) { objSliceByVolume = slice_volumes_inner( print->config(), this->config(), this->trafo_centered(), - this->model_object()->volumes, m_shared_regions->layer_ranges, slice_zs, throw_on_cancel_callback); + this->model_object()->volumes, m_shared_regions->layer_ranges, slice_zs, throw_on_cancel_callback, + &m_belt_min_z); } //BBS: "model_part" volumes are grouded according to their connections diff --git a/src/libslic3r/Slicing.hpp b/src/libslic3r/Slicing.hpp index a7b21a140d..b06f2a7bc4 100644 --- a/src/libslic3r/Slicing.hpp +++ b/src/libslic3r/Slicing.hpp @@ -110,6 +110,13 @@ struct SlicingParameters coordf_t object_print_z_uncompensated_max { 0 }; // Scaling factor for compensating shrinkage in Z-axis. coordf_t object_shrinkage_compensation_z { 0 }; + + // Belt printer: floor plane parameters for support clipping. + // Belt contact surface in slicing coords: Z = bb_min_z + sf*Y + slicing_z_shift. + // cutoff = (print_z - belt_floor_z_shift - floor_offset) / shear_factor + double belt_floor_shear_factor { 0.0 }; // shear factor (e.g. cot(45deg)) + int belt_floor_from_axis { 1 }; // which axis the shear is from (0=X, 1=Y) + double belt_floor_z_shift { 0.0 }; // bb_min_z + max(0, -min_z_after_shear) }; static_assert(IsTriviallyCopyable::value, "SlicingParameters class is not POD (and it should be - see constructor)."); diff --git a/src/libslic3r/Support/SupportCommon.hpp b/src/libslic3r/Support/SupportCommon.hpp index 531daaa0a8..f15c7d417a 100644 --- a/src/libslic3r/Support/SupportCommon.hpp +++ b/src/libslic3r/Support/SupportCommon.hpp @@ -144,6 +144,12 @@ int idx_lower_or_equal(const std::vector &vec, int idx, FN_LOWER_EQUAL fn_lo return idx_lower_or_equal(vec.begin(), vec.end(), idx, fn_lower_equal); } +// Belt floor: compute the belt-side half-plane polygon at a given print_z. +// Used to clip support polygons against the belt surface. +Polygons belt_floor_surface_polygon( + const SlicingParameters &slicing_params, const PrintConfig &print_config, + const PrintObject &object, coordf_t print_z); + } // namespace Slic3r #endif /* slic3r_SupportCommon_hpp_ */ diff --git a/src/libslic3r/Support/SupportMaterial.cpp b/src/libslic3r/Support/SupportMaterial.cpp index c230924ac8..d70153a7dd 100644 --- a/src/libslic3r/Support/SupportMaterial.cpp +++ b/src/libslic3r/Support/SupportMaterial.cpp @@ -367,10 +367,21 @@ inline void layers_append(SupportGeneratorLayersPtr &dst, const SupportGenerator } // Support layer that is covered by some form of dense interface. -static constexpr const std::initializer_list support_types_interface { +static constexpr const std::initializer_list support_types_interface { SupporLayerType::RaftInterface, SupporLayerType::BottomContact, SupporLayerType::BottomInterface, SupporLayerType::TopContact, SupporLayerType::TopInterface }; +// Forward declarations for belt floor helpers (defined later in this file). +// belt_floor_surface_polygon is declared in SupportCommon.hpp (non-static, +// shared with TreeSupport.cpp). + +static Polygons belt_floor_valid_region_polygon( + const SlicingParameters &slicing_params, const PrintConfig &print_config, + const PrintObject &object, coordf_t print_z); +static void trim_support_layers_by_belt_floor( + const SlicingParameters &slicing_params, const PrintConfig &print_config, + const PrintObject &object, SupportGeneratorLayersPtr &support_layers); + void PrintObjectSupportMaterial::generate(PrintObject &object) { BOOST_LOG_TRIVIAL(info) << "Support generator - Start"; @@ -443,11 +454,12 @@ void PrintObjectSupportMaterial::generate(PrintObject &object) object, bottom_contacts, top_contacts, layer_storage); this->trim_support_layers_by_object(object, top_contacts, m_slicing_params.gap_support_object, m_slicing_params.gap_object_support, m_support_params.gap_xy); + trim_support_layers_by_belt_floor(m_slicing_params, *m_print_config, object, top_contacts); #ifdef SLIC3R_DEBUG for (const SupportGeneratorLayer *layer : top_contacts) Slic3r::SVG::export_expolygons( - debug_out_path("support-top-contacts-trimmed-by-object-%d-%lf.svg", iRun, layer->print_z), + debug_out_path("support-top-contacts-trimmed-by-object-%d-%lf.svg", iRun, layer->print_z), union_ex(layer->polygons)); #endif @@ -603,6 +615,139 @@ Polygons collect_region_slices_by_type(const Layer &layer, SurfaceType surface_t return out; } +// Belt printer: compute the belt-side half-plane polygon at a given print_z. +// This represents the region where the belt surface exists (the "phantom top surface"). +// Support that overlaps with this polygon should terminate with a bottom contact. +// Returns empty if belt floor is not active. +Polygons belt_floor_surface_polygon( + const SlicingParameters &slicing_params, + const PrintConfig &print_config, + const PrintObject &object, + coordf_t print_z) +{ + const double shear_factor = slicing_params.belt_floor_shear_factor; + if (std::abs(shear_factor) < EPSILON) + return {}; + + const int from_axis = slicing_params.belt_floor_from_axis; // 0=X, 1=Y + const double floor_offset = print_config.belt_support_floor_offset.value; + + // Belt floor line in slicing coordinates: Z = sf * Y + z_shift. + // z_shift accounts for the upward shift applied when post-shear geometry + // extends below the bed (overhangs). Solving for Y: + // cutoff = (print_z - z_shift - floor_offset) / sf + const double z_shift = slicing_params.belt_floor_z_shift; + const double cutoff = (print_z - z_shift - floor_offset) / shear_factor; + const coord_t cutoff_scaled = scale_(cutoff); + const coord_t large_bound = scale_(1e4); + + // Build the belt-side half-plane (inverted from the valid region). + // If shear_factor > 0: valid region is from_axis < cutoff, so belt surface is from_axis >= cutoff. + // If shear_factor < 0: valid region is from_axis > cutoff, so belt surface is from_axis <= cutoff. + Polygon belt_poly; + if (from_axis == 0) { + if (shear_factor > 0) { + // Belt surface: X >= cutoff + belt_poly.points = { + Point(cutoff_scaled, -large_bound), + Point(large_bound, -large_bound), + Point(large_bound, large_bound), + Point(cutoff_scaled, large_bound) + }; + } else { + // Belt surface: X <= cutoff + belt_poly.points = { + Point(-large_bound, -large_bound), + Point(cutoff_scaled, -large_bound), + Point(cutoff_scaled, large_bound), + Point(-large_bound, large_bound) + }; + } + } else { + if (shear_factor > 0) { + // Belt surface: Y >= cutoff + belt_poly.points = { + Point(-large_bound, cutoff_scaled), + Point( large_bound, cutoff_scaled), + Point( large_bound, large_bound), + Point(-large_bound, large_bound) + }; + } else { + // Belt surface: Y <= cutoff + belt_poly.points = { + Point(-large_bound, -large_bound), + Point( large_bound, -large_bound), + Point( large_bound, cutoff_scaled), + Point(-large_bound, cutoff_scaled) + }; + } + } + return { belt_poly }; +} + +// Belt printer: compute the valid-region half-plane polygon at a given print_z. +// This is the region where support is allowed to exist (above the belt). +// Used to clip the downward-propagating support projection. +static Polygons belt_floor_valid_region_polygon( + const SlicingParameters &slicing_params, + const PrintConfig &print_config, + const PrintObject &object, + coordf_t print_z) +{ + const double shear_factor = slicing_params.belt_floor_shear_factor; + if (std::abs(shear_factor) < EPSILON) + return {}; + + const int from_axis = slicing_params.belt_floor_from_axis; + const double floor_offset = print_config.belt_support_floor_offset.value; + + const double z_shift = slicing_params.belt_floor_z_shift; + const double cutoff = (print_z - z_shift - floor_offset) / shear_factor; + const coord_t cutoff_scaled = scale_(cutoff); + const coord_t large_bound = scale_(1e4); + + // Valid region: the complement of the belt surface polygon. + Polygon valid_poly; + if (from_axis == 0) { + if (shear_factor > 0) { + // Valid: X < cutoff + valid_poly.points = { + Point(-large_bound, -large_bound), + Point(cutoff_scaled, -large_bound), + Point(cutoff_scaled, large_bound), + Point(-large_bound, large_bound) + }; + } else { + // Valid: X > cutoff + valid_poly.points = { + Point(cutoff_scaled, -large_bound), + Point(large_bound, -large_bound), + Point(large_bound, large_bound), + Point(cutoff_scaled, large_bound) + }; + } + } else { + if (shear_factor > 0) { + // Valid: Y < cutoff + valid_poly.points = { + Point(-large_bound, -large_bound), + Point( large_bound, -large_bound), + Point( large_bound, cutoff_scaled), + Point(-large_bound, cutoff_scaled) + }; + } else { + // Valid: Y > cutoff + valid_poly.points = { + Point(-large_bound, cutoff_scaled), + Point( large_bound, cutoff_scaled), + Point( large_bound, large_bound), + Point(-large_bound, large_bound) + }; + } + } + return { valid_poly }; +} + // Collect outer contours of all slices of this layer. // This is useful for calculating the support base with holes filled. Polygons collect_slices_outer(const Layer &layer) @@ -2516,6 +2661,82 @@ static inline SupportGeneratorLayer* detect_bottom_contacts( return &layer_new; } +// Belt printer: detect bottom contacts where support meets the belt floor plane. +// Modeled on detect_bottom_contacts() but uses the belt plane polygon instead of stTop surfaces. +static inline SupportGeneratorLayer* detect_belt_floor_bottom_contacts( + const SlicingParameters &slicing_params, + const SupportParameters &support_params, + const PrintConfig &print_config, + const PrintObject &object, + const Layer &layer, + // Existing top contact layers, for snapping. + const SupportGeneratorLayersPtr &top_contacts, + size_t contact_idx, + SupportGeneratorLayerStorage &layer_storage, + std::vector &layer_support_areas, + const Polygons &supports_projected) +{ + // Compute the belt surface polygon at this layer's Z. + Polygons belt_surface = belt_floor_surface_polygon(slicing_params, print_config, object, layer.print_z); + if (belt_surface.empty()) + return nullptr; + + // Find where projected support overlaps the belt surface. + Polygons touching = intersection(belt_surface, supports_projected); + if (touching.empty()) + return nullptr; + + assert(layer.id() >= slicing_params.raft_layers()); + size_t layer_id = layer.id() - slicing_params.raft_layers(); + + // Allocate a new bottom contact layer resting on the belt plane. + SupportGeneratorLayer &layer_new = layer_storage.allocate_unguarded(SupporLayerType::BottomContact); + + // No object layer to sync with -- compute heights directly from flow parameters. + layer_new.height = support_params.support_material_bottom_interface_flow.height(); + layer_new.print_z = layer.print_z + layer_new.height + slicing_params.gap_object_support; + layer_new.bottom_z = layer.print_z; + layer_new.idx_object_layer_below = layer_id; + layer_new.bridging = ! slicing_params.soluble_interface && object.config().thick_bridges; + layer_new.polygons = expand(touching, float(support_params.support_material_flow.scaled_width()), SUPPORT_SURFACES_OFFSET_PARAMETERS); + + if (! slicing_params.soluble_interface) { + // Snap to nearby top contact layers to avoid very thin support layers. + for (size_t top_idx = size_t(std::max(0, int(contact_idx))); + top_idx < top_contacts.size() && top_contacts[top_idx]->print_z < layer_new.print_z + support_params.support_layer_height_min + EPSILON; + ++ top_idx) { + if (top_contacts[top_idx]->print_z > layer_new.print_z - support_params.support_layer_height_min - EPSILON) { + coordf_t diff = layer_new.print_z - top_contacts[top_idx]->print_z; + assert(std::abs(diff) <= support_params.support_layer_height_min + EPSILON); + if (diff > 0.F) { + if (layer_new.height - diff > support_params.support_layer_height_min) { + layer_new.print_z = top_contacts[top_idx]->print_z; + layer_new.height -= diff; + } else { + continue; + } + } else { + layer_new.print_z = top_contacts[top_idx]->print_z; + layer_new.height -= diff; + } + break; + } + } + } + + // Trim the already created base layers above this belt contact. + touching = expand(touching, float(SCALED_EPSILON)); + for (int layer_id_above = int(layer_id) + 1; layer_id_above < int(object.total_layer_count()); ++ layer_id_above) { + const Layer &layer_above = *object.layers()[layer_id_above]; + if (layer_above.print_z > layer_new.print_z - EPSILON) + break; + if (Polygons &above = layer_support_areas[layer_id_above]; ! above.empty()) + above = diff(above, touching); + } + + return &layer_new; +} + // Returns polygons to print + polygons to propagate downwards. // Called twice: First for normal supports, possibly trimmed by "on build plate only", second for support enforcers not trimmed by "on build plate only". static inline std::pair project_support_to_grid(const Layer &layer, const SupportGridParams &grid_params, const Polygons &overhangs, Polygons *layer_buildplate_covered @@ -2615,6 +2836,8 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::bottom_contact_layers_and_ //const auto expansion_to_slice = m_support_material_flow.scaled_spacing() / 2 + 25; const SupportGridParams grid_params(*m_object_config, m_support_params.support_material_flow); const bool buildplate_only = ! buildplate_covered.empty(); + const bool has_belt_floor = std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly; // Allocate empty surface areas, one per object layer. layer_support_areas.assign(object.total_layer_count(), Polygons()); @@ -2675,8 +2898,9 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::bottom_contact_layers_and_ tbb::task_group task_group; const Polygons &overhangs_for_bottom_contacts = buildplate_only ? enforcers_projection_raw : overhangs_projection_raw; if (! overhangs_for_bottom_contacts.empty()) - // Find the bottom contact layers above the top surfaces of this layer. - task_group.run([this, &object, &layer, &top_contacts, contact_idx, &layer_storage, &layer_support_areas, &bottom_contacts, &overhangs_for_bottom_contacts + // Find the bottom contact layers above the top surfaces of this layer, + // and also detect belt floor contacts if belt mode is active. + task_group.run([this, &object, &layer, &top_contacts, contact_idx, &layer_storage, &layer_support_areas, &bottom_contacts, &overhangs_for_bottom_contacts, has_belt_floor #ifdef SLIC3R_DEBUG , iRun, &polygons_new #endif // SLIC3R_DEBUG @@ -2690,6 +2914,15 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::bottom_contact_layers_and_ ); if (layer_new) bottom_contacts.push_back(layer_new); + // Belt floor phantom surface: detect where support meets the belt plane. + if (has_belt_floor) { + SupportGeneratorLayer *belt_layer = detect_belt_floor_bottom_contacts( + m_slicing_params, m_support_params, *m_print_config, object, + layer, top_contacts, contact_idx, layer_storage, + layer_support_areas, overhangs_for_bottom_contacts); + if (belt_layer) + bottom_contacts.push_back(belt_layer); + } }); Polygons &layer_support_area = layer_support_areas[layer_id]; @@ -2728,6 +2961,23 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::bottom_contact_layers_and_ task_group.wait(); + // Belt floor: clip projections and support areas so support doesn't + // propagate below the belt plane. + if (has_belt_floor) { + Polygons valid_region = belt_floor_valid_region_polygon( + m_slicing_params, *m_print_config, object, layer.print_z); + if (! valid_region.empty()) { + if (! overhangs_projection.empty()) + overhangs_projection = intersection(overhangs_projection, valid_region); + if (! enforcers_projection.empty()) + enforcers_projection = intersection(enforcers_projection, valid_region); + if (! layer_support_area.empty()) + layer_support_area = intersection(layer_support_area, valid_region); + if (! layer_support_area_enforcers.empty()) + layer_support_area_enforcers = intersection(layer_support_area_enforcers, valid_region); + } + } + if (! layer_support_area_enforcers.empty()) { if (layer_support_area.empty()) layer_support_area = std::move(layer_support_area_enforcers); @@ -2738,6 +2988,7 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::bottom_contact_layers_and_ std::reverse(bottom_contacts.begin(), bottom_contacts.end()); trim_support_layers_by_object(object, bottom_contacts, m_slicing_params.gap_support_object, m_slicing_params.gap_object_support, m_support_params.gap_xy); + trim_support_layers_by_belt_floor(m_slicing_params, *m_print_config, object, bottom_contacts); return bottom_contacts; } @@ -3108,6 +3359,37 @@ void PrintObjectSupportMaterial::generate_base_layers( #endif /* SLIC3R_DEBUG */ this->trim_support_layers_by_object(object, intermediate_layers, m_slicing_params.gap_support_object, m_slicing_params.gap_object_support, m_support_params.gap_xy); + trim_support_layers_by_belt_floor(m_slicing_params, *m_print_config, object, intermediate_layers); +} + +// Belt printer: trim support layer polygons by the belt floor plane. +// For each support layer, computes the belt floor half-plane at that layer's print_z +// and subtracts it from the support polygons. This follows the same diff() pattern +// as trim_support_layers_by_object() so that interface layers derived from trimmed +// intermediates automatically inherit the belt floor trimming. +static void trim_support_layers_by_belt_floor( + const SlicingParameters &slicing_params, + const PrintConfig &print_config, + const PrintObject &object, + SupportGeneratorLayersPtr &support_layers) +{ + if (std::abs(slicing_params.belt_floor_shear_factor) < EPSILON) + return; + if (print_config.belt_support_floor_mode.value != BeltSupportFloorMode::GeneratorOnly) + return; + + tbb::parallel_for(tbb::blocked_range(0, support_layers.size()), + [&](const tbb::blocked_range &range) { + for (size_t i = range.begin(); i < range.end(); ++ i) { + SupportGeneratorLayer *layer = support_layers[i]; + if (layer->polygons.empty()) + continue; + Polygons belt_surface = belt_floor_surface_polygon( + slicing_params, print_config, object, layer->print_z); + if (! belt_surface.empty()) + layer->polygons = diff(layer->polygons, belt_surface); + } + }); } void PrintObjectSupportMaterial::trim_support_layers_by_object( diff --git a/src/libslic3r/Support/TreeModelVolumes.cpp b/src/libslic3r/Support/TreeModelVolumes.cpp index 0267c0c327..e270b62aab 100644 --- a/src/libslic3r/Support/TreeModelVolumes.cpp +++ b/src/libslic3r/Support/TreeModelVolumes.cpp @@ -94,6 +94,46 @@ TreeModelVolumes::TreeModelVolumes( #else { m_anti_overhang = print_object.slice_support_blockers(); + // Belt floor: add belt surface polygons to anti_overhang so support + // is never generated inside the belt. Only in global shear mode — + // in local mode the belt floor clipping handles everything and + // anti_overhang at the bottom layers would block all support. + { + const auto &sp = print_object.slicing_parameters(); + const auto &pcfg = print_object.print()->config(); + const double sf = sp.belt_floor_shear_factor; + if (std::abs(sf) > EPSILON + && std::abs(print_object.belt_global_z_offset()) > EPSILON + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + const int from_axis = sp.belt_floor_from_axis; + const double floor_off = pcfg.belt_support_floor_offset.value; + const double z_shift = sp.belt_floor_z_shift - print_object.belt_global_z_offset(); + size_t num_layers_needed = print_object.layer_count(); + // Ensure m_anti_overhang is large enough. + if (m_anti_overhang.size() < num_layers_needed) + m_anti_overhang.resize(num_layers_needed, Polygons{}); + for (size_t layer_idx = 0; layer_idx < num_layers_needed; ++layer_idx) { + double print_z = print_object.get_layer(layer_idx)->print_z + - print_object.belt_global_z_offset(); + double cutoff = (print_z - z_shift - floor_off) / sf; + coord_t cutoff_sc = scale_(cutoff); + coord_t big = scale_(1e4); + Polygon belt_poly; + if (from_axis == 0) { + if (sf > 0) + belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; + else + belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; + } else { + if (sf > 0) + belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; + else + belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; + } + append(m_anti_overhang[layer_idx], Polygons{belt_poly}); + } + } + } TreeSupportMeshGroupSettings mesh_settings(print_object); const TreeSupportSettings config{ mesh_settings, print_object.slicing_parameters() }; m_current_min_xy_dist = config.xy_min_distance; @@ -102,6 +142,27 @@ TreeModelVolumes::TreeModelVolumes( m_increase_until_radius = config.increase_radius_until_radius; m_radius_0 = config.getRadius(0); m_raft_layers = config.raft_layers; + // Belt printer: add virtual belt raft layers below the object, matching + // the extra layers added in generate_support_areas() so both use the + // same layer indexing. + { + const auto &sp2 = print_object.slicing_parameters(); + const auto &pcfg2 = print_object.print()->config(); + double belt_sf = sp2.belt_floor_shear_factor; + if (std::abs(belt_sf) > EPSILON && std::abs(print_object.belt_global_z_offset()) > EPSILON + && pcfg2.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + double bb_min_z = std::abs(print_object.model_object()->raw_bounding_box().min.z()); + double extra_depth = bb_min_z + 10.; + int num_extra = std::max(0, (int)std::ceil(extra_depth / sp2.layer_height)); + if (num_extra > 0) { + std::vector belt_layers; + belt_layers.reserve(num_extra); + for (int i = num_extra; i >= 1; --i) + belt_layers.push_back(sp2.first_object_layer_height - i * sp2.layer_height); + m_raft_layers.insert(m_raft_layers.begin(), belt_layers.begin(), belt_layers.end()); + } + } + } m_current_outline_idx = 0; m_layer_outlines.emplace_back(mesh_settings, std::vector{}); @@ -114,6 +175,47 @@ TreeModelVolumes::TreeModelVolumes( for (size_t layer_idx = range.begin(); layer_idx < range.end(); ++ layer_idx) outlines[layer_idx] = polygons_simplify(to_polygons(print_object.get_layer(layer_idx - num_raft_layers)->lslices), mesh_settings.resolution, polygons_strictly_simple); }); + + // Belt floor: pre-compute belt surface polygon per-layer for clipping. + // Branches grow toward the belt and their slices are clipped at the belt + // surface in organic_draw_branches(). The organic pipeline works in LOCAL + // Z (no global_z_offset), so use local z_shift and local print_z. + const auto &slicing_params = print_object.slicing_parameters(); + const auto &pcfg = print_object.print()->config(); + const double sf = slicing_params.belt_floor_shear_factor; + if (std::abs(sf) > EPSILON + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + const int from_axis = slicing_params.belt_floor_from_axis; + const double floor_off = pcfg.belt_support_floor_offset.value; + // Subtract global_z_offset to get the LOCAL z_shift — the organic + // pipeline's Z coordinates don't include the global offset. + const double z_shift = slicing_params.belt_floor_z_shift + - print_object.belt_global_z_offset(); + m_belt_floor.assign(num_layers, Polygons{}); + for (size_t layer_idx = 0; layer_idx < num_layers; ++layer_idx) { + // Use local print_z (subtract global offset from object layer). + double print_z = (layer_idx >= num_raft_layers) + ? print_object.get_layer(layer_idx - num_raft_layers)->print_z + - print_object.belt_global_z_offset() + : 0.; + double cutoff = (print_z - z_shift - floor_off) / sf; + coord_t cutoff_sc = scale_(cutoff); + coord_t big = scale_(1e4); + Polygon belt_poly; + if (from_axis == 0) { + if (sf > 0) + belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; + else + belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; + } else { + if (sf > 0) + belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; + else + belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; + } + m_belt_floor[layer_idx] = { belt_poly }; + } + } } #endif @@ -469,9 +571,9 @@ void TreeModelVolumes::calculateCollision(const coord_t radius, const LayerIndex }); // 2) Sum over top / bottom ranges. - const bool processing_last_mesh = outline_idx == layer_outline_indices.size(); + const bool processing_last_mesh = outline_idx == layer_outline_indices.back(); tbb::parallel_for(tbb::blocked_range(data.begin(), data.end()), - [&collision_areas_offsetted, &outlines, &machine_border = m_machine_border, &anti_overhang = m_anti_overhang, radius, + [&collision_areas_offsetted, &outlines, &machine_border = m_machine_border, &anti_overhang = m_anti_overhang, radius, xy_distance, z_distance_bottom_layers, z_distance_top_layers, min_resolution = m_min_resolution, &data, processing_last_mesh, &throw_on_cancel] (const tbb::blocked_range& range) { for (LayerIndex layer_idx = range.begin(); layer_idx != range.end(); ++ layer_idx) { @@ -517,9 +619,14 @@ void TreeModelVolumes::calculateCollision(const coord_t radius, const LayerIndex // not support an overhang<90 degree than to risk fusing to it. append(collisions, offset(union_ex(collision_areas_original), radius + required_range_x, ClipperLib::jtMiter, 1.2)); } - collisions = processing_last_mesh && layer_idx < int(anti_overhang.size()) ? - union_(collisions, offset(union_ex(anti_overhang[layer_idx]), radius, ClipperLib::jtMiter, 1.2)) : - union_(collisions); + if (processing_last_mesh) { + if (layer_idx < int(anti_overhang.size())) + append(collisions, offset(union_ex(anti_overhang[layer_idx]), radius, ClipperLib::jtMiter, 1.2)); + // NOTE: m_belt_floor is NOT added to collision here — branches + // should grow toward the belt and terminate at it, not avoid it. + // Belt floor clipping is done post-generation in organic_draw_branches(). + } + collisions = union_(collisions); auto &dst = data[layer_idx]; if (processing_last_mesh) { if (! dst.empty()) diff --git a/src/libslic3r/Support/TreeModelVolumes.hpp b/src/libslic3r/Support/TreeModelVolumes.hpp index eff4cadcaf..0ded395091 100644 --- a/src/libslic3r/Support/TreeModelVolumes.hpp +++ b/src/libslic3r/Support/TreeModelVolumes.hpp @@ -168,6 +168,9 @@ public: } Polygon m_bed_area; + // Belt floor polygons per layer — used for post-generation clipping + // in organic_draw_branches(). Public so the organic pipeline can access it. + std::vector m_belt_floor; private: // Caching polygons for a range of layers. diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 864a0eb0e0..4966a5a139 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -637,6 +637,20 @@ TreeSupport::TreeSupport(PrintObject& object, const SlicingParameters &slicing_p } +double TreeSupport::belt_floor_print_z(const Point &pos_slicing) const +{ + double sf = m_slicing_params.belt_floor_shear_factor; + if (std::abs(sf) < EPSILON) + return -std::numeric_limits::max(); // no belt floor + int from = m_slicing_params.belt_floor_from_axis; + // Belt floor in slicing coords: Z = sf * Y + z_shift + floor_offset. + // Inverse of cutoff = (Z - z_shift - floor_offset) / sf. + double pos = unscale(from == 0 ? pos_slicing.x() : pos_slicing.y()); + double floor_offset = m_print_config->belt_support_floor_offset.value; + double z_shift = m_slicing_params.belt_floor_z_shift; + return sf * pos + floor_offset + z_shift; +} + #define SUPPORT_SURFACES_OFFSET_PARAMETERS ClipperLib::jtSquare, 0. void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) { @@ -2141,6 +2155,41 @@ void TreeSupport::draw_circles() base_areas = diff_ex(base_areas, ClipperUtils::clip_clipper_polygons_with_subject_bbox(roofs, get_extents(base_areas))); base_areas = intersection_ex(base_areas, m_machine_border); + // Belt floor: clip tree support polygons by the belt surface plane. + // ts_layer->print_z is at LOCAL Z (global offset applied later in + // _generate_support_material), but belt_floor_z_shift includes + // global_z_offset — subtract it to get the cutoff in local coords. + if (std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + const double sf = m_slicing_params.belt_floor_shear_factor; + const int from_axis = m_slicing_params.belt_floor_from_axis; + const double floor_off = m_print_config->belt_support_floor_offset.value; + const double z_shift_local = m_slicing_params.belt_floor_z_shift + - m_object->belt_global_z_offset(); + const double cutoff = (ts_layer->print_z - z_shift_local - floor_off) / sf; + const coord_t cutoff_sc = scale_(cutoff); + const coord_t big = scale_(1e4); + + Polygon belt_poly; + if (from_axis == 0) { + if (sf > 0) + belt_poly.points = { {cutoff_sc,-big}, {big,-big}, {big,big}, {cutoff_sc,big} }; + else + belt_poly.points = { {-big,-big}, {cutoff_sc,-big}, {cutoff_sc,big}, {-big,big} }; + } else { + if (sf > 0) + belt_poly.points = { {-big,cutoff_sc}, {big,cutoff_sc}, {big,big}, {-big,big} }; + else + belt_poly.points = { {-big,-big}, {big,-big}, {big,cutoff_sc}, {-big,cutoff_sc} }; + } + Polygons belt_surface = { belt_poly }; + base_areas = diff_ex(base_areas, belt_surface); + roof_areas = diff_ex(roof_areas, belt_surface); + roof_1st_layer = diff_ex(roof_1st_layer, belt_surface); + floor_areas = diff_ex(floor_areas, belt_surface); + roof_gap_areas = diff_ex(roof_gap_areas, belt_surface); + } + if (SQUARE_SUPPORT) { // simplify support contours ExPolygons base_areas_simplified; @@ -2445,6 +2494,9 @@ void TreeSupport::drop_nodes() const coordf_t radius_sample_resolution = m_ts_data->m_radius_sample_resolution; const bool support_on_buildplate_only = config.support_on_build_plate_only.value; const size_t top_interface_layers = config.support_interface_top_layers.value; + const auto belt_floor_mode = m_print_config->belt_support_floor_mode.value; + const bool has_belt_floor = std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON + && belt_floor_mode == BeltSupportFloorMode::GeneratorOnly; const size_t bottom_interface_layers = config.support_interface_bottom_layers.value < 0 ? top_interface_layers : config.support_interface_bottom_layers.value; SupportNode::diameter_angle_scale_factor = diameter_angle_scale_factor; float DO_NOT_MOVER_UNDER_MM = is_slim ? 0 : 5; // do not move contact points under 5mm @@ -2677,15 +2729,22 @@ void TreeSupport::drop_nodes() node_parent = p_node->parent ? p_node : neighbour; // Make sure the next pass doesn't drop down either of these (since that already happened). node_parent->merged_neighbours.push_front(node_parent == p_node ? neighbour : p_node); - const bool to_buildplate = !is_inside_ex(get_collision(0, obj_layer_nr_next), next_position); - SupportNode* next_node = m_ts_data->create_node(next_position, node_parent->distance_to_top + 1, obj_layer_nr_next, node_parent->support_roof_layers_below - 1, to_buildplate, node_parent, - print_z_next, height_next); - get_max_move_dist(next_node); - m_ts_data->m_mutex.lock(); - contact_nodes[layer_nr_next].push_back(next_node); + // Belt floor: don't drop merged node below belt surface. + // Treat as object-surface termination (not buildplate) so + // the node gets floor/interface areas instead of base pads. + if (has_belt_floor && print_z_next <= belt_floor_print_z(next_position)) { + node_parent->to_buildplate = false; + } else { + const bool to_buildplate = !is_inside_ex(get_collision(0, obj_layer_nr_next), next_position); + SupportNode* next_node = m_ts_data->create_node(next_position, node_parent->distance_to_top + 1, obj_layer_nr_next, node_parent->support_roof_layers_below - 1, to_buildplate, node_parent, + print_z_next, height_next); + get_max_move_dist(next_node); + m_ts_data->m_mutex.lock(); + contact_nodes[layer_nr_next].push_back(next_node); + m_ts_data->m_mutex.unlock(); + } neighbour->valid = false; p_node->valid = false; - m_ts_data->m_mutex.unlock(); } else if (neighbours.size() > 1) //Don't merge leaf nodes because we would then incur movement greater than the maximum move distance. { @@ -2729,6 +2788,12 @@ void TreeSupport::drop_nodes() ExPolygons overhangs_next = diff_clipped({ node.overhang }, get_collision(0, obj_layer_nr_next)); for(auto& overhang:overhangs_next) { Point next_pt = overhang.contour.centroid(); + // Belt floor: don't drop polygon node below belt surface. + // Treat as object-surface termination (not buildplate). + if (has_belt_floor && print_z_next <= belt_floor_print_z(next_pt)) { + p_node->to_buildplate = false; + continue; + } SupportNode *next_node = m_ts_data->create_node(next_pt, p_node->distance_to_top + 1, obj_layer_nr_next, p_node->support_roof_layers_below - 1, to_buildplate, p_node, print_z_next, height_next); next_node->max_move_dist = 0; @@ -2873,6 +2938,12 @@ void TreeSupport::drop_nodes() if (is_outside) { next_layer_vertex = candidate_vertex; } } } + // Belt floor: don't drop regular node below belt surface. + // Treat as object-surface termination (not buildplate). + if (has_belt_floor && print_z_next <= belt_floor_print_z(next_layer_vertex)) { + p_node->to_buildplate = false; + return; // from parallel_for_each lambda + } auto next_collision = get_collision(0, obj_layer_nr_next); const bool to_buildplate = !is_inside_ex(m_ts_data->m_layer_outlines[obj_layer_nr_next], next_layer_vertex); SupportNode * next_node = m_ts_data->create_node(next_layer_vertex, node.distance_to_top + 1, obj_layer_nr_next, node.support_roof_layers_below - 1, to_buildplate, p_node, @@ -3167,6 +3238,9 @@ void TreeSupport::generate_contact_points() bool on_buildplate_only = m_object_config->support_on_build_plate_only.value; const bool roof_enabled = config.support_interface_top_layers.value > 0; const bool force_tip_to_roof = roof_enabled && m_support_params.soluble_interface; + const auto belt_floor_mode = m_print_config->belt_support_floor_mode.value; + const bool has_belt_floor = std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON + && belt_floor_mode == BeltSupportFloorMode::GeneratorOnly; //First generate grid points to cover the entire area of the print. BoundingBox bounding_box = m_object->bounding_box(); @@ -3257,6 +3331,10 @@ void TreeSupport::generate_contact_points() auto insert_point = [&](Point pt, const ExPolygon& overhang, double radius, bool force_add = false, bool add_interface=true) { + // Belt floor: skip contact points whose bottom_z is at or below + // the belt floor at this XY position (overhang rests on the belt). + if (has_belt_floor && bottom_z <= belt_floor_print_z(pt)) + return (SupportNode*) nullptr; Point hash_pos = pt / ((radius_scaled + 1) / 1); SupportNode* contact_node = nullptr; if (force_add || !already_inserted.count(hash_pos)) { @@ -3292,8 +3370,10 @@ void TreeSupport::generate_contact_points() double radius = unscale_(overhang_bounds.radius()); Point candidate = overhang_bounds.center(); SupportNode *contact_node = insert_point(candidate, overhang, radius, true, true); - contact_node->type = ePolygon; - curr_nodes.emplace_back(contact_node); + if (contact_node) { + contact_node->type = ePolygon; + curr_nodes.emplace_back(contact_node); + } } }else{ // otherwise, all nodes should be circle nodes diff --git a/src/libslic3r/Support/TreeSupport.hpp b/src/libslic3r/Support/TreeSupport.hpp index e0446ad5f1..c3bd186df1 100644 --- a/src/libslic3r/Support/TreeSupport.hpp +++ b/src/libslic3r/Support/TreeSupport.hpp @@ -446,6 +446,10 @@ private: bool is_slim = false; bool with_infill = false; + // Belt printer: compute the belt floor print_z at a given XY position (in slicing coords). + // Returns -infinity if belt floor is not active. + double belt_floor_print_z(const Point &pos_slicing) const; + /*! diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index 2c24b933b2..b551a42ece 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -3366,6 +3366,36 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons // this struct is used to easy retrieve setting. No other function except those in TreeModelVolumes and generate_initial_areas() have knowledge of the existence of multiple meshes being processed. //FIXME this is a copy // Contains config settings to avoid loading them in every function. This was done to improve readability of the code. + // Belt printer: add virtual "belt raft" layers below the object so + // organic branches can extend below the model's first layer and + // terminate at the belt surface instead of creating a flat base at Z=0. + { + PrintObject &po = *print.get_object(processing.second.front()); + const auto &sp = po.slicing_parameters(); + const auto &pcfg = po.print()->config(); + const double sf = sp.belt_floor_shear_factor; + if (std::abs(sf) > EPSILON && std::abs(po.belt_global_z_offset()) > EPSILON + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + // z_shift_local is the belt surface height at Y=0 in local coords. + // Extend below the belt so the base expansion and build-plate + // termination happen inside the belt region and get clipped. + // Use the distance from the pre-shear bbox min Z to the part's + // post-shear min Z, plus 10mm for base expansion headroom. + double bb_min_z = std::abs(po.model_object()->raw_bounding_box().min.z()); + double extra_depth = bb_min_z + 10.; + int num_extra = std::max(0, (int)std::ceil(extra_depth / sp.layer_height)); + if (num_extra > 0) { + // Insert belt raft layers at the front, from lowest Z to highest. + std::vector belt_layers; + belt_layers.reserve(num_extra); + for (int i = num_extra; i >= 1; --i) + belt_layers.push_back(sp.first_object_layer_height - i * sp.layer_height); + // Prepend to existing raft_layers (if any). + auto &rl = processing.first.raft_layers; + rl.insert(rl.begin(), belt_layers.begin(), belt_layers.end()); + } + } + } const TreeSupportSettings &config = processing.first; BOOST_LOG_TRIVIAL(info) << "Processing support tree mesh group " << counter + 1 << " of " << grouped_meshes.size() << " containing " << grouped_meshes[counter].second.size() << " meshes."; auto t_start = std::chrono::high_resolution_clock::now(); @@ -3561,6 +3591,43 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons if (layer) layer->polygons = intersection(layer->polygons, volumes.m_bed_area); }); + // Belt floor: clip ALL organic support layers (including intermediate/base + // fill) against the belt surface. The branch slices were already clipped + // in organic_draw_branches(), but intermediate layers generated between + // branches and the build plate need clipping too. + // Compute the belt floor polygon directly from each layer's print_z + // rather than mapping to a layer index (avoids index mismatch issues). + { + const auto &sp = print_object.slicing_parameters(); + const double sf = sp.belt_floor_shear_factor; + const double z_shift = sp.belt_floor_z_shift - print_object.belt_global_z_offset(); + const double floor_off = print_object.print()->config().belt_support_floor_offset.value; + const int from_axis = sp.belt_floor_from_axis; + if (std::abs(sf) > EPSILON + && print_object.print()->config().belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + tbb::parallel_for_each(layers_sorted.begin(), layers_sorted.end(), [&](SupportGeneratorLayer *layer) { + if (!layer || layer->polygons.empty()) + return; + double cutoff = (layer->print_z - z_shift - floor_off) / sf; + coord_t cutoff_sc = scale_(cutoff); + coord_t big = scale_(1e4); + Polygon belt_poly; + if (from_axis == 0) { + if (sf > 0) + belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; + else + belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; + } else { + if (sf > 0) + belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; + else + belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; + } + layer->polygons = diff(layer->polygons, Polygons{belt_poly}); + }); + } + } + print.set_status(69, _L("Generating support")); generate_support_toolpaths(print_object.support_layers(), print_object.config(), support_params, print_object.slicing_parameters(), raft_layers, bottom_contacts, top_contacts, intermediate_layers, interface_layers, base_interface_layers); @@ -3816,6 +3883,10 @@ void organic_draw_branches( for (LayerIndex i = 0; i < LayerIndex(slices.size()); ++i) { slices[i] = diff_clipped(slices[i], volumes.getCollision(0, layer_begin + i, true)); // FIXME parent_uses_min || draw_area.element->state.use_min_xy_dist); slices[i] = intersection(slices[i], volumes.m_bed_area); + // Belt floor: clip branch slices against the belt surface plane. + LayerIndex belt_idx = layer_begin + i; + if (belt_idx < LayerIndex(volumes.m_belt_floor.size()) && !volumes.m_belt_floor[belt_idx].empty()) + slices[i] = diff(slices[i], volumes.m_belt_floor[belt_idx]); } size_t num_empty = 0; if (slices.front().empty()) { @@ -3850,6 +3921,9 @@ void organic_draw_branches( //double support_area_min = 0.1 * support_area_min_radius; for (LayerIndex layer_idx = layer_begin - 1; layer_idx >= layer_bottommost; -- layer_idx) { rest_support = diff_clipped(rest_support.empty() ? slices.front() : rest_support, volumes.getCollision(0, layer_idx, false)); + // Belt floor: clip propagated support at belt surface. + if (layer_idx < LayerIndex(volumes.m_belt_floor.size()) && !volumes.m_belt_floor[layer_idx].empty()) + rest_support = diff(rest_support, volumes.m_belt_floor[layer_idx]); double rest_support_area = area(rest_support); if (rest_support_area < support_area_stop) // Don't propagate a fraction of the tree contact surface. diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 25b4ba4e9c..b9fe17ff2a 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -2210,17 +2210,11 @@ void GCodeViewer::render_toolpaths() { const Camera& camera = wxGetApp().plater()->get_camera(); Matrix4f view = camera.get_view_matrix().matrix().cast(); - // Belt "designed" view: apply inverse shear to view matrix so toolpaths appear - // upright (as originally designed) instead of sheared on the belt. - if (m_belt_show_designed && m_belt_view_enabled && m_belt_angle_deg > 0.f) { - double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle_deg)); - double sin_a = std::sin(angle_rad); - if (sin_a > 1e-6) { - double cot_alpha = std::cos(angle_rad) / sin_a; - Transform3d inverse_shear = Transform3d::Identity(); - inverse_shear.matrix()(1, 2) = -cot_alpha; // Y -= Z * cot(α) - view = (camera.get_view_matrix() * inverse_shear).matrix().cast(); - } + // Belt "designed" view: apply the precomputed inverse of the full belt + // shear+scale transform so toolpaths appear upright (as originally designed) + // instead of transformed on the belt. + if (m_belt_show_designed && m_belt_view_enabled) { + view = (camera.get_view_matrix() * m_belt_inverse_transform).matrix().cast(); } const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(view); const libvgcode::Mat4x4 converted_projetion_matrix = libvgcode::convert(static_cast(camera.get_projection_matrix().matrix().cast())); @@ -4418,12 +4412,18 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv if (m_nozzle_nums > 1 && (m_viewer.get_view_type() == libvgcode::EViewType::Summary || m_viewer.get_view_type() == libvgcode::EViewType::ColorPrint)) // ORCA show only on summary and filament tab render_legend_color_arr_recommen(window_padding); - // Belt printer: toggle for viewing raw slicing-frame G-code + // Belt printer: toggle for viewing designed (upright) vs. machine-frame G-code. + // Rendered with a separator and hint text so users can find it easily. if (m_belt_view_enabled) { + ImGui::Spacing(); + ImGui::Separator(); ImGui::Spacing(); ImGui::Dummy({ window_padding, 0 }); ImGui::SameLine(); - ImGui::Checkbox("Show designed view (upright)", &m_belt_show_designed); + ImGui::TextColored(ImVec4(0.f, 0.59f, 0.53f, 1.f), "%s", _u8L("Belt Printer").c_str()); + ImGui::Dummy({ window_padding, 0 }); + ImGui::SameLine(); + ImGui::Checkbox(_u8L("Show designed view (upright) [B]").c_str(), &m_belt_show_designed); } legend_height = ImGui::GetCurrentWindow()->Size.y; diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index 184c56e915..cd97613b2a 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -240,6 +240,7 @@ mutable bool m_no_render_path { false }; bool m_belt_view_enabled = false; float m_belt_angle_deg = 0.f; bool m_belt_show_designed = false; // Toggle: show designed (upright) view via inverse shear + Transform3d m_belt_inverse_transform{Transform3d::Identity()}; libvgcode::Viewer m_viewer; bool m_loaded_as_preview{ false }; @@ -341,7 +342,10 @@ public: void export_toolpaths_to_obj(const char* filename) const; void set_belt_printer(bool enabled, float angle_deg) { m_belt_view_enabled = enabled; m_belt_angle_deg = angle_deg; } + void set_belt_inverse_transform(const Transform3d& t) { m_belt_inverse_transform = t; } bool is_belt_view() const { return m_belt_view_enabled && m_belt_angle_deg > 0.f; } + void toggle_belt_show_designed() { if (m_belt_view_enabled) m_belt_show_designed = !m_belt_show_designed; } + bool is_belt_show_designed() const { return m_belt_show_designed; } size_t get_extruders_count() { return m_extruders_count; } void push_combo_style(); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index a19bed05a8..3d964c7dab 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3463,8 +3463,16 @@ void GLCanvas3D::on_char(wxKeyEvent& evt) post_event(SimpleEvent(EVT_GLCANVAS_ARRANGE)); break; } - //case 'B': - //case 'b': { zoom_to_bed(); break; } + case 'B': + case 'b': { + // Toggle belt printer "show designed" view when in G-code preview with belt mode active. + if (dynamic_cast(m_canvas->GetParent()) != nullptr && + m_gcode_viewer.is_belt_view()) { + m_gcode_viewer.toggle_belt_show_designed(); + m_dirty = true; + } + break; + } case 'C': case 'c': { wxGetApp().toggle_show_gcode_window(); m_dirty = true; request_extra_frame(); break; } //case 'G': diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index b20e26653a..ea7b40893f 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2516,7 +2516,7 @@ void ObjectList::load_mesh_object(const TriangleMesh &mesh, const wxString &name Slic3r::save_object_mesh(*new_object); // BBS: find an empty cell to put the copied object - auto start_point = wxGetApp().plater()->build_volume().bounding_volume2d().center(); + auto start_point = wxGetApp().plater()->build_volume().bed_center(); auto empty_cell = wxGetApp().plater()->canvas3D()->get_nearest_empty_cell({start_point(0), start_point(1)}); new_object->instances[0]->set_offset(center ? to_3d(Vec2d(empty_cell(0), empty_cell(1)), -new_object->origin_translation.z()) : bb.center()); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 373ee2a3dc..ee235d4192 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6907,7 +6907,7 @@ std::vector Plater::priv::load_model_objects(const ModelObjectPtrs& mode // BBS: find an empty cell to put the copied object for (auto& instance : new_instances) { auto offset = instance->get_offset(); - auto start_point = this->bed.build_volume().bounding_volume2d().center(); + auto start_point = this->bed.build_volume().bed_center(); bool plate_empty = partplate_list.get_curr_plate()->empty(); Vec3d displacement; if (plate_empty) @@ -10991,10 +10991,83 @@ void Plater::priv::set_bed_shape(const Pointfs &shape, bed.set_belt_printer(true, static_cast(belt_angle)); if (preview) preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, static_cast(belt_angle)); + + // Compute the inverse of the full belt shear+scale transform for the G-code viewer. + auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + }; + auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } + }; + + // Read shear configs. + auto get_shear_mode = [this](const char *key) -> BeltShearMode { + auto opt = config->option>(key); + return opt ? opt->value : BeltShearMode::None; + }; + auto get_axis = [this](const char *key) -> BeltAxis { + auto opt = config->option>(key); + return opt ? opt->value : BeltAxis::X; + }; + auto get_scale_mode = [this](const char *key) -> BeltScaleMode { + auto opt = config->option>(key); + return opt ? opt->value : BeltScaleMode::None; + }; + + struct AxisShear { BeltShearMode mode; double angle; int from; }; + AxisShear axes[3] = { + { get_shear_mode("belt_shear_x"), config->opt_float("belt_shear_x_angle"), int(get_axis("belt_shear_x_from")) }, + { get_shear_mode("belt_shear_y"), config->opt_float("belt_shear_y_angle"), int(get_axis("belt_shear_y_from")) }, + { get_shear_mode("belt_shear_z"), config->opt_float("belt_shear_z_angle"), int(get_axis("belt_shear_z_from")) }, + }; + + Transform3d belt_shear = Transform3d::Identity(); + for (int row = 0; row < 3; ++row) { + if (axes[row].mode != BeltShearMode::None) { + double factor = compute_shear_factor(axes[row].mode, axes[row].angle); + if (std::abs(factor) > EPSILON) + belt_shear.matrix()(row, axes[row].from) += factor; + } + } + + double sx = compute_scale_factor(get_scale_mode("belt_scale_x"), config->opt_float("belt_scale_x_angle")); + double sy = compute_scale_factor(get_scale_mode("belt_scale_y"), config->opt_float("belt_scale_y_angle")); + double sz = compute_scale_factor(get_scale_mode("belt_scale_z"), config->opt_float("belt_scale_z_angle")); + Transform3d belt_scale = Transform3d::Identity(); + belt_scale.matrix()(0, 0) = sx; + belt_scale.matrix()(1, 1) = sy; + belt_scale.matrix()(2, 2) = sz; + + // Forward transform: scale * shear. Inverse for the viewer. + Transform3d forward = belt_scale * belt_shear; + Transform3d inverse = forward.inverse(); + if (preview) + preview->get_canvas3d()->get_gcode_viewer().set_belt_inverse_transform(inverse); } else { bed.set_belt_printer(false, 0.f); - if (preview) + if (preview) { preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(false, 0.f); + preview->get_canvas3d()->get_gcode_viewer().set_belt_inverse_transform(Transform3d::Identity()); + } } } @@ -13286,6 +13359,15 @@ void Plater::load_gcode(const wxString& filename) current_print.set_gcode_file_ready(); + // Belt printer: detect belt_printer_angle from loaded G-code header and enable + // belt view mode on the GCodeViewer so the "Show designed view" toggle appears. + if (current_result->belt_printer_angle > 0.f) { + float angle = current_result->belt_printer_angle; + p->preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, angle); + } else { + p->preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(false, 0.f); + } + // show results p->preview->reload_print(m_only_gcode); //BBS: zoom to bed 0 for gcode preview diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 87e97c5ff7..e6de38df78 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4364,58 +4364,6 @@ void TabPrinter::build_fff() optgroup->append_single_option_line(option, "printer_basic_information_printable_space#excluded-bed-area"); // optgroup->append_single_option_line("printable_area"); optgroup->append_single_option_line("printable_height", "printer_basic_information_printable_space#printable-height"); - optgroup->append_single_option_line("build_plate_tilt_x"); - optgroup->append_single_option_line("build_plate_tilt_y"); - optgroup->append_single_option_line("belt_printer"); - optgroup->append_single_option_line("belt_printer_angle"); - optgroup->append_single_option_line("belt_printer_infinite_y"); - // Per-axis shear: group mode + angle + source on one row per axis - { - Line line = { L("Shear X"), L("Shear applied to the X axis before slicing") }; - line.append_option(optgroup->get_option("belt_shear_x")); - line.append_option(optgroup->get_option("belt_shear_x_angle")); - line.append_option(optgroup->get_option("belt_shear_x_from")); - optgroup->append_line(line); - } - { - Line line = { L("Shear Y"), L("Shear applied to the Y axis before slicing") }; - line.append_option(optgroup->get_option("belt_shear_y")); - line.append_option(optgroup->get_option("belt_shear_y_angle")); - line.append_option(optgroup->get_option("belt_shear_y_from")); - optgroup->append_line(line); - } - { - Line line = { L("Shear Z"), L("Shear applied to the Z axis before slicing") }; - line.append_option(optgroup->get_option("belt_shear_z")); - line.append_option(optgroup->get_option("belt_shear_z_angle")); - line.append_option(optgroup->get_option("belt_shear_z_from")); - optgroup->append_line(line); - } - { - Line line = { L("Scale X"), L("Scale applied to the X axis before slicing") }; - line.append_option(optgroup->get_option("belt_scale_x")); - line.append_option(optgroup->get_option("belt_scale_x_angle")); - optgroup->append_line(line); - } - { - Line line = { L("Scale Y"), L("Scale applied to the Y axis before slicing") }; - line.append_option(optgroup->get_option("belt_scale_y")); - line.append_option(optgroup->get_option("belt_scale_y_angle")); - optgroup->append_line(line); - } - { - Line line = { L("Scale Z"), L("Scale applied to the Z axis before slicing") }; - line.append_option(optgroup->get_option("belt_scale_z")); - line.append_option(optgroup->get_option("belt_scale_z_angle")); - optgroup->append_line(line); - } - { - Line line = { L("G-code axis remap"), L("Remap slicing-frame axes to machine axes in G-code output") }; - line.append_option(optgroup->get_option("belt_gcode_remap_x")); - line.append_option(optgroup->get_option("belt_gcode_remap_y")); - line.append_option(optgroup->get_option("belt_gcode_remap_z")); - optgroup->append_line(line); - } optgroup->append_single_option_line("support_multi_bed_types","printer_basic_information_printable_space#support-multi-bed-types"); optgroup->append_single_option_line("best_object_pos", "printer_basic_information_printable_space#best-object-position"); // todo: for multi_extruder test @@ -4434,6 +4382,68 @@ void TabPrinter::build_fff() //option.opt.full_width = true; //optgroup->append_single_option_line(option); optgroup->append_single_option_line("disable_m73", "printer_basic_information_advanced#disable-set-remaining-print-time"); + optgroup->append_single_option_line("build_plate_tilt_x"); + optgroup->append_single_option_line("build_plate_tilt_y"); + optgroup->append_single_option_line("belt_printer"); + optgroup->append_single_option_line("belt_printer_angle"); + optgroup->append_single_option_line("belt_printer_infinite_y"); + // Per-axis shear: group mode + angle + source on one row per axis + { + Line line = { L("Mesh shear X"), L("Shear applied to the X axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_x")); + line.append_option(optgroup->get_option("belt_shear_x_angle")); + line.append_option(optgroup->get_option("belt_shear_x_from")); + line.append_option(optgroup->get_option("belt_shear_x_global")); + optgroup->append_line(line); + } + { + Line line = { L("Mesh shear Y"), L("Shear applied to the Y axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_y")); + line.append_option(optgroup->get_option("belt_shear_y_angle")); + line.append_option(optgroup->get_option("belt_shear_y_from")); + line.append_option(optgroup->get_option("belt_shear_y_global")); + optgroup->append_line(line); + } + { + Line line = { L("Mesh shear Z"), L("Shear applied to the Z axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_z")); + line.append_option(optgroup->get_option("belt_shear_z_angle")); + line.append_option(optgroup->get_option("belt_shear_z_from")); + line.append_option(optgroup->get_option("belt_shear_z_global")); + optgroup->append_line(line); + } + { + Line line = { L("Mesh scale X"), L("Scale applied to the X axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_x")); + line.append_option(optgroup->get_option("belt_scale_x_angle")); + optgroup->append_line(line); + } + { + Line line = { L("Mesh scale Y"), L("Scale applied to the Y axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_y")); + line.append_option(optgroup->get_option("belt_scale_y_angle")); + optgroup->append_line(line); + } + { + Line line = { L("Mesh scale Z"), L("Scale applied to the Z axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_z")); + line.append_option(optgroup->get_option("belt_scale_z_angle")); + optgroup->append_line(line); + } + { + Line line = { L("G-code axis remap"), L("Remap slicing-frame axes to machine axes in G-code output") }; + line.append_option(optgroup->get_option("belt_gcode_remap_x")); + line.append_option(optgroup->get_option("belt_gcode_remap_y")); + line.append_option(optgroup->get_option("belt_gcode_remap_z")); + optgroup->append_line(line); + } + { + Line line = { L("Support floor"), L("Belt floor awareness for support generation and clipping") }; + line.append_option(optgroup->get_option("belt_support_floor_mode")); + line.append_option(optgroup->get_option("belt_support_floor_offset")); + line.append_option(optgroup->get_option("belt_support_z_offset_mode")); + optgroup->append_line(line); + } option = optgroup->get_option("thumbnails"); option.opt.full_width = true; optgroup->append_single_option_line(option, "printer_basic_information_advanced#g-code-thumbnails"); @@ -5283,6 +5293,33 @@ void TabPrinter::toggle_options() "belt_scale_x", "belt_scale_y", "belt_scale_z", "belt_gcode_remap_x"}) toggle_line(el, is_belt); + + // Gray out angle/from sub-options when their parent shear/scale mode is None. + auto sx = m_config->option>("belt_shear_x")->value; + toggle_option("belt_shear_x_angle", is_belt && sx != BeltShearMode::None); + toggle_option("belt_shear_x_from", is_belt && sx != BeltShearMode::None); + toggle_option("belt_shear_x_global", is_belt && sx != BeltShearMode::None); + + auto sy = m_config->option>("belt_shear_y")->value; + toggle_option("belt_shear_y_angle", is_belt && sy != BeltShearMode::None); + toggle_option("belt_shear_y_from", is_belt && sy != BeltShearMode::None); + toggle_option("belt_shear_y_global", is_belt && sy != BeltShearMode::None); + + auto sz = m_config->option>("belt_shear_z")->value; + toggle_option("belt_shear_z_angle", is_belt && sz != BeltShearMode::None); + toggle_option("belt_shear_z_from", is_belt && sz != BeltShearMode::None); + toggle_option("belt_shear_z_global", is_belt && sz != BeltShearMode::None); + + auto scx = m_config->option>("belt_scale_x")->value; + toggle_option("belt_scale_x_angle", is_belt && scx != BeltScaleMode::None); + + auto scy = m_config->option>("belt_scale_y")->value; + toggle_option("belt_scale_y_angle", is_belt && scy != BeltScaleMode::None); + + auto scz = m_config->option>("belt_scale_z")->value; + toggle_option("belt_scale_z_angle", is_belt && scz != BeltScaleMode::None); + + toggle_line("belt_support_floor_mode", is_belt); } From b297f68921a74b95b108a9afb5d4f08fed3256c9 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 25 Mar 2026 22:19:31 -0500 Subject: [PATCH 006/389] Part 2.7: Add G-code back-transform and tree support belt floor clipping - Add BeltBackTransform class that inverts the shear/scale matrix and applies it in GCodeWriter::to_machine_coords() so G-code outputs in the machine's physical coordinate space, gated by new belt_gcode_back_transform config option - Extend belt floor clipping to all three tree support pipelines (Prusa-style, Orca organic, TreeModelVolumes) with per-layer polygon clipping, anti-overhang integration, and belt raft extension layers - Fix tree drop_nodes() belt termination, organic support global Z offset, collision calculation index bug, and first-layer brim/empty layer checks for belt printers two-shot - first build built but didn't plumb to UI. Woah. add pre-slice axis remap, because Y needs to be Z going to change tactic and move based on bbox min switch to per axis snapping per axis swap snap now per object build plate tilt wasn't invalidating slicer settings support upper bound now correct, need to get lower bound corrected axis swapped support termination corrected Z Shear works with and without pre-slice remap now --- src/libslic3r/CMakeLists.txt | 2 + src/libslic3r/GCode.cpp | 142 +++++++++++++++++++ src/libslic3r/GCode.hpp | 5 + src/libslic3r/GCode/BeltBackTransform.cpp | 150 +++++++++++++++++++++ src/libslic3r/GCode/BeltBackTransform.hpp | 45 +++++++ src/libslic3r/GCode/GCodeProcessor.cpp | 22 +++ src/libslic3r/GCode/GCodeProcessor.hpp | 6 + src/libslic3r/GCodeWriter.cpp | 32 ++++- src/libslic3r/GCodeWriter.hpp | 9 ++ src/libslic3r/Preset.cpp | 6 +- src/libslic3r/Print.cpp | 11 +- src/libslic3r/Print.hpp | 31 +++++ src/libslic3r/PrintConfig.cpp | 60 ++++++++- src/libslic3r/PrintConfig.hpp | 10 ++ src/libslic3r/PrintObject.cpp | 19 ++- src/libslic3r/PrintObjectSlice.cpp | 117 +++++++++++++--- src/libslic3r/Support/TreeModelVolumes.cpp | 2 +- src/libslic3r/Support/TreeSupport.cpp | 93 +++++++++++++ src/libslic3r/Support/TreeSupport3D.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 39 +++++- 20 files changed, 767 insertions(+), 36 deletions(-) create mode 100644 src/libslic3r/GCode/BeltBackTransform.cpp create mode 100644 src/libslic3r/GCode/BeltBackTransform.hpp diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 5f9591452f..c2d92ee800 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -208,6 +208,8 @@ set(lisbslic3r_sources GCode/AdaptivePAProcessor.hpp GCode/AvoidCrossingPerimeters.cpp GCode/AvoidCrossingPerimeters.hpp + GCode/BeltBackTransform.cpp + GCode/BeltBackTransform.hpp GCode/ConflictChecker.cpp GCode/ConflictChecker.hpp GCode/CoolingBuffer.cpp diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 41cfa7b72a..8391f9b820 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2432,6 +2432,16 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Build volume extents for Rev remap mode. BoundingBoxf bbox_bed(print.config().printable_area.values); m_writer.set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), print.config().printable_height.value)); + // Initialize the back-transform that undoes slicing shear/scale. + m_writer.set_belt_back_transform(print.config()); + // Per-axis origin snap: store config; actual snap is computed + // per-instance in update_origin_snap() called from set_origin(). + m_origin_snap[0] = print.config().belt_origin_snap_x.value; + m_origin_snap[1] = print.config().belt_origin_snap_y.value; + m_origin_snap[2] = print.config().belt_origin_snap_z.value; + m_origin_snap_offset[0] = print.config().belt_origin_offset_x.value; + m_origin_snap_offset[1] = print.config().belt_origin_offset_y.value; + m_origin_snap_offset[2] = print.config().belt_origin_offset_z.value; } // How many times will be change_layer() called? @@ -2544,6 +2554,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); + file.write_format("; belt_preslice_remap_x = %s\n", full_cfg.opt_serialize("belt_preslice_remap_x").c_str()); + file.write_format("; belt_preslice_remap_y = %s\n", full_cfg.opt_serialize("belt_preslice_remap_y").c_str()); + file.write_format("; belt_preslice_remap_z = %s\n", full_cfg.opt_serialize("belt_preslice_remap_z").c_str()); } if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); @@ -3248,6 +3261,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } print.throw_if_canceled(); this->set_origin(unscale((*print_object_instance_sequential_active)->shift)); + this->update_origin_snap((*print_object_instance_sequential_active)->print_object, + (*print_object_instance_sequential_active)->shift); // BBS: prime extruder if extruder change happens before this object instance bool prime_extruder = false; @@ -5212,6 +5227,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); + this->update_origin_snap(&instance_to_print.print_object, offset); if (instance_to_print.object_by_extruder.support != nullptr) { m_layer = layers[instance_to_print.layer_id].support_layer; m_object_layer_over_raft = false; @@ -5235,6 +5251,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); + this->update_origin_snap(&instance_to_print.print_object, offset); ExtrusionEntityCollection support_eec; // BBS @@ -5283,6 +5300,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); + this->update_origin_snap(&instance_to_print.print_object, offset); //FIXME the following code prints regions in the order they are defined, the path is not optimized in any way. auto has_infill = [](const std::vector &by_region) { @@ -5509,6 +5527,130 @@ void GCode::set_origin(const Vec2d &pointf) m_origin = pointf; } +void GCode::update_origin_snap(const PrintObject *obj, const Point &inst_shift) +{ + if (!m_origin_snap[0] && !m_origin_snap[1] && !m_origin_snap[2]) + return; + + // Clear existing snap so to_machine_coords gives raw machine coords for bbox computation. + for (int a = 0; a < 3; ++a) + m_writer.set_origin_snap(a, false, 0., 0.); + + // Reconstruct the belt pipeline transform for this object (same as + // PrintObjectSlice.cpp: z_shift * scale * shear * pre_remap). + const auto &cfg = m_config; + Transform3d belt = Transform3d::Identity(); + + // Pre-slice remap + int pre_rx = int(cfg.belt_preslice_remap_x.value); + int pre_ry = int(cfg.belt_preslice_remap_y.value); + int pre_rz = int(cfg.belt_preslice_remap_z.value); + if (pre_rx != int(BeltRemapAxis::PosX) || + pre_ry != int(BeltRemapAxis::PosY) || + pre_rz != int(BeltRemapAxis::PosZ)) { + auto remap_col = [](int r) -> Vec3d { + int a = r % 3; Vec3d c = Vec3d::Zero(); + c[a] = (r < 3) ? 1.0 : -1.0; + return c; + }; + Matrix3d lin; + lin.col(0) = remap_col(pre_rx); + lin.col(1) = remap_col(pre_ry); + lin.col(2) = remap_col(pre_rz); + Transform3d pre = Transform3d::Identity(); + pre.linear() = lin; + if (pre_rx >= 6 || pre_ry >= 6 || pre_rz >= 6) { + BoundingBoxf bb(cfg.printable_area.values); + Vec3d vm(bb.max.x(), bb.max.y(), cfg.printable_height.value); + Vec3d tr = Vec3d::Zero(); + if (pre_rx >= 6) tr[0] = vm[pre_rx % 3]; + if (pre_ry >= 6) tr[1] = vm[pre_ry % 3]; + if (pre_rz >= 6) tr[2] = vm[pre_rz % 3]; + pre.translation() = tr; + } + belt = pre * belt; + } + + // Shear + auto shear_f = [](BeltShearMode m, double a) -> double { + double r = Geometry::deg2rad(a), s = std::sin(r), c = std::cos(r); + switch (m) { + case BeltShearMode::PosCot: return (s > EPSILON) ? c/s : 0.; + case BeltShearMode::NegCot: return (s > EPSILON) ? -c/s : 0.; + case BeltShearMode::PosTan: return (c > EPSILON) ? s/c : 0.; + case BeltShearMode::NegTan: return (c > EPSILON) ? -s/c : 0.; + default: return 0.; + } + }; + struct AS { BeltShearMode m; double a; int f; }; + AS axes[3] = { + {cfg.belt_shear_x.value, cfg.belt_shear_x_angle.value, int(cfg.belt_shear_x_from.value)}, + {cfg.belt_shear_y.value, cfg.belt_shear_y_angle.value, int(cfg.belt_shear_y_from.value)}, + {cfg.belt_shear_z.value, cfg.belt_shear_z_angle.value, int(cfg.belt_shear_z_from.value)}, + }; + Transform3d shear = Transform3d::Identity(); + for (int i = 0; i < 3; ++i) + if (axes[i].m != BeltShearMode::None) { + double f = shear_f(axes[i].m, axes[i].a); + if (std::abs(f) > EPSILON) + shear.matrix()(i, axes[i].f) += f; + } + + // Scale + auto scale_f = [](BeltScaleMode m, double a) -> double { + if (m == BeltScaleMode::None) return 1.; + double r = Geometry::deg2rad(a), s = std::sin(r), c = std::cos(r); + switch (m) { + case BeltScaleMode::InvSin: return (s > EPSILON) ? 1./s : 1.; + case BeltScaleMode::InvCos: return (c > EPSILON) ? 1./c : 1.; + case BeltScaleMode::Sin: return s; + case BeltScaleMode::Cos: return c; + default: return 1.; + } + }; + Transform3d sc = Transform3d::Identity(); + sc.matrix()(0,0) = scale_f(cfg.belt_scale_x.value, cfg.belt_scale_x_angle.value); + sc.matrix()(1,1) = scale_f(cfg.belt_scale_y.value, cfg.belt_scale_y_angle.value); + sc.matrix()(2,2) = scale_f(cfg.belt_scale_z.value, cfg.belt_scale_z_angle.value); + + belt = sc * shear * belt; + + // Z-shift + double zs = (obj->belt_min_z() < 0.) ? -obj->belt_min_z() : 0.; + if (zs > 0.) { + Transform3d zsh = Transform3d::Identity(); + zsh.matrix()(2, 3) = zs; + belt = zsh * belt; + } + + // Full transform: belt * trafo_centered + Transform3d full = belt * obj->trafo_centered(); + + // Instance shift in slicer space + global Z offset + Vec3d shift(unscale(inst_shift.x()), + unscale(inst_shift.y()), + obj->belt_global_z_offset()); + + // Compute this instance's machine-space bbox min + BoundingBoxf3 bb = obj->model_object()->raw_bounding_box(); + Vec3d mn = bb.min.cast(), mx = bb.max.cast(); + Vec3d inst_min(std::numeric_limits::max(), + std::numeric_limits::max(), + std::numeric_limits::max()); + for (int i = 0; i < 8; ++i) { + Vec3d c((i & 1) ? mx.x() : mn.x(), + (i & 2) ? mx.y() : mn.y(), + (i & 4) ? mx.z() : mn.z()); + Vec3d mc = m_writer.to_machine_coords(full * c + shift); + for (int a = 0; a < 3; ++a) + inst_min[a] = std::min(inst_min[a], mc[a]); + } + + // Update writer snap for each enabled axis + for (int a = 0; a < 3; ++a) + m_writer.set_origin_snap(a, m_origin_snap[a], m_origin_snap_offset[a], inst_min[a]); +} + std::string GCode::preamble() { std::string gcode = m_writer.preamble(); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index d379300bad..dbec7d0315 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -493,6 +493,11 @@ private: This affects the input arguments supplied to the extrude*() and travel_to() methods. */ Vec2d m_origin; + // Per-axis origin snap: shift G-code so each object's bbox min = offset. + bool m_origin_snap[3] = {false, false, false}; + double m_origin_snap_offset[3] = {0., 0., 0.}; + // Called when switching instances to recompute the writer's snap for this instance. + void update_origin_snap(const PrintObject *obj, const Point &inst_shift); FullPrintConfig m_config; DynamicConfig m_calib_config; // scaled G-code resolution diff --git a/src/libslic3r/GCode/BeltBackTransform.cpp b/src/libslic3r/GCode/BeltBackTransform.cpp new file mode 100644 index 0000000000..7cd5bc6b53 --- /dev/null +++ b/src/libslic3r/GCode/BeltBackTransform.cpp @@ -0,0 +1,150 @@ +#include "BeltBackTransform.hpp" +#include "../Geometry.hpp" +#include + +namespace Slic3r { + +// Keep in sync with PrintObjectSlice.cpp compute_shear_factor (lines ~147-157). +static double compute_shear_factor(BeltShearMode mode, double angle_deg) +{ + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } +} + +// Keep in sync with PrintObjectSlice.cpp compute_scale_factor (lines ~180-192). +static double compute_scale_factor(BeltScaleMode mode, double angle_deg) +{ + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } +} + +bool BeltBackTransform::init_from_config(const PrintConfig &config) +{ + m_active = false; + m_inverse = Transform3d::Identity(); + + if (!config.belt_printer.value || !config.belt_gcode_back_transform.value) + return false; + + // --- Pre-slice axis remap (same as PrintObjectSlice.cpp) --- + int pre_rx = int(config.belt_preslice_remap_x.value); + int pre_ry = int(config.belt_preslice_remap_y.value); + int pre_rz = int(config.belt_preslice_remap_z.value); + + bool has_preslice_remap = (pre_rx != int(BeltRemapAxis::PosX) || + pre_ry != int(BeltRemapAxis::PosY) || + pre_rz != int(BeltRemapAxis::PosZ)); + + // Require at least one active transform to proceed. + bool has_global_shear = config.belt_shear_x_global.value || + config.belt_shear_y_global.value || + config.belt_shear_z_global.value; + if (!has_global_shear && !has_preslice_remap) + return false; + + // Build pre-slice remap matrix. + Transform3d pre_remap = Transform3d::Identity(); + if (has_preslice_remap) { + auto remap_column = [](int r) -> Vec3d { + int axis = r % 3; + Vec3d col = Vec3d::Zero(); + if (r < 3) col[axis] = 1.0; + else if (r < 6) col[axis] = -1.0; + else col[axis] = -1.0; // Rev: max - pos + return col; + }; + + Matrix3d remap_lin; + remap_lin.col(0) = remap_column(pre_rx); + remap_lin.col(1) = remap_column(pre_ry); + remap_lin.col(2) = remap_column(pre_rz); + pre_remap.linear() = remap_lin; + + // Rev mode translation (needs build volume extents). + Vec3d remap_trans = Vec3d::Zero(); + if (pre_rx >= 6 || pre_ry >= 6 || pre_rz >= 6) { + BoundingBoxf bbox_bed(config.printable_area.values); + Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), + config.printable_height.value); + auto add_rev = [&](int r, int out) { + if (r >= 6) remap_trans[out] = vol_max[r % 3]; + }; + add_rev(pre_rx, 0); + add_rev(pre_ry, 1); + add_rev(pre_rz, 2); + } + pre_remap.translation() = remap_trans; + } + + // Build per-axis shear matrix (same as PrintObjectSlice.cpp). + struct AxisShear { BeltShearMode mode; double angle; int from; }; + AxisShear axes[3] = { + { config.belt_shear_x.value, config.belt_shear_x_angle.value, int(config.belt_shear_x_from.value) }, + { config.belt_shear_y.value, config.belt_shear_y_angle.value, int(config.belt_shear_y_from.value) }, + { config.belt_shear_z.value, config.belt_shear_z_angle.value, int(config.belt_shear_z_from.value) }, + }; + + Matrix3d shear = Matrix3d::Identity(); + bool has_shear = false; + for (int row = 0; row < 3; ++row) { + if (axes[row].mode != BeltShearMode::None) { + double factor = compute_shear_factor(axes[row].mode, axes[row].angle); + if (std::abs(factor) > EPSILON) { + shear(row, axes[row].from) += factor; + has_shear = true; + } + } + } + + // Build per-axis scale diagonal matrix (same as PrintObjectSlice.cpp). + double sx = compute_scale_factor(config.belt_scale_x.value, config.belt_scale_x_angle.value); + double sy = compute_scale_factor(config.belt_scale_y.value, config.belt_scale_y_angle.value); + double sz = compute_scale_factor(config.belt_scale_z.value, config.belt_scale_z_angle.value); + + Matrix3d scale = Matrix3d::Identity(); + bool has_scale = (std::abs(sx - 1.) > EPSILON || + std::abs(sy - 1.) > EPSILON || + std::abs(sz - 1.) > EPSILON); + if (has_scale) { + scale(0, 0) = sx; + scale(1, 1) = sy; + scale(2, 2) = sz; + } + + if (!has_shear && !has_scale && !has_preslice_remap) + return false; + + // Forward pipeline: scale * shear * pre_remap (same order as PrintObjectSlice.cpp). + Transform3d combined = Transform3d::Identity(); + combined.linear() = scale * shear; + combined = combined * pre_remap; + m_inverse = combined.inverse(); + m_active = true; + return true; +} + +Vec3d BeltBackTransform::apply(const Vec3d &pos) const +{ + if (!m_active) + return pos; + return m_inverse * pos; +} + +} // namespace Slic3r diff --git a/src/libslic3r/GCode/BeltBackTransform.hpp b/src/libslic3r/GCode/BeltBackTransform.hpp new file mode 100644 index 0000000000..5a75d94dc8 --- /dev/null +++ b/src/libslic3r/GCode/BeltBackTransform.hpp @@ -0,0 +1,45 @@ +#ifndef slic3r_BeltBackTransform_hpp_ +#define slic3r_BeltBackTransform_hpp_ + +#include "../libslic3r.h" +#include "../Point.hpp" +#include "../PrintConfig.hpp" + +namespace Slic3r { + +// Reverses the pre-slice remap + shear + scale transforms that +// PrintObjectSlice.cpp applies to belt printer geometry, converting G-code +// coordinates from the sliced (remapped/sheared/scaled) frame back to the +// machine's real coordinate space. +// +// Initialized once from PrintConfig, then applied per-point in +// GCodeWriter::to_machine_coords() before axis remapping. +// +// Active when belt_gcode_back_transform is true AND at least one of: +// - a shear axis has global mode enabled, or +// - a pre-slice axis remap is non-identity. +class BeltBackTransform +{ +public: + BeltBackTransform() = default; + + // Initialize from belt printer config. Rebuilds the same pre-slice remap, + // shear, and scale matrices as PrintObjectSlice.cpp and precomputes the + // affine inverse. Returns true if a non-identity back-transform was computed. + bool init_from_config(const PrintConfig &config); + + // Apply the inverse transform to a point. Returns pos unchanged if + // no back-transform is active. + Vec3d apply(const Vec3d &pos) const; + + // True if a non-identity back-transform is active. + bool is_active() const { return m_active; } + +private: + bool m_active = false; + Transform3d m_inverse = Transform3d::Identity(); +}; + +} // namespace Slic3r + +#endif // slic3r_BeltBackTransform_hpp_ diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 8def7c08db..4c630bb6de 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3128,6 +3128,28 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers if (boost::starts_with(comment, " belt_scale_z_angle = ")) { try { m_result.belt_scale_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; } + // Pre-slice axis remap + auto parse_remap_axis = [](const std::string &s) -> BeltRemapAxis { + if (s == "pos_x") return BeltRemapAxis::PosX; + if (s == "pos_y") return BeltRemapAxis::PosY; + if (s == "pos_z") return BeltRemapAxis::PosZ; + if (s == "neg_x") return BeltRemapAxis::NegX; + if (s == "neg_y") return BeltRemapAxis::NegY; + if (s == "neg_z") return BeltRemapAxis::NegZ; + if (s == "rev_x") return BeltRemapAxis::RevX; + if (s == "rev_y") return BeltRemapAxis::RevY; + if (s == "rev_z") return BeltRemapAxis::RevZ; + return BeltRemapAxis::PosX; + }; + if (boost::starts_with(comment, " belt_preslice_remap_x = ")) { + m_result.belt_preslice_remap_x = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + } + if (boost::starts_with(comment, " belt_preslice_remap_y = ")) { + m_result.belt_preslice_remap_y = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + } + if (boost::starts_with(comment, " belt_preslice_remap_z = ")) { + m_result.belt_preslice_remap_z = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + } } // wipe start tag if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) { diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index f953345f4e..7d08a9cdfd 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -246,6 +246,9 @@ class Print; float belt_scale_y_angle{ 45.f }; BeltScaleMode belt_scale_z{ BeltScaleMode::None }; float belt_scale_z_angle{ 45.f }; + BeltRemapAxis belt_preslice_remap_x{ BeltRemapAxis::PosX }; + BeltRemapAxis belt_preslice_remap_y{ BeltRemapAxis::PosY }; + BeltRemapAxis belt_preslice_remap_z{ BeltRemapAxis::PosZ }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; @@ -321,6 +324,9 @@ class Print; belt_scale_y_angle = other.belt_scale_y_angle; belt_scale_z = other.belt_scale_z; belt_scale_z_angle = other.belt_scale_z_angle; + belt_preslice_remap_x = other.belt_preslice_remap_x; + belt_preslice_remap_y = other.belt_preslice_remap_y; + belt_preslice_remap_z = other.belt_preslice_remap_z; #if ENABLE_GCODE_VIEWER_STATISTICS time = other.time; #endif diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index d6bb5a0bb9..8c2f7122b8 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -37,18 +37,40 @@ void GCodeWriter::set_build_volume_max(const Vec3d &max) m_build_vol_max = max; } +void GCodeWriter::set_belt_back_transform(const PrintConfig &config) +{ + m_belt_back_transform.init_from_config(config); +} + +void GCodeWriter::set_origin_snap(int axis, bool enable, double offset, double bbox_min) +{ + if (axis >= 0 && axis < 3) { + m_origin_snap[axis] = enable; + m_origin_offset[axis] = offset; + m_origin_bbox_min[axis] = bbox_min; + } +} + Vec3d GCodeWriter::to_machine_coords(const Vec3d &pos) const { if (!is_belt_printer()) return pos; + // Step 1: Undo the shear/scale applied during slicing. + Vec3d p = m_belt_back_transform.apply(pos); + // Step 2: Apply axis remapping for the machine's coordinate convention. // BeltRemapAxis: 0-2 = +X/+Y/+Z, 3-5 = -X/-Y/-Z, 6-8 = Rev X/Y/Z - auto remap = [this, &pos](int r) -> double { + auto remap = [this, &p](int r) -> double { int axis = r % 3; - if (r < 3) return pos[axis]; - if (r < 6) return -pos[axis]; - return m_build_vol_max[axis] - pos[axis]; + if (r < 3) return p[axis]; + if (r < 6) return -p[axis]; + return m_build_vol_max[axis] - p[axis]; }; - return { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; + Vec3d result = { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; + // Per-axis origin snap: shift so bbox min on each enabled axis = offset. + for (int i = 0; i < 3; ++i) + if (m_origin_snap[i]) + result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); + return result; } bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 6074eb247c..2334f5d416 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -8,6 +8,7 @@ #include "Point.hpp" #include "PrintConfig.hpp" #include "GCode/CoolingBuffer.hpp" +#include "GCode/BeltBackTransform.hpp" namespace Slic3r { @@ -132,6 +133,10 @@ public: void set_axis_remap(int rx, int ry, int rz); // Set build volume extents for Rev remap mode (max X, Y, Z). void set_build_volume_max(const Vec3d &max); + // Initialize the belt back-transform that undoes slicing shear/scale. + void set_belt_back_transform(const PrintConfig &config); + // Set per-axis origin snap: shifts G-code so bbox min on this axis = offset. + void set_origin_snap(int axis, bool enable, double offset, double bbox_min); // Transform a point from the slicing frame to machine coordinates. Vec3d to_machine_coords(const Vec3d &pos) const; @@ -194,6 +199,10 @@ public: int m_remap_y = 1; int m_remap_z = 2; Vec3d m_build_vol_max = Vec3d::Zero(); + BeltBackTransform m_belt_back_transform; + bool m_origin_snap[3] = {false, false, false}; + double m_origin_offset[3] = {0., 0., 0.}; // target coord for bbox min + double m_origin_bbox_min[3] = {0., 0., 0.}; // computed bbox min in machine space double m_current_speed; bool m_is_first_layer = true; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 9437b6098e..9cc5e03d40 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1014,7 +1014,11 @@ static std::vector s_Preset_printer_options { "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", "belt_shear_y_global", "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", "belt_shear_z_global", "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", - "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", + "belt_preslice_remap_x", "belt_preslice_remap_y", "belt_preslice_remap_z", + "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", "belt_gcode_back_transform", + "belt_origin_snap_x", "belt_origin_offset_x", + "belt_origin_snap_y", "belt_origin_offset_y", + "belt_origin_snap_z", "belt_origin_offset_z", "belt_support_floor_offset", "belt_support_floor_mode", "belt_support_z_offset_mode", "gcode_flavor", "fan_kickstart", "fan_speedup_time", "fan_speedup_overhangs", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 0aef12a74b..0b7190e8d1 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -103,6 +103,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", + "belt_origin_snap_x", "belt_origin_offset_x", + "belt_origin_snap_y", "belt_origin_offset_y", + "belt_origin_snap_z", "belt_origin_offset_z", //BBS "additional_cooling_fan_speed", "reduce_crossing_wall", @@ -280,6 +283,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n // In Spiral Vase mode, holes are closed and only the largest area contour is kept at each layer. // Therefore toggling the Spiral Vase on / off requires complete reslicing. || opt_key == "spiral_mode" + // Build plate tilt changes slicing plane orientation. + || opt_key == "build_plate_tilt_x" + || opt_key == "build_plate_tilt_y" // Belt printer transform options change the mesh geometry before slicing. || opt_key == "belt_printer" || opt_key == "belt_printer_angle" @@ -300,7 +306,10 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "belt_scale_y" || opt_key == "belt_scale_y_angle" || opt_key == "belt_scale_z" - || opt_key == "belt_scale_z_angle") { + || opt_key == "belt_scale_z_angle" + || opt_key == "belt_preslice_remap_x" + || opt_key == "belt_preslice_remap_y" + || opt_key == "belt_preslice_remap_z") { osteps.emplace_back(posSlice); } else if ( opt_key == "belt_support_floor_offset" diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index d0c050f442..c13a1407c0 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -186,6 +186,36 @@ class ConstSupportLayerPtrsAdaptor : public ConstVectorOfPtrsAdaptor(data) {} }; +// Returns the model's raw bounding box with pre-slice axis remap applied. +// When no remap is active, returns the unmodified raw_bounding_box(). +inline BoundingBoxf3 belt_remapped_bbox(const ModelObject &model_object, const PrintConfig &config) +{ + BoundingBoxf3 bb = model_object.raw_bounding_box(); + int pre_rx = int(config.belt_preslice_remap_x.value); + int pre_ry = int(config.belt_preslice_remap_y.value); + int pre_rz = int(config.belt_preslice_remap_z.value); + if (pre_rx == int(BeltRemapAxis::PosX) && + pre_ry == int(BeltRemapAxis::PosY) && + pre_rz == int(BeltRemapAxis::PosZ)) + return bb; // Identity remap, no change. + auto remap_coord = [](int r, const Vec3d &v) -> double { + int axis = r % 3; + if (r < 3) return v[axis]; + return -v[axis]; + }; + Vec3d mn = bb.min.cast(), mx = bb.max.cast(); + BoundingBoxf3 rbb; + for (int i = 0; i < 8; ++i) { + Vec3d c((i & 1) ? mx.x() : mn.x(), + (i & 2) ? mx.y() : mn.y(), + (i & 4) ? mx.z() : mn.z()); + Vec3d rc(remap_coord(pre_rx, c), remap_coord(pre_ry, c), remap_coord(pre_rz, c)); + if (i == 0) rbb = BoundingBoxf3(rc, rc); + else rbb.merge(rc); + } + return rbb; +} + // Single instance of a PrintObject. // As multiple PrintObjects may be generated for a single ModelObject (their instances differ in rotation around Z), // ModelObject's instancess will be distributed among these multiple PrintObjects. @@ -579,6 +609,7 @@ private: double m_belt_min_z { 0.0 }; public: double belt_global_z_offset() const { return m_belt_global_z_offset; } + double belt_min_z() const { return m_belt_min_z; } private: diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 7d06f96a85..506bd17a29 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6132,9 +6132,63 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionEnum(default_axis)); }; - add_belt_remap("belt_gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output.", BeltRemapAxis::PosX); - add_belt_remap("belt_gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output.", BeltRemapAxis::PosY); - add_belt_remap("belt_gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output.", BeltRemapAxis::PosZ); + add_belt_remap("belt_preslice_remap_x", "X", + "Before slicing, which model-space axis becomes the slicer's X axis. " + "Use this to re-orient the coordinate system so the slicer's XY plane matches " + "your belt printer's physical bed plane. For a printer whose bed is in the XZ plane, " + "set Y to +Z and Z to +Y (or -Y) to swap the vertical and belt-travel axes. " + "Default +X: no change.", + BeltRemapAxis::PosX); + add_belt_remap("belt_preslice_remap_y", "Y", + "Before slicing, which model-space axis becomes the slicer's Y axis. " + "The slicer treats Y as one of the two horizontal bed axes. If your physical " + "belt surface runs along the Z axis, map Y to +Z here so the slicer slices " + "along the correct plane. Default +Y: no change.", + BeltRemapAxis::PosY); + add_belt_remap("belt_preslice_remap_z", "Z", + "Before slicing, which model-space axis becomes the slicer's Z axis (layer stacking direction). " + "The slicer builds layers upward along this axis. If your printer's layer-stacking " + "direction is the physical Y axis, map Z to +Y (or -Y for inverted direction). " + "Rev mode mirrors relative to the build volume maximum. Default +Z: no change.", + BeltRemapAxis::PosZ); + + add_belt_remap("belt_gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosX); + add_belt_remap("belt_gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosY); + add_belt_remap("belt_gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosZ); + + def = this->add("belt_gcode_back_transform", coBool); + def->label = L("G-code back-transform"); + def->category = L("Printable space"); + def->tooltip = L("Reverse the shear/scale transform applied during slicing so G-code " + "coordinates are in the machine's physical coordinate space. " + "Requires at least one shear axis with global mode enabled."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + + auto add_belt_origin_snap = [this](const char *key_snap, const char *key_offset, + const char *axis_label) { + auto def = this->add(key_snap, coBool); + def->label = L(axis_label); + def->category = L("Printable space"); + std::string tip = std::string("Shift G-code output so the object's bounding box minimum on machine ") + + axis_label + " equals the offset value."; + def->tooltip = L(tip); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + + def = this->add(key_offset, coFloat); + def->label = L("Offset"); + def->category = L("Printable space"); + def->tooltip = L("Target coordinate for the bounding box minimum on this machine axis."); + def->sidetext = L("mm"); + def->min = -10000; + def->max = 10000; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0)); + }; + add_belt_origin_snap("belt_origin_snap_x", "belt_origin_offset_x", "X"); + add_belt_origin_snap("belt_origin_snap_y", "belt_origin_offset_y", "Y"); + add_belt_origin_snap("belt_origin_snap_z", "belt_origin_offset_z", "Z"); // Belt support floor debug controls def = this->add("belt_support_floor_offset", coFloat); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index fc533bf6bb..8b469c4dc6 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1488,9 +1488,19 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, belt_scale_y_angle)) ((ConfigOptionEnum, belt_scale_z)) ((ConfigOptionFloat, belt_scale_z_angle)) + ((ConfigOptionEnum, belt_preslice_remap_x)) + ((ConfigOptionEnum, belt_preslice_remap_y)) + ((ConfigOptionEnum, belt_preslice_remap_z)) ((ConfigOptionEnum, belt_gcode_remap_x)) ((ConfigOptionEnum, belt_gcode_remap_y)) ((ConfigOptionEnum, belt_gcode_remap_z)) + ((ConfigOptionBool, belt_gcode_back_transform)) + ((ConfigOptionBool, belt_origin_snap_x)) + ((ConfigOptionFloat, belt_origin_offset_x)) + ((ConfigOptionBool, belt_origin_snap_y)) + ((ConfigOptionFloat, belt_origin_offset_y)) + ((ConfigOptionBool, belt_origin_snap_z)) + ((ConfigOptionFloat, belt_origin_offset_z)) ((ConfigOptionFloat, belt_support_floor_offset)) ((ConfigOptionEnum, belt_support_floor_mode)) ((ConfigOptionEnum, belt_support_z_offset_mode)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index f803cc0369..ba2ed408ce 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -3402,9 +3402,16 @@ void PrintObject::update_slicing_parameters() double belt_floor_shear_factor_out = 0.0; int belt_floor_from_axis_out = 1; double belt_floor_z_shift_out = 0.0; - // Belt shear/scale may change the effective Z height. + // Belt shear/scale/pre-remap may change the effective Z height. const auto &pcfg = this->print()->config(); if (pcfg.belt_printer.value) { + BoundingBoxf3 bb = belt_remapped_bbox(*this->model_object(), pcfg); + bool has_preslice_remap = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || + int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || + int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); + if (has_preslice_remap) + object_height = bb.size().z(); + bool has_z_shear = pcfg.belt_shear_z.value != BeltShearMode::None; bool has_z_scale = pcfg.belt_scale_z.value != BeltScaleMode::None; if (has_z_shear || has_z_scale) { @@ -3435,7 +3442,6 @@ void PrintObject::update_slicing_parameters() double scale_z = compute_scale_factor(pcfg.belt_scale_z.value, pcfg.belt_scale_z_angle.value); if (has_z_shear && std::abs(shear_factor) > EPSILON) { int from = int(pcfg.belt_shear_z_from.value); - BoundingBoxf3 bb = this->model_object()->raw_bounding_box(); double min_rz = std::numeric_limits::max(); double max_rz = std::numeric_limits::lowest(); for (double vz : {bb.min.z(), bb.max.z()}) @@ -3507,8 +3513,15 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full if (object_max_z <= 0.f) { BoundingBoxf3 bb = model_object.raw_bounding_box(); object_max_z = (float)bb.size().z(); - // Belt shear/scale may change the effective Z height. + // Belt pre-remap/shear/scale may change the effective Z height. if (print_config.belt_printer.value) { + bb = belt_remapped_bbox(model_object, print_config); + bool has_preslice_remap = (int(print_config.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || + int(print_config.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || + int(print_config.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); + if (has_preslice_remap) + object_max_z = (float)bb.size().z(); + bool has_z_shear = print_config.belt_shear_z.value != BeltShearMode::None; bool has_z_scale = print_config.belt_scale_z.value != BeltScaleMode::None; if (has_z_shear || has_z_scale) { diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 404550da1a..4c767ea0ed 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -143,6 +143,58 @@ static std::vector slice_volumes_inner( params_base.extra_offset = 0; params_base.trafo = object_trafo; if (print_config.belt_printer.value) { + // --- Pre-slice axis remap --- + // Permutes/negates model axes before slicing so the slicer's coordinate + // system matches the physical bed orientation (e.g. XZ bed instead of XY). + int pre_rx = int(print_config.belt_preslice_remap_x.value); + int pre_ry = int(print_config.belt_preslice_remap_y.value); + int pre_rz = int(print_config.belt_preslice_remap_z.value); + + bool has_preslice_remap = (pre_rx != int(BeltRemapAxis::PosX) || + pre_ry != int(BeltRemapAxis::PosY) || + pre_rz != int(BeltRemapAxis::PosZ)); + + if (has_preslice_remap) { + // Build volume extents for Rev mode. + BoundingBoxf bbox_bed(print_config.printable_area.values); + Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), + print_config.printable_height.value); + + // Each remap value selects a source axis and sign. + // The column vector tells the matrix which input axis feeds this output. + auto remap_column = [](int r) -> Vec3d { + int axis = r % 3; + Vec3d col = Vec3d::Zero(); + if (r < 3) col[axis] = 1.0; // +axis + else if (r < 6) col[axis] = -1.0; // -axis + else col[axis] = -1.0; // Rev: max - pos = -(pos - max) + return col; + }; + + Matrix3d remap_lin; + remap_lin.col(0) = remap_column(pre_rx); + remap_lin.col(1) = remap_column(pre_ry); + remap_lin.col(2) = remap_column(pre_rz); + + // Translation for Rev modes: output = max[src] - input[src]. + Vec3d remap_trans = Vec3d::Zero(); + auto add_rev_offset = [&](int r, int out_axis) { + if (r >= 6) { + int src_axis = r % 3; + remap_trans[out_axis] = vol_max[src_axis]; + } + }; + add_rev_offset(pre_rx, 0); + add_rev_offset(pre_ry, 1); + add_rev_offset(pre_rz, 2); + + Transform3d pre_remap = Transform3d::Identity(); + pre_remap.linear() = remap_lin; + pre_remap.translation() = remap_trans; + + params_base.trafo = pre_remap * params_base.trafo; + } + // Build per-axis shear matrix from 3 independent axis configs. auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { double angle_rad = Geometry::deg2rad(angle_deg); @@ -204,11 +256,12 @@ static std::vector slice_volumes_inner( } // Apply: scale * shear * trafo (shear first, then scale). - if (has_shear || has_scale) { + if (has_shear || has_scale) params_base.trafo = belt_scale * belt_shear * params_base.trafo; - // After the shear/scale transform, the mesh may clip through the - // build plate (Z < 0). Detect this and shift the mesh up. + // After pre-remap/shear/scale, the mesh may clip through the build + // plate (Z < 0). Detect this and shift the mesh up along slicer Z. + if (has_preslice_remap || has_shear || has_scale) { Transform3d combined = params_base.trafo; double min_z = std::numeric_limits::max(); for (const ModelVolume *mv : model_volumes) { @@ -893,17 +946,34 @@ void PrintObject::slice() this->slice_volumes(); m_print->throw_if_canceled(); - // After slicing, m_belt_min_z holds the exact post-shear minimum Z - // in trafo_centered space (which includes the ensure_on_bed Z offset). - // The belt surface is at Z=0 in trafo_centered space; after shear it - // becomes Z = sf*Y, and after the z-shift that keeps the mesh above - // Z=0 it becomes Z = sf*Y + z_shift_val. So belt_floor_z_shift is - // simply the z-shift applied, i.e. max(0, -m_belt_min_z). - // NOTE: do NOT add raw_bounding_box().min.z() here — m_belt_min_z - // already includes the ensure_on_bed offset, unlike the min_rz used - // in update_slicing_parameters() which needs that compensation. + // Belt floor Z-shift: where is the belt surface in final slicer space? + // + // The belt surface is at model_Y=0 (XZ belt plane). After the full + // pipeline (trafo_centered → pre_remap → shear → z_shift), the belt + // surface equation in slicer space is: + // Z_belt = sf * from_axis + belt_surface_z_centered + z_shift_val + // + // belt_surface_z_centered = remapped_bbox.min.z() (the Z position of + // the belt surface in centered-pre-shear slicer space, which is 0 + // without pre-remap but nonzero when e.g. Y↔Z swap shifts the belt + // surface away from Z=0 by the centering offset). + // + // z_shift_val = max(0, -m_belt_min_z) (lifts mesh above Z=0). + // + // So: belt_floor_z_shift = remapped_bb.min.z() + z_shift_val if (std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON) { - m_slicing_params.belt_floor_z_shift = (m_belt_min_z < 0.) ? -m_belt_min_z : 0.; + double z_shift_val = (m_belt_min_z < 0.) ? -m_belt_min_z : 0.; + // With pre-remap, the belt surface (model_Y=0) may not be at Z=0 in + // centered slicer space — add the remapped bbox min Z to compensate. + // Without pre-remap, the belt surface IS at Z=0 and bb.min.z() is + // already folded into m_belt_min_z, so use 0. + const auto &pcfg = this->print()->config(); + bool has_preslice_remap = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || + int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || + int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); + double belt_surface_z = has_preslice_remap + ? belt_remapped_bbox(*this->model_object(), pcfg).min.z() : 0.; + m_slicing_params.belt_floor_z_shift = belt_surface_z + z_shift_val; } int firstLayerReplacedBy = 0; @@ -989,14 +1059,23 @@ void PrintObject::slice() const auto &za = gaxes[2]; // Z row if (za.global && za.mode != BeltShearMode::None && za.from < 2) { double factor = compute_shear_factor(za.mode, za.angle); - // The Z-shift brought the mesh's lowest sheared vertex to - // Z=0. That vertex's physical Y determines the belt contact - // point. With trafo_z preserved (ensure_on_bed offset), - // min_z = Y_at_contact * factor for bottom-face vertices, - // so: z_offset = center_Y * factor + min_z. + // The global Z offset accounts for the instance's position- + // dependent shear contribution. m_belt_min_z is the minimum Z + // of the mesh after pre_remap + shear + trafo_centered, which + // includes the centering offset on the remapped Z axis. + // Subtract the belt surface's centered Z position so we get + // only the shear-induced contribution (same correction as the + // belt_floor_z_shift fix). + // Same pre-remap guard as belt_floor_z_shift above. + bool has_preslice_remap2 = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || + int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || + int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); + double belt_surface_z = has_preslice_remap2 + ? belt_remapped_bbox(*this->model_object(), this->print()->config()).min.z() : 0.; + double shear_min_z = m_belt_min_z - belt_surface_z; Point phys = inst_shift; // already has center_offset subtracted double center_on_axis = (za.from == 0) ? unscale(phys.x()) : unscale(phys.y()); - global_z_offset += center_on_axis * factor + m_belt_min_z; + global_z_offset += center_on_axis * factor + shear_min_z; } BOOST_LOG_TRIVIAL(warning) << "Belt global: z_offset=" << global_z_offset diff --git a/src/libslic3r/Support/TreeModelVolumes.cpp b/src/libslic3r/Support/TreeModelVolumes.cpp index e270b62aab..ec38ffed73 100644 --- a/src/libslic3r/Support/TreeModelVolumes.cpp +++ b/src/libslic3r/Support/TreeModelVolumes.cpp @@ -151,7 +151,7 @@ TreeModelVolumes::TreeModelVolumes( double belt_sf = sp2.belt_floor_shear_factor; if (std::abs(belt_sf) > EPSILON && std::abs(print_object.belt_global_z_offset()) > EPSILON && pcfg2.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { - double bb_min_z = std::abs(print_object.model_object()->raw_bounding_box().min.z()); + double bb_min_z = std::abs(belt_remapped_bbox(*print_object.model_object(), pcfg2).min.z()); double extra_depth = bb_min_z + 10.; int num_extra = std::max(0, (int)std::ceil(extra_depth / sp2.layer_height)); if (num_extra > 0) { diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 4966a5a139..60e681add9 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1733,6 +1733,99 @@ void TreeSupport::generate() + // Belt floor: extend support below the object's first layer by creating + // additional support layers with geometry copied from the lowest content + // layer and clipped at the belt surface. These layers bypass the tree + // algorithm entirely — they're pure geometry added after draw_circles(). + { + const auto &sp = m_slicing_params; + const auto &pcfg = *m_print_config; + const double sf = sp.belt_floor_shear_factor; + if (std::abs(sf) > EPSILON + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly + && m_object->support_layer_count() > 0) { + const int from_axis = sp.belt_floor_from_axis; + const double floor_off = pcfg.belt_support_floor_offset.value; + // Support layer print_z values are in GLOBAL Z (non-organic inherits + // from object layers which include global_z_offset). Use the GLOBAL + // belt_floor_z_shift to match. + const double z_shift = sp.belt_floor_z_shift; + // Find the lowest non-empty, non-brim support layer. + ExPolygons source_areas; + double source_z = 0; + int layers_with_content = 0; + for (size_t i = 0; i < m_object->support_layer_count(); ++i) { + SupportLayer *sl = m_object->get_support_layer(i); + if (sl && !sl->base_areas.empty()) { + layers_with_content++; + if (layers_with_content >= 2) { + source_areas = sl->base_areas; + source_z = sl->print_z; + break; + } + } + } + // Fallback to first content layer. + if (source_areas.empty()) { + for (size_t i = 0; i < m_object->support_layer_count(); ++i) { + SupportLayer *sl = m_object->get_support_layer(i); + if (sl && !sl->base_areas.empty()) { + source_areas = sl->base_areas; + source_z = sl->print_z; + break; + } + } + } + if (!source_areas.empty()) { + BoundingBoxf3 bb = belt_remapped_bbox(*m_object->model_object(), m_object->print()->config()); + double from_extent = std::abs(bb.min(from_axis)); + double bb_min_z = std::abs(bb.min.z()); + double first_z = m_object->get_support_layer(0)->print_z; + // Depth = from-axis extent + pre-shear bbox Z offset (ensure_on_bed + // distance) + 10mm safety margin. The 10mm is a bodge to avoid + // small cutoff artifacts — ideally computed exactly from belt geometry. + double extra_depth = std::min(from_extent + bb_min_z + 10., std::max(0., first_z)); + int num_extra = std::max(0, (int)std::ceil(extra_depth / sp.layer_height)); + ExPolygons prev_areas = source_areas; + // Build belt extension layers (lowest Z first). + SupportLayerPtrs belt_ext_layers; + for (int i = num_extra; i >= 1 && !prev_areas.empty(); --i) { + double print_z = first_z - i * sp.layer_height; + if (print_z < -sp.layer_height) continue; + double cutoff = (print_z - z_shift - floor_off) / sf; + coord_t cutoff_sc = scale_(cutoff); + coord_t big = scale_(1e3); + Polygon belt_poly; + if (from_axis == 0) { + if (sf > 0) belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; + else belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; + } else { + if (sf > 0) belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; + else belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; + } + ExPolygons clipped = diff_ex(source_areas, Polygons{belt_poly}); + if (clipped.empty()) continue; + SupportLayer *sl = new SupportLayer(0, 0, m_object, sp.layer_height, print_z, -1); + sl->base_areas = clipped; + // Populate area_groups — generate_toolpaths() iterates these, + // not base_areas directly. + for (auto &expoly : sl->base_areas) + sl->area_groups.emplace_back(&expoly, SupportLayer::BaseType, 0); + sl->lslices = clipped; + sl->lslices_bboxes.reserve(clipped.size()); + for (const ExPolygon &ep : clipped) + sl->lslices_bboxes.emplace_back(get_extents(ep)); + belt_ext_layers.push_back(sl); + } + // Insert at the front of support_layers (they're already in Z order). + if (!belt_ext_layers.empty()) { + auto &sl_vec = m_object->support_layers(); + sl_vec.insert(sl_vec.begin(), belt_ext_layers.begin(), belt_ext_layers.end()); + } + } + } + } + profiler.stage_start(STAGE_GENERATE_TOOLPATHS); m_object->print()->set_status(70, _u8L("Generating support")); generate_toolpaths(); diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index b551a42ece..9d35cb2dd8 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -3381,7 +3381,7 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons // termination happen inside the belt region and get clipped. // Use the distance from the pre-shear bbox min Z to the part's // post-shear min Z, plus 10mm for base expansion headroom. - double bb_min_z = std::abs(po.model_object()->raw_bounding_box().min.z()); + double bb_min_z = std::abs(belt_remapped_bbox(*po.model_object(), pcfg).min.z()); double extra_depth = bb_min_z + 10.; int num_extra = std::max(0, (int)std::ceil(extra_depth / sp.layer_height)); if (num_extra > 0) { diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index e6de38df78..d5a6b38ebc 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4431,12 +4431,41 @@ void TabPrinter::build_fff() optgroup->append_line(line); } { - Line line = { L("G-code axis remap"), L("Remap slicing-frame axes to machine axes in G-code output") }; + Line line = { L("Pre-slice axis remap"), + L("Remap model axes before slicing so the slicer's coordinate system matches " + "the physical bed orientation. For belt printers whose bed is NOT in the XY plane, " + "use this to swap axes so layers are stacked in the correct physical direction.") }; + line.append_option(optgroup->get_option("belt_preslice_remap_x")); + line.append_option(optgroup->get_option("belt_preslice_remap_y")); + line.append_option(optgroup->get_option("belt_preslice_remap_z")); + optgroup->append_line(line); + } + { + Line line = { L("G-code axis remap (post-slice)"), L("Remap slicing-frame axes to machine axes in G-code output. Applied AFTER slicing, during G-code generation.") }; line.append_option(optgroup->get_option("belt_gcode_remap_x")); line.append_option(optgroup->get_option("belt_gcode_remap_y")); line.append_option(optgroup->get_option("belt_gcode_remap_z")); optgroup->append_line(line); } + optgroup->append_single_option_line("belt_gcode_back_transform"); + { + Line line = { L("Origin snap X"), L("Snap object bbox min X to offset in G-code output") }; + line.append_option(optgroup->get_option("belt_origin_snap_x")); + line.append_option(optgroup->get_option("belt_origin_offset_x")); + optgroup->append_line(line); + } + { + Line line = { L("Origin snap Y"), L("Snap object bbox min Y to offset in G-code output") }; + line.append_option(optgroup->get_option("belt_origin_snap_y")); + line.append_option(optgroup->get_option("belt_origin_offset_y")); + optgroup->append_line(line); + } + { + Line line = { L("Origin snap Z"), L("Snap object bbox min Z to offset in G-code output") }; + line.append_option(optgroup->get_option("belt_origin_snap_z")); + line.append_option(optgroup->get_option("belt_origin_offset_z")); + optgroup->append_line(line); + } { Line line = { L("Support floor"), L("Belt floor awareness for support generation and clipping") }; line.append_option(optgroup->get_option("belt_support_floor_mode")); @@ -5291,7 +5320,9 @@ void TabPrinter::toggle_options() toggle_line("belt_printer_infinite_y", is_belt); for (auto el : {"belt_shear_x", "belt_shear_y", "belt_shear_z", "belt_scale_x", "belt_scale_y", "belt_scale_z", - "belt_gcode_remap_x"}) + "belt_preslice_remap_x", + "belt_gcode_remap_x", "belt_gcode_back_transform", + "belt_origin_snap_x", "belt_origin_snap_y", "belt_origin_snap_z"}) toggle_line(el, is_belt); // Gray out angle/from sub-options when their parent shear/scale mode is None. @@ -5319,6 +5350,10 @@ void TabPrinter::toggle_options() auto scz = m_config->option>("belt_scale_z")->value; toggle_option("belt_scale_z_angle", is_belt && scz != BeltScaleMode::None); + toggle_option("belt_origin_offset_x", is_belt && m_config->opt_bool("belt_origin_snap_x")); + toggle_option("belt_origin_offset_y", is_belt && m_config->opt_bool("belt_origin_snap_y")); + toggle_option("belt_origin_offset_z", is_belt && m_config->opt_bool("belt_origin_snap_z")); + toggle_line("belt_support_floor_mode", is_belt); } From c7aa4ca3eff1ae459c7017b3d32a8e03b68d6966 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 27 Mar 2026 17:34:19 -0500 Subject: [PATCH 007/389] Part 3.1: refactor BeltTransform pipeline add BeltGCodeWriter add BeltGCode consolidate changes into shared classes for BeltGcode --- src/libslic3r/BeltGCode.cpp | 119 +++++ src/libslic3r/BeltGCode.hpp | 28 ++ src/libslic3r/BeltGCodeWriter.cpp | 243 +++++++++ src/libslic3r/BeltGCodeWriter.hpp | 50 ++ src/libslic3r/BeltSliceStrategy.cpp | 62 +++ src/libslic3r/BeltSliceStrategy.hpp | 45 ++ src/libslic3r/BeltTransform.cpp | 246 ++++++++++ src/libslic3r/BeltTransform.hpp | 146 ++++++ src/libslic3r/CMakeLists.txt | 10 + src/libslic3r/GCode.cpp | 542 +++++++-------------- src/libslic3r/GCode.hpp | 34 +- src/libslic3r/GCode/BeltBackTransform.cpp | 124 +---- src/libslic3r/GCodeWriter.cpp | 127 +---- src/libslic3r/GCodeWriter.hpp | 74 +-- src/libslic3r/Print.cpp | 14 +- src/libslic3r/Print.hpp | 26 +- src/libslic3r/PrintObject.cpp | 143 +----- src/libslic3r/PrintObjectSlice.cpp | 177 +------ src/libslic3r/Support/BeltFloorContext.cpp | 124 +++++ src/libslic3r/Support/BeltFloorContext.hpp | 74 +++ src/libslic3r/Support/SupportMaterial.cpp | 131 +---- src/libslic3r/Support/TreeModelVolumes.cpp | 74 +-- src/libslic3r/Support/TreeSupport.cpp | 102 ++-- src/libslic3r/Support/TreeSupport3D.cpp | 36 +- 24 files changed, 1522 insertions(+), 1229 deletions(-) create mode 100644 src/libslic3r/BeltGCode.cpp create mode 100644 src/libslic3r/BeltGCode.hpp create mode 100644 src/libslic3r/BeltGCodeWriter.cpp create mode 100644 src/libslic3r/BeltGCodeWriter.hpp create mode 100644 src/libslic3r/BeltSliceStrategy.cpp create mode 100644 src/libslic3r/BeltSliceStrategy.hpp create mode 100644 src/libslic3r/BeltTransform.cpp create mode 100644 src/libslic3r/BeltTransform.hpp create mode 100644 src/libslic3r/Support/BeltFloorContext.cpp create mode 100644 src/libslic3r/Support/BeltFloorContext.hpp diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp new file mode 100644 index 0000000000..dc1b6ca439 --- /dev/null +++ b/src/libslic3r/BeltGCode.cpp @@ -0,0 +1,119 @@ +#include "BeltGCode.hpp" +#include "BeltGCodeWriter.hpp" +#include "BeltTransform.hpp" +#include "Print.hpp" + +#include + +namespace Slic3r { + +void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) +{ + if (!print.config().belt_printer.value) + return; + + auto belt_writer = std::make_unique(); + belt_writer->set_is_bbl_machine(is_bbl_printers); + belt_writer->set_belt_angle(print.config().belt_printer_angle.value); + belt_writer->set_axis_remap( + int(print.config().belt_gcode_remap_x.value), + int(print.config().belt_gcode_remap_y.value), + int(print.config().belt_gcode_remap_z.value)); + BoundingBoxf bbox_bed(print.config().printable_area.values); + belt_writer->set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), + print.config().printable_height.value)); + belt_writer->set_belt_back_transform(print.config()); + m_writer = std::move(belt_writer); + + // Per-axis origin snap config. + m_origin_snap[0] = print.config().belt_origin_snap_x.value; + m_origin_snap[1] = print.config().belt_origin_snap_y.value; + m_origin_snap[2] = print.config().belt_origin_snap_z.value; + m_origin_snap_offset[0] = print.config().belt_origin_offset_x.value; + m_origin_snap_offset[1] = print.config().belt_origin_offset_y.value; + m_origin_snap_offset[2] = print.config().belt_origin_offset_z.value; +} + +void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) +{ + if (!print.config().belt_printer.value) + return; + + file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); + // Shear configs + const auto &full_cfg = print.full_print_config(); + file.write_format("; belt_shear_x = %s\n", full_cfg.opt_serialize("belt_shear_x").c_str()); + file.write_format("; belt_shear_x_angle = %.1f\n", print.config().belt_shear_x_angle.value); + file.write_format("; belt_shear_x_from = %s\n", full_cfg.opt_serialize("belt_shear_x_from").c_str()); + file.write_format("; belt_shear_y = %s\n", full_cfg.opt_serialize("belt_shear_y").c_str()); + file.write_format("; belt_shear_y_angle = %.1f\n", print.config().belt_shear_y_angle.value); + file.write_format("; belt_shear_y_from = %s\n", full_cfg.opt_serialize("belt_shear_y_from").c_str()); + file.write_format("; belt_shear_z = %s\n", full_cfg.opt_serialize("belt_shear_z").c_str()); + file.write_format("; belt_shear_z_angle = %.1f\n", print.config().belt_shear_z_angle.value); + file.write_format("; belt_shear_z_from = %s\n", full_cfg.opt_serialize("belt_shear_z_from").c_str()); + // Scale configs + file.write_format("; belt_scale_x = %s\n", full_cfg.opt_serialize("belt_scale_x").c_str()); + file.write_format("; belt_scale_x_angle = %.1f\n", print.config().belt_scale_x_angle.value); + file.write_format("; belt_scale_y = %s\n", full_cfg.opt_serialize("belt_scale_y").c_str()); + file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); + file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); + file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); + // Pre-slice remap configs + file.write_format("; belt_preslice_remap_x = %s\n", full_cfg.opt_serialize("belt_preslice_remap_x").c_str()); + file.write_format("; belt_preslice_remap_y = %s\n", full_cfg.opt_serialize("belt_preslice_remap_y").c_str()); + file.write_format("; belt_preslice_remap_z = %s\n", full_cfg.opt_serialize("belt_preslice_remap_z").c_str()); +} + +void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) +{ + if (!m_origin_snap[0] && !m_origin_snap[1] && !m_origin_snap[2]) + return; + + auto *belt_writer = dynamic_cast(m_writer.get()); + if (!belt_writer) + return; + + // Clear existing snap so to_machine_coords gives raw machine coords for bbox computation. + for (int a = 0; a < 3; ++a) + belt_writer->set_origin_snap(a, false, 0., 0.); + + // Reconstruct the belt pipeline transform for this object. + Transform3d belt = BeltTransformPipeline::build_forward_transform(m_config); + + // Z-shift + double zs = (obj->belt_min_z() < 0.) ? -obj->belt_min_z() : 0.; + if (zs > 0.) { + Transform3d zsh = Transform3d::Identity(); + zsh.matrix()(2, 3) = zs; + belt = zsh * belt; + } + + // Full transform: belt * trafo_centered + Transform3d full = belt * obj->trafo_centered(); + + // Instance shift in slicer space + global Z offset + Vec3d shift(unscale(inst_shift.x()), + unscale(inst_shift.y()), + obj->belt_global_z_offset()); + + // Compute this instance's machine-space bbox min + BoundingBoxf3 bb = obj->model_object()->raw_bounding_box(); + Vec3d mn = bb.min.cast(), mx = bb.max.cast(); + Vec3d inst_min(std::numeric_limits::max(), + std::numeric_limits::max(), + std::numeric_limits::max()); + for (int i = 0; i < 8; ++i) { + Vec3d c((i & 1) ? mx.x() : mn.x(), + (i & 2) ? mx.y() : mn.y(), + (i & 4) ? mx.z() : mn.z()); + Vec3d mc = belt_writer->to_machine_coords(full * c + shift); + for (int a = 0; a < 3; ++a) + inst_min[a] = std::min(inst_min[a], mc[a]); + } + + // Update writer snap for each enabled axis + for (int a = 0; a < 3; ++a) + belt_writer->set_origin_snap(a, m_origin_snap[a], m_origin_snap_offset[a], inst_min[a]); +} + +} // namespace Slic3r diff --git a/src/libslic3r/BeltGCode.hpp b/src/libslic3r/BeltGCode.hpp new file mode 100644 index 0000000000..682deb7d65 --- /dev/null +++ b/src/libslic3r/BeltGCode.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include "GCode.hpp" + +namespace Slic3r { + +// Belt-printer-specific GCode export. +// +// Inherits from GCode and overrides virtual hooks to: +// - Create a BeltGCodeWriter instead of a plain GCodeWriter +// - Write belt configuration to the G-code header +// - Update per-axis origin snap when switching instances +// - Disable arc fitting (G2/G3 not supported on belt printers) +class BeltGCode : public GCode +{ +protected: + void init_belt_writer(Print &print, bool is_bbl_printers) override; + void write_belt_header(GCodeOutputStream &file, const Print &print) override; + void on_set_origin(const PrintObject *obj, const Point &inst_shift) override; + bool should_disable_arc_fitting() const override { return true; } + +private: + // Per-axis origin snap config (set during init, used in on_set_origin). + bool m_origin_snap[3] = {false, false, false}; + double m_origin_snap_offset[3] = {0., 0., 0.}; +}; + +} // namespace Slic3r diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp new file mode 100644 index 0000000000..645bf85a5b --- /dev/null +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -0,0 +1,243 @@ +#include "BeltGCodeWriter.hpp" +#include "Geometry.hpp" + +namespace Slic3r { + +// ---- Belt configuration --------------------------------------------------- + +void BeltGCodeWriter::set_belt_angle(double angle_deg) +{ + m_belt_angle_rad = Geometry::deg2rad(angle_deg); +} + +void BeltGCodeWriter::set_axis_remap(int rx, int ry, int rz) +{ + m_remap_x = rx; + m_remap_y = ry; + m_remap_z = rz; +} + +void BeltGCodeWriter::set_build_volume_max(const Vec3d &max) +{ + m_build_vol_max = max; +} + +void BeltGCodeWriter::set_belt_back_transform(const PrintConfig &config) +{ + m_belt_back_transform.init_from_config(config); +} + +void BeltGCodeWriter::set_origin_snap(int axis, bool enable, double offset, double bbox_min) +{ + if (axis >= 0 && axis < 3) { + m_origin_snap[axis] = enable; + m_origin_offset[axis] = offset; + m_origin_bbox_min[axis] = bbox_min; + } +} + +Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const +{ + // Step 1: Undo the shear/scale applied during slicing. + Vec3d p = m_belt_back_transform.apply(pos); + // Step 2: Apply axis remapping for the machine's coordinate convention. + // BeltRemapAxis: 0-2 = +X/+Y/+Z, 3-5 = -X/-Y/-Z, 6-8 = Rev X/Y/Z + auto remap = [this, &p](int r) -> double { + int axis = r % 3; + if (r < 3) return p[axis]; + if (r < 6) return -p[axis]; + return m_build_vol_max[axis] - p[axis]; + }; + Vec3d result = { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; + // Per-axis origin snap: shift so bbox min on each enabled axis = offset. + for (int i = 0; i < 3; ++i) + if (m_origin_snap[i]) + result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); + return result; +} + +// ---- Overridden movement methods ------------------------------------------ + +std::string BeltGCodeWriter::travel_to_xy(const Vec2d &point, const std::string &comment) +{ + m_pos(0) = point(0); + m_pos(1) = point(1); + + this->set_current_position_clear(true); + Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; + + // Belt printer: transform to machine coordinates (XY travel also needs Z due to YZ rotation) + Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + + GCodeG1Formatter w; + w.emit_xyz(machine); + auto speed = m_is_first_layer + ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; + w.emit_f(speed * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + return w.string(); +} + +std::string BeltGCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) +{ + // Belt printer: force NormalLift since SpiralLift and SlopeLift compute + // slope angles that don't account for the YZ coordinate rotation. + return GCodeWriter::lazy_lift(LiftType::NormalLift, spiral_vase); +} + +std::string BeltGCodeWriter::eager_lift(const LiftType type) +{ + // Belt printer: force NormalLift (SpiralLift/SlopeLift don't account for YZ rotation). + return GCodeWriter::eager_lift(LiftType::NormalLift); +} + +std::string BeltGCodeWriter::_travel_to_z(double z, const std::string &comment) +{ + m_pos(2) = z; + + double speed = this->config.travel_speed_z.value; + if (speed == 0.) { + speed = m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") + : this->config.travel_speed.value; + } + + // Belt printer: a Z-only move in slicing frame needs to emit both Y and Z in machine coords. + Vec3d machine = to_machine_coords(Vec3d(m_pos.x() - m_x_offset, m_pos.y() - m_y_offset, z)); + + GCodeG1Formatter w; + w.emit_xyz(machine); + w.emit_f(speed * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + return w.string(); +} + +std::string BeltGCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std::string &comment, bool force_no_extrusion) +{ + m_pos(0) = point(0); + m_pos(1) = point(1); + if (std::abs(dE) <= std::numeric_limits::epsilon()) + force_no_extrusion = true; + + if (!force_no_extrusion) + filament()->extrude(dE); + + Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; + + // Belt printer: transform and emit XYZ (Y and Z are coupled) + Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + + GCodeG1Formatter w; + w.emit_xyz(machine); + if (!force_no_extrusion) + w.emit_e(filament()->E()); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + return w.string(); +} + +std::string BeltGCodeWriter::extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment, bool force_no_extrusion) +{ + m_pos = point; + m_lifted = 0; + if (!force_no_extrusion) + filament()->extrude(dE); + + Vec3d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset, point(2) }; + point_on_plate = to_machine_coords(point_on_plate); + + GCodeG1Formatter w; + w.emit_xyz(point_on_plate); + if (!force_no_extrusion) + w.emit_e(filament()->E()); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + return w.string(); +} + +std::string BeltGCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &comment, bool force_z) +{ + // Belt-specific override of travel_to_xyz. + // Key differences from base: + // 1. All coordinates go through to_machine_coords() + // 2. Always emit full XYZ (can't split XY and Z due to coupling) + // 3. Lift type forced to NormalLift (handled by lazy_lift/eager_lift overrides) + + Vec3d dest_point = point; + auto travel_speed = + m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; + + // Handle pending z_hop + if (std::abs(m_to_lift) > EPSILON) { + assert(std::abs(m_lifted) < EPSILON); + if ((!this->is_current_position_clear() || m_pos != dest_point) && + m_to_lift + m_pos(2) > point(2)) { + m_lifted = m_to_lift + m_pos(2) - point(2); + dest_point(2) = m_to_lift + m_pos(2); + } + m_to_lift = 0.; + + std::string slop_move; + Vec3d source = { m_pos(0) - m_x_offset, m_pos(1) - m_y_offset, m_pos(2) }; + Vec3d target = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; + Vec3d delta = target - source; + Vec2d delta_no_z = { delta(0), delta(1) }; + + if (delta(2) > 0 && delta_no_z.norm() != 0.0f) { + // Belt: SpiralLift and SlopeLift are disabled (lazy_lift forces NormalLift), + // but handle NormalLift and fallthrough. + if (m_to_lift_type == LiftType::SlopeLift && + this->is_current_position_clear() && + atan2(delta(2), delta_no_z.norm()) < this->filament()->travel_slope()) { + Vec2d temp = delta_no_z.normalized() * delta(2) / tan(this->filament()->travel_slope()); + Vec3d slope_top_point = Vec3d(temp(0), temp(1), delta(2)) + source; + slope_top_point = to_machine_coords(slope_top_point); + GCodeG1Formatter w0; + w0.emit_xyz(slope_top_point); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + slop_move = w0.string(); + } + else if (m_to_lift_type == LiftType::NormalLift) { + slop_move = _travel_to_z(target.z(), "normal lift Z"); + } + } + + std::string xy_z_move; + { + Vec3d emit_target = to_machine_coords(target); + GCodeG1Formatter w0; + // Belt mode: always emit full XYZ since Y and Z are coupled + w0.emit_xyz(emit_target); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + xy_z_move = w0.string(); + } + m_pos = dest_point; + this->set_current_position_clear(true); + return slop_move + xy_z_move; + } + else if (!force_z && !this->will_move_z(point(2))) { + double nominal_z = m_pos(2) - m_lifted; + m_lifted -= (point(2) - nominal_z); + if (std::abs(m_lifted) < EPSILON) + m_lifted = 0.; + this->set_current_position_clear(true); + return this->travel_to_xy(to_2d(point)); + } + else { + m_lifted = 0; + } + + Vec3d point_on_plate = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; + point_on_plate = to_machine_coords(point_on_plate); + + // Belt mode: always emit full XYZ + GCodeG1Formatter w; + w.emit_xyz(point_on_plate); + w.emit_f(this->config.travel_speed.value * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + + m_pos = dest_point; + this->set_current_position_clear(true); + return w.string(); +} + +} // namespace Slic3r diff --git a/src/libslic3r/BeltGCodeWriter.hpp b/src/libslic3r/BeltGCodeWriter.hpp new file mode 100644 index 0000000000..727135b578 --- /dev/null +++ b/src/libslic3r/BeltGCodeWriter.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include "GCodeWriter.hpp" +#include "GCode/BeltBackTransform.hpp" + +namespace Slic3r { + +// Belt-printer-specific GCode writer. +// +// Inherits from GCodeWriter and overrides movement methods to apply +// coordinate transformation (back-transform, axis remap, origin snap) +// and emit coupled XYZ moves (Y and Z are coupled due to belt tilt). +class BeltGCodeWriter : public GCodeWriter +{ +public: + BeltGCodeWriter() : GCodeWriter() {} + + // Belt configuration + void set_belt_angle(double angle_deg); + bool is_belt_printer() const { return m_belt_angle_rad != 0.; } + void set_axis_remap(int rx, int ry, int rz); + void set_build_volume_max(const Vec3d &max); + void set_belt_back_transform(const PrintConfig &config); + void set_origin_snap(int axis, bool enable, double offset, double bbox_min); + Vec3d to_machine_coords(const Vec3d &pos) const; + + // Overridden movement methods + std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string()) override; + std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false) override; + std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false) override; + std::string extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false) override; + std::string lazy_lift(LiftType lift_type = LiftType::NormalLift, bool spiral_vase = false) override; + std::string eager_lift(const LiftType type) override; + +protected: + std::string _travel_to_z(double z, const std::string &comment) override; + +private: + double m_belt_angle_rad = 0.; + int m_remap_x = 0; + int m_remap_y = 1; + int m_remap_z = 2; + Vec3d m_build_vol_max = Vec3d::Zero(); + BeltBackTransform m_belt_back_transform; + bool m_origin_snap[3] = {false, false, false}; + double m_origin_offset[3] = {0., 0., 0.}; + double m_origin_bbox_min[3] = {0., 0., 0.}; +}; + +} // namespace Slic3r diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp new file mode 100644 index 0000000000..b3adeec64a --- /dev/null +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -0,0 +1,62 @@ +#include "BeltSliceStrategy.hpp" + +#include + +namespace Slic3r { + +std::unique_ptr BeltSliceStrategy::create(const PrintConfig &config) +{ + if (!config.belt_printer.value) + return nullptr; + return std::unique_ptr(new BeltSliceStrategy(config)); +} + +BeltSliceStrategy::BeltSliceStrategy(const PrintConfig &config) +{ + m_has_remap = BeltTransformPipeline::has_preslice_remap(config); + if (m_has_remap) + m_pre_remap = BeltTransformPipeline::build_preslice_remap(config); + + m_shear = BeltTransformPipeline::build_shear_matrix(config, &m_has_shear); + m_scale = BeltTransformPipeline::build_scale_matrix(config, &m_has_scale); +} + +void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, + const ModelVolumePtrs &model_volumes, + double *out_belt_min_z) const +{ + // Step 1: Pre-slice axis remap. + if (m_has_remap) + trafo = m_pre_remap * trafo; + + // Step 2: Shear + scale. + if (m_has_shear || m_has_scale) { + Transform3d belt_xform = Transform3d::Identity(); + belt_xform.linear() = m_scale * m_shear; + trafo = belt_xform * trafo; + } + + // Step 3: Z-shift — detect if mesh clips below build plate after transforms. + if (m_has_remap || m_has_shear || m_has_scale) { + double min_z = std::numeric_limits::max(); + for (const ModelVolume *mv : model_volumes) { + if (!mv->is_model_part()) continue; + for (const stl_vertex &v : mv->mesh().its.vertices) { + Vec3d pt = trafo * v.cast(); + min_z = std::min(min_z, pt.z()); + } + } + double belt_z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; + BOOST_LOG_TRIVIAL(warning) << "Belt Z-shift: min_z=" << min_z + << " z_shift=" << belt_z_shift_val; + if (belt_z_shift_val > 0.) { + Transform3d z_shift = Transform3d::Identity(); + z_shift.matrix()(2, 3) = belt_z_shift_val; + trafo = z_shift * trafo; + } + if (out_belt_min_z) + *out_belt_min_z = (min_z != std::numeric_limits::max()) ? min_z : 0.; + } +} + +} // namespace Slic3r diff --git a/src/libslic3r/BeltSliceStrategy.hpp b/src/libslic3r/BeltSliceStrategy.hpp new file mode 100644 index 0000000000..bf19243fd2 --- /dev/null +++ b/src/libslic3r/BeltSliceStrategy.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include "libslic3r.h" +#include "Point.hpp" +#include "BeltTransform.hpp" +#include "PrintConfig.hpp" +#include "Model.hpp" + +#include +#include + +namespace Slic3r { + +// Belt printer pre-slice transform strategy. +// +// Encapsulates the pre-remap, shear, scale, and Z-shift transforms +// that are applied to model geometry before slicing on belt printers. +// Used by PrintObjectSlice.cpp to isolate belt-specific logic from +// the slicing pipeline. +class BeltSliceStrategy +{ +public: + // Create a strategy if belt_printer is enabled; returns nullptr otherwise. + static std::unique_ptr create(const PrintConfig &config); + + // Apply belt transforms to the slicing trafo. + // Modifies trafo in-place: trafo = z_shift * scale * shear * pre_remap * trafo + // Scans all model_part volumes to detect minimum Z and add z-shift if needed. + // Sets *out_belt_min_z to the minimum Z of the mesh after transforms. + void apply_to_trafo(Transform3d &trafo, + const ModelVolumePtrs &model_volumes, + double *out_belt_min_z) const; + +private: + explicit BeltSliceStrategy(const PrintConfig &config); + + bool m_has_remap = false; + bool m_has_shear = false; + bool m_has_scale = false; + Transform3d m_pre_remap = Transform3d::Identity(); + Matrix3d m_shear = Matrix3d::Identity(); + Matrix3d m_scale = Matrix3d::Identity(); +}; + +} // namespace Slic3r diff --git a/src/libslic3r/BeltTransform.cpp b/src/libslic3r/BeltTransform.cpp new file mode 100644 index 0000000000..db7eea7d80 --- /dev/null +++ b/src/libslic3r/BeltTransform.cpp @@ -0,0 +1,246 @@ +#include "BeltTransform.hpp" +#include "Model.hpp" + +#include + +namespace Slic3r { + +// ---- Matrix builders ------------------------------------------------------ + +Transform3d BeltTransformPipeline::build_preslice_remap(const PrintConfig &config) +{ + Transform3d pre_remap = Transform3d::Identity(); + if (!has_preslice_remap(config)) + return pre_remap; + + int pre_rx = int(config.belt_preslice_remap_x.value); + int pre_ry = int(config.belt_preslice_remap_y.value); + int pre_rz = int(config.belt_preslice_remap_z.value); + + // Each remap value selects a source axis and sign. + auto remap_column = [](int r) -> Vec3d { + int axis = r % 3; + Vec3d col = Vec3d::Zero(); + if (r < 3) col[axis] = 1.0; // +axis + else if (r < 6) col[axis] = -1.0; // -axis + else col[axis] = -1.0; // Rev: max - pos = -(pos - max) + return col; + }; + + Matrix3d remap_lin; + remap_lin.col(0) = remap_column(pre_rx); + remap_lin.col(1) = remap_column(pre_ry); + remap_lin.col(2) = remap_column(pre_rz); + pre_remap.linear() = remap_lin; + + // Translation for Rev modes (needs build volume extents). + if (pre_rx >= 6 || pre_ry >= 6 || pre_rz >= 6) { + BoundingBoxf bbox_bed(config.printable_area.values); + Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), + config.printable_height.value); + Vec3d remap_trans = Vec3d::Zero(); + auto add_rev = [&](int r, int out) { + if (r >= 6) remap_trans[out] = vol_max[r % 3]; + }; + add_rev(pre_rx, 0); + add_rev(pre_ry, 1); + add_rev(pre_rz, 2); + pre_remap.translation() = remap_trans; + } + + return pre_remap; +} + +Matrix3d BeltTransformPipeline::build_shear_matrix(const PrintConfig &config, bool *has_shear_out) +{ + struct AxisShear { BeltShearMode mode; double angle; int from; }; + AxisShear axes[3] = { + { config.belt_shear_x.value, config.belt_shear_x_angle.value, int(config.belt_shear_x_from.value) }, + { config.belt_shear_y.value, config.belt_shear_y_angle.value, int(config.belt_shear_y_from.value) }, + { config.belt_shear_z.value, config.belt_shear_z_angle.value, int(config.belt_shear_z_from.value) }, + }; + + Matrix3d shear = Matrix3d::Identity(); + bool active = false; + for (int row = 0; row < 3; ++row) { + if (axes[row].mode != BeltShearMode::None) { + double factor = compute_shear_factor(axes[row].mode, axes[row].angle); + if (std::abs(factor) > EPSILON) { + shear(row, axes[row].from) += factor; + active = true; + } + } + } + if (has_shear_out) *has_shear_out = active; + return shear; +} + +Matrix3d BeltTransformPipeline::build_scale_matrix(const PrintConfig &config, bool *has_scale_out) +{ + double sx = compute_scale_factor(config.belt_scale_x.value, config.belt_scale_x_angle.value); + double sy = compute_scale_factor(config.belt_scale_y.value, config.belt_scale_y_angle.value); + double sz = compute_scale_factor(config.belt_scale_z.value, config.belt_scale_z_angle.value); + + bool active = (std::abs(sx - 1.) > EPSILON || + std::abs(sy - 1.) > EPSILON || + std::abs(sz - 1.) > EPSILON); + + Matrix3d scale = Matrix3d::Identity(); + if (active) { + scale(0, 0) = sx; + scale(1, 1) = sy; + scale(2, 2) = sz; + } + if (has_scale_out) *has_scale_out = active; + return scale; +} + +Transform3d BeltTransformPipeline::build_forward_transform(const PrintConfig &config) +{ + Transform3d pre_remap = build_preslice_remap(config); + bool shear_active = false; + Matrix3d shear = build_shear_matrix(config, &shear_active); + bool scale_active = false; + Matrix3d scale = build_scale_matrix(config, &scale_active); + + // Pipeline: scale * shear * pre_remap + Transform3d combined = Transform3d::Identity(); + combined.linear() = scale * shear; + combined = combined * pre_remap; + return combined; +} + +// ---- Bounding box remap --------------------------------------------------- + +BoundingBoxf3 BeltTransformPipeline::remap_bbox(const BoundingBoxf3 &bb, const PrintConfig &config) +{ + int pre_rx = int(config.belt_preslice_remap_x.value); + int pre_ry = int(config.belt_preslice_remap_y.value); + int pre_rz = int(config.belt_preslice_remap_z.value); + + if (pre_rx == int(BeltRemapAxis::PosX) && + pre_ry == int(BeltRemapAxis::PosY) && + pre_rz == int(BeltRemapAxis::PosZ)) + return bb; // Identity remap. + + auto remap_coord = [](int r, const Vec3d &v) -> double { + int axis = r % 3; + if (r < 3) return v[axis]; + return -v[axis]; + }; + + Vec3d mn = bb.min.cast(), mx = bb.max.cast(); + BoundingBoxf3 rbb; + for (int i = 0; i < 8; ++i) { + Vec3d c((i & 1) ? mx.x() : mn.x(), + (i & 2) ? mx.y() : mn.y(), + (i & 4) ? mx.z() : mn.z()); + Vec3d rc(remap_coord(pre_rx, c), remap_coord(pre_ry, c), remap_coord(pre_rz, c)); + if (i == 0) rbb = BoundingBoxf3(rc, rc); + else rbb.merge(rc); + } + return rbb; +} + +BoundingBoxf3 BeltTransformPipeline::remap_bbox(const ModelObject &model_object, const PrintConfig &config) +{ + return remap_bbox(model_object.raw_bounding_box(), config); +} + +// ---- Belt floor parameters ------------------------------------------------ + +// Shared implementation for both PrintConfig and DynamicPrintConfig. +// Template avoids duplicating the math for the two config types. +namespace { + +template +BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( + const Config &config, const BoundingBoxf3 &bb, double original_height) +{ + BeltTransformPipeline::BeltHeightResult result; + result.object_height = original_height; + + // Extract Z-axis shear/scale config. + BeltShearMode z_shear_mode; + double z_shear_angle; + BeltScaleMode z_scale_mode; + double z_scale_angle; + int z_shear_from; + + if constexpr (std::is_same_v) { + z_shear_mode = config.belt_shear_z.value; + z_shear_angle = config.belt_shear_z_angle.value; + z_scale_mode = config.belt_scale_z.value; + z_scale_angle = config.belt_scale_z_angle.value; + z_shear_from = int(config.belt_shear_z_from.value); + } else { + // DynamicPrintConfig path + auto get_shear = [&](const char *key) { + auto *opt = config.template option>(key); + return opt ? opt->value : BeltShearMode::None; + }; + auto get_scale = [&](const char *key) { + auto *opt = config.template option>(key); + return opt ? opt->value : BeltScaleMode::None; + }; + auto get_float = [&](const char *key) { + auto *opt = config.template option(key); + return opt ? opt->value : 45.0; + }; + auto get_axis = [&](const char *key) { + auto *opt = config.template option>(key); + return opt ? int(opt->value) : 1; + }; + z_shear_mode = get_shear("belt_shear_z"); + z_shear_angle = get_float("belt_shear_z_angle"); + z_scale_mode = get_scale("belt_scale_z"); + z_scale_angle = get_float("belt_scale_z_angle"); + z_shear_from = get_axis("belt_shear_z_from"); + } + + bool has_z_shear = z_shear_mode != BeltShearMode::None; + bool has_z_scale = z_scale_mode != BeltScaleMode::None; + + if (!has_z_shear && !has_z_scale) + return result; + + double shear_factor = has_z_shear + ? BeltTransformPipeline::compute_shear_factor(z_shear_mode, z_shear_angle) : 0.; + double scale_z = BeltTransformPipeline::compute_scale_factor(z_scale_mode, z_scale_angle); + + if (has_z_shear && std::abs(shear_factor) > EPSILON) { + int from = z_shear_from; + double min_rz = std::numeric_limits::max(); + double max_rz = std::numeric_limits::lowest(); + for (double vz : {bb.min.z(), bb.max.z()}) + for (double vs : {bb.min(from), bb.max(from)}) { + double new_z = scale_z * (vz + shear_factor * vs); + min_rz = std::min(min_rz, new_z); + max_rz = std::max(max_rz, new_z); + } + result.object_height = max_rz - min_rz; + result.floor_params.shear_factor = shear_factor; + result.floor_params.from_axis = from; + result.floor_params.z_shift = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); + } else { + result.object_height = original_height * scale_z; + } + + return result; +} + +} // anonymous namespace + +BeltTransformPipeline::BeltHeightResult BeltTransformPipeline::compute_belt_height_and_floor( + const PrintConfig &config, const BoundingBoxf3 &remapped_bbox, double original_height) +{ + return compute_belt_height_and_floor_impl(config, remapped_bbox, original_height); +} + +BeltTransformPipeline::BeltHeightResult BeltTransformPipeline::compute_belt_height_and_floor( + const DynamicPrintConfig &config, const BoundingBoxf3 &remapped_bbox, double original_height) +{ + return compute_belt_height_and_floor_impl(config, remapped_bbox, original_height); +} + +} // namespace Slic3r diff --git a/src/libslic3r/BeltTransform.hpp b/src/libslic3r/BeltTransform.hpp new file mode 100644 index 0000000000..b9a60473e5 --- /dev/null +++ b/src/libslic3r/BeltTransform.hpp @@ -0,0 +1,146 @@ +#pragma once + +#include "libslic3r.h" +#include "Point.hpp" +#include "BoundingBox.hpp" +#include "PrintConfig.hpp" +#include "Geometry.hpp" + +#include + +namespace Slic3r { + +class ModelObject; + +// Shared belt-printer transform math. +// +// The pre-slice pipeline applied in PrintObjectSlice.cpp is: +// trafo_out = z_shift * scale * shear * pre_remap * trafo_in +// +// This class provides the building blocks so every call site uses the +// same implementation. z_shift is object-dependent (computed from mesh +// vertex bounds) and is NOT included in build_forward_transform(). +class BeltTransformPipeline +{ +public: + // ---- Pure math helpers ------------------------------------------------ + + static double compute_shear_factor(BeltShearMode mode, double angle_deg) + { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + } + + static double compute_scale_factor(BeltScaleMode mode, double angle_deg) + { + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } + } + + // ---- Identity checks -------------------------------------------------- + + static bool has_preslice_remap(const PrintConfig &config) + { + return int(config.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || + int(config.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || + int(config.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ); + } + + // Overload accepting DynamicPrintConfig (used in static slicing_parameters). + static bool has_preslice_remap(const DynamicPrintConfig &config) + { + auto get_int = [&](const char *key) -> int { + auto *opt = config.option>(key); + return opt ? int(opt->value) : 0; + }; + return get_int("belt_preslice_remap_x") != int(BeltRemapAxis::PosX) || + get_int("belt_preslice_remap_y") != int(BeltRemapAxis::PosY) || + get_int("belt_preslice_remap_z") != int(BeltRemapAxis::PosZ); + } + + static bool has_shear(const PrintConfig &config) + { + return config.belt_shear_x.value != BeltShearMode::None || + config.belt_shear_y.value != BeltShearMode::None || + config.belt_shear_z.value != BeltShearMode::None; + } + + static bool has_scale(const PrintConfig &config) + { + double sx = compute_scale_factor(config.belt_scale_x.value, config.belt_scale_x_angle.value); + double sy = compute_scale_factor(config.belt_scale_y.value, config.belt_scale_y_angle.value); + double sz = compute_scale_factor(config.belt_scale_z.value, config.belt_scale_z_angle.value); + return std::abs(sx - 1.) > EPSILON || + std::abs(sy - 1.) > EPSILON || + std::abs(sz - 1.) > EPSILON; + } + + // ---- Matrix builders -------------------------------------------------- + + // Build the pre-slice axis remap transform (includes Rev-mode translation). + static Transform3d build_preslice_remap(const PrintConfig &config); + + // Build the 3x3 shear matrix. Returns Identity if no shear is active. + // Also sets has_shear_out if non-null. + static Matrix3d build_shear_matrix(const PrintConfig &config, bool *has_shear_out = nullptr); + + // Build the 3x3 diagonal scale matrix. Returns Identity if no scale. + // Also sets has_scale_out if non-null. + static Matrix3d build_scale_matrix(const PrintConfig &config, bool *has_scale_out = nullptr); + + // Combined forward transform: scale * shear * pre_remap. + // Does NOT include the per-object Z-shift. + static Transform3d build_forward_transform(const PrintConfig &config); + + // ---- Bounding box remap ----------------------------------------------- + + // Remap a bounding box through the pre-slice axis remap. + // Returns the original bbox if remap is identity. + static BoundingBoxf3 remap_bbox(const BoundingBoxf3 &bb, const PrintConfig &config); + static BoundingBoxf3 remap_bbox(const ModelObject &model_object, const PrintConfig &config); + + // ---- Belt floor parameters -------------------------------------------- + + struct BeltFloorParams { + double shear_factor = 0.0; + int from_axis = 1; + double z_shift = 0.0; + }; + + // Result of computing belt height + floor params. + struct BeltHeightResult { + double object_height; // Effective object height after shear/scale + BeltFloorParams floor_params; + }; + + // Compute effective object height and belt floor parameters from config + // and pre-remapped bounding box. original_height is the input height + // (bb.size().z() or model_object.max_z()). + static BeltHeightResult compute_belt_height_and_floor( + const PrintConfig &config, const BoundingBoxf3 &remapped_bbox, + double original_height); + + // Overload for DynamicPrintConfig (used by static slicing_parameters). + static BeltHeightResult compute_belt_height_and_floor( + const DynamicPrintConfig &config, const BoundingBoxf3 &remapped_bbox, + double original_height); +}; + +} // namespace Slic3r diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index c2d92ee800..a3e813b1da 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -79,6 +79,14 @@ set(lisbslic3r_sources BoundingBox.hpp BridgeDetector.cpp BridgeDetector.hpp + BeltGCode.cpp + BeltGCode.hpp + BeltGCodeWriter.cpp + BeltGCodeWriter.hpp + BeltSliceStrategy.cpp + BeltSliceStrategy.hpp + BeltTransform.cpp + BeltTransform.hpp Brim.cpp BrimEarsPoint.hpp Brim.hpp @@ -417,6 +425,8 @@ set(lisbslic3r_sources SlicingAdaptive.hpp Slicing.cpp Slicing.hpp + Support/BeltFloorContext.cpp + Support/BeltFloorContext.hpp Support/SupportCommon.cpp Support/SupportCommon.hpp Support/SupportLayer.hpp diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 8391f9b820..c8b6e540cf 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -8,6 +8,7 @@ #include "Exception.hpp" #include "ExtrusionEntity.hpp" #include "EdgeGrid.hpp" +#include "BeltTransform.hpp" #include "Geometry.hpp" #include "Geometry/ConvexHull.hpp" #include "GCode/PrintExtents.hpp" @@ -795,7 +796,7 @@ static std::vector get_path_of_change_filament(const Print& print) //BBS: if needed, write the gcode_label_objects_end then priming tower, if the retract, didn't did it. std::string object_end_label_temp; - gcodegen.m_writer.add_object_end_labels(object_end_label_temp); + gcodegen.m_writer->add_object_end_labels(object_end_label_temp); // Process the custom change_filament_gcode. If it is empty, provide a simple Tn command to change the filament. // Otherwise, leave control to the user completely. @@ -839,7 +840,7 @@ static std::vector get_path_of_change_filament(const Print& print) // config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); // BBS { - GCodeWriter& gcode_writer = gcodegen.m_writer; + GCodeWriter& gcode_writer = *gcodegen.m_writer; FullPrintConfig& full_config = gcodegen.m_config; // set volumetric speed of outer wall ,ignore per obejct,just use default setting @@ -1573,8 +1574,8 @@ static std::vector get_path_of_change_filament(const Print& print) const std::vector ColorPrintColors::Colors = { "#C0392B", "#E67E22", "#F1C40F", "#27AE60", "#1ABC9C", "#2980B9", "#9B59B6" }; -#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_writer.filament()->extruder_id()) -#define FILAMENT_CONFIG(OPT) m_config.OPT.get_at(m_writer.filament()->id()) +#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_writer->filament()->extruder_id()) +#define FILAMENT_CONFIG(OPT) m_config.OPT.get_at(m_writer->filament()->id()) void GCode::PlaceholderParserIntegration::reset() { @@ -1687,7 +1688,7 @@ void GCode::PlaceholderParserIntegration::validate_output_vector_variables() // Collect pairs of object_layer + support_layer sorted by print_z. // object_layer & support_layer are considered to be on the same print_z, if they are not further than EPSILON. -std::vector GCode::collect_layers_to_print(const PrintObject& object) +std::vector GCode::collect_layers_to_print(const PrintObject& object, bool skip_empty_first_layer) { std::vector layers_to_print; layers_to_print.reserve(object.layers().size() + object.support_layers().size()); @@ -1753,8 +1754,7 @@ std::vector GCode::collect_layers_to_print(const PrintObjec // an error. In global shear mode the object may also start above // Z=0 on the tilted belt surface. if (layers_to_print.size() == 1u) { - bool skip_empty_check = object.print()->config().belt_printer.value; - if (!has_extrusions && !skip_empty_check) + if (!has_extrusions && !skip_empty_first_layer) throw Slic3r::SlicingError(_(L("One object has an empty first layer and can't be printed. Please Cut the bottom or enable supports.")), object.id().id); } @@ -1827,7 +1827,7 @@ std::vector>> GCode::collec for (size_t i = 0; i < print.objects().size(); ++i) { try { - per_object[i] = collect_layers_to_print(*print.objects()[i]); + per_object[i] = collect_layers_to_print(*print.objects()[i], print.config().belt_printer.value); } catch (const Slic3r::SlicingError &e) { errors.push_back(e); continue; @@ -2016,7 +2016,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu BOOST_LOG_TRIVIAL(info) << boost::format("Will export G-code to %1% soon")%path; GCodeProcessor::s_IsBBLPrinter = print->is_BBL_printer(); - m_writer.set_is_bbl_machine(print->is_BBL_printer()); + m_writer->set_is_bbl_machine(print->is_BBL_printer()); print->set_started(psGCodeExport); // check if any custom gcode contains keywords used by the gcode processor to @@ -2113,7 +2113,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu m_processor.result().support_traditional_timelapse = m_support_traditional_timelapse; bool activate_long_retraction_when_cut = false; - for (const auto& filament : m_writer.extruders()) + for (const auto& filament : m_writer->extruders()) activate_long_retraction_when_cut |= ( m_config.long_retractions_when_cut.get_at(filament.id()) && m_config.retraction_distances_when_cut.get_at(filament.id()) > 0 @@ -2144,7 +2144,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu m_processor.finalize(true); // DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics); - DoExport::update_print_estimated_stats(m_processor, m_writer.extruders(), print->m_print_statistics, print->config()); + DoExport::update_print_estimated_stats(m_processor, m_writer->extruders(), print->m_print_statistics, print->config()); if (result != nullptr) { *result = std::move(m_processor.extract_result()); // set the filename to the correct value @@ -2404,7 +2404,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato PROFILE_FUNC(); m_print = &print; - m_timelapse_pos_picker.init(&print,m_writer.get_xy_offset().cast()); + m_timelapse_pos_picker.init(&print,m_writer->get_xy_offset().cast()); // modifies m_silent_time_estimator_enabled DoExport::init_gcode_processor(print.config(), m_processor, m_silent_time_estimator_enabled); @@ -2420,29 +2420,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_fan_mover.release(); - m_writer.set_is_bbl_machine(is_bbl_printers); + m_writer->set_is_bbl_machine(is_bbl_printers); - // Belt printer: initialize coordinate transformation and axis remap on the writer. - if (print.config().belt_printer.value) { - m_writer.set_belt_angle(print.config().belt_printer_angle.value); - m_writer.set_axis_remap( - int(print.config().belt_gcode_remap_x.value), - int(print.config().belt_gcode_remap_y.value), - int(print.config().belt_gcode_remap_z.value)); - // Build volume extents for Rev remap mode. - BoundingBoxf bbox_bed(print.config().printable_area.values); - m_writer.set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), print.config().printable_height.value)); - // Initialize the back-transform that undoes slicing shear/scale. - m_writer.set_belt_back_transform(print.config()); - // Per-axis origin snap: store config; actual snap is computed - // per-instance in update_origin_snap() called from set_origin(). - m_origin_snap[0] = print.config().belt_origin_snap_x.value; - m_origin_snap[1] = print.config().belt_origin_snap_y.value; - m_origin_snap[2] = print.config().belt_origin_snap_z.value; - m_origin_snap_offset[0] = print.config().belt_origin_offset_x.value; - m_origin_snap_offset[1] = print.config().belt_origin_offset_y.value; - m_origin_snap_offset[2] = print.config().belt_origin_offset_z.value; - } + // Belt printer: initialize belt-specific writer via virtual hook. + this->init_belt_writer(print, is_bbl_printers); // How many times will be change_layer() called? // change_layer() in turn increments the progress bar status. @@ -2533,31 +2514,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format("; HEADER_BLOCK_START\n"); // Write information on the generator. file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str()); - // Belt printer: embed angle and transform configs in header for G-code processor detection. - if (print.config().belt_printer.value) { - file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); - // Shear configs - const auto &full_cfg = print.full_print_config(); - file.write_format("; belt_shear_x = %s\n", full_cfg.opt_serialize("belt_shear_x").c_str()); - file.write_format("; belt_shear_x_angle = %.1f\n", print.config().belt_shear_x_angle.value); - file.write_format("; belt_shear_x_from = %s\n", full_cfg.opt_serialize("belt_shear_x_from").c_str()); - file.write_format("; belt_shear_y = %s\n", full_cfg.opt_serialize("belt_shear_y").c_str()); - file.write_format("; belt_shear_y_angle = %.1f\n", print.config().belt_shear_y_angle.value); - file.write_format("; belt_shear_y_from = %s\n", full_cfg.opt_serialize("belt_shear_y_from").c_str()); - file.write_format("; belt_shear_z = %s\n", full_cfg.opt_serialize("belt_shear_z").c_str()); - file.write_format("; belt_shear_z_angle = %.1f\n", print.config().belt_shear_z_angle.value); - file.write_format("; belt_shear_z_from = %s\n", full_cfg.opt_serialize("belt_shear_z_from").c_str()); - // Scale configs - file.write_format("; belt_scale_x = %s\n", full_cfg.opt_serialize("belt_scale_x").c_str()); - file.write_format("; belt_scale_x_angle = %.1f\n", print.config().belt_scale_x_angle.value); - file.write_format("; belt_scale_y = %s\n", full_cfg.opt_serialize("belt_scale_y").c_str()); - file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); - file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); - file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); - file.write_format("; belt_preslice_remap_x = %s\n", full_cfg.opt_serialize("belt_preslice_remap_x").c_str()); - file.write_format("; belt_preslice_remap_y = %s\n", full_cfg.opt_serialize("belt_preslice_remap_y").c_str()); - file.write_format("; belt_preslice_remap_z = %s\n", full_cfg.opt_serialize("belt_preslice_remap_z").c_str()); - } + // Belt printer: embed angle and transform configs in header via virtual hook. + this->write_belt_header(file, print); if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); //BBS: total layer number @@ -2804,13 +2762,13 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Disable fan. if (m_config.auxiliary_fan.value && print.config().close_fan_the_first_x_layers.get_at(initial_extruder_id)) { - file.write(m_writer.set_fan(0)); + file.write(m_writer->set_fan(0)); //BBS: disable additional fan - file.write(m_writer.set_additional_fan(0)); + file.write(m_writer->set_additional_fan(0)); } // Update output variables after the extruders were initialized. - m_placeholder_parser_integration.init(m_writer); + m_placeholder_parser_integration.init(*m_writer); // Let the start-up script prime the 1st printing tool. @@ -2883,7 +2841,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato { BoundingBoxf bbox_bed(print.config().printable_area.values); - Vec2f plate_offset = m_writer.get_xy_offset(); + Vec2f plate_offset = m_writer->get_xy_offset(); this->placeholder_parser().set("print_bed_min", new ConfigOptionFloats({ bbox_bed.min.x(), bbox_bed.min.y()})); this->placeholder_parser().set("print_bed_max", new ConfigOptionFloats({ bbox_bed.max.x(), bbox_bed.max.y()})); this->placeholder_parser().set("print_bed_size", new ConfigOptionFloats({ bbox_bed.size().x(), bbox_bed.size().y() })); @@ -2985,7 +2943,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } bool activate_chamber_temp_control = false; auto max_chamber_temp = 0; - for (const auto &extruder : m_writer.extruders()) { + for (const auto &extruder : m_writer->extruders()) { activate_chamber_temp_control |= m_config.activate_chamber_temp_control.get_at(extruder.id()); max_chamber_temp = std::max(max_chamber_temp, m_config.chamber_temperature.get_at(extruder.id())); } @@ -2993,7 +2951,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato BedType curr_bed_type = m_config.curr_bed_type; int min_temperature_vitrification = std::numeric_limits::max(); - for (const auto& extruder : m_writer.extruders()) + for (const auto& extruder : m_writer->extruders()) min_temperature_vitrification = std::min(min_temperature_vitrification, m_config.temperature_vitrification.get_at(extruder.id())); @@ -3107,18 +3065,18 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato if (activate_chamber_temp_control && max_chamber_temp > 0){ int temp_out =0; if(!custom_gcode_sets_temperature(machine_start_gcode,141,191,false,temp_out)) - file.write(m_writer.set_chamber_temperature(max_chamber_temp, true)); // set chamber_temperature + file.write(m_writer->set_chamber_temperature(max_chamber_temp, true)); // set chamber_temperature } // Write the custom start G-code file.writeln(machine_start_gcode); //BBS: gcode writer doesn't know where the real position of extruder is after inserting custom gcode - m_writer.set_current_position_clear(false); + m_writer->set_current_position_clear(false); m_start_gcode_filament = GCodeProcessor::get_gcode_last_filament(machine_start_gcode); if (is_bbl_printers) { - m_writer.init_extruder(initial_non_support_extruder_id); + m_writer->init_extruder(initial_non_support_extruder_id); // add the missing filament start gcode in machine start gcode { DynamicConfig config; @@ -3131,7 +3089,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } // Orca: add missing PA settings for initial filament if (m_config.enable_pressure_advance.get_at(initial_non_support_extruder_id)) { - file.write(m_writer.set_pressure_advance(m_config.pressure_advance.get_at(initial_non_support_extruder_id))); + file.write(m_writer->set_pressure_advance(m_config.pressure_advance.get_at(initial_non_support_extruder_id))); // Orca: Adaptive PA // Reset Adaptive PA processor last PA value m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(initial_non_support_extruder_id)); @@ -3157,14 +3115,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Orca: when activate_air_filtration is set on any extruder, find and set the highest during_print_exhaust_fan_speed bool activate_air_filtration = false; int during_print_exhaust_fan_speed = 0; - for (const auto &extruder : m_writer.extruders()) { + for (const auto &extruder : m_writer->extruders()) { activate_air_filtration |= m_config.activate_air_filtration.get_at(extruder.id()); if (m_config.activate_air_filtration.get_at(extruder.id())) during_print_exhaust_fan_speed = std::max(during_print_exhaust_fan_speed, m_config.during_print_exhaust_fan_speed.get_at(extruder.id())); } if (activate_air_filtration) - file.write(m_writer.set_exhaust_fan(during_print_exhaust_fan_speed, true)); + file.write(m_writer->set_exhaust_fan(during_print_exhaust_fan_speed, true)); print.throw_if_canceled(); @@ -3180,7 +3138,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_seam_placer.init(print, throw_if_canceled_func); // BBS: get path for change filament - if (m_writer.multiple_extruders) { + if (m_writer->multiple_extruders) { std::vector points = get_path_of_change_filament(print); if (points.size() == 3) { travel_point_1 = points[0]; @@ -3212,12 +3170,12 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato std::string gcode; gcode += ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change) + "\n"; if ((print.default_object_config().outer_wall_acceleration.value > 0 && print.default_object_config().outer_wall_acceleration.value > 0)) { - gcode += m_writer.set_print_acceleration((unsigned int)floor(print.default_object_config().outer_wall_acceleration.value + 0.5)); + gcode += m_writer->set_print_acceleration((unsigned int)floor(print.default_object_config().outer_wall_acceleration.value + 0.5)); } if (print.default_object_config().outer_wall_jerk.value > 0) { double jerk = print.default_object_config().outer_wall_jerk.value; - gcode += m_writer.set_jerk_xy(jerk); + gcode += m_writer->set_jerk_xy(jerk); } auto params = print.calib_params(); @@ -3261,8 +3219,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } print.throw_if_canceled(); this->set_origin(unscale((*print_object_instance_sequential_active)->shift)); - this->update_origin_snap((*print_object_instance_sequential_active)->print_object, - (*print_object_instance_sequential_active)->shift); + this->on_set_origin((*print_object_instance_sequential_active)->print_object, + (*print_object_instance_sequential_active)->shift); // BBS: prime extruder if extruder change happens before this object instance bool prime_extruder = false; @@ -3272,7 +3230,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_enable_cooling_markers = false; // we're not filtering these moves through CoolingBuffer m_avoid_crossing_perimeters.use_external_mp_once(); // BBS. change tool before moving to origin point. - if (m_writer.need_toolchange(initial_extruder_id)) { + if (m_writer->need_toolchange(initial_extruder_id)) { const PrintObjectConfig& object_config = object.config(); coordf_t initial_layer_print_height = print.config().initial_layer_print_height.value; @@ -3285,7 +3243,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } else { file.write(this->retract()); } - file.write(m_writer.travel_to_z(m_max_layer_z + m_writer.config.z_hop.get_at(initial_extruder_id))); + file.write(m_writer->travel_to_z(m_max_layer_z + m_writer->config.z_hop.get_at(initial_extruder_id))); file.write(this->travel_to(Point(0, 0), erNone, "move to origin position for next object")); m_enable_cooling_markers = true; // Disable motion planner when traveling to first object point. @@ -3308,7 +3266,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // and export G-code into file. tool_ordering.cal_most_used_extruder(print.config()); m_printed_objects.emplace_back(&object); - this->process_layers(print, tool_ordering, collect_layers_to_print(object), *print_object_instance_sequential_active - object.instances().data(), file, + this->process_layers(print, tool_ordering, collect_layers_to_print(object, print.config().belt_printer.value), *print_object_instance_sequential_active - object.instances().data(), file, prime_extruder); { // save the flush statitics stored in tool ordering by object @@ -3325,7 +3283,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato { const auto plr_mode = print.config().enable_power_loss_recovery.value; if (m_second_layer_things_done && plr_mode == PowerLossRecoveryMode::Enable) { - file.write(m_writer.enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); + file.write(m_writer->enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); } } ++ finished_objects; @@ -3346,7 +3304,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_wipe_tower->set_wipe_tower_bbx(print.get_wipe_tower_bbx()); m_wipe_tower->set_rib_offset(print.get_rib_offset()); //BBS - file.write(m_writer.travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height")); + file.write(m_writer->travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height")); if (wipe_tower_type == WipeTowerType::Type2 && print.config().single_extruder_multi_material_priming) { file.write(m_wipe_tower->prime(*this)); @@ -3405,7 +3363,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Orca: disable power loss recovery if (m_second_layer_things_done && print.config().enable_power_loss_recovery.value == PowerLossRecoveryMode::Enable) { - file.write(m_writer.enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); + file.write(m_writer->enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); } if (m_wipe_tower) // Purge the extruder, pull out the active filament. @@ -3419,14 +3377,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // if needed, write the gcode_label_objects_end { std::string gcode; - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); file.write(gcode); } - file.write(m_writer.set_fan(0)); + file.write(m_writer->set_fan(0)); //BBS: make sure the additional fan is closed when end if(m_config.auxiliary_fan.value) - file.write(m_writer.set_additional_fan(0)); + file.write(m_writer->set_additional_fan(0)); if (is_bbl_printers) { //BBS: close spaghetti detector //Note: M981 is also used to tell xcam the last layer is finished, so we need always send it even if spaghetti option is disabled. @@ -3442,12 +3400,12 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato DynamicConfig config; config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); //BBS - config.set_key_value("layer_z", new ConfigOptionFloat(m_writer.get_position()(2) - m_config.z_offset.value)); + config.set_key_value("layer_z", new ConfigOptionFloat(m_writer->get_position()(2) - m_config.z_offset.value)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); if (print.config().single_extruder_multi_material) { // Process the filament_end_gcode for the active filament only. - int extruder_id = m_writer.filament()->id(); + int extruder_id = m_writer->filament()->id(); config.set_key_value("filament_extruder_id", new ConfigOptionInt(extruder_id)); file.writeln(this->placeholder_parser_process("filament_end_gcode", print.config().filament_end_gcode.get_at(extruder_id), extruder_id, &config)); } else { @@ -3457,20 +3415,20 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.writeln(this->placeholder_parser_process("filament_end_gcode", end_gcode, extruder_id, &config)); } } - file.writeln(this->placeholder_parser_process("machine_end_gcode", print.config().machine_end_gcode, m_writer.filament()->id(), &config)); + file.writeln(this->placeholder_parser_process("machine_end_gcode", print.config().machine_end_gcode, m_writer->filament()->id(), &config)); } - file.write(m_writer.update_progress(m_layer_count, m_layer_count, true)); // 100% - file.write(m_writer.postamble()); + file.write(m_writer->update_progress(m_layer_count, m_layer_count, true)); // 100% + file.write(m_writer->postamble()); if (activate_chamber_temp_control && max_chamber_temp > 0) - file.write(m_writer.set_chamber_temperature(0, false)); //close chamber_temperature + file.write(m_writer->set_chamber_temperature(0, false)); //close chamber_temperature if (activate_air_filtration) { int complete_print_exhaust_fan_speed = 0; - for (const auto& extruder : m_writer.extruders()) + for (const auto& extruder : m_writer->extruders()) if (m_config.activate_air_filtration.get_at(extruder.id())) complete_print_exhaust_fan_speed = std::max(complete_print_exhaust_fan_speed, m_config.complete_print_exhaust_fan_speed.get_at(extruder.id())); - file.write(m_writer.set_exhaust_fan(complete_print_exhaust_fan_speed, true)); + file.write(m_writer->set_exhaust_fan(complete_print_exhaust_fan_speed, true)); } // adds tags for time estimators file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Last_Line_M73_Placeholder).c_str()); @@ -3482,7 +3440,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write(DoExport::update_print_stats_and_format_filament_stats( // Const inputs has_wipe_tower, print.wipe_tower_data(), - m_writer.extruders(), + m_writer->extruders(), // Modifies print.m_print_statistics)); print.m_print_statistics.initial_tool = initial_extruder_id; @@ -3656,7 +3614,7 @@ void GCode::process_layers( ); const auto fan_mover = tbb::make_filter(slic3r_tbb_filtermode::serial_in_order, - [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = this->m_writer](std::string in)->std::string { + [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = *this->m_writer](std::string in)->std::string { CNumericLocalesSetter locales_setter; @@ -3756,7 +3714,7 @@ void GCode::process_layers( ); const auto fan_mover = tbb::make_filter(slic3r_tbb_filtermode::serial_in_order, - [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = this->m_writer](std::string in)->std::string { + [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = *this->m_writer](std::string in)->std::string { if (config.fan_speedup_time.value != 0 || config.fan_kickstart.value > 0) { if (fan_mover.get() == nullptr) @@ -3824,21 +3782,21 @@ std::string GCode::placeholder_parser_process(const std::string &name, const std PlaceholderParserIntegration &ppi = m_placeholder_parser_integration; try { - ppi.update_from_gcodewriter(m_writer); + ppi.update_from_gcodewriter(*m_writer); std::string output = ppi.parser.process(templ, current_filament_id, config_override, &ppi.output_config, &ppi.context); ppi.validate_output_vector_variables(); if (const std::vector &pos = ppi.opt_position->values; ppi.position != pos) { // Update G-code writer. - m_writer.set_position({ pos[0], pos[1], pos[2] }); + m_writer->set_position({ pos[0], pos[1], pos[2] }); this->set_last_pos(this->gcode_to_point({ pos[0], pos[1] })); } - for (const Extruder &e : m_writer.extruders()) { + for (const Extruder &e : m_writer->extruders()) { unsigned int eid = e.id(); assert(eid < ppi.num_extruders); if ( eid < ppi.num_extruders) { - if (! m_writer.config.use_relative_e_distances && ! is_approx(ppi.e_position[eid], ppi.opt_e_position->values[eid])) + if (! m_writer->config.use_relative_e_distances && ! is_approx(ppi.e_position[eid], ppi.opt_e_position->values[eid])) const_cast(e).set_position(ppi.opt_e_position->values[eid]); if (! is_approx(ppi.e_retracted[eid], ppi.opt_e_retracted->values[eid]) || ! is_approx(ppi.e_restart_extra[eid], ppi.opt_e_restart_extra->values[eid])) @@ -3963,9 +3921,9 @@ void GCode::_print_first_layer_bed_temperature(GCodeOutputStream &file, Print &p temp = temp_by_gcode; #endif - // Always call m_writer.set_bed_temperature() so it will set the internal "current" state of the bed temp as if + // Always call m_writer->set_bed_temperature() so it will set the internal "current" state of the bed temp as if // the custom start G-code emited these. - std::string set_temp_gcode = m_writer.set_bed_temperature(bed_temp, wait); + std::string set_temp_gcode = m_writer->set_bed_temperature(bed_temp, wait); if (! temp_set_by_gcode) file.write(set_temp_gcode); } @@ -3985,14 +3943,14 @@ void GCode::_print_first_layer_extruder_temperatures(GCodeOutputStream &file, Pr int temp = print.config().nozzle_temperature_initial_layer.get_at(first_printing_extruder_id); if (temp_by_gcode >= 0 && temp_by_gcode < 1000) temp = temp_by_gcode; - m_writer.set_temperature(temp, wait, first_printing_extruder_id); + m_writer->set_temperature(temp, wait, first_printing_extruder_id); } else { // Custom G-code does not set the extruder temperature. Do it now. if (print.config().single_extruder_multi_material.value) { // Set temperature of the first printing extruder only. int temp = print.config().nozzle_temperature_initial_layer.get_at(first_printing_extruder_id); if (temp > 0) - file.write(m_writer.set_temperature(temp, wait, first_printing_extruder_id)); + file.write(m_writer->set_temperature(temp, wait, first_printing_extruder_id)); } else { // Set temperatures of all the printing extruders. for (unsigned int tool_id : print.extruders()) { @@ -4004,7 +3962,7 @@ void GCode::_print_first_layer_extruder_temperatures(GCodeOutputStream &file, Pr temp = print.config().idle_temperature.get_at(tool_id); } if (temp > 0) - file.write(m_writer.set_temperature(temp, wait, tool_id)); + file.write(m_writer->set_temperature(temp, wait, tool_id)); } } } @@ -4427,7 +4385,7 @@ LayerResult GCode::process_layer( //support is attached above the object, and support layers has independent layer height, then the lowest support //interface layer id is 0. bool first_layer = (layer.id() == 0 && abs(layer.bottom_z()) < EPSILON); - m_writer.set_is_first_layer(first_layer); + m_writer->set_is_first_layer(first_layer); unsigned int first_extruder_id = layer_tools.extruders.front(); // Initialize config with the 1st object to be printed at this layer. @@ -4477,7 +4435,7 @@ LayerResult GCode::process_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); gcode += this->placeholder_parser_process("before_layer_change_gcode", - print.config().before_layer_change_gcode.value, m_writer.filament()->id(), &config) + print.config().before_layer_change_gcode.value, m_writer->filament()->id(), &config) + "\n"; } @@ -4512,7 +4470,7 @@ LayerResult GCode::process_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); gcode += this->placeholder_parser_process("timelapse_gcode", - print.config().time_lapse_gcode.value, m_writer.filament()->id(), &config) + print.config().time_lapse_gcode.value, m_writer->filament()->id(), &config) + "\n"; } @@ -4522,7 +4480,7 @@ LayerResult GCode::process_layer( config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); gcode += this->placeholder_parser_process("layer_change_gcode", - print.config().layer_change_gcode.value, m_writer.filament()->id(), &config) + print.config().layer_change_gcode.value, m_writer->filament()->id(), &config) + "\n"; config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); } @@ -4562,7 +4520,7 @@ LayerResult GCode::process_layer( case CalibMode::Calib_Input_shaping_freq: { if (m_layer_index == 1){ gcode += writer().set_input_shaping('A', print.calib_params().start, 0.f, print.calib_params().shaper_type); - if (m_writer.get_gcode_flavor() == gcfKlipper) { + if (m_writer->get_gcode_flavor() == gcfKlipper) { // Disable minimum cruise ratio to ensure consistent motion for calibration gcode += "SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0\n"; } @@ -4578,7 +4536,7 @@ LayerResult GCode::process_layer( } case CalibMode::Calib_Input_shaping_damp: { if (m_layer_index == 1){ - if (m_writer.get_gcode_flavor() == gcfKlipper) { + if (m_writer->get_gcode_flavor() == gcfKlipper) { // Disable minimum cruise ratio to ensure consistent motion for calibration gcode += "SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0\n"; } @@ -4590,7 +4548,7 @@ LayerResult GCode::process_layer( break; } case CalibMode::Calib_Cornering: { - if (m_writer.get_gcode_flavor() == gcfMarlinFirmware && + if (m_writer->get_gcode_flavor() == gcfMarlinFirmware && !m_config.machine_max_junction_deviation.values.empty() && m_config.machine_max_junction_deviation.values.front() > 0) { gcode += writer().set_junction_deviation(this->interpolate_value_across_layers(print.calib_params().start, print.calib_params().end)); @@ -4605,22 +4563,22 @@ LayerResult GCode::process_layer( if (first_layer) { // Orca: we don't need to optimize the Klipper as only set once if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) { - gcode += m_writer.set_print_acceleration((unsigned int)floor(m_config.initial_layer_acceleration.value + 0.5)); + gcode += m_writer->set_print_acceleration((unsigned int)floor(m_config.initial_layer_acceleration.value + 0.5)); } if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0) { - gcode += m_writer.set_jerk_xy(m_config.initial_layer_jerk.value); + gcode += m_writer->set_jerk_xy(m_config.initial_layer_jerk.value); } - if (m_writer.get_gcode_flavor() == gcfMarlinFirmware && m_config.default_junction_deviation.value > 0) { - gcode += m_writer.set_junction_deviation(m_config.default_junction_deviation.value); + if (m_writer->get_gcode_flavor() == gcfMarlinFirmware && m_config.default_junction_deviation.value > 0) { + gcode += m_writer->set_junction_deviation(m_config.default_junction_deviation.value); } } if (!first_layer && !m_second_layer_things_done) { // Orca: set power loss recovery const auto plr_mode = print.config().enable_power_loss_recovery.value; - gcode += m_writer.enable_power_loss_recovery(plr_mode); + gcode += m_writer->enable_power_loss_recovery(plr_mode); if (print.is_BBL_printer()) { // BBS: open first layer inspection at second layer @@ -4635,23 +4593,23 @@ LayerResult GCode::process_layer( // Reset acceleration at sencond layer // Orca: only set once, don't need to call set_accel_and_jerk if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) { - gcode += m_writer.set_print_acceleration((unsigned int) floor(m_config.default_acceleration.value + 0.5)); + gcode += m_writer->set_print_acceleration((unsigned int) floor(m_config.default_acceleration.value + 0.5)); } if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0) { - gcode += m_writer.set_jerk_xy(m_config.default_jerk.value); + gcode += m_writer->set_jerk_xy(m_config.default_jerk.value); } // Transition from 1st to 2nd layer. Adjust nozzle temperatures as prescribed by the nozzle dependent // nozzle_temperature_initial_layer vs. temperature settings. - for (const Extruder& extruder : m_writer.extruders()) { + for (const Extruder& extruder : m_writer->extruders()) { if ((print.config().single_extruder_multi_material.value || m_ooze_prevention.enable) && - extruder.id() != m_writer.filament()->id()) + extruder.id() != m_writer->filament()->id()) // In single extruder multi material mode, set the temperature for the current extruder only. continue; int temperature = print.config().nozzle_temperature.get_at(extruder.id()); if (temperature > 0 && temperature != print.config().nozzle_temperature_initial_layer.get_at(extruder.id())) - gcode += m_writer.set_temperature(temperature, false, extruder.id()); + gcode += m_writer->set_temperature(temperature, false, extruder.id()); } // BBS @@ -4660,14 +4618,14 @@ LayerResult GCode::process_layer( bed_temp = get_highest_bed_temperature(false,print); else bed_temp = get_bed_temperature(first_extruder_id, false, m_config.curr_bed_type); - gcode += m_writer.set_bed_temperature(bed_temp); + gcode += m_writer->set_bed_temperature(bed_temp); // Mark the temperature transition from 1st to 2nd layer to be finished. m_second_layer_things_done = true; } if (single_object_instance_idx == size_t(-1)) { // Normal (non-sequential) print. - gcode += ProcessLayer::emit_custom_gcode_per_print_z(*this, layer_tools.custom_gcode, m_writer.filament()->id(), first_extruder_id, print.config()); + gcode += ProcessLayer::emit_custom_gcode_per_print_z(*this, layer_tools.custom_gcode, m_writer->filament()->id(), first_extruder_id, print.config()); } // BBS: get next extruder according to flush and soluble @@ -4958,9 +4916,9 @@ LayerResult GCode::process_layer( auto insert_timelapse_gcode = [this, print_z, &print, &most_used_extruder, &layer_object_label_ids,&printed_objects = std::as_const(m_printed_objects)]() -> std::string { PosPickCtx ctx; - ctx.curr_pos = { (coord_t)(scale_(m_writer.get_position().x())),(coord_t)(scale_(m_writer.get_position().y())) }; + ctx.curr_pos = { (coord_t)(scale_(m_writer->get_position().x())),(coord_t)(scale_(m_writer->get_position().y())) }; ctx.curr_layer = this->layer(); - ctx.curr_extruder_id = m_writer.filament()->extruder_id(); + ctx.curr_extruder_id = m_writer->filament()->extruder_id(); ctx.picture_extruder_id = most_used_extruder; if (m_config.print_sequence == PrintSequence::ByObject) ctx.printed_objects = printed_objects; @@ -4978,17 +4936,17 @@ LayerResult GCode::process_layer( config.set_key_value("timelapse_pos_x", new ConfigOptionInt((int)timelapse_pos.x())); config.set_key_value("timelapse_pos_y", new ConfigOptionInt((int)timelapse_pos.y())); config.set_key_value("has_timelapse_safe_pos", new ConfigOptionBool(timelapse_pos != DefaultTimelapsePos)); - timelapse_gcode = this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer.filament()->id(), &config) + "\n"; + timelapse_gcode = this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer->filament()->id(), &config) + "\n"; } if (!timelapse_gcode.empty()) { - m_writer.set_current_position_clear(false); + m_writer->set_current_position_clear(false); double temp_z_after_tool_change; if (GCodeProcessor::get_last_z_from_gcode(timelapse_gcode, temp_z_after_tool_change)) { - Vec3d pos = m_writer.get_position(); + Vec3d pos = m_writer->get_position(); pos(2) = temp_z_after_tool_change; - m_writer.set_position(pos); + m_writer->set_position(pos); } } @@ -5034,16 +4992,16 @@ LayerResult GCode::process_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); config.set_key_value("most_used_physical_extruder_id", new ConfigOptionInt(m_config.physical_extruder_map.get_at(most_used_extruder))); - config.set_key_value("curr_physical_extruder_id", new ConfigOptionInt(m_config.physical_extruder_map.get_at(m_writer.filament()->extruder_id()))); - wrapping_gcode = this->placeholder_parser_process("wrapping_detection_gcode", print.config().wrapping_detection_gcode.value, m_writer.filament()->id(), &config) +"\n"; + config.set_key_value("curr_physical_extruder_id", new ConfigOptionInt(m_config.physical_extruder_map.get_at(m_writer->filament()->extruder_id()))); + wrapping_gcode = this->placeholder_parser_process("wrapping_detection_gcode", print.config().wrapping_detection_gcode.value, m_writer->filament()->id(), &config) +"\n"; } - m_writer.set_current_position_clear(false); + m_writer->set_current_position_clear(false); double temp_z_after_tool_change; if (GCodeProcessor::get_last_z_from_gcode(wrapping_gcode, temp_z_after_tool_change)) { - Vec3d pos = m_writer.get_position(); + Vec3d pos = m_writer->get_position(); pos(2) = temp_z_after_tool_change; - m_writer.set_position(pos); + m_writer->set_position(pos); } return wrapping_gcode; }; @@ -5076,7 +5034,7 @@ LayerResult GCode::process_layer( if (should_insert) { gcode += this->retract(false, false, auto_lift_type, true); - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); gcode += insert_timelapse_gcode(); has_insert_timelapse_gcode = true; @@ -5093,12 +5051,12 @@ LayerResult GCode::process_layer( } else { if (need_insert_timelapse_gcode_for_traditional && !has_insert_timelapse_gcode && - m_writer.need_toolchange(extruder_id) && + m_writer->need_toolchange(extruder_id) && m_config.nozzle_diameter.values.size() == 2 && writer().filament() && (get_extruder_id(writer().filament()->id()) == most_used_extruder)) { gcode += this->retract(false, false, auto_lift_type, true); - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); gcode += insert_timelapse_gcode(); has_insert_timelapse_gcode = true; @@ -5197,19 +5155,19 @@ LayerResult GCode::process_layer( // exclude objects if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer.set_object_start_str( + m_writer->set_object_start_str( std::string("; start printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M624 " + _encode_label_ids_to_base64({instance_to_print.label_object_id}) + "\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer.set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + + m_writer->set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { std::string str = std::string("M486 S") + std::to_string(inst.unique_id) + "\n"; - m_writer.set_object_start_str(str); + m_writer->set_object_start_str(str); } } } @@ -5227,7 +5185,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); - this->update_origin_snap(&instance_to_print.print_object, offset); + this->on_set_origin(&instance_to_print.print_object, offset); if (instance_to_print.object_by_extruder.support != nullptr) { m_layer = layers[instance_to_print.layer_id].support_layer; m_object_layer_over_raft = false; @@ -5251,7 +5209,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); - this->update_origin_snap(&instance_to_print.print_object, offset); + this->on_set_origin(&instance_to_print.print_object, offset); ExtrusionEntityCollection support_eec; // BBS @@ -5300,7 +5258,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); - this->update_origin_snap(&instance_to_print.print_object, offset); + this->on_set_origin(&instance_to_print.print_object, offset); //FIXME the following code prints regions in the order they are defined, the path is not optimized in any way. auto has_infill = [](const std::vector &by_region) { @@ -5337,20 +5295,20 @@ LayerResult GCode::process_layer( } // exclude objects // Don't set m_gcode_label_objects_end if you don't had to write the m_gcode_label_objects_start. - if (!m_writer.is_object_start_str_empty()) { - m_writer.set_object_start_str(""); + if (!m_writer->is_object_start_str_empty()) { + m_writer->set_object_start_str(""); } else if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer.set_object_end_str(std::string("; stop printing object, unique label id: ") + + m_writer->set_object_end_str(std::string("; stop printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M625\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer.set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + + m_writer->set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { - m_writer.set_object_end_str(std::string("M486 S-1\n")); + m_writer->set_object_end_str(std::string("M486 S-1\n")); } } } @@ -5402,7 +5360,7 @@ LayerResult GCode::process_layer( if (FILAMENT_CONFIG(retract_when_changing_layer)) { gcode += this->retract(false, false, auto_lift_type, true); } - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); gcode += insert_timelapse_gcode(); } @@ -5414,7 +5372,7 @@ LayerResult GCode::process_layer( void GCode::apply_print_config(const PrintConfig &print_config) { - m_writer.apply_print_config(print_config); + m_writer->apply_print_config(print_config); m_config.apply(print_config); m_scaled_resolution = scaled(print_config.resolution.value); m_enable_exclude_object = m_config.exclude_object; @@ -5504,7 +5462,7 @@ void GCode::append_full_config(const Print &print, std::string &str) void GCode::set_extruders(const std::vector &extruder_ids) { - m_writer.set_extruders(extruder_ids); + m_writer->set_extruders(extruder_ids); // enable wipe path generation if any extruder has wipe enabled m_wipe.enable = false; @@ -5527,139 +5485,15 @@ void GCode::set_origin(const Vec2d &pointf) m_origin = pointf; } -void GCode::update_origin_snap(const PrintObject *obj, const Point &inst_shift) -{ - if (!m_origin_snap[0] && !m_origin_snap[1] && !m_origin_snap[2]) - return; - - // Clear existing snap so to_machine_coords gives raw machine coords for bbox computation. - for (int a = 0; a < 3; ++a) - m_writer.set_origin_snap(a, false, 0., 0.); - - // Reconstruct the belt pipeline transform for this object (same as - // PrintObjectSlice.cpp: z_shift * scale * shear * pre_remap). - const auto &cfg = m_config; - Transform3d belt = Transform3d::Identity(); - - // Pre-slice remap - int pre_rx = int(cfg.belt_preslice_remap_x.value); - int pre_ry = int(cfg.belt_preslice_remap_y.value); - int pre_rz = int(cfg.belt_preslice_remap_z.value); - if (pre_rx != int(BeltRemapAxis::PosX) || - pre_ry != int(BeltRemapAxis::PosY) || - pre_rz != int(BeltRemapAxis::PosZ)) { - auto remap_col = [](int r) -> Vec3d { - int a = r % 3; Vec3d c = Vec3d::Zero(); - c[a] = (r < 3) ? 1.0 : -1.0; - return c; - }; - Matrix3d lin; - lin.col(0) = remap_col(pre_rx); - lin.col(1) = remap_col(pre_ry); - lin.col(2) = remap_col(pre_rz); - Transform3d pre = Transform3d::Identity(); - pre.linear() = lin; - if (pre_rx >= 6 || pre_ry >= 6 || pre_rz >= 6) { - BoundingBoxf bb(cfg.printable_area.values); - Vec3d vm(bb.max.x(), bb.max.y(), cfg.printable_height.value); - Vec3d tr = Vec3d::Zero(); - if (pre_rx >= 6) tr[0] = vm[pre_rx % 3]; - if (pre_ry >= 6) tr[1] = vm[pre_ry % 3]; - if (pre_rz >= 6) tr[2] = vm[pre_rz % 3]; - pre.translation() = tr; - } - belt = pre * belt; - } - - // Shear - auto shear_f = [](BeltShearMode m, double a) -> double { - double r = Geometry::deg2rad(a), s = std::sin(r), c = std::cos(r); - switch (m) { - case BeltShearMode::PosCot: return (s > EPSILON) ? c/s : 0.; - case BeltShearMode::NegCot: return (s > EPSILON) ? -c/s : 0.; - case BeltShearMode::PosTan: return (c > EPSILON) ? s/c : 0.; - case BeltShearMode::NegTan: return (c > EPSILON) ? -s/c : 0.; - default: return 0.; - } - }; - struct AS { BeltShearMode m; double a; int f; }; - AS axes[3] = { - {cfg.belt_shear_x.value, cfg.belt_shear_x_angle.value, int(cfg.belt_shear_x_from.value)}, - {cfg.belt_shear_y.value, cfg.belt_shear_y_angle.value, int(cfg.belt_shear_y_from.value)}, - {cfg.belt_shear_z.value, cfg.belt_shear_z_angle.value, int(cfg.belt_shear_z_from.value)}, - }; - Transform3d shear = Transform3d::Identity(); - for (int i = 0; i < 3; ++i) - if (axes[i].m != BeltShearMode::None) { - double f = shear_f(axes[i].m, axes[i].a); - if (std::abs(f) > EPSILON) - shear.matrix()(i, axes[i].f) += f; - } - - // Scale - auto scale_f = [](BeltScaleMode m, double a) -> double { - if (m == BeltScaleMode::None) return 1.; - double r = Geometry::deg2rad(a), s = std::sin(r), c = std::cos(r); - switch (m) { - case BeltScaleMode::InvSin: return (s > EPSILON) ? 1./s : 1.; - case BeltScaleMode::InvCos: return (c > EPSILON) ? 1./c : 1.; - case BeltScaleMode::Sin: return s; - case BeltScaleMode::Cos: return c; - default: return 1.; - } - }; - Transform3d sc = Transform3d::Identity(); - sc.matrix()(0,0) = scale_f(cfg.belt_scale_x.value, cfg.belt_scale_x_angle.value); - sc.matrix()(1,1) = scale_f(cfg.belt_scale_y.value, cfg.belt_scale_y_angle.value); - sc.matrix()(2,2) = scale_f(cfg.belt_scale_z.value, cfg.belt_scale_z_angle.value); - - belt = sc * shear * belt; - - // Z-shift - double zs = (obj->belt_min_z() < 0.) ? -obj->belt_min_z() : 0.; - if (zs > 0.) { - Transform3d zsh = Transform3d::Identity(); - zsh.matrix()(2, 3) = zs; - belt = zsh * belt; - } - - // Full transform: belt * trafo_centered - Transform3d full = belt * obj->trafo_centered(); - - // Instance shift in slicer space + global Z offset - Vec3d shift(unscale(inst_shift.x()), - unscale(inst_shift.y()), - obj->belt_global_z_offset()); - - // Compute this instance's machine-space bbox min - BoundingBoxf3 bb = obj->model_object()->raw_bounding_box(); - Vec3d mn = bb.min.cast(), mx = bb.max.cast(); - Vec3d inst_min(std::numeric_limits::max(), - std::numeric_limits::max(), - std::numeric_limits::max()); - for (int i = 0; i < 8; ++i) { - Vec3d c((i & 1) ? mx.x() : mn.x(), - (i & 2) ? mx.y() : mn.y(), - (i & 4) ? mx.z() : mn.z()); - Vec3d mc = m_writer.to_machine_coords(full * c + shift); - for (int a = 0; a < 3; ++a) - inst_min[a] = std::min(inst_min[a], mc[a]); - } - - // Update writer snap for each enabled axis - for (int a = 0; a < 3; ++a) - m_writer.set_origin_snap(a, m_origin_snap[a], m_origin_snap_offset[a], inst_min[a]); -} - std::string GCode::preamble() { - std::string gcode = m_writer.preamble(); + std::string gcode = m_writer->preamble(); /* Perform a *silent* move to z_offset: we need this to initialize the Z position of our writer object so that any initial lift taking place before the first layer change will raise the extruder from the correct initial Z instead of 0. */ - m_writer.travel_to_z(m_config.z_offset.value); + m_writer->travel_to_z(m_config.z_offset.value); return gcode; } @@ -5670,28 +5504,28 @@ std::string GCode::change_layer(coordf_t print_z) std::string gcode; if (m_layer_count > 0) // Increment a progress bar indicator. - gcode += m_writer.update_progress(++ m_layer_index, m_layer_count); + gcode += m_writer->update_progress(++ m_layer_index, m_layer_count); //BBS coordf_t z = print_z + m_config.z_offset.value; // in unscaled coordinates - if (FILAMENT_CONFIG(retract_when_changing_layer) && m_writer.will_move_z(z)) { + if (FILAMENT_CONFIG(retract_when_changing_layer) && m_writer->will_move_z(z)) { LiftType lift_type = this->to_lift_type(ZHopType(FILAMENT_CONFIG(z_hop_types))); //BBS: force to use SpiralLift when change layer if lift type is auto gcode += this->retract(false, false, ZHopType(FILAMENT_CONFIG(z_hop_types)) == ZHopType::zhtAuto ? LiftType::SpiralLift : lift_type); } - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); if (m_spiral_vase) { //BBS: force to normal lift immediately in spiral vase mode std::ostringstream comment; comment << "move to next layer (" << m_layer_index << ")"; - gcode += m_writer.travel_to_z(z, comment.str()); + gcode += m_writer->travel_to_z(z, comment.str()); } m_need_change_layer_lift_z = true; m_nominal_z = z; - m_writer.get_position().z() = z; + m_writer->get_position().z() = z; // forget last wiping path as wiping after raising Z is pointless // BBS. Dont forget wiping path to reduce stringing. @@ -5990,7 +5824,7 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou //Point pt = ((nd * nd >= l2) ? (p1+v*0.4): (p1 + 0.2 * v * (nd / sqrt(l2)))).cast(); pt.rotate(angle, paths.front().polyline.points.front()); // generate the travel move - gcode += m_writer.extrude_to_xy(this->point_to_gcode(pt), 0,"move inwards before travel",true); + gcode += m_writer->extrude_to_xy(this->point_to_gcode(pt), 0,"move inwards before travel",true); } return gcode; @@ -6313,7 +6147,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, bool slope_need_z_travel = false; if (sloped != nullptr && !sloped->is_flat()) { auto target_z = get_sloped_z(sloped->slope_begin.z_ratio); - slope_need_z_travel = m_writer.will_move_z(target_z); + slope_need_z_travel = m_writer->will_move_z(target_z); } // Move to first point of extrusion path // path is 2D. But in slope lift case, lift z is done in travel_to function. @@ -6336,7 +6170,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // if needed, write the gcode_label_objects_end then gcode_label_objects_start // should be already done by travel_to, but just in case - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); // compensate retraction gcode += this->unretract(); @@ -6390,12 +6224,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } } - if (m_writer.get_gcode_flavor() == gcfKlipper) { - gcode += m_writer.set_accel_and_jerk(acceleration_i, jerk); + if (m_writer->get_gcode_flavor() == gcfKlipper) { + gcode += m_writer->set_accel_and_jerk(acceleration_i, jerk); } else { - gcode += m_writer.set_print_acceleration(acceleration_i); - gcode += m_writer.set_jerk_xy(jerk); + gcode += m_writer->set_print_acceleration(acceleration_i); + gcode += m_writer->set_jerk_xy(jerk); } // calculate effective extrusion length per distance unit (e_per_mm) @@ -6440,8 +6274,8 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } // Effective extrusion length per distance unit = (filament_flow_ratio/cross_section) * mm3_per_mm / print flow ratio - // m_writer.extruder()->e_per_mm3() below is (filament flow ratio / cross-sectional area) - double e_per_mm = m_writer.filament()->e_per_mm3() * _mm3_per_mm; + // m_writer->extruder()->e_per_mm3() below is (filament flow ratio / cross-sectional area) + double e_per_mm = m_writer->filament()->e_per_mm3() * _mm3_per_mm; e_per_mm /= filament_flow_ratio; // set speed @@ -6667,7 +6501,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index + 1)); config.set_key_value("layer_z", new ConfigOptionFloat(m_layer == nullptr ? m_last_height : m_layer->print_z)); gcode += this->placeholder_parser_process("change_extrusion_role_gcode", - m_config.change_extrusion_role_gcode.value, m_writer.filament()->id(), &config) + m_config.change_extrusion_role_gcode.value, m_writer->filament()->id(), &config) + "\n"; } @@ -6722,7 +6556,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, if (m_multi_flow_segment_path_average_mm3_per_mm > 0) { sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), m_multi_flow_segment_path_average_mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -6735,7 +6569,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // to issue a zero flow PA change command for this sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -6841,7 +6675,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -6856,7 +6690,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -6871,7 +6705,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // ORCA: End of adaptive PA code segment } - gcode += m_writer.set_speed(F, "", comment); + gcode += m_writer->set_speed(F, "", comment); { if (m_enable_cooling_markers) { if (enable_overhang_bridge_fan) { @@ -6889,7 +6723,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } // BBS: use G1 if not enable arc fitting or has no arc fitting result or in spiral_mode mode or we are doing sloped extrusion // Attention: G2 and G3 is not supported in spiral_mode mode - if (!m_config.enable_arc_fitting || path.polyline.fitting_result.empty() || m_config.spiral_mode || sloped != nullptr || m_config.belt_printer) { + if (!m_config.enable_arc_fitting || path.polyline.fitting_result.empty() || m_config.spiral_mode || sloped != nullptr || this->should_disable_arc_fitting()) { double path_length = 0.; double total_length = sloped == nullptr ? 0. : path.polyline.length() * SCALING_FACTOR; for (const Line& line : path.polyline.lines()) { @@ -6909,7 +6743,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } if (sloped == nullptr) { // Normal extrusion - gcode += m_writer.extrude_to_xy( + gcode += m_writer->extrude_to_xy( this->point_to_gcode(line.b), dE, GCodeWriter::full_gcode_comment ? tempDescription : "", path.is_force_no_extrusion()); @@ -6918,7 +6752,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, const auto [z_ratio, e_ratio] = sloped->interpolate(path_length / total_length); Vec2d dest2d = this->point_to_gcode(line.b); Vec3d dest3d(dest2d(0), dest2d(1), get_sloped_z(z_ratio)); - gcode += m_writer.extrude_to_xyz( + gcode += m_writer->extrude_to_xyz( dest3d, dE * e_ratio, GCodeWriter::full_gcode_comment ? tempDescription : "", path.is_force_no_extrusion()); @@ -6948,7 +6782,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, tempDescription += Slic3r::format(" | Old Flow Value: %0.5f Length: %0.5f",oldE, line_length); } } - gcode += m_writer.extrude_to_xy( + gcode += m_writer->extrude_to_xy( this->point_to_gcode(line.b), dE, GCodeWriter::full_gcode_comment ? tempDescription : "", path.is_force_no_extrusion()); @@ -6971,7 +6805,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, tempDescription += Slic3r::format(" | Old Flow Value: %0.5f Length: %0.5f",oldE, arc_length); } } - gcode += m_writer.extrude_arc_to_xy( + gcode += m_writer->extrude_arc_to_xy( this->point_to_gcode(arc.end_point), center_offset, dE, @@ -6999,7 +6833,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, Polyline l(p); total_length = l.length() * SCALING_FACTOR; } - gcode += m_writer.set_speed(last_set_speed, "", comment); + gcode += m_writer->set_speed(last_set_speed, "", comment); Vec2d prev = this->point_to_gcode_quantized(new_points[0].p); bool pre_fan_enabled = false; bool cur_fan_enabled = false; @@ -7049,7 +6883,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -7064,7 +6898,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -7081,10 +6915,10 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // Ignore small speed variations - emit speed change if the delta between current and new is greater than 60mm/min / 1mm/sec // Reset speed to F if delta to F is less than 1mm/sec if ((std::abs(last_set_speed - new_speed) > 60)) { - gcode += m_writer.set_speed(new_speed, "", comment); + gcode += m_writer->set_speed(new_speed, "", comment); last_set_speed = new_speed; } else if ((std::abs(F - new_speed) <= 60)) { - gcode += m_writer.set_speed(F, "", comment); + gcode += m_writer->set_speed(F, "", comment); last_set_speed = F; } auto dE = e_per_mm * line_length; @@ -7098,12 +6932,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } if (sloped == nullptr) { // Normal extrusion - gcode += m_writer.extrude_to_xy(p, dE, GCodeWriter::full_gcode_comment ? tempDescription : ""); + gcode += m_writer->extrude_to_xy(p, dE, GCodeWriter::full_gcode_comment ? tempDescription : ""); } else { // Sloped extrusion const auto [z_ratio, e_ratio] = sloped->interpolate(path_length / total_length); Vec3d dest3d(p(0), p(1), get_sloped_z(z_ratio)); - gcode += m_writer.extrude_to_xyz(dest3d, dE * e_ratio, GCodeWriter::full_gcode_comment ? tempDescription : ""); + gcode += m_writer->extrude_to_xyz(dest3d, dE * e_ratio, GCodeWriter::full_gcode_comment ? tempDescription : ""); } prev = p; @@ -7244,18 +7078,18 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string } } - if (m_writer.get_gcode_flavor() == gcfKlipper) { - gcode += m_writer.set_accel_and_jerk(acceleration_to_set, jerk_to_set); + if (m_writer->get_gcode_flavor() == gcfKlipper) { + gcode += m_writer->set_accel_and_jerk(acceleration_to_set, jerk_to_set); } else { - gcode += m_writer.set_travel_acceleration(acceleration_to_set); - gcode += m_writer.set_jerk_xy(jerk_to_set); + gcode += m_writer->set_travel_acceleration(acceleration_to_set); + gcode += m_writer->set_jerk_xy(jerk_to_set); } // if a retraction would be needed, try to use reduce_crossing_wall to plan a // multi-hop travel path inside the configuration space if (m_config.reduce_crossing_wall && !m_avoid_crossing_perimeters.disabled_once() - && m_writer.is_current_position_clear()) + && m_writer->is_current_position_clear()) //BBS: don't generate detour travel paths when current position is unclea { travel = m_avoid_crossing_perimeters.travel_to(*this, point, &could_be_wipe_disabled); @@ -7302,7 +7136,7 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string // if needed, write the gcode_label_objects_end then gcode_label_objects_start - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); // use G1 because we rely on paths being straight (G0 may make round paths) if (travel.size() >= 2) { @@ -7310,14 +7144,14 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string if (false/*m_spiral_vase*/) { // No lazy z lift for spiral vase mode for (size_t i = 1; i < travel.size(); ++i) { - gcode += m_writer.travel_to_xy(this->point_to_gcode(travel.points[i]), comment); + gcode += m_writer->travel_to_xy(this->point_to_gcode(travel.points[i]), comment); } } else { if (travel.size() == 2) { // No extra movements emitted by avoid_crossing_perimeters, simply move to the end point with z change const auto& dest2d = this->point_to_gcode(travel.points.back()); Vec3d dest3d(dest2d(0), dest2d(1), z == DBL_MAX ? m_nominal_z : z); - gcode += m_writer.travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); + gcode += m_writer->travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); m_need_change_layer_lift_z = false; } else { // Extra movements emitted by avoid_crossing_perimeters, lift the z to normal height at the beginning, then apply the z @@ -7327,16 +7161,16 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string // Lift to normal z at beginning Vec2d dest2d = this->point_to_gcode(travel.points[i]); Vec3d dest3d(dest2d(0), dest2d(1), m_nominal_z); - gcode += m_writer.travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); + gcode += m_writer->travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); m_need_change_layer_lift_z = false; } else if (z != DBL_MAX && i == travel.size() - 1) { // Apply z_ratio for the very last point Vec2d dest2d = this->point_to_gcode(travel.points[i]); Vec3d dest3d(dest2d(0), dest2d(1), z); - gcode += m_writer.travel_to_xyz(dest3d, comment); + gcode += m_writer->travel_to_xyz(dest3d, comment); } else { // For all points in between, no z change - gcode += m_writer.travel_to_xy(this->point_to_gcode(travel.points[i]), comment); + gcode += m_writer->travel_to_xy(this->point_to_gcode(travel.points[i]), comment); } } } @@ -7439,7 +7273,7 @@ bool GCode::needs_retraction(const Polyline &travel, ExtrusionRole role, LiftTyp if (clipped_travel.length() > travel_len_thresh) clipped_travel.points.back() = clipped_travel.points.front()+(clipped_travel.points.back() - clipped_travel.points.front()) * (travel_len_thresh / clipped_travel.length()); //BBS: translate to current plate coordinate system - clipped_travel.translate(Point::new_scale(double(m_origin.x() - m_writer.get_xy_offset().x()), double(m_origin.y() - m_writer.get_xy_offset().y()))); + clipped_travel.translate(Point::new_scale(double(m_origin.x() - m_writer->get_xy_offset().x()), double(m_origin.y() - m_writer->get_xy_offset().y()))); //BBS: force to retract when leave from external perimeter for a long travel //Better way is judging whether the travel move direction is same with last extrusion move. @@ -7491,13 +7325,13 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li { std::string gcode; - if (m_writer.filament() == nullptr) + if (m_writer->filament() == nullptr) return gcode; // wipe (if it's enabled for this extruder and we have a stored wipe path and no-zero wipe distance) if (FILAMENT_CONFIG(wipe) && m_wipe.has_path() && scale_(FILAMENT_CONFIG(wipe_distance)) > SCALED_EPSILON) { Wipe::RetractionValues wipeRetractions = m_wipe.calculateWipeRetractionLengths(*this, toolchange); - gcode += toolchange ? m_writer.retract_for_toolchange(true,wipeRetractions.retractLengthBeforeWipe) : m_writer.retract(true, wipeRetractions.retractLengthBeforeWipe); + gcode += toolchange ? m_writer->retract_for_toolchange(true,wipeRetractions.retractLengthBeforeWipe) : m_writer->retract(true, wipeRetractions.retractLengthBeforeWipe); gcode += m_wipe.wipe(*this,wipeRetractions.retractLengthDuringWipe, toolchange, is_last_retraction); } @@ -7507,14 +7341,14 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li length is honored in case wipe path was too short. */ if ((!this->on_first_layer() || this->config().bottom_surface_pattern != InfillPattern::ipHilbertCurve) && (role != erTopSolidInfill || this->config().top_surface_pattern != InfillPattern::ipHilbertCurve)) - gcode += toolchange ? m_writer.retract_for_toolchange() : m_writer.retract(); + gcode += toolchange ? m_writer->retract_for_toolchange() : m_writer->retract(); - gcode += m_writer.reset_e(); + gcode += m_writer->reset_e(); // Orca: check if should + can lift (roughly from SuperSlicer) RetractLiftEnforceType retract_lift_type = RetractLiftEnforceType(EXTRUDER_CONFIG(retract_lift_enforce)); bool needs_lift = toolchange - || m_writer.filament()->retraction_length() > 0 + || m_writer->filament()->retraction_length() > 0 || m_config.use_firmware_retraction; bool last_fill_extrusion_role_top_infill = (this->m_last_notgapfill_extrusion_role == ExtrusionRole::erTopSolidInfill || this->m_last_notgapfill_extrusion_role == ExtrusionRole::erIroning); @@ -7537,9 +7371,9 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li if (needs_lift && can_lift) { if (apply_instantly) - gcode += m_writer.eager_lift(lift_type); + gcode += m_writer->eager_lift(lift_type); else - gcode += m_writer.lazy_lift(lift_type, m_spiral_vase != nullptr); + gcode += m_writer->lazy_lift(lift_type, m_spiral_vase != nullptr); } return gcode; @@ -7548,11 +7382,11 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bool by_object, int toolchange_temp_override) { int new_extruder_id = get_extruder_id(new_filament_id); - if (!m_writer.need_toolchange(new_filament_id)) + if (!m_writer->need_toolchange(new_filament_id)) return ""; // if we are running a single-extruder setup, just set the extruder and return nothing - if (!m_writer.multiple_extruders) { + if (!m_writer->multiple_extruders) { this->placeholder_parser().set("current_extruder", new_filament_id); this->placeholder_parser().set("retraction_distance_when_ec", m_config.retraction_distances_when_ec.get_at(new_filament_id)); this->placeholder_parser().set("long_retraction_when_ec", m_config.long_retractions_when_ec.get_at(new_filament_id)); @@ -7575,13 +7409,13 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo check_add_eol(gcode); } if (m_config.enable_pressure_advance.get_at(new_filament_id)) { - gcode += m_writer.set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); + gcode += m_writer->set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); // Orca: Adaptive PA // Reset Adaptive PA processor last PA value m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(new_filament_id)); } - gcode += m_writer.toolchange(new_filament_id); + gcode += m_writer->toolchange(new_filament_id); return gcode; } @@ -7596,18 +7430,18 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo // BBS: insert skip object label before change filament while by object if (by_object) - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); bool add_change_filament_624 = false; - if (m_writer.filament() != nullptr) { + if (m_writer->filament() != nullptr) { // Process the custom filament_end_gcode. set_extruder() is only called if there is no wipe tower // so it should not be injected twice. - unsigned int old_filament_id = m_writer.filament()->id(); + unsigned int old_filament_id = m_writer->filament()->id(); const std::string &filament_end_gcode = m_config.filament_end_gcode.get_at(old_filament_id); if (! filament_end_gcode.empty()) { DynamicConfig config; config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); - config.set_key_value("layer_z", new ConfigOptionFloat(m_writer.get_position().z() - m_config.z_offset.value)); + config.set_key_value("layer_z", new ConfigOptionFloat(m_writer->get_position().z() - m_config.z_offset.value)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); config.set_key_value("filament_extruder_id", new ConfigOptionInt(int(get_extruder_id(old_filament_id)))); if (!m_filament_instances_code.empty()) { @@ -7623,7 +7457,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo // If ooze prevention is enabled, park current extruder in the nearest // standby point and set it to the standby temperature. - if (m_ooze_prevention.enable && m_writer.filament() != nullptr) + if (m_ooze_prevention.enable && m_writer->filament() != nullptr) gcode += m_ooze_prevention.pre_toolchange(*this); // BBS @@ -7636,23 +7470,23 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo if (toolchange_temp_override > 0) new_filament_temp = toolchange_temp_override; - Vec3d nozzle_pos = m_writer.get_position(); + Vec3d nozzle_pos = m_writer->get_position(); float old_retract_length, old_retract_length_toolchange, wipe_volume; int old_filament_temp, old_filament_e_feedrate; float filament_area = float((M_PI / 4.f) * pow(m_config.filament_diameter.get_at(new_filament_id), 2)); //BBS: add handling for filament change in start gcode int old_filament_id = -1; - if (m_writer.filament() != nullptr || m_start_gcode_filament != -1) { + if (m_writer->filament() != nullptr || m_start_gcode_filament != -1) { std::vector flush_matrix(cast(get_flush_volumes_matrix(m_config.flush_volumes_matrix.values, new_extruder_id, m_config.nozzle_diameter.values.size()))); const unsigned int number_of_extruders = (unsigned int) (m_config.filament_colour.values.size()); // if is multi_extruder only use the fist extruder matrix - if (m_writer.filament() != nullptr) - assert(m_writer.filament()->id() < number_of_extruders); + if (m_writer->filament() != nullptr) + assert(m_writer->filament()->id() < number_of_extruders); else assert(m_start_gcode_filament < number_of_extruders); - old_filament_id = m_writer.filament() != nullptr ? m_writer.filament()->id() : m_start_gcode_filament; - int old_extruder_id = m_writer.filament() != nullptr ? m_writer.filament()->extruder_id() : get_extruder_id(m_start_gcode_filament); + old_filament_id = m_writer->filament() != nullptr ? m_writer->filament()->id() : m_start_gcode_filament; + int old_extruder_id = m_writer->filament() != nullptr ? m_writer->filament()->extruder_id() : get_extruder_id(m_start_gcode_filament); old_retract_length = m_config.retraction_length.get_at(old_filament_id); old_retract_length_toolchange = m_config.retract_length_toolchange.get_at(old_filament_id); @@ -7662,7 +7496,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo float grab_purge_volume = m_config.grab_length.get_at(new_extruder_id) * 2.4; if (old_extruder_id != new_extruder_id) { //calc flush volume between the same extruder id - int old_filament_id_in_new_extruder = m_writer.filament(new_extruder_id) != nullptr ? m_writer.filament(new_extruder_id)->id() : -1; + int old_filament_id_in_new_extruder = m_writer->filament(new_extruder_id) != nullptr ? m_writer->filament(new_extruder_id)->id() : -1; if (old_filament_id_in_new_extruder == -1) wipe_volume = 0; else { @@ -7798,13 +7632,13 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo //BBS: gcode writer doesn't know where the extruder is and whether fan speed is changed after inserting tool change gcode //Set this flag so that normal lift will be used the first time after tool change. gcode += ";_FORCE_RESUME_FAN_SPEED\n"; - m_writer.set_current_position_clear(false); + m_writer->set_current_position_clear(false); //BBS: check whether custom gcode changes the z position. Update if changed double temp_z_after_tool_change; if (GCodeProcessor::get_last_z_from_gcode(toolchange_gcode_parsed, temp_z_after_tool_change)) { - Vec3d pos = m_writer.get_position(); + Vec3d pos = m_writer->get_position(); pos(2) = temp_z_after_tool_change; - m_writer.set_position(pos); + m_writer->set_position(pos); } } } @@ -7812,13 +7646,13 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo // BBS. Reset old extruder E-value. // Keep retract length because Custom GCode will guarantee retract length be the same as toolchange if (m_config.single_extruder_multi_material) { - m_writer.reset_e(); + m_writer->reset_e(); } //BBS: don't add T[next extruder] if there is no T cmd on filament change //We inform the writer about what is happening, but we may not use the resulting gcode. - std::string toolchange_command = m_writer.toolchange(new_filament_id); - if (!custom_gcode_changes_tool(toolchange_gcode_parsed, m_writer.toolchange_prefix(), new_filament_id)) + std::string toolchange_command = m_writer->toolchange(new_filament_id); + if (!custom_gcode_changes_tool(toolchange_gcode_parsed, m_writer->toolchange_prefix(), new_filament_id)) gcode += toolchange_command; else { // user provided his own toolchange gcode, no need to do anything @@ -7829,7 +7663,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo int temp = (m_layer_index <= 0 ? m_config.nozzle_temperature_initial_layer.get_at(new_filament_id) : m_config.nozzle_temperature.get_at(new_filament_id)); - gcode += m_writer.set_temperature(temp, false); + gcode += m_writer->set_temperature(temp, false); } this->placeholder_parser().set("current_extruder", new_filament_id); @@ -7873,7 +7707,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo gcode += m_ooze_prevention.post_toolchange(*this); if (m_config.enable_pressure_advance.get_at(new_filament_id)) { - gcode += m_writer.set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); + gcode += m_writer->set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); // Orca: Adaptive PA // Reset Adaptive PA processor last PA value m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(new_filament_id)); @@ -7959,7 +7793,7 @@ Vec2d GCode::point_to_gcode(const Point &point) const Point GCode::gcode_to_point(const Vec2d &point) const { Vec2d pt = point - m_origin; - if (const Extruder *extruder = m_writer.filament(); extruder) + if (const Extruder *extruder = m_writer->filament(); extruder) // This function may be called at the very start from toolchange G-code when the extruder is not assigned yet. pt += m_config.extruder_offset.get_at(extruder->extruder_id()); return scaled(pt); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index dbec7d0315..9004f30fd3 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -4,6 +4,7 @@ #include "libslic3r.h" #include "ExPolygon.hpp" #include "GCodeWriter.hpp" +#include "BeltGCodeWriter.hpp" #include "Layer.hpp" #include "Point.hpp" #include "PlaceholderParser.hpp" @@ -206,16 +207,18 @@ public: m_last_obj_copy(nullptr, Point(std::numeric_limits::max(), std::numeric_limits::max())), // BBS m_toolchange_count(0), - m_nominal_z(0.) + m_nominal_z(0.), + m_writer(std::make_unique()) {} - ~GCode() = default; + virtual ~GCode() = default; +public: // throws std::runtime_exception on error, // throws CanceledException through print->throw_if_canceled(). void do_export(Print* print, const char* path, GCodeProcessorResult* result = nullptr, ThumbnailsGeneratorCallback thumbnail_cb = nullptr); void export_layer_filaments(GCodeProcessorResult* result); //BBS: set offset for gcode writer - void set_gcode_offset(double x, double y) { m_writer.set_xy_offset(x, y); m_processor.set_xy_offset(x, y);} + void set_gcode_offset(double x, double y) { m_writer->set_xy_offset(x, y); m_processor.set_xy_offset(x, y);} // Exported for the helper classes (OozePrevention, Wipe) and for the Perl binding for unit tests. const Vec2d& origin() const { return m_origin; } @@ -227,8 +230,8 @@ public: Vec2d point_to_gcode_quantized(const Point& point) const; const FullPrintConfig &config() const { return m_config; } const Layer* layer() const { return m_layer; } - GCodeWriter& writer() { return m_writer; } - const GCodeWriter& writer() const { return m_writer; } + GCodeWriter& writer() { return *m_writer; } + const GCodeWriter& writer() const { return *m_writer; } PlaceholderParser& placeholder_parser() { return m_placeholder_parser_integration.parser; } const PlaceholderParser& placeholder_parser() const { return m_placeholder_parser_integration.parser; } // Process a template through the placeholder parser, collect error messages to be reported @@ -248,7 +251,7 @@ public: std::string travel_to(const Point& point, ExtrusionRole role, std::string comment, double z = DBL_MAX); bool needs_retraction(const Polyline& travel, ExtrusionRole role, LiftType& lift_type); std::string retract(bool toolchange = false, bool is_last_retraction = false, LiftType lift_type = LiftType::NormalLift, bool apply_instantly = false, ExtrusionRole role = erNone); - std::string unretract() { return m_writer.unlift() + m_writer.unretract(); } + std::string unretract() { return m_writer->unlift() + m_writer->unretract(); } std::string set_extruder(unsigned int extruder_id, double print_z, bool by_object=false, int toolchange_temp_override = -1); bool is_BBL_Printer(); WipeTowerType wipe_tower_type(); @@ -300,7 +303,7 @@ public: } }; -private: +protected: class GCodeOutputStream { public: GCodeOutputStream(FILE *f, GCodeProcessor &processor) : f(f), m_processor(processor) {} @@ -328,9 +331,17 @@ private: FILE *f = nullptr; GCodeProcessor &m_processor; }; + + // Virtual hooks for belt printer subclass (BeltGCode). + // No-ops in base GCode; overridden in BeltGCode. + virtual void init_belt_writer(Print &print, bool is_bbl_printers) {} + virtual void write_belt_header(GCodeOutputStream &file, const Print &print) {} + virtual void on_set_origin(const PrintObject *obj, const Point &inst_shift) {} + virtual bool should_disable_arc_fitting() const { return false; } + void _do_export(Print &print, GCodeOutputStream &file, ThumbnailsGeneratorCallback thumbnail_cb); - static std::vector collect_layers_to_print(const PrintObject &object); + static std::vector collect_layers_to_print(const PrintObject &object, bool skip_empty_first_layer = false); static std::vector>> collect_layers_to_print(const Print &print); std::string generate_skirt(const Print &print, @@ -493,16 +504,11 @@ private: This affects the input arguments supplied to the extrude*() and travel_to() methods. */ Vec2d m_origin; - // Per-axis origin snap: shift G-code so each object's bbox min = offset. - bool m_origin_snap[3] = {false, false, false}; - double m_origin_snap_offset[3] = {0., 0., 0.}; - // Called when switching instances to recompute the writer's snap for this instance. - void update_origin_snap(const PrintObject *obj, const Point &inst_shift); FullPrintConfig m_config; DynamicConfig m_calib_config; // scaled G-code resolution double m_scaled_resolution; - GCodeWriter m_writer; + std::unique_ptr m_writer; struct PlaceholderParserIntegration { void reset(); diff --git a/src/libslic3r/GCode/BeltBackTransform.cpp b/src/libslic3r/GCode/BeltBackTransform.cpp index 7cd5bc6b53..2e2cd26f75 100644 --- a/src/libslic3r/GCode/BeltBackTransform.cpp +++ b/src/libslic3r/GCode/BeltBackTransform.cpp @@ -1,40 +1,8 @@ #include "BeltBackTransform.hpp" -#include "../Geometry.hpp" -#include +#include "../BeltTransform.hpp" namespace Slic3r { -// Keep in sync with PrintObjectSlice.cpp compute_shear_factor (lines ~147-157). -static double compute_shear_factor(BeltShearMode mode, double angle_deg) -{ - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } -} - -// Keep in sync with PrintObjectSlice.cpp compute_scale_factor (lines ~180-192). -static double compute_scale_factor(BeltScaleMode mode, double angle_deg) -{ - if (mode == BeltScaleMode::None) return 1.; - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; - case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; - case BeltScaleMode::Sin: return sin_a; - case BeltScaleMode::Cos: return cos_a; - default: return 1.; - } -} - bool BeltBackTransform::init_from_config(const PrintConfig &config) { m_active = false; @@ -43,99 +11,19 @@ bool BeltBackTransform::init_from_config(const PrintConfig &config) if (!config.belt_printer.value || !config.belt_gcode_back_transform.value) return false; - // --- Pre-slice axis remap (same as PrintObjectSlice.cpp) --- - int pre_rx = int(config.belt_preslice_remap_x.value); - int pre_ry = int(config.belt_preslice_remap_y.value); - int pre_rz = int(config.belt_preslice_remap_z.value); - - bool has_preslice_remap = (pre_rx != int(BeltRemapAxis::PosX) || - pre_ry != int(BeltRemapAxis::PosY) || - pre_rz != int(BeltRemapAxis::PosZ)); - // Require at least one active transform to proceed. bool has_global_shear = config.belt_shear_x_global.value || config.belt_shear_y_global.value || config.belt_shear_z_global.value; - if (!has_global_shear && !has_preslice_remap) + if (!has_global_shear && !BeltTransformPipeline::has_preslice_remap(config)) return false; - // Build pre-slice remap matrix. - Transform3d pre_remap = Transform3d::Identity(); - if (has_preslice_remap) { - auto remap_column = [](int r) -> Vec3d { - int axis = r % 3; - Vec3d col = Vec3d::Zero(); - if (r < 3) col[axis] = 1.0; - else if (r < 6) col[axis] = -1.0; - else col[axis] = -1.0; // Rev: max - pos - return col; - }; - - Matrix3d remap_lin; - remap_lin.col(0) = remap_column(pre_rx); - remap_lin.col(1) = remap_column(pre_ry); - remap_lin.col(2) = remap_column(pre_rz); - pre_remap.linear() = remap_lin; - - // Rev mode translation (needs build volume extents). - Vec3d remap_trans = Vec3d::Zero(); - if (pre_rx >= 6 || pre_ry >= 6 || pre_rz >= 6) { - BoundingBoxf bbox_bed(config.printable_area.values); - Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), - config.printable_height.value); - auto add_rev = [&](int r, int out) { - if (r >= 6) remap_trans[out] = vol_max[r % 3]; - }; - add_rev(pre_rx, 0); - add_rev(pre_ry, 1); - add_rev(pre_rz, 2); - } - pre_remap.translation() = remap_trans; - } - - // Build per-axis shear matrix (same as PrintObjectSlice.cpp). - struct AxisShear { BeltShearMode mode; double angle; int from; }; - AxisShear axes[3] = { - { config.belt_shear_x.value, config.belt_shear_x_angle.value, int(config.belt_shear_x_from.value) }, - { config.belt_shear_y.value, config.belt_shear_y_angle.value, int(config.belt_shear_y_from.value) }, - { config.belt_shear_z.value, config.belt_shear_z_angle.value, int(config.belt_shear_z_from.value) }, - }; - - Matrix3d shear = Matrix3d::Identity(); - bool has_shear = false; - for (int row = 0; row < 3; ++row) { - if (axes[row].mode != BeltShearMode::None) { - double factor = compute_shear_factor(axes[row].mode, axes[row].angle); - if (std::abs(factor) > EPSILON) { - shear(row, axes[row].from) += factor; - has_shear = true; - } - } - } - - // Build per-axis scale diagonal matrix (same as PrintObjectSlice.cpp). - double sx = compute_scale_factor(config.belt_scale_x.value, config.belt_scale_x_angle.value); - double sy = compute_scale_factor(config.belt_scale_y.value, config.belt_scale_y_angle.value); - double sz = compute_scale_factor(config.belt_scale_z.value, config.belt_scale_z_angle.value); - - Matrix3d scale = Matrix3d::Identity(); - bool has_scale = (std::abs(sx - 1.) > EPSILON || - std::abs(sy - 1.) > EPSILON || - std::abs(sz - 1.) > EPSILON); - if (has_scale) { - scale(0, 0) = sx; - scale(1, 1) = sy; - scale(2, 2) = sz; - } - - if (!has_shear && !has_scale && !has_preslice_remap) + // Build the forward pipeline (scale * shear * pre_remap) and store its inverse. + Transform3d forward = BeltTransformPipeline::build_forward_transform(config); + if (forward.isApprox(Transform3d::Identity())) return false; - // Forward pipeline: scale * shear * pre_remap (same order as PrintObjectSlice.cpp). - Transform3d combined = Transform3d::Identity(); - combined.linear() = scale * shear; - combined = combined * pre_remap; - m_inverse = combined.inverse(); + m_inverse = forward.inverse(); m_active = true; return true; } diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 8c2f7122b8..fea5509bc3 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -20,59 +20,6 @@ namespace Slic3r { bool GCodeWriter::full_gcode_comment = true; -void GCodeWriter::set_belt_angle(double angle_deg) -{ - m_belt_angle_rad = Geometry::deg2rad(angle_deg); -} - -void GCodeWriter::set_axis_remap(int rx, int ry, int rz) -{ - m_remap_x = rx; - m_remap_y = ry; - m_remap_z = rz; -} - -void GCodeWriter::set_build_volume_max(const Vec3d &max) -{ - m_build_vol_max = max; -} - -void GCodeWriter::set_belt_back_transform(const PrintConfig &config) -{ - m_belt_back_transform.init_from_config(config); -} - -void GCodeWriter::set_origin_snap(int axis, bool enable, double offset, double bbox_min) -{ - if (axis >= 0 && axis < 3) { - m_origin_snap[axis] = enable; - m_origin_offset[axis] = offset; - m_origin_bbox_min[axis] = bbox_min; - } -} - -Vec3d GCodeWriter::to_machine_coords(const Vec3d &pos) const -{ - if (!is_belt_printer()) - return pos; - // Step 1: Undo the shear/scale applied during slicing. - Vec3d p = m_belt_back_transform.apply(pos); - // Step 2: Apply axis remapping for the machine's coordinate convention. - // BeltRemapAxis: 0-2 = +X/+Y/+Z, 3-5 = -X/-Y/-Z, 6-8 = Rev X/Y/Z - auto remap = [this, &p](int r) -> double { - int axis = r % 3; - if (r < 3) return p[axis]; - if (r < 6) return -p[axis]; - return m_build_vol_max[axis] - p[axis]; - }; - Vec3d result = { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; - // Per-axis origin snap: shift so bbox min on each enabled axis = offset. - for (int i = 0; i < 3; ++i) - if (m_origin_snap[i]) - result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); - return result; -} - bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) { return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware); @@ -601,13 +548,7 @@ std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &com Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - if (is_belt_printer()) { - // Belt printer: transform to machine coordinates (XY travel also needs Z due to YZ rotation) - Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); - w.emit_xyz(machine); - } else { - w.emit_xy(point_on_plate); - } + w.emit_xy(point_on_plate); auto speed = m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; w.emit_f(speed * 60.0); @@ -621,11 +562,6 @@ it will not perform subsequent lifts, even if Z was raised manually (i.e. with travel_to_z()) and thus _lifted was reduced. */ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) { - // Belt printer: force NormalLift since SpiralLift and SlopeLift compute slope angles - // that don't account for the YZ coordinate rotation. - if (is_belt_printer()) - lift_type = LiftType::NormalLift; - // check whether the above/below conditions are met double target_lift = 0; { @@ -654,8 +590,7 @@ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) // BBS: immediately execute an undelayed lift move with a spiral lift pattern // designed specifically for subsequent gcode injection (e.g. timelapse) std::string GCodeWriter::eager_lift(const LiftType type) { - // Belt printer: force NormalLift (SpiralLift/SlopeLift don't account for YZ rotation). - const LiftType effective_type = is_belt_printer() ? LiftType::NormalLift : type; + const LiftType effective_type = type; std::string lift_move; double target_lift = 0; { @@ -742,8 +677,6 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co // / to make the z list early to avoid to hit some warping place when travel is long. Vec2d temp = delta_no_z.normalized() * delta(2) / tan(this->filament()->travel_slope()); Vec3d slope_top_point = Vec3d(temp(0), temp(1), delta(2)) + source; - if (is_belt_printer()) - slope_top_point = to_machine_coords(slope_top_point); GCodeG1Formatter w0; w0.emit_xyz(slope_top_point); w0.emit_f(travel_speed * 60.0); @@ -758,27 +691,18 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co std::string xy_z_move; { - Vec3d emit_target = is_belt_printer() ? to_machine_coords(target) : target; GCodeG1Formatter w0; if (this->is_current_position_clear()) { - w0.emit_xyz(emit_target); + w0.emit_xyz(target); w0.emit_f(travel_speed * 60.0); w0.emit_comment(GCodeWriter::full_gcode_comment, comment); xy_z_move = w0.string(); } else { - if (is_belt_printer()) { - // Belt mode: can't split XY and Z moves independently, emit full XYZ - w0.emit_xyz(emit_target); - w0.emit_f(travel_speed * 60.0); - w0.emit_comment(GCodeWriter::full_gcode_comment, comment); - xy_z_move = w0.string(); - } else { - w0.emit_xy(Vec2d(target.x(), target.y())); - w0.emit_f(travel_speed * 60.0); - w0.emit_comment(GCodeWriter::full_gcode_comment, comment); - xy_z_move = w0.string() + _travel_to_z(target.z(), comment); - } + w0.emit_xy(Vec2d(target.x(), target.y())); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + xy_z_move = w0.string() + _travel_to_z(target.z(), comment); } } m_pos = dest_point; @@ -804,25 +728,15 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co //BBS: take plate offset into consider Vec3d point_on_plate = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; - if (is_belt_printer()) - point_on_plate = to_machine_coords(point_on_plate); std::string out_string; GCodeG1Formatter w; if (!this->is_current_position_clear()) { - if (is_belt_printer()) { - // Belt mode: emit full XYZ since Y and Z are coupled - w.emit_xyz(point_on_plate); - w.emit_f(this->config.travel_speed.value * 60.0); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - out_string = w.string(); - } else { - //force to move xy first then z after filament change - w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); - w.emit_f(this->config.travel_speed.value * 60.0); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - out_string = w.string() + _travel_to_z(point_on_plate.z(), comment); - } + //force to move xy first then z after filament change + w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); + w.emit_f(this->config.travel_speed.value * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + out_string = w.string() + _travel_to_z(point_on_plate.z(), comment); } else { GCodeG1Formatter w; w.emit_xyz(point_on_plate); @@ -866,13 +780,7 @@ std::string GCodeWriter::_travel_to_z(double z, const std::string &comment) } GCodeG1Formatter w; - if (is_belt_printer()) { - // Belt printer: a Z-only move in slicing frame needs to emit both Y and Z in machine coords. - Vec3d machine = to_machine_coords(Vec3d(m_pos.x() - m_x_offset, m_pos.y() - m_y_offset, z)); - w.emit_xyz(machine); - } else { - w.emit_z(z); - } + w.emit_z(z); w.emit_f(speed * 60.0); //BBS w.emit_comment(GCodeWriter::full_gcode_comment, comment); @@ -977,12 +885,7 @@ std::string GCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std: Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - if (is_belt_printer()) { - Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); - w.emit_xyz(machine); - } else { - w.emit_xy(point_on_plate); - } + w.emit_xy(point_on_plate); if (!force_no_extrusion) w.emit_e(filament()->E()); //BBS @@ -1023,8 +926,6 @@ std::string GCodeWriter::extrude_to_xyz(const Vec3d &point, double dE, const std Vec3d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset, point(2) }; GCodeG1Formatter w; - if (is_belt_printer()) - point_on_plate = to_machine_coords(point_on_plate); w.emit_xyz(point_on_plate); if (!force_no_extrusion) w.emit_e(filament()->E()); diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 2334f5d416..c96c3ca2c1 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -8,12 +8,11 @@ #include "Point.hpp" #include "PrintConfig.hpp" #include "GCode/CoolingBuffer.hpp" -#include "GCode/BeltBackTransform.hpp" - namespace Slic3r { class GCodeWriter { public: + virtual ~GCodeWriter() = default; GCodeConfig config; bool multiple_extruders; @@ -74,21 +73,21 @@ public: std::string set_speed(double F, const std::string &comment = std::string(), const std::string &cooling_marker = std::string()); // SoftFever NOTE: the returned speed is mm/minute double get_current_speed() const { return m_current_speed;} - std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string()); - std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false); + virtual std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string()); + virtual std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false); std::string travel_to_z(double z, const std::string &comment = std::string(), bool force = false); bool will_move_z(double z) const; - std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); + virtual std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); //BBS: generate G2 or G3 extrude which moves by arc std::string extrude_arc_to_xy(const Vec2d &point, const Vec2d ¢er_offset, double dE, const bool is_ccw, const std::string &comment = std::string(), bool force_no_extrusion = false); - std::string extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); + virtual std::string extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); std::string retract(bool before_wipe = false, double retract_length = 0); std::string retract_for_toolchange(bool before_wipe = false, double retract_length = 0); std::string unretract(); // do lift instantly - std::string eager_lift(const LiftType type); + virtual std::string eager_lift(const LiftType type); // record a lift request, do realy lift in next travel - std::string lazy_lift(LiftType lift_type = LiftType::NormalLift, bool spiral_vase = false); + virtual std::string lazy_lift(LiftType lift_type = LiftType::NormalLift, bool spiral_vase = false); std::string unlift(); const Vec3d& get_position() const { return m_pos; } Vec3d& get_position() { return m_pos; } @@ -126,23 +125,23 @@ public: void set_is_first_layer(bool bval) { m_is_first_layer = bval; } GCodeFlavor get_gcode_flavor() const { return config.gcode_flavor; } - // Belt printer: set the belt angle and precompute sin/cos for coordinate transformation. - void set_belt_angle(double angle_deg); - bool is_belt_printer() const { return m_belt_angle_rad != 0.; } - // Set axis remap for G-code output (BeltRemapAxis enum values). - void set_axis_remap(int rx, int ry, int rz); - // Set build volume extents for Rev remap mode (max X, Y, Z). - void set_build_volume_max(const Vec3d &max); - // Initialize the belt back-transform that undoes slicing shear/scale. - void set_belt_back_transform(const PrintConfig &config); - // Set per-axis origin snap: shifts G-code so bbox min on this axis = offset. - void set_origin_snap(int axis, bool enable, double offset, double bbox_min); - // Transform a point from the slicing frame to machine coordinates. - Vec3d to_machine_coords(const Vec3d &pos) const; - // Returns whether this flavor supports separate print and travel acceleration. static bool supports_separate_travel_acceleration(GCodeFlavor flavor); - private: +protected: + // Position/lift/offset state — accessible to subclasses (e.g. BeltGCodeWriter) + Vec3d m_pos = Vec3d::Zero(); + double m_x_offset{ 0 }; + double m_y_offset{ 0 }; + double m_lifted; + double m_to_lift; + LiftType m_to_lift_type; + bool m_is_first_layer = true; + bool m_is_current_pos_clear = false; + double m_current_speed; + + virtual std::string _travel_to_z(double z, const std::string &comment); + +private: // Extruders are sorted by their ID, so that binary search is possible. std::vector m_filament_extruders; bool m_single_extruder_multi_material; @@ -170,48 +169,21 @@ public: unsigned int m_last_additional_fan_speed; int m_last_bed_temperature; bool m_last_bed_temperature_reached; - double m_lifted; - - // BBS - double m_to_lift; - LiftType m_to_lift_type; - Vec3d m_pos = Vec3d::Zero(); - //BBS: this flag is used to indicate whether the m_pos is real. - //A example that of the first move, the m_pos is zero, but the real position of extruder doesn't - //Pos must be clear after the first xyz travel move - bool m_is_current_pos_clear = false; - //BBS: x, y offset for gcode generated - double m_x_offset{ 0 }; - double m_y_offset{ 0 }; // Orca: slicing resolution in mm double m_resolution = 0.01; - + std::string m_gcode_label_objects_start; std::string m_gcode_label_objects_end; //SoftFever bool m_is_bbl_printers = false; - // Belt printer state - double m_belt_angle_rad = 0.; - int m_remap_x = 0; - int m_remap_y = 1; - int m_remap_z = 2; - Vec3d m_build_vol_max = Vec3d::Zero(); - BeltBackTransform m_belt_back_transform; - bool m_origin_snap[3] = {false, false, false}; - double m_origin_offset[3] = {0., 0., 0.}; // target coord for bbox min - double m_origin_bbox_min[3] = {0., 0., 0.}; // computed bbox min in machine space - double m_current_speed; - bool m_is_first_layer = true; - enum class Acceleration { Travel, Print }; - std::string _travel_to_z(double z, const std::string &comment); std::string _spiral_travel_to_z(double z, const Vec2d &ij_offset, const std::string &comment); std::string _retract(double length, double restart_extra, const std::string &comment); std::string set_acceleration_internal(Acceleration type, unsigned int acceleration); diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 0b7190e8d1..1f787a70cf 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -12,6 +12,7 @@ #include "Thread.hpp" #include "Time.hpp" #include "GCode.hpp" +#include "BeltGCode.hpp" #include "GCode/WipeTower.hpp" #include "GCode/WipeTower2.hpp" #include "Utils.hpp" @@ -2551,12 +2552,17 @@ std::string Print::export_gcode(const std::string& path_template, GCodeProcessor this->set_status(80, message); // The following line may die for multiple reasons. - GCode gcode; + // Factory: use BeltGCode for belt printers, plain GCode otherwise. + std::unique_ptr gcode; + if (m_config.belt_printer.value) + gcode = std::make_unique(); + else + gcode = std::make_unique(); //BBS: compute plate offset for gcode-generator const Vec3d origin = this->get_plate_origin(); - gcode.set_gcode_offset(origin(0), origin(1)); - gcode.do_export(this, path.c_str(), result, thumbnail_cb); - gcode.export_layer_filaments(result); + gcode->set_gcode_offset(origin(0), origin(1)); + gcode->do_export(this, path.c_str(), result, thumbnail_cb); + gcode->export_layer_filaments(result); //BBS result->conflict_result = m_conflict_result; return path.c_str(); diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index c13a1407c0..9a5d000e1c 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -17,6 +17,7 @@ #include "GCode/ThumbnailData.hpp" #include "GCode/GCodeProcessor.hpp" #include "MultiMaterialSegmentation.hpp" +#include "BeltTransform.hpp" #include "libslic3r.h" #include @@ -190,30 +191,7 @@ class ConstSupportLayerPtrsAdaptor : public ConstVectorOfPtrsAdaptor double { - int axis = r % 3; - if (r < 3) return v[axis]; - return -v[axis]; - }; - Vec3d mn = bb.min.cast(), mx = bb.max.cast(); - BoundingBoxf3 rbb; - for (int i = 0; i < 8; ++i) { - Vec3d c((i & 1) ? mx.x() : mn.x(), - (i & 2) ? mx.y() : mn.y(), - (i & 4) ? mx.z() : mn.z()); - Vec3d rc(remap_coord(pre_rx, c), remap_coord(pre_ry, c), remap_coord(pre_rz, c)); - if (i == 0) rbb = BoundingBoxf3(rc, rc); - else rbb.merge(rc); - } - return rbb; + return BeltTransformPipeline::remap_bbox(model_object, config); } // Single instance of a PrintObject. diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index ba2ed408ce..be65c21c59 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1,5 +1,6 @@ #include "Exception.hpp" #include "Print.hpp" +#include "BeltTransform.hpp" #include "BoundingBox.hpp" #include "ClipperUtils.hpp" #include "ElephantFootCompensation.hpp" @@ -3398,76 +3399,22 @@ void PrintObject::update_slicing_parameters() // Orca: updated function call for XYZ shrinkage compensation if (!m_slicing_params.valid) { coordf_t object_height = this->model_object()->max_z(); - // Belt floor parameters for support clipping (populated below if belt Z-shear is active). - double belt_floor_shear_factor_out = 0.0; - int belt_floor_from_axis_out = 1; - double belt_floor_z_shift_out = 0.0; - // Belt shear/scale/pre-remap may change the effective Z height. + BeltTransformPipeline::BeltFloorParams belt_floor; const auto &pcfg = this->print()->config(); if (pcfg.belt_printer.value) { - BoundingBoxf3 bb = belt_remapped_bbox(*this->model_object(), pcfg); - bool has_preslice_remap = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || - int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || - int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); - if (has_preslice_remap) + BoundingBoxf3 bb = BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg); + if (BeltTransformPipeline::has_preslice_remap(pcfg)) object_height = bb.size().z(); - - bool has_z_shear = pcfg.belt_shear_z.value != BeltShearMode::None; - bool has_z_scale = pcfg.belt_scale_z.value != BeltScaleMode::None; - if (has_z_shear || has_z_scale) { - auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } - }; - auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { - if (mode == BeltScaleMode::None) return 1.; - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); - switch (mode) { - case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; - case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; - case BeltScaleMode::Sin: return sin_a; - case BeltScaleMode::Cos: return cos_a; - default: return 1.; - } - }; - double shear_factor = has_z_shear ? compute_shear_factor(pcfg.belt_shear_z.value, pcfg.belt_shear_z_angle.value) : 0.; - double scale_z = compute_scale_factor(pcfg.belt_scale_z.value, pcfg.belt_scale_z_angle.value); - if (has_z_shear && std::abs(shear_factor) > EPSILON) { - int from = int(pcfg.belt_shear_z_from.value); - double min_rz = std::numeric_limits::max(); - double max_rz = std::numeric_limits::lowest(); - for (double vz : {bb.min.z(), bb.max.z()}) - for (double vs : {bb.min(from), bb.max(from)}) { - double new_z = scale_z * (vz + shear_factor * vs); - min_rz = std::min(min_rz, new_z); - max_rz = std::max(max_rz, new_z); - } - object_height = max_rz - min_rz; - belt_floor_shear_factor_out = shear_factor; - belt_floor_from_axis_out = from; - // Belt contact surface starts at bb.min.z() pre-shear; add the - // slicing Z-shift that keeps the mesh above Z=0. - // Exact value is patched after slice_volumes() in posSlice. - belt_floor_z_shift_out = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); - } else { - object_height *= scale_z; - } - } + auto hr = BeltTransformPipeline::compute_belt_height_and_floor(pcfg, bb, object_height); + object_height = hr.object_height; + belt_floor = hr.floor_params; } m_slicing_params = SlicingParameters::create_from_config(pcfg, m_config, object_height, this->object_extruders(), this->print()->shrinkage_compensation()); // Populate belt floor parameters into slicing params for support clipping. - m_slicing_params.belt_floor_shear_factor = belt_floor_shear_factor_out; - m_slicing_params.belt_floor_from_axis = belt_floor_from_axis_out; - m_slicing_params.belt_floor_z_shift = belt_floor_z_shift_out; + m_slicing_params.belt_floor_shear_factor = belt_floor.shear_factor; + m_slicing_params.belt_floor_from_axis = belt_floor.from_axis; + m_slicing_params.belt_floor_z_shift = belt_floor.z_shift; } } @@ -3505,75 +3452,23 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full sort_remove_duplicates(object_extruders); //FIXME add painting extruders - // Belt floor parameters for support clipping (populated below if belt Z-shear is active). - double belt_floor_shear_factor_out = 0.0; - int belt_floor_from_axis_out = 1; - double belt_floor_z_shift_out = 0.0; - + BeltTransformPipeline::BeltFloorParams belt_floor; if (object_max_z <= 0.f) { BoundingBoxf3 bb = model_object.raw_bounding_box(); object_max_z = (float)bb.size().z(); - // Belt pre-remap/shear/scale may change the effective Z height. if (print_config.belt_printer.value) { - bb = belt_remapped_bbox(model_object, print_config); - bool has_preslice_remap = (int(print_config.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || - int(print_config.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || - int(print_config.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); - if (has_preslice_remap) + bb = BeltTransformPipeline::remap_bbox(model_object, print_config); + if (BeltTransformPipeline::has_preslice_remap(print_config)) object_max_z = (float)bb.size().z(); - - bool has_z_shear = print_config.belt_shear_z.value != BeltShearMode::None; - bool has_z_scale = print_config.belt_scale_z.value != BeltScaleMode::None; - if (has_z_shear || has_z_scale) { - auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } - }; - auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { - if (mode == BeltScaleMode::None) return 1.; - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); - switch (mode) { - case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; - case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; - case BeltScaleMode::Sin: return sin_a; - case BeltScaleMode::Cos: return cos_a; - default: return 1.; - } - }; - double shear_factor = has_z_shear ? compute_shear_factor(print_config.belt_shear_z.value, print_config.belt_shear_z_angle.value) : 0.; - double scale_z = compute_scale_factor(print_config.belt_scale_z.value, print_config.belt_scale_z_angle.value); - if (has_z_shear && std::abs(shear_factor) > EPSILON) { - int from = int(print_config.belt_shear_z_from.value); - double min_rz = std::numeric_limits::max(); - double max_rz = std::numeric_limits::lowest(); - for (double vz : {bb.min.z(), bb.max.z()}) - for (double vs : {bb.min(from), bb.max(from)}) { - double new_z = scale_z * (vz + shear_factor * vs); - min_rz = std::min(min_rz, new_z); - max_rz = std::max(max_rz, new_z); - } - object_max_z = (float)(max_rz - min_rz); - belt_floor_shear_factor_out = shear_factor; - belt_floor_from_axis_out = from; - belt_floor_z_shift_out = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); - } else { - object_max_z *= (float)scale_z; - } - } + auto hr = BeltTransformPipeline::compute_belt_height_and_floor(print_config, bb, object_max_z); + object_max_z = (float)hr.object_height; + belt_floor = hr.floor_params; } } SlicingParameters params = SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); - params.belt_floor_shear_factor = belt_floor_shear_factor_out; - params.belt_floor_from_axis = belt_floor_from_axis_out; - params.belt_floor_z_shift = belt_floor_z_shift_out; + params.belt_floor_shear_factor = belt_floor.shear_factor; + params.belt_floor_from_axis = belt_floor.from_axis; + params.belt_floor_z_shift = belt_floor.z_shift; return params; } diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 4c767ea0ed..3067772f09 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -9,6 +9,8 @@ #include "Layer.hpp" #include "MultiMaterialSegmentation.hpp" #include "Print.hpp" +#include "BeltTransform.hpp" +#include "BeltSliceStrategy.hpp" #include "Geometry.hpp" //BBS #include "ShortestPath.hpp" @@ -142,147 +144,11 @@ static std::vector slice_volumes_inner( params_base.closing_radius = print_object_config.slice_closing_radius.value; params_base.extra_offset = 0; params_base.trafo = object_trafo; - if (print_config.belt_printer.value) { - // --- Pre-slice axis remap --- - // Permutes/negates model axes before slicing so the slicer's coordinate - // system matches the physical bed orientation (e.g. XZ bed instead of XY). - int pre_rx = int(print_config.belt_preslice_remap_x.value); - int pre_ry = int(print_config.belt_preslice_remap_y.value); - int pre_rz = int(print_config.belt_preslice_remap_z.value); - - bool has_preslice_remap = (pre_rx != int(BeltRemapAxis::PosX) || - pre_ry != int(BeltRemapAxis::PosY) || - pre_rz != int(BeltRemapAxis::PosZ)); - - if (has_preslice_remap) { - // Build volume extents for Rev mode. - BoundingBoxf bbox_bed(print_config.printable_area.values); - Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), - print_config.printable_height.value); - - // Each remap value selects a source axis and sign. - // The column vector tells the matrix which input axis feeds this output. - auto remap_column = [](int r) -> Vec3d { - int axis = r % 3; - Vec3d col = Vec3d::Zero(); - if (r < 3) col[axis] = 1.0; // +axis - else if (r < 6) col[axis] = -1.0; // -axis - else col[axis] = -1.0; // Rev: max - pos = -(pos - max) - return col; - }; - - Matrix3d remap_lin; - remap_lin.col(0) = remap_column(pre_rx); - remap_lin.col(1) = remap_column(pre_ry); - remap_lin.col(2) = remap_column(pre_rz); - - // Translation for Rev modes: output = max[src] - input[src]. - Vec3d remap_trans = Vec3d::Zero(); - auto add_rev_offset = [&](int r, int out_axis) { - if (r >= 6) { - int src_axis = r % 3; - remap_trans[out_axis] = vol_max[src_axis]; - } - }; - add_rev_offset(pre_rx, 0); - add_rev_offset(pre_ry, 1); - add_rev_offset(pre_rz, 2); - - Transform3d pre_remap = Transform3d::Identity(); - pre_remap.linear() = remap_lin; - pre_remap.translation() = remap_trans; - - params_base.trafo = pre_remap * params_base.trafo; - } - - // Build per-axis shear matrix from 3 independent axis configs. - auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } - }; - - struct AxisShear { BeltShearMode mode; double angle; int from; }; - AxisShear axes[3] = { - { print_config.belt_shear_x.value, print_config.belt_shear_x_angle.value, int(print_config.belt_shear_x_from.value) }, - { print_config.belt_shear_y.value, print_config.belt_shear_y_angle.value, int(print_config.belt_shear_y_from.value) }, - { print_config.belt_shear_z.value, print_config.belt_shear_z_angle.value, int(print_config.belt_shear_z_from.value) }, - }; - - Transform3d belt_shear = Transform3d::Identity(); - bool has_shear = false; - for (int row = 0; row < 3; ++row) { - if (axes[row].mode != BeltShearMode::None) { - double factor = compute_shear_factor(axes[row].mode, axes[row].angle); - if (std::abs(factor) > EPSILON) { - belt_shear.matrix()(row, axes[row].from) += factor; - has_shear = true; - } - } - } - - // Build per-axis scale matrix. - auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { - if (mode == BeltScaleMode::None) return 1.; - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; - case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; - case BeltScaleMode::Sin: return sin_a; - case BeltScaleMode::Cos: return cos_a; - default: return 1.; - } - }; - - Transform3d belt_scale = Transform3d::Identity(); - bool has_scale = false; - double sx = compute_scale_factor(print_config.belt_scale_x.value, print_config.belt_scale_x_angle.value); - double sy = compute_scale_factor(print_config.belt_scale_y.value, print_config.belt_scale_y_angle.value); - double sz = compute_scale_factor(print_config.belt_scale_z.value, print_config.belt_scale_z_angle.value); - if (std::abs(sx - 1.) > EPSILON || std::abs(sy - 1.) > EPSILON || std::abs(sz - 1.) > EPSILON) { - belt_scale.matrix()(0, 0) = sx; - belt_scale.matrix()(1, 1) = sy; - belt_scale.matrix()(2, 2) = sz; - has_scale = true; - } - - // Apply: scale * shear * trafo (shear first, then scale). - if (has_shear || has_scale) - params_base.trafo = belt_scale * belt_shear * params_base.trafo; - - // After pre-remap/shear/scale, the mesh may clip through the build - // plate (Z < 0). Detect this and shift the mesh up along slicer Z. - if (has_preslice_remap || has_shear || has_scale) { - Transform3d combined = params_base.trafo; - double min_z = std::numeric_limits::max(); - for (const ModelVolume *mv : model_volumes) { - if (!mv->is_model_part()) continue; - for (const stl_vertex &v : mv->mesh().its.vertices) { - Vec3d pt = combined * v.cast(); - min_z = std::min(min_z, pt.z()); - } - } - double belt_z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; - BOOST_LOG_TRIVIAL(warning) << "Belt Z-shift: min_z=" << min_z - << " z_shift=" << belt_z_shift_val - << " trafo_z=" << object_trafo.matrix()(2, 3); - if (belt_z_shift_val > 0.) { - Transform3d z_shift = Transform3d::Identity(); - z_shift.matrix()(2, 3) = belt_z_shift_val; - params_base.trafo = z_shift * params_base.trafo; - } - if (out_belt_min_z) - *out_belt_min_z = (min_z != std::numeric_limits::max()) ? min_z : 0.; - } + { + // Belt printer: apply pre-slice transforms (remap, shear, scale, z-shift) via strategy. + auto belt_strategy = BeltSliceStrategy::create(print_config); + if (belt_strategy) + belt_strategy->apply_to_trafo(params_base.trafo, model_volumes, out_belt_min_z); } //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. @@ -968,11 +834,8 @@ void PrintObject::slice() // Without pre-remap, the belt surface IS at Z=0 and bb.min.z() is // already folded into m_belt_min_z, so use 0. const auto &pcfg = this->print()->config(); - bool has_preslice_remap = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || - int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || - int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); - double belt_surface_z = has_preslice_remap - ? belt_remapped_bbox(*this->model_object(), pcfg).min.z() : 0.; + double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) + ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; m_slicing_params.belt_floor_z_shift = belt_surface_z + z_shift_val; } @@ -1025,18 +888,6 @@ void PrintObject::slice() << " belt_shear_z_global=" << pcfg.belt_shear_z_global.value << " object=" << this->model_object()->name; if (pcfg.belt_printer.value) { - auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } - }; Point inst_shift = this->instances().empty() ? Point(0, 0) : this->instances().front().shift - this->center_offset(); @@ -1058,7 +909,7 @@ void PrintObject::slice() // PrintObjects so the lowest-positioned object stays at Z=0. const auto &za = gaxes[2]; // Z row if (za.global && za.mode != BeltShearMode::None && za.from < 2) { - double factor = compute_shear_factor(za.mode, za.angle); + double factor = BeltTransformPipeline::compute_shear_factor(za.mode, za.angle); // The global Z offset accounts for the instance's position- // dependent shear contribution. m_belt_min_z is the minimum Z // of the mesh after pre_remap + shear + trafo_centered, which @@ -1066,12 +917,8 @@ void PrintObject::slice() // Subtract the belt surface's centered Z position so we get // only the shear-induced contribution (same correction as the // belt_floor_z_shift fix). - // Same pre-remap guard as belt_floor_z_shift above. - bool has_preslice_remap2 = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || - int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || - int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); - double belt_surface_z = has_preslice_remap2 - ? belt_remapped_bbox(*this->model_object(), this->print()->config()).min.z() : 0.; + double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) + ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; double shear_min_z = m_belt_min_z - belt_surface_z; Point phys = inst_shift; // already has center_offset subtracted double center_on_axis = (za.from == 0) ? unscale(phys.x()) : unscale(phys.y()); diff --git a/src/libslic3r/Support/BeltFloorContext.cpp b/src/libslic3r/Support/BeltFloorContext.cpp new file mode 100644 index 0000000000..d2ffcfd397 --- /dev/null +++ b/src/libslic3r/Support/BeltFloorContext.cpp @@ -0,0 +1,124 @@ +#include "BeltFloorContext.hpp" + +#include +#include + +namespace Slic3r { + +bool BeltFloorContext::init(const SlicingParameters &sp, const PrintConfig &pcfg) +{ + m_active = false; + m_shear_factor = sp.belt_floor_shear_factor; + m_from_axis = sp.belt_floor_from_axis; + m_z_shift = sp.belt_floor_z_shift; + m_floor_offset = pcfg.belt_support_floor_offset.value; + + if (std::abs(m_shear_factor) < EPSILON) + return false; + + m_active = true; + return true; +} + +bool BeltFloorContext::init_local(const SlicingParameters &sp, const PrintConfig &pcfg, + double global_z_offset) +{ + if (!init(sp, pcfg)) + return false; + // Local Z: subtract the global Z offset so polygon computation + // works in the object's local coordinate space. + m_z_shift -= global_z_offset; + return true; +} + +Polygons BeltFloorContext::surface_polygon(coordf_t print_z) const +{ + return half_plane(print_z, /*belt_surface=*/true); +} + +Polygons BeltFloorContext::valid_region_polygon(coordf_t print_z) const +{ + return half_plane(print_z, /*belt_surface=*/false); +} + +double BeltFloorContext::floor_print_z(const Point &pos_slicing) const +{ + if (!m_active) + return -std::numeric_limits::infinity(); + double pos = unscale(m_from_axis == 0 ? pos_slicing.x() : pos_slicing.y()); + return m_shear_factor * pos + m_floor_offset + m_z_shift; +} + +std::vector BeltFloorContext::compute_per_layer_floors( + size_t num_layers, + const std::function &layer_print_z) const +{ + std::vector result(num_layers); + if (!m_active) + return result; + for (size_t i = 0; i < num_layers; ++i) + result[i] = surface_polygon(layer_print_z(i)); + return result; +} + +Polygons BeltFloorContext::half_plane(coordf_t print_z, bool belt_surface) const +{ + if (!m_active) + return {}; + + const double cutoff = (print_z - m_z_shift - m_floor_offset) / m_shear_factor; + const coord_t cutoff_scaled = scale_(cutoff); + const coord_t large_bound = scale_(1e3); + + // The belt surface is on one side of the cutoff line; the valid region + // is on the other side. Which side depends on shear_factor sign. + // + // belt_surface=true → the belt side (where support should NOT exist) + // belt_surface=false → the valid side (where support IS allowed) + // + // For shear_factor > 0: belt surface is from_axis >= cutoff + // For shear_factor < 0: belt surface is from_axis <= cutoff + bool high_side = (m_shear_factor > 0) == belt_surface; + + Polygon poly; + if (m_from_axis == 0) { + if (high_side) { + // X >= cutoff + poly.points = { + Point(cutoff_scaled, -large_bound), + Point(large_bound, -large_bound), + Point(large_bound, large_bound), + Point(cutoff_scaled, large_bound) + }; + } else { + // X < cutoff + poly.points = { + Point(-large_bound, -large_bound), + Point(cutoff_scaled, -large_bound), + Point(cutoff_scaled, large_bound), + Point(-large_bound, large_bound) + }; + } + } else { + if (high_side) { + // Y >= cutoff + poly.points = { + Point(-large_bound, cutoff_scaled), + Point( large_bound, cutoff_scaled), + Point( large_bound, large_bound), + Point(-large_bound, large_bound) + }; + } else { + // Y < cutoff + poly.points = { + Point(-large_bound, -large_bound), + Point( large_bound, -large_bound), + Point( large_bound, cutoff_scaled), + Point(-large_bound, cutoff_scaled) + }; + } + } + return { poly }; +} + +} // namespace Slic3r diff --git a/src/libslic3r/Support/BeltFloorContext.hpp b/src/libslic3r/Support/BeltFloorContext.hpp new file mode 100644 index 0000000000..7b8b704ef6 --- /dev/null +++ b/src/libslic3r/Support/BeltFloorContext.hpp @@ -0,0 +1,74 @@ +#pragma once + +#include "../libslic3r.h" +#include "../Point.hpp" +#include "../Polygon.hpp" +#include "../Slicing.hpp" +#include "../PrintConfig.hpp" + +namespace Slic3r { + +class PrintObject; + +// Belt floor context: encapsulates the parameters and polygon computation +// for belt printer floor clipping in support generation. +// +// All belt floor code across SupportMaterial, TreeSupport, TreeSupport3D, +// and TreeModelVolumes uses the same 4 parameters and the same 4-case +// polygon construction. This class consolidates that logic. +// +// Construct once per PrintObject, then call surface_polygon() or +// valid_region_polygon() per layer with the layer's print_z. +class BeltFloorContext +{ +public: + BeltFloorContext() = default; + + // Initialize from slicing parameters and print config. + // Uses global Z coordinates (for SupportMaterial, non-organic TreeSupport). + bool init(const SlicingParameters &sp, const PrintConfig &pcfg); + + // Initialize with a Z offset subtracted from z_shift. + // Uses local Z coordinates (for TreeSupport3D, TreeModelVolumes organic pipeline). + bool init_local(const SlicingParameters &sp, const PrintConfig &pcfg, + double global_z_offset); + + bool is_active() const { return m_active; } + + // Compute the belt-side half-plane polygon at a given print_z. + // This is the region where the belt surface exists. + Polygons surface_polygon(coordf_t print_z) const; + + // Compute the valid-region half-plane polygon at a given print_z. + // This is the complement: the region where support is allowed. + Polygons valid_region_polygon(coordf_t print_z) const; + + // Compute the belt floor Z position at a given XY position (in slicing coords). + // Returns -infinity if not active. + double floor_print_z(const Point &pos_slicing) const; + + // Pre-compute belt floor polygons for a range of layers. + // layer_print_z(i) returns the print_z for layer index i. + std::vector compute_per_layer_floors( + size_t num_layers, + const std::function &layer_print_z) const; + + // Accessors + double shear_factor() const { return m_shear_factor; } + int from_axis() const { return m_from_axis; } + double z_shift() const { return m_z_shift; } + double floor_offset() const { return m_floor_offset; } + +private: + bool m_active = false; + double m_shear_factor = 0.0; + int m_from_axis = 1; // 0=X, 1=Y + double m_z_shift = 0.0; + double m_floor_offset = 0.0; + + // Internal: compute the raw half-plane polygon. + // If belt_surface=true, returns the belt side; otherwise the valid (complement) side. + Polygons half_plane(coordf_t print_z, bool belt_surface) const; +}; + +} // namespace Slic3r diff --git a/src/libslic3r/Support/SupportMaterial.cpp b/src/libslic3r/Support/SupportMaterial.cpp index d70153a7dd..c1f732bc6d 100644 --- a/src/libslic3r/Support/SupportMaterial.cpp +++ b/src/libslic3r/Support/SupportMaterial.cpp @@ -5,6 +5,7 @@ #include "Print.hpp" #include "SupportMaterial.hpp" #include "SupportCommon.hpp" +#include "BeltFloorContext.hpp" #include "Geometry.hpp" #include "Point.hpp" #include "MutablePolygon.hpp" @@ -625,64 +626,10 @@ Polygons belt_floor_surface_polygon( const PrintObject &object, coordf_t print_z) { - const double shear_factor = slicing_params.belt_floor_shear_factor; - if (std::abs(shear_factor) < EPSILON) + BeltFloorContext ctx; + if (!ctx.init(slicing_params, print_config)) return {}; - - const int from_axis = slicing_params.belt_floor_from_axis; // 0=X, 1=Y - const double floor_offset = print_config.belt_support_floor_offset.value; - - // Belt floor line in slicing coordinates: Z = sf * Y + z_shift. - // z_shift accounts for the upward shift applied when post-shear geometry - // extends below the bed (overhangs). Solving for Y: - // cutoff = (print_z - z_shift - floor_offset) / sf - const double z_shift = slicing_params.belt_floor_z_shift; - const double cutoff = (print_z - z_shift - floor_offset) / shear_factor; - const coord_t cutoff_scaled = scale_(cutoff); - const coord_t large_bound = scale_(1e4); - - // Build the belt-side half-plane (inverted from the valid region). - // If shear_factor > 0: valid region is from_axis < cutoff, so belt surface is from_axis >= cutoff. - // If shear_factor < 0: valid region is from_axis > cutoff, so belt surface is from_axis <= cutoff. - Polygon belt_poly; - if (from_axis == 0) { - if (shear_factor > 0) { - // Belt surface: X >= cutoff - belt_poly.points = { - Point(cutoff_scaled, -large_bound), - Point(large_bound, -large_bound), - Point(large_bound, large_bound), - Point(cutoff_scaled, large_bound) - }; - } else { - // Belt surface: X <= cutoff - belt_poly.points = { - Point(-large_bound, -large_bound), - Point(cutoff_scaled, -large_bound), - Point(cutoff_scaled, large_bound), - Point(-large_bound, large_bound) - }; - } - } else { - if (shear_factor > 0) { - // Belt surface: Y >= cutoff - belt_poly.points = { - Point(-large_bound, cutoff_scaled), - Point( large_bound, cutoff_scaled), - Point( large_bound, large_bound), - Point(-large_bound, large_bound) - }; - } else { - // Belt surface: Y <= cutoff - belt_poly.points = { - Point(-large_bound, -large_bound), - Point( large_bound, -large_bound), - Point( large_bound, cutoff_scaled), - Point(-large_bound, cutoff_scaled) - }; - } - } - return { belt_poly }; + return ctx.surface_polygon(print_z); } // Belt printer: compute the valid-region half-plane polygon at a given print_z. @@ -694,58 +641,10 @@ static Polygons belt_floor_valid_region_polygon( const PrintObject &object, coordf_t print_z) { - const double shear_factor = slicing_params.belt_floor_shear_factor; - if (std::abs(shear_factor) < EPSILON) + BeltFloorContext ctx; + if (!ctx.init(slicing_params, print_config)) return {}; - - const int from_axis = slicing_params.belt_floor_from_axis; - const double floor_offset = print_config.belt_support_floor_offset.value; - - const double z_shift = slicing_params.belt_floor_z_shift; - const double cutoff = (print_z - z_shift - floor_offset) / shear_factor; - const coord_t cutoff_scaled = scale_(cutoff); - const coord_t large_bound = scale_(1e4); - - // Valid region: the complement of the belt surface polygon. - Polygon valid_poly; - if (from_axis == 0) { - if (shear_factor > 0) { - // Valid: X < cutoff - valid_poly.points = { - Point(-large_bound, -large_bound), - Point(cutoff_scaled, -large_bound), - Point(cutoff_scaled, large_bound), - Point(-large_bound, large_bound) - }; - } else { - // Valid: X > cutoff - valid_poly.points = { - Point(cutoff_scaled, -large_bound), - Point(large_bound, -large_bound), - Point(large_bound, large_bound), - Point(cutoff_scaled, large_bound) - }; - } - } else { - if (shear_factor > 0) { - // Valid: Y < cutoff - valid_poly.points = { - Point(-large_bound, -large_bound), - Point( large_bound, -large_bound), - Point( large_bound, cutoff_scaled), - Point(-large_bound, cutoff_scaled) - }; - } else { - // Valid: Y > cutoff - valid_poly.points = { - Point(-large_bound, cutoff_scaled), - Point( large_bound, cutoff_scaled), - Point( large_bound, large_bound), - Point(-large_bound, large_bound) - }; - } - } - return { valid_poly }; + return ctx.valid_region_polygon(print_z); } // Collect outer contours of all slices of this layer. @@ -3373,22 +3272,18 @@ static void trim_support_layers_by_belt_floor( const PrintObject &object, SupportGeneratorLayersPtr &support_layers) { - if (std::abs(slicing_params.belt_floor_shear_factor) < EPSILON) + BeltFloorContext ctx; + if (!ctx.init(slicing_params, print_config)) return; if (print_config.belt_support_floor_mode.value != BeltSupportFloorMode::GeneratorOnly) return; tbb::parallel_for(tbb::blocked_range(0, support_layers.size()), [&](const tbb::blocked_range &range) { - for (size_t i = range.begin(); i < range.end(); ++ i) { - SupportGeneratorLayer *layer = support_layers[i]; - if (layer->polygons.empty()) - continue; - Polygons belt_surface = belt_floor_surface_polygon( - slicing_params, print_config, object, layer->print_z); - if (! belt_surface.empty()) - layer->polygons = diff(layer->polygons, belt_surface); - } + for (size_t i = range.begin(); i < range.end(); ++i) + if (support_layers[i]) + support_layers[i]->polygons = diff(support_layers[i]->polygons, + ctx.surface_polygon(support_layers[i]->print_z)); }); } diff --git a/src/libslic3r/Support/TreeModelVolumes.cpp b/src/libslic3r/Support/TreeModelVolumes.cpp index ec38ffed73..ebc3d2c958 100644 --- a/src/libslic3r/Support/TreeModelVolumes.cpp +++ b/src/libslic3r/Support/TreeModelVolumes.cpp @@ -8,6 +8,7 @@ #include "TreeModelVolumes.hpp" #include "TreeSupportCommon.hpp" +#include "BeltFloorContext.hpp" #include "../BuildVolume.hpp" #include "../ClipperUtils.hpp" @@ -101,13 +102,11 @@ TreeModelVolumes::TreeModelVolumes( { const auto &sp = print_object.slicing_parameters(); const auto &pcfg = print_object.print()->config(); - const double sf = sp.belt_floor_shear_factor; - if (std::abs(sf) > EPSILON + BeltFloorContext ctx; + ctx.init_local(sp, pcfg, print_object.belt_global_z_offset()); + if (ctx.is_active() && std::abs(print_object.belt_global_z_offset()) > EPSILON && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { - const int from_axis = sp.belt_floor_from_axis; - const double floor_off = pcfg.belt_support_floor_offset.value; - const double z_shift = sp.belt_floor_z_shift - print_object.belt_global_z_offset(); size_t num_layers_needed = print_object.layer_count(); // Ensure m_anti_overhang is large enough. if (m_anti_overhang.size() < num_layers_needed) @@ -115,22 +114,7 @@ TreeModelVolumes::TreeModelVolumes( for (size_t layer_idx = 0; layer_idx < num_layers_needed; ++layer_idx) { double print_z = print_object.get_layer(layer_idx)->print_z - print_object.belt_global_z_offset(); - double cutoff = (print_z - z_shift - floor_off) / sf; - coord_t cutoff_sc = scale_(cutoff); - coord_t big = scale_(1e4); - Polygon belt_poly; - if (from_axis == 0) { - if (sf > 0) - belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; - else - belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; - } else { - if (sf > 0) - belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; - else - belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; - } - append(m_anti_overhang[layer_idx], Polygons{belt_poly}); + append(m_anti_overhang[layer_idx], ctx.surface_polygon(print_z)); } } } @@ -180,40 +164,20 @@ TreeModelVolumes::TreeModelVolumes( // Branches grow toward the belt and their slices are clipped at the belt // surface in organic_draw_branches(). The organic pipeline works in LOCAL // Z (no global_z_offset), so use local z_shift and local print_z. - const auto &slicing_params = print_object.slicing_parameters(); - const auto &pcfg = print_object.print()->config(); - const double sf = slicing_params.belt_floor_shear_factor; - if (std::abs(sf) > EPSILON - && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { - const int from_axis = slicing_params.belt_floor_from_axis; - const double floor_off = pcfg.belt_support_floor_offset.value; - // Subtract global_z_offset to get the LOCAL z_shift — the organic - // pipeline's Z coordinates don't include the global offset. - const double z_shift = slicing_params.belt_floor_z_shift - - print_object.belt_global_z_offset(); - m_belt_floor.assign(num_layers, Polygons{}); - for (size_t layer_idx = 0; layer_idx < num_layers; ++layer_idx) { - // Use local print_z (subtract global offset from object layer). - double print_z = (layer_idx >= num_raft_layers) - ? print_object.get_layer(layer_idx - num_raft_layers)->print_z - - print_object.belt_global_z_offset() - : 0.; - double cutoff = (print_z - z_shift - floor_off) / sf; - coord_t cutoff_sc = scale_(cutoff); - coord_t big = scale_(1e4); - Polygon belt_poly; - if (from_axis == 0) { - if (sf > 0) - belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; - else - belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; - } else { - if (sf > 0) - belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; - else - belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; - } - m_belt_floor[layer_idx] = { belt_poly }; + { + const auto &slicing_params = print_object.slicing_parameters(); + const auto &pcfg2 = print_object.print()->config(); + BeltFloorContext ctx; + ctx.init_local(slicing_params, pcfg2, print_object.belt_global_z_offset()); + if (ctx.is_active() + && pcfg2.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + m_belt_floor = ctx.compute_per_layer_floors(num_layers, [&](size_t layer_idx) -> double { + // Use local print_z (subtract global offset from object layer). + return (layer_idx >= num_raft_layers) + ? print_object.get_layer(layer_idx - num_raft_layers)->print_z + - print_object.belt_global_z_offset() + : 0.; + }); } } } diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 60e681add9..6c359115da 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -14,6 +14,7 @@ #include "TreeSupportCommon.hpp" #include "TreeSupport.hpp" #include "TreeSupport3D.hpp" +#include "BeltFloorContext.hpp" #include #include @@ -639,16 +640,10 @@ TreeSupport::TreeSupport(PrintObject& object, const SlicingParameters &slicing_p double TreeSupport::belt_floor_print_z(const Point &pos_slicing) const { - double sf = m_slicing_params.belt_floor_shear_factor; - if (std::abs(sf) < EPSILON) - return -std::numeric_limits::max(); // no belt floor - int from = m_slicing_params.belt_floor_from_axis; - // Belt floor in slicing coords: Z = sf * Y + z_shift + floor_offset. - // Inverse of cutoff = (Z - z_shift - floor_offset) / sf. - double pos = unscale(from == 0 ? pos_slicing.x() : pos_slicing.y()); - double floor_offset = m_print_config->belt_support_floor_offset.value; - double z_shift = m_slicing_params.belt_floor_z_shift; - return sf * pos + floor_offset + z_shift; + BeltFloorContext ctx; + if (!ctx.init(m_slicing_params, *m_print_config)) + return -std::numeric_limits::infinity(); + return ctx.floor_print_z(pos_slicing); } #define SUPPORT_SURFACES_OFFSET_PARAMETERS ClipperLib::jtSquare, 0. @@ -1738,18 +1733,11 @@ void TreeSupport::generate() // layer and clipped at the belt surface. These layers bypass the tree // algorithm entirely — they're pure geometry added after draw_circles(). { - const auto &sp = m_slicing_params; - const auto &pcfg = *m_print_config; - const double sf = sp.belt_floor_shear_factor; - if (std::abs(sf) > EPSILON - && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly + BeltFloorContext ctx; + if (ctx.init(m_slicing_params, *m_print_config) + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly && m_object->support_layer_count() > 0) { - const int from_axis = sp.belt_floor_from_axis; - const double floor_off = pcfg.belt_support_floor_offset.value; - // Support layer print_z values are in GLOBAL Z (non-organic inherits - // from object layers which include global_z_offset). Use the GLOBAL - // belt_floor_z_shift to match. - const double z_shift = sp.belt_floor_z_shift; + const auto &sp = m_slicing_params; // Find the lowest non-empty, non-brim support layer. ExPolygons source_areas; double source_z = 0; @@ -1778,7 +1766,7 @@ void TreeSupport::generate() } if (!source_areas.empty()) { BoundingBoxf3 bb = belt_remapped_bbox(*m_object->model_object(), m_object->print()->config()); - double from_extent = std::abs(bb.min(from_axis)); + double from_extent = std::abs(bb.min(ctx.from_axis())); double bb_min_z = std::abs(bb.min.z()); double first_z = m_object->get_support_layer(0)->print_z; // Depth = from-axis extent + pre-shear bbox Z offset (ensure_on_bed @@ -1792,18 +1780,8 @@ void TreeSupport::generate() for (int i = num_extra; i >= 1 && !prev_areas.empty(); --i) { double print_z = first_z - i * sp.layer_height; if (print_z < -sp.layer_height) continue; - double cutoff = (print_z - z_shift - floor_off) / sf; - coord_t cutoff_sc = scale_(cutoff); - coord_t big = scale_(1e3); - Polygon belt_poly; - if (from_axis == 0) { - if (sf > 0) belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; - else belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; - } else { - if (sf > 0) belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; - else belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; - } - ExPolygons clipped = diff_ex(source_areas, Polygons{belt_poly}); + Polygons belt_surface = ctx.surface_polygon(print_z); + ExPolygons clipped = diff_ex(source_areas, belt_surface); if (clipped.empty()) continue; SupportLayer *sl = new SupportLayer(0, 0, m_object, sp.layer_height, print_z, -1); sl->base_areas = clipped; @@ -2250,37 +2228,19 @@ void TreeSupport::draw_circles() // Belt floor: clip tree support polygons by the belt surface plane. // ts_layer->print_z is at LOCAL Z (global offset applied later in - // _generate_support_material), but belt_floor_z_shift includes - // global_z_offset — subtract it to get the cutoff in local coords. - if (std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON - && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { - const double sf = m_slicing_params.belt_floor_shear_factor; - const int from_axis = m_slicing_params.belt_floor_from_axis; - const double floor_off = m_print_config->belt_support_floor_offset.value; - const double z_shift_local = m_slicing_params.belt_floor_z_shift - - m_object->belt_global_z_offset(); - const double cutoff = (ts_layer->print_z - z_shift_local - floor_off) / sf; - const coord_t cutoff_sc = scale_(cutoff); - const coord_t big = scale_(1e4); - - Polygon belt_poly; - if (from_axis == 0) { - if (sf > 0) - belt_poly.points = { {cutoff_sc,-big}, {big,-big}, {big,big}, {cutoff_sc,big} }; - else - belt_poly.points = { {-big,-big}, {cutoff_sc,-big}, {cutoff_sc,big}, {-big,big} }; - } else { - if (sf > 0) - belt_poly.points = { {-big,cutoff_sc}, {big,cutoff_sc}, {big,big}, {-big,big} }; - else - belt_poly.points = { {-big,-big}, {big,-big}, {big,cutoff_sc}, {-big,cutoff_sc} }; + // _generate_support_material), so use init_local to subtract + // belt_global_z_offset from z_shift. + { + BeltFloorContext ctx; + if (ctx.init_local(m_slicing_params, *m_print_config, m_object->belt_global_z_offset()) + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + Polygons belt_surface = ctx.surface_polygon(ts_layer->print_z); + base_areas = diff_ex(base_areas, belt_surface); + roof_areas = diff_ex(roof_areas, belt_surface); + roof_1st_layer = diff_ex(roof_1st_layer, belt_surface); + floor_areas = diff_ex(floor_areas, belt_surface); + roof_gap_areas = diff_ex(roof_gap_areas, belt_surface); } - Polygons belt_surface = { belt_poly }; - base_areas = diff_ex(base_areas, belt_surface); - roof_areas = diff_ex(roof_areas, belt_surface); - roof_1st_layer = diff_ex(roof_1st_layer, belt_surface); - floor_areas = diff_ex(floor_areas, belt_surface); - roof_gap_areas = diff_ex(roof_gap_areas, belt_surface); } if (SQUARE_SUPPORT) { @@ -3593,6 +3553,20 @@ TreeSupportData::TreeSupportData(const PrintObject &object, coordf_t xy_distance poly.simplify(scale_(m_radius_sample_resolution), &outline); } + // Belt floor: add belt surface polygon to layer outlines so the + // collision system treats the belt as a physical surface. + { + BeltFloorContext ctx; + double local_print_z = layer->print_z - object.belt_global_z_offset(); + if (ctx.init_local(object.slicing_parameters(), object.print()->config(), + object.belt_global_z_offset()) + && object.print()->config().belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + Polygons belt_surface = ctx.surface_polygon(local_print_z); + for (auto &p : belt_surface) + outline.emplace_back(ExPolygon(p)); + } + } + if (layer_nr == 0) m_layer_outlines_below.push_back(outline); else diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index 9d35cb2dd8..8a07609930 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -19,6 +19,7 @@ #include "Polygon.hpp" #include "Polyline.hpp" #include "MutablePolygon.hpp" +#include "BeltFloorContext.hpp" #include "SupportCommon.hpp" #include "TriangleMeshSlicer.hpp" #include "TreeSupport.hpp" @@ -3373,8 +3374,9 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons PrintObject &po = *print.get_object(processing.second.front()); const auto &sp = po.slicing_parameters(); const auto &pcfg = po.print()->config(); - const double sf = sp.belt_floor_shear_factor; - if (std::abs(sf) > EPSILON && std::abs(po.belt_global_z_offset()) > EPSILON + BeltFloorContext ctx; + ctx.init_local(sp, pcfg, po.belt_global_z_offset()); + if (ctx.is_active() && std::abs(po.belt_global_z_offset()) > EPSILON && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { // z_shift_local is the belt surface height at Y=0 in local coords. // Extend below the belt so the base expansion and build-plate @@ -3598,32 +3600,16 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons // Compute the belt floor polygon directly from each layer's print_z // rather than mapping to a layer index (avoids index mismatch issues). { - const auto &sp = print_object.slicing_parameters(); - const double sf = sp.belt_floor_shear_factor; - const double z_shift = sp.belt_floor_z_shift - print_object.belt_global_z_offset(); - const double floor_off = print_object.print()->config().belt_support_floor_offset.value; - const int from_axis = sp.belt_floor_from_axis; - if (std::abs(sf) > EPSILON - && print_object.print()->config().belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + const auto &sp = print_object.slicing_parameters(); + const auto &pcfg = print_object.print()->config(); + BeltFloorContext ctx; + ctx.init_local(sp, pcfg, print_object.belt_global_z_offset()); + if (ctx.is_active() + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { tbb::parallel_for_each(layers_sorted.begin(), layers_sorted.end(), [&](SupportGeneratorLayer *layer) { if (!layer || layer->polygons.empty()) return; - double cutoff = (layer->print_z - z_shift - floor_off) / sf; - coord_t cutoff_sc = scale_(cutoff); - coord_t big = scale_(1e4); - Polygon belt_poly; - if (from_axis == 0) { - if (sf > 0) - belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; - else - belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; - } else { - if (sf > 0) - belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; - else - belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; - } - layer->polygons = diff(layer->polygons, Polygons{belt_poly}); + layer->polygons = diff(layer->polygons, ctx.surface_polygon(layer->print_z)); }); } } From 44eebdb8ad0d0869c1aa4a58b5a27425ae46d81f Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 28 Mar 2026 02:13:15 -0500 Subject: [PATCH 008/389] Part 3.2: decouple axis remapping, enable viewing settings in Developer mode or when Belt mode is active --- src/libslic3r/BeltGCode.cpp | 14 ++---- src/libslic3r/BeltGCodeWriter.cpp | 25 ++-------- src/libslic3r/BeltGCodeWriter.hpp | 8 +--- src/libslic3r/BeltSliceStrategy.cpp | 15 ++---- src/libslic3r/BeltSliceStrategy.hpp | 10 ++-- src/libslic3r/BeltTransform.cpp | 18 ++++---- src/libslic3r/BeltTransform.hpp | 14 +++--- src/libslic3r/GCode.cpp | 13 ++++++ src/libslic3r/GCode/BeltBackTransform.cpp | 2 +- src/libslic3r/GCode/BeltBackTransform.hpp | 2 +- src/libslic3r/GCode/GCodeProcessor.cpp | 34 +++++++------- src/libslic3r/GCode/GCodeProcessor.hpp | 12 ++--- src/libslic3r/GCodeWriter.cpp | 56 +++++++++++++++++++++-- src/libslic3r/GCodeWriter.hpp | 15 ++++++ src/libslic3r/Preset.cpp | 4 +- src/libslic3r/Print.cpp | 12 ++--- src/libslic3r/PrintConfig.cpp | 52 ++++++++++----------- src/libslic3r/PrintConfig.hpp | 18 ++++---- src/libslic3r/PrintObjectSlice.cpp | 24 +++++++++- src/slic3r/GUI/Tab.cpp | 21 +++++---- 20 files changed, 215 insertions(+), 154 deletions(-) diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index dc1b6ca439..40dabf98dc 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -15,13 +15,7 @@ void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) auto belt_writer = std::make_unique(); belt_writer->set_is_bbl_machine(is_bbl_printers); belt_writer->set_belt_angle(print.config().belt_printer_angle.value); - belt_writer->set_axis_remap( - int(print.config().belt_gcode_remap_x.value), - int(print.config().belt_gcode_remap_y.value), - int(print.config().belt_gcode_remap_z.value)); - BoundingBoxf bbox_bed(print.config().printable_area.values); - belt_writer->set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), - print.config().printable_height.value)); + // Axis remap and build volume max are set by base GCode after init_belt_writer returns. belt_writer->set_belt_back_transform(print.config()); m_writer = std::move(belt_writer); @@ -59,9 +53,9 @@ void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); // Pre-slice remap configs - file.write_format("; belt_preslice_remap_x = %s\n", full_cfg.opt_serialize("belt_preslice_remap_x").c_str()); - file.write_format("; belt_preslice_remap_y = %s\n", full_cfg.opt_serialize("belt_preslice_remap_y").c_str()); - file.write_format("; belt_preslice_remap_z = %s\n", full_cfg.opt_serialize("belt_preslice_remap_z").c_str()); + file.write_format("; preslice_remap_x = %s\n", full_cfg.opt_serialize("preslice_remap_x").c_str()); + file.write_format("; preslice_remap_y = %s\n", full_cfg.opt_serialize("preslice_remap_y").c_str()); + file.write_format("; preslice_remap_z = %s\n", full_cfg.opt_serialize("preslice_remap_z").c_str()); } void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index 645bf85a5b..db2bc46fe1 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -10,18 +10,6 @@ void BeltGCodeWriter::set_belt_angle(double angle_deg) m_belt_angle_rad = Geometry::deg2rad(angle_deg); } -void BeltGCodeWriter::set_axis_remap(int rx, int ry, int rz) -{ - m_remap_x = rx; - m_remap_y = ry; - m_remap_z = rz; -} - -void BeltGCodeWriter::set_build_volume_max(const Vec3d &max) -{ - m_build_vol_max = max; -} - void BeltGCodeWriter::set_belt_back_transform(const PrintConfig &config) { m_belt_back_transform.init_from_config(config); @@ -40,16 +28,9 @@ Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const { // Step 1: Undo the shear/scale applied during slicing. Vec3d p = m_belt_back_transform.apply(pos); - // Step 2: Apply axis remapping for the machine's coordinate convention. - // BeltRemapAxis: 0-2 = +X/+Y/+Z, 3-5 = -X/-Y/-Z, 6-8 = Rev X/Y/Z - auto remap = [this, &p](int r) -> double { - int axis = r % 3; - if (r < 3) return p[axis]; - if (r < 6) return -p[axis]; - return m_build_vol_max[axis] - p[axis]; - }; - Vec3d result = { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; - // Per-axis origin snap: shift so bbox min on each enabled axis = offset. + // Step 2: Apply axis remap (uses inherited base class method). + Vec3d result = apply_axis_remap(p); + // Step 3: Per-axis origin snap. for (int i = 0; i < 3; ++i) if (m_origin_snap[i]) result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); diff --git a/src/libslic3r/BeltGCodeWriter.hpp b/src/libslic3r/BeltGCodeWriter.hpp index 727135b578..a41f890503 100644 --- a/src/libslic3r/BeltGCodeWriter.hpp +++ b/src/libslic3r/BeltGCodeWriter.hpp @@ -15,11 +15,9 @@ class BeltGCodeWriter : public GCodeWriter public: BeltGCodeWriter() : GCodeWriter() {} - // Belt configuration + // Belt configuration (axis remap is inherited from GCodeWriter) void set_belt_angle(double angle_deg); bool is_belt_printer() const { return m_belt_angle_rad != 0.; } - void set_axis_remap(int rx, int ry, int rz); - void set_build_volume_max(const Vec3d &max); void set_belt_back_transform(const PrintConfig &config); void set_origin_snap(int axis, bool enable, double offset, double bbox_min); Vec3d to_machine_coords(const Vec3d &pos) const; @@ -37,10 +35,6 @@ protected: private: double m_belt_angle_rad = 0.; - int m_remap_x = 0; - int m_remap_y = 1; - int m_remap_z = 2; - Vec3d m_build_vol_max = Vec3d::Zero(); BeltBackTransform m_belt_back_transform; bool m_origin_snap[3] = {false, false, false}; double m_origin_offset[3] = {0., 0., 0.}; diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp index b3adeec64a..c1a300869e 100644 --- a/src/libslic3r/BeltSliceStrategy.cpp +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -13,31 +13,24 @@ std::unique_ptr BeltSliceStrategy::create(const PrintConfig & BeltSliceStrategy::BeltSliceStrategy(const PrintConfig &config) { - m_has_remap = BeltTransformPipeline::has_preslice_remap(config); - if (m_has_remap) - m_pre_remap = BeltTransformPipeline::build_preslice_remap(config); - m_shear = BeltTransformPipeline::build_shear_matrix(config, &m_has_shear); m_scale = BeltTransformPipeline::build_scale_matrix(config, &m_has_scale); } void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, const ModelVolumePtrs &model_volumes, + bool has_remap, double *out_belt_min_z) const { - // Step 1: Pre-slice axis remap. - if (m_has_remap) - trafo = m_pre_remap * trafo; - - // Step 2: Shear + scale. + // Shear + scale (belt-only; pre-slice remap is handled separately). if (m_has_shear || m_has_scale) { Transform3d belt_xform = Transform3d::Identity(); belt_xform.linear() = m_scale * m_shear; trafo = belt_xform * trafo; } - // Step 3: Z-shift — detect if mesh clips below build plate after transforms. - if (m_has_remap || m_has_shear || m_has_scale) { + // Z-shift — detect if mesh clips below build plate after transforms. + if (has_remap || m_has_shear || m_has_scale) { double min_z = std::numeric_limits::max(); for (const ModelVolume *mv : model_volumes) { if (!mv->is_model_part()) continue; diff --git a/src/libslic3r/BeltSliceStrategy.hpp b/src/libslic3r/BeltSliceStrategy.hpp index bf19243fd2..ef6e038ee7 100644 --- a/src/libslic3r/BeltSliceStrategy.hpp +++ b/src/libslic3r/BeltSliceStrategy.hpp @@ -23,21 +23,19 @@ public: // Create a strategy if belt_printer is enabled; returns nullptr otherwise. static std::unique_ptr create(const PrintConfig &config); - // Apply belt transforms to the slicing trafo. - // Modifies trafo in-place: trafo = z_shift * scale * shear * pre_remap * trafo - // Scans all model_part volumes to detect minimum Z and add z-shift if needed. - // Sets *out_belt_min_z to the minimum Z of the mesh after transforms. + // Apply belt-specific transforms (shear + scale + z-shift) to the slicing trafo. + // Pre-slice remap is handled separately (standalone feature). + // has_remap: whether pre-slice remap was already applied (affects z-shift detection). void apply_to_trafo(Transform3d &trafo, const ModelVolumePtrs &model_volumes, + bool has_remap, double *out_belt_min_z) const; private: explicit BeltSliceStrategy(const PrintConfig &config); - bool m_has_remap = false; bool m_has_shear = false; bool m_has_scale = false; - Transform3d m_pre_remap = Transform3d::Identity(); Matrix3d m_shear = Matrix3d::Identity(); Matrix3d m_scale = Matrix3d::Identity(); }; diff --git a/src/libslic3r/BeltTransform.cpp b/src/libslic3r/BeltTransform.cpp index db7eea7d80..9bb66fcfb6 100644 --- a/src/libslic3r/BeltTransform.cpp +++ b/src/libslic3r/BeltTransform.cpp @@ -13,9 +13,9 @@ Transform3d BeltTransformPipeline::build_preslice_remap(const PrintConfig &confi if (!has_preslice_remap(config)) return pre_remap; - int pre_rx = int(config.belt_preslice_remap_x.value); - int pre_ry = int(config.belt_preslice_remap_y.value); - int pre_rz = int(config.belt_preslice_remap_z.value); + int pre_rx = int(config.preslice_remap_x.value); + int pre_ry = int(config.preslice_remap_y.value); + int pre_rz = int(config.preslice_remap_z.value); // Each remap value selects a source axis and sign. auto remap_column = [](int r) -> Vec3d { @@ -114,13 +114,13 @@ Transform3d BeltTransformPipeline::build_forward_transform(const PrintConfig &co BoundingBoxf3 BeltTransformPipeline::remap_bbox(const BoundingBoxf3 &bb, const PrintConfig &config) { - int pre_rx = int(config.belt_preslice_remap_x.value); - int pre_ry = int(config.belt_preslice_remap_y.value); - int pre_rz = int(config.belt_preslice_remap_z.value); + int pre_rx = int(config.preslice_remap_x.value); + int pre_ry = int(config.preslice_remap_y.value); + int pre_rz = int(config.preslice_remap_z.value); - if (pre_rx == int(BeltRemapAxis::PosX) && - pre_ry == int(BeltRemapAxis::PosY) && - pre_rz == int(BeltRemapAxis::PosZ)) + if (pre_rx == int(RemapAxis::PosX) && + pre_ry == int(RemapAxis::PosY) && + pre_rz == int(RemapAxis::PosZ)) return bb; // Identity remap. auto remap_coord = [](int r, const Vec3d &v) -> double { diff --git a/src/libslic3r/BeltTransform.hpp b/src/libslic3r/BeltTransform.hpp index b9a60473e5..3c0665c252 100644 --- a/src/libslic3r/BeltTransform.hpp +++ b/src/libslic3r/BeltTransform.hpp @@ -58,21 +58,21 @@ public: static bool has_preslice_remap(const PrintConfig &config) { - return int(config.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || - int(config.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || - int(config.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ); + return int(config.preslice_remap_x.value) != int(RemapAxis::PosX) || + int(config.preslice_remap_y.value) != int(RemapAxis::PosY) || + int(config.preslice_remap_z.value) != int(RemapAxis::PosZ); } // Overload accepting DynamicPrintConfig (used in static slicing_parameters). static bool has_preslice_remap(const DynamicPrintConfig &config) { auto get_int = [&](const char *key) -> int { - auto *opt = config.option>(key); + auto *opt = config.option>(key); return opt ? int(opt->value) : 0; }; - return get_int("belt_preslice_remap_x") != int(BeltRemapAxis::PosX) || - get_int("belt_preslice_remap_y") != int(BeltRemapAxis::PosY) || - get_int("belt_preslice_remap_z") != int(BeltRemapAxis::PosZ); + return get_int("preslice_remap_x") != int(RemapAxis::PosX) || + get_int("preslice_remap_y") != int(RemapAxis::PosY) || + get_int("preslice_remap_z") != int(RemapAxis::PosZ); } static bool has_shear(const PrintConfig &config) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index c8b6e540cf..514efc4b52 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2425,6 +2425,19 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Belt printer: initialize belt-specific writer via virtual hook. this->init_belt_writer(print, is_bbl_printers); + // Standalone axis remap (works with or without belt mode). + { + int rx = int(print.config().gcode_remap_x.value); + int ry = int(print.config().gcode_remap_y.value); + int rz = int(print.config().gcode_remap_z.value); + if (rx != 0 || ry != 1 || rz != 2) { + m_writer->set_axis_remap(rx, ry, rz); + BoundingBoxf bbox_bed(print.config().printable_area.values); + m_writer->set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), + print.config().printable_height.value)); + } + } + // How many times will be change_layer() called? // change_layer() in turn increments the progress bar status. m_layer_count = 0; diff --git a/src/libslic3r/GCode/BeltBackTransform.cpp b/src/libslic3r/GCode/BeltBackTransform.cpp index 2e2cd26f75..b9cdac779f 100644 --- a/src/libslic3r/GCode/BeltBackTransform.cpp +++ b/src/libslic3r/GCode/BeltBackTransform.cpp @@ -8,7 +8,7 @@ bool BeltBackTransform::init_from_config(const PrintConfig &config) m_active = false; m_inverse = Transform3d::Identity(); - if (!config.belt_printer.value || !config.belt_gcode_back_transform.value) + if (!config.belt_printer.value || !config.gcode_back_transform.value) return false; // Require at least one active transform to proceed. diff --git a/src/libslic3r/GCode/BeltBackTransform.hpp b/src/libslic3r/GCode/BeltBackTransform.hpp index 5a75d94dc8..b98770c688 100644 --- a/src/libslic3r/GCode/BeltBackTransform.hpp +++ b/src/libslic3r/GCode/BeltBackTransform.hpp @@ -15,7 +15,7 @@ namespace Slic3r { // Initialized once from PrintConfig, then applied per-point in // GCodeWriter::to_machine_coords() before axis remapping. // -// Active when belt_gcode_back_transform is true AND at least one of: +// Active when gcode_back_transform is true AND at least one of: // - a shear axis has global mode enabled, or // - a pre-slice axis remap is non-identity. class BeltBackTransform diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 4c630bb6de..5e1bad0b69 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3129,26 +3129,26 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers try { m_result.belt_scale_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; } // Pre-slice axis remap - auto parse_remap_axis = [](const std::string &s) -> BeltRemapAxis { - if (s == "pos_x") return BeltRemapAxis::PosX; - if (s == "pos_y") return BeltRemapAxis::PosY; - if (s == "pos_z") return BeltRemapAxis::PosZ; - if (s == "neg_x") return BeltRemapAxis::NegX; - if (s == "neg_y") return BeltRemapAxis::NegY; - if (s == "neg_z") return BeltRemapAxis::NegZ; - if (s == "rev_x") return BeltRemapAxis::RevX; - if (s == "rev_y") return BeltRemapAxis::RevY; - if (s == "rev_z") return BeltRemapAxis::RevZ; - return BeltRemapAxis::PosX; + auto parse_remap_axis = [](const std::string &s) -> RemapAxis { + if (s == "pos_x") return RemapAxis::PosX; + if (s == "pos_y") return RemapAxis::PosY; + if (s == "pos_z") return RemapAxis::PosZ; + if (s == "neg_x") return RemapAxis::NegX; + if (s == "neg_y") return RemapAxis::NegY; + if (s == "neg_z") return RemapAxis::NegZ; + if (s == "rev_x") return RemapAxis::RevX; + if (s == "rev_y") return RemapAxis::RevY; + if (s == "rev_z") return RemapAxis::RevZ; + return RemapAxis::PosX; }; - if (boost::starts_with(comment, " belt_preslice_remap_x = ")) { - m_result.belt_preslice_remap_x = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + if (boost::starts_with(comment, " preslice_remap_x = ")) { + m_result.preslice_remap_x = parse_remap_axis(trim(std::string(comment.substr(25)))); return; } - if (boost::starts_with(comment, " belt_preslice_remap_y = ")) { - m_result.belt_preslice_remap_y = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + if (boost::starts_with(comment, " preslice_remap_y = ")) { + m_result.preslice_remap_y = parse_remap_axis(trim(std::string(comment.substr(25)))); return; } - if (boost::starts_with(comment, " belt_preslice_remap_z = ")) { - m_result.belt_preslice_remap_z = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + if (boost::starts_with(comment, " preslice_remap_z = ")) { + m_result.preslice_remap_z = parse_remap_axis(trim(std::string(comment.substr(25)))); return; } } // wipe start tag diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 7d08a9cdfd..4c6e4f6618 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -246,9 +246,9 @@ class Print; float belt_scale_y_angle{ 45.f }; BeltScaleMode belt_scale_z{ BeltScaleMode::None }; float belt_scale_z_angle{ 45.f }; - BeltRemapAxis belt_preslice_remap_x{ BeltRemapAxis::PosX }; - BeltRemapAxis belt_preslice_remap_y{ BeltRemapAxis::PosY }; - BeltRemapAxis belt_preslice_remap_z{ BeltRemapAxis::PosZ }; + RemapAxis preslice_remap_x{ RemapAxis::PosX }; + RemapAxis preslice_remap_y{ RemapAxis::PosY }; + RemapAxis preslice_remap_z{ RemapAxis::PosZ }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; @@ -324,9 +324,9 @@ class Print; belt_scale_y_angle = other.belt_scale_y_angle; belt_scale_z = other.belt_scale_z; belt_scale_z_angle = other.belt_scale_z_angle; - belt_preslice_remap_x = other.belt_preslice_remap_x; - belt_preslice_remap_y = other.belt_preslice_remap_y; - belt_preslice_remap_z = other.belt_preslice_remap_z; + preslice_remap_x = other.preslice_remap_x; + preslice_remap_y = other.preslice_remap_y; + preslice_remap_z = other.preslice_remap_z; #if ENABLE_GCODE_VIEWER_STATISTICS time = other.time; #endif diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index fea5509bc3..9b78ef1ea5 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -20,6 +20,36 @@ namespace Slic3r { bool GCodeWriter::full_gcode_comment = true; +void GCodeWriter::set_axis_remap(int rx, int ry, int rz) +{ + m_remap_x = rx; + m_remap_y = ry; + m_remap_z = rz; +} + +void GCodeWriter::set_build_volume_max(const Vec3d &max) +{ + m_build_vol_max = max; +} + +bool GCodeWriter::has_axis_remap() const +{ + return m_remap_x != 0 || m_remap_y != 1 || m_remap_z != 2; +} + +Vec3d GCodeWriter::apply_axis_remap(const Vec3d &pos) const +{ + if (!has_axis_remap()) + return pos; + auto remap = [this, &pos](int r) -> double { + int axis = r % 3; + if (r < 3) return pos[axis]; + if (r < 6) return -pos[axis]; + return m_build_vol_max[axis] - pos[axis]; + }; + return { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; +} + bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) { return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware); @@ -548,7 +578,13 @@ std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &com Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - w.emit_xy(point_on_plate); + if (has_axis_remap()) { + // Axis remap may couple XY with Z; emit full XYZ in machine coordinates. + Vec3d machine = apply_axis_remap(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + w.emit_xyz(machine); + } else { + w.emit_xy(point_on_plate); + } auto speed = m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; w.emit_f(speed * 60.0); @@ -780,7 +816,13 @@ std::string GCodeWriter::_travel_to_z(double z, const std::string &comment) } GCodeG1Formatter w; - w.emit_z(z); + if (has_axis_remap()) { + // Remap may couple Z with other axes; emit full XYZ. + Vec3d machine = apply_axis_remap(Vec3d(m_pos.x() - m_x_offset, m_pos.y() - m_y_offset, z)); + w.emit_xyz(machine); + } else { + w.emit_z(z); + } w.emit_f(speed * 60.0); //BBS w.emit_comment(GCodeWriter::full_gcode_comment, comment); @@ -885,7 +927,12 @@ std::string GCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std: Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - w.emit_xy(point_on_plate); + if (has_axis_remap()) { + Vec3d machine = apply_axis_remap(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + w.emit_xyz(machine); + } else { + w.emit_xy(point_on_plate); + } if (!force_no_extrusion) w.emit_e(filament()->E()); //BBS @@ -925,6 +972,9 @@ std::string GCodeWriter::extrude_to_xyz(const Vec3d &point, double dE, const std //BBS: take plate offset into consider Vec3d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset, point(2) }; + if (has_axis_remap()) + point_on_plate = apply_axis_remap(point_on_plate); + GCodeG1Formatter w; w.emit_xyz(point_on_plate); if (!force_no_extrusion) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index c96c3ca2c1..6aa2ee8ffd 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -125,6 +125,12 @@ public: void set_is_first_layer(bool bval) { m_is_first_layer = bval; } GCodeFlavor get_gcode_flavor() const { return config.gcode_flavor; } + // Axis remap: permute/negate/reverse axes in G-code output. + // Works standalone (without belt mode) for printers with non-standard axis conventions. + void set_axis_remap(int rx, int ry, int rz); + void set_build_volume_max(const Vec3d &max); + bool has_axis_remap() const; + // Returns whether this flavor supports separate print and travel acceleration. static bool supports_separate_travel_acceleration(GCodeFlavor flavor); protected: @@ -141,6 +147,15 @@ protected: virtual std::string _travel_to_z(double z, const std::string &comment); + // Axis remap state — accessible to subclasses. + int m_remap_x = 0; // RemapAxis: 0=+X, 1=+Y, 2=+Z, 3=-X, etc. + int m_remap_y = 1; + int m_remap_z = 2; + Vec3d m_build_vol_max = Vec3d::Zero(); + + // Apply axis remap to a point. Returns pos unchanged if remap is identity. + Vec3d apply_axis_remap(const Vec3d &pos) const; + private: // Extruders are sorted by their ID, so that binary search is possible. std::vector m_filament_extruders; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 9cc5e03d40..cd3af59dae 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1014,8 +1014,8 @@ static std::vector s_Preset_printer_options { "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", "belt_shear_y_global", "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", "belt_shear_z_global", "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", - "belt_preslice_remap_x", "belt_preslice_remap_y", "belt_preslice_remap_z", - "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", "belt_gcode_back_transform", + "preslice_remap_x", "preslice_remap_y", "preslice_remap_z", + "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", "gcode_back_transform", "belt_origin_snap_x", "belt_origin_offset_x", "belt_origin_snap_y", "belt_origin_offset_y", "belt_origin_snap_z", "belt_origin_offset_z", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 1f787a70cf..aca40e4952 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -101,9 +101,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n // or they are only notes not influencing the generated G-code. static std::unordered_set steps_gcode = { // Belt printer G-code axis remap (only affects G-code output, not slicing). - "belt_gcode_remap_x", - "belt_gcode_remap_y", - "belt_gcode_remap_z", + "gcode_remap_x", + "gcode_remap_y", + "gcode_remap_z", "belt_origin_snap_x", "belt_origin_offset_x", "belt_origin_snap_y", "belt_origin_offset_y", "belt_origin_snap_z", "belt_origin_offset_z", @@ -308,9 +308,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "belt_scale_y_angle" || opt_key == "belt_scale_z" || opt_key == "belt_scale_z_angle" - || opt_key == "belt_preslice_remap_x" - || opt_key == "belt_preslice_remap_y" - || opt_key == "belt_preslice_remap_z") { + || opt_key == "preslice_remap_x" + || opt_key == "preslice_remap_y" + || opt_key == "preslice_remap_z") { osteps.emplace_back(posSlice); } else if ( opt_key == "belt_support_floor_offset" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 506bd17a29..a1dbcf8845 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -314,18 +314,18 @@ static t_config_enum_values s_keys_map_BeltScaleMode { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltScaleMode) -static t_config_enum_values s_keys_map_BeltRemapAxis { - { "pos_x", int(BeltRemapAxis::PosX) }, - { "pos_y", int(BeltRemapAxis::PosY) }, - { "pos_z", int(BeltRemapAxis::PosZ) }, - { "neg_x", int(BeltRemapAxis::NegX) }, - { "neg_y", int(BeltRemapAxis::NegY) }, - { "neg_z", int(BeltRemapAxis::NegZ) }, - { "rev_x", int(BeltRemapAxis::RevX) }, - { "rev_y", int(BeltRemapAxis::RevY) }, - { "rev_z", int(BeltRemapAxis::RevZ) }, +static t_config_enum_values s_keys_map_RemapAxis { + { "pos_x", int(RemapAxis::PosX) }, + { "pos_y", int(RemapAxis::PosY) }, + { "pos_z", int(RemapAxis::PosZ) }, + { "neg_x", int(RemapAxis::NegX) }, + { "neg_y", int(RemapAxis::NegY) }, + { "neg_z", int(RemapAxis::NegZ) }, + { "rev_x", int(RemapAxis::RevX) }, + { "rev_y", int(RemapAxis::RevY) }, + { "rev_z", int(RemapAxis::RevZ) }, }; -CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltRemapAxis) +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(RemapAxis) static t_config_enum_values s_keys_map_BeltSupportFloorMode { { "none", int(BeltSupportFloorMode::None) }, @@ -6120,49 +6120,49 @@ void PrintConfigDef::init_fff_params() add_belt_scale_angle("belt_scale_z_angle", "Angle"); // G-code axis remap with sign - auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, BeltRemapAxis default_axis) { + auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, RemapAxis default_axis) { auto def = this->add(key, coEnum); def->label = L(label); def->category = L("Printable space"); def->tooltip = L(tooltip); - def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"pos_x", "pos_y", "pos_z", "neg_x", "neg_y", "neg_z", "rev_x", "rev_y", "rev_z"}; def->enum_labels = {L("+X"), L("+Y"), L("+Z"), L("-X"), L("-Y"), L("-Z"), L("Rev X"), L("Rev Y"), L("Rev Z")}; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionEnum(default_axis)); + def->mode = comSimple; // Visibility controlled by toggle_line in Tab.cpp + def->set_default_value(new ConfigOptionEnum(default_axis)); }; - add_belt_remap("belt_preslice_remap_x", "X", + add_belt_remap("preslice_remap_x", "X", "Before slicing, which model-space axis becomes the slicer's X axis. " "Use this to re-orient the coordinate system so the slicer's XY plane matches " "your belt printer's physical bed plane. For a printer whose bed is in the XZ plane, " "set Y to +Z and Z to +Y (or -Y) to swap the vertical and belt-travel axes. " "Default +X: no change.", - BeltRemapAxis::PosX); - add_belt_remap("belt_preslice_remap_y", "Y", + RemapAxis::PosX); + add_belt_remap("preslice_remap_y", "Y", "Before slicing, which model-space axis becomes the slicer's Y axis. " "The slicer treats Y as one of the two horizontal bed axes. If your physical " "belt surface runs along the Z axis, map Y to +Z here so the slicer slices " "along the correct plane. Default +Y: no change.", - BeltRemapAxis::PosY); - add_belt_remap("belt_preslice_remap_z", "Z", + RemapAxis::PosY); + add_belt_remap("preslice_remap_z", "Z", "Before slicing, which model-space axis becomes the slicer's Z axis (layer stacking direction). " "The slicer builds layers upward along this axis. If your printer's layer-stacking " "direction is the physical Y axis, map Z to +Y (or -Y for inverted direction). " "Rev mode mirrors relative to the build volume maximum. Default +Z: no change.", - BeltRemapAxis::PosZ); + RemapAxis::PosZ); - add_belt_remap("belt_gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosX); - add_belt_remap("belt_gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosY); - add_belt_remap("belt_gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosZ); + add_belt_remap("gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosX); + add_belt_remap("gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosY); + add_belt_remap("gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosZ); - def = this->add("belt_gcode_back_transform", coBool); + def = this->add("gcode_back_transform", coBool); def->label = L("G-code back-transform"); def->category = L("Printable space"); def->tooltip = L("Reverse the shear/scale transform applied during slicing so G-code " "coordinates are in the machine's physical coordinate space. " "Requires at least one shear axis with global mode enabled."); - def->mode = comAdvanced; + def->mode = comSimple; // Visibility controlled by toggle_line in Tab.cpp def->set_default_value(new ConfigOptionBool(false)); auto add_belt_origin_snap = [this](const char *key_snap, const char *key_offset, diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 8b469c4dc6..459e9eb26f 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -182,7 +182,7 @@ enum class BeltAxis Z = 2, }; -enum class BeltRemapAxis +enum class RemapAxis { PosX = 0, PosY = 1, PosZ = 2, NegX = 3, NegY = 4, NegZ = 5, @@ -550,7 +550,7 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SlicingMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltShearMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltScaleMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltAxis) -CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltRemapAxis) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(RemapAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportFloorMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportZOffsetMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialPattern) @@ -1488,13 +1488,13 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, belt_scale_y_angle)) ((ConfigOptionEnum, belt_scale_z)) ((ConfigOptionFloat, belt_scale_z_angle)) - ((ConfigOptionEnum, belt_preslice_remap_x)) - ((ConfigOptionEnum, belt_preslice_remap_y)) - ((ConfigOptionEnum, belt_preslice_remap_z)) - ((ConfigOptionEnum, belt_gcode_remap_x)) - ((ConfigOptionEnum, belt_gcode_remap_y)) - ((ConfigOptionEnum, belt_gcode_remap_z)) - ((ConfigOptionBool, belt_gcode_back_transform)) + ((ConfigOptionEnum, preslice_remap_x)) + ((ConfigOptionEnum, preslice_remap_y)) + ((ConfigOptionEnum, preslice_remap_z)) + ((ConfigOptionEnum, gcode_remap_x)) + ((ConfigOptionEnum, gcode_remap_y)) + ((ConfigOptionEnum, gcode_remap_z)) + ((ConfigOptionBool, gcode_back_transform)) ((ConfigOptionBool, belt_origin_snap_x)) ((ConfigOptionFloat, belt_origin_offset_x)) ((ConfigOptionBool, belt_origin_snap_y)) diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 3067772f09..7279b83d14 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -144,11 +144,31 @@ static std::vector slice_volumes_inner( params_base.closing_radius = print_object_config.slice_closing_radius.value; params_base.extra_offset = 0; params_base.trafo = object_trafo; + // Standalone pre-slice axis remap (works without belt mode). + bool has_remap = BeltTransformPipeline::has_preslice_remap(print_config); + if (has_remap) + params_base.trafo = BeltTransformPipeline::build_preslice_remap(print_config) * params_base.trafo; { - // Belt printer: apply pre-slice transforms (remap, shear, scale, z-shift) via strategy. + // Belt-specific transforms (shear, scale, z-shift) via strategy. auto belt_strategy = BeltSliceStrategy::create(print_config); if (belt_strategy) - belt_strategy->apply_to_trafo(params_base.trafo, model_volumes, out_belt_min_z); + belt_strategy->apply_to_trafo(params_base.trafo, model_volumes, has_remap, out_belt_min_z); + } + // If only remap (no belt), still need z-shift detection. + if (has_remap && !print_config.belt_printer.value) { + double min_z = std::numeric_limits::max(); + for (const ModelVolume *mv : model_volumes) { + if (!mv->is_model_part()) continue; + for (const stl_vertex &v : mv->mesh().its.vertices) { + Vec3d pt = params_base.trafo * v.cast(); + min_z = std::min(min_z, pt.z()); + } + } + if (min_z < 0. && min_z != std::numeric_limits::max()) { + Transform3d z_shift = Transform3d::Identity(); + z_shift.matrix()(2, 3) = -min_z; + params_base.trafo = z_shift * params_base.trafo; + } } //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index d5a6b38ebc..6202185440 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4435,19 +4435,19 @@ void TabPrinter::build_fff() L("Remap model axes before slicing so the slicer's coordinate system matches " "the physical bed orientation. For belt printers whose bed is NOT in the XY plane, " "use this to swap axes so layers are stacked in the correct physical direction.") }; - line.append_option(optgroup->get_option("belt_preslice_remap_x")); - line.append_option(optgroup->get_option("belt_preslice_remap_y")); - line.append_option(optgroup->get_option("belt_preslice_remap_z")); + line.append_option(optgroup->get_option("preslice_remap_x")); + line.append_option(optgroup->get_option("preslice_remap_y")); + line.append_option(optgroup->get_option("preslice_remap_z")); optgroup->append_line(line); } { Line line = { L("G-code axis remap (post-slice)"), L("Remap slicing-frame axes to machine axes in G-code output. Applied AFTER slicing, during G-code generation.") }; - line.append_option(optgroup->get_option("belt_gcode_remap_x")); - line.append_option(optgroup->get_option("belt_gcode_remap_y")); - line.append_option(optgroup->get_option("belt_gcode_remap_z")); + line.append_option(optgroup->get_option("gcode_remap_x")); + line.append_option(optgroup->get_option("gcode_remap_y")); + line.append_option(optgroup->get_option("gcode_remap_z")); optgroup->append_line(line); } - optgroup->append_single_option_line("belt_gcode_back_transform"); + optgroup->append_single_option_line("gcode_back_transform"); { Line line = { L("Origin snap X"), L("Snap object bbox min X to offset in G-code output") }; line.append_option(optgroup->get_option("belt_origin_snap_x")); @@ -5320,11 +5320,14 @@ void TabPrinter::toggle_options() toggle_line("belt_printer_infinite_y", is_belt); for (auto el : {"belt_shear_x", "belt_shear_y", "belt_shear_z", "belt_scale_x", "belt_scale_y", "belt_scale_z", - "belt_preslice_remap_x", - "belt_gcode_remap_x", "belt_gcode_back_transform", "belt_origin_snap_x", "belt_origin_snap_y", "belt_origin_snap_z"}) toggle_line(el, is_belt); + // Remap options: visible when belt mode is on OR when UI is in developer mode. + bool show_remap = is_belt || (m_mode >= comDevelop); + for (auto el : {"preslice_remap_x", "gcode_remap_x", "gcode_back_transform"}) + toggle_line(el, show_remap); + // Gray out angle/from sub-options when their parent shear/scale mode is None. auto sx = m_config->option>("belt_shear_x")->value; toggle_option("belt_shear_x_angle", is_belt && sx != BeltShearMode::None); From 372139c770b9112d27c76c27e3253e29de2f5bb0 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 28 Mar 2026 04:03:39 -0500 Subject: [PATCH 009/389] revert CLAUDE.md --- CLAUDE.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9bd162c42c..25aa516a56 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -23,7 +23,27 @@ cmake --build build/arm64 --config RelWithDebInfo --target all -- ### Building on Linux **Always use this command to build the project when testing build issues on Linux.** ```bash -systemd-run --user --scope -p MemoryMax=48G cmake --build build --config RelWithDebInfo --target all -- -j18 -l 24 +cmake --build build/arm64 --config RelWithDebInfo --target all -- + +``` +### Build test: + +**Always use this command to build the project when testing build issues on Windows.** +```bash +cmake --build . --config %build_type% --target ALL_BUILD -- -m +``` + +### Building on macOS +**Always use this command to build the project when testing build issues on macOS.** +```bash +cmake --build build/arm64 --config RelWithDebInfo --target all -- +``` + +### Building on Linux + **Always use this command to build the project when testing build issues on Linux.** +```bash +cmake --build build --config RelWithDebInfo --target all -- + ``` From 4634a5dfd79e234439b244e43f528f3e33a1c9cb Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sun, 29 Mar 2026 13:14:25 -0500 Subject: [PATCH 010/389] switch default shear axis, swap to tan(a) instead of cot(a) --- src/libslic3r/PrintConfig.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index a1dbcf8845..0ae4173911 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6062,13 +6062,13 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionEnum(default_axis)); }; - auto add_belt_shear_global = [this](const char *key, const char *label) { + auto add_belt_shear_global = [this](const char *key, const char *label, bool default_val = false) { auto def = this->add(key, coBool); def->label = L(label); def->category = L("Printable space"); def->tooltip = L("Apply shear in global coordinates (position-aware) rather than object-local coordinates."); def->mode = comAdvanced; - def->set_default_value(new ConfigOptionBool(false)); + def->set_default_value(new ConfigOptionBool(default_val)); }; add_belt_shear_mode("belt_shear_x", "Function", BeltShearMode::None); @@ -6076,15 +6076,15 @@ void PrintConfigDef::init_fff_params() add_belt_axis_enum("belt_shear_x_from", "From", "Source axis for X shear.", BeltAxis::Z); add_belt_shear_global("belt_shear_x_global", "Global"); - add_belt_shear_mode("belt_shear_y", "Function", BeltShearMode::PosCot); + add_belt_shear_mode("belt_shear_y", "Function", BeltShearMode::None); add_belt_shear_angle("belt_shear_y_angle", "Angle"); add_belt_axis_enum("belt_shear_y_from", "From", "Source axis for Y shear.", BeltAxis::Z); add_belt_shear_global("belt_shear_y_global", "Global"); - add_belt_shear_mode("belt_shear_z", "Function", BeltShearMode::None); + add_belt_shear_mode("belt_shear_z", "Function", BeltShearMode::PosTan); add_belt_shear_angle("belt_shear_z_angle", "Angle"); add_belt_axis_enum("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y); - add_belt_shear_global("belt_shear_z_global", "Global"); + add_belt_shear_global("belt_shear_z_global", "Global", true); // Per-axis scale controls for belt printer auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode) { From 3bc13e5cfd91f2949bca14466423214c6c1ce111 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Tue, 7 Apr 2026 10:37:34 +0800 Subject: [PATCH 011/389] add a generic belt printer --- resources/profiles/Custom.json | 26 ++++- .../Custom/Generic Belt Printer_cover.png | Bin 0 -> 30205 bytes .../machine/MyBeltPrinter 0.2 nozzle.json | 26 +++++ .../machine/MyBeltPrinter 0.4 nozzle.json | 20 ++++ .../machine/MyBeltPrinter 0.6 nozzle.json | 26 +++++ .../machine/MyBeltPrinter 0.8 nozzle.json | 26 +++++ .../Custom/machine/MyBeltPrinter.json | 12 +++ .../Custom/machine/fdm_belt_common.json | 98 ++++++++++++++++++ 8 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 resources/profiles/Custom/Generic Belt Printer_cover.png create mode 100644 resources/profiles/Custom/machine/MyBeltPrinter 0.2 nozzle.json create mode 100644 resources/profiles/Custom/machine/MyBeltPrinter 0.4 nozzle.json create mode 100644 resources/profiles/Custom/machine/MyBeltPrinter 0.6 nozzle.json create mode 100644 resources/profiles/Custom/machine/MyBeltPrinter 0.8 nozzle.json create mode 100644 resources/profiles/Custom/machine/MyBeltPrinter.json create mode 100644 resources/profiles/Custom/machine/fdm_belt_common.json diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index 37927a90fe..4c64f0a205 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,9 +1,13 @@ { "name": "Custom Printer", - "version": "02.03.02.60", + "version": "02.03.02.61", "force_update": "0", "description": "My configurations", "machine_model_list": [ + { + "name": "Generic Belt Printer", + "sub_path": "machine/MyBeltPrinter.json" + }, { "name": "Generic Klipper Printer", "sub_path": "machine/MyKlipper.json" @@ -246,6 +250,10 @@ "name": "MyKlipper 0.8 nozzle", "sub_path": "machine/MyKlipper 0.8 nozzle.json" }, + { + "name": "fdm_belt_common", + "sub_path": "machine/fdm_belt_common.json" + }, { "name": "fdm_toolchanger_common", "sub_path": "machine/fdm_toolchanger_common.json" @@ -254,6 +262,22 @@ "name": "MyRRF 0.4 nozzle", "sub_path": "machine/MyRRF 0.4 nozzle.json" }, + { + "name": "MyBeltPrinter 0.2 nozzle", + "sub_path": "machine/MyBeltPrinter 0.2 nozzle.json" + }, + { + "name": "MyBeltPrinter 0.4 nozzle", + "sub_path": "machine/MyBeltPrinter 0.4 nozzle.json" + }, + { + "name": "MyBeltPrinter 0.6 nozzle", + "sub_path": "machine/MyBeltPrinter 0.6 nozzle.json" + }, + { + "name": "MyBeltPrinter 0.8 nozzle", + "sub_path": "machine/MyBeltPrinter 0.8 nozzle.json" + }, { "name": "MyToolChanger 0.2 nozzle", "sub_path": "machine/MyToolChanger 0.2 nozzle.json" diff --git a/resources/profiles/Custom/Generic Belt Printer_cover.png b/resources/profiles/Custom/Generic Belt Printer_cover.png new file mode 100644 index 0000000000000000000000000000000000000000..d42f2ef228b2cfcdb0d16a525b4fde4d68b3010d GIT binary patch literal 30205 zcmV(|K+(U6P)Px#1ZP1_K>z@;j|==^1poj7(@;!QMMrQ9vvdt+}$iKJSZnH zA0H|;Fg+1etCmDI7LcNVk$F7PEA~Vdy73i zOgS+=h=-FG79oX*ie6rCV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R&>a>Xh-@%`|^o?05og~VJQ73UqG+c^f1HPq;<6_FY? z$AN6crde#YIHeRilkWnL)OhT!Clhmf7GhZyOAJ=7GzQJ;TZ|poa=m>5$E4KmiXb?< z^CRaO?mZ>RrnZ-)WuPrqj+zd~hjPXDGP1cHb-m!7xLAZ%v;?haUbFcTy1lcpscaIB zBgW0n$nu2iwL{?t{@B(Se>y+%$s7ZS^QMuP-;m`c^FYm5{2=frkq$B;y*mHd{HT1E z`zD-mZlX@l3%%2E1R{_tcl}wxeMrML(z0yp1X?lDpz-2(aVqgFPcoBH?Rg0@8^<46 zP-}6SWa8N#MM;2#8Bn+LODpSZiRYNjkG1F3_2rFha>k Date: Wed, 11 Mar 2026 00:27:14 -0500 Subject: [PATCH 012/389] stage in changes from off-plate-gravity and remove stuff I didn't need --- resources/shaders/110/gouraud.fs | 1 + resources/shaders/110/gouraud.vs | 5 +- resources/shaders/110/mm_gouraud.fs | 3 +- resources/shaders/110/mm_gouraud.vs | 1 + resources/shaders/140/gouraud.fs | 1 + resources/shaders/140/gouraud.vs | 5 +- resources/shaders/140/mm_gouraud.fs | 3 +- resources/shaders/140/mm_gouraud.vs | 1 + src/libslic3r/ExPolygon.hpp | 5 ++ src/libslic3r/Preset.cpp | 2 +- src/libslic3r/PrintConfig.cpp | 24 ++++++++ src/libslic3r/PrintConfig.hpp | 3 + src/libslic3r/Support/SupportMaterial.cpp | 22 ++++++-- src/libslic3r/Support/TreeSupport.cpp | 18 +++++- src/libslic3r/Support/TreeSupport3D.cpp | 16 +++++- src/libslic3r/TriangleSelector.cpp | 12 ++-- src/libslic3r/TriangleSelector.hpp | 6 +- src/slic3r/GUI/3DBed.cpp | 59 ++++++++++++++++++++ src/slic3r/GUI/3DBed.hpp | 4 +- src/slic3r/GUI/3DScene.cpp | 18 +++++- src/slic3r/GUI/GUI_Factories.cpp | 4 +- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 20 +++++-- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp | 1 + src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp | 28 ++++++++-- src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp | 3 + src/slic3r/GUI/Tab.cpp | 2 + 26 files changed, 230 insertions(+), 37 deletions(-) diff --git a/resources/shaders/110/gouraud.fs b/resources/shaders/110/gouraud.fs index e602d6067d..12f4feca3e 100644 --- a/resources/shaders/110/gouraud.fs +++ b/resources/shaders/110/gouraud.fs @@ -26,6 +26,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform vec4 uniform_color; diff --git a/resources/shaders/110/gouraud.vs b/resources/shaders/110/gouraud.vs index ff3a190c79..e2de2b63e5 100644 --- a/resources/shaders/110/gouraud.vs +++ b/resources/shaders/110/gouraud.vs @@ -23,6 +23,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform mat4 view_model_matrix; @@ -71,8 +72,8 @@ void main() // Point in homogenous coordinates. world_pos = volume_world_matrix * vec4(v_position, 1.0); - // z component of normal vector in world coordinate used for slope shading - world_normal_z = slope.actived ? (normalize(slope.volume_world_normal_matrix * v_normal)).z : 0.0; + // dot product of world normal with up direction, used for slope shading + world_normal_z = slope.actived ? dot(normalize(slope.volume_world_normal_matrix * v_normal), slope.up_direction) : 0.0; gl_Position = projection_matrix * position; // Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded. diff --git a/resources/shaders/110/mm_gouraud.fs b/resources/shaders/110/mm_gouraud.fs index 821af13f03..431c936e9c 100644 --- a/resources/shaders/110/mm_gouraud.fs +++ b/resources/shaders/110/mm_gouraud.fs @@ -37,6 +37,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform SlopeDetection slope; @@ -85,7 +86,7 @@ void main() color = LightBlue; alpha = 1.0; } - else if( transformed_normal.z < slope.normal_z - EPSILON) + else if( dot(transformed_normal, slope.up_direction) < slope.normal_z - EPSILON) { color = color * 0.5 + LightRed * 0.5; alpha = 1.0; diff --git a/resources/shaders/110/mm_gouraud.vs b/resources/shaders/110/mm_gouraud.vs index b0cea9cfd6..c54ae4bff5 100644 --- a/resources/shaders/110/mm_gouraud.vs +++ b/resources/shaders/110/mm_gouraud.vs @@ -24,6 +24,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform SlopeDetection slope; void main() diff --git a/resources/shaders/140/gouraud.fs b/resources/shaders/140/gouraud.fs index bbfb76f7a1..0d9fa021fe 100644 --- a/resources/shaders/140/gouraud.fs +++ b/resources/shaders/140/gouraud.fs @@ -26,6 +26,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform vec4 uniform_color; diff --git a/resources/shaders/140/gouraud.vs b/resources/shaders/140/gouraud.vs index 72dd4ff1bf..c69dcd11df 100644 --- a/resources/shaders/140/gouraud.vs +++ b/resources/shaders/140/gouraud.vs @@ -23,6 +23,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform mat4 view_model_matrix; @@ -71,8 +72,8 @@ void main() // Point in homogenous coordinates. world_pos = volume_world_matrix * vec4(v_position, 1.0); - // z component of normal vector in world coordinate used for slope shading - world_normal_z = slope.actived ? (normalize(slope.volume_world_normal_matrix * v_normal)).z : 0.0; + // dot product of world normal with up direction, used for slope shading + world_normal_z = slope.actived ? dot(normalize(slope.volume_world_normal_matrix * v_normal), slope.up_direction) : 0.0; gl_Position = projection_matrix * position; // Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded. diff --git a/resources/shaders/140/mm_gouraud.fs b/resources/shaders/140/mm_gouraud.fs index c5fe86efc5..7c77d5565e 100644 --- a/resources/shaders/140/mm_gouraud.fs +++ b/resources/shaders/140/mm_gouraud.fs @@ -37,6 +37,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform SlopeDetection slope; @@ -87,7 +88,7 @@ void main() color = LightBlue; alpha = 1.0; } - else if( transformed_normal.z < slope.normal_z - EPSILON) + else if( dot(transformed_normal, slope.up_direction) < slope.normal_z - EPSILON) { color = color * 0.5 + LightRed * 0.5; alpha = 1.0; diff --git a/resources/shaders/140/mm_gouraud.vs b/resources/shaders/140/mm_gouraud.vs index b191e35fa8..191613f957 100644 --- a/resources/shaders/140/mm_gouraud.vs +++ b/resources/shaders/140/mm_gouraud.vs @@ -24,6 +24,7 @@ struct SlopeDetection bool actived; float normal_z; mat3 volume_world_normal_matrix; + vec3 up_direction; }; uniform SlopeDetection slope; void main() diff --git a/src/libslic3r/ExPolygon.hpp b/src/libslic3r/ExPolygon.hpp index 87a1146d41..7a51f70ef7 100644 --- a/src/libslic3r/ExPolygon.hpp +++ b/src/libslic3r/ExPolygon.hpp @@ -377,6 +377,11 @@ inline void translate(ExPolygons &expolys, const Point &p) { expoly.translate(p); } +inline void translate(Polygons &polys, const Point &p) { + for (Polygon &poly : polys) + poly.translate(p); +} + inline void polygons_append(Polygons &dst, const ExPolygon &src) { dst.reserve(dst.size() + src.holes.size() + 1); diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index f8001d2806..8317eca70a 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1010,7 +1010,7 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", - "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "gcode_flavor", + "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "gcode_flavor", "fan_kickstart", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", "printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index d4711a0da9..c9d2f588da 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -5922,6 +5922,30 @@ void PrintConfigDef::init_fff_params() def->mode = comSimple; def->set_default_value(new ConfigOptionFloatOrPercent(50., true)); + def = this->add("build_plate_tilt_x", coFloat); + def->label = L("Build plate tilt X"); + def->category = L("Support"); + def->tooltip = L("Tilt angle of the build plate along the X axis. " + "A positive value tilts the plate so the +X side is higher, shifting gravity toward -X and increasing overhangs on the +X side. " + "A negative value tilts the -X side higher. Set to 0 for no X-axis tilt."); + def->sidetext = u8"\u00B0"; + def->min = -45; + def->max = 45; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.)); + + def = this->add("build_plate_tilt_y", coFloat); + def->label = L("Build plate tilt Y"); + def->category = L("Support"); + def->tooltip = L("Tilt angle of the build plate along the Y axis. " + "A positive value tilts the plate so the +Y side is higher, shifting gravity toward -Y and increasing overhangs on the +Y side. " + "A negative value tilts the -Y side higher. Set to 0 for no Y-axis tilt."); + def->sidetext = u8"\u00B0"; + def->min = -45; + def->max = 45; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("tree_support_branch_angle", coFloat); def->label = L("Tree support branch angle"); def->category = L("Support"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 7d40ef0706..6b9ad65185 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1409,6 +1409,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( PrintConfig, (MachineEnvelopeConfig, GCodeConfig), + // Build plate tilt for off-axis gravity support generation (printer-level setting). + ((ConfigOptionFloat, build_plate_tilt_x)) + ((ConfigOptionFloat, build_plate_tilt_y)) //BBS ((ConfigOptionInts, additional_cooling_fan_speed)) ((ConfigOptionBool, reduce_crossing_wall)) diff --git a/src/libslic3r/Support/SupportMaterial.cpp b/src/libslic3r/Support/SupportMaterial.cpp index d1fa5d8627..c230924ac8 100644 --- a/src/libslic3r/Support/SupportMaterial.cpp +++ b/src/libslic3r/Support/SupportMaterial.cpp @@ -1392,6 +1392,10 @@ static inline ExPolygons detect_overhangs( const double threshold_rad = Geometry::deg2rad(thresh_angle); const bool bridge_no_support = object_config.bridge_no_support.value; const coordf_t xy_expansion = scale_(object_config.support_expansion.value); + // Build plate tilt: compute per-layer XY shift for tilted gravity direction + const double tilt_x_rad = Geometry::deg2rad(print_config.build_plate_tilt_x.value); + const double tilt_y_rad = Geometry::deg2rad(print_config.build_plate_tilt_y.value); + const bool has_tilt = std::abs(tilt_x_rad) > EPSILON || std::abs(tilt_y_rad) > EPSILON; float lower_layer_offset = 0; if (layer_id == 0) @@ -1441,9 +1445,17 @@ static inline ExPolygons detect_overhangs( // Overhang polygons for this layer and region. Polygons diff_polygons; Polygons layerm_polygons = to_polygons(layerm->slices.surfaces); + // Apply build plate tilt: shift lower layer polygons to simulate tilted gravity + Polygons effective_lower = lower_layer_polygons; + if (has_tilt) { + const double lh = lower_layer.height; + Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), + coord_t(scale_(lh * tan(tilt_x_rad)))); + translate(effective_lower, tilt_shift); + } if (lower_layer_offset == 0.f) { // Support everything. - diff_polygons = diff(layerm_polygons, lower_layer_polygons); + diff_polygons = diff(layerm_polygons, effective_lower); if (buildplate_only) { // Don't support overhangs above the top surfaces. // This step is done before the contact surface is calculated by growing the overhang region. @@ -1452,9 +1464,9 @@ static inline ExPolygons detect_overhangs( } else if (auto_normal_support) { // Get the regions needing a suport, collapse very tiny spots. //FIXME cache the lower layer offset if this layer has multiple regions. - diff_polygons = + diff_polygons = diff(layerm_polygons, - expand(lower_layer_polygons, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS)); + expand(effective_lower, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS)); if (buildplate_only && ! annotations.buildplate_covered[layer_id].empty()) { // Don't support overhangs above the top surfaces. // This step is done before the contact surface is calculated by growing the overhang region. @@ -1462,9 +1474,9 @@ static inline ExPolygons detect_overhangs( } if (! diff_polygons.empty()) { // Offset the support regions back to a full overhang, restrict them to the full overhang. - // This is done to increase size of the supporting columns below, as they are calculated by + // This is done to increase size of the supporting columns below, as they are calculated by // propagating these contact surfaces downwards. - diff_polygons = diff(intersection(expand(diff_polygons, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS), layerm_polygons), lower_layer_polygons); + diff_polygons = diff(intersection(expand(diff_polygons, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS), layerm_polygons), effective_lower); } //FIXME add user defined filtering here based on minimal area or minimum radius or whatever. diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 50272009cd..864a0eb0e0 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -671,6 +671,11 @@ void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) double thresh_angle = config.support_threshold_angle.value > EPSILON ? config.support_threshold_angle.value + 1 : 30; thresh_angle = std::min(thresh_angle, 89.); // should be smaller than 90 const double threshold_rad = Geometry::deg2rad(thresh_angle); + // Build plate tilt: compute per-layer XY shift for tilted gravity direction + const PrintConfig& print_cfg = m_object->print()->config(); + const double tilt_x_rad = Geometry::deg2rad(print_cfg.build_plate_tilt_x.value); + const double tilt_y_rad = Geometry::deg2rad(print_cfg.build_plate_tilt_y.value); + const bool has_tilt = std::abs(tilt_x_rad) > EPSILON || std::abs(tilt_y_rad) > EPSILON; // FIXME this is a fudge constant! double support_tree_tip_diameter = 0.8; auto enforcer_overhang_offset = scaled(support_tree_tip_diameter); @@ -813,8 +818,19 @@ void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) ExPolygons& curr_polys = layer->lslices_extrudable; ExPolygons& lower_polys = lower_layer->lslices_extrudable; + // Apply build plate tilt: shift lower layer polygons to simulate tilted gravity + ExPolygons shifted_lower; + if (has_tilt) { + shifted_lower = lower_polys; // copy + const double lh = lower_layer->height; + Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), + coord_t(scale_(lh * tan(tilt_x_rad)))); + translate(shifted_lower, tilt_shift); + } + const ExPolygons &effective_lower = has_tilt ? shifted_lower : lower_polys; + // normal overhang - ExPolygons lower_layer_offseted = offset_ex(lower_polys, support_offset_scaled, SUPPORT_SURFACES_OFFSET_PARAMETERS); + ExPolygons lower_layer_offseted = offset_ex(effective_lower, support_offset_scaled, SUPPORT_SURFACES_OFFSET_PARAMETERS); overhangs_all_layers[layer_nr] = std::move(diff_ex(curr_polys, lower_layer_offseted)); double duration{ std::chrono::duration_cast(clock_::now() - t0).count() }; diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index 307e4d314d..2c24b933b2 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -208,6 +208,10 @@ static std::vector>> group_me const bool support_threshold_auto = support_threshold == 0; // +1 makes the threshold inclusive double tan_threshold = support_threshold_auto ? 0. : tan(M_PI * double(support_threshold + 1) / 180.); + // Build plate tilt: compute per-layer XY shift for tilted gravity direction + const double tilt_x_rad = Geometry::deg2rad(print_config.build_plate_tilt_x.value); + const double tilt_y_rad = Geometry::deg2rad(print_config.build_plate_tilt_y.value); + const bool has_tilt = std::abs(tilt_x_rad) > EPSILON || std::abs(tilt_y_rad) > EPSILON; //FIXME this is a fudge constant! auto enforcer_overhang_offset = scaled(config.tree_support_tip_diameter.value); const coordf_t radius_sample_resolution = g_config_tree_support_collision_resolution; @@ -229,7 +233,7 @@ static std::vector>> group_me size_t num_overhang_layers = support_auto ? num_object_layers : std::min(num_object_layers, std::max(size_t(support_enforce_layers), enforcers_layers.size())); tbb::parallel_for(tbb::blocked_range(1, num_overhang_layers), [&print_object, &config, &print_config, &enforcers_layers, &blockers_layers, - support_auto, support_enforce_layers, support_threshold_auto, tan_threshold, enforcer_overhang_offset, num_raft_layers, radius_sample_resolution, &throw_on_cancel, &out] + support_auto, support_enforce_layers, support_threshold_auto, tan_threshold, enforcer_overhang_offset, num_raft_layers, radius_sample_resolution, has_tilt, tilt_x_rad, tilt_y_rad, &throw_on_cancel, &out] (const tbb::blocked_range &range) { for (LayerIndex layer_id = range.begin(); layer_id < range.end(); ++ layer_id) { const Layer ¤t_layer = *print_object.get_layer(layer_id); @@ -253,7 +257,15 @@ static std::vector>> group_me lower_layer_offset = external_perimeter_width - float(scale_(config.support_threshold_overlap.get_abs_value(unscale_(external_perimeter_width)))); } else lower_layer_offset = scaled(lower_layer.height / tan_threshold); - Polygons lower_layer_offseted = offset(lower_layer.lslices_extrudable, lower_layer_offset); + // Apply build plate tilt: shift lower layer polygons to simulate tilted gravity + Polygons lower_src = to_polygons(lower_layer.lslices_extrudable); + if (has_tilt) { + const double lh = lower_layer.height; + Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), + coord_t(scale_(lh * tan(tilt_x_rad)))); + translate(lower_src, tilt_shift); + } + Polygons lower_layer_offseted = offset(lower_src, lower_layer_offset); overhangs = diff(current_layer.lslices_extrudable, lower_layer_offseted); if (lower_layer_offset == 0) { raw_overhangs = overhangs; diff --git a/src/libslic3r/TriangleSelector.cpp b/src/libslic3r/TriangleSelector.cpp index a6d19f505c..695ac4c2ba 100644 --- a/src/libslic3r/TriangleSelector.cpp +++ b/src/libslic3r/TriangleSelector.cpp @@ -233,7 +233,7 @@ int TriangleSelector::select_unsplit_triangle(const Vec3f &hit, int facet_idx) c return this->select_unsplit_triangle(hit, facet_idx, neighbors); } -void TriangleSelector::select_patch(int facet_start, std::unique_ptr &&cursor, EnforcerBlockerType new_state, const Transform3d& trafo_no_translate, bool triangle_splitting, float highlight_by_angle_deg) +void TriangleSelector::select_patch(int facet_start, std::unique_ptr &&cursor, EnforcerBlockerType new_state, const Transform3d& trafo_no_translate, bool triangle_splitting, float highlight_by_angle_deg, const Vec3f &up_direction) { assert(facet_start < m_orig_size_indices); @@ -294,8 +294,8 @@ void TriangleSelector::select_patch(int facet_start, std::unique_ptr &&c int facet = facets_to_check[facet_idx]; const Vec3f& facet_normal = m_face_normals[m_triangles[facet].source_triangle]; Matrix3f normal_matrix = static_cast(trafo_no_translate.matrix().block(0, 0, 3, 3).inverse().transpose().cast()); - float world_normal_z = (normal_matrix* facet_normal).normalized().z(); - if (!visited[facet] && (highlight_by_angle_deg == 0.f || world_normal_z < highlight_angle_limit)) { + float world_normal_dot = (normal_matrix * facet_normal).normalized().dot(up_direction); + if (!visited[facet] && (highlight_by_angle_deg == 0.f || world_normal_dot < highlight_angle_limit)) { if (select_triangle(facet, new_state, triangle_splitting)) { // add neighboring facets to list to be processed later for (int neighbor_idx : m_neighbors[facet]) @@ -320,7 +320,7 @@ bool TriangleSelector::is_facet_clipped(int facet_idx, const ClippingPlane &clp) void TriangleSelector::seed_fill_select_triangles(const Vec3f &hit, int facet_start, const Transform3d& trafo_no_translate, const ClippingPlane &clp, float seed_fill_angle, float highlight_by_angle_deg, - bool force_reselection) + bool force_reselection, const Vec3f &up_direction) { assert(facet_start < m_orig_size_indices); @@ -344,8 +344,8 @@ void TriangleSelector::seed_fill_select_triangles(const Vec3f &hit, int facet_st const Vec3f &facet_normal = m_face_normals[m_triangles[current_facet].source_triangle]; Matrix3f normal_matrix = static_cast(trafo_no_translate.matrix().block(0, 0, 3, 3).inverse().transpose().cast()); - float world_normal_z = (normal_matrix * facet_normal).normalized().z(); - if (!visited[current_facet] && (highlight_by_angle_deg == 0.f || world_normal_z < highlight_angle_limit)) { + float world_normal_dot = (normal_matrix * facet_normal).normalized().dot(up_direction); + if (!visited[current_facet] && (highlight_by_angle_deg == 0.f || world_normal_dot < highlight_angle_limit)) { if (m_triangles[current_facet].is_split()) { for (int split_triangle_idx = 0; split_triangle_idx <= m_triangles[current_facet].number_of_split_sides(); ++split_triangle_idx) { assert(split_triangle_idx < int(m_triangles[current_facet].children.size())); diff --git a/src/libslic3r/TriangleSelector.hpp b/src/libslic3r/TriangleSelector.hpp index 50bbdd4ed0..5b20647b84 100644 --- a/src/libslic3r/TriangleSelector.hpp +++ b/src/libslic3r/TriangleSelector.hpp @@ -308,7 +308,8 @@ public: EnforcerBlockerType new_state, // enforcer or blocker? const Transform3d &trafo_no_translate, // matrix to get from mesh to world without translation bool triangle_splitting, // If triangles will be split base on the cursor or not - float highlight_by_angle_deg = 0.f); // The maximal angle of overhang. If it is set to a non-zero value, it is possible to paint only the triangles of overhang defined by this angle in degrees. + float highlight_by_angle_deg = 0.f, // The maximal angle of overhang. If it is set to a non-zero value, it is possible to paint only the triangles of overhang defined by this angle in degrees. + const Vec3f &up_direction = Vec3f::UnitZ()); // Up direction for overhang detection (accounts for build plate tilt) void seed_fill_select_triangles(const Vec3f &hit, // point where to start int facet_start, // facet of the original mesh (unsplit) that the hit point belongs to @@ -316,7 +317,8 @@ public: const ClippingPlane &clp, // Clipping plane to limit painting to not clipped facets only float seed_fill_angle, // the maximal angle between two facets to be painted by the same color float highlight_by_angle_deg = 0.f, // The maximal angle of overhang. If it is set to a non-zero value, it is possible to paint only the triangles of overhang defined by this angle in degrees. - bool force_reselection = false); // force reselection of the triangle mesh even in cases that mouse is pointing on the selected triangle + bool force_reselection = false, // force reselection of the triangle mesh even in cases that mouse is pointing on the selected triangle + const Vec3f &up_direction = Vec3f::UnitZ()); // Up direction for overhang detection (accounts for build plate tilt) void bucket_fill_select_triangles(const Vec3f &hit, // point where to start int facet_start, // facet of the original mesh (unsplit) that the hit point belongs to diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 544a3f8f12..3f5cd306ad 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -394,6 +394,8 @@ void Bed3D::render_internal(GLCanvas3D& canvas, const Transform3d& view_matrix, case Type::Custom: { render_custom(canvas, view_matrix, projection_matrix, bottom); break; } } + render_gravity_arrow(view_matrix, projection_matrix); + glsafe(::glDisable(GL_DEPTH_TEST)); } @@ -731,6 +733,63 @@ void Bed3D::render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, co render_texture(bottom, canvas);*/ } +void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix) +{ + const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; + double tilt_x_deg = cfg.opt_float("build_plate_tilt_x"); + double tilt_y_deg = cfg.opt_float("build_plate_tilt_y"); + if (tilt_x_deg == 0. && tilt_y_deg == 0.) { + m_gravity_arrow.reset(); + return; + } + + // Gravity direction (matching the slicer's tilt convention) + double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); + double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); + Vec3d gravity_dir = Vec3d(-tan(tilt_y_rad), -tan(tilt_x_rad), -1.0).normalized(); + + // Build the arrow model (same dimensions as the axis arrows) + if (!m_gravity_arrow.is_initialized()) { + const float stem_length = Axes::DefaultStemLength; + const float tip_radius = Axes::DefaultTipRadius; + const float tip_length = Axes::DefaultTipLength; + const float stem_radius = stem_length / 75.f; // same ratio as axis cylinders + m_gravity_arrow.init_from(stilized_arrow(16, tip_radius, tip_length, stem_radius, stem_length)); + } + + // The arrow model points along +Z by default. Compute rotation to align with gravity_dir. + // Rotation axis = cross(+Z, gravity_dir), angle = acos(dot(+Z, gravity_dir)) + Vec3d from = Vec3d::UnitZ(); + Vec3d to = gravity_dir; + double dot = from.dot(to); + Transform3d rot = Transform3d::Identity(); + if (dot < -0.9999) { + // Nearly opposite — rotate 180° around X + rot = Eigen::AngleAxisd(M_PI, Vec3d::UnitX()) * rot; + } else if (dot < 0.9999) { + Vec3d axis = from.cross(to).normalized(); + double angle = std::acos(std::clamp(dot, -1.0, 1.0)); + rot = Eigen::AngleAxisd(angle, axis) * rot; + } + + GLShaderProgram* shader = wxGetApp().get_shader("flat"); + if (shader == nullptr) + return; + + glsafe(::glEnable(GL_DEPTH_TEST)); + shader->start_using(); + + const Camera& camera = wxGetApp().plater()->get_camera(); + Transform3d model_matrix = rot; + shader->set_uniform("view_model_matrix", camera.get_view_matrix() * model_matrix); + shader->set_uniform("projection_matrix", camera.get_projection_matrix()); + + m_gravity_arrow.set_color({ 1.0f, 0.85f, 0.0f, 1.0f }); // yellow + m_gravity_arrow.render(); + + shader->stop_using(); +} + void Bed3D::render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix) { // m_texture.reset(); diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index b791635fd3..b16ead575b 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -110,6 +110,7 @@ private: //GLTexture m_temp_texture; GLModel m_model; Vec3d m_model_offset{ Vec3d::Zero() }; + GLModel m_gravity_arrow; Axes m_axes; float m_scale_factor{ 1.0f }; @@ -177,7 +178,8 @@ private: void render_model(const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom); void render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix); - + void render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix); + // BBS: remove the bed picking logic // void register_raycasters_for_picking(const GLModel::Geometry& geometry, const Transform3d& trafo); }; diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index 1a1f652e71..e36f053667 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -1078,13 +1078,27 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool enable_support; int support_threshold_angle = get_selection_support_threshold_angle(enable_support); - + float normal_z = -::cos(Geometry::deg2rad((float) support_threshold_angle)); - + + // Compute up direction accounting for build plate tilt + Vec3f up_direction = Vec3f::UnitZ(); + { + const DynamicPrintConfig& prt_cfg = GUI::wxGetApp().preset_bundle->printers.get_edited_preset().config; + double tilt_x_deg = prt_cfg.opt_float("build_plate_tilt_x"); + double tilt_y_deg = prt_cfg.opt_float("build_plate_tilt_y"); + if (tilt_x_deg != 0. || tilt_y_deg != 0.) { + double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); + double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); + up_direction = Vec3f(float(tan(tilt_y_rad)), float(tan(tilt_x_rad)), 1.f).normalized(); + } + } + shader->set_uniform("volume_world_matrix", volume.first->world_matrix()); shader->set_uniform("slope.actived", m_slope.isGlobalActive && !volume.first->is_modifier && !volume.first->is_wipe_tower); shader->set_uniform("slope.volume_world_normal_matrix", static_cast(volume.first->world_matrix().matrix().block(0, 0, 3, 3).inverse().transpose().cast())); shader->set_uniform("slope.normal_z", normal_z); + shader->set_uniform("slope.up_direction", up_direction); #if ENABLE_ENVIRONMENT_MAP unsigned int environment_texture_id = GUI::wxGetApp().plater()->get_environment_texture_id(); diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 5c3c0267ee..3cc39fe1ce 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -64,6 +64,7 @@ static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_FFF = { L("Support") , { "enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap", "support_base_pattern", "support_on_build_plate_only","support_critical_regions_only", "support_remove_small_overhang", + "build_plate_tilt_x", "build_plate_tilt_y", "support_base_pattern_spacing", "support_expansion"}}, //BBS { L("Flush options") , { "flush_into_infill", "flush_into_objects", "flush_into_support"} } @@ -94,7 +95,8 @@ std::map> SettingsFactory::OBJECT_C {"support_bottom_z_distance", "",19},{"support_top_z_distance", "",20},{"support_base_pattern", "",21},{"support_base_pattern_spacing", "",22}, {"support_interface_top_layers", "",23},{"support_interface_bottom_layers", "",24},{"support_interface_spacing", "",25},{"support_bottom_interface_spacing", "",26}, {"support_object_xy_distance", "",27}, {"bridge_no_support", "",28},{"max_bridge_length", "",29},{"support_critical_regions_only", "",30},{"support_remove_small_overhang","",31}, - {"support_object_first_layer_gap","",32} + {"build_plate_tilt_x","",32},{"build_plate_tilt_y","",33}, + {"support_object_first_layer_gap","",34} }}, { L("Speed"), {{"support_speed", "",12}, {"support_interface_speed", "",13} }} diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index 02f1b4be5f..88781f6006 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -537,6 +537,14 @@ int GLGizmoFdmSupports::get_selection_support_threshold_angle() return auto_support ? support_threshold_angle : 0; } +std::pair GLGizmoFdmSupports::get_build_plate_tilt() +{ + const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; + double tilt_x = cfg.opt_float("build_plate_tilt_x"); + double tilt_y = cfg.opt_float("build_plate_tilt_y"); + return {tilt_x, tilt_y}; +} + void GLGizmoFdmSupports::select_facets_by_angle(float threshold_deg, bool block) { float threshold = (float(M_PI)/180.f)*threshold_deg; @@ -544,6 +552,12 @@ void GLGizmoFdmSupports::select_facets_by_angle(float threshold_deg, bool block) const ModelObject* mo = m_c->selection_info()->model_object(); const ModelInstance* mi = mo->instances[selection.get_instance_idx()]; + // Compute gravity direction accounting for build plate tilt + auto [tilt_x_deg, tilt_y_deg] = get_build_plate_tilt(); + double tilt_x_rad = tilt_x_deg * M_PI / 180.0; + double tilt_y_rad = tilt_y_deg * M_PI / 180.0; + Vec3d gravity_dir = Vec3d(-tan(tilt_y_rad), -tan(tilt_x_rad), -1.0).normalized(); + int mesh_id = -1; for (const ModelVolume* mv : mo->volumes) { if (! mv->is_model_part()) @@ -552,10 +566,8 @@ void GLGizmoFdmSupports::select_facets_by_angle(float threshold_deg, bool block) ++mesh_id; const Transform3d trafo_matrix = mi->get_matrix_no_offset() * mv->get_matrix_no_offset(); - Vec3f down = (trafo_matrix.inverse() * (-Vec3d::UnitZ())).cast().normalized(); - Vec3f limit = (trafo_matrix.inverse() * Vec3d(std::sin(threshold), 0, -std::cos(threshold))).cast().normalized(); - - float dot_limit = limit.dot(down); + Vec3f down = (trafo_matrix.inverse() * gravity_dir).cast().normalized(); + float dot_limit = std::cos(threshold); // Now calculate dot product of vert_direction and facets' normals. int idx = 0; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp index ec0faeab80..0afdba7f19 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp @@ -59,6 +59,7 @@ private: void select_facets_by_angle(float threshold, bool block); // BBS int get_selection_support_threshold_angle(); + std::pair get_build_plate_tilt(); int m_support_threshold_angle = -1; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp index 7d3f40bd12..71e4c45f4a 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp @@ -73,6 +73,18 @@ GLGizmoPainterBase::ClippingPlaneDataWrapper GLGizmoPainterBase::get_clipping_pl return clp_data_out; } +Vec3f GLGizmoPainterBase::get_tilt_up_direction() const +{ + const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; + double tilt_x_deg = cfg.opt_float("build_plate_tilt_x"); + double tilt_y_deg = cfg.opt_float("build_plate_tilt_y"); + if (tilt_x_deg == 0. && tilt_y_deg == 0.) + return Vec3f::UnitZ(); + double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); + double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); + return Vec3f(float(tan(tilt_y_rad)), float(tan(tilt_x_rad)), 1.f).normalized(); +} + void GLGizmoPainterBase::render_triangles(const Selection& selection) const { auto* shader = wxGetApp().get_shader("mm_gouraud"); @@ -119,11 +131,15 @@ void GLGizmoPainterBase::render_triangles(const Selection& selection) const float normal_z = -::cos(Geometry::deg2rad(m_highlight_by_angle_threshold_deg)); Matrix3f normal_matrix = static_cast(trafo_matrix.matrix().block(0, 0, 3, 3).inverse().transpose().cast()); + // Compute up direction accounting for build plate tilt + Vec3f up_direction = get_tilt_up_direction(); + shader->set_uniform("volume_world_matrix", trafo_matrix); shader->set_uniform("volume_mirrored", is_left_handed); shader->set_uniform("slope.actived", m_parent.is_using_slope()); shader->set_uniform("slope.volume_world_normal_matrix", normal_matrix); shader->set_uniform("slope.normal_z", normal_z); + shader->set_uniform("slope.up_direction", up_direction); m_triangle_selectors[mesh_id]->render(m_imgui, trafo_matrix); if (is_left_handed) @@ -691,7 +707,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous mi->get_assemble_transformation().get_matrix() * mo->volumes[m_rr.mesh_id]->get_matrix() : mi->get_transformation().get_matrix() * mo->volumes[m_rr.mesh_id]->get_matrix(); m_triangle_selectors[m_rr.mesh_id]->seed_fill_select_triangles(m_rr.hit, int(m_rr.facet), trafo_matrix_not_translate, this->get_clipping_plane_in_volume_coordinates(trafo_matrix), m_smart_fill_angle, - m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, true); + m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, true, get_tilt_up_direction()); m_triangle_selectors[m_rr.mesh_id]->request_update_render_data(); m_seed_fill_last_mesh_id = m_rr.mesh_id; } @@ -803,7 +819,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous std::unique_ptr cursor = TriangleSelector::SinglePointCursor::cursor_factory(phr.z_world, camera_pos, m_cursor_height, trafo_matrix, clp); m_triangle_selectors[mesh_idx]->select_patch(int(phr.first_facet_idx), std::move(cursor), new_state, trafo_matrix_not_translate, - m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f); + m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, get_tilt_up_direction()); m_triangle_selectors[mesh_idx]->request_update_render_data(true); m_last_mouse_click = _mouse_position; @@ -855,7 +871,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous m_triangle_selectors[mesh_idx]->seed_fill_apply_on_triangles(new_state); if (m_tool_type == ToolType::SMART_FILL) m_triangle_selectors[mesh_idx]->seed_fill_select_triangles(mesh_hit, facet_idx, trafo_matrix_not_translate, clp, m_smart_fill_angle, - m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, true); + m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, true, get_tilt_up_direction()); else if (m_tool_type == ToolType::BRUSH && m_cursor_type == TriangleSelector::CursorType::POINTER) // BBS: add infill_angle parameter m_triangle_selectors[mesh_idx]->bucket_fill_select_triangles(mesh_hit, facet_idx, clp, -1.f, false, true); @@ -874,12 +890,12 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous camera_pos, m_cursor_radius, m_cursor_type, trafo_matrix, clp); m_triangle_selectors[mesh_idx]->select_patch(int(first_position.facet_idx), std::move(cursor), new_state, trafo_matrix_not_translate, - m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f); + m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, get_tilt_up_direction()); } else { for (auto first_position_it = projected_mouse_positions.cbegin(); first_position_it != projected_mouse_positions.cend() - 1; ++first_position_it) { auto second_position_it = first_position_it + 1; std::unique_ptr cursor = TriangleSelector::DoublePointCursor::cursor_factory(first_position_it->mesh_hit, second_position_it->mesh_hit, camera_pos, m_cursor_radius, m_cursor_type, trafo_matrix, clp); - m_triangle_selectors[mesh_idx]->select_patch(int(first_position_it->facet_idx), std::move(cursor), new_state, trafo_matrix_not_translate, m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f); + m_triangle_selectors[mesh_idx]->select_patch(int(first_position_it->facet_idx), std::move(cursor), new_state, trafo_matrix_not_translate, m_triangle_splitting_enabled, m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, get_tilt_up_direction()); } } } @@ -953,7 +969,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous const TriangleSelector::ClippingPlane &clp = this->get_clipping_plane_in_volume_coordinates(trafo_matrix); if (m_tool_type == ToolType::SMART_FILL) m_triangle_selectors[m_rr.mesh_id]->seed_fill_select_triangles(m_rr.hit, int(m_rr.facet), trafo_matrix_not_translate, clp, m_smart_fill_angle, - m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f); + m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, false, get_tilt_up_direction()); else if (m_tool_type == ToolType::BRUSH && m_cursor_type == TriangleSelector::CursorType::POINTER) // BBS: add infill_angle parameter m_triangle_selectors[m_rr.mesh_id]->bucket_fill_select_triangles(m_rr.hit, int(m_rr.facet), clp, -1.f, false); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp index 5fc1a9e18f..9dbed7df7e 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp @@ -281,6 +281,9 @@ protected: bool m_paint_on_overhangs_only = false; float m_highlight_by_angle_threshold_deg = 0.f; + // Returns the up direction accounting for build plate tilt (default: UnitZ) + Vec3f get_tilt_up_direction() const; + GLModel m_circle; Vec2d m_old_center{ Vec2d::Zero() }; float m_old_cursor_radius{ 0.0f }; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 6141d96885..70265aa81d 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4365,6 +4365,8 @@ void TabPrinter::build_fff() optgroup->append_single_option_line(option, "printer_basic_information_printable_space#excluded-bed-area"); // optgroup->append_single_option_line("printable_area"); optgroup->append_single_option_line("printable_height", "printer_basic_information_printable_space#printable-height"); + optgroup->append_single_option_line("build_plate_tilt_x"); + optgroup->append_single_option_line("build_plate_tilt_y"); optgroup->append_single_option_line("support_multi_bed_types","printer_basic_information_printable_space#support-multi-bed-types"); optgroup->append_single_option_line("best_object_pos", "printer_basic_information_printable_space#best-object-position"); // todo: for multi_extruder test From c808653565d27ebcdced52c58b048087a85263bd Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 11 Mar 2026 03:58:52 -0500 Subject: [PATCH 013/389] Add belt printer transform pipeline: slicing rotation, G-code coords, preview - Implement core belt slicing pipeline: R(-alpha, X) mesh rotation in PrintObjectSlice with corrected object height calculation for proper layer count Add to_machine_coords() in GCodeWriter to convert slicing-frame coordinates back to machine-frame, propagated through GCode, GCodeProcessor, and GCodeViewer Add belt-mode UI: tilted bed visualization, slicing-direction arrow, and raw G-code toggle to switch between machine-frame and slicing-frame views This is a combination of 6 commits. checkpoint 1: initial MVP. Slicing functions, but rotates instead of skews are happening and a lot of other stuff too getting somewhere, getting to the point where I need to figure out how to verify this stuff this appears to be a dead end. getting somewhere I think maybe I'm pretty sure we've completely lost the plot at this point and need to restart this process... remove slice logic in preparation for new, more invasive plan --- result.json | 7 ++ src/libslic3r/Brim.cpp | 4 ++ src/libslic3r/BuildVolume.cpp | 25 +++++++ src/libslic3r/BuildVolume.hpp | 8 +++ src/libslic3r/GCode.cpp | 9 ++- src/libslic3r/GCode/GCodeProcessor.cpp | 10 +++ src/libslic3r/GCode/GCodeProcessor.hpp | 2 + src/libslic3r/GCodeWriter.cpp | 91 +++++++++++++++++++++----- src/libslic3r/GCodeWriter.hpp | 11 ++++ src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 20 ++++++ src/libslic3r/PrintConfig.cpp | 50 ++++++++++++-- src/libslic3r/PrintConfig.hpp | 4 ++ src/libslic3r/PrintObject.cpp | 5 +- src/libslic3r/PrintObjectSlice.cpp | 2 + src/slic3r/GUI/3DBed.cpp | 67 ++++++++++++++++++- src/slic3r/GUI/3DBed.hpp | 11 ++++ src/slic3r/GUI/ConfigManipulation.cpp | 25 +++++-- src/slic3r/GUI/GCodeViewer.cpp | 4 +- src/slic3r/GUI/GCodeViewer.hpp | 6 ++ src/slic3r/GUI/Plater.cpp | 18 +++++ src/slic3r/GUI/Tab.cpp | 25 +++++++ 22 files changed, 375 insertions(+), 31 deletions(-) create mode 100644 result.json diff --git a/result.json b/result.json new file mode 100644 index 0000000000..e309ad45a1 --- /dev/null +++ b/result.json @@ -0,0 +1,7 @@ +{ + "error_string": "Success.", + "export_time": 0, + "plate_index": 0, + "prepare_time": 0, + "return_code": 0 +} diff --git a/src/libslic3r/Brim.cpp b/src/libslic3r/Brim.cpp index 8b245e82c5..8eb6af9590 100644 --- a/src/libslic3r/Brim.cpp +++ b/src/libslic3r/Brim.cpp @@ -881,6 +881,10 @@ void make_brim(const Print& print, PrintTryCancel try_cancel, Polygons& islands_ std::vector> &objPrintVec, std::vector& printExtruders) { + // Belt printer: brim is not compatible with belt printing. + if (print.config().belt_printer.value) + return; + std::map brim_width_map; std::map brimAreaMap; std::map supportBrimAreaMap; diff --git a/src/libslic3r/BuildVolume.cpp b/src/libslic3r/BuildVolume.cpp index 3802fbc014..132794ccfe 100644 --- a/src/libslic3r/BuildVolume.cpp +++ b/src/libslic3r/BuildVolume.cpp @@ -176,6 +176,26 @@ BuildVolume::BuildVolume(const std::vector &printable_area, const double BOOST_LOG_TRIVIAL(debug) << "BuildVolume printable_area clasified as: " << this->type_name(); } +void BuildVolume::set_belt_printer(bool enabled, double angle_deg, bool infinite_y) +{ + m_is_belt_printer = enabled; + m_belt_angle = angle_deg; + m_belt_infinite_y = infinite_y; + + if (enabled) { + if (infinite_y) { + // Extend the Y bound to a very large value for infinite belt. + m_bboxf.max.y() = 100000.; + } + // Adjust max print height to diagonal reach: printable_height / sin(belt_angle). + if (angle_deg > 0. && angle_deg < 90.) { + double sin_a = std::sin(angle_deg * M_PI / 180.0); + if (sin_a > 0.) + m_bboxf.max.z() = m_max_print_height / sin_a; + } + } +} + #if 0 // Tests intersections of projected triangles, not just their vertices against a bounding box. // This test also correctly evaluates collision of a non-convex object with the bounding box. @@ -384,6 +404,11 @@ BuildVolume::ObjectState BuildVolume::object_state(const indexed_triangle_set& i build_volume.max.z() = std::numeric_limits::max(); if (ignore_bottom) build_volume.min.z() = -std::numeric_limits::max(); + // Belt printer: extend Y bounds for infinite Y. + if (m_is_belt_printer && m_belt_infinite_y) { + build_volume.min.y() = -std::numeric_limits::max(); + build_volume.max.y() = std::numeric_limits::max(); + } BoundingBox3Base build_volumef(build_volume.min.cast(), build_volume.max.cast()); // The following test correctly interprets intersection of a non-convex object with a rectangular build volume. //return rectangle_test(its, trafo, to_2d(build_volume.min), to_2d(build_volume.max), build_volume.max.z()); diff --git a/src/libslic3r/BuildVolume.hpp b/src/libslic3r/BuildVolume.hpp index 6f53fdd704..0494efe9ba 100644 --- a/src/libslic3r/BuildVolume.hpp +++ b/src/libslic3r/BuildVolume.hpp @@ -57,6 +57,10 @@ public: // Initialize from PrintConfig::printable_area and PrintConfig::printable_height BuildVolume(const std::vector &printable_area, const double printable_height, const std::vector> &extruder_areas, const std::vector& extruder_printable_heights); + // Belt printer configuration. + void set_belt_printer(bool enabled, double angle_deg, bool infinite_y); + bool is_belt_printer() const { return m_is_belt_printer; } + // Source data, unscaled coordinates. const std::vector& printable_area() const { return m_bed_shape; } double printable_height() const { return m_max_print_height; } @@ -139,6 +143,10 @@ private: // Source definition of the print volume height (PrintConfig::printable_height) double m_max_print_height { 0.f }; std::vector m_extruder_printable_height; + // Belt printer state. + bool m_is_belt_printer { false }; + double m_belt_angle { 0. }; + bool m_belt_infinite_y { false }; // Derived values. BuildVolume_Type m_type { BuildVolume_Type::Invalid }; diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 04a2df48db..7b881ea74f 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2413,6 +2413,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_writer.set_is_bbl_machine(is_bbl_printers); + // Belt printer: initialize coordinate transformation on the writer. + if (print.config().belt_printer.value) + m_writer.set_belt_angle(print.config().belt_printer_angle.value); + // How many times will be change_layer() called? // change_layer() in turn increments the progress bar status. m_layer_count = 0; @@ -2502,6 +2506,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format("; HEADER_BLOCK_START\n"); // Write information on the generator. file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str()); + // Belt printer: embed angle in header for G-code processor detection. + if (print.config().belt_printer.value) + file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); //BBS: total layer number @@ -6758,7 +6765,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } // BBS: use G1 if not enable arc fitting or has no arc fitting result or in spiral_mode mode or we are doing sloped extrusion // Attention: G2 and G3 is not supported in spiral_mode mode - if (!m_config.enable_arc_fitting || path.polyline.fitting_result.empty() || m_config.spiral_mode || sloped != nullptr) { + if (!m_config.enable_arc_fitting || path.polyline.fitting_result.empty() || m_config.spiral_mode || sloped != nullptr || m_config.belt_printer) { double path_length = 0.; double total_length = sloped == nullptr ? 0. : path.polyline.length() * SCALING_FACTOR; for (const Line& line : path.polyline.lines()) { diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 8876cbeede..6c5c837b92 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2597,6 +2597,8 @@ void GCodeProcessor::finalize(bool post_process) } } + // Belt printer: preview coordinate transform placeholder (to be implemented in next cycle). + calculate_time(m_result); // process the time blocks @@ -3044,6 +3046,14 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers return; } + // Belt printer angle detection from G-code header comment. + if (boost::starts_with(comment, " belt_printer_angle = ")) { + try { + m_result.belt_printer_angle = std::stof(std::string(comment.substr(22))); + } catch (...) {} + return; + } + // wipe start tag if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) { m_wiping = true; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 1d72b1c614..e432a165a8 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -227,6 +227,8 @@ class Print; bool support_traditional_timelapse{true}; float printable_height; float z_offset; + // Belt printer: angle for coordinate transformation in preview. + float belt_printer_angle{ 0.f }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index ef6ff54e5e..7d4ac3babb 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -1,5 +1,6 @@ #include "GCodeWriter.hpp" #include "CustomGCode.hpp" +#include "Geometry.hpp" #include "PrintConfig.hpp" #include #include @@ -19,6 +20,19 @@ namespace Slic3r { bool GCodeWriter::full_gcode_comment = true; +void GCodeWriter::set_belt_angle(double angle_deg) +{ + m_belt_angle_rad = Geometry::deg2rad(angle_deg); + m_belt_cos = std::cos(m_belt_angle_rad); + m_belt_sin = std::sin(m_belt_angle_rad); +} + +Vec3d GCodeWriter::to_machine_coords(const Vec3d &pos) const +{ + // Belt printer: coordinate transform placeholder (to be implemented in next cycle). + return pos; +} + bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) { return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware); @@ -561,7 +575,13 @@ std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &com Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - w.emit_xy(point_on_plate); + if (is_belt_printer()) { + // Belt printer: transform to machine coordinates (XY travel also needs Z due to YZ rotation) + Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + w.emit_xyz(machine); + } else { + w.emit_xy(point_on_plate); + } auto speed = m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; w.emit_f(speed * 60.0); @@ -575,6 +595,11 @@ it will not perform subsequent lifts, even if Z was raised manually (i.e. with travel_to_z()) and thus _lifted was reduced. */ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) { + // Belt printer: force NormalLift since SpiralLift and SlopeLift compute slope angles + // that don't account for the YZ coordinate rotation. + if (is_belt_printer()) + lift_type = LiftType::NormalLift; + // check whether the above/below conditions are met double target_lift = 0; { @@ -601,8 +626,10 @@ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) } // BBS: immediately execute an undelayed lift move with a spiral lift pattern -// designed specifically for subsequent gcode injection (e.g. timelapse) +// designed specifically for subsequent gcode injection (e.g. timelapse) std::string GCodeWriter::eager_lift(const LiftType type) { + // Belt printer: force NormalLift (SpiralLift/SlopeLift don't account for YZ rotation). + const LiftType effective_type = is_belt_printer() ? LiftType::NormalLift : type; std::string lift_move; double target_lift = 0; { @@ -617,7 +644,7 @@ std::string GCodeWriter::eager_lift(const LiftType type) { // BBS: spiral lift only safe with known position // TODO: check the arc will move within bed area - if (type == LiftType::SpiralLift && this->is_current_position_clear()) { + if (effective_type == LiftType::SpiralLift && this->is_current_position_clear()) { double radius = target_lift / (2 * PI * atan(filament()->travel_slope())); // static spiral alignment when no move in x,y plane. // spiral centra is a radius distance to the right (y=0) @@ -689,6 +716,8 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co // / to make the z list early to avoid to hit some warping place when travel is long. Vec2d temp = delta_no_z.normalized() * delta(2) / tan(this->filament()->travel_slope()); Vec3d slope_top_point = Vec3d(temp(0), temp(1), delta(2)) + source; + if (is_belt_printer()) + slope_top_point = to_machine_coords(slope_top_point); GCodeG1Formatter w0; w0.emit_xyz(slope_top_point); w0.emit_f(travel_speed * 60.0); @@ -703,18 +732,27 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co std::string xy_z_move; { + Vec3d emit_target = is_belt_printer() ? to_machine_coords(target) : target; GCodeG1Formatter w0; if (this->is_current_position_clear()) { - w0.emit_xyz(target); + w0.emit_xyz(emit_target); w0.emit_f(travel_speed * 60.0); w0.emit_comment(GCodeWriter::full_gcode_comment, comment); xy_z_move = w0.string(); } else { - w0.emit_xy(Vec2d(target.x(), target.y())); - w0.emit_f(travel_speed * 60.0); - w0.emit_comment(GCodeWriter::full_gcode_comment, comment); - xy_z_move = w0.string() + _travel_to_z(target.z(), comment); + if (is_belt_printer()) { + // Belt mode: can't split XY and Z moves independently, emit full XYZ + w0.emit_xyz(emit_target); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + xy_z_move = w0.string(); + } else { + w0.emit_xy(Vec2d(target.x(), target.y())); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + xy_z_move = w0.string() + _travel_to_z(target.z(), comment); + } } } m_pos = dest_point; @@ -740,15 +778,25 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co //BBS: take plate offset into consider Vec3d point_on_plate = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; + if (is_belt_printer()) + point_on_plate = to_machine_coords(point_on_plate); std::string out_string; GCodeG1Formatter w; if (!this->is_current_position_clear()) { - //force to move xy first then z after filament change - w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); - w.emit_f(this->config.travel_speed.value * 60.0); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - out_string = w.string() + _travel_to_z(point_on_plate.z(), comment); + if (is_belt_printer()) { + // Belt mode: emit full XYZ since Y and Z are coupled + w.emit_xyz(point_on_plate); + w.emit_f(this->config.travel_speed.value * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + out_string = w.string(); + } else { + //force to move xy first then z after filament change + w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); + w.emit_f(this->config.travel_speed.value * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + out_string = w.string() + _travel_to_z(point_on_plate.z(), comment); + } } else { GCodeG1Formatter w; w.emit_xyz(point_on_plate); @@ -792,7 +840,13 @@ std::string GCodeWriter::_travel_to_z(double z, const std::string &comment) } GCodeG1Formatter w; - w.emit_z(z); + if (is_belt_printer()) { + // Belt printer: a Z-only move in slicing frame needs to emit both Y and Z in machine coords. + Vec3d machine = to_machine_coords(Vec3d(m_pos.x() - m_x_offset, m_pos.y() - m_y_offset, z)); + w.emit_xyz(machine); + } else { + w.emit_z(z); + } w.emit_f(speed * 60.0); //BBS w.emit_comment(GCodeWriter::full_gcode_comment, comment); @@ -897,7 +951,12 @@ std::string GCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std: Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - w.emit_xy(point_on_plate); + if (is_belt_printer()) { + Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + w.emit_xyz(machine); + } else { + w.emit_xy(point_on_plate); + } if (!force_no_extrusion) w.emit_e(filament()->E()); //BBS @@ -938,6 +997,8 @@ std::string GCodeWriter::extrude_to_xyz(const Vec3d &point, double dE, const std Vec3d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset, point(2) }; GCodeG1Formatter w; + if (is_belt_printer()) + point_on_plate = to_machine_coords(point_on_plate); w.emit_xyz(point_on_plate); if (!force_no_extrusion) w.emit_e(filament()->E()); diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index dbc64694e2..10159d941f 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -125,6 +125,12 @@ public: void set_is_first_layer(bool bval) { m_is_first_layer = bval; } GCodeFlavor get_gcode_flavor() const { return config.gcode_flavor; } + // Belt printer: set the belt angle and precompute sin/cos for coordinate transformation. + void set_belt_angle(double angle_deg); + bool is_belt_printer() const { return m_belt_angle_rad != 0.; } + // Transform a point from the slicing frame to machine/world coordinates (inverse shear). + Vec3d to_machine_coords(const Vec3d &pos) const; + // Returns whether this flavor supports separate print and travel acceleration. static bool supports_separate_travel_acceleration(GCodeFlavor flavor); private: @@ -177,6 +183,11 @@ public: //SoftFever bool m_is_bbl_printers = false; + + // Belt printer coordinate transformation (YZ shear) + double m_belt_angle_rad = 0.; + double m_belt_cos = 1.0; + double m_belt_sin = 0.0; double m_current_speed; bool m_is_first_layer = true; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 8317eca70a..6d8c113480 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1010,7 +1010,7 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", - "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "gcode_flavor", + "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "gcode_flavor", "fan_kickstart", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", "printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 6463338f7d..f245cc32b6 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -565,6 +565,9 @@ std::vector Print::print_object_ids() const bool Print::has_infinite_skirt() const { + // Belt printer: no skirt support. + if (m_config.belt_printer.value) + return false; // Orca: unclear why (m_config.ooze_prevention && this->extruders().size() > 1) logic is here, removed. // return (m_config.draft_shield == dsEnabled && m_config.skirt_loops > 0) || (m_config.ooze_prevention && this->extruders().size() > 1); @@ -573,6 +576,9 @@ bool Print::has_infinite_skirt() const bool Print::has_skirt() const { + // Belt printer: no skirt support. + if (m_config.belt_printer.value) + return false; return (m_config.skirt_height > 0); } @@ -1194,6 +1200,16 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* if (extruders.empty()) return { L("No extrusions under current settings.") }; + // Belt printer validation: incompatible features. + if (m_config.belt_printer.value) { + for (const PrintObject *object : m_objects) { + if (object->config().raft_layers > 0) + return { L("Raft is not compatible with belt printer mode.") }; + } + if (m_config.draft_shield != dsDisabled) + return { L("Draft shield is not compatible with belt printer mode.") }; + } + if (nozzles < 2 && extruders.size() > 1) { auto ret = check_multi_filament_valid(*this); if (!ret.string.empty()) @@ -2501,6 +2517,10 @@ std::string Print::export_gcode(const std::string& path_template, GCodeProcessor void Print::_make_skirt() { + // Belt printer: skirt is not compatible. + if (m_config.belt_printer.value) + return; + // First off we need to decide how tall the skirt must be. // The skirt_height option from config is expressed in layers, but our // object might have different layer heights, so we need to find the print_z diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index c9d2f588da..976a35c126 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2,6 +2,7 @@ #include "PrintConfigConstants.hpp" #include "ClipperUtils.hpp" #include "Config.hpp" +#include "Geometry.hpp" #include "MaterialType.hpp" #include "I18N.hpp" #include "format.hpp" @@ -5927,10 +5928,11 @@ void PrintConfigDef::init_fff_params() def->category = L("Support"); def->tooltip = L("Tilt angle of the build plate along the X axis. " "A positive value tilts the plate so the +X side is higher, shifting gravity toward -X and increasing overhangs on the +X side. " - "A negative value tilts the -X side higher. Set to 0 for no X-axis tilt."); + "A negative value tilts the -X side higher. Set to 0 for no X-axis tilt. " + "In belt printer mode, this is automatically synced to the belt angle."); def->sidetext = u8"\u00B0"; - def->min = -45; - def->max = 45; + def->min = -90; + def->max = 90; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0.)); @@ -5941,11 +5943,41 @@ void PrintConfigDef::init_fff_params() "A positive value tilts the plate so the +Y side is higher, shifting gravity toward -Y and increasing overhangs on the +Y side. " "A negative value tilts the -Y side higher. Set to 0 for no Y-axis tilt."); def->sidetext = u8"\u00B0"; - def->min = -45; - def->max = 45; + def->min = -90; + def->max = 90; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("belt_printer", coBool); + def->label = L("Belt printer"); + def->category = L("Printable space"); + def->tooltip = L("Enable belt printer mode. Belt printers use a conveyor belt as the build surface, " + "tilted at an angle (typically 45 degrees). The slicer will rotate the slicing plane " + "and transform G-code coordinates for the tilted build surface."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + + def = this->add("belt_printer_angle", coFloat); + def->label = L("Belt angle"); + def->category = L("Printable space"); + def->tooltip = L("The tilt angle of the belt surface in degrees. " + "Most belt printers use a 45-degree angle. " + "This controls the rotation applied to the slicing plane and G-code coordinates."); + def->sidetext = u8"\u00B0"; + def->min = 0; + def->max = 90; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(45.)); + + def = this->add("belt_printer_infinite_y", coBool); + def->label = L("Infinite Y axis"); + def->category = L("Printable space"); + def->tooltip = L("Enable infinite Y axis for belt printers. " + "When enabled, the Y axis build volume limit is effectively removed, " + "allowing objects of any length to be printed along the belt direction."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(true)); + def = this->add("tree_support_branch_angle", coFloat); def->label = L("Tree support branch angle"); def->category = L("Support"); @@ -10827,10 +10859,16 @@ Polygons get_bed_excluded_area(const PrintConfig& cfg) { const Pointfs exclude_area_points = cfg.bed_exclude_area.values; + // Belt printer: project exclusion zone points from belt surface to machine-frame XY. + // On the belt surface, Z=0, so machine_Y = belt_Y * cos(angle). + const bool is_belt = cfg.belt_printer.value; + const double belt_cos = is_belt ? std::cos(Geometry::deg2rad(cfg.belt_printer_angle.value)) : 1.0; + Polygon exclude_poly; for (int i = 0; i < exclude_area_points.size(); i++) { auto pt = exclude_area_points[i]; - exclude_poly.points.emplace_back(scale_(pt.x()), scale_(pt.y())); + double y = is_belt ? pt.y() * belt_cos : pt.y(); + exclude_poly.points.emplace_back(scale_(pt.x()), scale_(y)); } exclude_poly.make_counter_clockwise(); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 6b9ad65185..080956c1dd 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1412,6 +1412,10 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( // Build plate tilt for off-axis gravity support generation (printer-level setting). ((ConfigOptionFloat, build_plate_tilt_x)) ((ConfigOptionFloat, build_plate_tilt_y)) + // Belt printer settings (printer-level). + ((ConfigOptionBool, belt_printer)) + ((ConfigOptionFloat, belt_printer_angle)) + ((ConfigOptionBool, belt_printer_infinite_y)) //BBS ((ConfigOptionInts, additional_cooling_fan_speed)) ((ConfigOptionBool, reduce_crossing_wall)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index fc68fce76b..979953fb94 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -3391,7 +3391,9 @@ void PrintObject::update_slicing_parameters() { // Orca: updated function call for XYZ shrinkage compensation if (!m_slicing_params.valid) { - m_slicing_params = SlicingParameters::create_from_config(this->print()->config(), m_config, this->model_object()->max_z(), + coordf_t object_height = this->model_object()->max_z(); + // Belt printer: height adjustment placeholder (to be implemented in next cycle). + m_slicing_params = SlicingParameters::create_from_config(this->print()->config(), m_config, object_height, this->object_extruders(), this->print()->shrinkage_compensation()); } } @@ -3432,6 +3434,7 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full if (object_max_z <= 0.f) object_max_z = (float)model_object.raw_bounding_box().size().z(); + // Belt printer: height adjustment placeholder (to be implemented in next cycle). return SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); } diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 2d67ac0939..bba4593764 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -8,6 +8,7 @@ #include "Layer.hpp" #include "MultiMaterialSegmentation.hpp" #include "Print.hpp" +#include "Geometry.hpp" //BBS #include "ShortestPath.hpp" #include "libslic3r/Feature/Interlocking/InterlockingGenerator.hpp" @@ -139,6 +140,7 @@ static std::vector slice_volumes_inner( params_base.closing_radius = print_object_config.slice_closing_radius.value; params_base.extra_offset = 0; params_base.trafo = object_trafo; + // Belt printer: mesh transform placeholder (to be implemented in next cycle). //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. params_base.resolution = print_config.resolution <= 0.001 ? 0.0f : 0.0025; diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 3f5cd306ad..101279d744 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -387,14 +387,18 @@ void Bed3D::render_internal(GLCanvas3D& canvas, const Transform3d& view_matrix, m_model.set_color(m_is_dark ? DEFAULT_MODEL_COLOR_DARK : DEFAULT_MODEL_COLOR); + // Belt printer: bed view transform placeholder (to be implemented in next cycle). + Transform3d belt_view_matrix = view_matrix; + switch (m_type) { - case Type::System: { render_system(canvas, view_matrix, projection_matrix, bottom); break; } + case Type::System: { render_system(canvas, belt_view_matrix, projection_matrix, bottom); break; } default: - case Type::Custom: { render_custom(canvas, view_matrix, projection_matrix, bottom); break; } + case Type::Custom: { render_custom(canvas, belt_view_matrix, projection_matrix, bottom); break; } } render_gravity_arrow(view_matrix, projection_matrix); + render_slicing_plane(view_matrix, projection_matrix); glsafe(::glDisable(GL_DEPTH_TEST)); } @@ -738,6 +742,10 @@ void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; double tilt_x_deg = cfg.opt_float("build_plate_tilt_x"); double tilt_y_deg = cfg.opt_float("build_plate_tilt_y"); + // Belt printer: auto-derive gravity direction from belt angle if belt mode is active. + if (m_is_belt_printer && m_belt_angle > 0.f) { + tilt_x_deg = m_belt_angle; + } if (tilt_x_deg == 0. && tilt_y_deg == 0.) { m_gravity_arrow.reset(); return; @@ -790,6 +798,61 @@ void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform shader->stop_using(); } +void Bed3D::render_slicing_plane(const Transform3d& view_matrix, const Transform3d& projection_matrix) +{ + if (!m_is_belt_printer || m_belt_angle <= 0.f) + return; + + // Build a quad in the XZ plane (world frame) representing the belt slicing plane. + // The plane is tilted at belt_angle from horizontal, with normal (0, -sin(a), cos(a)). + // We render it as a semi-transparent quad centered on the build plate. + if (!m_slicing_plane.is_initialized()) { + const float half_size = 120.f; // mm, large enough to be visible + GLModel::Geometry init_data; + init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 }; + init_data.reserve_vertices(4); + init_data.reserve_indices(2); // 2 triangles + + // Quad corners in local frame (XY plane, will be rotated to match slicing plane) + Vec3f n = Vec3f::UnitZ(); + init_data.add_vertex(Vec3f(-half_size, -half_size, 0.f), n); + init_data.add_vertex(Vec3f( half_size, -half_size, 0.f), n); + init_data.add_vertex(Vec3f( half_size, half_size, 0.f), n); + init_data.add_vertex(Vec3f(-half_size, half_size, 0.f), n); + init_data.add_triangle(0, 1, 2); + init_data.add_triangle(0, 2, 3); + + m_slicing_plane.init_from(std::move(init_data)); + } + + GLShaderProgram* shader = wxGetApp().get_shader("flat"); + if (shader == nullptr) + return; + + glsafe(::glEnable(GL_DEPTH_TEST)); + glsafe(::glEnable(GL_BLEND)); + glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); + + shader->start_using(); + + // Show a tilted plane representing the slicing direction. + // The slicing plane is rotated by belt_angle about X from horizontal. + // Raise it slightly so it's visible above the bed surface. + double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); + Transform3d model_matrix = Transform3d::Identity(); + model_matrix.translate(Vec3d(0., 0., 30.)); + model_matrix.rotate(Eigen::AngleAxisd(angle_rad, Vec3d::UnitX())); + + shader->set_uniform("view_model_matrix", view_matrix * model_matrix); + shader->set_uniform("projection_matrix", projection_matrix); + + m_slicing_plane.set_color({ 0.2f, 0.6f, 1.0f, 0.3f }); // semi-transparent blue + m_slicing_plane.render(); + + glsafe(::glDisable(GL_BLEND)); + shader->stop_using(); +} + void Bed3D::render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix) { // m_texture.reset(); diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index b16ead575b..005dbff534 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -111,6 +111,7 @@ private: GLModel m_model; Vec3d m_model_offset{ Vec3d::Zero() }; GLModel m_gravity_arrow; + GLModel m_slicing_plane; // Debug: shows the intended slicing plane direction Axes m_axes; float m_scale_factor{ 1.0f }; @@ -120,6 +121,9 @@ private: std::vector> m_extruder_shapes; std::vector m_extruder_heights; bool m_is_dark = false; + // Belt printer state for rendering. + bool m_is_belt_printer = false; + float m_belt_angle = 0.f; public: Bed3D() = default; @@ -139,6 +143,12 @@ public: // Build volume geometry for various collision detection tasks. const BuildVolume& build_volume() const { return m_build_volume; } + BuildVolume& build_volume() { return m_build_volume; } + + // Belt printer bed settings. + void set_belt_printer(bool enabled, float angle_deg) { m_is_belt_printer = enabled; m_belt_angle = angle_deg; } + bool is_belt_printer() const { return m_is_belt_printer; } + float belt_angle() const { return m_belt_angle; } // Was the model provided, or was it generated procedurally? Type get_type() const { return m_type; } @@ -179,6 +189,7 @@ private: void render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom); void render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix); + void render_slicing_plane(const Transform3d& view_matrix, const Transform3d& projection_matrix); // BBS: remove the bed picking logic // void register_raycasters_for_picking(const GLModel::Geometry& geometry, const Transform3d& trafo); diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index f531aebafb..971b108e5f 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -573,9 +573,17 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co auto gcflavor = preset_bundle->printers.get_edited_preset().config.option>("gcode_flavor")->value; + // Belt printer: detect early since it affects multiple toggle decisions below. + bool is_belt_printer = false; + { + const auto *belt_opt = preset_bundle->printers.get_edited_preset().config.option("belt_printer"); + if (belt_opt) + is_belt_printer = belt_opt->value; + } + bool have_volumetric_extrusion_rate_slope = config->option("max_volumetric_extrusion_rate_slope")->value > 0; float have_volumetric_extrusion_rate_slope_segment_length = config->option("max_volumetric_extrusion_rate_slope_segment_length")->value; - toggle_field("enable_arc_fitting", !have_volumetric_extrusion_rate_slope); + toggle_field("enable_arc_fitting", !have_volumetric_extrusion_rate_slope && !is_belt_printer); toggle_line("max_volumetric_extrusion_rate_slope_segment_length", have_volumetric_extrusion_rate_slope); toggle_line("extrusion_rate_smoothing_external_perimeter_only", have_volumetric_extrusion_rate_slope); if(have_volumetric_extrusion_rate_slope) config->set_key_value("enable_arc_fitting", new ConfigOptionBool(false)); @@ -693,13 +701,20 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co } } - bool have_skirt = config->opt_int("skirt_loops") > 0; + // Belt printer: disable skirt, brim, raft, and draft shield controls. + bool have_skirt = config->opt_int("skirt_loops") > 0 && !is_belt_printer; toggle_field("skirt_height", have_skirt && config->opt_enum("draft_shield") != dsEnabled); toggle_line("single_loop_draft_shield", have_skirt); // ORCA: Display one wall if skirt enabled for (auto el : {"skirt_type", "min_skirt_length", "skirt_distance", "skirt_start_angle", "skirt_speed", "draft_shield"}) toggle_field(el, have_skirt); + if (is_belt_printer) { + toggle_field("skirt_loops", false); + toggle_field("skirt_height", false); + } - bool have_brim = (config->opt_enum("brim_type") != btNoBrim); + bool have_brim = (config->opt_enum("brim_type") != btNoBrim) && !is_belt_printer; + if (is_belt_printer) + toggle_field("brim_type", false); toggle_field("brim_object_gap", have_brim); toggle_field("brim_use_efc_outline", have_brim); toggle_field("combine_brims", have_brim); @@ -721,7 +736,9 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co // Hide Elephant foot compensation layers if elefant_foot_compensation is not enabled toggle_line("elefant_foot_compensation_layers", config->opt_float("elefant_foot_compensation") > 0); - bool have_raft = config->opt_int("raft_layers") > 0; + bool have_raft = config->opt_int("raft_layers") > 0 && !is_belt_printer; + if (is_belt_printer) + toggle_field("raft_layers", false); bool have_support_material = config->opt_bool("enable_support") || have_raft; SupportType support_type = config->opt_enum("support_type"); diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 4814548a10..7df0b06ff5 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -2208,7 +2208,9 @@ void GCodeViewer::load_shells(const Print& print, bool initialized, bool force_p void GCodeViewer::render_toolpaths() { const Camera& camera = wxGetApp().plater()->get_camera(); - const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(static_cast(camera.get_view_matrix().matrix().cast())); + Matrix4f view = camera.get_view_matrix().matrix().cast(); + // Belt view: view matrix transform placeholder (to be implemented in next cycle). + const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(view); const libvgcode::Mat4x4 converted_projetion_matrix = libvgcode::convert(static_cast(camera.get_projection_matrix().matrix().cast())); #if VGCODE_ENABLE_COG_AND_TOOL_MARKERS m_viewer.set_cog_marker_scale_factor(m_cog_marker_fixed_screen_size ? 10.0f * m_cog_marker_size * camera.get_inv_zoom() : m_cog_marker_size); diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index dc928b822a..a299b93058 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -237,6 +237,9 @@ private: mutable bool m_no_render_path { false }; bool m_is_dark = false; + bool m_belt_view_enabled = false; + float m_belt_angle_deg = 0.f; + libvgcode::Viewer m_viewer; bool m_loaded_as_preview{ false }; @@ -336,6 +339,9 @@ public: void export_toolpaths_to_obj(const char* filename) const; + void set_belt_printer(bool enabled, float angle_deg) { m_belt_view_enabled = enabled; m_belt_angle_deg = angle_deg; } + bool is_belt_view() const { return m_belt_view_enabled && m_belt_angle_deg > 0.f; } + size_t get_extruders_count() { return m_extruders_count; } void push_combo_style(); void pop_combo_style(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 72f53720c1..6e5872d074 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -10980,6 +10980,24 @@ void Plater::priv::set_bed_shape(const Pointfs &shape, Vec2d shape_position = partplate_list.get_current_shape_position(); bool new_shape = bed.set_shape(shape, printable_height, extruder_areas, extruder_heights, custom_model, force_as_custom, shape_position); + // Belt printer: configure build volume and bed rendering for belt mode. + { + const auto *belt_opt = config->option("belt_printer"); + bool is_belt = belt_opt && belt_opt->value; + if (is_belt) { + double belt_angle = config->opt_float("belt_printer_angle"); + bool infinite_y = config->opt_bool("belt_printer_infinite_y"); + bed.build_volume().set_belt_printer(true, belt_angle, infinite_y); + bed.set_belt_printer(true, static_cast(belt_angle)); + if (preview) + preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, static_cast(belt_angle)); + } else { + bed.set_belt_printer(false, 0.f); + if (preview) + preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(false, 0.f); + } + } + float prev_height_lid, prev_height_rod; partplate_list.get_height_limits(prev_height_lid, prev_height_rod); double height_to_lid = config->opt_float("extruder_clearance_height_to_lid"); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 70265aa81d..3dce081708 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4367,6 +4367,9 @@ void TabPrinter::build_fff() optgroup->append_single_option_line("printable_height", "printer_basic_information_printable_space#printable-height"); optgroup->append_single_option_line("build_plate_tilt_x"); optgroup->append_single_option_line("build_plate_tilt_y"); + optgroup->append_single_option_line("belt_printer"); + optgroup->append_single_option_line("belt_printer_angle"); + optgroup->append_single_option_line("belt_printer_infinite_y"); optgroup->append_single_option_line("support_multi_bed_types","printer_basic_information_printable_space#support-multi-bed-types"); optgroup->append_single_option_line("best_object_pos", "printer_basic_information_printable_space#best-object-position"); // todo: for multi_extruder test @@ -5225,6 +5228,11 @@ void TabPrinter::toggle_options() auto gcf = m_config->option>("gcode_flavor")->value; toggle_line("enable_power_loss_recovery", is_BBL_printer || gcf == gcfMarlinFirmware); + + // Belt printer: show belt-specific settings only when belt_printer is enabled. + bool is_belt = m_config->opt_bool("belt_printer"); + toggle_line("belt_printer_angle", is_belt); + toggle_line("belt_printer_infinite_y", is_belt); } @@ -5396,6 +5404,23 @@ void TabPrinter::update_fff() m_use_silent_mode = m_config->opt_bool("silent_mode"); } + // Belt printer: auto-sync build_plate_tilt_x to belt_printer_angle when belt mode is active. + // When belt mode is off, reset build_plate_tilt_x to 0 if it was set by belt mode. + if (m_config->opt_bool("belt_printer")) { + double belt_angle = m_config->opt_float("belt_printer_angle"); + if (m_config->opt_float("build_plate_tilt_x") != belt_angle) { + m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(belt_angle)); + } + } else { + // Only reset if build_plate_tilt_x matches a typical belt angle (was set by auto-sync). + // Avoid clobbering a manually-set tilt value for non-belt tilted printers. + double current_tilt = m_config->opt_float("build_plate_tilt_x"); + double belt_angle = m_config->opt_float("belt_printer_angle"); + if (current_tilt != 0. && std::abs(current_tilt - belt_angle) < 0.01) { + m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(0.)); + } + } + toggle_options(); } From 501aff7e53871d2de3fa3d037e68ae8fcef1c680 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 12 Mar 2026 14:25:30 -0500 Subject: [PATCH 014/389] Part 2: Replace belt rotation w/ per-axis shear transforms and G-code axis remap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace monolithic belt rotation transform with independent per-axis shear controls (mode/angle/source-axis for X, Y, Z) and G-code axis remapping, giving full flexibility to match any belt printer's coordinate system - Remove all rotation mode logic and intermediate type+axes dropdowns, simplifying the pipeline to pure shear matrices while preserving the default behavior (Y += Z*cot(45deg) with identity remap) - Clean up GCodeWriter, GCodeProcessor, and GCodeViewer for the new shear-only model; expose 12 new settings in printer UI via Tab.cpp/Preset.cpp Implement belt printer tilted slicing Implement the core belt slicing pipeline that makes the slicer tilt-aware: Step 1: GCodeWriter::to_machine_coords() - R(+alpha, X) rotation from slicing frame to machine frame Step 2: PrintObject - belt-rotated object height calculation (y*sin(a) + z*cos(a)) for correct layer count Step 3: PrintObjectSlice - apply R(-alpha, X) rotation trafo so horizontal slice planes correspond to belt-parallel planes, with Z-shift computed from model volumes Step 4: GCodeProcessor - machine-frame preview (no transform needed) Step 5: 3DBed - rotate bed visualization about X by belt angle Fix: belt surface IS the build plate, no mesh rotation Currently still slicing perpendicular to the belt normal. Need to figure out why. Fix G-code Z sign: use R(-alpha, X) so Z+ is away from belt The previous R(+alpha, X) transform produced negative Z values (-y*sin(a) term dominated). Changed to R(-alpha, X) which gives machine_z = y*sin(a) + z*cos(a), always positive for points above the belt surface. Z increases with each layer as expected. reverting and changing slice methodology Add pink slicing direction arrow from origin Shows the effective slicing direction (gantry normal) as a pink arrow from the origin. Shorter and wider than the gravity arrow. Direction: R(+alpha, X) * Z = (0, -sin(a), cos(a)), which is the layer stacking direction in the original mesh frame. Fix slicing arrow visibility and add raw G-code toggle - Disable depth test for pink slicing arrow so it renders on top of the tilted bed geometry (was being occluded) - Remove unnecessary 5mm Z-offset from arrow position - Add m_belt_show_raw toggle to GCodeViewer - Add "Show raw G-code (slicing frame)" checkbox in legend when belt mode is active Implement to_machine_coords inverse rotation for belt printer G-code The slicing pipeline rotates the mesh by R(-alpha, X) and shifts Z to start at 0. The G-code output now undoes this transform via to_machine_coords: R(+alpha, X) * T(0,0,+z_shift), recovering the original machine-frame coordinates where Y is horizontal and Z is vertical. Changes: - GCodeWriter: implement to_machine_coords with inverse rotation + Z-shift - GCodeWriter: add belt_z_shift member and setter/getter - GCode.cpp: compute Z-shift from print objects (same logic as PrintObjectSlice) and pass to writer; write z_shift to G-code header - GCodeProcessor: parse belt_z_shift from G-code header - GCodeViewer: store belt_z_shift from processor result Wire raw G-code toggle to apply slicing-frame view transform When "Show raw G-code (slicing frame)" is checked in the preview legend, the view matrix is modified to apply R(-alpha, X) * T(0,0,-z_shift) to the toolpath rendering. This shows the G-code as it was during slicing: rotated part with horizontal layers. Default (unchecked): machine-frame view — upright part with tilted layers. Remove belt printer placeholder comment from GCodeProcessor The preview now correctly displays machine-frame G-code with the optional raw view toggle. No transform is needed in the processor. --- src/libslic3r/GCode.cpp | 27 ++++++++- src/libslic3r/GCode/GCodeProcessor.cpp | 9 ++- src/libslic3r/GCode/GCodeProcessor.hpp | 3 +- src/libslic3r/GCodeWriter.cpp | 16 +++++- src/libslic3r/GCodeWriter.hpp | 7 ++- src/libslic3r/PrintObject.cpp | 19 +++++-- src/libslic3r/PrintObjectSlice.cpp | 20 ++++++- src/slic3r/GUI/3DBed.cpp | 79 ++++++++++++++++++++++++-- src/slic3r/GUI/3DBed.hpp | 2 + src/slic3r/GUI/GCodeViewer.cpp | 20 ++++++- src/slic3r/GUI/GCodeViewer.hpp | 2 + 11 files changed, 183 insertions(+), 21 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 7b881ea74f..dd9e477149 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -8,6 +8,7 @@ #include "Exception.hpp" #include "ExtrusionEntity.hpp" #include "EdgeGrid.hpp" +#include "Geometry.hpp" #include "Geometry/ConvexHull.hpp" #include "GCode/PrintExtents.hpp" #include "GCode/Thumbnails.hpp" @@ -2414,8 +2415,28 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_writer.set_is_bbl_machine(is_bbl_printers); // Belt printer: initialize coordinate transformation on the writer. - if (print.config().belt_printer.value) + if (print.config().belt_printer.value) { m_writer.set_belt_angle(print.config().belt_printer_angle.value); + // Compute the Z-shift that was applied during slicing (same logic as PrintObjectSlice.cpp). + // This is needed by to_machine_coords() to undo the slicing transform. + // For multiple objects, use the minimum min_z_rotated across all objects. + double angle_rad = Geometry::deg2rad(print.config().belt_printer_angle.value); + Transform3d belt_rotation = Transform3d::Identity(); + belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); + double global_min_z = std::numeric_limits::max(); + for (const PrintObject *obj : print.objects()) { + Transform3d obj_trafo = belt_rotation * obj->trafo_centered(); + for (const ModelVolume *mv : obj->model_object()->volumes) { + if (! mv->is_model_part() && ! mv->is_modifier()) + continue; + BoundingBoxf3 bb = mv->mesh().bounding_box(); + bb = bb.transformed(obj_trafo * mv->get_matrix()); + global_min_z = std::min(global_min_z, bb.min.z()); + } + } + if (global_min_z != std::numeric_limits::max() && std::abs(global_min_z) > EPSILON) + m_writer.set_belt_z_shift(global_min_z); // typically negative + } // How many times will be change_layer() called? // change_layer() in turn increments the progress bar status. @@ -2507,8 +2528,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Write information on the generator. file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str()); // Belt printer: embed angle in header for G-code processor detection. - if (print.config().belt_printer.value) + if (print.config().belt_printer.value) { file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); + file.write_format("; belt_z_shift = %.4f\n", m_writer.belt_z_shift()); + } if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); //BBS: total layer number diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 6c5c837b92..eddfc56440 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2597,8 +2597,6 @@ void GCodeProcessor::finalize(bool post_process) } } - // Belt printer: preview coordinate transform placeholder (to be implemented in next cycle). - calculate_time(m_result); // process the time blocks @@ -3053,6 +3051,13 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers } catch (...) {} return; } + // Belt printer Z-shift for raw G-code toggle in preview. + if (boost::starts_with(comment, " belt_z_shift = ")) { + try { + m_result.belt_z_shift = std::stof(std::string(comment.substr(16))); + } catch (...) {} + return; + } // wipe start tag if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) { diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index e432a165a8..af68a5a6b7 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -227,8 +227,9 @@ class Print; bool support_traditional_timelapse{true}; float printable_height; float z_offset; - // Belt printer: angle for coordinate transformation in preview. + // Belt printer: angle and Z-shift for coordinate transformation in preview. float belt_printer_angle{ 0.f }; + float belt_z_shift{ 0.f }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 7d4ac3babb..bb606b222e 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -29,8 +29,20 @@ void GCodeWriter::set_belt_angle(double angle_deg) Vec3d GCodeWriter::to_machine_coords(const Vec3d &pos) const { - // Belt printer: coordinate transform placeholder (to be implemented in next cycle). - return pos; + if (!is_belt_printer()) + return pos; + + // Undo the slicing transform to recover machine-frame coordinates. + // Slicing applied: T(0,0,-min_z_rot) * R(-alpha, X) * original_pos + // Inverse: R(+alpha, X) * T(0,0,+min_z_rot) * slicing_pos + // + // First undo the Z-shift, then apply R(+alpha, X). + double sz = pos.z() + m_belt_z_shift; // undo T(0,0,-min_z_rot) + return Vec3d( + pos.x(), + pos.y() * m_belt_cos - sz * m_belt_sin, // R(+alpha, X) + pos.y() * m_belt_sin + sz * m_belt_cos + ); } bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 10159d941f..f9b5ed79ac 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -127,8 +127,10 @@ public: // Belt printer: set the belt angle and precompute sin/cos for coordinate transformation. void set_belt_angle(double angle_deg); + void set_belt_z_shift(double z_shift) { m_belt_z_shift = z_shift; } + double belt_z_shift() const { return m_belt_z_shift; } bool is_belt_printer() const { return m_belt_angle_rad != 0.; } - // Transform a point from the slicing frame to machine/world coordinates (inverse shear). + // Transform a point from the slicing frame to machine/world coordinates (inverse rotation). Vec3d to_machine_coords(const Vec3d &pos) const; // Returns whether this flavor supports separate print and travel acceleration. @@ -184,10 +186,11 @@ public: //SoftFever bool m_is_bbl_printers = false; - // Belt printer coordinate transformation (YZ shear) + // Belt printer coordinate transformation (inverse of slicing rotation) double m_belt_angle_rad = 0.; double m_belt_cos = 1.0; double m_belt_sin = 0.0; + double m_belt_z_shift = 0.; // Z-shift applied during slicing (min_z_rotated, typically negative) double m_current_speed; bool m_is_first_layer = true; diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 979953fb94..08ff847951 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -3392,7 +3392,13 @@ void PrintObject::update_slicing_parameters() // Orca: updated function call for XYZ shrinkage compensation if (!m_slicing_params.valid) { coordf_t object_height = this->model_object()->max_z(); - // Belt printer: height adjustment placeholder (to be implemented in next cycle). + if (this->print()->config().belt_printer.value) { + // After mesh rotation R(-alpha, X), effective height in the slicing + // direction is y_extent*sin(a) + z_extent*cos(a). + double angle_rad = Geometry::deg2rad(this->print()->config().belt_printer_angle.value); + BoundingBoxf3 bb = this->model_object()->raw_bounding_box(); + object_height = bb.size().y() * std::sin(angle_rad) + bb.size().z() * std::cos(angle_rad); + } m_slicing_params = SlicingParameters::create_from_config(this->print()->config(), m_config, object_height, this->object_extruders(), this->print()->shrinkage_compensation()); } @@ -3432,9 +3438,14 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full sort_remove_duplicates(object_extruders); //FIXME add painting extruders - if (object_max_z <= 0.f) - object_max_z = (float)model_object.raw_bounding_box().size().z(); - // Belt printer: height adjustment placeholder (to be implemented in next cycle). + if (object_max_z <= 0.f) { + BoundingBoxf3 bb = model_object.raw_bounding_box(); + object_max_z = (float)bb.size().z(); + if (print_config.belt_printer.value) { + double angle_rad = Geometry::deg2rad(print_config.belt_printer_angle.value); + object_max_z = (float)(bb.size().y() * std::sin(angle_rad) + bb.size().z() * std::cos(angle_rad)); + } + } return SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); } diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index bba4593764..2748151aa0 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -140,7 +140,25 @@ static std::vector slice_volumes_inner( params_base.closing_radius = print_object_config.slice_closing_radius.value; params_base.extra_offset = 0; params_base.trafo = object_trafo; - // Belt printer: mesh transform placeholder (to be implemented in next cycle). + if (print_config.belt_printer.value) { + double angle_rad = Geometry::deg2rad(print_config.belt_printer_angle.value); + // Rotate mesh by -alpha about X so horizontal slice planes = gantry-parallel planes. + // The gantry (XY) is tilted by belt_printer_angle; this rotation aligns it with horizontal. + Transform3d belt_rotation = Transform3d::Identity(); + belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); + params_base.trafo = belt_rotation * params_base.trafo; + // Compute Z-shift from model_volumes: find min-Z of all rotated meshes + // so the rotated geometry starts at Z=0 (the belt surface in slicing frame). + double min_z_rotated = std::numeric_limits::max(); + for (const ModelVolume *mv : model_volumes) { + if (!model_volume_needs_slicing(*mv)) continue; + BoundingBoxf3 bb = mv->mesh().bounding_box(); + bb = bb.transformed(params_base.trafo * mv->get_matrix()); + min_z_rotated = std::min(min_z_rotated, bb.min.z()); + } + if (min_z_rotated != std::numeric_limits::max() && std::abs(min_z_rotated) > EPSILON) + params_base.trafo = Eigen::Translation3d(0, 0, -min_z_rotated) * params_base.trafo; + } //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. params_base.resolution = print_config.resolution <= 0.001 ? 0.0f : 0.0025; diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 101279d744..858182946c 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -387,17 +387,18 @@ void Bed3D::render_internal(GLCanvas3D& canvas, const Transform3d& view_matrix, m_model.set_color(m_is_dark ? DEFAULT_MODEL_COLOR_DARK : DEFAULT_MODEL_COLOR); - // Belt printer: bed view transform placeholder (to be implemented in next cycle). - Transform3d belt_view_matrix = view_matrix; + // Belt printer: bed rotation is applied inside render_model() and render_default() + // using m_is_belt_printer and m_belt_angle members. switch (m_type) { - case Type::System: { render_system(canvas, belt_view_matrix, projection_matrix, bottom); break; } + case Type::System: { render_system(canvas, view_matrix, projection_matrix, bottom); break; } default: - case Type::Custom: { render_custom(canvas, belt_view_matrix, projection_matrix, bottom); break; } + case Type::Custom: { render_custom(canvas, view_matrix, projection_matrix, bottom); break; } } render_gravity_arrow(view_matrix, projection_matrix); + render_slicing_arrow(view_matrix, projection_matrix); render_slicing_plane(view_matrix, projection_matrix); glsafe(::glDisable(GL_DEPTH_TEST)); @@ -698,7 +699,13 @@ void Bed3D::render_model(const Transform3d& view_matrix, const Transform3d& proj if (shader != nullptr) { shader->start_using(); shader->set_uniform("emission_factor", 0.0f); - const Transform3d model_matrix = Geometry::assemble_transform(m_model_offset); + Transform3d model_matrix = Geometry::assemble_transform(m_model_offset); + // Belt printer: rotate the bed model about X so the belt tilt is visible. + // Negative angle: belt surface tilts downward away from the nozzle. + if (m_is_belt_printer && m_belt_angle > 0.f) { + double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); + model_matrix = Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX()) * model_matrix; + } shader->set_uniform("volume_world_matrix", model_matrix); shader->set_uniform("view_model_matrix", view_matrix * model_matrix); shader->set_uniform("projection_matrix", projection_matrix); @@ -798,6 +805,58 @@ void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform shader->stop_using(); } +void Bed3D::render_slicing_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix) +{ + if (!m_is_belt_printer || m_belt_angle <= 0.f) + return; + + // Build the arrow model: shorter and wider than the gravity arrow. + if (!m_slicing_arrow.is_initialized()) { + const float stem_length = 15.0f; // shorter than gravity arrow (25) + const float stem_radius = 1.0f; // wider than gravity arrow (~0.33) + const float tip_radius = 3.0f; // wider tip + const float tip_length = 5.0f; + m_slicing_arrow.init_from(stilized_arrow(16, tip_radius, tip_length, stem_radius, stem_length)); + } + + // The slicing direction: layers stack along the gantry normal. + // With mesh rotation R(-alpha, X), the slicing Z-axis in the original frame + // points in direction R(+alpha, X) * (0, 0, 1) = (0, -sin(alpha), cos(alpha)). + double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); + Vec3d slice_dir = Vec3d(0., -std::sin(angle_rad), std::cos(angle_rad)).normalized(); + + // Compute rotation to align +Z (arrow default) with slice_dir. + Vec3d from = Vec3d::UnitZ(); + double dot = from.dot(slice_dir); + Transform3d rot = Transform3d::Identity(); + if (dot < -0.9999) { + rot = Eigen::AngleAxisd(M_PI, Vec3d::UnitX()) * rot; + } else if (dot < 0.9999) { + Vec3d axis = from.cross(slice_dir).normalized(); + double angle = std::acos(std::clamp(dot, -1.0, 1.0)); + rot = Eigen::AngleAxisd(angle, axis) * rot; + } + + GLShaderProgram* shader = wxGetApp().get_shader("flat"); + if (shader == nullptr) + return; + + // Disable depth test so the arrow is always visible (not occluded by the tilted bed). + glsafe(::glDisable(GL_DEPTH_TEST)); + shader->start_using(); + + const Camera& camera = wxGetApp().plater()->get_camera(); + Transform3d model_matrix = rot; + shader->set_uniform("view_model_matrix", camera.get_view_matrix() * model_matrix); + shader->set_uniform("projection_matrix", camera.get_projection_matrix()); + + m_slicing_arrow.set_color({ 1.0f, 0.2f, 0.6f, 1.0f }); // pink + m_slicing_arrow.render(); + + shader->stop_using(); + glsafe(::glEnable(GL_DEPTH_TEST)); +} + void Bed3D::render_slicing_plane(const Transform3d& view_matrix, const Transform3d& projection_matrix) { if (!m_is_belt_printer || m_belt_angle <= 0.f) @@ -863,7 +922,15 @@ void Bed3D::render_default(bool bottom, const Transform3d& view_matrix, const Tr if (shader != nullptr) { shader->start_using(); - shader->set_uniform("view_model_matrix", view_matrix); + // Belt printer: rotate the default bed about X so the belt tilt is visible. + Transform3d view_model_matrix = view_matrix; + if (m_is_belt_printer && m_belt_angle > 0.f) { + double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); + Transform3d belt_rotation = Transform3d::Identity(); + belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); + view_model_matrix = view_matrix * belt_rotation; + } + shader->set_uniform("view_model_matrix", view_model_matrix); shader->set_uniform("projection_matrix", projection_matrix); glsafe(::glEnable(GL_DEPTH_TEST)); diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index 005dbff534..d01273961d 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -111,6 +111,7 @@ private: GLModel m_model; Vec3d m_model_offset{ Vec3d::Zero() }; GLModel m_gravity_arrow; + GLModel m_slicing_arrow; // Pink arrow showing the effective slicing direction GLModel m_slicing_plane; // Debug: shows the intended slicing plane direction Axes m_axes; @@ -189,6 +190,7 @@ private: void render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom); void render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix); + void render_slicing_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_slicing_plane(const Transform3d& view_matrix, const Transform3d& projection_matrix); // BBS: remove the bed picking logic diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 7df0b06ff5..dd66c918a7 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1271,6 +1271,7 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const m_max_print_height = gcode_result.printable_height; m_z_offset = gcode_result.z_offset; + m_belt_z_shift = gcode_result.belt_z_shift; // load_toolpaths(gcode_result, build_volume, exclude_bounding_box); @@ -2209,7 +2210,16 @@ void GCodeViewer::render_toolpaths() { const Camera& camera = wxGetApp().plater()->get_camera(); Matrix4f view = camera.get_view_matrix().matrix().cast(); - // Belt view: view matrix transform placeholder (to be implemented in next cycle). + // Belt "raw" view: apply slicing rotation to view matrix so toolpaths appear + // in the slicing frame (rotated part with horizontal layers). + if (m_belt_show_raw && m_belt_view_enabled && m_belt_angle_deg > 0.f) { + double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle_deg)); + // Apply R(-alpha, X) * T(0,0,-z_shift) to bring machine coords back to slicing frame. + Transform3d slicing_trafo = Transform3d::Identity(); + slicing_trafo.translate(Vec3d(0., 0., -static_cast(m_belt_z_shift))); + slicing_trafo = Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX()) * slicing_trafo; + view = (camera.get_view_matrix() * slicing_trafo).matrix().cast(); + } const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(view); const libvgcode::Mat4x4 converted_projetion_matrix = libvgcode::convert(static_cast(camera.get_projection_matrix().matrix().cast())); #if VGCODE_ENABLE_COG_AND_TOOL_MARKERS @@ -4406,6 +4416,14 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv if (m_nozzle_nums > 1 && (m_viewer.get_view_type() == libvgcode::EViewType::Summary || m_viewer.get_view_type() == libvgcode::EViewType::ColorPrint)) // ORCA show only on summary and filament tab render_legend_color_arr_recommen(window_padding); + // Belt printer: toggle for viewing raw slicing-frame G-code + if (m_belt_view_enabled) { + ImGui::Spacing(); + ImGui::Dummy({ window_padding, 0 }); + ImGui::SameLine(); + ImGui::Checkbox("Show raw G-code (slicing frame)", &m_belt_show_raw); + } + legend_height = ImGui::GetCurrentWindow()->Size.y; imgui.end(); ImGui::PopStyleColor(7); diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index a299b93058..4bd3746991 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -239,6 +239,8 @@ mutable bool m_no_render_path { false }; bool m_belt_view_enabled = false; float m_belt_angle_deg = 0.f; + float m_belt_z_shift = 0.f; + bool m_belt_show_raw = false; // Toggle: show raw slicing-frame G-code (rotated part) libvgcode::Viewer m_viewer; bool m_loaded_as_preview{ false }; From 98f4d34dcb26257fdae9fc68ff9b4d3064afcb3b Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 12 Mar 2026 20:47:28 -0500 Subject: [PATCH 015/389] Part 2.5: Add global shear transform, support clipping, and belt UI improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implement per-object global shear transform in PrintObject with layer Z-offset calculation, config invalidation, and fix for shared-object layer optimization breaking copied objects - Clip support layers to the transformed belt floor plane and begin work on tree support adaptation for sheared coordinate space - Improve belt UI: gray out inactive sub-options, add B keyboard shortcut for G-code viewer design-view toggle, fix mesh clipping through build plate after shear/scale transform y' = y + z·cot(α), while x' = x and z' = z getting closer to customizable variant getting closer X/Y/Z shear initial clean up UI add 1/sin(a) transform, idea taken from blackbelt cura plugin Things work now (turns out I've been using the wrong set of transforms) --- src/libslic3r/GCode.cpp | 31 ++---- src/libslic3r/GCode/GCodeProcessor.cpp | 8 -- src/libslic3r/GCode/GCodeProcessor.hpp | 3 +- src/libslic3r/GCodeWriter.cpp | 34 ++++--- src/libslic3r/GCodeWriter.hpp | 17 ++-- src/libslic3r/Preset.cpp | 6 +- src/libslic3r/PrintConfig.cpp | 135 +++++++++++++++++++++++++ src/libslic3r/PrintConfig.hpp | 54 ++++++++++ src/libslic3r/PrintObject.cpp | 101 ++++++++++++++++-- src/libslic3r/PrintObjectSlice.cpp | 78 +++++++++++--- src/slic3r/GUI/GCodeViewer.cpp | 22 ++-- src/slic3r/GUI/GCodeViewer.hpp | 3 +- src/slic3r/GUI/Tab.cpp | 51 ++++++++++ 13 files changed, 452 insertions(+), 91 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index dd9e477149..1aeb5497a3 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2411,31 +2411,19 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_is_role_based_fan_on.fill(false); m_fan_mover.release(); - + m_writer.set_is_bbl_machine(is_bbl_printers); - // Belt printer: initialize coordinate transformation on the writer. + // Belt printer: initialize coordinate transformation and axis remap on the writer. if (print.config().belt_printer.value) { m_writer.set_belt_angle(print.config().belt_printer_angle.value); - // Compute the Z-shift that was applied during slicing (same logic as PrintObjectSlice.cpp). - // This is needed by to_machine_coords() to undo the slicing transform. - // For multiple objects, use the minimum min_z_rotated across all objects. - double angle_rad = Geometry::deg2rad(print.config().belt_printer_angle.value); - Transform3d belt_rotation = Transform3d::Identity(); - belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); - double global_min_z = std::numeric_limits::max(); - for (const PrintObject *obj : print.objects()) { - Transform3d obj_trafo = belt_rotation * obj->trafo_centered(); - for (const ModelVolume *mv : obj->model_object()->volumes) { - if (! mv->is_model_part() && ! mv->is_modifier()) - continue; - BoundingBoxf3 bb = mv->mesh().bounding_box(); - bb = bb.transformed(obj_trafo * mv->get_matrix()); - global_min_z = std::min(global_min_z, bb.min.z()); - } - } - if (global_min_z != std::numeric_limits::max() && std::abs(global_min_z) > EPSILON) - m_writer.set_belt_z_shift(global_min_z); // typically negative + m_writer.set_axis_remap( + int(print.config().belt_gcode_remap_x.value), + int(print.config().belt_gcode_remap_y.value), + int(print.config().belt_gcode_remap_z.value)); + // Build volume extents for Rev remap mode. + BoundingBoxf bbox_bed(print.config().printable_area.values); + m_writer.set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), print.config().printable_height.value)); } // How many times will be change_layer() called? @@ -2530,7 +2518,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Belt printer: embed angle in header for G-code processor detection. if (print.config().belt_printer.value) { file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); - file.write_format("; belt_z_shift = %.4f\n", m_writer.belt_z_shift()); } if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index eddfc56440..5dd2c0fc84 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3051,14 +3051,6 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers } catch (...) {} return; } - // Belt printer Z-shift for raw G-code toggle in preview. - if (boost::starts_with(comment, " belt_z_shift = ")) { - try { - m_result.belt_z_shift = std::stof(std::string(comment.substr(16))); - } catch (...) {} - return; - } - // wipe start tag if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) { m_wiping = true; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index af68a5a6b7..e432a165a8 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -227,9 +227,8 @@ class Print; bool support_traditional_timelapse{true}; float printable_height; float z_offset; - // Belt printer: angle and Z-shift for coordinate transformation in preview. + // Belt printer: angle for coordinate transformation in preview. float belt_printer_angle{ 0.f }; - float belt_z_shift{ 0.f }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index bb606b222e..da655a6548 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -23,26 +23,32 @@ bool GCodeWriter::full_gcode_comment = true; void GCodeWriter::set_belt_angle(double angle_deg) { m_belt_angle_rad = Geometry::deg2rad(angle_deg); - m_belt_cos = std::cos(m_belt_angle_rad); - m_belt_sin = std::sin(m_belt_angle_rad); +} + +void GCodeWriter::set_axis_remap(int rx, int ry, int rz) +{ + m_remap_x = rx; + m_remap_y = ry; + m_remap_z = rz; +} + +void GCodeWriter::set_build_volume_max(const Vec3d &max) +{ + m_build_vol_max = max; } Vec3d GCodeWriter::to_machine_coords(const Vec3d &pos) const { if (!is_belt_printer()) return pos; - - // Undo the slicing transform to recover machine-frame coordinates. - // Slicing applied: T(0,0,-min_z_rot) * R(-alpha, X) * original_pos - // Inverse: R(+alpha, X) * T(0,0,+min_z_rot) * slicing_pos - // - // First undo the Z-shift, then apply R(+alpha, X). - double sz = pos.z() + m_belt_z_shift; // undo T(0,0,-min_z_rot) - return Vec3d( - pos.x(), - pos.y() * m_belt_cos - sz * m_belt_sin, // R(+alpha, X) - pos.y() * m_belt_sin + sz * m_belt_cos - ); + // BeltRemapAxis: 0-2 = +X/+Y/+Z, 3-5 = -X/-Y/-Z, 6-8 = Rev X/Y/Z + auto remap = [this, &pos](int r) -> double { + int axis = r % 3; + if (r < 3) return pos[axis]; + if (r < 6) return -pos[axis]; + return m_build_vol_max[axis] - pos[axis]; + }; + return { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; } bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index f9b5ed79ac..6074eb247c 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -127,10 +127,12 @@ public: // Belt printer: set the belt angle and precompute sin/cos for coordinate transformation. void set_belt_angle(double angle_deg); - void set_belt_z_shift(double z_shift) { m_belt_z_shift = z_shift; } - double belt_z_shift() const { return m_belt_z_shift; } bool is_belt_printer() const { return m_belt_angle_rad != 0.; } - // Transform a point from the slicing frame to machine/world coordinates (inverse rotation). + // Set axis remap for G-code output (BeltRemapAxis enum values). + void set_axis_remap(int rx, int ry, int rz); + // Set build volume extents for Rev remap mode (max X, Y, Z). + void set_build_volume_max(const Vec3d &max); + // Transform a point from the slicing frame to machine coordinates. Vec3d to_machine_coords(const Vec3d &pos) const; // Returns whether this flavor supports separate print and travel acceleration. @@ -186,11 +188,12 @@ public: //SoftFever bool m_is_bbl_printers = false; - // Belt printer coordinate transformation (inverse of slicing rotation) + // Belt printer state double m_belt_angle_rad = 0.; - double m_belt_cos = 1.0; - double m_belt_sin = 0.0; - double m_belt_z_shift = 0.; // Z-shift applied during slicing (min_z_rotated, typically negative) + int m_remap_x = 0; + int m_remap_y = 1; + int m_remap_z = 2; + Vec3d m_build_vol_max = Vec3d::Zero(); double m_current_speed; bool m_is_first_layer = true; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 6d8c113480..f2a0cd9d24 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1010,7 +1010,11 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", - "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "gcode_flavor", + "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "belt_shear_x", "belt_shear_x_angle", "belt_shear_x_from", + "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", + "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", + "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", + "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", "gcode_flavor", "fan_kickstart", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", "printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 976a35c126..7290af09fb 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -288,6 +288,44 @@ static t_config_enum_values s_keys_map_SlicingMode { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SlicingMode) +static t_config_enum_values s_keys_map_BeltShearMode { + { "none", int(BeltShearMode::None) }, + { "pos_cot", int(BeltShearMode::PosCot) }, + { "neg_cot", int(BeltShearMode::NegCot) }, + { "pos_tan", int(BeltShearMode::PosTan) }, + { "neg_tan", int(BeltShearMode::NegTan) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltShearMode) + +static t_config_enum_values s_keys_map_BeltAxis { + { "x", int(BeltAxis::X) }, + { "y", int(BeltAxis::Y) }, + { "z", int(BeltAxis::Z) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltAxis) + +static t_config_enum_values s_keys_map_BeltScaleMode { + { "none", int(BeltScaleMode::None) }, + { "inv_sin", int(BeltScaleMode::InvSin) }, + { "inv_cos", int(BeltScaleMode::InvCos) }, + { "sin", int(BeltScaleMode::Sin) }, + { "cos", int(BeltScaleMode::Cos) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltScaleMode) + +static t_config_enum_values s_keys_map_BeltRemapAxis { + { "pos_x", int(BeltRemapAxis::PosX) }, + { "pos_y", int(BeltRemapAxis::PosY) }, + { "pos_z", int(BeltRemapAxis::PosZ) }, + { "neg_x", int(BeltRemapAxis::NegX) }, + { "neg_y", int(BeltRemapAxis::NegY) }, + { "neg_z", int(BeltRemapAxis::NegZ) }, + { "rev_x", int(BeltRemapAxis::RevX) }, + { "rev_y", int(BeltRemapAxis::RevY) }, + { "rev_z", int(BeltRemapAxis::RevZ) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltRemapAxis) + static t_config_enum_values s_keys_map_SupportMaterialPattern { { "rectilinear", smpRectilinear }, { "rectilinear-grid", smpRectilinearGrid }, @@ -5978,6 +6016,103 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(true)); + // Per-axis shear controls for belt printer + auto add_belt_shear_mode = [this](const char *key, const char *label, BeltShearMode default_mode) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Shear function applied to this axis in belt printer mode."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "pos_cot", "neg_cot", "pos_tan", "neg_tan"}; + def->enum_labels = {L("None"), L("+cot(α)"), L("-cot(α)"), L("+tan(α)"), L("-tan(α)")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(default_mode)); + }; + auto add_belt_shear_angle = [this](const char *key, const char *label) { + auto def = this->add(key, coFloat); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Angle (degrees) for the shear function on this axis."); + def->sidetext = L("°"); + def->min = 0.1; + def->max = 89.9; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(45)); + }; + auto add_belt_axis_enum = [this](const char *key, const char *label, const char *tooltip, BeltAxis default_axis) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L(tooltip); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"x", "y", "z"}; + def->enum_labels = {L("X"), L("Y"), L("Z")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(default_axis)); + }; + + add_belt_shear_mode("belt_shear_x", "Function", BeltShearMode::None); + add_belt_shear_angle("belt_shear_x_angle", "Angle"); + add_belt_axis_enum("belt_shear_x_from", "From", "Source axis for X shear.", BeltAxis::Z); + + add_belt_shear_mode("belt_shear_y", "Function", BeltShearMode::PosCot); + add_belt_shear_angle("belt_shear_y_angle", "Angle"); + add_belt_axis_enum("belt_shear_y_from", "From", "Source axis for Y shear.", BeltAxis::Z); + + add_belt_shear_mode("belt_shear_z", "Function", BeltShearMode::None); + add_belt_shear_angle("belt_shear_z_angle", "Angle"); + add_belt_axis_enum("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y); + + // Per-axis scale controls for belt printer + auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Scale factor applied to this axis in belt printer mode."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "inv_sin", "inv_cos", "sin", "cos"}; + def->enum_labels = {L("None"), L("1/sin(α)"), L("1/cos(α)"), L("sin(α)"), L("cos(α)")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(default_mode)); + }; + auto add_belt_scale_angle = [this](const char *key, const char *label) { + auto def = this->add(key, coFloat); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Angle (degrees) for the scale function on this axis."); + def->sidetext = L("°"); + def->min = 0.1; + def->max = 89.9; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(45)); + }; + + add_belt_scale_mode("belt_scale_x", "Function", BeltScaleMode::None); + add_belt_scale_angle("belt_scale_x_angle", "Angle"); + + add_belt_scale_mode("belt_scale_y", "Function", BeltScaleMode::None); + add_belt_scale_angle("belt_scale_y_angle", "Angle"); + + add_belt_scale_mode("belt_scale_z", "Function", BeltScaleMode::None); + add_belt_scale_angle("belt_scale_z_angle", "Angle"); + + // G-code axis remap with sign + auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, BeltRemapAxis default_axis) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L(tooltip); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"pos_x", "pos_y", "pos_z", "neg_x", "neg_y", "neg_z", "rev_x", "rev_y", "rev_z"}; + def->enum_labels = {L("+X"), L("+Y"), L("+Z"), L("-X"), L("-Y"), L("-Z"), L("Rev X"), L("Rev Y"), L("Rev Z")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(default_axis)); + }; + + add_belt_remap("belt_gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output.", BeltRemapAxis::PosX); + add_belt_remap("belt_gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output.", BeltRemapAxis::PosY); + add_belt_remap("belt_gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output.", BeltRemapAxis::PosZ); + def = this->add("tree_support_branch_angle", coFloat); def->label = L("Tree support branch angle"); def->category = L("Support"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 080956c1dd..68e9425a82 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -156,6 +156,38 @@ enum class SlicingMode CloseHoles, }; +enum class BeltShearMode +{ + None, // No shear on this axis + PosCot, // += cot(α) + NegCot, // -= cot(α) + PosTan, // += tan(α) + NegTan, // -= tan(α) +}; + +enum class BeltScaleMode +{ + None, // No scaling (factor = 1) + InvSin, // 1/sin(α) + InvCos, // 1/cos(α) + Sin, // sin(α) + Cos, // cos(α) +}; + +enum class BeltAxis +{ + X = 0, + Y = 1, + Z = 2, +}; + +enum class BeltRemapAxis +{ + PosX = 0, PosY = 1, PosZ = 2, + NegX = 3, NegY = 4, NegZ = 5, + RevX = 6, RevY = 7, RevZ = 8, // Reversed: max - pos +}; + enum SupportMaterialPattern { smpDefault, smpRectilinear, smpRectilinearGrid, smpHoneycomb, @@ -499,6 +531,10 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(NoiseType) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(InfillPattern) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(IroningType) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SlicingMode) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltShearMode) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltScaleMode) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltAxis) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltRemapAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialPattern) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialStyle) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialInterfacePattern) @@ -1416,6 +1452,24 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionBool, belt_printer)) ((ConfigOptionFloat, belt_printer_angle)) ((ConfigOptionBool, belt_printer_infinite_y)) + ((ConfigOptionEnum, belt_shear_x)) + ((ConfigOptionFloat, belt_shear_x_angle)) + ((ConfigOptionEnum, belt_shear_x_from)) + ((ConfigOptionEnum, belt_shear_y)) + ((ConfigOptionFloat, belt_shear_y_angle)) + ((ConfigOptionEnum, belt_shear_y_from)) + ((ConfigOptionEnum, belt_shear_z)) + ((ConfigOptionFloat, belt_shear_z_angle)) + ((ConfigOptionEnum, belt_shear_z_from)) + ((ConfigOptionEnum, belt_scale_x)) + ((ConfigOptionFloat, belt_scale_x_angle)) + ((ConfigOptionEnum, belt_scale_y)) + ((ConfigOptionFloat, belt_scale_y_angle)) + ((ConfigOptionEnum, belt_scale_z)) + ((ConfigOptionFloat, belt_scale_z_angle)) + ((ConfigOptionEnum, belt_gcode_remap_x)) + ((ConfigOptionEnum, belt_gcode_remap_y)) + ((ConfigOptionEnum, belt_gcode_remap_z)) //BBS ((ConfigOptionInts, additional_cooling_fan_speed)) ((ConfigOptionBool, reduce_crossing_wall)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 08ff847951..abd309fbff 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -3392,14 +3392,55 @@ void PrintObject::update_slicing_parameters() // Orca: updated function call for XYZ shrinkage compensation if (!m_slicing_params.valid) { coordf_t object_height = this->model_object()->max_z(); - if (this->print()->config().belt_printer.value) { - // After mesh rotation R(-alpha, X), effective height in the slicing - // direction is y_extent*sin(a) + z_extent*cos(a). - double angle_rad = Geometry::deg2rad(this->print()->config().belt_printer_angle.value); - BoundingBoxf3 bb = this->model_object()->raw_bounding_box(); - object_height = bb.size().y() * std::sin(angle_rad) + bb.size().z() * std::cos(angle_rad); + // Belt shear/scale may change the effective Z height. + const auto &pcfg = this->print()->config(); + if (pcfg.belt_printer.value) { + bool has_z_shear = pcfg.belt_shear_z.value != BeltShearMode::None; + bool has_z_scale = pcfg.belt_scale_z.value != BeltScaleMode::None; + if (has_z_shear || has_z_scale) { + auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + }; + auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } + }; + double shear_factor = has_z_shear ? compute_shear_factor(pcfg.belt_shear_z.value, pcfg.belt_shear_z_angle.value) : 0.; + double scale_z = compute_scale_factor(pcfg.belt_scale_z.value, pcfg.belt_scale_z_angle.value); + if (has_z_shear && std::abs(shear_factor) > EPSILON) { + int from = int(pcfg.belt_shear_z_from.value); + BoundingBoxf3 bb = this->model_object()->raw_bounding_box(); + double min_rz = std::numeric_limits::max(); + double max_rz = std::numeric_limits::lowest(); + for (double vz : {bb.min.z(), bb.max.z()}) + for (double vs : {bb.min(from), bb.max(from)}) { + double new_z = scale_z * (vz + shear_factor * vs); + min_rz = std::min(min_rz, new_z); + max_rz = std::max(max_rz, new_z); + } + object_height = max_rz - min_rz; + } else { + object_height *= scale_z; + } + } } - m_slicing_params = SlicingParameters::create_from_config(this->print()->config(), m_config, object_height, + m_slicing_params = SlicingParameters::create_from_config(pcfg, m_config, object_height, this->object_extruders(), this->print()->shrinkage_compensation()); } } @@ -3441,9 +3482,51 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full if (object_max_z <= 0.f) { BoundingBoxf3 bb = model_object.raw_bounding_box(); object_max_z = (float)bb.size().z(); + // Belt shear/scale may change the effective Z height. if (print_config.belt_printer.value) { - double angle_rad = Geometry::deg2rad(print_config.belt_printer_angle.value); - object_max_z = (float)(bb.size().y() * std::sin(angle_rad) + bb.size().z() * std::cos(angle_rad)); + bool has_z_shear = print_config.belt_shear_z.value != BeltShearMode::None; + bool has_z_scale = print_config.belt_scale_z.value != BeltScaleMode::None; + if (has_z_shear || has_z_scale) { + auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + }; + auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } + }; + double shear_factor = has_z_shear ? compute_shear_factor(print_config.belt_shear_z.value, print_config.belt_shear_z_angle.value) : 0.; + double scale_z = compute_scale_factor(print_config.belt_scale_z.value, print_config.belt_scale_z_angle.value); + if (has_z_shear && std::abs(shear_factor) > EPSILON) { + int from = int(print_config.belt_shear_z_from.value); + double min_rz = std::numeric_limits::max(); + double max_rz = std::numeric_limits::lowest(); + for (double vz : {bb.min.z(), bb.max.z()}) + for (double vs : {bb.min(from), bb.max(from)}) { + double new_z = scale_z * (vz + shear_factor * vs); + min_rz = std::min(min_rz, new_z); + max_rz = std::max(max_rz, new_z); + } + object_max_z = (float)(max_rz - min_rz); + } else { + object_max_z *= (float)scale_z; + } + } } } return SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 2748151aa0..294c245eaa 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -141,23 +141,69 @@ static std::vector slice_volumes_inner( params_base.extra_offset = 0; params_base.trafo = object_trafo; if (print_config.belt_printer.value) { - double angle_rad = Geometry::deg2rad(print_config.belt_printer_angle.value); - // Rotate mesh by -alpha about X so horizontal slice planes = gantry-parallel planes. - // The gantry (XY) is tilted by belt_printer_angle; this rotation aligns it with horizontal. - Transform3d belt_rotation = Transform3d::Identity(); - belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); - params_base.trafo = belt_rotation * params_base.trafo; - // Compute Z-shift from model_volumes: find min-Z of all rotated meshes - // so the rotated geometry starts at Z=0 (the belt surface in slicing frame). - double min_z_rotated = std::numeric_limits::max(); - for (const ModelVolume *mv : model_volumes) { - if (!model_volume_needs_slicing(*mv)) continue; - BoundingBoxf3 bb = mv->mesh().bounding_box(); - bb = bb.transformed(params_base.trafo * mv->get_matrix()); - min_z_rotated = std::min(min_z_rotated, bb.min.z()); + // Build per-axis shear matrix from 3 independent axis configs. + auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + }; + + struct AxisShear { BeltShearMode mode; double angle; int from; }; + AxisShear axes[3] = { + { print_config.belt_shear_x.value, print_config.belt_shear_x_angle.value, int(print_config.belt_shear_x_from.value) }, + { print_config.belt_shear_y.value, print_config.belt_shear_y_angle.value, int(print_config.belt_shear_y_from.value) }, + { print_config.belt_shear_z.value, print_config.belt_shear_z_angle.value, int(print_config.belt_shear_z_from.value) }, + }; + + Transform3d belt_shear = Transform3d::Identity(); + bool has_shear = false; + for (int row = 0; row < 3; ++row) { + if (axes[row].mode != BeltShearMode::None) { + double factor = compute_shear_factor(axes[row].mode, axes[row].angle); + if (std::abs(factor) > EPSILON) { + belt_shear.matrix()(row, axes[row].from) += factor; + has_shear = true; + } + } } - if (min_z_rotated != std::numeric_limits::max() && std::abs(min_z_rotated) > EPSILON) - params_base.trafo = Eigen::Translation3d(0, 0, -min_z_rotated) * params_base.trafo; + + // Build per-axis scale matrix. + auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } + }; + + Transform3d belt_scale = Transform3d::Identity(); + bool has_scale = false; + double sx = compute_scale_factor(print_config.belt_scale_x.value, print_config.belt_scale_x_angle.value); + double sy = compute_scale_factor(print_config.belt_scale_y.value, print_config.belt_scale_y_angle.value); + double sz = compute_scale_factor(print_config.belt_scale_z.value, print_config.belt_scale_z_angle.value); + if (std::abs(sx - 1.) > EPSILON || std::abs(sy - 1.) > EPSILON || std::abs(sz - 1.) > EPSILON) { + belt_scale.matrix()(0, 0) = sx; + belt_scale.matrix()(1, 1) = sy; + belt_scale.matrix()(2, 2) = sz; + has_scale = true; + } + + // Apply: scale * shear * trafo (shear first, then scale). + if (has_shear || has_scale) + params_base.trafo = belt_scale * belt_shear * params_base.trafo; } //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index dd66c918a7..25b4ba4e9c 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1271,7 +1271,7 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const m_max_print_height = gcode_result.printable_height; m_z_offset = gcode_result.z_offset; - m_belt_z_shift = gcode_result.belt_z_shift; + // load_toolpaths(gcode_result, build_volume, exclude_bounding_box); @@ -2210,15 +2210,17 @@ void GCodeViewer::render_toolpaths() { const Camera& camera = wxGetApp().plater()->get_camera(); Matrix4f view = camera.get_view_matrix().matrix().cast(); - // Belt "raw" view: apply slicing rotation to view matrix so toolpaths appear - // in the slicing frame (rotated part with horizontal layers). - if (m_belt_show_raw && m_belt_view_enabled && m_belt_angle_deg > 0.f) { + // Belt "designed" view: apply inverse shear to view matrix so toolpaths appear + // upright (as originally designed) instead of sheared on the belt. + if (m_belt_show_designed && m_belt_view_enabled && m_belt_angle_deg > 0.f) { double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle_deg)); - // Apply R(-alpha, X) * T(0,0,-z_shift) to bring machine coords back to slicing frame. - Transform3d slicing_trafo = Transform3d::Identity(); - slicing_trafo.translate(Vec3d(0., 0., -static_cast(m_belt_z_shift))); - slicing_trafo = Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX()) * slicing_trafo; - view = (camera.get_view_matrix() * slicing_trafo).matrix().cast(); + double sin_a = std::sin(angle_rad); + if (sin_a > 1e-6) { + double cot_alpha = std::cos(angle_rad) / sin_a; + Transform3d inverse_shear = Transform3d::Identity(); + inverse_shear.matrix()(1, 2) = -cot_alpha; // Y -= Z * cot(α) + view = (camera.get_view_matrix() * inverse_shear).matrix().cast(); + } } const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(view); const libvgcode::Mat4x4 converted_projetion_matrix = libvgcode::convert(static_cast(camera.get_projection_matrix().matrix().cast())); @@ -4421,7 +4423,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv ImGui::Spacing(); ImGui::Dummy({ window_padding, 0 }); ImGui::SameLine(); - ImGui::Checkbox("Show raw G-code (slicing frame)", &m_belt_show_raw); + ImGui::Checkbox("Show designed view (upright)", &m_belt_show_designed); } legend_height = ImGui::GetCurrentWindow()->Size.y; diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index 4bd3746991..184c56e915 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -239,8 +239,7 @@ mutable bool m_no_render_path { false }; bool m_belt_view_enabled = false; float m_belt_angle_deg = 0.f; - float m_belt_z_shift = 0.f; - bool m_belt_show_raw = false; // Toggle: show raw slicing-frame G-code (rotated part) + bool m_belt_show_designed = false; // Toggle: show designed (upright) view via inverse shear libvgcode::Viewer m_viewer; bool m_loaded_as_preview{ false }; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 3dce081708..9d1ee6b2ad 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4370,6 +4370,53 @@ void TabPrinter::build_fff() optgroup->append_single_option_line("belt_printer"); optgroup->append_single_option_line("belt_printer_angle"); optgroup->append_single_option_line("belt_printer_infinite_y"); + // Per-axis shear: group mode + angle + source on one row per axis + { + Line line = { L("Shear X"), L("Shear applied to the X axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_x")); + line.append_option(optgroup->get_option("belt_shear_x_angle")); + line.append_option(optgroup->get_option("belt_shear_x_from")); + optgroup->append_line(line); + } + { + Line line = { L("Shear Y"), L("Shear applied to the Y axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_y")); + line.append_option(optgroup->get_option("belt_shear_y_angle")); + line.append_option(optgroup->get_option("belt_shear_y_from")); + optgroup->append_line(line); + } + { + Line line = { L("Shear Z"), L("Shear applied to the Z axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_z")); + line.append_option(optgroup->get_option("belt_shear_z_angle")); + line.append_option(optgroup->get_option("belt_shear_z_from")); + optgroup->append_line(line); + } + { + Line line = { L("Scale X"), L("Scale applied to the X axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_x")); + line.append_option(optgroup->get_option("belt_scale_x_angle")); + optgroup->append_line(line); + } + { + Line line = { L("Scale Y"), L("Scale applied to the Y axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_y")); + line.append_option(optgroup->get_option("belt_scale_y_angle")); + optgroup->append_line(line); + } + { + Line line = { L("Scale Z"), L("Scale applied to the Z axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_z")); + line.append_option(optgroup->get_option("belt_scale_z_angle")); + optgroup->append_line(line); + } + { + Line line = { L("G-code axis remap"), L("Remap slicing-frame axes to machine axes in G-code output") }; + line.append_option(optgroup->get_option("belt_gcode_remap_x")); + line.append_option(optgroup->get_option("belt_gcode_remap_y")); + line.append_option(optgroup->get_option("belt_gcode_remap_z")); + optgroup->append_line(line); + } optgroup->append_single_option_line("support_multi_bed_types","printer_basic_information_printable_space#support-multi-bed-types"); optgroup->append_single_option_line("best_object_pos", "printer_basic_information_printable_space#best-object-position"); // todo: for multi_extruder test @@ -5233,6 +5280,10 @@ void TabPrinter::toggle_options() bool is_belt = m_config->opt_bool("belt_printer"); toggle_line("belt_printer_angle", is_belt); toggle_line("belt_printer_infinite_y", is_belt); + for (auto el : {"belt_shear_x", "belt_shear_y", "belt_shear_z", + "belt_scale_x", "belt_scale_y", "belt_scale_z", + "belt_gcode_remap_x"}) + toggle_line(el, is_belt); } From ea5c6776b33de30ec157e18350922bb9d39a038a Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 18 Mar 2026 12:09:28 -0500 Subject: [PATCH 016/389] Part 2.6: Add belt floor support clipping for all support types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix support clipping z-shift calculation by removing coordinate-space mismatch and sync belt_floor_z_shift with global_z_offset; fix invalidation so posSupportMaterial no longer resets slicing params - Add belt floor polygon clipping to non-organic tree support (slim/strong/hybrid) with collision surface integration in TreeSupportData, belt extension layers, and first-layer brim suppression - Add belt floor clipping to organic tree support pipeline with virtual belt raft layers, per-layer polygons in TreeModelVolumes, and post-generation layer trimming; fix pre-existing processing_last_mesh bug in calculateCollision() Fix belt floor support clipping: z-shift, invalidation, and global offset - Fix support clipping z-shift calculation by removing coordinate-space mismatch (raw_bounding_box min.z vs trafo_centered m_belt_min_z) and sync belt_floor_z_shift with global_z_offset in global shear mode - Fix invalidation so posSupportMaterial no longer resets slicing params, preventing the exact posSlice z-shift from being overwritten by the bounding-box approximation on support-only setting changes - Remove double-counting of global z_offset on support layers — support already inherits the offset from object layers during generation This Work Was Co-Authored-By Claude Opus 4.6 (1M context) UI: gray out inactive belt sub-options, rename to mesh transforms, move to Advanced Fix mesh clipping through build plate after belt shear/scale transform Generalize G-code viewer designed-view toggle for full belt transform Clip support layers to transformed belt floor plane Supports below the tilted build plate (Z = shear_factor * from_axis - min_z) are now clipped via half-plane intersection after generation. Belt floor parameters stored in SlicingParameters and populated in both update_slicing_parameters() and the static slicing_parameters() overload. Make belt G-code viewer toggle more prominent, add B keyboard shortcut - Add separator + teal "Belt Printer" header in legend panel - Append [B] hint to checkbox label - Add B key shortcut in GLCanvas3D to toggle designed/machine view - Read belt_printer_angle from loaded G-code headers to enable belt view Add per-axis global transform option for belt printer shear New belt_shear_{x,y,z}_global bool configs. When enabled, shear incorporates instance shift so objects at different bed positions get position-aware transform (Z += factor * instance_shift_on_from_axis). Fix global shear: use layer Z offset instead of mesh transform, add config invalidation - Global shear offset applied as post-slicing layer print_z adjustment instead of mesh transform (which was absorbed by min_z normalization or shifted mesh out of slice range) - Register all belt transform options in Print::invalidate_state_by_config_options to trigger posSlice re-slicing (the fallback only invalidated Print steps, not PrintObject steps — belt changes had no effect without manual re-slice) - Belt gcode remap options added to steps_gcode (gcode-export only) - Skip empty-first-layer check for belt objects with global Z offset WIP: split instances for global shear, relative Z offsets, debug logging - PrintApply: when belt global mode active, prevent instance grouping by adding unique Z perturbation to trafo — each copy becomes its own PrintObject with independent layers - PrintObjectSlice: compute global Z offset relative to minimum Y shift across all PrintObjects (lowest-Y object stays at Z=0) - Debug logging (warning level) for belt global shift values and offsets Known issues: - Cached posSlice results cause stale offsets when mixing copies with individually-added objects — need to compute min baseline outside slice() - Supports still generate to Z=0 instead of object's global Z offset Fix global shear for copied objects: disable shared-object layer optimization When belt global Z shear is active, each object needs unique layer Z values based on its bed position. The shared-object optimization was causing copies to reuse the source object's layers (and its Z offset) instead of computing their own position-based offset. started work on getting supports to work properly one step forward, one step back this version didn't quite work. Getting somewhere though about to add UI controllable tests added configuration options for supports tweak CLAUDE.md to be more aggressive for my machine. This commit should probably be pulled out before contributing upstream still chasing down some bugs moving objects between slices no longer results in improper Z-height because of caching added more data to the debug logs Z offset is getting more global again still not quite there, I think there's a fundamental logic flaw? hunting for bugs finally have a functional fix Add belt floor clipping to tree supports (organic and non-organic) - Add belt floor polygon clipping to non-organic tree support (slim/strong/hybrid) in draw_circles() and terminate nodes at the belt surface instead of the horizontal build plate - Add belt floor clipping to organic tree support pipeline with virtual belt raft layers for sub-floor branch generation, per-layer belt floor polygons in TreeModelVolumes, and post-generation layer trimming - Fix pre-existing processing_last_mesh bug in TreeModelVolumes that prevented m_anti_overhang (support blockers) from ever being applied; skip empty first layer check for belt printers Commits: current approach: make a face surface to build supports to closer! supports now terminate on shear plane, now need to get shear plane to correct Z height nearly there chasing down logic issues still committing for checkpoint, this still does not work still got logic problems... cull support clipping stashing changes for now. Going to focus on getting the global shear OFF support generation dialed first. beginning per object shear calcs Local shear transform is on correct Z offset now local shear finally works now and needs more testing global shear works now, needs thorough testing debugging non-45 degree angles debugging part 2 supports at all angles work now remove debug logging Add belt floor collision to non-organic tree support pipeline - Integrate belt floor as a collision surface in TreeSupportData so branches route around the belt naturally, replacing the explicit termination checks in drop_nodes() - Add belt extension layers below the object after draw_circles() to allow support geometry to extend to the diagonal belt surface instead of terminating at a horizontal first layer - Fix coordinate overflow in belt floor polygons (scale_(1e4) exceeds int32), skip first-layer brim expansion for belt printers, and extend empty first layer check bypass to all belt modes add debug logging, Z translate for tree supports still not seeing any cutoff surface yet adding debug options attempt #2 at trees if hit Z buildplate stop but don't set to_buildplate true getting closer tree support almost there, just need to get rid of the circles at the beginning getting closer belt / shear plane clip works, need to figure out the buidlplate plane issues more logic, added debugging logs supports now extend somewhat below Z=0 in global shear mode fix bad alloc, add 10mm below build plate fully works now shear transform + prusa tree support generation works now. pull out debug logging --- CLAUDE.md | 22 +- src/libslic3r/BuildVolume.hpp | 2 +- src/libslic3r/GCode.cpp | 30 ++- src/libslic3r/GCode/GCodeProcessor.cpp | 78 ++++++ src/libslic3r/GCode/GCodeProcessor.hpp | 33 +++ src/libslic3r/Preset.cpp | 10 +- src/libslic3r/Print.cpp | 62 ++++- src/libslic3r/Print.hpp | 10 +- src/libslic3r/PrintApply.cpp | 30 ++- src/libslic3r/PrintConfig.cpp | 64 +++++ src/libslic3r/PrintConfig.hpp | 23 ++ src/libslic3r/PrintObject.cpp | 116 ++++++++- src/libslic3r/PrintObjectSlice.cpp | 124 ++++++++- src/libslic3r/Slicing.hpp | 7 + src/libslic3r/Support/SupportCommon.hpp | 6 + src/libslic3r/Support/SupportMaterial.cpp | 290 ++++++++++++++++++++- src/libslic3r/Support/TreeModelVolumes.cpp | 117 ++++++++- src/libslic3r/Support/TreeModelVolumes.hpp | 3 + src/libslic3r/Support/TreeSupport.cpp | 98 ++++++- src/libslic3r/Support/TreeSupport.hpp | 4 + src/libslic3r/Support/TreeSupport3D.cpp | 74 ++++++ src/slic3r/GUI/GCodeViewer.cpp | 26 +- src/slic3r/GUI/GCodeViewer.hpp | 4 + src/slic3r/GUI/GLCanvas3D.cpp | 12 +- src/slic3r/GUI/GUI_ObjectList.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 86 +++++- src/slic3r/GUI/Tab.cpp | 141 ++++++---- 27 files changed, 1337 insertions(+), 137 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 25aa516a56..9bd162c42c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -23,27 +23,7 @@ cmake --build build/arm64 --config RelWithDebInfo --target all -- ### Building on Linux **Always use this command to build the project when testing build issues on Linux.** ```bash -cmake --build build/arm64 --config RelWithDebInfo --target all -- - -``` -### Build test: - -**Always use this command to build the project when testing build issues on Windows.** -```bash -cmake --build . --config %build_type% --target ALL_BUILD -- -m -``` - -### Building on macOS -**Always use this command to build the project when testing build issues on macOS.** -```bash -cmake --build build/arm64 --config RelWithDebInfo --target all -- -``` - -### Building on Linux - **Always use this command to build the project when testing build issues on Linux.** -```bash -cmake --build build --config RelWithDebInfo --target all -- - +systemd-run --user --scope -p MemoryMax=48G cmake --build build --config RelWithDebInfo --target all -- -j18 -l 24 ``` diff --git a/src/libslic3r/BuildVolume.hpp b/src/libslic3r/BuildVolume.hpp index 0494efe9ba..2b0d8c2746 100644 --- a/src/libslic3r/BuildVolume.hpp +++ b/src/libslic3r/BuildVolume.hpp @@ -84,7 +84,7 @@ public: indexed_triangle_set bounding_mesh(bool scale=true) const; // Center of the print bed, unscaled. - Vec2d bed_center() const { return to_2d(m_bboxf.center()); } + Vec2d bed_center() const { return get_extents(m_bed_shape).center(); } // Convex hull of polygon(), scaled. const Polygon& convex_hull() const { return m_convex_hull; } // Smallest enclosing circle of polygon(), scaled. diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 1aeb5497a3..5b1330b202 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1745,8 +1745,16 @@ std::vector GCode::collect_layers_to_print(const PrintObjec // Check that there are extrusions on the very first layer. The case with empty // first layer may result in skirt/brim in the air and maybe other issues. + // Skip this check for belt printers. The shear transform tilts the + // model so the first horizontal layer plane intersects only a thin + // sliver of the model (width ≈ first_layer_height / shear_factor). + // This sliver is often narrower than the nozzle diameter, producing + // zero perimeters and an empty first layer — which is expected, not + // an error. In global shear mode the object may also start above + // Z=0 on the tilted belt surface. if (layers_to_print.size() == 1u) { - if (!has_extrusions) + bool skip_empty_check = object.print()->config().belt_printer.value; + if (!has_extrusions && !skip_empty_check) throw Slic3r::SlicingError(_(L("One object has an empty first layer and can't be printed. Please Cut the bottom or enable supports.")), object.id().id); } @@ -2515,9 +2523,27 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format("; HEADER_BLOCK_START\n"); // Write information on the generator. file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str()); - // Belt printer: embed angle in header for G-code processor detection. + // Belt printer: embed angle and transform configs in header for G-code processor detection. if (print.config().belt_printer.value) { file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); + // Shear configs + const auto &full_cfg = print.full_print_config(); + file.write_format("; belt_shear_x = %s\n", full_cfg.opt_serialize("belt_shear_x").c_str()); + file.write_format("; belt_shear_x_angle = %.1f\n", print.config().belt_shear_x_angle.value); + file.write_format("; belt_shear_x_from = %s\n", full_cfg.opt_serialize("belt_shear_x_from").c_str()); + file.write_format("; belt_shear_y = %s\n", full_cfg.opt_serialize("belt_shear_y").c_str()); + file.write_format("; belt_shear_y_angle = %.1f\n", print.config().belt_shear_y_angle.value); + file.write_format("; belt_shear_y_from = %s\n", full_cfg.opt_serialize("belt_shear_y_from").c_str()); + file.write_format("; belt_shear_z = %s\n", full_cfg.opt_serialize("belt_shear_z").c_str()); + file.write_format("; belt_shear_z_angle = %.1f\n", print.config().belt_shear_z_angle.value); + file.write_format("; belt_shear_z_from = %s\n", full_cfg.opt_serialize("belt_shear_z_from").c_str()); + // Scale configs + file.write_format("; belt_scale_x = %s\n", full_cfg.opt_serialize("belt_scale_x").c_str()); + file.write_format("; belt_scale_x_angle = %.1f\n", print.config().belt_scale_x_angle.value); + file.write_format("; belt_scale_y = %s\n", full_cfg.opt_serialize("belt_scale_y").c_str()); + file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); + file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); + file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); } if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 5dd2c0fc84..8a470eff19 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3051,6 +3051,84 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers } catch (...) {} return; } + // Belt printer: parse shear configs from header comments. + { + auto parse_shear_mode = [](const std::string &s) -> BeltShearMode { + if (s == "pos_cot") return BeltShearMode::PosCot; + if (s == "neg_cot") return BeltShearMode::NegCot; + if (s == "pos_tan") return BeltShearMode::PosTan; + if (s == "neg_tan") return BeltShearMode::NegTan; + return BeltShearMode::None; + }; + auto parse_axis = [](const std::string &s) -> BeltAxis { + if (s == "y") return BeltAxis::Y; + if (s == "z") return BeltAxis::Z; + return BeltAxis::X; + }; + auto parse_scale_mode = [](const std::string &s) -> BeltScaleMode { + if (s == "inv_sin") return BeltScaleMode::InvSin; + if (s == "inv_cos") return BeltScaleMode::InvCos; + if (s == "sin") return BeltScaleMode::Sin; + if (s == "cos") return BeltScaleMode::Cos; + return BeltScaleMode::None; + }; + auto trim = [](const std::string &s) -> std::string { + size_t start = s.find_first_not_of(" \t\r\n"); + size_t end = s.find_last_not_of(" \t\r\n"); + return (start == std::string::npos) ? "" : s.substr(start, end - start + 1); + }; + // Shear X + if (boost::starts_with(comment, " belt_shear_x = ")) { + m_result.belt_shear_x = parse_shear_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_shear_x_angle = ")) { + try { m_result.belt_shear_x_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + if (boost::starts_with(comment, " belt_shear_x_from = ")) { + m_result.belt_shear_x_from = parse_axis(trim(std::string(comment.substr(21)))); return; + } + // Shear Y + if (boost::starts_with(comment, " belt_shear_y = ")) { + m_result.belt_shear_y = parse_shear_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_shear_y_angle = ")) { + try { m_result.belt_shear_y_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + if (boost::starts_with(comment, " belt_shear_y_from = ")) { + m_result.belt_shear_y_from = parse_axis(trim(std::string(comment.substr(21)))); return; + } + // Shear Z + if (boost::starts_with(comment, " belt_shear_z = ")) { + m_result.belt_shear_z = parse_shear_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_shear_z_angle = ")) { + try { m_result.belt_shear_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + if (boost::starts_with(comment, " belt_shear_z_from = ")) { + m_result.belt_shear_z_from = parse_axis(trim(std::string(comment.substr(21)))); return; + } + // Scale X + if (boost::starts_with(comment, " belt_scale_x = ")) { + m_result.belt_scale_x = parse_scale_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_scale_x_angle = ")) { + try { m_result.belt_scale_x_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + // Scale Y + if (boost::starts_with(comment, " belt_scale_y = ")) { + m_result.belt_scale_y = parse_scale_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_scale_y_angle = ")) { + try { m_result.belt_scale_y_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + // Scale Z + if (boost::starts_with(comment, " belt_scale_z = ")) { + m_result.belt_scale_z = parse_scale_mode(trim(std::string(comment.substr(16)))); return; + } + if (boost::starts_with(comment, " belt_scale_z_angle = ")) { + try { m_result.belt_scale_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; + } + } // wipe start tag if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) { m_wiping = true; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index e432a165a8..f953345f4e 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -229,6 +229,23 @@ class Print; float z_offset; // Belt printer: angle for coordinate transformation in preview. float belt_printer_angle{ 0.f }; + // Belt printer: per-axis shear config. + BeltShearMode belt_shear_x{ BeltShearMode::None }; + float belt_shear_x_angle{ 45.f }; + BeltAxis belt_shear_x_from{ BeltAxis::Y }; + BeltShearMode belt_shear_y{ BeltShearMode::None }; + float belt_shear_y_angle{ 45.f }; + BeltAxis belt_shear_y_from{ BeltAxis::Y }; + BeltShearMode belt_shear_z{ BeltShearMode::None }; + float belt_shear_z_angle{ 45.f }; + BeltAxis belt_shear_z_from{ BeltAxis::Y }; + // Belt printer: per-axis scale config. + BeltScaleMode belt_scale_x{ BeltScaleMode::None }; + float belt_scale_x_angle{ 45.f }; + BeltScaleMode belt_scale_y{ BeltScaleMode::None }; + float belt_scale_y_angle{ 45.f }; + BeltScaleMode belt_scale_z{ BeltScaleMode::None }; + float belt_scale_z_angle{ 45.f }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; @@ -288,6 +305,22 @@ class Print; layer_filaments = other.layer_filaments; filament_change_count_map = other.filament_change_count_map; initial_layer_time = other.initial_layer_time; + belt_printer_angle = other.belt_printer_angle; + belt_shear_x = other.belt_shear_x; + belt_shear_x_angle = other.belt_shear_x_angle; + belt_shear_x_from = other.belt_shear_x_from; + belt_shear_y = other.belt_shear_y; + belt_shear_y_angle = other.belt_shear_y_angle; + belt_shear_y_from = other.belt_shear_y_from; + belt_shear_z = other.belt_shear_z; + belt_shear_z_angle = other.belt_shear_z_angle; + belt_shear_z_from = other.belt_shear_z_from; + belt_scale_x = other.belt_scale_x; + belt_scale_x_angle = other.belt_scale_x_angle; + belt_scale_y = other.belt_scale_y; + belt_scale_y_angle = other.belt_scale_y_angle; + belt_scale_z = other.belt_scale_z; + belt_scale_z_angle = other.belt_scale_z_angle; #if ENABLE_GCODE_VIEWER_STATISTICS time = other.time; #endif diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index f2a0cd9d24..3c597ac7f2 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1010,11 +1010,13 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", - "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "belt_shear_x", "belt_shear_x_angle", "belt_shear_x_from", - "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", - "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", + "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "belt_shear_x", "belt_shear_x_angle", "belt_shear_x_from", "belt_shear_x_global", + "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", "belt_shear_y_global", + "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", "belt_shear_z_global", "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", - "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", "gcode_flavor", + "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", + "belt_support_floor_offset", "belt_support_floor_mode", "belt_support_z_offset_mode", + "gcode_flavor", "fan_kickstart", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", "printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index f245cc32b6..0aef12a74b 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -99,6 +99,10 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n // Cache the plenty of parameters, which influence the G-code generator only, // or they are only notes not influencing the generated G-code. static std::unordered_set steps_gcode = { + // Belt printer G-code axis remap (only affects G-code output, not slicing). + "belt_gcode_remap_x", + "belt_gcode_remap_y", + "belt_gcode_remap_z", //BBS "additional_cooling_fan_speed", "reduce_crossing_wall", @@ -275,8 +279,34 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n // Spiral Vase forces different kind of slicing than the normal model: // In Spiral Vase mode, holes are closed and only the largest area contour is kept at each layer. // Therefore toggling the Spiral Vase on / off requires complete reslicing. - || opt_key == "spiral_mode") { + || opt_key == "spiral_mode" + // Belt printer transform options change the mesh geometry before slicing. + || opt_key == "belt_printer" + || opt_key == "belt_printer_angle" + || opt_key == "belt_shear_x" + || opt_key == "belt_shear_x_angle" + || opt_key == "belt_shear_x_from" + || opt_key == "belt_shear_x_global" + || opt_key == "belt_shear_y" + || opt_key == "belt_shear_y_angle" + || opt_key == "belt_shear_y_from" + || opt_key == "belt_shear_y_global" + || opt_key == "belt_shear_z" + || opt_key == "belt_shear_z_angle" + || opt_key == "belt_shear_z_from" + || opt_key == "belt_shear_z_global" + || opt_key == "belt_scale_x" + || opt_key == "belt_scale_x_angle" + || opt_key == "belt_scale_y" + || opt_key == "belt_scale_y_angle" + || opt_key == "belt_scale_z" + || opt_key == "belt_scale_z_angle") { osteps.emplace_back(posSlice); + } else if ( + opt_key == "belt_support_floor_offset" + || opt_key == "belt_support_floor_mode" + || opt_key == "belt_support_z_offset_mode") { + osteps.emplace_back(posSupportMaterial); } else if ( opt_key == "print_sequence" || opt_key == "filament_type" @@ -2124,15 +2154,21 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) int object_count = m_objects.size(); std::set need_slicing_objects; std::set re_slicing_objects; + // Belt global Z shear: each object needs unique layer Z values based on + // its bed position, so sharing layers between "identical" objects is wrong. + bool belt_no_share = m_config.belt_printer.value && m_config.belt_shear_z_global.value + && m_config.belt_shear_z.value != BeltShearMode::None; if (!use_cache) { for (int index = 0; index < object_count; index++) { PrintObject *obj = m_objects[index]; - for (PrintObject *slicing_obj : need_slicing_objects) - { - if (is_print_object_the_same(obj, slicing_obj)) { - obj->set_shared_object(slicing_obj); - break; + if (!belt_no_share) { + for (PrintObject *slicing_obj : need_slicing_objects) + { + if (is_print_object_the_same(obj, slicing_obj)) { + obj->set_shared_object(slicing_obj); + break; + } } } if (!obj->get_shared_object()) @@ -2151,12 +2187,14 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) PrintObject *obj = m_objects[index]; bool found_shared = false; if (need_slicing_objects.find(obj) == need_slicing_objects.end()) { - for (PrintObject *slicing_obj : need_slicing_objects) - { - if (is_print_object_the_same(obj, slicing_obj)) { - obj->set_shared_object(slicing_obj); - found_shared = true; - break; + if (!belt_no_share) { + for (PrintObject *slicing_obj : need_slicing_objects) + { + if (is_print_object_the_same(obj, slicing_obj)) { + obj->set_shared_object(slicing_obj); + found_shared = true; + break; + } } } if (!found_shared) { diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index b98811c8e3..d0c050f442 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -573,7 +573,15 @@ private: PrintObject* m_shared_object{ nullptr }; - + // Belt printer: global Z offset applied to this object's layers for shear positioning. + double m_belt_global_z_offset { 0.0 }; + // Belt printer: min_z of mesh after belt shear (before Z-shift), for z_offset calc. + double m_belt_min_z { 0.0 }; +public: + double belt_global_z_offset() const { return m_belt_global_z_offset; } +private: + + // SoftFever // // object id diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index d2a44463ea..7f3b41b0f1 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -135,22 +135,29 @@ struct PrintObjectTrafoAndInstances // Generate a list of trafos and XY offsets for instances of a ModelObject // Orca: Updated to include XYZ filament shrinkage compensation -static std::vector print_objects_from_model_object(const ModelObject &model_object, const Vec3d &shrinkage_compensation) +static std::vector print_objects_from_model_object(const ModelObject &model_object, const Vec3d &shrinkage_compensation, bool force_separate_instances = false) { std::set trafos; PrintObjectTrafoAndInstances trafo; //BBS: add useful logs for debug int index = 0; + int unique_counter = 0; for (ModelInstance *model_instance : model_object.instances) { if (model_instance->is_printable()) { // Orca: Updated with XYZ filament shrinkage compensation Geometry::Transformation model_instance_transformation = model_instance->get_transformation(); trafo.trafo = model_instance_transformation.get_matrix_with_applied_shrinkage_compensation(shrinkage_compensation); - + auto shift = Point::new_scale(trafo.trafo.data()[12], trafo.trafo.data()[13]); // Reset the XY axes of the transformation. trafo.trafo.data()[12] = 0; trafo.trafo.data()[13] = 0; + // Belt printer global mode: prevent instance grouping so each + // copy gets its own PrintObject with independent layer Z values. + // Add a tiny unique perturbation to the existing Z (don't replace + // it — the Z translation from ensure_on_bed must be preserved). + if (force_separate_instances) + trafo.trafo.data()[14] += 1e-10 * (++unique_counter); // Search or insert a trafo. auto it = trafos.emplace(trafo).first; const_cast(*it).instances.emplace_back(PrintInstance{ nullptr, model_instance, shift }); @@ -1506,11 +1513,16 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ PrintObjectPtrs print_objects_new; print_objects_new.reserve(std::max(m_objects.size(), m_model.objects.size())); bool new_objects = false; + bool belt_instances_shifted = false; // Walk over all new model objects and check, whether there are matching PrintObjects. for (ModelObject *model_object : m_model.objects) { ModelObjectStatus &model_object_status = const_cast(model_object_status_db.reuse(*model_object)); // Orca: Updated for XYZ filament shrink compensation - model_object_status.print_instances = print_objects_from_model_object(*model_object, this->shrinkage_compensation()); + // Belt global mode: force each instance into its own PrintObject + // so each gets independent layer Z values. + bool belt_force_separate = m_config.belt_printer.value && m_config.belt_shear_z_global.value + && m_config.belt_shear_z.value != BeltShearMode::None; + model_object_status.print_instances = print_objects_from_model_object(*model_object, this->shrinkage_compensation(), belt_force_separate); std::vector old; old.reserve(print_object_status_db.count(*model_object)); for (const PrintObjectStatus &print_object_status : print_object_status_db.get_range(*model_object)) @@ -1558,6 +1570,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ if (status != PrintBase::APPLY_STATUS_UNCHANGED) { size_t extruder_num = new_full_config.option("nozzle_diameter")->size(); update_apply_status(status == PrintBase::APPLY_STATUS_INVALIDATED); + belt_instances_shifted = true; } print_objects_new.emplace_back((*it_old)->print_object); const_cast(*it_old)->status = PrintObjectStatus::Reused; @@ -1593,6 +1606,17 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ update_apply_status(object->invalidate_step(posSlice)); } } + + // Belt printer global mode: when any object's instances shifted, + // recompute m_belt_global_z_offset for ALL objects (it depends on + // min_shift across all objects, so one move affects everyone). + if (belt_instances_shifted + && m_config.belt_printer.value + && m_config.belt_shear_z_global.value + && m_config.belt_shear_z.value != BeltShearMode::None) { + for (PrintObject *object : m_objects) + update_apply_status(object->invalidate_step(posSlice)); + } } //BBS: check the config again diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 7290af09fb..96e320ecf4 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -326,6 +326,21 @@ static t_config_enum_values s_keys_map_BeltRemapAxis { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltRemapAxis) +static t_config_enum_values s_keys_map_BeltSupportFloorMode { + { "none", int(BeltSupportFloorMode::None) }, + { "generator_only", int(BeltSupportFloorMode::GeneratorOnly) }, + { "clip_only", int(BeltSupportFloorMode::ClipOnly) }, + { "both", int(BeltSupportFloorMode::Both) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltSupportFloorMode) + +static t_config_enum_values s_keys_map_BeltSupportZOffsetMode { + { "none", int(BeltSupportZOffsetMode::None) }, + { "unconditional", int(BeltSupportZOffsetMode::Unconditional) }, + { "raft_only", int(BeltSupportZOffsetMode::RaftOnly) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltSupportZOffsetMode) + static t_config_enum_values s_keys_map_SupportMaterialPattern { { "rectilinear", smpRectilinear }, { "rectilinear-grid", smpRectilinearGrid }, @@ -6051,17 +6066,29 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionEnum(default_axis)); }; + auto add_belt_shear_global = [this](const char *key, const char *label) { + auto def = this->add(key, coBool); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Apply shear in global coordinates (position-aware) rather than object-local coordinates."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + }; + add_belt_shear_mode("belt_shear_x", "Function", BeltShearMode::None); add_belt_shear_angle("belt_shear_x_angle", "Angle"); add_belt_axis_enum("belt_shear_x_from", "From", "Source axis for X shear.", BeltAxis::Z); + add_belt_shear_global("belt_shear_x_global", "Global"); add_belt_shear_mode("belt_shear_y", "Function", BeltShearMode::PosCot); add_belt_shear_angle("belt_shear_y_angle", "Angle"); add_belt_axis_enum("belt_shear_y_from", "From", "Source axis for Y shear.", BeltAxis::Z); + add_belt_shear_global("belt_shear_y_global", "Global"); add_belt_shear_mode("belt_shear_z", "Function", BeltShearMode::None); add_belt_shear_angle("belt_shear_z_angle", "Angle"); add_belt_axis_enum("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y); + add_belt_shear_global("belt_shear_z_global", "Global"); // Per-axis scale controls for belt printer auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode) { @@ -6113,6 +6140,43 @@ void PrintConfigDef::init_fff_params() add_belt_remap("belt_gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output.", BeltRemapAxis::PosY); add_belt_remap("belt_gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output.", BeltRemapAxis::PosZ); + // Belt support floor debug controls + def = this->add("belt_support_floor_offset", coFloat); + def->label = L("Floor Z offset"); + def->category = L("Printable space"); + def->tooltip = L("Shifts the computed belt floor up or down (mm). Negative values lower the floor, allowing more supports to survive. Use this to diagnose belt floor formula issues."); + def->sidetext = L("mm"); + def->min = -500; + def->max = 500; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0)); + + { + auto def = this->add("belt_support_floor_mode", coEnum); + def->label = L("Floor mode"); + def->category = L("Printable space"); + def->tooltip = L("Controls belt floor awareness for supports. 'None' disables belt floor logic. " + "'Generator only' stops support generation at the belt floor plane."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "generator_only"}; + def->enum_labels = {L("None"), L("Generator only")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(BeltSupportFloorMode::GeneratorOnly)); + } + + { + auto def = this->add("belt_support_z_offset_mode", coEnum); + def->label = L("Z offset mode"); + def->category = L("Printable space"); + def->tooltip = L("How global Z offset is applied to support layers for belt printers with global shear. " + "'None' = don't offset. 'Unconditional' = offset all layers. 'Raft only' = only offset raft layers."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "unconditional", "raft_only"}; + def->enum_labels = {L("None"), L("Unconditional"), L("Raft only")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(BeltSupportZOffsetMode::Unconditional)); + } + def = this->add("tree_support_branch_angle", coFloat); def->label = L("Tree support branch angle"); def->category = L("Support"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 68e9425a82..2d76dcc0b5 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -188,6 +188,21 @@ enum class BeltRemapAxis RevX = 6, RevY = 7, RevZ = 8, // Reversed: max - pos }; +enum class BeltSupportFloorMode +{ + None, // No belt floor awareness + GeneratorOnly, // Only in tree support drop_nodes/contact_points + ClipOnly, // Only post-processing clipping + Both, // Both generator and clipping +}; + +enum class BeltSupportZOffsetMode +{ + None, // Don't apply global_z_offset to support layers + Unconditional, // Apply to all support layers + RaftOnly, // Only apply to raft layers +}; + enum SupportMaterialPattern { smpDefault, smpRectilinear, smpRectilinearGrid, smpHoneycomb, @@ -535,6 +550,8 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltShearMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltScaleMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltRemapAxis) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportFloorMode) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportZOffsetMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialPattern) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialStyle) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialInterfacePattern) @@ -1455,12 +1472,15 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, belt_shear_x)) ((ConfigOptionFloat, belt_shear_x_angle)) ((ConfigOptionEnum, belt_shear_x_from)) + ((ConfigOptionBool, belt_shear_x_global)) ((ConfigOptionEnum, belt_shear_y)) ((ConfigOptionFloat, belt_shear_y_angle)) ((ConfigOptionEnum, belt_shear_y_from)) + ((ConfigOptionBool, belt_shear_y_global)) ((ConfigOptionEnum, belt_shear_z)) ((ConfigOptionFloat, belt_shear_z_angle)) ((ConfigOptionEnum, belt_shear_z_from)) + ((ConfigOptionBool, belt_shear_z_global)) ((ConfigOptionEnum, belt_scale_x)) ((ConfigOptionFloat, belt_scale_x_angle)) ((ConfigOptionEnum, belt_scale_y)) @@ -1470,6 +1490,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, belt_gcode_remap_x)) ((ConfigOptionEnum, belt_gcode_remap_y)) ((ConfigOptionEnum, belt_gcode_remap_z)) + ((ConfigOptionFloat, belt_support_floor_offset)) + ((ConfigOptionEnum, belt_support_floor_mode)) + ((ConfigOptionEnum, belt_support_z_offset_mode)) //BBS ((ConfigOptionInts, additional_cooling_fan_speed)) ((ConfigOptionBool, reduce_crossing_wall)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index abd309fbff..f803cc0369 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -9,6 +9,7 @@ #include "MutablePolygon.hpp" #include "PrintConfig.hpp" #include "Support/SupportMaterial.hpp" +#include "Support/SupportCommon.hpp" #include "Support/SupportSpotsGenerator.hpp" #include "Support/TreeSupport.hpp" #include "Surface.hpp" @@ -1365,7 +1366,12 @@ bool PrintObject::invalidate_step(PrintObjectStep step) } else if (step == posSupportMaterial) { invalidated |= this->invalidate_steps({ posSimplifySupportPath }); invalidated |= m_print->invalidate_steps({ psSkirtBrim }); - m_slicing_params.valid = false; + // NOTE: do NOT set m_slicing_params.valid = false here. + // belt_floor_z_shift is patched to an exact value during posSlice + // (PrintObjectSlice.cpp, after slice_volumes). Invalidating slicing + // params here causes update_slicing_parameters() to overwrite that + // exact value with a bounding-box approximation, while posSlice does + // not re-run to correct it — breaking belt support clipping. } // Wipe tower depends on the ordering of extruders, which in turn depends on everything. @@ -3392,6 +3398,10 @@ void PrintObject::update_slicing_parameters() // Orca: updated function call for XYZ shrinkage compensation if (!m_slicing_params.valid) { coordf_t object_height = this->model_object()->max_z(); + // Belt floor parameters for support clipping (populated below if belt Z-shear is active). + double belt_floor_shear_factor_out = 0.0; + int belt_floor_from_axis_out = 1; + double belt_floor_z_shift_out = 0.0; // Belt shear/scale may change the effective Z height. const auto &pcfg = this->print()->config(); if (pcfg.belt_printer.value) { @@ -3435,6 +3445,12 @@ void PrintObject::update_slicing_parameters() max_rz = std::max(max_rz, new_z); } object_height = max_rz - min_rz; + belt_floor_shear_factor_out = shear_factor; + belt_floor_from_axis_out = from; + // Belt contact surface starts at bb.min.z() pre-shear; add the + // slicing Z-shift that keeps the mesh above Z=0. + // Exact value is patched after slice_volumes() in posSlice. + belt_floor_z_shift_out = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); } else { object_height *= scale_z; } @@ -3442,6 +3458,10 @@ void PrintObject::update_slicing_parameters() } m_slicing_params = SlicingParameters::create_from_config(pcfg, m_config, object_height, this->object_extruders(), this->print()->shrinkage_compensation()); + // Populate belt floor parameters into slicing params for support clipping. + m_slicing_params.belt_floor_shear_factor = belt_floor_shear_factor_out; + m_slicing_params.belt_floor_from_axis = belt_floor_from_axis_out; + m_slicing_params.belt_floor_z_shift = belt_floor_z_shift_out; } } @@ -3479,6 +3499,11 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full sort_remove_duplicates(object_extruders); //FIXME add painting extruders + // Belt floor parameters for support clipping (populated below if belt Z-shear is active). + double belt_floor_shear_factor_out = 0.0; + int belt_floor_from_axis_out = 1; + double belt_floor_z_shift_out = 0.0; + if (object_max_z <= 0.f) { BoundingBoxf3 bb = model_object.raw_bounding_box(); object_max_z = (float)bb.size().z(); @@ -3523,13 +3548,20 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full max_rz = std::max(max_rz, new_z); } object_max_z = (float)(max_rz - min_rz); + belt_floor_shear_factor_out = shear_factor; + belt_floor_from_axis_out = from; + belt_floor_z_shift_out = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); } else { object_max_z *= (float)scale_z; } } } } - return SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); + SlicingParameters params = SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); + params.belt_floor_shear_factor = belt_floor_shear_factor_out; + params.belt_floor_from_axis = belt_floor_from_axis_out; + params.belt_floor_z_shift = belt_floor_z_shift_out; + return params; } // returns 0-based indices of extruders used to print the object (without brim, support and other helper extrusions) @@ -4038,6 +4070,67 @@ void PrintObject::combine_infill() } } +// Belt printer: clip an ExtrusionEntityCollection to a region defined by clip_expoly. +// Handles ExtrusionPath, ExtrusionMultiPath, ExtrusionLoop, and nested ExtrusionEntityCollection. +static void clip_support_fills(ExtrusionEntityCollection &fills, const ExPolygons &clip_region) +{ + ExtrusionEntitiesPtr new_entities; + for (ExtrusionEntity *entity : fills.entities) { + if (auto *path = dynamic_cast(entity)) { + ExtrusionEntityCollection clipped; + path->intersect_expolygons(clip_region, &clipped); + if (!clipped.empty()) { + for (ExtrusionEntity *e : clipped.entities) + new_entities.push_back(e->clone()); + } + delete entity; + } else if (auto *multipath = dynamic_cast(entity)) { + ExtrusionPaths new_paths; + for (const ExtrusionPath &p : multipath->paths) { + ExtrusionEntityCollection clipped; + p.intersect_expolygons(clip_region, &clipped); + for (ExtrusionEntity *e : clipped.entities) + if (auto *cp = dynamic_cast(e)) + new_paths.push_back(std::move(*cp)); + } + if (!new_paths.empty()) { + multipath->paths = std::move(new_paths); + new_entities.push_back(multipath); + } else { + delete entity; + } + } else if (auto *loop = dynamic_cast(entity)) { + ExtrusionPaths new_paths; + for (const ExtrusionPath &p : loop->paths) { + ExtrusionEntityCollection clipped; + p.intersect_expolygons(clip_region, &clipped); + for (ExtrusionEntity *e : clipped.entities) + if (auto *cp = dynamic_cast(e)) + new_paths.push_back(std::move(*cp)); + } + if (!new_paths.empty()) { + // Loop is no longer a closed loop after clipping; emit as individual paths. + for (auto &p : new_paths) + new_entities.push_back(new ExtrusionPath(std::move(p))); + delete entity; + } else { + delete entity; + } + } else if (auto *coll = dynamic_cast(entity)) { + clip_support_fills(*coll, clip_region); + if (!coll->empty()) { + new_entities.push_back(coll); + } else { + delete entity; + } + } else { + // Unknown entity type — keep as-is. + new_entities.push_back(entity); + } + } + fills.entities = std::move(new_entities); +} + void PrintObject::_generate_support_material() { if (is_tree(m_config.support_type.value)) { @@ -4049,6 +4142,25 @@ void PrintObject::_generate_support_material() PrintObjectSupportMaterial support_material(this, m_slicing_params); support_material.generate(*this); } + // Global Z offset for support layers: + // - Normal support: layers already inherit global_z_offset from object layers. + // - Non-organic tree support (slim/strong/hybrid): plan_layer_heights() reads + // from globally-offset object layers, so support layers already have it. + // - Organic tree support: generate_tree_support_3D() computes its own Z values + // independently and does NOT inherit the offset — apply it here. + // Belt floor polygon clipping for non-organic tree support is done inside + // draw_circles() before area_groups and toolpaths are built. + if (is_tree(m_config.support_type.value) && std::abs(m_belt_global_z_offset) > EPSILON) { + // Resolve effective support style (same logic as SupportParameters). + auto style = m_config.support_style.value; + if (style == smsDefault) + style = smsTreeOrganic; + if (style == smsTreeOrganic) { + for (SupportLayer *sl : m_support_layers) + sl->print_z += m_belt_global_z_offset; + } + } + } // BBS diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 294c245eaa..404550da1a 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1,4 +1,5 @@ #include +#include #include @@ -125,7 +126,8 @@ static std::vector slice_volumes_inner( ModelVolumePtrs model_volumes, const std::vector &layer_ranges, const std::vector &zs, - const std::function &throw_on_cancel_callback) + const std::function &throw_on_cancel_callback, + double *out_belt_min_z = nullptr) { model_volumes_sort_by_id(model_volumes); @@ -202,8 +204,32 @@ static std::vector slice_volumes_inner( } // Apply: scale * shear * trafo (shear first, then scale). - if (has_shear || has_scale) + if (has_shear || has_scale) { params_base.trafo = belt_scale * belt_shear * params_base.trafo; + + // After the shear/scale transform, the mesh may clip through the + // build plate (Z < 0). Detect this and shift the mesh up. + Transform3d combined = params_base.trafo; + double min_z = std::numeric_limits::max(); + for (const ModelVolume *mv : model_volumes) { + if (!mv->is_model_part()) continue; + for (const stl_vertex &v : mv->mesh().its.vertices) { + Vec3d pt = combined * v.cast(); + min_z = std::min(min_z, pt.z()); + } + } + double belt_z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; + BOOST_LOG_TRIVIAL(warning) << "Belt Z-shift: min_z=" << min_z + << " z_shift=" << belt_z_shift_val + << " trafo_z=" << object_trafo.matrix()(2, 3); + if (belt_z_shift_val > 0.) { + Transform3d z_shift = Transform3d::Identity(); + z_shift.matrix()(2, 3) = belt_z_shift_val; + params_base.trafo = z_shift * params_base.trafo; + } + if (out_belt_min_z) + *out_belt_min_z = (min_z != std::numeric_limits::max()) ? min_z : 0.; + } } //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. @@ -866,6 +892,20 @@ void PrintObject::slice() m_layers = new_layers(this, generate_object_layers(m_slicing_params, layer_height_profile, m_config.precise_z_height.value)); this->slice_volumes(); m_print->throw_if_canceled(); + + // After slicing, m_belt_min_z holds the exact post-shear minimum Z + // in trafo_centered space (which includes the ensure_on_bed Z offset). + // The belt surface is at Z=0 in trafo_centered space; after shear it + // becomes Z = sf*Y, and after the z-shift that keeps the mesh above + // Z=0 it becomes Z = sf*Y + z_shift_val. So belt_floor_z_shift is + // simply the z-shift applied, i.e. max(0, -m_belt_min_z). + // NOTE: do NOT add raw_bounding_box().min.z() here — m_belt_min_z + // already includes the ensure_on_bed offset, unlike the min_rz used + // in update_slicing_parameters() which needs that compensation. + if (std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON) { + m_slicing_params.belt_floor_z_shift = (m_belt_min_z < 0.) ? -m_belt_min_z : 0.; + } + int firstLayerReplacedBy = 0; #if 0 @@ -904,6 +944,83 @@ void PrintObject::slice() if (m_layers.empty()) throw Slic3r::SlicingError(L("No layers were detected. You might want to repair your STL file(s) or check their size or thickness and retry.\n")); + // Belt printer global mode: offset all layer Z values so objects at + // different bed positions print at different heights on the tilted belt. + // This is a post-slicing adjustment — the sliced geometry is identical + // regardless of global mode, only the output Z coordinates change. + { + const auto &pcfg = this->print()->config(); + BOOST_LOG_TRIVIAL(warning) << "Belt global check: belt_printer=" << pcfg.belt_printer.value + << " belt_shear_z=" << int(pcfg.belt_shear_z.value) + << " belt_shear_z_global=" << pcfg.belt_shear_z_global.value + << " object=" << this->model_object()->name; + if (pcfg.belt_printer.value) { + auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + }; + + Point inst_shift = this->instances().empty() ? Point(0, 0) + : this->instances().front().shift - this->center_offset(); + BOOST_LOG_TRIVIAL(warning) << "Belt global: object " << this->model_object()->name + << " instances=" << this->instances().size() + << " shift=(" << unscale(inst_shift.x()) << ", " << unscale(inst_shift.y()) << ")"; + double global_z_offset = 0.; + + struct GAxis { BeltShearMode mode; double angle; int from; bool global; }; + GAxis gaxes[3] = { + { pcfg.belt_shear_x.value, pcfg.belt_shear_x_angle.value, int(pcfg.belt_shear_x_from.value), pcfg.belt_shear_x_global.value }, + { pcfg.belt_shear_y.value, pcfg.belt_shear_y_angle.value, int(pcfg.belt_shear_y_from.value), pcfg.belt_shear_y_global.value }, + { pcfg.belt_shear_z.value, pcfg.belt_shear_z_angle.value, int(pcfg.belt_shear_z_from.value), pcfg.belt_shear_z_global.value }, + }; + + // Only the Z-row shear contributes a Z offset from global mode. + // (X/Y row shears with global would offset X/Y, not Z — not useful here.) + // Offsets are RELATIVE: we subtract the minimum shift across all + // PrintObjects so the lowest-positioned object stays at Z=0. + const auto &za = gaxes[2]; // Z row + if (za.global && za.mode != BeltShearMode::None && za.from < 2) { + double factor = compute_shear_factor(za.mode, za.angle); + // The Z-shift brought the mesh's lowest sheared vertex to + // Z=0. That vertex's physical Y determines the belt contact + // point. With trafo_z preserved (ensure_on_bed offset), + // min_z = Y_at_contact * factor for bottom-face vertices, + // so: z_offset = center_Y * factor + min_z. + Point phys = inst_shift; // already has center_offset subtracted + double center_on_axis = (za.from == 0) ? unscale(phys.x()) : unscale(phys.y()); + global_z_offset += center_on_axis * factor + m_belt_min_z; + } + + BOOST_LOG_TRIVIAL(warning) << "Belt global: z_offset=" << global_z_offset + << " za.global=" << za.global << " za.mode=" << int(za.mode) << " za.from=" << za.from + << " (relative to min across " << this->print()->objects().size() << " objects)"; + m_belt_global_z_offset = global_z_offset; + if (std::abs(global_z_offset) > EPSILON) { + for (Layer *layer : m_layers) + layer->print_z += global_z_offset; + // Keep belt floor clipping in sync with the shifted print_z + // values — the support generator sees globally-offset object + // layer print_z, so belt_floor_z_shift must match. + m_slicing_params.belt_floor_z_shift += global_z_offset; + } + if (!m_layers.empty()) { + BOOST_LOG_TRIVIAL(warning) << "Belt global: first_layer_z=" << m_layers.front()->print_z + << " last_layer_z=" << m_layers.back()->print_z + << " num_layers=" << m_layers.size() + << " center_offset=(" << unscale(m_center_offset.x()) + << ", " << unscale(m_center_offset.y()) << ")"; + } + } + } + // BBS this->set_done(posSlice); } @@ -1208,7 +1325,8 @@ void PrintObject::slice_volumes() if (!slice_zs.empty()) { objSliceByVolume = slice_volumes_inner( print->config(), this->config(), this->trafo_centered(), - this->model_object()->volumes, m_shared_regions->layer_ranges, slice_zs, throw_on_cancel_callback); + this->model_object()->volumes, m_shared_regions->layer_ranges, slice_zs, throw_on_cancel_callback, + &m_belt_min_z); } //BBS: "model_part" volumes are grouded according to their connections diff --git a/src/libslic3r/Slicing.hpp b/src/libslic3r/Slicing.hpp index a7b21a140d..b06f2a7bc4 100644 --- a/src/libslic3r/Slicing.hpp +++ b/src/libslic3r/Slicing.hpp @@ -110,6 +110,13 @@ struct SlicingParameters coordf_t object_print_z_uncompensated_max { 0 }; // Scaling factor for compensating shrinkage in Z-axis. coordf_t object_shrinkage_compensation_z { 0 }; + + // Belt printer: floor plane parameters for support clipping. + // Belt contact surface in slicing coords: Z = bb_min_z + sf*Y + slicing_z_shift. + // cutoff = (print_z - belt_floor_z_shift - floor_offset) / shear_factor + double belt_floor_shear_factor { 0.0 }; // shear factor (e.g. cot(45deg)) + int belt_floor_from_axis { 1 }; // which axis the shear is from (0=X, 1=Y) + double belt_floor_z_shift { 0.0 }; // bb_min_z + max(0, -min_z_after_shear) }; static_assert(IsTriviallyCopyable::value, "SlicingParameters class is not POD (and it should be - see constructor)."); diff --git a/src/libslic3r/Support/SupportCommon.hpp b/src/libslic3r/Support/SupportCommon.hpp index 531daaa0a8..f15c7d417a 100644 --- a/src/libslic3r/Support/SupportCommon.hpp +++ b/src/libslic3r/Support/SupportCommon.hpp @@ -144,6 +144,12 @@ int idx_lower_or_equal(const std::vector &vec, int idx, FN_LOWER_EQUAL fn_lo return idx_lower_or_equal(vec.begin(), vec.end(), idx, fn_lower_equal); } +// Belt floor: compute the belt-side half-plane polygon at a given print_z. +// Used to clip support polygons against the belt surface. +Polygons belt_floor_surface_polygon( + const SlicingParameters &slicing_params, const PrintConfig &print_config, + const PrintObject &object, coordf_t print_z); + } // namespace Slic3r #endif /* slic3r_SupportCommon_hpp_ */ diff --git a/src/libslic3r/Support/SupportMaterial.cpp b/src/libslic3r/Support/SupportMaterial.cpp index c230924ac8..d70153a7dd 100644 --- a/src/libslic3r/Support/SupportMaterial.cpp +++ b/src/libslic3r/Support/SupportMaterial.cpp @@ -367,10 +367,21 @@ inline void layers_append(SupportGeneratorLayersPtr &dst, const SupportGenerator } // Support layer that is covered by some form of dense interface. -static constexpr const std::initializer_list support_types_interface { +static constexpr const std::initializer_list support_types_interface { SupporLayerType::RaftInterface, SupporLayerType::BottomContact, SupporLayerType::BottomInterface, SupporLayerType::TopContact, SupporLayerType::TopInterface }; +// Forward declarations for belt floor helpers (defined later in this file). +// belt_floor_surface_polygon is declared in SupportCommon.hpp (non-static, +// shared with TreeSupport.cpp). + +static Polygons belt_floor_valid_region_polygon( + const SlicingParameters &slicing_params, const PrintConfig &print_config, + const PrintObject &object, coordf_t print_z); +static void trim_support_layers_by_belt_floor( + const SlicingParameters &slicing_params, const PrintConfig &print_config, + const PrintObject &object, SupportGeneratorLayersPtr &support_layers); + void PrintObjectSupportMaterial::generate(PrintObject &object) { BOOST_LOG_TRIVIAL(info) << "Support generator - Start"; @@ -443,11 +454,12 @@ void PrintObjectSupportMaterial::generate(PrintObject &object) object, bottom_contacts, top_contacts, layer_storage); this->trim_support_layers_by_object(object, top_contacts, m_slicing_params.gap_support_object, m_slicing_params.gap_object_support, m_support_params.gap_xy); + trim_support_layers_by_belt_floor(m_slicing_params, *m_print_config, object, top_contacts); #ifdef SLIC3R_DEBUG for (const SupportGeneratorLayer *layer : top_contacts) Slic3r::SVG::export_expolygons( - debug_out_path("support-top-contacts-trimmed-by-object-%d-%lf.svg", iRun, layer->print_z), + debug_out_path("support-top-contacts-trimmed-by-object-%d-%lf.svg", iRun, layer->print_z), union_ex(layer->polygons)); #endif @@ -603,6 +615,139 @@ Polygons collect_region_slices_by_type(const Layer &layer, SurfaceType surface_t return out; } +// Belt printer: compute the belt-side half-plane polygon at a given print_z. +// This represents the region where the belt surface exists (the "phantom top surface"). +// Support that overlaps with this polygon should terminate with a bottom contact. +// Returns empty if belt floor is not active. +Polygons belt_floor_surface_polygon( + const SlicingParameters &slicing_params, + const PrintConfig &print_config, + const PrintObject &object, + coordf_t print_z) +{ + const double shear_factor = slicing_params.belt_floor_shear_factor; + if (std::abs(shear_factor) < EPSILON) + return {}; + + const int from_axis = slicing_params.belt_floor_from_axis; // 0=X, 1=Y + const double floor_offset = print_config.belt_support_floor_offset.value; + + // Belt floor line in slicing coordinates: Z = sf * Y + z_shift. + // z_shift accounts for the upward shift applied when post-shear geometry + // extends below the bed (overhangs). Solving for Y: + // cutoff = (print_z - z_shift - floor_offset) / sf + const double z_shift = slicing_params.belt_floor_z_shift; + const double cutoff = (print_z - z_shift - floor_offset) / shear_factor; + const coord_t cutoff_scaled = scale_(cutoff); + const coord_t large_bound = scale_(1e4); + + // Build the belt-side half-plane (inverted from the valid region). + // If shear_factor > 0: valid region is from_axis < cutoff, so belt surface is from_axis >= cutoff. + // If shear_factor < 0: valid region is from_axis > cutoff, so belt surface is from_axis <= cutoff. + Polygon belt_poly; + if (from_axis == 0) { + if (shear_factor > 0) { + // Belt surface: X >= cutoff + belt_poly.points = { + Point(cutoff_scaled, -large_bound), + Point(large_bound, -large_bound), + Point(large_bound, large_bound), + Point(cutoff_scaled, large_bound) + }; + } else { + // Belt surface: X <= cutoff + belt_poly.points = { + Point(-large_bound, -large_bound), + Point(cutoff_scaled, -large_bound), + Point(cutoff_scaled, large_bound), + Point(-large_bound, large_bound) + }; + } + } else { + if (shear_factor > 0) { + // Belt surface: Y >= cutoff + belt_poly.points = { + Point(-large_bound, cutoff_scaled), + Point( large_bound, cutoff_scaled), + Point( large_bound, large_bound), + Point(-large_bound, large_bound) + }; + } else { + // Belt surface: Y <= cutoff + belt_poly.points = { + Point(-large_bound, -large_bound), + Point( large_bound, -large_bound), + Point( large_bound, cutoff_scaled), + Point(-large_bound, cutoff_scaled) + }; + } + } + return { belt_poly }; +} + +// Belt printer: compute the valid-region half-plane polygon at a given print_z. +// This is the region where support is allowed to exist (above the belt). +// Used to clip the downward-propagating support projection. +static Polygons belt_floor_valid_region_polygon( + const SlicingParameters &slicing_params, + const PrintConfig &print_config, + const PrintObject &object, + coordf_t print_z) +{ + const double shear_factor = slicing_params.belt_floor_shear_factor; + if (std::abs(shear_factor) < EPSILON) + return {}; + + const int from_axis = slicing_params.belt_floor_from_axis; + const double floor_offset = print_config.belt_support_floor_offset.value; + + const double z_shift = slicing_params.belt_floor_z_shift; + const double cutoff = (print_z - z_shift - floor_offset) / shear_factor; + const coord_t cutoff_scaled = scale_(cutoff); + const coord_t large_bound = scale_(1e4); + + // Valid region: the complement of the belt surface polygon. + Polygon valid_poly; + if (from_axis == 0) { + if (shear_factor > 0) { + // Valid: X < cutoff + valid_poly.points = { + Point(-large_bound, -large_bound), + Point(cutoff_scaled, -large_bound), + Point(cutoff_scaled, large_bound), + Point(-large_bound, large_bound) + }; + } else { + // Valid: X > cutoff + valid_poly.points = { + Point(cutoff_scaled, -large_bound), + Point(large_bound, -large_bound), + Point(large_bound, large_bound), + Point(cutoff_scaled, large_bound) + }; + } + } else { + if (shear_factor > 0) { + // Valid: Y < cutoff + valid_poly.points = { + Point(-large_bound, -large_bound), + Point( large_bound, -large_bound), + Point( large_bound, cutoff_scaled), + Point(-large_bound, cutoff_scaled) + }; + } else { + // Valid: Y > cutoff + valid_poly.points = { + Point(-large_bound, cutoff_scaled), + Point( large_bound, cutoff_scaled), + Point( large_bound, large_bound), + Point(-large_bound, large_bound) + }; + } + } + return { valid_poly }; +} + // Collect outer contours of all slices of this layer. // This is useful for calculating the support base with holes filled. Polygons collect_slices_outer(const Layer &layer) @@ -2516,6 +2661,82 @@ static inline SupportGeneratorLayer* detect_bottom_contacts( return &layer_new; } +// Belt printer: detect bottom contacts where support meets the belt floor plane. +// Modeled on detect_bottom_contacts() but uses the belt plane polygon instead of stTop surfaces. +static inline SupportGeneratorLayer* detect_belt_floor_bottom_contacts( + const SlicingParameters &slicing_params, + const SupportParameters &support_params, + const PrintConfig &print_config, + const PrintObject &object, + const Layer &layer, + // Existing top contact layers, for snapping. + const SupportGeneratorLayersPtr &top_contacts, + size_t contact_idx, + SupportGeneratorLayerStorage &layer_storage, + std::vector &layer_support_areas, + const Polygons &supports_projected) +{ + // Compute the belt surface polygon at this layer's Z. + Polygons belt_surface = belt_floor_surface_polygon(slicing_params, print_config, object, layer.print_z); + if (belt_surface.empty()) + return nullptr; + + // Find where projected support overlaps the belt surface. + Polygons touching = intersection(belt_surface, supports_projected); + if (touching.empty()) + return nullptr; + + assert(layer.id() >= slicing_params.raft_layers()); + size_t layer_id = layer.id() - slicing_params.raft_layers(); + + // Allocate a new bottom contact layer resting on the belt plane. + SupportGeneratorLayer &layer_new = layer_storage.allocate_unguarded(SupporLayerType::BottomContact); + + // No object layer to sync with -- compute heights directly from flow parameters. + layer_new.height = support_params.support_material_bottom_interface_flow.height(); + layer_new.print_z = layer.print_z + layer_new.height + slicing_params.gap_object_support; + layer_new.bottom_z = layer.print_z; + layer_new.idx_object_layer_below = layer_id; + layer_new.bridging = ! slicing_params.soluble_interface && object.config().thick_bridges; + layer_new.polygons = expand(touching, float(support_params.support_material_flow.scaled_width()), SUPPORT_SURFACES_OFFSET_PARAMETERS); + + if (! slicing_params.soluble_interface) { + // Snap to nearby top contact layers to avoid very thin support layers. + for (size_t top_idx = size_t(std::max(0, int(contact_idx))); + top_idx < top_contacts.size() && top_contacts[top_idx]->print_z < layer_new.print_z + support_params.support_layer_height_min + EPSILON; + ++ top_idx) { + if (top_contacts[top_idx]->print_z > layer_new.print_z - support_params.support_layer_height_min - EPSILON) { + coordf_t diff = layer_new.print_z - top_contacts[top_idx]->print_z; + assert(std::abs(diff) <= support_params.support_layer_height_min + EPSILON); + if (diff > 0.F) { + if (layer_new.height - diff > support_params.support_layer_height_min) { + layer_new.print_z = top_contacts[top_idx]->print_z; + layer_new.height -= diff; + } else { + continue; + } + } else { + layer_new.print_z = top_contacts[top_idx]->print_z; + layer_new.height -= diff; + } + break; + } + } + } + + // Trim the already created base layers above this belt contact. + touching = expand(touching, float(SCALED_EPSILON)); + for (int layer_id_above = int(layer_id) + 1; layer_id_above < int(object.total_layer_count()); ++ layer_id_above) { + const Layer &layer_above = *object.layers()[layer_id_above]; + if (layer_above.print_z > layer_new.print_z - EPSILON) + break; + if (Polygons &above = layer_support_areas[layer_id_above]; ! above.empty()) + above = diff(above, touching); + } + + return &layer_new; +} + // Returns polygons to print + polygons to propagate downwards. // Called twice: First for normal supports, possibly trimmed by "on build plate only", second for support enforcers not trimmed by "on build plate only". static inline std::pair project_support_to_grid(const Layer &layer, const SupportGridParams &grid_params, const Polygons &overhangs, Polygons *layer_buildplate_covered @@ -2615,6 +2836,8 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::bottom_contact_layers_and_ //const auto expansion_to_slice = m_support_material_flow.scaled_spacing() / 2 + 25; const SupportGridParams grid_params(*m_object_config, m_support_params.support_material_flow); const bool buildplate_only = ! buildplate_covered.empty(); + const bool has_belt_floor = std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly; // Allocate empty surface areas, one per object layer. layer_support_areas.assign(object.total_layer_count(), Polygons()); @@ -2675,8 +2898,9 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::bottom_contact_layers_and_ tbb::task_group task_group; const Polygons &overhangs_for_bottom_contacts = buildplate_only ? enforcers_projection_raw : overhangs_projection_raw; if (! overhangs_for_bottom_contacts.empty()) - // Find the bottom contact layers above the top surfaces of this layer. - task_group.run([this, &object, &layer, &top_contacts, contact_idx, &layer_storage, &layer_support_areas, &bottom_contacts, &overhangs_for_bottom_contacts + // Find the bottom contact layers above the top surfaces of this layer, + // and also detect belt floor contacts if belt mode is active. + task_group.run([this, &object, &layer, &top_contacts, contact_idx, &layer_storage, &layer_support_areas, &bottom_contacts, &overhangs_for_bottom_contacts, has_belt_floor #ifdef SLIC3R_DEBUG , iRun, &polygons_new #endif // SLIC3R_DEBUG @@ -2690,6 +2914,15 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::bottom_contact_layers_and_ ); if (layer_new) bottom_contacts.push_back(layer_new); + // Belt floor phantom surface: detect where support meets the belt plane. + if (has_belt_floor) { + SupportGeneratorLayer *belt_layer = detect_belt_floor_bottom_contacts( + m_slicing_params, m_support_params, *m_print_config, object, + layer, top_contacts, contact_idx, layer_storage, + layer_support_areas, overhangs_for_bottom_contacts); + if (belt_layer) + bottom_contacts.push_back(belt_layer); + } }); Polygons &layer_support_area = layer_support_areas[layer_id]; @@ -2728,6 +2961,23 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::bottom_contact_layers_and_ task_group.wait(); + // Belt floor: clip projections and support areas so support doesn't + // propagate below the belt plane. + if (has_belt_floor) { + Polygons valid_region = belt_floor_valid_region_polygon( + m_slicing_params, *m_print_config, object, layer.print_z); + if (! valid_region.empty()) { + if (! overhangs_projection.empty()) + overhangs_projection = intersection(overhangs_projection, valid_region); + if (! enforcers_projection.empty()) + enforcers_projection = intersection(enforcers_projection, valid_region); + if (! layer_support_area.empty()) + layer_support_area = intersection(layer_support_area, valid_region); + if (! layer_support_area_enforcers.empty()) + layer_support_area_enforcers = intersection(layer_support_area_enforcers, valid_region); + } + } + if (! layer_support_area_enforcers.empty()) { if (layer_support_area.empty()) layer_support_area = std::move(layer_support_area_enforcers); @@ -2738,6 +2988,7 @@ SupportGeneratorLayersPtr PrintObjectSupportMaterial::bottom_contact_layers_and_ std::reverse(bottom_contacts.begin(), bottom_contacts.end()); trim_support_layers_by_object(object, bottom_contacts, m_slicing_params.gap_support_object, m_slicing_params.gap_object_support, m_support_params.gap_xy); + trim_support_layers_by_belt_floor(m_slicing_params, *m_print_config, object, bottom_contacts); return bottom_contacts; } @@ -3108,6 +3359,37 @@ void PrintObjectSupportMaterial::generate_base_layers( #endif /* SLIC3R_DEBUG */ this->trim_support_layers_by_object(object, intermediate_layers, m_slicing_params.gap_support_object, m_slicing_params.gap_object_support, m_support_params.gap_xy); + trim_support_layers_by_belt_floor(m_slicing_params, *m_print_config, object, intermediate_layers); +} + +// Belt printer: trim support layer polygons by the belt floor plane. +// For each support layer, computes the belt floor half-plane at that layer's print_z +// and subtracts it from the support polygons. This follows the same diff() pattern +// as trim_support_layers_by_object() so that interface layers derived from trimmed +// intermediates automatically inherit the belt floor trimming. +static void trim_support_layers_by_belt_floor( + const SlicingParameters &slicing_params, + const PrintConfig &print_config, + const PrintObject &object, + SupportGeneratorLayersPtr &support_layers) +{ + if (std::abs(slicing_params.belt_floor_shear_factor) < EPSILON) + return; + if (print_config.belt_support_floor_mode.value != BeltSupportFloorMode::GeneratorOnly) + return; + + tbb::parallel_for(tbb::blocked_range(0, support_layers.size()), + [&](const tbb::blocked_range &range) { + for (size_t i = range.begin(); i < range.end(); ++ i) { + SupportGeneratorLayer *layer = support_layers[i]; + if (layer->polygons.empty()) + continue; + Polygons belt_surface = belt_floor_surface_polygon( + slicing_params, print_config, object, layer->print_z); + if (! belt_surface.empty()) + layer->polygons = diff(layer->polygons, belt_surface); + } + }); } void PrintObjectSupportMaterial::trim_support_layers_by_object( diff --git a/src/libslic3r/Support/TreeModelVolumes.cpp b/src/libslic3r/Support/TreeModelVolumes.cpp index 0267c0c327..e270b62aab 100644 --- a/src/libslic3r/Support/TreeModelVolumes.cpp +++ b/src/libslic3r/Support/TreeModelVolumes.cpp @@ -94,6 +94,46 @@ TreeModelVolumes::TreeModelVolumes( #else { m_anti_overhang = print_object.slice_support_blockers(); + // Belt floor: add belt surface polygons to anti_overhang so support + // is never generated inside the belt. Only in global shear mode — + // in local mode the belt floor clipping handles everything and + // anti_overhang at the bottom layers would block all support. + { + const auto &sp = print_object.slicing_parameters(); + const auto &pcfg = print_object.print()->config(); + const double sf = sp.belt_floor_shear_factor; + if (std::abs(sf) > EPSILON + && std::abs(print_object.belt_global_z_offset()) > EPSILON + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + const int from_axis = sp.belt_floor_from_axis; + const double floor_off = pcfg.belt_support_floor_offset.value; + const double z_shift = sp.belt_floor_z_shift - print_object.belt_global_z_offset(); + size_t num_layers_needed = print_object.layer_count(); + // Ensure m_anti_overhang is large enough. + if (m_anti_overhang.size() < num_layers_needed) + m_anti_overhang.resize(num_layers_needed, Polygons{}); + for (size_t layer_idx = 0; layer_idx < num_layers_needed; ++layer_idx) { + double print_z = print_object.get_layer(layer_idx)->print_z + - print_object.belt_global_z_offset(); + double cutoff = (print_z - z_shift - floor_off) / sf; + coord_t cutoff_sc = scale_(cutoff); + coord_t big = scale_(1e4); + Polygon belt_poly; + if (from_axis == 0) { + if (sf > 0) + belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; + else + belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; + } else { + if (sf > 0) + belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; + else + belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; + } + append(m_anti_overhang[layer_idx], Polygons{belt_poly}); + } + } + } TreeSupportMeshGroupSettings mesh_settings(print_object); const TreeSupportSettings config{ mesh_settings, print_object.slicing_parameters() }; m_current_min_xy_dist = config.xy_min_distance; @@ -102,6 +142,27 @@ TreeModelVolumes::TreeModelVolumes( m_increase_until_radius = config.increase_radius_until_radius; m_radius_0 = config.getRadius(0); m_raft_layers = config.raft_layers; + // Belt printer: add virtual belt raft layers below the object, matching + // the extra layers added in generate_support_areas() so both use the + // same layer indexing. + { + const auto &sp2 = print_object.slicing_parameters(); + const auto &pcfg2 = print_object.print()->config(); + double belt_sf = sp2.belt_floor_shear_factor; + if (std::abs(belt_sf) > EPSILON && std::abs(print_object.belt_global_z_offset()) > EPSILON + && pcfg2.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + double bb_min_z = std::abs(print_object.model_object()->raw_bounding_box().min.z()); + double extra_depth = bb_min_z + 10.; + int num_extra = std::max(0, (int)std::ceil(extra_depth / sp2.layer_height)); + if (num_extra > 0) { + std::vector belt_layers; + belt_layers.reserve(num_extra); + for (int i = num_extra; i >= 1; --i) + belt_layers.push_back(sp2.first_object_layer_height - i * sp2.layer_height); + m_raft_layers.insert(m_raft_layers.begin(), belt_layers.begin(), belt_layers.end()); + } + } + } m_current_outline_idx = 0; m_layer_outlines.emplace_back(mesh_settings, std::vector{}); @@ -114,6 +175,47 @@ TreeModelVolumes::TreeModelVolumes( for (size_t layer_idx = range.begin(); layer_idx < range.end(); ++ layer_idx) outlines[layer_idx] = polygons_simplify(to_polygons(print_object.get_layer(layer_idx - num_raft_layers)->lslices), mesh_settings.resolution, polygons_strictly_simple); }); + + // Belt floor: pre-compute belt surface polygon per-layer for clipping. + // Branches grow toward the belt and their slices are clipped at the belt + // surface in organic_draw_branches(). The organic pipeline works in LOCAL + // Z (no global_z_offset), so use local z_shift and local print_z. + const auto &slicing_params = print_object.slicing_parameters(); + const auto &pcfg = print_object.print()->config(); + const double sf = slicing_params.belt_floor_shear_factor; + if (std::abs(sf) > EPSILON + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + const int from_axis = slicing_params.belt_floor_from_axis; + const double floor_off = pcfg.belt_support_floor_offset.value; + // Subtract global_z_offset to get the LOCAL z_shift — the organic + // pipeline's Z coordinates don't include the global offset. + const double z_shift = slicing_params.belt_floor_z_shift + - print_object.belt_global_z_offset(); + m_belt_floor.assign(num_layers, Polygons{}); + for (size_t layer_idx = 0; layer_idx < num_layers; ++layer_idx) { + // Use local print_z (subtract global offset from object layer). + double print_z = (layer_idx >= num_raft_layers) + ? print_object.get_layer(layer_idx - num_raft_layers)->print_z + - print_object.belt_global_z_offset() + : 0.; + double cutoff = (print_z - z_shift - floor_off) / sf; + coord_t cutoff_sc = scale_(cutoff); + coord_t big = scale_(1e4); + Polygon belt_poly; + if (from_axis == 0) { + if (sf > 0) + belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; + else + belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; + } else { + if (sf > 0) + belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; + else + belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; + } + m_belt_floor[layer_idx] = { belt_poly }; + } + } } #endif @@ -469,9 +571,9 @@ void TreeModelVolumes::calculateCollision(const coord_t radius, const LayerIndex }); // 2) Sum over top / bottom ranges. - const bool processing_last_mesh = outline_idx == layer_outline_indices.size(); + const bool processing_last_mesh = outline_idx == layer_outline_indices.back(); tbb::parallel_for(tbb::blocked_range(data.begin(), data.end()), - [&collision_areas_offsetted, &outlines, &machine_border = m_machine_border, &anti_overhang = m_anti_overhang, radius, + [&collision_areas_offsetted, &outlines, &machine_border = m_machine_border, &anti_overhang = m_anti_overhang, radius, xy_distance, z_distance_bottom_layers, z_distance_top_layers, min_resolution = m_min_resolution, &data, processing_last_mesh, &throw_on_cancel] (const tbb::blocked_range& range) { for (LayerIndex layer_idx = range.begin(); layer_idx != range.end(); ++ layer_idx) { @@ -517,9 +619,14 @@ void TreeModelVolumes::calculateCollision(const coord_t radius, const LayerIndex // not support an overhang<90 degree than to risk fusing to it. append(collisions, offset(union_ex(collision_areas_original), radius + required_range_x, ClipperLib::jtMiter, 1.2)); } - collisions = processing_last_mesh && layer_idx < int(anti_overhang.size()) ? - union_(collisions, offset(union_ex(anti_overhang[layer_idx]), radius, ClipperLib::jtMiter, 1.2)) : - union_(collisions); + if (processing_last_mesh) { + if (layer_idx < int(anti_overhang.size())) + append(collisions, offset(union_ex(anti_overhang[layer_idx]), radius, ClipperLib::jtMiter, 1.2)); + // NOTE: m_belt_floor is NOT added to collision here — branches + // should grow toward the belt and terminate at it, not avoid it. + // Belt floor clipping is done post-generation in organic_draw_branches(). + } + collisions = union_(collisions); auto &dst = data[layer_idx]; if (processing_last_mesh) { if (! dst.empty()) diff --git a/src/libslic3r/Support/TreeModelVolumes.hpp b/src/libslic3r/Support/TreeModelVolumes.hpp index eff4cadcaf..0ded395091 100644 --- a/src/libslic3r/Support/TreeModelVolumes.hpp +++ b/src/libslic3r/Support/TreeModelVolumes.hpp @@ -168,6 +168,9 @@ public: } Polygon m_bed_area; + // Belt floor polygons per layer — used for post-generation clipping + // in organic_draw_branches(). Public so the organic pipeline can access it. + std::vector m_belt_floor; private: // Caching polygons for a range of layers. diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 864a0eb0e0..4966a5a139 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -637,6 +637,20 @@ TreeSupport::TreeSupport(PrintObject& object, const SlicingParameters &slicing_p } +double TreeSupport::belt_floor_print_z(const Point &pos_slicing) const +{ + double sf = m_slicing_params.belt_floor_shear_factor; + if (std::abs(sf) < EPSILON) + return -std::numeric_limits::max(); // no belt floor + int from = m_slicing_params.belt_floor_from_axis; + // Belt floor in slicing coords: Z = sf * Y + z_shift + floor_offset. + // Inverse of cutoff = (Z - z_shift - floor_offset) / sf. + double pos = unscale(from == 0 ? pos_slicing.x() : pos_slicing.y()); + double floor_offset = m_print_config->belt_support_floor_offset.value; + double z_shift = m_slicing_params.belt_floor_z_shift; + return sf * pos + floor_offset + z_shift; +} + #define SUPPORT_SURFACES_OFFSET_PARAMETERS ClipperLib::jtSquare, 0. void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) { @@ -2141,6 +2155,41 @@ void TreeSupport::draw_circles() base_areas = diff_ex(base_areas, ClipperUtils::clip_clipper_polygons_with_subject_bbox(roofs, get_extents(base_areas))); base_areas = intersection_ex(base_areas, m_machine_border); + // Belt floor: clip tree support polygons by the belt surface plane. + // ts_layer->print_z is at LOCAL Z (global offset applied later in + // _generate_support_material), but belt_floor_z_shift includes + // global_z_offset — subtract it to get the cutoff in local coords. + if (std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + const double sf = m_slicing_params.belt_floor_shear_factor; + const int from_axis = m_slicing_params.belt_floor_from_axis; + const double floor_off = m_print_config->belt_support_floor_offset.value; + const double z_shift_local = m_slicing_params.belt_floor_z_shift + - m_object->belt_global_z_offset(); + const double cutoff = (ts_layer->print_z - z_shift_local - floor_off) / sf; + const coord_t cutoff_sc = scale_(cutoff); + const coord_t big = scale_(1e4); + + Polygon belt_poly; + if (from_axis == 0) { + if (sf > 0) + belt_poly.points = { {cutoff_sc,-big}, {big,-big}, {big,big}, {cutoff_sc,big} }; + else + belt_poly.points = { {-big,-big}, {cutoff_sc,-big}, {cutoff_sc,big}, {-big,big} }; + } else { + if (sf > 0) + belt_poly.points = { {-big,cutoff_sc}, {big,cutoff_sc}, {big,big}, {-big,big} }; + else + belt_poly.points = { {-big,-big}, {big,-big}, {big,cutoff_sc}, {-big,cutoff_sc} }; + } + Polygons belt_surface = { belt_poly }; + base_areas = diff_ex(base_areas, belt_surface); + roof_areas = diff_ex(roof_areas, belt_surface); + roof_1st_layer = diff_ex(roof_1st_layer, belt_surface); + floor_areas = diff_ex(floor_areas, belt_surface); + roof_gap_areas = diff_ex(roof_gap_areas, belt_surface); + } + if (SQUARE_SUPPORT) { // simplify support contours ExPolygons base_areas_simplified; @@ -2445,6 +2494,9 @@ void TreeSupport::drop_nodes() const coordf_t radius_sample_resolution = m_ts_data->m_radius_sample_resolution; const bool support_on_buildplate_only = config.support_on_build_plate_only.value; const size_t top_interface_layers = config.support_interface_top_layers.value; + const auto belt_floor_mode = m_print_config->belt_support_floor_mode.value; + const bool has_belt_floor = std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON + && belt_floor_mode == BeltSupportFloorMode::GeneratorOnly; const size_t bottom_interface_layers = config.support_interface_bottom_layers.value < 0 ? top_interface_layers : config.support_interface_bottom_layers.value; SupportNode::diameter_angle_scale_factor = diameter_angle_scale_factor; float DO_NOT_MOVER_UNDER_MM = is_slim ? 0 : 5; // do not move contact points under 5mm @@ -2677,15 +2729,22 @@ void TreeSupport::drop_nodes() node_parent = p_node->parent ? p_node : neighbour; // Make sure the next pass doesn't drop down either of these (since that already happened). node_parent->merged_neighbours.push_front(node_parent == p_node ? neighbour : p_node); - const bool to_buildplate = !is_inside_ex(get_collision(0, obj_layer_nr_next), next_position); - SupportNode* next_node = m_ts_data->create_node(next_position, node_parent->distance_to_top + 1, obj_layer_nr_next, node_parent->support_roof_layers_below - 1, to_buildplate, node_parent, - print_z_next, height_next); - get_max_move_dist(next_node); - m_ts_data->m_mutex.lock(); - contact_nodes[layer_nr_next].push_back(next_node); + // Belt floor: don't drop merged node below belt surface. + // Treat as object-surface termination (not buildplate) so + // the node gets floor/interface areas instead of base pads. + if (has_belt_floor && print_z_next <= belt_floor_print_z(next_position)) { + node_parent->to_buildplate = false; + } else { + const bool to_buildplate = !is_inside_ex(get_collision(0, obj_layer_nr_next), next_position); + SupportNode* next_node = m_ts_data->create_node(next_position, node_parent->distance_to_top + 1, obj_layer_nr_next, node_parent->support_roof_layers_below - 1, to_buildplate, node_parent, + print_z_next, height_next); + get_max_move_dist(next_node); + m_ts_data->m_mutex.lock(); + contact_nodes[layer_nr_next].push_back(next_node); + m_ts_data->m_mutex.unlock(); + } neighbour->valid = false; p_node->valid = false; - m_ts_data->m_mutex.unlock(); } else if (neighbours.size() > 1) //Don't merge leaf nodes because we would then incur movement greater than the maximum move distance. { @@ -2729,6 +2788,12 @@ void TreeSupport::drop_nodes() ExPolygons overhangs_next = diff_clipped({ node.overhang }, get_collision(0, obj_layer_nr_next)); for(auto& overhang:overhangs_next) { Point next_pt = overhang.contour.centroid(); + // Belt floor: don't drop polygon node below belt surface. + // Treat as object-surface termination (not buildplate). + if (has_belt_floor && print_z_next <= belt_floor_print_z(next_pt)) { + p_node->to_buildplate = false; + continue; + } SupportNode *next_node = m_ts_data->create_node(next_pt, p_node->distance_to_top + 1, obj_layer_nr_next, p_node->support_roof_layers_below - 1, to_buildplate, p_node, print_z_next, height_next); next_node->max_move_dist = 0; @@ -2873,6 +2938,12 @@ void TreeSupport::drop_nodes() if (is_outside) { next_layer_vertex = candidate_vertex; } } } + // Belt floor: don't drop regular node below belt surface. + // Treat as object-surface termination (not buildplate). + if (has_belt_floor && print_z_next <= belt_floor_print_z(next_layer_vertex)) { + p_node->to_buildplate = false; + return; // from parallel_for_each lambda + } auto next_collision = get_collision(0, obj_layer_nr_next); const bool to_buildplate = !is_inside_ex(m_ts_data->m_layer_outlines[obj_layer_nr_next], next_layer_vertex); SupportNode * next_node = m_ts_data->create_node(next_layer_vertex, node.distance_to_top + 1, obj_layer_nr_next, node.support_roof_layers_below - 1, to_buildplate, p_node, @@ -3167,6 +3238,9 @@ void TreeSupport::generate_contact_points() bool on_buildplate_only = m_object_config->support_on_build_plate_only.value; const bool roof_enabled = config.support_interface_top_layers.value > 0; const bool force_tip_to_roof = roof_enabled && m_support_params.soluble_interface; + const auto belt_floor_mode = m_print_config->belt_support_floor_mode.value; + const bool has_belt_floor = std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON + && belt_floor_mode == BeltSupportFloorMode::GeneratorOnly; //First generate grid points to cover the entire area of the print. BoundingBox bounding_box = m_object->bounding_box(); @@ -3257,6 +3331,10 @@ void TreeSupport::generate_contact_points() auto insert_point = [&](Point pt, const ExPolygon& overhang, double radius, bool force_add = false, bool add_interface=true) { + // Belt floor: skip contact points whose bottom_z is at or below + // the belt floor at this XY position (overhang rests on the belt). + if (has_belt_floor && bottom_z <= belt_floor_print_z(pt)) + return (SupportNode*) nullptr; Point hash_pos = pt / ((radius_scaled + 1) / 1); SupportNode* contact_node = nullptr; if (force_add || !already_inserted.count(hash_pos)) { @@ -3292,8 +3370,10 @@ void TreeSupport::generate_contact_points() double radius = unscale_(overhang_bounds.radius()); Point candidate = overhang_bounds.center(); SupportNode *contact_node = insert_point(candidate, overhang, radius, true, true); - contact_node->type = ePolygon; - curr_nodes.emplace_back(contact_node); + if (contact_node) { + contact_node->type = ePolygon; + curr_nodes.emplace_back(contact_node); + } } }else{ // otherwise, all nodes should be circle nodes diff --git a/src/libslic3r/Support/TreeSupport.hpp b/src/libslic3r/Support/TreeSupport.hpp index e0446ad5f1..c3bd186df1 100644 --- a/src/libslic3r/Support/TreeSupport.hpp +++ b/src/libslic3r/Support/TreeSupport.hpp @@ -446,6 +446,10 @@ private: bool is_slim = false; bool with_infill = false; + // Belt printer: compute the belt floor print_z at a given XY position (in slicing coords). + // Returns -infinity if belt floor is not active. + double belt_floor_print_z(const Point &pos_slicing) const; + /*! diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index 2c24b933b2..b551a42ece 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -3366,6 +3366,36 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons // this struct is used to easy retrieve setting. No other function except those in TreeModelVolumes and generate_initial_areas() have knowledge of the existence of multiple meshes being processed. //FIXME this is a copy // Contains config settings to avoid loading them in every function. This was done to improve readability of the code. + // Belt printer: add virtual "belt raft" layers below the object so + // organic branches can extend below the model's first layer and + // terminate at the belt surface instead of creating a flat base at Z=0. + { + PrintObject &po = *print.get_object(processing.second.front()); + const auto &sp = po.slicing_parameters(); + const auto &pcfg = po.print()->config(); + const double sf = sp.belt_floor_shear_factor; + if (std::abs(sf) > EPSILON && std::abs(po.belt_global_z_offset()) > EPSILON + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + // z_shift_local is the belt surface height at Y=0 in local coords. + // Extend below the belt so the base expansion and build-plate + // termination happen inside the belt region and get clipped. + // Use the distance from the pre-shear bbox min Z to the part's + // post-shear min Z, plus 10mm for base expansion headroom. + double bb_min_z = std::abs(po.model_object()->raw_bounding_box().min.z()); + double extra_depth = bb_min_z + 10.; + int num_extra = std::max(0, (int)std::ceil(extra_depth / sp.layer_height)); + if (num_extra > 0) { + // Insert belt raft layers at the front, from lowest Z to highest. + std::vector belt_layers; + belt_layers.reserve(num_extra); + for (int i = num_extra; i >= 1; --i) + belt_layers.push_back(sp.first_object_layer_height - i * sp.layer_height); + // Prepend to existing raft_layers (if any). + auto &rl = processing.first.raft_layers; + rl.insert(rl.begin(), belt_layers.begin(), belt_layers.end()); + } + } + } const TreeSupportSettings &config = processing.first; BOOST_LOG_TRIVIAL(info) << "Processing support tree mesh group " << counter + 1 << " of " << grouped_meshes.size() << " containing " << grouped_meshes[counter].second.size() << " meshes."; auto t_start = std::chrono::high_resolution_clock::now(); @@ -3561,6 +3591,43 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons if (layer) layer->polygons = intersection(layer->polygons, volumes.m_bed_area); }); + // Belt floor: clip ALL organic support layers (including intermediate/base + // fill) against the belt surface. The branch slices were already clipped + // in organic_draw_branches(), but intermediate layers generated between + // branches and the build plate need clipping too. + // Compute the belt floor polygon directly from each layer's print_z + // rather than mapping to a layer index (avoids index mismatch issues). + { + const auto &sp = print_object.slicing_parameters(); + const double sf = sp.belt_floor_shear_factor; + const double z_shift = sp.belt_floor_z_shift - print_object.belt_global_z_offset(); + const double floor_off = print_object.print()->config().belt_support_floor_offset.value; + const int from_axis = sp.belt_floor_from_axis; + if (std::abs(sf) > EPSILON + && print_object.print()->config().belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + tbb::parallel_for_each(layers_sorted.begin(), layers_sorted.end(), [&](SupportGeneratorLayer *layer) { + if (!layer || layer->polygons.empty()) + return; + double cutoff = (layer->print_z - z_shift - floor_off) / sf; + coord_t cutoff_sc = scale_(cutoff); + coord_t big = scale_(1e4); + Polygon belt_poly; + if (from_axis == 0) { + if (sf > 0) + belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; + else + belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; + } else { + if (sf > 0) + belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; + else + belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; + } + layer->polygons = diff(layer->polygons, Polygons{belt_poly}); + }); + } + } + print.set_status(69, _L("Generating support")); generate_support_toolpaths(print_object.support_layers(), print_object.config(), support_params, print_object.slicing_parameters(), raft_layers, bottom_contacts, top_contacts, intermediate_layers, interface_layers, base_interface_layers); @@ -3816,6 +3883,10 @@ void organic_draw_branches( for (LayerIndex i = 0; i < LayerIndex(slices.size()); ++i) { slices[i] = diff_clipped(slices[i], volumes.getCollision(0, layer_begin + i, true)); // FIXME parent_uses_min || draw_area.element->state.use_min_xy_dist); slices[i] = intersection(slices[i], volumes.m_bed_area); + // Belt floor: clip branch slices against the belt surface plane. + LayerIndex belt_idx = layer_begin + i; + if (belt_idx < LayerIndex(volumes.m_belt_floor.size()) && !volumes.m_belt_floor[belt_idx].empty()) + slices[i] = diff(slices[i], volumes.m_belt_floor[belt_idx]); } size_t num_empty = 0; if (slices.front().empty()) { @@ -3850,6 +3921,9 @@ void organic_draw_branches( //double support_area_min = 0.1 * support_area_min_radius; for (LayerIndex layer_idx = layer_begin - 1; layer_idx >= layer_bottommost; -- layer_idx) { rest_support = diff_clipped(rest_support.empty() ? slices.front() : rest_support, volumes.getCollision(0, layer_idx, false)); + // Belt floor: clip propagated support at belt surface. + if (layer_idx < LayerIndex(volumes.m_belt_floor.size()) && !volumes.m_belt_floor[layer_idx].empty()) + rest_support = diff(rest_support, volumes.m_belt_floor[layer_idx]); double rest_support_area = area(rest_support); if (rest_support_area < support_area_stop) // Don't propagate a fraction of the tree contact surface. diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 25b4ba4e9c..b9fe17ff2a 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -2210,17 +2210,11 @@ void GCodeViewer::render_toolpaths() { const Camera& camera = wxGetApp().plater()->get_camera(); Matrix4f view = camera.get_view_matrix().matrix().cast(); - // Belt "designed" view: apply inverse shear to view matrix so toolpaths appear - // upright (as originally designed) instead of sheared on the belt. - if (m_belt_show_designed && m_belt_view_enabled && m_belt_angle_deg > 0.f) { - double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle_deg)); - double sin_a = std::sin(angle_rad); - if (sin_a > 1e-6) { - double cot_alpha = std::cos(angle_rad) / sin_a; - Transform3d inverse_shear = Transform3d::Identity(); - inverse_shear.matrix()(1, 2) = -cot_alpha; // Y -= Z * cot(α) - view = (camera.get_view_matrix() * inverse_shear).matrix().cast(); - } + // Belt "designed" view: apply the precomputed inverse of the full belt + // shear+scale transform so toolpaths appear upright (as originally designed) + // instead of transformed on the belt. + if (m_belt_show_designed && m_belt_view_enabled) { + view = (camera.get_view_matrix() * m_belt_inverse_transform).matrix().cast(); } const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(view); const libvgcode::Mat4x4 converted_projetion_matrix = libvgcode::convert(static_cast(camera.get_projection_matrix().matrix().cast())); @@ -4418,12 +4412,18 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv if (m_nozzle_nums > 1 && (m_viewer.get_view_type() == libvgcode::EViewType::Summary || m_viewer.get_view_type() == libvgcode::EViewType::ColorPrint)) // ORCA show only on summary and filament tab render_legend_color_arr_recommen(window_padding); - // Belt printer: toggle for viewing raw slicing-frame G-code + // Belt printer: toggle for viewing designed (upright) vs. machine-frame G-code. + // Rendered with a separator and hint text so users can find it easily. if (m_belt_view_enabled) { + ImGui::Spacing(); + ImGui::Separator(); ImGui::Spacing(); ImGui::Dummy({ window_padding, 0 }); ImGui::SameLine(); - ImGui::Checkbox("Show designed view (upright)", &m_belt_show_designed); + ImGui::TextColored(ImVec4(0.f, 0.59f, 0.53f, 1.f), "%s", _u8L("Belt Printer").c_str()); + ImGui::Dummy({ window_padding, 0 }); + ImGui::SameLine(); + ImGui::Checkbox(_u8L("Show designed view (upright) [B]").c_str(), &m_belt_show_designed); } legend_height = ImGui::GetCurrentWindow()->Size.y; diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index 184c56e915..cd97613b2a 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -240,6 +240,7 @@ mutable bool m_no_render_path { false }; bool m_belt_view_enabled = false; float m_belt_angle_deg = 0.f; bool m_belt_show_designed = false; // Toggle: show designed (upright) view via inverse shear + Transform3d m_belt_inverse_transform{Transform3d::Identity()}; libvgcode::Viewer m_viewer; bool m_loaded_as_preview{ false }; @@ -341,7 +342,10 @@ public: void export_toolpaths_to_obj(const char* filename) const; void set_belt_printer(bool enabled, float angle_deg) { m_belt_view_enabled = enabled; m_belt_angle_deg = angle_deg; } + void set_belt_inverse_transform(const Transform3d& t) { m_belt_inverse_transform = t; } bool is_belt_view() const { return m_belt_view_enabled && m_belt_angle_deg > 0.f; } + void toggle_belt_show_designed() { if (m_belt_view_enabled) m_belt_show_designed = !m_belt_show_designed; } + bool is_belt_show_designed() const { return m_belt_show_designed; } size_t get_extruders_count() { return m_extruders_count; } void push_combo_style(); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 2c8285720b..b8947d77b0 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3463,8 +3463,16 @@ void GLCanvas3D::on_char(wxKeyEvent& evt) post_event(SimpleEvent(EVT_GLCANVAS_ARRANGE)); break; } - //case 'B': - //case 'b': { zoom_to_bed(); break; } + case 'B': + case 'b': { + // Toggle belt printer "show designed" view when in G-code preview with belt mode active. + if (dynamic_cast(m_canvas->GetParent()) != nullptr && + m_gcode_viewer.is_belt_view()) { + m_gcode_viewer.toggle_belt_show_designed(); + m_dirty = true; + } + break; + } case 'C': case 'c': { wxGetApp().toggle_show_gcode_window(); m_dirty = true; request_extra_frame(); break; } //case 'G': diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index fe2479386b..a3c68d34d4 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2516,7 +2516,7 @@ void ObjectList::load_mesh_object(const TriangleMesh &mesh, const wxString &name Slic3r::save_object_mesh(*new_object); // BBS: find an empty cell to put the copied object - auto start_point = wxGetApp().plater()->build_volume().bounding_volume2d().center(); + auto start_point = wxGetApp().plater()->build_volume().bed_center(); auto empty_cell = wxGetApp().plater()->canvas3D()->get_nearest_empty_cell({start_point(0), start_point(1)}); new_object->instances[0]->set_offset(center ? to_3d(Vec2d(empty_cell(0), empty_cell(1)), -new_object->origin_translation.z()) : bb.center()); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6e5872d074..b6c3e28553 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6907,7 +6907,7 @@ std::vector Plater::priv::load_model_objects(const ModelObjectPtrs& mode // BBS: find an empty cell to put the copied object for (auto& instance : new_instances) { auto offset = instance->get_offset(); - auto start_point = this->bed.build_volume().bounding_volume2d().center(); + auto start_point = this->bed.build_volume().bed_center(); bool plate_empty = partplate_list.get_curr_plate()->empty(); Vec3d displacement; if (plate_empty) @@ -10991,10 +10991,83 @@ void Plater::priv::set_bed_shape(const Pointfs &shape, bed.set_belt_printer(true, static_cast(belt_angle)); if (preview) preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, static_cast(belt_angle)); + + // Compute the inverse of the full belt shear+scale transform for the G-code viewer. + auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + }; + auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } + }; + + // Read shear configs. + auto get_shear_mode = [this](const char *key) -> BeltShearMode { + auto opt = config->option>(key); + return opt ? opt->value : BeltShearMode::None; + }; + auto get_axis = [this](const char *key) -> BeltAxis { + auto opt = config->option>(key); + return opt ? opt->value : BeltAxis::X; + }; + auto get_scale_mode = [this](const char *key) -> BeltScaleMode { + auto opt = config->option>(key); + return opt ? opt->value : BeltScaleMode::None; + }; + + struct AxisShear { BeltShearMode mode; double angle; int from; }; + AxisShear axes[3] = { + { get_shear_mode("belt_shear_x"), config->opt_float("belt_shear_x_angle"), int(get_axis("belt_shear_x_from")) }, + { get_shear_mode("belt_shear_y"), config->opt_float("belt_shear_y_angle"), int(get_axis("belt_shear_y_from")) }, + { get_shear_mode("belt_shear_z"), config->opt_float("belt_shear_z_angle"), int(get_axis("belt_shear_z_from")) }, + }; + + Transform3d belt_shear = Transform3d::Identity(); + for (int row = 0; row < 3; ++row) { + if (axes[row].mode != BeltShearMode::None) { + double factor = compute_shear_factor(axes[row].mode, axes[row].angle); + if (std::abs(factor) > EPSILON) + belt_shear.matrix()(row, axes[row].from) += factor; + } + } + + double sx = compute_scale_factor(get_scale_mode("belt_scale_x"), config->opt_float("belt_scale_x_angle")); + double sy = compute_scale_factor(get_scale_mode("belt_scale_y"), config->opt_float("belt_scale_y_angle")); + double sz = compute_scale_factor(get_scale_mode("belt_scale_z"), config->opt_float("belt_scale_z_angle")); + Transform3d belt_scale = Transform3d::Identity(); + belt_scale.matrix()(0, 0) = sx; + belt_scale.matrix()(1, 1) = sy; + belt_scale.matrix()(2, 2) = sz; + + // Forward transform: scale * shear. Inverse for the viewer. + Transform3d forward = belt_scale * belt_shear; + Transform3d inverse = forward.inverse(); + if (preview) + preview->get_canvas3d()->get_gcode_viewer().set_belt_inverse_transform(inverse); } else { bed.set_belt_printer(false, 0.f); - if (preview) + if (preview) { preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(false, 0.f); + preview->get_canvas3d()->get_gcode_viewer().set_belt_inverse_transform(Transform3d::Identity()); + } } } @@ -13286,6 +13359,15 @@ void Plater::load_gcode(const wxString& filename) current_print.set_gcode_file_ready(); + // Belt printer: detect belt_printer_angle from loaded G-code header and enable + // belt view mode on the GCodeViewer so the "Show designed view" toggle appears. + if (current_result->belt_printer_angle > 0.f) { + float angle = current_result->belt_printer_angle; + p->preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, angle); + } else { + p->preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(false, 0.f); + } + // show results p->preview->reload_print(m_only_gcode); //BBS: zoom to bed 0 for gcode preview diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 9d1ee6b2ad..d997fbb7a9 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4365,58 +4365,6 @@ void TabPrinter::build_fff() optgroup->append_single_option_line(option, "printer_basic_information_printable_space#excluded-bed-area"); // optgroup->append_single_option_line("printable_area"); optgroup->append_single_option_line("printable_height", "printer_basic_information_printable_space#printable-height"); - optgroup->append_single_option_line("build_plate_tilt_x"); - optgroup->append_single_option_line("build_plate_tilt_y"); - optgroup->append_single_option_line("belt_printer"); - optgroup->append_single_option_line("belt_printer_angle"); - optgroup->append_single_option_line("belt_printer_infinite_y"); - // Per-axis shear: group mode + angle + source on one row per axis - { - Line line = { L("Shear X"), L("Shear applied to the X axis before slicing") }; - line.append_option(optgroup->get_option("belt_shear_x")); - line.append_option(optgroup->get_option("belt_shear_x_angle")); - line.append_option(optgroup->get_option("belt_shear_x_from")); - optgroup->append_line(line); - } - { - Line line = { L("Shear Y"), L("Shear applied to the Y axis before slicing") }; - line.append_option(optgroup->get_option("belt_shear_y")); - line.append_option(optgroup->get_option("belt_shear_y_angle")); - line.append_option(optgroup->get_option("belt_shear_y_from")); - optgroup->append_line(line); - } - { - Line line = { L("Shear Z"), L("Shear applied to the Z axis before slicing") }; - line.append_option(optgroup->get_option("belt_shear_z")); - line.append_option(optgroup->get_option("belt_shear_z_angle")); - line.append_option(optgroup->get_option("belt_shear_z_from")); - optgroup->append_line(line); - } - { - Line line = { L("Scale X"), L("Scale applied to the X axis before slicing") }; - line.append_option(optgroup->get_option("belt_scale_x")); - line.append_option(optgroup->get_option("belt_scale_x_angle")); - optgroup->append_line(line); - } - { - Line line = { L("Scale Y"), L("Scale applied to the Y axis before slicing") }; - line.append_option(optgroup->get_option("belt_scale_y")); - line.append_option(optgroup->get_option("belt_scale_y_angle")); - optgroup->append_line(line); - } - { - Line line = { L("Scale Z"), L("Scale applied to the Z axis before slicing") }; - line.append_option(optgroup->get_option("belt_scale_z")); - line.append_option(optgroup->get_option("belt_scale_z_angle")); - optgroup->append_line(line); - } - { - Line line = { L("G-code axis remap"), L("Remap slicing-frame axes to machine axes in G-code output") }; - line.append_option(optgroup->get_option("belt_gcode_remap_x")); - line.append_option(optgroup->get_option("belt_gcode_remap_y")); - line.append_option(optgroup->get_option("belt_gcode_remap_z")); - optgroup->append_line(line); - } optgroup->append_single_option_line("support_multi_bed_types","printer_basic_information_printable_space#support-multi-bed-types"); optgroup->append_single_option_line("best_object_pos", "printer_basic_information_printable_space#best-object-position"); // todo: for multi_extruder test @@ -4435,6 +4383,68 @@ void TabPrinter::build_fff() //option.opt.full_width = true; //optgroup->append_single_option_line(option); optgroup->append_single_option_line("disable_m73", "printer_basic_information_advanced#disable-set-remaining-print-time"); + optgroup->append_single_option_line("build_plate_tilt_x"); + optgroup->append_single_option_line("build_plate_tilt_y"); + optgroup->append_single_option_line("belt_printer"); + optgroup->append_single_option_line("belt_printer_angle"); + optgroup->append_single_option_line("belt_printer_infinite_y"); + // Per-axis shear: group mode + angle + source on one row per axis + { + Line line = { L("Mesh shear X"), L("Shear applied to the X axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_x")); + line.append_option(optgroup->get_option("belt_shear_x_angle")); + line.append_option(optgroup->get_option("belt_shear_x_from")); + line.append_option(optgroup->get_option("belt_shear_x_global")); + optgroup->append_line(line); + } + { + Line line = { L("Mesh shear Y"), L("Shear applied to the Y axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_y")); + line.append_option(optgroup->get_option("belt_shear_y_angle")); + line.append_option(optgroup->get_option("belt_shear_y_from")); + line.append_option(optgroup->get_option("belt_shear_y_global")); + optgroup->append_line(line); + } + { + Line line = { L("Mesh shear Z"), L("Shear applied to the Z axis before slicing") }; + line.append_option(optgroup->get_option("belt_shear_z")); + line.append_option(optgroup->get_option("belt_shear_z_angle")); + line.append_option(optgroup->get_option("belt_shear_z_from")); + line.append_option(optgroup->get_option("belt_shear_z_global")); + optgroup->append_line(line); + } + { + Line line = { L("Mesh scale X"), L("Scale applied to the X axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_x")); + line.append_option(optgroup->get_option("belt_scale_x_angle")); + optgroup->append_line(line); + } + { + Line line = { L("Mesh scale Y"), L("Scale applied to the Y axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_y")); + line.append_option(optgroup->get_option("belt_scale_y_angle")); + optgroup->append_line(line); + } + { + Line line = { L("Mesh scale Z"), L("Scale applied to the Z axis before slicing") }; + line.append_option(optgroup->get_option("belt_scale_z")); + line.append_option(optgroup->get_option("belt_scale_z_angle")); + optgroup->append_line(line); + } + { + Line line = { L("G-code axis remap"), L("Remap slicing-frame axes to machine axes in G-code output") }; + line.append_option(optgroup->get_option("belt_gcode_remap_x")); + line.append_option(optgroup->get_option("belt_gcode_remap_y")); + line.append_option(optgroup->get_option("belt_gcode_remap_z")); + optgroup->append_line(line); + } + { + Line line = { L("Support floor"), L("Belt floor awareness for support generation and clipping") }; + line.append_option(optgroup->get_option("belt_support_floor_mode")); + line.append_option(optgroup->get_option("belt_support_floor_offset")); + line.append_option(optgroup->get_option("belt_support_z_offset_mode")); + optgroup->append_line(line); + } option = optgroup->get_option("thumbnails"); option.opt.full_width = true; optgroup->append_single_option_line(option, "printer_basic_information_advanced#g-code-thumbnails"); @@ -5284,6 +5294,33 @@ void TabPrinter::toggle_options() "belt_scale_x", "belt_scale_y", "belt_scale_z", "belt_gcode_remap_x"}) toggle_line(el, is_belt); + + // Gray out angle/from sub-options when their parent shear/scale mode is None. + auto sx = m_config->option>("belt_shear_x")->value; + toggle_option("belt_shear_x_angle", is_belt && sx != BeltShearMode::None); + toggle_option("belt_shear_x_from", is_belt && sx != BeltShearMode::None); + toggle_option("belt_shear_x_global", is_belt && sx != BeltShearMode::None); + + auto sy = m_config->option>("belt_shear_y")->value; + toggle_option("belt_shear_y_angle", is_belt && sy != BeltShearMode::None); + toggle_option("belt_shear_y_from", is_belt && sy != BeltShearMode::None); + toggle_option("belt_shear_y_global", is_belt && sy != BeltShearMode::None); + + auto sz = m_config->option>("belt_shear_z")->value; + toggle_option("belt_shear_z_angle", is_belt && sz != BeltShearMode::None); + toggle_option("belt_shear_z_from", is_belt && sz != BeltShearMode::None); + toggle_option("belt_shear_z_global", is_belt && sz != BeltShearMode::None); + + auto scx = m_config->option>("belt_scale_x")->value; + toggle_option("belt_scale_x_angle", is_belt && scx != BeltScaleMode::None); + + auto scy = m_config->option>("belt_scale_y")->value; + toggle_option("belt_scale_y_angle", is_belt && scy != BeltScaleMode::None); + + auto scz = m_config->option>("belt_scale_z")->value; + toggle_option("belt_scale_z_angle", is_belt && scz != BeltScaleMode::None); + + toggle_line("belt_support_floor_mode", is_belt); } From 9bbac19de424b903666f415f07a46ccc5f7646a7 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 25 Mar 2026 22:19:31 -0500 Subject: [PATCH 017/389] Part 2.7: Add G-code back-transform and tree support belt floor clipping - Add BeltBackTransform class that inverts the shear/scale matrix and applies it in GCodeWriter::to_machine_coords() so G-code outputs in the machine's physical coordinate space, gated by new belt_gcode_back_transform config option - Extend belt floor clipping to all three tree support pipelines (Prusa-style, Orca organic, TreeModelVolumes) with per-layer polygon clipping, anti-overhang integration, and belt raft extension layers - Fix tree drop_nodes() belt termination, organic support global Z offset, collision calculation index bug, and first-layer brim/empty layer checks for belt printers two-shot - first build built but didn't plumb to UI. Woah. add pre-slice axis remap, because Y needs to be Z going to change tactic and move based on bbox min switch to per axis snapping per axis swap snap now per object build plate tilt wasn't invalidating slicer settings support upper bound now correct, need to get lower bound corrected axis swapped support termination corrected Z Shear works with and without pre-slice remap now --- src/libslic3r/CMakeLists.txt | 2 + src/libslic3r/GCode.cpp | 142 +++++++++++++++++++ src/libslic3r/GCode.hpp | 5 + src/libslic3r/GCode/BeltBackTransform.cpp | 150 +++++++++++++++++++++ src/libslic3r/GCode/BeltBackTransform.hpp | 45 +++++++ src/libslic3r/GCode/GCodeProcessor.cpp | 22 +++ src/libslic3r/GCode/GCodeProcessor.hpp | 6 + src/libslic3r/GCodeWriter.cpp | 32 ++++- src/libslic3r/GCodeWriter.hpp | 9 ++ src/libslic3r/Preset.cpp | 6 +- src/libslic3r/Print.cpp | 11 +- src/libslic3r/Print.hpp | 31 +++++ src/libslic3r/PrintConfig.cpp | 60 ++++++++- src/libslic3r/PrintConfig.hpp | 10 ++ src/libslic3r/PrintObject.cpp | 19 ++- src/libslic3r/PrintObjectSlice.cpp | 117 +++++++++++++--- src/libslic3r/Support/TreeModelVolumes.cpp | 2 +- src/libslic3r/Support/TreeSupport.cpp | 93 +++++++++++++ src/libslic3r/Support/TreeSupport3D.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 39 +++++- 20 files changed, 767 insertions(+), 36 deletions(-) create mode 100644 src/libslic3r/GCode/BeltBackTransform.cpp create mode 100644 src/libslic3r/GCode/BeltBackTransform.hpp diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 5f9591452f..c2d92ee800 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -208,6 +208,8 @@ set(lisbslic3r_sources GCode/AdaptivePAProcessor.hpp GCode/AvoidCrossingPerimeters.cpp GCode/AvoidCrossingPerimeters.hpp + GCode/BeltBackTransform.cpp + GCode/BeltBackTransform.hpp GCode/ConflictChecker.cpp GCode/ConflictChecker.hpp GCode/CoolingBuffer.cpp diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 5b1330b202..ac04c6dd5b 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2432,6 +2432,16 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Build volume extents for Rev remap mode. BoundingBoxf bbox_bed(print.config().printable_area.values); m_writer.set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), print.config().printable_height.value)); + // Initialize the back-transform that undoes slicing shear/scale. + m_writer.set_belt_back_transform(print.config()); + // Per-axis origin snap: store config; actual snap is computed + // per-instance in update_origin_snap() called from set_origin(). + m_origin_snap[0] = print.config().belt_origin_snap_x.value; + m_origin_snap[1] = print.config().belt_origin_snap_y.value; + m_origin_snap[2] = print.config().belt_origin_snap_z.value; + m_origin_snap_offset[0] = print.config().belt_origin_offset_x.value; + m_origin_snap_offset[1] = print.config().belt_origin_offset_y.value; + m_origin_snap_offset[2] = print.config().belt_origin_offset_z.value; } // How many times will be change_layer() called? @@ -2544,6 +2554,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); + file.write_format("; belt_preslice_remap_x = %s\n", full_cfg.opt_serialize("belt_preslice_remap_x").c_str()); + file.write_format("; belt_preslice_remap_y = %s\n", full_cfg.opt_serialize("belt_preslice_remap_y").c_str()); + file.write_format("; belt_preslice_remap_z = %s\n", full_cfg.opt_serialize("belt_preslice_remap_z").c_str()); } if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); @@ -3248,6 +3261,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } print.throw_if_canceled(); this->set_origin(unscale((*print_object_instance_sequential_active)->shift)); + this->update_origin_snap((*print_object_instance_sequential_active)->print_object, + (*print_object_instance_sequential_active)->shift); // BBS: prime extruder if extruder change happens before this object instance bool prime_extruder = false; @@ -5263,6 +5278,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); + this->update_origin_snap(&instance_to_print.print_object, offset); if (instance_to_print.object_by_extruder.support != nullptr) { m_layer = layers[instance_to_print.layer_id].support_layer; m_object_layer_over_raft = false; @@ -5286,6 +5302,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); + this->update_origin_snap(&instance_to_print.print_object, offset); ExtrusionEntityCollection support_eec; // BBS @@ -5334,6 +5351,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); + this->update_origin_snap(&instance_to_print.print_object, offset); //FIXME the following code prints regions in the order they are defined, the path is not optimized in any way. auto has_infill = [](const std::vector &by_region) { @@ -5560,6 +5578,130 @@ void GCode::set_origin(const Vec2d &pointf) m_origin = pointf; } +void GCode::update_origin_snap(const PrintObject *obj, const Point &inst_shift) +{ + if (!m_origin_snap[0] && !m_origin_snap[1] && !m_origin_snap[2]) + return; + + // Clear existing snap so to_machine_coords gives raw machine coords for bbox computation. + for (int a = 0; a < 3; ++a) + m_writer.set_origin_snap(a, false, 0., 0.); + + // Reconstruct the belt pipeline transform for this object (same as + // PrintObjectSlice.cpp: z_shift * scale * shear * pre_remap). + const auto &cfg = m_config; + Transform3d belt = Transform3d::Identity(); + + // Pre-slice remap + int pre_rx = int(cfg.belt_preslice_remap_x.value); + int pre_ry = int(cfg.belt_preslice_remap_y.value); + int pre_rz = int(cfg.belt_preslice_remap_z.value); + if (pre_rx != int(BeltRemapAxis::PosX) || + pre_ry != int(BeltRemapAxis::PosY) || + pre_rz != int(BeltRemapAxis::PosZ)) { + auto remap_col = [](int r) -> Vec3d { + int a = r % 3; Vec3d c = Vec3d::Zero(); + c[a] = (r < 3) ? 1.0 : -1.0; + return c; + }; + Matrix3d lin; + lin.col(0) = remap_col(pre_rx); + lin.col(1) = remap_col(pre_ry); + lin.col(2) = remap_col(pre_rz); + Transform3d pre = Transform3d::Identity(); + pre.linear() = lin; + if (pre_rx >= 6 || pre_ry >= 6 || pre_rz >= 6) { + BoundingBoxf bb(cfg.printable_area.values); + Vec3d vm(bb.max.x(), bb.max.y(), cfg.printable_height.value); + Vec3d tr = Vec3d::Zero(); + if (pre_rx >= 6) tr[0] = vm[pre_rx % 3]; + if (pre_ry >= 6) tr[1] = vm[pre_ry % 3]; + if (pre_rz >= 6) tr[2] = vm[pre_rz % 3]; + pre.translation() = tr; + } + belt = pre * belt; + } + + // Shear + auto shear_f = [](BeltShearMode m, double a) -> double { + double r = Geometry::deg2rad(a), s = std::sin(r), c = std::cos(r); + switch (m) { + case BeltShearMode::PosCot: return (s > EPSILON) ? c/s : 0.; + case BeltShearMode::NegCot: return (s > EPSILON) ? -c/s : 0.; + case BeltShearMode::PosTan: return (c > EPSILON) ? s/c : 0.; + case BeltShearMode::NegTan: return (c > EPSILON) ? -s/c : 0.; + default: return 0.; + } + }; + struct AS { BeltShearMode m; double a; int f; }; + AS axes[3] = { + {cfg.belt_shear_x.value, cfg.belt_shear_x_angle.value, int(cfg.belt_shear_x_from.value)}, + {cfg.belt_shear_y.value, cfg.belt_shear_y_angle.value, int(cfg.belt_shear_y_from.value)}, + {cfg.belt_shear_z.value, cfg.belt_shear_z_angle.value, int(cfg.belt_shear_z_from.value)}, + }; + Transform3d shear = Transform3d::Identity(); + for (int i = 0; i < 3; ++i) + if (axes[i].m != BeltShearMode::None) { + double f = shear_f(axes[i].m, axes[i].a); + if (std::abs(f) > EPSILON) + shear.matrix()(i, axes[i].f) += f; + } + + // Scale + auto scale_f = [](BeltScaleMode m, double a) -> double { + if (m == BeltScaleMode::None) return 1.; + double r = Geometry::deg2rad(a), s = std::sin(r), c = std::cos(r); + switch (m) { + case BeltScaleMode::InvSin: return (s > EPSILON) ? 1./s : 1.; + case BeltScaleMode::InvCos: return (c > EPSILON) ? 1./c : 1.; + case BeltScaleMode::Sin: return s; + case BeltScaleMode::Cos: return c; + default: return 1.; + } + }; + Transform3d sc = Transform3d::Identity(); + sc.matrix()(0,0) = scale_f(cfg.belt_scale_x.value, cfg.belt_scale_x_angle.value); + sc.matrix()(1,1) = scale_f(cfg.belt_scale_y.value, cfg.belt_scale_y_angle.value); + sc.matrix()(2,2) = scale_f(cfg.belt_scale_z.value, cfg.belt_scale_z_angle.value); + + belt = sc * shear * belt; + + // Z-shift + double zs = (obj->belt_min_z() < 0.) ? -obj->belt_min_z() : 0.; + if (zs > 0.) { + Transform3d zsh = Transform3d::Identity(); + zsh.matrix()(2, 3) = zs; + belt = zsh * belt; + } + + // Full transform: belt * trafo_centered + Transform3d full = belt * obj->trafo_centered(); + + // Instance shift in slicer space + global Z offset + Vec3d shift(unscale(inst_shift.x()), + unscale(inst_shift.y()), + obj->belt_global_z_offset()); + + // Compute this instance's machine-space bbox min + BoundingBoxf3 bb = obj->model_object()->raw_bounding_box(); + Vec3d mn = bb.min.cast(), mx = bb.max.cast(); + Vec3d inst_min(std::numeric_limits::max(), + std::numeric_limits::max(), + std::numeric_limits::max()); + for (int i = 0; i < 8; ++i) { + Vec3d c((i & 1) ? mx.x() : mn.x(), + (i & 2) ? mx.y() : mn.y(), + (i & 4) ? mx.z() : mn.z()); + Vec3d mc = m_writer.to_machine_coords(full * c + shift); + for (int a = 0; a < 3; ++a) + inst_min[a] = std::min(inst_min[a], mc[a]); + } + + // Update writer snap for each enabled axis + for (int a = 0; a < 3; ++a) + m_writer.set_origin_snap(a, m_origin_snap[a], m_origin_snap_offset[a], inst_min[a]); +} + std::string GCode::preamble() { std::string gcode = m_writer.preamble(); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index d379300bad..dbec7d0315 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -493,6 +493,11 @@ private: This affects the input arguments supplied to the extrude*() and travel_to() methods. */ Vec2d m_origin; + // Per-axis origin snap: shift G-code so each object's bbox min = offset. + bool m_origin_snap[3] = {false, false, false}; + double m_origin_snap_offset[3] = {0., 0., 0.}; + // Called when switching instances to recompute the writer's snap for this instance. + void update_origin_snap(const PrintObject *obj, const Point &inst_shift); FullPrintConfig m_config; DynamicConfig m_calib_config; // scaled G-code resolution diff --git a/src/libslic3r/GCode/BeltBackTransform.cpp b/src/libslic3r/GCode/BeltBackTransform.cpp new file mode 100644 index 0000000000..7cd5bc6b53 --- /dev/null +++ b/src/libslic3r/GCode/BeltBackTransform.cpp @@ -0,0 +1,150 @@ +#include "BeltBackTransform.hpp" +#include "../Geometry.hpp" +#include + +namespace Slic3r { + +// Keep in sync with PrintObjectSlice.cpp compute_shear_factor (lines ~147-157). +static double compute_shear_factor(BeltShearMode mode, double angle_deg) +{ + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } +} + +// Keep in sync with PrintObjectSlice.cpp compute_scale_factor (lines ~180-192). +static double compute_scale_factor(BeltScaleMode mode, double angle_deg) +{ + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } +} + +bool BeltBackTransform::init_from_config(const PrintConfig &config) +{ + m_active = false; + m_inverse = Transform3d::Identity(); + + if (!config.belt_printer.value || !config.belt_gcode_back_transform.value) + return false; + + // --- Pre-slice axis remap (same as PrintObjectSlice.cpp) --- + int pre_rx = int(config.belt_preslice_remap_x.value); + int pre_ry = int(config.belt_preslice_remap_y.value); + int pre_rz = int(config.belt_preslice_remap_z.value); + + bool has_preslice_remap = (pre_rx != int(BeltRemapAxis::PosX) || + pre_ry != int(BeltRemapAxis::PosY) || + pre_rz != int(BeltRemapAxis::PosZ)); + + // Require at least one active transform to proceed. + bool has_global_shear = config.belt_shear_x_global.value || + config.belt_shear_y_global.value || + config.belt_shear_z_global.value; + if (!has_global_shear && !has_preslice_remap) + return false; + + // Build pre-slice remap matrix. + Transform3d pre_remap = Transform3d::Identity(); + if (has_preslice_remap) { + auto remap_column = [](int r) -> Vec3d { + int axis = r % 3; + Vec3d col = Vec3d::Zero(); + if (r < 3) col[axis] = 1.0; + else if (r < 6) col[axis] = -1.0; + else col[axis] = -1.0; // Rev: max - pos + return col; + }; + + Matrix3d remap_lin; + remap_lin.col(0) = remap_column(pre_rx); + remap_lin.col(1) = remap_column(pre_ry); + remap_lin.col(2) = remap_column(pre_rz); + pre_remap.linear() = remap_lin; + + // Rev mode translation (needs build volume extents). + Vec3d remap_trans = Vec3d::Zero(); + if (pre_rx >= 6 || pre_ry >= 6 || pre_rz >= 6) { + BoundingBoxf bbox_bed(config.printable_area.values); + Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), + config.printable_height.value); + auto add_rev = [&](int r, int out) { + if (r >= 6) remap_trans[out] = vol_max[r % 3]; + }; + add_rev(pre_rx, 0); + add_rev(pre_ry, 1); + add_rev(pre_rz, 2); + } + pre_remap.translation() = remap_trans; + } + + // Build per-axis shear matrix (same as PrintObjectSlice.cpp). + struct AxisShear { BeltShearMode mode; double angle; int from; }; + AxisShear axes[3] = { + { config.belt_shear_x.value, config.belt_shear_x_angle.value, int(config.belt_shear_x_from.value) }, + { config.belt_shear_y.value, config.belt_shear_y_angle.value, int(config.belt_shear_y_from.value) }, + { config.belt_shear_z.value, config.belt_shear_z_angle.value, int(config.belt_shear_z_from.value) }, + }; + + Matrix3d shear = Matrix3d::Identity(); + bool has_shear = false; + for (int row = 0; row < 3; ++row) { + if (axes[row].mode != BeltShearMode::None) { + double factor = compute_shear_factor(axes[row].mode, axes[row].angle); + if (std::abs(factor) > EPSILON) { + shear(row, axes[row].from) += factor; + has_shear = true; + } + } + } + + // Build per-axis scale diagonal matrix (same as PrintObjectSlice.cpp). + double sx = compute_scale_factor(config.belt_scale_x.value, config.belt_scale_x_angle.value); + double sy = compute_scale_factor(config.belt_scale_y.value, config.belt_scale_y_angle.value); + double sz = compute_scale_factor(config.belt_scale_z.value, config.belt_scale_z_angle.value); + + Matrix3d scale = Matrix3d::Identity(); + bool has_scale = (std::abs(sx - 1.) > EPSILON || + std::abs(sy - 1.) > EPSILON || + std::abs(sz - 1.) > EPSILON); + if (has_scale) { + scale(0, 0) = sx; + scale(1, 1) = sy; + scale(2, 2) = sz; + } + + if (!has_shear && !has_scale && !has_preslice_remap) + return false; + + // Forward pipeline: scale * shear * pre_remap (same order as PrintObjectSlice.cpp). + Transform3d combined = Transform3d::Identity(); + combined.linear() = scale * shear; + combined = combined * pre_remap; + m_inverse = combined.inverse(); + m_active = true; + return true; +} + +Vec3d BeltBackTransform::apply(const Vec3d &pos) const +{ + if (!m_active) + return pos; + return m_inverse * pos; +} + +} // namespace Slic3r diff --git a/src/libslic3r/GCode/BeltBackTransform.hpp b/src/libslic3r/GCode/BeltBackTransform.hpp new file mode 100644 index 0000000000..5a75d94dc8 --- /dev/null +++ b/src/libslic3r/GCode/BeltBackTransform.hpp @@ -0,0 +1,45 @@ +#ifndef slic3r_BeltBackTransform_hpp_ +#define slic3r_BeltBackTransform_hpp_ + +#include "../libslic3r.h" +#include "../Point.hpp" +#include "../PrintConfig.hpp" + +namespace Slic3r { + +// Reverses the pre-slice remap + shear + scale transforms that +// PrintObjectSlice.cpp applies to belt printer geometry, converting G-code +// coordinates from the sliced (remapped/sheared/scaled) frame back to the +// machine's real coordinate space. +// +// Initialized once from PrintConfig, then applied per-point in +// GCodeWriter::to_machine_coords() before axis remapping. +// +// Active when belt_gcode_back_transform is true AND at least one of: +// - a shear axis has global mode enabled, or +// - a pre-slice axis remap is non-identity. +class BeltBackTransform +{ +public: + BeltBackTransform() = default; + + // Initialize from belt printer config. Rebuilds the same pre-slice remap, + // shear, and scale matrices as PrintObjectSlice.cpp and precomputes the + // affine inverse. Returns true if a non-identity back-transform was computed. + bool init_from_config(const PrintConfig &config); + + // Apply the inverse transform to a point. Returns pos unchanged if + // no back-transform is active. + Vec3d apply(const Vec3d &pos) const; + + // True if a non-identity back-transform is active. + bool is_active() const { return m_active; } + +private: + bool m_active = false; + Transform3d m_inverse = Transform3d::Identity(); +}; + +} // namespace Slic3r + +#endif // slic3r_BeltBackTransform_hpp_ diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 8a470eff19..2288c9e670 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3128,6 +3128,28 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers if (boost::starts_with(comment, " belt_scale_z_angle = ")) { try { m_result.belt_scale_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; } + // Pre-slice axis remap + auto parse_remap_axis = [](const std::string &s) -> BeltRemapAxis { + if (s == "pos_x") return BeltRemapAxis::PosX; + if (s == "pos_y") return BeltRemapAxis::PosY; + if (s == "pos_z") return BeltRemapAxis::PosZ; + if (s == "neg_x") return BeltRemapAxis::NegX; + if (s == "neg_y") return BeltRemapAxis::NegY; + if (s == "neg_z") return BeltRemapAxis::NegZ; + if (s == "rev_x") return BeltRemapAxis::RevX; + if (s == "rev_y") return BeltRemapAxis::RevY; + if (s == "rev_z") return BeltRemapAxis::RevZ; + return BeltRemapAxis::PosX; + }; + if (boost::starts_with(comment, " belt_preslice_remap_x = ")) { + m_result.belt_preslice_remap_x = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + } + if (boost::starts_with(comment, " belt_preslice_remap_y = ")) { + m_result.belt_preslice_remap_y = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + } + if (boost::starts_with(comment, " belt_preslice_remap_z = ")) { + m_result.belt_preslice_remap_z = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + } } // wipe start tag if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) { diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index f953345f4e..7d08a9cdfd 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -246,6 +246,9 @@ class Print; float belt_scale_y_angle{ 45.f }; BeltScaleMode belt_scale_z{ BeltScaleMode::None }; float belt_scale_z_angle{ 45.f }; + BeltRemapAxis belt_preslice_remap_x{ BeltRemapAxis::PosX }; + BeltRemapAxis belt_preslice_remap_y{ BeltRemapAxis::PosY }; + BeltRemapAxis belt_preslice_remap_z{ BeltRemapAxis::PosZ }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; @@ -321,6 +324,9 @@ class Print; belt_scale_y_angle = other.belt_scale_y_angle; belt_scale_z = other.belt_scale_z; belt_scale_z_angle = other.belt_scale_z_angle; + belt_preslice_remap_x = other.belt_preslice_remap_x; + belt_preslice_remap_y = other.belt_preslice_remap_y; + belt_preslice_remap_z = other.belt_preslice_remap_z; #if ENABLE_GCODE_VIEWER_STATISTICS time = other.time; #endif diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index da655a6548..b5a6402a14 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -37,18 +37,40 @@ void GCodeWriter::set_build_volume_max(const Vec3d &max) m_build_vol_max = max; } +void GCodeWriter::set_belt_back_transform(const PrintConfig &config) +{ + m_belt_back_transform.init_from_config(config); +} + +void GCodeWriter::set_origin_snap(int axis, bool enable, double offset, double bbox_min) +{ + if (axis >= 0 && axis < 3) { + m_origin_snap[axis] = enable; + m_origin_offset[axis] = offset; + m_origin_bbox_min[axis] = bbox_min; + } +} + Vec3d GCodeWriter::to_machine_coords(const Vec3d &pos) const { if (!is_belt_printer()) return pos; + // Step 1: Undo the shear/scale applied during slicing. + Vec3d p = m_belt_back_transform.apply(pos); + // Step 2: Apply axis remapping for the machine's coordinate convention. // BeltRemapAxis: 0-2 = +X/+Y/+Z, 3-5 = -X/-Y/-Z, 6-8 = Rev X/Y/Z - auto remap = [this, &pos](int r) -> double { + auto remap = [this, &p](int r) -> double { int axis = r % 3; - if (r < 3) return pos[axis]; - if (r < 6) return -pos[axis]; - return m_build_vol_max[axis] - pos[axis]; + if (r < 3) return p[axis]; + if (r < 6) return -p[axis]; + return m_build_vol_max[axis] - p[axis]; }; - return { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; + Vec3d result = { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; + // Per-axis origin snap: shift so bbox min on each enabled axis = offset. + for (int i = 0; i < 3; ++i) + if (m_origin_snap[i]) + result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); + return result; } bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 6074eb247c..2334f5d416 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -8,6 +8,7 @@ #include "Point.hpp" #include "PrintConfig.hpp" #include "GCode/CoolingBuffer.hpp" +#include "GCode/BeltBackTransform.hpp" namespace Slic3r { @@ -132,6 +133,10 @@ public: void set_axis_remap(int rx, int ry, int rz); // Set build volume extents for Rev remap mode (max X, Y, Z). void set_build_volume_max(const Vec3d &max); + // Initialize the belt back-transform that undoes slicing shear/scale. + void set_belt_back_transform(const PrintConfig &config); + // Set per-axis origin snap: shifts G-code so bbox min on this axis = offset. + void set_origin_snap(int axis, bool enable, double offset, double bbox_min); // Transform a point from the slicing frame to machine coordinates. Vec3d to_machine_coords(const Vec3d &pos) const; @@ -194,6 +199,10 @@ public: int m_remap_y = 1; int m_remap_z = 2; Vec3d m_build_vol_max = Vec3d::Zero(); + BeltBackTransform m_belt_back_transform; + bool m_origin_snap[3] = {false, false, false}; + double m_origin_offset[3] = {0., 0., 0.}; // target coord for bbox min + double m_origin_bbox_min[3] = {0., 0., 0.}; // computed bbox min in machine space double m_current_speed; bool m_is_first_layer = true; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 3c597ac7f2..737ee2d663 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1014,7 +1014,11 @@ static std::vector s_Preset_printer_options { "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", "belt_shear_y_global", "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", "belt_shear_z_global", "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", - "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", + "belt_preslice_remap_x", "belt_preslice_remap_y", "belt_preslice_remap_z", + "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", "belt_gcode_back_transform", + "belt_origin_snap_x", "belt_origin_offset_x", + "belt_origin_snap_y", "belt_origin_offset_y", + "belt_origin_snap_z", "belt_origin_offset_z", "belt_support_floor_offset", "belt_support_floor_mode", "belt_support_z_offset_mode", "gcode_flavor", "fan_kickstart", "fan_speedup_time", "fan_speedup_overhangs", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 0aef12a74b..0b7190e8d1 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -103,6 +103,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", + "belt_origin_snap_x", "belt_origin_offset_x", + "belt_origin_snap_y", "belt_origin_offset_y", + "belt_origin_snap_z", "belt_origin_offset_z", //BBS "additional_cooling_fan_speed", "reduce_crossing_wall", @@ -280,6 +283,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n // In Spiral Vase mode, holes are closed and only the largest area contour is kept at each layer. // Therefore toggling the Spiral Vase on / off requires complete reslicing. || opt_key == "spiral_mode" + // Build plate tilt changes slicing plane orientation. + || opt_key == "build_plate_tilt_x" + || opt_key == "build_plate_tilt_y" // Belt printer transform options change the mesh geometry before slicing. || opt_key == "belt_printer" || opt_key == "belt_printer_angle" @@ -300,7 +306,10 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "belt_scale_y" || opt_key == "belt_scale_y_angle" || opt_key == "belt_scale_z" - || opt_key == "belt_scale_z_angle") { + || opt_key == "belt_scale_z_angle" + || opt_key == "belt_preslice_remap_x" + || opt_key == "belt_preslice_remap_y" + || opt_key == "belt_preslice_remap_z") { osteps.emplace_back(posSlice); } else if ( opt_key == "belt_support_floor_offset" diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index d0c050f442..c13a1407c0 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -186,6 +186,36 @@ class ConstSupportLayerPtrsAdaptor : public ConstVectorOfPtrsAdaptor(data) {} }; +// Returns the model's raw bounding box with pre-slice axis remap applied. +// When no remap is active, returns the unmodified raw_bounding_box(). +inline BoundingBoxf3 belt_remapped_bbox(const ModelObject &model_object, const PrintConfig &config) +{ + BoundingBoxf3 bb = model_object.raw_bounding_box(); + int pre_rx = int(config.belt_preslice_remap_x.value); + int pre_ry = int(config.belt_preslice_remap_y.value); + int pre_rz = int(config.belt_preslice_remap_z.value); + if (pre_rx == int(BeltRemapAxis::PosX) && + pre_ry == int(BeltRemapAxis::PosY) && + pre_rz == int(BeltRemapAxis::PosZ)) + return bb; // Identity remap, no change. + auto remap_coord = [](int r, const Vec3d &v) -> double { + int axis = r % 3; + if (r < 3) return v[axis]; + return -v[axis]; + }; + Vec3d mn = bb.min.cast(), mx = bb.max.cast(); + BoundingBoxf3 rbb; + for (int i = 0; i < 8; ++i) { + Vec3d c((i & 1) ? mx.x() : mn.x(), + (i & 2) ? mx.y() : mn.y(), + (i & 4) ? mx.z() : mn.z()); + Vec3d rc(remap_coord(pre_rx, c), remap_coord(pre_ry, c), remap_coord(pre_rz, c)); + if (i == 0) rbb = BoundingBoxf3(rc, rc); + else rbb.merge(rc); + } + return rbb; +} + // Single instance of a PrintObject. // As multiple PrintObjects may be generated for a single ModelObject (their instances differ in rotation around Z), // ModelObject's instancess will be distributed among these multiple PrintObjects. @@ -579,6 +609,7 @@ private: double m_belt_min_z { 0.0 }; public: double belt_global_z_offset() const { return m_belt_global_z_offset; } + double belt_min_z() const { return m_belt_min_z; } private: diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 96e320ecf4..8c637b7f7c 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6136,9 +6136,63 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionEnum(default_axis)); }; - add_belt_remap("belt_gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output.", BeltRemapAxis::PosX); - add_belt_remap("belt_gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output.", BeltRemapAxis::PosY); - add_belt_remap("belt_gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output.", BeltRemapAxis::PosZ); + add_belt_remap("belt_preslice_remap_x", "X", + "Before slicing, which model-space axis becomes the slicer's X axis. " + "Use this to re-orient the coordinate system so the slicer's XY plane matches " + "your belt printer's physical bed plane. For a printer whose bed is in the XZ plane, " + "set Y to +Z and Z to +Y (or -Y) to swap the vertical and belt-travel axes. " + "Default +X: no change.", + BeltRemapAxis::PosX); + add_belt_remap("belt_preslice_remap_y", "Y", + "Before slicing, which model-space axis becomes the slicer's Y axis. " + "The slicer treats Y as one of the two horizontal bed axes. If your physical " + "belt surface runs along the Z axis, map Y to +Z here so the slicer slices " + "along the correct plane. Default +Y: no change.", + BeltRemapAxis::PosY); + add_belt_remap("belt_preslice_remap_z", "Z", + "Before slicing, which model-space axis becomes the slicer's Z axis (layer stacking direction). " + "The slicer builds layers upward along this axis. If your printer's layer-stacking " + "direction is the physical Y axis, map Z to +Y (or -Y for inverted direction). " + "Rev mode mirrors relative to the build volume maximum. Default +Z: no change.", + BeltRemapAxis::PosZ); + + add_belt_remap("belt_gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosX); + add_belt_remap("belt_gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosY); + add_belt_remap("belt_gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosZ); + + def = this->add("belt_gcode_back_transform", coBool); + def->label = L("G-code back-transform"); + def->category = L("Printable space"); + def->tooltip = L("Reverse the shear/scale transform applied during slicing so G-code " + "coordinates are in the machine's physical coordinate space. " + "Requires at least one shear axis with global mode enabled."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + + auto add_belt_origin_snap = [this](const char *key_snap, const char *key_offset, + const char *axis_label) { + auto def = this->add(key_snap, coBool); + def->label = L(axis_label); + def->category = L("Printable space"); + std::string tip = std::string("Shift G-code output so the object's bounding box minimum on machine ") + + axis_label + " equals the offset value."; + def->tooltip = L(tip); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + + def = this->add(key_offset, coFloat); + def->label = L("Offset"); + def->category = L("Printable space"); + def->tooltip = L("Target coordinate for the bounding box minimum on this machine axis."); + def->sidetext = L("mm"); + def->min = -10000; + def->max = 10000; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0)); + }; + add_belt_origin_snap("belt_origin_snap_x", "belt_origin_offset_x", "X"); + add_belt_origin_snap("belt_origin_snap_y", "belt_origin_offset_y", "Y"); + add_belt_origin_snap("belt_origin_snap_z", "belt_origin_offset_z", "Z"); // Belt support floor debug controls def = this->add("belt_support_floor_offset", coFloat); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 2d76dcc0b5..13202657ef 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1487,9 +1487,19 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, belt_scale_y_angle)) ((ConfigOptionEnum, belt_scale_z)) ((ConfigOptionFloat, belt_scale_z_angle)) + ((ConfigOptionEnum, belt_preslice_remap_x)) + ((ConfigOptionEnum, belt_preslice_remap_y)) + ((ConfigOptionEnum, belt_preslice_remap_z)) ((ConfigOptionEnum, belt_gcode_remap_x)) ((ConfigOptionEnum, belt_gcode_remap_y)) ((ConfigOptionEnum, belt_gcode_remap_z)) + ((ConfigOptionBool, belt_gcode_back_transform)) + ((ConfigOptionBool, belt_origin_snap_x)) + ((ConfigOptionFloat, belt_origin_offset_x)) + ((ConfigOptionBool, belt_origin_snap_y)) + ((ConfigOptionFloat, belt_origin_offset_y)) + ((ConfigOptionBool, belt_origin_snap_z)) + ((ConfigOptionFloat, belt_origin_offset_z)) ((ConfigOptionFloat, belt_support_floor_offset)) ((ConfigOptionEnum, belt_support_floor_mode)) ((ConfigOptionEnum, belt_support_z_offset_mode)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index f803cc0369..ba2ed408ce 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -3402,9 +3402,16 @@ void PrintObject::update_slicing_parameters() double belt_floor_shear_factor_out = 0.0; int belt_floor_from_axis_out = 1; double belt_floor_z_shift_out = 0.0; - // Belt shear/scale may change the effective Z height. + // Belt shear/scale/pre-remap may change the effective Z height. const auto &pcfg = this->print()->config(); if (pcfg.belt_printer.value) { + BoundingBoxf3 bb = belt_remapped_bbox(*this->model_object(), pcfg); + bool has_preslice_remap = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || + int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || + int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); + if (has_preslice_remap) + object_height = bb.size().z(); + bool has_z_shear = pcfg.belt_shear_z.value != BeltShearMode::None; bool has_z_scale = pcfg.belt_scale_z.value != BeltScaleMode::None; if (has_z_shear || has_z_scale) { @@ -3435,7 +3442,6 @@ void PrintObject::update_slicing_parameters() double scale_z = compute_scale_factor(pcfg.belt_scale_z.value, pcfg.belt_scale_z_angle.value); if (has_z_shear && std::abs(shear_factor) > EPSILON) { int from = int(pcfg.belt_shear_z_from.value); - BoundingBoxf3 bb = this->model_object()->raw_bounding_box(); double min_rz = std::numeric_limits::max(); double max_rz = std::numeric_limits::lowest(); for (double vz : {bb.min.z(), bb.max.z()}) @@ -3507,8 +3513,15 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full if (object_max_z <= 0.f) { BoundingBoxf3 bb = model_object.raw_bounding_box(); object_max_z = (float)bb.size().z(); - // Belt shear/scale may change the effective Z height. + // Belt pre-remap/shear/scale may change the effective Z height. if (print_config.belt_printer.value) { + bb = belt_remapped_bbox(model_object, print_config); + bool has_preslice_remap = (int(print_config.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || + int(print_config.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || + int(print_config.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); + if (has_preslice_remap) + object_max_z = (float)bb.size().z(); + bool has_z_shear = print_config.belt_shear_z.value != BeltShearMode::None; bool has_z_scale = print_config.belt_scale_z.value != BeltScaleMode::None; if (has_z_shear || has_z_scale) { diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 404550da1a..4c767ea0ed 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -143,6 +143,58 @@ static std::vector slice_volumes_inner( params_base.extra_offset = 0; params_base.trafo = object_trafo; if (print_config.belt_printer.value) { + // --- Pre-slice axis remap --- + // Permutes/negates model axes before slicing so the slicer's coordinate + // system matches the physical bed orientation (e.g. XZ bed instead of XY). + int pre_rx = int(print_config.belt_preslice_remap_x.value); + int pre_ry = int(print_config.belt_preslice_remap_y.value); + int pre_rz = int(print_config.belt_preslice_remap_z.value); + + bool has_preslice_remap = (pre_rx != int(BeltRemapAxis::PosX) || + pre_ry != int(BeltRemapAxis::PosY) || + pre_rz != int(BeltRemapAxis::PosZ)); + + if (has_preslice_remap) { + // Build volume extents for Rev mode. + BoundingBoxf bbox_bed(print_config.printable_area.values); + Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), + print_config.printable_height.value); + + // Each remap value selects a source axis and sign. + // The column vector tells the matrix which input axis feeds this output. + auto remap_column = [](int r) -> Vec3d { + int axis = r % 3; + Vec3d col = Vec3d::Zero(); + if (r < 3) col[axis] = 1.0; // +axis + else if (r < 6) col[axis] = -1.0; // -axis + else col[axis] = -1.0; // Rev: max - pos = -(pos - max) + return col; + }; + + Matrix3d remap_lin; + remap_lin.col(0) = remap_column(pre_rx); + remap_lin.col(1) = remap_column(pre_ry); + remap_lin.col(2) = remap_column(pre_rz); + + // Translation for Rev modes: output = max[src] - input[src]. + Vec3d remap_trans = Vec3d::Zero(); + auto add_rev_offset = [&](int r, int out_axis) { + if (r >= 6) { + int src_axis = r % 3; + remap_trans[out_axis] = vol_max[src_axis]; + } + }; + add_rev_offset(pre_rx, 0); + add_rev_offset(pre_ry, 1); + add_rev_offset(pre_rz, 2); + + Transform3d pre_remap = Transform3d::Identity(); + pre_remap.linear() = remap_lin; + pre_remap.translation() = remap_trans; + + params_base.trafo = pre_remap * params_base.trafo; + } + // Build per-axis shear matrix from 3 independent axis configs. auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { double angle_rad = Geometry::deg2rad(angle_deg); @@ -204,11 +256,12 @@ static std::vector slice_volumes_inner( } // Apply: scale * shear * trafo (shear first, then scale). - if (has_shear || has_scale) { + if (has_shear || has_scale) params_base.trafo = belt_scale * belt_shear * params_base.trafo; - // After the shear/scale transform, the mesh may clip through the - // build plate (Z < 0). Detect this and shift the mesh up. + // After pre-remap/shear/scale, the mesh may clip through the build + // plate (Z < 0). Detect this and shift the mesh up along slicer Z. + if (has_preslice_remap || has_shear || has_scale) { Transform3d combined = params_base.trafo; double min_z = std::numeric_limits::max(); for (const ModelVolume *mv : model_volumes) { @@ -893,17 +946,34 @@ void PrintObject::slice() this->slice_volumes(); m_print->throw_if_canceled(); - // After slicing, m_belt_min_z holds the exact post-shear minimum Z - // in trafo_centered space (which includes the ensure_on_bed Z offset). - // The belt surface is at Z=0 in trafo_centered space; after shear it - // becomes Z = sf*Y, and after the z-shift that keeps the mesh above - // Z=0 it becomes Z = sf*Y + z_shift_val. So belt_floor_z_shift is - // simply the z-shift applied, i.e. max(0, -m_belt_min_z). - // NOTE: do NOT add raw_bounding_box().min.z() here — m_belt_min_z - // already includes the ensure_on_bed offset, unlike the min_rz used - // in update_slicing_parameters() which needs that compensation. + // Belt floor Z-shift: where is the belt surface in final slicer space? + // + // The belt surface is at model_Y=0 (XZ belt plane). After the full + // pipeline (trafo_centered → pre_remap → shear → z_shift), the belt + // surface equation in slicer space is: + // Z_belt = sf * from_axis + belt_surface_z_centered + z_shift_val + // + // belt_surface_z_centered = remapped_bbox.min.z() (the Z position of + // the belt surface in centered-pre-shear slicer space, which is 0 + // without pre-remap but nonzero when e.g. Y↔Z swap shifts the belt + // surface away from Z=0 by the centering offset). + // + // z_shift_val = max(0, -m_belt_min_z) (lifts mesh above Z=0). + // + // So: belt_floor_z_shift = remapped_bb.min.z() + z_shift_val if (std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON) { - m_slicing_params.belt_floor_z_shift = (m_belt_min_z < 0.) ? -m_belt_min_z : 0.; + double z_shift_val = (m_belt_min_z < 0.) ? -m_belt_min_z : 0.; + // With pre-remap, the belt surface (model_Y=0) may not be at Z=0 in + // centered slicer space — add the remapped bbox min Z to compensate. + // Without pre-remap, the belt surface IS at Z=0 and bb.min.z() is + // already folded into m_belt_min_z, so use 0. + const auto &pcfg = this->print()->config(); + bool has_preslice_remap = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || + int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || + int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); + double belt_surface_z = has_preslice_remap + ? belt_remapped_bbox(*this->model_object(), pcfg).min.z() : 0.; + m_slicing_params.belt_floor_z_shift = belt_surface_z + z_shift_val; } int firstLayerReplacedBy = 0; @@ -989,14 +1059,23 @@ void PrintObject::slice() const auto &za = gaxes[2]; // Z row if (za.global && za.mode != BeltShearMode::None && za.from < 2) { double factor = compute_shear_factor(za.mode, za.angle); - // The Z-shift brought the mesh's lowest sheared vertex to - // Z=0. That vertex's physical Y determines the belt contact - // point. With trafo_z preserved (ensure_on_bed offset), - // min_z = Y_at_contact * factor for bottom-face vertices, - // so: z_offset = center_Y * factor + min_z. + // The global Z offset accounts for the instance's position- + // dependent shear contribution. m_belt_min_z is the minimum Z + // of the mesh after pre_remap + shear + trafo_centered, which + // includes the centering offset on the remapped Z axis. + // Subtract the belt surface's centered Z position so we get + // only the shear-induced contribution (same correction as the + // belt_floor_z_shift fix). + // Same pre-remap guard as belt_floor_z_shift above. + bool has_preslice_remap2 = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || + int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || + int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); + double belt_surface_z = has_preslice_remap2 + ? belt_remapped_bbox(*this->model_object(), this->print()->config()).min.z() : 0.; + double shear_min_z = m_belt_min_z - belt_surface_z; Point phys = inst_shift; // already has center_offset subtracted double center_on_axis = (za.from == 0) ? unscale(phys.x()) : unscale(phys.y()); - global_z_offset += center_on_axis * factor + m_belt_min_z; + global_z_offset += center_on_axis * factor + shear_min_z; } BOOST_LOG_TRIVIAL(warning) << "Belt global: z_offset=" << global_z_offset diff --git a/src/libslic3r/Support/TreeModelVolumes.cpp b/src/libslic3r/Support/TreeModelVolumes.cpp index e270b62aab..ec38ffed73 100644 --- a/src/libslic3r/Support/TreeModelVolumes.cpp +++ b/src/libslic3r/Support/TreeModelVolumes.cpp @@ -151,7 +151,7 @@ TreeModelVolumes::TreeModelVolumes( double belt_sf = sp2.belt_floor_shear_factor; if (std::abs(belt_sf) > EPSILON && std::abs(print_object.belt_global_z_offset()) > EPSILON && pcfg2.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { - double bb_min_z = std::abs(print_object.model_object()->raw_bounding_box().min.z()); + double bb_min_z = std::abs(belt_remapped_bbox(*print_object.model_object(), pcfg2).min.z()); double extra_depth = bb_min_z + 10.; int num_extra = std::max(0, (int)std::ceil(extra_depth / sp2.layer_height)); if (num_extra > 0) { diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 4966a5a139..60e681add9 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1733,6 +1733,99 @@ void TreeSupport::generate() + // Belt floor: extend support below the object's first layer by creating + // additional support layers with geometry copied from the lowest content + // layer and clipped at the belt surface. These layers bypass the tree + // algorithm entirely — they're pure geometry added after draw_circles(). + { + const auto &sp = m_slicing_params; + const auto &pcfg = *m_print_config; + const double sf = sp.belt_floor_shear_factor; + if (std::abs(sf) > EPSILON + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly + && m_object->support_layer_count() > 0) { + const int from_axis = sp.belt_floor_from_axis; + const double floor_off = pcfg.belt_support_floor_offset.value; + // Support layer print_z values are in GLOBAL Z (non-organic inherits + // from object layers which include global_z_offset). Use the GLOBAL + // belt_floor_z_shift to match. + const double z_shift = sp.belt_floor_z_shift; + // Find the lowest non-empty, non-brim support layer. + ExPolygons source_areas; + double source_z = 0; + int layers_with_content = 0; + for (size_t i = 0; i < m_object->support_layer_count(); ++i) { + SupportLayer *sl = m_object->get_support_layer(i); + if (sl && !sl->base_areas.empty()) { + layers_with_content++; + if (layers_with_content >= 2) { + source_areas = sl->base_areas; + source_z = sl->print_z; + break; + } + } + } + // Fallback to first content layer. + if (source_areas.empty()) { + for (size_t i = 0; i < m_object->support_layer_count(); ++i) { + SupportLayer *sl = m_object->get_support_layer(i); + if (sl && !sl->base_areas.empty()) { + source_areas = sl->base_areas; + source_z = sl->print_z; + break; + } + } + } + if (!source_areas.empty()) { + BoundingBoxf3 bb = belt_remapped_bbox(*m_object->model_object(), m_object->print()->config()); + double from_extent = std::abs(bb.min(from_axis)); + double bb_min_z = std::abs(bb.min.z()); + double first_z = m_object->get_support_layer(0)->print_z; + // Depth = from-axis extent + pre-shear bbox Z offset (ensure_on_bed + // distance) + 10mm safety margin. The 10mm is a bodge to avoid + // small cutoff artifacts — ideally computed exactly from belt geometry. + double extra_depth = std::min(from_extent + bb_min_z + 10., std::max(0., first_z)); + int num_extra = std::max(0, (int)std::ceil(extra_depth / sp.layer_height)); + ExPolygons prev_areas = source_areas; + // Build belt extension layers (lowest Z first). + SupportLayerPtrs belt_ext_layers; + for (int i = num_extra; i >= 1 && !prev_areas.empty(); --i) { + double print_z = first_z - i * sp.layer_height; + if (print_z < -sp.layer_height) continue; + double cutoff = (print_z - z_shift - floor_off) / sf; + coord_t cutoff_sc = scale_(cutoff); + coord_t big = scale_(1e3); + Polygon belt_poly; + if (from_axis == 0) { + if (sf > 0) belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; + else belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; + } else { + if (sf > 0) belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; + else belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; + } + ExPolygons clipped = diff_ex(source_areas, Polygons{belt_poly}); + if (clipped.empty()) continue; + SupportLayer *sl = new SupportLayer(0, 0, m_object, sp.layer_height, print_z, -1); + sl->base_areas = clipped; + // Populate area_groups — generate_toolpaths() iterates these, + // not base_areas directly. + for (auto &expoly : sl->base_areas) + sl->area_groups.emplace_back(&expoly, SupportLayer::BaseType, 0); + sl->lslices = clipped; + sl->lslices_bboxes.reserve(clipped.size()); + for (const ExPolygon &ep : clipped) + sl->lslices_bboxes.emplace_back(get_extents(ep)); + belt_ext_layers.push_back(sl); + } + // Insert at the front of support_layers (they're already in Z order). + if (!belt_ext_layers.empty()) { + auto &sl_vec = m_object->support_layers(); + sl_vec.insert(sl_vec.begin(), belt_ext_layers.begin(), belt_ext_layers.end()); + } + } + } + } + profiler.stage_start(STAGE_GENERATE_TOOLPATHS); m_object->print()->set_status(70, _u8L("Generating support")); generate_toolpaths(); diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index b551a42ece..9d35cb2dd8 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -3381,7 +3381,7 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons // termination happen inside the belt region and get clipped. // Use the distance from the pre-shear bbox min Z to the part's // post-shear min Z, plus 10mm for base expansion headroom. - double bb_min_z = std::abs(po.model_object()->raw_bounding_box().min.z()); + double bb_min_z = std::abs(belt_remapped_bbox(*po.model_object(), pcfg).min.z()); double extra_depth = bb_min_z + 10.; int num_extra = std::max(0, (int)std::ceil(extra_depth / sp.layer_height)); if (num_extra > 0) { diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index d997fbb7a9..202c28c121 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4432,12 +4432,41 @@ void TabPrinter::build_fff() optgroup->append_line(line); } { - Line line = { L("G-code axis remap"), L("Remap slicing-frame axes to machine axes in G-code output") }; + Line line = { L("Pre-slice axis remap"), + L("Remap model axes before slicing so the slicer's coordinate system matches " + "the physical bed orientation. For belt printers whose bed is NOT in the XY plane, " + "use this to swap axes so layers are stacked in the correct physical direction.") }; + line.append_option(optgroup->get_option("belt_preslice_remap_x")); + line.append_option(optgroup->get_option("belt_preslice_remap_y")); + line.append_option(optgroup->get_option("belt_preslice_remap_z")); + optgroup->append_line(line); + } + { + Line line = { L("G-code axis remap (post-slice)"), L("Remap slicing-frame axes to machine axes in G-code output. Applied AFTER slicing, during G-code generation.") }; line.append_option(optgroup->get_option("belt_gcode_remap_x")); line.append_option(optgroup->get_option("belt_gcode_remap_y")); line.append_option(optgroup->get_option("belt_gcode_remap_z")); optgroup->append_line(line); } + optgroup->append_single_option_line("belt_gcode_back_transform"); + { + Line line = { L("Origin snap X"), L("Snap object bbox min X to offset in G-code output") }; + line.append_option(optgroup->get_option("belt_origin_snap_x")); + line.append_option(optgroup->get_option("belt_origin_offset_x")); + optgroup->append_line(line); + } + { + Line line = { L("Origin snap Y"), L("Snap object bbox min Y to offset in G-code output") }; + line.append_option(optgroup->get_option("belt_origin_snap_y")); + line.append_option(optgroup->get_option("belt_origin_offset_y")); + optgroup->append_line(line); + } + { + Line line = { L("Origin snap Z"), L("Snap object bbox min Z to offset in G-code output") }; + line.append_option(optgroup->get_option("belt_origin_snap_z")); + line.append_option(optgroup->get_option("belt_origin_offset_z")); + optgroup->append_line(line); + } { Line line = { L("Support floor"), L("Belt floor awareness for support generation and clipping") }; line.append_option(optgroup->get_option("belt_support_floor_mode")); @@ -5292,7 +5321,9 @@ void TabPrinter::toggle_options() toggle_line("belt_printer_infinite_y", is_belt); for (auto el : {"belt_shear_x", "belt_shear_y", "belt_shear_z", "belt_scale_x", "belt_scale_y", "belt_scale_z", - "belt_gcode_remap_x"}) + "belt_preslice_remap_x", + "belt_gcode_remap_x", "belt_gcode_back_transform", + "belt_origin_snap_x", "belt_origin_snap_y", "belt_origin_snap_z"}) toggle_line(el, is_belt); // Gray out angle/from sub-options when their parent shear/scale mode is None. @@ -5320,6 +5351,10 @@ void TabPrinter::toggle_options() auto scz = m_config->option>("belt_scale_z")->value; toggle_option("belt_scale_z_angle", is_belt && scz != BeltScaleMode::None); + toggle_option("belt_origin_offset_x", is_belt && m_config->opt_bool("belt_origin_snap_x")); + toggle_option("belt_origin_offset_y", is_belt && m_config->opt_bool("belt_origin_snap_y")); + toggle_option("belt_origin_offset_z", is_belt && m_config->opt_bool("belt_origin_snap_z")); + toggle_line("belt_support_floor_mode", is_belt); } From 2facaac9e81330cb26669d6d5e48ed9528f25956 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 27 Mar 2026 17:34:19 -0500 Subject: [PATCH 018/389] Part 3.1: refactor BeltTransform pipeline add BeltGCodeWriter add BeltGCode consolidate changes into shared classes for BeltGcode --- src/libslic3r/BeltGCode.cpp | 119 +++++ src/libslic3r/BeltGCode.hpp | 28 ++ src/libslic3r/BeltGCodeWriter.cpp | 243 +++++++++ src/libslic3r/BeltGCodeWriter.hpp | 50 ++ src/libslic3r/BeltSliceStrategy.cpp | 62 +++ src/libslic3r/BeltSliceStrategy.hpp | 45 ++ src/libslic3r/BeltTransform.cpp | 246 ++++++++++ src/libslic3r/BeltTransform.hpp | 146 ++++++ src/libslic3r/CMakeLists.txt | 10 + src/libslic3r/GCode.cpp | 542 +++++++-------------- src/libslic3r/GCode.hpp | 34 +- src/libslic3r/GCode/BeltBackTransform.cpp | 124 +---- src/libslic3r/GCodeWriter.cpp | 127 +---- src/libslic3r/GCodeWriter.hpp | 74 +-- src/libslic3r/Print.cpp | 14 +- src/libslic3r/Print.hpp | 26 +- src/libslic3r/PrintObject.cpp | 143 +----- src/libslic3r/PrintObjectSlice.cpp | 177 +------ src/libslic3r/Support/BeltFloorContext.cpp | 124 +++++ src/libslic3r/Support/BeltFloorContext.hpp | 74 +++ src/libslic3r/Support/SupportMaterial.cpp | 131 +---- src/libslic3r/Support/TreeModelVolumes.cpp | 74 +-- src/libslic3r/Support/TreeSupport.cpp | 102 ++-- src/libslic3r/Support/TreeSupport3D.cpp | 36 +- 24 files changed, 1522 insertions(+), 1229 deletions(-) create mode 100644 src/libslic3r/BeltGCode.cpp create mode 100644 src/libslic3r/BeltGCode.hpp create mode 100644 src/libslic3r/BeltGCodeWriter.cpp create mode 100644 src/libslic3r/BeltGCodeWriter.hpp create mode 100644 src/libslic3r/BeltSliceStrategy.cpp create mode 100644 src/libslic3r/BeltSliceStrategy.hpp create mode 100644 src/libslic3r/BeltTransform.cpp create mode 100644 src/libslic3r/BeltTransform.hpp create mode 100644 src/libslic3r/Support/BeltFloorContext.cpp create mode 100644 src/libslic3r/Support/BeltFloorContext.hpp diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp new file mode 100644 index 0000000000..dc1b6ca439 --- /dev/null +++ b/src/libslic3r/BeltGCode.cpp @@ -0,0 +1,119 @@ +#include "BeltGCode.hpp" +#include "BeltGCodeWriter.hpp" +#include "BeltTransform.hpp" +#include "Print.hpp" + +#include + +namespace Slic3r { + +void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) +{ + if (!print.config().belt_printer.value) + return; + + auto belt_writer = std::make_unique(); + belt_writer->set_is_bbl_machine(is_bbl_printers); + belt_writer->set_belt_angle(print.config().belt_printer_angle.value); + belt_writer->set_axis_remap( + int(print.config().belt_gcode_remap_x.value), + int(print.config().belt_gcode_remap_y.value), + int(print.config().belt_gcode_remap_z.value)); + BoundingBoxf bbox_bed(print.config().printable_area.values); + belt_writer->set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), + print.config().printable_height.value)); + belt_writer->set_belt_back_transform(print.config()); + m_writer = std::move(belt_writer); + + // Per-axis origin snap config. + m_origin_snap[0] = print.config().belt_origin_snap_x.value; + m_origin_snap[1] = print.config().belt_origin_snap_y.value; + m_origin_snap[2] = print.config().belt_origin_snap_z.value; + m_origin_snap_offset[0] = print.config().belt_origin_offset_x.value; + m_origin_snap_offset[1] = print.config().belt_origin_offset_y.value; + m_origin_snap_offset[2] = print.config().belt_origin_offset_z.value; +} + +void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) +{ + if (!print.config().belt_printer.value) + return; + + file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); + // Shear configs + const auto &full_cfg = print.full_print_config(); + file.write_format("; belt_shear_x = %s\n", full_cfg.opt_serialize("belt_shear_x").c_str()); + file.write_format("; belt_shear_x_angle = %.1f\n", print.config().belt_shear_x_angle.value); + file.write_format("; belt_shear_x_from = %s\n", full_cfg.opt_serialize("belt_shear_x_from").c_str()); + file.write_format("; belt_shear_y = %s\n", full_cfg.opt_serialize("belt_shear_y").c_str()); + file.write_format("; belt_shear_y_angle = %.1f\n", print.config().belt_shear_y_angle.value); + file.write_format("; belt_shear_y_from = %s\n", full_cfg.opt_serialize("belt_shear_y_from").c_str()); + file.write_format("; belt_shear_z = %s\n", full_cfg.opt_serialize("belt_shear_z").c_str()); + file.write_format("; belt_shear_z_angle = %.1f\n", print.config().belt_shear_z_angle.value); + file.write_format("; belt_shear_z_from = %s\n", full_cfg.opt_serialize("belt_shear_z_from").c_str()); + // Scale configs + file.write_format("; belt_scale_x = %s\n", full_cfg.opt_serialize("belt_scale_x").c_str()); + file.write_format("; belt_scale_x_angle = %.1f\n", print.config().belt_scale_x_angle.value); + file.write_format("; belt_scale_y = %s\n", full_cfg.opt_serialize("belt_scale_y").c_str()); + file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); + file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); + file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); + // Pre-slice remap configs + file.write_format("; belt_preslice_remap_x = %s\n", full_cfg.opt_serialize("belt_preslice_remap_x").c_str()); + file.write_format("; belt_preslice_remap_y = %s\n", full_cfg.opt_serialize("belt_preslice_remap_y").c_str()); + file.write_format("; belt_preslice_remap_z = %s\n", full_cfg.opt_serialize("belt_preslice_remap_z").c_str()); +} + +void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) +{ + if (!m_origin_snap[0] && !m_origin_snap[1] && !m_origin_snap[2]) + return; + + auto *belt_writer = dynamic_cast(m_writer.get()); + if (!belt_writer) + return; + + // Clear existing snap so to_machine_coords gives raw machine coords for bbox computation. + for (int a = 0; a < 3; ++a) + belt_writer->set_origin_snap(a, false, 0., 0.); + + // Reconstruct the belt pipeline transform for this object. + Transform3d belt = BeltTransformPipeline::build_forward_transform(m_config); + + // Z-shift + double zs = (obj->belt_min_z() < 0.) ? -obj->belt_min_z() : 0.; + if (zs > 0.) { + Transform3d zsh = Transform3d::Identity(); + zsh.matrix()(2, 3) = zs; + belt = zsh * belt; + } + + // Full transform: belt * trafo_centered + Transform3d full = belt * obj->trafo_centered(); + + // Instance shift in slicer space + global Z offset + Vec3d shift(unscale(inst_shift.x()), + unscale(inst_shift.y()), + obj->belt_global_z_offset()); + + // Compute this instance's machine-space bbox min + BoundingBoxf3 bb = obj->model_object()->raw_bounding_box(); + Vec3d mn = bb.min.cast(), mx = bb.max.cast(); + Vec3d inst_min(std::numeric_limits::max(), + std::numeric_limits::max(), + std::numeric_limits::max()); + for (int i = 0; i < 8; ++i) { + Vec3d c((i & 1) ? mx.x() : mn.x(), + (i & 2) ? mx.y() : mn.y(), + (i & 4) ? mx.z() : mn.z()); + Vec3d mc = belt_writer->to_machine_coords(full * c + shift); + for (int a = 0; a < 3; ++a) + inst_min[a] = std::min(inst_min[a], mc[a]); + } + + // Update writer snap for each enabled axis + for (int a = 0; a < 3; ++a) + belt_writer->set_origin_snap(a, m_origin_snap[a], m_origin_snap_offset[a], inst_min[a]); +} + +} // namespace Slic3r diff --git a/src/libslic3r/BeltGCode.hpp b/src/libslic3r/BeltGCode.hpp new file mode 100644 index 0000000000..682deb7d65 --- /dev/null +++ b/src/libslic3r/BeltGCode.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include "GCode.hpp" + +namespace Slic3r { + +// Belt-printer-specific GCode export. +// +// Inherits from GCode and overrides virtual hooks to: +// - Create a BeltGCodeWriter instead of a plain GCodeWriter +// - Write belt configuration to the G-code header +// - Update per-axis origin snap when switching instances +// - Disable arc fitting (G2/G3 not supported on belt printers) +class BeltGCode : public GCode +{ +protected: + void init_belt_writer(Print &print, bool is_bbl_printers) override; + void write_belt_header(GCodeOutputStream &file, const Print &print) override; + void on_set_origin(const PrintObject *obj, const Point &inst_shift) override; + bool should_disable_arc_fitting() const override { return true; } + +private: + // Per-axis origin snap config (set during init, used in on_set_origin). + bool m_origin_snap[3] = {false, false, false}; + double m_origin_snap_offset[3] = {0., 0., 0.}; +}; + +} // namespace Slic3r diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp new file mode 100644 index 0000000000..645bf85a5b --- /dev/null +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -0,0 +1,243 @@ +#include "BeltGCodeWriter.hpp" +#include "Geometry.hpp" + +namespace Slic3r { + +// ---- Belt configuration --------------------------------------------------- + +void BeltGCodeWriter::set_belt_angle(double angle_deg) +{ + m_belt_angle_rad = Geometry::deg2rad(angle_deg); +} + +void BeltGCodeWriter::set_axis_remap(int rx, int ry, int rz) +{ + m_remap_x = rx; + m_remap_y = ry; + m_remap_z = rz; +} + +void BeltGCodeWriter::set_build_volume_max(const Vec3d &max) +{ + m_build_vol_max = max; +} + +void BeltGCodeWriter::set_belt_back_transform(const PrintConfig &config) +{ + m_belt_back_transform.init_from_config(config); +} + +void BeltGCodeWriter::set_origin_snap(int axis, bool enable, double offset, double bbox_min) +{ + if (axis >= 0 && axis < 3) { + m_origin_snap[axis] = enable; + m_origin_offset[axis] = offset; + m_origin_bbox_min[axis] = bbox_min; + } +} + +Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const +{ + // Step 1: Undo the shear/scale applied during slicing. + Vec3d p = m_belt_back_transform.apply(pos); + // Step 2: Apply axis remapping for the machine's coordinate convention. + // BeltRemapAxis: 0-2 = +X/+Y/+Z, 3-5 = -X/-Y/-Z, 6-8 = Rev X/Y/Z + auto remap = [this, &p](int r) -> double { + int axis = r % 3; + if (r < 3) return p[axis]; + if (r < 6) return -p[axis]; + return m_build_vol_max[axis] - p[axis]; + }; + Vec3d result = { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; + // Per-axis origin snap: shift so bbox min on each enabled axis = offset. + for (int i = 0; i < 3; ++i) + if (m_origin_snap[i]) + result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); + return result; +} + +// ---- Overridden movement methods ------------------------------------------ + +std::string BeltGCodeWriter::travel_to_xy(const Vec2d &point, const std::string &comment) +{ + m_pos(0) = point(0); + m_pos(1) = point(1); + + this->set_current_position_clear(true); + Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; + + // Belt printer: transform to machine coordinates (XY travel also needs Z due to YZ rotation) + Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + + GCodeG1Formatter w; + w.emit_xyz(machine); + auto speed = m_is_first_layer + ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; + w.emit_f(speed * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + return w.string(); +} + +std::string BeltGCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) +{ + // Belt printer: force NormalLift since SpiralLift and SlopeLift compute + // slope angles that don't account for the YZ coordinate rotation. + return GCodeWriter::lazy_lift(LiftType::NormalLift, spiral_vase); +} + +std::string BeltGCodeWriter::eager_lift(const LiftType type) +{ + // Belt printer: force NormalLift (SpiralLift/SlopeLift don't account for YZ rotation). + return GCodeWriter::eager_lift(LiftType::NormalLift); +} + +std::string BeltGCodeWriter::_travel_to_z(double z, const std::string &comment) +{ + m_pos(2) = z; + + double speed = this->config.travel_speed_z.value; + if (speed == 0.) { + speed = m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") + : this->config.travel_speed.value; + } + + // Belt printer: a Z-only move in slicing frame needs to emit both Y and Z in machine coords. + Vec3d machine = to_machine_coords(Vec3d(m_pos.x() - m_x_offset, m_pos.y() - m_y_offset, z)); + + GCodeG1Formatter w; + w.emit_xyz(machine); + w.emit_f(speed * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + return w.string(); +} + +std::string BeltGCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std::string &comment, bool force_no_extrusion) +{ + m_pos(0) = point(0); + m_pos(1) = point(1); + if (std::abs(dE) <= std::numeric_limits::epsilon()) + force_no_extrusion = true; + + if (!force_no_extrusion) + filament()->extrude(dE); + + Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; + + // Belt printer: transform and emit XYZ (Y and Z are coupled) + Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + + GCodeG1Formatter w; + w.emit_xyz(machine); + if (!force_no_extrusion) + w.emit_e(filament()->E()); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + return w.string(); +} + +std::string BeltGCodeWriter::extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment, bool force_no_extrusion) +{ + m_pos = point; + m_lifted = 0; + if (!force_no_extrusion) + filament()->extrude(dE); + + Vec3d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset, point(2) }; + point_on_plate = to_machine_coords(point_on_plate); + + GCodeG1Formatter w; + w.emit_xyz(point_on_plate); + if (!force_no_extrusion) + w.emit_e(filament()->E()); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + return w.string(); +} + +std::string BeltGCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &comment, bool force_z) +{ + // Belt-specific override of travel_to_xyz. + // Key differences from base: + // 1. All coordinates go through to_machine_coords() + // 2. Always emit full XYZ (can't split XY and Z due to coupling) + // 3. Lift type forced to NormalLift (handled by lazy_lift/eager_lift overrides) + + Vec3d dest_point = point; + auto travel_speed = + m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; + + // Handle pending z_hop + if (std::abs(m_to_lift) > EPSILON) { + assert(std::abs(m_lifted) < EPSILON); + if ((!this->is_current_position_clear() || m_pos != dest_point) && + m_to_lift + m_pos(2) > point(2)) { + m_lifted = m_to_lift + m_pos(2) - point(2); + dest_point(2) = m_to_lift + m_pos(2); + } + m_to_lift = 0.; + + std::string slop_move; + Vec3d source = { m_pos(0) - m_x_offset, m_pos(1) - m_y_offset, m_pos(2) }; + Vec3d target = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; + Vec3d delta = target - source; + Vec2d delta_no_z = { delta(0), delta(1) }; + + if (delta(2) > 0 && delta_no_z.norm() != 0.0f) { + // Belt: SpiralLift and SlopeLift are disabled (lazy_lift forces NormalLift), + // but handle NormalLift and fallthrough. + if (m_to_lift_type == LiftType::SlopeLift && + this->is_current_position_clear() && + atan2(delta(2), delta_no_z.norm()) < this->filament()->travel_slope()) { + Vec2d temp = delta_no_z.normalized() * delta(2) / tan(this->filament()->travel_slope()); + Vec3d slope_top_point = Vec3d(temp(0), temp(1), delta(2)) + source; + slope_top_point = to_machine_coords(slope_top_point); + GCodeG1Formatter w0; + w0.emit_xyz(slope_top_point); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + slop_move = w0.string(); + } + else if (m_to_lift_type == LiftType::NormalLift) { + slop_move = _travel_to_z(target.z(), "normal lift Z"); + } + } + + std::string xy_z_move; + { + Vec3d emit_target = to_machine_coords(target); + GCodeG1Formatter w0; + // Belt mode: always emit full XYZ since Y and Z are coupled + w0.emit_xyz(emit_target); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + xy_z_move = w0.string(); + } + m_pos = dest_point; + this->set_current_position_clear(true); + return slop_move + xy_z_move; + } + else if (!force_z && !this->will_move_z(point(2))) { + double nominal_z = m_pos(2) - m_lifted; + m_lifted -= (point(2) - nominal_z); + if (std::abs(m_lifted) < EPSILON) + m_lifted = 0.; + this->set_current_position_clear(true); + return this->travel_to_xy(to_2d(point)); + } + else { + m_lifted = 0; + } + + Vec3d point_on_plate = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; + point_on_plate = to_machine_coords(point_on_plate); + + // Belt mode: always emit full XYZ + GCodeG1Formatter w; + w.emit_xyz(point_on_plate); + w.emit_f(this->config.travel_speed.value * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + + m_pos = dest_point; + this->set_current_position_clear(true); + return w.string(); +} + +} // namespace Slic3r diff --git a/src/libslic3r/BeltGCodeWriter.hpp b/src/libslic3r/BeltGCodeWriter.hpp new file mode 100644 index 0000000000..727135b578 --- /dev/null +++ b/src/libslic3r/BeltGCodeWriter.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include "GCodeWriter.hpp" +#include "GCode/BeltBackTransform.hpp" + +namespace Slic3r { + +// Belt-printer-specific GCode writer. +// +// Inherits from GCodeWriter and overrides movement methods to apply +// coordinate transformation (back-transform, axis remap, origin snap) +// and emit coupled XYZ moves (Y and Z are coupled due to belt tilt). +class BeltGCodeWriter : public GCodeWriter +{ +public: + BeltGCodeWriter() : GCodeWriter() {} + + // Belt configuration + void set_belt_angle(double angle_deg); + bool is_belt_printer() const { return m_belt_angle_rad != 0.; } + void set_axis_remap(int rx, int ry, int rz); + void set_build_volume_max(const Vec3d &max); + void set_belt_back_transform(const PrintConfig &config); + void set_origin_snap(int axis, bool enable, double offset, double bbox_min); + Vec3d to_machine_coords(const Vec3d &pos) const; + + // Overridden movement methods + std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string()) override; + std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false) override; + std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false) override; + std::string extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false) override; + std::string lazy_lift(LiftType lift_type = LiftType::NormalLift, bool spiral_vase = false) override; + std::string eager_lift(const LiftType type) override; + +protected: + std::string _travel_to_z(double z, const std::string &comment) override; + +private: + double m_belt_angle_rad = 0.; + int m_remap_x = 0; + int m_remap_y = 1; + int m_remap_z = 2; + Vec3d m_build_vol_max = Vec3d::Zero(); + BeltBackTransform m_belt_back_transform; + bool m_origin_snap[3] = {false, false, false}; + double m_origin_offset[3] = {0., 0., 0.}; + double m_origin_bbox_min[3] = {0., 0., 0.}; +}; + +} // namespace Slic3r diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp new file mode 100644 index 0000000000..b3adeec64a --- /dev/null +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -0,0 +1,62 @@ +#include "BeltSliceStrategy.hpp" + +#include + +namespace Slic3r { + +std::unique_ptr BeltSliceStrategy::create(const PrintConfig &config) +{ + if (!config.belt_printer.value) + return nullptr; + return std::unique_ptr(new BeltSliceStrategy(config)); +} + +BeltSliceStrategy::BeltSliceStrategy(const PrintConfig &config) +{ + m_has_remap = BeltTransformPipeline::has_preslice_remap(config); + if (m_has_remap) + m_pre_remap = BeltTransformPipeline::build_preslice_remap(config); + + m_shear = BeltTransformPipeline::build_shear_matrix(config, &m_has_shear); + m_scale = BeltTransformPipeline::build_scale_matrix(config, &m_has_scale); +} + +void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, + const ModelVolumePtrs &model_volumes, + double *out_belt_min_z) const +{ + // Step 1: Pre-slice axis remap. + if (m_has_remap) + trafo = m_pre_remap * trafo; + + // Step 2: Shear + scale. + if (m_has_shear || m_has_scale) { + Transform3d belt_xform = Transform3d::Identity(); + belt_xform.linear() = m_scale * m_shear; + trafo = belt_xform * trafo; + } + + // Step 3: Z-shift — detect if mesh clips below build plate after transforms. + if (m_has_remap || m_has_shear || m_has_scale) { + double min_z = std::numeric_limits::max(); + for (const ModelVolume *mv : model_volumes) { + if (!mv->is_model_part()) continue; + for (const stl_vertex &v : mv->mesh().its.vertices) { + Vec3d pt = trafo * v.cast(); + min_z = std::min(min_z, pt.z()); + } + } + double belt_z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; + BOOST_LOG_TRIVIAL(warning) << "Belt Z-shift: min_z=" << min_z + << " z_shift=" << belt_z_shift_val; + if (belt_z_shift_val > 0.) { + Transform3d z_shift = Transform3d::Identity(); + z_shift.matrix()(2, 3) = belt_z_shift_val; + trafo = z_shift * trafo; + } + if (out_belt_min_z) + *out_belt_min_z = (min_z != std::numeric_limits::max()) ? min_z : 0.; + } +} + +} // namespace Slic3r diff --git a/src/libslic3r/BeltSliceStrategy.hpp b/src/libslic3r/BeltSliceStrategy.hpp new file mode 100644 index 0000000000..bf19243fd2 --- /dev/null +++ b/src/libslic3r/BeltSliceStrategy.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include "libslic3r.h" +#include "Point.hpp" +#include "BeltTransform.hpp" +#include "PrintConfig.hpp" +#include "Model.hpp" + +#include +#include + +namespace Slic3r { + +// Belt printer pre-slice transform strategy. +// +// Encapsulates the pre-remap, shear, scale, and Z-shift transforms +// that are applied to model geometry before slicing on belt printers. +// Used by PrintObjectSlice.cpp to isolate belt-specific logic from +// the slicing pipeline. +class BeltSliceStrategy +{ +public: + // Create a strategy if belt_printer is enabled; returns nullptr otherwise. + static std::unique_ptr create(const PrintConfig &config); + + // Apply belt transforms to the slicing trafo. + // Modifies trafo in-place: trafo = z_shift * scale * shear * pre_remap * trafo + // Scans all model_part volumes to detect minimum Z and add z-shift if needed. + // Sets *out_belt_min_z to the minimum Z of the mesh after transforms. + void apply_to_trafo(Transform3d &trafo, + const ModelVolumePtrs &model_volumes, + double *out_belt_min_z) const; + +private: + explicit BeltSliceStrategy(const PrintConfig &config); + + bool m_has_remap = false; + bool m_has_shear = false; + bool m_has_scale = false; + Transform3d m_pre_remap = Transform3d::Identity(); + Matrix3d m_shear = Matrix3d::Identity(); + Matrix3d m_scale = Matrix3d::Identity(); +}; + +} // namespace Slic3r diff --git a/src/libslic3r/BeltTransform.cpp b/src/libslic3r/BeltTransform.cpp new file mode 100644 index 0000000000..db7eea7d80 --- /dev/null +++ b/src/libslic3r/BeltTransform.cpp @@ -0,0 +1,246 @@ +#include "BeltTransform.hpp" +#include "Model.hpp" + +#include + +namespace Slic3r { + +// ---- Matrix builders ------------------------------------------------------ + +Transform3d BeltTransformPipeline::build_preslice_remap(const PrintConfig &config) +{ + Transform3d pre_remap = Transform3d::Identity(); + if (!has_preslice_remap(config)) + return pre_remap; + + int pre_rx = int(config.belt_preslice_remap_x.value); + int pre_ry = int(config.belt_preslice_remap_y.value); + int pre_rz = int(config.belt_preslice_remap_z.value); + + // Each remap value selects a source axis and sign. + auto remap_column = [](int r) -> Vec3d { + int axis = r % 3; + Vec3d col = Vec3d::Zero(); + if (r < 3) col[axis] = 1.0; // +axis + else if (r < 6) col[axis] = -1.0; // -axis + else col[axis] = -1.0; // Rev: max - pos = -(pos - max) + return col; + }; + + Matrix3d remap_lin; + remap_lin.col(0) = remap_column(pre_rx); + remap_lin.col(1) = remap_column(pre_ry); + remap_lin.col(2) = remap_column(pre_rz); + pre_remap.linear() = remap_lin; + + // Translation for Rev modes (needs build volume extents). + if (pre_rx >= 6 || pre_ry >= 6 || pre_rz >= 6) { + BoundingBoxf bbox_bed(config.printable_area.values); + Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), + config.printable_height.value); + Vec3d remap_trans = Vec3d::Zero(); + auto add_rev = [&](int r, int out) { + if (r >= 6) remap_trans[out] = vol_max[r % 3]; + }; + add_rev(pre_rx, 0); + add_rev(pre_ry, 1); + add_rev(pre_rz, 2); + pre_remap.translation() = remap_trans; + } + + return pre_remap; +} + +Matrix3d BeltTransformPipeline::build_shear_matrix(const PrintConfig &config, bool *has_shear_out) +{ + struct AxisShear { BeltShearMode mode; double angle; int from; }; + AxisShear axes[3] = { + { config.belt_shear_x.value, config.belt_shear_x_angle.value, int(config.belt_shear_x_from.value) }, + { config.belt_shear_y.value, config.belt_shear_y_angle.value, int(config.belt_shear_y_from.value) }, + { config.belt_shear_z.value, config.belt_shear_z_angle.value, int(config.belt_shear_z_from.value) }, + }; + + Matrix3d shear = Matrix3d::Identity(); + bool active = false; + for (int row = 0; row < 3; ++row) { + if (axes[row].mode != BeltShearMode::None) { + double factor = compute_shear_factor(axes[row].mode, axes[row].angle); + if (std::abs(factor) > EPSILON) { + shear(row, axes[row].from) += factor; + active = true; + } + } + } + if (has_shear_out) *has_shear_out = active; + return shear; +} + +Matrix3d BeltTransformPipeline::build_scale_matrix(const PrintConfig &config, bool *has_scale_out) +{ + double sx = compute_scale_factor(config.belt_scale_x.value, config.belt_scale_x_angle.value); + double sy = compute_scale_factor(config.belt_scale_y.value, config.belt_scale_y_angle.value); + double sz = compute_scale_factor(config.belt_scale_z.value, config.belt_scale_z_angle.value); + + bool active = (std::abs(sx - 1.) > EPSILON || + std::abs(sy - 1.) > EPSILON || + std::abs(sz - 1.) > EPSILON); + + Matrix3d scale = Matrix3d::Identity(); + if (active) { + scale(0, 0) = sx; + scale(1, 1) = sy; + scale(2, 2) = sz; + } + if (has_scale_out) *has_scale_out = active; + return scale; +} + +Transform3d BeltTransformPipeline::build_forward_transform(const PrintConfig &config) +{ + Transform3d pre_remap = build_preslice_remap(config); + bool shear_active = false; + Matrix3d shear = build_shear_matrix(config, &shear_active); + bool scale_active = false; + Matrix3d scale = build_scale_matrix(config, &scale_active); + + // Pipeline: scale * shear * pre_remap + Transform3d combined = Transform3d::Identity(); + combined.linear() = scale * shear; + combined = combined * pre_remap; + return combined; +} + +// ---- Bounding box remap --------------------------------------------------- + +BoundingBoxf3 BeltTransformPipeline::remap_bbox(const BoundingBoxf3 &bb, const PrintConfig &config) +{ + int pre_rx = int(config.belt_preslice_remap_x.value); + int pre_ry = int(config.belt_preslice_remap_y.value); + int pre_rz = int(config.belt_preslice_remap_z.value); + + if (pre_rx == int(BeltRemapAxis::PosX) && + pre_ry == int(BeltRemapAxis::PosY) && + pre_rz == int(BeltRemapAxis::PosZ)) + return bb; // Identity remap. + + auto remap_coord = [](int r, const Vec3d &v) -> double { + int axis = r % 3; + if (r < 3) return v[axis]; + return -v[axis]; + }; + + Vec3d mn = bb.min.cast(), mx = bb.max.cast(); + BoundingBoxf3 rbb; + for (int i = 0; i < 8; ++i) { + Vec3d c((i & 1) ? mx.x() : mn.x(), + (i & 2) ? mx.y() : mn.y(), + (i & 4) ? mx.z() : mn.z()); + Vec3d rc(remap_coord(pre_rx, c), remap_coord(pre_ry, c), remap_coord(pre_rz, c)); + if (i == 0) rbb = BoundingBoxf3(rc, rc); + else rbb.merge(rc); + } + return rbb; +} + +BoundingBoxf3 BeltTransformPipeline::remap_bbox(const ModelObject &model_object, const PrintConfig &config) +{ + return remap_bbox(model_object.raw_bounding_box(), config); +} + +// ---- Belt floor parameters ------------------------------------------------ + +// Shared implementation for both PrintConfig and DynamicPrintConfig. +// Template avoids duplicating the math for the two config types. +namespace { + +template +BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( + const Config &config, const BoundingBoxf3 &bb, double original_height) +{ + BeltTransformPipeline::BeltHeightResult result; + result.object_height = original_height; + + // Extract Z-axis shear/scale config. + BeltShearMode z_shear_mode; + double z_shear_angle; + BeltScaleMode z_scale_mode; + double z_scale_angle; + int z_shear_from; + + if constexpr (std::is_same_v) { + z_shear_mode = config.belt_shear_z.value; + z_shear_angle = config.belt_shear_z_angle.value; + z_scale_mode = config.belt_scale_z.value; + z_scale_angle = config.belt_scale_z_angle.value; + z_shear_from = int(config.belt_shear_z_from.value); + } else { + // DynamicPrintConfig path + auto get_shear = [&](const char *key) { + auto *opt = config.template option>(key); + return opt ? opt->value : BeltShearMode::None; + }; + auto get_scale = [&](const char *key) { + auto *opt = config.template option>(key); + return opt ? opt->value : BeltScaleMode::None; + }; + auto get_float = [&](const char *key) { + auto *opt = config.template option(key); + return opt ? opt->value : 45.0; + }; + auto get_axis = [&](const char *key) { + auto *opt = config.template option>(key); + return opt ? int(opt->value) : 1; + }; + z_shear_mode = get_shear("belt_shear_z"); + z_shear_angle = get_float("belt_shear_z_angle"); + z_scale_mode = get_scale("belt_scale_z"); + z_scale_angle = get_float("belt_scale_z_angle"); + z_shear_from = get_axis("belt_shear_z_from"); + } + + bool has_z_shear = z_shear_mode != BeltShearMode::None; + bool has_z_scale = z_scale_mode != BeltScaleMode::None; + + if (!has_z_shear && !has_z_scale) + return result; + + double shear_factor = has_z_shear + ? BeltTransformPipeline::compute_shear_factor(z_shear_mode, z_shear_angle) : 0.; + double scale_z = BeltTransformPipeline::compute_scale_factor(z_scale_mode, z_scale_angle); + + if (has_z_shear && std::abs(shear_factor) > EPSILON) { + int from = z_shear_from; + double min_rz = std::numeric_limits::max(); + double max_rz = std::numeric_limits::lowest(); + for (double vz : {bb.min.z(), bb.max.z()}) + for (double vs : {bb.min(from), bb.max(from)}) { + double new_z = scale_z * (vz + shear_factor * vs); + min_rz = std::min(min_rz, new_z); + max_rz = std::max(max_rz, new_z); + } + result.object_height = max_rz - min_rz; + result.floor_params.shear_factor = shear_factor; + result.floor_params.from_axis = from; + result.floor_params.z_shift = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); + } else { + result.object_height = original_height * scale_z; + } + + return result; +} + +} // anonymous namespace + +BeltTransformPipeline::BeltHeightResult BeltTransformPipeline::compute_belt_height_and_floor( + const PrintConfig &config, const BoundingBoxf3 &remapped_bbox, double original_height) +{ + return compute_belt_height_and_floor_impl(config, remapped_bbox, original_height); +} + +BeltTransformPipeline::BeltHeightResult BeltTransformPipeline::compute_belt_height_and_floor( + const DynamicPrintConfig &config, const BoundingBoxf3 &remapped_bbox, double original_height) +{ + return compute_belt_height_and_floor_impl(config, remapped_bbox, original_height); +} + +} // namespace Slic3r diff --git a/src/libslic3r/BeltTransform.hpp b/src/libslic3r/BeltTransform.hpp new file mode 100644 index 0000000000..b9a60473e5 --- /dev/null +++ b/src/libslic3r/BeltTransform.hpp @@ -0,0 +1,146 @@ +#pragma once + +#include "libslic3r.h" +#include "Point.hpp" +#include "BoundingBox.hpp" +#include "PrintConfig.hpp" +#include "Geometry.hpp" + +#include + +namespace Slic3r { + +class ModelObject; + +// Shared belt-printer transform math. +// +// The pre-slice pipeline applied in PrintObjectSlice.cpp is: +// trafo_out = z_shift * scale * shear * pre_remap * trafo_in +// +// This class provides the building blocks so every call site uses the +// same implementation. z_shift is object-dependent (computed from mesh +// vertex bounds) and is NOT included in build_forward_transform(). +class BeltTransformPipeline +{ +public: + // ---- Pure math helpers ------------------------------------------------ + + static double compute_shear_factor(BeltShearMode mode, double angle_deg) + { + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; + case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; + case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; + case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; + default: return 0.; + } + } + + static double compute_scale_factor(BeltScaleMode mode, double angle_deg) + { + if (mode == BeltScaleMode::None) return 1.; + double angle_rad = Geometry::deg2rad(angle_deg); + double sin_a = std::sin(angle_rad); + double cos_a = std::cos(angle_rad); + switch (mode) { + case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; + case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; + case BeltScaleMode::Sin: return sin_a; + case BeltScaleMode::Cos: return cos_a; + default: return 1.; + } + } + + // ---- Identity checks -------------------------------------------------- + + static bool has_preslice_remap(const PrintConfig &config) + { + return int(config.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || + int(config.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || + int(config.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ); + } + + // Overload accepting DynamicPrintConfig (used in static slicing_parameters). + static bool has_preslice_remap(const DynamicPrintConfig &config) + { + auto get_int = [&](const char *key) -> int { + auto *opt = config.option>(key); + return opt ? int(opt->value) : 0; + }; + return get_int("belt_preslice_remap_x") != int(BeltRemapAxis::PosX) || + get_int("belt_preslice_remap_y") != int(BeltRemapAxis::PosY) || + get_int("belt_preslice_remap_z") != int(BeltRemapAxis::PosZ); + } + + static bool has_shear(const PrintConfig &config) + { + return config.belt_shear_x.value != BeltShearMode::None || + config.belt_shear_y.value != BeltShearMode::None || + config.belt_shear_z.value != BeltShearMode::None; + } + + static bool has_scale(const PrintConfig &config) + { + double sx = compute_scale_factor(config.belt_scale_x.value, config.belt_scale_x_angle.value); + double sy = compute_scale_factor(config.belt_scale_y.value, config.belt_scale_y_angle.value); + double sz = compute_scale_factor(config.belt_scale_z.value, config.belt_scale_z_angle.value); + return std::abs(sx - 1.) > EPSILON || + std::abs(sy - 1.) > EPSILON || + std::abs(sz - 1.) > EPSILON; + } + + // ---- Matrix builders -------------------------------------------------- + + // Build the pre-slice axis remap transform (includes Rev-mode translation). + static Transform3d build_preslice_remap(const PrintConfig &config); + + // Build the 3x3 shear matrix. Returns Identity if no shear is active. + // Also sets has_shear_out if non-null. + static Matrix3d build_shear_matrix(const PrintConfig &config, bool *has_shear_out = nullptr); + + // Build the 3x3 diagonal scale matrix. Returns Identity if no scale. + // Also sets has_scale_out if non-null. + static Matrix3d build_scale_matrix(const PrintConfig &config, bool *has_scale_out = nullptr); + + // Combined forward transform: scale * shear * pre_remap. + // Does NOT include the per-object Z-shift. + static Transform3d build_forward_transform(const PrintConfig &config); + + // ---- Bounding box remap ----------------------------------------------- + + // Remap a bounding box through the pre-slice axis remap. + // Returns the original bbox if remap is identity. + static BoundingBoxf3 remap_bbox(const BoundingBoxf3 &bb, const PrintConfig &config); + static BoundingBoxf3 remap_bbox(const ModelObject &model_object, const PrintConfig &config); + + // ---- Belt floor parameters -------------------------------------------- + + struct BeltFloorParams { + double shear_factor = 0.0; + int from_axis = 1; + double z_shift = 0.0; + }; + + // Result of computing belt height + floor params. + struct BeltHeightResult { + double object_height; // Effective object height after shear/scale + BeltFloorParams floor_params; + }; + + // Compute effective object height and belt floor parameters from config + // and pre-remapped bounding box. original_height is the input height + // (bb.size().z() or model_object.max_z()). + static BeltHeightResult compute_belt_height_and_floor( + const PrintConfig &config, const BoundingBoxf3 &remapped_bbox, + double original_height); + + // Overload for DynamicPrintConfig (used by static slicing_parameters). + static BeltHeightResult compute_belt_height_and_floor( + const DynamicPrintConfig &config, const BoundingBoxf3 &remapped_bbox, + double original_height); +}; + +} // namespace Slic3r diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index c2d92ee800..a3e813b1da 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -79,6 +79,14 @@ set(lisbslic3r_sources BoundingBox.hpp BridgeDetector.cpp BridgeDetector.hpp + BeltGCode.cpp + BeltGCode.hpp + BeltGCodeWriter.cpp + BeltGCodeWriter.hpp + BeltSliceStrategy.cpp + BeltSliceStrategy.hpp + BeltTransform.cpp + BeltTransform.hpp Brim.cpp BrimEarsPoint.hpp Brim.hpp @@ -417,6 +425,8 @@ set(lisbslic3r_sources SlicingAdaptive.hpp Slicing.cpp Slicing.hpp + Support/BeltFloorContext.cpp + Support/BeltFloorContext.hpp Support/SupportCommon.cpp Support/SupportCommon.hpp Support/SupportLayer.hpp diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index ac04c6dd5b..a330fad689 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -8,6 +8,7 @@ #include "Exception.hpp" #include "ExtrusionEntity.hpp" #include "EdgeGrid.hpp" +#include "BeltTransform.hpp" #include "Geometry.hpp" #include "Geometry/ConvexHull.hpp" #include "GCode/PrintExtents.hpp" @@ -795,7 +796,7 @@ static std::vector get_path_of_change_filament(const Print& print) //BBS: if needed, write the gcode_label_objects_end then priming tower, if the retract, didn't did it. std::string object_end_label_temp; - gcodegen.m_writer.add_object_end_labels(object_end_label_temp); + gcodegen.m_writer->add_object_end_labels(object_end_label_temp); // Process the custom change_filament_gcode. If it is empty, provide a simple Tn command to change the filament. // Otherwise, leave control to the user completely. @@ -839,7 +840,7 @@ static std::vector get_path_of_change_filament(const Print& print) // config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); // BBS { - GCodeWriter& gcode_writer = gcodegen.m_writer; + GCodeWriter& gcode_writer = *gcodegen.m_writer; FullPrintConfig& full_config = gcodegen.m_config; // set volumetric speed of outer wall ,ignore per obejct,just use default setting @@ -1573,8 +1574,8 @@ static std::vector get_path_of_change_filament(const Print& print) const std::vector ColorPrintColors::Colors = { "#C0392B", "#E67E22", "#F1C40F", "#27AE60", "#1ABC9C", "#2980B9", "#9B59B6" }; -#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_writer.filament()->extruder_id()) -#define FILAMENT_CONFIG(OPT) m_config.OPT.get_at(m_writer.filament()->id()) +#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_writer->filament()->extruder_id()) +#define FILAMENT_CONFIG(OPT) m_config.OPT.get_at(m_writer->filament()->id()) void GCode::PlaceholderParserIntegration::reset() { @@ -1687,7 +1688,7 @@ void GCode::PlaceholderParserIntegration::validate_output_vector_variables() // Collect pairs of object_layer + support_layer sorted by print_z. // object_layer & support_layer are considered to be on the same print_z, if they are not further than EPSILON. -std::vector GCode::collect_layers_to_print(const PrintObject& object) +std::vector GCode::collect_layers_to_print(const PrintObject& object, bool skip_empty_first_layer) { std::vector layers_to_print; layers_to_print.reserve(object.layers().size() + object.support_layers().size()); @@ -1753,8 +1754,7 @@ std::vector GCode::collect_layers_to_print(const PrintObjec // an error. In global shear mode the object may also start above // Z=0 on the tilted belt surface. if (layers_to_print.size() == 1u) { - bool skip_empty_check = object.print()->config().belt_printer.value; - if (!has_extrusions && !skip_empty_check) + if (!has_extrusions && !skip_empty_first_layer) throw Slic3r::SlicingError(_(L("One object has an empty first layer and can't be printed. Please Cut the bottom or enable supports.")), object.id().id); } @@ -1827,7 +1827,7 @@ std::vector>> GCode::collec for (size_t i = 0; i < print.objects().size(); ++i) { try { - per_object[i] = collect_layers_to_print(*print.objects()[i]); + per_object[i] = collect_layers_to_print(*print.objects()[i], print.config().belt_printer.value); } catch (const Slic3r::SlicingError &e) { errors.push_back(e); continue; @@ -2016,7 +2016,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu BOOST_LOG_TRIVIAL(info) << boost::format("Will export G-code to %1% soon")%path; GCodeProcessor::s_IsBBLPrinter = print->is_BBL_printer(); - m_writer.set_is_bbl_machine(print->is_BBL_printer()); + m_writer->set_is_bbl_machine(print->is_BBL_printer()); print->set_started(psGCodeExport); // check if any custom gcode contains keywords used by the gcode processor to @@ -2113,7 +2113,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu m_processor.result().support_traditional_timelapse = m_support_traditional_timelapse; bool activate_long_retraction_when_cut = false; - for (const auto& filament : m_writer.extruders()) + for (const auto& filament : m_writer->extruders()) activate_long_retraction_when_cut |= ( m_config.long_retractions_when_cut.get_at(filament.id()) && m_config.retraction_distances_when_cut.get_at(filament.id()) > 0 @@ -2144,7 +2144,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu m_processor.finalize(true); // DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics); - DoExport::update_print_estimated_stats(m_processor, m_writer.extruders(), print->m_print_statistics, print->config()); + DoExport::update_print_estimated_stats(m_processor, m_writer->extruders(), print->m_print_statistics, print->config()); if (result != nullptr) { *result = std::move(m_processor.extract_result()); // set the filename to the correct value @@ -2404,7 +2404,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato PROFILE_FUNC(); m_print = &print; - m_timelapse_pos_picker.init(&print,m_writer.get_xy_offset().cast()); + m_timelapse_pos_picker.init(&print,m_writer->get_xy_offset().cast()); // modifies m_silent_time_estimator_enabled DoExport::init_gcode_processor(print.config(), m_processor, m_silent_time_estimator_enabled); @@ -2420,29 +2420,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_fan_mover.release(); - m_writer.set_is_bbl_machine(is_bbl_printers); + m_writer->set_is_bbl_machine(is_bbl_printers); - // Belt printer: initialize coordinate transformation and axis remap on the writer. - if (print.config().belt_printer.value) { - m_writer.set_belt_angle(print.config().belt_printer_angle.value); - m_writer.set_axis_remap( - int(print.config().belt_gcode_remap_x.value), - int(print.config().belt_gcode_remap_y.value), - int(print.config().belt_gcode_remap_z.value)); - // Build volume extents for Rev remap mode. - BoundingBoxf bbox_bed(print.config().printable_area.values); - m_writer.set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), print.config().printable_height.value)); - // Initialize the back-transform that undoes slicing shear/scale. - m_writer.set_belt_back_transform(print.config()); - // Per-axis origin snap: store config; actual snap is computed - // per-instance in update_origin_snap() called from set_origin(). - m_origin_snap[0] = print.config().belt_origin_snap_x.value; - m_origin_snap[1] = print.config().belt_origin_snap_y.value; - m_origin_snap[2] = print.config().belt_origin_snap_z.value; - m_origin_snap_offset[0] = print.config().belt_origin_offset_x.value; - m_origin_snap_offset[1] = print.config().belt_origin_offset_y.value; - m_origin_snap_offset[2] = print.config().belt_origin_offset_z.value; - } + // Belt printer: initialize belt-specific writer via virtual hook. + this->init_belt_writer(print, is_bbl_printers); // How many times will be change_layer() called? // change_layer() in turn increments the progress bar status. @@ -2533,31 +2514,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format("; HEADER_BLOCK_START\n"); // Write information on the generator. file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str()); - // Belt printer: embed angle and transform configs in header for G-code processor detection. - if (print.config().belt_printer.value) { - file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); - // Shear configs - const auto &full_cfg = print.full_print_config(); - file.write_format("; belt_shear_x = %s\n", full_cfg.opt_serialize("belt_shear_x").c_str()); - file.write_format("; belt_shear_x_angle = %.1f\n", print.config().belt_shear_x_angle.value); - file.write_format("; belt_shear_x_from = %s\n", full_cfg.opt_serialize("belt_shear_x_from").c_str()); - file.write_format("; belt_shear_y = %s\n", full_cfg.opt_serialize("belt_shear_y").c_str()); - file.write_format("; belt_shear_y_angle = %.1f\n", print.config().belt_shear_y_angle.value); - file.write_format("; belt_shear_y_from = %s\n", full_cfg.opt_serialize("belt_shear_y_from").c_str()); - file.write_format("; belt_shear_z = %s\n", full_cfg.opt_serialize("belt_shear_z").c_str()); - file.write_format("; belt_shear_z_angle = %.1f\n", print.config().belt_shear_z_angle.value); - file.write_format("; belt_shear_z_from = %s\n", full_cfg.opt_serialize("belt_shear_z_from").c_str()); - // Scale configs - file.write_format("; belt_scale_x = %s\n", full_cfg.opt_serialize("belt_scale_x").c_str()); - file.write_format("; belt_scale_x_angle = %.1f\n", print.config().belt_scale_x_angle.value); - file.write_format("; belt_scale_y = %s\n", full_cfg.opt_serialize("belt_scale_y").c_str()); - file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); - file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); - file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); - file.write_format("; belt_preslice_remap_x = %s\n", full_cfg.opt_serialize("belt_preslice_remap_x").c_str()); - file.write_format("; belt_preslice_remap_y = %s\n", full_cfg.opt_serialize("belt_preslice_remap_y").c_str()); - file.write_format("; belt_preslice_remap_z = %s\n", full_cfg.opt_serialize("belt_preslice_remap_z").c_str()); - } + // Belt printer: embed angle and transform configs in header via virtual hook. + this->write_belt_header(file, print); if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); //BBS: total layer number @@ -2804,13 +2762,13 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Disable fan. if (m_config.auxiliary_fan.value && print.config().close_fan_the_first_x_layers.get_at(initial_extruder_id)) { - file.write(m_writer.set_fan(0)); + file.write(m_writer->set_fan(0)); //BBS: disable additional fan - file.write(m_writer.set_additional_fan(0)); + file.write(m_writer->set_additional_fan(0)); } // Update output variables after the extruders were initialized. - m_placeholder_parser_integration.init(m_writer); + m_placeholder_parser_integration.init(*m_writer); // Let the start-up script prime the 1st printing tool. @@ -2883,7 +2841,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato { BoundingBoxf bbox_bed(print.config().printable_area.values); - Vec2f plate_offset = m_writer.get_xy_offset(); + Vec2f plate_offset = m_writer->get_xy_offset(); this->placeholder_parser().set("print_bed_min", new ConfigOptionFloats({ bbox_bed.min.x(), bbox_bed.min.y()})); this->placeholder_parser().set("print_bed_max", new ConfigOptionFloats({ bbox_bed.max.x(), bbox_bed.max.y()})); this->placeholder_parser().set("print_bed_size", new ConfigOptionFloats({ bbox_bed.size().x(), bbox_bed.size().y() })); @@ -2985,7 +2943,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } bool activate_chamber_temp_control = false; auto max_chamber_temp = 0; - for (const auto &extruder : m_writer.extruders()) { + for (const auto &extruder : m_writer->extruders()) { activate_chamber_temp_control |= m_config.activate_chamber_temp_control.get_at(extruder.id()); max_chamber_temp = std::max(max_chamber_temp, m_config.chamber_temperature.get_at(extruder.id())); } @@ -2993,7 +2951,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato BedType curr_bed_type = m_config.curr_bed_type; int min_temperature_vitrification = std::numeric_limits::max(); - for (const auto& extruder : m_writer.extruders()) + for (const auto& extruder : m_writer->extruders()) min_temperature_vitrification = std::min(min_temperature_vitrification, m_config.temperature_vitrification.get_at(extruder.id())); @@ -3107,18 +3065,18 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato if (activate_chamber_temp_control && max_chamber_temp > 0){ int temp_out =0; if(!custom_gcode_sets_temperature(machine_start_gcode,141,191,false,temp_out)) - file.write(m_writer.set_chamber_temperature(max_chamber_temp, true)); // set chamber_temperature + file.write(m_writer->set_chamber_temperature(max_chamber_temp, true)); // set chamber_temperature } // Write the custom start G-code file.writeln(machine_start_gcode); //BBS: gcode writer doesn't know where the real position of extruder is after inserting custom gcode - m_writer.set_current_position_clear(false); + m_writer->set_current_position_clear(false); m_start_gcode_filament = GCodeProcessor::get_gcode_last_filament(machine_start_gcode); if (is_bbl_printers) { - m_writer.init_extruder(initial_non_support_extruder_id); + m_writer->init_extruder(initial_non_support_extruder_id); // add the missing filament start gcode in machine start gcode { DynamicConfig config; @@ -3131,7 +3089,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } // Orca: add missing PA settings for initial filament if (m_config.enable_pressure_advance.get_at(initial_non_support_extruder_id)) { - file.write(m_writer.set_pressure_advance(m_config.pressure_advance.get_at(initial_non_support_extruder_id))); + file.write(m_writer->set_pressure_advance(m_config.pressure_advance.get_at(initial_non_support_extruder_id))); // Orca: Adaptive PA // Reset Adaptive PA processor last PA value m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(initial_non_support_extruder_id)); @@ -3157,14 +3115,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Orca: when activate_air_filtration is set on any extruder, find and set the highest during_print_exhaust_fan_speed bool activate_air_filtration = false; int during_print_exhaust_fan_speed = 0; - for (const auto &extruder : m_writer.extruders()) { + for (const auto &extruder : m_writer->extruders()) { activate_air_filtration |= m_config.activate_air_filtration.get_at(extruder.id()); if (m_config.activate_air_filtration.get_at(extruder.id())) during_print_exhaust_fan_speed = std::max(during_print_exhaust_fan_speed, m_config.during_print_exhaust_fan_speed.get_at(extruder.id())); } if (activate_air_filtration) - file.write(m_writer.set_exhaust_fan(during_print_exhaust_fan_speed, true)); + file.write(m_writer->set_exhaust_fan(during_print_exhaust_fan_speed, true)); print.throw_if_canceled(); @@ -3180,7 +3138,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_seam_placer.init(print, throw_if_canceled_func); // BBS: get path for change filament - if (m_writer.multiple_extruders) { + if (m_writer->multiple_extruders) { std::vector points = get_path_of_change_filament(print); if (points.size() == 3) { travel_point_1 = points[0]; @@ -3212,12 +3170,12 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato std::string gcode; gcode += ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change) + "\n"; if ((print.default_object_config().outer_wall_acceleration.value > 0 && print.default_object_config().outer_wall_acceleration.value > 0)) { - gcode += m_writer.set_print_acceleration((unsigned int)floor(print.default_object_config().outer_wall_acceleration.value + 0.5)); + gcode += m_writer->set_print_acceleration((unsigned int)floor(print.default_object_config().outer_wall_acceleration.value + 0.5)); } if (print.default_object_config().outer_wall_jerk.value > 0) { double jerk = print.default_object_config().outer_wall_jerk.value; - gcode += m_writer.set_jerk_xy(jerk); + gcode += m_writer->set_jerk_xy(jerk); } auto params = print.calib_params(); @@ -3261,8 +3219,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } print.throw_if_canceled(); this->set_origin(unscale((*print_object_instance_sequential_active)->shift)); - this->update_origin_snap((*print_object_instance_sequential_active)->print_object, - (*print_object_instance_sequential_active)->shift); + this->on_set_origin((*print_object_instance_sequential_active)->print_object, + (*print_object_instance_sequential_active)->shift); // BBS: prime extruder if extruder change happens before this object instance bool prime_extruder = false; @@ -3272,7 +3230,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_enable_cooling_markers = false; // we're not filtering these moves through CoolingBuffer m_avoid_crossing_perimeters.use_external_mp_once(); // BBS. change tool before moving to origin point. - if (m_writer.need_toolchange(initial_extruder_id)) { + if (m_writer->need_toolchange(initial_extruder_id)) { const PrintObjectConfig& object_config = object.config(); coordf_t initial_layer_print_height = print.config().initial_layer_print_height.value; @@ -3285,7 +3243,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } else { file.write(this->retract()); } - file.write(m_writer.travel_to_z(m_max_layer_z + m_writer.config.z_hop.get_at(initial_extruder_id))); + file.write(m_writer->travel_to_z(m_max_layer_z + m_writer->config.z_hop.get_at(initial_extruder_id))); file.write(this->travel_to(Point(0, 0), erNone, "move to origin position for next object")); m_enable_cooling_markers = true; // Disable motion planner when traveling to first object point. @@ -3308,7 +3266,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // and export G-code into file. tool_ordering.cal_most_used_extruder(print.config()); m_printed_objects.emplace_back(&object); - this->process_layers(print, tool_ordering, collect_layers_to_print(object), *print_object_instance_sequential_active - object.instances().data(), file, + this->process_layers(print, tool_ordering, collect_layers_to_print(object, print.config().belt_printer.value), *print_object_instance_sequential_active - object.instances().data(), file, prime_extruder); { // save the flush statitics stored in tool ordering by object @@ -3325,7 +3283,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato { const auto plr_mode = print.config().enable_power_loss_recovery.value; if (m_second_layer_things_done && plr_mode == PowerLossRecoveryMode::Enable) { - file.write(m_writer.enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); + file.write(m_writer->enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); } } ++ finished_objects; @@ -3346,7 +3304,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_wipe_tower->set_wipe_tower_bbx(print.get_wipe_tower_bbx()); m_wipe_tower->set_rib_offset(print.get_rib_offset()); //BBS - file.write(m_writer.travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height")); + file.write(m_writer->travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height")); if (wipe_tower_type == WipeTowerType::Type2 && print.config().single_extruder_multi_material_priming) { file.write(m_wipe_tower->prime(*this)); @@ -3405,7 +3363,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Orca: disable power loss recovery if (m_second_layer_things_done && print.config().enable_power_loss_recovery.value == PowerLossRecoveryMode::Enable) { - file.write(m_writer.enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); + file.write(m_writer->enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); } if (m_wipe_tower) // Purge the extruder, pull out the active filament. @@ -3419,14 +3377,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // if needed, write the gcode_label_objects_end { std::string gcode; - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); file.write(gcode); } - file.write(m_writer.set_fan(0)); + file.write(m_writer->set_fan(0)); //BBS: make sure the additional fan is closed when end if(m_config.auxiliary_fan.value) - file.write(m_writer.set_additional_fan(0)); + file.write(m_writer->set_additional_fan(0)); if (is_bbl_printers) { //BBS: close spaghetti detector //Note: M981 is also used to tell xcam the last layer is finished, so we need always send it even if spaghetti option is disabled. @@ -3442,12 +3400,12 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato DynamicConfig config; config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); //BBS - config.set_key_value("layer_z", new ConfigOptionFloat(m_writer.get_position()(2) - m_config.z_offset.value)); + config.set_key_value("layer_z", new ConfigOptionFloat(m_writer->get_position()(2) - m_config.z_offset.value)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); if (print.config().single_extruder_multi_material) { // Process the filament_end_gcode for the active filament only. - int extruder_id = m_writer.filament()->id(); + int extruder_id = m_writer->filament()->id(); config.set_key_value("filament_extruder_id", new ConfigOptionInt(extruder_id)); file.writeln(this->placeholder_parser_process("filament_end_gcode", print.config().filament_end_gcode.get_at(extruder_id), extruder_id, &config)); } else { @@ -3457,20 +3415,20 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.writeln(this->placeholder_parser_process("filament_end_gcode", end_gcode, extruder_id, &config)); } } - file.writeln(this->placeholder_parser_process("machine_end_gcode", print.config().machine_end_gcode, m_writer.filament()->id(), &config)); + file.writeln(this->placeholder_parser_process("machine_end_gcode", print.config().machine_end_gcode, m_writer->filament()->id(), &config)); } - file.write(m_writer.update_progress(m_layer_count, m_layer_count, true)); // 100% - file.write(m_writer.postamble()); + file.write(m_writer->update_progress(m_layer_count, m_layer_count, true)); // 100% + file.write(m_writer->postamble()); if (activate_chamber_temp_control && max_chamber_temp > 0) - file.write(m_writer.set_chamber_temperature(0, false)); //close chamber_temperature + file.write(m_writer->set_chamber_temperature(0, false)); //close chamber_temperature if (activate_air_filtration) { int complete_print_exhaust_fan_speed = 0; - for (const auto& extruder : m_writer.extruders()) + for (const auto& extruder : m_writer->extruders()) if (m_config.activate_air_filtration.get_at(extruder.id())) complete_print_exhaust_fan_speed = std::max(complete_print_exhaust_fan_speed, m_config.complete_print_exhaust_fan_speed.get_at(extruder.id())); - file.write(m_writer.set_exhaust_fan(complete_print_exhaust_fan_speed, true)); + file.write(m_writer->set_exhaust_fan(complete_print_exhaust_fan_speed, true)); } // adds tags for time estimators file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Last_Line_M73_Placeholder).c_str()); @@ -3482,7 +3440,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write(DoExport::update_print_stats_and_format_filament_stats( // Const inputs has_wipe_tower, print.wipe_tower_data(), - m_writer.extruders(), + m_writer->extruders(), // Modifies print.m_print_statistics)); print.m_print_statistics.initial_tool = initial_extruder_id; @@ -3656,7 +3614,7 @@ void GCode::process_layers( ); const auto fan_mover = tbb::make_filter(slic3r_tbb_filtermode::serial_in_order, - [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = this->m_writer](std::string in)->std::string { + [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = *this->m_writer](std::string in)->std::string { CNumericLocalesSetter locales_setter; @@ -3756,7 +3714,7 @@ void GCode::process_layers( ); const auto fan_mover = tbb::make_filter(slic3r_tbb_filtermode::serial_in_order, - [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = this->m_writer](std::string in)->std::string { + [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = *this->m_writer](std::string in)->std::string { if (config.fan_speedup_time.value != 0 || config.fan_kickstart.value > 0) { if (fan_mover.get() == nullptr) @@ -3824,21 +3782,21 @@ std::string GCode::placeholder_parser_process(const std::string &name, const std PlaceholderParserIntegration &ppi = m_placeholder_parser_integration; try { - ppi.update_from_gcodewriter(m_writer); + ppi.update_from_gcodewriter(*m_writer); std::string output = ppi.parser.process(templ, current_filament_id, config_override, &ppi.output_config, &ppi.context); ppi.validate_output_vector_variables(); if (const std::vector &pos = ppi.opt_position->values; ppi.position != pos) { // Update G-code writer. - m_writer.set_position({ pos[0], pos[1], pos[2] }); + m_writer->set_position({ pos[0], pos[1], pos[2] }); this->set_last_pos(this->gcode_to_point({ pos[0], pos[1] })); } - for (const Extruder &e : m_writer.extruders()) { + for (const Extruder &e : m_writer->extruders()) { unsigned int eid = e.id(); assert(eid < ppi.num_extruders); if ( eid < ppi.num_extruders) { - if (! m_writer.config.use_relative_e_distances && ! is_approx(ppi.e_position[eid], ppi.opt_e_position->values[eid])) + if (! m_writer->config.use_relative_e_distances && ! is_approx(ppi.e_position[eid], ppi.opt_e_position->values[eid])) const_cast(e).set_position(ppi.opt_e_position->values[eid]); if (! is_approx(ppi.e_retracted[eid], ppi.opt_e_retracted->values[eid]) || ! is_approx(ppi.e_restart_extra[eid], ppi.opt_e_restart_extra->values[eid])) @@ -3963,9 +3921,9 @@ void GCode::_print_first_layer_bed_temperature(GCodeOutputStream &file, Print &p temp = temp_by_gcode; #endif - // Always call m_writer.set_bed_temperature() so it will set the internal "current" state of the bed temp as if + // Always call m_writer->set_bed_temperature() so it will set the internal "current" state of the bed temp as if // the custom start G-code emited these. - std::string set_temp_gcode = m_writer.set_bed_temperature(bed_temp, wait); + std::string set_temp_gcode = m_writer->set_bed_temperature(bed_temp, wait); if (! temp_set_by_gcode) file.write(set_temp_gcode); } @@ -3985,14 +3943,14 @@ void GCode::_print_first_layer_extruder_temperatures(GCodeOutputStream &file, Pr int temp = print.config().nozzle_temperature_initial_layer.get_at(first_printing_extruder_id); if (temp_by_gcode >= 0 && temp_by_gcode < 1000) temp = temp_by_gcode; - m_writer.set_temperature(temp, wait, first_printing_extruder_id); + m_writer->set_temperature(temp, wait, first_printing_extruder_id); } else { // Custom G-code does not set the extruder temperature. Do it now. if (print.config().single_extruder_multi_material.value) { // Set temperature of the first printing extruder only. int temp = print.config().nozzle_temperature_initial_layer.get_at(first_printing_extruder_id); if (temp > 0) - file.write(m_writer.set_temperature(temp, wait, first_printing_extruder_id)); + file.write(m_writer->set_temperature(temp, wait, first_printing_extruder_id)); } else { // Set temperatures of all the printing extruders. for (unsigned int tool_id : print.extruders()) { @@ -4004,7 +3962,7 @@ void GCode::_print_first_layer_extruder_temperatures(GCodeOutputStream &file, Pr temp = print.config().idle_temperature.get_at(tool_id); } if (temp > 0) - file.write(m_writer.set_temperature(temp, wait, tool_id)); + file.write(m_writer->set_temperature(temp, wait, tool_id)); } } } @@ -4427,7 +4385,7 @@ LayerResult GCode::process_layer( //support is attached above the object, and support layers has independent layer height, then the lowest support //interface layer id is 0. bool first_layer = (layer.id() == 0 && abs(layer.bottom_z()) < EPSILON); - m_writer.set_is_first_layer(first_layer); + m_writer->set_is_first_layer(first_layer); unsigned int first_extruder_id = layer_tools.extruders.front(); // Initialize config with the 1st object to be printed at this layer. @@ -4477,7 +4435,7 @@ LayerResult GCode::process_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); gcode += this->placeholder_parser_process("before_layer_change_gcode", - print.config().before_layer_change_gcode.value, m_writer.filament()->id(), &config) + print.config().before_layer_change_gcode.value, m_writer->filament()->id(), &config) + "\n"; } @@ -4512,7 +4470,7 @@ LayerResult GCode::process_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); gcode += this->placeholder_parser_process("timelapse_gcode", - print.config().time_lapse_gcode.value, m_writer.filament()->id(), &config) + print.config().time_lapse_gcode.value, m_writer->filament()->id(), &config) + "\n"; } @@ -4522,7 +4480,7 @@ LayerResult GCode::process_layer( config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); gcode += this->placeholder_parser_process("layer_change_gcode", - print.config().layer_change_gcode.value, m_writer.filament()->id(), &config) + print.config().layer_change_gcode.value, m_writer->filament()->id(), &config) + "\n"; config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); } @@ -4562,7 +4520,7 @@ LayerResult GCode::process_layer( case CalibMode::Calib_Input_shaping_freq: { if (m_layer_index == 1){ gcode += writer().set_input_shaping('A', print.calib_params().start, 0.f, print.calib_params().shaper_type); - if (m_writer.get_gcode_flavor() == gcfKlipper) { + if (m_writer->get_gcode_flavor() == gcfKlipper) { // Disable minimum cruise ratio to ensure consistent motion for calibration gcode += "SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0\n"; } @@ -4578,7 +4536,7 @@ LayerResult GCode::process_layer( } case CalibMode::Calib_Input_shaping_damp: { if (m_layer_index == 1){ - if (m_writer.get_gcode_flavor() == gcfKlipper) { + if (m_writer->get_gcode_flavor() == gcfKlipper) { // Disable minimum cruise ratio to ensure consistent motion for calibration gcode += "SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0\n"; } @@ -4590,7 +4548,7 @@ LayerResult GCode::process_layer( break; } case CalibMode::Calib_Cornering: { - if (m_writer.get_gcode_flavor() == gcfMarlinFirmware && + if (m_writer->get_gcode_flavor() == gcfMarlinFirmware && !m_config.machine_max_junction_deviation.values.empty() && m_config.machine_max_junction_deviation.values.front() > 0) { gcode += writer().set_junction_deviation(this->interpolate_value_across_layers(print.calib_params().start, print.calib_params().end)); @@ -4605,22 +4563,22 @@ LayerResult GCode::process_layer( if (first_layer) { // Orca: we don't need to optimize the Klipper as only set once if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) { - gcode += m_writer.set_print_acceleration((unsigned int)floor(m_config.initial_layer_acceleration.value + 0.5)); + gcode += m_writer->set_print_acceleration((unsigned int)floor(m_config.initial_layer_acceleration.value + 0.5)); } if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0) { - gcode += m_writer.set_jerk_xy(m_config.initial_layer_jerk.value); + gcode += m_writer->set_jerk_xy(m_config.initial_layer_jerk.value); } - if (m_writer.get_gcode_flavor() == gcfMarlinFirmware && m_config.default_junction_deviation.value > 0) { - gcode += m_writer.set_junction_deviation(m_config.default_junction_deviation.value); + if (m_writer->get_gcode_flavor() == gcfMarlinFirmware && m_config.default_junction_deviation.value > 0) { + gcode += m_writer->set_junction_deviation(m_config.default_junction_deviation.value); } } if (!first_layer && !m_second_layer_things_done) { // Orca: set power loss recovery const auto plr_mode = print.config().enable_power_loss_recovery.value; - gcode += m_writer.enable_power_loss_recovery(plr_mode); + gcode += m_writer->enable_power_loss_recovery(plr_mode); if (print.is_BBL_printer()) { // BBS: open first layer inspection at second layer @@ -4635,23 +4593,23 @@ LayerResult GCode::process_layer( // Reset acceleration at sencond layer // Orca: only set once, don't need to call set_accel_and_jerk if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) { - gcode += m_writer.set_print_acceleration((unsigned int) floor(m_config.default_acceleration.value + 0.5)); + gcode += m_writer->set_print_acceleration((unsigned int) floor(m_config.default_acceleration.value + 0.5)); } if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0) { - gcode += m_writer.set_jerk_xy(m_config.default_jerk.value); + gcode += m_writer->set_jerk_xy(m_config.default_jerk.value); } // Transition from 1st to 2nd layer. Adjust nozzle temperatures as prescribed by the nozzle dependent // nozzle_temperature_initial_layer vs. temperature settings. - for (const Extruder& extruder : m_writer.extruders()) { + for (const Extruder& extruder : m_writer->extruders()) { if ((print.config().single_extruder_multi_material.value || m_ooze_prevention.enable) && - extruder.id() != m_writer.filament()->id()) + extruder.id() != m_writer->filament()->id()) // In single extruder multi material mode, set the temperature for the current extruder only. continue; int temperature = print.config().nozzle_temperature.get_at(extruder.id()); if (temperature > 0 && temperature != print.config().nozzle_temperature_initial_layer.get_at(extruder.id())) - gcode += m_writer.set_temperature(temperature, false, extruder.id()); + gcode += m_writer->set_temperature(temperature, false, extruder.id()); } // BBS @@ -4660,14 +4618,14 @@ LayerResult GCode::process_layer( bed_temp = get_highest_bed_temperature(false,print); else bed_temp = get_bed_temperature(first_extruder_id, false, m_config.curr_bed_type); - gcode += m_writer.set_bed_temperature(bed_temp); + gcode += m_writer->set_bed_temperature(bed_temp); // Mark the temperature transition from 1st to 2nd layer to be finished. m_second_layer_things_done = true; } if (single_object_instance_idx == size_t(-1)) { // Normal (non-sequential) print. - gcode += ProcessLayer::emit_custom_gcode_per_print_z(*this, layer_tools.custom_gcode, m_writer.filament()->id(), first_extruder_id, print.config()); + gcode += ProcessLayer::emit_custom_gcode_per_print_z(*this, layer_tools.custom_gcode, m_writer->filament()->id(), first_extruder_id, print.config()); } // BBS: get next extruder according to flush and soluble @@ -4958,9 +4916,9 @@ LayerResult GCode::process_layer( auto insert_timelapse_gcode = [this, print_z, &print, &most_used_extruder, &layer_object_label_ids,&printed_objects = std::as_const(m_printed_objects)]() -> std::string { PosPickCtx ctx; - ctx.curr_pos = { (coord_t)(scale_(m_writer.get_position().x())),(coord_t)(scale_(m_writer.get_position().y())) }; + ctx.curr_pos = { (coord_t)(scale_(m_writer->get_position().x())),(coord_t)(scale_(m_writer->get_position().y())) }; ctx.curr_layer = this->layer(); - ctx.curr_extruder_id = m_writer.filament()->extruder_id(); + ctx.curr_extruder_id = m_writer->filament()->extruder_id(); ctx.picture_extruder_id = most_used_extruder; if (m_config.print_sequence == PrintSequence::ByObject) ctx.printed_objects = printed_objects; @@ -4978,17 +4936,17 @@ LayerResult GCode::process_layer( config.set_key_value("timelapse_pos_x", new ConfigOptionInt((int)timelapse_pos.x())); config.set_key_value("timelapse_pos_y", new ConfigOptionInt((int)timelapse_pos.y())); config.set_key_value("has_timelapse_safe_pos", new ConfigOptionBool(timelapse_pos != DefaultTimelapsePos)); - timelapse_gcode = this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer.filament()->id(), &config) + "\n"; + timelapse_gcode = this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer->filament()->id(), &config) + "\n"; } if (!timelapse_gcode.empty()) { - m_writer.set_current_position_clear(false); + m_writer->set_current_position_clear(false); double temp_z_after_tool_change; if (GCodeProcessor::get_last_z_from_gcode(timelapse_gcode, temp_z_after_tool_change)) { - Vec3d pos = m_writer.get_position(); + Vec3d pos = m_writer->get_position(); pos(2) = temp_z_after_tool_change; - m_writer.set_position(pos); + m_writer->set_position(pos); } } @@ -5034,16 +4992,16 @@ LayerResult GCode::process_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); config.set_key_value("most_used_physical_extruder_id", new ConfigOptionInt(m_config.physical_extruder_map.get_at(most_used_extruder))); - config.set_key_value("curr_physical_extruder_id", new ConfigOptionInt(m_config.physical_extruder_map.get_at(m_writer.filament()->extruder_id()))); - wrapping_gcode = this->placeholder_parser_process("wrapping_detection_gcode", print.config().wrapping_detection_gcode.value, m_writer.filament()->id(), &config) +"\n"; + config.set_key_value("curr_physical_extruder_id", new ConfigOptionInt(m_config.physical_extruder_map.get_at(m_writer->filament()->extruder_id()))); + wrapping_gcode = this->placeholder_parser_process("wrapping_detection_gcode", print.config().wrapping_detection_gcode.value, m_writer->filament()->id(), &config) +"\n"; } - m_writer.set_current_position_clear(false); + m_writer->set_current_position_clear(false); double temp_z_after_tool_change; if (GCodeProcessor::get_last_z_from_gcode(wrapping_gcode, temp_z_after_tool_change)) { - Vec3d pos = m_writer.get_position(); + Vec3d pos = m_writer->get_position(); pos(2) = temp_z_after_tool_change; - m_writer.set_position(pos); + m_writer->set_position(pos); } return wrapping_gcode; }; @@ -5109,7 +5067,7 @@ LayerResult GCode::process_layer( if (should_insert) { gcode += this->retract(false, false, auto_lift_type, true); - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); gcode += insert_timelapse_gcode(); has_insert_timelapse_gcode = true; @@ -5126,12 +5084,12 @@ LayerResult GCode::process_layer( } else { if (need_insert_timelapse_gcode_for_traditional && !has_insert_timelapse_gcode && - m_writer.need_toolchange(extruder_id) && + m_writer->need_toolchange(extruder_id) && m_config.nozzle_diameter.values.size() == 2 && writer().filament() && (get_extruder_id(writer().filament()->id()) == most_used_extruder)) { gcode += this->retract(false, false, auto_lift_type, true); - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); gcode += insert_timelapse_gcode(); has_insert_timelapse_gcode = true; @@ -5248,19 +5206,19 @@ LayerResult GCode::process_layer( // exclude objects if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer.set_object_start_str( + m_writer->set_object_start_str( std::string("; start printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M624 " + _encode_label_ids_to_base64({instance_to_print.label_object_id}) + "\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer.set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + + m_writer->set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { std::string str = std::string("M486 S") + std::to_string(inst.unique_id) + "\n"; - m_writer.set_object_start_str(str); + m_writer->set_object_start_str(str); } } } @@ -5278,7 +5236,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); - this->update_origin_snap(&instance_to_print.print_object, offset); + this->on_set_origin(&instance_to_print.print_object, offset); if (instance_to_print.object_by_extruder.support != nullptr) { m_layer = layers[instance_to_print.layer_id].support_layer; m_object_layer_over_raft = false; @@ -5302,7 +5260,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); - this->update_origin_snap(&instance_to_print.print_object, offset); + this->on_set_origin(&instance_to_print.print_object, offset); ExtrusionEntityCollection support_eec; // BBS @@ -5351,7 +5309,7 @@ LayerResult GCode::process_layer( m_avoid_crossing_perimeters.use_external_mp_once(); m_last_obj_copy = this_object_copy; this->set_origin(unscale(offset)); - this->update_origin_snap(&instance_to_print.print_object, offset); + this->on_set_origin(&instance_to_print.print_object, offset); //FIXME the following code prints regions in the order they are defined, the path is not optimized in any way. auto has_infill = [](const std::vector &by_region) { @@ -5388,20 +5346,20 @@ LayerResult GCode::process_layer( } // exclude objects // Don't set m_gcode_label_objects_end if you don't had to write the m_gcode_label_objects_start. - if (!m_writer.is_object_start_str_empty()) { - m_writer.set_object_start_str(""); + if (!m_writer->is_object_start_str_empty()) { + m_writer->set_object_start_str(""); } else if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer.set_object_end_str(std::string("; stop printing object, unique label id: ") + + m_writer->set_object_end_str(std::string("; stop printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M625\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer.set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + + m_writer->set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { - m_writer.set_object_end_str(std::string("M486 S-1\n")); + m_writer->set_object_end_str(std::string("M486 S-1\n")); } } } @@ -5453,7 +5411,7 @@ LayerResult GCode::process_layer( if (FILAMENT_CONFIG(retract_when_changing_layer)) { gcode += this->retract(false, false, auto_lift_type, true); } - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); gcode += insert_timelapse_gcode(); } @@ -5465,7 +5423,7 @@ LayerResult GCode::process_layer( void GCode::apply_print_config(const PrintConfig &print_config) { - m_writer.apply_print_config(print_config); + m_writer->apply_print_config(print_config); m_config.apply(print_config); m_scaled_resolution = scaled(print_config.resolution.value); m_enable_exclude_object = m_config.exclude_object; @@ -5555,7 +5513,7 @@ void GCode::append_full_config(const Print &print, std::string &str) void GCode::set_extruders(const std::vector &extruder_ids) { - m_writer.set_extruders(extruder_ids); + m_writer->set_extruders(extruder_ids); // enable wipe path generation if any extruder has wipe enabled m_wipe.enable = false; @@ -5578,139 +5536,15 @@ void GCode::set_origin(const Vec2d &pointf) m_origin = pointf; } -void GCode::update_origin_snap(const PrintObject *obj, const Point &inst_shift) -{ - if (!m_origin_snap[0] && !m_origin_snap[1] && !m_origin_snap[2]) - return; - - // Clear existing snap so to_machine_coords gives raw machine coords for bbox computation. - for (int a = 0; a < 3; ++a) - m_writer.set_origin_snap(a, false, 0., 0.); - - // Reconstruct the belt pipeline transform for this object (same as - // PrintObjectSlice.cpp: z_shift * scale * shear * pre_remap). - const auto &cfg = m_config; - Transform3d belt = Transform3d::Identity(); - - // Pre-slice remap - int pre_rx = int(cfg.belt_preslice_remap_x.value); - int pre_ry = int(cfg.belt_preslice_remap_y.value); - int pre_rz = int(cfg.belt_preslice_remap_z.value); - if (pre_rx != int(BeltRemapAxis::PosX) || - pre_ry != int(BeltRemapAxis::PosY) || - pre_rz != int(BeltRemapAxis::PosZ)) { - auto remap_col = [](int r) -> Vec3d { - int a = r % 3; Vec3d c = Vec3d::Zero(); - c[a] = (r < 3) ? 1.0 : -1.0; - return c; - }; - Matrix3d lin; - lin.col(0) = remap_col(pre_rx); - lin.col(1) = remap_col(pre_ry); - lin.col(2) = remap_col(pre_rz); - Transform3d pre = Transform3d::Identity(); - pre.linear() = lin; - if (pre_rx >= 6 || pre_ry >= 6 || pre_rz >= 6) { - BoundingBoxf bb(cfg.printable_area.values); - Vec3d vm(bb.max.x(), bb.max.y(), cfg.printable_height.value); - Vec3d tr = Vec3d::Zero(); - if (pre_rx >= 6) tr[0] = vm[pre_rx % 3]; - if (pre_ry >= 6) tr[1] = vm[pre_ry % 3]; - if (pre_rz >= 6) tr[2] = vm[pre_rz % 3]; - pre.translation() = tr; - } - belt = pre * belt; - } - - // Shear - auto shear_f = [](BeltShearMode m, double a) -> double { - double r = Geometry::deg2rad(a), s = std::sin(r), c = std::cos(r); - switch (m) { - case BeltShearMode::PosCot: return (s > EPSILON) ? c/s : 0.; - case BeltShearMode::NegCot: return (s > EPSILON) ? -c/s : 0.; - case BeltShearMode::PosTan: return (c > EPSILON) ? s/c : 0.; - case BeltShearMode::NegTan: return (c > EPSILON) ? -s/c : 0.; - default: return 0.; - } - }; - struct AS { BeltShearMode m; double a; int f; }; - AS axes[3] = { - {cfg.belt_shear_x.value, cfg.belt_shear_x_angle.value, int(cfg.belt_shear_x_from.value)}, - {cfg.belt_shear_y.value, cfg.belt_shear_y_angle.value, int(cfg.belt_shear_y_from.value)}, - {cfg.belt_shear_z.value, cfg.belt_shear_z_angle.value, int(cfg.belt_shear_z_from.value)}, - }; - Transform3d shear = Transform3d::Identity(); - for (int i = 0; i < 3; ++i) - if (axes[i].m != BeltShearMode::None) { - double f = shear_f(axes[i].m, axes[i].a); - if (std::abs(f) > EPSILON) - shear.matrix()(i, axes[i].f) += f; - } - - // Scale - auto scale_f = [](BeltScaleMode m, double a) -> double { - if (m == BeltScaleMode::None) return 1.; - double r = Geometry::deg2rad(a), s = std::sin(r), c = std::cos(r); - switch (m) { - case BeltScaleMode::InvSin: return (s > EPSILON) ? 1./s : 1.; - case BeltScaleMode::InvCos: return (c > EPSILON) ? 1./c : 1.; - case BeltScaleMode::Sin: return s; - case BeltScaleMode::Cos: return c; - default: return 1.; - } - }; - Transform3d sc = Transform3d::Identity(); - sc.matrix()(0,0) = scale_f(cfg.belt_scale_x.value, cfg.belt_scale_x_angle.value); - sc.matrix()(1,1) = scale_f(cfg.belt_scale_y.value, cfg.belt_scale_y_angle.value); - sc.matrix()(2,2) = scale_f(cfg.belt_scale_z.value, cfg.belt_scale_z_angle.value); - - belt = sc * shear * belt; - - // Z-shift - double zs = (obj->belt_min_z() < 0.) ? -obj->belt_min_z() : 0.; - if (zs > 0.) { - Transform3d zsh = Transform3d::Identity(); - zsh.matrix()(2, 3) = zs; - belt = zsh * belt; - } - - // Full transform: belt * trafo_centered - Transform3d full = belt * obj->trafo_centered(); - - // Instance shift in slicer space + global Z offset - Vec3d shift(unscale(inst_shift.x()), - unscale(inst_shift.y()), - obj->belt_global_z_offset()); - - // Compute this instance's machine-space bbox min - BoundingBoxf3 bb = obj->model_object()->raw_bounding_box(); - Vec3d mn = bb.min.cast(), mx = bb.max.cast(); - Vec3d inst_min(std::numeric_limits::max(), - std::numeric_limits::max(), - std::numeric_limits::max()); - for (int i = 0; i < 8; ++i) { - Vec3d c((i & 1) ? mx.x() : mn.x(), - (i & 2) ? mx.y() : mn.y(), - (i & 4) ? mx.z() : mn.z()); - Vec3d mc = m_writer.to_machine_coords(full * c + shift); - for (int a = 0; a < 3; ++a) - inst_min[a] = std::min(inst_min[a], mc[a]); - } - - // Update writer snap for each enabled axis - for (int a = 0; a < 3; ++a) - m_writer.set_origin_snap(a, m_origin_snap[a], m_origin_snap_offset[a], inst_min[a]); -} - std::string GCode::preamble() { - std::string gcode = m_writer.preamble(); + std::string gcode = m_writer->preamble(); /* Perform a *silent* move to z_offset: we need this to initialize the Z position of our writer object so that any initial lift taking place before the first layer change will raise the extruder from the correct initial Z instead of 0. */ - m_writer.travel_to_z(m_config.z_offset.value); + m_writer->travel_to_z(m_config.z_offset.value); return gcode; } @@ -5721,28 +5555,28 @@ std::string GCode::change_layer(coordf_t print_z) std::string gcode; if (m_layer_count > 0) // Increment a progress bar indicator. - gcode += m_writer.update_progress(++ m_layer_index, m_layer_count); + gcode += m_writer->update_progress(++ m_layer_index, m_layer_count); //BBS coordf_t z = print_z + m_config.z_offset.value; // in unscaled coordinates - if (FILAMENT_CONFIG(retract_when_changing_layer) && m_writer.will_move_z(z)) { + if (FILAMENT_CONFIG(retract_when_changing_layer) && m_writer->will_move_z(z)) { LiftType lift_type = this->to_lift_type(ZHopType(FILAMENT_CONFIG(z_hop_types))); //BBS: force to use SpiralLift when change layer if lift type is auto gcode += this->retract(false, false, ZHopType(FILAMENT_CONFIG(z_hop_types)) == ZHopType::zhtAuto ? LiftType::SpiralLift : lift_type); } - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); if (m_spiral_vase) { //BBS: force to normal lift immediately in spiral vase mode std::ostringstream comment; comment << "move to next layer (" << m_layer_index << ")"; - gcode += m_writer.travel_to_z(z, comment.str()); + gcode += m_writer->travel_to_z(z, comment.str()); } m_need_change_layer_lift_z = true; m_nominal_z = z; - m_writer.get_position().z() = z; + m_writer->get_position().z() = z; // forget last wiping path as wiping after raising Z is pointless // BBS. Dont forget wiping path to reduce stringing. @@ -6044,7 +5878,7 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou //Point pt = ((nd * nd >= l2) ? (p1+v*0.4): (p1 + 0.2 * v * (nd / sqrt(l2)))).cast(); pt.rotate(angle, paths.front().polyline.points.front()); // generate the travel move - gcode += m_writer.extrude_to_xy(this->point_to_gcode(pt), 0,"move inwards before travel",true); + gcode += m_writer->extrude_to_xy(this->point_to_gcode(pt), 0,"move inwards before travel",true); } return gcode; @@ -6367,7 +6201,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, bool slope_need_z_travel = false; if (sloped != nullptr && !sloped->is_flat()) { auto target_z = get_sloped_z(sloped->slope_begin.z_ratio); - slope_need_z_travel = m_writer.will_move_z(target_z); + slope_need_z_travel = m_writer->will_move_z(target_z); } // Move to first point of extrusion path // path is 2D. But in slope lift case, lift z is done in travel_to function. @@ -6390,7 +6224,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // if needed, write the gcode_label_objects_end then gcode_label_objects_start // should be already done by travel_to, but just in case - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); // compensate retraction gcode += this->unretract(); @@ -6444,12 +6278,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } } - if (m_writer.get_gcode_flavor() == gcfKlipper) { - gcode += m_writer.set_accel_and_jerk(acceleration_i, jerk); + if (m_writer->get_gcode_flavor() == gcfKlipper) { + gcode += m_writer->set_accel_and_jerk(acceleration_i, jerk); } else { - gcode += m_writer.set_print_acceleration(acceleration_i); - gcode += m_writer.set_jerk_xy(jerk); + gcode += m_writer->set_print_acceleration(acceleration_i); + gcode += m_writer->set_jerk_xy(jerk); } // calculate effective extrusion length per distance unit (e_per_mm) @@ -6494,8 +6328,8 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } // Effective extrusion length per distance unit = (filament_flow_ratio/cross_section) * mm3_per_mm / print flow ratio - // m_writer.extruder()->e_per_mm3() below is (filament flow ratio / cross-sectional area) - double e_per_mm = m_writer.filament()->e_per_mm3() * _mm3_per_mm; + // m_writer->extruder()->e_per_mm3() below is (filament flow ratio / cross-sectional area) + double e_per_mm = m_writer->filament()->e_per_mm3() * _mm3_per_mm; e_per_mm /= filament_flow_ratio; // set speed @@ -6721,7 +6555,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index + 1)); config.set_key_value("layer_z", new ConfigOptionFloat(m_layer == nullptr ? m_last_height : m_layer->print_z)); gcode += this->placeholder_parser_process("change_extrusion_role_gcode", - m_config.change_extrusion_role_gcode.value, m_writer.filament()->id(), &config) + m_config.change_extrusion_role_gcode.value, m_writer->filament()->id(), &config) + "\n"; } @@ -6776,7 +6610,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, if (m_multi_flow_segment_path_average_mm3_per_mm > 0) { sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), m_multi_flow_segment_path_average_mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -6789,7 +6623,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // to issue a zero flow PA change command for this sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -6895,7 +6729,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -6910,7 +6744,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -6925,7 +6759,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // ORCA: End of adaptive PA code segment } - gcode += m_writer.set_speed(F, "", comment); + gcode += m_writer->set_speed(F, "", comment); { if (m_enable_cooling_markers) { if (enable_overhang_bridge_fan) { @@ -6943,7 +6777,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } // BBS: use G1 if not enable arc fitting or has no arc fitting result or in spiral_mode mode or we are doing sloped extrusion // Attention: G2 and G3 is not supported in spiral_mode mode - if (!m_config.enable_arc_fitting || path.polyline.fitting_result.empty() || m_config.spiral_mode || sloped != nullptr || m_config.belt_printer) { + if (!m_config.enable_arc_fitting || path.polyline.fitting_result.empty() || m_config.spiral_mode || sloped != nullptr || this->should_disable_arc_fitting()) { double path_length = 0.; double total_length = sloped == nullptr ? 0. : path.polyline.length() * SCALING_FACTOR; for (const Line& line : path.polyline.lines()) { @@ -6963,7 +6797,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } if (sloped == nullptr) { // Normal extrusion - gcode += m_writer.extrude_to_xy( + gcode += m_writer->extrude_to_xy( this->point_to_gcode(line.b), dE, GCodeWriter::full_gcode_comment ? tempDescription : "", path.is_force_no_extrusion()); @@ -6972,7 +6806,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, const auto [z_ratio, e_ratio] = sloped->interpolate(path_length / total_length); Vec2d dest2d = this->point_to_gcode(line.b); Vec3d dest3d(dest2d(0), dest2d(1), get_sloped_z(z_ratio)); - gcode += m_writer.extrude_to_xyz( + gcode += m_writer->extrude_to_xyz( dest3d, dE * e_ratio, GCodeWriter::full_gcode_comment ? tempDescription : "", path.is_force_no_extrusion()); @@ -7002,7 +6836,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, tempDescription += Slic3r::format(" | Old Flow Value: %0.5f Length: %0.5f",oldE, line_length); } } - gcode += m_writer.extrude_to_xy( + gcode += m_writer->extrude_to_xy( this->point_to_gcode(line.b), dE, GCodeWriter::full_gcode_comment ? tempDescription : "", path.is_force_no_extrusion()); @@ -7025,7 +6859,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, tempDescription += Slic3r::format(" | Old Flow Value: %0.5f Length: %0.5f",oldE, arc_length); } } - gcode += m_writer.extrude_arc_to_xy( + gcode += m_writer->extrude_arc_to_xy( this->point_to_gcode(arc.end_point), center_offset, dE, @@ -7053,7 +6887,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, Polyline l(p); total_length = l.length() * SCALING_FACTOR; } - gcode += m_writer.set_speed(last_set_speed, "", comment); + gcode += m_writer->set_speed(last_set_speed, "", comment); Vec2d prev = this->point_to_gcode_quantized(new_points[0].p); bool pre_fan_enabled = false; bool cur_fan_enabled = false; @@ -7103,7 +6937,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -7118,7 +6952,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer.filament()->id(), + m_writer->filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -7135,10 +6969,10 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // Ignore small speed variations - emit speed change if the delta between current and new is greater than 60mm/min / 1mm/sec // Reset speed to F if delta to F is less than 1mm/sec if ((std::abs(last_set_speed - new_speed) > 60)) { - gcode += m_writer.set_speed(new_speed, "", comment); + gcode += m_writer->set_speed(new_speed, "", comment); last_set_speed = new_speed; } else if ((std::abs(F - new_speed) <= 60)) { - gcode += m_writer.set_speed(F, "", comment); + gcode += m_writer->set_speed(F, "", comment); last_set_speed = F; } auto dE = e_per_mm * line_length; @@ -7152,12 +6986,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } if (sloped == nullptr) { // Normal extrusion - gcode += m_writer.extrude_to_xy(p, dE, GCodeWriter::full_gcode_comment ? tempDescription : ""); + gcode += m_writer->extrude_to_xy(p, dE, GCodeWriter::full_gcode_comment ? tempDescription : ""); } else { // Sloped extrusion const auto [z_ratio, e_ratio] = sloped->interpolate(path_length / total_length); Vec3d dest3d(p(0), p(1), get_sloped_z(z_ratio)); - gcode += m_writer.extrude_to_xyz(dest3d, dE * e_ratio, GCodeWriter::full_gcode_comment ? tempDescription : ""); + gcode += m_writer->extrude_to_xyz(dest3d, dE * e_ratio, GCodeWriter::full_gcode_comment ? tempDescription : ""); } prev = p; @@ -7298,18 +7132,18 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string } } - if (m_writer.get_gcode_flavor() == gcfKlipper) { - gcode += m_writer.set_accel_and_jerk(acceleration_to_set, jerk_to_set); + if (m_writer->get_gcode_flavor() == gcfKlipper) { + gcode += m_writer->set_accel_and_jerk(acceleration_to_set, jerk_to_set); } else { - gcode += m_writer.set_travel_acceleration(acceleration_to_set); - gcode += m_writer.set_jerk_xy(jerk_to_set); + gcode += m_writer->set_travel_acceleration(acceleration_to_set); + gcode += m_writer->set_jerk_xy(jerk_to_set); } // if a retraction would be needed, try to use reduce_crossing_wall to plan a // multi-hop travel path inside the configuration space if (m_config.reduce_crossing_wall && !m_avoid_crossing_perimeters.disabled_once() - && m_writer.is_current_position_clear()) + && m_writer->is_current_position_clear()) //BBS: don't generate detour travel paths when current position is unclea { travel = m_avoid_crossing_perimeters.travel_to(*this, point, &could_be_wipe_disabled); @@ -7356,7 +7190,7 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string // if needed, write the gcode_label_objects_end then gcode_label_objects_start - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); // use G1 because we rely on paths being straight (G0 may make round paths) if (travel.size() >= 2) { @@ -7364,14 +7198,14 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string if (false/*m_spiral_vase*/) { // No lazy z lift for spiral vase mode for (size_t i = 1; i < travel.size(); ++i) { - gcode += m_writer.travel_to_xy(this->point_to_gcode(travel.points[i]), comment); + gcode += m_writer->travel_to_xy(this->point_to_gcode(travel.points[i]), comment); } } else { if (travel.size() == 2) { // No extra movements emitted by avoid_crossing_perimeters, simply move to the end point with z change const auto& dest2d = this->point_to_gcode(travel.points.back()); Vec3d dest3d(dest2d(0), dest2d(1), z == DBL_MAX ? m_nominal_z : z); - gcode += m_writer.travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); + gcode += m_writer->travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); m_need_change_layer_lift_z = false; } else { // Extra movements emitted by avoid_crossing_perimeters, lift the z to normal height at the beginning, then apply the z @@ -7381,16 +7215,16 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string // Lift to normal z at beginning Vec2d dest2d = this->point_to_gcode(travel.points[i]); Vec3d dest3d(dest2d(0), dest2d(1), m_nominal_z); - gcode += m_writer.travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); + gcode += m_writer->travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); m_need_change_layer_lift_z = false; } else if (z != DBL_MAX && i == travel.size() - 1) { // Apply z_ratio for the very last point Vec2d dest2d = this->point_to_gcode(travel.points[i]); Vec3d dest3d(dest2d(0), dest2d(1), z); - gcode += m_writer.travel_to_xyz(dest3d, comment); + gcode += m_writer->travel_to_xyz(dest3d, comment); } else { // For all points in between, no z change - gcode += m_writer.travel_to_xy(this->point_to_gcode(travel.points[i]), comment); + gcode += m_writer->travel_to_xy(this->point_to_gcode(travel.points[i]), comment); } } } @@ -7493,7 +7327,7 @@ bool GCode::needs_retraction(const Polyline &travel, ExtrusionRole role, LiftTyp if (clipped_travel.length() > travel_len_thresh) clipped_travel.points.back() = clipped_travel.points.front()+(clipped_travel.points.back() - clipped_travel.points.front()) * (travel_len_thresh / clipped_travel.length()); //BBS: translate to current plate coordinate system - clipped_travel.translate(Point::new_scale(double(m_origin.x() - m_writer.get_xy_offset().x()), double(m_origin.y() - m_writer.get_xy_offset().y()))); + clipped_travel.translate(Point::new_scale(double(m_origin.x() - m_writer->get_xy_offset().x()), double(m_origin.y() - m_writer->get_xy_offset().y()))); //BBS: force to retract when leave from external perimeter for a long travel //Better way is judging whether the travel move direction is same with last extrusion move. @@ -7545,13 +7379,13 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li { std::string gcode; - if (m_writer.filament() == nullptr) + if (m_writer->filament() == nullptr) return gcode; // wipe (if it's enabled for this extruder and we have a stored wipe path and no-zero wipe distance) if (FILAMENT_CONFIG(wipe) && m_wipe.has_path() && scale_(FILAMENT_CONFIG(wipe_distance)) > SCALED_EPSILON) { Wipe::RetractionValues wipeRetractions = m_wipe.calculateWipeRetractionLengths(*this, toolchange); - gcode += toolchange ? m_writer.retract_for_toolchange(true,wipeRetractions.retractLengthBeforeWipe) : m_writer.retract(true, wipeRetractions.retractLengthBeforeWipe); + gcode += toolchange ? m_writer->retract_for_toolchange(true,wipeRetractions.retractLengthBeforeWipe) : m_writer->retract(true, wipeRetractions.retractLengthBeforeWipe); gcode += m_wipe.wipe(*this,wipeRetractions.retractLengthDuringWipe, toolchange, is_last_retraction); } @@ -7561,14 +7395,14 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li length is honored in case wipe path was too short. */ if ((!this->on_first_layer() || this->config().bottom_surface_pattern != InfillPattern::ipHilbertCurve) && (role != erTopSolidInfill || this->config().top_surface_pattern != InfillPattern::ipHilbertCurve)) - gcode += toolchange ? m_writer.retract_for_toolchange() : m_writer.retract(); + gcode += toolchange ? m_writer->retract_for_toolchange() : m_writer->retract(); - gcode += m_writer.reset_e(); + gcode += m_writer->reset_e(); // Orca: check if should + can lift (roughly from SuperSlicer) RetractLiftEnforceType retract_lift_type = RetractLiftEnforceType(EXTRUDER_CONFIG(retract_lift_enforce)); bool needs_lift = toolchange - || m_writer.filament()->retraction_length() > 0 + || m_writer->filament()->retraction_length() > 0 || m_config.use_firmware_retraction; bool last_fill_extrusion_role_top_infill = (this->m_last_notgapfill_extrusion_role == ExtrusionRole::erTopSolidInfill || this->m_last_notgapfill_extrusion_role == ExtrusionRole::erIroning); @@ -7591,9 +7425,9 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li if (needs_lift && can_lift) { if (apply_instantly) - gcode += m_writer.eager_lift(lift_type); + gcode += m_writer->eager_lift(lift_type); else - gcode += m_writer.lazy_lift(lift_type, m_spiral_vase != nullptr); + gcode += m_writer->lazy_lift(lift_type, m_spiral_vase != nullptr); } return gcode; @@ -7602,11 +7436,11 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bool by_object, int toolchange_temp_override) { int new_extruder_id = get_extruder_id(new_filament_id); - if (!m_writer.need_toolchange(new_filament_id)) + if (!m_writer->need_toolchange(new_filament_id)) return ""; // if we are running a single-extruder setup, just set the extruder and return nothing - if (!m_writer.multiple_extruders) { + if (!m_writer->multiple_extruders) { this->placeholder_parser().set("current_extruder", new_filament_id); this->placeholder_parser().set("retraction_distance_when_ec", m_config.retraction_distances_when_ec.get_at(new_filament_id)); this->placeholder_parser().set("long_retraction_when_ec", m_config.long_retractions_when_ec.get_at(new_filament_id)); @@ -7629,13 +7463,13 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo check_add_eol(gcode); } if (m_config.enable_pressure_advance.get_at(new_filament_id)) { - gcode += m_writer.set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); + gcode += m_writer->set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); // Orca: Adaptive PA // Reset Adaptive PA processor last PA value m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(new_filament_id)); } - gcode += m_writer.toolchange(new_filament_id); + gcode += m_writer->toolchange(new_filament_id); return gcode; } @@ -7650,18 +7484,18 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo // BBS: insert skip object label before change filament while by object if (by_object) - m_writer.add_object_change_labels(gcode); + m_writer->add_object_change_labels(gcode); bool add_change_filament_624 = false; - if (m_writer.filament() != nullptr) { + if (m_writer->filament() != nullptr) { // Process the custom filament_end_gcode. set_extruder() is only called if there is no wipe tower // so it should not be injected twice. - unsigned int old_filament_id = m_writer.filament()->id(); + unsigned int old_filament_id = m_writer->filament()->id(); const std::string &filament_end_gcode = m_config.filament_end_gcode.get_at(old_filament_id); if (! filament_end_gcode.empty()) { DynamicConfig config; config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); - config.set_key_value("layer_z", new ConfigOptionFloat(m_writer.get_position().z() - m_config.z_offset.value)); + config.set_key_value("layer_z", new ConfigOptionFloat(m_writer->get_position().z() - m_config.z_offset.value)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); config.set_key_value("filament_extruder_id", new ConfigOptionInt(int(get_extruder_id(old_filament_id)))); if (!m_filament_instances_code.empty()) { @@ -7677,7 +7511,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo // If ooze prevention is enabled, park current extruder in the nearest // standby point and set it to the standby temperature. - if (m_ooze_prevention.enable && m_writer.filament() != nullptr) + if (m_ooze_prevention.enable && m_writer->filament() != nullptr) gcode += m_ooze_prevention.pre_toolchange(*this); // BBS @@ -7690,23 +7524,23 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo if (toolchange_temp_override > 0) new_filament_temp = toolchange_temp_override; - Vec3d nozzle_pos = m_writer.get_position(); + Vec3d nozzle_pos = m_writer->get_position(); float old_retract_length, old_retract_length_toolchange, wipe_volume; int old_filament_temp, old_filament_e_feedrate; float filament_area = float((M_PI / 4.f) * pow(m_config.filament_diameter.get_at(new_filament_id), 2)); //BBS: add handling for filament change in start gcode int old_filament_id = -1; - if (m_writer.filament() != nullptr || m_start_gcode_filament != -1) { + if (m_writer->filament() != nullptr || m_start_gcode_filament != -1) { std::vector flush_matrix(cast(get_flush_volumes_matrix(m_config.flush_volumes_matrix.values, new_extruder_id, m_config.nozzle_diameter.values.size()))); const unsigned int number_of_extruders = (unsigned int) (m_config.filament_colour.values.size()); // if is multi_extruder only use the fist extruder matrix - if (m_writer.filament() != nullptr) - assert(m_writer.filament()->id() < number_of_extruders); + if (m_writer->filament() != nullptr) + assert(m_writer->filament()->id() < number_of_extruders); else assert(m_start_gcode_filament < number_of_extruders); - old_filament_id = m_writer.filament() != nullptr ? m_writer.filament()->id() : m_start_gcode_filament; - int old_extruder_id = m_writer.filament() != nullptr ? m_writer.filament()->extruder_id() : get_extruder_id(m_start_gcode_filament); + old_filament_id = m_writer->filament() != nullptr ? m_writer->filament()->id() : m_start_gcode_filament; + int old_extruder_id = m_writer->filament() != nullptr ? m_writer->filament()->extruder_id() : get_extruder_id(m_start_gcode_filament); old_retract_length = m_config.retraction_length.get_at(old_filament_id); old_retract_length_toolchange = m_config.retract_length_toolchange.get_at(old_filament_id); @@ -7716,7 +7550,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo float grab_purge_volume = m_config.grab_length.get_at(new_extruder_id) * 2.4; if (old_extruder_id != new_extruder_id) { //calc flush volume between the same extruder id - int old_filament_id_in_new_extruder = m_writer.filament(new_extruder_id) != nullptr ? m_writer.filament(new_extruder_id)->id() : -1; + int old_filament_id_in_new_extruder = m_writer->filament(new_extruder_id) != nullptr ? m_writer->filament(new_extruder_id)->id() : -1; if (old_filament_id_in_new_extruder == -1) wipe_volume = 0; else { @@ -7852,13 +7686,13 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo //BBS: gcode writer doesn't know where the extruder is and whether fan speed is changed after inserting tool change gcode //Set this flag so that normal lift will be used the first time after tool change. gcode += ";_FORCE_RESUME_FAN_SPEED\n"; - m_writer.set_current_position_clear(false); + m_writer->set_current_position_clear(false); //BBS: check whether custom gcode changes the z position. Update if changed double temp_z_after_tool_change; if (GCodeProcessor::get_last_z_from_gcode(toolchange_gcode_parsed, temp_z_after_tool_change)) { - Vec3d pos = m_writer.get_position(); + Vec3d pos = m_writer->get_position(); pos(2) = temp_z_after_tool_change; - m_writer.set_position(pos); + m_writer->set_position(pos); } } } @@ -7866,13 +7700,13 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo // BBS. Reset old extruder E-value. // Keep retract length because Custom GCode will guarantee retract length be the same as toolchange if (m_config.single_extruder_multi_material) { - m_writer.reset_e(); + m_writer->reset_e(); } //BBS: don't add T[next extruder] if there is no T cmd on filament change //We inform the writer about what is happening, but we may not use the resulting gcode. - std::string toolchange_command = m_writer.toolchange(new_filament_id); - if (!custom_gcode_changes_tool(toolchange_gcode_parsed, m_writer.toolchange_prefix(), new_filament_id)) + std::string toolchange_command = m_writer->toolchange(new_filament_id); + if (!custom_gcode_changes_tool(toolchange_gcode_parsed, m_writer->toolchange_prefix(), new_filament_id)) gcode += toolchange_command; else { // user provided his own toolchange gcode, no need to do anything @@ -7883,7 +7717,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo int temp = (m_layer_index <= 0 ? m_config.nozzle_temperature_initial_layer.get_at(new_filament_id) : m_config.nozzle_temperature.get_at(new_filament_id)); - gcode += m_writer.set_temperature(temp, false); + gcode += m_writer->set_temperature(temp, false); } this->placeholder_parser().set("current_extruder", new_filament_id); @@ -7927,7 +7761,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo gcode += m_ooze_prevention.post_toolchange(*this); if (m_config.enable_pressure_advance.get_at(new_filament_id)) { - gcode += m_writer.set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); + gcode += m_writer->set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); // Orca: Adaptive PA // Reset Adaptive PA processor last PA value m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(new_filament_id)); @@ -8013,7 +7847,7 @@ Vec2d GCode::point_to_gcode(const Point &point) const Point GCode::gcode_to_point(const Vec2d &point) const { Vec2d pt = point - m_origin; - if (const Extruder *extruder = m_writer.filament(); extruder) + if (const Extruder *extruder = m_writer->filament(); extruder) // This function may be called at the very start from toolchange G-code when the extruder is not assigned yet. pt += m_config.extruder_offset.get_at(extruder->extruder_id()); return scaled(pt); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index dbec7d0315..9004f30fd3 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -4,6 +4,7 @@ #include "libslic3r.h" #include "ExPolygon.hpp" #include "GCodeWriter.hpp" +#include "BeltGCodeWriter.hpp" #include "Layer.hpp" #include "Point.hpp" #include "PlaceholderParser.hpp" @@ -206,16 +207,18 @@ public: m_last_obj_copy(nullptr, Point(std::numeric_limits::max(), std::numeric_limits::max())), // BBS m_toolchange_count(0), - m_nominal_z(0.) + m_nominal_z(0.), + m_writer(std::make_unique()) {} - ~GCode() = default; + virtual ~GCode() = default; +public: // throws std::runtime_exception on error, // throws CanceledException through print->throw_if_canceled(). void do_export(Print* print, const char* path, GCodeProcessorResult* result = nullptr, ThumbnailsGeneratorCallback thumbnail_cb = nullptr); void export_layer_filaments(GCodeProcessorResult* result); //BBS: set offset for gcode writer - void set_gcode_offset(double x, double y) { m_writer.set_xy_offset(x, y); m_processor.set_xy_offset(x, y);} + void set_gcode_offset(double x, double y) { m_writer->set_xy_offset(x, y); m_processor.set_xy_offset(x, y);} // Exported for the helper classes (OozePrevention, Wipe) and for the Perl binding for unit tests. const Vec2d& origin() const { return m_origin; } @@ -227,8 +230,8 @@ public: Vec2d point_to_gcode_quantized(const Point& point) const; const FullPrintConfig &config() const { return m_config; } const Layer* layer() const { return m_layer; } - GCodeWriter& writer() { return m_writer; } - const GCodeWriter& writer() const { return m_writer; } + GCodeWriter& writer() { return *m_writer; } + const GCodeWriter& writer() const { return *m_writer; } PlaceholderParser& placeholder_parser() { return m_placeholder_parser_integration.parser; } const PlaceholderParser& placeholder_parser() const { return m_placeholder_parser_integration.parser; } // Process a template through the placeholder parser, collect error messages to be reported @@ -248,7 +251,7 @@ public: std::string travel_to(const Point& point, ExtrusionRole role, std::string comment, double z = DBL_MAX); bool needs_retraction(const Polyline& travel, ExtrusionRole role, LiftType& lift_type); std::string retract(bool toolchange = false, bool is_last_retraction = false, LiftType lift_type = LiftType::NormalLift, bool apply_instantly = false, ExtrusionRole role = erNone); - std::string unretract() { return m_writer.unlift() + m_writer.unretract(); } + std::string unretract() { return m_writer->unlift() + m_writer->unretract(); } std::string set_extruder(unsigned int extruder_id, double print_z, bool by_object=false, int toolchange_temp_override = -1); bool is_BBL_Printer(); WipeTowerType wipe_tower_type(); @@ -300,7 +303,7 @@ public: } }; -private: +protected: class GCodeOutputStream { public: GCodeOutputStream(FILE *f, GCodeProcessor &processor) : f(f), m_processor(processor) {} @@ -328,9 +331,17 @@ private: FILE *f = nullptr; GCodeProcessor &m_processor; }; + + // Virtual hooks for belt printer subclass (BeltGCode). + // No-ops in base GCode; overridden in BeltGCode. + virtual void init_belt_writer(Print &print, bool is_bbl_printers) {} + virtual void write_belt_header(GCodeOutputStream &file, const Print &print) {} + virtual void on_set_origin(const PrintObject *obj, const Point &inst_shift) {} + virtual bool should_disable_arc_fitting() const { return false; } + void _do_export(Print &print, GCodeOutputStream &file, ThumbnailsGeneratorCallback thumbnail_cb); - static std::vector collect_layers_to_print(const PrintObject &object); + static std::vector collect_layers_to_print(const PrintObject &object, bool skip_empty_first_layer = false); static std::vector>> collect_layers_to_print(const Print &print); std::string generate_skirt(const Print &print, @@ -493,16 +504,11 @@ private: This affects the input arguments supplied to the extrude*() and travel_to() methods. */ Vec2d m_origin; - // Per-axis origin snap: shift G-code so each object's bbox min = offset. - bool m_origin_snap[3] = {false, false, false}; - double m_origin_snap_offset[3] = {0., 0., 0.}; - // Called when switching instances to recompute the writer's snap for this instance. - void update_origin_snap(const PrintObject *obj, const Point &inst_shift); FullPrintConfig m_config; DynamicConfig m_calib_config; // scaled G-code resolution double m_scaled_resolution; - GCodeWriter m_writer; + std::unique_ptr m_writer; struct PlaceholderParserIntegration { void reset(); diff --git a/src/libslic3r/GCode/BeltBackTransform.cpp b/src/libslic3r/GCode/BeltBackTransform.cpp index 7cd5bc6b53..2e2cd26f75 100644 --- a/src/libslic3r/GCode/BeltBackTransform.cpp +++ b/src/libslic3r/GCode/BeltBackTransform.cpp @@ -1,40 +1,8 @@ #include "BeltBackTransform.hpp" -#include "../Geometry.hpp" -#include +#include "../BeltTransform.hpp" namespace Slic3r { -// Keep in sync with PrintObjectSlice.cpp compute_shear_factor (lines ~147-157). -static double compute_shear_factor(BeltShearMode mode, double angle_deg) -{ - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } -} - -// Keep in sync with PrintObjectSlice.cpp compute_scale_factor (lines ~180-192). -static double compute_scale_factor(BeltScaleMode mode, double angle_deg) -{ - if (mode == BeltScaleMode::None) return 1.; - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; - case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; - case BeltScaleMode::Sin: return sin_a; - case BeltScaleMode::Cos: return cos_a; - default: return 1.; - } -} - bool BeltBackTransform::init_from_config(const PrintConfig &config) { m_active = false; @@ -43,99 +11,19 @@ bool BeltBackTransform::init_from_config(const PrintConfig &config) if (!config.belt_printer.value || !config.belt_gcode_back_transform.value) return false; - // --- Pre-slice axis remap (same as PrintObjectSlice.cpp) --- - int pre_rx = int(config.belt_preslice_remap_x.value); - int pre_ry = int(config.belt_preslice_remap_y.value); - int pre_rz = int(config.belt_preslice_remap_z.value); - - bool has_preslice_remap = (pre_rx != int(BeltRemapAxis::PosX) || - pre_ry != int(BeltRemapAxis::PosY) || - pre_rz != int(BeltRemapAxis::PosZ)); - // Require at least one active transform to proceed. bool has_global_shear = config.belt_shear_x_global.value || config.belt_shear_y_global.value || config.belt_shear_z_global.value; - if (!has_global_shear && !has_preslice_remap) + if (!has_global_shear && !BeltTransformPipeline::has_preslice_remap(config)) return false; - // Build pre-slice remap matrix. - Transform3d pre_remap = Transform3d::Identity(); - if (has_preslice_remap) { - auto remap_column = [](int r) -> Vec3d { - int axis = r % 3; - Vec3d col = Vec3d::Zero(); - if (r < 3) col[axis] = 1.0; - else if (r < 6) col[axis] = -1.0; - else col[axis] = -1.0; // Rev: max - pos - return col; - }; - - Matrix3d remap_lin; - remap_lin.col(0) = remap_column(pre_rx); - remap_lin.col(1) = remap_column(pre_ry); - remap_lin.col(2) = remap_column(pre_rz); - pre_remap.linear() = remap_lin; - - // Rev mode translation (needs build volume extents). - Vec3d remap_trans = Vec3d::Zero(); - if (pre_rx >= 6 || pre_ry >= 6 || pre_rz >= 6) { - BoundingBoxf bbox_bed(config.printable_area.values); - Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), - config.printable_height.value); - auto add_rev = [&](int r, int out) { - if (r >= 6) remap_trans[out] = vol_max[r % 3]; - }; - add_rev(pre_rx, 0); - add_rev(pre_ry, 1); - add_rev(pre_rz, 2); - } - pre_remap.translation() = remap_trans; - } - - // Build per-axis shear matrix (same as PrintObjectSlice.cpp). - struct AxisShear { BeltShearMode mode; double angle; int from; }; - AxisShear axes[3] = { - { config.belt_shear_x.value, config.belt_shear_x_angle.value, int(config.belt_shear_x_from.value) }, - { config.belt_shear_y.value, config.belt_shear_y_angle.value, int(config.belt_shear_y_from.value) }, - { config.belt_shear_z.value, config.belt_shear_z_angle.value, int(config.belt_shear_z_from.value) }, - }; - - Matrix3d shear = Matrix3d::Identity(); - bool has_shear = false; - for (int row = 0; row < 3; ++row) { - if (axes[row].mode != BeltShearMode::None) { - double factor = compute_shear_factor(axes[row].mode, axes[row].angle); - if (std::abs(factor) > EPSILON) { - shear(row, axes[row].from) += factor; - has_shear = true; - } - } - } - - // Build per-axis scale diagonal matrix (same as PrintObjectSlice.cpp). - double sx = compute_scale_factor(config.belt_scale_x.value, config.belt_scale_x_angle.value); - double sy = compute_scale_factor(config.belt_scale_y.value, config.belt_scale_y_angle.value); - double sz = compute_scale_factor(config.belt_scale_z.value, config.belt_scale_z_angle.value); - - Matrix3d scale = Matrix3d::Identity(); - bool has_scale = (std::abs(sx - 1.) > EPSILON || - std::abs(sy - 1.) > EPSILON || - std::abs(sz - 1.) > EPSILON); - if (has_scale) { - scale(0, 0) = sx; - scale(1, 1) = sy; - scale(2, 2) = sz; - } - - if (!has_shear && !has_scale && !has_preslice_remap) + // Build the forward pipeline (scale * shear * pre_remap) and store its inverse. + Transform3d forward = BeltTransformPipeline::build_forward_transform(config); + if (forward.isApprox(Transform3d::Identity())) return false; - // Forward pipeline: scale * shear * pre_remap (same order as PrintObjectSlice.cpp). - Transform3d combined = Transform3d::Identity(); - combined.linear() = scale * shear; - combined = combined * pre_remap; - m_inverse = combined.inverse(); + m_inverse = forward.inverse(); m_active = true; return true; } diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index b5a6402a14..51f82ea009 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -20,59 +20,6 @@ namespace Slic3r { bool GCodeWriter::full_gcode_comment = true; -void GCodeWriter::set_belt_angle(double angle_deg) -{ - m_belt_angle_rad = Geometry::deg2rad(angle_deg); -} - -void GCodeWriter::set_axis_remap(int rx, int ry, int rz) -{ - m_remap_x = rx; - m_remap_y = ry; - m_remap_z = rz; -} - -void GCodeWriter::set_build_volume_max(const Vec3d &max) -{ - m_build_vol_max = max; -} - -void GCodeWriter::set_belt_back_transform(const PrintConfig &config) -{ - m_belt_back_transform.init_from_config(config); -} - -void GCodeWriter::set_origin_snap(int axis, bool enable, double offset, double bbox_min) -{ - if (axis >= 0 && axis < 3) { - m_origin_snap[axis] = enable; - m_origin_offset[axis] = offset; - m_origin_bbox_min[axis] = bbox_min; - } -} - -Vec3d GCodeWriter::to_machine_coords(const Vec3d &pos) const -{ - if (!is_belt_printer()) - return pos; - // Step 1: Undo the shear/scale applied during slicing. - Vec3d p = m_belt_back_transform.apply(pos); - // Step 2: Apply axis remapping for the machine's coordinate convention. - // BeltRemapAxis: 0-2 = +X/+Y/+Z, 3-5 = -X/-Y/-Z, 6-8 = Rev X/Y/Z - auto remap = [this, &p](int r) -> double { - int axis = r % 3; - if (r < 3) return p[axis]; - if (r < 6) return -p[axis]; - return m_build_vol_max[axis] - p[axis]; - }; - Vec3d result = { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; - // Per-axis origin snap: shift so bbox min on each enabled axis = offset. - for (int i = 0; i < 3; ++i) - if (m_origin_snap[i]) - result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); - return result; -} - bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) { return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware); @@ -615,13 +562,7 @@ std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &com Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - if (is_belt_printer()) { - // Belt printer: transform to machine coordinates (XY travel also needs Z due to YZ rotation) - Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); - w.emit_xyz(machine); - } else { - w.emit_xy(point_on_plate); - } + w.emit_xy(point_on_plate); auto speed = m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; w.emit_f(speed * 60.0); @@ -635,11 +576,6 @@ it will not perform subsequent lifts, even if Z was raised manually (i.e. with travel_to_z()) and thus _lifted was reduced. */ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) { - // Belt printer: force NormalLift since SpiralLift and SlopeLift compute slope angles - // that don't account for the YZ coordinate rotation. - if (is_belt_printer()) - lift_type = LiftType::NormalLift; - // check whether the above/below conditions are met double target_lift = 0; { @@ -668,8 +604,7 @@ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) // BBS: immediately execute an undelayed lift move with a spiral lift pattern // designed specifically for subsequent gcode injection (e.g. timelapse) std::string GCodeWriter::eager_lift(const LiftType type) { - // Belt printer: force NormalLift (SpiralLift/SlopeLift don't account for YZ rotation). - const LiftType effective_type = is_belt_printer() ? LiftType::NormalLift : type; + const LiftType effective_type = type; std::string lift_move; double target_lift = 0; { @@ -756,8 +691,6 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co // / to make the z list early to avoid to hit some warping place when travel is long. Vec2d temp = delta_no_z.normalized() * delta(2) / tan(this->filament()->travel_slope()); Vec3d slope_top_point = Vec3d(temp(0), temp(1), delta(2)) + source; - if (is_belt_printer()) - slope_top_point = to_machine_coords(slope_top_point); GCodeG1Formatter w0; w0.emit_xyz(slope_top_point); w0.emit_f(travel_speed * 60.0); @@ -772,27 +705,18 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co std::string xy_z_move; { - Vec3d emit_target = is_belt_printer() ? to_machine_coords(target) : target; GCodeG1Formatter w0; if (this->is_current_position_clear()) { - w0.emit_xyz(emit_target); + w0.emit_xyz(target); w0.emit_f(travel_speed * 60.0); w0.emit_comment(GCodeWriter::full_gcode_comment, comment); xy_z_move = w0.string(); } else { - if (is_belt_printer()) { - // Belt mode: can't split XY and Z moves independently, emit full XYZ - w0.emit_xyz(emit_target); - w0.emit_f(travel_speed * 60.0); - w0.emit_comment(GCodeWriter::full_gcode_comment, comment); - xy_z_move = w0.string(); - } else { - w0.emit_xy(Vec2d(target.x(), target.y())); - w0.emit_f(travel_speed * 60.0); - w0.emit_comment(GCodeWriter::full_gcode_comment, comment); - xy_z_move = w0.string() + _travel_to_z(target.z(), comment); - } + w0.emit_xy(Vec2d(target.x(), target.y())); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + xy_z_move = w0.string() + _travel_to_z(target.z(), comment); } } m_pos = dest_point; @@ -818,25 +742,15 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co //BBS: take plate offset into consider Vec3d point_on_plate = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; - if (is_belt_printer()) - point_on_plate = to_machine_coords(point_on_plate); std::string out_string; GCodeG1Formatter w; if (!this->is_current_position_clear()) { - if (is_belt_printer()) { - // Belt mode: emit full XYZ since Y and Z are coupled - w.emit_xyz(point_on_plate); - w.emit_f(this->config.travel_speed.value * 60.0); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - out_string = w.string(); - } else { - //force to move xy first then z after filament change - w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); - w.emit_f(this->config.travel_speed.value * 60.0); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - out_string = w.string() + _travel_to_z(point_on_plate.z(), comment); - } + //force to move xy first then z after filament change + w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); + w.emit_f(this->config.travel_speed.value * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + out_string = w.string() + _travel_to_z(point_on_plate.z(), comment); } else { GCodeG1Formatter w; w.emit_xyz(point_on_plate); @@ -880,13 +794,7 @@ std::string GCodeWriter::_travel_to_z(double z, const std::string &comment) } GCodeG1Formatter w; - if (is_belt_printer()) { - // Belt printer: a Z-only move in slicing frame needs to emit both Y and Z in machine coords. - Vec3d machine = to_machine_coords(Vec3d(m_pos.x() - m_x_offset, m_pos.y() - m_y_offset, z)); - w.emit_xyz(machine); - } else { - w.emit_z(z); - } + w.emit_z(z); w.emit_f(speed * 60.0); //BBS w.emit_comment(GCodeWriter::full_gcode_comment, comment); @@ -991,12 +899,7 @@ std::string GCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std: Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - if (is_belt_printer()) { - Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); - w.emit_xyz(machine); - } else { - w.emit_xy(point_on_plate); - } + w.emit_xy(point_on_plate); if (!force_no_extrusion) w.emit_e(filament()->E()); //BBS @@ -1037,8 +940,6 @@ std::string GCodeWriter::extrude_to_xyz(const Vec3d &point, double dE, const std Vec3d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset, point(2) }; GCodeG1Formatter w; - if (is_belt_printer()) - point_on_plate = to_machine_coords(point_on_plate); w.emit_xyz(point_on_plate); if (!force_no_extrusion) w.emit_e(filament()->E()); diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 2334f5d416..c96c3ca2c1 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -8,12 +8,11 @@ #include "Point.hpp" #include "PrintConfig.hpp" #include "GCode/CoolingBuffer.hpp" -#include "GCode/BeltBackTransform.hpp" - namespace Slic3r { class GCodeWriter { public: + virtual ~GCodeWriter() = default; GCodeConfig config; bool multiple_extruders; @@ -74,21 +73,21 @@ public: std::string set_speed(double F, const std::string &comment = std::string(), const std::string &cooling_marker = std::string()); // SoftFever NOTE: the returned speed is mm/minute double get_current_speed() const { return m_current_speed;} - std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string()); - std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false); + virtual std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string()); + virtual std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false); std::string travel_to_z(double z, const std::string &comment = std::string(), bool force = false); bool will_move_z(double z) const; - std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); + virtual std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); //BBS: generate G2 or G3 extrude which moves by arc std::string extrude_arc_to_xy(const Vec2d &point, const Vec2d ¢er_offset, double dE, const bool is_ccw, const std::string &comment = std::string(), bool force_no_extrusion = false); - std::string extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); + virtual std::string extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); std::string retract(bool before_wipe = false, double retract_length = 0); std::string retract_for_toolchange(bool before_wipe = false, double retract_length = 0); std::string unretract(); // do lift instantly - std::string eager_lift(const LiftType type); + virtual std::string eager_lift(const LiftType type); // record a lift request, do realy lift in next travel - std::string lazy_lift(LiftType lift_type = LiftType::NormalLift, bool spiral_vase = false); + virtual std::string lazy_lift(LiftType lift_type = LiftType::NormalLift, bool spiral_vase = false); std::string unlift(); const Vec3d& get_position() const { return m_pos; } Vec3d& get_position() { return m_pos; } @@ -126,23 +125,23 @@ public: void set_is_first_layer(bool bval) { m_is_first_layer = bval; } GCodeFlavor get_gcode_flavor() const { return config.gcode_flavor; } - // Belt printer: set the belt angle and precompute sin/cos for coordinate transformation. - void set_belt_angle(double angle_deg); - bool is_belt_printer() const { return m_belt_angle_rad != 0.; } - // Set axis remap for G-code output (BeltRemapAxis enum values). - void set_axis_remap(int rx, int ry, int rz); - // Set build volume extents for Rev remap mode (max X, Y, Z). - void set_build_volume_max(const Vec3d &max); - // Initialize the belt back-transform that undoes slicing shear/scale. - void set_belt_back_transform(const PrintConfig &config); - // Set per-axis origin snap: shifts G-code so bbox min on this axis = offset. - void set_origin_snap(int axis, bool enable, double offset, double bbox_min); - // Transform a point from the slicing frame to machine coordinates. - Vec3d to_machine_coords(const Vec3d &pos) const; - // Returns whether this flavor supports separate print and travel acceleration. static bool supports_separate_travel_acceleration(GCodeFlavor flavor); - private: +protected: + // Position/lift/offset state — accessible to subclasses (e.g. BeltGCodeWriter) + Vec3d m_pos = Vec3d::Zero(); + double m_x_offset{ 0 }; + double m_y_offset{ 0 }; + double m_lifted; + double m_to_lift; + LiftType m_to_lift_type; + bool m_is_first_layer = true; + bool m_is_current_pos_clear = false; + double m_current_speed; + + virtual std::string _travel_to_z(double z, const std::string &comment); + +private: // Extruders are sorted by their ID, so that binary search is possible. std::vector m_filament_extruders; bool m_single_extruder_multi_material; @@ -170,48 +169,21 @@ public: unsigned int m_last_additional_fan_speed; int m_last_bed_temperature; bool m_last_bed_temperature_reached; - double m_lifted; - - // BBS - double m_to_lift; - LiftType m_to_lift_type; - Vec3d m_pos = Vec3d::Zero(); - //BBS: this flag is used to indicate whether the m_pos is real. - //A example that of the first move, the m_pos is zero, but the real position of extruder doesn't - //Pos must be clear after the first xyz travel move - bool m_is_current_pos_clear = false; - //BBS: x, y offset for gcode generated - double m_x_offset{ 0 }; - double m_y_offset{ 0 }; // Orca: slicing resolution in mm double m_resolution = 0.01; - + std::string m_gcode_label_objects_start; std::string m_gcode_label_objects_end; //SoftFever bool m_is_bbl_printers = false; - // Belt printer state - double m_belt_angle_rad = 0.; - int m_remap_x = 0; - int m_remap_y = 1; - int m_remap_z = 2; - Vec3d m_build_vol_max = Vec3d::Zero(); - BeltBackTransform m_belt_back_transform; - bool m_origin_snap[3] = {false, false, false}; - double m_origin_offset[3] = {0., 0., 0.}; // target coord for bbox min - double m_origin_bbox_min[3] = {0., 0., 0.}; // computed bbox min in machine space - double m_current_speed; - bool m_is_first_layer = true; - enum class Acceleration { Travel, Print }; - std::string _travel_to_z(double z, const std::string &comment); std::string _spiral_travel_to_z(double z, const Vec2d &ij_offset, const std::string &comment); std::string _retract(double length, double restart_extra, const std::string &comment); std::string set_acceleration_internal(Acceleration type, unsigned int acceleration); diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 0b7190e8d1..1f787a70cf 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -12,6 +12,7 @@ #include "Thread.hpp" #include "Time.hpp" #include "GCode.hpp" +#include "BeltGCode.hpp" #include "GCode/WipeTower.hpp" #include "GCode/WipeTower2.hpp" #include "Utils.hpp" @@ -2551,12 +2552,17 @@ std::string Print::export_gcode(const std::string& path_template, GCodeProcessor this->set_status(80, message); // The following line may die for multiple reasons. - GCode gcode; + // Factory: use BeltGCode for belt printers, plain GCode otherwise. + std::unique_ptr gcode; + if (m_config.belt_printer.value) + gcode = std::make_unique(); + else + gcode = std::make_unique(); //BBS: compute plate offset for gcode-generator const Vec3d origin = this->get_plate_origin(); - gcode.set_gcode_offset(origin(0), origin(1)); - gcode.do_export(this, path.c_str(), result, thumbnail_cb); - gcode.export_layer_filaments(result); + gcode->set_gcode_offset(origin(0), origin(1)); + gcode->do_export(this, path.c_str(), result, thumbnail_cb); + gcode->export_layer_filaments(result); //BBS result->conflict_result = m_conflict_result; return path.c_str(); diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index c13a1407c0..9a5d000e1c 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -17,6 +17,7 @@ #include "GCode/ThumbnailData.hpp" #include "GCode/GCodeProcessor.hpp" #include "MultiMaterialSegmentation.hpp" +#include "BeltTransform.hpp" #include "libslic3r.h" #include @@ -190,30 +191,7 @@ class ConstSupportLayerPtrsAdaptor : public ConstVectorOfPtrsAdaptor double { - int axis = r % 3; - if (r < 3) return v[axis]; - return -v[axis]; - }; - Vec3d mn = bb.min.cast(), mx = bb.max.cast(); - BoundingBoxf3 rbb; - for (int i = 0; i < 8; ++i) { - Vec3d c((i & 1) ? mx.x() : mn.x(), - (i & 2) ? mx.y() : mn.y(), - (i & 4) ? mx.z() : mn.z()); - Vec3d rc(remap_coord(pre_rx, c), remap_coord(pre_ry, c), remap_coord(pre_rz, c)); - if (i == 0) rbb = BoundingBoxf3(rc, rc); - else rbb.merge(rc); - } - return rbb; + return BeltTransformPipeline::remap_bbox(model_object, config); } // Single instance of a PrintObject. diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index ba2ed408ce..be65c21c59 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1,5 +1,6 @@ #include "Exception.hpp" #include "Print.hpp" +#include "BeltTransform.hpp" #include "BoundingBox.hpp" #include "ClipperUtils.hpp" #include "ElephantFootCompensation.hpp" @@ -3398,76 +3399,22 @@ void PrintObject::update_slicing_parameters() // Orca: updated function call for XYZ shrinkage compensation if (!m_slicing_params.valid) { coordf_t object_height = this->model_object()->max_z(); - // Belt floor parameters for support clipping (populated below if belt Z-shear is active). - double belt_floor_shear_factor_out = 0.0; - int belt_floor_from_axis_out = 1; - double belt_floor_z_shift_out = 0.0; - // Belt shear/scale/pre-remap may change the effective Z height. + BeltTransformPipeline::BeltFloorParams belt_floor; const auto &pcfg = this->print()->config(); if (pcfg.belt_printer.value) { - BoundingBoxf3 bb = belt_remapped_bbox(*this->model_object(), pcfg); - bool has_preslice_remap = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || - int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || - int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); - if (has_preslice_remap) + BoundingBoxf3 bb = BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg); + if (BeltTransformPipeline::has_preslice_remap(pcfg)) object_height = bb.size().z(); - - bool has_z_shear = pcfg.belt_shear_z.value != BeltShearMode::None; - bool has_z_scale = pcfg.belt_scale_z.value != BeltScaleMode::None; - if (has_z_shear || has_z_scale) { - auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } - }; - auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { - if (mode == BeltScaleMode::None) return 1.; - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); - switch (mode) { - case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; - case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; - case BeltScaleMode::Sin: return sin_a; - case BeltScaleMode::Cos: return cos_a; - default: return 1.; - } - }; - double shear_factor = has_z_shear ? compute_shear_factor(pcfg.belt_shear_z.value, pcfg.belt_shear_z_angle.value) : 0.; - double scale_z = compute_scale_factor(pcfg.belt_scale_z.value, pcfg.belt_scale_z_angle.value); - if (has_z_shear && std::abs(shear_factor) > EPSILON) { - int from = int(pcfg.belt_shear_z_from.value); - double min_rz = std::numeric_limits::max(); - double max_rz = std::numeric_limits::lowest(); - for (double vz : {bb.min.z(), bb.max.z()}) - for (double vs : {bb.min(from), bb.max(from)}) { - double new_z = scale_z * (vz + shear_factor * vs); - min_rz = std::min(min_rz, new_z); - max_rz = std::max(max_rz, new_z); - } - object_height = max_rz - min_rz; - belt_floor_shear_factor_out = shear_factor; - belt_floor_from_axis_out = from; - // Belt contact surface starts at bb.min.z() pre-shear; add the - // slicing Z-shift that keeps the mesh above Z=0. - // Exact value is patched after slice_volumes() in posSlice. - belt_floor_z_shift_out = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); - } else { - object_height *= scale_z; - } - } + auto hr = BeltTransformPipeline::compute_belt_height_and_floor(pcfg, bb, object_height); + object_height = hr.object_height; + belt_floor = hr.floor_params; } m_slicing_params = SlicingParameters::create_from_config(pcfg, m_config, object_height, this->object_extruders(), this->print()->shrinkage_compensation()); // Populate belt floor parameters into slicing params for support clipping. - m_slicing_params.belt_floor_shear_factor = belt_floor_shear_factor_out; - m_slicing_params.belt_floor_from_axis = belt_floor_from_axis_out; - m_slicing_params.belt_floor_z_shift = belt_floor_z_shift_out; + m_slicing_params.belt_floor_shear_factor = belt_floor.shear_factor; + m_slicing_params.belt_floor_from_axis = belt_floor.from_axis; + m_slicing_params.belt_floor_z_shift = belt_floor.z_shift; } } @@ -3505,75 +3452,23 @@ SlicingParameters PrintObject::slicing_parameters(const DynamicPrintConfig &full sort_remove_duplicates(object_extruders); //FIXME add painting extruders - // Belt floor parameters for support clipping (populated below if belt Z-shear is active). - double belt_floor_shear_factor_out = 0.0; - int belt_floor_from_axis_out = 1; - double belt_floor_z_shift_out = 0.0; - + BeltTransformPipeline::BeltFloorParams belt_floor; if (object_max_z <= 0.f) { BoundingBoxf3 bb = model_object.raw_bounding_box(); object_max_z = (float)bb.size().z(); - // Belt pre-remap/shear/scale may change the effective Z height. if (print_config.belt_printer.value) { - bb = belt_remapped_bbox(model_object, print_config); - bool has_preslice_remap = (int(print_config.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || - int(print_config.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || - int(print_config.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); - if (has_preslice_remap) + bb = BeltTransformPipeline::remap_bbox(model_object, print_config); + if (BeltTransformPipeline::has_preslice_remap(print_config)) object_max_z = (float)bb.size().z(); - - bool has_z_shear = print_config.belt_shear_z.value != BeltShearMode::None; - bool has_z_scale = print_config.belt_scale_z.value != BeltScaleMode::None; - if (has_z_shear || has_z_scale) { - auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } - }; - auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { - if (mode == BeltScaleMode::None) return 1.; - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); - switch (mode) { - case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; - case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; - case BeltScaleMode::Sin: return sin_a; - case BeltScaleMode::Cos: return cos_a; - default: return 1.; - } - }; - double shear_factor = has_z_shear ? compute_shear_factor(print_config.belt_shear_z.value, print_config.belt_shear_z_angle.value) : 0.; - double scale_z = compute_scale_factor(print_config.belt_scale_z.value, print_config.belt_scale_z_angle.value); - if (has_z_shear && std::abs(shear_factor) > EPSILON) { - int from = int(print_config.belt_shear_z_from.value); - double min_rz = std::numeric_limits::max(); - double max_rz = std::numeric_limits::lowest(); - for (double vz : {bb.min.z(), bb.max.z()}) - for (double vs : {bb.min(from), bb.max(from)}) { - double new_z = scale_z * (vz + shear_factor * vs); - min_rz = std::min(min_rz, new_z); - max_rz = std::max(max_rz, new_z); - } - object_max_z = (float)(max_rz - min_rz); - belt_floor_shear_factor_out = shear_factor; - belt_floor_from_axis_out = from; - belt_floor_z_shift_out = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); - } else { - object_max_z *= (float)scale_z; - } - } + auto hr = BeltTransformPipeline::compute_belt_height_and_floor(print_config, bb, object_max_z); + object_max_z = (float)hr.object_height; + belt_floor = hr.floor_params; } } SlicingParameters params = SlicingParameters::create_from_config(print_config, object_config, object_max_z, object_extruders, object_shrinkage_compensation); - params.belt_floor_shear_factor = belt_floor_shear_factor_out; - params.belt_floor_from_axis = belt_floor_from_axis_out; - params.belt_floor_z_shift = belt_floor_z_shift_out; + params.belt_floor_shear_factor = belt_floor.shear_factor; + params.belt_floor_from_axis = belt_floor.from_axis; + params.belt_floor_z_shift = belt_floor.z_shift; return params; } diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 4c767ea0ed..3067772f09 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -9,6 +9,8 @@ #include "Layer.hpp" #include "MultiMaterialSegmentation.hpp" #include "Print.hpp" +#include "BeltTransform.hpp" +#include "BeltSliceStrategy.hpp" #include "Geometry.hpp" //BBS #include "ShortestPath.hpp" @@ -142,147 +144,11 @@ static std::vector slice_volumes_inner( params_base.closing_radius = print_object_config.slice_closing_radius.value; params_base.extra_offset = 0; params_base.trafo = object_trafo; - if (print_config.belt_printer.value) { - // --- Pre-slice axis remap --- - // Permutes/negates model axes before slicing so the slicer's coordinate - // system matches the physical bed orientation (e.g. XZ bed instead of XY). - int pre_rx = int(print_config.belt_preslice_remap_x.value); - int pre_ry = int(print_config.belt_preslice_remap_y.value); - int pre_rz = int(print_config.belt_preslice_remap_z.value); - - bool has_preslice_remap = (pre_rx != int(BeltRemapAxis::PosX) || - pre_ry != int(BeltRemapAxis::PosY) || - pre_rz != int(BeltRemapAxis::PosZ)); - - if (has_preslice_remap) { - // Build volume extents for Rev mode. - BoundingBoxf bbox_bed(print_config.printable_area.values); - Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), - print_config.printable_height.value); - - // Each remap value selects a source axis and sign. - // The column vector tells the matrix which input axis feeds this output. - auto remap_column = [](int r) -> Vec3d { - int axis = r % 3; - Vec3d col = Vec3d::Zero(); - if (r < 3) col[axis] = 1.0; // +axis - else if (r < 6) col[axis] = -1.0; // -axis - else col[axis] = -1.0; // Rev: max - pos = -(pos - max) - return col; - }; - - Matrix3d remap_lin; - remap_lin.col(0) = remap_column(pre_rx); - remap_lin.col(1) = remap_column(pre_ry); - remap_lin.col(2) = remap_column(pre_rz); - - // Translation for Rev modes: output = max[src] - input[src]. - Vec3d remap_trans = Vec3d::Zero(); - auto add_rev_offset = [&](int r, int out_axis) { - if (r >= 6) { - int src_axis = r % 3; - remap_trans[out_axis] = vol_max[src_axis]; - } - }; - add_rev_offset(pre_rx, 0); - add_rev_offset(pre_ry, 1); - add_rev_offset(pre_rz, 2); - - Transform3d pre_remap = Transform3d::Identity(); - pre_remap.linear() = remap_lin; - pre_remap.translation() = remap_trans; - - params_base.trafo = pre_remap * params_base.trafo; - } - - // Build per-axis shear matrix from 3 independent axis configs. - auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } - }; - - struct AxisShear { BeltShearMode mode; double angle; int from; }; - AxisShear axes[3] = { - { print_config.belt_shear_x.value, print_config.belt_shear_x_angle.value, int(print_config.belt_shear_x_from.value) }, - { print_config.belt_shear_y.value, print_config.belt_shear_y_angle.value, int(print_config.belt_shear_y_from.value) }, - { print_config.belt_shear_z.value, print_config.belt_shear_z_angle.value, int(print_config.belt_shear_z_from.value) }, - }; - - Transform3d belt_shear = Transform3d::Identity(); - bool has_shear = false; - for (int row = 0; row < 3; ++row) { - if (axes[row].mode != BeltShearMode::None) { - double factor = compute_shear_factor(axes[row].mode, axes[row].angle); - if (std::abs(factor) > EPSILON) { - belt_shear.matrix()(row, axes[row].from) += factor; - has_shear = true; - } - } - } - - // Build per-axis scale matrix. - auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { - if (mode == BeltScaleMode::None) return 1.; - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; - case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; - case BeltScaleMode::Sin: return sin_a; - case BeltScaleMode::Cos: return cos_a; - default: return 1.; - } - }; - - Transform3d belt_scale = Transform3d::Identity(); - bool has_scale = false; - double sx = compute_scale_factor(print_config.belt_scale_x.value, print_config.belt_scale_x_angle.value); - double sy = compute_scale_factor(print_config.belt_scale_y.value, print_config.belt_scale_y_angle.value); - double sz = compute_scale_factor(print_config.belt_scale_z.value, print_config.belt_scale_z_angle.value); - if (std::abs(sx - 1.) > EPSILON || std::abs(sy - 1.) > EPSILON || std::abs(sz - 1.) > EPSILON) { - belt_scale.matrix()(0, 0) = sx; - belt_scale.matrix()(1, 1) = sy; - belt_scale.matrix()(2, 2) = sz; - has_scale = true; - } - - // Apply: scale * shear * trafo (shear first, then scale). - if (has_shear || has_scale) - params_base.trafo = belt_scale * belt_shear * params_base.trafo; - - // After pre-remap/shear/scale, the mesh may clip through the build - // plate (Z < 0). Detect this and shift the mesh up along slicer Z. - if (has_preslice_remap || has_shear || has_scale) { - Transform3d combined = params_base.trafo; - double min_z = std::numeric_limits::max(); - for (const ModelVolume *mv : model_volumes) { - if (!mv->is_model_part()) continue; - for (const stl_vertex &v : mv->mesh().its.vertices) { - Vec3d pt = combined * v.cast(); - min_z = std::min(min_z, pt.z()); - } - } - double belt_z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; - BOOST_LOG_TRIVIAL(warning) << "Belt Z-shift: min_z=" << min_z - << " z_shift=" << belt_z_shift_val - << " trafo_z=" << object_trafo.matrix()(2, 3); - if (belt_z_shift_val > 0.) { - Transform3d z_shift = Transform3d::Identity(); - z_shift.matrix()(2, 3) = belt_z_shift_val; - params_base.trafo = z_shift * params_base.trafo; - } - if (out_belt_min_z) - *out_belt_min_z = (min_z != std::numeric_limits::max()) ? min_z : 0.; - } + { + // Belt printer: apply pre-slice transforms (remap, shear, scale, z-shift) via strategy. + auto belt_strategy = BeltSliceStrategy::create(print_config); + if (belt_strategy) + belt_strategy->apply_to_trafo(params_base.trafo, model_volumes, out_belt_min_z); } //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. @@ -968,11 +834,8 @@ void PrintObject::slice() // Without pre-remap, the belt surface IS at Z=0 and bb.min.z() is // already folded into m_belt_min_z, so use 0. const auto &pcfg = this->print()->config(); - bool has_preslice_remap = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || - int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || - int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); - double belt_surface_z = has_preslice_remap - ? belt_remapped_bbox(*this->model_object(), pcfg).min.z() : 0.; + double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) + ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; m_slicing_params.belt_floor_z_shift = belt_surface_z + z_shift_val; } @@ -1025,18 +888,6 @@ void PrintObject::slice() << " belt_shear_z_global=" << pcfg.belt_shear_z_global.value << " object=" << this->model_object()->name; if (pcfg.belt_printer.value) { - auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } - }; Point inst_shift = this->instances().empty() ? Point(0, 0) : this->instances().front().shift - this->center_offset(); @@ -1058,7 +909,7 @@ void PrintObject::slice() // PrintObjects so the lowest-positioned object stays at Z=0. const auto &za = gaxes[2]; // Z row if (za.global && za.mode != BeltShearMode::None && za.from < 2) { - double factor = compute_shear_factor(za.mode, za.angle); + double factor = BeltTransformPipeline::compute_shear_factor(za.mode, za.angle); // The global Z offset accounts for the instance's position- // dependent shear contribution. m_belt_min_z is the minimum Z // of the mesh after pre_remap + shear + trafo_centered, which @@ -1066,12 +917,8 @@ void PrintObject::slice() // Subtract the belt surface's centered Z position so we get // only the shear-induced contribution (same correction as the // belt_floor_z_shift fix). - // Same pre-remap guard as belt_floor_z_shift above. - bool has_preslice_remap2 = (int(pcfg.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || - int(pcfg.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || - int(pcfg.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ)); - double belt_surface_z = has_preslice_remap2 - ? belt_remapped_bbox(*this->model_object(), this->print()->config()).min.z() : 0.; + double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) + ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; double shear_min_z = m_belt_min_z - belt_surface_z; Point phys = inst_shift; // already has center_offset subtracted double center_on_axis = (za.from == 0) ? unscale(phys.x()) : unscale(phys.y()); diff --git a/src/libslic3r/Support/BeltFloorContext.cpp b/src/libslic3r/Support/BeltFloorContext.cpp new file mode 100644 index 0000000000..d2ffcfd397 --- /dev/null +++ b/src/libslic3r/Support/BeltFloorContext.cpp @@ -0,0 +1,124 @@ +#include "BeltFloorContext.hpp" + +#include +#include + +namespace Slic3r { + +bool BeltFloorContext::init(const SlicingParameters &sp, const PrintConfig &pcfg) +{ + m_active = false; + m_shear_factor = sp.belt_floor_shear_factor; + m_from_axis = sp.belt_floor_from_axis; + m_z_shift = sp.belt_floor_z_shift; + m_floor_offset = pcfg.belt_support_floor_offset.value; + + if (std::abs(m_shear_factor) < EPSILON) + return false; + + m_active = true; + return true; +} + +bool BeltFloorContext::init_local(const SlicingParameters &sp, const PrintConfig &pcfg, + double global_z_offset) +{ + if (!init(sp, pcfg)) + return false; + // Local Z: subtract the global Z offset so polygon computation + // works in the object's local coordinate space. + m_z_shift -= global_z_offset; + return true; +} + +Polygons BeltFloorContext::surface_polygon(coordf_t print_z) const +{ + return half_plane(print_z, /*belt_surface=*/true); +} + +Polygons BeltFloorContext::valid_region_polygon(coordf_t print_z) const +{ + return half_plane(print_z, /*belt_surface=*/false); +} + +double BeltFloorContext::floor_print_z(const Point &pos_slicing) const +{ + if (!m_active) + return -std::numeric_limits::infinity(); + double pos = unscale(m_from_axis == 0 ? pos_slicing.x() : pos_slicing.y()); + return m_shear_factor * pos + m_floor_offset + m_z_shift; +} + +std::vector BeltFloorContext::compute_per_layer_floors( + size_t num_layers, + const std::function &layer_print_z) const +{ + std::vector result(num_layers); + if (!m_active) + return result; + for (size_t i = 0; i < num_layers; ++i) + result[i] = surface_polygon(layer_print_z(i)); + return result; +} + +Polygons BeltFloorContext::half_plane(coordf_t print_z, bool belt_surface) const +{ + if (!m_active) + return {}; + + const double cutoff = (print_z - m_z_shift - m_floor_offset) / m_shear_factor; + const coord_t cutoff_scaled = scale_(cutoff); + const coord_t large_bound = scale_(1e3); + + // The belt surface is on one side of the cutoff line; the valid region + // is on the other side. Which side depends on shear_factor sign. + // + // belt_surface=true → the belt side (where support should NOT exist) + // belt_surface=false → the valid side (where support IS allowed) + // + // For shear_factor > 0: belt surface is from_axis >= cutoff + // For shear_factor < 0: belt surface is from_axis <= cutoff + bool high_side = (m_shear_factor > 0) == belt_surface; + + Polygon poly; + if (m_from_axis == 0) { + if (high_side) { + // X >= cutoff + poly.points = { + Point(cutoff_scaled, -large_bound), + Point(large_bound, -large_bound), + Point(large_bound, large_bound), + Point(cutoff_scaled, large_bound) + }; + } else { + // X < cutoff + poly.points = { + Point(-large_bound, -large_bound), + Point(cutoff_scaled, -large_bound), + Point(cutoff_scaled, large_bound), + Point(-large_bound, large_bound) + }; + } + } else { + if (high_side) { + // Y >= cutoff + poly.points = { + Point(-large_bound, cutoff_scaled), + Point( large_bound, cutoff_scaled), + Point( large_bound, large_bound), + Point(-large_bound, large_bound) + }; + } else { + // Y < cutoff + poly.points = { + Point(-large_bound, -large_bound), + Point( large_bound, -large_bound), + Point( large_bound, cutoff_scaled), + Point(-large_bound, cutoff_scaled) + }; + } + } + return { poly }; +} + +} // namespace Slic3r diff --git a/src/libslic3r/Support/BeltFloorContext.hpp b/src/libslic3r/Support/BeltFloorContext.hpp new file mode 100644 index 0000000000..7b8b704ef6 --- /dev/null +++ b/src/libslic3r/Support/BeltFloorContext.hpp @@ -0,0 +1,74 @@ +#pragma once + +#include "../libslic3r.h" +#include "../Point.hpp" +#include "../Polygon.hpp" +#include "../Slicing.hpp" +#include "../PrintConfig.hpp" + +namespace Slic3r { + +class PrintObject; + +// Belt floor context: encapsulates the parameters and polygon computation +// for belt printer floor clipping in support generation. +// +// All belt floor code across SupportMaterial, TreeSupport, TreeSupport3D, +// and TreeModelVolumes uses the same 4 parameters and the same 4-case +// polygon construction. This class consolidates that logic. +// +// Construct once per PrintObject, then call surface_polygon() or +// valid_region_polygon() per layer with the layer's print_z. +class BeltFloorContext +{ +public: + BeltFloorContext() = default; + + // Initialize from slicing parameters and print config. + // Uses global Z coordinates (for SupportMaterial, non-organic TreeSupport). + bool init(const SlicingParameters &sp, const PrintConfig &pcfg); + + // Initialize with a Z offset subtracted from z_shift. + // Uses local Z coordinates (for TreeSupport3D, TreeModelVolumes organic pipeline). + bool init_local(const SlicingParameters &sp, const PrintConfig &pcfg, + double global_z_offset); + + bool is_active() const { return m_active; } + + // Compute the belt-side half-plane polygon at a given print_z. + // This is the region where the belt surface exists. + Polygons surface_polygon(coordf_t print_z) const; + + // Compute the valid-region half-plane polygon at a given print_z. + // This is the complement: the region where support is allowed. + Polygons valid_region_polygon(coordf_t print_z) const; + + // Compute the belt floor Z position at a given XY position (in slicing coords). + // Returns -infinity if not active. + double floor_print_z(const Point &pos_slicing) const; + + // Pre-compute belt floor polygons for a range of layers. + // layer_print_z(i) returns the print_z for layer index i. + std::vector compute_per_layer_floors( + size_t num_layers, + const std::function &layer_print_z) const; + + // Accessors + double shear_factor() const { return m_shear_factor; } + int from_axis() const { return m_from_axis; } + double z_shift() const { return m_z_shift; } + double floor_offset() const { return m_floor_offset; } + +private: + bool m_active = false; + double m_shear_factor = 0.0; + int m_from_axis = 1; // 0=X, 1=Y + double m_z_shift = 0.0; + double m_floor_offset = 0.0; + + // Internal: compute the raw half-plane polygon. + // If belt_surface=true, returns the belt side; otherwise the valid (complement) side. + Polygons half_plane(coordf_t print_z, bool belt_surface) const; +}; + +} // namespace Slic3r diff --git a/src/libslic3r/Support/SupportMaterial.cpp b/src/libslic3r/Support/SupportMaterial.cpp index d70153a7dd..c1f732bc6d 100644 --- a/src/libslic3r/Support/SupportMaterial.cpp +++ b/src/libslic3r/Support/SupportMaterial.cpp @@ -5,6 +5,7 @@ #include "Print.hpp" #include "SupportMaterial.hpp" #include "SupportCommon.hpp" +#include "BeltFloorContext.hpp" #include "Geometry.hpp" #include "Point.hpp" #include "MutablePolygon.hpp" @@ -625,64 +626,10 @@ Polygons belt_floor_surface_polygon( const PrintObject &object, coordf_t print_z) { - const double shear_factor = slicing_params.belt_floor_shear_factor; - if (std::abs(shear_factor) < EPSILON) + BeltFloorContext ctx; + if (!ctx.init(slicing_params, print_config)) return {}; - - const int from_axis = slicing_params.belt_floor_from_axis; // 0=X, 1=Y - const double floor_offset = print_config.belt_support_floor_offset.value; - - // Belt floor line in slicing coordinates: Z = sf * Y + z_shift. - // z_shift accounts for the upward shift applied when post-shear geometry - // extends below the bed (overhangs). Solving for Y: - // cutoff = (print_z - z_shift - floor_offset) / sf - const double z_shift = slicing_params.belt_floor_z_shift; - const double cutoff = (print_z - z_shift - floor_offset) / shear_factor; - const coord_t cutoff_scaled = scale_(cutoff); - const coord_t large_bound = scale_(1e4); - - // Build the belt-side half-plane (inverted from the valid region). - // If shear_factor > 0: valid region is from_axis < cutoff, so belt surface is from_axis >= cutoff. - // If shear_factor < 0: valid region is from_axis > cutoff, so belt surface is from_axis <= cutoff. - Polygon belt_poly; - if (from_axis == 0) { - if (shear_factor > 0) { - // Belt surface: X >= cutoff - belt_poly.points = { - Point(cutoff_scaled, -large_bound), - Point(large_bound, -large_bound), - Point(large_bound, large_bound), - Point(cutoff_scaled, large_bound) - }; - } else { - // Belt surface: X <= cutoff - belt_poly.points = { - Point(-large_bound, -large_bound), - Point(cutoff_scaled, -large_bound), - Point(cutoff_scaled, large_bound), - Point(-large_bound, large_bound) - }; - } - } else { - if (shear_factor > 0) { - // Belt surface: Y >= cutoff - belt_poly.points = { - Point(-large_bound, cutoff_scaled), - Point( large_bound, cutoff_scaled), - Point( large_bound, large_bound), - Point(-large_bound, large_bound) - }; - } else { - // Belt surface: Y <= cutoff - belt_poly.points = { - Point(-large_bound, -large_bound), - Point( large_bound, -large_bound), - Point( large_bound, cutoff_scaled), - Point(-large_bound, cutoff_scaled) - }; - } - } - return { belt_poly }; + return ctx.surface_polygon(print_z); } // Belt printer: compute the valid-region half-plane polygon at a given print_z. @@ -694,58 +641,10 @@ static Polygons belt_floor_valid_region_polygon( const PrintObject &object, coordf_t print_z) { - const double shear_factor = slicing_params.belt_floor_shear_factor; - if (std::abs(shear_factor) < EPSILON) + BeltFloorContext ctx; + if (!ctx.init(slicing_params, print_config)) return {}; - - const int from_axis = slicing_params.belt_floor_from_axis; - const double floor_offset = print_config.belt_support_floor_offset.value; - - const double z_shift = slicing_params.belt_floor_z_shift; - const double cutoff = (print_z - z_shift - floor_offset) / shear_factor; - const coord_t cutoff_scaled = scale_(cutoff); - const coord_t large_bound = scale_(1e4); - - // Valid region: the complement of the belt surface polygon. - Polygon valid_poly; - if (from_axis == 0) { - if (shear_factor > 0) { - // Valid: X < cutoff - valid_poly.points = { - Point(-large_bound, -large_bound), - Point(cutoff_scaled, -large_bound), - Point(cutoff_scaled, large_bound), - Point(-large_bound, large_bound) - }; - } else { - // Valid: X > cutoff - valid_poly.points = { - Point(cutoff_scaled, -large_bound), - Point(large_bound, -large_bound), - Point(large_bound, large_bound), - Point(cutoff_scaled, large_bound) - }; - } - } else { - if (shear_factor > 0) { - // Valid: Y < cutoff - valid_poly.points = { - Point(-large_bound, -large_bound), - Point( large_bound, -large_bound), - Point( large_bound, cutoff_scaled), - Point(-large_bound, cutoff_scaled) - }; - } else { - // Valid: Y > cutoff - valid_poly.points = { - Point(-large_bound, cutoff_scaled), - Point( large_bound, cutoff_scaled), - Point( large_bound, large_bound), - Point(-large_bound, large_bound) - }; - } - } - return { valid_poly }; + return ctx.valid_region_polygon(print_z); } // Collect outer contours of all slices of this layer. @@ -3373,22 +3272,18 @@ static void trim_support_layers_by_belt_floor( const PrintObject &object, SupportGeneratorLayersPtr &support_layers) { - if (std::abs(slicing_params.belt_floor_shear_factor) < EPSILON) + BeltFloorContext ctx; + if (!ctx.init(slicing_params, print_config)) return; if (print_config.belt_support_floor_mode.value != BeltSupportFloorMode::GeneratorOnly) return; tbb::parallel_for(tbb::blocked_range(0, support_layers.size()), [&](const tbb::blocked_range &range) { - for (size_t i = range.begin(); i < range.end(); ++ i) { - SupportGeneratorLayer *layer = support_layers[i]; - if (layer->polygons.empty()) - continue; - Polygons belt_surface = belt_floor_surface_polygon( - slicing_params, print_config, object, layer->print_z); - if (! belt_surface.empty()) - layer->polygons = diff(layer->polygons, belt_surface); - } + for (size_t i = range.begin(); i < range.end(); ++i) + if (support_layers[i]) + support_layers[i]->polygons = diff(support_layers[i]->polygons, + ctx.surface_polygon(support_layers[i]->print_z)); }); } diff --git a/src/libslic3r/Support/TreeModelVolumes.cpp b/src/libslic3r/Support/TreeModelVolumes.cpp index ec38ffed73..ebc3d2c958 100644 --- a/src/libslic3r/Support/TreeModelVolumes.cpp +++ b/src/libslic3r/Support/TreeModelVolumes.cpp @@ -8,6 +8,7 @@ #include "TreeModelVolumes.hpp" #include "TreeSupportCommon.hpp" +#include "BeltFloorContext.hpp" #include "../BuildVolume.hpp" #include "../ClipperUtils.hpp" @@ -101,13 +102,11 @@ TreeModelVolumes::TreeModelVolumes( { const auto &sp = print_object.slicing_parameters(); const auto &pcfg = print_object.print()->config(); - const double sf = sp.belt_floor_shear_factor; - if (std::abs(sf) > EPSILON + BeltFloorContext ctx; + ctx.init_local(sp, pcfg, print_object.belt_global_z_offset()); + if (ctx.is_active() && std::abs(print_object.belt_global_z_offset()) > EPSILON && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { - const int from_axis = sp.belt_floor_from_axis; - const double floor_off = pcfg.belt_support_floor_offset.value; - const double z_shift = sp.belt_floor_z_shift - print_object.belt_global_z_offset(); size_t num_layers_needed = print_object.layer_count(); // Ensure m_anti_overhang is large enough. if (m_anti_overhang.size() < num_layers_needed) @@ -115,22 +114,7 @@ TreeModelVolumes::TreeModelVolumes( for (size_t layer_idx = 0; layer_idx < num_layers_needed; ++layer_idx) { double print_z = print_object.get_layer(layer_idx)->print_z - print_object.belt_global_z_offset(); - double cutoff = (print_z - z_shift - floor_off) / sf; - coord_t cutoff_sc = scale_(cutoff); - coord_t big = scale_(1e4); - Polygon belt_poly; - if (from_axis == 0) { - if (sf > 0) - belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; - else - belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; - } else { - if (sf > 0) - belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; - else - belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; - } - append(m_anti_overhang[layer_idx], Polygons{belt_poly}); + append(m_anti_overhang[layer_idx], ctx.surface_polygon(print_z)); } } } @@ -180,40 +164,20 @@ TreeModelVolumes::TreeModelVolumes( // Branches grow toward the belt and their slices are clipped at the belt // surface in organic_draw_branches(). The organic pipeline works in LOCAL // Z (no global_z_offset), so use local z_shift and local print_z. - const auto &slicing_params = print_object.slicing_parameters(); - const auto &pcfg = print_object.print()->config(); - const double sf = slicing_params.belt_floor_shear_factor; - if (std::abs(sf) > EPSILON - && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { - const int from_axis = slicing_params.belt_floor_from_axis; - const double floor_off = pcfg.belt_support_floor_offset.value; - // Subtract global_z_offset to get the LOCAL z_shift — the organic - // pipeline's Z coordinates don't include the global offset. - const double z_shift = slicing_params.belt_floor_z_shift - - print_object.belt_global_z_offset(); - m_belt_floor.assign(num_layers, Polygons{}); - for (size_t layer_idx = 0; layer_idx < num_layers; ++layer_idx) { - // Use local print_z (subtract global offset from object layer). - double print_z = (layer_idx >= num_raft_layers) - ? print_object.get_layer(layer_idx - num_raft_layers)->print_z - - print_object.belt_global_z_offset() - : 0.; - double cutoff = (print_z - z_shift - floor_off) / sf; - coord_t cutoff_sc = scale_(cutoff); - coord_t big = scale_(1e4); - Polygon belt_poly; - if (from_axis == 0) { - if (sf > 0) - belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; - else - belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; - } else { - if (sf > 0) - belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; - else - belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; - } - m_belt_floor[layer_idx] = { belt_poly }; + { + const auto &slicing_params = print_object.slicing_parameters(); + const auto &pcfg2 = print_object.print()->config(); + BeltFloorContext ctx; + ctx.init_local(slicing_params, pcfg2, print_object.belt_global_z_offset()); + if (ctx.is_active() + && pcfg2.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + m_belt_floor = ctx.compute_per_layer_floors(num_layers, [&](size_t layer_idx) -> double { + // Use local print_z (subtract global offset from object layer). + return (layer_idx >= num_raft_layers) + ? print_object.get_layer(layer_idx - num_raft_layers)->print_z + - print_object.belt_global_z_offset() + : 0.; + }); } } } diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 60e681add9..6c359115da 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -14,6 +14,7 @@ #include "TreeSupportCommon.hpp" #include "TreeSupport.hpp" #include "TreeSupport3D.hpp" +#include "BeltFloorContext.hpp" #include #include @@ -639,16 +640,10 @@ TreeSupport::TreeSupport(PrintObject& object, const SlicingParameters &slicing_p double TreeSupport::belt_floor_print_z(const Point &pos_slicing) const { - double sf = m_slicing_params.belt_floor_shear_factor; - if (std::abs(sf) < EPSILON) - return -std::numeric_limits::max(); // no belt floor - int from = m_slicing_params.belt_floor_from_axis; - // Belt floor in slicing coords: Z = sf * Y + z_shift + floor_offset. - // Inverse of cutoff = (Z - z_shift - floor_offset) / sf. - double pos = unscale(from == 0 ? pos_slicing.x() : pos_slicing.y()); - double floor_offset = m_print_config->belt_support_floor_offset.value; - double z_shift = m_slicing_params.belt_floor_z_shift; - return sf * pos + floor_offset + z_shift; + BeltFloorContext ctx; + if (!ctx.init(m_slicing_params, *m_print_config)) + return -std::numeric_limits::infinity(); + return ctx.floor_print_z(pos_slicing); } #define SUPPORT_SURFACES_OFFSET_PARAMETERS ClipperLib::jtSquare, 0. @@ -1738,18 +1733,11 @@ void TreeSupport::generate() // layer and clipped at the belt surface. These layers bypass the tree // algorithm entirely — they're pure geometry added after draw_circles(). { - const auto &sp = m_slicing_params; - const auto &pcfg = *m_print_config; - const double sf = sp.belt_floor_shear_factor; - if (std::abs(sf) > EPSILON - && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly + BeltFloorContext ctx; + if (ctx.init(m_slicing_params, *m_print_config) + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly && m_object->support_layer_count() > 0) { - const int from_axis = sp.belt_floor_from_axis; - const double floor_off = pcfg.belt_support_floor_offset.value; - // Support layer print_z values are in GLOBAL Z (non-organic inherits - // from object layers which include global_z_offset). Use the GLOBAL - // belt_floor_z_shift to match. - const double z_shift = sp.belt_floor_z_shift; + const auto &sp = m_slicing_params; // Find the lowest non-empty, non-brim support layer. ExPolygons source_areas; double source_z = 0; @@ -1778,7 +1766,7 @@ void TreeSupport::generate() } if (!source_areas.empty()) { BoundingBoxf3 bb = belt_remapped_bbox(*m_object->model_object(), m_object->print()->config()); - double from_extent = std::abs(bb.min(from_axis)); + double from_extent = std::abs(bb.min(ctx.from_axis())); double bb_min_z = std::abs(bb.min.z()); double first_z = m_object->get_support_layer(0)->print_z; // Depth = from-axis extent + pre-shear bbox Z offset (ensure_on_bed @@ -1792,18 +1780,8 @@ void TreeSupport::generate() for (int i = num_extra; i >= 1 && !prev_areas.empty(); --i) { double print_z = first_z - i * sp.layer_height; if (print_z < -sp.layer_height) continue; - double cutoff = (print_z - z_shift - floor_off) / sf; - coord_t cutoff_sc = scale_(cutoff); - coord_t big = scale_(1e3); - Polygon belt_poly; - if (from_axis == 0) { - if (sf > 0) belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; - else belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; - } else { - if (sf > 0) belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; - else belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; - } - ExPolygons clipped = diff_ex(source_areas, Polygons{belt_poly}); + Polygons belt_surface = ctx.surface_polygon(print_z); + ExPolygons clipped = diff_ex(source_areas, belt_surface); if (clipped.empty()) continue; SupportLayer *sl = new SupportLayer(0, 0, m_object, sp.layer_height, print_z, -1); sl->base_areas = clipped; @@ -2250,37 +2228,19 @@ void TreeSupport::draw_circles() // Belt floor: clip tree support polygons by the belt surface plane. // ts_layer->print_z is at LOCAL Z (global offset applied later in - // _generate_support_material), but belt_floor_z_shift includes - // global_z_offset — subtract it to get the cutoff in local coords. - if (std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON - && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { - const double sf = m_slicing_params.belt_floor_shear_factor; - const int from_axis = m_slicing_params.belt_floor_from_axis; - const double floor_off = m_print_config->belt_support_floor_offset.value; - const double z_shift_local = m_slicing_params.belt_floor_z_shift - - m_object->belt_global_z_offset(); - const double cutoff = (ts_layer->print_z - z_shift_local - floor_off) / sf; - const coord_t cutoff_sc = scale_(cutoff); - const coord_t big = scale_(1e4); - - Polygon belt_poly; - if (from_axis == 0) { - if (sf > 0) - belt_poly.points = { {cutoff_sc,-big}, {big,-big}, {big,big}, {cutoff_sc,big} }; - else - belt_poly.points = { {-big,-big}, {cutoff_sc,-big}, {cutoff_sc,big}, {-big,big} }; - } else { - if (sf > 0) - belt_poly.points = { {-big,cutoff_sc}, {big,cutoff_sc}, {big,big}, {-big,big} }; - else - belt_poly.points = { {-big,-big}, {big,-big}, {big,cutoff_sc}, {-big,cutoff_sc} }; + // _generate_support_material), so use init_local to subtract + // belt_global_z_offset from z_shift. + { + BeltFloorContext ctx; + if (ctx.init_local(m_slicing_params, *m_print_config, m_object->belt_global_z_offset()) + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + Polygons belt_surface = ctx.surface_polygon(ts_layer->print_z); + base_areas = diff_ex(base_areas, belt_surface); + roof_areas = diff_ex(roof_areas, belt_surface); + roof_1st_layer = diff_ex(roof_1st_layer, belt_surface); + floor_areas = diff_ex(floor_areas, belt_surface); + roof_gap_areas = diff_ex(roof_gap_areas, belt_surface); } - Polygons belt_surface = { belt_poly }; - base_areas = diff_ex(base_areas, belt_surface); - roof_areas = diff_ex(roof_areas, belt_surface); - roof_1st_layer = diff_ex(roof_1st_layer, belt_surface); - floor_areas = diff_ex(floor_areas, belt_surface); - roof_gap_areas = diff_ex(roof_gap_areas, belt_surface); } if (SQUARE_SUPPORT) { @@ -3593,6 +3553,20 @@ TreeSupportData::TreeSupportData(const PrintObject &object, coordf_t xy_distance poly.simplify(scale_(m_radius_sample_resolution), &outline); } + // Belt floor: add belt surface polygon to layer outlines so the + // collision system treats the belt as a physical surface. + { + BeltFloorContext ctx; + double local_print_z = layer->print_z - object.belt_global_z_offset(); + if (ctx.init_local(object.slicing_parameters(), object.print()->config(), + object.belt_global_z_offset()) + && object.print()->config().belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + Polygons belt_surface = ctx.surface_polygon(local_print_z); + for (auto &p : belt_surface) + outline.emplace_back(ExPolygon(p)); + } + } + if (layer_nr == 0) m_layer_outlines_below.push_back(outline); else diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index 9d35cb2dd8..8a07609930 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -19,6 +19,7 @@ #include "Polygon.hpp" #include "Polyline.hpp" #include "MutablePolygon.hpp" +#include "BeltFloorContext.hpp" #include "SupportCommon.hpp" #include "TriangleMeshSlicer.hpp" #include "TreeSupport.hpp" @@ -3373,8 +3374,9 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons PrintObject &po = *print.get_object(processing.second.front()); const auto &sp = po.slicing_parameters(); const auto &pcfg = po.print()->config(); - const double sf = sp.belt_floor_shear_factor; - if (std::abs(sf) > EPSILON && std::abs(po.belt_global_z_offset()) > EPSILON + BeltFloorContext ctx; + ctx.init_local(sp, pcfg, po.belt_global_z_offset()); + if (ctx.is_active() && std::abs(po.belt_global_z_offset()) > EPSILON && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { // z_shift_local is the belt surface height at Y=0 in local coords. // Extend below the belt so the base expansion and build-plate @@ -3598,32 +3600,16 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons // Compute the belt floor polygon directly from each layer's print_z // rather than mapping to a layer index (avoids index mismatch issues). { - const auto &sp = print_object.slicing_parameters(); - const double sf = sp.belt_floor_shear_factor; - const double z_shift = sp.belt_floor_z_shift - print_object.belt_global_z_offset(); - const double floor_off = print_object.print()->config().belt_support_floor_offset.value; - const int from_axis = sp.belt_floor_from_axis; - if (std::abs(sf) > EPSILON - && print_object.print()->config().belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + const auto &sp = print_object.slicing_parameters(); + const auto &pcfg = print_object.print()->config(); + BeltFloorContext ctx; + ctx.init_local(sp, pcfg, print_object.belt_global_z_offset()); + if (ctx.is_active() + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { tbb::parallel_for_each(layers_sorted.begin(), layers_sorted.end(), [&](SupportGeneratorLayer *layer) { if (!layer || layer->polygons.empty()) return; - double cutoff = (layer->print_z - z_shift - floor_off) / sf; - coord_t cutoff_sc = scale_(cutoff); - coord_t big = scale_(1e4); - Polygon belt_poly; - if (from_axis == 0) { - if (sf > 0) - belt_poly.points = {{cutoff_sc,-big},{big,-big},{big,big},{cutoff_sc,big}}; - else - belt_poly.points = {{-big,-big},{cutoff_sc,-big},{cutoff_sc,big},{-big,big}}; - } else { - if (sf > 0) - belt_poly.points = {{-big,cutoff_sc},{big,cutoff_sc},{big,big},{-big,big}}; - else - belt_poly.points = {{-big,-big},{big,-big},{big,cutoff_sc},{-big,cutoff_sc}}; - } - layer->polygons = diff(layer->polygons, Polygons{belt_poly}); + layer->polygons = diff(layer->polygons, ctx.surface_polygon(layer->print_z)); }); } } From c8a1bf3a99f61ec972d0691e2ad46077ce415945 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 28 Mar 2026 02:13:15 -0500 Subject: [PATCH 019/389] Part 3.2: decouple axis remapping, enable viewing settings in Developer mode or when Belt mode is active --- src/libslic3r/BeltGCode.cpp | 14 ++---- src/libslic3r/BeltGCodeWriter.cpp | 25 ++-------- src/libslic3r/BeltGCodeWriter.hpp | 8 +--- src/libslic3r/BeltSliceStrategy.cpp | 15 ++---- src/libslic3r/BeltSliceStrategy.hpp | 10 ++-- src/libslic3r/BeltTransform.cpp | 18 ++++---- src/libslic3r/BeltTransform.hpp | 14 +++--- src/libslic3r/GCode.cpp | 13 ++++++ src/libslic3r/GCode/BeltBackTransform.cpp | 2 +- src/libslic3r/GCode/BeltBackTransform.hpp | 2 +- src/libslic3r/GCode/GCodeProcessor.cpp | 34 +++++++------- src/libslic3r/GCode/GCodeProcessor.hpp | 12 ++--- src/libslic3r/GCodeWriter.cpp | 56 +++++++++++++++++++++-- src/libslic3r/GCodeWriter.hpp | 15 ++++++ src/libslic3r/Preset.cpp | 4 +- src/libslic3r/Print.cpp | 12 ++--- src/libslic3r/PrintConfig.cpp | 52 ++++++++++----------- src/libslic3r/PrintConfig.hpp | 18 ++++---- src/libslic3r/PrintObjectSlice.cpp | 24 +++++++++- src/slic3r/GUI/Tab.cpp | 21 +++++---- 20 files changed, 215 insertions(+), 154 deletions(-) diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index dc1b6ca439..40dabf98dc 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -15,13 +15,7 @@ void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) auto belt_writer = std::make_unique(); belt_writer->set_is_bbl_machine(is_bbl_printers); belt_writer->set_belt_angle(print.config().belt_printer_angle.value); - belt_writer->set_axis_remap( - int(print.config().belt_gcode_remap_x.value), - int(print.config().belt_gcode_remap_y.value), - int(print.config().belt_gcode_remap_z.value)); - BoundingBoxf bbox_bed(print.config().printable_area.values); - belt_writer->set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), - print.config().printable_height.value)); + // Axis remap and build volume max are set by base GCode after init_belt_writer returns. belt_writer->set_belt_back_transform(print.config()); m_writer = std::move(belt_writer); @@ -59,9 +53,9 @@ void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); // Pre-slice remap configs - file.write_format("; belt_preslice_remap_x = %s\n", full_cfg.opt_serialize("belt_preslice_remap_x").c_str()); - file.write_format("; belt_preslice_remap_y = %s\n", full_cfg.opt_serialize("belt_preslice_remap_y").c_str()); - file.write_format("; belt_preslice_remap_z = %s\n", full_cfg.opt_serialize("belt_preslice_remap_z").c_str()); + file.write_format("; preslice_remap_x = %s\n", full_cfg.opt_serialize("preslice_remap_x").c_str()); + file.write_format("; preslice_remap_y = %s\n", full_cfg.opt_serialize("preslice_remap_y").c_str()); + file.write_format("; preslice_remap_z = %s\n", full_cfg.opt_serialize("preslice_remap_z").c_str()); } void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index 645bf85a5b..db2bc46fe1 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -10,18 +10,6 @@ void BeltGCodeWriter::set_belt_angle(double angle_deg) m_belt_angle_rad = Geometry::deg2rad(angle_deg); } -void BeltGCodeWriter::set_axis_remap(int rx, int ry, int rz) -{ - m_remap_x = rx; - m_remap_y = ry; - m_remap_z = rz; -} - -void BeltGCodeWriter::set_build_volume_max(const Vec3d &max) -{ - m_build_vol_max = max; -} - void BeltGCodeWriter::set_belt_back_transform(const PrintConfig &config) { m_belt_back_transform.init_from_config(config); @@ -40,16 +28,9 @@ Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const { // Step 1: Undo the shear/scale applied during slicing. Vec3d p = m_belt_back_transform.apply(pos); - // Step 2: Apply axis remapping for the machine's coordinate convention. - // BeltRemapAxis: 0-2 = +X/+Y/+Z, 3-5 = -X/-Y/-Z, 6-8 = Rev X/Y/Z - auto remap = [this, &p](int r) -> double { - int axis = r % 3; - if (r < 3) return p[axis]; - if (r < 6) return -p[axis]; - return m_build_vol_max[axis] - p[axis]; - }; - Vec3d result = { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; - // Per-axis origin snap: shift so bbox min on each enabled axis = offset. + // Step 2: Apply axis remap (uses inherited base class method). + Vec3d result = apply_axis_remap(p); + // Step 3: Per-axis origin snap. for (int i = 0; i < 3; ++i) if (m_origin_snap[i]) result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); diff --git a/src/libslic3r/BeltGCodeWriter.hpp b/src/libslic3r/BeltGCodeWriter.hpp index 727135b578..a41f890503 100644 --- a/src/libslic3r/BeltGCodeWriter.hpp +++ b/src/libslic3r/BeltGCodeWriter.hpp @@ -15,11 +15,9 @@ class BeltGCodeWriter : public GCodeWriter public: BeltGCodeWriter() : GCodeWriter() {} - // Belt configuration + // Belt configuration (axis remap is inherited from GCodeWriter) void set_belt_angle(double angle_deg); bool is_belt_printer() const { return m_belt_angle_rad != 0.; } - void set_axis_remap(int rx, int ry, int rz); - void set_build_volume_max(const Vec3d &max); void set_belt_back_transform(const PrintConfig &config); void set_origin_snap(int axis, bool enable, double offset, double bbox_min); Vec3d to_machine_coords(const Vec3d &pos) const; @@ -37,10 +35,6 @@ protected: private: double m_belt_angle_rad = 0.; - int m_remap_x = 0; - int m_remap_y = 1; - int m_remap_z = 2; - Vec3d m_build_vol_max = Vec3d::Zero(); BeltBackTransform m_belt_back_transform; bool m_origin_snap[3] = {false, false, false}; double m_origin_offset[3] = {0., 0., 0.}; diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp index b3adeec64a..c1a300869e 100644 --- a/src/libslic3r/BeltSliceStrategy.cpp +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -13,31 +13,24 @@ std::unique_ptr BeltSliceStrategy::create(const PrintConfig & BeltSliceStrategy::BeltSliceStrategy(const PrintConfig &config) { - m_has_remap = BeltTransformPipeline::has_preslice_remap(config); - if (m_has_remap) - m_pre_remap = BeltTransformPipeline::build_preslice_remap(config); - m_shear = BeltTransformPipeline::build_shear_matrix(config, &m_has_shear); m_scale = BeltTransformPipeline::build_scale_matrix(config, &m_has_scale); } void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, const ModelVolumePtrs &model_volumes, + bool has_remap, double *out_belt_min_z) const { - // Step 1: Pre-slice axis remap. - if (m_has_remap) - trafo = m_pre_remap * trafo; - - // Step 2: Shear + scale. + // Shear + scale (belt-only; pre-slice remap is handled separately). if (m_has_shear || m_has_scale) { Transform3d belt_xform = Transform3d::Identity(); belt_xform.linear() = m_scale * m_shear; trafo = belt_xform * trafo; } - // Step 3: Z-shift — detect if mesh clips below build plate after transforms. - if (m_has_remap || m_has_shear || m_has_scale) { + // Z-shift — detect if mesh clips below build plate after transforms. + if (has_remap || m_has_shear || m_has_scale) { double min_z = std::numeric_limits::max(); for (const ModelVolume *mv : model_volumes) { if (!mv->is_model_part()) continue; diff --git a/src/libslic3r/BeltSliceStrategy.hpp b/src/libslic3r/BeltSliceStrategy.hpp index bf19243fd2..ef6e038ee7 100644 --- a/src/libslic3r/BeltSliceStrategy.hpp +++ b/src/libslic3r/BeltSliceStrategy.hpp @@ -23,21 +23,19 @@ public: // Create a strategy if belt_printer is enabled; returns nullptr otherwise. static std::unique_ptr create(const PrintConfig &config); - // Apply belt transforms to the slicing trafo. - // Modifies trafo in-place: trafo = z_shift * scale * shear * pre_remap * trafo - // Scans all model_part volumes to detect minimum Z and add z-shift if needed. - // Sets *out_belt_min_z to the minimum Z of the mesh after transforms. + // Apply belt-specific transforms (shear + scale + z-shift) to the slicing trafo. + // Pre-slice remap is handled separately (standalone feature). + // has_remap: whether pre-slice remap was already applied (affects z-shift detection). void apply_to_trafo(Transform3d &trafo, const ModelVolumePtrs &model_volumes, + bool has_remap, double *out_belt_min_z) const; private: explicit BeltSliceStrategy(const PrintConfig &config); - bool m_has_remap = false; bool m_has_shear = false; bool m_has_scale = false; - Transform3d m_pre_remap = Transform3d::Identity(); Matrix3d m_shear = Matrix3d::Identity(); Matrix3d m_scale = Matrix3d::Identity(); }; diff --git a/src/libslic3r/BeltTransform.cpp b/src/libslic3r/BeltTransform.cpp index db7eea7d80..9bb66fcfb6 100644 --- a/src/libslic3r/BeltTransform.cpp +++ b/src/libslic3r/BeltTransform.cpp @@ -13,9 +13,9 @@ Transform3d BeltTransformPipeline::build_preslice_remap(const PrintConfig &confi if (!has_preslice_remap(config)) return pre_remap; - int pre_rx = int(config.belt_preslice_remap_x.value); - int pre_ry = int(config.belt_preslice_remap_y.value); - int pre_rz = int(config.belt_preslice_remap_z.value); + int pre_rx = int(config.preslice_remap_x.value); + int pre_ry = int(config.preslice_remap_y.value); + int pre_rz = int(config.preslice_remap_z.value); // Each remap value selects a source axis and sign. auto remap_column = [](int r) -> Vec3d { @@ -114,13 +114,13 @@ Transform3d BeltTransformPipeline::build_forward_transform(const PrintConfig &co BoundingBoxf3 BeltTransformPipeline::remap_bbox(const BoundingBoxf3 &bb, const PrintConfig &config) { - int pre_rx = int(config.belt_preslice_remap_x.value); - int pre_ry = int(config.belt_preslice_remap_y.value); - int pre_rz = int(config.belt_preslice_remap_z.value); + int pre_rx = int(config.preslice_remap_x.value); + int pre_ry = int(config.preslice_remap_y.value); + int pre_rz = int(config.preslice_remap_z.value); - if (pre_rx == int(BeltRemapAxis::PosX) && - pre_ry == int(BeltRemapAxis::PosY) && - pre_rz == int(BeltRemapAxis::PosZ)) + if (pre_rx == int(RemapAxis::PosX) && + pre_ry == int(RemapAxis::PosY) && + pre_rz == int(RemapAxis::PosZ)) return bb; // Identity remap. auto remap_coord = [](int r, const Vec3d &v) -> double { diff --git a/src/libslic3r/BeltTransform.hpp b/src/libslic3r/BeltTransform.hpp index b9a60473e5..3c0665c252 100644 --- a/src/libslic3r/BeltTransform.hpp +++ b/src/libslic3r/BeltTransform.hpp @@ -58,21 +58,21 @@ public: static bool has_preslice_remap(const PrintConfig &config) { - return int(config.belt_preslice_remap_x.value) != int(BeltRemapAxis::PosX) || - int(config.belt_preslice_remap_y.value) != int(BeltRemapAxis::PosY) || - int(config.belt_preslice_remap_z.value) != int(BeltRemapAxis::PosZ); + return int(config.preslice_remap_x.value) != int(RemapAxis::PosX) || + int(config.preslice_remap_y.value) != int(RemapAxis::PosY) || + int(config.preslice_remap_z.value) != int(RemapAxis::PosZ); } // Overload accepting DynamicPrintConfig (used in static slicing_parameters). static bool has_preslice_remap(const DynamicPrintConfig &config) { auto get_int = [&](const char *key) -> int { - auto *opt = config.option>(key); + auto *opt = config.option>(key); return opt ? int(opt->value) : 0; }; - return get_int("belt_preslice_remap_x") != int(BeltRemapAxis::PosX) || - get_int("belt_preslice_remap_y") != int(BeltRemapAxis::PosY) || - get_int("belt_preslice_remap_z") != int(BeltRemapAxis::PosZ); + return get_int("preslice_remap_x") != int(RemapAxis::PosX) || + get_int("preslice_remap_y") != int(RemapAxis::PosY) || + get_int("preslice_remap_z") != int(RemapAxis::PosZ); } static bool has_shear(const PrintConfig &config) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index a330fad689..93b87cbba8 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2425,6 +2425,19 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Belt printer: initialize belt-specific writer via virtual hook. this->init_belt_writer(print, is_bbl_printers); + // Standalone axis remap (works with or without belt mode). + { + int rx = int(print.config().gcode_remap_x.value); + int ry = int(print.config().gcode_remap_y.value); + int rz = int(print.config().gcode_remap_z.value); + if (rx != 0 || ry != 1 || rz != 2) { + m_writer->set_axis_remap(rx, ry, rz); + BoundingBoxf bbox_bed(print.config().printable_area.values); + m_writer->set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), + print.config().printable_height.value)); + } + } + // How many times will be change_layer() called? // change_layer() in turn increments the progress bar status. m_layer_count = 0; diff --git a/src/libslic3r/GCode/BeltBackTransform.cpp b/src/libslic3r/GCode/BeltBackTransform.cpp index 2e2cd26f75..b9cdac779f 100644 --- a/src/libslic3r/GCode/BeltBackTransform.cpp +++ b/src/libslic3r/GCode/BeltBackTransform.cpp @@ -8,7 +8,7 @@ bool BeltBackTransform::init_from_config(const PrintConfig &config) m_active = false; m_inverse = Transform3d::Identity(); - if (!config.belt_printer.value || !config.belt_gcode_back_transform.value) + if (!config.belt_printer.value || !config.gcode_back_transform.value) return false; // Require at least one active transform to proceed. diff --git a/src/libslic3r/GCode/BeltBackTransform.hpp b/src/libslic3r/GCode/BeltBackTransform.hpp index 5a75d94dc8..b98770c688 100644 --- a/src/libslic3r/GCode/BeltBackTransform.hpp +++ b/src/libslic3r/GCode/BeltBackTransform.hpp @@ -15,7 +15,7 @@ namespace Slic3r { // Initialized once from PrintConfig, then applied per-point in // GCodeWriter::to_machine_coords() before axis remapping. // -// Active when belt_gcode_back_transform is true AND at least one of: +// Active when gcode_back_transform is true AND at least one of: // - a shear axis has global mode enabled, or // - a pre-slice axis remap is non-identity. class BeltBackTransform diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 2288c9e670..e6b6403be5 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3129,26 +3129,26 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers try { m_result.belt_scale_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; } // Pre-slice axis remap - auto parse_remap_axis = [](const std::string &s) -> BeltRemapAxis { - if (s == "pos_x") return BeltRemapAxis::PosX; - if (s == "pos_y") return BeltRemapAxis::PosY; - if (s == "pos_z") return BeltRemapAxis::PosZ; - if (s == "neg_x") return BeltRemapAxis::NegX; - if (s == "neg_y") return BeltRemapAxis::NegY; - if (s == "neg_z") return BeltRemapAxis::NegZ; - if (s == "rev_x") return BeltRemapAxis::RevX; - if (s == "rev_y") return BeltRemapAxis::RevY; - if (s == "rev_z") return BeltRemapAxis::RevZ; - return BeltRemapAxis::PosX; + auto parse_remap_axis = [](const std::string &s) -> RemapAxis { + if (s == "pos_x") return RemapAxis::PosX; + if (s == "pos_y") return RemapAxis::PosY; + if (s == "pos_z") return RemapAxis::PosZ; + if (s == "neg_x") return RemapAxis::NegX; + if (s == "neg_y") return RemapAxis::NegY; + if (s == "neg_z") return RemapAxis::NegZ; + if (s == "rev_x") return RemapAxis::RevX; + if (s == "rev_y") return RemapAxis::RevY; + if (s == "rev_z") return RemapAxis::RevZ; + return RemapAxis::PosX; }; - if (boost::starts_with(comment, " belt_preslice_remap_x = ")) { - m_result.belt_preslice_remap_x = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + if (boost::starts_with(comment, " preslice_remap_x = ")) { + m_result.preslice_remap_x = parse_remap_axis(trim(std::string(comment.substr(25)))); return; } - if (boost::starts_with(comment, " belt_preslice_remap_y = ")) { - m_result.belt_preslice_remap_y = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + if (boost::starts_with(comment, " preslice_remap_y = ")) { + m_result.preslice_remap_y = parse_remap_axis(trim(std::string(comment.substr(25)))); return; } - if (boost::starts_with(comment, " belt_preslice_remap_z = ")) { - m_result.belt_preslice_remap_z = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + if (boost::starts_with(comment, " preslice_remap_z = ")) { + m_result.preslice_remap_z = parse_remap_axis(trim(std::string(comment.substr(25)))); return; } } // wipe start tag diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 7d08a9cdfd..4c6e4f6618 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -246,9 +246,9 @@ class Print; float belt_scale_y_angle{ 45.f }; BeltScaleMode belt_scale_z{ BeltScaleMode::None }; float belt_scale_z_angle{ 45.f }; - BeltRemapAxis belt_preslice_remap_x{ BeltRemapAxis::PosX }; - BeltRemapAxis belt_preslice_remap_y{ BeltRemapAxis::PosY }; - BeltRemapAxis belt_preslice_remap_z{ BeltRemapAxis::PosZ }; + RemapAxis preslice_remap_x{ RemapAxis::PosX }; + RemapAxis preslice_remap_y{ RemapAxis::PosY }; + RemapAxis preslice_remap_z{ RemapAxis::PosZ }; SettingsIds settings_ids; size_t filaments_count; bool backtrace_enabled; @@ -324,9 +324,9 @@ class Print; belt_scale_y_angle = other.belt_scale_y_angle; belt_scale_z = other.belt_scale_z; belt_scale_z_angle = other.belt_scale_z_angle; - belt_preslice_remap_x = other.belt_preslice_remap_x; - belt_preslice_remap_y = other.belt_preslice_remap_y; - belt_preslice_remap_z = other.belt_preslice_remap_z; + preslice_remap_x = other.preslice_remap_x; + preslice_remap_y = other.preslice_remap_y; + preslice_remap_z = other.preslice_remap_z; #if ENABLE_GCODE_VIEWER_STATISTICS time = other.time; #endif diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 51f82ea009..424d0b722d 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -20,6 +20,36 @@ namespace Slic3r { bool GCodeWriter::full_gcode_comment = true; +void GCodeWriter::set_axis_remap(int rx, int ry, int rz) +{ + m_remap_x = rx; + m_remap_y = ry; + m_remap_z = rz; +} + +void GCodeWriter::set_build_volume_max(const Vec3d &max) +{ + m_build_vol_max = max; +} + +bool GCodeWriter::has_axis_remap() const +{ + return m_remap_x != 0 || m_remap_y != 1 || m_remap_z != 2; +} + +Vec3d GCodeWriter::apply_axis_remap(const Vec3d &pos) const +{ + if (!has_axis_remap()) + return pos; + auto remap = [this, &pos](int r) -> double { + int axis = r % 3; + if (r < 3) return pos[axis]; + if (r < 6) return -pos[axis]; + return m_build_vol_max[axis] - pos[axis]; + }; + return { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; +} + bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) { return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware); @@ -562,7 +592,13 @@ std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &com Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - w.emit_xy(point_on_plate); + if (has_axis_remap()) { + // Axis remap may couple XY with Z; emit full XYZ in machine coordinates. + Vec3d machine = apply_axis_remap(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + w.emit_xyz(machine); + } else { + w.emit_xy(point_on_plate); + } auto speed = m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; w.emit_f(speed * 60.0); @@ -794,7 +830,13 @@ std::string GCodeWriter::_travel_to_z(double z, const std::string &comment) } GCodeG1Formatter w; - w.emit_z(z); + if (has_axis_remap()) { + // Remap may couple Z with other axes; emit full XYZ. + Vec3d machine = apply_axis_remap(Vec3d(m_pos.x() - m_x_offset, m_pos.y() - m_y_offset, z)); + w.emit_xyz(machine); + } else { + w.emit_z(z); + } w.emit_f(speed * 60.0); //BBS w.emit_comment(GCodeWriter::full_gcode_comment, comment); @@ -899,7 +941,12 @@ std::string GCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std: Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; GCodeG1Formatter w; - w.emit_xy(point_on_plate); + if (has_axis_remap()) { + Vec3d machine = apply_axis_remap(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); + w.emit_xyz(machine); + } else { + w.emit_xy(point_on_plate); + } if (!force_no_extrusion) w.emit_e(filament()->E()); //BBS @@ -939,6 +986,9 @@ std::string GCodeWriter::extrude_to_xyz(const Vec3d &point, double dE, const std //BBS: take plate offset into consider Vec3d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset, point(2) }; + if (has_axis_remap()) + point_on_plate = apply_axis_remap(point_on_plate); + GCodeG1Formatter w; w.emit_xyz(point_on_plate); if (!force_no_extrusion) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index c96c3ca2c1..6aa2ee8ffd 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -125,6 +125,12 @@ public: void set_is_first_layer(bool bval) { m_is_first_layer = bval; } GCodeFlavor get_gcode_flavor() const { return config.gcode_flavor; } + // Axis remap: permute/negate/reverse axes in G-code output. + // Works standalone (without belt mode) for printers with non-standard axis conventions. + void set_axis_remap(int rx, int ry, int rz); + void set_build_volume_max(const Vec3d &max); + bool has_axis_remap() const; + // Returns whether this flavor supports separate print and travel acceleration. static bool supports_separate_travel_acceleration(GCodeFlavor flavor); protected: @@ -141,6 +147,15 @@ protected: virtual std::string _travel_to_z(double z, const std::string &comment); + // Axis remap state — accessible to subclasses. + int m_remap_x = 0; // RemapAxis: 0=+X, 1=+Y, 2=+Z, 3=-X, etc. + int m_remap_y = 1; + int m_remap_z = 2; + Vec3d m_build_vol_max = Vec3d::Zero(); + + // Apply axis remap to a point. Returns pos unchanged if remap is identity. + Vec3d apply_axis_remap(const Vec3d &pos) const; + private: // Extruders are sorted by their ID, so that binary search is possible. std::vector m_filament_extruders; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 737ee2d663..399480075e 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1014,8 +1014,8 @@ static std::vector s_Preset_printer_options { "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", "belt_shear_y_global", "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", "belt_shear_z_global", "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", - "belt_preslice_remap_x", "belt_preslice_remap_y", "belt_preslice_remap_z", - "belt_gcode_remap_x", "belt_gcode_remap_y", "belt_gcode_remap_z", "belt_gcode_back_transform", + "preslice_remap_x", "preslice_remap_y", "preslice_remap_z", + "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", "gcode_back_transform", "belt_origin_snap_x", "belt_origin_offset_x", "belt_origin_snap_y", "belt_origin_offset_y", "belt_origin_snap_z", "belt_origin_offset_z", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 1f787a70cf..aca40e4952 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -101,9 +101,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n // or they are only notes not influencing the generated G-code. static std::unordered_set steps_gcode = { // Belt printer G-code axis remap (only affects G-code output, not slicing). - "belt_gcode_remap_x", - "belt_gcode_remap_y", - "belt_gcode_remap_z", + "gcode_remap_x", + "gcode_remap_y", + "gcode_remap_z", "belt_origin_snap_x", "belt_origin_offset_x", "belt_origin_snap_y", "belt_origin_offset_y", "belt_origin_snap_z", "belt_origin_offset_z", @@ -308,9 +308,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "belt_scale_y_angle" || opt_key == "belt_scale_z" || opt_key == "belt_scale_z_angle" - || opt_key == "belt_preslice_remap_x" - || opt_key == "belt_preslice_remap_y" - || opt_key == "belt_preslice_remap_z") { + || opt_key == "preslice_remap_x" + || opt_key == "preslice_remap_y" + || opt_key == "preslice_remap_z") { osteps.emplace_back(posSlice); } else if ( opt_key == "belt_support_floor_offset" diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 8c637b7f7c..0cb46c02f6 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -313,18 +313,18 @@ static t_config_enum_values s_keys_map_BeltScaleMode { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltScaleMode) -static t_config_enum_values s_keys_map_BeltRemapAxis { - { "pos_x", int(BeltRemapAxis::PosX) }, - { "pos_y", int(BeltRemapAxis::PosY) }, - { "pos_z", int(BeltRemapAxis::PosZ) }, - { "neg_x", int(BeltRemapAxis::NegX) }, - { "neg_y", int(BeltRemapAxis::NegY) }, - { "neg_z", int(BeltRemapAxis::NegZ) }, - { "rev_x", int(BeltRemapAxis::RevX) }, - { "rev_y", int(BeltRemapAxis::RevY) }, - { "rev_z", int(BeltRemapAxis::RevZ) }, +static t_config_enum_values s_keys_map_RemapAxis { + { "pos_x", int(RemapAxis::PosX) }, + { "pos_y", int(RemapAxis::PosY) }, + { "pos_z", int(RemapAxis::PosZ) }, + { "neg_x", int(RemapAxis::NegX) }, + { "neg_y", int(RemapAxis::NegY) }, + { "neg_z", int(RemapAxis::NegZ) }, + { "rev_x", int(RemapAxis::RevX) }, + { "rev_y", int(RemapAxis::RevY) }, + { "rev_z", int(RemapAxis::RevZ) }, }; -CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltRemapAxis) +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(RemapAxis) static t_config_enum_values s_keys_map_BeltSupportFloorMode { { "none", int(BeltSupportFloorMode::None) }, @@ -6124,49 +6124,49 @@ void PrintConfigDef::init_fff_params() add_belt_scale_angle("belt_scale_z_angle", "Angle"); // G-code axis remap with sign - auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, BeltRemapAxis default_axis) { + auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, RemapAxis default_axis) { auto def = this->add(key, coEnum); def->label = L(label); def->category = L("Printable space"); def->tooltip = L(tooltip); - def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"pos_x", "pos_y", "pos_z", "neg_x", "neg_y", "neg_z", "rev_x", "rev_y", "rev_z"}; def->enum_labels = {L("+X"), L("+Y"), L("+Z"), L("-X"), L("-Y"), L("-Z"), L("Rev X"), L("Rev Y"), L("Rev Z")}; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionEnum(default_axis)); + def->mode = comSimple; // Visibility controlled by toggle_line in Tab.cpp + def->set_default_value(new ConfigOptionEnum(default_axis)); }; - add_belt_remap("belt_preslice_remap_x", "X", + add_belt_remap("preslice_remap_x", "X", "Before slicing, which model-space axis becomes the slicer's X axis. " "Use this to re-orient the coordinate system so the slicer's XY plane matches " "your belt printer's physical bed plane. For a printer whose bed is in the XZ plane, " "set Y to +Z and Z to +Y (or -Y) to swap the vertical and belt-travel axes. " "Default +X: no change.", - BeltRemapAxis::PosX); - add_belt_remap("belt_preslice_remap_y", "Y", + RemapAxis::PosX); + add_belt_remap("preslice_remap_y", "Y", "Before slicing, which model-space axis becomes the slicer's Y axis. " "The slicer treats Y as one of the two horizontal bed axes. If your physical " "belt surface runs along the Z axis, map Y to +Z here so the slicer slices " "along the correct plane. Default +Y: no change.", - BeltRemapAxis::PosY); - add_belt_remap("belt_preslice_remap_z", "Z", + RemapAxis::PosY); + add_belt_remap("preslice_remap_z", "Z", "Before slicing, which model-space axis becomes the slicer's Z axis (layer stacking direction). " "The slicer builds layers upward along this axis. If your printer's layer-stacking " "direction is the physical Y axis, map Z to +Y (or -Y for inverted direction). " "Rev mode mirrors relative to the build volume maximum. Default +Z: no change.", - BeltRemapAxis::PosZ); + RemapAxis::PosZ); - add_belt_remap("belt_gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosX); - add_belt_remap("belt_gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosY); - add_belt_remap("belt_gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", BeltRemapAxis::PosZ); + add_belt_remap("gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosX); + add_belt_remap("gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosY); + add_belt_remap("gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosZ); - def = this->add("belt_gcode_back_transform", coBool); + def = this->add("gcode_back_transform", coBool); def->label = L("G-code back-transform"); def->category = L("Printable space"); def->tooltip = L("Reverse the shear/scale transform applied during slicing so G-code " "coordinates are in the machine's physical coordinate space. " "Requires at least one shear axis with global mode enabled."); - def->mode = comAdvanced; + def->mode = comSimple; // Visibility controlled by toggle_line in Tab.cpp def->set_default_value(new ConfigOptionBool(false)); auto add_belt_origin_snap = [this](const char *key_snap, const char *key_offset, diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 13202657ef..5d9f977ed1 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -181,7 +181,7 @@ enum class BeltAxis Z = 2, }; -enum class BeltRemapAxis +enum class RemapAxis { PosX = 0, PosY = 1, PosZ = 2, NegX = 3, NegY = 4, NegZ = 5, @@ -549,7 +549,7 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SlicingMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltShearMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltScaleMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltAxis) -CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltRemapAxis) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(RemapAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportFloorMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportZOffsetMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialPattern) @@ -1487,13 +1487,13 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, belt_scale_y_angle)) ((ConfigOptionEnum, belt_scale_z)) ((ConfigOptionFloat, belt_scale_z_angle)) - ((ConfigOptionEnum, belt_preslice_remap_x)) - ((ConfigOptionEnum, belt_preslice_remap_y)) - ((ConfigOptionEnum, belt_preslice_remap_z)) - ((ConfigOptionEnum, belt_gcode_remap_x)) - ((ConfigOptionEnum, belt_gcode_remap_y)) - ((ConfigOptionEnum, belt_gcode_remap_z)) - ((ConfigOptionBool, belt_gcode_back_transform)) + ((ConfigOptionEnum, preslice_remap_x)) + ((ConfigOptionEnum, preslice_remap_y)) + ((ConfigOptionEnum, preslice_remap_z)) + ((ConfigOptionEnum, gcode_remap_x)) + ((ConfigOptionEnum, gcode_remap_y)) + ((ConfigOptionEnum, gcode_remap_z)) + ((ConfigOptionBool, gcode_back_transform)) ((ConfigOptionBool, belt_origin_snap_x)) ((ConfigOptionFloat, belt_origin_offset_x)) ((ConfigOptionBool, belt_origin_snap_y)) diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 3067772f09..7279b83d14 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -144,11 +144,31 @@ static std::vector slice_volumes_inner( params_base.closing_radius = print_object_config.slice_closing_radius.value; params_base.extra_offset = 0; params_base.trafo = object_trafo; + // Standalone pre-slice axis remap (works without belt mode). + bool has_remap = BeltTransformPipeline::has_preslice_remap(print_config); + if (has_remap) + params_base.trafo = BeltTransformPipeline::build_preslice_remap(print_config) * params_base.trafo; { - // Belt printer: apply pre-slice transforms (remap, shear, scale, z-shift) via strategy. + // Belt-specific transforms (shear, scale, z-shift) via strategy. auto belt_strategy = BeltSliceStrategy::create(print_config); if (belt_strategy) - belt_strategy->apply_to_trafo(params_base.trafo, model_volumes, out_belt_min_z); + belt_strategy->apply_to_trafo(params_base.trafo, model_volumes, has_remap, out_belt_min_z); + } + // If only remap (no belt), still need z-shift detection. + if (has_remap && !print_config.belt_printer.value) { + double min_z = std::numeric_limits::max(); + for (const ModelVolume *mv : model_volumes) { + if (!mv->is_model_part()) continue; + for (const stl_vertex &v : mv->mesh().its.vertices) { + Vec3d pt = params_base.trafo * v.cast(); + min_z = std::min(min_z, pt.z()); + } + } + if (min_z < 0. && min_z != std::numeric_limits::max()) { + Transform3d z_shift = Transform3d::Identity(); + z_shift.matrix()(2, 3) = -min_z; + params_base.trafo = z_shift * params_base.trafo; + } } //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 202c28c121..e43e979955 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4436,19 +4436,19 @@ void TabPrinter::build_fff() L("Remap model axes before slicing so the slicer's coordinate system matches " "the physical bed orientation. For belt printers whose bed is NOT in the XY plane, " "use this to swap axes so layers are stacked in the correct physical direction.") }; - line.append_option(optgroup->get_option("belt_preslice_remap_x")); - line.append_option(optgroup->get_option("belt_preslice_remap_y")); - line.append_option(optgroup->get_option("belt_preslice_remap_z")); + line.append_option(optgroup->get_option("preslice_remap_x")); + line.append_option(optgroup->get_option("preslice_remap_y")); + line.append_option(optgroup->get_option("preslice_remap_z")); optgroup->append_line(line); } { Line line = { L("G-code axis remap (post-slice)"), L("Remap slicing-frame axes to machine axes in G-code output. Applied AFTER slicing, during G-code generation.") }; - line.append_option(optgroup->get_option("belt_gcode_remap_x")); - line.append_option(optgroup->get_option("belt_gcode_remap_y")); - line.append_option(optgroup->get_option("belt_gcode_remap_z")); + line.append_option(optgroup->get_option("gcode_remap_x")); + line.append_option(optgroup->get_option("gcode_remap_y")); + line.append_option(optgroup->get_option("gcode_remap_z")); optgroup->append_line(line); } - optgroup->append_single_option_line("belt_gcode_back_transform"); + optgroup->append_single_option_line("gcode_back_transform"); { Line line = { L("Origin snap X"), L("Snap object bbox min X to offset in G-code output") }; line.append_option(optgroup->get_option("belt_origin_snap_x")); @@ -5321,11 +5321,14 @@ void TabPrinter::toggle_options() toggle_line("belt_printer_infinite_y", is_belt); for (auto el : {"belt_shear_x", "belt_shear_y", "belt_shear_z", "belt_scale_x", "belt_scale_y", "belt_scale_z", - "belt_preslice_remap_x", - "belt_gcode_remap_x", "belt_gcode_back_transform", "belt_origin_snap_x", "belt_origin_snap_y", "belt_origin_snap_z"}) toggle_line(el, is_belt); + // Remap options: visible when belt mode is on OR when UI is in developer mode. + bool show_remap = is_belt || (m_mode >= comDevelop); + for (auto el : {"preslice_remap_x", "gcode_remap_x", "gcode_back_transform"}) + toggle_line(el, show_remap); + // Gray out angle/from sub-options when their parent shear/scale mode is None. auto sx = m_config->option>("belt_shear_x")->value; toggle_option("belt_shear_x_angle", is_belt && sx != BeltShearMode::None); From 783acd932a1d97343f9467373036f48cfac324f4 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 28 Mar 2026 04:03:39 -0500 Subject: [PATCH 020/389] revert CLAUDE.md --- CLAUDE.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9bd162c42c..25aa516a56 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -23,7 +23,27 @@ cmake --build build/arm64 --config RelWithDebInfo --target all -- ### Building on Linux **Always use this command to build the project when testing build issues on Linux.** ```bash -systemd-run --user --scope -p MemoryMax=48G cmake --build build --config RelWithDebInfo --target all -- -j18 -l 24 +cmake --build build/arm64 --config RelWithDebInfo --target all -- + +``` +### Build test: + +**Always use this command to build the project when testing build issues on Windows.** +```bash +cmake --build . --config %build_type% --target ALL_BUILD -- -m +``` + +### Building on macOS +**Always use this command to build the project when testing build issues on macOS.** +```bash +cmake --build build/arm64 --config RelWithDebInfo --target all -- +``` + +### Building on Linux + **Always use this command to build the project when testing build issues on Linux.** +```bash +cmake --build build --config RelWithDebInfo --target all -- + ``` From e9a579b604ba3f937b22cfbf48986cab834a0b03 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sun, 29 Mar 2026 13:14:25 -0500 Subject: [PATCH 021/389] switch default shear axis, swap to tan(a) instead of cot(a) --- src/libslic3r/PrintConfig.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 0cb46c02f6..a601a35a17 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6066,13 +6066,13 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionEnum(default_axis)); }; - auto add_belt_shear_global = [this](const char *key, const char *label) { + auto add_belt_shear_global = [this](const char *key, const char *label, bool default_val = false) { auto def = this->add(key, coBool); def->label = L(label); def->category = L("Printable space"); def->tooltip = L("Apply shear in global coordinates (position-aware) rather than object-local coordinates."); def->mode = comAdvanced; - def->set_default_value(new ConfigOptionBool(false)); + def->set_default_value(new ConfigOptionBool(default_val)); }; add_belt_shear_mode("belt_shear_x", "Function", BeltShearMode::None); @@ -6080,15 +6080,15 @@ void PrintConfigDef::init_fff_params() add_belt_axis_enum("belt_shear_x_from", "From", "Source axis for X shear.", BeltAxis::Z); add_belt_shear_global("belt_shear_x_global", "Global"); - add_belt_shear_mode("belt_shear_y", "Function", BeltShearMode::PosCot); + add_belt_shear_mode("belt_shear_y", "Function", BeltShearMode::None); add_belt_shear_angle("belt_shear_y_angle", "Angle"); add_belt_axis_enum("belt_shear_y_from", "From", "Source axis for Y shear.", BeltAxis::Z); add_belt_shear_global("belt_shear_y_global", "Global"); - add_belt_shear_mode("belt_shear_z", "Function", BeltShearMode::None); + add_belt_shear_mode("belt_shear_z", "Function", BeltShearMode::PosTan); add_belt_shear_angle("belt_shear_z_angle", "Angle"); add_belt_axis_enum("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y); - add_belt_shear_global("belt_shear_z_global", "Global"); + add_belt_shear_global("belt_shear_z_global", "Global", true); // Per-axis scale controls for belt printer auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode) { From 1e9ee0c12050d4458d399447a3d00df983b60bc3 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Tue, 7 Apr 2026 10:37:34 +0800 Subject: [PATCH 022/389] add a generic belt printer --- resources/profiles/Custom.json | 26 ++++- .../Custom/Generic Belt Printer_cover.png | Bin 0 -> 30205 bytes .../machine/MyBeltPrinter 0.2 nozzle.json | 26 +++++ .../machine/MyBeltPrinter 0.4 nozzle.json | 20 ++++ .../machine/MyBeltPrinter 0.6 nozzle.json | 26 +++++ .../machine/MyBeltPrinter 0.8 nozzle.json | 26 +++++ .../Custom/machine/MyBeltPrinter.json | 12 +++ .../Custom/machine/fdm_belt_common.json | 98 ++++++++++++++++++ 8 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 resources/profiles/Custom/Generic Belt Printer_cover.png create mode 100644 resources/profiles/Custom/machine/MyBeltPrinter 0.2 nozzle.json create mode 100644 resources/profiles/Custom/machine/MyBeltPrinter 0.4 nozzle.json create mode 100644 resources/profiles/Custom/machine/MyBeltPrinter 0.6 nozzle.json create mode 100644 resources/profiles/Custom/machine/MyBeltPrinter 0.8 nozzle.json create mode 100644 resources/profiles/Custom/machine/MyBeltPrinter.json create mode 100644 resources/profiles/Custom/machine/fdm_belt_common.json diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index 37927a90fe..4c64f0a205 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,9 +1,13 @@ { "name": "Custom Printer", - "version": "02.03.02.60", + "version": "02.03.02.61", "force_update": "0", "description": "My configurations", "machine_model_list": [ + { + "name": "Generic Belt Printer", + "sub_path": "machine/MyBeltPrinter.json" + }, { "name": "Generic Klipper Printer", "sub_path": "machine/MyKlipper.json" @@ -246,6 +250,10 @@ "name": "MyKlipper 0.8 nozzle", "sub_path": "machine/MyKlipper 0.8 nozzle.json" }, + { + "name": "fdm_belt_common", + "sub_path": "machine/fdm_belt_common.json" + }, { "name": "fdm_toolchanger_common", "sub_path": "machine/fdm_toolchanger_common.json" @@ -254,6 +262,22 @@ "name": "MyRRF 0.4 nozzle", "sub_path": "machine/MyRRF 0.4 nozzle.json" }, + { + "name": "MyBeltPrinter 0.2 nozzle", + "sub_path": "machine/MyBeltPrinter 0.2 nozzle.json" + }, + { + "name": "MyBeltPrinter 0.4 nozzle", + "sub_path": "machine/MyBeltPrinter 0.4 nozzle.json" + }, + { + "name": "MyBeltPrinter 0.6 nozzle", + "sub_path": "machine/MyBeltPrinter 0.6 nozzle.json" + }, + { + "name": "MyBeltPrinter 0.8 nozzle", + "sub_path": "machine/MyBeltPrinter 0.8 nozzle.json" + }, { "name": "MyToolChanger 0.2 nozzle", "sub_path": "machine/MyToolChanger 0.2 nozzle.json" diff --git a/resources/profiles/Custom/Generic Belt Printer_cover.png b/resources/profiles/Custom/Generic Belt Printer_cover.png new file mode 100644 index 0000000000000000000000000000000000000000..d42f2ef228b2cfcdb0d16a525b4fde4d68b3010d GIT binary patch literal 30205 zcmV(|K+(U6P)Px#1ZP1_K>z@;j|==^1poj7(@;!QMMrQ9vvdt+}$iKJSZnH zA0H|;Fg+1etCmDI7LcNVk$F7PEA~Vdy73i zOgS+=h=-FG79oX*ie6rCV`zDdiHKK=o@{S_(9q1XsG{cG(V?THU}Jl!v9#UV)br7~ zL^UuWASP*JVIUqM5D*ncHZo{oU>6u292y-J78`42WD5)u5fd3EA|)6ZARHSbgo=(r zGB51y?1G4kB_t|VMnh;{UM(swEG8%y6BdSykniyDQ$s*)XlNW486p!S>FVizf`&0L zH!&?RP(VC~j+E!<=Zcb-8VwwQg@`F9F9-(=q^+>>^z%PHLVSRPWnEk~H9O32OGHCP zWLjF|<>X;kR?VAnkeQx2IzL-aPE1Wvp{lNomYh5;EK*ZeM@UOvQ&U=8VRUzUZ*X&y zouX`zrjSXGu(r9Xw7E<@J4-q?D;Fv^Gc|pMi@wFjSW8JrI5cu|c6WMy_W1aVkdj_t zWy{jkd3}Kx4-lB5rd3y6MreJJQ$K zacpdgLx+%4kF2w`(v4u7Oq!9EmV!Keq_4DqM}Ei4%(1(_W@v1kQ=Y$*acVkca+j)7 zEKQrApixIir(von8Wy0Xrkkg%wz|5yzreU~OJOQkz01+4glC^xp{u#TJt!ewZi;6y zU(l0fq_Vj&ARBE*ZHZ=3QcO+6c~h`!w9KP?ezCw=V|<%!RGW8SQZ-O@Q$c@RNVIra zyl6mpov&U&GPs6jmuH-GskzL8S!hc-gkXs|4=;C9dQUPaTR>d={{5|cwwraNzIMg8 zguz%HONYJ5!-C7ck;-Ftjzzr5{94aK0000zbW%=J009F1{QUkt^WW2~=54zyAEQvu zX$4zPjfOlFF6sw-+yk5Z84|(%4Z|b(`3&{xql-TAS1ZvTG7vpjC~|ZO&X2ML>I2o-MHS6m2$}!ODfN z%SF*AiYLb`*&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+Ce?y-p>uAmCT zwh-!NiIR<|+T9Uy&roN4<}UBI{t-mxw!tvf`68E7sVS+P2D&+flH~balXe2&(xH@w zoorQot{Y)I4r07+TW)kvdn|nSWS7A2>3PWJN9y+4 zdOD}xoG&_eE=jWvit=FOUQ&*Ffv_w$I6(xPSgyQ#$5f|SPDGM(1$P=|`8Tg_t?>Ar z{l-v*xnA#=DGJ4CpR(e(ZCR&>a>Xh-@%`|^o?05og~VJQ73UqG+c^f1HPq;<6_FY? z$AN6crde#YIHeRilkWnL)OhT!Clhmf7GhZyOAJ=7GzQJ;TZ|poa=m>5$E4KmiXb?< z^CRaO?mZ>RrnZ-)WuPrqj+zd~hjPXDGP1cHb-m!7xLAZ%v;?haUbFcTy1lcpscaIB zBgW0n$nu2iwL{?t{@B(Se>y+%$s7ZS^QMuP-;m`c^FYm5{2=frkq$B;y*mHd{HT1E z`zD-mZlX@l3%%2E1R{_tcl}wxeMrML(z0yp1X?lDpz-2(aVqgFPcoBH?Rg0@8^<46 zP-}6SWa8N#MM;2#8Bn+LODpSZiRYNjkG1F3_2rFha>k Date: Thu, 9 Apr 2026 23:48:43 -0500 Subject: [PATCH 023/389] add global mesh transform option --- resources/profiles/Custom.json | 2 +- .../Custom/machine/fdm_belt_common.json | 2 + src/libslic3r/BeltGCode.cpp | 35 +++++++++ src/libslic3r/GCode/BeltBackTransform.cpp | 4 +- src/libslic3r/Preset.cpp | 3 +- src/libslic3r/Print.hpp | 3 + src/libslic3r/PrintApply.cpp | 12 ++-- src/libslic3r/PrintConfig.cpp | 19 +++++ src/libslic3r/PrintConfig.hpp | 2 + src/libslic3r/PrintObjectSlice.cpp | 71 ++++++++++++------- src/slic3r/GUI/Tab.cpp | 22 ++++-- 11 files changed, 135 insertions(+), 40 deletions(-) diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index 4c64f0a205..2e697a7b54 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,6 +1,6 @@ { "name": "Custom Printer", - "version": "02.03.02.61", + "version": "02.03.02.62", "force_update": "0", "description": "My configurations", "machine_model_list": [ diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index dd8b166805..46603f7faf 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -84,11 +84,13 @@ ], "preslice_remap_y": "pos_z", "preslice_remap_z": "pos_y", + "preslice_remap_global": "1", "printer_extruder_id": [ "1" ], "belt_origin_snap_y": "1", "belt_printer": "1", + "belt_preslice_global": "1", "belt_shear_z": "pos_cot", "belt_shear_z_angle": "30", "build_plate_tilt_x": "45", diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index 40dabf98dc..a34acf95bd 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -56,10 +56,45 @@ void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) file.write_format("; preslice_remap_x = %s\n", full_cfg.opt_serialize("preslice_remap_x").c_str()); file.write_format("; preslice_remap_y = %s\n", full_cfg.opt_serialize("preslice_remap_y").c_str()); file.write_format("; preslice_remap_z = %s\n", full_cfg.opt_serialize("preslice_remap_z").c_str()); + file.write_format("; preslice_remap_global = %d\n", print.config().preslice_remap_global.value ? 1 : 0); + file.write_format("; belt_preslice_global = %d\n", print.config().belt_preslice_global.value ? 1 : 0); } void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) { + // Global pre-slice mode: adjust origin using computed correction. + // Transform the origin through the belt pipeline so that + // back_transform(T * origin) = origin (correct machine position). + // This replaces the bbox-based axis snap with an exact formula. + // + // Two flags trigger this path: + // belt_preslice_global — full pipeline (scale * shear * remap) is global + // preslice_remap_global — only the pre-slice remap is global + // The XY origin adjustment uses the FULL forward transform either way, + // because the back_transform applied during G-code emission is always the + // inverse of the full pipeline. When only the remap is configured, both + // flags produce identical math (T == R). + bool use_global = m_config.belt_preslice_global.value + || (m_config.preslice_remap_global.value + && BeltTransformPipeline::has_preslice_remap(m_config)); + if (use_global && m_config.belt_printer.value) { + auto *belt_writer = dynamic_cast(m_writer.get()); + if (belt_writer) { + // Clear snap — not needed with computed corrections + for (int a = 0; a < 3; ++a) + belt_writer->set_origin_snap(a, false, 0., 0.); + } + + // Adjust origin: transform through belt forward pipeline so that + // the back-transform correctly recovers model-space positions. + Transform3d T = BeltTransformPipeline::build_forward_transform(m_config); + Vec2d cur_origin = this->origin(); + Vec3d origin3d(cur_origin.x(), cur_origin.y(), 0.); + Vec3d adjusted = T.linear() * origin3d; + this->set_origin(Vec2d(adjusted.x(), adjusted.y())); + return; + } + if (!m_origin_snap[0] && !m_origin_snap[1] && !m_origin_snap[2]) return; diff --git a/src/libslic3r/GCode/BeltBackTransform.cpp b/src/libslic3r/GCode/BeltBackTransform.cpp index b9cdac779f..893c46e52b 100644 --- a/src/libslic3r/GCode/BeltBackTransform.cpp +++ b/src/libslic3r/GCode/BeltBackTransform.cpp @@ -15,7 +15,9 @@ bool BeltBackTransform::init_from_config(const PrintConfig &config) bool has_global_shear = config.belt_shear_x_global.value || config.belt_shear_y_global.value || config.belt_shear_z_global.value; - if (!has_global_shear && !BeltTransformPipeline::has_preslice_remap(config)) + bool has_preslice_global = config.belt_preslice_global.value + || config.preslice_remap_global.value; + if (!has_global_shear && !has_preslice_global && !BeltTransformPipeline::has_preslice_remap(config)) return false; // Build the forward pipeline (scale * shear * pre_remap) and store its inverse. diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 399480075e..4d01757826 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1014,8 +1014,9 @@ static std::vector s_Preset_printer_options { "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", "belt_shear_y_global", "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", "belt_shear_z_global", "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", - "preslice_remap_x", "preslice_remap_y", "preslice_remap_z", + "preslice_remap_x", "preslice_remap_y", "preslice_remap_z", "preslice_remap_global", "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", "gcode_back_transform", + "belt_preslice_global", "belt_origin_snap_x", "belt_origin_offset_x", "belt_origin_snap_y", "belt_origin_offset_y", "belt_origin_snap_z", "belt_origin_offset_z", diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index 9a5d000e1c..074ff52bf3 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -585,9 +585,12 @@ private: double m_belt_global_z_offset { 0.0 }; // Belt printer: min_z of mesh after belt shear (before Z-shift), for z_offset calc. double m_belt_min_z { 0.0 }; + // Belt printer: XY correction from global pre-slice mode, applied to G-code origin. + Vec2d m_belt_global_xy_correction { Vec2d::Zero() }; public: double belt_global_z_offset() const { return m_belt_global_z_offset; } double belt_min_z() const { return m_belt_min_z; } + Vec2d belt_global_xy_correction() const { return m_belt_global_xy_correction; } private: diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index 7f3b41b0f1..a68c390477 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -1,6 +1,7 @@ #include "ClipperUtils.hpp" #include "Model.hpp" #include "Print.hpp" +#include "BeltTransform.hpp" #include #include @@ -1520,8 +1521,10 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ // Orca: Updated for XYZ filament shrink compensation // Belt global mode: force each instance into its own PrintObject // so each gets independent layer Z values. - bool belt_force_separate = m_config.belt_printer.value && m_config.belt_shear_z_global.value - && m_config.belt_shear_z.value != BeltShearMode::None; + bool belt_force_separate = m_config.belt_printer.value && ( + (m_config.belt_shear_z_global.value && m_config.belt_shear_z.value != BeltShearMode::None) + || m_config.belt_preslice_global.value + || (m_config.preslice_remap_global.value && BeltTransformPipeline::has_preslice_remap(m_config))); model_object_status.print_instances = print_objects_from_model_object(*model_object, this->shrinkage_compensation(), belt_force_separate); std::vector old; old.reserve(print_object_status_db.count(*model_object)); @@ -1612,8 +1615,9 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ // min_shift across all objects, so one move affects everyone). if (belt_instances_shifted && m_config.belt_printer.value - && m_config.belt_shear_z_global.value - && m_config.belt_shear_z.value != BeltShearMode::None) { + && ((m_config.belt_shear_z_global.value && m_config.belt_shear_z.value != BeltShearMode::None) + || m_config.belt_preslice_global.value + || (m_config.preslice_remap_global.value && BeltTransformPipeline::has_preslice_remap(m_config)))) { for (PrintObject *object : m_objects) update_apply_status(object->invalidate_step(posSlice)); } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index a601a35a17..47d0b9c549 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6156,6 +6156,16 @@ void PrintConfigDef::init_fff_params() "Rev mode mirrors relative to the build volume maximum. Default +Z: no change.", RemapAxis::PosZ); + def = this->add("preslice_remap_global", coBool); + def->label = L("Global"); + def->category = L("Printable space"); + def->tooltip = L("When enabled, the pre-slice axis remap accounts for each object's bed position. " + "Without this, the remap is applied locally around each object's center, so " + "objects at different positions don't get a position-dependent contribution. " + "Mirrors the per-axis 'Global' option on belt mesh shears, but for the remap."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + add_belt_remap("gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosX); add_belt_remap("gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosY); add_belt_remap("gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosZ); @@ -6169,6 +6179,15 @@ void PrintConfigDef::init_fff_params() def->mode = comSimple; // Visibility controlled by toggle_line in Tab.cpp def->set_default_value(new ConfigOptionBool(false)); + def = this->add("belt_preslice_global", coBool); + def->label = L("Global mesh transforms"); + def->category = L("Printable space"); + def->tooltip = L("When enabled, pre-slice belt transforms (remap, shear, scale) account for " + "each object's bed position, producing correct machine coordinates without " + "relying on origin snap. Each instance gets its own PrintObject."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + auto add_belt_origin_snap = [this](const char *key_snap, const char *key_offset, const char *axis_label) { auto def = this->add(key_snap, coBool); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 5d9f977ed1..d17c46f0aa 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1490,10 +1490,12 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, preslice_remap_x)) ((ConfigOptionEnum, preslice_remap_y)) ((ConfigOptionEnum, preslice_remap_z)) + ((ConfigOptionBool, preslice_remap_global)) ((ConfigOptionEnum, gcode_remap_x)) ((ConfigOptionEnum, gcode_remap_y)) ((ConfigOptionEnum, gcode_remap_z)) ((ConfigOptionBool, gcode_back_transform)) + ((ConfigOptionBool, belt_preslice_global)) ((ConfigOptionBool, belt_origin_snap_x)) ((ConfigOptionFloat, belt_origin_offset_x)) ((ConfigOptionBool, belt_origin_snap_y)) diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 7279b83d14..7711610004 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -906,6 +906,7 @@ void PrintObject::slice() BOOST_LOG_TRIVIAL(warning) << "Belt global check: belt_printer=" << pcfg.belt_printer.value << " belt_shear_z=" << int(pcfg.belt_shear_z.value) << " belt_shear_z_global=" << pcfg.belt_shear_z_global.value + << " belt_preslice_global=" << pcfg.belt_preslice_global.value << " object=" << this->model_object()->name; if (pcfg.belt_printer.value) { @@ -916,37 +917,53 @@ void PrintObject::slice() << " shift=(" << unscale(inst_shift.x()) << ", " << unscale(inst_shift.y()) << ")"; double global_z_offset = 0.; - struct GAxis { BeltShearMode mode; double angle; int from; bool global; }; - GAxis gaxes[3] = { - { pcfg.belt_shear_x.value, pcfg.belt_shear_x_angle.value, int(pcfg.belt_shear_x_from.value), pcfg.belt_shear_x_global.value }, - { pcfg.belt_shear_y.value, pcfg.belt_shear_y_angle.value, int(pcfg.belt_shear_y_from.value), pcfg.belt_shear_y_global.value }, - { pcfg.belt_shear_z.value, pcfg.belt_shear_z_angle.value, int(pcfg.belt_shear_z_from.value), pcfg.belt_shear_z_global.value }, - }; + if (pcfg.belt_preslice_global.value) { + // Global pre-slice mode: compute full correction c = (T.linear() - I) * d + // where T is the belt forward transform and d is the bed position. + Transform3d T = BeltTransformPipeline::build_forward_transform(pcfg); + Vec3d d(unscale(inst_shift.x()), unscale(inst_shift.y()), 0.); + Vec3d c = T.linear() * d - d; - // Only the Z-row shear contributes a Z offset from global mode. - // (X/Y row shears with global would offset X/Y, not Z — not useful here.) - // Offsets are RELATIVE: we subtract the minimum shift across all - // PrintObjects so the lowest-positioned object stays at Z=0. - const auto &za = gaxes[2]; // Z row - if (za.global && za.mode != BeltShearMode::None && za.from < 2) { - double factor = BeltTransformPipeline::compute_shear_factor(za.mode, za.angle); - // The global Z offset accounts for the instance's position- - // dependent shear contribution. m_belt_min_z is the minimum Z - // of the mesh after pre_remap + shear + trafo_centered, which - // includes the centering offset on the remapped Z axis. - // Subtract the belt surface's centered Z position so we get - // only the shear-induced contribution (same correction as the - // belt_floor_z_shift fix). - double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) - ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; - double shear_min_z = m_belt_min_z - belt_surface_z; - Point phys = inst_shift; // already has center_offset subtracted - double center_on_axis = (za.from == 0) ? unscale(phys.x()) : unscale(phys.y()); - global_z_offset += center_on_axis * factor + shear_min_z; + global_z_offset = c.z(); + m_belt_global_xy_correction = Vec2d(c.x(), c.y()); + + BOOST_LOG_TRIVIAL(warning) << "Belt preslice_global: correction=(" + << c.x() << ", " << c.y() << ", " << c.z() << ")"; + } else { + struct GAxis { BeltShearMode mode; double angle; int from; bool global; }; + GAxis gaxes[3] = { + { pcfg.belt_shear_x.value, pcfg.belt_shear_x_angle.value, int(pcfg.belt_shear_x_from.value), pcfg.belt_shear_x_global.value }, + { pcfg.belt_shear_y.value, pcfg.belt_shear_y_angle.value, int(pcfg.belt_shear_y_from.value), pcfg.belt_shear_y_global.value }, + { pcfg.belt_shear_z.value, pcfg.belt_shear_z_angle.value, int(pcfg.belt_shear_z_from.value), pcfg.belt_shear_z_global.value }, + }; + + // Only the Z-row shear contributes a Z offset from global mode. + // (X/Y row shears with global would offset X/Y, not Z — not useful here.) + const auto &za = gaxes[2]; // Z row + if (za.global && za.mode != BeltShearMode::None && za.from < 2) { + double factor = BeltTransformPipeline::compute_shear_factor(za.mode, za.angle); + double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) + ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; + double shear_min_z = m_belt_min_z - belt_surface_z; + Point phys = inst_shift; + double center_on_axis = (za.from == 0) ? unscale(phys.x()) : unscale(phys.y()); + global_z_offset += center_on_axis * factor + shear_min_z; + } + + // Pre-slice remap global mode: when on, the remap accounts for the + // instance bed position. The Z component of the correction + // (R - I) * d shifts layer print_z so e.g. a Y↔Z swap with an + // object at Y=50 prints at Z=50. + if (pcfg.preslice_remap_global.value + && BeltTransformPipeline::has_preslice_remap(pcfg)) { + Transform3d R = BeltTransformPipeline::build_preslice_remap(pcfg); + Vec3d d(unscale(inst_shift.x()), unscale(inst_shift.y()), 0.); + Vec3d remap_correction = R.linear() * d - d; + global_z_offset += remap_correction.z(); + } } BOOST_LOG_TRIVIAL(warning) << "Belt global: z_offset=" << global_z_offset - << " za.global=" << za.global << " za.mode=" << int(za.mode) << " za.from=" << za.from << " (relative to min across " << this->print()->objects().size() << " objects)"; m_belt_global_z_offset = global_z_offset; if (std::abs(global_z_offset) > EPSILON) { diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index e43e979955..986ff614f6 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4439,6 +4439,7 @@ void TabPrinter::build_fff() line.append_option(optgroup->get_option("preslice_remap_x")); line.append_option(optgroup->get_option("preslice_remap_y")); line.append_option(optgroup->get_option("preslice_remap_z")); + line.append_option(optgroup->get_option("preslice_remap_global")); optgroup->append_line(line); } { @@ -4448,6 +4449,7 @@ void TabPrinter::build_fff() line.append_option(optgroup->get_option("gcode_remap_z")); optgroup->append_line(line); } + optgroup->append_single_option_line("belt_preslice_global"); optgroup->append_single_option_line("gcode_back_transform"); { Line line = { L("Origin snap X"), L("Snap object bbox min X to offset in G-code output") }; @@ -5328,22 +5330,29 @@ void TabPrinter::toggle_options() bool show_remap = is_belt || (m_mode >= comDevelop); for (auto el : {"preslice_remap_x", "gcode_remap_x", "gcode_back_transform"}) toggle_line(el, show_remap); + toggle_line("belt_preslice_global", show_remap); + + bool belt_global = is_belt && m_config->opt_bool("belt_preslice_global"); + + // preslice_remap_global: superseded by belt_preslice_global + toggle_option("preslice_remap_global", show_remap && !belt_global); // Gray out angle/from sub-options when their parent shear/scale mode is None. + // Per-axis globals are superseded when belt_preslice_global is on. auto sx = m_config->option>("belt_shear_x")->value; toggle_option("belt_shear_x_angle", is_belt && sx != BeltShearMode::None); toggle_option("belt_shear_x_from", is_belt && sx != BeltShearMode::None); - toggle_option("belt_shear_x_global", is_belt && sx != BeltShearMode::None); + toggle_option("belt_shear_x_global", is_belt && sx != BeltShearMode::None && !belt_global); auto sy = m_config->option>("belt_shear_y")->value; toggle_option("belt_shear_y_angle", is_belt && sy != BeltShearMode::None); toggle_option("belt_shear_y_from", is_belt && sy != BeltShearMode::None); - toggle_option("belt_shear_y_global", is_belt && sy != BeltShearMode::None); + toggle_option("belt_shear_y_global", is_belt && sy != BeltShearMode::None && !belt_global); auto sz = m_config->option>("belt_shear_z")->value; toggle_option("belt_shear_z_angle", is_belt && sz != BeltShearMode::None); toggle_option("belt_shear_z_from", is_belt && sz != BeltShearMode::None); - toggle_option("belt_shear_z_global", is_belt && sz != BeltShearMode::None); + toggle_option("belt_shear_z_global", is_belt && sz != BeltShearMode::None && !belt_global); auto scx = m_config->option>("belt_scale_x")->value; toggle_option("belt_scale_x_angle", is_belt && scx != BeltScaleMode::None); @@ -5354,9 +5363,10 @@ void TabPrinter::toggle_options() auto scz = m_config->option>("belt_scale_z")->value; toggle_option("belt_scale_z_angle", is_belt && scz != BeltScaleMode::None); - toggle_option("belt_origin_offset_x", is_belt && m_config->opt_bool("belt_origin_snap_x")); - toggle_option("belt_origin_offset_y", is_belt && m_config->opt_bool("belt_origin_snap_y")); - toggle_option("belt_origin_offset_z", is_belt && m_config->opt_bool("belt_origin_snap_z")); + // Origin snap is superseded by belt_preslice_global + toggle_option("belt_origin_offset_x", is_belt && m_config->opt_bool("belt_origin_snap_x") && !belt_global); + toggle_option("belt_origin_offset_y", is_belt && m_config->opt_bool("belt_origin_snap_y") && !belt_global); + toggle_option("belt_origin_offset_z", is_belt && m_config->opt_bool("belt_origin_snap_z") && !belt_global); toggle_line("belt_support_floor_mode", is_belt); } From bc6d0ef0fbb4755c9f323bcf58bcd2756803979a Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Mon, 13 Apr 2026 22:29:23 -0500 Subject: [PATCH 024/389] Add first layer detection and fan control - prototype --- .claude/scheduled_tasks.lock | 1 + src/libslic3r/BeltGCodeWriter.cpp | 36 +++- src/libslic3r/BeltGCodeWriter.hpp | 15 ++ src/libslic3r/CMakeLists.txt | 2 + src/libslic3r/FirstLayerPlane.cpp | 226 ++++++++++++++++++++++++++ src/libslic3r/FirstLayerPlane.hpp | 76 +++++++++ src/libslic3r/GCode.cpp | 72 +++++++- src/libslic3r/GCode.hpp | 33 ++++ src/libslic3r/GCode/CoolingBuffer.cpp | 223 +++++++++++++++++++++++++ src/libslic3r/GCode/CoolingBuffer.hpp | 21 ++- src/libslic3r/Preset.cpp | 1 + src/libslic3r/PrintConfig.cpp | 54 ++++++ src/libslic3r/PrintConfig.hpp | 24 +++ src/slic3r/GUI/Tab.cpp | 20 +++ 14 files changed, 792 insertions(+), 12 deletions(-) create mode 100644 .claude/scheduled_tasks.lock create mode 100644 src/libslic3r/FirstLayerPlane.cpp create mode 100644 src/libslic3r/FirstLayerPlane.hpp diff --git a/.claude/scheduled_tasks.lock b/.claude/scheduled_tasks.lock new file mode 100644 index 0000000000..cce3208834 --- /dev/null +++ b/.claude/scheduled_tasks.lock @@ -0,0 +1 @@ +{"sessionId":"597ab29b-cd70-40f4-95d9-fee98b3968ad","pid":1159657,"acquiredAt":1775936463783} \ No newline at end of file diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index db2bc46fe1..ea90f2588e 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -1,8 +1,27 @@ #include "BeltGCodeWriter.hpp" +#include "FirstLayerPlane.hpp" #include "Geometry.hpp" namespace Slic3r { +namespace { + +// Decide whether a particular destination point gets first-layer treatment. +// When the plane evaluator is active, distance from the plane wins; otherwise +// fall back to the layer-coarse m_is_first_layer flag set by the caller. +inline bool belt_point_on_first_layer( + const FirstLayerPlane *plane, + double first_layer_thickness_mm, + bool layer_first_flag, + const Vec3d &point_slicing_mm) +{ + if (plane && plane->is_active()) + return plane->is_first_layer(point_slicing_mm, first_layer_thickness_mm); + return layer_first_flag; +} + +} // namespace + // ---- Belt configuration --------------------------------------------------- void BeltGCodeWriter::set_belt_angle(double angle_deg) @@ -52,7 +71,10 @@ std::string BeltGCodeWriter::travel_to_xy(const Vec2d &point, const std::string GCodeG1Formatter w; w.emit_xyz(machine); - auto speed = m_is_first_layer + const bool first_layer_for_point = belt_point_on_first_layer( + m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, + Vec3d(point.x(), point.y(), m_pos.z())); + auto speed = first_layer_for_point ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; w.emit_f(speed * 60.0); w.emit_comment(GCodeWriter::full_gcode_comment, comment); @@ -78,8 +100,11 @@ std::string BeltGCodeWriter::_travel_to_z(double z, const std::string &comment) double speed = this->config.travel_speed_z.value; if (speed == 0.) { - speed = m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") - : this->config.travel_speed.value; + const bool first_layer_for_point = belt_point_on_first_layer( + m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, + Vec3d(m_pos.x(), m_pos.y(), z)); + speed = first_layer_for_point ? this->config.get_abs_value("initial_layer_travel_speed") + : this->config.travel_speed.value; } // Belt printer: a Z-only move in slicing frame needs to emit both Y and Z in machine coords. @@ -142,8 +167,11 @@ std::string BeltGCodeWriter::travel_to_xyz(const Vec3d &point, const std::string // 3. Lift type forced to NormalLift (handled by lazy_lift/eager_lift overrides) Vec3d dest_point = point; + const bool first_layer_for_point = belt_point_on_first_layer( + m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, point); auto travel_speed = - m_is_first_layer ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; + first_layer_for_point ? this->config.get_abs_value("initial_layer_travel_speed") + : this->config.travel_speed.value; // Handle pending z_hop if (std::abs(m_to_lift) > EPSILON) { diff --git a/src/libslic3r/BeltGCodeWriter.hpp b/src/libslic3r/BeltGCodeWriter.hpp index a41f890503..828dd43bb3 100644 --- a/src/libslic3r/BeltGCodeWriter.hpp +++ b/src/libslic3r/BeltGCodeWriter.hpp @@ -5,6 +5,8 @@ namespace Slic3r { +class FirstLayerPlane; + // Belt-printer-specific GCode writer. // // Inherits from GCodeWriter and overrides movement methods to apply @@ -22,6 +24,16 @@ public: void set_origin_snap(int axis, bool enable, double offset, double bbox_min); Vec3d to_machine_coords(const Vec3d &pos) const; + // First-layer plane: when set to a non-null active evaluator, travel + // speed selection consults the plane per-move and uses + // initial_layer_travel_speed for points within first_layer_height_mm + // of the plane (regardless of slicing layer index). + void set_first_layer_plane(const FirstLayerPlane *plane, + double first_layer_height_mm) { + m_first_layer_plane = plane; + m_first_layer_thickness_mm = first_layer_height_mm; + } + // Overridden movement methods std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string()) override; std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false) override; @@ -39,6 +51,9 @@ private: bool m_origin_snap[3] = {false, false, false}; double m_origin_offset[3] = {0., 0., 0.}; double m_origin_bbox_min[3] = {0., 0., 0.}; + // Borrowed pointer; lifetime owned by GCode. null = inactive. + const FirstLayerPlane *m_first_layer_plane = nullptr; + double m_first_layer_thickness_mm = 0.; }; } // namespace Slic3r diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index a3e813b1da..689dee8c83 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -87,6 +87,8 @@ set(lisbslic3r_sources BeltSliceStrategy.hpp BeltTransform.cpp BeltTransform.hpp + FirstLayerPlane.cpp + FirstLayerPlane.hpp Brim.cpp BrimEarsPoint.hpp Brim.hpp diff --git a/src/libslic3r/FirstLayerPlane.cpp b/src/libslic3r/FirstLayerPlane.cpp new file mode 100644 index 0000000000..23327aea7a --- /dev/null +++ b/src/libslic3r/FirstLayerPlane.cpp @@ -0,0 +1,226 @@ +#include "FirstLayerPlane.hpp" +#include "BeltTransform.hpp" + +#include +#include +#include + +namespace Slic3r { + +namespace { + +// Build the row of the gcode-axis-remap matrix R that produces machine_Z, +// AS A FUNCTION OF a slicing-frame point in the GCode generator's coordinate +// space. Without back-transform this is just R.row(2). With back-transform +// the writer applies F^-1 before R, so the effective row is (R * F^-1).row(2). +// +// Returns a pair (gradient, constant) such that: +// machine_Z(p_slicing) = gradient.dot(p_slicing) + constant +struct MachineZAffine { + Vec3d gradient = Vec3d::UnitZ(); + double constant = 0.0; +}; + +MachineZAffine compute_machine_z_affine(const PrintConfig &config) +{ + MachineZAffine out; + + // R is the matrix form of GCodeWriter::apply_axis_remap. Each output axis + // i picks one slicing-frame component (with sign + optional Rev mode + // translation) based on m_remap_{x,y,z}. We only need row 2 (the z output) + // since machine_Z is what defines the first-layer plane. + int rz = int(config.gcode_remap_z.value); + int axis = rz % 3; + double sign; + double trans; + if (rz < int(RemapAxis::NegX)) { // 0..2 = PosX/Y/Z + sign = 1.0; + trans = 0.0; + } else if (rz < int(RemapAxis::RevX)) { // 3..5 = NegX/Y/Z + sign = -1.0; + trans = 0.0; + } else { // 6..8 = RevX/Y/Z + sign = -1.0; + BoundingBoxf bbox_bed(config.printable_area.values); + Vec3d vol_max(bbox_bed.max.x(), + bbox_bed.max.y(), + config.printable_height.value); + trans = vol_max[axis]; + } + + Vec3d r_row = Vec3d::Zero(); + r_row[axis] = sign; + + // Without back-transform, machine_Z(slicing) = r_row · slicing + trans. + out.gradient = r_row; + out.constant = trans; + + if (config.gcode_back_transform.value && config.belt_printer.value) { + // BeltGCodeWriter applies F^-1 before R when back-transform is on. + // So machine_Z(slicing) = r_row · (F^-1 · slicing) + trans + // = (r_row^T · F^-1) · slicing + trans + // We need to compose r_row with F^-1 from the LEFT (treating r_row as + // a row vector). Eigen makes this easy: it's just F^-1.transpose() * r_row. + Transform3d forward = BeltTransformPipeline::build_forward_transform(config); + Transform3d inverse = forward.inverse(); + // Note: forward.translation() is normally zero (per-print transforms + // don't add a translation; the per-object z_shift is added separately + // in PrintObjectSlice). We still incorporate inverse.translation() in + // case a Rev-mode preslice_remap puts a translation in F. + Vec3d composed_grad = inverse.linear().transpose() * r_row; + double composed_trans = + r_row.dot(inverse.translation()) + trans; + out.gradient = composed_grad; + out.constant = composed_trans; + } + + return out; +} + +} // namespace + +FirstLayerPlane::FirstLayerPlane(const PrintConfig &config) +{ + // -------- Resolve Auto ------------------------------------------------- + FirstLayerPlaneMode mode = config.first_layer_plane.value; + if (mode == FirstLayerPlaneMode::Auto) { + if (config.belt_printer.value && + config.belt_shear_z.value != BeltShearMode::None) { + mode = FirstLayerPlaneMode::BeltShear; + } else { + mode = FirstLayerPlaneMode::XY; + } + } + m_mode = mode; + + // -------- Band thickness ---------------------------------------------- + // Note: layer_height lives in PrintObjectConfig, not PrintConfig, so we + // can't fall back to it from here. initial_layer_print_height is in + // PrintConfig and is the right default anyway (the legacy first-layer + // semantics used initial_layer_print_height, not the regular one). + double thickness = config.first_layer_plane_thickness.value; + if (thickness <= 0.0) + thickness = config.initial_layer_print_height.value; + if (thickness <= 0.0) + thickness = 0.2; + m_thickness_mm = thickness; + + const double user_offset = config.first_layer_plane_offset.value; + + // -------- Build the plane --------------------------------------------- + auto set_axis_aligned = [&](const Vec3d &n_unit, double offset_along_n) { + m_normal = n_unit; + m_offset = offset_along_n; + }; + + switch (mode) { + case FirstLayerPlaneMode::XY: + // Legacy XY plane. Inactive: short-circuit to layer-index path. + set_axis_aligned(Vec3d::UnitZ(), user_offset); + m_active = false; + return; + + case FirstLayerPlaneMode::YZ: + set_axis_aligned(Vec3d::UnitX(), user_offset); + m_active = true; + return; + + case FirstLayerPlaneMode::XZ: + set_axis_aligned(Vec3d::UnitY(), user_offset); + m_active = true; + return; + + case FirstLayerPlaneMode::BeltShear: { + // Compute the slicing-frame plane that maps to machine_Z = user_offset + // under the gcode axis remap (and optional back-transform). + MachineZAffine mz = compute_machine_z_affine(config); + double cmag = mz.gradient.norm(); + if (cmag < EPSILON) { + // Degenerate: slicing point doesn't affect machine_Z. Fall back. + set_axis_aligned(Vec3d::UnitZ(), user_offset); + m_active = false; + return; + } + // Plane equation: gradient · slicing = user_offset - constant + const double K = user_offset - mz.constant; + m_normal = mz.gradient / cmag; + m_offset = K / cmag; + m_active = true; + return; + } + + case FirstLayerPlaneMode::Auto: + // Should have been resolved above. + m_active = false; + return; + } + + m_active = false; +} + +double FirstLayerPlane::distance_from_plane(const Vec3d &point_slicing_mm) const +{ + return m_normal.dot(point_slicing_mm) - m_offset; +} + +bool FirstLayerPlane::is_first_layer(const Vec3d &point_slicing_mm, + double first_layer_height_mm) const +{ + if (!m_active) + return false; + return distance_from_plane(point_slicing_mm) < first_layer_height_mm; +} + +int FirstLayerPlane::effective_layer_index(const Vec3d &point_slicing_mm) const +{ + if (!m_active) + return INT_MAX / 2; // Effectively "way past first layer". + double d = distance_from_plane(point_slicing_mm); + if (d <= 0.0) + return 0; + return int(std::floor(d / m_thickness_mm)); +} + +int FirstLayerPlane::min_effective_index_for_xy_bbox( + const BoundingBoxf &xy_bbox_mm, double slicing_z_mm) const +{ + if (!m_active) + return INT_MAX / 2; + // For the rectangular bbox in (x, y) at fixed z, the smallest value of + // (n.x*x + n.y*y + n.z*z - offset) is achieved at one of the four + // corners, with the smaller component picked when the corresponding + // normal coefficient is positive. + const double x_for_min = (m_normal.x() >= 0.0) + ? xy_bbox_mm.min.x() : xy_bbox_mm.max.x(); + const double y_for_min = (m_normal.y() >= 0.0) + ? xy_bbox_mm.min.y() : xy_bbox_mm.max.y(); + const double dmin = m_normal.x() * x_for_min + + m_normal.y() * y_for_min + + m_normal.z() * slicing_z_mm + - m_offset; + if (dmin <= 0.0) + return 0; + return int(std::floor(dmin / m_thickness_mm)); +} + +int FirstLayerPlane::min_effective_index_for_bbox3( + const BoundingBoxf3 &bbox_mm) const +{ + if (!m_active) + return INT_MAX / 2; + const double x_for_min = (m_normal.x() >= 0.0) + ? bbox_mm.min.x() : bbox_mm.max.x(); + const double y_for_min = (m_normal.y() >= 0.0) + ? bbox_mm.min.y() : bbox_mm.max.y(); + const double z_for_min = (m_normal.z() >= 0.0) + ? bbox_mm.min.z() : bbox_mm.max.z(); + const double dmin = m_normal.x() * x_for_min + + m_normal.y() * y_for_min + + m_normal.z() * z_for_min + - m_offset; + if (dmin <= 0.0) + return 0; + return int(std::floor(dmin / m_thickness_mm)); +} + +} // namespace Slic3r diff --git a/src/libslic3r/FirstLayerPlane.hpp b/src/libslic3r/FirstLayerPlane.hpp new file mode 100644 index 0000000000..35b8346c82 --- /dev/null +++ b/src/libslic3r/FirstLayerPlane.hpp @@ -0,0 +1,76 @@ +#ifndef slic3r_FirstLayerPlane_hpp_ +#define slic3r_FirstLayerPlane_hpp_ + +#include "libslic3r.h" +#include "Point.hpp" +#include "BoundingBox.hpp" +#include "PrintConfig.hpp" + +namespace Slic3r { + +// Decides which extrusions get "first layer" treatment (no fan, slow speed, +// initial-layer accel/jerk, deferred temperature drop) by reference to a +// configurable plane in slicing-frame coordinates rather than the slicing +// layer index. +// +// On a normal flat-bed printer the plane is XY at slicing_Z = 0 and the +// evaluator is INACTIVE — every call site short-circuits back to the legacy +// `Layer::id() == 0` test. On a belt printer with a Z-from-Y shear the +// belt surface (machine_Z = 0) maps to a plane in slicing-frame coordinates +// derived from the gcode axis remap, so layer-index-based detection no +// longer matches the physical first printed surface. +// +// Plane representation: unit normal `n` (slicing frame) and offset along +// the normal such that the plane equation is `n · p == offset`. Signed +// perpendicular distance is `d(p) = n · p - offset`. Positive distance +// means "away from the belt surface", negative means "below the plane". +class FirstLayerPlane +{ +public: + explicit FirstLayerPlane(const PrintConfig &config); + + // Inactive when the legacy XY layer-index path should be used. This + // covers all non-belt printers and any belt printer where the user + // explicitly picked XY mode. + bool is_active() const { return m_active; } + FirstLayerPlaneMode effective_mode() const{ return m_mode; } + double band_thickness_mm() const { return m_thickness_mm; } + const Vec3d & normal() const { return m_normal; } + double plane_offset() const { return m_offset; } + + // Signed perpendicular distance from a slicing-frame point to the plane. + double distance_from_plane(const Vec3d &point_slicing_mm) const; + + // True if perpendicular distance < first_layer_height_mm. When the + // evaluator is inactive this returns false (call sites should fall back + // to the legacy per-layer path before reaching this function). + bool is_first_layer(const Vec3d &point_slicing_mm, + double first_layer_height_mm) const; + + // floor((distance - 0) / band_thickness), clamped to [0, +inf). Used + // for "first N layers" thresholds (fan, slow_down_layers). Returns 0 + // for points within the band. Returns INT_MAX/2 when inactive. + int effective_layer_index(const Vec3d &point_slicing_mm) const; + + // Min effective index over a 2D bbox at a fixed slicing_Z. Used for + // layer-level decisions (e.g. temperature transition gate) where we + // don't want to walk every extrusion in the layer. For axis-aligned + // planes this is exact; for tilted planes it's a tight lower bound + // (the plane projection of the bbox's extreme corner). + int min_effective_index_for_xy_bbox(const BoundingBoxf &xy_bbox_mm, + double slicing_z_mm) const; + + // Same as above but the bbox spans a Z range too. + int min_effective_index_for_bbox3(const BoundingBoxf3 &bbox_mm) const; + +private: + bool m_active = false; + FirstLayerPlaneMode m_mode = FirstLayerPlaneMode::XY; + Vec3d m_normal = Vec3d::UnitZ(); // unit, slicing frame + double m_offset = 0.0; // n·p == m_offset + double m_thickness_mm = 0.0; +}; + +} // namespace Slic3r + +#endif // slic3r_FirstLayerPlane_hpp_ diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 93b87cbba8..a9122d9bfd 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -24,6 +24,7 @@ #include "Time.hpp" #include "GCode/ExtrusionProcessor.hpp" #include +#include #include #include #include @@ -2438,6 +2439,17 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } } + // Build the FirstLayerPlane evaluator. When inactive (non-belt printers + // and belt printers without Z shear), all per-path call sites short- + // circuit to the legacy Layer::id() == 0 path so g-code stays bit- + // identical to the pre-feature behavior. + m_first_layer_plane = std::make_unique(print.config()); + if (auto *belt_writer = dynamic_cast(m_writer.get())) { + belt_writer->set_first_layer_plane( + m_first_layer_plane.get(), + print.config().initial_layer_print_height.value); + } + // How many times will be change_layer() called? // change_layer() in turn increments the progress bar status. m_layer_count = 0; @@ -4588,7 +4600,38 @@ LayerResult GCode::process_layer( } } - if (!first_layer && !m_second_layer_things_done) { + // First-layer plane: defer the temperature/PLR transition until the + // entire layer is past the first-layer band. When the evaluator is + // inactive (non-belt printers and belt printers without Z shear) we + // fall back to the legacy `!first_layer` predicate so behavior is + // bit-identical to the pre-feature path. + bool past_first_layer_band = !first_layer; + if (m_first_layer_plane && m_first_layer_plane->is_active()) { + past_first_layer_band = false; + if (object_layer != nullptr) { + // Conservatively walk the layer's lslice bboxes; if every bbox's + // most-belt-side corner is outside the first-layer band, the + // layer is fully past it. + const Layer *ol = object_layer; + int min_eff = INT_MAX; + for (const BoundingBox &bb : ol->lslices_bboxes) { + BoundingBoxf bbf( + Vec2d(unscale(bb.min.x()), unscale(bb.min.y())), + Vec2d(unscale(bb.max.x()), unscale(bb.max.y()))); + int eff = m_first_layer_plane->min_effective_index_for_xy_bbox( + bbf, ol->print_z); + if (eff < min_eff) min_eff = eff; + if (min_eff <= 0) break; + } + past_first_layer_band = (min_eff > 0 && min_eff != INT_MAX); + } else if (support_layer != nullptr) { + // Support-only layers: gate on the support layer's bottom_z + // proximity to the plane. Conservative. + past_first_layer_band = !first_layer; + } + } + + if (past_first_layer_band && !m_second_layer_things_done) { // Orca: set power loss recovery const auto plr_mode = print.config().enable_power_loss_recovery.value; gcode += m_writer->enable_power_loss_recovery(plr_mode); @@ -6204,6 +6247,18 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, if (is_bridge(path.role())) description += " (bridge)"; + // First-layer plane evaluation: compute the path's slicing-frame point + // once and reuse for every per-path call site below. When the plane + // evaluator is inactive (non-belt printers, or belt printers without + // a Z-axis shear) `path_on_first_layer` falls back to the legacy + // layer-id check, so behavior is bit-identical to the pre-feature path. + const Vec3d path_point_mm{ + unscale(path.first_point().x()), + unscale(path.first_point().y()), + m_layer ? m_layer->print_z : 0.0 + }; + const bool path_on_first_layer = this->on_first_layer(path_point_mm); + const ExtrusionPathSloped* sloped = dynamic_cast(&path); const auto get_sloped_z = [&sloped, this](double z_ratio) { @@ -6249,7 +6304,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // adjust acceleration if (m_config.default_acceleration.value > 0) { double acceleration; - if (this->on_first_layer() && m_config.initial_layer_acceleration.value > 0) { + if (path_on_first_layer && m_config.initial_layer_acceleration.value > 0) { acceleration = m_config.initial_layer_acceleration.value; #if 0 } else if (this->object_layer_over_raft() && m_config.first_layer_acceleration_over_raft.value > 0) { @@ -6275,7 +6330,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // adjust X Y jerk if (m_config.default_jerk.value > 0) { - if (this->on_first_layer() && m_config.initial_layer_jerk.value > 0) { + if (path_on_first_layer && m_config.initial_layer_jerk.value > 0) { jerk = m_config.initial_layer_jerk.value; } else if (m_config.outer_wall_jerk.value > 0 && is_external_perimeter(path.role())) { jerk = m_config.outer_wall_jerk.value; @@ -6335,7 +6390,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } // Additionally, adjust the value if we are on the first layer (except for brims and skirts) - if (this->on_first_layer() && (path.role() != erBrim && path.role() != erSkirt)) { + if (path_on_first_layer && (path.role() != erBrim && path.role() != erSkirt)) { _mm3_per_mm *= m_config.first_layer_flow_ratio; } } @@ -6393,14 +6448,17 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, if (speed == 0) speed = filament_max_volumetric_speed / _mm3_per_mm; - if (this->on_first_layer()) { + if (path_on_first_layer) { //BBS: for solid infill of first layer, speed can be higher as long as //wall lines have be attached if (path.role() != erBottomSurface) speed = m_config.get_abs_value("initial_layer_speed"); } else if(m_config.slow_down_layers > 1){ - const auto _layer = layer_id(); + // Use the FirstLayerPlane-aware effective layer index when active so + // the speed fade tracks perpendicular distance from the plane on + // belt printers; otherwise this falls back to the slicing layer id. + const int _layer = this->effective_layer_index_for_point(path_point_mm); if (_layer > 0 && _layer < m_config.slow_down_layers) { const auto first_layer_speed = is_perimeter(path.role()) @@ -6473,7 +6531,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, bool variable_speed = false; std::vector new_points {}; - if (m_config.enable_overhang_speed && !this->on_first_layer() && + if (m_config.enable_overhang_speed && !path_on_first_layer && (is_bridge(path.role()) || is_perimeter(path.role()))) { bool is_external = is_external_perimeter(path.role()); double ref_speed = is_external ? m_config.get_abs_value("outer_wall_speed") : m_config.get_abs_value("inner_wall_speed"); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 9004f30fd3..99d95eeb61 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -5,6 +5,7 @@ #include "ExPolygon.hpp" #include "GCodeWriter.hpp" #include "BeltGCodeWriter.hpp" +#include "FirstLayerPlane.hpp" #include "Layer.hpp" #include "Point.hpp" #include "PlaceholderParser.hpp" @@ -303,6 +304,14 @@ public: } }; + // Public accessor for the first-layer plane evaluator. Used by + // CoolingBuffer (which is constructed with a GCode reference and needs + // to read the plane for per-segment fan re-evaluation). All other + // first-layer-plane access points (on_first_layer overload, effective + // index helper) are in the protected section since they're called from + // GCode internals only. + const FirstLayerPlane *first_layer_plane() const { return m_first_layer_plane.get(); } + protected: class GCodeOutputStream { public: @@ -598,6 +607,11 @@ protected: std::unique_ptr m_cooling_buffer; std::unique_ptr m_spiral_vase; + // First-layer plane evaluator. Constructed once per print from the + // PrintConfig. is_active() == false on non-belt printers and on belt + // printers without a Z-axis shear; in that case all per-path plane + // checks short-circuit to the legacy Layer::id() == 0 path. + std::unique_ptr m_first_layer_plane; std::unique_ptr m_pressure_equalizer; @@ -657,6 +671,25 @@ protected: // On the first printing layer. This flag triggers first layer speeds. //BBS bool on_first_layer() const { return m_layer != nullptr && m_layer->id() == 0 && abs(m_layer->bottom_z()) < EPSILON; } + // Per-point first-layer test. When the FirstLayerPlane evaluator is + // active, the result depends on the supplied slicing-frame point; + // otherwise we delegate to the legacy per-layer test. This is the + // entry point used by per-path call sites in _extrude. + bool on_first_layer(const Vec3d &point_slicing_mm) const { + if (m_first_layer_plane && m_first_layer_plane->is_active()) + return m_first_layer_plane->is_first_layer( + point_slicing_mm, m_config.initial_layer_print_height.value); + return on_first_layer(); + } + // "Effective layer index" used to drive layer-count thresholds like + // slow_down_layers. When the evaluator is active this returns the + // perpendicular distance to the plane in band_thickness_mm units; + // otherwise it returns the legacy slicing layer index. + int effective_layer_index_for_point(const Vec3d &point_slicing_mm) const { + if (m_first_layer_plane && m_first_layer_plane->is_active()) + return m_first_layer_plane->effective_layer_index(point_slicing_mm); + return on_first_layer() ? 0 : layer_id(); + } int layer_id() const { if (m_layer == nullptr) return -1; diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index 41e612fdab..407163b3dd 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -1,10 +1,14 @@ #include "../GCode.hpp" +#include "../FirstLayerPlane.hpp" #include "CoolingBuffer.hpp" #include #include #include +#include +#include #include #include +#include #include #include @@ -28,6 +32,12 @@ CoolingBuffer::CoolingBuffer(GCode &gcodegen) : m_config(gcodegen.config()), m_t m_num_extruders = std::max(ex.id() + 1, m_num_extruders); m_extruder_ids.emplace_back(ex.id()); } + + // Borrow the first-layer plane from the GCode generator. When inactive + // (non-belt printers and belt printers without Z shear), per-line fan + // re-evaluation is skipped and behavior is bit-identical to the legacy + // per-layer path. + m_first_layer_plane = gcodegen.first_layer_plane(); } void CoolingBuffer::reset(const Vec3d &position) @@ -328,6 +338,13 @@ std::string CoolingBuffer::process_layer(std::string &&gcode, size_t layer_id, b std::vector per_extruder_adjustments = this->parse_layer_gcode(m_gcode, m_current_pos); float layer_time_stretched = this->calculate_layer_slowdown(per_extruder_adjustments); out = this->apply_layer_cooldown(m_gcode, layer_id, layer_time_stretched, per_extruder_adjustments); + // First-layer plane: per-segment fan re-evaluation post-pass. Walks + // the cooled-down gcode and inserts inline M106 commands at band + // crossings (where the path's perpendicular distance to the plane + // crosses close_fan_the_first_x_layers thresholds). No-op when + // the evaluator is inactive. + if (m_first_layer_plane && m_first_layer_plane->is_active()) + out = this->apply_first_layer_plane_fan_eval(std::move(out), layer_id, layer_time_stretched); m_gcode.clear(); } return out; @@ -1011,4 +1028,210 @@ std::string CoolingBuffer::apply_layer_cooldown( return new_gcode; } +// Pure helper: compute the main fan speed for a given effective layer index. +// Mirrors the inline logic in change_extruder_set_fan but is callable from +// per-line code in apply_first_layer_plane_fan_eval. +int CoolingBuffer::compute_main_fan_speed(int effective_layer_id, float layer_time, + unsigned int extruder_id) const +{ +#define EXTRUDER_CFG(opt) m_config.opt.get_at(extruder_id) + float fan_min_speed = EXTRUDER_CFG(fan_min_speed); + float fan_max_speed = EXTRUDER_CFG(fan_max_speed); + bool reduce_fan_stop_start_freq = EXTRUDER_CFG(reduce_fan_stop_start_freq); + int close_fan_the_first_x_layers = EXTRUDER_CFG(close_fan_the_first_x_layers); + int full_fan_speed_layer = EXTRUDER_CFG(full_fan_speed_layer); + float slow_down_layer_time = float(EXTRUDER_CFG(slow_down_layer_time)); + float fan_cooling_layer_time = float(EXTRUDER_CFG(fan_cooling_layer_time)); +#undef EXTRUDER_CFG + + if (close_fan_the_first_x_layers <= 0 && full_fan_speed_layer > 0) + close_fan_the_first_x_layers = 1; + + float fan_speed_new = reduce_fan_stop_start_freq ? fan_min_speed : 0.f; + if (effective_layer_id >= close_fan_the_first_x_layers) { + if (layer_time < slow_down_layer_time) { + fan_speed_new = fan_max_speed; + } else if (layer_time < fan_cooling_layer_time) { + double t = (layer_time - slow_down_layer_time) / + (fan_cooling_layer_time - slow_down_layer_time); + fan_speed_new = float(int(floor(t * fan_min_speed + + (1. - t) * fan_max_speed) + 0.5)); + } + if (effective_layer_id + 1 < full_fan_speed_layer) { + float factor = float(effective_layer_id + 1 - close_fan_the_first_x_layers) + / float(full_fan_speed_layer - close_fan_the_first_x_layers); + fan_speed_new = float(std::clamp(int(fan_speed_new * factor + 0.5f), 0, 255)); + } + } else { + fan_speed_new = 0.f; + } + return int(fan_speed_new); +} + +// Post-pass: walk the cooled-down gcode line by line, track XYZ position, +// and insert M106 commands at first-layer-plane band crossings so the fan +// follows perpendicular distance to the plane rather than the slicing-layer +// index. Only invoked when the FirstLayerPlane evaluator is active. +// +// This implementation is intentionally minimal: it overrides only the MAIN +// fan (the one set by GCodeWriter::set_fan); overhang/internal-bridge/etc +// special fans remain at their layer-level values from apply_layer_cooldown. +// That keeps the per-line logic small while still giving the user precise +// fan control near the belt surface, which is the main quality concern. +std::string CoolingBuffer::apply_first_layer_plane_fan_eval( + std::string &&gcode_in, size_t /*layer_id*/, float layer_time) +{ + if (!m_first_layer_plane || !m_first_layer_plane->is_active()) + return std::move(gcode_in); + + const std::string &gcode = gcode_in; + std::string out; + out.reserve(gcode.size() + 256); + + // Track position in slicing-frame mm. Seed from m_current_pos which the + // CoolingBuffer keeps up-to-date across layers. + Vec3d cur_pos_mm(m_current_pos[0], m_current_pos[1], m_current_pos[2]); + + // Track current main fan speed by parsing M106 commands as we walk so + // we can restore it after a band exit. + int current_main_fan = m_fan_speed; + int pre_band_main_fan = current_main_fan; + // Implicit initial state: assume the layer started "out of the band" + // (i.e., the layer-level fan setting from apply_layer_cooldown is in + // effect). The first movement we encounter will reconcile this. + bool in_first_layer_band = false; + unsigned int active_extruder = m_current_extruder; + + auto parse_xyz_into = [](const std::string_view &line_sv, Vec3d &p) { + if (line_sv.size() < 3) return false; + if (line_sv[0] != 'G') return false; + if (line_sv[1] != '0' && line_sv[1] != '1') return false; + if (line_sv[2] != ' ' && line_sv[2] != '\t') return false; + const char *c = line_sv.data() + 3; + const char *end = line_sv.data() + line_sv.size(); + bool any = false; + while (c < end && *c != ';') { + while (c < end && (*c == ' ' || *c == '\t')) ++c; + if (c >= end || *c == ';' || *c == '\n' || *c == '\r') break; + char axis = *c; + ++c; + if (axis == 'X' || axis == 'Y' || axis == 'Z') { + char *next; + double v = std::strtod(c, &next); + if (next != c) { + if (axis == 'X') p.x() = v; + else if (axis == 'Y') p.y() = v; + else p.z() = v; + c = next; + any = true; + continue; + } + } + // Skip unrecognized word. + while (c < end && *c != ' ' && *c != '\t' && *c != ';' && *c != '\n') + ++c; + } + return any; + }; + + auto parse_m106 = [](const std::string_view &line_sv) -> int { + // Returns -1 if not an M106, otherwise the S value (0..255). + if (line_sv.size() < 4 || line_sv[0] != 'M') return -1; + if (!(line_sv[1] == '1' && line_sv[2] == '0' && line_sv[3] == '6')) + return -1; + // Find S + size_t s_pos = line_sv.find('S'); + if (s_pos == std::string_view::npos) return -1; + const char *c = line_sv.data() + s_pos + 1; + char *next; + long v = std::strtol(c, &next, 10); + if (next == c) return -1; + return int(std::clamp(v, 0, 255)); + }; + + auto parse_m107 = [](const std::string_view &line_sv) -> bool { + return line_sv.size() >= 4 && line_sv[0] == 'M' && + line_sv[1] == '1' && line_sv[2] == '0' && line_sv[3] == '7'; + }; + + auto parse_tool_change = [this](const std::string_view &line_sv) -> int { + // Returns the new extruder id, or -1 if not a toolchange. + if (line_sv.size() < m_toolchange_prefix.size() + 1) return -1; + if (line_sv.compare(0, m_toolchange_prefix.size(), m_toolchange_prefix) != 0) + return -1; + const char *c = line_sv.data() + m_toolchange_prefix.size(); + char *next; + long v = std::strtol(c, &next, 10); + if (next == c) return -1; + return int(v); + }; + + const char *p = gcode.c_str(); + const char *end = gcode.c_str() + gcode.size(); + while (p < end) { + const char *line_end = p; + while (line_end < end && *line_end != '\n') ++line_end; + const char *next_line = line_end; + if (next_line < end) ++next_line; // include the '\n' + + std::string_view line_sv(p, line_end - p); + + // Track tool changes so the per-line fan eval uses the right extruder. + int new_tool = parse_tool_change(line_sv); + if (new_tool >= 0) + active_extruder = unsigned(new_tool); + + // Track existing fan commands so we can restore the right value when + // exiting a band. + int m106_speed = parse_m106(line_sv); + if (m106_speed >= 0) { + current_main_fan = m106_speed; + if (!in_first_layer_band) + pre_band_main_fan = m106_speed; + } else if (parse_m107(line_sv)) { + current_main_fan = 0; + if (!in_first_layer_band) + pre_band_main_fan = 0; + } + + // Movement line: parse XYZ, evaluate plane, possibly emit a fan + // change BEFORE this line. + bool moved = parse_xyz_into(line_sv, cur_pos_mm); + if (moved) { + const int eff_idx = m_first_layer_plane->effective_layer_index(cur_pos_mm); + const int close_n = m_config.close_fan_the_first_x_layers.get_at(active_extruder); + const bool now_in_band = eff_idx < std::max(close_n, 1); + if (now_in_band != in_first_layer_band) { + // Band crossing: emit a M106 with the appropriate speed. + int target_fan; + if (now_in_band) { + // Entering the first-layer band: fan off. + pre_band_main_fan = current_main_fan; + target_fan = compute_main_fan_speed(eff_idx, layer_time, active_extruder); + } else { + // Exiting the band: restore the layer's normal fan speed. + // Use compute_main_fan_speed with the effective index so + // the linear ramp factor (close_fan→full_fan_speed_layer) + // also follows distance from the plane. + target_fan = compute_main_fan_speed(eff_idx, layer_time, active_extruder); + if (target_fan == 0) + target_fan = pre_band_main_fan; + } + if (target_fan != current_main_fan) { + out += GCodeWriter::set_fan(m_config.gcode_flavor, target_fan); + current_main_fan = target_fan; + m_fan_speed = target_fan; + m_current_fan_speed = target_fan; + } + in_first_layer_band = now_in_band; + } + } + + out.append(p, next_line - p); + p = next_line; + } + + return out; +} + } // namespace Slic3r diff --git a/src/libslic3r/GCode/CoolingBuffer.hpp b/src/libslic3r/GCode/CoolingBuffer.hpp index fba27b289b..4bb8f26476 100644 --- a/src/libslic3r/GCode/CoolingBuffer.hpp +++ b/src/libslic3r/GCode/CoolingBuffer.hpp @@ -10,6 +10,7 @@ namespace Slic3r { class GCode; class Layer; +class FirstLayerPlane; struct PerExtruderAdjustments; // A standalone G-code filter, to control cooling of the print. @@ -18,7 +19,7 @@ struct PerExtruderAdjustments; // // The simple it sounds, the actual implementation is significantly more complex. // Namely, for a multi-extruder print, each material may require a different cooling logic. -// For example, some materials may not like to print too slowly, while with some materials +// For example, some materials may not like to print too slowly, while with some materials // we may slow down significantly. // class CoolingBuffer { @@ -36,6 +37,21 @@ private: // Returns the adjusted G-code. std::string apply_layer_cooldown(const std::string &gcode, size_t layer_id, float layer_time, std::vector &per_extruder_adjustments); + // First-layer plane: per-line fan re-evaluation post-pass. Walks the + // post-cooldown gcode, tracks XYZ position, and inserts M106 commands at + // band-crossing transitions in slicing-frame coordinates. Only runs + // when m_first_layer_plane is active. + std::string apply_first_layer_plane_fan_eval(std::string &&gcode_in, + size_t layer_id, + float layer_time); + + // Pure helper: compute the main fan speed for a given effective layer + // index (layer-id units, mapped through the plane evaluator) and the + // current extruder. Mirrors the inline logic in the change_extruder_set_fan + // lambda but is callable from per-line code. + int compute_main_fan_speed(int effective_layer_id, float layer_time, + unsigned int extruder_id) const; + // G-code snippet cached for the support layers preceding an object layer. std::string m_gcode; // Internal data. @@ -57,6 +73,9 @@ private: unsigned int m_current_extruder; //BBS: current fan speed int m_current_fan_speed; + // First-layer plane evaluator, borrowed from GCode. Null = inactive + // (legacy per-layer fan control). + const FirstLayerPlane *m_first_layer_plane = nullptr; }; } diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 4d01757826..f76ea93e55 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1017,6 +1017,7 @@ static std::vector s_Preset_printer_options { "preslice_remap_x", "preslice_remap_y", "preslice_remap_z", "preslice_remap_global", "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", "gcode_back_transform", "belt_preslice_global", + "first_layer_plane", "first_layer_plane_offset", "first_layer_plane_thickness", "belt_origin_snap_x", "belt_origin_offset_x", "belt_origin_snap_y", "belt_origin_offset_y", "belt_origin_snap_z", "belt_origin_offset_z", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 47d0b9c549..4ec0547ddb 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -341,6 +341,15 @@ static t_config_enum_values s_keys_map_BeltSupportZOffsetMode { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltSupportZOffsetMode) +static t_config_enum_values s_keys_map_FirstLayerPlaneMode { + { "auto", int(FirstLayerPlaneMode::Auto) }, + { "xy", int(FirstLayerPlaneMode::XY) }, + { "yz", int(FirstLayerPlaneMode::YZ) }, + { "xz", int(FirstLayerPlaneMode::XZ) }, + { "belt_shear", int(FirstLayerPlaneMode::BeltShear) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(FirstLayerPlaneMode) + static t_config_enum_values s_keys_map_SupportMaterialPattern { { "rectilinear", smpRectilinear }, { "rectilinear-grid", smpRectilinearGrid }, @@ -6188,6 +6197,51 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(false)); + // First-layer plane: which surface defines "first layer" for fan / speed / + // accel decisions. On belt printers the slicing-frame layer 0 is a tilted + // slab that no longer corresponds to the physical first printed layer. + // Auto picks BeltShear when belt_shear_z != None, otherwise XY (legacy). + def = this->add("first_layer_plane", coEnum); + def->label = L("First layer plane"); + def->category = L("Printable space"); + def->tooltip = L("Selects the reference plane used to decide which extrusions get " + "first-layer settings (no fan, slow speed, initial-layer accel/jerk, " + "deferred temperature drop). On belt printers a single slicing layer " + "contains paths at many machine-Z values, so layer-index based detection " + "fails. Auto resolves to Belt shear plane when belt_shear_z is non-None, " + "otherwise XY (legacy). Pick XY explicitly to opt out and force the " + "legacy slicing-layer-0 detection."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"auto", "xy", "yz", "xz", "belt_shear"}; + def->enum_labels = {L("Auto"), L("XY (machine bed)"), L("YZ"), L("XZ"), L("Belt shear plane")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(FirstLayerPlaneMode::Auto)); + + def = this->add("first_layer_plane_offset", coFloat); + def->label = L("Plane offset"); + def->category = L("Printable space"); + def->tooltip = L("Shifts the first-layer plane along its normal (mm). For axis-aligned " + "planes this is just a coordinate shift. Positive values move the plane " + "away from the belt surface (deeper into the model)."); + def->sidetext = L("mm"); + def->min = -1000; + def->max = 1000; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.0)); + + def = this->add("first_layer_plane_thickness", coFloat); + def->label = L("Plane band thickness"); + def->category = L("Printable space"); + def->tooltip = L("Thickness of one 'band' relative to the first-layer plane, in mm. " + "Used as the unit by which 'No cooling for the first N layers' (and " + "similar layer-count thresholds) is multiplied when the first-layer " + "plane is active. -1 means use initial_layer_print_height."); + def->sidetext = L("mm"); + def->min = -1; + def->max = 100; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(-1.0)); + auto add_belt_origin_snap = [this](const char *key_snap, const char *key_offset, const char *axis_label) { auto def = this->add(key_snap, coBool); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index d17c46f0aa..afe5ec58ac 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -203,6 +203,26 @@ enum class BeltSupportZOffsetMode RaftOnly, // Only apply to raft layers }; +// Selects which plane the slicer treats as the "first layer plane" — the +// reference surface used to decide which extrusions get first-layer settings +// (no fan, slow speed, initial-layer accel/jerk, deferred temperature drop). +// +// Auto resolves to: +// - XY (inactive, legacy behavior) for non-belt printers and for belt +// printers with no Z-axis shear. +// - BeltShear for belt printers with belt_shear_z != None. +// +// XY is also used as an explicit "opt out" mode that forces legacy +// per-layer first-layer detection even on belt printers. +enum class FirstLayerPlaneMode +{ + Auto = 0, + XY, + YZ, + XZ, + BeltShear, +}; + enum SupportMaterialPattern { smpDefault, smpRectilinear, smpRectilinearGrid, smpHoneycomb, @@ -552,6 +572,7 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(RemapAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportFloorMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportZOffsetMode) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(FirstLayerPlaneMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialPattern) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialStyle) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SupportMaterialInterfacePattern) @@ -1496,6 +1517,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, gcode_remap_z)) ((ConfigOptionBool, gcode_back_transform)) ((ConfigOptionBool, belt_preslice_global)) + ((ConfigOptionEnum, first_layer_plane)) + ((ConfigOptionFloat, first_layer_plane_offset)) + ((ConfigOptionFloat, first_layer_plane_thickness)) ((ConfigOptionBool, belt_origin_snap_x)) ((ConfigOptionFloat, belt_origin_offset_x)) ((ConfigOptionBool, belt_origin_snap_y)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 986ff614f6..4eaa6c5788 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4451,6 +4451,18 @@ void TabPrinter::build_fff() } optgroup->append_single_option_line("belt_preslice_global"); optgroup->append_single_option_line("gcode_back_transform"); + { + Line line = { L("First layer plane"), + L("Reference plane used to decide which extrusions get first-layer " + "settings (no fan, slow speed, deferred temperature drop). On belt " + "printers, Auto resolves to the tilted belt-shear plane so that " + "first-layer treatment follows perpendicular distance from the belt " + "surface, not slicing layer index.") }; + line.append_option(optgroup->get_option("first_layer_plane")); + line.append_option(optgroup->get_option("first_layer_plane_offset")); + line.append_option(optgroup->get_option("first_layer_plane_thickness")); + optgroup->append_line(line); + } { Line line = { L("Origin snap X"), L("Snap object bbox min X to offset in G-code output") }; line.append_option(optgroup->get_option("belt_origin_snap_x")); @@ -5368,6 +5380,14 @@ void TabPrinter::toggle_options() toggle_option("belt_origin_offset_y", is_belt && m_config->opt_bool("belt_origin_snap_y") && !belt_global); toggle_option("belt_origin_offset_z", is_belt && m_config->opt_bool("belt_origin_snap_z") && !belt_global); + // First-layer plane: visible alongside the rest of belt-printer settings. + // The Auto default keeps legacy XY behavior on non-belt printers, so it's + // safe to also show it in the developer mode for non-belt printers. + bool show_first_layer_plane = is_belt || (m_mode >= comDevelop); + toggle_line("first_layer_plane", show_first_layer_plane); + toggle_option("first_layer_plane_offset", show_first_layer_plane); + toggle_option("first_layer_plane_thickness", show_first_layer_plane); + toggle_line("belt_support_floor_mode", is_belt); } From 8fa6a4602b054c6a1a5fa59f31e7545b1a6cfa17 Mon Sep 17 00:00:00 2001 From: RF47 <162915171+RF47@users.noreply.github.com> Date: Sat, 9 May 2026 19:51:18 -0300 Subject: [PATCH 025/389] fix profile indentation --- resources/profiles/Custom.json | 592 +++++++++--------- .../machine/MyBeltPrinter 0.2 nozzle.json | 50 +- .../machine/MyBeltPrinter 0.4 nozzle.json | 38 +- .../machine/MyBeltPrinter 0.6 nozzle.json | 50 +- .../machine/MyBeltPrinter 0.8 nozzle.json | 50 +- .../Custom/machine/MyBeltPrinter.json | 22 +- .../Custom/machine/fdm_belt_common.json | 198 +++--- 7 files changed, 500 insertions(+), 500 deletions(-) diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index 790e66c6dc..16c02eda4d 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,298 +1,298 @@ { - "name": "Custom Printer", - "version": "02.03.02.62", - "force_update": "0", - "description": "My configurations", - "machine_model_list": [ - { - "name": "Generic Belt Printer", - "sub_path": "machine/MyBeltPrinter.json" - }, - { - "name": "Generic Klipper Printer", - "sub_path": "machine/MyKlipper.json" - }, - { - "name": "Generic Marlin Printer", - "sub_path": "machine/MyMarlin.json" - }, - { - "name": "Generic RRF Printer", - "sub_path": "machine/MyRRF.json" - }, - { - "name": "Generic ToolChanger Printer", - "sub_path": "machine/MyToolChanger.json" - } - ], - "process_list": [ - { - "name": "fdm_process_common", - "sub_path": "process/fdm_process_common.json" - }, - { - "name": "fdm_process_klipper_common", - "sub_path": "process/fdm_process_klipper_common.json" - }, - { - "name": "fdm_process_marlin_common", - "sub_path": "process/fdm_process_marlin_common.json" - }, - { - "name": "fdm_process_rrf_common", - "sub_path": "process/fdm_process_rrf_common.json" - }, - { - "name": "0.08mm Extra Fine @MyKlipper", - "sub_path": "process/0.08mm Extra Fine @MyKlipper.json" - }, - { - "name": "0.12mm Fine @MyKlipper", - "sub_path": "process/0.12mm Fine @MyKlipper.json" - }, - { - "name": "0.15mm Optimal @MyKlipper", - "sub_path": "process/0.15mm Optimal @MyKlipper.json" - }, - { - "name": "0.16mm Optimal @MyKlipper", - "sub_path": "process/0.16mm Optimal @MyKlipper.json" - }, - { - "name": "0.20mm Standard @MyKlipper", - "sub_path": "process/0.20mm Standard @MyKlipper.json" - }, - { - "name": "0.24mm Draft @MyKlipper", - "sub_path": "process/0.24mm Draft @MyKlipper.json" - }, - { - "name": "0.28mm Extra Draft @MyKlipper", - "sub_path": "process/0.28mm Extra Draft @MyKlipper.json" - }, - { - "name": "0.32mm Standard @MyKlipper", - "sub_path": "process/0.32mm Extra Draft @MyKlipper.json" - }, - { - "name": "0.40mm Standard @MyKlipper", - "sub_path": "process/0.40mm Extra Draft @MyKlipper.json" - }, - { - "name": "0.56mm Standard @MyKlipper", - "sub_path": "process/0.56mm Extra Draft @MyKlipper.json" - }, - { - "name": "fdm_process_mytoolchanger_common", - "sub_path": "process/fdm_process_mytoolchanger_common.json" - }, - { - "name": "0.08mm Extra Fine @MyMarlin", - "sub_path": "process/0.08mm Extra Fine @MyMarlin.json" - }, - { - "name": "0.12mm Fine @MyMarlin", - "sub_path": "process/0.12mm Fine @MyMarlin.json" - }, - { - "name": "0.15mm Optimal @MyMarlin", - "sub_path": "process/0.15mm Optimal @MyMarlin.json" - }, - { - "name": "0.20mm Standard @MyMarlin", - "sub_path": "process/0.20mm Standard @MyMarlin.json" - }, - { - "name": "0.24mm Draft @MyMarlin", - "sub_path": "process/0.24mm Draft @MyMarlin.json" - }, - { - "name": "0.28mm Extra Draft @MyMarlin", - "sub_path": "process/0.28mm Extra Draft @MyMarlin.json" - }, - { - "name": "0.08mm Extra Fine @MyRRF", - "sub_path": "process/0.08mm Extra Fine @MyRRF.json" - }, - { - "name": "0.12mm Fine @MyRRF", - "sub_path": "process/0.12mm Fine @MyRRF.json" - }, - { - "name": "0.15mm Optimal @MyRRF", - "sub_path": "process/0.15mm Optimal @MyRRF.json" - }, - { - "name": "0.20mm Standard @MyRRF", - "sub_path": "process/0.20mm Standard @MyRRF.json" - }, - { - "name": "0.24mm Draft @MyRRF", - "sub_path": "process/0.24mm Draft @MyRRF.json" - }, - { - "name": "0.28mm Extra Draft @MyRRF", - "sub_path": "process/0.28mm Extra Draft @MyRRF.json" - }, - { - "name": "0.08mm Extra Fine @MyToolChanger", - "sub_path": "process/0.08mm Extra Fine @MyToolChanger.json" - }, - { - "name": "0.12mm Fine @MyToolChanger", - "sub_path": "process/0.12mm Fine @MyToolChanger.json" - }, - { - "name": "0.15mm Optimal @MyToolChanger", - "sub_path": "process/0.15mm Optimal @MyToolChanger.json" - }, - { - "name": "0.16mm Optimal @MyToolChanger", - "sub_path": "process/0.16mm Optimal @MyToolChanger.json" - }, - { - "name": "0.20mm Standard @MyToolChanger", - "sub_path": "process/0.20mm Standard @MyToolChanger.json" - }, - { - "name": "0.24mm Draft @MyToolChanger", - "sub_path": "process/0.24mm Draft @MyToolChanger.json" - }, - { - "name": "0.28mm Extra Draft @MyToolChanger", - "sub_path": "process/0.28mm Extra Draft @MyToolChanger.json" - }, - { - "name": "0.32mm Extra Draft @MyToolChanger", - "sub_path": "process/0.32mm Extra Draft @MyToolChanger.json" - }, - { - "name": "0.40mm Standard @MyToolChanger", - "sub_path": "process/0.40mm Extra Draft @MyToolChanger.json" - }, - { - "name": "0.56mm Standard @MyToolChanger", - "sub_path": "process/0.56mm Extra Draft @MyToolChanger.json" - } - ], - "filament_list": [ - { - "name": "Generic ABS @MyToolChanger", - "sub_path": "filament/Generic ABS @MyToolChanger.json" - }, - { - "name": "Generic ASA @MyToolChanger", - "sub_path": "filament/Generic ASA @MyToolChanger.json" - }, - { - "name": "Generic PA @MyToolChanger", - "sub_path": "filament/Generic PA @MyToolChanger.json" - }, - { - "name": "Generic PA-CF @MyToolChanger", - "sub_path": "filament/Generic PA-CF @MyToolChanger.json" - }, - { - "name": "Generic PC @MyToolChanger", - "sub_path": "filament/Generic PC @MyToolChanger.json" - }, - { - "name": "Generic PETG @MyToolChanger", - "sub_path": "filament/Generic PETG @MyToolChanger.json" - }, - { - "name": "Generic PLA @MyToolChanger", - "sub_path": "filament/Generic PLA @MyToolChanger.json" - }, - { - "name": "Generic PLA-CF @MyToolChanger", - "sub_path": "filament/Generic PLA-CF @MyToolChanger.json" - }, - { - "name": "Generic PVA @MyToolChanger", - "sub_path": "filament/Generic PVA @MyToolChanger.json" - }, - { - "name": "Generic TPU @MyToolChanger", - "sub_path": "filament/Generic TPU @MyToolChanger.json" - } - ], - "machine_list": [ - { - "name": "fdm_machine_common", - "sub_path": "machine/fdm_machine_common.json" - }, - { - "name": "MyMarlin 0.4 nozzle", - "sub_path": "machine/MyMarlin 0.4 nozzle.json" - }, - { - "name": "fdm_klipper_common", - "sub_path": "machine/fdm_klipper_common.json" - }, - { - "name": "fdm_rrf_common", - "sub_path": "machine/fdm_rrf_common.json" - }, - { - "name": "MyKlipper 0.2 nozzle", - "sub_path": "machine/MyKlipper 0.2 nozzle.json" - }, - { - "name": "MyKlipper 0.4 nozzle", - "sub_path": "machine/MyKlipper 0.4 nozzle.json" - }, - { - "name": "MyKlipper 0.6 nozzle", - "sub_path": "machine/MyKlipper 0.6 nozzle.json" - }, - { - "name": "MyKlipper 0.8 nozzle", - "sub_path": "machine/MyKlipper 0.8 nozzle.json" - }, - { - "name": "fdm_belt_common", - "sub_path": "machine/fdm_belt_common.json" - }, - { - "name": "fdm_toolchanger_common", - "sub_path": "machine/fdm_toolchanger_common.json" - }, - { - "name": "MyRRF 0.4 nozzle", - "sub_path": "machine/MyRRF 0.4 nozzle.json" - }, - { - "name": "MyBeltPrinter 0.2 nozzle", - "sub_path": "machine/MyBeltPrinter 0.2 nozzle.json" - }, - { - "name": "MyBeltPrinter 0.4 nozzle", - "sub_path": "machine/MyBeltPrinter 0.4 nozzle.json" - }, - { - "name": "MyBeltPrinter 0.6 nozzle", - "sub_path": "machine/MyBeltPrinter 0.6 nozzle.json" - }, - { - "name": "MyBeltPrinter 0.8 nozzle", - "sub_path": "machine/MyBeltPrinter 0.8 nozzle.json" - }, - { - "name": "MyToolChanger 0.2 nozzle", - "sub_path": "machine/MyToolChanger 0.2 nozzle.json" - }, - { - "name": "MyToolChanger 0.4 nozzle", - "sub_path": "machine/MyToolChanger 0.4 nozzle.json" - }, - { - "name": "MyToolChanger 0.6 nozzle", - "sub_path": "machine/MyToolChanger 0.6 nozzle.json" - }, - { - "name": "MyToolChanger 0.8 nozzle", - "sub_path": "machine/MyToolChanger 0.8 nozzle.json" - } - ] + "name": "Custom Printer", + "version": "02.03.02.62", + "force_update": "0", + "description": "My configurations", + "machine_model_list": [ + { + "name": "Generic Belt Printer", + "sub_path": "machine/MyBeltPrinter.json" + }, + { + "name": "Generic Klipper Printer", + "sub_path": "machine/MyKlipper.json" + }, + { + "name": "Generic Marlin Printer", + "sub_path": "machine/MyMarlin.json" + }, + { + "name": "Generic RRF Printer", + "sub_path": "machine/MyRRF.json" + }, + { + "name": "Generic ToolChanger Printer", + "sub_path": "machine/MyToolChanger.json" + } + ], + "process_list": [ + { + "name": "fdm_process_common", + "sub_path": "process/fdm_process_common.json" + }, + { + "name": "fdm_process_klipper_common", + "sub_path": "process/fdm_process_klipper_common.json" + }, + { + "name": "fdm_process_marlin_common", + "sub_path": "process/fdm_process_marlin_common.json" + }, + { + "name": "fdm_process_rrf_common", + "sub_path": "process/fdm_process_rrf_common.json" + }, + { + "name": "0.08mm Extra Fine @MyKlipper", + "sub_path": "process/0.08mm Extra Fine @MyKlipper.json" + }, + { + "name": "0.12mm Fine @MyKlipper", + "sub_path": "process/0.12mm Fine @MyKlipper.json" + }, + { + "name": "0.15mm Optimal @MyKlipper", + "sub_path": "process/0.15mm Optimal @MyKlipper.json" + }, + { + "name": "0.16mm Optimal @MyKlipper", + "sub_path": "process/0.16mm Optimal @MyKlipper.json" + }, + { + "name": "0.20mm Standard @MyKlipper", + "sub_path": "process/0.20mm Standard @MyKlipper.json" + }, + { + "name": "0.24mm Draft @MyKlipper", + "sub_path": "process/0.24mm Draft @MyKlipper.json" + }, + { + "name": "0.28mm Extra Draft @MyKlipper", + "sub_path": "process/0.28mm Extra Draft @MyKlipper.json" + }, + { + "name": "0.32mm Standard @MyKlipper", + "sub_path": "process/0.32mm Extra Draft @MyKlipper.json" + }, + { + "name": "0.40mm Standard @MyKlipper", + "sub_path": "process/0.40mm Extra Draft @MyKlipper.json" + }, + { + "name": "0.56mm Standard @MyKlipper", + "sub_path": "process/0.56mm Extra Draft @MyKlipper.json" + }, + { + "name": "fdm_process_mytoolchanger_common", + "sub_path": "process/fdm_process_mytoolchanger_common.json" + }, + { + "name": "0.08mm Extra Fine @MyMarlin", + "sub_path": "process/0.08mm Extra Fine @MyMarlin.json" + }, + { + "name": "0.12mm Fine @MyMarlin", + "sub_path": "process/0.12mm Fine @MyMarlin.json" + }, + { + "name": "0.15mm Optimal @MyMarlin", + "sub_path": "process/0.15mm Optimal @MyMarlin.json" + }, + { + "name": "0.20mm Standard @MyMarlin", + "sub_path": "process/0.20mm Standard @MyMarlin.json" + }, + { + "name": "0.24mm Draft @MyMarlin", + "sub_path": "process/0.24mm Draft @MyMarlin.json" + }, + { + "name": "0.28mm Extra Draft @MyMarlin", + "sub_path": "process/0.28mm Extra Draft @MyMarlin.json" + }, + { + "name": "0.08mm Extra Fine @MyRRF", + "sub_path": "process/0.08mm Extra Fine @MyRRF.json" + }, + { + "name": "0.12mm Fine @MyRRF", + "sub_path": "process/0.12mm Fine @MyRRF.json" + }, + { + "name": "0.15mm Optimal @MyRRF", + "sub_path": "process/0.15mm Optimal @MyRRF.json" + }, + { + "name": "0.20mm Standard @MyRRF", + "sub_path": "process/0.20mm Standard @MyRRF.json" + }, + { + "name": "0.24mm Draft @MyRRF", + "sub_path": "process/0.24mm Draft @MyRRF.json" + }, + { + "name": "0.28mm Extra Draft @MyRRF", + "sub_path": "process/0.28mm Extra Draft @MyRRF.json" + }, + { + "name": "0.08mm Extra Fine @MyToolChanger", + "sub_path": "process/0.08mm Extra Fine @MyToolChanger.json" + }, + { + "name": "0.12mm Fine @MyToolChanger", + "sub_path": "process/0.12mm Fine @MyToolChanger.json" + }, + { + "name": "0.15mm Optimal @MyToolChanger", + "sub_path": "process/0.15mm Optimal @MyToolChanger.json" + }, + { + "name": "0.16mm Optimal @MyToolChanger", + "sub_path": "process/0.16mm Optimal @MyToolChanger.json" + }, + { + "name": "0.20mm Standard @MyToolChanger", + "sub_path": "process/0.20mm Standard @MyToolChanger.json" + }, + { + "name": "0.24mm Draft @MyToolChanger", + "sub_path": "process/0.24mm Draft @MyToolChanger.json" + }, + { + "name": "0.28mm Extra Draft @MyToolChanger", + "sub_path": "process/0.28mm Extra Draft @MyToolChanger.json" + }, + { + "name": "0.32mm Extra Draft @MyToolChanger", + "sub_path": "process/0.32mm Extra Draft @MyToolChanger.json" + }, + { + "name": "0.40mm Standard @MyToolChanger", + "sub_path": "process/0.40mm Extra Draft @MyToolChanger.json" + }, + { + "name": "0.56mm Standard @MyToolChanger", + "sub_path": "process/0.56mm Extra Draft @MyToolChanger.json" + } + ], + "filament_list": [ + { + "name": "Generic ABS @MyToolChanger", + "sub_path": "filament/Generic ABS @MyToolChanger.json" + }, + { + "name": "Generic ASA @MyToolChanger", + "sub_path": "filament/Generic ASA @MyToolChanger.json" + }, + { + "name": "Generic PA @MyToolChanger", + "sub_path": "filament/Generic PA @MyToolChanger.json" + }, + { + "name": "Generic PA-CF @MyToolChanger", + "sub_path": "filament/Generic PA-CF @MyToolChanger.json" + }, + { + "name": "Generic PC @MyToolChanger", + "sub_path": "filament/Generic PC @MyToolChanger.json" + }, + { + "name": "Generic PETG @MyToolChanger", + "sub_path": "filament/Generic PETG @MyToolChanger.json" + }, + { + "name": "Generic PLA @MyToolChanger", + "sub_path": "filament/Generic PLA @MyToolChanger.json" + }, + { + "name": "Generic PLA-CF @MyToolChanger", + "sub_path": "filament/Generic PLA-CF @MyToolChanger.json" + }, + { + "name": "Generic PVA @MyToolChanger", + "sub_path": "filament/Generic PVA @MyToolChanger.json" + }, + { + "name": "Generic TPU @MyToolChanger", + "sub_path": "filament/Generic TPU @MyToolChanger.json" + } + ], + "machine_list": [ + { + "name": "fdm_machine_common", + "sub_path": "machine/fdm_machine_common.json" + }, + { + "name": "MyMarlin 0.4 nozzle", + "sub_path": "machine/MyMarlin 0.4 nozzle.json" + }, + { + "name": "fdm_klipper_common", + "sub_path": "machine/fdm_klipper_common.json" + }, + { + "name": "fdm_rrf_common", + "sub_path": "machine/fdm_rrf_common.json" + }, + { + "name": "MyKlipper 0.2 nozzle", + "sub_path": "machine/MyKlipper 0.2 nozzle.json" + }, + { + "name": "MyKlipper 0.4 nozzle", + "sub_path": "machine/MyKlipper 0.4 nozzle.json" + }, + { + "name": "MyKlipper 0.6 nozzle", + "sub_path": "machine/MyKlipper 0.6 nozzle.json" + }, + { + "name": "MyKlipper 0.8 nozzle", + "sub_path": "machine/MyKlipper 0.8 nozzle.json" + }, + { + "name": "fdm_belt_common", + "sub_path": "machine/fdm_belt_common.json" + }, + { + "name": "fdm_toolchanger_common", + "sub_path": "machine/fdm_toolchanger_common.json" + }, + { + "name": "MyRRF 0.4 nozzle", + "sub_path": "machine/MyRRF 0.4 nozzle.json" + }, + { + "name": "MyBeltPrinter 0.2 nozzle", + "sub_path": "machine/MyBeltPrinter 0.2 nozzle.json" + }, + { + "name": "MyBeltPrinter 0.4 nozzle", + "sub_path": "machine/MyBeltPrinter 0.4 nozzle.json" + }, + { + "name": "MyBeltPrinter 0.6 nozzle", + "sub_path": "machine/MyBeltPrinter 0.6 nozzle.json" + }, + { + "name": "MyBeltPrinter 0.8 nozzle", + "sub_path": "machine/MyBeltPrinter 0.8 nozzle.json" + }, + { + "name": "MyToolChanger 0.2 nozzle", + "sub_path": "machine/MyToolChanger 0.2 nozzle.json" + }, + { + "name": "MyToolChanger 0.4 nozzle", + "sub_path": "machine/MyToolChanger 0.4 nozzle.json" + }, + { + "name": "MyToolChanger 0.6 nozzle", + "sub_path": "machine/MyToolChanger 0.6 nozzle.json" + }, + { + "name": "MyToolChanger 0.8 nozzle", + "sub_path": "machine/MyToolChanger 0.8 nozzle.json" + } + ] } diff --git a/resources/profiles/Custom/machine/MyBeltPrinter 0.2 nozzle.json b/resources/profiles/Custom/machine/MyBeltPrinter 0.2 nozzle.json index 576965a6ba..5e7655fbe1 100644 --- a/resources/profiles/Custom/machine/MyBeltPrinter 0.2 nozzle.json +++ b/resources/profiles/Custom/machine/MyBeltPrinter 0.2 nozzle.json @@ -1,26 +1,26 @@ { - "type": "machine", - "name": "MyBeltPrinter 0.2 nozzle", - "inherits": "fdm_belt_common", - "from": "system", - "setting_id": "GM_BELT_001", - "instantiation": "true", - "printer_model": "Generic Belt Printer", - "nozzle_diameter": [ - "0.2" - ], - "max_layer_height": [ - "0.16" - ], - "min_layer_height": [ - "0.04" - ], - "printer_variant": "0.2", - "printable_area": [ - "0x0", - "350x0", - "350x350", - "0x350" - ], - "printable_height": "300" -} \ No newline at end of file + "type": "machine", + "name": "MyBeltPrinter 0.2 nozzle", + "inherits": "fdm_belt_common", + "from": "system", + "setting_id": "GM_BELT_001", + "instantiation": "true", + "printer_model": "Generic Belt Printer", + "nozzle_diameter": [ + "0.2" + ], + "max_layer_height": [ + "0.16" + ], + "min_layer_height": [ + "0.04" + ], + "printer_variant": "0.2", + "printable_area": [ + "0x0", + "350x0", + "350x350", + "0x350" + ], + "printable_height": "300" +} diff --git a/resources/profiles/Custom/machine/MyBeltPrinter 0.4 nozzle.json b/resources/profiles/Custom/machine/MyBeltPrinter 0.4 nozzle.json index b066b929cc..73be69ba61 100644 --- a/resources/profiles/Custom/machine/MyBeltPrinter 0.4 nozzle.json +++ b/resources/profiles/Custom/machine/MyBeltPrinter 0.4 nozzle.json @@ -1,20 +1,20 @@ { - "type": "machine", - "name": "MyBeltPrinter 0.4 nozzle", - "inherits": "fdm_belt_common", - "from": "system", - "setting_id": "GM_BELT_002", - "instantiation": "true", - "printer_model": "Generic Belt Printer", - "nozzle_diameter": [ - "0.4" - ], - "printer_variant": "0.4", - "printable_area": [ - "0x0", - "350x0", - "350x350", - "0x350" - ], - "printable_height": "300" -} \ No newline at end of file + "type": "machine", + "name": "MyBeltPrinter 0.4 nozzle", + "inherits": "fdm_belt_common", + "from": "system", + "setting_id": "GM_BELT_002", + "instantiation": "true", + "printer_model": "Generic Belt Printer", + "nozzle_diameter": [ + "0.4" + ], + "printer_variant": "0.4", + "printable_area": [ + "0x0", + "350x0", + "350x350", + "0x350" + ], + "printable_height": "300" +} diff --git a/resources/profiles/Custom/machine/MyBeltPrinter 0.6 nozzle.json b/resources/profiles/Custom/machine/MyBeltPrinter 0.6 nozzle.json index e45fa70489..49646db06d 100644 --- a/resources/profiles/Custom/machine/MyBeltPrinter 0.6 nozzle.json +++ b/resources/profiles/Custom/machine/MyBeltPrinter 0.6 nozzle.json @@ -1,26 +1,26 @@ { - "type": "machine", - "name": "MyBeltPrinter 0.6 nozzle", - "inherits": "fdm_belt_common", - "from": "system", - "setting_id": "GM_BELT_003", - "instantiation": "true", - "printer_model": "Generic Belt Printer", - "nozzle_diameter": [ - "0.6" - ], - "max_layer_height": [ - "0.4" - ], - "min_layer_height": [ - "0.12" - ], - "printer_variant": "0.6", - "printable_area": [ - "0x0", - "350x0", - "350x350", - "0x350" - ], - "printable_height": "300" -} \ No newline at end of file + "type": "machine", + "name": "MyBeltPrinter 0.6 nozzle", + "inherits": "fdm_belt_common", + "from": "system", + "setting_id": "GM_BELT_003", + "instantiation": "true", + "printer_model": "Generic Belt Printer", + "nozzle_diameter": [ + "0.6" + ], + "max_layer_height": [ + "0.4" + ], + "min_layer_height": [ + "0.12" + ], + "printer_variant": "0.6", + "printable_area": [ + "0x0", + "350x0", + "350x350", + "0x350" + ], + "printable_height": "300" +} diff --git a/resources/profiles/Custom/machine/MyBeltPrinter 0.8 nozzle.json b/resources/profiles/Custom/machine/MyBeltPrinter 0.8 nozzle.json index 90133edd29..412291754e 100644 --- a/resources/profiles/Custom/machine/MyBeltPrinter 0.8 nozzle.json +++ b/resources/profiles/Custom/machine/MyBeltPrinter 0.8 nozzle.json @@ -1,26 +1,26 @@ { - "type": "machine", - "name": "MyBeltPrinter 0.8 nozzle", - "inherits": "fdm_belt_common", - "from": "system", - "setting_id": "GM_BELT_004", - "instantiation": "true", - "printer_model": "Generic Belt Printer", - "nozzle_diameter": [ - "0.8" - ], - "max_layer_height": [ - "0.6" - ], - "min_layer_height": [ - "0.2" - ], - "printer_variant": "0.8", - "printable_area": [ - "0x0", - "350x0", - "350x350", - "0x350" - ], - "printable_height": "300" -} \ No newline at end of file + "type": "machine", + "name": "MyBeltPrinter 0.8 nozzle", + "inherits": "fdm_belt_common", + "from": "system", + "setting_id": "GM_BELT_004", + "instantiation": "true", + "printer_model": "Generic Belt Printer", + "nozzle_diameter": [ + "0.8" + ], + "max_layer_height": [ + "0.6" + ], + "min_layer_height": [ + "0.2" + ], + "printer_variant": "0.8", + "printable_area": [ + "0x0", + "350x0", + "350x350", + "0x350" + ], + "printable_height": "300" +} diff --git a/resources/profiles/Custom/machine/MyBeltPrinter.json b/resources/profiles/Custom/machine/MyBeltPrinter.json index 2761644788..0f6e0c5891 100644 --- a/resources/profiles/Custom/machine/MyBeltPrinter.json +++ b/resources/profiles/Custom/machine/MyBeltPrinter.json @@ -1,12 +1,12 @@ { - "type": "machine_model", - "name": "Generic Belt Printer", - "model_id": "my_belt_01", - "nozzle_diameter": "0.4;0.2;0.6;0.8", - "machine_tech": "FFF", - "family": "MyPrinter", - "bed_model": "Custom_350_bed.stl", - "bed_texture": "orcaslicer_bed_texture.svg", - "hotend_model": "", - "default_materials": "Generic PLA @System;Generic PLA-CF @System;Generic PETG @System;Generic TPU @System;Generic PC @System;Generic PVA @System;Generic PA @System;Generic PA-CF @System" -} \ No newline at end of file + "type": "machine_model", + "name": "Generic Belt Printer", + "model_id": "my_belt_01", + "nozzle_diameter": "0.4;0.2;0.6;0.8", + "machine_tech": "FFF", + "family": "MyPrinter", + "bed_model": "Custom_350_bed.stl", + "bed_texture": "orcaslicer_bed_texture.svg", + "hotend_model": "", + "default_materials": "Generic PLA @System;Generic PLA-CF @System;Generic PETG @System;Generic TPU @System;Generic PC @System;Generic PVA @System;Generic PA @System;Generic PA-CF @System" +} diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index 46603f7faf..1ca314da0f 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -1,100 +1,100 @@ { - "type": "machine", - "name": "fdm_belt_common", - "inherits": "fdm_klipper_common", - "from": "system", - "instantiation": "false", - "gcode_flavor": "klipper", - "single_extruder_multi_material": "0", - "default_filament_profile": [ - "Generic PLA @System" - ], - "default_print_profile": "0.20mm Standard @System", - "max_layer_height": [ - "0.32" - ], - "min_layer_height": [ - "0.08" - ], - "deretraction_speed": [ - "30" - ], - "extruder_colour": [ - "#FCE94F" - ], - "extruder_offset": [ - "0x0" - ], - "long_retractions_when_cut": [ - "0" - ], - "nozzle_diameter": [ - "0.4" - ], - "retract_before_wipe": [ - "70%" - ], - "retract_length_toolchange": [ - "2" - ], - "retract_lift_above": [ - "0" - ], - "retract_lift_below": [ - "0" - ], - "retract_lift_enforce": [ - "All Surfaces" - ], - "retract_restart_extra": [ - "0" - ], - "retract_restart_extra_toolchange": [ - "0" - ], - "retract_when_changing_layer": [ - "1" - ], - "retraction_distances_when_cut": [ - "18" - ], - "retraction_length": [ - "0.8" - ], - "retraction_minimum_travel": [ - "1" - ], - "retraction_speed": [ - "30" - ], - "travel_slope": [ - "3" - ], - "wipe": [ - "1" - ], - "wipe_distance": [ - "1" - ], - "z_hop": [ - "0.4" - ], - "z_hop_types": [ - "Normal Lift" - ], - "preslice_remap_y": "pos_z", - "preslice_remap_z": "pos_y", - "preslice_remap_global": "1", - "printer_extruder_id": [ - "1" - ], - "belt_origin_snap_y": "1", - "belt_printer": "1", - "belt_preslice_global": "1", - "belt_shear_z": "pos_cot", - "belt_shear_z_angle": "30", - "build_plate_tilt_x": "45", - "purge_in_prime_tower": "0", - "scan_first_layer": "0", - "auxiliary_fan": "0" -} \ No newline at end of file + "type": "machine", + "name": "fdm_belt_common", + "inherits": "fdm_klipper_common", + "from": "system", + "instantiation": "false", + "gcode_flavor": "klipper", + "single_extruder_multi_material": "0", + "default_filament_profile": [ + "Generic PLA @System" + ], + "default_print_profile": "0.20mm Standard @System", + "max_layer_height": [ + "0.32" + ], + "min_layer_height": [ + "0.08" + ], + "deretraction_speed": [ + "30" + ], + "extruder_colour": [ + "#FCE94F" + ], + "extruder_offset": [ + "0x0" + ], + "long_retractions_when_cut": [ + "0" + ], + "nozzle_diameter": [ + "0.4" + ], + "retract_before_wipe": [ + "70%" + ], + "retract_length_toolchange": [ + "2" + ], + "retract_lift_above": [ + "0" + ], + "retract_lift_below": [ + "0" + ], + "retract_lift_enforce": [ + "All Surfaces" + ], + "retract_restart_extra": [ + "0" + ], + "retract_restart_extra_toolchange": [ + "0" + ], + "retract_when_changing_layer": [ + "1" + ], + "retraction_distances_when_cut": [ + "18" + ], + "retraction_length": [ + "0.8" + ], + "retraction_minimum_travel": [ + "1" + ], + "retraction_speed": [ + "30" + ], + "travel_slope": [ + "3" + ], + "wipe": [ + "1" + ], + "wipe_distance": [ + "1" + ], + "z_hop": [ + "0.4" + ], + "z_hop_types": [ + "Normal Lift" + ], + "preslice_remap_y": "pos_z", + "preslice_remap_z": "pos_y", + "preslice_remap_global": "1", + "printer_extruder_id": [ + "1" + ], + "belt_origin_snap_y": "1", + "belt_printer": "1", + "belt_preslice_global": "1", + "belt_shear_z": "pos_cot", + "belt_shear_z_angle": "30", + "build_plate_tilt_x": "45", + "purge_in_prime_tower": "0", + "scan_first_layer": "0", + "auxiliary_fan": "0" +} From 6a2d690f459e265963eb81ddf3aa9a615e95bc82 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Mon, 18 May 2026 19:01:43 -0500 Subject: [PATCH 026/389] Decouple Slicing From Machine Frame Logic (#21) * minor logic swap * first attempt, has a race condition * fixed the offset issue * found a solution, I think things work now (at least once I quash this race condition) * still chasing down race conditions * add manual shear / scale order strategy swap * tweak manual shear, fix ui uninitialization crash * fix z height / g-code desync issue * fix shear then scale cutoff planes * getting closer * fix support termination planes * fix incorrect offsets in shear-then-scale mode * test - fix overextrusion due to model/layer scale --- .claude/scheduled_tasks.lock | 1 - src/libslic3r/BeltGCode.cpp | 52 ++++++- src/libslic3r/BeltGCodeWriter.cpp | 26 +++- src/libslic3r/BeltGCodeWriter.hpp | 9 +- src/libslic3r/BeltSliceStrategy.cpp | 17 +- src/libslic3r/BeltSliceStrategy.hpp | 9 +- src/libslic3r/BeltTransform.cpp | 73 +++++++-- src/libslic3r/BeltTransform.hpp | 4 +- src/libslic3r/CMakeLists.txt | 2 + src/libslic3r/GCode.cpp | 14 ++ src/libslic3r/GCode/MachineFrameTransform.cpp | 147 ++++++++++++++++++ src/libslic3r/GCode/MachineFrameTransform.hpp | 43 +++++ src/libslic3r/Preset.cpp | 9 ++ src/libslic3r/Print.cpp | 12 ++ src/libslic3r/PrintConfig.cpp | 65 ++++++++ src/libslic3r/PrintConfig.hpp | 30 ++++ src/libslic3r/PrintObject.cpp | 14 +- src/libslic3r/PrintObjectSlice.cpp | 53 ++++++- src/slic3r/GUI/Tab.cpp | 87 +++++++++++ 19 files changed, 621 insertions(+), 46 deletions(-) delete mode 100644 .claude/scheduled_tasks.lock create mode 100644 src/libslic3r/GCode/MachineFrameTransform.cpp create mode 100644 src/libslic3r/GCode/MachineFrameTransform.hpp diff --git a/.claude/scheduled_tasks.lock b/.claude/scheduled_tasks.lock deleted file mode 100644 index cce3208834..0000000000 --- a/.claude/scheduled_tasks.lock +++ /dev/null @@ -1 +0,0 @@ -{"sessionId":"597ab29b-cd70-40f4-95d9-fee98b3968ad","pid":1159657,"acquiredAt":1775936463783} \ No newline at end of file diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index a34acf95bd..767d280579 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -17,6 +17,7 @@ void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) belt_writer->set_belt_angle(print.config().belt_printer_angle.value); // Axis remap and build volume max are set by base GCode after init_belt_writer returns. belt_writer->set_belt_back_transform(print.config()); + belt_writer->set_machine_frame_transform(print.config()); m_writer = std::move(belt_writer); // Per-axis origin snap config. @@ -52,12 +53,33 @@ void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); + file.write_format("; belt_mesh_transform_order = %s\n", full_cfg.opt_serialize("belt_mesh_transform_order").c_str()); // Pre-slice remap configs file.write_format("; preslice_remap_x = %s\n", full_cfg.opt_serialize("preslice_remap_x").c_str()); file.write_format("; preslice_remap_y = %s\n", full_cfg.opt_serialize("preslice_remap_y").c_str()); file.write_format("; preslice_remap_z = %s\n", full_cfg.opt_serialize("preslice_remap_z").c_str()); file.write_format("; preslice_remap_global = %d\n", print.config().preslice_remap_global.value ? 1 : 0); file.write_format("; belt_preslice_global = %d\n", print.config().belt_preslice_global.value ? 1 : 0); + // Machine-frame transform configs + file.write_format("; gcode_shear_x = %s\n", full_cfg.opt_serialize("gcode_shear_x").c_str()); + file.write_format("; gcode_shear_x_angle = %.1f\n", print.config().gcode_shear_x_angle.value); + file.write_format("; gcode_shear_x_from = %s\n", full_cfg.opt_serialize("gcode_shear_x_from").c_str()); + file.write_format("; gcode_shear_y = %s\n", full_cfg.opt_serialize("gcode_shear_y").c_str()); + file.write_format("; gcode_shear_y_angle = %.1f\n", print.config().gcode_shear_y_angle.value); + file.write_format("; gcode_shear_y_from = %s\n", full_cfg.opt_serialize("gcode_shear_y_from").c_str()); + file.write_format("; gcode_shear_z = %s\n", full_cfg.opt_serialize("gcode_shear_z").c_str()); + file.write_format("; gcode_shear_z_angle = %.1f\n", print.config().gcode_shear_z_angle.value); + file.write_format("; gcode_shear_z_from = %s\n", full_cfg.opt_serialize("gcode_shear_z_from").c_str()); + file.write_format("; gcode_scale_x = %s\n", full_cfg.opt_serialize("gcode_scale_x").c_str()); + file.write_format("; gcode_scale_x_angle = %.1f\n", print.config().gcode_scale_x_angle.value); + file.write_format("; gcode_scale_y = %s\n", full_cfg.opt_serialize("gcode_scale_y").c_str()); + file.write_format("; gcode_scale_y_angle = %.1f\n", print.config().gcode_scale_y_angle.value); + file.write_format("; gcode_scale_z = %s\n", full_cfg.opt_serialize("gcode_scale_z").c_str()); + file.write_format("; gcode_scale_z_angle = %.1f\n", print.config().gcode_scale_z_angle.value); + file.write_format("; belt_gcode_transform_order = %s\n", full_cfg.opt_serialize("belt_gcode_transform_order").c_str()); + file.write_format("; post_gcode_remap_x = %s\n", full_cfg.opt_serialize("post_gcode_remap_x").c_str()); + file.write_format("; post_gcode_remap_y = %s\n", full_cfg.opt_serialize("post_gcode_remap_y").c_str()); + file.write_format("; post_gcode_remap_z = %s\n", full_cfg.opt_serialize("post_gcode_remap_z").c_str()); } void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) @@ -67,20 +89,31 @@ void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) // back_transform(T * origin) = origin (correct machine position). // This replaces the bbox-based axis snap with an exact formula. // - // Two flags trigger this path: + // Flags that trigger this path: // belt_preslice_global — full pipeline (scale * shear * remap) is global // preslice_remap_global — only the pre-slice remap is global + // belt_shear_z_global — Z-row shear treated as global (matches per-axis + // Z-offset added in PrintObjectSlice.cpp) // The XY origin adjustment uses the FULL forward transform either way, // because the back_transform applied during G-code emission is always the - // inverse of the full pipeline. When only the remap is configured, both - // flags produce identical math (T == R). + // inverse of the full pipeline. Without pre-multiplication under + // ShearThenScale order with sy != 1, machine_y of bed position cy ends up + // at cy/sy instead of cy, which also leaves the object bottom off the belt + // plane. bool use_global = m_config.belt_preslice_global.value || (m_config.preslice_remap_global.value - && BeltTransformPipeline::has_preslice_remap(m_config)); + && BeltTransformPipeline::has_preslice_remap(m_config)) + || (m_config.belt_shear_z_global.value + && m_config.belt_shear_z.value != BeltShearMode::None); if (use_global && m_config.belt_printer.value) { auto *belt_writer = dynamic_cast(m_writer.get()); if (belt_writer) { - // Clear snap — not needed with computed corrections + // The per-object lift (z_shift_val = max(0, -m_belt_min_z)) added by + // BeltSliceStrategy::apply_to_trafo is already compensated inside + // global_z_offset (via the shear_min_z term in PrintObjectSlice.cpp's + // preslice_global branch). Snap was previously used here for the same + // purpose, but with both active the lift gets subtracted twice. Clear + // any leftover snap state from a prior instance. for (int a = 0; a < 3; ++a) belt_writer->set_origin_snap(a, false, 0., 0.); } @@ -125,7 +158,12 @@ void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) unscale(inst_shift.y()), obj->belt_global_z_offset()); - // Compute this instance's machine-space bbox min + // Compute this instance's bbox min in the Cartesian frame (post back_transform + // + axis_remap, before machine_frame_transform). Using to_cartesian instead of + // to_machine_coords ensures the 8 axis-aligned bbox corners coincide with the + // geometry's extreme points — a property that breaks under shear, which would + // mis-normalize non-cubic shapes (inverted cone, benchy) by their bbox-volume + // corners rather than their actual lowest geometry point. BoundingBoxf3 bb = obj->model_object()->raw_bounding_box(); Vec3d mn = bb.min.cast(), mx = bb.max.cast(); Vec3d inst_min(std::numeric_limits::max(), @@ -135,7 +173,7 @@ void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) Vec3d c((i & 1) ? mx.x() : mn.x(), (i & 2) ? mx.y() : mn.y(), (i & 4) ? mx.z() : mn.z()); - Vec3d mc = belt_writer->to_machine_coords(full * c + shift); + Vec3d mc = belt_writer->to_cartesian(full * c + shift); for (int a = 0; a < 3; ++a) inst_min[a] = std::min(inst_min[a], mc[a]); } diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index ea90f2588e..1987d0127a 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -34,6 +34,11 @@ void BeltGCodeWriter::set_belt_back_transform(const PrintConfig &config) m_belt_back_transform.init_from_config(config); } +void BeltGCodeWriter::set_machine_frame_transform(const PrintConfig &config) +{ + m_machine_frame_transform.init_from_config(config); +} + void BeltGCodeWriter::set_origin_snap(int axis, bool enable, double offset, double bbox_min) { if (axis >= 0 && axis < 3) { @@ -43,17 +48,26 @@ void BeltGCodeWriter::set_origin_snap(int axis, bool enable, double offset, doub } } +Vec3d BeltGCodeWriter::to_cartesian(const Vec3d &pos) const +{ + // back_transform → axis_remap, no origin_snap, no machine_frame_transform. + return apply_axis_remap(m_belt_back_transform.apply(pos)); +} + Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const { - // Step 1: Undo the shear/scale applied during slicing. - Vec3d p = m_belt_back_transform.apply(pos); - // Step 2: Apply axis remap (uses inherited base class method). - Vec3d result = apply_axis_remap(p); - // Step 3: Per-axis origin snap. + // Step 1+2: To Cartesian (back_transform + axis_remap). + Vec3d result = to_cartesian(pos); + // Step 3: Per-axis origin snap (computed in the Cartesian frame). for (int i = 0; i < 3; ++i) if (m_origin_snap[i]) result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); - return result; + // Step 4: Machine-frame transform (gcode_shear / gcode_scale / post_gcode_remap) + // applied LAST so it acts as a global linear transform on the placed coords. + // Order matters: putting it before origin_snap would feed sheared bbox corners + // into the snap's per-object min calculation, mis-normalizing non-cubic geometries + // (the corners of the original bbox aren't extreme points of the sheared shape). + return m_machine_frame_transform.apply(result); } // ---- Overridden movement methods ------------------------------------------ diff --git a/src/libslic3r/BeltGCodeWriter.hpp b/src/libslic3r/BeltGCodeWriter.hpp index 828dd43bb3..60fd93f3e0 100644 --- a/src/libslic3r/BeltGCodeWriter.hpp +++ b/src/libslic3r/BeltGCodeWriter.hpp @@ -2,6 +2,7 @@ #include "GCodeWriter.hpp" #include "GCode/BeltBackTransform.hpp" +#include "GCode/MachineFrameTransform.hpp" namespace Slic3r { @@ -21,8 +22,13 @@ public: void set_belt_angle(double angle_deg); bool is_belt_printer() const { return m_belt_angle_rad != 0.; } void set_belt_back_transform(const PrintConfig &config); + void set_machine_frame_transform(const PrintConfig &config); void set_origin_snap(int axis, bool enable, double offset, double bbox_min); Vec3d to_machine_coords(const Vec3d &pos) const; + // back_transform + axis_remap only (no origin_snap, no machine_frame_transform). + // Used by on_set_origin for bbox computation in the Cartesian frame, where + // axis-aligned bbox corners coincide with the geometry's extreme points. + Vec3d to_cartesian(const Vec3d &pos) const; // First-layer plane: when set to a non-null active evaluator, travel // speed selection consults the plane per-move and uses @@ -47,7 +53,8 @@ protected: private: double m_belt_angle_rad = 0.; - BeltBackTransform m_belt_back_transform; + BeltBackTransform m_belt_back_transform; + MachineFrameTransform m_machine_frame_transform; bool m_origin_snap[3] = {false, false, false}; double m_origin_offset[3] = {0., 0., 0.}; double m_origin_bbox_min[3] = {0., 0., 0.}; diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp index c1a300869e..850a4ad221 100644 --- a/src/libslic3r/BeltSliceStrategy.cpp +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -1,6 +1,7 @@ #include "BeltSliceStrategy.hpp" #include +#include namespace Slic3r { @@ -15,6 +16,7 @@ BeltSliceStrategy::BeltSliceStrategy(const PrintConfig &config) { m_shear = BeltTransformPipeline::build_shear_matrix(config, &m_has_shear); m_scale = BeltTransformPipeline::build_scale_matrix(config, &m_has_scale); + m_order = config.belt_mesh_transform_order.value; } void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, @@ -22,10 +24,13 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, bool has_remap, double *out_belt_min_z) const { - // Shear + scale (belt-only; pre-slice remap is handled separately). + // ScaleThenShear: applied to a point, scale runs first then shear (m_shear * m_scale). + // ShearThenScale: applied to a point, shear runs first then scale (m_scale * m_shear). if (m_has_shear || m_has_scale) { Transform3d belt_xform = Transform3d::Identity(); - belt_xform.linear() = m_scale * m_shear; + belt_xform.linear() = (m_order == BeltTransformOrder::ScaleThenShear) + ? Matrix3d(m_shear * m_scale) + : Matrix3d(m_scale * m_shear); trafo = belt_xform * trafo; } @@ -47,8 +52,12 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, z_shift.matrix()(2, 3) = belt_z_shift_val; trafo = z_shift * trafo; } - if (out_belt_min_z) - *out_belt_min_z = (min_z != std::numeric_limits::max()) ? min_z : 0.; + if (out_belt_min_z) { + double new_val = (min_z != std::numeric_limits::max()) ? min_z : 0.; + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_min_z tid=" << std::this_thread::get_id() + << " target=" << out_belt_min_z << " old=" << *out_belt_min_z << " new=" << new_val; + *out_belt_min_z = new_val; + } } } diff --git a/src/libslic3r/BeltSliceStrategy.hpp b/src/libslic3r/BeltSliceStrategy.hpp index ef6e038ee7..c2362e3552 100644 --- a/src/libslic3r/BeltSliceStrategy.hpp +++ b/src/libslic3r/BeltSliceStrategy.hpp @@ -34,10 +34,11 @@ public: private: explicit BeltSliceStrategy(const PrintConfig &config); - bool m_has_shear = false; - bool m_has_scale = false; - Matrix3d m_shear = Matrix3d::Identity(); - Matrix3d m_scale = Matrix3d::Identity(); + bool m_has_shear = false; + bool m_has_scale = false; + Matrix3d m_shear = Matrix3d::Identity(); + Matrix3d m_scale = Matrix3d::Identity(); + BeltTransformOrder m_order = BeltTransformOrder::ScaleThenShear; }; } // namespace Slic3r diff --git a/src/libslic3r/BeltTransform.cpp b/src/libslic3r/BeltTransform.cpp index 9bb66fcfb6..6c0838b2eb 100644 --- a/src/libslic3r/BeltTransform.cpp +++ b/src/libslic3r/BeltTransform.cpp @@ -103,9 +103,15 @@ Transform3d BeltTransformPipeline::build_forward_transform(const PrintConfig &co bool scale_active = false; Matrix3d scale = build_scale_matrix(config, &scale_active); - // Pipeline: scale * shear * pre_remap + // Match the mesh-side ordering selected by belt_mesh_transform_order so + // BeltBackTransform inverts the same composition that BeltSliceStrategy + // applied to the mesh. + // ScaleThenShear: applied to p, scale runs first then shear (shear * scale). + // ShearThenScale: applied to p, shear runs first then scale (scale * shear). Transform3d combined = Transform3d::Identity(); - combined.linear() = scale * shear; + combined.linear() = (config.belt_mesh_transform_order.value == BeltTransformOrder::ScaleThenShear) + ? Matrix3d(shear * scale) + : Matrix3d(scale * shear); combined = combined * pre_remap; return combined; } @@ -160,19 +166,30 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( BeltTransformPipeline::BeltHeightResult result; result.object_height = original_height; - // Extract Z-axis shear/scale config. + // Extract Z-axis shear/scale + per-axis scale + transform order from config. BeltShearMode z_shear_mode; double z_shear_angle; BeltScaleMode z_scale_mode; double z_scale_angle; int z_shear_from; + BeltScaleMode from_scale_mode; // scale on the shear's source axis + double from_scale_angle; + BeltTransformOrder order; if constexpr (std::is_same_v) { - z_shear_mode = config.belt_shear_z.value; - z_shear_angle = config.belt_shear_z_angle.value; - z_scale_mode = config.belt_scale_z.value; - z_scale_angle = config.belt_scale_z_angle.value; - z_shear_from = int(config.belt_shear_z_from.value); + z_shear_mode = config.belt_shear_z.value; + z_shear_angle = config.belt_shear_z_angle.value; + z_scale_mode = config.belt_scale_z.value; + z_scale_angle = config.belt_scale_z_angle.value; + z_shear_from = int(config.belt_shear_z_from.value); + order = config.belt_mesh_transform_order.value; + if (z_shear_from == 0) { + from_scale_mode = config.belt_scale_x.value; + from_scale_angle = config.belt_scale_x_angle.value; + } else { + from_scale_mode = config.belt_scale_y.value; + from_scale_angle = config.belt_scale_y_angle.value; + } } else { // DynamicPrintConfig path auto get_shear = [&](const char *key) { @@ -191,11 +208,23 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( auto *opt = config.template option>(key); return opt ? int(opt->value) : 1; }; + auto get_order = [&](const char *key) { + auto *opt = config.template option>(key); + return opt ? opt->value : BeltTransformOrder::ScaleThenShear; + }; z_shear_mode = get_shear("belt_shear_z"); z_shear_angle = get_float("belt_shear_z_angle"); z_scale_mode = get_scale("belt_scale_z"); z_scale_angle = get_float("belt_scale_z_angle"); z_shear_from = get_axis("belt_shear_z_from"); + order = get_order("belt_mesh_transform_order"); + if (z_shear_from == 0) { + from_scale_mode = get_scale("belt_scale_x"); + from_scale_angle = get_float("belt_scale_x_angle"); + } else { + from_scale_mode = get_scale("belt_scale_y"); + from_scale_angle = get_float("belt_scale_y_angle"); + } } bool has_z_shear = z_shear_mode != BeltShearMode::None; @@ -206,7 +235,8 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( double shear_factor = has_z_shear ? BeltTransformPipeline::compute_shear_factor(z_shear_mode, z_shear_angle) : 0.; - double scale_z = BeltTransformPipeline::compute_scale_factor(z_scale_mode, z_scale_angle); + double scale_z = BeltTransformPipeline::compute_scale_factor(z_scale_mode, z_scale_angle); + double scale_from = BeltTransformPipeline::compute_scale_factor(from_scale_mode, from_scale_angle); if (has_z_shear && std::abs(shear_factor) > EPSILON) { int from = z_shear_from; @@ -214,14 +244,29 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( double max_rz = std::numeric_limits::lowest(); for (double vz : {bb.min.z(), bb.max.z()}) for (double vs : {bb.min(from), bb.max(from)}) { - double new_z = scale_z * (vz + shear_factor * vs); + // Mesh-frame new_z computed per ordering. + // scale-then-shear: Z_s = sz*Z_m + s_from*tan(α)*from_m + // shear-then-scale: Z_s = sz*(Z_m + tan(α)*from_m) + double new_z = (order == BeltTransformOrder::ScaleThenShear) + ? scale_z * vz + scale_from * shear_factor * vs + : scale_z * (vz + shear_factor * vs); min_rz = std::min(min_rz, new_z); max_rz = std::max(max_rz, new_z); } - result.object_height = max_rz - min_rz; - result.floor_params.shear_factor = shear_factor; - result.floor_params.from_axis = from; - result.floor_params.z_shift = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); + result.object_height = max_rz - min_rz; + // Effective slicer-frame slope of the belt surface (Z_m=0 line): + // scale-then-shear: Z_s = tan(α) * Y_s → slope = tan(α) + // shear-then-scale: Z_s = sz/s_from * tan(α) * Y_s → slope = sz*tan(α)/s_from + // The downstream cutoff formula `Y_s = (print_z - z_shift) / slope` + // and floor_print_z(Y_s) = slope * Y_s + z_shift use this slope. + double effective_shear = (order == BeltTransformOrder::ScaleThenShear) + ? shear_factor + : (std::abs(scale_from) > EPSILON + ? scale_z * shear_factor / scale_from + : shear_factor); + result.floor_params.shear_factor = effective_shear; + result.floor_params.from_axis = from; + result.floor_params.z_shift = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); } else { result.object_height = original_height * scale_z; } diff --git a/src/libslic3r/BeltTransform.hpp b/src/libslic3r/BeltTransform.hpp index 3c0665c252..f15a9995c3 100644 --- a/src/libslic3r/BeltTransform.hpp +++ b/src/libslic3r/BeltTransform.hpp @@ -105,7 +105,9 @@ public: // Also sets has_scale_out if non-null. static Matrix3d build_scale_matrix(const PrintConfig &config, bool *has_scale_out = nullptr); - // Combined forward transform: scale * shear * pre_remap. + // Combined forward transform. Shear/scale order is selected by + // belt_mesh_transform_order so the result matches what BeltSliceStrategy + // applied to the mesh (BeltBackTransform inverts this). // Does NOT include the per-object Z-shift. static Transform3d build_forward_transform(const PrintConfig &config); diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index a887336361..f9910dc894 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -221,6 +221,8 @@ set(lisbslic3r_sources GCode/AvoidCrossingPerimeters.hpp GCode/BeltBackTransform.cpp GCode/BeltBackTransform.hpp + GCode/MachineFrameTransform.cpp + GCode/MachineFrameTransform.hpp GCode/ConflictChecker.cpp GCode/ConflictChecker.hpp GCode/CoolingBuffer.cpp diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index c3c3532364..b2aba1e35c 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -6462,6 +6462,20 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, auto _mm3_per_mm = path.mm3_per_mm * this->config().print_flow_ratio; _mm3_per_mm *= filament_flow_ratio; + // Belt printer: compensate for the volume change introduced by the mesh + // forward transform. path.mm3_per_mm is derived from slicer-frame layer + // height × line width, but a slicer-frame slab of volume V maps under the + // back-transform to a machine-frame region of volume V / |det(T)|. When + // det(T) > 1 — e.g. belt_scale_y = 1/cos(α) ≈ 1.155 at α = 30° — the + // machine slab holds less plastic than the slicer thinks it is filling + // and we over-extrude by det(T). Pure shear has det 1, so this is a + // no-op until scale factors deviate from 1. + if (m_config.belt_printer.value) { + double det = std::abs(BeltTransformPipeline::build_forward_transform(m_config).linear().determinant()); + if (det > EPSILON) + _mm3_per_mm /= det; + } + if (path.role() == erTopSolidInfill) { _mm3_per_mm *= m_config.top_solid_infill_flow_ratio; } else if (path.role() == erBottomSurface) { diff --git a/src/libslic3r/GCode/MachineFrameTransform.cpp b/src/libslic3r/GCode/MachineFrameTransform.cpp new file mode 100644 index 0000000000..10a658c7f7 --- /dev/null +++ b/src/libslic3r/GCode/MachineFrameTransform.cpp @@ -0,0 +1,147 @@ +#include "MachineFrameTransform.hpp" +#include "../BeltTransform.hpp" +#include "../BoundingBox.hpp" + +namespace Slic3r { + +namespace { + +// Build the post-gcode axis-remap transform (mirrors BeltTransformPipeline::build_preslice_remap +// but reads post_gcode_remap_* keys). Includes Rev-mode translation derived from build volume. +Transform3d build_post_gcode_remap(const PrintConfig &config) +{ + Transform3d remap = Transform3d::Identity(); + + int rx = int(config.post_gcode_remap_x.value); + int ry = int(config.post_gcode_remap_y.value); + int rz = int(config.post_gcode_remap_z.value); + + if (rx == int(RemapAxis::PosX) && ry == int(RemapAxis::PosY) && rz == int(RemapAxis::PosZ)) + return remap; + + auto remap_column = [](int r) -> Vec3d { + int axis = r % 3; + Vec3d col = Vec3d::Zero(); + if (r < 3) col[axis] = 1.0; + else if (r < 6) col[axis] = -1.0; + else col[axis] = -1.0; // Rev: max - pos + return col; + }; + + Matrix3d lin; + lin.col(0) = remap_column(rx); + lin.col(1) = remap_column(ry); + lin.col(2) = remap_column(rz); + remap.linear() = lin; + + if (rx >= 6 || ry >= 6 || rz >= 6) { + BoundingBoxf bbox_bed(config.printable_area.values); + Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), config.printable_height.value); + Vec3d trans = Vec3d::Zero(); + auto add_rev = [&](int r, int out) { + if (r >= 6) trans[out] = vol_max[r % 3]; + }; + add_rev(rx, 0); + add_rev(ry, 1); + add_rev(rz, 2); + remap.translation() = trans; + } + + return remap; +} + +// Build the 3x3 shear matrix from gcode_shear_* keys. +Matrix3d build_gcode_shear_matrix(const PrintConfig &config, bool &active) +{ + struct AxisShear { BeltShearMode mode; double angle; int from; }; + AxisShear axes[3] = { + { config.gcode_shear_x.value, config.gcode_shear_x_angle.value, int(config.gcode_shear_x_from.value) }, + { config.gcode_shear_y.value, config.gcode_shear_y_angle.value, int(config.gcode_shear_y_from.value) }, + { config.gcode_shear_z.value, config.gcode_shear_z_angle.value, int(config.gcode_shear_z_from.value) }, + }; + + Matrix3d shear = Matrix3d::Identity(); + active = false; + for (int row = 0; row < 3; ++row) { + if (axes[row].mode != BeltShearMode::None) { + double factor = BeltTransformPipeline::compute_shear_factor(axes[row].mode, axes[row].angle); + if (std::abs(factor) > EPSILON) { + shear(row, axes[row].from) += factor; + active = true; + } + } + } + return shear; +} + +// Build the 3x3 diagonal scale matrix from gcode_scale_* keys. +Matrix3d build_gcode_scale_matrix(const PrintConfig &config, bool &active) +{ + double sx = BeltTransformPipeline::compute_scale_factor(config.gcode_scale_x.value, config.gcode_scale_x_angle.value); + double sy = BeltTransformPipeline::compute_scale_factor(config.gcode_scale_y.value, config.gcode_scale_y_angle.value); + double sz = BeltTransformPipeline::compute_scale_factor(config.gcode_scale_z.value, config.gcode_scale_z_angle.value); + + active = (std::abs(sx - 1.) > EPSILON || + std::abs(sy - 1.) > EPSILON || + std::abs(sz - 1.) > EPSILON); + + Matrix3d scale = Matrix3d::Identity(); + if (active) { + scale(0, 0) = sx; + scale(1, 1) = sy; + scale(2, 2) = sz; + } + return scale; +} + +bool has_post_gcode_remap(const PrintConfig &config) +{ + return int(config.post_gcode_remap_x.value) != int(RemapAxis::PosX) || + int(config.post_gcode_remap_y.value) != int(RemapAxis::PosY) || + int(config.post_gcode_remap_z.value) != int(RemapAxis::PosZ); +} + +} // namespace + +bool MachineFrameTransform::init_from_config(const PrintConfig &config) +{ + m_active = false; + m_transform = Transform3d::Identity(); + + if (!config.belt_printer.value) + return false; + + Transform3d post_remap = build_post_gcode_remap(config); + bool shear_active = false; + Matrix3d shear = build_gcode_shear_matrix(config, shear_active); + bool scale_active = false; + Matrix3d scale = build_gcode_scale_matrix(config, scale_active); + + if (!shear_active && !scale_active && !has_post_gcode_remap(config)) + return false; + + // Compose per belt_gcode_transform_order: + // ScaleThenShear: applied to p, scale runs first then shear (shear * scale). + // ShearThenScale: applied to p, shear runs first then scale (scale * shear). + Transform3d combined = Transform3d::Identity(); + combined.linear() = (config.belt_gcode_transform_order.value == BeltTransformOrder::ScaleThenShear) + ? Matrix3d(shear * scale) + : Matrix3d(scale * shear); + combined = combined * post_remap; + + if (combined.isApprox(Transform3d::Identity())) + return false; + + m_transform = combined; + m_active = true; + return true; +} + +Vec3d MachineFrameTransform::apply(const Vec3d &pos) const +{ + if (!m_active) + return pos; + return m_transform * pos; +} + +} // namespace Slic3r diff --git a/src/libslic3r/GCode/MachineFrameTransform.hpp b/src/libslic3r/GCode/MachineFrameTransform.hpp new file mode 100644 index 0000000000..4a2f189802 --- /dev/null +++ b/src/libslic3r/GCode/MachineFrameTransform.hpp @@ -0,0 +1,43 @@ +#ifndef slic3r_MachineFrameTransform_hpp_ +#define slic3r_MachineFrameTransform_hpp_ + +#include "../libslic3r.h" +#include "../Point.hpp" +#include "../PrintConfig.hpp" + +namespace Slic3r { + +// Post-stage machine-frame transform for belt printers. +// +// Applied in BeltGCodeWriter::to_machine_coords AFTER the back-transform +// and the existing gcode_remap_* axis remap, and BEFORE per-axis origin snap. +// Maps Cartesian (axis-permuted) G-code coordinates into the printer's +// physical machine frame using a parallel set of options: +// gcode_shear_x/y/z + _angle + _from +// gcode_scale_x/y/z + _angle +// post_gcode_remap_x/y/z +// +// Composition matches the mesh-side pipeline: shear * scale * post_remap. +class MachineFrameTransform +{ +public: + MachineFrameTransform() = default; + + // Initialize from belt printer config. Returns true if a non-identity + // transform was computed. Inactive when belt_printer is disabled or + // all three sub-stages are identity. + bool init_from_config(const PrintConfig &config); + + // Apply the transform to a point. Returns pos unchanged if not active. + Vec3d apply(const Vec3d &pos) const; + + bool is_active() const { return m_active; } + +private: + bool m_active = false; + Transform3d m_transform = Transform3d::Identity(); +}; + +} // namespace Slic3r + +#endif // slic3r_MachineFrameTransform_hpp_ diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 6c6382f91d..a62628b3cd 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1326,8 +1326,17 @@ static std::vector s_Preset_printer_options { "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", "belt_shear_y_global", "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", "belt_shear_z_global", "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", + "belt_mesh_transform_order", "preslice_remap_x", "preslice_remap_y", "preslice_remap_z", "preslice_remap_global", "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", "gcode_back_transform", + "gcode_shear_x", "gcode_shear_x_angle", "gcode_shear_x_from", + "gcode_shear_y", "gcode_shear_y_angle", "gcode_shear_y_from", + "gcode_shear_z", "gcode_shear_z_angle", "gcode_shear_z_from", + "gcode_scale_x", "gcode_scale_x_angle", + "gcode_scale_y", "gcode_scale_y_angle", + "gcode_scale_z", "gcode_scale_z_angle", + "belt_gcode_transform_order", + "post_gcode_remap_x", "post_gcode_remap_y", "post_gcode_remap_z", "belt_preslice_global", "first_layer_plane", "first_layer_plane_offset", "first_layer_plane_thickness", "belt_origin_snap_x", "belt_origin_offset_x", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 09a8a50923..de5621a67a 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -104,6 +104,15 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", + // Machine-frame transforms (only affect G-code output, not slicing). + "gcode_shear_x", "gcode_shear_x_angle", "gcode_shear_x_from", + "gcode_shear_y", "gcode_shear_y_angle", "gcode_shear_y_from", + "gcode_shear_z", "gcode_shear_z_angle", "gcode_shear_z_from", + "gcode_scale_x", "gcode_scale_x_angle", + "gcode_scale_y", "gcode_scale_y_angle", + "gcode_scale_z", "gcode_scale_z_angle", + "belt_gcode_transform_order", + "post_gcode_remap_x", "post_gcode_remap_y", "post_gcode_remap_z", "belt_origin_snap_x", "belt_origin_offset_x", "belt_origin_snap_y", "belt_origin_offset_y", "belt_origin_snap_z", "belt_origin_offset_z", @@ -310,6 +319,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "belt_scale_y_angle" || opt_key == "belt_scale_z" || opt_key == "belt_scale_z_angle" + || opt_key == "belt_mesh_transform_order" + || opt_key == "belt_preslice_global" + || opt_key == "preslice_remap_global" || opt_key == "preslice_remap_x" || opt_key == "preslice_remap_y" || opt_key == "preslice_remap_z") { diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 5a9b63fc0f..ed0892ea04 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -307,6 +307,12 @@ static t_config_enum_values s_keys_map_BeltAxis { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltAxis) +static t_config_enum_values s_keys_map_BeltTransformOrder { + { "scale_then_shear", int(BeltTransformOrder::ScaleThenShear) }, + { "shear_then_scale", int(BeltTransformOrder::ShearThenScale) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltTransformOrder) + static t_config_enum_values s_keys_map_BeltScaleMode { { "none", int(BeltScaleMode::None) }, { "inv_sin", int(BeltScaleMode::InvSin) }, @@ -6320,6 +6326,24 @@ void PrintConfigDef::init_fff_params() add_belt_scale_mode("belt_scale_z", "Function", BeltScaleMode::None); add_belt_scale_angle("belt_scale_z_angle", "Angle"); + auto add_belt_transform_order = [this](const char *key, const char *label, const char *tooltip) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L(tooltip); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"scale_then_shear", "shear_then_scale"}; + def->enum_labels = {L("Scale, then shear"), L("Shear, then scale")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(BeltTransformOrder::ScaleThenShear)); + }; + + add_belt_transform_order("belt_mesh_transform_order", "Mesh transform order", + "Order in which the mesh shear and scale matrices are composed before slicing. " + "'Scale, then shear' applies scale first and then shear (current default). " + "'Shear, then scale' applies shear first and then scale. The g-code back-transform " + "follows the same order so that it correctly inverts the mesh transform."); + // G-code axis remap with sign auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, RemapAxis default_axis) { auto def = this->add(key, coEnum); @@ -6367,6 +6391,47 @@ void PrintConfigDef::init_fff_params() add_belt_remap("gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosY); add_belt_remap("gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosZ); + // Machine-frame G-code transforms: applied AFTER back-transform and gcode_remap, + // before per-axis origin snap. Maps Cartesian G-code to the printer's physical machine frame. + add_belt_shear_mode ("gcode_shear_x", "Function", BeltShearMode::None); + add_belt_shear_angle("gcode_shear_x_angle", "Angle"); + add_belt_axis_enum ("gcode_shear_x_from", "From", "Source axis for X shear in the machine-frame stage.", BeltAxis::Z); + + add_belt_shear_mode ("gcode_shear_y", "Function", BeltShearMode::None); + add_belt_shear_angle("gcode_shear_y_angle", "Angle"); + add_belt_axis_enum ("gcode_shear_y_from", "From", "Source axis for Y shear in the machine-frame stage.", BeltAxis::Z); + + add_belt_shear_mode ("gcode_shear_z", "Function", BeltShearMode::None); + add_belt_shear_angle("gcode_shear_z_angle", "Angle"); + add_belt_axis_enum ("gcode_shear_z_from", "From", "Source axis for Z shear in the machine-frame stage.", BeltAxis::Y); + + add_belt_scale_mode ("gcode_scale_x", "Function", BeltScaleMode::None); + add_belt_scale_angle("gcode_scale_x_angle", "Angle"); + + add_belt_scale_mode ("gcode_scale_y", "Function", BeltScaleMode::None); + add_belt_scale_angle("gcode_scale_y_angle", "Angle"); + + add_belt_scale_mode ("gcode_scale_z", "Function", BeltScaleMode::None); + add_belt_scale_angle("gcode_scale_z_angle", "Angle"); + + add_belt_transform_order("belt_gcode_transform_order", "G-code transform order", + "Order in which the machine-frame shear and scale matrices are composed when " + "applied to G-code coordinates. 'Scale, then shear' applies scale first and then " + "shear (current default). 'Shear, then scale' applies shear first and then scale."); + + add_belt_remap("post_gcode_remap_x", "X", + "Axis remap in the machine-frame stage. Applied AFTER gcode_remap, " + "to put coordinates into the printer's physical axis labelling. Default +X: no change.", + RemapAxis::PosX); + add_belt_remap("post_gcode_remap_y", "Y", + "Axis remap in the machine-frame stage. Applied AFTER gcode_remap, " + "to put coordinates into the printer's physical axis labelling. Default +Y: no change.", + RemapAxis::PosY); + add_belt_remap("post_gcode_remap_z", "Z", + "Axis remap in the machine-frame stage. Applied AFTER gcode_remap, " + "to put coordinates into the printer's physical axis labelling. Default +Z: no change.", + RemapAxis::PosZ); + def = this->add("gcode_back_transform", coBool); def->label = L("G-code back-transform"); def->category = L("Printable space"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 601cfcbb7e..904ecd742d 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -183,6 +183,15 @@ enum class BeltAxis Z = 2, }; +// Order in which the belt shear and scale matrices are composed. +// ScaleThenShear: applied to a point p, the result is shear(scale(p)). +// ShearThenScale: applied to a point p, the result is scale(shear(p)). +enum class BeltTransformOrder +{ + ScaleThenShear = 0, + ShearThenScale = 1, +}; + enum class RemapAxis { PosX = 0, PosY = 1, PosZ = 2, @@ -571,6 +580,7 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SlicingMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltShearMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltScaleMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltAxis) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltTransformOrder) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(RemapAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportFloorMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportZOffsetMode) @@ -1535,6 +1545,26 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, gcode_remap_x)) ((ConfigOptionEnum, gcode_remap_y)) ((ConfigOptionEnum, gcode_remap_z)) + ((ConfigOptionEnum, gcode_shear_x)) + ((ConfigOptionFloat, gcode_shear_x_angle)) + ((ConfigOptionEnum, gcode_shear_x_from)) + ((ConfigOptionEnum, gcode_shear_y)) + ((ConfigOptionFloat, gcode_shear_y_angle)) + ((ConfigOptionEnum, gcode_shear_y_from)) + ((ConfigOptionEnum, gcode_shear_z)) + ((ConfigOptionFloat, gcode_shear_z_angle)) + ((ConfigOptionEnum, gcode_shear_z_from)) + ((ConfigOptionEnum, gcode_scale_x)) + ((ConfigOptionFloat, gcode_scale_x_angle)) + ((ConfigOptionEnum, gcode_scale_y)) + ((ConfigOptionFloat, gcode_scale_y_angle)) + ((ConfigOptionEnum, gcode_scale_z)) + ((ConfigOptionFloat, gcode_scale_z_angle)) + ((ConfigOptionEnum, belt_mesh_transform_order)) + ((ConfigOptionEnum, belt_gcode_transform_order)) + ((ConfigOptionEnum, post_gcode_remap_x)) + ((ConfigOptionEnum, post_gcode_remap_y)) + ((ConfigOptionEnum, post_gcode_remap_z)) ((ConfigOptionBool, gcode_back_transform)) ((ConfigOptionBool, belt_preslice_global)) ((ConfigOptionEnum, first_layer_plane)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 78b75a8bbb..596053f685 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -3,6 +3,8 @@ #include "Point.hpp" #include "Print.hpp" #include "BeltTransform.hpp" + +#include #include "BoundingBox.hpp" #include "ClipperUtils.hpp" #include "ElephantFootCompensation.hpp" @@ -425,11 +427,15 @@ std::vector> PrintObject::detect_extruder_geometric_unprintables() // 3) Generates perimeters, gap fills and fill regions (fill regions of type stInternal). void PrintObject::make_perimeters() { + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] make_perimeters request tid=" << std::this_thread::get_id() << " obj=" << this; // prerequisites this->slice(); - if (! this->set_started(posPerimeters)) + if (! this->set_started(posPerimeters)) { + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] make_perimeters SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; return; + } + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] make_perimeters ENTER tid=" << std::this_thread::get_id() << " obj=" << this; m_print->set_status(15, L("Generating walls")); BOOST_LOG_TRIVIAL(info) << "Generating walls..." << log_memory_info(); @@ -527,6 +533,7 @@ void PrintObject::make_perimeters() m_print->throw_if_canceled(); BOOST_LOG_TRIVIAL(debug) << "Generating perimeters in parallel - end"; + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] make_perimeters EXIT tid=" << std::this_thread::get_id() << " obj=" << this; this->set_done(posPerimeters); } @@ -822,7 +829,9 @@ void PrintObject::detect_overhangs_for_lift() void PrintObject::generate_support_material() { + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] generate_support_material request tid=" << std::this_thread::get_id() << " obj=" << this; if (this->set_started(posSupportMaterial)) { + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] generate_support_material ENTER tid=" << std::this_thread::get_id() << " obj=" << this; this->clear_support_layers(); if(!has_support() && !m_print->get_no_check_flag()) { @@ -863,7 +872,10 @@ void PrintObject::generate_support_material() this->_generate_support_material(); m_print->throw_if_canceled(); } + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] generate_support_material EXIT tid=" << std::this_thread::get_id() << " obj=" << this; this->set_done(posSupportMaterial); + } else { + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] generate_support_material SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; } } diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 23e3583a2f..4454ce87ea 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1,5 +1,6 @@ #include #include +#include #include @@ -837,8 +838,12 @@ void groupingVolumesForBrim(PrintObject* object, LayerPtrs& layers, int firstLay // Resulting expolygons of layer regions are marked as Internal. void PrintObject::slice() { - if (! this->set_started(posSlice)) + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] slice request tid=" << std::this_thread::get_id() << " obj=" << this; + if (! this->set_started(posSlice)) { + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] slice SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; return; + } + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] slice ENTER tid=" << std::this_thread::get_id() << " obj=" << this; //BBS: add flag to reload scene for shell rendering m_print->set_status(5, L("Slicing mesh"), PrintBase::SlicingStatus::RELOAD_SCENE); std::vector layer_height_profile; @@ -942,11 +947,25 @@ void PrintObject::slice() Vec3d d(unscale(inst_shift.x()), unscale(inst_shift.y()), 0.); Vec3d c = T.linear() * d - d; - global_z_offset = c.z(); + // Per-object shape contribution: BeltSliceStrategy::apply_to_trafo + // lifts the mesh by max(0, -m_belt_min_z) to keep slicer-frame Z + // above 0. Two objects at the same bed position but different + // m_belt_min_z (e.g. cube vs inverted-cone tip) otherwise end up + // at the same print_z, which causes the inverted-cone tip to + // start on the same layer as the cube's lowest sheared corner. + double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) + ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; + double shear_min_z = m_belt_min_z - belt_surface_z; + + global_z_offset = c.z() + shear_min_z; + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_global_xy_correction tid=" << std::this_thread::get_id() + << " obj=" << this << " old=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() + << ") new=(" << c.x() << "," << c.y() << ")"; m_belt_global_xy_correction = Vec2d(c.x(), c.y()); BOOST_LOG_TRIVIAL(warning) << "Belt preslice_global: correction=(" - << c.x() << ", " << c.y() << ", " << c.z() << ")"; + << c.x() << ", " << c.y() << ", " << c.z() << ")" + << " shear_min_z=" << shear_min_z << " (m_belt_min_z=" << m_belt_min_z << ")"; } else { struct GAxis { BeltShearMode mode; double angle; int from; bool global; }; GAxis gaxes[3] = { @@ -959,13 +978,27 @@ void PrintObject::slice() // (X/Y row shears with global would offset X/Y, not Z — not useful here.) const auto &za = gaxes[2]; // Z row if (za.global && za.mode != BeltShearMode::None && za.from < 2) { - double factor = BeltTransformPipeline::compute_shear_factor(za.mode, za.angle); + // Use the full forward-transform correction (same formula as + // preslice_global) so the per-bed-position offset matches what + // BeltGCode::on_set_origin's T.linear() pre-multiplication + // expects after back-transform. The simple `cy*tan(α)` form + // is exact only for ScaleThenShear; under ShearThenScale with + // sy != 1 it leaves the object bottom off the belt plane by + // cy*tan(α)*(sy-1)/sy. + Transform3d T = BeltTransformPipeline::build_forward_transform(pcfg); + Vec3d d(unscale(inst_shift.x()), unscale(inst_shift.y()), 0.); + Vec3d c = T.linear() * d - d; double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; double shear_min_z = m_belt_min_z - belt_surface_z; - Point phys = inst_shift; - double center_on_axis = (za.from == 0) ? unscale(phys.x()) : unscale(phys.y()); - global_z_offset += center_on_axis * factor + shear_min_z; + global_z_offset += c.z() + shear_min_z; + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_global_xy_correction tid=" << std::this_thread::get_id() + << " obj=" << this << " old=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() + << ") new=(" << c.x() << "," << c.y() << ")"; + m_belt_global_xy_correction = Vec2d(c.x(), c.y()); + BOOST_LOG_TRIVIAL(warning) << "Belt per-axis Z-shear-global: correction=(" + << c.x() << ", " << c.y() << ", " << c.z() << ")" + << " shear_min_z=" << shear_min_z << " (m_belt_min_z=" << m_belt_min_z << ")"; } // Pre-slice remap global mode: when on, the remap accounts for the @@ -983,6 +1016,8 @@ void PrintObject::slice() BOOST_LOG_TRIVIAL(warning) << "Belt global: z_offset=" << global_z_offset << " (relative to min across " << this->print()->objects().size() << " objects)"; + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_global_z_offset tid=" << std::this_thread::get_id() + << " obj=" << this << " old=" << m_belt_global_z_offset << " new=" << global_z_offset; m_belt_global_z_offset = global_z_offset; if (std::abs(global_z_offset) > EPSILON) { for (Layer *layer : m_layers) @@ -1003,6 +1038,10 @@ void PrintObject::slice() } // BBS + BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] slice EXIT tid=" << std::this_thread::get_id() << " obj=" << this + << " layers=" << m_layers.size() << " belt_min_z=" << m_belt_min_z + << " belt_global_z_offset=" << m_belt_global_z_offset + << " belt_xy=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ")"; this->set_done(posSlice); } diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index e707386576..92302c583e 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4491,6 +4491,7 @@ void TabPrinter::build_fff() line.append_option(optgroup->get_option("belt_scale_z_angle")); optgroup->append_line(line); } + optgroup->append_single_option_line("belt_mesh_transform_order"); { Line line = { L("Pre-slice axis remap"), L("Remap model axes before slicing so the slicer's coordinate system matches " @@ -4548,6 +4549,63 @@ void TabPrinter::build_fff() line.append_option(optgroup->get_option("belt_support_z_offset_mode")); optgroup->append_line(line); } + + // Machine-frame transforms: applied to G-code after back-transform and + // gcode_remap, before per-axis origin snap. Maps Cartesian G-code into + // the printer's physical machine frame. + { + auto mf = page->new_optgroup(L("Machine frame transforms"), L"param_advanced"); + { + Line line = { L("G-code shear X"), L("Shear applied to the X axis in the machine-frame stage (after back-transform and gcode_remap).") }; + line.append_option(mf->get_option("gcode_shear_x")); + line.append_option(mf->get_option("gcode_shear_x_angle")); + line.append_option(mf->get_option("gcode_shear_x_from")); + mf->append_line(line); + } + { + Line line = { L("G-code shear Y"), L("Shear applied to the Y axis in the machine-frame stage (after back-transform and gcode_remap).") }; + line.append_option(mf->get_option("gcode_shear_y")); + line.append_option(mf->get_option("gcode_shear_y_angle")); + line.append_option(mf->get_option("gcode_shear_y_from")); + mf->append_line(line); + } + { + Line line = { L("G-code shear Z"), L("Shear applied to the Z axis in the machine-frame stage (after back-transform and gcode_remap).") }; + line.append_option(mf->get_option("gcode_shear_z")); + line.append_option(mf->get_option("gcode_shear_z_angle")); + line.append_option(mf->get_option("gcode_shear_z_from")); + mf->append_line(line); + } + { + Line line = { L("G-code scale X"), L("Scale applied to the X axis in the machine-frame stage.") }; + line.append_option(mf->get_option("gcode_scale_x")); + line.append_option(mf->get_option("gcode_scale_x_angle")); + mf->append_line(line); + } + { + Line line = { L("G-code scale Y"), L("Scale applied to the Y axis in the machine-frame stage.") }; + line.append_option(mf->get_option("gcode_scale_y")); + line.append_option(mf->get_option("gcode_scale_y_angle")); + mf->append_line(line); + } + { + Line line = { L("G-code scale Z"), L("Scale applied to the Z axis in the machine-frame stage.") }; + line.append_option(mf->get_option("gcode_scale_z")); + line.append_option(mf->get_option("gcode_scale_z_angle")); + mf->append_line(line); + } + mf->append_single_option_line("belt_gcode_transform_order"); + { + Line line = { L("Post-gcode axis remap"), + L("Axis remap in the machine-frame stage. Applied AFTER gcode_remap, " + "to put coordinates into the printer's physical axis labelling.") }; + line.append_option(mf->get_option("post_gcode_remap_x")); + line.append_option(mf->get_option("post_gcode_remap_y")); + line.append_option(mf->get_option("post_gcode_remap_z")); + mf->append_line(line); + } + } + option = optgroup->get_option("thumbnails"); option.opt.full_width = true; optgroup->append_single_option_line(option, "printer_basic_information_advanced#g-code-thumbnails"); @@ -5395,6 +5453,7 @@ void TabPrinter::toggle_options() toggle_line("belt_printer_infinite_y", is_belt); for (auto el : {"belt_shear_x", "belt_shear_y", "belt_shear_z", "belt_scale_x", "belt_scale_y", "belt_scale_z", + "belt_mesh_transform_order", "belt_origin_snap_x", "belt_origin_snap_y", "belt_origin_snap_z"}) toggle_line(el, is_belt); @@ -5435,6 +5494,34 @@ void TabPrinter::toggle_options() auto scz = m_config->option>("belt_scale_z")->value; toggle_option("belt_scale_z_angle", is_belt && scz != BeltScaleMode::None); + // Machine-frame transforms: shown only in belt mode. + for (auto el : {"gcode_shear_x", "gcode_shear_y", "gcode_shear_z", + "gcode_scale_x", "gcode_scale_y", "gcode_scale_z", + "belt_gcode_transform_order", + "post_gcode_remap_x"}) + toggle_line(el, is_belt); + + auto gsx = m_config->option>("gcode_shear_x")->value; + toggle_option("gcode_shear_x_angle", is_belt && gsx != BeltShearMode::None); + toggle_option("gcode_shear_x_from", is_belt && gsx != BeltShearMode::None); + + auto gsy = m_config->option>("gcode_shear_y")->value; + toggle_option("gcode_shear_y_angle", is_belt && gsy != BeltShearMode::None); + toggle_option("gcode_shear_y_from", is_belt && gsy != BeltShearMode::None); + + auto gsz = m_config->option>("gcode_shear_z")->value; + toggle_option("gcode_shear_z_angle", is_belt && gsz != BeltShearMode::None); + toggle_option("gcode_shear_z_from", is_belt && gsz != BeltShearMode::None); + + auto gscx = m_config->option>("gcode_scale_x")->value; + toggle_option("gcode_scale_x_angle", is_belt && gscx != BeltScaleMode::None); + + auto gscy = m_config->option>("gcode_scale_y")->value; + toggle_option("gcode_scale_y_angle", is_belt && gscy != BeltScaleMode::None); + + auto gscz = m_config->option>("gcode_scale_z")->value; + toggle_option("gcode_scale_z_angle", is_belt && gscz != BeltScaleMode::None); + // Origin snap is superseded by belt_preslice_global toggle_option("belt_origin_offset_x", is_belt && m_config->opt_bool("belt_origin_snap_x") && !belt_global); toggle_option("belt_origin_offset_y", is_belt && m_config->opt_bool("belt_origin_snap_y") && !belt_global); From c79970bedbcc542f448aeb8f29bf78d314f09cf3 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Tue, 19 May 2026 00:56:08 -0500 Subject: [PATCH 027/389] Clean Up Settings Interface, Update Generic Profile (#22) * clean up UI elements * further cleaning * final cleanup for first round of settings UI streamlining * update generic belt printer settings * fix generic again --- resources/profiles/Custom.json | 2 +- .../Custom/machine/fdm_belt_common.json | 10 +- src/libslic3r/PrintConfig.cpp | 126 +++++------ src/slic3r/GUI/Tab.cpp | 198 ++++++++++-------- 4 files changed, 181 insertions(+), 155 deletions(-) diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index 2119514211..fa683db8d6 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,6 +1,6 @@ { "name": "Custom Printer", - "version": "02.03.02.62", + "version": "02.03.02.65", "force_update": "0", "description": "My configurations", "machine_model_list": [ diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index 1ca314da0f..039c4745e0 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -84,15 +84,15 @@ ], "preslice_remap_y": "pos_z", "preslice_remap_z": "pos_y", - "preslice_remap_global": "1", "printer_extruder_id": [ "1" ], - "belt_origin_snap_y": "1", "belt_printer": "1", - "belt_preslice_global": "1", - "belt_shear_z": "pos_cot", - "belt_shear_z_angle": "30", + "belt_shear_z": "pos_tan", + "belt_shear_z_angle": "45", + "belt_scale_y": "inv_cos", + "gcode_shear_z": "pos_tan", + "gcode_scale_y": "inv_cos", "build_plate_tilt_x": "45", "purge_in_prime_tower": "0", "scan_first_layer": "0", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 665b11dcd7..e83edf5a8d 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6305,7 +6305,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = u8"\u00B0"; def->min = -90; def->max = 90; - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(0.)); def = this->add("build_plate_tilt_y", coFloat); @@ -6317,11 +6317,11 @@ void PrintConfigDef::init_fff_params() def->sidetext = u8"\u00B0"; def->min = -90; def->max = 90; - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(0.)); def = this->add("belt_printer", coBool); - def->label = L("Belt printer"); + def->label = L("Enable belt printing"); def->category = L("Printable space"); def->tooltip = L("Enable belt printer mode. Belt printers use a conveyor belt as the build surface, " "tilted at an angle (typically 45 degrees). The slicer will rotate the slicing plane " @@ -6351,7 +6351,8 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionBool(true)); // Per-axis shear controls for belt printer - auto add_belt_shear_mode = [this](const char *key, const char *label, BeltShearMode default_mode) { + auto add_belt_shear_mode = [this](const char *key, const char *label, BeltShearMode default_mode, + ConfigOptionMode mode = comAdvanced) { auto def = this->add(key, coEnum); def->label = L(label); def->category = L("Printable space"); @@ -6359,10 +6360,11 @@ void PrintConfigDef::init_fff_params() def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"none", "pos_cot", "neg_cot", "pos_tan", "neg_tan"}; def->enum_labels = {L("None"), L("+cot(α)"), L("-cot(α)"), L("+tan(α)"), L("-tan(α)")}; - def->mode = comAdvanced; + def->mode = mode; def->set_default_value(new ConfigOptionEnum(default_mode)); }; - auto add_belt_shear_angle = [this](const char *key, const char *label) { + auto add_belt_shear_angle = [this](const char *key, const char *label, + ConfigOptionMode mode = comAdvanced) { auto def = this->add(key, coFloat); def->label = L(label); def->category = L("Printable space"); @@ -6370,10 +6372,11 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("°"); def->min = 0.1; def->max = 89.9; - def->mode = comAdvanced; + def->mode = mode; def->set_default_value(new ConfigOptionFloat(45)); }; - auto add_belt_axis_enum = [this](const char *key, const char *label, const char *tooltip, BeltAxis default_axis) { + auto add_belt_axis_enum = [this](const char *key, const char *label, const char *tooltip, + BeltAxis default_axis, ConfigOptionMode mode = comAdvanced) { auto def = this->add(key, coEnum); def->label = L(label); def->category = L("Printable space"); @@ -6381,7 +6384,7 @@ void PrintConfigDef::init_fff_params() def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"x", "y", "z"}; def->enum_labels = {L("X"), L("Y"), L("Z")}; - def->mode = comAdvanced; + def->mode = mode; def->set_default_value(new ConfigOptionEnum(default_axis)); }; @@ -6390,27 +6393,28 @@ void PrintConfigDef::init_fff_params() def->label = L(label); def->category = L("Printable space"); def->tooltip = L("Apply shear in global coordinates (position-aware) rather than object-local coordinates."); - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionBool(default_val)); }; - add_belt_shear_mode("belt_shear_x", "Function", BeltShearMode::None); - add_belt_shear_angle("belt_shear_x_angle", "Angle"); - add_belt_axis_enum("belt_shear_x_from", "From", "Source axis for X shear.", BeltAxis::Z); + add_belt_shear_mode ("belt_shear_x", "Function", BeltShearMode::None, comExpert); + add_belt_shear_angle("belt_shear_x_angle", "Angle", comExpert); + add_belt_axis_enum ("belt_shear_x_from", "From", "Source axis for X shear.", BeltAxis::Z, comExpert); add_belt_shear_global("belt_shear_x_global", "Global"); - add_belt_shear_mode("belt_shear_y", "Function", BeltShearMode::None); - add_belt_shear_angle("belt_shear_y_angle", "Angle"); - add_belt_axis_enum("belt_shear_y_from", "From", "Source axis for Y shear.", BeltAxis::Z); + add_belt_shear_mode ("belt_shear_y", "Function", BeltShearMode::None, comExpert); + add_belt_shear_angle("belt_shear_y_angle", "Angle", comExpert); + add_belt_axis_enum ("belt_shear_y_from", "From", "Source axis for Y shear.", BeltAxis::Z, comExpert); add_belt_shear_global("belt_shear_y_global", "Global"); - add_belt_shear_mode("belt_shear_z", "Function", BeltShearMode::PosTan); + add_belt_shear_mode ("belt_shear_z", "Function", BeltShearMode::PosTan); add_belt_shear_angle("belt_shear_z_angle", "Angle"); - add_belt_axis_enum("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y); + add_belt_axis_enum ("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y); add_belt_shear_global("belt_shear_z_global", "Global", true); // Per-axis scale controls for belt printer - auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode) { + auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode, + ConfigOptionMode mode = comAdvanced) { auto def = this->add(key, coEnum); def->label = L(label); def->category = L("Printable space"); @@ -6418,10 +6422,11 @@ void PrintConfigDef::init_fff_params() def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"none", "inv_sin", "inv_cos", "sin", "cos"}; def->enum_labels = {L("None"), L("1/sin(α)"), L("1/cos(α)"), L("sin(α)"), L("cos(α)")}; - def->mode = comAdvanced; + def->mode = mode; def->set_default_value(new ConfigOptionEnum(default_mode)); }; - auto add_belt_scale_angle = [this](const char *key, const char *label) { + auto add_belt_scale_angle = [this](const char *key, const char *label, + ConfigOptionMode mode = comAdvanced) { auto def = this->add(key, coFloat); def->label = L(label); def->category = L("Printable space"); @@ -6429,18 +6434,18 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("°"); def->min = 0.1; def->max = 89.9; - def->mode = comAdvanced; + def->mode = mode; def->set_default_value(new ConfigOptionFloat(45)); }; - add_belt_scale_mode("belt_scale_x", "Function", BeltScaleMode::None); - add_belt_scale_angle("belt_scale_x_angle", "Angle"); + add_belt_scale_mode ("belt_scale_x", "Function", BeltScaleMode::None, comExpert); + add_belt_scale_angle("belt_scale_x_angle", "Angle", comExpert); - add_belt_scale_mode("belt_scale_y", "Function", BeltScaleMode::None); + add_belt_scale_mode ("belt_scale_y", "Function", BeltScaleMode::None); add_belt_scale_angle("belt_scale_y_angle", "Angle"); - add_belt_scale_mode("belt_scale_z", "Function", BeltScaleMode::None); - add_belt_scale_angle("belt_scale_z_angle", "Angle"); + add_belt_scale_mode ("belt_scale_z", "Function", BeltScaleMode::None, comExpert); + add_belt_scale_angle("belt_scale_z_angle", "Angle", comExpert); auto add_belt_transform_order = [this](const char *key, const char *label, const char *tooltip) { auto def = this->add(key, coEnum); @@ -6450,8 +6455,8 @@ void PrintConfigDef::init_fff_params() def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"scale_then_shear", "shear_then_scale"}; def->enum_labels = {L("Scale, then shear"), L("Shear, then scale")}; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionEnum(BeltTransformOrder::ScaleThenShear)); + def->mode = comExpert; + def->set_default_value(new ConfigOptionEnum(BeltTransformOrder::ShearThenScale)); }; add_belt_transform_order("belt_mesh_transform_order", "Mesh transform order", @@ -6461,7 +6466,8 @@ void PrintConfigDef::init_fff_params() "follows the same order so that it correctly inverts the mesh transform."); // G-code axis remap with sign - auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, RemapAxis default_axis) { + auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, + RemapAxis default_axis, ConfigOptionMode mode = comSimple) { auto def = this->add(key, coEnum); def->label = L(label); def->category = L("Printable space"); @@ -6469,7 +6475,7 @@ void PrintConfigDef::init_fff_params() def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"pos_x", "pos_y", "pos_z", "neg_x", "neg_y", "neg_z", "rev_x", "rev_y", "rev_z"}; def->enum_labels = {L("+X"), L("+Y"), L("+Z"), L("-X"), L("-Y"), L("-Z"), L("Rev X"), L("Rev Y"), L("Rev Z")}; - def->mode = comSimple; // Visibility controlled by toggle_line in Tab.cpp + def->mode = mode; // Visibility may also be gated by toggle_line in Tab.cpp def->set_default_value(new ConfigOptionEnum(default_axis)); }; @@ -6479,19 +6485,19 @@ void PrintConfigDef::init_fff_params() "your belt printer's physical bed plane. For a printer whose bed is in the XZ plane, " "set Y to +Z and Z to +Y (or -Y) to swap the vertical and belt-travel axes. " "Default +X: no change.", - RemapAxis::PosX); + RemapAxis::PosX, comExpert); add_belt_remap("preslice_remap_y", "Y", "Before slicing, which model-space axis becomes the slicer's Y axis. " "The slicer treats Y as one of the two horizontal bed axes. If your physical " "belt surface runs along the Z axis, map Y to +Z here so the slicer slices " "along the correct plane. Default +Y: no change.", - RemapAxis::PosY); + RemapAxis::PosY, comExpert); add_belt_remap("preslice_remap_z", "Z", "Before slicing, which model-space axis becomes the slicer's Z axis (layer stacking direction). " "The slicer builds layers upward along this axis. If your printer's layer-stacking " "direction is the physical Y axis, map Z to +Y (or -Y for inverted direction). " "Rev mode mirrors relative to the build volume maximum. Default +Z: no change.", - RemapAxis::PosZ); + RemapAxis::PosZ, comExpert); def = this->add("preslice_remap_global", coBool); def->label = L("Global"); @@ -6500,35 +6506,35 @@ void PrintConfigDef::init_fff_params() "Without this, the remap is applied locally around each object's center, so " "objects at different positions don't get a position-dependent contribution. " "Mirrors the per-axis 'Global' option on belt mesh shears, but for the remap."); - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionBool(false)); - add_belt_remap("gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosX); - add_belt_remap("gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosY); - add_belt_remap("gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosZ); + add_belt_remap("gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosX, comExpert); + add_belt_remap("gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosY, comExpert); + add_belt_remap("gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosZ, comExpert); // Machine-frame G-code transforms: applied AFTER back-transform and gcode_remap, // before per-axis origin snap. Maps Cartesian G-code to the printer's physical machine frame. - add_belt_shear_mode ("gcode_shear_x", "Function", BeltShearMode::None); - add_belt_shear_angle("gcode_shear_x_angle", "Angle"); - add_belt_axis_enum ("gcode_shear_x_from", "From", "Source axis for X shear in the machine-frame stage.", BeltAxis::Z); + add_belt_shear_mode ("gcode_shear_x", "Function", BeltShearMode::None, comExpert); + add_belt_shear_angle("gcode_shear_x_angle", "Angle", comExpert); + add_belt_axis_enum ("gcode_shear_x_from", "From", "Source axis for X shear in the machine-frame stage.", BeltAxis::Z, comExpert); - add_belt_shear_mode ("gcode_shear_y", "Function", BeltShearMode::None); - add_belt_shear_angle("gcode_shear_y_angle", "Angle"); - add_belt_axis_enum ("gcode_shear_y_from", "From", "Source axis for Y shear in the machine-frame stage.", BeltAxis::Z); + add_belt_shear_mode ("gcode_shear_y", "Function", BeltShearMode::None, comExpert); + add_belt_shear_angle("gcode_shear_y_angle", "Angle", comExpert); + add_belt_axis_enum ("gcode_shear_y_from", "From", "Source axis for Y shear in the machine-frame stage.", BeltAxis::Z, comExpert); add_belt_shear_mode ("gcode_shear_z", "Function", BeltShearMode::None); add_belt_shear_angle("gcode_shear_z_angle", "Angle"); add_belt_axis_enum ("gcode_shear_z_from", "From", "Source axis for Z shear in the machine-frame stage.", BeltAxis::Y); - add_belt_scale_mode ("gcode_scale_x", "Function", BeltScaleMode::None); - add_belt_scale_angle("gcode_scale_x_angle", "Angle"); + add_belt_scale_mode ("gcode_scale_x", "Function", BeltScaleMode::None, comExpert); + add_belt_scale_angle("gcode_scale_x_angle", "Angle", comExpert); add_belt_scale_mode ("gcode_scale_y", "Function", BeltScaleMode::None); add_belt_scale_angle("gcode_scale_y_angle", "Angle"); - add_belt_scale_mode ("gcode_scale_z", "Function", BeltScaleMode::None); - add_belt_scale_angle("gcode_scale_z_angle", "Angle"); + add_belt_scale_mode ("gcode_scale_z", "Function", BeltScaleMode::None, comExpert); + add_belt_scale_angle("gcode_scale_z_angle", "Angle", comExpert); add_belt_transform_order("belt_gcode_transform_order", "G-code transform order", "Order in which the machine-frame shear and scale matrices are composed when " @@ -6554,8 +6560,8 @@ void PrintConfigDef::init_fff_params() def->tooltip = L("Reverse the shear/scale transform applied during slicing so G-code " "coordinates are in the machine's physical coordinate space. " "Requires at least one shear axis with global mode enabled."); - def->mode = comSimple; // Visibility controlled by toggle_line in Tab.cpp - def->set_default_value(new ConfigOptionBool(false)); + def->mode = comExpert; + def->set_default_value(new ConfigOptionBool(true)); def = this->add("belt_preslice_global", coBool); def->label = L("Global mesh transforms"); @@ -6563,8 +6569,8 @@ void PrintConfigDef::init_fff_params() def->tooltip = L("When enabled, pre-slice belt transforms (remap, shear, scale) account for " "each object's bed position, producing correct machine coordinates without " "relying on origin snap. Each instance gets its own PrintObject."); - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionBool(false)); + def->mode = comExpert; + def->set_default_value(new ConfigOptionBool(true)); // First-layer plane: which surface defines "first layer" for fan / speed / // accel decisions. On belt printers the slicing-frame layer 0 is a tilted @@ -6583,11 +6589,11 @@ void PrintConfigDef::init_fff_params() def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"auto", "xy", "yz", "xz", "belt_shear"}; def->enum_labels = {L("Auto"), L("XY (machine bed)"), L("YZ"), L("XZ"), L("Belt shear plane")}; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionEnum(FirstLayerPlaneMode::Auto)); + def->mode = comExpert; + def->set_default_value(new ConfigOptionEnum(FirstLayerPlaneMode::BeltShear)); def = this->add("first_layer_plane_offset", coFloat); - def->label = L("Plane offset"); + def->label = L("Belt plane offset"); def->category = L("Printable space"); def->tooltip = L("Shifts the first-layer plane along its normal (mm). For axis-aligned " "planes this is just a coordinate shift. Positive values move the plane " @@ -6619,7 +6625,7 @@ void PrintConfigDef::init_fff_params() std::string tip = std::string("Shift G-code output so the object's bounding box minimum on machine ") + axis_label + " equals the offset value."; def->tooltip = L(tip); - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionBool(false)); def = this->add(key_offset, coFloat); @@ -6629,7 +6635,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm"); def->min = -10000; def->max = 10000; - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(0)); }; add_belt_origin_snap("belt_origin_snap_x", "belt_origin_offset_x", "X"); @@ -6638,7 +6644,7 @@ void PrintConfigDef::init_fff_params() // Belt support floor debug controls def = this->add("belt_support_floor_offset", coFloat); - def->label = L("Floor Z offset"); + def->label = L("Support Floor Z offset"); def->category = L("Printable space"); def->tooltip = L("Shifts the computed belt floor up or down (mm). Negative values lower the floor, allowing more supports to survive. Use this to diagnose belt floor formula issues."); def->sidetext = L("mm"); @@ -6656,7 +6662,7 @@ void PrintConfigDef::init_fff_params() def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"none", "generator_only"}; def->enum_labels = {L("None"), L("Generator only")}; - def->mode = comAdvanced; + def->mode = comDevelop; def->set_default_value(new ConfigOptionEnum(BeltSupportFloorMode::GeneratorOnly)); } @@ -6669,7 +6675,7 @@ void PrintConfigDef::init_fff_params() def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"none", "unconditional", "raft_only"}; def->enum_labels = {L("None"), L("Unconditional"), L("Raft only")}; - def->mode = comAdvanced; + def->mode = comExpert; def->set_default_value(new ConfigOptionEnum(BeltSupportZOffsetMode::Unconditional)); } diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index e9356144ad..b0ee2c9435 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1268,6 +1268,13 @@ void Tab::update_mode() { m_mode = wxGetApp().get_mode(); + // toggle_options reads m_mode to gate Lines whose contents are mode-mixed + // (e.g., a multi-option row where some options are Advanced and some Expert): + // when all of a Line's options would be hidden, we hide the Line itself. + // Without refreshing here, the toggle_visible state stays stale across mode + // switches and Lines stay hidden. + toggle_options(); + update_visibility(); update_changed_tree_ui(); @@ -4448,75 +4455,77 @@ void TabPrinter::build_fff() //option.opt.full_width = true; //optgroup->append_single_option_line(option); optgroup->append_single_option_line("disable_m73", "printer_basic_information_advanced#disable-set-remaining-print-time"); - optgroup->append_single_option_line("build_plate_tilt_x"); - optgroup->append_single_option_line("build_plate_tilt_y"); - optgroup->append_single_option_line("belt_printer"); - optgroup->append_single_option_line("belt_printer_angle"); - optgroup->append_single_option_line("belt_printer_infinite_y"); + + // Belt printer: dedicated section. Everything except the "Enable belt printing" + // checkbox is hidden when belt_printer is off (see TabPrinter::toggle_options). + auto belt_og = page->new_optgroup(L("Belt printer"), L"param_advanced"); + belt_og->append_single_option_line("belt_printer"); + belt_og->append_single_option_line("belt_printer_angle"); + belt_og->append_single_option_line("belt_printer_infinite_y"); // Per-axis shear: group mode + angle + source on one row per axis { Line line = { L("Mesh shear X"), L("Shear applied to the X axis before slicing") }; - line.append_option(optgroup->get_option("belt_shear_x")); - line.append_option(optgroup->get_option("belt_shear_x_angle")); - line.append_option(optgroup->get_option("belt_shear_x_from")); - line.append_option(optgroup->get_option("belt_shear_x_global")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("belt_shear_x")); + line.append_option(belt_og->get_option("belt_shear_x_angle")); + line.append_option(belt_og->get_option("belt_shear_x_from")); + line.append_option(belt_og->get_option("belt_shear_x_global")); + belt_og->append_line(line); } { Line line = { L("Mesh shear Y"), L("Shear applied to the Y axis before slicing") }; - line.append_option(optgroup->get_option("belt_shear_y")); - line.append_option(optgroup->get_option("belt_shear_y_angle")); - line.append_option(optgroup->get_option("belt_shear_y_from")); - line.append_option(optgroup->get_option("belt_shear_y_global")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("belt_shear_y")); + line.append_option(belt_og->get_option("belt_shear_y_angle")); + line.append_option(belt_og->get_option("belt_shear_y_from")); + line.append_option(belt_og->get_option("belt_shear_y_global")); + belt_og->append_line(line); } { Line line = { L("Mesh shear Z"), L("Shear applied to the Z axis before slicing") }; - line.append_option(optgroup->get_option("belt_shear_z")); - line.append_option(optgroup->get_option("belt_shear_z_angle")); - line.append_option(optgroup->get_option("belt_shear_z_from")); - line.append_option(optgroup->get_option("belt_shear_z_global")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("belt_shear_z")); + line.append_option(belt_og->get_option("belt_shear_z_angle")); + line.append_option(belt_og->get_option("belt_shear_z_from")); + line.append_option(belt_og->get_option("belt_shear_z_global")); + belt_og->append_line(line); } { Line line = { L("Mesh scale X"), L("Scale applied to the X axis before slicing") }; - line.append_option(optgroup->get_option("belt_scale_x")); - line.append_option(optgroup->get_option("belt_scale_x_angle")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("belt_scale_x")); + line.append_option(belt_og->get_option("belt_scale_x_angle")); + belt_og->append_line(line); } { Line line = { L("Mesh scale Y"), L("Scale applied to the Y axis before slicing") }; - line.append_option(optgroup->get_option("belt_scale_y")); - line.append_option(optgroup->get_option("belt_scale_y_angle")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("belt_scale_y")); + line.append_option(belt_og->get_option("belt_scale_y_angle")); + belt_og->append_line(line); } { Line line = { L("Mesh scale Z"), L("Scale applied to the Z axis before slicing") }; - line.append_option(optgroup->get_option("belt_scale_z")); - line.append_option(optgroup->get_option("belt_scale_z_angle")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("belt_scale_z")); + line.append_option(belt_og->get_option("belt_scale_z_angle")); + belt_og->append_line(line); } - optgroup->append_single_option_line("belt_mesh_transform_order"); + belt_og->append_single_option_line("belt_mesh_transform_order"); { Line line = { L("Pre-slice axis remap"), L("Remap model axes before slicing so the slicer's coordinate system matches " "the physical bed orientation. For belt printers whose bed is NOT in the XY plane, " "use this to swap axes so layers are stacked in the correct physical direction.") }; - line.append_option(optgroup->get_option("preslice_remap_x")); - line.append_option(optgroup->get_option("preslice_remap_y")); - line.append_option(optgroup->get_option("preslice_remap_z")); - line.append_option(optgroup->get_option("preslice_remap_global")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("preslice_remap_x")); + line.append_option(belt_og->get_option("preslice_remap_y")); + line.append_option(belt_og->get_option("preslice_remap_z")); + line.append_option(belt_og->get_option("preslice_remap_global")); + belt_og->append_line(line); } { Line line = { L("G-code axis remap (post-slice)"), L("Remap slicing-frame axes to machine axes in G-code output. Applied AFTER slicing, during G-code generation.") }; - line.append_option(optgroup->get_option("gcode_remap_x")); - line.append_option(optgroup->get_option("gcode_remap_y")); - line.append_option(optgroup->get_option("gcode_remap_z")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("gcode_remap_x")); + line.append_option(belt_og->get_option("gcode_remap_y")); + line.append_option(belt_og->get_option("gcode_remap_z")); + belt_og->append_line(line); } - optgroup->append_single_option_line("belt_preslice_global"); - optgroup->append_single_option_line("gcode_back_transform"); + belt_og->append_single_option_line("belt_preslice_global"); + belt_og->append_single_option_line("gcode_back_transform"); { Line line = { L("First layer plane"), L("Reference plane used to decide which extrusions get first-layer " @@ -4524,42 +4533,49 @@ void TabPrinter::build_fff() "printers, Auto resolves to the tilted belt-shear plane so that " "first-layer treatment follows perpendicular distance from the belt " "surface, not slicing layer index.") }; - line.append_option(optgroup->get_option("first_layer_plane")); - line.append_option(optgroup->get_option("first_layer_plane_offset")); - line.append_option(optgroup->get_option("first_layer_plane_thickness")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("first_layer_plane")); + line.append_option(belt_og->get_option("first_layer_plane_offset")); + line.append_option(belt_og->get_option("first_layer_plane_thickness")); + belt_og->append_line(line); } { Line line = { L("Origin snap X"), L("Snap object bbox min X to offset in G-code output") }; - line.append_option(optgroup->get_option("belt_origin_snap_x")); - line.append_option(optgroup->get_option("belt_origin_offset_x")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("belt_origin_snap_x")); + line.append_option(belt_og->get_option("belt_origin_offset_x")); + belt_og->append_line(line); } { Line line = { L("Origin snap Y"), L("Snap object bbox min Y to offset in G-code output") }; - line.append_option(optgroup->get_option("belt_origin_snap_y")); - line.append_option(optgroup->get_option("belt_origin_offset_y")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("belt_origin_snap_y")); + line.append_option(belt_og->get_option("belt_origin_offset_y")); + belt_og->append_line(line); } { Line line = { L("Origin snap Z"), L("Snap object bbox min Z to offset in G-code output") }; - line.append_option(optgroup->get_option("belt_origin_snap_z")); - line.append_option(optgroup->get_option("belt_origin_offset_z")); - optgroup->append_line(line); - } - { - Line line = { L("Support floor"), L("Belt floor awareness for support generation and clipping") }; - line.append_option(optgroup->get_option("belt_support_floor_mode")); - line.append_option(optgroup->get_option("belt_support_floor_offset")); - line.append_option(optgroup->get_option("belt_support_z_offset_mode")); - optgroup->append_line(line); + line.append_option(belt_og->get_option("belt_origin_snap_z")); + line.append_option(belt_og->get_option("belt_origin_offset_z")); + belt_og->append_line(line); } + // Support floor: split across lines so each setting's own mode controls + // its visibility (floor_mode = Develop, floor_offset = Advanced, z_offset_mode = Expert). + belt_og->append_single_option_line("belt_support_floor_offset"); + belt_og->append_single_option_line("belt_support_z_offset_mode"); + belt_og->append_single_option_line("belt_support_floor_mode"); // Machine-frame transforms: applied to G-code after back-transform and // gcode_remap, before per-axis origin snap. Maps Cartesian G-code into // the printer's physical machine frame. { auto mf = page->new_optgroup(L("Machine frame transforms"), L"param_advanced"); + { + Line line = { L("Post-gcode axis remap"), + L("Axis remap in the machine-frame stage. Applied AFTER gcode_remap, " + "to put coordinates into the printer's physical axis labelling.") }; + line.append_option(mf->get_option("post_gcode_remap_x")); + line.append_option(mf->get_option("post_gcode_remap_y")); + line.append_option(mf->get_option("post_gcode_remap_z")); + mf->append_line(line); + } { Line line = { L("G-code shear X"), L("Shear applied to the X axis in the machine-frame stage (after back-transform and gcode_remap).") }; line.append_option(mf->get_option("gcode_shear_x")); @@ -4600,15 +4616,6 @@ void TabPrinter::build_fff() mf->append_line(line); } mf->append_single_option_line("belt_gcode_transform_order"); - { - Line line = { L("Post-gcode axis remap"), - L("Axis remap in the machine-frame stage. Applied AFTER gcode_remap, " - "to put coordinates into the printer's physical axis labelling.") }; - line.append_option(mf->get_option("post_gcode_remap_x")); - line.append_option(mf->get_option("post_gcode_remap_y")); - line.append_option(mf->get_option("post_gcode_remap_z")); - mf->append_line(line); - } } option = optgroup->get_option("thumbnails"); @@ -4655,6 +4662,8 @@ void TabPrinter::build_fff() optgroup->append_single_option_line("use_firmware_retraction", "printer_basic_information_advanced#use-firmware-retraction"); // optgroup->append_single_option_line("spaghetti_detector"); optgroup->append_single_option_line("time_cost", "printer_basic_information_advanced#time-cost"); + optgroup->append_single_option_line("build_plate_tilt_x"); + optgroup->append_single_option_line("build_plate_tilt_y"); optgroup = page->new_optgroup(L("Cooling Fan"), "param_cooling_fan"); Line line = Line{ L("Fan speed-up time"), optgroup->get_option("fan_speedup_time").opt.tooltip }; @@ -5580,24 +5589,33 @@ void TabPrinter::toggle_options() // Belt printer: show belt-specific settings only when belt_printer is enabled. bool is_belt = m_config->opt_bool("belt_printer"); + bool expert_or_above = (m_mode >= comExpert); toggle_line("belt_printer_angle", is_belt); toggle_line("belt_printer_infinite_y", is_belt); - for (auto el : {"belt_shear_x", "belt_shear_y", "belt_shear_z", - "belt_scale_x", "belt_scale_y", "belt_scale_z", - "belt_mesh_transform_order", + // Mesh shear/scale: only shear Z and scale Y are shown in Advanced; the others + // are Expert-only. Each Line packs all its options on one row, so toggle the + // Line here in addition to the per-option mode gating. + toggle_line("belt_shear_x", is_belt && expert_or_above); + toggle_line("belt_shear_y", is_belt && expert_or_above); + toggle_line("belt_shear_z", is_belt); + toggle_line("belt_scale_x", is_belt && expert_or_above); + toggle_line("belt_scale_y", is_belt); + toggle_line("belt_scale_z", is_belt && expert_or_above); + for (auto el : {"belt_mesh_transform_order", "belt_origin_snap_x", "belt_origin_snap_y", "belt_origin_snap_z"}) toggle_line(el, is_belt); - // Remap options: visible when belt mode is on OR when UI is in developer mode. - bool show_remap = is_belt || (m_mode >= comDevelop); + // Remap, back-transform, and global mesh-transforms toggles are gated by belt + // mode here; finer mode-based visibility (Advanced vs Expert) is handled by + // each option's ConfigOptionMode in PrintConfig.cpp. for (auto el : {"preslice_remap_x", "gcode_remap_x", "gcode_back_transform"}) - toggle_line(el, show_remap); - toggle_line("belt_preslice_global", show_remap); + toggle_line(el, is_belt); + toggle_line("belt_preslice_global", is_belt); bool belt_global = is_belt && m_config->opt_bool("belt_preslice_global"); // preslice_remap_global: superseded by belt_preslice_global - toggle_option("preslice_remap_global", show_remap && !belt_global); + toggle_option("preslice_remap_global", is_belt && !belt_global); // Gray out angle/from sub-options when their parent shear/scale mode is None. // Per-axis globals are superseded when belt_preslice_global is on. @@ -5626,10 +5644,14 @@ void TabPrinter::toggle_options() toggle_option("belt_scale_z_angle", is_belt && scz != BeltScaleMode::None); // Machine-frame transforms: shown only in belt mode. - for (auto el : {"gcode_shear_x", "gcode_shear_y", "gcode_shear_z", - "gcode_scale_x", "gcode_scale_y", "gcode_scale_z", - "belt_gcode_transform_order", - "post_gcode_remap_x"}) + // Mirror the Advanced/Expert split used for mesh shear/scale. + toggle_line("gcode_shear_x", is_belt && expert_or_above); + toggle_line("gcode_shear_y", is_belt && expert_or_above); + toggle_line("gcode_shear_z", is_belt); + toggle_line("gcode_scale_x", is_belt && expert_or_above); + toggle_line("gcode_scale_y", is_belt); + toggle_line("gcode_scale_z", is_belt && expert_or_above); + for (auto el : {"belt_gcode_transform_order", "post_gcode_remap_x"}) toggle_line(el, is_belt); auto gsx = m_config->option>("gcode_shear_x")->value; @@ -5659,14 +5681,12 @@ void TabPrinter::toggle_options() toggle_option("belt_origin_offset_z", is_belt && m_config->opt_bool("belt_origin_snap_z") && !belt_global); // First-layer plane: visible alongside the rest of belt-printer settings. - // The Auto default keeps legacy XY behavior on non-belt printers, so it's - // safe to also show it in the developer mode for non-belt printers. - bool show_first_layer_plane = is_belt || (m_mode >= comDevelop); - toggle_line("first_layer_plane", show_first_layer_plane); - toggle_option("first_layer_plane_offset", show_first_layer_plane); - toggle_option("first_layer_plane_thickness", show_first_layer_plane); + toggle_line("first_layer_plane", is_belt); + toggle_option("first_layer_plane_offset", is_belt); + toggle_option("first_layer_plane_thickness", is_belt); - toggle_line("belt_support_floor_mode", is_belt); + for (auto el : {"belt_support_floor_mode", "belt_support_floor_offset", "belt_support_z_offset_mode"}) + toggle_line(el, is_belt); } From da8b11b8ab9351698022e48fbf6a26bcc39b3386 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Tue, 19 May 2026 01:06:39 -0500 Subject: [PATCH 028/389] HOTFIX: update generic belt printer profile (#23) oops --- resources/profiles/Custom.json | 2 +- resources/profiles/Custom/machine/fdm_belt_common.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index fa683db8d6..85e04e525c 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,6 +1,6 @@ { "name": "Custom Printer", - "version": "02.03.02.65", + "version": "02.03.02.66", "force_update": "0", "description": "My configurations", "machine_model_list": [ diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index 039c4745e0..1562507631 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -82,8 +82,8 @@ "z_hop_types": [ "Normal Lift" ], - "preslice_remap_y": "pos_z", - "preslice_remap_z": "pos_y", + "post_gcode_remap_y": "pos_z", + "post_gcode_remap_z": "pos_y", "printer_extruder_id": [ "1" ], From f87a46ec6ec7beb6e9b699fb24a23177c25f7430 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Tue, 19 May 2026 22:54:50 -0500 Subject: [PATCH 029/389] fix X mirroring (#26) Thanks to @hotcubcar for catching this! --- resources/profiles/Custom.json | 2 +- resources/profiles/Custom/machine/fdm_belt_common.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index 85e04e525c..0f54d2f4dd 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,6 +1,6 @@ { "name": "Custom Printer", - "version": "02.03.02.66", + "version": "02.03.02.67", "force_update": "0", "description": "My configurations", "machine_model_list": [ diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index 1562507631..ce39146042 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -82,6 +82,7 @@ "z_hop_types": [ "Normal Lift" ], + "post_gcode_remap_x": "rev_x", "post_gcode_remap_y": "pos_z", "post_gcode_remap_z": "pos_y", "printer_extruder_id": [ From 218881c6f665ce2447aa5c648e2d51d6f32b4250 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Wed, 20 May 2026 02:46:41 -0500 Subject: [PATCH 030/389] fix assembly bounding box truncation problems noticed by hotcubcar (#28) --- src/libslic3r/PrintObjectSlice.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 4454ce87ea..07ba2c63af 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -322,20 +322,31 @@ static std::vector> slices_to_regions( } } else { zs_complex.reserve(zs.size()); + // region.bbox is computed in pre-belt-shear slicer space (see PrintApply.cpp::trafo_for_bbox). + // When belt transforms are active, layer Z values are in post-shear/scale/remap space, + // so the Z components of region.bbox aren't comparable to z. Skipping the Z filter here + // pushes those layers into the parallel_for path below, which handles multi-volume + // clipping per layer without relying on the bbox Z range. + const bool bbox_z_in_layer_frame = !(print_config.belt_printer.value && + (BeltTransformPipeline::has_shear(print_config) + || BeltTransformPipeline::has_scale(print_config) + || BeltTransformPipeline::has_preslice_remap(print_config))); for (; z_idx < zs.size() && zs[z_idx] < layer_range.layer_height_range.second; ++ z_idx) { float z = zs[z_idx]; int idx_first_printable_region = -1; bool complex = false; for (int idx_region = 0; idx_region < int(layer_range.volume_regions.size()); ++ idx_region) { const PrintObjectRegions::VolumeRegion ®ion = layer_range.volume_regions[idx_region]; - if (region.bbox->min().z() <= z && region.bbox->max().z() >= z) { + if (!bbox_z_in_layer_frame || (region.bbox->min().z() <= z && region.bbox->max().z() >= z)) { if (idx_first_printable_region == -1 && region.model_volume->is_model_part()) idx_first_printable_region = idx_region; else if (idx_first_printable_region != -1) { // Test for overlap with some other region. for (int idx_region2 = idx_first_printable_region; idx_region2 < idx_region; ++ idx_region2) { const PrintObjectRegions::VolumeRegion ®ion2 = layer_range.volume_regions[idx_region2]; - if (region2.bbox->min().z() <= z && region2.bbox->max().z() >= z && overlap_in_xy(*region.bbox, *region2.bbox)) { + const bool region2_in_z = !bbox_z_in_layer_frame + || (region2.bbox->min().z() <= z && region2.bbox->max().z() >= z); + if (region2_in_z && overlap_in_xy(*region.bbox, *region2.bbox)) { complex = true; break; } From a9bae54f20aaa669748fb104f6dc70e942fa9e50 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Fri, 22 May 2026 15:21:33 -0500 Subject: [PATCH 031/389] Rotate instead of shear for slicing stage (#30) * initial commit * fix upper bounds for assemblies * significantly less Z shift issues, still not quite tamped down yet though * add instrumentation to logs * finally found the issue * update printer defaults --- resources/profiles/Custom.json | 2 +- .../Custom/machine/fdm_belt_common.json | 6 +- src/libslic3r/BeltGCode.cpp | 9 +- src/libslic3r/BeltGCodeWriter.cpp | 26 ++- src/libslic3r/BeltSliceStrategy.cpp | 89 +++++++++-- src/libslic3r/BeltSliceStrategy.hpp | 12 +- src/libslic3r/BeltTransform.cpp | 94 ++++++++++- src/libslic3r/BeltTransform.hpp | 11 ++ src/libslic3r/FirstLayerPlane.cpp | 14 +- src/libslic3r/GCode/BeltBackTransform.cpp | 5 +- src/libslic3r/Preset.cpp | 1 + src/libslic3r/PrintApply.cpp | 6 + src/libslic3r/PrintConfig.cpp | 74 +++++++-- src/libslic3r/PrintConfig.hpp | 25 ++- src/libslic3r/PrintObjectSlice.cpp | 149 +++++++++++++++--- src/slic3r/GUI/Tab.cpp | 86 +++++++--- 16 files changed, 513 insertions(+), 96 deletions(-) diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index 0f54d2f4dd..0ac3597347 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,6 +1,6 @@ { "name": "Custom Printer", - "version": "02.03.02.67", + "version": "02.03.02.68", "force_update": "0", "description": "My configurations", "machine_model_list": [ diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index ce39146042..0c3a976c0e 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -89,9 +89,9 @@ "1" ], "belt_printer": "1", - "belt_shear_z": "pos_tan", - "belt_shear_z_angle": "45", - "belt_scale_y": "inv_cos", + "belt_slice_rotation": "x", + "belt_slice_rotation_angle": "45", + "belt_slice_rotation_global": "1", "gcode_shear_z": "pos_tan", "gcode_scale_y": "inv_cos", "build_plate_tilt_x": "45", diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index 767d280579..a89b20bcec 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -53,6 +53,10 @@ void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); + // Slicing rotation configs + file.write_format("; belt_slice_rotation = %s\n", full_cfg.opt_serialize("belt_slice_rotation").c_str()); + file.write_format("; belt_slice_rotation_angle = %.1f\n", print.config().belt_slice_rotation_angle.value); + file.write_format("; belt_slice_rotation_global = %d\n", print.config().belt_slice_rotation_global.value ? 1 : 0); file.write_format("; belt_mesh_transform_order = %s\n", full_cfg.opt_serialize("belt_mesh_transform_order").c_str()); // Pre-slice remap configs file.write_format("; preslice_remap_x = %s\n", full_cfg.opt_serialize("preslice_remap_x").c_str()); @@ -104,7 +108,10 @@ void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) || (m_config.preslice_remap_global.value && BeltTransformPipeline::has_preslice_remap(m_config)) || (m_config.belt_shear_z_global.value - && m_config.belt_shear_z.value != BeltShearMode::None); + && m_config.belt_shear_z.value != BeltShearMode::None) + || (m_config.belt_slice_rotation_global.value + && m_config.belt_slice_rotation.value != BeltRotationAxis::None + && std::abs(m_config.belt_slice_rotation_angle.value) > EPSILON); if (use_global && m_config.belt_printer.value) { auto *belt_writer = dynamic_cast(m_writer.get()); if (belt_writer) { diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index 1987d0127a..b2a8f5c470 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -57,17 +57,39 @@ Vec3d BeltGCodeWriter::to_cartesian(const Vec3d &pos) const Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const { // Step 1+2: To Cartesian (back_transform + axis_remap). - Vec3d result = to_cartesian(pos); + Vec3d after_back = m_belt_back_transform.apply(pos); + Vec3d result = apply_axis_remap(after_back); + Vec3d after_remap = result; // Step 3: Per-axis origin snap (computed in the Cartesian frame). for (int i = 0; i < 3; ++i) if (m_origin_snap[i]) result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); + Vec3d after_snap = result; // Step 4: Machine-frame transform (gcode_shear / gcode_scale / post_gcode_remap) // applied LAST so it acts as a global linear transform on the placed coords. // Order matters: putting it before origin_snap would feed sheared bbox corners // into the snap's per-object min calculation, mis-normalizing non-cubic geometries // (the corners of the original bbox aren't extreme points of the sheared shape). - return m_machine_frame_transform.apply(result); + Vec3d final = m_machine_frame_transform.apply(result); + + // [BELT-DEBUG] One-shot log per layer transition (i.e. when the input Z + // crosses an integer mm boundary) to keep the log volume manageable while + // still capturing one sample per ~5 layers. Shows the full pipeline so + // Case A vs Case B can be compared step-by-step. + static thread_local int s_last_logged_z = std::numeric_limits::min(); + int z_bucket = static_cast(std::floor(pos.z() * 5.0)); // every 0.2mm + if (z_bucket != s_last_logged_z) { + s_last_logged_z = z_bucket; + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] to_machine_coords" + << " slicer_in=(" << pos.x() << "," << pos.y() << "," << pos.z() << ")" + << " after_back=(" << after_back.x() << "," << after_back.y() << "," << after_back.z() << ")" + << " after_remap=(" << after_remap.x() << "," << after_remap.y() << "," << after_remap.z() << ")" + << " after_snap=(" << after_snap.x() << "," << after_snap.y() << "," << after_snap.z() << ")" + << " final=(" << final.x() << "," << final.y() << "," << final.z() << ")" + << " mft_active=" << m_machine_frame_transform.is_active() + << " back_active=" << m_belt_back_transform.is_active(); + } + return final; } // ---- Overridden movement methods ------------------------------------------ diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp index 850a4ad221..81c4c06f1e 100644 --- a/src/libslic3r/BeltSliceStrategy.cpp +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -1,6 +1,9 @@ #include "BeltSliceStrategy.hpp" +#include "Model.hpp" #include +#include +#include #include namespace Slic3r { @@ -14,9 +17,10 @@ std::unique_ptr BeltSliceStrategy::create(const PrintConfig & BeltSliceStrategy::BeltSliceStrategy(const PrintConfig &config) { - m_shear = BeltTransformPipeline::build_shear_matrix(config, &m_has_shear); - m_scale = BeltTransformPipeline::build_scale_matrix(config, &m_has_scale); - m_order = config.belt_mesh_transform_order.value; + m_shear = BeltTransformPipeline::build_shear_matrix(config, &m_has_shear); + m_scale = BeltTransformPipeline::build_scale_matrix(config, &m_has_scale); + m_rotation = BeltTransformPipeline::build_rotation_matrix(config, &m_has_rotation); + m_order = config.belt_mesh_transform_order.value; } void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, @@ -26,27 +30,83 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, { // ScaleThenShear: applied to a point, scale runs first then shear (m_shear * m_scale). // ShearThenScale: applied to a point, shear runs first then scale (m_scale * m_shear). - if (m_has_shear || m_has_scale) { - Transform3d belt_xform = Transform3d::Identity(); - belt_xform.linear() = (m_order == BeltTransformOrder::ScaleThenShear) + // Rotation (if active) is applied AFTER shear/scale, matching build_forward_transform. + if (m_has_shear || m_has_scale || m_has_rotation) { + Matrix3d shear_scale = (m_order == BeltTransformOrder::ScaleThenShear) ? Matrix3d(m_shear * m_scale) : Matrix3d(m_scale * m_shear); + Transform3d belt_xform = Transform3d::Identity(); + belt_xform.linear() = Matrix3d(m_rotation * shear_scale); trafo = belt_xform * trafo; } // Z-shift — detect if mesh clips below build plate after transforms. - if (has_remap || m_has_shear || m_has_scale) { + // Each mesh vertex must be brought into object space via mv->get_matrix() + // before applying the full trafo (which is in object space). Missing this + // step on assemblies (where per-volume get_matrix() positions each volume + // within the object) causes min_z to be computed against mesh-local vertex + // coordinates rather than object-space coordinates, so volumes translated + // along the slicer's Z axis are silently excluded from the bound check. + if (has_remap || m_has_shear || m_has_scale || m_has_rotation) { + // [BELT-DEBUG] Capture the incoming trafo for diagnostic logging. + // This is the slicer-frame transform AFTER belt_xform but BEFORE z_shift. + const Transform3d trafo_pre_shift = trafo; + auto log_mat = [](const Matrix3d &m) { + std::ostringstream ss; + ss << std::fixed << std::setprecision(4); + ss << "[[" << m(0,0) << "," << m(0,1) << "," << m(0,2) << "]," + << "[" << m(1,0) << "," << m(1,1) << "," << m(1,2) << "]," + << "[" << m(2,0) << "," << m(2,1) << "," << m(2,2) << "]]"; + return ss.str(); + }; + auto log_vec3 = [](const Vec3d &v) { + std::ostringstream ss; + ss << std::fixed << std::setprecision(4); + ss << "(" << v.x() << "," << v.y() << "," << v.z() << ")"; + return ss.str(); + }; + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] apply_to_trafo enter" + << " has_shear=" << m_has_shear + << " has_scale=" << m_has_scale + << " has_rotation=" << m_has_rotation + << " has_remap=" << has_remap + << " trafo.linear=" << log_mat(trafo_pre_shift.linear()) + << " trafo.translation=" << log_vec3(trafo_pre_shift.translation()) + << " volumes=" << model_volumes.size(); + double min_z = std::numeric_limits::max(); + int vol_idx = 0; for (const ModelVolume *mv : model_volumes) { - if (!mv->is_model_part()) continue; - for (const stl_vertex &v : mv->mesh().its.vertices) { - Vec3d pt = trafo * v.cast(); + if (!mv->is_model_part()) { ++vol_idx; continue; } + Transform3d vol_trafo = trafo * mv->get_matrix(); + // [BELT-DEBUG] Per-volume bbox in mesh-frame and post-trafo slicer-frame. + const auto &its = mv->mesh().its; + Vec3d mesh_min(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); + Vec3d mesh_max(std::numeric_limits::lowest(), std::numeric_limits::lowest(), std::numeric_limits::lowest()); + Vec3d slicer_min(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); + Vec3d slicer_max(std::numeric_limits::lowest(), std::numeric_limits::lowest(), std::numeric_limits::lowest()); + double vol_min_z = std::numeric_limits::max(); + for (const stl_vertex &v : its.vertices) { + Vec3d vm = v.cast(); + mesh_min = mesh_min.cwiseMin(vm); + mesh_max = mesh_max.cwiseMax(vm); + Vec3d pt = vol_trafo * vm; + slicer_min = slicer_min.cwiseMin(pt); + slicer_max = slicer_max.cwiseMax(pt); + vol_min_z = std::min(vol_min_z, pt.z()); min_z = std::min(min_z, pt.z()); } + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] vol[" << vol_idx + << "] id=" << mv->id().id << " name='" << mv->name << "'" + << " mesh_bbox_min=" << log_vec3(mesh_min) << " mesh_bbox_max=" << log_vec3(mesh_max) + << " get_matrix.translation=" << log_vec3(mv->get_matrix().translation()) + << " slicer_bbox_min=" << log_vec3(slicer_min) << " slicer_bbox_max=" << log_vec3(slicer_max) + << " vol_min_z=" << vol_min_z; + ++vol_idx; } double belt_z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; - BOOST_LOG_TRIVIAL(warning) << "Belt Z-shift: min_z=" << min_z - << " z_shift=" << belt_z_shift_val; + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] combined min_z=" << min_z + << " z_shift_val=" << belt_z_shift_val; if (belt_z_shift_val > 0.) { Transform3d z_shift = Transform3d::Identity(); z_shift.matrix()(2, 3) = belt_z_shift_val; @@ -54,10 +114,13 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, } if (out_belt_min_z) { double new_val = (min_z != std::numeric_limits::max()) ? min_z : 0.; - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_min_z tid=" << std::this_thread::get_id() + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] write m_belt_min_z tid=" << std::this_thread::get_id() << " target=" << out_belt_min_z << " old=" << *out_belt_min_z << " new=" << new_val; *out_belt_min_z = new_val; } + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] apply_to_trafo exit" + << " final_trafo.linear=" << log_mat(trafo.linear()) + << " final_trafo.translation=" << log_vec3(trafo.translation()); } } diff --git a/src/libslic3r/BeltSliceStrategy.hpp b/src/libslic3r/BeltSliceStrategy.hpp index c2362e3552..6009155c7b 100644 --- a/src/libslic3r/BeltSliceStrategy.hpp +++ b/src/libslic3r/BeltSliceStrategy.hpp @@ -34,11 +34,13 @@ public: private: explicit BeltSliceStrategy(const PrintConfig &config); - bool m_has_shear = false; - bool m_has_scale = false; - Matrix3d m_shear = Matrix3d::Identity(); - Matrix3d m_scale = Matrix3d::Identity(); - BeltTransformOrder m_order = BeltTransformOrder::ScaleThenShear; + bool m_has_shear = false; + bool m_has_scale = false; + bool m_has_rotation = false; + Matrix3d m_shear = Matrix3d::Identity(); + Matrix3d m_scale = Matrix3d::Identity(); + Matrix3d m_rotation = Matrix3d::Identity(); + BeltTransformOrder m_order = BeltTransformOrder::ScaleThenShear; }; } // namespace Slic3r diff --git a/src/libslic3r/BeltTransform.cpp b/src/libslic3r/BeltTransform.cpp index 6c0838b2eb..0d1ae41295 100644 --- a/src/libslic3r/BeltTransform.cpp +++ b/src/libslic3r/BeltTransform.cpp @@ -95,23 +95,47 @@ Matrix3d BeltTransformPipeline::build_scale_matrix(const PrintConfig &config, bo return scale; } +Matrix3d BeltTransformPipeline::build_rotation_matrix(const PrintConfig &config, bool *has_rot_out) +{ + BeltRotationAxis axis = config.belt_slice_rotation.value; + double angle_deg = config.belt_slice_rotation_angle.value; + bool active = axis != BeltRotationAxis::None && std::abs(angle_deg) > EPSILON; + if (has_rot_out) *has_rot_out = active; + if (!active) + return Matrix3d::Identity(); + double angle_rad = Geometry::deg2rad(angle_deg); + Vec3d unit_axis; + switch (axis) { + case BeltRotationAxis::X: unit_axis = Vec3d::UnitX(); break; + case BeltRotationAxis::Y: unit_axis = Vec3d::UnitY(); break; + case BeltRotationAxis::Z: unit_axis = Vec3d::UnitZ(); break; + default: return Matrix3d::Identity(); + } + return Eigen::AngleAxisd(angle_rad, unit_axis).toRotationMatrix(); +} + Transform3d BeltTransformPipeline::build_forward_transform(const PrintConfig &config) { - Transform3d pre_remap = build_preslice_remap(config); + Transform3d pre_remap = build_preslice_remap(config); bool shear_active = false; Matrix3d shear = build_shear_matrix(config, &shear_active); bool scale_active = false; Matrix3d scale = build_scale_matrix(config, &scale_active); + bool rot_active = false; + Matrix3d rot = build_rotation_matrix(config, &rot_active); // Match the mesh-side ordering selected by belt_mesh_transform_order so // BeltBackTransform inverts the same composition that BeltSliceStrategy // applied to the mesh. // ScaleThenShear: applied to p, scale runs first then shear (shear * scale). // ShearThenScale: applied to p, shear runs first then scale (scale * shear). - Transform3d combined = Transform3d::Identity(); - combined.linear() = (config.belt_mesh_transform_order.value == BeltTransformOrder::ScaleThenShear) + // Rotation is applied AFTER shear/scale: rot * shear_scale * pre_remap. + Matrix3d shear_scale = (config.belt_mesh_transform_order.value == BeltTransformOrder::ScaleThenShear) ? Matrix3d(shear * scale) : Matrix3d(scale * shear); + + Transform3d combined = Transform3d::Identity(); + combined.linear() = Matrix3d(rot * shear_scale); combined = combined * pre_remap; return combined; } @@ -166,7 +190,7 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( BeltTransformPipeline::BeltHeightResult result; result.object_height = original_height; - // Extract Z-axis shear/scale + per-axis scale + transform order from config. + // Extract Z-axis shear/scale + per-axis scale + transform order + rotation from config. BeltShearMode z_shear_mode; double z_shear_angle; BeltScaleMode z_scale_mode; @@ -175,6 +199,8 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( BeltScaleMode from_scale_mode; // scale on the shear's source axis double from_scale_angle; BeltTransformOrder order; + BeltRotationAxis rot_axis; + double rot_angle; if constexpr (std::is_same_v) { z_shear_mode = config.belt_shear_z.value; @@ -183,6 +209,8 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( z_scale_angle = config.belt_scale_z_angle.value; z_shear_from = int(config.belt_shear_z_from.value); order = config.belt_mesh_transform_order.value; + rot_axis = config.belt_slice_rotation.value; + rot_angle = config.belt_slice_rotation_angle.value; if (z_shear_from == 0) { from_scale_mode = config.belt_scale_x.value; from_scale_angle = config.belt_scale_x_angle.value; @@ -212,12 +240,18 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( auto *opt = config.template option>(key); return opt ? opt->value : BeltTransformOrder::ScaleThenShear; }; + auto get_rot_axis = [&](const char *key) { + auto *opt = config.template option>(key); + return opt ? opt->value : BeltRotationAxis::None; + }; z_shear_mode = get_shear("belt_shear_z"); z_shear_angle = get_float("belt_shear_z_angle"); z_scale_mode = get_scale("belt_scale_z"); z_scale_angle = get_float("belt_scale_z_angle"); z_shear_from = get_axis("belt_shear_z_from"); order = get_order("belt_mesh_transform_order"); + rot_axis = get_rot_axis("belt_slice_rotation"); + rot_angle = get_float("belt_slice_rotation_angle"); if (z_shear_from == 0) { from_scale_mode = get_scale("belt_scale_x"); from_scale_angle = get_float("belt_scale_x_angle"); @@ -227,10 +261,11 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( } } - bool has_z_shear = z_shear_mode != BeltShearMode::None; - bool has_z_scale = z_scale_mode != BeltScaleMode::None; + bool has_z_shear = z_shear_mode != BeltShearMode::None; + bool has_z_scale = z_scale_mode != BeltScaleMode::None; + bool has_rotation = rot_axis != BeltRotationAxis::None && std::abs(rot_angle) > EPSILON; - if (!has_z_shear && !has_z_scale) + if (!has_z_shear && !has_z_scale && !has_rotation) return result; double shear_factor = has_z_shear @@ -267,6 +302,51 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( result.floor_params.shear_factor = effective_shear; result.floor_params.from_axis = from; result.floor_params.z_shift = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); + } else if (has_rotation) { + // Rotation-only path (no Z-shear): sweep 8 bbox corners through R. + double angle_rad = Geometry::deg2rad(rot_angle); + Vec3d unit_axis; + switch (rot_axis) { + case BeltRotationAxis::X: unit_axis = Vec3d::UnitX(); break; + case BeltRotationAxis::Y: unit_axis = Vec3d::UnitY(); break; + case BeltRotationAxis::Z: unit_axis = Vec3d::UnitZ(); break; + default: unit_axis = Vec3d::UnitX(); break; + } + Matrix3d R = Eigen::AngleAxisd(angle_rad, unit_axis).toRotationMatrix(); + double min_rz = std::numeric_limits::max(); + double max_rz = std::numeric_limits::lowest(); + for (int i = 0; i < 8; ++i) { + Vec3d c((i & 1) ? bb.max.x() : bb.min.x(), + (i & 2) ? bb.max.y() : bb.min.y(), + (i & 4) ? bb.max.z() : bb.min.z()); + double z = (R * c).z(); + min_rz = std::min(min_rz, z); + max_rz = std::max(max_rz, z); + } + // Optional Z-scale still applies multiplicatively if both are set. + result.object_height = (max_rz - min_rz) * (has_z_scale ? scale_z : 1.0); + + // Belt floor in slicer-frame is the image of z_machine = 0 under R. + // R(+α, X): point (·, y, 0) → (·, cos α · y, sin α · y) ⇒ z = tan(α) · y_s + // R(+α, Y): point (x, ·, 0) → (cos α · x, ·, -sin α · x) ⇒ z = -tan(α) · x_s + // R(+α, Z): point (·, ·, 0) → (·, ·, 0); no tilt → no floor + double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); + switch (rot_axis) { + case BeltRotationAxis::X: + result.floor_params.shear_factor = (std::abs(cos_a) > EPSILON) ? sin_a / cos_a : 0.; + result.floor_params.from_axis = 1; // Y + break; + case BeltRotationAxis::Y: + result.floor_params.shear_factor = (std::abs(cos_a) > EPSILON) ? -sin_a / cos_a : 0.; + result.floor_params.from_axis = 0; // X + break; + case BeltRotationAxis::Z: + default: + result.floor_params.shear_factor = 0.0; + result.floor_params.from_axis = 1; + break; + } + result.floor_params.z_shift = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); } else { result.object_height = original_height * scale_z; } diff --git a/src/libslic3r/BeltTransform.hpp b/src/libslic3r/BeltTransform.hpp index f15a9995c3..1ce47a2e31 100644 --- a/src/libslic3r/BeltTransform.hpp +++ b/src/libslic3r/BeltTransform.hpp @@ -92,6 +92,12 @@ public: std::abs(sz - 1.) > EPSILON; } + static bool has_rotation(const PrintConfig &config) + { + return config.belt_slice_rotation.value != BeltRotationAxis::None && + std::abs(config.belt_slice_rotation_angle.value) > EPSILON; + } + // ---- Matrix builders -------------------------------------------------- // Build the pre-slice axis remap transform (includes Rev-mode translation). @@ -105,6 +111,11 @@ public: // Also sets has_scale_out if non-null. static Matrix3d build_scale_matrix(const PrintConfig &config, bool *has_scale_out = nullptr); + // Build the 3x3 rotation matrix from belt_slice_rotation* config. + // Returns Identity if rotation axis is None or angle is ~0. + // Also sets has_rot_out if non-null. + static Matrix3d build_rotation_matrix(const PrintConfig &config, bool *has_rot_out = nullptr); + // Combined forward transform. Shear/scale order is selected by // belt_mesh_transform_order so the result matches what BeltSliceStrategy // applied to the mesh (BeltBackTransform inverts this). diff --git a/src/libslic3r/FirstLayerPlane.cpp b/src/libslic3r/FirstLayerPlane.cpp index 23327aea7a..10866c57f5 100644 --- a/src/libslic3r/FirstLayerPlane.cpp +++ b/src/libslic3r/FirstLayerPlane.cpp @@ -84,12 +84,12 @@ FirstLayerPlane::FirstLayerPlane(const PrintConfig &config) // -------- Resolve Auto ------------------------------------------------- FirstLayerPlaneMode mode = config.first_layer_plane.value; if (mode == FirstLayerPlaneMode::Auto) { - if (config.belt_printer.value && - config.belt_shear_z.value != BeltShearMode::None) { - mode = FirstLayerPlaneMode::BeltShear; - } else { - mode = FirstLayerPlaneMode::XY; - } + bool belt_affine_active = config.belt_printer.value && + (config.belt_shear_z.value != BeltShearMode::None || + (config.belt_slice_rotation.value != BeltRotationAxis::None && + std::abs(config.belt_slice_rotation_angle.value) > EPSILON)); + mode = belt_affine_active ? FirstLayerPlaneMode::BeltAffine + : FirstLayerPlaneMode::XY; } m_mode = mode; @@ -130,7 +130,7 @@ FirstLayerPlane::FirstLayerPlane(const PrintConfig &config) m_active = true; return; - case FirstLayerPlaneMode::BeltShear: { + case FirstLayerPlaneMode::BeltAffine: { // Compute the slicing-frame plane that maps to machine_Z = user_offset // under the gcode axis remap (and optional back-transform). MachineZAffine mz = compute_machine_z_affine(config); diff --git a/src/libslic3r/GCode/BeltBackTransform.cpp b/src/libslic3r/GCode/BeltBackTransform.cpp index 893c46e52b..654afe6262 100644 --- a/src/libslic3r/GCode/BeltBackTransform.cpp +++ b/src/libslic3r/GCode/BeltBackTransform.cpp @@ -15,9 +15,12 @@ bool BeltBackTransform::init_from_config(const PrintConfig &config) bool has_global_shear = config.belt_shear_x_global.value || config.belt_shear_y_global.value || config.belt_shear_z_global.value; + bool has_global_rotation = config.belt_slice_rotation_global.value + && config.belt_slice_rotation.value != BeltRotationAxis::None; bool has_preslice_global = config.belt_preslice_global.value || config.preslice_remap_global.value; - if (!has_global_shear && !has_preslice_global && !BeltTransformPipeline::has_preslice_remap(config)) + if (!has_global_shear && !has_global_rotation && !has_preslice_global + && !BeltTransformPipeline::has_preslice_remap(config)) return false; // Build the forward pipeline (scale * shear * pre_remap) and store its inverse. diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index b6875f6117..8a5acdd95a 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1329,6 +1329,7 @@ static std::vector s_Preset_printer_options { "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", "belt_shear_y_global", "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", "belt_shear_z_global", "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", + "belt_slice_rotation", "belt_slice_rotation_angle", "belt_slice_rotation_global", "belt_mesh_transform_order", "preslice_remap_x", "preslice_remap_y", "preslice_remap_z", "preslice_remap_global", "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", "gcode_back_transform", diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index 11b8c4d99c..eb4e7b0bed 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -1536,6 +1536,9 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ // so each gets independent layer Z values. bool belt_force_separate = m_config.belt_printer.value && ( (m_config.belt_shear_z_global.value && m_config.belt_shear_z.value != BeltShearMode::None) + || (m_config.belt_slice_rotation_global.value + && m_config.belt_slice_rotation.value != BeltRotationAxis::None + && std::abs(m_config.belt_slice_rotation_angle.value) > EPSILON) || m_config.belt_preslice_global.value || (m_config.preslice_remap_global.value && BeltTransformPipeline::has_preslice_remap(m_config))); model_object_status.print_instances = print_objects_from_model_object(*model_object, this->shrinkage_compensation(), belt_force_separate); @@ -1629,6 +1632,9 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ if (belt_instances_shifted && m_config.belt_printer.value && ((m_config.belt_shear_z_global.value && m_config.belt_shear_z.value != BeltShearMode::None) + || (m_config.belt_slice_rotation_global.value + && m_config.belt_slice_rotation.value != BeltRotationAxis::None + && std::abs(m_config.belt_slice_rotation_angle.value) > EPSILON) || m_config.belt_preslice_global.value || (m_config.preslice_remap_global.value && BeltTransformPipeline::has_preslice_remap(m_config)))) { for (PrintObject *object : m_objects) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 5edfb1b0f0..ab6c122fd3 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -326,6 +326,14 @@ static t_config_enum_values s_keys_map_BeltAxis { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltAxis) +static t_config_enum_values s_keys_map_BeltRotationAxis { + { "none", int(BeltRotationAxis::None) }, + { "x", int(BeltRotationAxis::X) }, + { "y", int(BeltRotationAxis::Y) }, + { "z", int(BeltRotationAxis::Z) }, +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltRotationAxis) + static t_config_enum_values s_keys_map_BeltTransformOrder { { "scale_then_shear", int(BeltTransformOrder::ScaleThenShear) }, { "shear_then_scale", int(BeltTransformOrder::ShearThenScale) }, @@ -374,7 +382,10 @@ static t_config_enum_values s_keys_map_FirstLayerPlaneMode { { "xy", int(FirstLayerPlaneMode::XY) }, { "yz", int(FirstLayerPlaneMode::YZ) }, { "xz", int(FirstLayerPlaneMode::XZ) }, - { "belt_shear", int(FirstLayerPlaneMode::BeltShear) }, + { "belt_affine", int(FirstLayerPlaneMode::BeltAffine) }, + // Back-compat alias: pre-rotation builds serialised this mode as + // "belt_shear". Accept it on parse so old 3MFs / presets keep loading. + { "belt_shear", int(FirstLayerPlaneMode::BeltAffine) }, }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(FirstLayerPlaneMode) @@ -6429,9 +6440,9 @@ void PrintConfigDef::init_fff_params() add_belt_axis_enum ("belt_shear_y_from", "From", "Source axis for Y shear.", BeltAxis::Z, comExpert); add_belt_shear_global("belt_shear_y_global", "Global"); - add_belt_shear_mode ("belt_shear_z", "Function", BeltShearMode::PosTan); - add_belt_shear_angle("belt_shear_z_angle", "Angle"); - add_belt_axis_enum ("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y); + add_belt_shear_mode ("belt_shear_z", "Function", BeltShearMode::None, comExpert); + add_belt_shear_angle("belt_shear_z_angle", "Angle", comExpert); + add_belt_axis_enum ("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y, comExpert); add_belt_shear_global("belt_shear_z_global", "Global", true); // Per-axis scale controls for belt printer @@ -6463,12 +6474,47 @@ void PrintConfigDef::init_fff_params() add_belt_scale_mode ("belt_scale_x", "Function", BeltScaleMode::None, comExpert); add_belt_scale_angle("belt_scale_x_angle", "Angle", comExpert); - add_belt_scale_mode ("belt_scale_y", "Function", BeltScaleMode::None); - add_belt_scale_angle("belt_scale_y_angle", "Angle"); + add_belt_scale_mode ("belt_scale_y", "Function", BeltScaleMode::None, comExpert); + add_belt_scale_angle("belt_scale_y_angle", "Angle", comExpert); add_belt_scale_mode ("belt_scale_z", "Function", BeltScaleMode::None, comExpert); add_belt_scale_angle("belt_scale_z_angle", "Angle", comExpert); + // Global slicing rotation (alternative to per-axis shear+scale). + def = this->add("belt_slice_rotation", coEnum); + def->label = L("Slicing rotation axis"); + def->category = L("Printable space"); + def->tooltip = L("Rotate the mesh by this axis before slicing. Use this for an " + "isometric (no shear distortion) belt slicing transform. " + "Mutually exclusive with the per-axis shear/scale controls " + "in the UI; the pipeline composes them if both are set in JSON."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "x", "y", "z"}; + def->enum_labels = {L("None"), L("X"), L("Y"), L("Z")}; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(BeltRotationAxis::None)); + + def = this->add("belt_slice_rotation_angle", coFloat); + def->label = L("Slicing rotation angle"); + def->category = L("Printable space"); + def->tooltip = L("Magnitude of the slicing rotation, in degrees. Positive values " + "rotate counter-clockwise looking down the positive axis."); + def->sidetext = L("°"); + def->min = -180.; + def->max = 180.; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.)); + + def = this->add("belt_slice_rotation_global", coBool); + def->label = L("Global"); + def->category = L("Printable space"); + def->tooltip = L("Treat the slicing rotation as part of the global forward transform " + "that BeltBackTransform inverts before the machine-frame remap. " + "Required for rotation-mode belt printers; mirrors belt_shear_z_global. " + "Defaults to on because virtually all rotation-mode printers need it."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(true)); + auto add_belt_transform_order = [this](const char *key, const char *label, const char *tooltip) { auto def = this->add(key, coEnum); def->label = L(label); @@ -6597,7 +6643,8 @@ void PrintConfigDef::init_fff_params() // First-layer plane: which surface defines "first layer" for fan / speed / // accel decisions. On belt printers the slicing-frame layer 0 is a tilted // slab that no longer corresponds to the physical first printed layer. - // Auto picks BeltShear when belt_shear_z != None, otherwise XY (legacy). + // Auto picks BeltAffine when any belt-side affine transform is active + // (Z shear or slicing rotation), otherwise XY (legacy). def = this->add("first_layer_plane", coEnum); def->label = L("First layer plane"); def->category = L("Printable space"); @@ -6605,14 +6652,15 @@ void PrintConfigDef::init_fff_params() "first-layer settings (no fan, slow speed, initial-layer accel/jerk, " "deferred temperature drop). On belt printers a single slicing layer " "contains paths at many machine-Z values, so layer-index based detection " - "fails. Auto resolves to Belt shear plane when belt_shear_z is non-None, " - "otherwise XY (legacy). Pick XY explicitly to opt out and force the " - "legacy slicing-layer-0 detection."); + "fails. Auto resolves to Belt affine plane when any belt-side affine " + "transform (Z shear or slicing rotation) is active, otherwise XY (legacy). " + "Pick XY explicitly to opt out and force the legacy slicing-layer-0 " + "detection."); def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); - def->enum_values = {"auto", "xy", "yz", "xz", "belt_shear"}; - def->enum_labels = {L("Auto"), L("XY (machine bed)"), L("YZ"), L("XZ"), L("Belt shear plane")}; + def->enum_values = {"auto", "xy", "yz", "xz", "belt_affine"}; + def->enum_labels = {L("Auto"), L("XY (machine bed)"), L("YZ"), L("XZ"), L("Belt affine plane")}; def->mode = comExpert; - def->set_default_value(new ConfigOptionEnum(FirstLayerPlaneMode::BeltShear)); + def->set_default_value(new ConfigOptionEnum(FirstLayerPlaneMode::BeltAffine)); def = this->add("first_layer_plane_offset", coFloat); def->label = L("Belt plane offset"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 3536f6d909..a6c6f55394 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -194,6 +194,17 @@ enum class BeltAxis Z = 2, }; +// Axis around which the mesh is rotated before slicing, when +// `belt_slice_rotation` is set. None disables the rotation stage. +// Distinct from BeltAxis because BeltAxis carries no "None" semantics. +enum class BeltRotationAxis +{ + None = 0, + X = 1, + Y = 2, + Z = 3, +}; + // Order in which the belt shear and scale matrices are composed. // ScaleThenShear: applied to a point p, the result is shear(scale(p)). // ShearThenScale: applied to a point p, the result is scale(shear(p)). @@ -231,8 +242,9 @@ enum class BeltSupportZOffsetMode // // Auto resolves to: // - XY (inactive, legacy behavior) for non-belt printers and for belt -// printers with no Z-axis shear. -// - BeltShear for belt printers with belt_shear_z != None. +// printers with no active belt-side transform. +// - BeltAffine for belt printers with any active belt-side affine +// transform (Z shear, slicing rotation, or both). // // XY is also used as an explicit "opt out" mode that forces legacy // per-layer first-layer detection even on belt printers. @@ -242,7 +254,7 @@ enum class FirstLayerPlaneMode XY, YZ, XZ, - BeltShear, + BeltAffine, // formerly BeltShear; renamed to reflect rotation support }; enum SupportMaterialPattern { @@ -607,6 +619,7 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SlicingMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltShearMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltScaleMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltAxis) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltRotationAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltTransformOrder) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(RemapAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportFloorMode) @@ -1579,6 +1592,12 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, belt_scale_y_angle)) ((ConfigOptionEnum, belt_scale_z)) ((ConfigOptionFloat, belt_scale_z_angle)) + // Global mesh rotation as an alternative to per-axis shear/scale (isometric + // slicing transform). Composes with shear in the pipeline math; UI gates + // them as mutually exclusive. + ((ConfigOptionEnum, belt_slice_rotation)) + ((ConfigOptionFloat, belt_slice_rotation_angle)) + ((ConfigOptionBool, belt_slice_rotation_global)) ((ConfigOptionEnum, preslice_remap_x)) ((ConfigOptionEnum, preslice_remap_y)) ((ConfigOptionEnum, preslice_remap_z)) diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 07ba2c63af..a0d2b18992 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -174,12 +174,15 @@ static std::vector slice_volumes_inner( belt_strategy->apply_to_trafo(params_base.trafo, model_volumes, has_remap, out_belt_min_z); } // If only remap (no belt), still need z-shift detection. + // Compose per-volume mv->get_matrix() so assembly volumes contribute their + // actual object-space positions — see the matching note in BeltSliceStrategy. if (has_remap && !print_config.belt_printer.value) { double min_z = std::numeric_limits::max(); for (const ModelVolume *mv : model_volumes) { if (!mv->is_model_part()) continue; + Transform3d vol_trafo = params_base.trafo * mv->get_matrix(); for (const stl_vertex &v : mv->mesh().its.vertices) { - Vec3d pt = params_base.trafo * v.cast(); + Vec3d pt = vol_trafo * v.cast(); min_z = std::min(min_z, pt.z()); } } @@ -322,17 +325,35 @@ static std::vector> slices_to_regions( } } else { zs_complex.reserve(zs.size()); - // region.bbox is computed in pre-belt-shear slicer space (see PrintApply.cpp::trafo_for_bbox). - // When belt transforms are active, layer Z values are in post-shear/scale/remap space, + // region.bbox is computed in pre-belt-transform slicer space (see PrintApply.cpp::trafo_for_bbox). + // When belt transforms are active, layer Z values are in post-rotation/shear/scale/remap space, // so the Z components of region.bbox aren't comparable to z. Skipping the Z filter here // pushes those layers into the parallel_for path below, which handles multi-volume // clipping per layer without relying on the bbox Z range. const bool bbox_z_in_layer_frame = !(print_config.belt_printer.value && (BeltTransformPipeline::has_shear(print_config) || BeltTransformPipeline::has_scale(print_config) + || BeltTransformPipeline::has_rotation(print_config) || BeltTransformPipeline::has_preslice_remap(print_config))); + // Belt-transform addendum: with bbox-Z untrusted, the simple path's + // "first model_part wins" logic drops subsequent volumes' slices unless + // they XY-overlap with the first. Assemblies whose volumes are stacked + // or side-by-side in pre-transform Z (different bbox.z ranges) thus lose + // the volumes that originally sat outside the first volume's Z range — + // showing up as truncation at the top or bottom of the assembly. Force + // every layer in a multi-volume range through the parallel_for path, + // which correctly merges all volumes per layer. + int num_model_parts = 0; + for (const PrintObjectRegions::VolumeRegion &vr : layer_range.volume_regions) + if (vr.model_volume->is_model_part()) + ++num_model_parts; + const bool force_complex_for_belt = !bbox_z_in_layer_frame && num_model_parts > 1; for (; z_idx < zs.size() && zs[z_idx] < layer_range.layer_height_range.second; ++ z_idx) { float z = zs[z_idx]; + if (force_complex_for_belt) { + zs_complex.push_back({ z_idx, z }); + continue; + } int idx_first_printable_region = -1; bool complex = false; for (int idx_region = 0; idx_region < int(layer_range.volume_regions.size()); ++ idx_region) { @@ -949,7 +970,81 @@ void PrintObject::slice() BOOST_LOG_TRIVIAL(warning) << "Belt global: object " << this->model_object()->name << " instances=" << this->instances().size() << " shift=(" << unscale(inst_shift.x()) << ", " << unscale(inst_shift.y()) << ")"; - double global_z_offset = 0.; + + // Per-object Z-shift compensation, applied regardless of global mode. + // + // BeltSliceStrategy::apply_to_trafo lifts the mesh by max(0, -m_belt_min_z) + // so the slicer can slice with slicer_z >= 0. BeltBackTransform inverts + // build_forward_transform() which DOES NOT include this per-object + // Z-shift (it's not known until vertex scan time). Result: G-code + // coords emerge offset by the un-undone Z-shift — for shear that's a + // pure machine_z lift; for rotation it leaks into both machine_y and + // machine_z because the inverse rotation couples slicer_z back into + // both axes. Compensating layer.print_z by shear_min_z here makes the + // back-transform produce correct machine-frame coordinates whether or + // not any global mode is active. + // + // (The original global-mode-only application of shear_min_z was sized + // for cube-vs-inverted-cone-tip differentiation; the same compensation + // is what fixes assemblies and rotation-mode parts where z_shift > 0.) + double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) + ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; + double shear_min_z = m_belt_min_z - belt_surface_z; + double global_z_offset = shear_min_z; + + // Centering correction: trafo_centered pretranslates by + // -m_center_offset.{x,y}. Under the belt forward transform, the + // Y component of that pretranslate couples into slicer-Z (shear: + // tan*c.y, rotation: sin*c.y). BeltBackTransform inverts the + // rotation/shear but doesn't undo centering, so this Z component + // leaks into machine output as a position offset whenever + // m_center_offset != 0. When a user moves a volume within an + // assembly such that the combined bbox center shifts, this shows + // up as a small Z translation in the print. Compensate by adding + // the Z component of the centering through the forward transform. + { + Transform3d T_fwd = BeltTransformPipeline::build_forward_transform(pcfg); + Vec3d c_off(unscale(m_center_offset.x()), + unscale(m_center_offset.y()), + 0.); + double centering_z_corr = (T_fwd.linear() * c_off).z(); + global_z_offset += centering_z_corr; + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] centering correction" + << " obj=" << this->model_object()->name + << " m_center_offset_mm=(" << c_off.x() << "," << c_off.y() << ")" + << " centering_z_corr=" << centering_z_corr + << " (added to global_z_offset)"; + } + + // [BELT-DEBUG] Per-object summary so Case A vs Case B can be compared + // side-by-side. Lays out every value that feeds into the final layer + // print_z adjustment. + { + BoundingBoxf3 raw_bb = this->model_object()->raw_bounding_box(); + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] slice() per-object summary" + << " obj=" << this->model_object()->name + << " n_volumes=" << this->model_object()->volumes.size() + << " raw_bbox.min=(" << raw_bb.min.x() << "," << raw_bb.min.y() << "," << raw_bb.min.z() << ")" + << " raw_bbox.max=(" << raw_bb.max.x() << "," << raw_bb.max.y() << "," << raw_bb.max.z() << ")" + << " raw_bbox.center=(" << raw_bb.center().x() << "," << raw_bb.center().y() << ")" + << " m_center_offset=(" << unscale(m_center_offset.x()) << "," << unscale(m_center_offset.y()) << ")" + << " inst_shift=(" << unscale(inst_shift.x()) << "," << unscale(inst_shift.y()) << ")" + << " m_belt_min_z=" << m_belt_min_z + << " belt_surface_z=" << belt_surface_z + << " shear_min_z=" << shear_min_z; + // Per-volume bbox + get_matrix translation so order/composition is visible. + int vi = 0; + for (const ModelVolume *mv : this->model_object()->volumes) { + if (!mv->is_model_part()) { ++vi; continue; } + BoundingBoxf3 vol_bb = mv->mesh().transformed_bounding_box(mv->get_matrix()); + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] vol[" << vi + << "] id=" << mv->id().id << " name='" << mv->name << "'" + << " get_matrix.translation=(" << mv->get_matrix().translation().x() << "," << mv->get_matrix().translation().y() << "," << mv->get_matrix().translation().z() << ")" + << " object_bbox.min=(" << vol_bb.min.x() << "," << vol_bb.min.y() << "," << vol_bb.min.z() << ")" + << " object_bbox.max=(" << vol_bb.max.x() << "," << vol_bb.max.y() << "," << vol_bb.max.z() << ")"; + ++vi; + } + } if (pcfg.belt_preslice_global.value) { // Global pre-slice mode: compute full correction c = (T.linear() - I) * d @@ -957,18 +1052,7 @@ void PrintObject::slice() Transform3d T = BeltTransformPipeline::build_forward_transform(pcfg); Vec3d d(unscale(inst_shift.x()), unscale(inst_shift.y()), 0.); Vec3d c = T.linear() * d - d; - - // Per-object shape contribution: BeltSliceStrategy::apply_to_trafo - // lifts the mesh by max(0, -m_belt_min_z) to keep slicer-frame Z - // above 0. Two objects at the same bed position but different - // m_belt_min_z (e.g. cube vs inverted-cone tip) otherwise end up - // at the same print_z, which causes the inverted-cone tip to - // start on the same layer as the cube's lowest sheared corner. - double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) - ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; - double shear_min_z = m_belt_min_z - belt_surface_z; - - global_z_offset = c.z() + shear_min_z; + global_z_offset += c.z(); BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_global_xy_correction tid=" << std::this_thread::get_id() << " obj=" << this << " old=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ") new=(" << c.x() << "," << c.y() << ")"; @@ -999,10 +1083,7 @@ void PrintObject::slice() Transform3d T = BeltTransformPipeline::build_forward_transform(pcfg); Vec3d d(unscale(inst_shift.x()), unscale(inst_shift.y()), 0.); Vec3d c = T.linear() * d - d; - double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) - ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; - double shear_min_z = m_belt_min_z - belt_surface_z; - global_z_offset += c.z() + shear_min_z; + global_z_offset += c.z(); BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_global_xy_correction tid=" << std::this_thread::get_id() << " obj=" << this << " old=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ") new=(" << c.x() << "," << c.y() << ")"; @@ -1012,6 +1093,19 @@ void PrintObject::slice() << " shear_min_z=" << shear_min_z << " (m_belt_min_z=" << m_belt_min_z << ")"; } + // Slicing rotation in global mode: bed-position-dependent Z offset. + // For R(α, X): c.z = sin(α)*d.y so objects at different bed-Y + // values print at different machine Z values along the inclined belt. + if (pcfg.belt_slice_rotation_global.value + && pcfg.belt_slice_rotation.value != BeltRotationAxis::None + && std::abs(pcfg.belt_slice_rotation_angle.value) > EPSILON) { + Transform3d T = BeltTransformPipeline::build_forward_transform(pcfg); + Vec3d d(unscale(inst_shift.x()), unscale(inst_shift.y()), 0.); + Vec3d c = T.linear() * d - d; + global_z_offset += c.z(); + m_belt_global_xy_correction = Vec2d(c.x(), c.y()); + } + // Pre-slice remap global mode: when on, the remap accounts for the // instance bed position. The Z component of the correction // (R - I) * d shifts layer print_z so e.g. a Y↔Z swap with an @@ -1030,6 +1124,15 @@ void PrintObject::slice() BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_global_z_offset tid=" << std::this_thread::get_id() << " obj=" << this << " old=" << m_belt_global_z_offset << " new=" << global_z_offset; m_belt_global_z_offset = global_z_offset; + // [BELT-DEBUG] Final breakdown of all contributions to layer.print_z + // and where the first / last layer end up post-adjustment. + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] global_z_offset breakdown" + << " obj=" << this->model_object()->name + << " shear_min_z=" << shear_min_z + << " total_global_z_offset=" << global_z_offset + << " xy_correction=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ")" + << " belt_floor_z_shift_before=" << (m_slicing_params.belt_floor_z_shift) + << " n_layers=" << m_layers.size(); if (std::abs(global_z_offset) > EPSILON) { for (Layer *layer : m_layers) layer->print_z += global_z_offset; @@ -1038,6 +1141,12 @@ void PrintObject::slice() // layer print_z, so belt_floor_z_shift must match. m_slicing_params.belt_floor_z_shift += global_z_offset; } + if (!m_layers.empty()) { + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] post-adjustment" + << " first_layer.print_z=" << m_layers.front()->print_z + << " last_layer.print_z=" << m_layers.back()->print_z + << " belt_floor_z_shift_after=" << m_slicing_params.belt_floor_z_shift; + } if (!m_layers.empty()) { BOOST_LOG_TRIVIAL(warning) << "Belt global: first_layer_z=" << m_layers.front()->print_z << " last_layer_z=" << m_layers.back()->print_z diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 93dde99522..470f1d93cb 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4462,7 +4462,23 @@ void TabPrinter::build_fff() belt_og->append_single_option_line("belt_printer"); belt_og->append_single_option_line("belt_printer_angle"); belt_og->append_single_option_line("belt_printer_infinite_y"); - // Per-axis shear: group mode + angle + source on one row per axis + // Mesh rotate (default belt-side transform): isometric, no distortion. + // Shown above the per-axis shear/scale rows because most users should + // pick rotation; shear/scale is the expert escape hatch. + { + Line line = { L("Mesh rotate"), + L("Global mesh rotation applied before slicing. Isometric " + "(no distortion); the back-transform inverts it before the " + "machine-frame remap. Default belt transform. Mutually " + "exclusive with per-axis shear/scale in the UI.") }; + line.append_option(belt_og->get_option("belt_slice_rotation")); + line.append_option(belt_og->get_option("belt_slice_rotation_angle")); + line.append_option(belt_og->get_option("belt_slice_rotation_global")); + belt_og->append_line(line); + } + // Per-axis shear/scale: expert escape hatch for non-rigid belt transforms + // (BlackBelt-style 1/sin scaling, asymmetric belt geometries, etc.). + // Group mode + angle + source on one row per axis. { Line line = { L("Mesh shear X"), L("Shear applied to the X axis before slicing") }; line.append_option(belt_og->get_option("belt_shear_x")); @@ -5594,17 +5610,19 @@ void TabPrinter::toggle_options() bool expert_or_above = (m_mode >= comExpert); toggle_line("belt_printer_angle", is_belt); toggle_line("belt_printer_infinite_y", is_belt); - // Mesh shear/scale: only shear Z and scale Y are shown in Advanced; the others - // are Expert-only. Each Line packs all its options on one row, so toggle the - // Line here in addition to the per-option mode gating. + // Mesh rotate: advanced (visible by default in belt mode). + toggle_line("belt_slice_rotation", is_belt); + // Mesh shear/scale: expert-only (the rigid rotation above is the + // primary belt transform; shear/scale is reserved for power users + // matching BlackBelt-style 1/sin scale or asymmetric belt geometries). toggle_line("belt_shear_x", is_belt && expert_or_above); toggle_line("belt_shear_y", is_belt && expert_or_above); - toggle_line("belt_shear_z", is_belt); + toggle_line("belt_shear_z", is_belt && expert_or_above); toggle_line("belt_scale_x", is_belt && expert_or_above); - toggle_line("belt_scale_y", is_belt); + toggle_line("belt_scale_y", is_belt && expert_or_above); toggle_line("belt_scale_z", is_belt && expert_or_above); - for (auto el : {"belt_mesh_transform_order", - "belt_origin_snap_x", "belt_origin_snap_y", "belt_origin_snap_z"}) + toggle_line("belt_mesh_transform_order", is_belt && expert_or_above); + for (auto el : {"belt_origin_snap_x", "belt_origin_snap_y", "belt_origin_snap_z"}) toggle_line(el, is_belt); // Remap, back-transform, and global mesh-transforms toggles are gated by belt @@ -5619,31 +5637,59 @@ void TabPrinter::toggle_options() // preslice_remap_global: superseded by belt_preslice_global toggle_option("preslice_remap_global", is_belt && !belt_global); + // Mutual exclusion (UI only): slicing rotation and per-axis shear/scale are + // alternatives in the printer panel. The pipeline math composes them; this + // just disables the inactive set so users pick one path or the other. + auto rot_axis = m_config->option>("belt_slice_rotation")->value; + bool rotation_active = is_belt + && rot_axis != BeltRotationAxis::None + && std::abs(m_config->opt_float("belt_slice_rotation_angle")) > 1e-9; + bool shear_or_scale_active = is_belt && ( + m_config->option>("belt_shear_x")->value != BeltShearMode::None || + m_config->option>("belt_shear_y")->value != BeltShearMode::None || + m_config->option>("belt_shear_z")->value != BeltShearMode::None || + m_config->option>("belt_scale_x")->value != BeltScaleMode::None || + m_config->option>("belt_scale_y")->value != BeltScaleMode::None || + m_config->option>("belt_scale_z")->value != BeltScaleMode::None); + bool allow_shear_scale = !rotation_active; + bool allow_rotation = !shear_or_scale_active; + + // Disable shear/scale mode dropdowns when rotation is active. + for (auto el : {"belt_shear_x", "belt_shear_y", "belt_shear_z", + "belt_scale_x", "belt_scale_y", "belt_scale_z", + "belt_mesh_transform_order"}) + toggle_option(el, is_belt && allow_shear_scale); + + // Disable rotation controls when any shear/scale is active. + toggle_option("belt_slice_rotation", is_belt && allow_rotation); + toggle_option("belt_slice_rotation_angle", is_belt && allow_rotation && rot_axis != BeltRotationAxis::None); + toggle_option("belt_slice_rotation_global", is_belt && allow_rotation && rot_axis != BeltRotationAxis::None); + // Gray out angle/from sub-options when their parent shear/scale mode is None. // Per-axis globals are superseded when belt_preslice_global is on. auto sx = m_config->option>("belt_shear_x")->value; - toggle_option("belt_shear_x_angle", is_belt && sx != BeltShearMode::None); - toggle_option("belt_shear_x_from", is_belt && sx != BeltShearMode::None); - toggle_option("belt_shear_x_global", is_belt && sx != BeltShearMode::None && !belt_global); + toggle_option("belt_shear_x_angle", is_belt && sx != BeltShearMode::None && allow_shear_scale); + toggle_option("belt_shear_x_from", is_belt && sx != BeltShearMode::None && allow_shear_scale); + toggle_option("belt_shear_x_global", is_belt && sx != BeltShearMode::None && !belt_global && allow_shear_scale); auto sy = m_config->option>("belt_shear_y")->value; - toggle_option("belt_shear_y_angle", is_belt && sy != BeltShearMode::None); - toggle_option("belt_shear_y_from", is_belt && sy != BeltShearMode::None); - toggle_option("belt_shear_y_global", is_belt && sy != BeltShearMode::None && !belt_global); + toggle_option("belt_shear_y_angle", is_belt && sy != BeltShearMode::None && allow_shear_scale); + toggle_option("belt_shear_y_from", is_belt && sy != BeltShearMode::None && allow_shear_scale); + toggle_option("belt_shear_y_global", is_belt && sy != BeltShearMode::None && !belt_global && allow_shear_scale); auto sz = m_config->option>("belt_shear_z")->value; - toggle_option("belt_shear_z_angle", is_belt && sz != BeltShearMode::None); - toggle_option("belt_shear_z_from", is_belt && sz != BeltShearMode::None); - toggle_option("belt_shear_z_global", is_belt && sz != BeltShearMode::None && !belt_global); + toggle_option("belt_shear_z_angle", is_belt && sz != BeltShearMode::None && allow_shear_scale); + toggle_option("belt_shear_z_from", is_belt && sz != BeltShearMode::None && allow_shear_scale); + toggle_option("belt_shear_z_global", is_belt && sz != BeltShearMode::None && !belt_global && allow_shear_scale); auto scx = m_config->option>("belt_scale_x")->value; - toggle_option("belt_scale_x_angle", is_belt && scx != BeltScaleMode::None); + toggle_option("belt_scale_x_angle", is_belt && scx != BeltScaleMode::None && allow_shear_scale); auto scy = m_config->option>("belt_scale_y")->value; - toggle_option("belt_scale_y_angle", is_belt && scy != BeltScaleMode::None); + toggle_option("belt_scale_y_angle", is_belt && scy != BeltScaleMode::None && allow_shear_scale); auto scz = m_config->option>("belt_scale_z")->value; - toggle_option("belt_scale_z_angle", is_belt && scz != BeltScaleMode::None); + toggle_option("belt_scale_z_angle", is_belt && scz != BeltScaleMode::None && allow_shear_scale); // Machine-frame transforms: shown only in belt mode. // Mirror the Advanced/Expert split used for mesh shear/scale. From 48b6db93b8e643655b8aaf11e36d707a46ddb656 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Wed, 27 May 2026 11:45:38 -0500 Subject: [PATCH 032/389] Belt/slice rotate (#33) * initial commit * fix upper bounds for assemblies * significantly less Z shift issues, still not quite tamped down yet though * add instrumentation to logs * finally found the issue * update printer defaults From 0f75d6bc4e28bbbe510a656018aeb7f8aab6bf32 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Wed, 27 May 2026 19:25:02 -0500 Subject: [PATCH 033/389] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/libslic3r/BeltGCodeWriter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index b2a8f5c470..e0e4fb6f46 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -1,6 +1,7 @@ #include "BeltGCodeWriter.hpp" #include "FirstLayerPlane.hpp" #include "Geometry.hpp" +#include namespace Slic3r { From 2dc49002921aa2db525831a8f2325f69f705e4f9 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Wed, 27 May 2026 21:53:04 -0500 Subject: [PATCH 034/389] Copilot review fixes & upstream code interaction fix (#34) * first pass at review issue 8 * delete detritus * fix build compile error due to upstream changes --- result.json | 7 ------- src/libslic3r/Print.hpp | 8 ++++++++ src/libslic3r/PrintObject.cpp | 19 +++++++++++++------ src/libslic3r/PrintObjectSlice.cpp | 7 +++++++ src/slic3r/GUI/3DScene.cpp | 5 +---- 5 files changed, 29 insertions(+), 17 deletions(-) delete mode 100644 result.json diff --git a/result.json b/result.json deleted file mode 100644 index e309ad45a1..0000000000 --- a/result.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "error_string": "Success.", - "export_time": 0, - "plate_index": 0, - "prepare_time": 0, - "return_code": 0 -} diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index 98d1e6fa5c..269c407762 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -589,6 +589,14 @@ private: double m_belt_min_z { 0.0 }; // Belt printer: XY correction from global pre-slice mode, applied to G-code origin. Vec2d m_belt_global_xy_correction { Vec2d::Zero() }; + // Belt printer: exact belt_floor_z_shift computed during posSlice from a + // vertex-level scan of the post-transform mesh. Cached separately from + // m_slicing_params so that rebuilding m_slicing_params on a non-belt-affecting + // invalidation (e.g. support config change) doesn't replace the exact value + // with the bbox approximation seeded by create_from_config(). Cleared when + // posSlice is invalidated. + double m_belt_floor_z_shift_cached { 0.0 }; + bool m_belt_floor_z_shift_cache_valid { false }; public: double belt_global_z_offset() const { return m_belt_global_z_offset; } double belt_min_z() const { return m_belt_min_z; } diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 309f497412..c1d01c6c68 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1461,15 +1461,16 @@ bool PrintObject::invalidate_step(PrintObjectStep step) invalidated |= this->invalidate_steps({ posPerimeters, posPrepareInfill, posInfill, posIroning, posContouring, posSupportMaterial, posSimplifyPath, posSimplifyInfill }); invalidated |= m_print->invalidate_steps({ psSkirtBrim }); m_slicing_params.valid = false; + // The exact belt_floor_z_shift is recomputed when slice() runs again. + m_belt_floor_z_shift_cache_valid = false; } else if (step == posSupportMaterial) { invalidated |= this->invalidate_steps({ posSimplifySupportPath }); invalidated |= m_print->invalidate_steps({ psSkirtBrim }); - // NOTE: do NOT set m_slicing_params.valid = false here. - // belt_floor_z_shift is patched to an exact value during posSlice - // (PrintObjectSlice.cpp, after slice_volumes). Invalidating slicing - // params here causes update_slicing_parameters() to overwrite that - // exact value with a bounding-box approximation, while posSlice does - // not re-run to correct it — breaking belt support clipping. + // SlicingParameters depend on support config (enable_support / + // raft_layers / enforce_support_layers feed min/max layer height in + // Slicing.cpp), so invalidate them here. The vertex-scan + // belt_floor_z_shift is preserved via m_belt_floor_z_shift_cached. + m_slicing_params.valid = false; } // Wipe tower depends on the ordering of extruders, which in turn depends on everything. @@ -1487,6 +1488,7 @@ bool PrintObject::invalidate_all_steps() bool result = Inherited::invalidate_all_steps() | m_print->invalidate_all_steps(); // Then reset some of the depending values. m_slicing_params.valid = false; + m_belt_floor_z_shift_cache_valid = false; return result; } @@ -3654,6 +3656,11 @@ void PrintObject::update_slicing_parameters() m_slicing_params.belt_floor_shear_factor = belt_floor.shear_factor; m_slicing_params.belt_floor_from_axis = belt_floor.from_axis; m_slicing_params.belt_floor_z_shift = belt_floor.z_shift; + // Prefer the vertex-scan z_shift over the bbox approximation when + // slice() has already produced one (e.g. this rebuild was triggered + // by a support-config change, which doesn't move the belt floor). + if (m_belt_floor_z_shift_cache_valid) + m_slicing_params.belt_floor_z_shift = m_belt_floor_z_shift_cached; } } diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index bb5af8c342..deaf6fdfce 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1164,6 +1164,13 @@ void PrintObject::slice() << " center_offset=(" << unscale(m_center_offset.x()) << ", " << unscale(m_center_offset.y()) << ")"; } + + // Cache the final patched belt_floor_z_shift so a later support-only + // invalidation can rebuild m_slicing_params without losing this exact + // (vertex-scan-derived) value. update_slicing_parameters() will + // restore it after create_from_config() seeds the bbox approximation. + m_belt_floor_z_shift_cached = m_slicing_params.belt_floor_z_shift; + m_belt_floor_z_shift_cache_valid = true; } } diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index bfa2b933a2..e9910a2eed 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -1117,10 +1117,7 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, shader->set_uniform("print_volume.type", -1); } - bool enable_support; - int support_threshold_angle = get_selection_support_threshold_angle(enable_support); - - float normal_z = -::cos(Geometry::deg2rad((float) support_threshold_angle)); + const float normal_z = get_selection_support_normal_z(); // Compute up direction accounting for build plate tilt Vec3f up_direction = Vec3f::UnitZ(); From 0bda684dd7a7975726db70593cea1158b1f191ee Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Sun, 31 May 2026 05:08:42 -0500 Subject: [PATCH 035/389] delete mesh transforms (#37) * delete mesh shear, scale and refactor logger * clean up config options * reorder UI elements --- .../Custom/machine/fdm_belt_common.json | 7 +- src/libslic3r/BeltGCode.cpp | 49 +--- src/libslic3r/BeltGCodeWriter.cpp | 7 +- src/libslic3r/BeltGCodeWriter.hpp | 3 - src/libslic3r/BeltSliceStrategy.cpp | 28 +- src/libslic3r/BeltSliceStrategy.hpp | 19 +- src/libslic3r/BeltTransform.cpp | 262 ++++-------------- src/libslic3r/BeltTransform.hpp | 72 ++--- src/libslic3r/FirstLayerPlane.cpp | 5 +- src/libslic3r/GCode.cpp | 12 +- src/libslic3r/GCode/BeltBackTransform.cpp | 7 +- src/libslic3r/GCode/GCodeProcessor.cpp | 79 +----- src/libslic3r/GCode/GCodeProcessor.hpp | 39 +-- src/libslic3r/GCode/MachineFrameTransform.cpp | 55 +--- src/libslic3r/GCode/MachineFrameTransform.hpp | 13 +- src/libslic3r/Preset.cpp | 7 +- src/libslic3r/Print.cpp | 35 +-- src/libslic3r/PrintApply.cpp | 6 +- src/libslic3r/PrintConfig.cpp | 239 +++++++--------- src/libslic3r/PrintConfig.hpp | 32 +-- src/libslic3r/PrintObjectSlice.cpp | 95 ++----- src/slic3r/GUI/3DBed.cpp | 25 +- src/slic3r/GUI/3DBed.hpp | 10 +- src/slic3r/GUI/Plater.cpp | 93 ++----- src/slic3r/GUI/Tab.cpp | 186 +++---------- 25 files changed, 377 insertions(+), 1008 deletions(-) diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index 0c3a976c0e..545ad15846 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -82,9 +82,9 @@ "z_hop_types": [ "Normal Lift" ], - "post_gcode_remap_x": "rev_x", - "post_gcode_remap_y": "pos_z", - "post_gcode_remap_z": "pos_y", + "gcode_remap_x": "rev_x", + "gcode_remap_y": "pos_z", + "gcode_remap_z": "pos_y", "printer_extruder_id": [ "1" ], @@ -94,7 +94,6 @@ "belt_slice_rotation_global": "1", "gcode_shear_z": "pos_tan", "gcode_scale_y": "inv_cos", - "build_plate_tilt_x": "45", "purge_in_prime_tower": "0", "scan_first_layer": "0", "auxiliary_fan": "0" diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index a89b20bcec..8c8c3d4392 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -14,7 +14,6 @@ void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) auto belt_writer = std::make_unique(); belt_writer->set_is_bbl_machine(is_bbl_printers); - belt_writer->set_belt_angle(print.config().belt_printer_angle.value); // Axis remap and build volume max are set by base GCode after init_belt_writer returns. belt_writer->set_belt_back_transform(print.config()); belt_writer->set_machine_frame_transform(print.config()); @@ -34,30 +33,12 @@ void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) if (!print.config().belt_printer.value) return; - file.write_format("; belt_printer_angle = %.1f\n", print.config().belt_printer_angle.value); - // Shear configs const auto &full_cfg = print.full_print_config(); - file.write_format("; belt_shear_x = %s\n", full_cfg.opt_serialize("belt_shear_x").c_str()); - file.write_format("; belt_shear_x_angle = %.1f\n", print.config().belt_shear_x_angle.value); - file.write_format("; belt_shear_x_from = %s\n", full_cfg.opt_serialize("belt_shear_x_from").c_str()); - file.write_format("; belt_shear_y = %s\n", full_cfg.opt_serialize("belt_shear_y").c_str()); - file.write_format("; belt_shear_y_angle = %.1f\n", print.config().belt_shear_y_angle.value); - file.write_format("; belt_shear_y_from = %s\n", full_cfg.opt_serialize("belt_shear_y_from").c_str()); - file.write_format("; belt_shear_z = %s\n", full_cfg.opt_serialize("belt_shear_z").c_str()); - file.write_format("; belt_shear_z_angle = %.1f\n", print.config().belt_shear_z_angle.value); - file.write_format("; belt_shear_z_from = %s\n", full_cfg.opt_serialize("belt_shear_z_from").c_str()); - // Scale configs - file.write_format("; belt_scale_x = %s\n", full_cfg.opt_serialize("belt_scale_x").c_str()); - file.write_format("; belt_scale_x_angle = %.1f\n", print.config().belt_scale_x_angle.value); - file.write_format("; belt_scale_y = %s\n", full_cfg.opt_serialize("belt_scale_y").c_str()); - file.write_format("; belt_scale_y_angle = %.1f\n", print.config().belt_scale_y_angle.value); - file.write_format("; belt_scale_z = %s\n", full_cfg.opt_serialize("belt_scale_z").c_str()); - file.write_format("; belt_scale_z_angle = %.1f\n", print.config().belt_scale_z_angle.value); - // Slicing rotation configs + // Slicing rotation: the belt tilt (axis + angle) and the single source of truth + // for the physical tilt the G-code viewer uses to enable belt view. file.write_format("; belt_slice_rotation = %s\n", full_cfg.opt_serialize("belt_slice_rotation").c_str()); file.write_format("; belt_slice_rotation_angle = %.1f\n", print.config().belt_slice_rotation_angle.value); file.write_format("; belt_slice_rotation_global = %d\n", print.config().belt_slice_rotation_global.value ? 1 : 0); - file.write_format("; belt_mesh_transform_order = %s\n", full_cfg.opt_serialize("belt_mesh_transform_order").c_str()); // Pre-slice remap configs file.write_format("; preslice_remap_x = %s\n", full_cfg.opt_serialize("preslice_remap_x").c_str()); file.write_format("; preslice_remap_y = %s\n", full_cfg.opt_serialize("preslice_remap_y").c_str()); @@ -81,9 +62,6 @@ void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) file.write_format("; gcode_scale_z = %s\n", full_cfg.opt_serialize("gcode_scale_z").c_str()); file.write_format("; gcode_scale_z_angle = %.1f\n", print.config().gcode_scale_z_angle.value); file.write_format("; belt_gcode_transform_order = %s\n", full_cfg.opt_serialize("belt_gcode_transform_order").c_str()); - file.write_format("; post_gcode_remap_x = %s\n", full_cfg.opt_serialize("post_gcode_remap_x").c_str()); - file.write_format("; post_gcode_remap_y = %s\n", full_cfg.opt_serialize("post_gcode_remap_y").c_str()); - file.write_format("; post_gcode_remap_z = %s\n", full_cfg.opt_serialize("post_gcode_remap_z").c_str()); } void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) @@ -94,21 +72,16 @@ void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) // This replaces the bbox-based axis snap with an exact formula. // // Flags that trigger this path: - // belt_preslice_global — full pipeline (scale * shear * remap) is global - // preslice_remap_global — only the pre-slice remap is global - // belt_shear_z_global — Z-row shear treated as global (matches per-axis - // Z-offset added in PrintObjectSlice.cpp) + // belt_preslice_global — full pipeline (rotation * remap) is global + // preslice_remap_global — only the pre-slice remap is global + // belt_slice_rotation_global — slicing rotation treated as global (matches + // the per-instance Z-offset added in PrintObjectSlice.cpp) // The XY origin adjustment uses the FULL forward transform either way, // because the back_transform applied during G-code emission is always the - // inverse of the full pipeline. Without pre-multiplication under - // ShearThenScale order with sy != 1, machine_y of bed position cy ends up - // at cy/sy instead of cy, which also leaves the object bottom off the belt - // plane. + // inverse of the full pipeline. bool use_global = m_config.belt_preslice_global.value || (m_config.preslice_remap_global.value && BeltTransformPipeline::has_preslice_remap(m_config)) - || (m_config.belt_shear_z_global.value - && m_config.belt_shear_z.value != BeltShearMode::None) || (m_config.belt_slice_rotation_global.value && m_config.belt_slice_rotation.value != BeltRotationAxis::None && std::abs(m_config.belt_slice_rotation_angle.value) > EPSILON); @@ -117,10 +90,10 @@ void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) if (belt_writer) { // The per-object lift (z_shift_val = max(0, -m_belt_min_z)) added by // BeltSliceStrategy::apply_to_trafo is already compensated inside - // global_z_offset (via the shear_min_z term in PrintObjectSlice.cpp's - // preslice_global branch). Snap was previously used here for the same - // purpose, but with both active the lift gets subtracted twice. Clear - // any leftover snap state from a prior instance. + // global_z_offset (via the belt_z_shift term in PrintObjectSlice.cpp). + // Snap was previously used here for the same purpose, but with both + // active the lift gets subtracted twice. Clear any leftover snap + // state from a prior instance. for (int a = 0; a < 3; ++a) belt_writer->set_origin_snap(a, false, 0., 0.); } diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index e0e4fb6f46..751a7f19d8 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -25,11 +25,6 @@ inline bool belt_point_on_first_layer( // ---- Belt configuration --------------------------------------------------- -void BeltGCodeWriter::set_belt_angle(double angle_deg) -{ - m_belt_angle_rad = Geometry::deg2rad(angle_deg); -} - void BeltGCodeWriter::set_belt_back_transform(const PrintConfig &config) { m_belt_back_transform.init_from_config(config); @@ -66,7 +61,7 @@ Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const if (m_origin_snap[i]) result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); Vec3d after_snap = result; - // Step 4: Machine-frame transform (gcode_shear / gcode_scale / post_gcode_remap) + // Step 4: Machine-frame transform (gcode_shear / gcode_scale) // applied LAST so it acts as a global linear transform on the placed coords. // Order matters: putting it before origin_snap would feed sheared bbox corners // into the snap's per-object min calculation, mis-normalizing non-cubic geometries diff --git a/src/libslic3r/BeltGCodeWriter.hpp b/src/libslic3r/BeltGCodeWriter.hpp index 60fd93f3e0..e9d4af0f3a 100644 --- a/src/libslic3r/BeltGCodeWriter.hpp +++ b/src/libslic3r/BeltGCodeWriter.hpp @@ -19,8 +19,6 @@ public: BeltGCodeWriter() : GCodeWriter() {} // Belt configuration (axis remap is inherited from GCodeWriter) - void set_belt_angle(double angle_deg); - bool is_belt_printer() const { return m_belt_angle_rad != 0.; } void set_belt_back_transform(const PrintConfig &config); void set_machine_frame_transform(const PrintConfig &config); void set_origin_snap(int axis, bool enable, double offset, double bbox_min); @@ -52,7 +50,6 @@ protected: std::string _travel_to_z(double z, const std::string &comment) override; private: - double m_belt_angle_rad = 0.; BeltBackTransform m_belt_back_transform; MachineFrameTransform m_machine_frame_transform; bool m_origin_snap[3] = {false, false, false}; diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp index 81c4c06f1e..ddaabdef0b 100644 --- a/src/libslic3r/BeltSliceStrategy.cpp +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -17,10 +17,7 @@ std::unique_ptr BeltSliceStrategy::create(const PrintConfig & BeltSliceStrategy::BeltSliceStrategy(const PrintConfig &config) { - m_shear = BeltTransformPipeline::build_shear_matrix(config, &m_has_shear); - m_scale = BeltTransformPipeline::build_scale_matrix(config, &m_has_scale); m_rotation = BeltTransformPipeline::build_rotation_matrix(config, &m_has_rotation); - m_order = config.belt_mesh_transform_order.value; } void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, @@ -28,15 +25,10 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, bool has_remap, double *out_belt_min_z) const { - // ScaleThenShear: applied to a point, scale runs first then shear (m_shear * m_scale). - // ShearThenScale: applied to a point, shear runs first then scale (m_scale * m_shear). - // Rotation (if active) is applied AFTER shear/scale, matching build_forward_transform. - if (m_has_shear || m_has_scale || m_has_rotation) { - Matrix3d shear_scale = (m_order == BeltTransformOrder::ScaleThenShear) - ? Matrix3d(m_shear * m_scale) - : Matrix3d(m_scale * m_shear); + // Rotation is the only mesh-side belt transform (matching build_forward_transform). + if (m_has_rotation) { Transform3d belt_xform = Transform3d::Identity(); - belt_xform.linear() = Matrix3d(m_rotation * shear_scale); + belt_xform.linear() = m_rotation; trafo = belt_xform * trafo; } @@ -47,7 +39,7 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, // within the object) causes min_z to be computed against mesh-local vertex // coordinates rather than object-space coordinates, so volumes translated // along the slicer's Z axis are silently excluded from the bound check. - if (has_remap || m_has_shear || m_has_scale || m_has_rotation) { + if (has_remap || m_has_rotation) { // [BELT-DEBUG] Capture the incoming trafo for diagnostic logging. // This is the slicer-frame transform AFTER belt_xform but BEFORE z_shift. const Transform3d trafo_pre_shift = trafo; @@ -65,9 +57,7 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, ss << "(" << v.x() << "," << v.y() << "," << v.z() << ")"; return ss.str(); }; - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] apply_to_trafo enter" - << " has_shear=" << m_has_shear - << " has_scale=" << m_has_scale + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_to_trafo enter" << " has_rotation=" << m_has_rotation << " has_remap=" << has_remap << " trafo.linear=" << log_mat(trafo_pre_shift.linear()) @@ -96,7 +86,7 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, vol_min_z = std::min(vol_min_z, pt.z()); min_z = std::min(min_z, pt.z()); } - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] vol[" << vol_idx + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] vol[" << vol_idx << "] id=" << mv->id().id << " name='" << mv->name << "'" << " mesh_bbox_min=" << log_vec3(mesh_min) << " mesh_bbox_max=" << log_vec3(mesh_max) << " get_matrix.translation=" << log_vec3(mv->get_matrix().translation()) @@ -105,7 +95,7 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, ++vol_idx; } double belt_z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] combined min_z=" << min_z + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] combined min_z=" << min_z << " z_shift_val=" << belt_z_shift_val; if (belt_z_shift_val > 0.) { Transform3d z_shift = Transform3d::Identity(); @@ -114,11 +104,11 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, } if (out_belt_min_z) { double new_val = (min_z != std::numeric_limits::max()) ? min_z : 0.; - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] write m_belt_min_z tid=" << std::this_thread::get_id() + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] write m_belt_min_z tid=" << std::this_thread::get_id() << " target=" << out_belt_min_z << " old=" << *out_belt_min_z << " new=" << new_val; *out_belt_min_z = new_val; } - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] apply_to_trafo exit" + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_to_trafo exit" << " final_trafo.linear=" << log_mat(trafo.linear()) << " final_trafo.translation=" << log_vec3(trafo.translation()); } diff --git a/src/libslic3r/BeltSliceStrategy.hpp b/src/libslic3r/BeltSliceStrategy.hpp index 6009155c7b..ff56f6fece 100644 --- a/src/libslic3r/BeltSliceStrategy.hpp +++ b/src/libslic3r/BeltSliceStrategy.hpp @@ -13,17 +13,17 @@ namespace Slic3r { // Belt printer pre-slice transform strategy. // -// Encapsulates the pre-remap, shear, scale, and Z-shift transforms -// that are applied to model geometry before slicing on belt printers. -// Used by PrintObjectSlice.cpp to isolate belt-specific logic from -// the slicing pipeline. +// Encapsulates the pre-remap, rotation, and Z-shift transforms that are +// applied to model geometry before slicing on belt printers. (Shear & scale +// are applied to the g-code, not the mesh.) Used by PrintObjectSlice.cpp to +// isolate belt-specific logic from the slicing pipeline. class BeltSliceStrategy { public: // Create a strategy if belt_printer is enabled; returns nullptr otherwise. static std::unique_ptr create(const PrintConfig &config); - // Apply belt-specific transforms (shear + scale + z-shift) to the slicing trafo. + // Apply belt-specific transforms (rotation + z-shift) to the slicing trafo. // Pre-slice remap is handled separately (standalone feature). // has_remap: whether pre-slice remap was already applied (affects z-shift detection). void apply_to_trafo(Transform3d &trafo, @@ -34,13 +34,8 @@ public: private: explicit BeltSliceStrategy(const PrintConfig &config); - bool m_has_shear = false; - bool m_has_scale = false; - bool m_has_rotation = false; - Matrix3d m_shear = Matrix3d::Identity(); - Matrix3d m_scale = Matrix3d::Identity(); - Matrix3d m_rotation = Matrix3d::Identity(); - BeltTransformOrder m_order = BeltTransformOrder::ScaleThenShear; + bool m_has_rotation = false; + Matrix3d m_rotation = Matrix3d::Identity(); }; } // namespace Slic3r diff --git a/src/libslic3r/BeltTransform.cpp b/src/libslic3r/BeltTransform.cpp index 0d1ae41295..db23e13417 100644 --- a/src/libslic3r/BeltTransform.cpp +++ b/src/libslic3r/BeltTransform.cpp @@ -51,50 +51,6 @@ Transform3d BeltTransformPipeline::build_preslice_remap(const PrintConfig &confi return pre_remap; } -Matrix3d BeltTransformPipeline::build_shear_matrix(const PrintConfig &config, bool *has_shear_out) -{ - struct AxisShear { BeltShearMode mode; double angle; int from; }; - AxisShear axes[3] = { - { config.belt_shear_x.value, config.belt_shear_x_angle.value, int(config.belt_shear_x_from.value) }, - { config.belt_shear_y.value, config.belt_shear_y_angle.value, int(config.belt_shear_y_from.value) }, - { config.belt_shear_z.value, config.belt_shear_z_angle.value, int(config.belt_shear_z_from.value) }, - }; - - Matrix3d shear = Matrix3d::Identity(); - bool active = false; - for (int row = 0; row < 3; ++row) { - if (axes[row].mode != BeltShearMode::None) { - double factor = compute_shear_factor(axes[row].mode, axes[row].angle); - if (std::abs(factor) > EPSILON) { - shear(row, axes[row].from) += factor; - active = true; - } - } - } - if (has_shear_out) *has_shear_out = active; - return shear; -} - -Matrix3d BeltTransformPipeline::build_scale_matrix(const PrintConfig &config, bool *has_scale_out) -{ - double sx = compute_scale_factor(config.belt_scale_x.value, config.belt_scale_x_angle.value); - double sy = compute_scale_factor(config.belt_scale_y.value, config.belt_scale_y_angle.value); - double sz = compute_scale_factor(config.belt_scale_z.value, config.belt_scale_z_angle.value); - - bool active = (std::abs(sx - 1.) > EPSILON || - std::abs(sy - 1.) > EPSILON || - std::abs(sz - 1.) > EPSILON); - - Matrix3d scale = Matrix3d::Identity(); - if (active) { - scale(0, 0) = sx; - scale(1, 1) = sy; - scale(2, 2) = sz; - } - if (has_scale_out) *has_scale_out = active; - return scale; -} - Matrix3d BeltTransformPipeline::build_rotation_matrix(const PrintConfig &config, bool *has_rot_out) { BeltRotationAxis axis = config.belt_slice_rotation.value; @@ -116,26 +72,13 @@ Matrix3d BeltTransformPipeline::build_rotation_matrix(const PrintConfig &config, Transform3d BeltTransformPipeline::build_forward_transform(const PrintConfig &config) { - Transform3d pre_remap = build_preslice_remap(config); - bool shear_active = false; - Matrix3d shear = build_shear_matrix(config, &shear_active); - bool scale_active = false; - Matrix3d scale = build_scale_matrix(config, &scale_active); - bool rot_active = false; - Matrix3d rot = build_rotation_matrix(config, &rot_active); - - // Match the mesh-side ordering selected by belt_mesh_transform_order so - // BeltBackTransform inverts the same composition that BeltSliceStrategy - // applied to the mesh. - // ScaleThenShear: applied to p, scale runs first then shear (shear * scale). - // ShearThenScale: applied to p, shear runs first then scale (scale * shear). - // Rotation is applied AFTER shear/scale: rot * shear_scale * pre_remap. - Matrix3d shear_scale = (config.belt_mesh_transform_order.value == BeltTransformOrder::ScaleThenShear) - ? Matrix3d(shear * scale) - : Matrix3d(scale * shear); + // Mesh-side belt transform: rotation applied after the pre-slice axis remap. + // (Shear & scale are a g-code-side stage, not part of the mesh transform.) + Transform3d pre_remap = build_preslice_remap(config); + Matrix3d rot = build_rotation_matrix(config); Transform3d combined = Transform3d::Identity(); - combined.linear() = Matrix3d(rot * shear_scale); + combined.linear() = rot; combined = combined * pre_remap; return combined; } @@ -190,166 +133,75 @@ BeltTransformPipeline::BeltHeightResult compute_belt_height_and_floor_impl( BeltTransformPipeline::BeltHeightResult result; result.object_height = original_height; - // Extract Z-axis shear/scale + per-axis scale + transform order + rotation from config. - BeltShearMode z_shear_mode; - double z_shear_angle; - BeltScaleMode z_scale_mode; - double z_scale_angle; - int z_shear_from; - BeltScaleMode from_scale_mode; // scale on the shear's source axis - double from_scale_angle; - BeltTransformOrder order; - BeltRotationAxis rot_axis; - double rot_angle; + // Extract the mesh rotation from config (the sole mesh-side belt transform). + BeltRotationAxis rot_axis; + double rot_angle; if constexpr (std::is_same_v) { - z_shear_mode = config.belt_shear_z.value; - z_shear_angle = config.belt_shear_z_angle.value; - z_scale_mode = config.belt_scale_z.value; - z_scale_angle = config.belt_scale_z_angle.value; - z_shear_from = int(config.belt_shear_z_from.value); - order = config.belt_mesh_transform_order.value; - rot_axis = config.belt_slice_rotation.value; - rot_angle = config.belt_slice_rotation_angle.value; - if (z_shear_from == 0) { - from_scale_mode = config.belt_scale_x.value; - from_scale_angle = config.belt_scale_x_angle.value; - } else { - from_scale_mode = config.belt_scale_y.value; - from_scale_angle = config.belt_scale_y_angle.value; - } + rot_axis = config.belt_slice_rotation.value; + rot_angle = config.belt_slice_rotation_angle.value; } else { // DynamicPrintConfig path - auto get_shear = [&](const char *key) { - auto *opt = config.template option>(key); - return opt ? opt->value : BeltShearMode::None; - }; - auto get_scale = [&](const char *key) { - auto *opt = config.template option>(key); - return opt ? opt->value : BeltScaleMode::None; - }; auto get_float = [&](const char *key) { auto *opt = config.template option(key); - return opt ? opt->value : 45.0; - }; - auto get_axis = [&](const char *key) { - auto *opt = config.template option>(key); - return opt ? int(opt->value) : 1; - }; - auto get_order = [&](const char *key) { - auto *opt = config.template option>(key); - return opt ? opt->value : BeltTransformOrder::ScaleThenShear; + return opt ? opt->value : 0.0; }; auto get_rot_axis = [&](const char *key) { auto *opt = config.template option>(key); return opt ? opt->value : BeltRotationAxis::None; }; - z_shear_mode = get_shear("belt_shear_z"); - z_shear_angle = get_float("belt_shear_z_angle"); - z_scale_mode = get_scale("belt_scale_z"); - z_scale_angle = get_float("belt_scale_z_angle"); - z_shear_from = get_axis("belt_shear_z_from"); - order = get_order("belt_mesh_transform_order"); - rot_axis = get_rot_axis("belt_slice_rotation"); - rot_angle = get_float("belt_slice_rotation_angle"); - if (z_shear_from == 0) { - from_scale_mode = get_scale("belt_scale_x"); - from_scale_angle = get_float("belt_scale_x_angle"); - } else { - from_scale_mode = get_scale("belt_scale_y"); - from_scale_angle = get_float("belt_scale_y_angle"); - } + rot_axis = get_rot_axis("belt_slice_rotation"); + rot_angle = get_float("belt_slice_rotation_angle"); } - bool has_z_shear = z_shear_mode != BeltShearMode::None; - bool has_z_scale = z_scale_mode != BeltScaleMode::None; bool has_rotation = rot_axis != BeltRotationAxis::None && std::abs(rot_angle) > EPSILON; - - if (!has_z_shear && !has_z_scale && !has_rotation) + if (!has_rotation) return result; - double shear_factor = has_z_shear - ? BeltTransformPipeline::compute_shear_factor(z_shear_mode, z_shear_angle) : 0.; - double scale_z = BeltTransformPipeline::compute_scale_factor(z_scale_mode, z_scale_angle); - double scale_from = BeltTransformPipeline::compute_scale_factor(from_scale_mode, from_scale_angle); - - if (has_z_shear && std::abs(shear_factor) > EPSILON) { - int from = z_shear_from; - double min_rz = std::numeric_limits::max(); - double max_rz = std::numeric_limits::lowest(); - for (double vz : {bb.min.z(), bb.max.z()}) - for (double vs : {bb.min(from), bb.max(from)}) { - // Mesh-frame new_z computed per ordering. - // scale-then-shear: Z_s = sz*Z_m + s_from*tan(α)*from_m - // shear-then-scale: Z_s = sz*(Z_m + tan(α)*from_m) - double new_z = (order == BeltTransformOrder::ScaleThenShear) - ? scale_z * vz + scale_from * shear_factor * vs - : scale_z * (vz + shear_factor * vs); - min_rz = std::min(min_rz, new_z); - max_rz = std::max(max_rz, new_z); - } - result.object_height = max_rz - min_rz; - // Effective slicer-frame slope of the belt surface (Z_m=0 line): - // scale-then-shear: Z_s = tan(α) * Y_s → slope = tan(α) - // shear-then-scale: Z_s = sz/s_from * tan(α) * Y_s → slope = sz*tan(α)/s_from - // The downstream cutoff formula `Y_s = (print_z - z_shift) / slope` - // and floor_print_z(Y_s) = slope * Y_s + z_shift use this slope. - double effective_shear = (order == BeltTransformOrder::ScaleThenShear) - ? shear_factor - : (std::abs(scale_from) > EPSILON - ? scale_z * shear_factor / scale_from - : shear_factor); - result.floor_params.shear_factor = effective_shear; - result.floor_params.from_axis = from; - result.floor_params.z_shift = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); - } else if (has_rotation) { - // Rotation-only path (no Z-shear): sweep 8 bbox corners through R. - double angle_rad = Geometry::deg2rad(rot_angle); - Vec3d unit_axis; - switch (rot_axis) { - case BeltRotationAxis::X: unit_axis = Vec3d::UnitX(); break; - case BeltRotationAxis::Y: unit_axis = Vec3d::UnitY(); break; - case BeltRotationAxis::Z: unit_axis = Vec3d::UnitZ(); break; - default: unit_axis = Vec3d::UnitX(); break; - } - Matrix3d R = Eigen::AngleAxisd(angle_rad, unit_axis).toRotationMatrix(); - double min_rz = std::numeric_limits::max(); - double max_rz = std::numeric_limits::lowest(); - for (int i = 0; i < 8; ++i) { - Vec3d c((i & 1) ? bb.max.x() : bb.min.x(), - (i & 2) ? bb.max.y() : bb.min.y(), - (i & 4) ? bb.max.z() : bb.min.z()); - double z = (R * c).z(); - min_rz = std::min(min_rz, z); - max_rz = std::max(max_rz, z); - } - // Optional Z-scale still applies multiplicatively if both are set. - result.object_height = (max_rz - min_rz) * (has_z_scale ? scale_z : 1.0); - - // Belt floor in slicer-frame is the image of z_machine = 0 under R. - // R(+α, X): point (·, y, 0) → (·, cos α · y, sin α · y) ⇒ z = tan(α) · y_s - // R(+α, Y): point (x, ·, 0) → (cos α · x, ·, -sin α · x) ⇒ z = -tan(α) · x_s - // R(+α, Z): point (·, ·, 0) → (·, ·, 0); no tilt → no floor - double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); - switch (rot_axis) { - case BeltRotationAxis::X: - result.floor_params.shear_factor = (std::abs(cos_a) > EPSILON) ? sin_a / cos_a : 0.; - result.floor_params.from_axis = 1; // Y - break; - case BeltRotationAxis::Y: - result.floor_params.shear_factor = (std::abs(cos_a) > EPSILON) ? -sin_a / cos_a : 0.; - result.floor_params.from_axis = 0; // X - break; - case BeltRotationAxis::Z: - default: - result.floor_params.shear_factor = 0.0; - result.floor_params.from_axis = 1; - break; - } - result.floor_params.z_shift = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); - } else { - result.object_height = original_height * scale_z; + // Rotation path: sweep the 8 bbox corners through R to get the rotated height, + // then derive the belt floor (the image of machine-Z = 0 under R). + double angle_rad = Geometry::deg2rad(rot_angle); + Vec3d unit_axis; + switch (rot_axis) { + case BeltRotationAxis::X: unit_axis = Vec3d::UnitX(); break; + case BeltRotationAxis::Y: unit_axis = Vec3d::UnitY(); break; + case BeltRotationAxis::Z: unit_axis = Vec3d::UnitZ(); break; + default: unit_axis = Vec3d::UnitX(); break; } + Matrix3d R = Eigen::AngleAxisd(angle_rad, unit_axis).toRotationMatrix(); + double min_rz = std::numeric_limits::max(); + double max_rz = std::numeric_limits::lowest(); + for (int i = 0; i < 8; ++i) { + Vec3d c((i & 1) ? bb.max.x() : bb.min.x(), + (i & 2) ? bb.max.y() : bb.min.y(), + (i & 4) ? bb.max.z() : bb.min.z()); + double z = (R * c).z(); + min_rz = std::min(min_rz, z); + max_rz = std::max(max_rz, z); + } + result.object_height = max_rz - min_rz; + + // Belt floor in slicer-frame is the image of z_machine = 0 under R. + // R(+α, X): point (·, y, 0) → (·, cos α · y, sin α · y) ⇒ z = tan(α) · y_s + // R(+α, Y): point (x, ·, 0) → (cos α · x, ·, -sin α · x) ⇒ z = -tan(α) · x_s + // R(+α, Z): point (·, ·, 0) → (·, ·, 0); no tilt → no floor + double sin_a = std::sin(angle_rad), cos_a = std::cos(angle_rad); + switch (rot_axis) { + case BeltRotationAxis::X: + result.floor_params.shear_factor = (std::abs(cos_a) > EPSILON) ? sin_a / cos_a : 0.; + result.floor_params.from_axis = 1; // Y + break; + case BeltRotationAxis::Y: + result.floor_params.shear_factor = (std::abs(cos_a) > EPSILON) ? -sin_a / cos_a : 0.; + result.floor_params.from_axis = 0; // X + break; + case BeltRotationAxis::Z: + default: + result.floor_params.shear_factor = 0.0; + result.floor_params.from_axis = 1; + break; + } + result.floor_params.z_shift = bb.min.z() + ((min_rz < 0.) ? -min_rz : 0.); return result; } diff --git a/src/libslic3r/BeltTransform.hpp b/src/libslic3r/BeltTransform.hpp index 1ce47a2e31..50f56bd75f 100644 --- a/src/libslic3r/BeltTransform.hpp +++ b/src/libslic3r/BeltTransform.hpp @@ -15,11 +15,16 @@ class ModelObject; // Shared belt-printer transform math. // // The pre-slice pipeline applied in PrintObjectSlice.cpp is: -// trafo_out = z_shift * scale * shear * pre_remap * trafo_in +// trafo_out = z_shift * rotation * pre_remap * trafo_in // -// This class provides the building blocks so every call site uses the -// same implementation. z_shift is object-dependent (computed from mesh -// vertex bounds) and is NOT included in build_forward_transform(). +// Rotation is the sole mesh-side belt transform; shear & scale are applied +// to the g-code instead (see MachineFrameTransform). This class provides the +// building blocks so every call site uses the same implementation. z_shift is +// object-dependent (computed from mesh vertex bounds) and is NOT included in +// build_forward_transform(). +// +// The compute_shear_factor / compute_scale_factor math helpers below are still +// used by the g-code-side machine-frame shear/scale. class BeltTransformPipeline { public: @@ -75,50 +80,53 @@ public: get_int("preslice_remap_z") != int(RemapAxis::PosZ); } - static bool has_shear(const PrintConfig &config) - { - return config.belt_shear_x.value != BeltShearMode::None || - config.belt_shear_y.value != BeltShearMode::None || - config.belt_shear_z.value != BeltShearMode::None; - } - - static bool has_scale(const PrintConfig &config) - { - double sx = compute_scale_factor(config.belt_scale_x.value, config.belt_scale_x_angle.value); - double sy = compute_scale_factor(config.belt_scale_y.value, config.belt_scale_y_angle.value); - double sz = compute_scale_factor(config.belt_scale_z.value, config.belt_scale_z_angle.value); - return std::abs(sx - 1.) > EPSILON || - std::abs(sy - 1.) > EPSILON || - std::abs(sz - 1.) > EPSILON; - } - static bool has_rotation(const PrintConfig &config) { return config.belt_slice_rotation.value != BeltRotationAxis::None && std::abs(config.belt_slice_rotation_angle.value) > EPSILON; } + // Physical belt tilt derived from the slicing rotation — the single source of + // truth for bed rendering, support gravity tilt and the bed-exclusion + // projection. Returns the tilt magnitude in degrees split onto the X and Y + // build-plate tilt axes according to the rotation axis: + // rotation about X → tilt_x = angle (gantry tilts in the YZ plane) + // rotation about Y → tilt_y = angle (gantry tilts in the XZ plane) + // rotation about Z / None → no tilt (in-plane spin doesn't tilt the belt) + // The magnitude uses abs(angle) so a negative rotation still reports a positive + // physical tilt. + struct PhysicalTilt { double tilt_x_deg = 0.; double tilt_y_deg = 0.; }; + + static PhysicalTilt physical_tilt(BeltRotationAxis axis, double angle_deg) + { + PhysicalTilt t; + double mag = std::abs(angle_deg); + switch (axis) { + case BeltRotationAxis::X: t.tilt_x_deg = mag; break; + case BeltRotationAxis::Y: t.tilt_y_deg = mag; break; + default: break; // Z / None: no physical tilt + } + return t; + } + + static PhysicalTilt physical_tilt(const PrintConfig &config) + { + return physical_tilt(config.belt_slice_rotation.value, + config.belt_slice_rotation_angle.value); + } + // ---- Matrix builders -------------------------------------------------- // Build the pre-slice axis remap transform (includes Rev-mode translation). static Transform3d build_preslice_remap(const PrintConfig &config); - // Build the 3x3 shear matrix. Returns Identity if no shear is active. - // Also sets has_shear_out if non-null. - static Matrix3d build_shear_matrix(const PrintConfig &config, bool *has_shear_out = nullptr); - - // Build the 3x3 diagonal scale matrix. Returns Identity if no scale. - // Also sets has_scale_out if non-null. - static Matrix3d build_scale_matrix(const PrintConfig &config, bool *has_scale_out = nullptr); - // Build the 3x3 rotation matrix from belt_slice_rotation* config. // Returns Identity if rotation axis is None or angle is ~0. // Also sets has_rot_out if non-null. static Matrix3d build_rotation_matrix(const PrintConfig &config, bool *has_rot_out = nullptr); - // Combined forward transform. Shear/scale order is selected by - // belt_mesh_transform_order so the result matches what BeltSliceStrategy - // applied to the mesh (BeltBackTransform inverts this). + // Combined forward transform (rotation * pre_remap) — the mesh-side belt + // transform that BeltSliceStrategy applies and BeltBackTransform inverts. // Does NOT include the per-object Z-shift. static Transform3d build_forward_transform(const PrintConfig &config); diff --git a/src/libslic3r/FirstLayerPlane.cpp b/src/libslic3r/FirstLayerPlane.cpp index 10866c57f5..6a4feba886 100644 --- a/src/libslic3r/FirstLayerPlane.cpp +++ b/src/libslic3r/FirstLayerPlane.cpp @@ -85,9 +85,8 @@ FirstLayerPlane::FirstLayerPlane(const PrintConfig &config) FirstLayerPlaneMode mode = config.first_layer_plane.value; if (mode == FirstLayerPlaneMode::Auto) { bool belt_affine_active = config.belt_printer.value && - (config.belt_shear_z.value != BeltShearMode::None || - (config.belt_slice_rotation.value != BeltRotationAxis::None && - std::abs(config.belt_slice_rotation_angle.value) > EPSILON)); + config.belt_slice_rotation.value != BeltRotationAxis::None && + std::abs(config.belt_slice_rotation_angle.value) > EPSILON; mode = belt_affine_active ? FirstLayerPlaneMode::BeltAffine : FirstLayerPlaneMode::XY; } diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 047d00250c..2ad11a710d 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -6520,14 +6520,14 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, auto _mm3_per_mm = path.mm3_per_mm * this->config().print_flow_ratio; _mm3_per_mm *= filament_flow_ratio; - // Belt printer: compensate for the volume change introduced by the mesh + // Belt printer: compensate for any volume change introduced by the mesh // forward transform. path.mm3_per_mm is derived from slicer-frame layer // height × line width, but a slicer-frame slab of volume V maps under the - // back-transform to a machine-frame region of volume V / |det(T)|. When - // det(T) > 1 — e.g. belt_scale_y = 1/cos(α) ≈ 1.155 at α = 30° — the - // machine slab holds less plastic than the slicer thinks it is filling - // and we over-extrude by det(T). Pure shear has det 1, so this is a - // no-op until scale factors deviate from 1. + // back-transform to a machine-frame region of volume V / |det(T)|. The + // mesh transform is now rotation ∘ pre-remap, both orthogonal, so |det(T)| + // is always 1 and this is currently a no-op; it is retained as a guard in + // case a non-orthogonal mesh transform is ever reintroduced. (Machine-frame + // shear/scale acts on the g-code in BeltGCodeWriter, not here.) if (m_config.belt_printer.value) { double det = std::abs(BeltTransformPipeline::build_forward_transform(m_config).linear().determinant()); if (det > EPSILON) diff --git a/src/libslic3r/GCode/BeltBackTransform.cpp b/src/libslic3r/GCode/BeltBackTransform.cpp index 654afe6262..6a25bbd408 100644 --- a/src/libslic3r/GCode/BeltBackTransform.cpp +++ b/src/libslic3r/GCode/BeltBackTransform.cpp @@ -12,18 +12,15 @@ bool BeltBackTransform::init_from_config(const PrintConfig &config) return false; // Require at least one active transform to proceed. - bool has_global_shear = config.belt_shear_x_global.value || - config.belt_shear_y_global.value || - config.belt_shear_z_global.value; bool has_global_rotation = config.belt_slice_rotation_global.value && config.belt_slice_rotation.value != BeltRotationAxis::None; bool has_preslice_global = config.belt_preslice_global.value || config.preslice_remap_global.value; - if (!has_global_shear && !has_global_rotation && !has_preslice_global + if (!has_global_rotation && !has_preslice_global && !BeltTransformPipeline::has_preslice_remap(config)) return false; - // Build the forward pipeline (scale * shear * pre_remap) and store its inverse. + // Build the forward pipeline (rotation * pre_remap) and store its inverse. Transform3d forward = BeltTransformPipeline::build_forward_transform(config); if (forward.isApprox(Transform3d::Identity())) return false; diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index d9fc8bc992..7df84ade84 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3072,90 +3072,21 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers return; } - // Belt printer angle detection from G-code header comment. - if (boost::starts_with(comment, " belt_printer_angle = ")) { + // Belt printer: derive the physical tilt magnitude from the slicing-rotation + // angle header comment (used to enable the preview's belt view). + if (boost::starts_with(comment, " belt_slice_rotation_angle = ")) { try { - m_result.belt_printer_angle = std::stof(std::string(comment.substr(22))); + m_result.belt_tilt_angle = std::abs(std::stof(std::string(comment.substr(29)))); } catch (...) {} return; } - // Belt printer: parse shear configs from header comments. + // Belt printer: parse pre-slice axis remap from header comments. { - auto parse_shear_mode = [](const std::string &s) -> BeltShearMode { - if (s == "pos_cot") return BeltShearMode::PosCot; - if (s == "neg_cot") return BeltShearMode::NegCot; - if (s == "pos_tan") return BeltShearMode::PosTan; - if (s == "neg_tan") return BeltShearMode::NegTan; - return BeltShearMode::None; - }; - auto parse_axis = [](const std::string &s) -> BeltAxis { - if (s == "y") return BeltAxis::Y; - if (s == "z") return BeltAxis::Z; - return BeltAxis::X; - }; - auto parse_scale_mode = [](const std::string &s) -> BeltScaleMode { - if (s == "inv_sin") return BeltScaleMode::InvSin; - if (s == "inv_cos") return BeltScaleMode::InvCos; - if (s == "sin") return BeltScaleMode::Sin; - if (s == "cos") return BeltScaleMode::Cos; - return BeltScaleMode::None; - }; auto trim = [](const std::string &s) -> std::string { size_t start = s.find_first_not_of(" \t\r\n"); size_t end = s.find_last_not_of(" \t\r\n"); return (start == std::string::npos) ? "" : s.substr(start, end - start + 1); }; - // Shear X - if (boost::starts_with(comment, " belt_shear_x = ")) { - m_result.belt_shear_x = parse_shear_mode(trim(std::string(comment.substr(16)))); return; - } - if (boost::starts_with(comment, " belt_shear_x_angle = ")) { - try { m_result.belt_shear_x_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; - } - if (boost::starts_with(comment, " belt_shear_x_from = ")) { - m_result.belt_shear_x_from = parse_axis(trim(std::string(comment.substr(21)))); return; - } - // Shear Y - if (boost::starts_with(comment, " belt_shear_y = ")) { - m_result.belt_shear_y = parse_shear_mode(trim(std::string(comment.substr(16)))); return; - } - if (boost::starts_with(comment, " belt_shear_y_angle = ")) { - try { m_result.belt_shear_y_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; - } - if (boost::starts_with(comment, " belt_shear_y_from = ")) { - m_result.belt_shear_y_from = parse_axis(trim(std::string(comment.substr(21)))); return; - } - // Shear Z - if (boost::starts_with(comment, " belt_shear_z = ")) { - m_result.belt_shear_z = parse_shear_mode(trim(std::string(comment.substr(16)))); return; - } - if (boost::starts_with(comment, " belt_shear_z_angle = ")) { - try { m_result.belt_shear_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; - } - if (boost::starts_with(comment, " belt_shear_z_from = ")) { - m_result.belt_shear_z_from = parse_axis(trim(std::string(comment.substr(21)))); return; - } - // Scale X - if (boost::starts_with(comment, " belt_scale_x = ")) { - m_result.belt_scale_x = parse_scale_mode(trim(std::string(comment.substr(16)))); return; - } - if (boost::starts_with(comment, " belt_scale_x_angle = ")) { - try { m_result.belt_scale_x_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; - } - // Scale Y - if (boost::starts_with(comment, " belt_scale_y = ")) { - m_result.belt_scale_y = parse_scale_mode(trim(std::string(comment.substr(16)))); return; - } - if (boost::starts_with(comment, " belt_scale_y_angle = ")) { - try { m_result.belt_scale_y_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; - } - // Scale Z - if (boost::starts_with(comment, " belt_scale_z = ")) { - m_result.belt_scale_z = parse_scale_mode(trim(std::string(comment.substr(16)))); return; - } - if (boost::starts_with(comment, " belt_scale_z_angle = ")) { - try { m_result.belt_scale_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return; - } // Pre-slice axis remap auto parse_remap_axis = [](const std::string &s) -> RemapAxis { if (s == "pos_x") return RemapAxis::PosX; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 4e5bb5b746..3047c005ed 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -245,25 +245,9 @@ class Print; bool support_traditional_timelapse{true}; float printable_height; float z_offset; - // Belt printer: angle for coordinate transformation in preview. - float belt_printer_angle{ 0.f }; - // Belt printer: per-axis shear config. - BeltShearMode belt_shear_x{ BeltShearMode::None }; - float belt_shear_x_angle{ 45.f }; - BeltAxis belt_shear_x_from{ BeltAxis::Y }; - BeltShearMode belt_shear_y{ BeltShearMode::None }; - float belt_shear_y_angle{ 45.f }; - BeltAxis belt_shear_y_from{ BeltAxis::Y }; - BeltShearMode belt_shear_z{ BeltShearMode::None }; - float belt_shear_z_angle{ 45.f }; - BeltAxis belt_shear_z_from{ BeltAxis::Y }; - // Belt printer: per-axis scale config. - BeltScaleMode belt_scale_x{ BeltScaleMode::None }; - float belt_scale_x_angle{ 45.f }; - BeltScaleMode belt_scale_y{ BeltScaleMode::None }; - float belt_scale_y_angle{ 45.f }; - BeltScaleMode belt_scale_z{ BeltScaleMode::None }; - float belt_scale_z_angle{ 45.f }; + // Belt printer: physical tilt magnitude (deg) parsed from the slicing-rotation + // header comment; used to enable the preview's belt view. + float belt_tilt_angle{ 0.f }; RemapAxis preslice_remap_x{ RemapAxis::PosX }; RemapAxis preslice_remap_y{ RemapAxis::PosY }; RemapAxis preslice_remap_z{ RemapAxis::PosZ }; @@ -332,22 +316,7 @@ class Print; optimal_assignment = other.optimal_assignment; filament_change_count_map = other.filament_change_count_map; initial_layer_time = other.initial_layer_time; - belt_printer_angle = other.belt_printer_angle; - belt_shear_x = other.belt_shear_x; - belt_shear_x_angle = other.belt_shear_x_angle; - belt_shear_x_from = other.belt_shear_x_from; - belt_shear_y = other.belt_shear_y; - belt_shear_y_angle = other.belt_shear_y_angle; - belt_shear_y_from = other.belt_shear_y_from; - belt_shear_z = other.belt_shear_z; - belt_shear_z_angle = other.belt_shear_z_angle; - belt_shear_z_from = other.belt_shear_z_from; - belt_scale_x = other.belt_scale_x; - belt_scale_x_angle = other.belt_scale_x_angle; - belt_scale_y = other.belt_scale_y; - belt_scale_y_angle = other.belt_scale_y_angle; - belt_scale_z = other.belt_scale_z; - belt_scale_z_angle = other.belt_scale_z_angle; + belt_tilt_angle = other.belt_tilt_angle; preslice_remap_x = other.preslice_remap_x; preslice_remap_y = other.preslice_remap_y; preslice_remap_z = other.preslice_remap_z; diff --git a/src/libslic3r/GCode/MachineFrameTransform.cpp b/src/libslic3r/GCode/MachineFrameTransform.cpp index 10a658c7f7..03f74605fe 100644 --- a/src/libslic3r/GCode/MachineFrameTransform.cpp +++ b/src/libslic3r/GCode/MachineFrameTransform.cpp @@ -6,50 +6,6 @@ namespace Slic3r { namespace { -// Build the post-gcode axis-remap transform (mirrors BeltTransformPipeline::build_preslice_remap -// but reads post_gcode_remap_* keys). Includes Rev-mode translation derived from build volume. -Transform3d build_post_gcode_remap(const PrintConfig &config) -{ - Transform3d remap = Transform3d::Identity(); - - int rx = int(config.post_gcode_remap_x.value); - int ry = int(config.post_gcode_remap_y.value); - int rz = int(config.post_gcode_remap_z.value); - - if (rx == int(RemapAxis::PosX) && ry == int(RemapAxis::PosY) && rz == int(RemapAxis::PosZ)) - return remap; - - auto remap_column = [](int r) -> Vec3d { - int axis = r % 3; - Vec3d col = Vec3d::Zero(); - if (r < 3) col[axis] = 1.0; - else if (r < 6) col[axis] = -1.0; - else col[axis] = -1.0; // Rev: max - pos - return col; - }; - - Matrix3d lin; - lin.col(0) = remap_column(rx); - lin.col(1) = remap_column(ry); - lin.col(2) = remap_column(rz); - remap.linear() = lin; - - if (rx >= 6 || ry >= 6 || rz >= 6) { - BoundingBoxf bbox_bed(config.printable_area.values); - Vec3d vol_max(bbox_bed.max.x(), bbox_bed.max.y(), config.printable_height.value); - Vec3d trans = Vec3d::Zero(); - auto add_rev = [&](int r, int out) { - if (r >= 6) trans[out] = vol_max[r % 3]; - }; - add_rev(rx, 0); - add_rev(ry, 1); - add_rev(rz, 2); - remap.translation() = trans; - } - - return remap; -} - // Build the 3x3 shear matrix from gcode_shear_* keys. Matrix3d build_gcode_shear_matrix(const PrintConfig &config, bool &active) { @@ -94,13 +50,6 @@ Matrix3d build_gcode_scale_matrix(const PrintConfig &config, bool &active) return scale; } -bool has_post_gcode_remap(const PrintConfig &config) -{ - return int(config.post_gcode_remap_x.value) != int(RemapAxis::PosX) || - int(config.post_gcode_remap_y.value) != int(RemapAxis::PosY) || - int(config.post_gcode_remap_z.value) != int(RemapAxis::PosZ); -} - } // namespace bool MachineFrameTransform::init_from_config(const PrintConfig &config) @@ -111,13 +60,12 @@ bool MachineFrameTransform::init_from_config(const PrintConfig &config) if (!config.belt_printer.value) return false; - Transform3d post_remap = build_post_gcode_remap(config); bool shear_active = false; Matrix3d shear = build_gcode_shear_matrix(config, shear_active); bool scale_active = false; Matrix3d scale = build_gcode_scale_matrix(config, scale_active); - if (!shear_active && !scale_active && !has_post_gcode_remap(config)) + if (!shear_active && !scale_active) return false; // Compose per belt_gcode_transform_order: @@ -127,7 +75,6 @@ bool MachineFrameTransform::init_from_config(const PrintConfig &config) combined.linear() = (config.belt_gcode_transform_order.value == BeltTransformOrder::ScaleThenShear) ? Matrix3d(shear * scale) : Matrix3d(scale * shear); - combined = combined * post_remap; if (combined.isApprox(Transform3d::Identity())) return false; diff --git a/src/libslic3r/GCode/MachineFrameTransform.hpp b/src/libslic3r/GCode/MachineFrameTransform.hpp index 4a2f189802..9fa25b2323 100644 --- a/src/libslic3r/GCode/MachineFrameTransform.hpp +++ b/src/libslic3r/GCode/MachineFrameTransform.hpp @@ -9,15 +9,14 @@ namespace Slic3r { // Post-stage machine-frame transform for belt printers. // -// Applied in BeltGCodeWriter::to_machine_coords AFTER the back-transform -// and the existing gcode_remap_* axis remap, and BEFORE per-axis origin snap. -// Maps Cartesian (axis-permuted) G-code coordinates into the printer's -// physical machine frame using a parallel set of options: +// Applied in BeltGCodeWriter::to_machine_coords AFTER the back-transform, +// the gcode_remap_* axis remap and per-axis origin snap. Maps Cartesian +// (axis-permuted) G-code coordinates into the printer's physical machine +// frame using: // gcode_shear_x/y/z + _angle + _from // gcode_scale_x/y/z + _angle -// post_gcode_remap_x/y/z // -// Composition matches the mesh-side pipeline: shear * scale * post_remap. +// Composition follows belt_gcode_transform_order (shear * scale or scale * shear). class MachineFrameTransform { public: @@ -25,7 +24,7 @@ public: // Initialize from belt printer config. Returns true if a non-identity // transform was computed. Inactive when belt_printer is disabled or - // all three sub-stages are identity. + // both shear and scale are identity. bool init_from_config(const PrintConfig &config); // Apply the transform to a point. Returns pos unchanged if not active. diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index fab3e963a7..05bdb2f262 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1318,12 +1318,8 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", - "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_angle", "belt_printer_infinite_y", "belt_shear_x", "belt_shear_x_angle", "belt_shear_x_from", "belt_shear_x_global", - "belt_shear_y", "belt_shear_y_angle", "belt_shear_y_from", "belt_shear_y_global", - "belt_shear_z", "belt_shear_z_angle", "belt_shear_z_from", "belt_shear_z_global", - "belt_scale_x", "belt_scale_x_angle", "belt_scale_y", "belt_scale_y_angle", "belt_scale_z", "belt_scale_z_angle", + "printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_infinite_y", "belt_slice_rotation", "belt_slice_rotation_angle", "belt_slice_rotation_global", - "belt_mesh_transform_order", "preslice_remap_x", "preslice_remap_y", "preslice_remap_z", "preslice_remap_global", "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", "gcode_back_transform", "gcode_shear_x", "gcode_shear_x_angle", "gcode_shear_x_from", @@ -1333,7 +1329,6 @@ static std::vector s_Preset_printer_options { "gcode_scale_y", "gcode_scale_y_angle", "gcode_scale_z", "gcode_scale_z_angle", "belt_gcode_transform_order", - "post_gcode_remap_x", "post_gcode_remap_y", "post_gcode_remap_z", "belt_preslice_global", "first_layer_plane", "first_layer_plane_offset", "first_layer_plane_thickness", "belt_origin_snap_x", "belt_origin_offset_x", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index c45334f95e..32f43052af 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -112,7 +112,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "gcode_scale_y", "gcode_scale_y_angle", "gcode_scale_z", "gcode_scale_z_angle", "belt_gcode_transform_order", - "post_gcode_remap_x", "post_gcode_remap_y", "post_gcode_remap_z", "belt_origin_snap_x", "belt_origin_offset_x", "belt_origin_snap_y", "belt_origin_offset_y", "belt_origin_snap_z", "belt_origin_offset_z", @@ -301,26 +300,9 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "build_plate_tilt_y" // Belt printer transform options change the mesh geometry before slicing. || opt_key == "belt_printer" - || opt_key == "belt_printer_angle" - || opt_key == "belt_shear_x" - || opt_key == "belt_shear_x_angle" - || opt_key == "belt_shear_x_from" - || opt_key == "belt_shear_x_global" - || opt_key == "belt_shear_y" - || opt_key == "belt_shear_y_angle" - || opt_key == "belt_shear_y_from" - || opt_key == "belt_shear_y_global" - || opt_key == "belt_shear_z" - || opt_key == "belt_shear_z_angle" - || opt_key == "belt_shear_z_from" - || opt_key == "belt_shear_z_global" - || opt_key == "belt_scale_x" - || opt_key == "belt_scale_x_angle" - || opt_key == "belt_scale_y" - || opt_key == "belt_scale_y_angle" - || opt_key == "belt_scale_z" - || opt_key == "belt_scale_z_angle" - || opt_key == "belt_mesh_transform_order" + || opt_key == "belt_slice_rotation" + || opt_key == "belt_slice_rotation_angle" + || opt_key == "belt_slice_rotation_global" || opt_key == "belt_preslice_global" || opt_key == "preslice_remap_global" || opt_key == "preslice_remap_x" @@ -2284,10 +2266,13 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) int object_count = m_objects.size(); std::set need_slicing_objects; std::set re_slicing_objects; - // Belt global Z shear: each object needs unique layer Z values based on - // its bed position, so sharing layers between "identical" objects is wrong. - bool belt_no_share = m_config.belt_printer.value && m_config.belt_shear_z_global.value - && m_config.belt_shear_z.value != BeltShearMode::None; + // Belt global modes couple each object's bed position into its layer Z values, + // so sharing layers between "identical" objects is wrong. + bool belt_no_share = m_config.belt_printer.value && + ((m_config.belt_slice_rotation_global.value + && m_config.belt_slice_rotation.value != BeltRotationAxis::None) + || m_config.preslice_remap_global.value + || m_config.belt_preslice_global.value); if (!use_cache) { for (int index = 0; index < object_count; index++) { diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index b883b474be..3dddcc40dd 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -1537,8 +1537,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ // Belt global mode: force each instance into its own PrintObject // so each gets independent layer Z values. bool belt_force_separate = m_config.belt_printer.value && ( - (m_config.belt_shear_z_global.value && m_config.belt_shear_z.value != BeltShearMode::None) - || (m_config.belt_slice_rotation_global.value + (m_config.belt_slice_rotation_global.value && m_config.belt_slice_rotation.value != BeltRotationAxis::None && std::abs(m_config.belt_slice_rotation_angle.value) > EPSILON) || m_config.belt_preslice_global.value @@ -1633,8 +1632,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ // min_shift across all objects, so one move affects everyone). if (belt_instances_shifted && m_config.belt_printer.value - && ((m_config.belt_shear_z_global.value && m_config.belt_shear_z.value != BeltShearMode::None) - || (m_config.belt_slice_rotation_global.value + && ((m_config.belt_slice_rotation_global.value && m_config.belt_slice_rotation.value != BeltRotationAxis::None && std::abs(m_config.belt_slice_rotation_angle.value) > EPSILON) || m_config.belt_preslice_global.value diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 8ee2350487..5c33692db0 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1,5 +1,6 @@ #include "PrintConfig.hpp" #include "PrintConfigConstants.hpp" +#include "BeltTransform.hpp" #include "ClipperUtils.hpp" #include "Config.hpp" #include "Geometry.hpp" @@ -6388,18 +6389,6 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(false)); - def = this->add("belt_printer_angle", coFloat); - def->label = L("Belt angle"); - def->category = L("Printable space"); - def->tooltip = L("The tilt angle of the belt surface in degrees. " - "Most belt printers use a 45-degree angle. " - "This controls the rotation applied to the slicing plane and G-code coordinates."); - def->sidetext = u8"\u00B0"; - def->min = 0; - def->max = 90; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(45.)); - def = this->add("belt_printer_infinite_y", coBool); def->label = L("Infinite Y axis"); def->category = L("Printable space"); @@ -6409,134 +6398,42 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(true)); - // Per-axis shear controls for belt printer - auto add_belt_shear_mode = [this](const char *key, const char *label, BeltShearMode default_mode, - ConfigOptionMode mode = comAdvanced) { - auto def = this->add(key, coEnum); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L("Shear function applied to this axis in belt printer mode."); - def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); - def->enum_values = {"none", "pos_cot", "neg_cot", "pos_tan", "neg_tan"}; - def->enum_labels = {L("None"), L("+cot(α)"), L("-cot(α)"), L("+tan(α)"), L("-tan(α)")}; - def->mode = mode; - def->set_default_value(new ConfigOptionEnum(default_mode)); - }; - auto add_belt_shear_angle = [this](const char *key, const char *label, - ConfigOptionMode mode = comAdvanced) { - auto def = this->add(key, coFloat); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L("Angle (degrees) for the shear function on this axis."); - def->sidetext = L("°"); - def->min = 0.1; - def->max = 89.9; - def->mode = mode; - def->set_default_value(new ConfigOptionFloat(45)); - }; - auto add_belt_axis_enum = [this](const char *key, const char *label, const char *tooltip, - BeltAxis default_axis, ConfigOptionMode mode = comAdvanced) { - auto def = this->add(key, coEnum); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L(tooltip); - def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); - def->enum_values = {"x", "y", "z"}; - def->enum_labels = {L("X"), L("Y"), L("Z")}; - def->mode = mode; - def->set_default_value(new ConfigOptionEnum(default_axis)); - }; - - auto add_belt_shear_global = [this](const char *key, const char *label, bool default_val = false) { - auto def = this->add(key, coBool); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L("Apply shear in global coordinates (position-aware) rather than object-local coordinates."); - def->mode = comExpert; - def->set_default_value(new ConfigOptionBool(default_val)); - }; - - add_belt_shear_mode ("belt_shear_x", "Function", BeltShearMode::None, comExpert); - add_belt_shear_angle("belt_shear_x_angle", "Angle", comExpert); - add_belt_axis_enum ("belt_shear_x_from", "From", "Source axis for X shear.", BeltAxis::Z, comExpert); - add_belt_shear_global("belt_shear_x_global", "Global"); - - add_belt_shear_mode ("belt_shear_y", "Function", BeltShearMode::None, comExpert); - add_belt_shear_angle("belt_shear_y_angle", "Angle", comExpert); - add_belt_axis_enum ("belt_shear_y_from", "From", "Source axis for Y shear.", BeltAxis::Z, comExpert); - add_belt_shear_global("belt_shear_y_global", "Global"); - - add_belt_shear_mode ("belt_shear_z", "Function", BeltShearMode::None, comExpert); - add_belt_shear_angle("belt_shear_z_angle", "Angle", comExpert); - add_belt_axis_enum ("belt_shear_z_from", "From", "Source axis for Z shear.", BeltAxis::Y, comExpert); - add_belt_shear_global("belt_shear_z_global", "Global", true); - - // Per-axis scale controls for belt printer - auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode, - ConfigOptionMode mode = comAdvanced) { - auto def = this->add(key, coEnum); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L("Scale factor applied to this axis in belt printer mode."); - def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); - def->enum_values = {"none", "inv_sin", "inv_cos", "sin", "cos"}; - def->enum_labels = {L("None"), L("1/sin(α)"), L("1/cos(α)"), L("sin(α)"), L("cos(α)")}; - def->mode = mode; - def->set_default_value(new ConfigOptionEnum(default_mode)); - }; - auto add_belt_scale_angle = [this](const char *key, const char *label, - ConfigOptionMode mode = comAdvanced) { - auto def = this->add(key, coFloat); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L("Angle (degrees) for the scale function on this axis."); - def->sidetext = L("°"); - def->min = 0.1; - def->max = 89.9; - def->mode = mode; - def->set_default_value(new ConfigOptionFloat(45)); - }; - - add_belt_scale_mode ("belt_scale_x", "Function", BeltScaleMode::None, comExpert); - add_belt_scale_angle("belt_scale_x_angle", "Angle", comExpert); - - add_belt_scale_mode ("belt_scale_y", "Function", BeltScaleMode::None, comExpert); - add_belt_scale_angle("belt_scale_y_angle", "Angle", comExpert); - - add_belt_scale_mode ("belt_scale_z", "Function", BeltScaleMode::None, comExpert); - add_belt_scale_angle("belt_scale_z_angle", "Angle", comExpert); - - // Global slicing rotation (alternative to per-axis shear+scale). + // Mesh rotation applied before slicing — the sole mesh-side belt transform AND + // the single source of truth for the physical belt tilt (bed rendering, support + // gravity tilt and bed-exclusion projection all derive their angle from this). def = this->add("belt_slice_rotation", coEnum); - def->label = L("Slicing rotation axis"); + def->label = L("Belt tilt axis"); def->category = L("Printable space"); - def->tooltip = L("Rotate the mesh by this axis before slicing. Use this for an " - "isometric (no shear distortion) belt slicing transform. " - "Mutually exclusive with the per-axis shear/scale controls " - "in the UI; the pipeline composes them if both are set in JSON."); + def->tooltip = L("Axis the mesh is rotated about before slicing. This is the belt " + "printer's tilt: an isometric (no distortion) rotation that also " + "drives bed rendering and support gravity tilt, and that the g-code " + "back-transform inverts before the machine-frame shear/scale and remap. " + "X is the typical gantry tilt (belt travels along Y)."); def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values = {"none", "x", "y", "z"}; def->enum_labels = {L("None"), L("X"), L("Y"), L("Z")}; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionEnum(BeltRotationAxis::None)); + def->set_default_value(new ConfigOptionEnum(BeltRotationAxis::X)); def = this->add("belt_slice_rotation_angle", coFloat); - def->label = L("Slicing rotation angle"); + def->label = L("Belt tilt angle"); def->category = L("Printable space"); - def->tooltip = L("Magnitude of the slicing rotation, in degrees. Positive values " - "rotate counter-clockwise looking down the positive axis."); + def->tooltip = L("Tilt angle of the belt surface, in degrees. Most belt printers use " + "45°. Positive values rotate counter-clockwise looking down the " + "positive tilt axis; the magnitude is also the physical belt tilt " + "used for bed rendering and support gravity."); def->sidetext = L("°"); def->min = -180.; def->max = 180.; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloat(0.)); + def->set_default_value(new ConfigOptionFloat(45.)); def = this->add("belt_slice_rotation_global", coBool); def->label = L("Global"); def->category = L("Printable space"); def->tooltip = L("Treat the slicing rotation as part of the global forward transform " "that BeltBackTransform inverts before the machine-frame remap. " - "Required for rotation-mode belt printers; mirrors belt_shear_z_global. " + "Required for rotation-mode belt printers. " "Defaults to on because virtually all rotation-mode printers need it."); def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(true)); @@ -6553,12 +6450,6 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionEnum(BeltTransformOrder::ShearThenScale)); }; - add_belt_transform_order("belt_mesh_transform_order", "Mesh transform order", - "Order in which the mesh shear and scale matrices are composed before slicing. " - "'Scale, then shear' applies scale first and then shear (current default). " - "'Shear, then scale' applies shear first and then scale. The g-code back-transform " - "follows the same order so that it correctly inverts the mesh transform."); - // G-code axis remap with sign auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, RemapAxis default_axis, ConfigOptionMode mode = comSimple) { @@ -6599,7 +6490,7 @@ void PrintConfigDef::init_fff_params() def->tooltip = L("When enabled, the pre-slice axis remap accounts for each object's bed position. " "Without this, the remap is applied locally around each object's center, so " "objects at different positions don't get a position-dependent contribution. " - "Mirrors the per-axis 'Global' option on belt mesh shears, but for the remap."); + "Mirrors the 'Global' option on the belt slicing rotation, but for the remap."); def->mode = comExpert; def->set_default_value(new ConfigOptionBool(false)); @@ -6609,6 +6500,69 @@ void PrintConfigDef::init_fff_params() // Machine-frame G-code transforms: applied AFTER back-transform and gcode_remap, // before per-axis origin snap. Maps Cartesian G-code to the printer's physical machine frame. + // These shear/scale transforms act on the G-code coordinates (not the mesh) — they are + // the belt printer's only shear/scale stage. + auto add_belt_shear_mode = [this](const char *key, const char *label, BeltShearMode default_mode, + ConfigOptionMode mode = comAdvanced) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Shear function applied to this axis in belt printer mode."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "pos_cot", "neg_cot", "pos_tan", "neg_tan"}; + def->enum_labels = {L("None"), L("+cot(α)"), L("-cot(α)"), L("+tan(α)"), L("-tan(α)")}; + def->mode = mode; + def->set_default_value(new ConfigOptionEnum(default_mode)); + }; + auto add_belt_shear_angle = [this](const char *key, const char *label, + ConfigOptionMode mode = comAdvanced) { + auto def = this->add(key, coFloat); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Angle (degrees) for the shear function on this axis."); + def->sidetext = L("°"); + def->min = 0.1; + def->max = 89.9; + def->mode = mode; + def->set_default_value(new ConfigOptionFloat(45)); + }; + auto add_belt_axis_enum = [this](const char *key, const char *label, const char *tooltip, + BeltAxis default_axis, ConfigOptionMode mode = comAdvanced) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L(tooltip); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"x", "y", "z"}; + def->enum_labels = {L("X"), L("Y"), L("Z")}; + def->mode = mode; + def->set_default_value(new ConfigOptionEnum(default_axis)); + }; + auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode, + ConfigOptionMode mode = comAdvanced) { + auto def = this->add(key, coEnum); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Scale factor applied to this axis in belt printer mode."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = {"none", "inv_sin", "inv_cos", "sin", "cos"}; + def->enum_labels = {L("None"), L("1/sin(α)"), L("1/cos(α)"), L("sin(α)"), L("cos(α)")}; + def->mode = mode; + def->set_default_value(new ConfigOptionEnum(default_mode)); + }; + auto add_belt_scale_angle = [this](const char *key, const char *label, + ConfigOptionMode mode = comAdvanced) { + auto def = this->add(key, coFloat); + def->label = L(label); + def->category = L("Printable space"); + def->tooltip = L("Angle (degrees) for the scale function on this axis."); + def->sidetext = L("°"); + def->min = 0.1; + def->max = 89.9; + def->mode = mode; + def->set_default_value(new ConfigOptionFloat(45)); + }; + add_belt_shear_mode ("gcode_shear_x", "Function", BeltShearMode::None, comExpert); add_belt_shear_angle("gcode_shear_x_angle", "Angle", comExpert); add_belt_axis_enum ("gcode_shear_x_from", "From", "Source axis for X shear in the machine-frame stage.", BeltAxis::Z, comExpert); @@ -6635,19 +6589,6 @@ void PrintConfigDef::init_fff_params() "applied to G-code coordinates. 'Scale, then shear' applies scale first and then " "shear (current default). 'Shear, then scale' applies shear first and then scale."); - add_belt_remap("post_gcode_remap_x", "X", - "Axis remap in the machine-frame stage. Applied AFTER gcode_remap, " - "to put coordinates into the printer's physical axis labelling. Default +X: no change.", - RemapAxis::PosX); - add_belt_remap("post_gcode_remap_y", "Y", - "Axis remap in the machine-frame stage. Applied AFTER gcode_remap, " - "to put coordinates into the printer's physical axis labelling. Default +Y: no change.", - RemapAxis::PosY); - add_belt_remap("post_gcode_remap_z", "Z", - "Axis remap in the machine-frame stage. Applied AFTER gcode_remap, " - "to put coordinates into the printer's physical axis labelling. Default +Z: no change.", - RemapAxis::PosZ); - def = this->add("gcode_back_transform", coBool); def->label = L("G-code back-transform"); def->category = L("Printable space"); @@ -11801,16 +11742,22 @@ Polygons get_bed_excluded_area(const PrintConfig& cfg) { const Pointfs exclude_area_points = cfg.bed_exclude_area.values; - // Belt printer: project exclusion zone points from belt surface to machine-frame XY. - // On the belt surface, Z=0, so machine_Y = belt_Y * cos(angle). + // Belt printer: project exclusion zone points from the belt surface to machine-frame XY. + // On the belt surface Z=0, so the in-plane axis foreshortens by cos(tilt). The tilt + // axis decides which bed axis foreshortens: tilt about X (belt along Y) scales Y, + // tilt about Y (belt along X) scales X. Derived from belt_slice_rotation. const bool is_belt = cfg.belt_printer.value; - const double belt_cos = is_belt ? std::cos(Geometry::deg2rad(cfg.belt_printer_angle.value)) : 1.0; + const auto tilt = BeltTransformPipeline::physical_tilt( + cfg.belt_slice_rotation.value, cfg.belt_slice_rotation_angle.value); + const double cos_x = is_belt ? std::cos(Geometry::deg2rad(tilt.tilt_x_deg)) : 1.0; // foreshortens Y + const double cos_y = is_belt ? std::cos(Geometry::deg2rad(tilt.tilt_y_deg)) : 1.0; // foreshortens X Polygon exclude_poly; for (int i = 0; i < exclude_area_points.size(); i++) { auto pt = exclude_area_points[i]; - double y = is_belt ? pt.y() * belt_cos : pt.y(); - exclude_poly.points.emplace_back(scale_(pt.x()), scale_(y)); + double x = is_belt ? pt.x() * cos_y : pt.x(); + double y = is_belt ? pt.y() * cos_x : pt.y(); + exclude_poly.points.emplace_back(scale_(x), scale_(y)); } exclude_poly.make_counter_clockwise(); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index bcfaab7bbc..f13c04f454 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1573,29 +1573,13 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, build_plate_tilt_y)) // Belt printer settings (printer-level). ((ConfigOptionBool, belt_printer)) - ((ConfigOptionFloat, belt_printer_angle)) ((ConfigOptionBool, belt_printer_infinite_y)) - ((ConfigOptionEnum, belt_shear_x)) - ((ConfigOptionFloat, belt_shear_x_angle)) - ((ConfigOptionEnum, belt_shear_x_from)) - ((ConfigOptionBool, belt_shear_x_global)) - ((ConfigOptionEnum, belt_shear_y)) - ((ConfigOptionFloat, belt_shear_y_angle)) - ((ConfigOptionEnum, belt_shear_y_from)) - ((ConfigOptionBool, belt_shear_y_global)) - ((ConfigOptionEnum, belt_shear_z)) - ((ConfigOptionFloat, belt_shear_z_angle)) - ((ConfigOptionEnum, belt_shear_z_from)) - ((ConfigOptionBool, belt_shear_z_global)) - ((ConfigOptionEnum, belt_scale_x)) - ((ConfigOptionFloat, belt_scale_x_angle)) - ((ConfigOptionEnum, belt_scale_y)) - ((ConfigOptionFloat, belt_scale_y_angle)) - ((ConfigOptionEnum, belt_scale_z)) - ((ConfigOptionFloat, belt_scale_z_angle)) - // Global mesh rotation as an alternative to per-axis shear/scale (isometric - // slicing transform). Composes with shear in the pipeline math; UI gates - // them as mutually exclusive. + // Mesh rotation applied before slicing — the sole mesh-side belt transform and + // the single source of truth for the physical belt tilt (its angle + axis drive + // bed rendering, support gravity tilt, and the bed-exclusion projection). + // Isometric (no distortion); the g-code back-transform inverts it before the + // machine-frame remap. (Shear & scale are applied to the g-code, not the + // mesh — see gcode_shear_* / gcode_scale_* below.) ((ConfigOptionEnum, belt_slice_rotation)) ((ConfigOptionFloat, belt_slice_rotation_angle)) ((ConfigOptionBool, belt_slice_rotation_global)) @@ -1621,11 +1605,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, gcode_scale_y_angle)) ((ConfigOptionEnum, gcode_scale_z)) ((ConfigOptionFloat, gcode_scale_z_angle)) - ((ConfigOptionEnum, belt_mesh_transform_order)) ((ConfigOptionEnum, belt_gcode_transform_order)) - ((ConfigOptionEnum, post_gcode_remap_x)) - ((ConfigOptionEnum, post_gcode_remap_y)) - ((ConfigOptionEnum, post_gcode_remap_z)) ((ConfigOptionBool, gcode_back_transform)) ((ConfigOptionBool, belt_preslice_global)) ((ConfigOptionEnum, first_layer_plane)) diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index deaf6fdfce..5fc7df232e 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -341,9 +341,7 @@ static std::vector> slices_to_regions( // pushes those layers into the parallel_for path below, which handles multi-volume // clipping per layer without relying on the bbox Z range. const bool bbox_z_in_layer_frame = !(print_config.belt_printer.value && - (BeltTransformPipeline::has_shear(print_config) - || BeltTransformPipeline::has_scale(print_config) - || BeltTransformPipeline::has_rotation(print_config) + (BeltTransformPipeline::has_rotation(print_config) || BeltTransformPipeline::has_preslice_remap(print_config))); // Belt-transform addendum: with bbox-Z untrusted, the simple path's // "first model_part wins" logic drops subsequent volumes' slices unless @@ -880,12 +878,12 @@ void groupingVolumesForBrim(PrintObject* object, LayerPtrs& layers, int firstLay // Resulting expolygons of layer regions are marked as Internal. void PrintObject::slice() { - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] slice request tid=" << std::this_thread::get_id() << " obj=" << this; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice request tid=" << std::this_thread::get_id() << " obj=" << this; if (! this->set_started(posSlice)) { - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] slice SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; return; } - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] slice ENTER tid=" << std::this_thread::get_id() << " obj=" << this; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice ENTER tid=" << std::this_thread::get_id() << " obj=" << this; //BBS: add flag to reload scene for shell rendering m_print->set_status(5, L("Slicing mesh"), PrintBase::SlicingStatus::RELOAD_SCENE); std::vector layer_height_profile; @@ -968,16 +966,16 @@ void PrintObject::slice() // regardless of global mode, only the output Z coordinates change. { const auto &pcfg = this->print()->config(); - BOOST_LOG_TRIVIAL(warning) << "Belt global check: belt_printer=" << pcfg.belt_printer.value - << " belt_shear_z=" << int(pcfg.belt_shear_z.value) - << " belt_shear_z_global=" << pcfg.belt_shear_z_global.value + BOOST_LOG_TRIVIAL(trace) << "Belt global check: belt_printer=" << pcfg.belt_printer.value + << " belt_slice_rotation=" << int(pcfg.belt_slice_rotation.value) + << " belt_slice_rotation_global=" << pcfg.belt_slice_rotation_global.value << " belt_preslice_global=" << pcfg.belt_preslice_global.value << " object=" << this->model_object()->name; if (pcfg.belt_printer.value) { Point inst_shift = this->instances().empty() ? Point(0, 0) : this->instances().front().shift - this->center_offset(); - BOOST_LOG_TRIVIAL(warning) << "Belt global: object " << this->model_object()->name + BOOST_LOG_TRIVIAL(trace) << "Belt global: object " << this->model_object()->name << " instances=" << this->instances().size() << " shift=(" << unscale(inst_shift.x()) << ", " << unscale(inst_shift.y()) << ")"; @@ -987,20 +985,14 @@ void PrintObject::slice() // so the slicer can slice with slicer_z >= 0. BeltBackTransform inverts // build_forward_transform() which DOES NOT include this per-object // Z-shift (it's not known until vertex scan time). Result: G-code - // coords emerge offset by the un-undone Z-shift — for shear that's a - // pure machine_z lift; for rotation it leaks into both machine_y and - // machine_z because the inverse rotation couples slicer_z back into - // both axes. Compensating layer.print_z by shear_min_z here makes the - // back-transform produce correct machine-frame coordinates whether or - // not any global mode is active. - // - // (The original global-mode-only application of shear_min_z was sized - // for cube-vs-inverted-cone-tip differentiation; the same compensation - // is what fixes assemblies and rotation-mode parts where z_shift > 0.) + // coords emerge offset by the un-undone Z-shift — the inverse rotation + // couples slicer_z back into both machine_y and machine_z. Compensating + // layer.print_z by belt_z_shift here makes the back-transform produce + // correct machine-frame coordinates whether or not a global mode is active. double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; - double shear_min_z = m_belt_min_z - belt_surface_z; - double global_z_offset = shear_min_z; + double belt_z_shift = m_belt_min_z - belt_surface_z; + double global_z_offset = belt_z_shift; // Centering correction: trafo_centered pretranslates by // -m_center_offset.{x,y}. Under the belt forward transform, the @@ -1019,7 +1011,7 @@ void PrintObject::slice() 0.); double centering_z_corr = (T_fwd.linear() * c_off).z(); global_z_offset += centering_z_corr; - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] centering correction" + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] centering correction" << " obj=" << this->model_object()->name << " m_center_offset_mm=(" << c_off.x() << "," << c_off.y() << ")" << " centering_z_corr=" << centering_z_corr @@ -1031,7 +1023,7 @@ void PrintObject::slice() // print_z adjustment. { BoundingBoxf3 raw_bb = this->model_object()->raw_bounding_box(); - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] slice() per-object summary" + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] slice() per-object summary" << " obj=" << this->model_object()->name << " n_volumes=" << this->model_object()->volumes.size() << " raw_bbox.min=(" << raw_bb.min.x() << "," << raw_bb.min.y() << "," << raw_bb.min.z() << ")" @@ -1041,13 +1033,13 @@ void PrintObject::slice() << " inst_shift=(" << unscale(inst_shift.x()) << "," << unscale(inst_shift.y()) << ")" << " m_belt_min_z=" << m_belt_min_z << " belt_surface_z=" << belt_surface_z - << " shear_min_z=" << shear_min_z; + << " belt_z_shift=" << belt_z_shift; // Per-volume bbox + get_matrix translation so order/composition is visible. int vi = 0; for (const ModelVolume *mv : this->model_object()->volumes) { if (!mv->is_model_part()) { ++vi; continue; } BoundingBoxf3 vol_bb = mv->mesh().transformed_bounding_box(mv->get_matrix()); - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] vol[" << vi + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] vol[" << vi << "] id=" << mv->id().id << " name='" << mv->name << "'" << " get_matrix.translation=(" << mv->get_matrix().translation().x() << "," << mv->get_matrix().translation().y() << "," << mv->get_matrix().translation().z() << ")" << " object_bbox.min=(" << vol_bb.min.x() << "," << vol_bb.min.y() << "," << vol_bb.min.z() << ")" @@ -1063,46 +1055,15 @@ void PrintObject::slice() Vec3d d(unscale(inst_shift.x()), unscale(inst_shift.y()), 0.); Vec3d c = T.linear() * d - d; global_z_offset += c.z(); - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_global_xy_correction tid=" << std::this_thread::get_id() + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] write m_belt_global_xy_correction tid=" << std::this_thread::get_id() << " obj=" << this << " old=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ") new=(" << c.x() << "," << c.y() << ")"; m_belt_global_xy_correction = Vec2d(c.x(), c.y()); - BOOST_LOG_TRIVIAL(warning) << "Belt preslice_global: correction=(" + BOOST_LOG_TRIVIAL(trace) << "Belt preslice_global: correction=(" << c.x() << ", " << c.y() << ", " << c.z() << ")" - << " shear_min_z=" << shear_min_z << " (m_belt_min_z=" << m_belt_min_z << ")"; + << " belt_z_shift=" << belt_z_shift << " (m_belt_min_z=" << m_belt_min_z << ")"; } else { - struct GAxis { BeltShearMode mode; double angle; int from; bool global; }; - GAxis gaxes[3] = { - { pcfg.belt_shear_x.value, pcfg.belt_shear_x_angle.value, int(pcfg.belt_shear_x_from.value), pcfg.belt_shear_x_global.value }, - { pcfg.belt_shear_y.value, pcfg.belt_shear_y_angle.value, int(pcfg.belt_shear_y_from.value), pcfg.belt_shear_y_global.value }, - { pcfg.belt_shear_z.value, pcfg.belt_shear_z_angle.value, int(pcfg.belt_shear_z_from.value), pcfg.belt_shear_z_global.value }, - }; - - // Only the Z-row shear contributes a Z offset from global mode. - // (X/Y row shears with global would offset X/Y, not Z — not useful here.) - const auto &za = gaxes[2]; // Z row - if (za.global && za.mode != BeltShearMode::None && za.from < 2) { - // Use the full forward-transform correction (same formula as - // preslice_global) so the per-bed-position offset matches what - // BeltGCode::on_set_origin's T.linear() pre-multiplication - // expects after back-transform. The simple `cy*tan(α)` form - // is exact only for ScaleThenShear; under ShearThenScale with - // sy != 1 it leaves the object bottom off the belt plane by - // cy*tan(α)*(sy-1)/sy. - Transform3d T = BeltTransformPipeline::build_forward_transform(pcfg); - Vec3d d(unscale(inst_shift.x()), unscale(inst_shift.y()), 0.); - Vec3d c = T.linear() * d - d; - global_z_offset += c.z(); - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_global_xy_correction tid=" << std::this_thread::get_id() - << " obj=" << this << " old=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() - << ") new=(" << c.x() << "," << c.y() << ")"; - m_belt_global_xy_correction = Vec2d(c.x(), c.y()); - BOOST_LOG_TRIVIAL(warning) << "Belt per-axis Z-shear-global: correction=(" - << c.x() << ", " << c.y() << ", " << c.z() << ")" - << " shear_min_z=" << shear_min_z << " (m_belt_min_z=" << m_belt_min_z << ")"; - } - // Slicing rotation in global mode: bed-position-dependent Z offset. // For R(α, X): c.z = sin(α)*d.y so objects at different bed-Y // values print at different machine Z values along the inclined belt. @@ -1129,16 +1090,16 @@ void PrintObject::slice() } } - BOOST_LOG_TRIVIAL(warning) << "Belt global: z_offset=" << global_z_offset + BOOST_LOG_TRIVIAL(trace) << "Belt global: z_offset=" << global_z_offset << " (relative to min across " << this->print()->objects().size() << " objects)"; - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] write m_belt_global_z_offset tid=" << std::this_thread::get_id() + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] write m_belt_global_z_offset tid=" << std::this_thread::get_id() << " obj=" << this << " old=" << m_belt_global_z_offset << " new=" << global_z_offset; m_belt_global_z_offset = global_z_offset; // [BELT-DEBUG] Final breakdown of all contributions to layer.print_z // and where the first / last layer end up post-adjustment. - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] global_z_offset breakdown" + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] global_z_offset breakdown" << " obj=" << this->model_object()->name - << " shear_min_z=" << shear_min_z + << " belt_z_shift=" << belt_z_shift << " total_global_z_offset=" << global_z_offset << " xy_correction=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ")" << " belt_floor_z_shift_before=" << (m_slicing_params.belt_floor_z_shift) @@ -1152,13 +1113,13 @@ void PrintObject::slice() m_slicing_params.belt_floor_z_shift += global_z_offset; } if (!m_layers.empty()) { - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] post-adjustment" + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] post-adjustment" << " first_layer.print_z=" << m_layers.front()->print_z << " last_layer.print_z=" << m_layers.back()->print_z << " belt_floor_z_shift_after=" << m_slicing_params.belt_floor_z_shift; } if (!m_layers.empty()) { - BOOST_LOG_TRIVIAL(warning) << "Belt global: first_layer_z=" << m_layers.front()->print_z + BOOST_LOG_TRIVIAL(trace) << "Belt global: first_layer_z=" << m_layers.front()->print_z << " last_layer_z=" << m_layers.back()->print_z << " num_layers=" << m_layers.size() << " center_offset=(" << unscale(m_center_offset.x()) @@ -1175,7 +1136,7 @@ void PrintObject::slice() } // BBS - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] slice EXIT tid=" << std::this_thread::get_id() << " obj=" << this + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice EXIT tid=" << std::this_thread::get_id() << " obj=" << this << " layers=" << m_layers.size() << " belt_min_z=" << m_belt_min_z << " belt_global_z_offset=" << m_belt_global_z_offset << " belt_xy=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ")"; diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 5663882f1c..fa9acffb50 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -700,11 +700,11 @@ void Bed3D::render_model(const Transform3d& view_matrix, const Transform3d& proj shader->start_using(); shader->set_uniform("emission_factor", 0.0f); Transform3d model_matrix = Geometry::assemble_transform(m_model_offset); - // Belt printer: rotate the bed model about X so the belt tilt is visible. - // Negative angle: belt surface tilts downward away from the nozzle. + // Belt printer: rotate the bed model about the tilt axis so the belt tilt + // is visible. Negative angle: belt surface tilts downward away from the nozzle. if (m_is_belt_printer && m_belt_angle > 0.f) { double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); - model_matrix = Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX()) * model_matrix; + model_matrix = Eigen::AngleAxisd(-angle_rad, belt_tilt_unit_axis()) * model_matrix; } shader->set_uniform("volume_world_matrix", model_matrix); shader->set_uniform("view_model_matrix", view_matrix * model_matrix); @@ -747,12 +747,10 @@ void Bed3D::render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, co void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix) { const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; + // build_plate_tilt_{x,y} are kept in sync with the belt tilt (see TabPrinter), so + // reading them here covers both belt and non-belt tilted printers. double tilt_x_deg = cfg.opt_float("build_plate_tilt_x"); double tilt_y_deg = cfg.opt_float("build_plate_tilt_y"); - // Belt printer: auto-derive gravity direction from belt angle if belt mode is active. - if (m_is_belt_printer && m_belt_angle > 0.f) { - tilt_x_deg = m_belt_angle; - } if (tilt_x_deg == 0. && tilt_y_deg == 0.) { m_gravity_arrow.reset(); return; @@ -819,11 +817,12 @@ void Bed3D::render_slicing_arrow(const Transform3d& view_matrix, const Transform m_slicing_arrow.init_from(stilized_arrow(16, tip_radius, tip_length, stem_radius, stem_length)); } - // The slicing direction: layers stack along the gantry normal. - // With mesh rotation R(-alpha, X), the slicing Z-axis in the original frame - // points in direction R(+alpha, X) * (0, 0, 1) = (0, -sin(alpha), cos(alpha)). + // The slicing direction: layers stack along the gantry normal, i.e. the image of + // +Z under the mesh rotation about the tilt axis. Use the same AngleAxis as the + // slicing pipeline so the arrow matches whichever tilt axis is configured. double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); - Vec3d slice_dir = Vec3d(0., -std::sin(angle_rad), std::cos(angle_rad)).normalized(); + Vec3d slice_dir = (Eigen::AngleAxisd(angle_rad, belt_tilt_unit_axis()).toRotationMatrix() + * Vec3d::UnitZ()).normalized(); // Compute rotation to align +Z (arrow default) with slice_dir. Vec3d from = Vec3d::UnitZ(); @@ -895,12 +894,12 @@ void Bed3D::render_slicing_plane(const Transform3d& view_matrix, const Transform shader->start_using(); // Show a tilted plane representing the slicing direction. - // The slicing plane is rotated by belt_angle about X from horizontal. + // The slicing plane is rotated by belt_angle about the tilt axis from horizontal. // Raise it slightly so it's visible above the bed surface. double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); Transform3d model_matrix = Transform3d::Identity(); model_matrix.translate(Vec3d(0., 0., 30.)); - model_matrix.rotate(Eigen::AngleAxisd(angle_rad, Vec3d::UnitX())); + model_matrix.rotate(Eigen::AngleAxisd(angle_rad, belt_tilt_unit_axis())); shader->set_uniform("view_model_matrix", view_matrix * model_matrix); shader->set_uniform("projection_matrix", projection_matrix); diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index d01273961d..788d8f52a3 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -125,6 +125,8 @@ private: // Belt printer state for rendering. bool m_is_belt_printer = false; float m_belt_angle = 0.f; + // Tilt axis: 0 = X (belt travels along Y, the common case), 1 = Y. + int m_belt_tilt_axis = 0; public: Bed3D() = default; @@ -146,10 +148,14 @@ public: const BuildVolume& build_volume() const { return m_build_volume; } BuildVolume& build_volume() { return m_build_volume; } - // Belt printer bed settings. - void set_belt_printer(bool enabled, float angle_deg) { m_is_belt_printer = enabled; m_belt_angle = angle_deg; } + // Belt printer bed settings. tilt_axis: 0 = X (belt along Y), 1 = Y. + void set_belt_printer(bool enabled, float angle_deg, int tilt_axis = 0) { + m_is_belt_printer = enabled; m_belt_angle = angle_deg; m_belt_tilt_axis = tilt_axis; + } bool is_belt_printer() const { return m_is_belt_printer; } float belt_angle() const { return m_belt_angle; } + // Unit vector of the tilt axis in bed space. + Vec3d belt_tilt_unit_axis() const { return m_belt_tilt_axis == 1 ? Vec3d::UnitY() : Vec3d::UnitX(); } // Was the model provided, or was it generated procedurally? Type get_type() const { return m_type; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 2bd1f5fc8d..c4a38fc12e 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -11312,80 +11312,33 @@ void Plater::priv::set_bed_shape(const Pointfs &shape, const auto *belt_opt = config->option("belt_printer"); bool is_belt = belt_opt && belt_opt->value; if (is_belt) { - double belt_angle = config->opt_float("belt_printer_angle"); + // The slicing rotation is the single source of truth for the belt tilt: + // its magnitude is the physical tilt angle and its axis is the tilt axis. + auto rot_axis = config->option>("belt_slice_rotation")->value; + double rot_angle = config->opt_float("belt_slice_rotation_angle"); + double belt_angle = std::abs(rot_angle); // physical tilt magnitude + int tilt_axis = (rot_axis == BeltRotationAxis::Y) ? 1 : 0; bool infinite_y = config->opt_bool("belt_printer_infinite_y"); bed.build_volume().set_belt_printer(true, belt_angle, infinite_y); - bed.set_belt_printer(true, static_cast(belt_angle)); + bed.set_belt_printer(true, static_cast(belt_angle), tilt_axis); if (preview) preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, static_cast(belt_angle)); - // Compute the inverse of the full belt shear+scale transform for the G-code viewer. - auto compute_shear_factor = [](BeltShearMode mode, double angle_deg) -> double { - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } - }; - auto compute_scale_factor = [](BeltScaleMode mode, double angle_deg) -> double { - if (mode == BeltScaleMode::None) return 1.; - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; - case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; - case BeltScaleMode::Sin: return sin_a; - case BeltScaleMode::Cos: return cos_a; - default: return 1.; - } - }; - - // Read shear configs. - auto get_shear_mode = [this](const char *key) -> BeltShearMode { - auto opt = config->option>(key); - return opt ? opt->value : BeltShearMode::None; - }; - auto get_axis = [this](const char *key) -> BeltAxis { - auto opt = config->option>(key); - return opt ? opt->value : BeltAxis::X; - }; - auto get_scale_mode = [this](const char *key) -> BeltScaleMode { - auto opt = config->option>(key); - return opt ? opt->value : BeltScaleMode::None; - }; - - struct AxisShear { BeltShearMode mode; double angle; int from; }; - AxisShear axes[3] = { - { get_shear_mode("belt_shear_x"), config->opt_float("belt_shear_x_angle"), int(get_axis("belt_shear_x_from")) }, - { get_shear_mode("belt_shear_y"), config->opt_float("belt_shear_y_angle"), int(get_axis("belt_shear_y_from")) }, - { get_shear_mode("belt_shear_z"), config->opt_float("belt_shear_z_angle"), int(get_axis("belt_shear_z_from")) }, - }; - - Transform3d belt_shear = Transform3d::Identity(); - for (int row = 0; row < 3; ++row) { - if (axes[row].mode != BeltShearMode::None) { - double factor = compute_shear_factor(axes[row].mode, axes[row].angle); - if (std::abs(factor) > EPSILON) - belt_shear.matrix()(row, axes[row].from) += factor; + // Compute the inverse of the mesh-side belt transform for the G-code + // viewer. The sole mesh transform is the slicing rotation; build its + // matrix from config and hand the viewer its inverse (rotation is + // orthogonal, so the inverse is the transpose). + Transform3d forward = Transform3d::Identity(); + if (rot_axis != BeltRotationAxis::None && std::abs(rot_angle) > EPSILON) { + Vec3d unit_axis = Vec3d::UnitX(); + switch (rot_axis) { + case BeltRotationAxis::X: unit_axis = Vec3d::UnitX(); break; + case BeltRotationAxis::Y: unit_axis = Vec3d::UnitY(); break; + case BeltRotationAxis::Z: unit_axis = Vec3d::UnitZ(); break; + default: break; } + forward.linear() = Eigen::AngleAxisd(Geometry::deg2rad(rot_angle), unit_axis).toRotationMatrix(); } - - double sx = compute_scale_factor(get_scale_mode("belt_scale_x"), config->opt_float("belt_scale_x_angle")); - double sy = compute_scale_factor(get_scale_mode("belt_scale_y"), config->opt_float("belt_scale_y_angle")); - double sz = compute_scale_factor(get_scale_mode("belt_scale_z"), config->opt_float("belt_scale_z_angle")); - Transform3d belt_scale = Transform3d::Identity(); - belt_scale.matrix()(0, 0) = sx; - belt_scale.matrix()(1, 1) = sy; - belt_scale.matrix()(2, 2) = sz; - - // Forward transform: scale * shear. Inverse for the viewer. - Transform3d forward = belt_scale * belt_shear; Transform3d inverse = forward.inverse(); if (preview) preview->get_canvas3d()->get_gcode_viewer().set_belt_inverse_transform(inverse); @@ -13730,10 +13683,10 @@ void Plater::load_gcode(const wxString& filename) current_print.set_gcode_file_ready(); - // Belt printer: detect belt_printer_angle from loaded G-code header and enable + // Belt printer: detect the belt tilt from the loaded G-code header and enable // belt view mode on the GCodeViewer so the "Show designed view" toggle appears. - if (current_result->belt_printer_angle > 0.f) { - float angle = current_result->belt_printer_angle; + if (current_result->belt_tilt_angle > 0.f) { + float angle = current_result->belt_tilt_angle; p->preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, angle); } else { p->preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(false, 0.f); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index fa90d97f54..1126d176c5 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4,6 +4,7 @@ #include "PresetHints.hpp" #include "libslic3r/PresetBundle.hpp" #include "libslic3r/PrintConfig.hpp" +#include "libslic3r/BeltTransform.hpp" #include "libslic3r/Utils.hpp" #include "libslic3r/Model.hpp" #include "libslic3r/GCode/GCodeProcessor.hpp" @@ -4464,68 +4465,22 @@ void TabPrinter::build_fff() // checkbox is hidden when belt_printer is off (see TabPrinter::toggle_options). auto belt_og = page->new_optgroup(L("Belt printer"), L"param_advanced"); belt_og->append_single_option_line("belt_printer"); - belt_og->append_single_option_line("belt_printer_angle"); belt_og->append_single_option_line("belt_printer_infinite_y"); - // Mesh rotate (default belt-side transform): isometric, no distortion. - // Shown above the per-axis shear/scale rows because most users should - // pick rotation; shear/scale is the expert escape hatch. + // Belt tilt: the sole mesh-side transform and the single source of truth for + // the physical tilt (drives bed rendering and support gravity tilt too). + // Isometric rotation, no distortion; the back-transform inverts it before the + // machine-frame remap. { - Line line = { L("Mesh rotate"), - L("Global mesh rotation applied before slicing. Isometric " - "(no distortion); the back-transform inverts it before the " - "machine-frame remap. Default belt transform. Mutually " - "exclusive with per-axis shear/scale in the UI.") }; + Line line = { L("Belt tilt"), + L("Belt tilt axis and angle, applied as a mesh rotation before " + "slicing. Also drives bed rendering and support gravity tilt. " + "Isometric (no distortion); the back-transform inverts it before " + "the machine-frame remap.") }; line.append_option(belt_og->get_option("belt_slice_rotation")); line.append_option(belt_og->get_option("belt_slice_rotation_angle")); line.append_option(belt_og->get_option("belt_slice_rotation_global")); belt_og->append_line(line); } - // Per-axis shear/scale: expert escape hatch for non-rigid belt transforms - // (BlackBelt-style 1/sin scaling, asymmetric belt geometries, etc.). - // Group mode + angle + source on one row per axis. - { - Line line = { L("Mesh shear X"), L("Shear applied to the X axis before slicing") }; - line.append_option(belt_og->get_option("belt_shear_x")); - line.append_option(belt_og->get_option("belt_shear_x_angle")); - line.append_option(belt_og->get_option("belt_shear_x_from")); - line.append_option(belt_og->get_option("belt_shear_x_global")); - belt_og->append_line(line); - } - { - Line line = { L("Mesh shear Y"), L("Shear applied to the Y axis before slicing") }; - line.append_option(belt_og->get_option("belt_shear_y")); - line.append_option(belt_og->get_option("belt_shear_y_angle")); - line.append_option(belt_og->get_option("belt_shear_y_from")); - line.append_option(belt_og->get_option("belt_shear_y_global")); - belt_og->append_line(line); - } - { - Line line = { L("Mesh shear Z"), L("Shear applied to the Z axis before slicing") }; - line.append_option(belt_og->get_option("belt_shear_z")); - line.append_option(belt_og->get_option("belt_shear_z_angle")); - line.append_option(belt_og->get_option("belt_shear_z_from")); - line.append_option(belt_og->get_option("belt_shear_z_global")); - belt_og->append_line(line); - } - { - Line line = { L("Mesh scale X"), L("Scale applied to the X axis before slicing") }; - line.append_option(belt_og->get_option("belt_scale_x")); - line.append_option(belt_og->get_option("belt_scale_x_angle")); - belt_og->append_line(line); - } - { - Line line = { L("Mesh scale Y"), L("Scale applied to the Y axis before slicing") }; - line.append_option(belt_og->get_option("belt_scale_y")); - line.append_option(belt_og->get_option("belt_scale_y_angle")); - belt_og->append_line(line); - } - { - Line line = { L("Mesh scale Z"), L("Scale applied to the Z axis before slicing") }; - line.append_option(belt_og->get_option("belt_scale_z")); - line.append_option(belt_og->get_option("belt_scale_z_angle")); - belt_og->append_line(line); - } - belt_og->append_single_option_line("belt_mesh_transform_order"); { Line line = { L("Pre-slice axis remap"), L("Remap model axes before slicing so the slicer's coordinate system matches " @@ -4537,13 +4492,6 @@ void TabPrinter::build_fff() line.append_option(belt_og->get_option("preslice_remap_global")); belt_og->append_line(line); } - { - Line line = { L("G-code axis remap (post-slice)"), L("Remap slicing-frame axes to machine axes in G-code output. Applied AFTER slicing, during G-code generation.") }; - line.append_option(belt_og->get_option("gcode_remap_x")); - line.append_option(belt_og->get_option("gcode_remap_y")); - line.append_option(belt_og->get_option("gcode_remap_z")); - belt_og->append_line(line); - } belt_og->append_single_option_line("belt_preslice_global"); belt_og->append_single_option_line("gcode_back_transform"); { @@ -4588,12 +4536,10 @@ void TabPrinter::build_fff() { auto mf = page->new_optgroup(L("Machine frame transforms"), L"param_advanced"); { - Line line = { L("Post-gcode axis remap"), - L("Axis remap in the machine-frame stage. Applied AFTER gcode_remap, " - "to put coordinates into the printer's physical axis labelling.") }; - line.append_option(mf->get_option("post_gcode_remap_x")); - line.append_option(mf->get_option("post_gcode_remap_y")); - line.append_option(mf->get_option("post_gcode_remap_z")); + Line line = { L("G-code axis remap (post-slice)"), L("Remap slicing-frame axes to machine axes in G-code output. Applied AFTER slicing, during G-code generation.") }; + line.append_option(mf->get_option("gcode_remap_x")); + line.append_option(mf->get_option("gcode_remap_y")); + line.append_option(mf->get_option("gcode_remap_z")); mf->append_line(line); } { @@ -5612,20 +5558,9 @@ void TabPrinter::toggle_options() // Belt printer: show belt-specific settings only when belt_printer is enabled. bool is_belt = m_config->opt_bool("belt_printer"); bool expert_or_above = (m_mode >= comExpert); - toggle_line("belt_printer_angle", is_belt); toggle_line("belt_printer_infinite_y", is_belt); - // Mesh rotate: advanced (visible by default in belt mode). + // Belt tilt: the sole mesh-side belt transform (visible by default in belt mode). toggle_line("belt_slice_rotation", is_belt); - // Mesh shear/scale: expert-only (the rigid rotation above is the - // primary belt transform; shear/scale is reserved for power users - // matching BlackBelt-style 1/sin scale or asymmetric belt geometries). - toggle_line("belt_shear_x", is_belt && expert_or_above); - toggle_line("belt_shear_y", is_belt && expert_or_above); - toggle_line("belt_shear_z", is_belt && expert_or_above); - toggle_line("belt_scale_x", is_belt && expert_or_above); - toggle_line("belt_scale_y", is_belt && expert_or_above); - toggle_line("belt_scale_z", is_belt && expert_or_above); - toggle_line("belt_mesh_transform_order", is_belt && expert_or_above); for (auto el : {"belt_origin_snap_x", "belt_origin_snap_y", "belt_origin_snap_z"}) toggle_line(el, is_belt); @@ -5641,59 +5576,11 @@ void TabPrinter::toggle_options() // preslice_remap_global: superseded by belt_preslice_global toggle_option("preslice_remap_global", is_belt && !belt_global); - // Mutual exclusion (UI only): slicing rotation and per-axis shear/scale are - // alternatives in the printer panel. The pipeline math composes them; this - // just disables the inactive set so users pick one path or the other. + // Rotation is the only mesh-side belt transform. Gray out its angle/global + // sub-options when no rotation axis is selected. auto rot_axis = m_config->option>("belt_slice_rotation")->value; - bool rotation_active = is_belt - && rot_axis != BeltRotationAxis::None - && std::abs(m_config->opt_float("belt_slice_rotation_angle")) > 1e-9; - bool shear_or_scale_active = is_belt && ( - m_config->option>("belt_shear_x")->value != BeltShearMode::None || - m_config->option>("belt_shear_y")->value != BeltShearMode::None || - m_config->option>("belt_shear_z")->value != BeltShearMode::None || - m_config->option>("belt_scale_x")->value != BeltScaleMode::None || - m_config->option>("belt_scale_y")->value != BeltScaleMode::None || - m_config->option>("belt_scale_z")->value != BeltScaleMode::None); - bool allow_shear_scale = !rotation_active; - bool allow_rotation = !shear_or_scale_active; - - // Disable shear/scale mode dropdowns when rotation is active. - for (auto el : {"belt_shear_x", "belt_shear_y", "belt_shear_z", - "belt_scale_x", "belt_scale_y", "belt_scale_z", - "belt_mesh_transform_order"}) - toggle_option(el, is_belt && allow_shear_scale); - - // Disable rotation controls when any shear/scale is active. - toggle_option("belt_slice_rotation", is_belt && allow_rotation); - toggle_option("belt_slice_rotation_angle", is_belt && allow_rotation && rot_axis != BeltRotationAxis::None); - toggle_option("belt_slice_rotation_global", is_belt && allow_rotation && rot_axis != BeltRotationAxis::None); - - // Gray out angle/from sub-options when their parent shear/scale mode is None. - // Per-axis globals are superseded when belt_preslice_global is on. - auto sx = m_config->option>("belt_shear_x")->value; - toggle_option("belt_shear_x_angle", is_belt && sx != BeltShearMode::None && allow_shear_scale); - toggle_option("belt_shear_x_from", is_belt && sx != BeltShearMode::None && allow_shear_scale); - toggle_option("belt_shear_x_global", is_belt && sx != BeltShearMode::None && !belt_global && allow_shear_scale); - - auto sy = m_config->option>("belt_shear_y")->value; - toggle_option("belt_shear_y_angle", is_belt && sy != BeltShearMode::None && allow_shear_scale); - toggle_option("belt_shear_y_from", is_belt && sy != BeltShearMode::None && allow_shear_scale); - toggle_option("belt_shear_y_global", is_belt && sy != BeltShearMode::None && !belt_global && allow_shear_scale); - - auto sz = m_config->option>("belt_shear_z")->value; - toggle_option("belt_shear_z_angle", is_belt && sz != BeltShearMode::None && allow_shear_scale); - toggle_option("belt_shear_z_from", is_belt && sz != BeltShearMode::None && allow_shear_scale); - toggle_option("belt_shear_z_global", is_belt && sz != BeltShearMode::None && !belt_global && allow_shear_scale); - - auto scx = m_config->option>("belt_scale_x")->value; - toggle_option("belt_scale_x_angle", is_belt && scx != BeltScaleMode::None && allow_shear_scale); - - auto scy = m_config->option>("belt_scale_y")->value; - toggle_option("belt_scale_y_angle", is_belt && scy != BeltScaleMode::None && allow_shear_scale); - - auto scz = m_config->option>("belt_scale_z")->value; - toggle_option("belt_scale_z_angle", is_belt && scz != BeltScaleMode::None && allow_shear_scale); + toggle_option("belt_slice_rotation_angle", is_belt && rot_axis != BeltRotationAxis::None); + toggle_option("belt_slice_rotation_global", is_belt && rot_axis != BeltRotationAxis::None); // Machine-frame transforms: shown only in belt mode. // Mirror the Advanced/Expert split used for mesh shear/scale. @@ -5703,8 +5590,7 @@ void TabPrinter::toggle_options() toggle_line("gcode_scale_x", is_belt && expert_or_above); toggle_line("gcode_scale_y", is_belt); toggle_line("gcode_scale_z", is_belt && expert_or_above); - for (auto el : {"belt_gcode_transform_order", "post_gcode_remap_x"}) - toggle_line(el, is_belt); + toggle_line("belt_gcode_transform_order", is_belt); auto gsx = m_config->option>("gcode_shear_x")->value; toggle_option("gcode_shear_x_angle", is_belt && gsx != BeltShearMode::None); @@ -5939,21 +5825,29 @@ void TabPrinter::update_fff() m_use_silent_mode = m_config->opt_bool("silent_mode"); } - // Belt printer: auto-sync build_plate_tilt_x to belt_printer_angle when belt mode is active. - // When belt mode is off, reset build_plate_tilt_x to 0 if it was set by belt mode. + // Belt printer: auto-sync build_plate_tilt_{x,y} (which drives support gravity tilt) + // from the belt slicing rotation, the single source of truth for the physical tilt. + // Tilt about X drives tilt_x, tilt about Y drives tilt_y. When belt mode is off, + // reset whichever tilt axis matches a leftover belt value so we don't clobber a + // manually-set tilt on a non-belt tilted printer. if (m_config->opt_bool("belt_printer")) { - double belt_angle = m_config->opt_float("belt_printer_angle"); - if (m_config->opt_float("build_plate_tilt_x") != belt_angle) { - m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(belt_angle)); - } + auto rot_axis = m_config->option>("belt_slice_rotation")->value; + const auto tilt = BeltTransformPipeline::physical_tilt( + rot_axis, m_config->opt_float("belt_slice_rotation_angle")); + if (m_config->opt_float("build_plate_tilt_x") != tilt.tilt_x_deg) + m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(tilt.tilt_x_deg)); + if (m_config->opt_float("build_plate_tilt_y") != tilt.tilt_y_deg) + m_config->set_key_value("build_plate_tilt_y", new ConfigOptionFloat(tilt.tilt_y_deg)); } else { - // Only reset if build_plate_tilt_x matches a typical belt angle (was set by auto-sync). - // Avoid clobbering a manually-set tilt value for non-belt tilted printers. - double current_tilt = m_config->opt_float("build_plate_tilt_x"); - double belt_angle = m_config->opt_float("belt_printer_angle"); - if (current_tilt != 0. && std::abs(current_tilt - belt_angle) < 0.01) { + const auto tilt = BeltTransformPipeline::physical_tilt( + m_config->option>("belt_slice_rotation")->value, + m_config->opt_float("belt_slice_rotation_angle")); + double tx = m_config->opt_float("build_plate_tilt_x"); + double ty = m_config->opt_float("build_plate_tilt_y"); + if (tx != 0. && std::abs(tx - tilt.tilt_x_deg) < 0.01) m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(0.)); - } + if (ty != 0. && std::abs(ty - tilt.tilt_y_deg) < 0.01) + m_config->set_key_value("build_plate_tilt_y", new ConfigOptionFloat(0.)); } toggle_options(); From 02d45c32584aeb72bdb8f55336568f9a24520ee4 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Thu, 4 Jun 2026 14:40:45 -0500 Subject: [PATCH 036/389] Finish Fixes from Copilot Review (#39) * fix: restore BuildVolume bounds when toggling belt mode set_belt_printer() mutated m_bboxf when enabling but never restored the original extents on disable or when switching infinite_y true->false, leaving stale max.y/max.z values that broke collision and object_state checks. Recompute m_bboxf from m_bed_shape + m_max_print_height at the top of each call, then apply belt-specific adjustments on top. Addresses Copilot review comment on PR #12998 (BuildVolume.cpp:196). * chore: drop [BELT-DEBUG] to_machine_coords log to trace Was emitting at warning level once per 0.2mm Z bucket during every belt print export, polluting default user logs. Trace level matches the rest of the belt diagnostics and is silent in production. Addresses Copilot review comment on PR #12998 (BeltGCodeWriter.cpp:86). * chore: drop [BELTRACE] make_perimeters/support logs to trace Eight warning-level traces around make_perimeters and generate_support_material were emitting on every call/exit during normal slicing, cluttering default logs. They're concurrency-debug breadcrumbs not user-facing diagnostics, so drop them to trace. Addresses Copilot review comment on PR #12998 (PrintObject.cpp:438). * perf: gate BeltSliceStrategy diagnostic bbox tracking behind compile flag apply_to_trafo() walked every model vertex twice (once for min_z, once for per-volume mesh/slicer bboxes) and emitted seven trace logs per call. The bboxes and logs are diagnostic only; min_z is the load-bearing output. Wrap the bbox accumulation, logging, and supporting headers in SLIC3R_BELT_DIAGNOSTIC_LOG so production builds do the bare min_z scan. Addresses Copilot review comment on PR #12998 (BeltSliceStrategy.cpp:95). * fix: apply part_cooling_fan_min_pwm to first-layer plane fan crossings apply_first_layer_plane_fan_eval emitted band-crossing M106 commands through GCodeWriter::set_fan() without the per-printer PWM floor that every other set_fan call in CoolingBuffer applies. On printers with a non-zero part_cooling_fan_min_pwm, fans could fail to spin up at low requested speeds near the belt surface. Addresses Copilot review comment on PR #12998 (CoolingBuffer.cpp:1227). --- src/libslic3r/BeltGCodeWriter.cpp | 2 +- src/libslic3r/BeltSliceStrategy.cpp | 30 +++++++++++++++++++++++---- src/libslic3r/BuildVolume.cpp | 6 ++++++ src/libslic3r/GCode/CoolingBuffer.cpp | 6 +++++- src/libslic3r/PrintObject.cpp | 16 +++++++------- 5 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index 751a7f19d8..9f1f32a375 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -76,7 +76,7 @@ Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const int z_bucket = static_cast(std::floor(pos.z() * 5.0)); // every 0.2mm if (z_bucket != s_last_logged_z) { s_last_logged_z = z_bucket; - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] to_machine_coords" + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] to_machine_coords" << " slicer_in=(" << pos.x() << "," << pos.y() << "," << pos.z() << ")" << " after_back=(" << after_back.x() << "," << after_back.y() << "," << after_back.z() << ")" << " after_remap=(" << after_remap.x() << "," << after_remap.y() << "," << after_remap.z() << ")" diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp index ddaabdef0b..fd1bfcc191 100644 --- a/src/libslic3r/BeltSliceStrategy.cpp +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -2,9 +2,11 @@ #include "Model.hpp" #include +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG #include #include #include +#endif namespace Slic3r { @@ -40,7 +42,8 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, // coordinates rather than object-space coordinates, so volumes translated // along the slicer's Z axis are silently excluded from the bound check. if (has_remap || m_has_rotation) { - // [BELT-DEBUG] Capture the incoming trafo for diagnostic logging. +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG + // Capture the incoming trafo for diagnostic logging. // This is the slicer-frame transform AFTER belt_xform but BEFORE z_shift. const Transform3d trafo_pre_shift = trafo; auto log_mat = [](const Matrix3d &m) { @@ -63,29 +66,41 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, << " trafo.linear=" << log_mat(trafo_pre_shift.linear()) << " trafo.translation=" << log_vec3(trafo_pre_shift.translation()) << " volumes=" << model_volumes.size(); +#endif double min_z = std::numeric_limits::max(); +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG int vol_idx = 0; +#endif for (const ModelVolume *mv : model_volumes) { +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG if (!mv->is_model_part()) { ++vol_idx; continue; } +#else + if (!mv->is_model_part()) continue; +#endif Transform3d vol_trafo = trafo * mv->get_matrix(); - // [BELT-DEBUG] Per-volume bbox in mesh-frame and post-trafo slicer-frame. const auto &its = mv->mesh().its; +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG + // Per-volume bbox in mesh-frame and post-trafo slicer-frame. Vec3d mesh_min(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); Vec3d mesh_max(std::numeric_limits::lowest(), std::numeric_limits::lowest(), std::numeric_limits::lowest()); Vec3d slicer_min(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); Vec3d slicer_max(std::numeric_limits::lowest(), std::numeric_limits::lowest(), std::numeric_limits::lowest()); double vol_min_z = std::numeric_limits::max(); +#endif for (const stl_vertex &v : its.vertices) { Vec3d vm = v.cast(); + Vec3d pt = vol_trafo * vm; + min_z = std::min(min_z, pt.z()); +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG mesh_min = mesh_min.cwiseMin(vm); mesh_max = mesh_max.cwiseMax(vm); - Vec3d pt = vol_trafo * vm; slicer_min = slicer_min.cwiseMin(pt); slicer_max = slicer_max.cwiseMax(pt); vol_min_z = std::min(vol_min_z, pt.z()); - min_z = std::min(min_z, pt.z()); +#endif } +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] vol[" << vol_idx << "] id=" << mv->id().id << " name='" << mv->name << "'" << " mesh_bbox_min=" << log_vec3(mesh_min) << " mesh_bbox_max=" << log_vec3(mesh_max) @@ -93,10 +108,13 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, << " slicer_bbox_min=" << log_vec3(slicer_min) << " slicer_bbox_max=" << log_vec3(slicer_max) << " vol_min_z=" << vol_min_z; ++vol_idx; +#endif } double belt_z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] combined min_z=" << min_z << " z_shift_val=" << belt_z_shift_val; +#endif if (belt_z_shift_val > 0.) { Transform3d z_shift = Transform3d::Identity(); z_shift.matrix()(2, 3) = belt_z_shift_val; @@ -104,13 +122,17 @@ void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, } if (out_belt_min_z) { double new_val = (min_z != std::numeric_limits::max()) ? min_z : 0.; +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] write m_belt_min_z tid=" << std::this_thread::get_id() << " target=" << out_belt_min_z << " old=" << *out_belt_min_z << " new=" << new_val; +#endif *out_belt_min_z = new_val; } +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_to_trafo exit" << " final_trafo.linear=" << log_mat(trafo.linear()) << " final_trafo.translation=" << log_vec3(trafo.translation()); +#endif } } diff --git a/src/libslic3r/BuildVolume.cpp b/src/libslic3r/BuildVolume.cpp index d6fae8f0a8..2e194bdd7e 100644 --- a/src/libslic3r/BuildVolume.cpp +++ b/src/libslic3r/BuildVolume.cpp @@ -182,6 +182,12 @@ void BuildVolume::set_belt_printer(bool enabled, double angle_deg, bool infinite m_belt_angle = angle_deg; m_belt_infinite_y = infinite_y; + // Restart from the unmodified bbox each call. Without this, toggling + // belt mode off (or switching infinite_y true→false) would leave the + // extents inflated and break collision / object_state checks. + BoundingBoxf bboxf = get_extents(m_bed_shape); + m_bboxf = BoundingBoxf3{ to_3d(bboxf.min, 0.), to_3d(bboxf.max, m_max_print_height) }; + if (enabled) { if (infinite_y) { // Extend the Y bound to a very large value for infinite belt. diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index a9991f6f62..a92bb7e4cf 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -1091,6 +1091,10 @@ std::string CoolingBuffer::apply_first_layer_plane_fan_eval( std::string out; out.reserve(gcode.size() + 256); + // Match the PWM floor applied at every other set_fan call in this file so + // band-crossing M106 emissions start the fan reliably at low speeds. + const unsigned int part_cooling_fan_min_pwm = static_cast(std::max(0, m_config.part_cooling_fan_min_pwm.value)); + // Track position in slicing-frame mm. Seed from m_current_pos which the // CoolingBuffer keeps up-to-date across layers. Vec3d cur_pos_mm(m_current_pos[0], m_current_pos[1], m_current_pos[2]); @@ -1221,7 +1225,7 @@ std::string CoolingBuffer::apply_first_layer_plane_fan_eval( target_fan = pre_band_main_fan; } if (target_fan != current_main_fan) { - out += GCodeWriter::set_fan(m_config.gcode_flavor, target_fan); + out += GCodeWriter::set_fan(m_config.gcode_flavor, target_fan, part_cooling_fan_min_pwm); current_main_fan = target_fan; m_fan_speed = target_fan; m_current_fan_speed = target_fan; diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 31565b9a6b..54a3f7bdb9 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -427,15 +427,15 @@ std::vector> PrintObject::detect_extruder_geometric_unprintables() // 3) Generates perimeters, gap fills and fill regions (fill regions of type stInternal). void PrintObject::make_perimeters() { - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] make_perimeters request tid=" << std::this_thread::get_id() << " obj=" << this; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters request tid=" << std::this_thread::get_id() << " obj=" << this; // prerequisites this->slice(); if (! this->set_started(posPerimeters)) { - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] make_perimeters SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; return; } - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] make_perimeters ENTER tid=" << std::this_thread::get_id() << " obj=" << this; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters ENTER tid=" << std::this_thread::get_id() << " obj=" << this; m_print->set_status(15, L("Generating walls")); BOOST_LOG_TRIVIAL(info) << "Generating walls..." << log_memory_info(); @@ -533,7 +533,7 @@ void PrintObject::make_perimeters() m_print->throw_if_canceled(); BOOST_LOG_TRIVIAL(debug) << "Generating perimeters in parallel - end"; - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] make_perimeters EXIT tid=" << std::this_thread::get_id() << " obj=" << this; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters EXIT tid=" << std::this_thread::get_id() << " obj=" << this; this->set_done(posPerimeters); } @@ -829,9 +829,9 @@ void PrintObject::detect_overhangs_for_lift() void PrintObject::generate_support_material() { - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] generate_support_material request tid=" << std::this_thread::get_id() << " obj=" << this; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material request tid=" << std::this_thread::get_id() << " obj=" << this; if (this->set_started(posSupportMaterial)) { - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] generate_support_material ENTER tid=" << std::this_thread::get_id() << " obj=" << this; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material ENTER tid=" << std::this_thread::get_id() << " obj=" << this; this->clear_support_layers(); if(!has_support() && !m_print->get_no_check_flag()) { @@ -872,10 +872,10 @@ void PrintObject::generate_support_material() this->_generate_support_material(); m_print->throw_if_canceled(); } - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] generate_support_material EXIT tid=" << std::this_thread::get_id() << " obj=" << this; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material EXIT tid=" << std::this_thread::get_id() << " obj=" << this; this->set_done(posSupportMaterial); } else { - BOOST_LOG_TRIVIAL(warning) << "[BELTRACE] generate_support_material SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; + BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; } } From 573e1c65441c0c88cc219a1844567608e31a1b35 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Fri, 5 Jun 2026 03:11:38 -0500 Subject: [PATCH 037/389] Belt/fix profiles and minor oopsies (#42) * fix duplicate printer, bump version * clean up extra tab in space * fix generic defaults --- resources/profiles/Custom.json | 6 +----- resources/profiles/Custom/machine/fdm_belt_common.json | 1 + src/libslic3r/Preset.cpp | 5 ++--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index 602631c7ff..ba1ddc14f4 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,6 +1,6 @@ { "name": "Custom Printer", - "version": "02.04.00.00", + "version": "02.04.00.03", "force_update": "0", "description": "My configurations", "machine_model_list": [ @@ -298,10 +298,6 @@ "name": "MyRepetier 0.4 nozzle", "sub_path": "machine/MyRepetier 0.4 nozzle.json" }, - { - "name": "MyRRF 0.4 nozzle", - "sub_path": "machine/MyRRF 0.4 nozzle.json" - }, { "name": "MyToolChanger 0.2 nozzle", "sub_path": "machine/MyToolChanger 0.2 nozzle.json" diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index 545ad15846..0530999f15 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -92,6 +92,7 @@ "belt_slice_rotation": "x", "belt_slice_rotation_angle": "45", "belt_slice_rotation_global": "1", + "build_plate_tilt_x": "45", "gcode_shear_z": "pos_tan", "gcode_scale_y": "inv_cos", "purge_in_prime_tower": "0", diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 5aab208049..2fc76a4998 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1323,8 +1323,7 @@ static std::vector s_Preset_machine_limits_options { static std::vector s_Preset_printer_options { "printer_technology", - "printable_area", "extruder_printable_area", "support_parallel_printheads", "parallel_printheads_count", "parallel_printheads_bed_exclude_areas", "bed_exclude_area","bed_custom_texture", "bed_custom_model", - "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_infinite_y", + "printable_area", "extruder_printable_area", "support_parallel_printheads", "parallel_printheads_count", "parallel_printheads_bed_exclude_areas", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "build_plate_tilt_x", "build_plate_tilt_y", "belt_printer", "belt_printer_infinite_y", "belt_slice_rotation", "belt_slice_rotation_angle", "belt_slice_rotation_global", "preslice_remap_x", "preslice_remap_y", "preslice_remap_z", "preslice_remap_global", "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", "gcode_back_transform", @@ -1341,7 +1340,7 @@ static std::vector s_Preset_printer_options { "belt_origin_snap_y", "belt_origin_offset_y", "belt_origin_snap_z", "belt_origin_offset_z", "belt_support_floor_offset", "belt_support_floor_mode", "belt_support_z_offset_mode", - "gcode_flavor", + "gcode_flavor", "fan_kickstart", "part_cooling_fan_min_pwm", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", "printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type", From 6ed24378484cb12bf83ed831024cbe1da1d8fac5 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi <163908227+tommasobbianchi@users.noreply.github.com> Date: Wed, 10 Jun 2026 11:13:56 +0200 Subject: [PATCH 038/389] Add IdeaFormer IR3 V2 belt printer profile - credit: tommasobbianchi (#43) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add IdeaFormer IR3 V2 belt printer profile Self-contained vendor profile for the IdeaFormer IR3 V2 (45 deg belt printer): machine (0.4 nozzle) + 0.20mm process + Generic PLA/PETG filaments, with the belt machine-frame transforms set explicitly on the machine preset (belt_printer, belt_slice_rotation x/45/global, build_plate_tilt_x=45, gcode_remap_x/y/z, gcode_shear_z=pos_tan, gcode_scale_y=inv_cos). The vendor bundles its own machine/process commons (fdm_belt_common, fdm_klipper_common, fdm_machine_common, fdm_process_common) on purpose: OrcaSlicer resolves system-preset inheritance per-vendor, so a profile that inherits the Custom vendor's commons cross-vendor fails to resolve its parent and the whole IdeaFormer vendor silently fails to load. Bundling the commons (and listing them in IdeaFormer.json in dependency order) keeps the vendor self-contained, matching how every other vendor folder is structured. Machine limits, bed temperature (75 C for belt PLA) and start/end G-code are taken from a working IdeaFormer IR3 V2. * feat(belt/profile): eSUN PLA @IdeaFormer IR3 V2 — HW-calibrated belt filament Add an eSUN PLA belt profile for the IR3 V2, inheriting Generic PLA @IdeaFormer IR3 V2 (self-contained: parent is in the same IdeaFormer vendor, registered after it in filament_list). HW-calibrated on the IR3 V2: - nozzle_temperature 200/200 (temp-tower calibration) - pressure_advance 0.12 (PA calibration) - filament_max_volumetric_speed 10 mm³/s (max-vol-speed calibration: wall failed at 126 mm/s → 126 × 0.0798 mm³/mm ≈ 10 mm³/s) --- resources/profiles/IdeaFormer.json | 54 +++++++ .../IdeaFormer/IdeaFormer IR3 V2_cover.png | Bin 0 -> 187734 bytes .../Generic PETG @IdeaFormer IR3 V2.json | 112 ++++++++++++++ .../Generic PLA @IdeaFormer IR3 V2.json | 112 ++++++++++++++ .../filament/eSUN PLA @IdeaFormer IR3 V2.json | 34 +++++ .../machine/IdeaFormer IR3 V2 0.4 nozzle.json | 105 +++++++++++++ .../IdeaFormer/machine/IdeaFormer IR3 V2.json | 12 ++ .../IdeaFormer/machine/fdm_belt_common.json | 101 +++++++++++++ .../machine/fdm_klipper_common.json | 141 ++++++++++++++++++ .../machine/fdm_machine_common.json | 119 +++++++++++++++ .../0.20mm Standard @IdeaFormer IR3 V2.json | 21 +++ .../process/fdm_process_common.json | 108 ++++++++++++++ 12 files changed, 919 insertions(+) create mode 100644 resources/profiles/IdeaFormer.json create mode 100644 resources/profiles/IdeaFormer/IdeaFormer IR3 V2_cover.png create mode 100644 resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json create mode 100644 resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json create mode 100644 resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json create mode 100644 resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json create mode 100644 resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2.json create mode 100644 resources/profiles/IdeaFormer/machine/fdm_belt_common.json create mode 100644 resources/profiles/IdeaFormer/machine/fdm_klipper_common.json create mode 100644 resources/profiles/IdeaFormer/machine/fdm_machine_common.json create mode 100644 resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json create mode 100644 resources/profiles/IdeaFormer/process/fdm_process_common.json diff --git a/resources/profiles/IdeaFormer.json b/resources/profiles/IdeaFormer.json new file mode 100644 index 0000000000..7e3e108c3d --- /dev/null +++ b/resources/profiles/IdeaFormer.json @@ -0,0 +1,54 @@ +{ + "name": "IdeaFormer", + "version": "02.00.00.00", + "force_update": "0", + "description": "IdeaFormer belt printer configurations", + "machine_model_list": [ + { + "name": "IdeaFormer IR3 V2", + "sub_path": "machine/IdeaFormer IR3 V2.json" + } + ], + "process_list": [ + { + "name": "fdm_process_common", + "sub_path": "process/fdm_process_common.json" + }, + { + "name": "0.20mm Standard @IdeaFormer IR3 V2", + "sub_path": "process/0.20mm Standard @IdeaFormer IR3 V2.json" + } + ], + "filament_list": [ + { + "name": "Generic PLA @IdeaFormer IR3 V2", + "sub_path": "filament/Generic PLA @IdeaFormer IR3 V2.json" + }, + { + "name": "eSUN PLA @IdeaFormer IR3 V2", + "sub_path": "filament/eSUN PLA @IdeaFormer IR3 V2.json" + }, + { + "name": "Generic PETG @IdeaFormer IR3 V2", + "sub_path": "filament/Generic PETG @IdeaFormer IR3 V2.json" + } + ], + "machine_list": [ + { + "name": "fdm_machine_common", + "sub_path": "machine/fdm_machine_common.json" + }, + { + "name": "fdm_klipper_common", + "sub_path": "machine/fdm_klipper_common.json" + }, + { + "name": "fdm_belt_common", + "sub_path": "machine/fdm_belt_common.json" + }, + { + "name": "IdeaFormer IR3 V2 0.4 nozzle", + "sub_path": "machine/IdeaFormer IR3 V2 0.4 nozzle.json" + } + ] +} \ No newline at end of file diff --git a/resources/profiles/IdeaFormer/IdeaFormer IR3 V2_cover.png b/resources/profiles/IdeaFormer/IdeaFormer IR3 V2_cover.png new file mode 100644 index 0000000000000000000000000000000000000000..71485f54f5e6ef9718dc75c15074e024bcc33521 GIT binary patch literal 187734 zcmeFY^;27K^evp=TA&cDMG7A*xVK2~;vU@H3lu9JpcJkZ$Td*^-sggbM8$Ykc^BspiFwfD33+UtqZP?IObqs9XO0ECJPvRVKD8Wi=y!@)uw zS%3Mb8ubSB(2|!1RFAye1_0;*in3DB52kw^*d8zSJ~w3_E&3mBu?Zs&DsLBF9Cx%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m_mUEp!%$D?ctBWMY*Z*ORvFPAq+lnS+Ae{@`;E@*wNJS5AMIm1H|7)92jZf za-L}r!c0Cm*3NcTzQiva?jacXY?R2!_3X5APq|hGQq{y{NORWpvlnj)La`T7#g2nCBf6FXnr^+2C?W*Gh=^&Rh+RLW@l1&MUI-?$ z&DRAeZGeFJd?7E)?9FV`--E&Sp6G?^5D4a|$e&^e=D0Yu8Zd7!U~f|#vJa{N1v31+ znw{o={nEuePcRFu6&fne10Dy1b2Qy=0sa$6emZqYv^v7bG5rA68kOgmPLm!GgH|uz zxWPUQ$PY)~Q%0fkLiYJ%QN^^?pomCcFqLIlqX@1Qgj}k%jVbd4wDk0?v<^V4bE^%K zKs;{mj}H+6=XBkV2)}DeZRmXr1AhYdU`{saS07eDQ-d)J&OGr;&gxGN|6>_(L;-yq zQAaPVK~rbc@H-jxzr$O?Z_zlGS1R!OY2R=I2%xDCZT+%AJYYTu^o}UBy7Vel8Abe) z9|qce&9dJ1k3<2ba1K>`_klg>znW)&>MCGlOF=+F1jVcI#A}>$aQas>orucu8kPFj oOex?!HC*_=n*Xoxf6}G9;CYjH4f0itI|xW;Eo{siOkETH1IrwqS^xk5 literal 0 HcmV?d00001 diff --git a/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json new file mode 100644 index 0000000000..c51b20abbc --- /dev/null +++ b/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json @@ -0,0 +1,112 @@ +{ + "type": "filament", + "name": "Generic PETG @IdeaFormer IR3 V2", + "inherits": "Generic PETG @System", + "from": "system", + "instantiation": "true", + "compatible_printers": [ + "IdeaFormer IR3 V2 0.4 nozzle" + ], + "filament_type": [ + "PETG" + ], + "filament_vendor": [ + "Generic" + ], + "filament_settings_id": [ + "Generic PETG @IdeaFormer IR3 V2" + ], + "filament_diameter": [ + "1.75" + ], + "filament_density": [ + "1.27" + ], + "filament_flow_ratio": [ + "0.95" + ], + "filament_cost": [ + "25" + ], + "filament_max_volumetric_speed": [ + "10" + ], + "nozzle_temperature": [ + "240" + ], + "nozzle_temperature_initial_layer": [ + "245" + ], + "nozzle_temperature_range_low": [ + "220" + ], + "nozzle_temperature_range_high": [ + "260" + ], + "temperature_vitrification": [ + "70" + ], + "hot_plate_temp": [ + "80" + ], + "hot_plate_temp_initial_layer": [ + "80" + ], + "cool_plate_temp": [ + "80" + ], + "cool_plate_temp_initial_layer": [ + "80" + ], + "textured_plate_temp": [ + "80" + ], + "textured_plate_temp_initial_layer": [ + "80" + ], + "fan_min_speed": [ + "40" + ], + "fan_max_speed": [ + "60" + ], + "overhang_fan_threshold": [ + "25%" + ], + "overhang_fan_speed": [ + "80" + ], + "close_fan_the_first_x_layers": [ + "3" + ], + "full_fan_speed_layer": [ + "8" + ], + "slow_down_min_speed": [ + "20" + ], + "slow_down_layer_time": [ + "4" + ], + "fan_cooling_layer_time": [ + "100" + ], + "reduce_fan_stop_start_freq": [ + "1" + ], + "filament_retraction_length": [ + "2" + ], + "filament_retraction_speed": [ + "40" + ], + "filament_deretraction_speed": [ + "40" + ], + "filament_z_hop": [ + "0.4" + ], + "filament_start_gcode": [ + "; Generic PETG @IdeaFormer IR3 V2 — belt PETG, bed 80C" + ] +} diff --git a/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json new file mode 100644 index 0000000000..c86ba651da --- /dev/null +++ b/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json @@ -0,0 +1,112 @@ +{ + "type": "filament", + "name": "Generic PLA @IdeaFormer IR3 V2", + "inherits": "Generic PLA @System", + "from": "system", + "instantiation": "true", + "compatible_printers": [ + "IdeaFormer IR3 V2 0.4 nozzle" + ], + "filament_type": [ + "PLA" + ], + "filament_vendor": [ + "Generic" + ], + "filament_settings_id": [ + "Generic PLA @IdeaFormer IR3 V2" + ], + "filament_diameter": [ + "1.75" + ], + "filament_density": [ + "1.24" + ], + "filament_flow_ratio": [ + "0.98" + ], + "filament_cost": [ + "20" + ], + "filament_max_volumetric_speed": [ + "12" + ], + "nozzle_temperature": [ + "215" + ], + "nozzle_temperature_initial_layer": [ + "220" + ], + "nozzle_temperature_range_low": [ + "190" + ], + "nozzle_temperature_range_high": [ + "240" + ], + "temperature_vitrification": [ + "45" + ], + "hot_plate_temp": [ + "75" + ], + "hot_plate_temp_initial_layer": [ + "75" + ], + "cool_plate_temp": [ + "75" + ], + "cool_plate_temp_initial_layer": [ + "75" + ], + "textured_plate_temp": [ + "75" + ], + "textured_plate_temp_initial_layer": [ + "75" + ], + "fan_min_speed": [ + "100" + ], + "fan_max_speed": [ + "100" + ], + "overhang_fan_threshold": [ + "50%" + ], + "overhang_fan_speed": [ + "100" + ], + "close_fan_the_first_x_layers": [ + "3" + ], + "full_fan_speed_layer": [ + "8" + ], + "slow_down_min_speed": [ + "20" + ], + "slow_down_layer_time": [ + "4" + ], + "fan_cooling_layer_time": [ + "100" + ], + "reduce_fan_stop_start_freq": [ + "1" + ], + "filament_retraction_length": [ + "1.5" + ], + "filament_retraction_speed": [ + "35" + ], + "filament_deretraction_speed": [ + "30" + ], + "filament_z_hop": [ + "0.4" + ], + "filament_start_gcode": [ + "; Generic PLA @IdeaFormer IR3 V2 — belt PLA, bed 75C" + ] +} diff --git a/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json new file mode 100644 index 0000000000..c438aac0fd --- /dev/null +++ b/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json @@ -0,0 +1,34 @@ +{ + "type": "filament", + "name": "eSUN PLA @IdeaFormer IR3 V2", + "inherits": "Generic PLA @IdeaFormer IR3 V2", + "from": "system", + "instantiation": "true", + "compatible_printers": [ + "IdeaFormer IR3 V2 0.4 nozzle" + ], + "filament_type": [ + "PLA" + ], + "filament_vendor": [ + "eSUN" + ], + "filament_settings_id": [ + "eSUN PLA @IdeaFormer IR3 V2" + ], + "nozzle_temperature_initial_layer": [ + "200" + ], + "nozzle_temperature": [ + "200" + ], + "enable_pressure_advance": [ + "1" + ], + "pressure_advance": [ + "0.12" + ], + "filament_max_volumetric_speed": [ + "10" + ] +} diff --git a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json new file mode 100644 index 0000000000..b1a2cc2c3b --- /dev/null +++ b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json @@ -0,0 +1,105 @@ +{ + "type": "machine", + "name": "IdeaFormer IR3 V2 0.4 nozzle", + "inherits": "fdm_belt_common", + "from": "system", + "setting_id": "GMIF001", + "instantiation": "true", + "printer_model": "IdeaFormer IR3 V2", + "printer_variant": "0.4", + "nozzle_diameter": [ + "0.4" + ], + "printable_area": [ + "0x0", + "250x0", + "250x2000", + "0x2000" + ], + "printable_height": "250", + "belt_printer": "1", + "belt_printer_infinite_y": "1", + "belt_slice_rotation": "x", + "belt_slice_rotation_angle": "45", + "belt_slice_rotation_global": "1", + "build_plate_tilt_x": "45", + "build_plate_tilt_y": "0", + "gcode_remap_x": "rev_x", + "gcode_remap_y": "pos_z", + "gcode_remap_z": "pos_y", + "gcode_shear_z": "pos_tan", + "gcode_scale_y": "inv_cos", + "thumbnails": [ + "48x48/PNG", + "300x300/PNG" + ], + "default_filament_profile": [ + "Generic PLA @IdeaFormer IR3 V2" + ], + "default_print_profile": "0.20mm Standard @IdeaFormer IR3 V2", + "use_relative_e_distances": "1", + "machine_max_acceleration_e": [ + "5000" + ], + "machine_max_acceleration_extruding": [ + "5000" + ], + "machine_max_acceleration_retracting": [ + "1000" + ], + "machine_max_acceleration_travel": [ + "9000" + ], + "machine_max_acceleration_x": [ + "5000" + ], + "machine_max_acceleration_y": [ + "5000" + ], + "machine_max_acceleration_z": [ + "100" + ], + "machine_max_jerk_e": [ + "2.5" + ], + "machine_max_jerk_x": [ + "10" + ], + "machine_max_jerk_y": [ + "10" + ], + "machine_max_jerk_z": [ + "0.4" + ], + "machine_max_speed_e": [ + "60" + ], + "machine_max_speed_x": [ + "500" + ], + "machine_max_speed_y": [ + "500" + ], + "machine_max_speed_z": [ + "20" + ], + "retraction_length": [ + "2" + ], + "retraction_speed": [ + "40" + ], + "deretraction_speed": [ + "40" + ], + "z_hop": [ + "0.4" + ], + "retract_lift_below": [ + "300" + ], + "machine_start_gcode": "; === IdeaFormer IR3 V2 Belt Printer Start ===\n; Axes: X=lateral, Y=gantry height (probe), Z=belt\nG90 ; absolute positioning\nM82 ; absolute extruder\nG21 ; millimeters\nG28 ; home all axes\nG1 Y20 F500 ; lift nozzle 20mm from belt\n; Bed + hotend temps come from the active filament profile. Belt PLA requires 75 C bed — use Generic/eSun PLA @IdeaFormer IR3 V2 filament presets to get it automatically.\nM140 S[hot_plate_temp_initial_layer] ; set bed temp\nM104 S[nozzle_temperature_initial_layer] ; hotend temp\nM109 S[nozzle_temperature_initial_layer] ; wait hotend\nM190 S[hot_plate_temp_initial_layer] ; wait bed\n; --- Purge blob ---\nG92 E0 ; zero extruder\nG1 Y.1 ; nozzle 0.1mm above belt\nG1 E15 F1000 ; purge 15mm blob\nG1 Z20 E25 F800 ; belt advance 20mm + extrude\nG1 E23 ; retract 2mm\nG28 Y ; re-probe belt surface\nG1 E25 ; de-retract\n; --- Prime lines (full 250mm bed width) ---\nFMS_on ; filament motion sensor\nG1 X250 E50 F2000 ; prime line 1\nG92 Z0 ; reset belt origin\nG1 Z.4 ; belt advance 0.4mm\nG1 X0 E75 ; prime line 2\nG1 F1000 ; default feedrate\nG92 E0 Z0 ; zero extruder + belt = print origin\n", + "machine_end_gcode": "; === IdeaFormer IR3 V2 Belt Printer End ===\nM400 ; wait for moves to finish\nG28 X ; home X axis\nM104 S0 ; heater off\nM140 S0 ; bed off\nG92 E0 ; zero extruder\nG1 E-5 F300 ; retract 5mm\nG4 P7000 ; wait 7s for ooze\nG28 ; home all\nG1 Y50 F1000 ; lift nozzle 50mm\nFMS_off ; filament motion sensor off\nBED_MESH_CLEAR\nM84 ; disable motors\n", + "machine_pause_gcode": "PAUSE", + "layer_change_gcode": "G92 E0 ; belt: reset extruder at layer change (relative E)" +} diff --git a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2.json new file mode 100644 index 0000000000..bc6d1a6e77 --- /dev/null +++ b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2.json @@ -0,0 +1,12 @@ +{ + "type": "machine_model", + "name": "IdeaFormer IR3 V2", + "model_id": "IdeaFormer_IR3_V2", + "nozzle_diameter": "0.4", + "machine_tech": "FFF", + "family": "IdeaFormer", + "bed_model": "", + "bed_texture": "", + "hotend_model": "", + "default_materials": "Generic PLA @IdeaFormer IR3 V2;Generic PETG @IdeaFormer IR3 V2" +} diff --git a/resources/profiles/IdeaFormer/machine/fdm_belt_common.json b/resources/profiles/IdeaFormer/machine/fdm_belt_common.json new file mode 100644 index 0000000000..0530999f15 --- /dev/null +++ b/resources/profiles/IdeaFormer/machine/fdm_belt_common.json @@ -0,0 +1,101 @@ +{ + "type": "machine", + "name": "fdm_belt_common", + "inherits": "fdm_klipper_common", + "from": "system", + "instantiation": "false", + "gcode_flavor": "klipper", + "single_extruder_multi_material": "0", + "default_filament_profile": [ + "Generic PLA @System" + ], + "default_print_profile": "0.20mm Standard @System", + "max_layer_height": [ + "0.32" + ], + "min_layer_height": [ + "0.08" + ], + "deretraction_speed": [ + "30" + ], + "extruder_colour": [ + "#FCE94F" + ], + "extruder_offset": [ + "0x0" + ], + "long_retractions_when_cut": [ + "0" + ], + "nozzle_diameter": [ + "0.4" + ], + "retract_before_wipe": [ + "70%" + ], + "retract_length_toolchange": [ + "2" + ], + "retract_lift_above": [ + "0" + ], + "retract_lift_below": [ + "0" + ], + "retract_lift_enforce": [ + "All Surfaces" + ], + "retract_restart_extra": [ + "0" + ], + "retract_restart_extra_toolchange": [ + "0" + ], + "retract_when_changing_layer": [ + "1" + ], + "retraction_distances_when_cut": [ + "18" + ], + "retraction_length": [ + "0.8" + ], + "retraction_minimum_travel": [ + "1" + ], + "retraction_speed": [ + "30" + ], + "travel_slope": [ + "3" + ], + "wipe": [ + "1" + ], + "wipe_distance": [ + "1" + ], + "z_hop": [ + "0.4" + ], + "z_hop_types": [ + "Normal Lift" + ], + "gcode_remap_x": "rev_x", + "gcode_remap_y": "pos_z", + "gcode_remap_z": "pos_y", + "printer_extruder_id": [ + "1" + ], + "belt_printer": "1", + "belt_slice_rotation": "x", + "belt_slice_rotation_angle": "45", + "belt_slice_rotation_global": "1", + "build_plate_tilt_x": "45", + "gcode_shear_z": "pos_tan", + "gcode_scale_y": "inv_cos", + "purge_in_prime_tower": "0", + "scan_first_layer": "0", + "auxiliary_fan": "0" +} diff --git a/resources/profiles/IdeaFormer/machine/fdm_klipper_common.json b/resources/profiles/IdeaFormer/machine/fdm_klipper_common.json new file mode 100644 index 0000000000..36f3fe13c6 --- /dev/null +++ b/resources/profiles/IdeaFormer/machine/fdm_klipper_common.json @@ -0,0 +1,141 @@ +{ + "type": "machine", + "name": "fdm_klipper_common", + "inherits": "fdm_machine_common", + "from": "system", + "instantiation": "false", + "gcode_flavor": "klipper", + "machine_max_acceleration_e": [ + "5000", + "5000" + ], + "machine_max_acceleration_extruding": [ + "20000", + "20000" + ], + "machine_max_acceleration_retracting": [ + "5000", + "5000" + ], + "machine_max_acceleration_travel": [ + "20000", + "20000" + ], + "machine_max_acceleration_x": [ + "20000", + "20000" + ], + "machine_max_acceleration_y": [ + "20000", + "20000" + ], + "machine_max_acceleration_z": [ + "500", + "200" + ], + "machine_max_speed_e": [ + "25", + "25" + ], + "machine_max_speed_x": [ + "500", + "200" + ], + "machine_max_speed_y": [ + "500", + "200" + ], + "machine_max_speed_z": [ + "12", + "12" + ], + "machine_max_jerk_e": [ + "2.5", + "2.5" + ], + "machine_max_jerk_x": [ + "9", + "9" + ], + "machine_max_jerk_y": [ + "9", + "9" + ], + "machine_max_jerk_z": [ + "0.2", + "0.4" + ], + "machine_min_extruding_rate": [ + "0", + "0" + ], + "machine_min_travel_rate": [ + "0", + "0" + ], + "max_layer_height": [ + "0.32" + ], + "min_layer_height": [ + "0.08" + ], + "printable_height": "250", + "extruder_clearance_radius": "65", + "extruder_clearance_height_to_rod": "36", + "extruder_clearance_height_to_lid": "140", + "printer_settings_id": "", + "printer_technology": "FFF", + "printer_variant": "0.4", + "retraction_minimum_travel": [ + "1" + ], + "retract_before_wipe": [ + "70%" + ], + "retract_when_changing_layer": [ + "1" + ], + "retraction_length": [ + "0.8" + ], + "retract_length_toolchange": [ + "2" + ], + "z_hop": [ + "0.4" + ], + "retract_restart_extra": [ + "0" + ], + "retract_restart_extra_toolchange": [ + "0" + ], + "retraction_speed": [ + "30" + ], + "deretraction_speed": [ + "30" + ], + "z_hop_types": "Normal Lift", + "silent_mode": "0", + "single_extruder_multi_material": "1", + "change_filament_gcode": "", + "wipe": [ + "1" + ], + "default_filament_profile": [ + "Generic PLA @System" + ], + "default_print_profile": "0.20mm Standard @MyKlipper", + "bed_exclude_area": [ + "0x0" + ], + "machine_start_gcode": "M190 S[bed_temperature_initial_layer_single]\nM109 S[nozzle_temperature_initial_layer]\nPRINT_START EXTRUDER=[nozzle_temperature_initial_layer] BED=[bed_temperature_initial_layer_single]\n", + "machine_end_gcode": "PRINT_END", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", + "machine_pause_gcode": "PAUSE", + "scan_first_layer": "0", + "nozzle_type": "undefine", + "auxiliary_fan": "0" +} diff --git a/resources/profiles/IdeaFormer/machine/fdm_machine_common.json b/resources/profiles/IdeaFormer/machine/fdm_machine_common.json new file mode 100644 index 0000000000..963f39c9d8 --- /dev/null +++ b/resources/profiles/IdeaFormer/machine/fdm_machine_common.json @@ -0,0 +1,119 @@ +{ + "type": "machine", + "name": "fdm_machine_common", + "from": "system", + "instantiation": "false", + "printer_technology": "FFF", + "deretraction_speed": [ + "40" + ], + "extruder_colour": [ + "#FCE94F" + ], + "extruder_offset": [ + "0x0" + ], + "gcode_flavor": "marlin", + "silent_mode": "0", + "machine_max_acceleration_e": [ + "5000" + ], + "machine_max_acceleration_extruding": [ + "10000" + ], + "machine_max_acceleration_retracting": [ + "1000" + ], + "machine_max_acceleration_x": [ + "10000" + ], + "machine_max_acceleration_y": [ + "10000" + ], + "machine_max_acceleration_z": [ + "500" + ], + "machine_max_speed_e": [ + "60" + ], + "machine_max_speed_x": [ + "500" + ], + "machine_max_speed_y": [ + "500" + ], + "machine_max_speed_z": [ + "10" + ], + "machine_max_jerk_e": [ + "5" + ], + "machine_max_jerk_x": [ + "8" + ], + "machine_max_jerk_y": [ + "8" + ], + "machine_max_jerk_z": [ + "0.4" + ], + "machine_min_extruding_rate": [ + "0" + ], + "machine_min_travel_rate": [ + "0" + ], + "max_layer_height": [ + "0.32" + ], + "min_layer_height": [ + "0.08" + ], + "printable_height": "250", + "extruder_clearance_radius": "65", + "extruder_clearance_height_to_rod": "36", + "extruder_clearance_height_to_lid": "140", + "nozzle_diameter": [ + "0.4" + ], + "printer_settings_id": "", + "printer_variant": "0.4", + "retraction_minimum_travel": [ + "2" + ], + "retract_before_wipe": [ + "70%" + ], + "retract_when_changing_layer": [ + "1" + ], + "retraction_length": [ + "1" + ], + "retract_length_toolchange": [ + "1" + ], + "z_hop": [ + "0" + ], + "retract_restart_extra": [ + "0" + ], + "retract_restart_extra_toolchange": [ + "0" + ], + "retraction_speed": [ + "60" + ], + "single_extruder_multi_material": "1", + "change_filament_gcode": "", + "wipe": [ + "1" + ], + "default_print_profile": "", + "machine_start_gcode": "G0 Z20 F9000\nG92 E0; G1 E-10 F1200\nG28\nM970 Q1 A10 B10 C130 K0\nM970 Q1 A10 B131 C250 K1\nM974 Q1 S1 P0\nM970 Q0 A10 B10 C130 H20 K0\nM970 Q0 A10 B131 C250 K1\nM974 Q0 S1 P0\nM220 S100 ;Reset Feedrate\nM221 S100 ;Reset Flowrate\nG29 ;Home\nG90;\nG92 E0 ;Reset Extruder \nG1 Z2.0 F3000 ;Move Z Axis up \nG1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position\nM109 S205;\nG1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line\nG1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little\nG1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line\nG92 E0 ;Reset Extruder \nG1 X110 Y110 Z2.0 F3000 ;Move Z Axis up", + "machine_end_gcode": "M400 ; wait for buffer to clear\nG92 E0 ; zero the extruder\nG1 E-4.0 F3600; retract \nG91\nG1 Z3;\nM104 S0 ; turn off hotend\nM140 S0 ; turn off bed\nM106 S0 ; turn off fan\nG90 \nG0 X110 Y200 F3600 \nprint_end", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", + "machine_pause_gcode": "M601" +} diff --git a/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json new file mode 100644 index 0000000000..f8e8a69e0f --- /dev/null +++ b/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json @@ -0,0 +1,21 @@ +{ + "type": "process", + "name": "0.20mm Standard @IdeaFormer IR3 V2", + "inherits": "fdm_process_common", + "from": "system", + "instantiation": "true", + "layer_height": "0.2", + "initial_layer_print_height": "0.2", + "initial_layer_line_width": "0.42", + "wall_loops": "2", + "reduce_infill_retraction": "1", + "detect_overhang_wall": "1", + "skirt_loops": "0", + "skirt_distance": "0", + "sparse_infill_pattern": "grid", + "support_base_pattern": "rectilinear", + "support_interface_pattern": "rectilinear", + "compatible_printers": [ + "IdeaFormer IR3 V2 0.4 nozzle" + ] +} diff --git a/resources/profiles/IdeaFormer/process/fdm_process_common.json b/resources/profiles/IdeaFormer/process/fdm_process_common.json new file mode 100644 index 0000000000..b8e882770a --- /dev/null +++ b/resources/profiles/IdeaFormer/process/fdm_process_common.json @@ -0,0 +1,108 @@ +{ + "type": "process", + "name": "fdm_process_common", + "from": "system", + "instantiation": "false", + "adaptive_layer_height": "0", + "reduce_crossing_wall": "0", + "max_travel_detour_distance": "0", + "bottom_surface_pattern": "monotonic", + "bottom_shell_thickness": "0", + "bridge_speed": "50", + "brim_width": "5", + "brim_object_gap": "0.1", + "compatible_printers": [], + "compatible_printers_condition": "", + "print_sequence": "by layer", + "default_acceleration": "1000", + "initial_layer_acceleration": "500", + "top_surface_acceleration": "1000", + "travel_acceleration": "1000", + "inner_wall_acceleration": "1000", + "outer_wall_acceleration": "700", + "bridge_no_support": "0", + "draft_shield": "disabled", + "elefant_foot_compensation": "0", + "enable_arc_fitting": "0", + "wall_infill_order": "inner wall/outer wall/infill", + "infill_direction": "45", + "sparse_infill_density": "15%", + "sparse_infill_pattern": "crosshatch", + "initial_layer_print_height": "0.2", + "infill_combination": "0", + "infill_wall_overlap": "25%", + "interface_shells": "0", + "ironing_flow": "10%", + "ironing_spacing": "0.15", + "ironing_speed": "30", + "ironing_type": "no ironing", + "reduce_infill_retraction": "1", + "filename_format": "{input_filename_base}_{layer_height}mm_{filament_type[initial_tool]}_{printer_model}_{print_time}.gcode", + "detect_overhang_wall": "1", + "slowdown_for_curled_perimeters": "1", + "overhang_1_4_speed": "0", + "overhang_2_4_speed": "50", + "overhang_3_4_speed": "30", + "overhang_4_4_speed": "10", + "line_width": "110%", + "inner_wall_line_width": "110%", + "outer_wall_line_width": "100%", + "top_surface_line_width": "93.75%", + "sparse_infill_line_width": "110%", + "initial_layer_line_width": "120%", + "internal_solid_infill_line_width": "120%", + "support_line_width": "96%", + "wall_loops": "3", + "print_settings_id": "", + "raft_layers": "0", + "seam_position": "aligned", + "skirt_distance": "2", + "skirt_height": "3", + "min_skirt_length": "4", + "skirt_loops": "0", + "minimum_sparse_infill_area": "15", + "spiral_mode": "0", + "standby_temperature_delta": "-5", + "enable_support": "0", + "resolution": "0.012", + "support_type": "normal(auto)", + "support_on_build_plate_only": "0", + "support_top_z_distance": "0.2", + "support_bottom_z_distance": "0.2", + "support_filament": "0", + "support_interface_loop_pattern": "0", + "support_interface_filament": "0", + "support_interface_top_layers": "2", + "support_interface_bottom_layers": "2", + "support_interface_spacing": "0.5", + "support_interface_speed": "80", + "support_base_pattern": "default", + "support_base_pattern_spacing": "2.5", + "support_speed": "150", + "support_threshold_angle": "30", + "support_object_xy_distance": "0.35", + "tree_support_branch_angle": "30", + "tree_support_wall_count": "0", + "tree_support_with_infill": "0", + "detect_thin_wall": "0", + "top_surface_pattern": "monotonicline", + "top_shell_thickness": "0.8", + "enable_prime_tower": "1", + "wipe_tower_no_sparse_layers": "0", + "prime_tower_width": "60", + "xy_hole_compensation": "0", + "xy_contour_compensation": "0", + "layer_height": "0.2", + "bottom_shell_layers": "3", + "top_shell_layers": "4", + "bridge_flow": "1", + "initial_layer_speed": "45", + "initial_layer_infill_speed": "45", + "outer_wall_speed": "45", + "inner_wall_speed": "80", + "sparse_infill_speed": "150", + "internal_solid_infill_speed": "150", + "top_surface_speed": "50", + "gap_infill_speed": "30", + "travel_speed": "200" +} From 9405ac59766e8e12c697d6e921ac457ecc6daf39 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Mon, 8 Jun 2026 05:36:46 -0500 Subject: [PATCH 039/389] remove mesh origin snapping --- src/libslic3r/BeltGCode.cpp | 101 ++++-------------------------- src/libslic3r/BeltGCode.hpp | 7 +-- src/libslic3r/BeltGCodeWriter.cpp | 28 +-------- src/libslic3r/BeltGCodeWriter.hpp | 12 +--- src/libslic3r/Preset.cpp | 3 - src/libslic3r/Print.cpp | 3 - src/libslic3r/PrintConfig.cpp | 25 -------- src/libslic3r/PrintConfig.hpp | 6 -- src/slic3r/GUI/Tab.cpp | 25 -------- 9 files changed, 17 insertions(+), 193 deletions(-) diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index 8c8c3d4392..8184692862 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -3,8 +3,6 @@ #include "BeltTransform.hpp" #include "Print.hpp" -#include - namespace Slic3r { void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) @@ -18,14 +16,6 @@ void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) belt_writer->set_belt_back_transform(print.config()); belt_writer->set_machine_frame_transform(print.config()); m_writer = std::move(belt_writer); - - // Per-axis origin snap config. - m_origin_snap[0] = print.config().belt_origin_snap_x.value; - m_origin_snap[1] = print.config().belt_origin_snap_y.value; - m_origin_snap[2] = print.config().belt_origin_snap_z.value; - m_origin_snap_offset[0] = print.config().belt_origin_offset_x.value; - m_origin_snap_offset[1] = print.config().belt_origin_offset_y.value; - m_origin_snap_offset[2] = print.config().belt_origin_offset_z.value; } void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) @@ -64,103 +54,36 @@ void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) file.write_format("; belt_gcode_transform_order = %s\n", full_cfg.opt_serialize("belt_gcode_transform_order").c_str()); } -void BeltGCode::on_set_origin(const PrintObject *obj, const Point &inst_shift) +void BeltGCode::on_set_origin(const PrintObject * /*obj*/, const Point & /*inst_shift*/) { // Global pre-slice mode: adjust origin using computed correction. // Transform the origin through the belt pipeline so that // back_transform(T * origin) = origin (correct machine position). - // This replaces the bbox-based axis snap with an exact formula. // // Flags that trigger this path: // belt_preslice_global — full pipeline (rotation * remap) is global // preslice_remap_global — only the pre-slice remap is global // belt_slice_rotation_global — slicing rotation treated as global (matches // the per-instance Z-offset added in PrintObjectSlice.cpp) - // The XY origin adjustment uses the FULL forward transform either way, - // because the back_transform applied during G-code emission is always the - // inverse of the full pipeline. + // The XY origin adjustment uses the FULL forward transform, because the + // back_transform applied during G-code emission is always the inverse of + // the full pipeline. bool use_global = m_config.belt_preslice_global.value || (m_config.preslice_remap_global.value && BeltTransformPipeline::has_preslice_remap(m_config)) || (m_config.belt_slice_rotation_global.value && m_config.belt_slice_rotation.value != BeltRotationAxis::None && std::abs(m_config.belt_slice_rotation_angle.value) > EPSILON); - if (use_global && m_config.belt_printer.value) { - auto *belt_writer = dynamic_cast(m_writer.get()); - if (belt_writer) { - // The per-object lift (z_shift_val = max(0, -m_belt_min_z)) added by - // BeltSliceStrategy::apply_to_trafo is already compensated inside - // global_z_offset (via the belt_z_shift term in PrintObjectSlice.cpp). - // Snap was previously used here for the same purpose, but with both - // active the lift gets subtracted twice. Clear any leftover snap - // state from a prior instance. - for (int a = 0; a < 3; ++a) - belt_writer->set_origin_snap(a, false, 0., 0.); - } - - // Adjust origin: transform through belt forward pipeline so that - // the back-transform correctly recovers model-space positions. - Transform3d T = BeltTransformPipeline::build_forward_transform(m_config); - Vec2d cur_origin = this->origin(); - Vec3d origin3d(cur_origin.x(), cur_origin.y(), 0.); - Vec3d adjusted = T.linear() * origin3d; - this->set_origin(Vec2d(adjusted.x(), adjusted.y())); - return; - } - - if (!m_origin_snap[0] && !m_origin_snap[1] && !m_origin_snap[2]) + if (!use_global || !m_config.belt_printer.value) return; - auto *belt_writer = dynamic_cast(m_writer.get()); - if (!belt_writer) - return; - - // Clear existing snap so to_machine_coords gives raw machine coords for bbox computation. - for (int a = 0; a < 3; ++a) - belt_writer->set_origin_snap(a, false, 0., 0.); - - // Reconstruct the belt pipeline transform for this object. - Transform3d belt = BeltTransformPipeline::build_forward_transform(m_config); - - // Z-shift - double zs = (obj->belt_min_z() < 0.) ? -obj->belt_min_z() : 0.; - if (zs > 0.) { - Transform3d zsh = Transform3d::Identity(); - zsh.matrix()(2, 3) = zs; - belt = zsh * belt; - } - - // Full transform: belt * trafo_centered - Transform3d full = belt * obj->trafo_centered(); - - // Instance shift in slicer space + global Z offset - Vec3d shift(unscale(inst_shift.x()), - unscale(inst_shift.y()), - obj->belt_global_z_offset()); - - // Compute this instance's bbox min in the Cartesian frame (post back_transform - // + axis_remap, before machine_frame_transform). Using to_cartesian instead of - // to_machine_coords ensures the 8 axis-aligned bbox corners coincide with the - // geometry's extreme points — a property that breaks under shear, which would - // mis-normalize non-cubic shapes (inverted cone, benchy) by their bbox-volume - // corners rather than their actual lowest geometry point. - BoundingBoxf3 bb = obj->model_object()->raw_bounding_box(); - Vec3d mn = bb.min.cast(), mx = bb.max.cast(); - Vec3d inst_min(std::numeric_limits::max(), - std::numeric_limits::max(), - std::numeric_limits::max()); - for (int i = 0; i < 8; ++i) { - Vec3d c((i & 1) ? mx.x() : mn.x(), - (i & 2) ? mx.y() : mn.y(), - (i & 4) ? mx.z() : mn.z()); - Vec3d mc = belt_writer->to_cartesian(full * c + shift); - for (int a = 0; a < 3; ++a) - inst_min[a] = std::min(inst_min[a], mc[a]); - } - - // Update writer snap for each enabled axis - for (int a = 0; a < 3; ++a) - belt_writer->set_origin_snap(a, m_origin_snap[a], m_origin_snap_offset[a], inst_min[a]); + // Adjust origin: transform through belt forward pipeline so that + // the back-transform correctly recovers model-space positions. + Transform3d T = BeltTransformPipeline::build_forward_transform(m_config); + Vec2d cur_origin = this->origin(); + Vec3d origin3d(cur_origin.x(), cur_origin.y(), 0.); + Vec3d adjusted = T.linear() * origin3d; + this->set_origin(Vec2d(adjusted.x(), adjusted.y())); } } // namespace Slic3r diff --git a/src/libslic3r/BeltGCode.hpp b/src/libslic3r/BeltGCode.hpp index 682deb7d65..2a3718b49f 100644 --- a/src/libslic3r/BeltGCode.hpp +++ b/src/libslic3r/BeltGCode.hpp @@ -9,7 +9,7 @@ namespace Slic3r { // Inherits from GCode and overrides virtual hooks to: // - Create a BeltGCodeWriter instead of a plain GCodeWriter // - Write belt configuration to the G-code header -// - Update per-axis origin snap when switching instances +// - Adjust the origin for global pre-slice transforms when switching instances // - Disable arc fitting (G2/G3 not supported on belt printers) class BeltGCode : public GCode { @@ -18,11 +18,6 @@ protected: void write_belt_header(GCodeOutputStream &file, const Print &print) override; void on_set_origin(const PrintObject *obj, const Point &inst_shift) override; bool should_disable_arc_fitting() const override { return true; } - -private: - // Per-axis origin snap config (set during init, used in on_set_origin). - bool m_origin_snap[3] = {false, false, false}; - double m_origin_snap_offset[3] = {0., 0., 0.}; }; } // namespace Slic3r diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index 9f1f32a375..a2322c9243 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -35,37 +35,14 @@ void BeltGCodeWriter::set_machine_frame_transform(const PrintConfig &config) m_machine_frame_transform.init_from_config(config); } -void BeltGCodeWriter::set_origin_snap(int axis, bool enable, double offset, double bbox_min) -{ - if (axis >= 0 && axis < 3) { - m_origin_snap[axis] = enable; - m_origin_offset[axis] = offset; - m_origin_bbox_min[axis] = bbox_min; - } -} - -Vec3d BeltGCodeWriter::to_cartesian(const Vec3d &pos) const -{ - // back_transform → axis_remap, no origin_snap, no machine_frame_transform. - return apply_axis_remap(m_belt_back_transform.apply(pos)); -} - Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const { // Step 1+2: To Cartesian (back_transform + axis_remap). Vec3d after_back = m_belt_back_transform.apply(pos); Vec3d result = apply_axis_remap(after_back); Vec3d after_remap = result; - // Step 3: Per-axis origin snap (computed in the Cartesian frame). - for (int i = 0; i < 3; ++i) - if (m_origin_snap[i]) - result[i] -= (m_origin_bbox_min[i] - m_origin_offset[i]); - Vec3d after_snap = result; - // Step 4: Machine-frame transform (gcode_shear / gcode_scale) - // applied LAST so it acts as a global linear transform on the placed coords. - // Order matters: putting it before origin_snap would feed sheared bbox corners - // into the snap's per-object min calculation, mis-normalizing non-cubic geometries - // (the corners of the original bbox aren't extreme points of the sheared shape). + // Step 3: Machine-frame transform (belt frame tilt) applied LAST so it acts + // as a global linear transform on the placed coords. Vec3d final = m_machine_frame_transform.apply(result); // [BELT-DEBUG] One-shot log per layer transition (i.e. when the input Z @@ -80,7 +57,6 @@ Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const << " slicer_in=(" << pos.x() << "," << pos.y() << "," << pos.z() << ")" << " after_back=(" << after_back.x() << "," << after_back.y() << "," << after_back.z() << ")" << " after_remap=(" << after_remap.x() << "," << after_remap.y() << "," << after_remap.z() << ")" - << " after_snap=(" << after_snap.x() << "," << after_snap.y() << "," << after_snap.z() << ")" << " final=(" << final.x() << "," << final.y() << "," << final.z() << ")" << " mft_active=" << m_machine_frame_transform.is_active() << " back_active=" << m_belt_back_transform.is_active(); diff --git a/src/libslic3r/BeltGCodeWriter.hpp b/src/libslic3r/BeltGCodeWriter.hpp index e9d4af0f3a..30159f4f33 100644 --- a/src/libslic3r/BeltGCodeWriter.hpp +++ b/src/libslic3r/BeltGCodeWriter.hpp @@ -11,8 +11,8 @@ class FirstLayerPlane; // Belt-printer-specific GCode writer. // // Inherits from GCodeWriter and overrides movement methods to apply -// coordinate transformation (back-transform, axis remap, origin snap) -// and emit coupled XYZ moves (Y and Z are coupled due to belt tilt). +// coordinate transformation (back-transform, axis remap, machine-frame +// transform) and emit coupled XYZ moves (Y and Z are coupled due to belt tilt). class BeltGCodeWriter : public GCodeWriter { public: @@ -21,12 +21,7 @@ public: // Belt configuration (axis remap is inherited from GCodeWriter) void set_belt_back_transform(const PrintConfig &config); void set_machine_frame_transform(const PrintConfig &config); - void set_origin_snap(int axis, bool enable, double offset, double bbox_min); Vec3d to_machine_coords(const Vec3d &pos) const; - // back_transform + axis_remap only (no origin_snap, no machine_frame_transform). - // Used by on_set_origin for bbox computation in the Cartesian frame, where - // axis-aligned bbox corners coincide with the geometry's extreme points. - Vec3d to_cartesian(const Vec3d &pos) const; // First-layer plane: when set to a non-null active evaluator, travel // speed selection consults the plane per-move and uses @@ -52,9 +47,6 @@ protected: private: BeltBackTransform m_belt_back_transform; MachineFrameTransform m_machine_frame_transform; - bool m_origin_snap[3] = {false, false, false}; - double m_origin_offset[3] = {0., 0., 0.}; - double m_origin_bbox_min[3] = {0., 0., 0.}; // Borrowed pointer; lifetime owned by GCode. null = inactive. const FirstLayerPlane *m_first_layer_plane = nullptr; double m_first_layer_thickness_mm = 0.; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 694cd284e3..9b514bb291 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1339,9 +1339,6 @@ static std::vector s_Preset_printer_options { "belt_gcode_transform_order", "belt_preslice_global", "first_layer_plane", "first_layer_plane_offset", "first_layer_plane_thickness", - "belt_origin_snap_x", "belt_origin_offset_x", - "belt_origin_snap_y", "belt_origin_offset_y", - "belt_origin_snap_z", "belt_origin_offset_z", "belt_support_floor_offset", "belt_support_floor_mode", "belt_support_z_offset_mode", "gcode_flavor", "fan_kickstart", "part_cooling_fan_min_pwm", "fan_speedup_time", "fan_speedup_overhangs", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index f55dd31fc1..099a592509 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -112,9 +112,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "gcode_scale_y", "gcode_scale_y_angle", "gcode_scale_z", "gcode_scale_z_angle", "belt_gcode_transform_order", - "belt_origin_snap_x", "belt_origin_offset_x", - "belt_origin_snap_y", "belt_origin_offset_y", - "belt_origin_snap_z", "belt_origin_offset_z", //BBS "additional_cooling_fan_speed", "reduce_crossing_wall", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index c1c411c7b6..cdb2ec1d5d 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6782,31 +6782,6 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(-1.0)); - auto add_belt_origin_snap = [this](const char *key_snap, const char *key_offset, - const char *axis_label) { - auto def = this->add(key_snap, coBool); - def->label = L(axis_label); - def->category = L("Printable space"); - std::string tip = std::string("Shift G-code output so the object's bounding box minimum on machine ") - + axis_label + " equals the offset value."; - def->tooltip = L(tip); - def->mode = comExpert; - def->set_default_value(new ConfigOptionBool(false)); - - def = this->add(key_offset, coFloat); - def->label = L("Offset"); - def->category = L("Printable space"); - def->tooltip = L("Target coordinate for the bounding box minimum on this machine axis."); - def->sidetext = L("mm"); - def->min = -10000; - def->max = 10000; - def->mode = comExpert; - def->set_default_value(new ConfigOptionFloat(0)); - }; - add_belt_origin_snap("belt_origin_snap_x", "belt_origin_offset_x", "X"); - add_belt_origin_snap("belt_origin_snap_y", "belt_origin_offset_y", "Y"); - add_belt_origin_snap("belt_origin_snap_z", "belt_origin_offset_z", "Z"); - // Belt support floor debug controls def = this->add("belt_support_floor_offset", coFloat); def->label = L("Support Floor Z offset"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 4a53aa7ac2..a31179cd9b 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1619,12 +1619,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, first_layer_plane)) ((ConfigOptionFloat, first_layer_plane_offset)) ((ConfigOptionFloat, first_layer_plane_thickness)) - ((ConfigOptionBool, belt_origin_snap_x)) - ((ConfigOptionFloat, belt_origin_offset_x)) - ((ConfigOptionBool, belt_origin_snap_y)) - ((ConfigOptionFloat, belt_origin_offset_y)) - ((ConfigOptionBool, belt_origin_snap_z)) - ((ConfigOptionFloat, belt_origin_offset_z)) ((ConfigOptionFloat, belt_support_floor_offset)) ((ConfigOptionEnum, belt_support_floor_mode)) ((ConfigOptionEnum, belt_support_z_offset_mode)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index bcbcce1d66..4027a671e7 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4535,24 +4535,6 @@ void TabPrinter::build_fff() line.append_option(belt_og->get_option("first_layer_plane_thickness")); belt_og->append_line(line); } - { - Line line = { L("Origin snap X"), L("Snap object bbox min X to offset in G-code output") }; - line.append_option(belt_og->get_option("belt_origin_snap_x")); - line.append_option(belt_og->get_option("belt_origin_offset_x")); - belt_og->append_line(line); - } - { - Line line = { L("Origin snap Y"), L("Snap object bbox min Y to offset in G-code output") }; - line.append_option(belt_og->get_option("belt_origin_snap_y")); - line.append_option(belt_og->get_option("belt_origin_offset_y")); - belt_og->append_line(line); - } - { - Line line = { L("Origin snap Z"), L("Snap object bbox min Z to offset in G-code output") }; - line.append_option(belt_og->get_option("belt_origin_snap_z")); - line.append_option(belt_og->get_option("belt_origin_offset_z")); - belt_og->append_line(line); - } // Support floor: split across lines so each setting's own mode controls // its visibility (floor_mode = Develop, floor_offset = Advanced, z_offset_mode = Expert). belt_og->append_single_option_line("belt_support_floor_offset"); @@ -5591,8 +5573,6 @@ void TabPrinter::toggle_options() toggle_line("belt_printer_infinite_y", is_belt); // Belt tilt: the sole mesh-side belt transform (visible by default in belt mode). toggle_line("belt_slice_rotation", is_belt); - for (auto el : {"belt_origin_snap_x", "belt_origin_snap_y", "belt_origin_snap_z"}) - toggle_line(el, is_belt); // Remap, back-transform, and global mesh-transforms toggles are gated by belt // mode here; finer mode-based visibility (Advanced vs Expert) is handled by @@ -5643,11 +5623,6 @@ void TabPrinter::toggle_options() auto gscz = m_config->option>("gcode_scale_z")->value; toggle_option("gcode_scale_z_angle", is_belt && gscz != BeltScaleMode::None); - // Origin snap is superseded by belt_preslice_global - toggle_option("belt_origin_offset_x", is_belt && m_config->opt_bool("belt_origin_snap_x") && !belt_global); - toggle_option("belt_origin_offset_y", is_belt && m_config->opt_bool("belt_origin_snap_y") && !belt_global); - toggle_option("belt_origin_offset_z", is_belt && m_config->opt_bool("belt_origin_snap_z") && !belt_global); - // First-layer plane: visible alongside the rest of belt-printer settings. toggle_line("first_layer_plane", is_belt); toggle_option("first_layer_plane_offset", is_belt); From fee6be98b2bc9953b3f5ba4a948b269a5f153a40 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Mon, 8 Jun 2026 06:16:48 -0500 Subject: [PATCH 040/389] unify frame tilt work --- .../Custom/machine/fdm_belt_common.json | 2 - src/libslic3r/BeltGCode.cpp | 21 +-- src/libslic3r/BeltTransform.hpp | 37 +---- src/libslic3r/GCode/MachineFrameTransform.cpp | 102 +++++------- src/libslic3r/GCode/MachineFrameTransform.hpp | 15 +- src/libslic3r/Preset.cpp | 8 +- src/libslic3r/Print.cpp | 10 +- src/libslic3r/PrintConfig.cpp | 157 +++--------------- src/libslic3r/PrintConfig.hpp | 75 ++------- src/slic3r/GUI/Tab.cpp | 86 ++-------- 10 files changed, 112 insertions(+), 401 deletions(-) diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index 0530999f15..b010742d78 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -93,8 +93,6 @@ "belt_slice_rotation_angle": "45", "belt_slice_rotation_global": "1", "build_plate_tilt_x": "45", - "gcode_shear_z": "pos_tan", - "gcode_scale_y": "inv_cos", "purge_in_prime_tower": "0", "scan_first_layer": "0", "auxiliary_fan": "0" diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index 8184692862..3ba2f79e55 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -35,23 +35,10 @@ void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) file.write_format("; preslice_remap_z = %s\n", full_cfg.opt_serialize("preslice_remap_z").c_str()); file.write_format("; preslice_remap_global = %d\n", print.config().preslice_remap_global.value ? 1 : 0); file.write_format("; belt_preslice_global = %d\n", print.config().belt_preslice_global.value ? 1 : 0); - // Machine-frame transform configs - file.write_format("; gcode_shear_x = %s\n", full_cfg.opt_serialize("gcode_shear_x").c_str()); - file.write_format("; gcode_shear_x_angle = %.1f\n", print.config().gcode_shear_x_angle.value); - file.write_format("; gcode_shear_x_from = %s\n", full_cfg.opt_serialize("gcode_shear_x_from").c_str()); - file.write_format("; gcode_shear_y = %s\n", full_cfg.opt_serialize("gcode_shear_y").c_str()); - file.write_format("; gcode_shear_y_angle = %.1f\n", print.config().gcode_shear_y_angle.value); - file.write_format("; gcode_shear_y_from = %s\n", full_cfg.opt_serialize("gcode_shear_y_from").c_str()); - file.write_format("; gcode_shear_z = %s\n", full_cfg.opt_serialize("gcode_shear_z").c_str()); - file.write_format("; gcode_shear_z_angle = %.1f\n", print.config().gcode_shear_z_angle.value); - file.write_format("; gcode_shear_z_from = %s\n", full_cfg.opt_serialize("gcode_shear_z_from").c_str()); - file.write_format("; gcode_scale_x = %s\n", full_cfg.opt_serialize("gcode_scale_x").c_str()); - file.write_format("; gcode_scale_x_angle = %.1f\n", print.config().gcode_scale_x_angle.value); - file.write_format("; gcode_scale_y = %s\n", full_cfg.opt_serialize("gcode_scale_y").c_str()); - file.write_format("; gcode_scale_y_angle = %.1f\n", print.config().gcode_scale_y_angle.value); - file.write_format("; gcode_scale_z = %s\n", full_cfg.opt_serialize("gcode_scale_z").c_str()); - file.write_format("; gcode_scale_z_angle = %.1f\n", print.config().gcode_scale_z_angle.value); - file.write_format("; belt_gcode_transform_order = %s\n", full_cfg.opt_serialize("belt_gcode_transform_order").c_str()); + // Machine-frame transform: shear (tan) + scale (1/cos) derived from the belt + // tilt angle (or belt_frame_tilt_angle when decoupled). + file.write_format("; belt_frame_tilt_decouple = %d\n", print.config().belt_frame_tilt_decouple.value ? 1 : 0); + file.write_format("; belt_frame_tilt_angle = %.1f\n", print.config().belt_frame_tilt_angle.value); } void BeltGCode::on_set_origin(const PrintObject * /*obj*/, const Point & /*inst_shift*/) diff --git a/src/libslic3r/BeltTransform.hpp b/src/libslic3r/BeltTransform.hpp index 50f56bd75f..b67ac2007d 100644 --- a/src/libslic3r/BeltTransform.hpp +++ b/src/libslic3r/BeltTransform.hpp @@ -21,44 +21,11 @@ class ModelObject; // to the g-code instead (see MachineFrameTransform). This class provides the // building blocks so every call site uses the same implementation. z_shift is // object-dependent (computed from mesh vertex bounds) and is NOT included in -// build_forward_transform(). -// -// The compute_shear_factor / compute_scale_factor math helpers below are still -// used by the g-code-side machine-frame shear/scale. +// build_forward_transform(). The machine-frame shear/scale is derived directly +// from the tilt angle in MachineFrameTransform and no longer lives here. class BeltTransformPipeline { public: - // ---- Pure math helpers ------------------------------------------------ - - static double compute_shear_factor(BeltShearMode mode, double angle_deg) - { - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltShearMode::PosCot: return (sin_a > EPSILON) ? cos_a / sin_a : 0.; - case BeltShearMode::NegCot: return (sin_a > EPSILON) ? -cos_a / sin_a : 0.; - case BeltShearMode::PosTan: return (cos_a > EPSILON) ? sin_a / cos_a : 0.; - case BeltShearMode::NegTan: return (cos_a > EPSILON) ? -sin_a / cos_a : 0.; - default: return 0.; - } - } - - static double compute_scale_factor(BeltScaleMode mode, double angle_deg) - { - if (mode == BeltScaleMode::None) return 1.; - double angle_rad = Geometry::deg2rad(angle_deg); - double sin_a = std::sin(angle_rad); - double cos_a = std::cos(angle_rad); - switch (mode) { - case BeltScaleMode::InvSin: return (sin_a > EPSILON) ? 1. / sin_a : 1.; - case BeltScaleMode::InvCos: return (cos_a > EPSILON) ? 1. / cos_a : 1.; - case BeltScaleMode::Sin: return sin_a; - case BeltScaleMode::Cos: return cos_a; - default: return 1.; - } - } - // ---- Identity checks -------------------------------------------------- static bool has_preslice_remap(const PrintConfig &config) diff --git a/src/libslic3r/GCode/MachineFrameTransform.cpp b/src/libslic3r/GCode/MachineFrameTransform.cpp index 03f74605fe..bdc172d7a4 100644 --- a/src/libslic3r/GCode/MachineFrameTransform.cpp +++ b/src/libslic3r/GCode/MachineFrameTransform.cpp @@ -1,57 +1,10 @@ #include "MachineFrameTransform.hpp" -#include "../BeltTransform.hpp" -#include "../BoundingBox.hpp" +#include "../Geometry.hpp" + +#include namespace Slic3r { -namespace { - -// Build the 3x3 shear matrix from gcode_shear_* keys. -Matrix3d build_gcode_shear_matrix(const PrintConfig &config, bool &active) -{ - struct AxisShear { BeltShearMode mode; double angle; int from; }; - AxisShear axes[3] = { - { config.gcode_shear_x.value, config.gcode_shear_x_angle.value, int(config.gcode_shear_x_from.value) }, - { config.gcode_shear_y.value, config.gcode_shear_y_angle.value, int(config.gcode_shear_y_from.value) }, - { config.gcode_shear_z.value, config.gcode_shear_z_angle.value, int(config.gcode_shear_z_from.value) }, - }; - - Matrix3d shear = Matrix3d::Identity(); - active = false; - for (int row = 0; row < 3; ++row) { - if (axes[row].mode != BeltShearMode::None) { - double factor = BeltTransformPipeline::compute_shear_factor(axes[row].mode, axes[row].angle); - if (std::abs(factor) > EPSILON) { - shear(row, axes[row].from) += factor; - active = true; - } - } - } - return shear; -} - -// Build the 3x3 diagonal scale matrix from gcode_scale_* keys. -Matrix3d build_gcode_scale_matrix(const PrintConfig &config, bool &active) -{ - double sx = BeltTransformPipeline::compute_scale_factor(config.gcode_scale_x.value, config.gcode_scale_x_angle.value); - double sy = BeltTransformPipeline::compute_scale_factor(config.gcode_scale_y.value, config.gcode_scale_y_angle.value); - double sz = BeltTransformPipeline::compute_scale_factor(config.gcode_scale_z.value, config.gcode_scale_z_angle.value); - - active = (std::abs(sx - 1.) > EPSILON || - std::abs(sy - 1.) > EPSILON || - std::abs(sz - 1.) > EPSILON); - - Matrix3d scale = Matrix3d::Identity(); - if (active) { - scale(0, 0) = sx; - scale(1, 1) = sy; - scale(2, 2) = sz; - } - return scale; -} - -} // namespace - bool MachineFrameTransform::init_from_config(const PrintConfig &config) { m_active = false; @@ -60,21 +13,48 @@ bool MachineFrameTransform::init_from_config(const PrintConfig &config) if (!config.belt_printer.value) return false; - bool shear_active = false; - Matrix3d shear = build_gcode_shear_matrix(config, shear_active); - bool scale_active = false; - Matrix3d scale = build_gcode_scale_matrix(config, scale_active); + // The machine-frame transform is derived from the single belt tilt (axis + + // angle) that also drives the pre-slice mesh rotation. Expert decouple lets + // the machine-frame angle differ from the slicing rotation; otherwise both + // use belt_slice_rotation_angle. + const BeltRotationAxis axis = config.belt_slice_rotation.value; + if (axis == BeltRotationAxis::None || axis == BeltRotationAxis::Z) + return false; // Z is an in-plane spin: no machine-frame tilt. - if (!shear_active && !scale_active) + const double angle_deg = config.belt_frame_tilt_decouple.value + ? config.belt_frame_tilt_angle.value + : config.belt_slice_rotation_angle.value; + if (std::abs(angle_deg) <= EPSILON) return false; - // Compose per belt_gcode_transform_order: - // ScaleThenShear: applied to p, scale runs first then shear (shear * scale). - // ShearThenScale: applied to p, shear runs first then scale (scale * shear). + const double angle_rad = Geometry::deg2rad(angle_deg); + const double cos_a = std::cos(angle_rad); + if (std::abs(cos_a) <= EPSILON) + return false; + const double tan_a = std::sin(angle_rad) / cos_a; + const double inv_cos = 1.0 / cos_a; + + // Couple the height axis (Z) to the belt-feed axis and stretch the belt-feed + // axis by 1/cos so a unit slicing move maps to the correct belt travel. The + // shear sign matches the belt-floor slope derived from the same rotation in + // BeltTransformPipeline::compute_belt_height_and_floor: + // tilt about X: feed axis Y, Z += +tan·Y, scale Y *= 1/cos + // tilt about Y: feed axis X, Z += -tan·X, scale X *= 1/cos + Matrix3d shear = Matrix3d::Identity(); + Matrix3d scale = Matrix3d::Identity(); + if (axis == BeltRotationAxis::X) { + shear(2, 1) = tan_a; // Z from Y + scale(1, 1) = inv_cos; // Y + } else { // BeltRotationAxis::Y + shear(2, 0) = -tan_a; // Z from X + scale(0, 0) = inv_cos; // X + } + + // Apply shear first, then scale (the historical default ShearThenScale order: + // result = scale * shear * p). For the canonical 45°/X belt this maps + // (x,y,z) -> (x, y/cos, y + z), matching the previous per-axis config. Transform3d combined = Transform3d::Identity(); - combined.linear() = (config.belt_gcode_transform_order.value == BeltTransformOrder::ScaleThenShear) - ? Matrix3d(shear * scale) - : Matrix3d(scale * shear); + combined.linear() = scale * shear; if (combined.isApprox(Transform3d::Identity())) return false; diff --git a/src/libslic3r/GCode/MachineFrameTransform.hpp b/src/libslic3r/GCode/MachineFrameTransform.hpp index 9fa25b2323..425fe3004b 100644 --- a/src/libslic3r/GCode/MachineFrameTransform.hpp +++ b/src/libslic3r/GCode/MachineFrameTransform.hpp @@ -9,14 +9,15 @@ namespace Slic3r { // Post-stage machine-frame transform for belt printers. // -// Applied in BeltGCodeWriter::to_machine_coords AFTER the back-transform, -// the gcode_remap_* axis remap and per-axis origin snap. Maps Cartesian -// (axis-permuted) G-code coordinates into the printer's physical machine -// frame using: -// gcode_shear_x/y/z + _angle + _from -// gcode_scale_x/y/z + _angle +// Applied in BeltGCodeWriter::to_machine_coords AFTER the back-transform and +// the gcode_remap_* axis remap. Maps Cartesian (axis-permuted) G-code +// coordinates into the printer's physical machine frame. // -// Composition follows belt_gcode_transform_order (shear * scale or scale * shear). +// Derived entirely from the single belt tilt (belt_slice_rotation axis + +// belt_slice_rotation_angle): a shear coupling the height axis to the belt-feed +// axis (factor tan a) plus a 1/cos a scale on the belt-feed axis. The expert +// belt_frame_tilt_decouple flag lets the machine-frame angle differ from the +// pre-slice rotation angle via belt_frame_tilt_angle. class MachineFrameTransform { public: diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 9b514bb291..a9ccfdbd6b 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1330,13 +1330,7 @@ static std::vector s_Preset_printer_options { "belt_slice_rotation", "belt_slice_rotation_angle", "belt_slice_rotation_global", "preslice_remap_x", "preslice_remap_y", "preslice_remap_z", "preslice_remap_global", "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", "gcode_back_transform", - "gcode_shear_x", "gcode_shear_x_angle", "gcode_shear_x_from", - "gcode_shear_y", "gcode_shear_y_angle", "gcode_shear_y_from", - "gcode_shear_z", "gcode_shear_z_angle", "gcode_shear_z_from", - "gcode_scale_x", "gcode_scale_x_angle", - "gcode_scale_y", "gcode_scale_y_angle", - "gcode_scale_z", "gcode_scale_z_angle", - "belt_gcode_transform_order", + "belt_frame_tilt_decouple", "belt_frame_tilt_angle", "belt_preslice_global", "first_layer_plane", "first_layer_plane_offset", "first_layer_plane_thickness", "belt_support_floor_offset", "belt_support_floor_mode", "belt_support_z_offset_mode", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 099a592509..b511898ae8 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -104,14 +104,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "gcode_remap_x", "gcode_remap_y", "gcode_remap_z", - // Machine-frame transforms (only affect G-code output, not slicing). - "gcode_shear_x", "gcode_shear_x_angle", "gcode_shear_x_from", - "gcode_shear_y", "gcode_shear_y_angle", "gcode_shear_y_from", - "gcode_shear_z", "gcode_shear_z_angle", "gcode_shear_z_from", - "gcode_scale_x", "gcode_scale_x_angle", - "gcode_scale_y", "gcode_scale_y_angle", - "gcode_scale_z", "gcode_scale_z_angle", - "belt_gcode_transform_order", + // Machine-frame transform (derived from belt tilt; only affects G-code output). + "belt_frame_tilt_decouple", "belt_frame_tilt_angle", //BBS "additional_cooling_fan_speed", "reduce_crossing_wall", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index cdb2ec1d5d..723725a7f2 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -312,22 +312,6 @@ static t_config_enum_values s_keys_map_SlicingMode { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SlicingMode) -static t_config_enum_values s_keys_map_BeltShearMode { - { "none", int(BeltShearMode::None) }, - { "pos_cot", int(BeltShearMode::PosCot) }, - { "neg_cot", int(BeltShearMode::NegCot) }, - { "pos_tan", int(BeltShearMode::PosTan) }, - { "neg_tan", int(BeltShearMode::NegTan) }, -}; -CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltShearMode) - -static t_config_enum_values s_keys_map_BeltAxis { - { "x", int(BeltAxis::X) }, - { "y", int(BeltAxis::Y) }, - { "z", int(BeltAxis::Z) }, -}; -CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltAxis) - static t_config_enum_values s_keys_map_BeltRotationAxis { { "none", int(BeltRotationAxis::None) }, { "x", int(BeltRotationAxis::X) }, @@ -336,21 +320,6 @@ static t_config_enum_values s_keys_map_BeltRotationAxis { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltRotationAxis) -static t_config_enum_values s_keys_map_BeltTransformOrder { - { "scale_then_shear", int(BeltTransformOrder::ScaleThenShear) }, - { "shear_then_scale", int(BeltTransformOrder::ShearThenScale) }, -}; -CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltTransformOrder) - -static t_config_enum_values s_keys_map_BeltScaleMode { - { "none", int(BeltScaleMode::None) }, - { "inv_sin", int(BeltScaleMode::InvSin) }, - { "inv_cos", int(BeltScaleMode::InvCos) }, - { "sin", int(BeltScaleMode::Sin) }, - { "cos", int(BeltScaleMode::Cos) }, -}; -CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltScaleMode) - static t_config_enum_values s_keys_map_RemapAxis { { "pos_x", int(RemapAxis::PosX) }, { "pos_y", int(RemapAxis::PosY) }, @@ -6566,17 +6535,28 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(true)); - auto add_belt_transform_order = [this](const char *key, const char *label, const char *tooltip) { - auto def = this->add(key, coEnum); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L(tooltip); - def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); - def->enum_values = {"scale_then_shear", "shear_then_scale"}; - def->enum_labels = {L("Scale, then shear"), L("Shear, then scale")}; - def->mode = comExpert; - def->set_default_value(new ConfigOptionEnum(BeltTransformOrder::ShearThenScale)); - }; + def = this->add("belt_frame_tilt_decouple", coBool); + def->label = L("Decouple machine-frame tilt"); + def->category = L("Printable space"); + def->tooltip = L("Expert override: set the machine-frame (g-code shear/scale) tilt angle " + "independently of the pre-slice rotation angle. When disabled, the " + "machine-frame transform is derived from the belt tilt angle, so a single " + "angle drives both stages. Enable only to compensate for a machine whose " + "physical gantry tilt differs from the slicing rotation."); + def->mode = comExpert; + def->set_default_value(new ConfigOptionBool(false)); + + def = this->add("belt_frame_tilt_angle", coFloat); + def->label = L("Machine-frame tilt angle"); + def->category = L("Printable space"); + def->tooltip = L("Tilt angle (degrees) used to derive the machine-frame shear (tan) and " + "scale (1/cos) applied to G-code. Only used when 'Decouple machine-frame " + "tilt' is enabled; otherwise the belt tilt angle is used."); + def->sidetext = L("°"); + def->min = -89.9; + def->max = 89.9; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(45.)); // G-code axis remap with sign auto add_belt_remap = [this](const char *key, const char *label, const char *tooltip, @@ -6626,96 +6606,9 @@ void PrintConfigDef::init_fff_params() add_belt_remap("gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosY, comExpert); add_belt_remap("gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosZ, comExpert); - // Machine-frame G-code transforms: applied AFTER back-transform and gcode_remap, - // before per-axis origin snap. Maps Cartesian G-code to the printer's physical machine frame. - // These shear/scale transforms act on the G-code coordinates (not the mesh) — they are - // the belt printer's only shear/scale stage. - auto add_belt_shear_mode = [this](const char *key, const char *label, BeltShearMode default_mode, - ConfigOptionMode mode = comAdvanced) { - auto def = this->add(key, coEnum); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L("Shear function applied to this axis in belt printer mode."); - def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); - def->enum_values = {"none", "pos_cot", "neg_cot", "pos_tan", "neg_tan"}; - def->enum_labels = {L("None"), L("+cot(α)"), L("-cot(α)"), L("+tan(α)"), L("-tan(α)")}; - def->mode = mode; - def->set_default_value(new ConfigOptionEnum(default_mode)); - }; - auto add_belt_shear_angle = [this](const char *key, const char *label, - ConfigOptionMode mode = comAdvanced) { - auto def = this->add(key, coFloat); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L("Angle (degrees) for the shear function on this axis."); - def->sidetext = L("°"); - def->min = 0.1; - def->max = 89.9; - def->mode = mode; - def->set_default_value(new ConfigOptionFloat(45)); - }; - auto add_belt_axis_enum = [this](const char *key, const char *label, const char *tooltip, - BeltAxis default_axis, ConfigOptionMode mode = comAdvanced) { - auto def = this->add(key, coEnum); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L(tooltip); - def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); - def->enum_values = {"x", "y", "z"}; - def->enum_labels = {L("X"), L("Y"), L("Z")}; - def->mode = mode; - def->set_default_value(new ConfigOptionEnum(default_axis)); - }; - auto add_belt_scale_mode = [this](const char *key, const char *label, BeltScaleMode default_mode, - ConfigOptionMode mode = comAdvanced) { - auto def = this->add(key, coEnum); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L("Scale factor applied to this axis in belt printer mode."); - def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); - def->enum_values = {"none", "inv_sin", "inv_cos", "sin", "cos"}; - def->enum_labels = {L("None"), L("1/sin(α)"), L("1/cos(α)"), L("sin(α)"), L("cos(α)")}; - def->mode = mode; - def->set_default_value(new ConfigOptionEnum(default_mode)); - }; - auto add_belt_scale_angle = [this](const char *key, const char *label, - ConfigOptionMode mode = comAdvanced) { - auto def = this->add(key, coFloat); - def->label = L(label); - def->category = L("Printable space"); - def->tooltip = L("Angle (degrees) for the scale function on this axis."); - def->sidetext = L("°"); - def->min = 0.1; - def->max = 89.9; - def->mode = mode; - def->set_default_value(new ConfigOptionFloat(45)); - }; - - add_belt_shear_mode ("gcode_shear_x", "Function", BeltShearMode::None, comExpert); - add_belt_shear_angle("gcode_shear_x_angle", "Angle", comExpert); - add_belt_axis_enum ("gcode_shear_x_from", "From", "Source axis for X shear in the machine-frame stage.", BeltAxis::Z, comExpert); - - add_belt_shear_mode ("gcode_shear_y", "Function", BeltShearMode::None, comExpert); - add_belt_shear_angle("gcode_shear_y_angle", "Angle", comExpert); - add_belt_axis_enum ("gcode_shear_y_from", "From", "Source axis for Y shear in the machine-frame stage.", BeltAxis::Z, comExpert); - - add_belt_shear_mode ("gcode_shear_z", "Function", BeltShearMode::None); - add_belt_shear_angle("gcode_shear_z_angle", "Angle"); - add_belt_axis_enum ("gcode_shear_z_from", "From", "Source axis for Z shear in the machine-frame stage.", BeltAxis::Y); - - add_belt_scale_mode ("gcode_scale_x", "Function", BeltScaleMode::None, comExpert); - add_belt_scale_angle("gcode_scale_x_angle", "Angle", comExpert); - - add_belt_scale_mode ("gcode_scale_y", "Function", BeltScaleMode::None); - add_belt_scale_angle("gcode_scale_y_angle", "Angle"); - - add_belt_scale_mode ("gcode_scale_z", "Function", BeltScaleMode::None, comExpert); - add_belt_scale_angle("gcode_scale_z_angle", "Angle", comExpert); - - add_belt_transform_order("belt_gcode_transform_order", "G-code transform order", - "Order in which the machine-frame shear and scale matrices are composed when " - "applied to G-code coordinates. 'Scale, then shear' applies scale first and then " - "shear (current default). 'Shear, then scale' applies shear first and then scale."); + // The machine-frame G-code transform (shear + scale) is no longer configured + // by per-axis keys: it is derived from the belt tilt (belt_slice_rotation axis + // + angle, or belt_frame_tilt_angle when decoupled) in MachineFrameTransform. def = this->add("gcode_back_transform", coBool); def->label = L("G-code back-transform"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index a31179cd9b..47da8f1b55 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -169,34 +169,10 @@ enum class SlicingMode CloseHoles, }; -enum class BeltShearMode -{ - None, // No shear on this axis - PosCot, // += cot(α) - NegCot, // -= cot(α) - PosTan, // += tan(α) - NegTan, // -= tan(α) -}; - -enum class BeltScaleMode -{ - None, // No scaling (factor = 1) - InvSin, // 1/sin(α) - InvCos, // 1/cos(α) - Sin, // sin(α) - Cos, // cos(α) -}; - -enum class BeltAxis -{ - X = 0, - Y = 1, - Z = 2, -}; - // Axis around which the mesh is rotated before slicing, when -// `belt_slice_rotation` is set. None disables the rotation stage. -// Distinct from BeltAxis because BeltAxis carries no "None" semantics. +// `belt_slice_rotation` is set. None disables the rotation stage. This is the +// single "belt tilt" axis: it drives both the pre-slice mesh rotation and the +// post-slice machine-frame transform (shear + scale derived from the tilt angle). enum class BeltRotationAxis { None = 0, @@ -205,15 +181,6 @@ enum class BeltRotationAxis Z = 3, }; -// Order in which the belt shear and scale matrices are composed. -// ScaleThenShear: applied to a point p, the result is shear(scale(p)). -// ShearThenScale: applied to a point p, the result is scale(shear(p)). -enum class BeltTransformOrder -{ - ScaleThenShear = 0, - ShearThenScale = 1, -}; - enum class RemapAxis { PosX = 0, PosY = 1, PosZ = 2, @@ -616,11 +583,7 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(NoiseType) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(InfillPattern) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(IroningType) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SlicingMode) -CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltShearMode) -CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltScaleMode) -CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltRotationAxis) -CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltTransformOrder) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(RemapAxis) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportFloorMode) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BeltSupportZOffsetMode) @@ -1582,15 +1545,19 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( // Belt printer settings (printer-level). ((ConfigOptionBool, belt_printer)) ((ConfigOptionBool, belt_printer_infinite_y)) - // Mesh rotation applied before slicing — the sole mesh-side belt transform and - // the single source of truth for the physical belt tilt (its angle + axis drive - // bed rendering, support gravity tilt, and the bed-exclusion projection). - // Isometric (no distortion); the g-code back-transform inverts it before the - // machine-frame remap. (Shear & scale are applied to the g-code, not the - // mesh — see gcode_shear_* / gcode_scale_* below.) + // Mesh rotation applied before slicing — the single source of truth for the + // physical belt tilt. Its angle + axis drive bed rendering, support gravity + // tilt, the bed-exclusion projection, AND the post-slice machine-frame + // transform (shear + scale, derived from the tilt angle; see + // MachineFrameTransform). Isometric (no distortion) on the mesh side; the + // g-code back-transform inverts the rotation before the machine-frame stage. ((ConfigOptionEnum, belt_slice_rotation)) ((ConfigOptionFloat, belt_slice_rotation_angle)) ((ConfigOptionBool, belt_slice_rotation_global)) + // Expert override: decouple the machine-frame tilt angle from the pre-slice + // rotation angle. When disabled, the machine frame uses belt_slice_rotation_angle. + ((ConfigOptionBool, belt_frame_tilt_decouple)) + ((ConfigOptionFloat, belt_frame_tilt_angle)) ((ConfigOptionEnum, preslice_remap_x)) ((ConfigOptionEnum, preslice_remap_y)) ((ConfigOptionEnum, preslice_remap_z)) @@ -1598,22 +1565,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, gcode_remap_x)) ((ConfigOptionEnum, gcode_remap_y)) ((ConfigOptionEnum, gcode_remap_z)) - ((ConfigOptionEnum, gcode_shear_x)) - ((ConfigOptionFloat, gcode_shear_x_angle)) - ((ConfigOptionEnum, gcode_shear_x_from)) - ((ConfigOptionEnum, gcode_shear_y)) - ((ConfigOptionFloat, gcode_shear_y_angle)) - ((ConfigOptionEnum, gcode_shear_y_from)) - ((ConfigOptionEnum, gcode_shear_z)) - ((ConfigOptionFloat, gcode_shear_z_angle)) - ((ConfigOptionEnum, gcode_shear_z_from)) - ((ConfigOptionEnum, gcode_scale_x)) - ((ConfigOptionFloat, gcode_scale_x_angle)) - ((ConfigOptionEnum, gcode_scale_y)) - ((ConfigOptionFloat, gcode_scale_y_angle)) - ((ConfigOptionEnum, gcode_scale_z)) - ((ConfigOptionFloat, gcode_scale_z_angle)) - ((ConfigOptionEnum, belt_gcode_transform_order)) ((ConfigOptionBool, gcode_back_transform)) ((ConfigOptionBool, belt_preslice_global)) ((ConfigOptionEnum, first_layer_plane)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 4027a671e7..ae9223ad7f 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4541,9 +4541,10 @@ void TabPrinter::build_fff() belt_og->append_single_option_line("belt_support_z_offset_mode"); belt_og->append_single_option_line("belt_support_floor_mode"); - // Machine-frame transforms: applied to G-code after back-transform and - // gcode_remap, before per-axis origin snap. Maps Cartesian G-code into - // the printer's physical machine frame. + // Machine-frame transform: the shear (tan) + scale (1/cos) that map + // Cartesian G-code into the printer's physical machine frame are derived + // from the belt tilt angle. Only the post-slice axis remap and the expert + // decouple override are exposed here. { auto mf = page->new_optgroup(L("Machine frame transforms"), L"param_advanced"); { @@ -4554,45 +4555,15 @@ void TabPrinter::build_fff() mf->append_line(line); } { - Line line = { L("G-code shear X"), L("Shear applied to the X axis in the machine-frame stage (after back-transform and gcode_remap).") }; - line.append_option(mf->get_option("gcode_shear_x")); - line.append_option(mf->get_option("gcode_shear_x_angle")); - line.append_option(mf->get_option("gcode_shear_x_from")); + Line line = { L("Machine-frame tilt"), + L("The machine-frame shear (tan) and scale (1/cos) are derived from " + "the belt tilt angle. Enable 'Decouple' to set an independent " + "machine-frame angle when the physical gantry tilt differs from " + "the slicing rotation.") }; + line.append_option(mf->get_option("belt_frame_tilt_decouple")); + line.append_option(mf->get_option("belt_frame_tilt_angle")); mf->append_line(line); } - { - Line line = { L("G-code shear Y"), L("Shear applied to the Y axis in the machine-frame stage (after back-transform and gcode_remap).") }; - line.append_option(mf->get_option("gcode_shear_y")); - line.append_option(mf->get_option("gcode_shear_y_angle")); - line.append_option(mf->get_option("gcode_shear_y_from")); - mf->append_line(line); - } - { - Line line = { L("G-code shear Z"), L("Shear applied to the Z axis in the machine-frame stage (after back-transform and gcode_remap).") }; - line.append_option(mf->get_option("gcode_shear_z")); - line.append_option(mf->get_option("gcode_shear_z_angle")); - line.append_option(mf->get_option("gcode_shear_z_from")); - mf->append_line(line); - } - { - Line line = { L("G-code scale X"), L("Scale applied to the X axis in the machine-frame stage.") }; - line.append_option(mf->get_option("gcode_scale_x")); - line.append_option(mf->get_option("gcode_scale_x_angle")); - mf->append_line(line); - } - { - Line line = { L("G-code scale Y"), L("Scale applied to the Y axis in the machine-frame stage.") }; - line.append_option(mf->get_option("gcode_scale_y")); - line.append_option(mf->get_option("gcode_scale_y_angle")); - mf->append_line(line); - } - { - Line line = { L("G-code scale Z"), L("Scale applied to the Z axis in the machine-frame stage.") }; - line.append_option(mf->get_option("gcode_scale_z")); - line.append_option(mf->get_option("gcode_scale_z_angle")); - mf->append_line(line); - } - mf->append_single_option_line("belt_gcode_transform_order"); } option = optgroup->get_option("thumbnails"); @@ -5592,36 +5563,11 @@ void TabPrinter::toggle_options() toggle_option("belt_slice_rotation_angle", is_belt && rot_axis != BeltRotationAxis::None); toggle_option("belt_slice_rotation_global", is_belt && rot_axis != BeltRotationAxis::None); - // Machine-frame transforms: shown only in belt mode. - // Mirror the Advanced/Expert split used for mesh shear/scale. - toggle_line("gcode_shear_x", is_belt && expert_or_above); - toggle_line("gcode_shear_y", is_belt && expert_or_above); - toggle_line("gcode_shear_z", is_belt); - toggle_line("gcode_scale_x", is_belt && expert_or_above); - toggle_line("gcode_scale_y", is_belt); - toggle_line("gcode_scale_z", is_belt && expert_or_above); - toggle_line("belt_gcode_transform_order", is_belt); - - auto gsx = m_config->option>("gcode_shear_x")->value; - toggle_option("gcode_shear_x_angle", is_belt && gsx != BeltShearMode::None); - toggle_option("gcode_shear_x_from", is_belt && gsx != BeltShearMode::None); - - auto gsy = m_config->option>("gcode_shear_y")->value; - toggle_option("gcode_shear_y_angle", is_belt && gsy != BeltShearMode::None); - toggle_option("gcode_shear_y_from", is_belt && gsy != BeltShearMode::None); - - auto gsz = m_config->option>("gcode_shear_z")->value; - toggle_option("gcode_shear_z_angle", is_belt && gsz != BeltShearMode::None); - toggle_option("gcode_shear_z_from", is_belt && gsz != BeltShearMode::None); - - auto gscx = m_config->option>("gcode_scale_x")->value; - toggle_option("gcode_scale_x_angle", is_belt && gscx != BeltScaleMode::None); - - auto gscy = m_config->option>("gcode_scale_y")->value; - toggle_option("gcode_scale_y_angle", is_belt && gscy != BeltScaleMode::None); - - auto gscz = m_config->option>("gcode_scale_z")->value; - toggle_option("gcode_scale_z_angle", is_belt && gscz != BeltScaleMode::None); + // Machine-frame transform: derived from the belt tilt. Only the expert + // decouple override is exposed; its angle is enabled only when decoupled. + toggle_line("belt_frame_tilt_decouple", is_belt && expert_or_above); + toggle_option("belt_frame_tilt_angle", + is_belt && expert_or_above && m_config->opt_bool("belt_frame_tilt_decouple")); // First-layer plane: visible alongside the rest of belt-printer settings. toggle_line("first_layer_plane", is_belt); From 5b243eec9245703510b283a9465675c691228dbe Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Mon, 8 Jun 2026 06:58:26 -0500 Subject: [PATCH 041/389] Relocate Pre-Slice remap logic --- src/libslic3r/BeltSliceStrategy.cpp | 212 ++++++++++++++-------------- src/libslic3r/BeltSliceStrategy.hpp | 43 +++--- src/libslic3r/PrintObjectSlice.cpp | 35 +---- 3 files changed, 132 insertions(+), 158 deletions(-) diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp index fd1bfcc191..cdb6ba428f 100644 --- a/src/libslic3r/BeltSliceStrategy.cpp +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -1,6 +1,8 @@ #include "BeltSliceStrategy.hpp" #include "Model.hpp" +#include + #include #ifdef SLIC3R_BELT_DIAGNOSTIC_LOG #include @@ -10,130 +12,132 @@ namespace Slic3r { -std::unique_ptr BeltSliceStrategy::create(const PrintConfig &config) +void BeltSliceStrategy::apply_preslice_transforms(Transform3d &trafo, + const PrintConfig &config, + const ModelVolumePtrs &model_volumes, + double *out_belt_min_z) { - if (!config.belt_printer.value) - return nullptr; - return std::unique_ptr(new BeltSliceStrategy(config)); -} + // 1. Standalone pre-slice axis remap (works without belt mode). + const bool has_remap = BeltTransformPipeline::has_preslice_remap(config); + if (has_remap) + trafo = BeltTransformPipeline::build_preslice_remap(config) * trafo; -BeltSliceStrategy::BeltSliceStrategy(const PrintConfig &config) -{ - m_rotation = BeltTransformPipeline::build_rotation_matrix(config, &m_has_rotation); -} - -void BeltSliceStrategy::apply_to_trafo(Transform3d &trafo, - const ModelVolumePtrs &model_volumes, - bool has_remap, - double *out_belt_min_z) const -{ - // Rotation is the only mesh-side belt transform (matching build_forward_transform). - if (m_has_rotation) { - Transform3d belt_xform = Transform3d::Identity(); - belt_xform.linear() = m_rotation; - trafo = belt_xform * trafo; + // 2. Belt rotation — the sole mesh-side belt transform (matching + // BeltTransformPipeline::build_forward_transform). Only active in + // belt-printer mode. + bool has_rotation = false; + if (config.belt_printer.value) { + const Matrix3d rot = BeltTransformPipeline::build_rotation_matrix(config, &has_rotation); + if (has_rotation) { + Transform3d belt_xform = Transform3d::Identity(); + belt_xform.linear() = rot; + trafo = belt_xform * trafo; + } } - // Z-shift — detect if mesh clips below build plate after transforms. - // Each mesh vertex must be brought into object space via mv->get_matrix() - // before applying the full trafo (which is in object space). Missing this - // step on assemblies (where per-volume get_matrix() positions each volume - // within the object) causes min_z to be computed against mesh-local vertex - // coordinates rather than object-space coordinates, so volumes translated - // along the slicer's Z axis are silently excluded from the bound check. - if (has_remap || m_has_rotation) { + if (!has_remap && !has_rotation) + return; + + // 3. Z-shift — detect if the mesh clips below the build plate after the + // transforms and lift it. Each mesh vertex must be brought into object space + // via mv->get_matrix() before applying the full trafo (which is in object + // space). Missing this on assemblies (where per-volume get_matrix() positions + // each volume within the object) would compute min_z against mesh-local vertex + // coordinates rather than object-space coordinates, so volumes translated along + // the slicer's Z axis would be silently excluded from the bound check. #ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - // Capture the incoming trafo for diagnostic logging. - // This is the slicer-frame transform AFTER belt_xform but BEFORE z_shift. - const Transform3d trafo_pre_shift = trafo; - auto log_mat = [](const Matrix3d &m) { - std::ostringstream ss; - ss << std::fixed << std::setprecision(4); - ss << "[[" << m(0,0) << "," << m(0,1) << "," << m(0,2) << "]," - << "[" << m(1,0) << "," << m(1,1) << "," << m(1,2) << "]," - << "[" << m(2,0) << "," << m(2,1) << "," << m(2,2) << "]]"; - return ss.str(); - }; - auto log_vec3 = [](const Vec3d &v) { - std::ostringstream ss; - ss << std::fixed << std::setprecision(4); - ss << "(" << v.x() << "," << v.y() << "," << v.z() << ")"; - return ss.str(); - }; - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_to_trafo enter" - << " has_rotation=" << m_has_rotation - << " has_remap=" << has_remap - << " trafo.linear=" << log_mat(trafo_pre_shift.linear()) - << " trafo.translation=" << log_vec3(trafo_pre_shift.translation()) - << " volumes=" << model_volumes.size(); + // Capture the incoming trafo for diagnostic logging. + // This is the slicer-frame transform AFTER remap + rotation but BEFORE z_shift. + const Transform3d trafo_pre_shift = trafo; + auto log_mat = [](const Matrix3d &m) { + std::ostringstream ss; + ss << std::fixed << std::setprecision(4); + ss << "[[" << m(0,0) << "," << m(0,1) << "," << m(0,2) << "]," + << "[" << m(1,0) << "," << m(1,1) << "," << m(1,2) << "]," + << "[" << m(2,0) << "," << m(2,1) << "," << m(2,2) << "]]"; + return ss.str(); + }; + auto log_vec3 = [](const Vec3d &v) { + std::ostringstream ss; + ss << std::fixed << std::setprecision(4); + ss << "(" << v.x() << "," << v.y() << "," << v.z() << ")"; + return ss.str(); + }; + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_preslice_transforms enter" + << " has_rotation=" << has_rotation + << " has_remap=" << has_remap + << " trafo.linear=" << log_mat(trafo_pre_shift.linear()) + << " trafo.translation=" << log_vec3(trafo_pre_shift.translation()) + << " volumes=" << model_volumes.size(); #endif - double min_z = std::numeric_limits::max(); + double min_z = std::numeric_limits::max(); #ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - int vol_idx = 0; + int vol_idx = 0; #endif - for (const ModelVolume *mv : model_volumes) { + for (const ModelVolume *mv : model_volumes) { #ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - if (!mv->is_model_part()) { ++vol_idx; continue; } + if (!mv->is_model_part()) { ++vol_idx; continue; } #else - if (!mv->is_model_part()) continue; + if (!mv->is_model_part()) continue; #endif - Transform3d vol_trafo = trafo * mv->get_matrix(); - const auto &its = mv->mesh().its; + Transform3d vol_trafo = trafo * mv->get_matrix(); + const auto &its = mv->mesh().its; #ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - // Per-volume bbox in mesh-frame and post-trafo slicer-frame. - Vec3d mesh_min(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); - Vec3d mesh_max(std::numeric_limits::lowest(), std::numeric_limits::lowest(), std::numeric_limits::lowest()); - Vec3d slicer_min(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); - Vec3d slicer_max(std::numeric_limits::lowest(), std::numeric_limits::lowest(), std::numeric_limits::lowest()); - double vol_min_z = std::numeric_limits::max(); + // Per-volume bbox in mesh-frame and post-trafo slicer-frame. + Vec3d mesh_min(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); + Vec3d mesh_max(std::numeric_limits::lowest(), std::numeric_limits::lowest(), std::numeric_limits::lowest()); + Vec3d slicer_min(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); + Vec3d slicer_max(std::numeric_limits::lowest(), std::numeric_limits::lowest(), std::numeric_limits::lowest()); + double vol_min_z = std::numeric_limits::max(); #endif - for (const stl_vertex &v : its.vertices) { - Vec3d vm = v.cast(); - Vec3d pt = vol_trafo * vm; - min_z = std::min(min_z, pt.z()); + for (const stl_vertex &v : its.vertices) { + Vec3d vm = v.cast(); + Vec3d pt = vol_trafo * vm; + min_z = std::min(min_z, pt.z()); #ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - mesh_min = mesh_min.cwiseMin(vm); - mesh_max = mesh_max.cwiseMax(vm); - slicer_min = slicer_min.cwiseMin(pt); - slicer_max = slicer_max.cwiseMax(pt); - vol_min_z = std::min(vol_min_z, pt.z()); -#endif - } -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] vol[" << vol_idx - << "] id=" << mv->id().id << " name='" << mv->name << "'" - << " mesh_bbox_min=" << log_vec3(mesh_min) << " mesh_bbox_max=" << log_vec3(mesh_max) - << " get_matrix.translation=" << log_vec3(mv->get_matrix().translation()) - << " slicer_bbox_min=" << log_vec3(slicer_min) << " slicer_bbox_max=" << log_vec3(slicer_max) - << " vol_min_z=" << vol_min_z; - ++vol_idx; + mesh_min = mesh_min.cwiseMin(vm); + mesh_max = mesh_max.cwiseMax(vm); + slicer_min = slicer_min.cwiseMin(pt); + slicer_max = slicer_max.cwiseMax(pt); + vol_min_z = std::min(vol_min_z, pt.z()); #endif } - double belt_z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; #ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] combined min_z=" << min_z - << " z_shift_val=" << belt_z_shift_val; -#endif - if (belt_z_shift_val > 0.) { - Transform3d z_shift = Transform3d::Identity(); - z_shift.matrix()(2, 3) = belt_z_shift_val; - trafo = z_shift * trafo; - } - if (out_belt_min_z) { - double new_val = (min_z != std::numeric_limits::max()) ? min_z : 0.; -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] write m_belt_min_z tid=" << std::this_thread::get_id() - << " target=" << out_belt_min_z << " old=" << *out_belt_min_z << " new=" << new_val; -#endif - *out_belt_min_z = new_val; - } -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_to_trafo exit" - << " final_trafo.linear=" << log_mat(trafo.linear()) - << " final_trafo.translation=" << log_vec3(trafo.translation()); + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] vol[" << vol_idx + << "] id=" << mv->id().id << " name='" << mv->name << "'" + << " mesh_bbox_min=" << log_vec3(mesh_min) << " mesh_bbox_max=" << log_vec3(mesh_max) + << " get_matrix.translation=" << log_vec3(mv->get_matrix().translation()) + << " slicer_bbox_min=" << log_vec3(slicer_min) << " slicer_bbox_max=" << log_vec3(slicer_max) + << " vol_min_z=" << vol_min_z; + ++vol_idx; #endif } + const double z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] combined min_z=" << min_z + << " z_shift_val=" << z_shift_val; +#endif + if (z_shift_val > 0.) { + Transform3d z_shift = Transform3d::Identity(); + z_shift.matrix()(2, 3) = z_shift_val; + trafo = z_shift * trafo; + } + // out_belt_min_z is only meaningful in belt mode; the standalone-remap path + // never reported it. + if (out_belt_min_z && config.belt_printer.value) { + const double new_val = (min_z != std::numeric_limits::max()) ? min_z : 0.; +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] write m_belt_min_z tid=" << std::this_thread::get_id() + << " target=" << out_belt_min_z << " old=" << *out_belt_min_z << " new=" << new_val; +#endif + *out_belt_min_z = new_val; + } +#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_preslice_transforms exit" + << " final_trafo.linear=" << log_mat(trafo.linear()) + << " final_trafo.translation=" << log_vec3(trafo.translation()); +#endif } } // namespace Slic3r diff --git a/src/libslic3r/BeltSliceStrategy.hpp b/src/libslic3r/BeltSliceStrategy.hpp index ff56f6fece..33a7ed4979 100644 --- a/src/libslic3r/BeltSliceStrategy.hpp +++ b/src/libslic3r/BeltSliceStrategy.hpp @@ -6,36 +6,31 @@ #include "PrintConfig.hpp" #include "Model.hpp" -#include -#include - namespace Slic3r { -// Belt printer pre-slice transform strategy. +// Belt printer / pre-slice transform strategy. // -// Encapsulates the pre-remap, rotation, and Z-shift transforms that are -// applied to model geometry before slicing on belt printers. (Shear & scale -// are applied to the g-code, not the mesh.) Used by PrintObjectSlice.cpp to -// isolate belt-specific logic from the slicing pipeline. +// Composes, in order, the pre-slice mesh transforms applied before slicing: +// 1. Pre-slice axis remap (standalone — works without belt mode) +// 2. Belt rotation (the sole mesh-side belt transform; shear & scale are a +// g-code-side stage, see MachineFrameTransform) +// 3. Per-object Z-shift that lifts the mesh above the build plate +// +// Isolates this belt/remap-specific logic from the generic slicing pipeline in +// PrintObjectSlice.cpp. class BeltSliceStrategy { public: - // Create a strategy if belt_printer is enabled; returns nullptr otherwise. - static std::unique_ptr create(const PrintConfig &config); - - // Apply belt-specific transforms (rotation + z-shift) to the slicing trafo. - // Pre-slice remap is handled separately (standalone feature). - // has_remap: whether pre-slice remap was already applied (affects z-shift detection). - void apply_to_trafo(Transform3d &trafo, - const ModelVolumePtrs &model_volumes, - bool has_remap, - double *out_belt_min_z) const; - -private: - explicit BeltSliceStrategy(const PrintConfig &config); - - bool m_has_rotation = false; - Matrix3d m_rotation = Matrix3d::Identity(); + // Apply the pre-slice remap + belt rotation + Z-shift to `trafo` in place. + // No-op when neither a remap nor a belt rotation is configured. + // + // out_belt_min_z (if non-null) receives the minimum mesh Z after the + // transforms, but only in belt-printer mode — the standalone-remap path + // never reported it. + static void apply_preslice_transforms(Transform3d &trafo, + const PrintConfig &config, + const ModelVolumePtrs &model_volumes, + double *out_belt_min_z = nullptr); }; } // namespace Slic3r diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 448b39fe0b..7e5203d624 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -173,35 +173,10 @@ static std::vector slice_volumes_inner( params_base.closing_radius = print_object_config.slice_closing_radius.value; params_base.extra_offset = 0; params_base.trafo = object_trafo; - // Standalone pre-slice axis remap (works without belt mode). - bool has_remap = BeltTransformPipeline::has_preslice_remap(print_config); - if (has_remap) - params_base.trafo = BeltTransformPipeline::build_preslice_remap(print_config) * params_base.trafo; - { - // Belt-specific transforms (shear, scale, z-shift) via strategy. - auto belt_strategy = BeltSliceStrategy::create(print_config); - if (belt_strategy) - belt_strategy->apply_to_trafo(params_base.trafo, model_volumes, has_remap, out_belt_min_z); - } - // If only remap (no belt), still need z-shift detection. - // Compose per-volume mv->get_matrix() so assembly volumes contribute their - // actual object-space positions — see the matching note in BeltSliceStrategy. - if (has_remap && !print_config.belt_printer.value) { - double min_z = std::numeric_limits::max(); - for (const ModelVolume *mv : model_volumes) { - if (!mv->is_model_part()) continue; - Transform3d vol_trafo = params_base.trafo * mv->get_matrix(); - for (const stl_vertex &v : mv->mesh().its.vertices) { - Vec3d pt = vol_trafo * v.cast(); - min_z = std::min(min_z, pt.z()); - } - } - if (min_z < 0. && min_z != std::numeric_limits::max()) { - Transform3d z_shift = Transform3d::Identity(); - z_shift.matrix()(2, 3) = -min_z; - params_base.trafo = z_shift * params_base.trafo; - } - } + // Pre-slice mesh transforms: axis remap (standalone — works without belt + // mode), belt rotation, and the per-object Z-shift. Owned by BeltSliceStrategy + // so this belt/remap-specific logic stays out of the generic slicing pipeline. + BeltSliceStrategy::apply_preslice_transforms(params_base.trafo, print_config, model_volumes, out_belt_min_z); //BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model. //Also has on influence on arc fitting which has default resolution 0.0125mm. params_base.resolution = print_config.resolution <= 0.001 ? 0.0f : 0.0025; @@ -981,7 +956,7 @@ void PrintObject::slice() // Per-object Z-shift compensation, applied regardless of global mode. // - // BeltSliceStrategy::apply_to_trafo lifts the mesh by max(0, -m_belt_min_z) + // BeltSliceStrategy::apply_preslice_transforms lifts the mesh by max(0, -m_belt_min_z) // so the slicer can slice with slicer_z >= 0. BeltBackTransform inverts // build_forward_transform() which DOES NOT include this per-object // Z-shift (it's not known until vertex scan time). Result: G-code From e29a82c6723b7088d1eef92c14a9d89c1af5fee4 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Mon, 8 Jun 2026 07:18:55 -0500 Subject: [PATCH 042/389] add attribution and design notes --- src/libslic3r/BeltTransform.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/libslic3r/BeltTransform.hpp b/src/libslic3r/BeltTransform.hpp index b67ac2007d..ad5b6d6ffd 100644 --- a/src/libslic3r/BeltTransform.hpp +++ b/src/libslic3r/BeltTransform.hpp @@ -23,6 +23,24 @@ class ModelObject; // object-dependent (computed from mesh vertex bounds) and is NOT included in // build_forward_transform(). The machine-frame shear/scale is derived directly // from the tilt angle in MachineFrameTransform and no longer lives here. +// +// Design note: this mesh-rotation approach replaced an earlier pre-shear +// method (now removed). While that initial pre-shear method was instrumental +// in getting belt printer slicing off the ground in the first place, its place is +// in the past. A big thank you goes to the Unlayered3D team, who recommended +// switching to a pre-slice rotation stage instead. Doing so keeps the slicing +// operation isometric — no distortion of the sliced geometry — while the +// non-orthogonal machine-axis compensation is confined to a g-code-side shear/scale +// derived from the same tilt angle. +// +// This fixed a number of issues, including several issues noticed by hotcubcar +// regarding adaptive infills not working, gyroid becoming anisotropic, and more +// that were all mostly resolved as a result of the switch. +// +// This also means that the pre-slice rotation transform methodology can be used +// more cleanly on non-belt printers. +// - HarrierPigeon (Joseph Robertson) + class BeltTransformPipeline { public: From 2bcb775b904973d0250bc85539a3d6a0e3fca567 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 10 Jun 2026 04:49:31 -0500 Subject: [PATCH 043/389] update IdeaFormer profiles to new generic belt printer config --- .../machine/IdeaFormer IR3 V2 0.4 nozzle.json | 11 ----------- .../profiles/IdeaFormer/machine/fdm_belt_common.json | 2 -- 2 files changed, 13 deletions(-) diff --git a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json index b1a2cc2c3b..bb987e712d 100644 --- a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json +++ b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json @@ -17,18 +17,7 @@ "0x2000" ], "printable_height": "250", - "belt_printer": "1", "belt_printer_infinite_y": "1", - "belt_slice_rotation": "x", - "belt_slice_rotation_angle": "45", - "belt_slice_rotation_global": "1", - "build_plate_tilt_x": "45", - "build_plate_tilt_y": "0", - "gcode_remap_x": "rev_x", - "gcode_remap_y": "pos_z", - "gcode_remap_z": "pos_y", - "gcode_shear_z": "pos_tan", - "gcode_scale_y": "inv_cos", "thumbnails": [ "48x48/PNG", "300x300/PNG" diff --git a/resources/profiles/IdeaFormer/machine/fdm_belt_common.json b/resources/profiles/IdeaFormer/machine/fdm_belt_common.json index 0530999f15..b010742d78 100644 --- a/resources/profiles/IdeaFormer/machine/fdm_belt_common.json +++ b/resources/profiles/IdeaFormer/machine/fdm_belt_common.json @@ -93,8 +93,6 @@ "belt_slice_rotation_angle": "45", "belt_slice_rotation_global": "1", "build_plate_tilt_x": "45", - "gcode_shear_z": "pos_tan", - "gcode_scale_y": "inv_cos", "purge_in_prime_tower": "0", "scan_first_layer": "0", "auxiliary_fan": "0" From f682ab5cd3939ed65c5ff043dba780b8da29d828 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Wed, 10 Jun 2026 21:17:47 +0200 Subject: [PATCH 044/389] belt: replace height-check skip with a belt-correct vertical-clearance check The original PR skipped the max-print-height check entirely on belt printers because the sliced (virtual) Z is belt travel, not build height. As the reviewer noted, that removed the only working height guard. Restore a correct guard: - Print::validate: on belt printers, compare the upright object height (max over instances of the scene-space bbox) against printable_height directly. printable_height is the usable VERTICAL clearance above the belt: the gantry travels up the tilted plane (reach = height/cos(tilt)) and its axis range is sized for that (IR3 V2: ~354 mm gantry travel = 250 mm vertical at 45deg, and printable_height = 250). Hardware-confirmed 250 mm vertical clearance, so no cos(tilt) factor is applied. - BuildVolume::set_belt_printer: drop the diagonal Z scaling; the build-volume Z already equals printable_height, keeping the live 'outside build volume' highlight in agreement with validate(). Co-Authored-By: Claude Opus 4.8 --- src/libslic3r/BuildVolume.cpp | 11 +++++------ src/libslic3r/Print.cpp | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/BuildVolume.cpp b/src/libslic3r/BuildVolume.cpp index 2e194bdd7e..c9e779f9e7 100644 --- a/src/libslic3r/BuildVolume.cpp +++ b/src/libslic3r/BuildVolume.cpp @@ -193,12 +193,11 @@ void BuildVolume::set_belt_printer(bool enabled, double angle_deg, bool infinite // Extend the Y bound to a very large value for infinite belt. m_bboxf.max.y() = 100000.; } - // Adjust max print height to diagonal reach: printable_height / sin(belt_angle). - if (angle_deg > 0. && angle_deg < 90.) { - double sin_a = std::sin(angle_deg * M_PI / 180.0); - if (sin_a > 0.) - m_bboxf.max.z() = m_max_print_height / sin_a; - } + // Belt printer: the Z extent already equals printable_height (set above), which + // is the usable vertical clearance above the belt. The gantry's axis range is + // sized to reach height/cos(tilt), so no diagonal scaling is applied here — this + // keeps the live "outside build volume" highlight in agreement with Print::validate(). + (void) angle_deg; } } diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index b511898ae8..257aa19f1d 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1406,6 +1406,28 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* // Checks that the print does not exceed the max print height for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx) { const PrintObject &print_object = *m_objects[print_object_idx]; + // Belt printer: the sliced (virtual) Z is belt travel along the conveyor, not + // build height, so the loop below (which measures the sliced layer stack) is + // meaningless here. The real ceiling is the usable vertical clearance above the + // belt, which printable_height holds directly: the gantry travels up the tilted + // plane, so a part of height z needs gantry reach z / cos(tilt), and the machine's + // gantry-axis range is sized to accommodate that (e.g. IdeaFormer IR3 V2: ~354 mm + // of gantry travel = 250 mm vertical at 45°, and printable_height = 250). So compare + // the upright object height against printable_height directly. + if (m_config.belt_printer.value) { + const double max_h = m_config.printable_height.value; + double obj_top = 0.0; + const ModelObject *mo = print_object.model_object(); + for (const ModelInstance *mi : mo->instances) + obj_top = std::max(obj_top, mo->instance_bounding_box(*mi).max.z()); + if (obj_top > max_h + EPSILON) + return StringObjectException{ + Slic3r::format(_u8L("The object %1% exceeds the maximum printable height " + "above the belt (%2% mm)."), + print_object.model_object()->name, max_h), + print_object.model_object(), "" }; + continue; + } //FIXME It is quite expensive to generate object layers just to get the print height! if (auto layers = generate_object_layers(print_object.slicing_parameters(), layer_height_profile(print_object_idx), print_object.config().precise_z_height.value); !layers.empty()) { From 4f3a6080090a5eb944d9ea5ca584b9500e872f93 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi <163908227+tommasobbianchi@users.noreply.github.com> Date: Thu, 11 Jun 2026 06:54:02 +0200 Subject: [PATCH 045/389] belt: don't flag the lead-in as an empty-layer error on belt printers (#47) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit collect_layers_to_print() warns (CRITICAL) when an extrusion layer sits above the previous one with an empty gap below — the fixed-bed assumption that material with nothing under it is floating and unprintable. On a belt printer a *leading* empty range (the gap starts at Z=0, no prior extrusion layer) is not floating: it is the conveyor lead-in, and the part rests on the advancing belt as the first material is laid down well above Z=0. A part not designed for a belt (e.g. a flat test model tilted into the belt frame) then trips this as a false "Object can't be printed for empty layer between 0 and N" error. Suppress only the leading case (belt_printer && last_extrusion_layer == null); genuine internal gaps are still flagged, since on a belt those can be an over-angle overhang printing into air. Non-belt output is unchanged. --- src/libslic3r/GCode.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index c25a657953..3f21616bbb 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1814,8 +1814,20 @@ std::vector GCode::collect_layers_to_print(const PrintObjec + std::max(0., extra_gap); // Negative support_contact_z is not taken into account, it can result in false positives in cases - if (has_extrusions && layer_to_print.print_z() > maximal_print_z + 2. * EPSILON) - warning_ranges.emplace_back(std::make_pair((last_extrusion_layer ? last_extrusion_layer->print_z() : 0.), layers_to_print.back().print_z())); + if (has_extrusions && layer_to_print.print_z() > maximal_print_z + 2. * EPSILON) { + // Belt printers: a *leading* empty range (no prior extrusion layer, so the + // gap starts at Z=0) is not a floating object — it is just the belt lead-in. + // The part rests on the conveyor as it advances, so the first material can + // legitimately appear well above Z=0. This empty-layer check assumes a fixed + // bed, where material with nothing below it is unprintable; that assumption + // does not hold on a belt for the lead-in. Suppress only this leading case, + // and keep flagging genuine *internal* gaps (which on a belt may still be an + // over-angle overhang that would print into air). + const bool belt_leading_gap = object.print()->config().belt_printer.value + && last_extrusion_layer == nullptr; + if (!belt_leading_gap) + warning_ranges.emplace_back(std::make_pair((last_extrusion_layer ? last_extrusion_layer->print_z() : 0.), layers_to_print.back().print_z())); + } } // Remember last layer with extrusions. if (has_extrusions) From b7bda9912b29f2caa8b3ae540655cb1954e81808 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi <163908227+tommasobbianchi@users.noreply.github.com> Date: Thu, 11 Jun 2026 16:30:35 +0200 Subject: [PATCH 046/389] belt: fix IR3 V2 end G-code reversing the belt into the part (#56) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The IdeaFormer IR3 V2 End G-code ran `G28 ; home all`, which homes the Z (belt) and Y (gantry) axes. On a belt printer Z is the conveyor, so homing it runs the belt all the way back to origin, dragging the finished part back under the gantry that G28 has just lowered — the head knocks the print (reported by an IR3 V2 user; the `G1 Y50` lift came after the G28, too late). Replace the end sequence with a belt-safe one: switch to relative mode (G91), lift the gantry for clearance, advance the belt forward one full machine-depth (Z676, the 676 mm product depth) to eject the part and cycle the belt surface clean, then home X only — never the Z/belt axis. --- .../IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json index bb987e712d..b6f128ca86 100644 --- a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json +++ b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json @@ -88,7 +88,7 @@ "300" ], "machine_start_gcode": "; === IdeaFormer IR3 V2 Belt Printer Start ===\n; Axes: X=lateral, Y=gantry height (probe), Z=belt\nG90 ; absolute positioning\nM82 ; absolute extruder\nG21 ; millimeters\nG28 ; home all axes\nG1 Y20 F500 ; lift nozzle 20mm from belt\n; Bed + hotend temps come from the active filament profile. Belt PLA requires 75 C bed — use Generic/eSun PLA @IdeaFormer IR3 V2 filament presets to get it automatically.\nM140 S[hot_plate_temp_initial_layer] ; set bed temp\nM104 S[nozzle_temperature_initial_layer] ; hotend temp\nM109 S[nozzle_temperature_initial_layer] ; wait hotend\nM190 S[hot_plate_temp_initial_layer] ; wait bed\n; --- Purge blob ---\nG92 E0 ; zero extruder\nG1 Y.1 ; nozzle 0.1mm above belt\nG1 E15 F1000 ; purge 15mm blob\nG1 Z20 E25 F800 ; belt advance 20mm + extrude\nG1 E23 ; retract 2mm\nG28 Y ; re-probe belt surface\nG1 E25 ; de-retract\n; --- Prime lines (full 250mm bed width) ---\nFMS_on ; filament motion sensor\nG1 X250 E50 F2000 ; prime line 1\nG92 Z0 ; reset belt origin\nG1 Z.4 ; belt advance 0.4mm\nG1 X0 E75 ; prime line 2\nG1 F1000 ; default feedrate\nG92 E0 Z0 ; zero extruder + belt = print origin\n", - "machine_end_gcode": "; === IdeaFormer IR3 V2 Belt Printer End ===\nM400 ; wait for moves to finish\nG28 X ; home X axis\nM104 S0 ; heater off\nM140 S0 ; bed off\nG92 E0 ; zero extruder\nG1 E-5 F300 ; retract 5mm\nG4 P7000 ; wait 7s for ooze\nG28 ; home all\nG1 Y50 F1000 ; lift nozzle 50mm\nFMS_off ; filament motion sensor off\nBED_MESH_CLEAR\nM84 ; disable motors\n", + "machine_end_gcode": "; === IdeaFormer IR3 V2 Belt Printer End ===\nM400 ; wait for moves to finish\nM104 S0 ; heater off\nM140 S0 ; bed off\nG92 E0 ; zero extruder\nG1 E-5 F300 ; retract 5mm\nG4 P5000 ; wait for ooze\nG91 ; relative mode - keep every end move relative on a belt\nG1 Y20 F1000 ; raise gantry 20mm for clearance over the part\nG1 Z676 F3000 ; advance belt one full machine-depth to eject the part and clean the belt\nG90 ; back to absolute\nG28 X ; home X only - NEVER 'G28' all: that homes Z/belt and reverses the whole print back into the gantry\nFMS_off ; filament motion sensor off\nBED_MESH_CLEAR\nM84 ; disable motors\n", "machine_pause_gcode": "PAUSE", "layer_change_gcode": "G92 E0 ; belt: reset extruder at layer change (relative E)" } From 0da24cd38b99dc149b02194457b84c2ee35d6a27 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Fri, 12 Jun 2026 03:14:12 -0500 Subject: [PATCH 047/389] Belt/Standard calibrations (#54) Enables supported printing of standard Orcaslicer calibration profiles. * Build 2 Checkpoint * fix support generation wedge, ghost layers * flip cornering tests 180 deg to waste less supports * fix row spacing on the flow ratio calibrations * more testing, this didn't fix anything * switched rotation tools, same issue * fixed Z-offset issues * add rest of PA features, may look a bit weird on a belt * make temp towers work * re-enable spiral on calibrations that want it * Final cleanup pre-PR and community testing --- src/libslic3r/BeltGCodeWriter.cpp | 6 +- src/libslic3r/BeltGCodeWriter.hpp | 9 + src/libslic3r/GCode.cpp | 97 ++++++-- src/libslic3r/PrintObjectSlice.cpp | 9 +- src/libslic3r/Support/TreeSupport.cpp | 64 +++++- src/libslic3r/calib.cpp | 82 ++++--- src/libslic3r/calib.hpp | 5 +- src/slic3r/GUI/Plater.cpp | 304 +++++++++++++++++++++++++- src/slic3r/GUI/Plater.hpp | 2 + src/slic3r/GUI/calib_dlg.cpp | 35 +++ 10 files changed, 554 insertions(+), 59 deletions(-) diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index a2322c9243..7c645edf43 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -38,7 +38,11 @@ void BeltGCodeWriter::set_machine_frame_transform(const PrintConfig &config) Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const { // Step 1+2: To Cartesian (back_transform + axis_remap). - Vec3d after_back = m_belt_back_transform.apply(pos); + // In world-coordinates mode (PA line / PA pattern calibration) the input + // already describes a point relative to the belt surface, so the + // slicer->world back-transform is skipped and only the machine kinematics + // (axis remap + frame shear/scale) are applied. + Vec3d after_back = m_world_coordinates ? pos : m_belt_back_transform.apply(pos); Vec3d result = apply_axis_remap(after_back); Vec3d after_remap = result; // Step 3: Machine-frame transform (belt frame tilt) applied LAST so it acts diff --git a/src/libslic3r/BeltGCodeWriter.hpp b/src/libslic3r/BeltGCodeWriter.hpp index 30159f4f33..ff7428d062 100644 --- a/src/libslic3r/BeltGCodeWriter.hpp +++ b/src/libslic3r/BeltGCodeWriter.hpp @@ -23,6 +23,14 @@ public: void set_machine_frame_transform(const PrintConfig &config); Vec3d to_machine_coords(const Vec3d &pos) const; + // World-coordinates mode: incoming coordinates are treated as points + // relative to the physical belt surface (X across, Y along the belt, + // Z height above it) instead of slicing-frame coordinates — the + // slicer->world back-transform is skipped. Used by the PA line / PA + // pattern calibration generators, whose logical bed coordinates describe + // first-layer drawings on the build surface. + void set_world_coordinates(bool enable) { m_world_coordinates = enable; } + // First-layer plane: when set to a non-null active evaluator, travel // speed selection consults the plane per-move and uses // initial_layer_travel_speed for points within first_layer_height_mm @@ -47,6 +55,7 @@ protected: private: BeltBackTransform m_belt_back_transform; MachineFrameTransform m_machine_frame_transform; + bool m_world_coordinates = false; // Borrowed pointer; lifetime owned by GCode. null = inactive. const FirstLayerPlane *m_first_layer_plane = nullptr; double m_first_layer_thickness_mm = 0.; diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 3f21616bbb..af59428c89 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1834,6 +1834,12 @@ std::vector GCode::collect_layers_to_print(const PrintObjec last_extrusion_layer = &layers_to_print.back(); } + // ORCA-Belt: objects print at their position along the belt, so the first + // extrusions legitimately start far above Z=0. Drop the spurious + // "empty layers from the bed" range while keeping genuine mid-print gaps. + if (skip_empty_first_layer && !warning_ranges.empty() && warning_ranges.front().first == 0.) + warning_ranges.erase(warning_ranges.begin()); + if (! warning_ranges.empty()) { std::string warning; size_t i = 0; @@ -3307,7 +3313,16 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato pa_test.set_speed(fast_speed, slow_speed); pa_test.draw_numbers() = print.calib_params().print_numbers; + + // ORCA-Belt: the PA line test draws directly on the build surface in + // logical bed coordinates — on a belt printer that surface is the + // belt plane, not the slicing plane. + BeltGCodeWriter* belt_writer = dynamic_cast(m_writer.get()); + if (belt_writer != nullptr) + belt_writer->set_world_coordinates(true); gcode += pa_test.generate_test(params.start, params.step, std::llround(std::ceil((params.end - params.start) / params.step)) + 1); + if (belt_writer != nullptr) + belt_writer->set_world_coordinates(false); file.write(gcode); } else { @@ -4653,31 +4668,57 @@ LayerResult GCode::process_layer( gcode += ";_SET_FAN_SPEED_CHANGING_LAYER\n"; //Calibration Layer-specific GCode + // ORCA-Belt: on belt printers the calibration object is counter-rotated to + // stand upright in slicing space on top of a support wedge, so its first + // layer starts above Z=0 (at its position along the belt) with support-only + // layers below it. Reference the per-height calibration bands to the bottom + // of the object so they keep their designed meaning; on regular printers + // the object base is at Z=0 and calib_z == print_z. + double calib_z = print_z; + if (m_config.belt_printer.value && print.calib_mode() != CalibMode::Calib_None) { + // Skip empty ghost layers the grid may produce below the object. + for (const Layer* l : layer.object()->layers()) + if (!l->lslices.empty()) { + calib_z = print_z - (l->print_z - l->height); + break; + } + } switch (print.calib_mode()) { case CalibMode::Calib_PA_Tower: { - gcode += writer().set_pressure_advance(print.calib_params().start + static_cast(print_z) * print.calib_params().step); + gcode += writer().set_pressure_advance(print.calib_params().start + static_cast(std::max(0.0, calib_z)) * print.calib_params().step); break; } case CalibMode::Calib_Temp_Tower: { - gcode += writer().set_temperature(this->interpolate_value_across_layers(static_cast(print.calib_params().start), static_cast(print.calib_params().end), 5.0f)); + // ORCA-Belt: the sectioned variant prints each temperature as its + // own object in native belt orientation, with the temperature + // encoded in the object name ("temp_230") — step per object + // instead of ramping per layer band. + int sectioned_temp = 0; + if (m_config.belt_printer.value && + sscanf(layer.object()->model_object()->name.c_str(), "temp_%d", §ioned_temp) == 1 && + sectioned_temp > 0) { + gcode += writer().set_temperature(static_cast(sectioned_temp)); + } else { + gcode += writer().set_temperature(this->interpolate_value_across_layers(static_cast(print.calib_params().start), static_cast(print.calib_params().end), 5.0f)); + } break; } case CalibMode::Calib_VFA_Tower: { - auto _speed = print.calib_params().start + std::floor(print_z / 5.0) * print.calib_params().step; + auto _speed = print.calib_params().start + std::floor(std::max(0.0, calib_z) / 5.0) * print.calib_params().step; m_calib_config.set_key_value("outer_wall_speed", new ConfigOptionFloat(std::round(_speed))); break; } case CalibMode::Calib_Vol_speed_Tower: { - auto _speed = print.calib_params().start + print_z * print.calib_params().step; + auto _speed = print.calib_params().start + std::max(0.0, calib_z) * print.calib_params().step; m_calib_config.set_key_value("outer_wall_speed", new ConfigOptionFloat(std::round(_speed))); break; } case CalibMode::Calib_Retraction_tower: { - auto _length = print.calib_params().start + std::floor(std::max(0.0,print_z-0.4)) * print.calib_params().step; + auto _length = print.calib_params().start + std::floor(std::max(0.0,calib_z-0.4)) * print.calib_params().step; DynamicConfig _cfg; _cfg.set_key_value("retraction_length", new ConfigOptionFloats{_length}); writer().config.apply(_cfg); - sprintf(buf, "; Calib_Retraction_tower: Z_HEIGHT: %g, length:%g\n", print_z, _length); + sprintf(buf, "; Calib_Retraction_tower: Z_HEIGHT: %g, length:%g\n", calib_z, _length); gcode += buf; break; } @@ -7415,25 +7456,39 @@ std::string GCode::extrusion_role_to_string_for_parser(const ExtrusionRole & rol // Step = 0 means gradual interpolation finishing at last value. float GCode::interpolate_value_across_layers(float start_value, float end_value, float step) const { - if (m_layer_index <= 1) { + float ratio; + // ORCA-Belt: counter-rotated calibration objects stand on a support wedge, + // so support-only layers below the object would stretch a layer-index + // interpolation. Use the object's own Z span instead, so the value ramps + // across the test geometry only. + if (m_config.belt_printer.value && m_layer != nullptr && !m_layer->object()->layers().empty()) { + const auto& layers = m_layer->object()->layers(); + // Skip empty ghost layers the grid may produce below the object. + double z_min = layers.front()->print_z; + for (const Layer* l : layers) + if (!l->lslices.empty()) { z_min = l->print_z; break; } + const double z_max = layers.back()->print_z; + if (m_layer->print_z <= z_min + EPSILON || z_max - z_min <= EPSILON) + return start_value; + ratio = float(std::min(1.0, (m_layer->print_z - z_min) / (z_max - z_min))); + } else if (m_layer_index <= 1) { return start_value; + } else { + ratio = m_layer_index / (m_layer_count - 1.f); } - else { - bool use_steps = step > 0.f; - if (use_steps) { - if (start_value > end_value) { - start_value += step; - } else { - end_value += step; - } + bool use_steps = step > 0.f; + if (use_steps) { + if (start_value > end_value) { + start_value += step; + } else { + end_value += step; } - float ratio = m_layer_index / (m_layer_count - 1.f); - float value = start_value + ratio * (end_value - start_value); - if (use_steps) { - value = trunc(value / step) * step; - } - return value; } + float value = start_value + ratio * (end_value - start_value); + if (use_steps) { + value = trunc(value / step) * step; + } + return value; } std::string encodeBase64(uint64_t value) diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 7e5203d624..1212100eac 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -966,7 +966,14 @@ void PrintObject::slice() // correct machine-frame coordinates whether or not a global mode is active. double belt_surface_z = BeltTransformPipeline::has_preslice_remap(pcfg) ? BeltTransformPipeline::remap_bbox(*this->model_object(), pcfg).min.z() : 0.; - double belt_z_shift = m_belt_min_z - belt_surface_z; + // The compensation must mirror the Z-shift actually applied, which + // is max(0, -m_belt_min_z): when the transformed mesh starts ABOVE + // slicer Z=0 (m_belt_min_z > 0 — possible for counter-rotated or + // asymmetric geometry whose centered-frame minimum lands positive) + // no lift was applied, and an unclamped m_belt_min_z here would + // leak straight into the layer Z values, floating the whole object + // off the belt by exactly that amount. + double belt_z_shift = std::min(m_belt_min_z, 0.) - belt_surface_z; double global_z_offset = belt_z_shift; // Centering correction: trafo_centered pretranslates by diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index e8009cf5c5..8c0fe205a4 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1801,8 +1801,7 @@ void TreeSupport::generate() { BeltFloorContext ctx; if (ctx.init(m_slicing_params, *m_print_config) - && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly - && m_object->support_layer_count() > 0) { + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { const auto &sp = m_slicing_params; // Find the lowest non-empty, non-brim support layer. ExPolygons source_areas; @@ -1830,16 +1829,61 @@ void TreeSupport::generate() } } } + // ORCA-Belt calibration: a counter-rotated calibration object + // stands on a support wedge that lies entirely below the object's + // first layer, where the tree pipeline has no layers at all — so + // no support content can exist yet. Seed the extension directly + // from the floating portion of the first layer (anything more + // than one layer height above the belt floor). For objects whose + // first layer rests on the belt the floating region is empty and + // behavior is unchanged. + double first_z = m_object->support_layer_count() > 0 ? m_object->get_support_layer(0)->print_z : 0.; + bool seeded = false; + if (source_areas.empty() && m_object_config->enable_support.value && !m_object->layers().empty()) { + // The layer grid may start with an empty ghost layer just below + // the object (grid rounding against the belt global Z offset) — + // anchor the seed to the first layer that has geometry. Object + // layer print_z and the floor plane are both in the globally + // offset frame here (belt_floor_z_shift was adjusted alongside + // the layer Z values in PrintObject::slice()). + const Layer *first_layer = nullptr; + for (const Layer *l : m_object->layers()) + if (!l->lslices_extrudable.empty()) { first_layer = l; break; } + if (first_layer != nullptr) { + ExPolygons floating = diff_ex(first_layer->lslices_extrudable, + ctx.surface_polygon(first_layer->bottom_z() - first_layer->height)); + BOOST_LOG_TRIVIAL(debug) << "[BELT-CALIB] wedge seed: obj=" << m_object->model_object()->name + << " bottom_z=" << first_layer->bottom_z() << " floating=" << floating.size(); + if (!floating.empty()) { + source_areas = std::move(floating); + first_z = first_layer->bottom_z(); + seeded = true; + } + } + } if (!source_areas.empty()) { BoundingBoxf3 bb = belt_remapped_bbox(*m_object->model_object(), m_object->print()->config()); double from_extent = std::abs(bb.min(ctx.from_axis())); double bb_min_z = std::abs(bb.min.z()); - double first_z = m_object->get_support_layer(0)->print_z; // Depth = from-axis extent + pre-shear bbox Z offset (ensure_on_bed // distance) + 10mm safety margin. The 10mm is a bodge to avoid // small cutoff artifacts — ideally computed exactly from belt geometry. double extra_depth = std::min(from_extent + bb_min_z + 10., std::max(0., first_z)); + if (seeded) { + // Seeded wedge: the depth is known exactly — down to the lowest + // belt-floor point under the floating footprint. The bbox + // heuristic above under-estimates it for meshes centered + // around their origin (every object loaded through the GUI). + double min_floor = first_z; + for (const ExPolygon &ep : source_areas) + for (const Point &pt : ep.contour.points) + min_floor = std::min(min_floor, ctx.floor_print_z(pt)); + extra_depth = std::min(std::max(0., first_z), first_z - min_floor + 2.); + } int num_extra = std::max(0, (int)std::ceil(extra_depth / sp.layer_height)); + // Seeded wedge: top layers become a dense support interface so the + // object's floating first layer bridges a roof, not sparse infill. + const int interface_layers = seeded ? std::max(0, m_object_config->support_interface_top_layers.value) : 0; ExPolygons prev_areas = source_areas; // Build belt extension layers (lowest Z first). SupportLayerPtrs belt_ext_layers; @@ -1853,8 +1897,15 @@ void TreeSupport::generate() sl->base_areas = clipped; // Populate area_groups — generate_toolpaths() iterates these, // not base_areas directly. - for (auto &expoly : sl->base_areas) - sl->area_groups.emplace_back(&expoly, SupportLayer::BaseType, 0); + // Note: base areas only get infill when support_base_pattern + // is explicitly set (with the default pattern tree bases are + // walls-only) — the calibration flow sets rectilinear. + const bool roof = i <= interface_layers; + for (auto &expoly : sl->base_areas) { + sl->area_groups.emplace_back(&expoly, roof ? SupportLayer::RoofType : SupportLayer::BaseType, 0); + if (roof) + sl->area_groups.back().interface_id = i & 1; + } sl->lslices = clipped; sl->lslices_bboxes.reserve(clipped.size()); for (const ExPolygon &ep : clipped) @@ -1865,6 +1916,9 @@ void TreeSupport::generate() if (!belt_ext_layers.empty()) { auto &sl_vec = m_object->support_layers(); sl_vec.insert(sl_vec.begin(), belt_ext_layers.begin(), belt_ext_layers.end()); + BOOST_LOG_TRIVIAL(debug) << "[BELT-CALIB] wedge ext layers=" << belt_ext_layers.size() + << " z=" << belt_ext_layers.front()->print_z << ".." << belt_ext_layers.back()->print_z + << " seeded=" << seeded; } } } diff --git a/src/libslic3r/calib.cpp b/src/libslic3r/calib.cpp index 4b3e05df8d..3509b32257 100644 --- a/src/libslic3r/calib.cpp +++ b/src/libslic3r/calib.cpp @@ -1,4 +1,5 @@ #include "calib.hpp" +#include "BeltGCodeWriter.hpp" #include "BoundingBox.hpp" #include "Config.hpp" #include "Model.hpp" @@ -587,21 +588,21 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_custom_gcodes(const Dyna refresh_setup(config, is_bbl_machine, object, origin); - gcode << move_to(Vec2d(m_starting_point.x(), m_starting_point.y()), m_writer, "Move to start XY position"); - gcode << m_writer.travel_to_z(height_first_layer() + height_z_offset(), "Move to start Z position"); - gcode << m_writer.set_pressure_advance(m_params.start); + gcode << move_to(Vec2d(m_starting_point.x(), m_starting_point.y()), *m_writer, "Move to start XY position"); + gcode << m_writer->travel_to_z(height_first_layer() + height_z_offset(), "Move to start Z position"); + gcode << m_writer->set_pressure_advance(m_params.start); const DrawBoxOptArgs default_box_opt_args(wall_count(), height_first_layer(), line_width_first_layer(), speed_adjust(speed_first_layer())); // create anchoring frame - gcode << draw_box(m_writer, m_starting_point.x(), m_starting_point.y(), print_size_x(), frame_size_y(), default_box_opt_args); + gcode << draw_box(*m_writer, m_starting_point.x(), m_starting_point.y(), print_size_x(), frame_size_y(), default_box_opt_args); // create tab for numbers DrawBoxOptArgs draw_box_opt_args = default_box_opt_args; draw_box_opt_args.is_filled = true; draw_box_opt_args.num_perimeters = wall_count(); - gcode << draw_box(m_writer, m_starting_point.x(), m_starting_point.y() + frame_size_y() + line_spacing_first_layer(), + gcode << draw_box(*m_writer, m_starting_point.x(), m_starting_point.y() + frame_size_y() + line_spacing_first_layer(), print_size_x(), max_numbering_height() + line_spacing_first_layer() + m_glyph_padding_vertical * 2, draw_box_opt_args); @@ -627,15 +628,15 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_custom_gcodes(const Dyna gcode = std::stringstream(); // reset for next layer contents gcode << "; start pressure advance pattern for layer\n"; - gcode << m_writer.travel_to_z(layer_height, "Move to layer height"); - gcode << m_writer.reset_e(); + gcode << m_writer->travel_to_z(layer_height, "Move to layer height"); + gcode << m_writer->reset_e(); } // line numbering if (i == 1) { m_number_len = max_numbering_length(); - gcode << m_writer.set_pressure_advance(m_params.start); + gcode << m_writer->set_pressure_advance(m_params.start); double number_e_per_mm = e_per_mm(line_width(), height_layer(), m_config.option("nozzle_diameter")->get_at(0), @@ -646,20 +647,20 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_custom_gcodes(const Dyna for (int j = 0; j < num_patterns; j += 2) { gcode << draw_number(glyph_start_x(j), m_starting_point.y() + frame_size_y() + m_glyph_padding_vertical + line_width(), m_params.start + (j * m_params.step), m_draw_digit_mode, line_width(), number_e_per_mm, - speed_first_layer(), m_writer); + speed_first_layer(), *m_writer); } // flow value int line_num = num_patterns + 2; gcode << draw_number(glyph_start_x(line_num), m_starting_point.y() + frame_size_y() + m_glyph_padding_vertical + line_width(), flow_val(), m_draw_digit_mode, line_width(), number_e_per_mm, - speed_first_layer(), m_writer); + speed_first_layer(), *m_writer); // acceleration line_num = num_patterns + 4; gcode << draw_number(glyph_start_x(line_num), m_starting_point.y() + frame_size_y() + m_glyph_padding_vertical + line_width(), accel, m_draw_digit_mode, line_width(), number_e_per_mm, - speed_first_layer(), m_writer); + speed_first_layer(), *m_writer); } @@ -678,20 +679,20 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_custom_gcodes(const Dyna /* Draw a line at slightly slower accel and speed in order to trick gcode writer to force update acceleration and speed. * We do this since several tests may be generated by their own gcode writers which are * not aware about their neighbours updating acceleration/speed */ - gcode << m_writer.set_print_acceleration(std::max(1, accel - 1)); - gcode << move_to(Vec2d(m_starting_point.x(), m_starting_point.y()), m_writer, "Move to starting point", zhop_height, layer_height); - gcode << draw_line(m_writer, Vec2d(m_starting_point.x(), m_starting_point.y() + frame_size_y()), line_width(), height_layer(), speed_adjust(std::max(1, speed_perimeter() - 1)), "Accel/flow trick line"); - gcode << m_writer.set_print_acceleration(accel); + gcode << m_writer->set_print_acceleration(std::max(1, accel - 1)); + gcode << move_to(Vec2d(m_starting_point.x(), m_starting_point.y()), *m_writer, "Move to starting point", zhop_height, layer_height); + gcode << draw_line(*m_writer, Vec2d(m_starting_point.x(), m_starting_point.y() + frame_size_y()), line_width(), height_layer(), speed_adjust(std::max(1, speed_perimeter() - 1)), "Accel/flow trick line"); + gcode << m_writer->set_print_acceleration(accel); } double initial_x = to_x; double initial_y = to_y; - gcode << move_to(Vec2d(to_x, to_y), m_writer, "Move to pattern start",zhop_height,layer_height); + gcode << move_to(Vec2d(to_x, to_y), *m_writer, "Move to pattern start",zhop_height,layer_height); for (int j = 0; j < num_patterns; ++j) { // increment pressure advance - gcode << m_writer.set_pressure_advance(m_params.start + (j * m_params.step)); + gcode << m_writer->set_pressure_advance(m_params.start + (j * m_params.step)); for (int k = 0; k < wall_count(); ++k) { to_x += std::cos(to_radians(m_corner_angle) / 2) * side_length; @@ -701,27 +702,27 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_custom_gcodes(const Dyna auto draw_line_arg_line_width = line_width(); // don't use line_width_first_layer so results are consistent across all layers auto draw_line_arg_speed = i == 0 ? speed_adjust(speed_first_layer()) : speed_adjust(speed_perimeter()); auto draw_line_arg_comment = "Print pattern wall"; - gcode << draw_line(m_writer, Vec2d(to_x, to_y), draw_line_arg_line_width, draw_line_arg_height, draw_line_arg_speed, draw_line_arg_comment); + gcode << draw_line(*m_writer, Vec2d(to_x, to_y), draw_line_arg_line_width, draw_line_arg_height, draw_line_arg_speed, draw_line_arg_comment); to_x -= std::cos(to_radians(m_corner_angle) / 2) * side_length; to_y += std::sin(to_radians(m_corner_angle) / 2) * side_length; - gcode << draw_line(m_writer, Vec2d(to_x, to_y), draw_line_arg_line_width, draw_line_arg_height, draw_line_arg_speed, draw_line_arg_comment); + gcode << draw_line(*m_writer, Vec2d(to_x, to_y), draw_line_arg_line_width, draw_line_arg_height, draw_line_arg_speed, draw_line_arg_comment); to_y = initial_y; if (k != wall_count() - 1) { // perimeters not done yet. move to next perimeter to_x += line_spacing_angle(); - gcode << move_to(Vec2d(to_x, to_y), m_writer, "Move to start next pattern wall", zhop_height, layer_height); // Call move to command with XY as well as z hop and layer height to invoke and undo z lift + gcode << move_to(Vec2d(to_x, to_y), *m_writer, "Move to start next pattern wall", zhop_height, layer_height); // Call move to command with XY as well as z hop and layer height to invoke and undo z lift } else if (j != num_patterns - 1) { // patterns not done yet. move to next pattern to_x += m_pattern_spacing + line_width(); - gcode << move_to(Vec2d(to_x, to_y), m_writer, "Move to next pattern", zhop_height, layer_height); // Call move to command with XY as well as z hop and layer height to invoke and undo z lift + gcode << move_to(Vec2d(to_x, to_y), *m_writer, "Move to next pattern", zhop_height, layer_height); // Call move to command with XY as well as z hop and layer height to invoke and undo z lift } else if (i != m_num_layers - 1) { // layers not done yet. move back to start to_x = initial_x; - gcode << move_to(Vec2d(to_x, to_y), m_writer, "Move back to start position", zhop_height, layer_height); // Call move to command with XY as well as z hop and layer height to invoke and undo z lift - gcode << m_writer.reset_e(); // reset extruder before printing placeholder cube to avoid over extrusion + gcode << move_to(Vec2d(to_x, to_y), *m_writer, "Move back to start position", zhop_height, layer_height); // Call move to command with XY as well as z hop and layer height to invoke and undo z lift + gcode << m_writer->reset_e(); // reset extruder before printing placeholder cube to avoid over extrusion } else { // everything done } @@ -729,7 +730,7 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_custom_gcodes(const Dyna } } - gcode << m_writer.set_pressure_advance(m_params.start); + gcode << m_writer->set_pressure_advance(m_params.start); gcode << "; end pressure advance pattern for layer\n"; CustomGCode::Item item; @@ -796,13 +797,36 @@ void CalibPressureAdvancePattern::_refresh_writer(bool is_bbl_machine, const Mod PrintConfig print_config; print_config.apply(m_config, true); - m_writer.apply_print_config(print_config); - m_writer.set_xy_offset(origin(0), origin(1)); - m_writer.set_is_bbl_machine(is_bbl_machine); + // ORCA-Belt: the pattern is drawn in logical bed coordinates directly on + // the build surface — on a belt printer that means the belt plane, which + // needs the machine kinematics (axis remap + frame shear/scale) with the + // coordinates interpreted as world points (see set_world_coordinates). + if (print_config.belt_printer.value) { + auto belt_writer = std::make_shared(); + belt_writer->set_belt_back_transform(print_config); + belt_writer->set_machine_frame_transform(print_config); + belt_writer->set_world_coordinates(true); + const int rx = int(print_config.gcode_remap_x.value); + const int ry = int(print_config.gcode_remap_y.value); + const int rz = int(print_config.gcode_remap_z.value); + if (rx != 0 || ry != 1 || rz != 2) { + belt_writer->set_axis_remap(rx, ry, rz); + BoundingBoxf bbox_bed(print_config.printable_area.values); + belt_writer->set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), + print_config.printable_height.value)); + } + m_writer = std::move(belt_writer); + } else if (dynamic_cast(m_writer.get()) != nullptr) { + m_writer = std::make_shared(); + } + + m_writer->apply_print_config(print_config); + m_writer->set_xy_offset(origin(0), origin(1)); + m_writer->set_is_bbl_machine(is_bbl_machine); const unsigned int extruder_id = object.volumes.front()->extruder_id(); - m_writer.set_extruders({extruder_id}); - m_writer.set_extruder(extruder_id); + m_writer->set_extruders({extruder_id}); + m_writer->set_extruder(extruder_id); } double CalibPressureAdvancePattern::object_size_x() const diff --git a/src/libslic3r/calib.hpp b/src/libslic3r/calib.hpp index cbac1d3f86..b36c75db62 100644 --- a/src/libslic3r/calib.hpp +++ b/src/libslic3r/calib.hpp @@ -358,7 +358,10 @@ private: const Calib_Params &m_params; - GCodeWriter m_writer; + // Polymorphic so belt printers get a BeltGCodeWriter in world-coordinates + // mode (_refresh_writer); shared_ptr keeps the class copyable — the writer + // is rebuilt by refresh_setup() before every use anyway. + std::shared_ptr m_writer{std::make_shared()}; Vec3d m_starting_point; bool m_is_start_point_fixed = false; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 823deb0aea..6bc6a30f0f 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -12594,8 +12594,181 @@ void Plater::add_model(bool imperial_units, std::string fname) } } +// ORCA-Belt: belt-printer handling for the desktop calibration tests. +// +// Belt slicing applies a global pre-slice rotation R(angle, axis) to every +// mesh (see BeltTransform.hpp) so the slicing planes match the tilted gantry. +// Calibration models are designed for upright slicing: their per-height test +// bands and XY-plane quality features assume slicer Z is the model's own Z +// axis. Counter-rotating each calibration object by the inverse rotation in +// world space cancels the global rotation, so in slicing space the object +// stands upright exactly as on a flat-bed printer and every test keeps its +// designed meaning. Physically the object then leans over the belt with its +// bottom face overhanging, so per-object supports fill the wedge between the +// bottom face and the belt. The wedge prints entirely below the object's base +// plane and leaves the test geometry untouched. Manual tree support is used +// so the deliberate bridge/overhang features of the test models stay +// unsupported; the wedge under the floating bottom face is built by the +// belt-floor extension in TreeSupport::generate(), which stacks the floating +// first-layer footprint down to the belt surface. +static bool belt_calib_rotation_params(double& angle_rad, Vec3d& axis) +{ + const auto& printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config; + const auto* belt_opt = printer_config.option("belt_printer"); + if (belt_opt == nullptr || !belt_opt->value) + return false; + const auto* axis_opt = printer_config.option>("belt_slice_rotation"); + const auto* angle_opt = printer_config.option("belt_slice_rotation_angle"); + if (axis_opt == nullptr || angle_opt == nullptr) + return false; + switch (axis_opt->value) { + case BeltRotationAxis::X: axis = Vec3d::UnitX(); break; + case BeltRotationAxis::Y: axis = Vec3d::UnitY(); break; + // Z rotation is an in-plane spin and None means no tilt; objects already + // slice upright in those cases and need no special handling. + default: return false; + } + angle_rad = -Geometry::deg2rad(angle_opt->value); + return std::abs(angle_rad) > EPSILON; +} + +// ORCA-Belt: flip the ringing tower 180° about Z before the belt +// counter-rotation — its sloped face then leans over the belt and the +// support wedge gets much smaller. +static void belt_calib_flip_ringing_tower(Model &model) +{ + double angle_rad = 0.; + Vec3d axis = Vec3d::UnitX(); + if (belt_calib_rotation_params(angle_rad, axis) && !model.objects.empty()) + model.objects.front()->rotate(M_PI, Vec3d::UnitZ()); +} + +void Plater::_calib_apply_belt_mode() +{ + double angle_rad = 0.; + Vec3d axis = Vec3d::UnitX(); + if (!belt_calib_rotation_params(angle_rad, axis)) + return; + + auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config; + // Spiral vase stays enabled where the tests request it: the support wedge + // lies strictly below the object, support layers never spiralize + // (spiral_vase_enable requires an object layer), and the spiral/support + // exclusivity check only applies to globally enabled supports — the wedge + // uses per-object supports. + // A skirt would be drawn in the first slicing plane, which lies mostly + // above the belt surface. + print_config->set_key_value("skirt_loops", new ConfigOptionInt(0)); + + const Matrix3d cancel_rotation = Eigen::AngleAxisd(angle_rad, axis).toRotationMatrix(); + std::vector obj_idxs; + for (size_t i = 0; i < model().objects.size(); ++i) { + ModelObject* obj = model().objects[i]; + if (obj->instances.size() != 1) + continue; + obj_idxs.emplace_back(i); + + // Manual tree support: only the floating bottom face gets a support + // wedge (via the belt-floor extension in TreeSupport::generate()), + // leaving the test features untouched. The style is pinned to hybrid + // because the default style resolves to organic, which bypasses the + // non-organic generator that hosts the belt-floor extension. + obj->config.set_key_value("enable_support", new ConfigOptionBool(true)); + obj->config.set_key_value("support_type", new ConfigOptionEnum(stTree)); + obj->config.set_key_value("support_style", new ConfigOptionEnum(smsTreeHybrid)); + obj->config.set_key_value("support_on_build_plate_only", new ConfigOptionBool(false)); + // With the default base pattern, tree support base areas print as + // hollow outlines (no infill) — the wedge needs a real pattern. + obj->config.set_key_value("support_base_pattern", new ConfigOptionEnum(smpRectilinear)); + + // Counter-rotate exactly the way the rotate gizmo would: rotation on + // the instance, then a plain drop to the bed. This leaves the object + // in the same state shape as any manually rotated object, which the + // belt pipeline is known to handle. + ModelInstance* inst = obj->instances.front(); + inst->rotate(cancel_rotation); + obj->invalidate_bounding_box(); + obj->ensure_on_bed(); + + { + const BoundingBoxf3 rb = obj->raw_bounding_box(); + const Vec3d io = inst->get_offset(); + const Vec3d ir = inst->get_rotation(); + BOOST_LOG_TRIVIAL(debug) << "[BELT-CALIB] helper exit: obj=" << obj->name + << " inst_offset=(" << io.x() << "," << io.y() << "," << io.z() << ")" + << " inst_rot=(" << ir.x() << "," << ir.y() << "," << ir.z() << ")" + << " vol0_offset=(" << obj->volumes.front()->get_offset().x() << "," + << obj->volumes.front()->get_offset().y() << "," << obj->volumes.front()->get_offset().z() << ")" + << " raw_bbox=(" << rb.min.x() << "," << rb.min.y() << "," << rb.min.z() + << ")..(" << rb.max.x() << "," << rb.max.y() << "," << rb.max.z() << ")" + << " min_z=" << obj->min_z(); + } + } + + // Each object's support wedge extends upstream of it by roughly its own + // depth (at 45°), so the tight flat-bed layouts of the multi-part tests + // leave wedges intersecting the neighbouring parts. Keep the grid rows of + // the test layouts together and open up the space between rows just + // enough for the wedge shadow. + if (obj_idxs.size() > 1) { + std::vector sorted_objs; + sorted_objs.reserve(obj_idxs.size()); + for (size_t i : obj_idxs) + sorted_objs.emplace_back(model().objects[i]); + std::sort(sorted_objs.begin(), sorted_objs.end(), [](const ModelObject* a, const ModelObject* b) { + return a->instances.front()->get_offset(Y) < b->instances.front()->get_offset(Y); + }); + std::vector> rows; + double row_y = std::numeric_limits::quiet_NaN(); + for (ModelObject* o : sorted_objs) { + const double oy = o->instances.front()->get_offset(Y); + if (rows.empty() || oy - row_y > 1.) + rows.emplace_back(); + rows.back().emplace_back(o); + row_y = oy; + } + const double wedge_factor = std::abs(std::tan(angle_rad)); + double cursor = std::numeric_limits::quiet_NaN(); + for (std::vector& row : rows) { + double rmin = std::numeric_limits::max(); + double rmax = std::numeric_limits::lowest(); + for (ModelObject* o : row) { + const BoundingBoxf3 bb = o->instance_bounding_box(0); + rmin = std::min(rmin, bb.min.y()); + rmax = std::max(rmax, bb.max.y()); + } + if (std::isnan(cursor)) + cursor = rmin; // the first row anchors the layout + const double shift = cursor - rmin; + for (ModelObject* o : row) { + ModelInstance* inst = o->instances.front(); + inst->set_offset(Y, inst->get_offset(Y) + shift); + o->invalidate_bounding_box(); + } + cursor += (rmax - rmin) * (1. + wedge_factor) + 5.; + } + } + + wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config(); + changed_objects(obj_idxs); +} + void Plater::calib_pa(const Calib_Params& params) { + // ORCA-Belt: PA Line / PA Pattern have the belt plumbing in place + // (BeltGCodeWriter::set_world_coordinates draws them on the belt surface) + // but are not validated yet — keep them gated to the PA Tower for now. + { + double angle_rad = 0.; + Vec3d axis = Vec3d::UnitX(); + if (belt_calib_rotation_params(angle_rad, axis) && params.mode != CalibMode::Calib_PA_Tower) { + MessageDialog msg_dlg(nullptr, _L("PA Line and PA Pattern tests are not enabled yet on belt printers.\nPlease use the PA Tower method instead."), + wxEmptyString, wxICON_WARNING | wxOK); + msg_dlg.ShowModal(); + return; + } + } const auto calib_pa_name = wxString::Format(L"Pressure Advance Test"); new_project(false, false, calib_pa_name); wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor)); @@ -12927,6 +13100,7 @@ void Plater::_calib_pa_tower(const Calib_Params& params) { cut_horizontal(0, 0, new_height, ModelObjectCutAttribute::KeepLower); } + _calib_apply_belt_mode(); _calib_pa_select_added_objects(); } @@ -13104,6 +13278,8 @@ void Plater::calib_flowrate(bool is_linear, int pass, InfillPattern pattern) { auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config; printer_config->set_key_value("resonance_avoidance", new ConfigOptionBool{false}); + _calib_apply_belt_mode(); + // Refresh object after scaling const std::vector object_idx(boost::counting_iterator(0), boost::counting_iterator(model().objects.size())); changed_objects(object_idx); @@ -13120,7 +13296,19 @@ void Plater::calib_temp(const Calib_Params& params) { wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor)); if (params.mode != CalibMode::Calib_Temp_Tower) return; - + + // ORCA-Belt: a counter-rotated tower would cantilever every block off a + // support wedge — print the temperature blocks as separate objects in + // native belt orientation instead. + { + double belt_angle_rad = 0.; + Vec3d belt_axis = Vec3d::UnitX(); + if (belt_calib_rotation_params(belt_angle_rad, belt_axis)) { + _calib_temp_belt_sectioned(params, std::abs(belt_angle_rad)); + return; + } + } + add_model(false, Slic3r::resources_dir() + "/calib/temperature_tower/temperature_tower.drc"); auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config; auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config; @@ -13190,6 +13378,107 @@ void Plater::calib_temp(const Calib_Params& params) { p->background_process.fff_print()->set_calib_params(params); } +// ORCA-Belt: sectioned temperature test. Each temperature gets its own block +// cut out of the temperature tower model, printed in native belt orientation +// (no counter-rotation, no support wedge) and spaced along the belt so the +// blocks' layer ranges are disjoint — they print strictly one after another, +// starting with the start temperature closest to the gantry. The temperature +// is encoded in the object name ("temp_230") and applied per object by the +// Calib_Temp_Tower handler at G-code time, replacing the per-layer-band ramp +// that only makes sense for a monolithic upright tower. +void Plater::_calib_temp_belt_sectioned(const Calib_Params& params, double belt_angle_rad) +{ + constexpr double base_temp_tower_nozzle_diameter = 0.4; + constexpr double base_temp_tower_block_height = 10.0; + constexpr int base_temp_tower_temp_step = 5; + + auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config; + auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config; + auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config; + + const long start_temp = lround(params.start); + const long end_temp = lround(params.end); + const int n_blocks = std::max(1, int((start_temp - end_temp) / base_temp_tower_temp_step) + 1); + + const ConfigOptionFloats* nozzle_diameter_config = printer_config->option("nozzle_diameter"); + size_t nozzle_id = static_cast(std::max(params.extruder_id, 0)); + double nozzle_diameter = base_temp_tower_nozzle_diameter; + if (nozzle_diameter_config && !nozzle_diameter_config->values.empty()) { + nozzle_id = std::min(nozzle_id, nozzle_diameter_config->values.size() - 1); + nozzle_diameter = nozzle_diameter_config->values[nozzle_id]; + } + if (nozzle_diameter <= 0.0) + nozzle_diameter = base_temp_tower_nozzle_diameter; + const double nozzle_scale = nozzle_diameter / base_temp_tower_nozzle_diameter; + + std::vector obj_idxs; + for (int i = 0; i < n_blocks; ++i) { + const long temp = start_temp - long(i) * base_temp_tower_temp_step; + const size_t count_before = model().objects.size(); + add_model(false, Slic3r::resources_dir() + "/calib/temperature_tower/temperature_tower.drc"); + if (model().objects.size() <= count_before) + break; // model failed to load — don't index into an empty list + // The cut replaces the object at the END of the list, so re-acquire + // the index after every operation. + size_t obj_idx = model().objects.size() - 1; + + // Isolate this temperature's block (full-tower coordinates, the same + // 500-down-to-temp indexing the monolithic flow cuts with). + const double block_bottom = double(lround(double(500 - temp) / base_temp_tower_temp_step)) * base_temp_tower_block_height; + auto obj_bb = model().objects[obj_idx]->bounding_box_exact(); + if (block_bottom + base_temp_tower_block_height < obj_bb.size().z()) { + cut_horizontal(obj_idx, 0, block_bottom + base_temp_tower_block_height - EPSILON, ModelObjectCutAttribute::KeepLower); + obj_idx = model().objects.size() - 1; + } + if (block_bottom > 0) { + cut_horizontal(obj_idx, 0, block_bottom + EPSILON, ModelObjectCutAttribute::KeepUpper); + obj_idx = model().objects.size() - 1; + } + + ModelObject* obj = model().objects[obj_idx]; + if (std::abs(nozzle_scale - 1.0) > EPSILON) + obj->scale(nozzle_scale, nozzle_scale, nozzle_scale); + obj->name = std::string("temp_") + std::to_string(temp); + obj->config.set_key_value("layer_height", new ConfigOptionFloat(nozzle_diameter / 2)); + obj->config.set_key_value("alternate_extra_wall", new ConfigOptionBool(false)); + obj->config.set_key_value("seam_slope_type", new ConfigOptionEnum(SeamScarfType::None)); + obj->config.set_key_value("overhang_reverse", new ConfigOptionBool(false)); + obj->config.set_key_value("precise_z_height", new ConfigOptionBool(false)); + obj->ensure_on_bed(); + obj_idxs.emplace_back(obj_idx); + } + + // Space the blocks along the belt with strictly increasing layer ranges: + // each block must start past the previous block's highest slicing plane, + // which trails its far edge by height / tan(angle). Anchor the row near + // the gantry so the whole test stays in the plate area. + const double cot_a = 1. / std::max(0.1, std::tan(belt_angle_rad)); + double cursor = 20.; + for (size_t idx : obj_idxs) { + ModelObject* obj = model().objects[idx]; + ModelInstance* inst = obj->instances.front(); + const BoundingBoxf3 bb = obj->instance_bounding_box(0); + inst->set_offset(Y, inst->get_offset(Y) + (cursor - bb.min.y())); + obj->invalidate_bounding_box(); + cursor += bb.size().y() + bb.size().z() * cot_a + 5.; + } + + printer_config->set_key_value("resonance_avoidance", new ConfigOptionBool{false}); + filament_config->set_key_value("nozzle_temperature_initial_layer", new ConfigOptionInts(1, (int)start_temp)); + filament_config->set_key_value("nozzle_temperature", new ConfigOptionInts(1, (int)start_temp)); + print_config->set_key_value("enable_wrapping_detection", new ConfigOptionBool(false)); + print_config->set_key_value("initial_layer_print_height", new ConfigOptionFloat(nozzle_diameter / 2)); + print_config->set_key_value("skirt_loops", new ConfigOptionInt(0)); + + changed_objects(obj_idxs); + wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config(); + wxGetApp().get_tab(Preset::TYPE_FILAMENT)->reload_config(); + + p->background_process.fff_print()->set_calib_params(params); +} + void Plater::calib_max_vol_speed(const Calib_Params& params) { const auto calib_vol_speed_name = wxString::Format(L"Max volumetric speed test"); @@ -13256,6 +13545,8 @@ void Plater::calib_max_vol_speed(const Calib_Params& params) cut_horizontal(0, 0, height, ModelObjectCutAttribute::KeepLower); } + _calib_apply_belt_mode(); + auto new_params = params; auto mm3_per_mm = Flow(line_width, layer_height, nozzle_diameter).mm3_per_mm() * filament_config->option("filament_flow_ratio")->get_at(0); new_params.end = params.end / mm3_per_mm; @@ -13320,6 +13611,7 @@ void Plater::calib_retraction(const Calib_Params& params) cut_horizontal(0, 0, height, ModelObjectCutAttribute::KeepLower); } + _calib_apply_belt_mode(); p->background_process.fff_print()->set_calib_params(params); } @@ -13365,6 +13657,7 @@ void Plater::calib_VFA(const Calib_Params& params) cut_horizontal(0, 0, height, ModelObjectCutAttribute::KeepLower); } + _calib_apply_belt_mode(); p->background_process.fff_print()->set_calib_params(params); } @@ -13377,6 +13670,8 @@ void Plater::calib_input_shaping_freq(const Calib_Params& params) return; add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.drc" : "/calib/input_shaping/fast_tower_test.drc")); + if (params.test_model < 1) + belt_calib_flip_ringing_tower(model()); auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config; auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config; auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config; @@ -13428,6 +13723,7 @@ void Plater::calib_input_shaping_freq(const Calib_Params& params) wxGetApp().get_tab(Preset::TYPE_PRINT)->update_ui_from_settings(); wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_ui_from_settings(); + _calib_apply_belt_mode(); p->background_process.fff_print()->set_calib_params(params); } @@ -13440,6 +13736,8 @@ void Plater::calib_input_shaping_damp(const Calib_Params& params) return; add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.drc" : "/calib/input_shaping/fast_tower_test.drc")); + if (params.test_model < 1) + belt_calib_flip_ringing_tower(model()); auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config; auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config; auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config; @@ -13490,6 +13788,7 @@ void Plater::calib_input_shaping_damp(const Calib_Params& params) wxGetApp().get_tab(Preset::TYPE_PRINT)->update_ui_from_settings(); wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_ui_from_settings(); + _calib_apply_belt_mode(); p->background_process.fff_print()->set_calib_params(params); } @@ -13505,6 +13804,8 @@ void Plater::Calib_Cornering(const Calib_Params& params) ? "/calib/input_shaping/ringing_tower.drc" : (params.test_model == 1 ? "/calib/input_shaping/fast_tower_test.drc" : "/calib/cornering/SCV-V2.drc"); add_model(false, Slic3r::resources_dir() + cornering_model_path); + if (params.test_model == 0) + belt_calib_flip_ringing_tower(model()); auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config; auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config; auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config; @@ -13555,6 +13856,7 @@ void Plater::Calib_Cornering(const Calib_Params& params) wxGetApp().get_tab(Preset::TYPE_PRINT)->update_ui_from_settings(); wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_ui_from_settings(); + _calib_apply_belt_mode(); p->background_process.fff_print()->set_calib_params(params); } diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index f2089c1c4f..a718d39464 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -951,6 +951,8 @@ private: void _calib_pa_pattern_gen_gcode(); void _calib_pa_tower(const Calib_Params& params); void _calib_pa_select_added_objects(); + void _calib_apply_belt_mode(); + void _calib_temp_belt_sectioned(const Calib_Params& params, double belt_angle_rad); void cut_horizontal(size_t obj_idx, size_t instance_idx, double z, ModelObjectCutAttributes attributes); diff --git a/src/slic3r/GUI/calib_dlg.cpp b/src/slic3r/GUI/calib_dlg.cpp index 5a06b24427..870b078aa1 100644 --- a/src/slic3r/GUI/calib_dlg.cpp +++ b/src/slic3r/GUI/calib_dlg.cpp @@ -78,6 +78,19 @@ std::vector make_shaper_type_labels() return labels; } +// ORCA-Belt: PA Line / PA Pattern have belt plumbing in place (drawn on the +// belt surface via BeltGCodeWriter world-coordinates mode) but are not +// validated yet — belt printers are restricted to the PA Tower for now. +bool is_belt_printer_selected() +{ + if (auto* preset_bundle = wxGetApp().preset_bundle) { + const auto& cfg = preset_bundle->printers.get_edited_preset().config; + const auto* opt = cfg.option("belt_printer"); + return opt != nullptr && opt->value; + } + return false; +} + } PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater* plater) @@ -288,6 +301,14 @@ void PA_Calibration_Dlg::on_start(wxCommandEvent& event) { m_params.mode = CalibMode::Calib_PA_Tower; } + // ORCA-Belt: backstop in case the selection slipped past the UI guards. + if (is_belt_printer_selected() && m_params.mode != CalibMode::Calib_PA_Tower) { + MessageDialog msg_dlg(nullptr, _L("PA Line and PA Pattern tests are not enabled yet on belt printers.\nPlease use the PA Tower method instead."), + wxEmptyString, wxICON_WARNING | wxOK); + msg_dlg.ShowModal(); + return; + } + m_params.print_numbers = m_cbPrintNum->GetValue(); ParseStringValues(m_tiBMAccels->GetTextCtrl()->GetValue().ToStdString(), m_params.accelerations); ParseStringValues(m_tiBMSpeeds->GetTextCtrl()->GetValue().ToStdString(), m_params.speeds); @@ -314,6 +335,9 @@ void PA_Calibration_Dlg::on_extruder_type_changed(wxCommandEvent& event) { event.Skip(); } void PA_Calibration_Dlg::on_method_changed(wxCommandEvent& event) { + // ORCA-Belt: only the PA Tower method is enabled on belt printers so far. + if (is_belt_printer_selected() && m_rbMethod->GetSelection() != 0) + m_rbMethod->SetSelection(0, true); PA_Calibration_Dlg::reset_params(); event.Skip(); } @@ -324,6 +348,17 @@ void PA_Calibration_Dlg::on_dpi_changed(const wxRect& suggested_rect) { } void PA_Calibration_Dlg::on_show(wxShowEvent& event) { + // ORCA-Belt: the dialog is cached across printer switches, so refresh the + // belt restriction on every show. + if (is_belt_printer_selected()) { + m_rbMethod->SetSelection(0); + const wxString tip = _L("Not enabled yet on belt printers — use the PA Tower method instead."); + m_rbMethod->SetRadioTooltip(1, tip); + m_rbMethod->SetRadioTooltip(2, tip); + } else { + m_rbMethod->SetRadioTooltip(1, wxEmptyString); + m_rbMethod->SetRadioTooltip(2, wxEmptyString); + } PA_Calibration_Dlg::reset_params(); } From 85fd613cf724e3c3da10bf573486fe05fd66e85f Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi <163908227+tommasobbianchi@users.noreply.github.com> Date: Fri, 12 Jun 2026 10:17:23 +0200 Subject: [PATCH 048/389] feat(belt/calib): add Overhang temperature-tower model (selectable) (#48) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Belt printers can't slice a tall vertical temperature tower. This adds a belt-specific temperature-tower model — a row of discrete, individually engraved provini laid along the belt, each printed at one temperature via custom per-layer M104. Each provino is an inverted-L overhang that stresses print quality, so the operator reads the best temperature off overhang quality rather than a continuous ramp. It is offered as a "Test model" choice in the temperature calibration dialog (mirroring the Cornering test's selector), so users keep Joe's counter-rotated sectioned tower as "Standard" and can pick this one as "Overhang": - Calib_Params::test_model (existing field) carries the choice. - Temp_Calibration_Dlg gets a Standard/Overhang radio. - Plater::calib_temp belt branch: test_model 0 -> _calib_temp_belt_sectioned (unchanged Standard path), 1 -> the discrete-provini Overhang path. Assets: belt_temp_provino_unit.stl + belt_temp_tower__.stl (6 ranges) + gen_belt_temp_tower.py (manifold engraving). Based on belt/generic-calibrations. The Overhang path is HW-validated on the IdeaFormer IR3 V2 (discrete M104 + engraved numbers); not re-validated since the rebase. --- .../belt_temp_provino_unit.stl | Bin 0 -> 7684 bytes .../belt_temp_tower_230_190.stl | Bin 0 -> 286084 bytes .../belt_temp_tower_240_210.stl | Bin 0 -> 223584 bytes .../belt_temp_tower_250_230.stl | Bin 0 -> 163784 bytes .../belt_temp_tower_270_230.stl | Bin 0 -> 296684 bytes .../belt_temp_tower_280_240.stl | Bin 0 -> 287684 bytes .../belt_temp_tower_320_280.stl | Bin 0 -> 327884 bytes .../temperature_tower/gen_belt_temp_tower.py | 79 ++++++++++++++ src/slic3r/GUI/Plater.cpp | 96 ++++++++++++++++-- src/slic3r/GUI/calib_dlg.cpp | 10 ++ src/slic3r/GUI/calib_dlg.hpp | 1 + 11 files changed, 179 insertions(+), 7 deletions(-) create mode 100644 resources/calib/temperature_tower/belt_temp_provino_unit.stl create mode 100644 resources/calib/temperature_tower/belt_temp_tower_230_190.stl create mode 100644 resources/calib/temperature_tower/belt_temp_tower_240_210.stl create mode 100644 resources/calib/temperature_tower/belt_temp_tower_250_230.stl create mode 100644 resources/calib/temperature_tower/belt_temp_tower_270_230.stl create mode 100644 resources/calib/temperature_tower/belt_temp_tower_280_240.stl create mode 100644 resources/calib/temperature_tower/belt_temp_tower_320_280.stl create mode 100644 resources/calib/temperature_tower/gen_belt_temp_tower.py diff --git a/resources/calib/temperature_tower/belt_temp_provino_unit.stl b/resources/calib/temperature_tower/belt_temp_provino_unit.stl new file mode 100644 index 0000000000000000000000000000000000000000..556cf313d241412d00faf8f961adfa11519906c0 GIT binary patch literal 7684 zcmb`MZ-`Yz7{=dVHO;jGH6oP8=&t>G1Zrso;eX*P6P*pRYd|l&mne`O}k8e7xl*52Er>VI;<4v~j_C#fhJ!vKV|jP(kruuI2vY ziJlwlTolR0lvIS4$BywI(O0PU_xLLBf%O`T>d=l*rE3E?k#XGv`Wi^0`?d zDDlO$qdn`Zu4nJG{v!a_yZBws5>)W`Bk#-QJ+NLAd^2x3=IkLA!Y{t&#`|(Q<_peF zx9gXG9mXBiTy|Y0W;-gHzj)BbCwBBx`*xJ~z}St&n&g=C9jQP+qEoI7LkA>JE$y3R zJ8P5qi)t>X?TCGJ{=z$`UN&}uO`dsAmG{8dT~C9z-VUx;Du_Eu&%w~jb!y<1yaWT@%%WOtVFJ_!iwO%{F=dig%qkC7Hb|@FP4dh)Q@TZ zwkrzri|A*kt(+J?+b3>JgDLlRh7}IWM4CcV6CGapbMfuLi-HH&g&xMP zwGY_!-8)0?%4d*QWTa5-8XIdKSTB}|woltz+|%_|h>Gt>k0;LFZ|jP?lBhfxryt^| zh`3EeTvIw8Wfe%Fhg(aOsF1>PXfmHR@fjqCMao@Em*_bnBEK*q3J&;;Dx{997=DZe3o2AMJzDJ<(ANX?q_PgGj3=vedG{Pc7!Vaiyfu&jF^_4o3t zQMR@dJ+^6cK3fx+k{+ngJ&nS4j1)_&rMU-Kl3T z=3FjX$Z}DpjAe=l%X&MI>RNI-O7;fl|Gl1bId!2g&8eA^9;~R;4y5>e=A%OcYPL-r zQy6$E*|9K%r#LPTDxK(5@<59B=hc&j*5FAIQ__PKeh{>%v zUVcBwV~$a|-%I0BNx`wBx{`wHm7}Rgh3(+^R%s?Ob*mnz;OA!0Pp8EbRh}}If3MVX zu2-%rMB2)rtrB`)p@P>jKhoL?$CQjp_do@&$KJ#3Sjw){OvzPS_do@|SLQ9;kkj5c zOv$&8?tuz^Kh9ki=kU#0o-&qyuQcXdugo7v%>cA)KyL>sIA3}5{Rz1vN+!dUj7s-F z1?OGw46M#!MpmA3=hu+K=^k9K%u7klEVV3C_do^b!G7*)88TBcD%}GWoX-aj$n?uo z#`5p!yz)YK$(5SxHJ0}!p3`kCar0pQJ z-K6e;3f}Mfc4#|cresvQ2P$~q?me^}JyUXbuX~_^&mX*pb~3?~Jf+Y*P{HRY-a|WK zVM?C1=pLxRQzIfg9mKOYJ{@$=N9jDV|MS78oGuqBo%P+Sg6oy1k+L1=fl={!>GETz xx8O-?dFoa@xL$dl?D9nAL|8o?_E}$g$^QbNg3qr#s-0{zC8N^&3Ke`>{~wWbJ;ne4 literal 0 HcmV?d00001 diff --git a/resources/calib/temperature_tower/belt_temp_tower_230_190.stl b/resources/calib/temperature_tower/belt_temp_tower_230_190.stl new file mode 100644 index 0000000000000000000000000000000000000000..0496fd1522daeb8370694134502bcf14e68f567d GIT binary patch literal 286084 zcmb@Pd7O^b|NjrkR?M=O*6jOj%f9c7od{WC?y=0= zHy`_!ElVY$qAW!T34P!1Ynch*E#2UUqbx<{cHR< z#}^1ki#0H|hTL>~MK!*D`Sw_;^c*6feo_DLa^jHuq1Fsr6KNs-%n=_Z@hMIIf75x@ zlNJl4nck3>P?j3Cl($R@6r~1f0J{)HY($R^y5&^k%?gU$qj!yK>H$XPd zm}Cpm(TSFCj**YB#@a#{a@^HBHx3o ztF*BH;IO*?GviZtt(#C544hnPo~&{baVo9i?m5#`P7)$UY74Z(-x#ng8!xN+N3|0%8Gx@wq@}n>GGHR zC)#2X*o!8;JwQ&pF~yeuHX6+Mb*yaAf2J)+N4J5!Gtwr3SCDA=)vPFeJC;?;t)1oS z1Cwmock>hZLBr{`m^K!E(nS_nG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zD^LHQ$cn~ZVqY=YxwHrH=$A^q<_07qB8d`&*W79TcUs4JC5}p|t!8t*v zKg*4T$yD6tIuD6b`N4Z5qBb5zNLqPS(a^^4n6ExZ?93w`dc0u9m&R5J%7bZT1lmU(I1_4DQ5#} zw~Ev*X(0HEj&p(q_LUxH^w_)6?s)i(eBCQan4e+X1jNn9-;K7;1EJ#8a)i@npedSb?^AfF!>KT%D z?Y8}+4u+ma3ud7ljNp73jq}<^8<~X)oR03!gNMpjZ;w?|&jjm+{LZNyzr%U4HxgYc z(a9uDIvrd(@pOPd$JUh%!-8*s`bQ6fspMPDZSypILH+{j&3O2Y7olnaw-c=I za}MD9qbR;VxUN`2ZdrUsefNE6GWsrJlU-8|b<09Wbk5wDF)kt1S%rt+u%8L;F^19K z+?TNw)C)ZbkxKDkH1vs$_hsw>_2YP$O48~EgpLSL`#z9YIYir{#s}vFPb7uDOH*|v zZ&YvKnr1X&-ru+{(%YBnT=7W7-Y-}}=ozl;jXVZK9X!mP^JTPQ+@7#6QWexq@GzC6 z)fm(f*>9bR9$e#hF5zJW`^#XoVLY-4zu`9LGUaMm-UW3VJWM5NHSTmo`L}ONQ>y{<5bcLr0XQez9O!c zvG-vF&(4g7Gl)g!;yPh8_i02dL~lQYdiu@N+ZmzP n)gxGOreSA!A0BT{RI3d49z=bEX5tb`JqHiJ@s?cmF~j(OMlfR& literal 0 HcmV?d00001 diff --git a/resources/calib/temperature_tower/belt_temp_tower_240_210.stl b/resources/calib/temperature_tower/belt_temp_tower_240_210.stl new file mode 100644 index 0000000000000000000000000000000000000000..31801c17447296d9a50d20dc9367bda74b2dd72d GIT binary patch literal 223584 zcmb@PcX(9A*T)Azs$c`9sVgE7q)A8uXm*)drAtRp5EN+?8==L1EiOdPqb2$OEf-glyT$X}Q?shT-2cqI`{X+@jR;zc4I2uUyLZvy{#&)Ul;T7uk977|WqPmXA!t?EXj= zY&YI=NJl3I_US7}?VVsbq@xpC&J2=&w3}=>q@xqD#eH(sqN$ccIy%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LzRqOA>qDt2Lp88#n(vn1%Zk%tAKa#~Ui)T_ zPia7~m8je1P72y913qsS8VX_-u0bZ)it~hb4fafQ&(=#f^XsOY zoGwQtw9+m9V}h;NA9e@E-0LxvY=cu-4ttklr3x(3)|77VIp18}dzsUcIo-vp@J&?U z&8qo!RX2EFG{d$+mrI?kMw#ZrODKQ%T6Umq4F(Z=snlUBIaca~9HC+K!fb8k;xhAr zMP(*OrR5wmw@QB*Pmo=j zH-H~L!vy=Qejbd&^I!`+5Asu-9IJ7({yf;vnd-iYtM;N?=k%N@$7-xDPe?VblV$uN#$PUag}R}9bzp;aVI zL$g2dZQfzjc_iNcD?ttllHjiG3@|p<)&7_CqV-GjhD~ z_x%9%R#Na-p?~-F3GQ|E5;TH$`ePb;GFG8K64npa)d`M@X}sT_T+v0 zk?BO{Ti^Pwm2;WDRM!WmgjwhM#}ifQ${E#uxc-^OojSTOyckgpL_Rnz)?(!d@lD*7 zg75)YyP%lhbeR^#p~CP|5C=i9l^m=3(20B2Pqf_pbo1>m(@mL;Qay_ts~&)_V5s#H z!Phy{IhddPM! zN0d2x>z6rRE7eEoMAi%C&fsvgJ8NsS%V*?R5v;`vU7S?g9aXo?8RPLG{#0+tG&EA? zMTPL}QQdz~>9Rj=Z+MP+zTEi%5jAw8wU)?{aI3`rvB<|=$VWCPPK$jo4ZXe>?@YWp zBBTC;TMV~1yd#VrXFqzJbDkcDdl{w;qX09IVT=P1E~?36}4l- F_zxDBl4}3} literal 0 HcmV?d00001 diff --git a/resources/calib/temperature_tower/belt_temp_tower_270_230.stl b/resources/calib/temperature_tower/belt_temp_tower_270_230.stl new file mode 100644 index 0000000000000000000000000000000000000000..7a0bfbd1da917567c95556c81c668f837e0ef3f7 GIT binary patch literal 296684 zcmb@P3B1k4|NlqHR#KuubIoU7^Kp*H_y2hO@8dBZ<9y!FdC&Hlna?cm5#s;vUxi0F zyg(#YsDV+nW)F(tV9qw=sy>!3D4nuWxIX~*Sdko3wI)uCp$b<=59hs<$J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ub2;mXrvHN_3avx}zmey}{fxx%jJ-SPH~<|I7!lNw zKpSS&;okQy+&UF@T|{h!|2(j zNP>rj<6W$dRyAb{Whu$iE}Y=|t&*JiX|?f5Z))+* zW+McSms2HZbw|LZ5iG^}a0e(Xsr7$+)*W0x>8g})N#hH0>aJLCw05~;gyRwmZLLW- zIcLv{+uIcy_eXVYX&pQNi#q{{1ciR-)T^J0v`Z$97g(=oaX-)sDZCC_S&tADF?a7TK{u<5_h9yWdY2IMam`QA}I7$@)NPjZ)J zG_*z{a6aT&)q#F*#v<7I8ntX_^$#FeN-PsAL3J~i=SU>*k z+R)m9AQlK!&wTTR{H{_6FN;qmnnNIc6oGXF5h|t&_L2#Z?ioM`TBU^1;AgP+XA6UJ z8GLhcS+PE@P4E=$+wZT)s7wT*)>=B^(-lX|-DoA}5crKeD=uffmAs#^JvuWf)q5X- z5zIEtXv28h+8%ue(ys>)oGM1cS-ti4=r%~-i@;LytX6tDV$A&g2~R+gQmsL3i>iNc zOos7FiG69RbQ!_*&uG}&i)_z*s(7krAaGpFfi1tQ6yhG-^WWy)3+aXd1joy0?0+O} z&%GMbw<55VJgfT95jVg6q;=odoy{T$Vs%n8i#)3tfP1iEFoOFzqjki_%|#No4>3ae zwwkXP4GxHQ6(e$&kj!coBU@;9L}sDc2%Uf2+l^IB76QLvgjP>R86b{8It_u}1QDt>4ded+bVywT literal 0 HcmV?d00001 diff --git a/resources/calib/temperature_tower/gen_belt_temp_tower.py b/resources/calib/temperature_tower/gen_belt_temp_tower.py new file mode 100644 index 0000000000..9182647acb --- /dev/null +++ b/resources/calib/temperature_tower/gen_belt_temp_tower.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +"""Belt temperature-tower asset generator (discrete-provini design). + +A vertical temperature tower cannot be sliced on a belt printer, so lay a row of +DISCRETE provini (one per temperature) along the belt (designed Y) with a fixed +surface gap. Each provino is the chevron+arc unit (belt_temp_provino_unit.stl, +keel-first); its temperature is ENGRAVED upright into the 50 mm face — a raised +number would be an unsupported overhang on the belt. The C++ calib_temp belt branch +(Plater.cpp) injects one M104 per zone 70 layers INTO provino i: + print_z[i] = i * PITCH * cos(theta) + 70 * layer_height (theta = 45) +inside the body, not in the empty inter-provino gap (which has no sliced layers for +the event to attach to). PITCH below is the shared geometry contract with that code — +keep them in sync. + +Generates one STL per filament temp range used by Temp_Calibration_Dlg. +""" +import numpy as np, trimesh, os +from matplotlib.textpath import TextPath +from matplotlib.font_manager import FontProperties +from shapely.geometry import Polygon as ShPoly +from shapely.ops import unary_union + +HERE = os.path.dirname(os.path.abspath(__file__)) +UNIT = os.path.join(HERE, 'belt_temp_provino_unit.stl') # single provino, keel-first +SURF_GAP = 25.0 # surface-to-surface gap between provini (mm) — user spec +TEXT_H = 9.0 +TEXT_DEPTH = 0.8 # engraving depth (numbers are CUT into the face, not raised: + # a raised number is an unsupported Y-overhang on the belt) +TEXT_OVERSHOOT = 0.6 # extra height poking out of the face for a clean boolean cut + +# Temperature ranges (start, end) per filament family, 5 C step. File name encodes them. +RANGES = [(230,190),(270,230),(250,230),(280,240),(240,210),(320,280)] + +unit = trimesh.load(UNIT) +dY = unit.bounds[1,1] - unit.bounds[0,1] +PITCH = dY + SURF_GAP # designed-Y pitch == C++ contract constant +print(f"unit dY={dY:.2f} PITCH={PITCH:.3f} (C++ contract: print_z[i]=i*{PITCH:.3f}*cos45)") + +# 50 mm face normal (0,-1,1)/sqrt2 ; UPRIGHT basis u=+X det(+1) (verified non-mirrored) +n = np.array([0,-1,1.])/np.sqrt(2) +u = np.array([1,0,0.]); v = np.array([0,1,1.])/np.sqrt(2) +R = np.column_stack([u,v,n]) +fn = unit.face_normals; fc = unit.triangles_center; fa = unit.area_faces +sel = (fn@n) > 0.9 +face_c = (fc[sel]*fa[sel,None]).sum(0)/fa[sel].sum() + +def text_mesh(s): + tp = TextPath((0,0), s, size=TEXT_H, prop=FontProperties(family='DejaVu Sans')) + rings = [ShPoly(p) for p in tp.to_polygons() if len(p)>=3] + rings.sort(key=lambda r:r.area, reverse=True) + used=[False]*len(rings); parts=[] + for i,o in enumerate(rings): + if used[i]: continue + holes=[] + for j in range(i+1,len(rings)): + if not used[j] and o.contains(rings[j]): holes.append(rings[j].exterior.coords); used[j]=True + parts.append(ShPoly(o.exterior.coords,holes)); used[i]=True + poly = unary_union(parts) + geoms = list(poly.geoms) if poly.geom_type=='MultiPolygon' else [poly] + m = trimesh.util.concatenate([trimesh.creation.extrude_polygon(g,height=TEXT_DEPTH+TEXT_OVERSHOOT) for g in geoms]) + c = m.bounds.mean(axis=0); m.apply_translation([-c[0],-c[1],0]); return m + +for t_start, t_end in RANGES: + temps = list(range(t_start, t_end-1, -5)) + parts=[] + for i,T in enumerate(temps): + c = unit.copy(); c.apply_translation([0, i*PITCH, 0]) + t = text_mesh(str(T)); M=np.eye(4); M[:3,:3]=R; t.apply_transform(M) + # place the text spanning from TEXT_DEPTH inside the face to TEXT_OVERSHOOT outside, + # then CUT it out of the provino (engrave) — no raised material, no Y-overhang. + t.apply_translation(face_c - n*TEXT_DEPTH + np.array([0,i*PITCH,0])) + c = trimesh.boolean.difference([c, t], engine='manifold') + parts.append(c) + asset = trimesh.util.concatenate(parts) + out = os.path.join(HERE, f"belt_temp_tower_{t_start}_{t_end}.stl") + asset.export(out) + dims = np.round(asset.bounds[1]-asset.bounds[0],1) + wt = all(p.is_watertight for p in parts) + print(f" {t_start}->{t_end}: {len(temps)} zones bbox={dims} watertight={wt} -> {os.path.basename(out)}") diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6bc6a30f0f..58d0ccb237 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -13297,14 +13297,96 @@ void Plater::calib_temp(const Calib_Params& params) { if (params.mode != CalibMode::Calib_Temp_Tower) return; - // ORCA-Belt: a counter-rotated tower would cantilever every block off a - // support wedge — print the temperature blocks as separate objects in - // native belt orientation instead. + // Belt printers build along the conveyor, not vertically — a tall tower cannot + // be sliced. Instead lay a row of DISCRETE provini (one per temperature) along + // the belt and change temperature in discrete steps via custom per-layer G-code + // (M104), injected in the empty gap just before each provino so the nozzle is + // settled by the time that provino prints. We deliberately do NOT call + // set_calib_params here: its per-layer interpolation (interpolate_value_across_ + // layers) would overwrite these discrete M104 events. { - double belt_angle_rad = 0.; - Vec3d belt_axis = Vec3d::UnitX(); - if (belt_calib_rotation_params(belt_angle_rad, belt_axis)) { - _calib_temp_belt_sectioned(params, std::abs(belt_angle_rad)); + auto belt_printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config; + if (belt_printer_config->has("belt_printer") && belt_printer_config->opt_bool("belt_printer")) { + // Belt temperature-tower model selector (Calib_Params::test_model): + // 0 = "Standard" -> Joe's counter-rotated sectioned tower. + // 1 = "Overhang" -> engraved inverted-L provini that stress overhang + // print-quality at each discrete temperature (below). + if (params.test_model < 1) { + double belt_angle_rad = 0.; Vec3d belt_axis = Vec3d::UnitX(); + belt_calib_rotation_params(belt_angle_rad, belt_axis); + _calib_temp_belt_sectioned(params, std::abs(belt_angle_rad)); + return; + } + constexpr int TEMP_STEP = 5; // matches Temp_Calibration_Dlg + // Shared geometry contract with the offline asset generator + // (resources/calib/temperature_tower/gen_belt_temp_tower.py): provini are + // replicated along the belt (designed Y) at this pitch. The slicing plane + // is oblique (belt_slice_rotation_angle), so the per-zone advance in the + // layer print_z space the custom-gcode matcher uses is PITCH*cos(theta). + constexpr double PITCH_Y = 74.718; // designed-Y pitch == gen PITCH + const double angle = belt_printer_config->has("belt_slice_rotation_angle") + ? belt_printer_config->opt_float("belt_slice_rotation_angle") : 45.0; + const double zone_topz = PITCH_Y * std::cos(angle * M_PI / 180.0); + // The custom-gcode matcher attaches each event to a real sliced layer. The + // empty inter-provino gap has NO layers, so an event placed there is silently + // dropped. Fire it 70 layers ABOVE provino i's start instead — inside the + // provino body, past the gap and the overlap with provino i-1's tail, so the + // temperature change attaches and applies cleanly. (layer print_z steps by the + // process layer height.) + auto belt_print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config; + const double layer_h = belt_print_config->has("layer_height") + ? belt_print_config->opt_float("layer_height") : 0.2; + const double into_provino = 70.0 * layer_h; + + const int t_start = (int) lround(params.start); + const int t_end = (int) lround(params.end); + std::vector temps; + const int tstep = (t_start >= t_end) ? -TEMP_STEP : TEMP_STEP; + for (int t = t_start; (tstep < 0) ? (t >= t_end) : (t <= t_end); t += tstep) + temps.push_back(t); + if (temps.empty()) temps.push_back(t_start); + + const std::string calib_dir = Slic3r::resources_dir() + "/calib/temperature_tower/"; + std::string asset = calib_dir + "belt_temp_tower_" + std::to_string(t_start) + "_" + std::to_string(t_end) + ".stl"; + if (!boost::filesystem::exists(asset)) { + BOOST_LOG_TRIVIAL(warning) << "[belt_temp] no embossed provini for " << t_start << "->" << t_end + << ", falling back to 230_190 (embossed numbers will not match)"; + asset = calib_dir + "belt_temp_tower_230_190.stl"; + } + add_model(false, asset); + + // Place keel-first asset at the belt entry (designed Y = 0) so Z_gcode + // starts at 0, centered laterally on the bed, resting on the conveyor. + ModelObject* obj = model().objects[0]; + obj->ensure_on_bed(); + BoundingBoxf3 obb = obj->bounding_box_exact(); + auto bed_shape = belt_printer_config->option("printable_area")->values; + BoundingBoxf bed_ext = get_extents(bed_shape); + obj->translate_instances(Vec3d(bed_ext.center().x() - obb.center().x(), -obb.min.y(), 0.0)); + + auto belt_filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config; + belt_filament_config->set_key_value("nozzle_temperature_initial_layer", new ConfigOptionInts(1, temps.front())); + belt_filament_config->set_key_value("nozzle_temperature", new ConfigOptionInts(1, temps.front())); + obj->config.set_key_value("brim_type", new ConfigOptionEnum(btNoBrim)); + obj->config.set_key_value("seam_slope_type", new ConfigOptionEnum(SeamScarfType::None)); + obj->config.set_key_value("overhang_reverse", new ConfigOptionBool(false)); + belt_printer_config->set_key_value("resonance_avoidance", new ConfigOptionBool{false}); + + const int plate_idx = get_partplate_list().get_curr_plate_index(); + model().curr_plate_index = plate_idx; + CustomGCode::Info &cg_info = model().plates_custom_gcodes[plate_idx]; + cg_info.mode = CustomGCode::Mode::SingleExtruder; + cg_info.gcodes.clear(); + for (size_t i = 1; i < temps.size(); ++i) { + const double pz = double(i) * zone_topz + into_provino; // 70 layers into provino i + cg_info.gcodes.push_back(CustomGCode::Item{ + pz, CustomGCode::Custom, 1, "", + "M104 S" + std::to_string(temps[i]) + " ; belt temp zone " + std::to_string(temps[i]) }); + } + + changed_objects({ 0 }); + wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_FILAMENT)->reload_config(); return; } } diff --git a/src/slic3r/GUI/calib_dlg.cpp b/src/slic3r/GUI/calib_dlg.cpp index 870b078aa1..0b2cc64f6a 100644 --- a/src/slic3r/GUI/calib_dlg.cpp +++ b/src/slic3r/GUI/calib_dlg.cpp @@ -395,6 +395,15 @@ Temp_Calibration_Dlg::Temp_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plat method_box->Add(m_rbFilamentType, 0, wxALL | wxEXPAND, FromDIP(4)); v_sizer->Add(method_box, 0, wxTOP | wxRIGHT | wxLEFT | wxEXPAND, FromDIP(10)); + // Belt temperature-tower model: Standard (sectioned tower) vs Overhang (engraved + // inverted-L provini that stress overhang quality per temperature). Only affects + // belt printers; the upright tower ignores it. + auto labeled_box_model = new LabeledStaticBox(this, _L("Test model")); + auto model_box = new wxStaticBoxSizer(labeled_box_model, wxHORIZONTAL); + m_rbModel = new RadioGroup(this, { _L("Standard"), _L("Overhang") }, wxVERTICAL); + model_box->Add(m_rbModel, 0, wxALL | wxEXPAND, FromDIP(4)); + v_sizer->Add(model_box, 0, wxTOP | wxRIGHT | wxLEFT | wxEXPAND, FromDIP(10)); + // Settings wxString start_temp_str = _L("Start temp: "); wxString end_temp_str = _L("End temp: "); @@ -511,6 +520,7 @@ void Temp_Calibration_Dlg::on_start(wxCommandEvent& event) { m_params.start = start; m_params.end = end; m_params.mode = CalibMode::Calib_Temp_Tower; + m_params.test_model = m_rbModel->GetSelection(); m_plater->calib_temp(m_params); EndModal(wxID_OK); diff --git a/src/slic3r/GUI/calib_dlg.hpp b/src/slic3r/GUI/calib_dlg.hpp index 5ff0fbf3e3..c7a12471bf 100644 --- a/src/slic3r/GUI/calib_dlg.hpp +++ b/src/slic3r/GUI/calib_dlg.hpp @@ -62,6 +62,7 @@ protected: Calib_Params m_params; RadioGroup* m_rbFilamentType; + RadioGroup* m_rbModel; TextInput* m_tiStart; TextInput* m_tiEnd; TextInput* m_tiStep; From 0bca3fd2e56189cdc75c7f8924f653cae5019f86 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 12 Jun 2026 04:41:29 -0500 Subject: [PATCH 049/389] make belt printer specific temp tower only accessible to belt printers --- src/slic3r/GUI/calib_dlg.cpp | 32 +++++++++++++++++++++++++++----- src/slic3r/GUI/calib_dlg.hpp | 4 +++- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/calib_dlg.cpp b/src/slic3r/GUI/calib_dlg.cpp index 0b2cc64f6a..89bb4de3aa 100644 --- a/src/slic3r/GUI/calib_dlg.cpp +++ b/src/slic3r/GUI/calib_dlg.cpp @@ -397,12 +397,14 @@ Temp_Calibration_Dlg::Temp_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plat // Belt temperature-tower model: Standard (sectioned tower) vs Overhang (engraved // inverted-L provini that stress overhang quality per temperature). Only affects - // belt printers; the upright tower ignores it. + // belt printers; the upright tower ignores it, so the picker is only shown on + // belts. The dialog is cached across printer switches, so visibility is toggled + // per-show in on_show() rather than gated here at construction time. auto labeled_box_model = new LabeledStaticBox(this, _L("Test model")); - auto model_box = new wxStaticBoxSizer(labeled_box_model, wxHORIZONTAL); + m_model_box = new wxStaticBoxSizer(labeled_box_model, wxHORIZONTAL); m_rbModel = new RadioGroup(this, { _L("Standard"), _L("Overhang") }, wxVERTICAL); - model_box->Add(m_rbModel, 0, wxALL | wxEXPAND, FromDIP(4)); - v_sizer->Add(model_box, 0, wxTOP | wxRIGHT | wxLEFT | wxEXPAND, FromDIP(10)); + m_model_box->Add(m_rbModel, 0, wxALL | wxEXPAND, FromDIP(4)); + v_sizer->Add(m_model_box, 0, wxTOP | wxRIGHT | wxLEFT | wxEXPAND, FromDIP(10)); // Settings wxString start_temp_str = _L("Start temp: "); @@ -464,6 +466,11 @@ Temp_Calibration_Dlg::Temp_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plat m_rbFilamentType->Connect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(Temp_Calibration_Dlg::on_filament_type_changed), NULL, this); + // Refresh the belt-only model picker on every show — the dialog is cached and + // reused across printer switches. + this->Connect(wxEVT_SHOW, wxShowEventHandler(Temp_Calibration_Dlg::on_show)); + m_model_box->ShowItems(is_belt_printer_selected()); + wxGetApp().UpdateDlgDarkUI(this); Layout(); @@ -520,12 +527,27 @@ void Temp_Calibration_Dlg::on_start(wxCommandEvent& event) { m_params.start = start; m_params.end = end; m_params.mode = CalibMode::Calib_Temp_Tower; - m_params.test_model = m_rbModel->GetSelection(); + // Picker only exists on belt printers; default non-belt to the Standard model. + m_params.test_model = m_rbModel ? m_rbModel->GetSelection() : 0; m_plater->calib_temp(m_params); EndModal(wxID_OK); } +void Temp_Calibration_Dlg::on_show(wxShowEvent& event) { + // ORCA-Belt: the dialog is cached across printer switches, so refresh the + // belt-only "Test model" picker on every show. The Overhang model only + // applies to belt printers; hide it (and resize the dialog) otherwise. + const bool belt = is_belt_printer_selected(); + if (m_model_box->AreAnyItemsShown() != belt) { + m_model_box->ShowItems(belt); + Layout(); + Fit(); + GetSizer()->SetSizeHints(this); + } + event.Skip(); +} + void Temp_Calibration_Dlg::on_filament_type_changed(wxCommandEvent& event) { int selection = event.GetSelection(); unsigned long start = 0, end = 0; diff --git a/src/slic3r/GUI/calib_dlg.hpp b/src/slic3r/GUI/calib_dlg.hpp index c7a12471bf..2ddf056dc6 100644 --- a/src/slic3r/GUI/calib_dlg.hpp +++ b/src/slic3r/GUI/calib_dlg.hpp @@ -59,10 +59,12 @@ protected: virtual void on_start(wxCommandEvent& event); virtual void on_filament_type_changed(wxCommandEvent& event); + void on_show(wxShowEvent& event); Calib_Params m_params; RadioGroup* m_rbFilamentType; - RadioGroup* m_rbModel; + RadioGroup* m_rbModel = nullptr; + wxStaticBoxSizer* m_model_box = nullptr; TextInput* m_tiStart; TextInput* m_tiEnd; TextInput* m_tiStep; From ef6f65eacc728eeebfa91fc528b43221177a2e9b Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Thu, 18 Jun 2026 07:13:59 +0200 Subject: [PATCH 050/389] IdeaFormer IR3 V2: tune eSUN PLA white speed from HW max-vol-speed calibration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Physical max-volumetric-speed test (belt #62 v4 asset) on the IR3 V2 with eSUN PLA white: the wall stayed clean up to ~100 mm/s = ~20 mm3/s before under-extrusion. The shipped cap of 10 mm3/s was ~half the real ceiling and was silently throttling infill. - eSUN PLA @IdeaFormer IR3 V2: filament_max_volumetric_speed 10 -> 20 - 0.20mm Standard @IdeaFormer IR3 V2: sparse_infill_speed 200 (~18 mm3/s at the new cap, no longer throttled). Outer wall (45), PA (0.12), accel (1000) unchanged — accuracy preserved. - IdeaFormer.json version bump for profile-cache refresh. Co-Authored-By: Claude Opus 4.8 --- resources/profiles/IdeaFormer.json | 2 +- .../IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json | 2 +- .../IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/profiles/IdeaFormer.json b/resources/profiles/IdeaFormer.json index 7e3e108c3d..a021e7c164 100644 --- a/resources/profiles/IdeaFormer.json +++ b/resources/profiles/IdeaFormer.json @@ -1,6 +1,6 @@ { "name": "IdeaFormer", - "version": "02.00.00.00", + "version": "02.00.00.02", "force_update": "0", "description": "IdeaFormer belt printer configurations", "machine_model_list": [ diff --git a/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json index c438aac0fd..d34131842a 100644 --- a/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json @@ -29,6 +29,6 @@ "0.12" ], "filament_max_volumetric_speed": [ - "10" + "20" ] } diff --git a/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json index f8e8a69e0f..b06b2e2192 100644 --- a/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json @@ -13,6 +13,7 @@ "skirt_loops": "0", "skirt_distance": "0", "sparse_infill_pattern": "grid", + "sparse_infill_speed": "200", "support_base_pattern": "rectilinear", "support_interface_pattern": "rectilinear", "compatible_printers": [ From 2d69f6e17c56c7506520be03b0f1ea595ddd98a8 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sat, 6 Jun 2026 16:00:37 +0200 Subject: [PATCH 051/389] belt: expose MachineFrameTransform's composed matrix Add a const accessor for the shear*scale transform so the G-code viewer can build the machine->model back-transform for the upright belt preview. --- src/libslic3r/GCode/MachineFrameTransform.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libslic3r/GCode/MachineFrameTransform.hpp b/src/libslic3r/GCode/MachineFrameTransform.hpp index 425fe3004b..f5e71398da 100644 --- a/src/libslic3r/GCode/MachineFrameTransform.hpp +++ b/src/libslic3r/GCode/MachineFrameTransform.hpp @@ -33,6 +33,11 @@ public: bool is_active() const { return m_active; } + // The composed shear*scale transform (identity when inactive). Exposed so the + // G-code viewer can build the machine->model back-transform for the upright + // ("designed") belt preview. + const Transform3d& transform() const { return m_transform; } + private: bool m_active = false; Transform3d m_transform = Transform3d::Identity(); From 695a1f897a828d6e24b44559662fd79b7cb49567 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sat, 6 Jun 2026 16:00:37 +0200 Subject: [PATCH 052/389] belt: render the G-code preview in model (Cartesian) space On a belt printer the emitted G-code is in the machine frame (45-deg sheared, axis-remapped, scaled), so the toolpath preview shows the print as a sheared slab floating off the bed. Map each toolpath vertex back to model/Cartesian space for the "designed" view. The back-transform is the inverse of the full G-code forward pipeline (BeltGCodeWriter::to_machine_coords): model = [BeltForward^-1 if !gcode_back_transform] . AxisRemap^-1 . MachineFrame^-1 built from config, so it handles any rotation / shear / scale / axis-remap combination, not just plain 45-deg belt slicing. Computed in load_as_gcode() from print.config() and applied per-vertex inside libvgcode::convert (display position only; layer_id, times and the volumetric/flow math keep the raw machine values, so the layer slider and stats are unaffected). - Toggle with the existing "Show designed view" checkbox / hotkey B; off shows the raw machine-frame G-code (useful for debugging the transform itself). Defaults to on. - Belt printers skip the same-result-id load cache so the upright view applies and the toggle takes effect even when the G-code is unchanged. - The object extrusions (layer_id >= 1) are anchored to the belt entry to drop the constant machine-origin offset (start-G-code belt advance) that the linear back-transform alone does not capture; start-G-code prime lines are excluded so they don't steal the anchor. --- src/slic3r/GUI/GCodeViewer.cpp | 81 ++++++++++++++++--- src/slic3r/GUI/GCodeViewer.hpp | 3 +- src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp | 42 ++++++++-- src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.hpp | 3 +- 4 files changed, 112 insertions(+), 17 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 1f9741e92b..963730e093 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -24,6 +24,8 @@ #include "GLToolbar.hpp" #include "GUI_Preview.hpp" #include "libslic3r/Print.hpp" +#include "libslic3r/BeltTransform.hpp" +#include "libslic3r/GCode/MachineFrameTransform.hpp" #include "libslic3r/Layer.hpp" #include "Widgets/ProgressDialog.hpp" #include "MsgDialog.hpp" @@ -1118,6 +1120,51 @@ std::vector GCodeViewer::get_plater_extruder() return m_plater_extruder; } +// Belt printers: compute the full machine->model back-transform from the print +// config, so the "designed" (upright) G-code preview maps each toolpath vertex +// back to Cartesian space. The G-code forward pipeline is (BeltGCodeWriter:: +// to_machine_coords): gcode = MachineFrame( AxisRemap( X ) ), with X = model if +// gcode_back_transform (write already un-rotated to Cartesian) else BeltForward( +// model). So the inverse is: +// model = [BeltForward^-1 if !gcode_back_transform] . AxisRemap^-1 . MachineFrame^-1 +// All parts are config-driven affines -> handles any rotation/shear/scale/axis- +// remap combination. (origin-snap is a per-instance translation that only shifts +// position, not orientation, so it is intentionally omitted.) +static Transform3d compute_belt_back_transform(const PrintConfig& cfg) +{ + if (!cfg.belt_printer.value) + return Transform3d::Identity(); + + MachineFrameTransform mft; + mft.init_from_config(cfg); + const Transform3d mf_inv = mft.is_active() ? Transform3d(mft.transform().inverse()) + : Transform3d::Identity(); + + Transform3d ar = Transform3d::Identity(); + const int rr[3] = { int(cfg.gcode_remap_x.value), int(cfg.gcode_remap_y.value), int(cfg.gcode_remap_z.value) }; + if (rr[0] != 0 || rr[1] != 1 || rr[2] != 2) { + BoundingBoxf bbox_bed(cfg.printable_area.values); + const Vec3d vmax(bbox_bed.max.x(), bbox_bed.max.y(), cfg.printable_height.value); + Matrix3d M = Matrix3d::Zero(); + Vec3d t = Vec3d::Zero(); + for (int i = 0; i < 3; ++i) { + const int axis = rr[i] % 3; + if (rr[i] < 3) M(i, axis) = 1.0; + else if (rr[i] < 6) M(i, axis) = -1.0; + else { M(i, axis) = -1.0; t[i] = vmax[axis]; } + } + ar.linear() = M; + ar.translation() = t; + } + const Transform3d ar_inv = ar.inverse(); + + Transform3d bf_inv = Transform3d::Identity(); + if (!cfg.gcode_back_transform.value) + bf_inv = BeltTransformPipeline::build_forward_transform(cfg).inverse(); + + return bf_inv * ar_inv * mf_inv; +} + //BBS: always load shell at preview void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const Print& print, const std::vector& str_tool_colors, const std::vector& str_color_print_colors, const BuildVolume& build_volume, @@ -1130,8 +1177,12 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const if (current_top_layer_only != required_top_layer_only) m_viewer.toggle_top_layer_only_view_range(); - // avoid processing if called with the same gcode_result - if (m_last_result_id == gcode_result.id && wxGetApp().is_editor()) { + // avoid processing if called with the same gcode_result. + // Belt printers are exempt: the toolpath geometry fed to libvgcode depends on + // the current designed/raw view state (back-transform applied in convert), so + // re-running the conversion is required for the upright view and for toggling + // it (hotkey B) to take effect even when the G-code itself is unchanged. + if (m_last_result_id == gcode_result.id && wxGetApp().is_editor() && !print.config().belt_printer.value) { //BBS: add logs BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": the same id %1%, return directly, result %2% ") % m_last_result_id % (&gcode_result); @@ -1172,8 +1223,18 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const return; } - // convert data from PrusaSlicer format to libvgcode format - libvgcode::GCodeInputData data = libvgcode::convert(gcode_result, str_tool_colors, str_color_print_colors, m_viewer); + // convert data from PrusaSlicer format to libvgcode format. + // Belt printers: when the "designed (upright) view" is active, back-transform + // the toolpath geometry into model/Cartesian space using the general belt + // inverse (handles any mesh rotation + shear + axis remap). When off, the raw + // machine-frame G-code is shown (useful for debugging the transform itself). + const bool is_belt = print.config().belt_printer.value; + const Transform3d belt_inv = (is_belt && m_belt_show_designed) + ? compute_belt_back_transform(print.config()) : Transform3d::Identity(); + const bool apply_belt = is_belt && m_belt_show_designed + && !belt_inv.matrix().isApprox(Transform3d::Identity().matrix()); + libvgcode::GCodeInputData data = libvgcode::convert(gcode_result, str_tool_colors, str_color_print_colors, m_viewer, + apply_belt ? &belt_inv : nullptr); //#define ENABLE_DATA_EXPORT 1 //#if ENABLE_DATA_EXPORT @@ -2303,12 +2364,12 @@ void GCodeViewer::render_toolpaths() { const Camera& camera = wxGetApp().plater()->get_camera(); Matrix4f view = camera.get_view_matrix().matrix().cast(); - // Belt "designed" view: apply the precomputed inverse of the full belt - // shear+scale transform so toolpaths appear upright (as originally designed) - // instead of transformed on the belt. - if (m_belt_show_designed && m_belt_view_enabled) { - view = (camera.get_view_matrix() * m_belt_inverse_transform).matrix().cast(); - } + // Belt "designed" (upright) view is now produced by back-transforming the + // toolpath GEOMETRY into model space at load time (see load_as_gcode -> + // libvgcode::convert with m_belt_inverse_transform). The camera is therefore + // left untouched here; transforming the view as well would double-apply the + // inverse. Keeping m_belt_inverse_transform on the geometry (not the camera) + // also keeps the bed and toolpaths in the same frame so they stay aligned. const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(view); const libvgcode::Mat4x4 converted_projetion_matrix = libvgcode::convert(static_cast(camera.get_projection_matrix().matrix().cast())); #if VGCODE_ENABLE_COG_AND_TOOL_MARKERS diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index ca79a82584..d5173b02e5 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -245,7 +245,8 @@ mutable bool m_no_render_path { false }; bool m_belt_view_enabled = false; float m_belt_angle_deg = 0.f; - bool m_belt_show_designed = false; // Toggle: show designed (upright) view via inverse shear + bool m_belt_show_designed = true; // Toggle: designed (upright, back-transformed) view by default; + // turn off (hotkey B) to inspect the raw machine-frame G-code. Transform3d m_belt_inverse_transform{Transform3d::Identity()}; libvgcode::Viewer m_viewer; diff --git a/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp b/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp index 5b5c7da076..ffc549755b 100644 --- a/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp +++ b/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp @@ -189,10 +189,22 @@ Slic3r::PrintEstimatedStatistics::ETimeMode convert(const ETimeMode& mode) } GCodeInputData convert(const Slic3r::GCodeProcessorResult& result, const std::vector& str_tool_colors, - const std::vector& str_color_print_colors, const Viewer& viewer) + const std::vector& str_color_print_colors, const Viewer& viewer, + const Slic3r::Transform3d* belt_xform) { GCodeInputData ret; + // Belt printers: optionally map each vertex DISPLAY position from machine + // (G-code) space back to model/Cartesian space using the general belt + // back-transform (handles any mesh rotation + shear + axis remap, not just + // 45 deg). Only the rendered position is transformed; layer_id, times and + // the volumetric/flow math below keep the original machine-space values. + auto xform_pos = [belt_xform](const Slic3r::Vec3f& v) -> Vec3 { + if (belt_xform != nullptr) + return convert(Slic3r::Vec3f((*belt_xform * v.cast()).cast())); + return convert(v); + }; + // collect tool colors ret.tools_colors.reserve(str_tool_colors.size()); for (const std::string& color : str_tool_colors) { @@ -221,7 +233,7 @@ GCodeInputData convert(const Slic3r::GCodeProcessorResult& result, const std::ve // equal to the current one with the exception of the position, which should match the previous move position, // and the times, which are set to zero #if VGCODE_ENABLE_COG_AND_TOOL_MARKERS - const libvgcode::PathVertex vertex = { convert(prev.position), curr.height, curr.width, curr.feedrate, prev.actual_feedrate, + const libvgcode::PathVertex vertex = { xform_pos(prev.position), curr.height, curr.width, curr.feedrate, prev.actual_feedrate, curr.mm3_per_mm, curr.fan_speed, curr.temperature, 0.0f, convert(curr.extrusion_role), curr_type, static_cast(curr.gcode_id), static_cast(curr.layer_id), static_cast(curr.extruder_id), static_cast(curr.cp_color_id), { 0.0f, 0.0f }, @@ -229,7 +241,7 @@ GCodeInputData convert(const Slic3r::GCodeProcessorResult& result, const std::ve /* ORCA: Add Acceleration visualization support */ curr.acceleration, /* ORCA: Add Jerk visualization support */ curr.jerk }; #else - const libvgcode::PathVertex vertex = { convert(prev.position), curr.height, curr.width, curr.feedrate, prev.actual_feedrate, + const libvgcode::PathVertex vertex = { xform_pos(prev.position), curr.height, curr.width, curr.feedrate, prev.actual_feedrate, curr.mm3_per_mm, curr.fan_speed, curr.temperature, convert(curr.extrusion_role), curr_type, static_cast(curr.gcode_id), static_cast(curr.layer_id), static_cast(curr.extruder_id), static_cast(curr.cp_color_id), { 0.0f, 0.0f }, @@ -242,7 +254,7 @@ GCodeInputData convert(const Slic3r::GCodeProcessorResult& result, const std::ve } #if VGCODE_ENABLE_COG_AND_TOOL_MARKERS - const libvgcode::PathVertex vertex = { convert(curr.position), curr.height, curr.width, curr.feedrate, curr.actual_feedrate, + const libvgcode::PathVertex vertex = { xform_pos(curr.position), curr.height, curr.width, curr.feedrate, curr.actual_feedrate, curr.mm3_per_mm, curr.fan_speed, curr.temperature, result.filament_densities[curr.extruder_id] * curr.mm3_per_mm * (curr.position - prev.position).norm(), convert(curr.extrusion_role), curr_type, static_cast(curr.gcode_id), static_cast(curr.layer_id), @@ -251,7 +263,7 @@ GCodeInputData convert(const Slic3r::GCodeProcessorResult& result, const std::ve /* ORCA: Add Acceleration visualization support */ curr.acceleration, /* ORCA: Add Jerk visualization support */ curr.jerk }; #else - const libvgcode::PathVertex vertex = { convert(curr.position), curr.height, curr.width, curr.feedrate, curr.actual_feedrate, + const libvgcode::PathVertex vertex = { xform_pos(curr.position), curr.height, curr.width, curr.feedrate, curr.actual_feedrate, curr.mm3_per_mm, curr.fan_speed, curr.temperature, convert(curr.extrusion_role), curr_type, static_cast(curr.gcode_id), static_cast(curr.layer_id), static_cast(curr.extruder_id), static_cast(curr.cp_color_id), curr.time, @@ -263,6 +275,26 @@ GCodeInputData convert(const Slic3r::GCodeProcessorResult& result, const std::ve } ret.vertices.shrink_to_fit(); + // Belt designed view: the linear back-transform recovers the correct shape + // and orientation, but not the constant machine-frame origin offset baked + // into the G-code (e.g. the start-G-code belt advance + a G92 reset leaves a + // ~20 mm Z residual). Anchor the lowest extrusion to the belt entry (Y=0) so + // the toolpaths sit on the bed under the model shell. Independent of the + // offset's source, so it stays general across machines. + if (belt_xform != nullptr && !ret.vertices.empty()) { + // Anchor on the OBJECT extrusions only (layer_id >= 1): the start-G-code + // prime lines (layer 0) print at the belt origin, while the object prints + // after the start-G-code belt advance, so anchoring on the global min + // would lock onto the prime and leave the object offset. + float min_y = std::numeric_limits::max(); + for (const PathVertex& v : ret.vertices) + if (v.type == EMoveType::Extrude && v.layer_id >= 1 && v.position[1] < min_y) + min_y = v.position[1]; + if (min_y != std::numeric_limits::max() && std::abs(min_y) > 1e-3f) + for (PathVertex& v : ret.vertices) + v.position[1] -= min_y; + } + ret.spiral_vase_mode = result.spiral_vase_mode; return ret; diff --git a/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.hpp b/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.hpp index 35b5bd7b44..872f297ae6 100644 --- a/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.hpp +++ b/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.hpp @@ -71,7 +71,8 @@ extern Slic3r::PrintEstimatedStatistics::ETimeMode convert(const ETimeMode& mode // mapping from Slic3r::GCodeProcessorResult to libvgcode::GCodeInputData extern GCodeInputData convert(const Slic3r::GCodeProcessorResult& result, const std::vector& str_tool_colors, - const std::vector& str_color_print_colors, const Viewer& viewer); + const std::vector& str_color_print_colors, const Viewer& viewer, + const Slic3r::Transform3d* belt_xform = nullptr); // mapping from Slic3r::Print to libvgcode::GCodeInputData extern GCodeInputData convert(const Slic3r::Print& print, const std::vector& str_tool_colors, From 3fc3b8a8aedae1042cfe8f8166c51f3c0b25351f Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sat, 6 Jun 2026 19:39:57 +0200 Subject: [PATCH 053/389] belt: anchor the designed-view G-code preview onto the model bounding box MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The belt designed (upright) preview back-transforms the machine-frame G-code into model space with the linear belt inverse. That inverse recovers the print's shape and orientation, but not the per-object placement/lift translation: the object's position on the belt, the BeltSliceStrategy min-Z lift, and the centering pre-translate are applied OUTSIDE build_forward_transform() (see PrintObjectSlice.cpp), so its linear inverse cannot undo them. The result was a constant offset (~20 mm on the belt-advance axis) of the toolpaths from the model shell, on every model. Recover the missing translation generally — independent of the offset's exact source or the axis remap — by anchoring the back-transformed object body (extrusions on layer_id >= 1, i.e. excluding the layer-0 prime/skirt) onto the upright model bounding box, the same space the shells render in, and folding that translation into the belt inverse before converting to libvgcode. Replaces the previous Y=0 anchoring in LibVGCodeWrapper, which pinned the toolpaths to the belt entry rather than to the model and so left the offset in place for any object not sitting at the origin. --- src/slic3r/GUI/GCodeViewer.cpp | 28 ++++++++++++++++++- src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp | 23 +++------------ 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 963730e093..9baced5d78 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1229,10 +1229,36 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const // inverse (handles any mesh rotation + shear + axis remap). When off, the raw // machine-frame G-code is shown (useful for debugging the transform itself). const bool is_belt = print.config().belt_printer.value; - const Transform3d belt_inv = (is_belt && m_belt_show_designed) + Transform3d belt_inv = (is_belt && m_belt_show_designed) ? compute_belt_back_transform(print.config()) : Transform3d::Identity(); const bool apply_belt = is_belt && m_belt_show_designed && !belt_inv.matrix().isApprox(Transform3d::Identity().matrix()); + if (apply_belt) { + // The linear belt back-transform recovers the print's shape and orientation but not + // the per-object placement/lift translation: the object's position on the belt, the + // BeltSliceStrategy min-Z lift, and the centering pre-translate are applied OUTSIDE + // build_forward_transform() (see PrintObjectSlice.cpp), so its linear inverse leaves + // them un-undone. Uncorrected, the upright toolpaths float a fixed offset from the + // model shell. Recover the translation generally — independent of the offset's exact + // source or the axis remap — by anchoring the back-transformed object body onto the + // upright model bounding box (the same space the shells render in). + BoundingBoxf3 model_bb; + for (const PrintObject* po : print.objects()) + for (const ModelInstance* mi : po->model_object()->instances) + model_bb.merge(po->model_object()->instance_bounding_box(*mi)); + BoundingBoxf3 tp_bb; + for (const GCodeProcessorResult::MoveVertex& mv : gcode_result.moves) + if (mv.type == EMoveType::Extrude && mv.layer_id >= 1) // skip layer-0 prime/skirt + tp_bb.merge(Vec3d(belt_inv * mv.position.cast())); + if (model_bb.defined && tp_bb.defined) { + const Vec3d d = model_bb.min - tp_bb.min; + belt_inv = Transform3d(Eigen::Translation3d(d)) * belt_inv; + BOOST_LOG_TRIVIAL(debug) << "[BELT-PREVIEW] anchor: model_bb.min=(" + << model_bb.min.x() << "," << model_bb.min.y() << "," << model_bb.min.z() + << ") tp_bb.min=(" << tp_bb.min.x() << "," << tp_bb.min.y() << "," << tp_bb.min.z() + << ") d=(" << d.x() << "," << d.y() << "," << d.z() << ")"; + } + } libvgcode::GCodeInputData data = libvgcode::convert(gcode_result, str_tool_colors, str_color_print_colors, m_viewer, apply_belt ? &belt_inv : nullptr); diff --git a/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp b/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp index ffc549755b..015947e9bb 100644 --- a/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp +++ b/src/slic3r/GUI/LibVGCode/LibVGCodeWrapper.cpp @@ -275,25 +275,10 @@ GCodeInputData convert(const Slic3r::GCodeProcessorResult& result, const std::ve } ret.vertices.shrink_to_fit(); - // Belt designed view: the linear back-transform recovers the correct shape - // and orientation, but not the constant machine-frame origin offset baked - // into the G-code (e.g. the start-G-code belt advance + a G92 reset leaves a - // ~20 mm Z residual). Anchor the lowest extrusion to the belt entry (Y=0) so - // the toolpaths sit on the bed under the model shell. Independent of the - // offset's source, so it stays general across machines. - if (belt_xform != nullptr && !ret.vertices.empty()) { - // Anchor on the OBJECT extrusions only (layer_id >= 1): the start-G-code - // prime lines (layer 0) print at the belt origin, while the object prints - // after the start-G-code belt advance, so anchoring on the global min - // would lock onto the prime and leave the object offset. - float min_y = std::numeric_limits::max(); - for (const PathVertex& v : ret.vertices) - if (v.type == EMoveType::Extrude && v.layer_id >= 1 && v.position[1] < min_y) - min_y = v.position[1]; - if (min_y != std::numeric_limits::max() && std::abs(min_y) > 1e-3f) - for (PathVertex& v : ret.vertices) - v.position[1] -= min_y; - } + // Note: the belt designed-view anchoring (recovering the per-object placement/ + // lift translation the linear back-transform cannot) is folded into belt_xform + // by the caller (GCodeViewer::load_as_gcode), which anchors onto the upright + // model bounding box. Nothing extra to do here. ret.spiral_vase_mode = result.spiral_vase_mode; From 8593d66a3998de8e87886251493f6d10bbc26eef Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sun, 7 Jun 2026 09:57:12 +0200 Subject: [PATCH 054/389] belt: correct the designed-view preview's belt-Z origin and reject mis-mapped outliers The Cartesian designed-view preview over-extended the toolpaths past the model shell by a height-proportional amount (up to ~20mm tall parts), most visibly on long multi-part prints; compact parts like a calibration cube looked fine. Two coupled causes: - Belt start G-code that primes with a Z advance and a 'G92 Z0' reset leaves a constant machine-Z origin in the GCodeProcessor, so move positions are stored as gcode_Z + origin. The linear back-transform mixes that constant with the gantry-Y term, leaving a per-move designed-Y error that min-corner anchoring cannot cancel when an elevated move (e.g. a bridge) happens to cancel it at the bbox minimum. Expose GCodeProcessorResult::belt_z_origin (the m_origin[Z] left by the start G-code) and subtract it before the back-transform. - Elevated features (bridges/overhangs) are mis-mapped by the linear inverse to outside the model body; build the anchor bbox only from moves within model_bb +/- 10mm, with a fallback to the full bbox when the clip would drop the bulk (object placed away from the belt entry) so the gross-offset case still anchors. Preview-only; G-code output is unchanged. --- src/libslic3r/GCode/GCodeProcessor.cpp | 7 ++++ src/libslic3r/GCode/GCodeProcessor.hpp | 6 ++++ src/slic3r/GUI/GCodeViewer.cpp | 47 ++++++++++++++++++++++---- 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 003c0af05a..b15736ef57 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -4933,6 +4933,13 @@ void GCodeProcessor::process_G92(const GCodeReader::GCodeLine& line) if (line.has_z()) { m_origin[Z] = m_end_position[Z] - line.z() * lengths_scale_factor; any_found = true; + // Belt only: the start G-code's purge-blob advance + G92 Z0 resets leave a constant + // machine-Z origin offset here; the designed-view back-transform subtracts it so + // toolpaths map to the model's belt coordinate (gcode Z). Gated on belt_tilt_angle + // (set from the belt header, parsed before the body) so non-belt G-code processing + // is byte-identical — no unconditional work on the shared path. + if (m_result.belt_tilt_angle != 0.f) + m_result.belt_z_origin = m_origin[Z]; } if (line.has_e()) { diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 3047c005ed..8fcf2e0c43 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -248,6 +248,11 @@ class Print; // Belt printer: physical tilt magnitude (deg) parsed from the slicing-rotation // header comment; used to enable the preview's belt view. float belt_tilt_angle{ 0.f }; + // Belt printer: machine-Z origin offset (mm) left in m_origin[Z] by the start + // G-code (purge-blob belt advance + G92 Z0 resets). Move positions are stored + // as gcode_Z + this offset, so the designed-view back-transform must subtract it + // to recover the model's belt coordinate. + float belt_z_origin{ 0.f }; RemapAxis preslice_remap_x{ RemapAxis::PosX }; RemapAxis preslice_remap_y{ RemapAxis::PosY }; RemapAxis preslice_remap_z{ RemapAxis::PosZ }; @@ -317,6 +322,7 @@ class Print; filament_change_count_map = other.filament_change_count_map; initial_layer_time = other.initial_layer_time; belt_tilt_angle = other.belt_tilt_angle; + belt_z_origin = other.belt_z_origin; preslice_remap_x = other.preslice_remap_x; preslice_remap_y = other.preslice_remap_y; preslice_remap_z = other.preslice_remap_z; diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 9baced5d78..1263e3fed6 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1231,6 +1231,14 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const const bool is_belt = print.config().belt_printer.value; Transform3d belt_inv = (is_belt && m_belt_show_designed) ? compute_belt_back_transform(print.config()) : Transform3d::Identity(); + // Belt: move positions are stored as gcode_Z + belt_z_origin (the start G-code's + // purge-blob advance baked into the machine-Z origin by its G92 Z0 resets). Subtract + // that constant before the linear back-transform so every toolpath maps to the model's + // belt coordinate. Without it the back-transform mixes the offset with the gantry-Y + // term, leaving a per-move designed-Y error that min-corner anchoring cannot remove + // when a bridge/keel move happens to cancel it at the bbox minimum. + if (is_belt && m_belt_show_designed && gcode_result.belt_z_origin != 0.0f) + belt_inv = belt_inv * Transform3d(Eigen::Translation3d(Vec3d(0.0, 0.0, -double(gcode_result.belt_z_origin)))); const bool apply_belt = is_belt && m_belt_show_designed && !belt_inv.matrix().isApprox(Transform3d::Identity().matrix()); if (apply_belt) { @@ -1246,17 +1254,42 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const for (const PrintObject* po : print.objects()) for (const ModelInstance* mi : po->model_object()->instances) model_bb.merge(po->model_object()->instance_bounding_box(*mi)); - BoundingBoxf3 tp_bb; + // Build the anchor bbox from surface toolpaths only. After the belt_z_origin + // correction the surface back-transforms onto the model, but a few elevated + // features (bridges/overhangs over the chevron gap) are mis-mapped by the linear + // inverse to well outside the model body; if one becomes the bbox minimum it + // drags the min-corner anchor by ~20mm. Drop moves that land clearly outside the + // (correct) model bbox — a geometric filter, not a role guess. + BoundingBoxf3 tp_bb_clip, tp_bb_full; + const double y_lo = model_bb.defined ? model_bb.min.y() - 10.0 : -1e30; + const double y_hi = model_bb.defined ? model_bb.max.y() + 10.0 : 1e30; for (const GCodeProcessorResult::MoveVertex& mv : gcode_result.moves) - if (mv.type == EMoveType::Extrude && mv.layer_id >= 1) // skip layer-0 prime/skirt - tp_bb.merge(Vec3d(belt_inv * mv.position.cast())); + if (mv.type == EMoveType::Extrude && mv.layer_id >= 1) { // skip layer-0 prime/skirt + const Vec3d p = belt_inv * mv.position.cast(); + tp_bb_full.merge(p); + if (p.y() >= y_lo && p.y() <= y_hi) + tp_bb_clip.merge(p); + } + // Use the clipped bbox only when it still holds the bulk of the body (outliers + // removed). If the object sits far from the belt entry the toolpaths are grossly + // offset and the clip would drop most of them — fall back to the full bbox so the + // min-corner anchor still recovers that gross translation rather than breaking. + const BoundingBoxf3& tp_bb = + (tp_bb_clip.defined && tp_bb_full.defined && + tp_bb_clip.size().y() >= 0.5 * tp_bb_full.size().y()) ? tp_bb_clip : tp_bb_full; if (model_bb.defined && tp_bb.defined) { + // Anchor the back-transformed toolpath body onto the upright model bbox by + // its MIN corner. (Center anchoring was tried and regressed when the toolpath + // and model bounding boxes differ in extent.) With the belt_z_origin + // correction above and the outlier-robust bbox below, the surface overlaps the + // shell to well under a millimetre when the object is at the belt entry; an + // object placed elsewhere in global-rotation mode still carries the placement + // translation, which this min-corner step recovers. const Vec3d d = model_bb.min - tp_bb.min; belt_inv = Transform3d(Eigen::Translation3d(d)) * belt_inv; - BOOST_LOG_TRIVIAL(debug) << "[BELT-PREVIEW] anchor: model_bb.min=(" - << model_bb.min.x() << "," << model_bb.min.y() << "," << model_bb.min.z() - << ") tp_bb.min=(" << tp_bb.min.x() << "," << tp_bb.min.y() << "," << tp_bb.min.z() - << ") d=(" << d.x() << "," << d.y() << "," << d.z() << ")"; + BOOST_LOG_TRIVIAL(debug) << "[BELT-PREVIEW] z_origin=" << gcode_result.belt_z_origin + << " model_bb.y=[" << model_bb.min.y() << "," << model_bb.max.y() + << "] tp_bb.y=[" << tp_bb.min.y() << "," << tp_bb.max.y() << "] d.y=" << d.y(); } } libvgcode::GCodeInputData data = libvgcode::convert(gcode_result, str_tool_colors, str_color_print_colors, m_viewer, From a4fb5af9e1c75bf66c1b6d488d4c9ac00c236e4d Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Sun, 21 Jun 2026 18:20:58 +0800 Subject: [PATCH 055/389] Don't allow adding more colors for non-semm printers on obj import color remapping dialog (#14275) --- src/slic3r/GUI/ObjColorDialog.cpp | 9 ++++++--- src/slic3r/GUI/ObjColorDialog.hpp | 5 +++-- src/slic3r/GUI/Plater.cpp | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/slic3r/GUI/ObjColorDialog.cpp b/src/slic3r/GUI/ObjColorDialog.cpp index a8ef3f046f..47f62aa168 100644 --- a/src/slic3r/GUI/ObjColorDialog.cpp +++ b/src/slic3r/GUI/ObjColorDialog.cpp @@ -79,7 +79,7 @@ bool ObjColorDialog::Show(bool show) { } }; -ObjColorDialog::ObjColorDialog(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, const std::vector &extruder_colours) +ObjColorDialog::ObjColorDialog(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, const std::vector &extruder_colours, const bool semm) : DPIDialog(parent ? parent : static_cast(wxGetApp().mainframe), wxID_ANY, _(L("OBJ file import color")), @@ -109,7 +109,7 @@ ObjColorDialog::ObjColorDialog(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, } bool ok = in_out.lost_material_name.empty() && !some_face_no_color; if (ok) { - m_panel_ObjColor = new ObjColorPanel(this, in_out, extruder_colours); + m_panel_ObjColor = new ObjColorPanel(this, in_out, extruder_colours, semm); m_panel_ObjColor->set_layout_callback([this]() { update_layout(); }); m_main_sizer->Add(m_panel_ObjColor, 1, wxEXPAND | wxALL, 0); } @@ -178,12 +178,13 @@ ObjColorDialog::ObjColorDialog(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, } // This panel contains all control widgets for both simple and advanced mode (these reside in separate sizers) -ObjColorPanel::ObjColorPanel(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, const std::vector &extruder_colours) +ObjColorPanel::ObjColorPanel(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, const std::vector &extruder_colours, const bool semm) : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize /*,wxBORDER_RAISED*/) , m_obj_in_out(in_out) , m_input_colors(in_out.input_colors) , m_filament_ids(in_out.filament_ids) , m_first_extruder_id(in_out.first_extruder_id) + , m_semm(semm) { if (in_out.input_colors.size() == 0) { return; } for (const std::string& color : extruder_colours) { @@ -504,6 +505,7 @@ wxBoxSizer *ObjColorPanel::create_add_btn_sizer(wxWindow *parent) deal_add_btn(); deal_thumbnail(); }); + m_quick_add_btn->Enable(m_semm); // only SEMM printer can add more colors return btn_sizer; } @@ -859,6 +861,7 @@ bool ObjColorPanel::do_show(bool show) { bool ObjColorPanel::deal_add_btn() { + if (!m_semm) { return false; }// only SEMM printer can add more colors if (m_colours.size() > g_max_color) { return false; } deal_reset_btn(); std::vector new_icons; diff --git a/src/slic3r/GUI/ObjColorDialog.hpp b/src/slic3r/GUI/ObjColorDialog.hpp index bac3a80519..1ad74cdccd 100644 --- a/src/slic3r/GUI/ObjColorDialog.hpp +++ b/src/slic3r/GUI/ObjColorDialog.hpp @@ -20,7 +20,7 @@ class ObjColorPanel : public wxPanel { public: // BBS - ObjColorPanel(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, const std::vector &extruder_colours); + ObjColorPanel(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, const std::vector &extruder_colours, bool semm); ~ObjColorPanel(); void msw_rescale(); bool is_ok(); @@ -90,6 +90,7 @@ private: int m_color_num_recommend{0}; int m_color_cluster_num_by_algo{0}; int m_input_colors_size{0}; + bool m_semm; // only SEMM printer can add more colors std::vector m_colours;//from project and show right std::vector m_cluster_map_filaments;//show middle int m_max_filament_index = 0; @@ -112,7 +113,7 @@ private: class ObjColorDialog : public Slic3r::GUI::DPIDialog { public: - ObjColorDialog(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, const std::vector &extruder_colours); + ObjColorDialog(wxWindow *parent, Slic3r::ObjDialogInOut &in_out, const std::vector &extruder_colours, bool semm); wxBoxSizer *create_btn_sizer(long flags, bool exist_error); void on_dpi_changed(const wxRect &suggested_rect) override; void update_layout(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 87be0e52f4..2dc92f3b4b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6554,7 +6554,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ if (!boost::iends_with(path.string(), ".obj")) { return; } const std::vector extruder_colours = wxGetApp().plater()->get_extruder_colors_from_plater_config(); - ObjColorDialog color_dlg(nullptr, in_out, extruder_colours); + ObjColorDialog color_dlg(nullptr, in_out, extruder_colours, Sidebar::should_show_SEMM_buttons()); if (color_dlg.ShowModal() != wxID_OK) { in_out.filament_ids.clear(); } @@ -8816,7 +8816,7 @@ void Plater::priv::reload_from_disk() auto obj_color_fun = [this, &path](ObjDialogInOut &in_out) { if (!boost::iends_with(path, ".obj")) { return; } const std::vector extruder_colours = wxGetApp().plater()->get_extruder_colors_from_plater_config(); - ObjColorDialog color_dlg(nullptr, in_out, extruder_colours); + ObjColorDialog color_dlg(nullptr, in_out, extruder_colours, Sidebar::should_show_SEMM_buttons()); if (color_dlg.ShowModal() != wxID_OK) { in_out.filament_ids.clear(); } From 07f08dfe40f925904c5384be7b36ec554012d551 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Mon, 22 Jun 2026 00:50:51 +0800 Subject: [PATCH 056/389] bump version to 2.5.0-dev --- scripts/flatpak/com.orcaslicer.OrcaSlicer.metainfo.xml | 2 +- version.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/flatpak/com.orcaslicer.OrcaSlicer.metainfo.xml b/scripts/flatpak/com.orcaslicer.OrcaSlicer.metainfo.xml index 9ec11fa930..c8e4d401b8 100644 --- a/scripts/flatpak/com.orcaslicer.OrcaSlicer.metainfo.xml +++ b/scripts/flatpak/com.orcaslicer.OrcaSlicer.metainfo.xml @@ -45,7 +45,7 @@ #00695C - + https://github.com/OrcaSlicer/OrcaSlicer/releases/tag/nightly-builds

See the release page for detailed changelog.

diff --git a/version.inc b/version.inc index c283ecbad6..7ddaad214e 100644 --- a/version.inc +++ b/version.inc @@ -7,7 +7,7 @@ set(SLIC3R_APP_KEY "OrcaSlicer") if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "0") endif() -set(SoftFever_VERSION "2.4.0-dev") +set(SoftFever_VERSION "2.5.0-dev") string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" SoftFever_VERSION_MATCH ${SoftFever_VERSION}) set(ORCA_VERSION_MAJOR ${CMAKE_MATCH_1}) From 86c6a1a66fca360068a96225bb7dd72ef8056cac Mon Sep 17 00:00:00 2001 From: Heiko Liebscher Date: Mon, 22 Jun 2026 20:40:14 +0200 Subject: [PATCH 057/389] Improve German (de) translation (#14352) Co-authored-by: Claude Opus 4.8 (1M context) --- localization/i18n/de/OrcaSlicer_de.po | 208 +++++++++++++------------- 1 file changed, 108 insertions(+), 100 deletions(-) diff --git a/localization/i18n/de/OrcaSlicer_de.po b/localization/i18n/de/OrcaSlicer_de.po index edd14a18e2..4a6ce9c11f 100644 --- a/localization/i18n/de/OrcaSlicer_de.po +++ b/localization/i18n/de/OrcaSlicer_de.po @@ -27,7 +27,7 @@ msgid "left extruder" msgstr "linker Extruder" msgid "extruder" -msgstr "" +msgstr "Extruder" msgid "TPU is not supported by AMS." msgstr "TPU wird vom AMS nicht unterstützt." @@ -85,7 +85,7 @@ msgid "Serial:" msgstr "Seriennummer:" msgid "Version:" -msgstr "" +msgstr "Version:" msgid "Latest version" msgstr "Neueste Version" @@ -246,7 +246,7 @@ msgid "Reset" msgstr "Zurücksetzen" msgid "Enter" -msgstr "" +msgstr "Eingabe" msgid "Shortcut Key " msgstr "Tastenkürzel" @@ -261,7 +261,7 @@ msgid "Vertical" msgstr "Vertikal" msgid "Horizontal" -msgstr "" +msgstr "Horizontal" msgid "Remove painted color" msgstr "Gemalte Farbe entfernen" @@ -358,7 +358,7 @@ msgid "Single sided scaling" msgstr "Einseitige Skalierung" msgid "Position" -msgstr "" +msgstr "Position" msgid "Rotate (relative)" msgstr "Rotation (relativ)" @@ -426,7 +426,7 @@ msgid "Uniform scale" msgstr "einheitliche Skalierung" msgid "Planar" -msgstr "" +msgstr "Planar" msgid "Dovetail" msgstr "Schwalbenschwanz" @@ -450,7 +450,7 @@ msgid "Prism" msgstr "Prisma" msgid "Frustum" -msgstr "" +msgstr "Frustum" msgid "Square" msgstr "Quadrat" @@ -863,19 +863,19 @@ msgid "Emboss" msgstr "Prägen" msgid "NORMAL" -msgstr "" +msgstr "Normal" msgid "SMALL" msgstr "Schmal" msgid "ITALIC" -msgstr "kursiv" +msgstr "Kursiv" msgid "SWISS" -msgstr "" +msgstr "Swiss" msgid "MODERN" -msgstr "" +msgstr "Modern" msgid "First font" msgstr "erste Schriftart" @@ -964,7 +964,7 @@ msgid "Name has to be unique." msgstr "Name muss eindeutig sein." msgid "OK" -msgstr "" +msgstr "OK" msgid "Rename style" msgstr "Benenne Stil um" @@ -1458,7 +1458,7 @@ msgid "Restart selection" msgstr "Auswahl neu starten" msgid "Esc" -msgstr "" +msgstr "Esc" msgid "Cancel a feature until exit" msgstr "Abbrechen einer Funktion bis zum Verlassen" @@ -1592,6 +1592,9 @@ msgid "" "because they are restricted to the bed \n" "and only parts can be lifted." msgstr "" +"Es wird empfohlen, die Objekte zuerst zusammenzubauen,\n" +"da sie auf das Druckbett beschränkt sind \n" +"und nur Teile angehoben werden können." msgid "Face and face assembly" msgstr "Face und Face Zusammenbau" @@ -1629,7 +1632,7 @@ msgid "Process" msgstr "Prozess" msgid "Filament" -msgstr "" +msgstr "Filament" msgid "Machine" msgstr "Maschine" @@ -1769,7 +1772,7 @@ msgid "This is the newest version." msgstr "Dies ist die neueste Version." msgid "Info" -msgstr "" +msgstr "Info" msgid "Loading printer & filament profiles" msgstr "Lade Drucker- und Filamentprofile" @@ -1817,7 +1820,7 @@ msgid "Choose one file (GCODE/3MF):" msgstr "Wählen sie eine Datei (GCODE/3MF):" msgid "Ext" -msgstr "" +msgstr "Ext" msgid "Some presets are modified." msgstr "Einige Profileinstellungen wurden geändert." @@ -2087,7 +2090,7 @@ msgid "Ironing" msgstr "Glätten" msgid "Fuzzy skin" -msgstr "" +msgstr "Fuzzy skin" msgid "Extruders" msgstr "Extruder" @@ -2174,7 +2177,7 @@ msgid "Disc" msgstr "Scheibe" msgid "Torus" -msgstr "" +msgstr "Torus" msgid "Orca Cube" msgstr "Orca Würfel" @@ -2310,7 +2313,7 @@ msgstr "Standard" #, c-format, boost-format msgid "Filament %d" -msgstr "" +msgstr "Filament %d" msgid "current" msgstr "Aktuell" @@ -2571,10 +2574,10 @@ msgid "Edit Plate Name" msgstr "Ändere Plattenname" msgid "Name" -msgstr "" +msgstr "Name" msgid "Fila." -msgstr "" +msgstr "Fila." #, c-format, boost-format msgid "%1$d error repaired" @@ -2868,7 +2871,7 @@ msgid "Color" msgstr "Farbe" msgid "Pause" -msgstr "" +msgstr "Pause" msgid "Template" msgstr "Vorlage" @@ -2877,7 +2880,7 @@ msgid "Custom" msgstr "Benutzerdefiniert" msgid "Pause:" -msgstr "" +msgstr "Pause:" msgid "Custom Template:" msgstr "Benutzerdefinierte Vorlage:" @@ -2918,7 +2921,7 @@ msgid "Insert template custom G-code at the beginning of this layer." msgstr "Fügen Sie am Anfang dieses Layers benutzerdefinierten G-Code aus einer Vorlage ein." msgid "Filament " -msgstr "" +msgstr "Filament " msgid "Change filament at the beginning of this layer." msgstr "Wechseln Sie am Anfang dieses Layers das Filament." @@ -2951,7 +2954,7 @@ msgid "Check the status of current system services" msgstr "Überprüfen Sie den Status der aktuellen Systemdienste" msgid "code" -msgstr "" +msgstr "Code" msgid "Failed to connect to cloud service" msgstr "Verbindung zum Cloud-Dienst fehlgeschlagen" @@ -2998,7 +3001,7 @@ msgid "Off" msgstr "Aus" msgid "Filter" -msgstr "" +msgstr "Filter" msgid "Enabling filtration redirects the right fan to filter gas, which may reduce cooling performance." msgstr "Die Aktivierung der Filtration leitet den rechten Lüfter um, um Gas zu filtern, was die Kühlleistung verringern kann." @@ -3068,13 +3071,13 @@ msgid "Parts" msgstr "Teile" msgid "Aux" -msgstr "" +msgstr "Aux" msgid "Nozzle1" msgstr "Düse1" msgid "MC Board" -msgstr "" +msgstr "MC Board" msgid "Heat" msgstr "Heizen" @@ -3161,7 +3164,7 @@ msgid "Developer mode" msgstr "Entwicklermodus" msgid "Launch troubleshoot center" -msgstr "" +msgstr "Fehlerbehebungszentrum starten" msgid "" "All the selected objects are on a locked plate.\n" @@ -3472,7 +3475,7 @@ msgid "Orca Slicer is licensed under " msgstr "Orca Slicer ist lizenziert unter " msgid "GNU Affero General Public License, version 3" -msgstr "" +msgstr "GNU Affero General Public License, Version 3" msgid "Orca Slicer is based on PrusaSlicer and BambuStudio" msgstr "Orca Slicer basiert auf PrusaSlicer und BambuStudio" @@ -3497,7 +3500,7 @@ msgid "Today, OrcaSlicer is the most widely used and actively developed open-sou msgstr "Heute ist OrcaSlicer der am weitesten verbreitete und aktiv entwickelte Open-Source-Slicer in der 3D-Druck-Community. Viele seiner Innovationen wurden von anderen Slicern übernommen und treiben die gesamte Industrie voran." msgid "Version" -msgstr "" +msgstr "Version" msgid "AMS Materials Setting" msgstr "AMS Material Einstellung" @@ -3514,17 +3517,17 @@ msgid "" msgstr "Düsentemperatur" msgid "max" -msgstr "" +msgstr "max" msgid "min" -msgstr "" +msgstr "min" #, boost-format msgid "The input value should be greater than %1% and less than %2%" msgstr "Der Eingabewert sollte größer als %1% und kleiner als %2% sein" msgid "SN" -msgstr "" +msgstr "SN" msgid "Factors of Flow Dynamics Calibration" msgstr "Dynamische Flusskalibrierungsfaktoren" @@ -3671,7 +3674,7 @@ msgstr "" "Und Sie können nicht darauf klicken, um es zu ändern" msgid "AMS Slots" -msgstr "" +msgstr "AMS-Slots" msgid "Please select from the following filaments" msgstr "Bitte wählen Sie aus den folgenden Filamenten" @@ -3827,7 +3830,7 @@ msgid "AMS will attempt to estimate the remaining capacity of the Bambu Lab fila msgstr "AMS versucht, die verbleibende Kapazität der Bambu Lab Filamente zu schätzen." msgid "AMS filament backup" -msgstr "" +msgstr "AMS-Filament-Backup" msgid "AMS will continue to another spool with matching filament properties automatically when current filament runs out." msgstr "AMS wechselt automatisch zu einer anderen Spule mit denselben Filamenteigenschaften, wenn das aktuelle Filament leer ist." @@ -4246,7 +4249,7 @@ msgid "Changing filament" msgstr "Filament wechseln" msgid "M400 pause" -msgstr "" +msgstr "M400 Pause" msgid "Paused (filament ran out)" msgstr "Pausiert (Filament leer)" @@ -4663,7 +4666,7 @@ msgid "Invalid format. Expected vector format: \"%1%\"" msgstr "Ungültiges Format. Erwartetes Vektorformat: \"%1%\"" msgid "N/A" -msgstr "" +msgstr "Nicht verfügbar" msgid "Pick" msgstr "Wähle" @@ -4980,7 +4983,7 @@ msgid "Options" msgstr "Optionen" msgid "Extruder" -msgstr "" +msgstr "Extruder" msgid "Cost" msgstr "Kosten" @@ -5052,7 +5055,7 @@ msgid "Smooth" msgstr "Höhenunterschiede glätten" msgid "Radius" -msgstr "" +msgstr "Radius" msgid "Keep min" msgstr "Minimum beibehalten" @@ -6044,7 +6047,7 @@ msgid "Switch to timelapse files." msgstr "Wechseln zu Zeitrafferdateien." msgid "Video" -msgstr "" +msgstr "Video" msgid "Switch to video files." msgstr "Wechseln Sie zu Videodateien." @@ -6247,7 +6250,7 @@ msgid "Invert Roll axis" msgstr "Invertiere Roll-Achse" msgid "(LAN)" -msgstr "" +msgstr "(LAN)" msgid "Search" msgstr "Suche" @@ -6259,7 +6262,7 @@ msgid "Other Device" msgstr "Anderes Gerät" msgid "Online" -msgstr "" +msgstr "Online" msgid "Input access code" msgstr "Zugangscode eingeben" @@ -6272,7 +6275,7 @@ msgid "Log out successful." msgstr "Abmeldung erfolgreich." msgid "Offline" -msgstr "" +msgstr "Offline" msgid "Busy" msgstr "Beschäftigt" @@ -6328,7 +6331,7 @@ msgid "Parts Skip" msgstr "Teile überspringen" msgid "Stop" -msgstr "" +msgstr "Stopp" msgid "Layer: N/A" msgstr "Schicht: N/A" @@ -6464,10 +6467,10 @@ msgid "Silent" msgstr "Leise" msgid "Standard" -msgstr "" +msgstr "Standard" msgid "Sport" -msgstr "" +msgstr "Sport" msgid "Ludicrous" msgstr "Verrückt" @@ -6630,7 +6633,7 @@ msgstr "" #, c-format, boost-format msgid "%s information" -msgstr "" +msgstr "%s Informationen" msgid "Skip" msgstr "Überspringen" @@ -6702,7 +6705,7 @@ msgid "New network plug-in available." msgstr "Neues Netzwerk-Plugin verfügbar" msgid "Details" -msgstr "" +msgstr "Details" msgid "New printer config available." msgstr "Neue Druckerkonfiguration verfügbar." @@ -7553,7 +7556,7 @@ msgid "Importing to Orca Slicer failed. Please download the file and manually im msgstr "Der Import in Orca Slicer ist fehlgeschlagen. Bitte laden Sie die Datei manuell herunter und importieren Sie sie." msgid "INFO:" -msgstr "" +msgstr "INFO:" msgid "No accelerations provided for calibration. Use default acceleration value " msgstr "Keine Beschleunigungen für die Kalibrierung bereitgestellt. Verwenden Sie den Standardbeschleunigungswert" @@ -8075,7 +8078,7 @@ msgid "With this option enabled, you can print materials with a large temperatur msgstr "Mit dieser Option können Sie Materialien mit großen Temperaturunterschieden zusammen drucken." msgid "Touchpad" -msgstr "" +msgstr "Touchpad" msgid "Camera style" msgstr "Kamerastil" @@ -8177,13 +8180,16 @@ msgid "Renders cast shadows on the plate in realistic view." msgstr "Zeigt geworfene Schatten auf der Platte in der realistischen Ansicht an." msgid "Smooth normals" -msgstr "" +msgstr "Glatte Normalen" msgid "" "Applies smooth normals to the realistic view.\n" "\n" "Requires manual scene reload to take effect (right-click on 3D view → \"Reload All\")." msgstr "" +"Wendet glatte Normalen auf die realistische Ansicht an.\n" +"\n" +"Erfordert manuelles Neuladen der Szene, um wirksam zu werden (Rechtsklick auf 3D-Ansicht → \"Alle neu laden\")." msgid "Anti-aliasing" msgstr "Kantenglättung" @@ -8246,7 +8252,7 @@ msgid "Displays current viewport FPS in the top-right corner." msgstr "Zeigt die aktuelle FPS des Viewports in der oberen rechten Ecke an." msgid "Login region" -msgstr "" +msgstr "Anmeldungsregion" msgid "Stealth mode" msgstr "Unsichtbarer Modus" @@ -8268,7 +8274,7 @@ msgid "Network test" msgstr "Netzwerktest" msgid "Test" -msgstr "" +msgstr "Test" msgid "Cloud Providers" msgstr "Cloud-Anbieter" @@ -8314,10 +8320,10 @@ msgid "Color only" msgstr "Nur Farbe" msgid "Bambu network plug-in" -msgstr "" +msgstr "Bambu Netzwerk-Plugin" msgid "Enable Bambu network plug-in" -msgstr "" +msgstr "Bambu Netzwerk-Plugin aktivieren" msgid "Network plug-in version" msgstr "Netzwerk-Plugin-Version" @@ -8552,7 +8558,7 @@ msgid "Left filaments" msgstr "linke Filamente" msgid "AMS filament" -msgstr "" +msgstr "AMS-Filament" msgid "Right filaments" msgstr "rechte Filamente" @@ -8576,7 +8582,7 @@ msgid "Bundle presets" msgstr "Gebündelte Profile" msgid "System" -msgstr "" +msgstr "System" msgid "Unsupported presets" msgstr "Nicht unterstützte Profile" @@ -9431,7 +9437,7 @@ msgid "Tree supports" msgstr "Baumstützen" msgid "Multimaterial" -msgstr "" +msgstr "Multimaterial" msgid "Filament for Features" msgstr "Filament für Funktionen" @@ -9567,10 +9573,10 @@ msgid "Complete print" msgstr "Druck abgeschlossen" msgid "Filament start G-code" -msgstr "" +msgstr "Filament Start G-Code" msgid "Filament end G-code" -msgstr "" +msgstr "Filament Ende G-Code" msgid "Wipe tower parameters" msgstr "Reinigungsturm-Parameter" @@ -9662,7 +9668,7 @@ msgid "Motion ability" msgstr "Bewegungseinstellung" msgid "Normal" -msgstr "" +msgstr "Normal" msgid "Resonance Compensation" msgstr "Resonanzkompensation" @@ -10148,7 +10154,7 @@ msgstr "" msgctxt "Sync_AMS" msgid "Original" -msgstr "" +msgstr "Original" msgid "After mapping" msgstr "Nach dem Zuordnen" @@ -10277,7 +10283,7 @@ msgstr "Farbe und Typ des Filaments erfolgreich vom Drucker synchronisiert." msgctxt "FinishSyncAms" msgid "OK" -msgstr "" +msgstr "OK" msgid "Ramming customization" msgstr "Ramming-Anpassung" @@ -10571,7 +10577,7 @@ msgid "Support/Color Painting: adjust section position" msgstr "Stützen/Farbmalen: Position des Abschnitts anpassen" msgid "Gizmo" -msgstr "" +msgstr "Gizmo" msgid "Set extruder number for the objects and parts" msgstr "Extrudernummer für die Objekte und Teile einstellen" @@ -10742,10 +10748,10 @@ msgid "Air Pump" msgstr "Luftpumpe" msgid "Laser 10W" -msgstr "" +msgstr "Laser 10W" msgid "Laser 40W" -msgstr "" +msgstr "Laser 40W" msgid "Cutting Module" msgstr "Schneidemodul" @@ -11332,10 +11338,10 @@ msgid "Allow controlling BambuLab's printer through 3rd party print hosts." msgstr "Erlauben Sie die Steuerung von BambuLab-Druckern durch Drittanbieter-Druck-Hosts" msgid "Use 3MF instead of G-code" -msgstr "" +msgstr "Benutze 3MF statt G-Code" msgid "Enable this if the printer accepts a 3MF file as the print job. When enabled, Orca Slicer sends the sliced file as a .gcode.3mf, instead of a plain .gcode file." -msgstr "" +msgstr "Aktivieren Sie diese Option, wenn der Drucker eine 3MF-Datei als Druckauftrag akzeptiert. Wenn aktiviert, sendet Orca Slicer die geslicete Datei als .gcode.3mf, anstatt als einfache .gcode-Datei." msgid "Printer Agent" msgstr "Drucker-Agent" @@ -12604,6 +12610,8 @@ msgid "" "Enable adaptive PA for overhangs as well as when flow changes within the same feature. This is an experimental option, as if the PA profile is not set accurately, it will cause uniformity issues on the external surfaces before and after overhangs.\n" "Not compatible with Prusa printers as they pause to process PA changes, which causes delays and defects." msgstr "" +"Aktivieren Sie adaptives PA auch für Überhänge sowie bei Flussänderungen innerhalb desselben Features. Dies ist eine experimentelle Option, da sie bei ungenau eingestelltem PA-Profil zu Uniformitätsproblemen auf den äußeren Oberflächen vor und nach Überhängen führen kann.\n" +"Nicht kompatibel mit Prusa-Druckern, da diese pausieren, um PA-Änderungen zu verarbeiten, was zu Verzögerungen und Defekten führt." msgid "Pressure advance for bridges" msgstr "Pressure Advance für Brücken" @@ -13068,7 +13076,7 @@ msgid "Grid" msgstr "Gitternetz" msgid "Tri-hexagon" -msgstr "" +msgstr "Tri-Hexagon" msgid "Cubic" msgstr "Kubisch" @@ -13107,7 +13115,7 @@ msgid "TPMS-FK" msgstr "TPMS-FK" msgid "Gyroid" -msgstr "" +msgstr "Gyroid" msgid "Lateral lattice angle 1" msgstr "Gitterwinkel 1" @@ -13288,7 +13296,7 @@ msgid "Travel speed of the first layer." msgstr "Bewegungsgeschwindigkeit der ersten Schicht" msgid "Number of slow layers" -msgstr "" +msgstr "Anzahl der langsamen Schichten" msgid "The first few layers are printed slower than normal. The speed is gradually increased in a linear fashion over the specified number of layers." msgstr "Die ersten paar Schichten werden langsamer als normal gedruckt. Die Geschwindigkeit wird allmählich linear über die angegebene Anzahl von Schichten erhöht." @@ -13429,7 +13437,7 @@ msgid "Displacement" msgstr "Verschiebung" msgid "Extrusion" -msgstr "" +msgstr "Extrusion" msgid "Combined" msgstr "Kombiniert" @@ -13463,7 +13471,7 @@ msgid "Billow" msgstr "Billow" msgid "Ridged Multifractal" -msgstr "" +msgstr "Ridged Multifractal" msgid "Voronoi" msgstr "Voronoi" @@ -14198,7 +14206,7 @@ msgstr "" "Bitte schalten Sie diese Option aus, wenn Sie Ringe testen." msgid "Min" -msgstr "" +msgstr "Min" msgid "Minimum speed of resonance avoidance." msgstr "Minimale Geschwindigkeit der Resonanzvermeidung." @@ -16011,7 +16019,7 @@ msgid "Export the objects as multiple STLs to directory." msgstr "Exportieren Sie die Objekte als mehrere STLs in ein Verzeichnis" msgid "Slice" -msgstr "" +msgstr "Slice" msgid "Slice the plates: 0-all plates, i-plate i, others-invalid" msgstr "Slicen sie die Druckplatten: 0-alle Druckplatten; i-Druckplatte i; andere ungültig" @@ -16516,7 +16524,7 @@ msgid "Hour" msgstr "Stunde" msgid "Minute" -msgstr "" +msgstr "Minute" msgid "Second" msgstr "Sekunde" @@ -16552,7 +16560,7 @@ msgid "Index of the current layer. One-based (i.e. first layer is number 1)." msgstr "Index der aktuellen Schicht. Einsbasiert (d.h. die erste Schicht ist Nummer 1)." msgid "Layer Z" -msgstr "" +msgstr "Schichthöhe Z" msgid "Height of the current layer above the print bed, measured to the top of the layer." msgstr "Höhe der aktuellen Schicht über dem Druckbett, gemessen an der Oberseite der Schicht." @@ -16719,7 +16727,7 @@ msgid "Error desc" msgstr "Fehlerbeschreibung" msgid "Extra info" -msgstr "" +msgstr "Zusätzliche Informationen" msgid "Flow Dynamics" msgstr "Flussdynamik" @@ -17125,13 +17133,13 @@ msgid "Address" msgstr "IP Adresse" msgid "Hostname" -msgstr "" +msgstr "Hostname" msgid "Service name" -msgstr "" +msgstr "Dienstname" msgid "OctoPrint version" -msgstr "" +msgstr "OctoPrint-Version" msgid "Searching for devices" msgstr "Suche nach Geräten" @@ -17169,7 +17177,7 @@ msgid "PA Pattern" msgstr "PA Muster" msgid "Start PA: " -msgstr "" +msgstr "Start PA:" msgid "End PA: " msgstr "Ende PA:" @@ -17278,7 +17286,7 @@ msgstr "" "Ende > Start + Schritt" msgid "VFA test" -msgstr "" +msgstr "VFA-Test" msgid "Start speed: " msgstr "Startgeschwindigkeit" @@ -17326,7 +17334,7 @@ msgstr "" "Fixed-Time-Bewegung noch nicht implementiert." msgid "Klipper version => 0.9.0" -msgstr "" +msgstr "Klipper Version => 0.9.0" msgid "" "RepRap firmware version => 3.4.0\n" @@ -17405,7 +17413,7 @@ msgid "SCV-V2" msgstr "SCV-V2" msgid "Start: " -msgstr "" +msgstr "Start:" msgid "End: " msgstr "Ende: " @@ -17649,25 +17657,25 @@ msgid "Export Log" msgstr "Protokoll exportieren" msgid "OrcaSlicer Version:" -msgstr "" +msgstr "OrcaSlicer Version:" msgid "System Version:" -msgstr "" +msgstr "Systemversion:" msgid "DNS Server:" -msgstr "" +msgstr "DNS-Server:" msgid "Test OrcaSlicer (GitHub)" -msgstr "" +msgstr "OrcaSlicer testen (GitHub)" msgid "Test OrcaSlicer (GitHub):" -msgstr "" +msgstr "OrcaSlicer testen (GitHub):" msgid "Test bing.com" -msgstr "" +msgstr "Bing.com testen" msgid "Test bing.com:" -msgstr "" +msgstr "Bing.com testen:" msgid "Log Info" msgstr "Protokoll Info" @@ -18261,7 +18269,7 @@ msgid "To use a custom CA file, please import your CA file into Certificate Stor msgstr "Um eine benutzerdefinierte CA-Datei zu verwenden, importieren Sie bitte Ihre CA-Datei in den Zertifikatspeicher / das Schlüsselbund." msgid "Login/Test" -msgstr "" +msgstr "Anmelden/Testen" msgid "Connection to printers connected via the print host failed." msgstr "Die Verbindung zu den über den Druck-Host verbundenen Druckern ist fehlgeschlagen." @@ -18569,22 +18577,22 @@ msgid "Standard profile for 0.4mm nozzle, prioritizing speed." msgstr "Standardprofil für 0,4 mm Düse, das die Geschwindigkeit priorisiert." msgid "High quality profile for 0.6mm nozzle, prioritizing print quality and strength." -msgstr "" +msgstr "Hochwertiges Profil für 0,6 mm Düse, das Druckqualität und Festigkeit priorisiert." msgid "Strength profile for 0.6mm nozzle, prioritizing strength." -msgstr "" +msgstr "Festigkeitsprofil für 0,6 mm Düse, das die Festigkeit priorisiert." msgid "Standard profile for 0.6mm nozzle, prioritizing speed." -msgstr "" +msgstr "Standardprofil für 0,6 mm Düse, das die Geschwindigkeit priorisiert." msgid "High quality profile for 0.8mm nozzle, prioritizing print quality." -msgstr "" +msgstr "Hochwertiges Profil für 0,8 mm Düse, das die Druckqualität priorisiert." msgid "Strength profile for 0.8mm nozzle, prioritizing strength." -msgstr "" +msgstr "Festigkeitsprofil für 0,8 mm Düse, das die Festigkeit priorisiert." msgid "Standard profile for 0.8mm nozzle, prioritizing speed." -msgstr "" +msgstr "Standardprofil für 0,8 mm Düse, das die Geschwindigkeit priorisiert." msgid "No AMS" msgstr "Kein AMS" From 14cec7239b7372d866a94914ada89246119213a8 Mon Sep 17 00:00:00 2001 From: foXaCe Date: Tue, 23 Jun 2026 01:13:19 +0200 Subject: [PATCH 058/389] i18n(fr): translate strings added after the post-refactor sync (#14304) --- localization/i18n/fr/OrcaSlicer_fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/localization/i18n/fr/OrcaSlicer_fr.po b/localization/i18n/fr/OrcaSlicer_fr.po index c4398d231b..f32ee3c763 100644 --- a/localization/i18n/fr/OrcaSlicer_fr.po +++ b/localization/i18n/fr/OrcaSlicer_fr.po @@ -7990,13 +7990,13 @@ msgid "Renders cast shadows on the plate in realistic view." msgstr "Affiche les ombres portées sur la plaque dans la vue réaliste." msgid "Smooth normals" -msgstr "" +msgstr "Normales lissées" msgid "" "Applies smooth normals to the realistic view.\n" "\n" "Requires manual scene reload to take effect (right-click on 3D view → \"Reload All\")." -msgstr "" +msgstr "Applique les normales lissées à la vue réaliste.\n\nNécessite un rechargement manuel de la scène pour prendre effet (clic droit sur la vue 3D → « Tout recharger »)." msgid "Anti-aliasing" msgstr "Anticrénelage" @@ -12747,7 +12747,7 @@ msgid "Z-buckling bias optimization (experimental)" msgstr "Optimisation du biais de flambage en Z (expérimental)" # TODO: Review, changed by lang refactor. PR 14254 -#, fuzzy, c-format, boost-format +#, no-c-format, no-boost-format msgid "Tightens the gyroid wave along the Z (vertical) axis at low infill density to shorten the effective vertical column length and improve Z-axis compression buckling resistance. Filament use is preserved. No effect at ~30% sparse infill density and above. Only applies when Sparse infill pattern is set to Gyroid." msgstr "Resserre l’onde gyroïde le long de l’axe Z (vertical) à faible densité de remplissage afin de raccourcir la longueur effective des colonnes verticales et d’améliorer la résistance au flambage en compression selon l’axe Z. La consommation de filament est préservée. Aucun effet à partir d’environ 30 % de densité de remplissage. S’applique uniquement lorsque le motif de remplissage est réglé sur Gyroïde." @@ -12989,7 +12989,7 @@ msgid "Travel speed of the first layer." msgstr "Vitesse de déplacement de la couche initiale" msgid "Number of slow layers" -msgstr "" +msgstr "Nombre de couches lentes" msgid "The first few layers are printed slower than normal. The speed is gradually increased in a linear fashion over the specified number of layers." msgstr "Les premières couches sont imprimées plus lentement que la normale. La vitesse augmente progressivement de manière linéaire sur le nombre de couches spécifié." From 0cdfb88357012c698c55163d2cd651c90ce3ac87 Mon Sep 17 00:00:00 2001 From: Ian Bassi Date: Mon, 22 Jun 2026 20:16:55 -0300 Subject: [PATCH 059/389] Lang: Gettext update (#14361) --- localization/i18n/OrcaSlicer.pot | 8 +- localization/i18n/ca/OrcaSlicer_ca.po | 8 +- localization/i18n/cs/OrcaSlicer_cs.po | 8 +- localization/i18n/de/OrcaSlicer_de.po | 8 +- localization/i18n/en/OrcaSlicer_en.po | 8 +- localization/i18n/es/OrcaSlicer_es.po | 8 +- localization/i18n/fr/OrcaSlicer_fr.po | 15 +- localization/i18n/hu/OrcaSlicer_hu.po | 8 +- localization/i18n/it/OrcaSlicer_it.po | 8 +- localization/i18n/ja/OrcaSlicer_ja.po | 8 +- localization/i18n/ko/OrcaSlicer_ko.po | 8 +- localization/i18n/lt/OrcaSlicer_lt.po | 8 +- localization/i18n/nl/OrcaSlicer_nl.po | 8 +- localization/i18n/pl/OrcaSlicer_pl.po | 8 +- localization/i18n/pt_BR/OrcaSlicer_pt_BR.po | 20 +- localization/i18n/ru/OrcaSlicer_ru.po | 8 +- localization/i18n/sv/OrcaSlicer_sv.po | 8 +- localization/i18n/th/OrcaSlicer_th.po | 7772 +++++-------------- localization/i18n/tr/OrcaSlicer_tr.po | 8 +- localization/i18n/uk/OrcaSlicer_uk.po | 8 +- localization/i18n/vi/OrcaSlicer_vi.po | 8 +- localization/i18n/zh_CN/OrcaSlicer_zh_CN.po | 8 +- localization/i18n/zh_TW/OrcaSlicer_zh_TW.po | 8 +- 23 files changed, 2074 insertions(+), 5893 deletions(-) diff --git a/localization/i18n/OrcaSlicer.pot b/localization/i18n/OrcaSlicer.pot index 293252b8b9..83fd738661 100644 --- a/localization/i18n/OrcaSlicer.pot +++ b/localization/i18n/OrcaSlicer.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3883,6 +3883,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + msgid "" "Too small max volumetric speed.\n" "Value was reset to 0.5" @@ -10637,6 +10640,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "" +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "" diff --git a/localization/i18n/ca/OrcaSlicer_ca.po b/localization/i18n/ca/OrcaSlicer_ca.po index e0c2212590..9c86db6907 100644 --- a/localization/i18n/ca/OrcaSlicer_ca.po +++ b/localization/i18n/ca/OrcaSlicer_ca.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2025-03-15 10:55+0100\n" "Last-Translator: \n" "Language-Team: \n" @@ -4070,6 +4070,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "La temperatura recomanada del broquet d'aquest tipus de filament és de [%d, %d] graus Celsius." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11181,6 +11184,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "L'opció de paret precisa s'ignorarà per a les seqüències de parets exterior-interior o interior-exterior-interior." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "La contracció del filament no s'utilitzarà perquè la contracció del filament per als filaments utilitzats difereix significativament." diff --git a/localization/i18n/cs/OrcaSlicer_cs.po b/localization/i18n/cs/OrcaSlicer_cs.po index ea07285de3..ce5f2ebe3a 100644 --- a/localization/i18n/cs/OrcaSlicer_cs.po +++ b/localization/i18n/cs/OrcaSlicer_cs.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: \n" "Last-Translator: Jakub Hencl\n" "Language-Team: \n" @@ -4068,6 +4068,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "Doporučená teplota trysky pro tento typ filamentu je [%d, %d] stupňů Celsia." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11185,6 +11188,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "Možnost přesné stěny se ignoruje pro sekvence stěn vnější-vnitřní nebo vnitřní-vnější-vnitřní." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "Smrštění filamentu nebude použito, protože hodnoty smrštění použitých filamentů se neshodují." diff --git a/localization/i18n/de/OrcaSlicer_de.po b/localization/i18n/de/OrcaSlicer_de.po index 4a6ce9c11f..67defac5e4 100644 --- a/localization/i18n/de/OrcaSlicer_de.po +++ b/localization/i18n/de/OrcaSlicer_de.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: \n" "Last-Translator: Heiko Liebscher \n" "Language-Team: \n" @@ -4079,6 +4079,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "Die empfohlene Düsentemperatur für diesen Filamenttyp beträgt [%d, %d] °C." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11224,6 +11227,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "Die Option für präzise Wände wird für Außen-Innen- oder Innen-Außen-Innen-Wand-Sequenzen ignoriert." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "Filament-Schrumpfung wird nicht verwendet, da sich die Filament-Schrumpfung für die verwendeten Filamente signifikant unterscheidet." diff --git a/localization/i18n/en/OrcaSlicer_en.po b/localization/i18n/en/OrcaSlicer_en.po index 2202b8ea2f..cb5d1552ec 100644 --- a/localization/i18n/en/OrcaSlicer_en.po +++ b/localization/i18n/en/OrcaSlicer_en.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2026-06-17 15:44-0300\n" "Last-Translator: Alexandre Folle de Menezes\n" "Language-Team: \n" @@ -3879,6 +3879,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + msgid "" "Too small max volumetric speed.\n" "Value was reset to 0.5" @@ -10633,6 +10636,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "" +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "" diff --git a/localization/i18n/es/OrcaSlicer_es.po b/localization/i18n/es/OrcaSlicer_es.po index 9978b8a2b0..786e43696e 100644 --- a/localization/i18n/es/OrcaSlicer_es.po +++ b/localization/i18n/es/OrcaSlicer_es.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: \n" "Last-Translator: Ian A. Bassi <>\n" "Language-Team: \n" @@ -4077,6 +4077,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "La temperatura recomendada de la boquilla para este tipo de filamento es de [%d, %d] grados Celsius." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11213,6 +11216,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "La opción de pared precisa se ignorará para secuencias de paredes externo-interno o interno-externo-interno." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "La contracción del filamento no se utilizará porque la contracción del filamento para los filamentos utilizados difiere significativamente." diff --git a/localization/i18n/fr/OrcaSlicer_fr.po b/localization/i18n/fr/OrcaSlicer_fr.po index f32ee3c763..a67471e0d5 100644 --- a/localization/i18n/fr/OrcaSlicer_fr.po +++ b/localization/i18n/fr/OrcaSlicer_fr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: Guislain Cyril, Thomas Lété\n" @@ -3972,6 +3972,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "La température de buse recommandée pour ce type de filament est de [%d, %d] degrés Celsius." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + msgid "" "Too small max volumetric speed.\n" "Value was reset to 0.5" @@ -7996,7 +7999,10 @@ msgid "" "Applies smooth normals to the realistic view.\n" "\n" "Requires manual scene reload to take effect (right-click on 3D view → \"Reload All\")." -msgstr "Applique les normales lissées à la vue réaliste.\n\nNécessite un rechargement manuel de la scène pour prendre effet (clic droit sur la vue 3D → « Tout recharger »)." +msgstr "" +"Applique les normales lissées à la vue réaliste.\n" +"\n" +"Nécessite un rechargement manuel de la scène pour prendre effet (clic droit sur la vue 3D → « Tout recharger »)." msgid "Anti-aliasing" msgstr "Anticrénelage" @@ -10970,6 +10976,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "L'option de paroi précise sera ignorée pour les séquences de parois extérieure-intérieure ou intérieure-extérieure-intérieure." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "Le rétrécissement du filament ne sera pas utilisé car le rétrécissement des filaments utilisés ne correspond pas." @@ -12747,7 +12756,7 @@ msgid "Z-buckling bias optimization (experimental)" msgstr "Optimisation du biais de flambage en Z (expérimental)" # TODO: Review, changed by lang refactor. PR 14254 -#, no-c-format, no-boost-format +#, fuzzy, c-format, boost-format msgid "Tightens the gyroid wave along the Z (vertical) axis at low infill density to shorten the effective vertical column length and improve Z-axis compression buckling resistance. Filament use is preserved. No effect at ~30% sparse infill density and above. Only applies when Sparse infill pattern is set to Gyroid." msgstr "Resserre l’onde gyroïde le long de l’axe Z (vertical) à faible densité de remplissage afin de raccourcir la longueur effective des colonnes verticales et d’améliorer la résistance au flambage en compression selon l’axe Z. La consommation de filament est préservée. Aucun effet à partir d’environ 30 % de densité de remplissage. S’applique uniquement lorsque le motif de remplissage est réglé sur Gyroïde." diff --git a/localization/i18n/hu/OrcaSlicer_hu.po b/localization/i18n/hu/OrcaSlicer_hu.po index 490c3276a1..0142e6415f 100644 --- a/localization/i18n/hu/OrcaSlicer_hu.po +++ b/localization/i18n/hu/OrcaSlicer_hu.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "Language: hu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -4062,6 +4062,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "Az ajánlott fúvóka hőmérséklet ehhez a filament típushoz [%d, %d] Celsius-fok" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11196,6 +11199,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "A pontos fal opció figyelmen kívül lesz hagyva külső-belső vagy belső-külső-belső fali sorrend esetén." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "A filament zsugorodása nem lesz figyelembe véve, mert a használt filamentekhez megadott zsugorodási értékek nem egyeznek." diff --git a/localization/i18n/it/OrcaSlicer_it.po b/localization/i18n/it/OrcaSlicer_it.po index 0901abff53..d079a657bf 100644 --- a/localization/i18n/it/OrcaSlicer_it.po +++ b/localization/i18n/it/OrcaSlicer_it.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -4063,6 +4063,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "La temperatura dell'ugello consigliata per questo filamento è [%d, %d] gradi Celsius." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11178,6 +11181,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "L'opzione parete precisa verrà ignorata per le sequenze di pareti esterno-interno o interno-esterno-interno." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "La compensazione del restringimento del materiale non verrà utilizzata perché il fenomeno di restringimento nei filamenti utilizzati varia in modo significativo." diff --git a/localization/i18n/ja/OrcaSlicer_ja.po b/localization/i18n/ja/OrcaSlicer_ja.po index db9445db1e..55b1632470 100644 --- a/localization/i18n/ja/OrcaSlicer_ja.po +++ b/localization/i18n/ja/OrcaSlicer_ja.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -4045,6 +4045,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "このフィラメントで推奨ノズル温度は %d ~ %d ℃です。" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11096,6 +11099,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "正確な壁オプションは外側-内側または内側-外側-内側の壁シーケンスでは無視されます。" +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "使用するフィラメントの収縮率が大きく異なるため、フィラメント収縮率は使用しません。" diff --git a/localization/i18n/ko/OrcaSlicer_ko.po b/localization/i18n/ko/OrcaSlicer_ko.po index 5983d1293f..f24e29a07e 100644 --- a/localization/i18n/ko/OrcaSlicer_ko.po +++ b/localization/i18n/ko/OrcaSlicer_ko.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2025-06-02 17:12+0900\n" "Last-Translator: crwusiz \n" "Language-Team: \n" @@ -4060,6 +4060,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "이 필라멘트 유형의 권장 노즐 온도는 [%d, %d]°C입니다" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11140,6 +11143,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "" +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "" diff --git a/localization/i18n/lt/OrcaSlicer_lt.po b/localization/i18n/lt/OrcaSlicer_lt.po index 83f1c8d567..5148dd0776 100644 --- a/localization/i18n/lt/OrcaSlicer_lt.po +++ b/localization/i18n/lt/OrcaSlicer_lt.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2025-10-25 23:01+0300\n" "Last-Translator: Gintaras Kučinskas \n" "Language-Team: \n" @@ -4055,6 +4055,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "Rekomenduojama šio tipo gijos spausdinimo temperatūra yra nuo %d iki %d laipsnių Celsijaus." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11129,6 +11132,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "Tiksli sienos parinktis bus ignoruojama išorinės-vidinės arba vidinės-išorinės-vidinės sienų sekose." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "Gijų susitraukimas nenaudojamas, nes naudojamų gijų susitraukimas labai skiriasi." diff --git a/localization/i18n/nl/OrcaSlicer_nl.po b/localization/i18n/nl/OrcaSlicer_nl.po index 6fe4919539..ca4fcd689b 100644 --- a/localization/i18n/nl/OrcaSlicer_nl.po +++ b/localization/i18n/nl/OrcaSlicer_nl.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -4017,6 +4017,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "De aanbevolen mondstuk temperatuur voor dit type filament is [%d, %d] graden Celsius." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11025,6 +11028,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "" +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "" diff --git a/localization/i18n/pl/OrcaSlicer_pl.po b/localization/i18n/pl/OrcaSlicer_pl.po index 185e1f8626..bdcec97fd6 100644 --- a/localization/i18n/pl/OrcaSlicer_pl.po +++ b/localization/i18n/pl/OrcaSlicer_pl.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: OrcaSlicer 2.3.0-rc\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: \n" "Last-Translator: Krzysztof Morga <>\n" "Language-Team: \n" @@ -4065,6 +4065,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "Zalecana temperatura dyszy dla tego typu filamentu wynosi [%d, %d] stopni Celsjusza" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11155,6 +11158,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "" +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "Kompensacja skurczu filamentu nie będzie zastosowana, ponieważ skurcz używanych filamentów jest zbyt zróżnicowany." diff --git a/localization/i18n/pt_BR/OrcaSlicer_pt_BR.po b/localization/i18n/pt_BR/OrcaSlicer_pt_BR.po index d6e6bb514c..c31f1a3e95 100644 --- a/localization/i18n/pt_BR/OrcaSlicer_pt_BR.po +++ b/localization/i18n/pt_BR/OrcaSlicer_pt_BR.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-18 09:16-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2026-06-19 20:49-0300\n" "Last-Translator: Alexandre Folle de Menezes\n" "Language-Team: Portuguese, Brazilian\n" @@ -3995,6 +3995,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "A temperatura do bico recomendada para este tipo de filamento é [%d, %d] graus Celsius." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + msgid "" "Too small max volumetric speed.\n" "Value was reset to 0.5" @@ -11102,6 +11105,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "A opção de parede precisa será ignorada para sequências externa-interna ou interna-externa-interna." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "A contração de filamento não será usada porque a contração dos filamentos usados difere significativamente." @@ -13103,9 +13109,6 @@ msgstr "Velocidade de deslocamento da primeira camada." msgid "Number of slow layers" msgstr "" -msgid "This is the number of top interface layers." -msgstr "Este é o número de camadas de interface superiores." - msgid "The first few layers are printed slower than normal. The speed is gradually increased in a linear fashion over the specified number of layers." msgstr "As primeiras camadas são impressas mais lentamente do que o normal. A velocidade é aumentada gradualmente de forma linear sobre o número especificado de camadas." @@ -15122,6 +15125,9 @@ msgstr "" msgid "Top interface layers" msgstr "Camadas de interface superior" +msgid "This is the number of top interface layers." +msgstr "Este é o número de camadas de interface superiores." + msgid "Bottom interface layers" msgstr "Camadas de interface inferior" @@ -19208,7 +19214,8 @@ msgstr "" "Divida suas impressões em placas\n" "Você sabia que pode dividir um modelo que tem diversas peças em placas individuais distintas prontas para imprimir? Isso simplifica o processo de manter o controle de todas as peças." -#: resources/data/hints.ini: [hint:Speed up your print with Adaptive Layer Height] +#: resources/data/hints.ini: [hint:Speed up your print with Adaptive Layer +#: Height] msgid "" "Speed up your print with Adaptive Layer Height\n" "Did you know that you can print a model even faster by using the Adaptive Layer Height option? Check it out!" @@ -19280,7 +19287,8 @@ msgstr "" "Melhorar a resistência\n" "Você sabia que pode usar mais voltas de parede e maior densidade de preenchimento esparso mais alta para melhorar a resistência do modelo?" -#: resources/data/hints.ini: [hint:When do you need to print with the printer door opened] +#: resources/data/hints.ini: [hint:When do you need to print with the printer +#: door opened] msgid "" "When do you need to print with the printer door opened?\n" "Did you know that opening the printer door can reduce the probability of extruder/hotend clogging when printing lower temperature filament with a higher enclosure temperature? There is more info about this in the Wiki." diff --git a/localization/i18n/ru/OrcaSlicer_ru.po b/localization/i18n/ru/OrcaSlicer_ru.po index a853217c74..832f2332da 100644 --- a/localization/i18n/ru/OrcaSlicer_ru.po +++ b/localization/i18n/ru/OrcaSlicer_ru.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: OrcaSlicer V2.3.2 beta2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2026-02-25 13:38+0300\n" "Last-Translator: Felix14_v2\n" "Language-Team: Felix14_v2 (ДС/ТГ: @felix14_v2, почта: aleks111001@list.ru), Andylg \n" @@ -4176,6 +4176,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "Диапазон рекомендуемых температур печати данным типом материала составляет [%d, %d] градусов Цельсия." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11506,6 +11509,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "Параметр точной стенки будет проигнорирован для последовательностей стен «внешняя-внутренняя» или «внутренняя-внешняя-внутренняя»." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "Компенсация усадки материала не будет использоваться, поскольку усадка у используемых материалов не совпадает." diff --git a/localization/i18n/sv/OrcaSlicer_sv.po b/localization/i18n/sv/OrcaSlicer_sv.po index 2e514d04e9..e47b3e2816 100644 --- a/localization/i18n/sv/OrcaSlicer_sv.po +++ b/localization/i18n/sv/OrcaSlicer_sv.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -4007,6 +4007,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "Rekommenderad nozzel temperatur med denna filament typ är [%d, %d] grader celius" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11001,6 +11004,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "" +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "" diff --git a/localization/i18n/th/OrcaSlicer_th.po b/localization/i18n/th/OrcaSlicer_th.po index bbf14d80a1..62f825f1ae 100644 --- a/localization/i18n/th/OrcaSlicer_th.po +++ b/localization/i18n/th/OrcaSlicer_th.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2026-06-19 13:40+0700\n" "Last-Translator: Icezaza\n" "Language-Team: Thai\n" @@ -38,34 +38,20 @@ msgstr "AMS ไม่รองรับ TPU" msgid "AMS does not support 'Bambu Lab PET-CF'." msgstr "AMS ไม่รองรับ 'Bambu Lab PET-CF'" -msgid "" -"Please cold pull before printing TPU to avoid clogging. You may use cold " -"pull maintenance on the printer." -msgstr "" -"โปรดทำ cold pull ก่อนพิมพ์ TPU เพื่อหลีกเลี่ยงการอุดตัน คุณสามารถใช้การบำรุงรักษาแบบ cold " -"pull บนเครื่องพิมพ์ได้" +msgid "Please cold pull before printing TPU to avoid clogging. You may use cold pull maintenance on the printer." +msgstr "โปรดทำ cold pull ก่อนพิมพ์ TPU เพื่อหลีกเลี่ยงการอุดตัน คุณสามารถใช้การบำรุงรักษาแบบ cold pull บนเครื่องพิมพ์ได้" -msgid "" -"Damp PVA will become flexible and get stuck inside AMS, please take care to " -"dry it before use." +msgid "Damp PVA will become flexible and get stuck inside AMS, please take care to dry it before use." msgstr "PVA ที่ชื้นจะมีความยืดหยุ่นและอาจติดค้างใน AMS โปรดระวังและอบให้แห้งก่อนใช้งาน" msgid "Damp PVA is flexible and may get stuck in extruder. Dry it before use." msgstr "PVA ที่ชื้นมีความยืดหยุ่นและอาจติดค้างในชุดดันเส้น โปรดอบให้แห้งก่อนใช้งาน" -msgid "" -"The rough surface of PLA Glow can accelerate wear on the AMS system, " -"particularly on the internal components of the AMS Lite." -msgstr "" -"พื้นผิวที่ขรุขระของ PLA Glow สามารถเร่งการสึกหรอในระบบ AMS ได้ " -"โดยเฉพาะอย่างยิ่งกับชิ้นส่วนภายในของ AMS Lite" +msgid "The rough surface of PLA Glow can accelerate wear on the AMS system, particularly on the internal components of the AMS Lite." +msgstr "พื้นผิวที่ขรุขระของ PLA Glow สามารถเร่งการสึกหรอในระบบ AMS ได้ โดยเฉพาะอย่างยิ่งกับชิ้นส่วนภายในของ AMS Lite" -msgid "" -"CF/GF filaments are hard and brittle, it's easy to break or get stuck in " -"AMS, please use with caution." -msgstr "" -"เส้นพลาสติก CF/GF มีความแข็งและเปราะบาง แตกหักหรือติดค้างใน AMS ได้ง่าย " -"โปรดใช้งานด้วยความระมัดระวัง" +msgid "CF/GF filaments are hard and brittle, it's easy to break or get stuck in AMS, please use with caution." +msgstr "เส้นพลาสติก CF/GF มีความแข็งและเปราะบาง แตกหักหรือติดค้างใน AMS ได้ง่าย โปรดใช้งานด้วยความระมัดระวัง" msgid "PPS-CF is brittle and could break in bended PTFE tube above Toolhead." msgstr "PPS-CF มีความเปราะบางและอาจแตกหักในท่อ PTFE ที่โค้งงอเหนือหัวพิมพ์" @@ -208,12 +194,8 @@ msgid "Lay on Face" msgstr "วางบนหน้า" #, boost-format -msgid "" -"Filament count exceeds the maximum number that painting tool supports. Only " -"the first %1% filaments will be available in painting tool." -msgstr "" -"จำนวนเส้นพลาสติกเกินจำนวนสูงสุดที่เครื่องมือพ่นสีรองรับ เฉพาะเส้นพลาสติก %1% " -"แรกเท่านั้นที่จะสามารถใช้ได้ในเครื่องมือวาดภาพ" +msgid "Filament count exceeds the maximum number that painting tool supports. Only the first %1% filaments will be available in painting tool." +msgstr "จำนวนเส้นพลาสติกเกินจำนวนสูงสุดที่เครื่องมือพ่นสีรองรับ เฉพาะเส้นพลาสติก %1% แรกเท่านั้นที่จะสามารถใช้ได้ในเครื่องมือวาดภาพ" msgid "Color Painting" msgstr "ระบายสี" @@ -309,8 +291,7 @@ msgstr "ลบผิวฟัซซี" msgid "Reset selection" msgstr "รีเซ็ตการเลือก" -msgid "" -"Warning: Fuzzy skin is disabled, painted fuzzy skin will not take effect!" +msgid "Warning: Fuzzy skin is disabled, painted fuzzy skin will not take effect!" msgstr "คำเตือน: ผิวฟัซซีถูกปิดใช้งาน ผิวฟัซซีที่ทาสีจะไม่มีผล!" msgid "Enable painted fuzzy skin for this object" @@ -726,12 +707,8 @@ msgid "Decimate ratio" msgstr "อัตราการลดรายละเอียด" #, boost-format -msgid "" -"Processing model '%1%' with more than 1M triangles could be slow. It is " -"highly recommended to simplify the model." -msgstr "" -"การประมวลผลโมเดล '%1%' ที่มีรูปสามเหลี่ยมมากกว่า 1 ล้านรูปอาจช้า " -"ขอแนะนำอย่างยิ่งให้ทำให้โมเดลง่ายขึ้น" +msgid "Processing model '%1%' with more than 1M triangles could be slow. It is highly recommended to simplify the model." +msgstr "การประมวลผลโมเดล '%1%' ที่มีรูปสามเหลี่ยมมากกว่า 1 ล้านรูปอาจช้า ขอแนะนำอย่างยิ่งให้ทำให้โมเดลง่ายขึ้น" msgid "Simplify model" msgstr "ลดรายละเอียดโมเดล" @@ -894,9 +871,7 @@ msgstr "ขั้นสูง" msgid "Reset all options except the text and operation" msgstr "รีเซ็ตตัวเลือกทั้งหมด ยกเว้นข้อความและการดำเนินการ" -msgid "" -"The text cannot be written using the selected font. Please try choosing a " -"different font." +msgid "The text cannot be written using the selected font. Please try choosing a different font." msgstr "ไม่สามารถเขียนข้อความโดยใช้แบบอักษรที่เลือกได้ โปรดลองเลือกแบบอักษรอื่น" msgid "Embossed text cannot contain only white spaces." @@ -1178,12 +1153,8 @@ msgid "Font \"%1%\" can't be used. Please select another." msgstr "ไม่สามารถใช้แบบอักษร \"%1%\" ได้ โปรดเลือกรายการอื่น" #, boost-format -msgid "" -"Can't load exactly same font (\"%1%\"). Application selected a similar one " -"(\"%2%\"). You have to specify font for enable edit text." -msgstr "" -"ไม่สามารถโหลดแบบอักษรเดียวกันทุกประการ (\"%1%\") แอปพลิเคชันเลือกแอปพลิเคชันที่คล้ายกัน " -"(\"%2%\") คุณต้องระบุแบบอักษรเพื่อให้สามารถแก้ไขข้อความได้" +msgid "Can't load exactly same font (\"%1%\"). Application selected a similar one (\"%2%\"). You have to specify font for enable edit text." +msgstr "ไม่สามารถโหลดแบบอักษรเดียวกันทุกประการ (\"%1%\") แอปพลิเคชันเลือกแอปพลิเคชันที่คล้ายกัน (\"%2%\") คุณต้องระบุแบบอักษรเพื่อให้สามารถแก้ไขข้อความได้" msgid "No symbol" msgstr "ไม่มีสัญลักษณ์" @@ -1298,9 +1269,7 @@ msgstr "ประเภทจังหวะที่ไม่ได้กำห msgid "Path can't be healed from self-intersection and multiple points." msgstr "เส้นทางไม่สามารถรักษาได้จากทางแยกตัวเองและหลายจุด" -msgid "" -"Final shape contains self-intersection or multiple points with same " -"coordinate." +msgid "Final shape contains self-intersection or multiple points with same coordinate." msgstr "รูปร่างสุดท้ายมีจุดตัดกันเองหรือหลายจุดที่มีพิกัดเดียวกัน" #, boost-format @@ -1477,8 +1446,7 @@ msgstr "ยกเลิกคุณลักษณะจนกว่าจะอ msgid "Measure" msgstr "วัด" -msgid "" -"Please confirm explosion ratio = 1, and please select at least one object." +msgid "Please confirm explosion ratio = 1, and please select at least one object." msgstr "โปรดยืนยันอัตราส่วนการระเบิด = 1 และโปรดเลือกวัตถุอย่างน้อยหนึ่งชิ้น" msgid "Edit to scale" @@ -1648,13 +1616,11 @@ msgstr "เส้นพลาสติก" msgid "Machine" msgstr "เครื่อง" -msgid "" -"The configuration package was loaded, but some values were not recognized." +msgid "The configuration package was loaded, but some values were not recognized." msgstr "โหลดแพ็คเกจการกำหนดค่าแล้ว แต่ไม่รู้จักค่าบางค่า" #, boost-format -msgid "" -"The configuration file “%1%” was loaded, but some values were not recognized." +msgid "The configuration file “%1%” was loaded, but some values were not recognized." msgstr "โหลดไฟล์การกำหนดค่า \"%1%\" แล้ว แต่ระบบไม่รู้จักค่าบางค่า" msgid "Loading configuration" @@ -1708,22 +1674,14 @@ msgstr "ไฟล์ SLA ที่ปกปิด" msgid "Draco files" msgstr "ไฟล์เดรโก" -msgid "" -"OrcaSlicer will terminate because of running out of memory. It may be a bug. " -"It will be appreciated if you report the issue to our team." -msgstr "" -"OrcaSlicer จะยุติลงเนื่องจากหน่วยความจำไม่เพียงพอ มันอาจจะเป็นข้อผิดพลาด " -"เราจะยินดีเป็นอย่างยิ่งหากคุณรายงานปัญหาดังกล่าวให้ทีมงานของเราทราบ" +msgid "OrcaSlicer will terminate because of running out of memory. It may be a bug. It will be appreciated if you report the issue to our team." +msgstr "OrcaSlicer จะยุติลงเนื่องจากหน่วยความจำไม่เพียงพอ มันอาจจะเป็นข้อผิดพลาด เราจะยินดีเป็นอย่างยิ่งหากคุณรายงานปัญหาดังกล่าวให้ทีมงานของเราทราบ" msgid "Fatal error" msgstr "ข้อผิดพลาดร้ายแรง" -msgid "" -"OrcaSlicer will terminate because of a localization error. It will be " -"appreciated if you report the specific scenario this issue happened." -msgstr "" -"OrcaSlicer จะยุติลงเนื่องจากข้อผิดพลาดในการแปล " -"เราจะยินดีอย่างยิ่งหากคุณรายงานสถานการณ์เฉพาะที่ปัญหานี้เกิดขึ้น" +msgid "OrcaSlicer will terminate because of a localization error. It will be appreciated if you report the specific scenario this issue happened." +msgstr "OrcaSlicer จะยุติลงเนื่องจากข้อผิดพลาดในการแปล เราจะยินดีอย่างยิ่งหากคุณรายงานสถานการณ์เฉพาะที่ปัญหานี้เกิดขึ้น" msgid "Critical error" msgstr "ข้อผิดพลาดร้ายแรง" @@ -1755,8 +1713,7 @@ msgid "Connect %s failed! [SN:%s, code=%s]" msgstr "เชื่อมต่อ %s ล้มเหลว! [SN:%s, รหัส=%s]" msgid "" -"Orca Slicer requires the Microsoft WebView2 Runtime to operate certain " -"features.\n" +"Orca Slicer requires the Microsoft WebView2 Runtime to operate certain features.\n" "Click Yes to install it now." msgstr "" "Orca Slicer ต้องใช้ Microsoft WebView2 Runtime เพื่อใช้งานคุณสมบัติบางอย่าง\n" @@ -1808,8 +1765,7 @@ msgstr "กำลังแสดงหน้าต่างหลัก" msgid "" "The OrcaSlicer configuration file may be corrupted and cannot be parsed.\n" "OrcaSlicer has attempted to recreate the configuration file.\n" -"Please note, application settings will be lost, but printer profiles will " -"not be affected." +"Please note, application settings will be lost, but printer profiles will not be affected." msgstr "" "ไฟล์การกำหนดค่า OrcaSlicer อาจเสียหายและไม่สามารถแยกวิเคราะห์ได้\n" "OrcaSlicer พยายามสร้างไฟล์การกำหนดค่าใหม่\n" @@ -1845,19 +1801,13 @@ msgstr "ต่อ" msgid "Some presets are modified." msgstr "ค่าที่ตั้งล่วงหน้าบางส่วนได้รับการแก้ไข" -msgid "" -"You can keep the modified presets for the new project, discard, or save " -"changes as new presets." -msgstr "" -"คุณสามารถเก็บค่าที่ตั้งล่วงหน้าที่แก้ไขแล้วไว้ในโปรเจ็กต์ใหม่ " -"ทิ้งหรือบันทึกการเปลี่ยนแปลงเป็นค่าที่ตั้งล่วงหน้าใหม่ได้" +msgid "You can keep the modified presets for the new project, discard, or save changes as new presets." +msgstr "คุณสามารถเก็บค่าที่ตั้งล่วงหน้าที่แก้ไขแล้วไว้ในโปรเจ็กต์ใหม่ ทิ้งหรือบันทึกการเปลี่ยนแปลงเป็นค่าที่ตั้งล่วงหน้าใหม่ได้" msgid "User logged out" msgstr "ผู้ใช้ออกจากระบบ" -msgid "" -"You are currently in Stealth Mode. To log into the Cloud, you need to " -"disable Stealth Mode first." +msgid "You are currently in Stealth Mode. To log into the Cloud, you need to disable Stealth Mode first." msgstr "คุณอยู่ในโหมดซ่อนตัวอยู่ หากต้องการเข้าสู่ระบบ Cloud ให้ปิดโหมดซ่อนตัวก่อน" msgid "Stealth Mode" @@ -1872,43 +1822,33 @@ msgstr "ไม่อนุญาตให้ใช้ไฟล์โครงก msgid "Open Project" msgstr "เปิดโปรเจกต์" -msgid "" -"The version of Orca Slicer is too low and needs to be updated to the latest " -"version before it can be used normally." -msgstr "" -"Orca Slicer " -"เวอร์ชันต่ำเกินไปและจำเป็นต้องอัปเดตเป็นเวอร์ชันล่าสุดก่อนจึงจะสามารถใช้งานได้ตามปกติ" +msgid "The version of Orca Slicer is too low and needs to be updated to the latest version before it can be used normally." +msgstr "Orca Slicer เวอร์ชันต่ำเกินไปและจำเป็นต้องอัปเดตเป็นเวอร์ชันล่าสุดก่อนจึงจะสามารถใช้งานได้ตามปกติ" msgid "" "Cloud sync conflict: this preset has a newer version in OrcaCloud.\n" -"Pull downloads the cloud copy. Force push overwrites it with your local " -"preset." +"Pull downloads the cloud copy. Force push overwrites it with your local preset." msgstr "" "ความขัดแย้งในการซิงก์ Cloud: ค่าที่ตั้งไว้ล่วงหน้านี้มีเวอร์ชันใหม่กว่าใน Orca Cloud\n" "ดึงข้อมูลจะดาวน์โหลดสำเนาจากคลาวด์ บังคับส่งจะเขียนทับด้วยค่าที่ตั้งไว้ล่วงหน้าในเครื่องของคุณ" msgid "" "Cloud sync conflict: a preset with this name already exists in OrcaCloud.\n" -"Pull downloads the cloud copy. Force push overwrites it with your local " -"preset." +"Pull downloads the cloud copy. Force push overwrites it with your local preset." msgstr "" "ความขัดแย้งในการซิงก์ Cloud: มีค่าที่ตั้งไว้ล่วงหน้าชื่อนี้อยู่ใน Orca Cloud แล้ว\n" "ดึงข้อมูลจะดาวน์โหลดสำเนาจากคลาวด์ บังคับส่งจะเขียนทับด้วยค่าที่ตั้งไว้ล่วงหน้าในเครื่องของคุณ" msgid "" -"Cloud sync conflict: a preset with the same name was previously deleted from " -"the cloud.\n" -"Delete will delete your local preset. Force push overwrites it with your " -"local preset." +"Cloud sync conflict: a preset with the same name was previously deleted from the cloud.\n" +"Delete will delete your local preset. Force push overwrites it with your local preset." msgstr "" "ความขัดแย้งในการซิงก์ Cloud: ค่าที่ตั้งไว้ล่วงหน้าชื่อเดียวกันเคยถูกลบจากคลาวด์แล้ว\n" "ลบจะลบค่าที่ตั้งไว้ล่วงหน้าในเครื่องของคุณ บังคับส่งจะเขียนทับด้วยค่าที่ตั้งไว้ล่วงหน้าในเครื่องของคุณ" msgid "" -"Cloud sync conflict: there was an unexpected or unidentified preset " -"conflict.\n" -"Pull downloads the cloud copy. Force push overwrites it with your local " -"preset." +"Cloud sync conflict: there was an unexpected or unidentified preset conflict.\n" +"Pull downloads the cloud copy. Force push overwrites it with your local preset." msgstr "" "ความขัดแย้งในการซิงก์ Cloud: พบความขัดแย้งของค่าที่ตั้งไว้ล่วงหน้าที่ไม่คาดคิดหรือระบุไม่ได้\n" "ดึงข้อมูลจะดาวน์โหลดสำเนาจากคลาวด์ บังคับส่งจะเขียนทับด้วยค่าที่ตั้งไว้ล่วงหน้าในเครื่องของคุณ" @@ -1929,43 +1869,31 @@ msgstr "กำลังดึงข้อมูลเครื่องพิม msgid "Please try updating OrcaSlicer and then try again." msgstr "โปรดลองอัปเดต OrcaSlicer แล้วลองอีกครั้ง" -msgid "" -"The certificate has expired. Please check the time settings or update " -"OrcaSlicer and try again." +msgid "The certificate has expired. Please check the time settings or update OrcaSlicer and try again." msgstr "ใบรับรองหมดอายุแล้ว โปรดตรวจสอบการตั้งค่าเวลาหรืออัปเดต OrcaSlicer แล้วลองอีกครั้ง" -msgid "" -"The certificate is no longer valid and the printing functions are " -"unavailable." +msgid "The certificate is no longer valid and the printing functions are unavailable." msgstr "ใบรับรองไม่ถูกต้องอีกต่อไป และฟังก์ชันการพิมพ์ไม่พร้อมใช้งาน" -msgid "" -"Internal error. Please try upgrading the firmware and OrcaSlicer version. If " -"the issue persists, contact support." -msgstr "" -"ข้อผิดพลาดภายใน โปรดลองอัปเกรดเฟิร์มแวร์และเวอร์ชัน OrcaSlicer หากปัญหายังคงอยู่ " -"โปรดติดต่อฝ่ายสนับสนุน" +msgid "Internal error. Please try upgrading the firmware and OrcaSlicer version. If the issue persists, contact support." +msgstr "ข้อผิดพลาดภายใน โปรดลองอัปเกรดเฟิร์มแวร์และเวอร์ชัน OrcaSlicer หากปัญหายังคงอยู่ โปรดติดต่อฝ่ายสนับสนุน" msgid "" -"To use OrcaSlicer with Bambu Lab printers, you need to enable LAN mode and " -"Developer mode on your printer.\n" +"To use OrcaSlicer with Bambu Lab printers, you need to enable LAN mode and Developer mode on your printer.\n" "\n" "Please go to your printer's settings and:\n" "1. Turn on LAN mode\n" "2. Enable Developer mode\n" "\n" -"Developer mode allows the printer to work exclusively through local network " -"access, enabling full functionality with OrcaSlicer." +"Developer mode allows the printer to work exclusively through local network access, enabling full functionality with OrcaSlicer." msgstr "" -"หากต้องการใช้ OrcaSlicer กับเครื่องพิมพ์ Bambu Lab คุณต้องเปิดใช้งานโหมด LAN " -"และโหมดนักพัฒนาซอฟต์แวร์บนเครื่องพิมพ์ของคุณ\n" +"หากต้องการใช้ OrcaSlicer กับเครื่องพิมพ์ Bambu Lab คุณต้องเปิดใช้งานโหมด LAN และโหมดนักพัฒนาซอฟต์แวร์บนเครื่องพิมพ์ของคุณ\n" "\n" "โปรดไปที่การตั้งค่าเครื่องพิมพ์ของคุณและ:\n" "1. เปิดโหมด LAN\n" "2. เปิดใช้งานโหมดนักพัฒนาซอฟต์แวร์\n" "\n" -"โหมดนักพัฒนาซอฟต์แวร์ช่วยให้เครื่องพิมพ์ทำงานผ่านการเข้าถึงเครือข่ายท้องถิ่นโดยเฉพาะ " -"เปิดใช้งานฟังก์ชันการทำงานเต็มรูปแบบด้วย OrcaSlicer" +"โหมดนักพัฒนาซอฟต์แวร์ช่วยให้เครื่องพิมพ์ทำงานผ่านการเข้าถึงเครือข่ายท้องถิ่นโดยเฉพาะ เปิดใช้งานฟังก์ชันการทำงานเต็มรูปแบบด้วย OrcaSlicer" msgid "Network Plug-in Restriction" msgstr "ข้อจำกัดปลั๊กอินเครือข่าย" @@ -2005,23 +1933,14 @@ msgstr "" "ไม่สามารถย้ายค่าที่ตั้งล่วงหน้าของผู้ใช้:\n" "%s" -msgid "" -"The number of user presets cached in the cloud has exceeded the upper limit, " -"newly created user presets can only be used locally." -msgstr "" -"จำนวนค่าที่ตั้งไว้ล่วงหน้าของผู้ใช้ที่แคชไว้ในคลาวด์เกินขีดจำกัดสูงสุด " -"ค่าที่ตั้งไว้ล่วงหน้าของผู้ใช้ที่สร้างขึ้นใหม่สามารถใช้ได้เฉพาะในเครื่องเท่านั้น" +msgid "The number of user presets cached in the cloud has exceeded the upper limit, newly created user presets can only be used locally." +msgstr "จำนวนค่าที่ตั้งไว้ล่วงหน้าของผู้ใช้ที่แคชไว้ในคลาวด์เกินขีดจำกัดสูงสุด ค่าที่ตั้งไว้ล่วงหน้าของผู้ใช้ที่สร้างขึ้นใหม่สามารถใช้ได้เฉพาะในเครื่องเท่านั้น" msgid "Sync user presets" msgstr "ซิงค์การตั้งค่าล่วงหน้าของผู้ใช้" -msgid "" -"The preset content is too large to sync to the cloud (exceeds 1MB). Please " -"reduce the preset size by removing custom configurations or use it locally " -"only." -msgstr "" -"เนื้อหาที่ตั้งไว้ล่วงหน้ามีขนาดใหญ่เกินกว่าจะซิงค์กับระบบคลาวด์ (เกิน 1MB) " -"โปรดลดขนาดที่กำหนดไว้ล่วงหน้าโดยการลบการกำหนดค่าที่กำหนดเองออกหรือใช้เฉพาะในเครื่องเท่านั้น" +msgid "The preset content is too large to sync to the cloud (exceeds 1MB). Please reduce the preset size by removing custom configurations or use it locally only." +msgstr "เนื้อหาที่ตั้งไว้ล่วงหน้ามีขนาดใหญ่เกินกว่าจะซิงค์กับระบบคลาวด์ (เกิน 1MB) โปรดลดขนาดที่กำหนดไว้ล่วงหน้าโดยการลบการกำหนดค่าที่กำหนดเองออกหรือใช้เฉพาะในเครื่องเท่านั้น" #, c-format, boost-format msgid "%s updated from %s to %s" @@ -2073,12 +1992,8 @@ msgstr "การอัปโหลดอย่างต่อเนื่อง msgid "Select a G-code file:" msgstr "เลือกไฟล์ G-code:" -msgid "" -"Could not start URL download. Destination folder is not set. Please choose " -"destination folder in Configuration Wizard." -msgstr "" -"ไม่สามารถเริ่มการดาวน์โหลด URL ไม่ได้ตั้งค่าโฟลเดอร์ปลายทาง " -"โปรดเลือกโฟลเดอร์ปลายทางในตัวช่วยสร้างการกำหนดค่า" +msgid "Could not start URL download. Destination folder is not set. Please choose destination folder in Configuration Wizard." +msgstr "ไม่สามารถเริ่มการดาวน์โหลด URL ไม่ได้ตั้งค่าโฟลเดอร์ปลายทาง โปรดเลือกโฟลเดอร์ปลายทางในตัวช่วยสร้างการกำหนดค่า" msgid "Import File" msgstr "นำเข้าไฟล์" @@ -2256,15 +2171,11 @@ msgid "Orca String Hell" msgstr "ออร์ก้าสตริงนรก" msgid "" -"This model features text embossment on the top surface. For optimal results, " -"it is advisable to set the 'One Wall Threshold (min_width_top_surface)' to 0 " -"for the 'Only One Wall on Top Surfaces' to work best.\n" +"This model features text embossment on the top surface. For optimal results, it is advisable to set the 'One Wall Threshold (min_width_top_surface)' to 0 for the 'Only One Wall on Top Surfaces' to work best.\n" "Yes - Change these settings automatically\n" "No - Do not change these settings for me" msgstr "" -"รุ่นนี้มีข้อความนูนบนพื้นผิวด้านบน เพื่อให้ได้ผลลัพธ์ที่ดีที่สุด ขอแนะนำให้ตั้งค่า 'เกณฑ์ผนังด้านเดียว " -"(min_width_top_surface)' เป็น 0 เพื่อให้ 'ผนังด้านเดียวเท่านั้นบนพื้นผิวด้านบน' " -"เพื่อให้ทำงานได้ดีที่สุด\n" +"รุ่นนี้มีข้อความนูนบนพื้นผิวด้านบน เพื่อให้ได้ผลลัพธ์ที่ดีที่สุด ขอแนะนำให้ตั้งค่า 'เกณฑ์ผนังด้านเดียว (min_width_top_surface)' เป็น 0 เพื่อให้ 'ผนังด้านเดียวเท่านั้นบนพื้นผิวด้านบน' เพื่อให้ทำงานได้ดีที่สุด\n" "ใช่ - เปลี่ยนการตั้งค่าเหล่านี้โดยอัตโนมัติ\n" "ไม่ - อย่าเปลี่ยนการตั้งค่าเหล่านี้ให้ฉัน" @@ -2668,9 +2579,7 @@ msgstr "ทั่วไป" msgid "Switch to per-object setting mode to edit modifier settings." msgstr "สลับไปที่โหมดการตั้งค่าต่อวัตถุเพื่อแก้ไขการตั้งค่าตัวแก้ไข" -msgid "" -"Switch to per-object setting mode to edit process settings of selected " -"objects." +msgid "Switch to per-object setting mode to edit process settings of selected objects." msgstr "สลับไปที่โหมดการตั้งค่าต่ออ็อบเจ็กต์เพื่อแก้ไขการตั้งค่ากระบวนการของอ็อบเจ็กต์ที่เลือก" msgid "Remove paint-on fuzzy skin" @@ -2685,17 +2594,14 @@ msgstr "ลบส่วนที่เป็นของแข็งออกจ msgid "Delete negative volume from object which is a part of cut" msgstr "ลบปริมาตรเชิงลบออกจากวัตถุซึ่งเป็นส่วนหนึ่งของการตัด" -msgid "" -"To save cut correspondence you can delete all connectors from all related " -"objects." +msgid "To save cut correspondence you can delete all connectors from all related objects." msgstr "หากต้องการบันทึกการติดต่อตัด คุณสามารถลบตัวเชื่อมต่อทั้งหมดออกจากวัตถุที่เกี่ยวข้องทั้งหมดได้" msgid "" "This action will break a cut correspondence.\n" "After that, model consistency can't be guaranteed.\n" "\n" -"To manipulate with solid parts or negative volumes you have to invalidate " -"cut information first." +"To manipulate with solid parts or negative volumes you have to invalidate cut information first." msgstr "" "การกระทำนี้จะตัดความเชื่อมโยงของข้อมูลการตัด\n" "หลังจากนั้นจะไม่สามารถรับประกันความสอดคล้องของโมเดลได้\n" @@ -2750,13 +2656,10 @@ msgstr "เลเยอร์" msgid "Selection conflicts" msgstr "ข้อขัดแย้งในการคัดเลือก" -msgid "" -"If the first selected item is an object, the second should also be an object." +msgid "If the first selected item is an object, the second should also be an object." msgstr "หากรายการแรกที่เลือกเป็นวัตถุ รายการที่สองก็ควรเป็นวัตถุด้วย" -msgid "" -"If the first selected item is a part, the second should be a part in the " -"same object." +msgid "If the first selected item is a part, the second should be a part in the same object." msgstr "หากรายการแรกที่เลือกเป็นส่วนหนึ่ง รายการที่สองควรเป็นส่วนในวัตถุเดียวกัน" msgid "The type of the last solid object part cannot be changed." @@ -2786,12 +2689,8 @@ msgid "Repairing was canceled" msgstr "การซ่อมแซมถูกยกเลิก" #, c-format, boost-format -msgid "" -"\"%s\" will exceed 1 million faces after this subdivision, which may " -"increase slicing time. Do you want to continue?" -msgstr "" -"\"%s\" จะมีเกิน 1 ล้านผิวหน้าหลังจากการแบ่งย่อยนี้ ซึ่งอาจเพิ่มเวลาการแบ่งส่วน " -"คุณต้องการดำเนินการต่อหรือไม่?" +msgid "\"%s\" will exceed 1 million faces after this subdivision, which may increase slicing time. Do you want to continue?" +msgstr "\"%s\" จะมีเกิน 1 ล้านผิวหน้าหลังจากการแบ่งย่อยนี้ ซึ่งอาจเพิ่มเวลาการแบ่งส่วน คุณต้องการดำเนินการต่อหรือไม่?" #, c-format, boost-format msgid "\"%s\" part's mesh contains errors. Please repair it first." @@ -3005,23 +2904,14 @@ msgstr "โหลด" msgid "Unload" msgstr "ถอนเส้น" -msgid "" -"Choose an AMS slot then press \"Load\" or \"Unload\" button to automatically " -"load or unload filament." -msgstr "" -"เลือกช่อง AMS แล้วกดปุ่ม \"โหลด\" หรือ \"ถอนเส้น\" เพื่อโหลดหรือถอนเส้นพลาสติกโดยอัตโนมัติ" +msgid "Choose an AMS slot then press \"Load\" or \"Unload\" button to automatically load or unload filament." +msgstr "เลือกช่อง AMS แล้วกดปุ่ม \"โหลด\" หรือ \"ถอนเส้น\" เพื่อโหลดหรือถอนเส้นพลาสติกโดยอัตโนมัติ" -msgid "" -"Filament type is unknown which is required to perform this action. Please " -"set target filament's informations." -msgstr "" -"ไม่ทราบประเภทเส้นพลาสติกซึ่งจำเป็นต่อการดำเนินการนี้ กรุณาตั้งค่าข้อมูลของเส้นพลาสติกเป้าหมาย" +msgid "Filament type is unknown which is required to perform this action. Please set target filament's informations." +msgstr "ไม่ทราบประเภทเส้นพลาสติกซึ่งจำเป็นต่อการดำเนินการนี้ กรุณาตั้งค่าข้อมูลของเส้นพลาสติกเป้าหมาย" -msgid "" -"Changing fan speed during printing may affect print quality, please choose " -"carefully." -msgstr "" -"การเปลี่ยนความเร็วพัดลมระหว่างการพิมพ์อาจส่งผลต่อคุณภาพการพิมพ์ โปรดเลือกอย่างระมัดระวัง" +msgid "Changing fan speed during printing may affect print quality, please choose carefully." +msgstr "การเปลี่ยนความเร็วพัดลมระหว่างการพิมพ์อาจส่งผลต่อคุณภาพการพิมพ์ โปรดเลือกอย่างระมัดระวัง" msgid "Change Anyway" msgstr "เปลี่ยนยังไงก็ได้" @@ -3032,25 +2922,14 @@ msgstr "ปิด" msgid "Filter" msgstr "กรอง" -msgid "" -"Enabling filtration redirects the right fan to filter gas, which may reduce " -"cooling performance." -msgstr "" -"การเปิดใช้งานการกรองจะเปลี่ยนเส้นทางพัดลมที่เหมาะสมไปกรองก๊าซ " -"ซึ่งอาจลดประสิทธิภาพการทำความเย็น" +msgid "Enabling filtration redirects the right fan to filter gas, which may reduce cooling performance." +msgstr "การเปิดใช้งานการกรองจะเปลี่ยนเส้นทางพัดลมที่เหมาะสมไปกรองก๊าซ ซึ่งอาจลดประสิทธิภาพการทำความเย็น" -msgid "" -"Enabling filtration during printing may reduce cooling and affect print " -"quality. Please choose carefully." -msgstr "" -"การเปิดใช้งานการกรองระหว่างการพิมพ์อาจลดความเย็นและส่งผลต่อคุณภาพการพิมพ์ " -"โปรดเลือกอย่างระมัดระวัง" +msgid "Enabling filtration during printing may reduce cooling and affect print quality. Please choose carefully." +msgstr "การเปิดใช้งานการกรองระหว่างการพิมพ์อาจลดความเย็นและส่งผลต่อคุณภาพการพิมพ์ โปรดเลือกอย่างระมัดระวัง" -msgid "" -"The selected material only supports the current fan mode, and it can't be " -"changed during printing." -msgstr "" -"วัสดุที่เลือกรองรับเฉพาะโหมดพัดลมปัจจุบันเท่านั้น และไม่สามารถเปลี่ยนแปลงได้ในระหว่างการพิมพ์" +msgid "The selected material only supports the current fan mode, and it can't be changed during printing." +msgstr "วัสดุที่เลือกรองรับเฉพาะโหมดพัดลมปัจจุบันเท่านั้น และไม่สามารถเปลี่ยนแปลงได้ในระหว่างการพิมพ์" msgid "Cooling" msgstr "การระบายความร้อน" @@ -3077,31 +2956,17 @@ msgstr "อินเนอร์ลูป" msgid "Top" msgstr "บน" -msgid "" -"The fan controls the temperature during printing to improve print quality. " -"The system automatically adjusts the fan's switch and speed according to " -"different printing materials." -msgstr "" -"พัดลมจะควบคุมอุณหภูมิระหว่างการพิมพ์เพื่อปรับปรุงคุณภาพการพิมพ์ " -"ระบบจะปรับสวิตช์และความเร็วของพัดลมโดยอัตโนมัติตามวัสดุการพิมพ์ที่แตกต่างกัน" +msgid "The fan controls the temperature during printing to improve print quality. The system automatically adjusts the fan's switch and speed according to different printing materials." +msgstr "พัดลมจะควบคุมอุณหภูมิระหว่างการพิมพ์เพื่อปรับปรุงคุณภาพการพิมพ์ ระบบจะปรับสวิตช์และความเร็วของพัดลมโดยอัตโนมัติตามวัสดุการพิมพ์ที่แตกต่างกัน" -msgid "" -"Cooling mode is suitable for printing PLA/PETG/TPU materials and filters the " -"chamber air." +msgid "Cooling mode is suitable for printing PLA/PETG/TPU materials and filters the chamber air." msgstr "โหมดทำความเย็นเหมาะสำหรับการพิมพ์วัสดุ PLA/PETG/TPU และกรองอากาศในห้อง" -msgid "" -"Heating mode is suitable for printing ABS/ASA/PC/PA materials and circulates " -"filters the chamber air." -msgstr "" -"โหมดทำความร้อนเหมาะสำหรับการพิมพ์วัสดุ ABS/ASA/PC/PA และหมุนเวียนตัวกรองอากาศในห้อง" +msgid "Heating mode is suitable for printing ABS/ASA/PC/PA materials and circulates filters the chamber air." +msgstr "โหมดทำความร้อนเหมาะสำหรับการพิมพ์วัสดุ ABS/ASA/PC/PA และหมุนเวียนตัวกรองอากาศในห้อง" -msgid "" -"Strong cooling mode is suitable for printing PLA/TPU materials. In this " -"mode, the printouts will be fully cooled." -msgstr "" -"โหมดระบายความร้อนสูงเหมาะสำหรับการพิมพ์วัสดุ PLA/TPU ในโหมดนี้ " -"งานพิมพ์จะถูกระบายความร้อนเต็มที่" +msgid "Strong cooling mode is suitable for printing PLA/TPU materials. In this mode, the printouts will be fully cooled." +msgstr "โหมดระบายความร้อนสูงเหมาะสำหรับการพิมพ์วัสดุ PLA/TPU ในโหมดนี้ งานพิมพ์จะถูกระบายความร้อนเต็มที่" msgid "Cooling mode is suitable for printing PLA/PETG/TPU materials." msgstr "โหมดทำความเย็นเหมาะสำหรับการพิมพ์วัสดุ PLA/PETG/TPU" @@ -3243,22 +3108,18 @@ msgstr "การจัด" msgid "Arranging canceled." msgstr "ยกเลิกการจัดเตรียมแล้ว" -msgid "" -"Arranging complete, but some items were not able to be arranged. Reduce " -"spacing and try again." +msgid "Arranging complete, but some items were not able to be arranged. Reduce spacing and try again." msgstr "จัดเรียงเสร็จแล้ว แต่มีบางรายการที่จัดวางไม่ได้ โปรดลดระยะห่างแล้วลองอีกครั้ง" msgid "Arranging done." msgstr "จัดการเรียบร้อยแล้ว." -msgid "" -"Arrange failed. Found some exceptions when processing object geometries." +msgid "Arrange failed. Found some exceptions when processing object geometries." msgstr "การจัดเรียงล้มเหลว พบข้อยกเว้นบางประการเมื่อประมวลผลรูปทรงของวัตถุ" #, c-format, boost-format msgid "" -"Arrangement ignored the following objects which can't fit into a single " -"bed:\n" +"Arrangement ignored the following objects which can't fit into a single bed:\n" "%s" msgstr "" "การจัดวางจะละเลยวัตถุต่อไปนี้ซึ่งไม่สามารถบรรจุลงในฐานพิมพ์เดี่ยวได้:\n" @@ -3329,9 +3190,7 @@ msgstr "การเชื่อมต่อบริการคลาวด์ msgid "Print file not found; please slice again." msgstr "ไม่พบไฟล์พิมพ์ โปรดสไลซ์อีกครั้ง" -msgid "" -"The print file exceeds the maximum allowable size (1GB). Please simplify the " -"model and slice again." +msgid "The print file exceeds the maximum allowable size (1GB). Please simplify the model and slice again." msgstr "ไฟล์พิมพ์เกินขนาดสูงสุดที่อนุญาต (1GB) โปรดทำให้โมเดลง่ายขึ้นและแบ่งส่วนอีกครั้ง" msgid "Failed to send the print job. Please try again." @@ -3340,22 +3199,16 @@ msgstr "ไม่สามารถส่งงานพิมพ์ได้ msgid "Failed to upload file to ftp. Please try again." msgstr "ไม่สามารถอัปโหลดไฟล์ไปยัง ftp โปรดลองอีกครั้ง" -msgid "" -"Check the current status of the Bambu Lab server by clicking on the link " -"above." +msgid "Check the current status of the Bambu Lab server by clicking on the link above." msgstr "ตรวจสอบสถานะปัจจุบันของเซิร์ฟเวอร์ Bambu Lab โดยคลิกลิงก์ด้านบน" -msgid "" -"The size of the print file is too large. Please adjust the file size and try " -"again." +msgid "The size of the print file is too large. Please adjust the file size and try again." msgstr "ขนาดของไฟล์การพิมพ์ใหญ่เกินไป โปรดปรับขนาดไฟล์แล้วลองอีกครั้ง" msgid "Print file not found; please slice it again and send it for printing." msgstr "ไม่พบไฟล์พิมพ์ โปรดสไลซ์อีกครั้งและส่งไปพิมพ์" -msgid "" -"Failed to upload print file via FTP. Please check the network status and try " -"again." +msgid "Failed to upload print file via FTP. Please check the network status and try again." msgstr "อัปโหลดไฟล์พิมพ์ผ่าน FTP ไม่สำเร็จ โปรดตรวจสอบสถานะเครือข่ายแล้วลองอีกครั้ง" msgid "Sending print job over LAN" @@ -3391,24 +3244,14 @@ msgstr "รหัสเข้าถึง:%s ที่อยู่ IP:%s" msgid "A Storage needs to be inserted before printing via LAN." msgstr "ต้องใส่ที่เก็บข้อมูลก่อนที่จะพิมพ์ผ่าน LAN" -msgid "" -"Sending print job over LAN, but the Storage in the printer is abnormal and " -"print-issues may be caused by this." -msgstr "" -"การส่งงานพิมพ์ผ่าน LAN แต่ที่เก็บข้อมูลในเครื่องพิมพ์ผิดปกติและปัญหาการพิมพ์อาจมีสาเหตุจากสิ่งนี้" +msgid "Sending print job over LAN, but the Storage in the printer is abnormal and print-issues may be caused by this." +msgstr "การส่งงานพิมพ์ผ่าน LAN แต่ที่เก็บข้อมูลในเครื่องพิมพ์ผิดปกติและปัญหาการพิมพ์อาจมีสาเหตุจากสิ่งนี้" -msgid "" -"The Storage in the printer is abnormal. Please replace it with a normal " -"Storage before sending print job to printer." -msgstr "" -"พื้นที่จัดเก็บข้อมูลในเครื่องพิมพ์ผิดปกติ โปรดแทนที่ด้วยที่เก็บข้อมูลปกติก่อนที่จะส่งงานพิมพ์ไปยังเครื่องพิมพ์" +msgid "The Storage in the printer is abnormal. Please replace it with a normal Storage before sending print job to printer." +msgstr "พื้นที่จัดเก็บข้อมูลในเครื่องพิมพ์ผิดปกติ โปรดแทนที่ด้วยที่เก็บข้อมูลปกติก่อนที่จะส่งงานพิมพ์ไปยังเครื่องพิมพ์" -msgid "" -"The Storage in the printer is read-only. Please replace it with a normal " -"Storage before sending print job to printer." -msgstr "" -"ที่เก็บข้อมูลในเครื่องพิมพ์เป็นแบบอ่านอย่างเดียว " -"โปรดแทนที่ด้วยที่เก็บข้อมูลปกติก่อนที่จะส่งงานพิมพ์ไปยังเครื่องพิมพ์" +msgid "The Storage in the printer is read-only. Please replace it with a normal Storage before sending print job to printer." +msgstr "ที่เก็บข้อมูลในเครื่องพิมพ์เป็นแบบอ่านอย่างเดียว โปรดแทนที่ด้วยที่เก็บข้อมูลปกติก่อนที่จะส่งงานพิมพ์ไปยังเครื่องพิมพ์" msgid "Encountered an unknown error with the Storage status. Please try again." msgstr "พบข้อผิดพลาดที่ไม่ทราบสาเหตุเกี่ยวกับสถานะการจัดเก็บ โปรดลองอีกครั้ง" @@ -3426,24 +3269,14 @@ msgstr "ส่งสำเร็จ หน้านี้จะปิดใน % msgid "Storage needs to be inserted before sending to printer." msgstr "ต้องใส่ที่เก็บข้อมูลก่อนที่จะส่งไปยังเครื่องพิมพ์" -msgid "" -"Sending G-code file over LAN, but the Storage in the printer is abnormal and " -"print-issues may be caused by this." -msgstr "" -"กำลังส่งไฟล์ G-code ผ่าน LAN " -"แต่ที่เก็บข้อมูลในเครื่องพิมพ์ผิดปกติและปัญหาการพิมพ์อาจมีสาเหตุจากสิ่งนี้" +msgid "Sending G-code file over LAN, but the Storage in the printer is abnormal and print-issues may be caused by this." +msgstr "กำลังส่งไฟล์ G-code ผ่าน LAN แต่ที่เก็บข้อมูลในเครื่องพิมพ์ผิดปกติและปัญหาการพิมพ์อาจมีสาเหตุจากสิ่งนี้" -msgid "" -"The Storage in the printer is abnormal. Please replace it with a normal " -"Storage before sending to printer." +msgid "The Storage in the printer is abnormal. Please replace it with a normal Storage before sending to printer." msgstr "พื้นที่จัดเก็บข้อมูลในเครื่องพิมพ์ผิดปกติ โปรดแทนที่ด้วยที่เก็บข้อมูลปกติก่อนที่จะส่งไปยังเครื่องพิมพ์" -msgid "" -"The Storage in the printer is read-only. Please replace it with a normal " -"Storage before sending to printer." -msgstr "" -"ที่เก็บข้อมูลในเครื่องพิมพ์เป็นแบบอ่านอย่างเดียว " -"โปรดแทนที่ด้วยที่เก็บข้อมูลปกติก่อนที่จะส่งไปยังเครื่องพิมพ์" +msgid "The Storage in the printer is read-only. Please replace it with a normal Storage before sending to printer." +msgstr "ที่เก็บข้อมูลในเครื่องพิมพ์เป็นแบบอ่านอย่างเดียว โปรดแทนที่ด้วยที่เก็บข้อมูลปกติก่อนที่จะส่งไปยังเครื่องพิมพ์" msgid "Bad input data for EmbossCreateObjectJob." msgstr "ข้อมูลอินพุตไม่ถูกต้องสำหรับ EmbossCreateObjectJob" @@ -3486,12 +3319,8 @@ msgstr "การปรับสภาพล่วงหน้าด้วยค msgid "Remaining time: Calculating..." msgstr "เวลาที่เหลืออยู่: กำลังคำนวณ..." -msgid "" -"The heated bed's thermal preconditioning helps optimize the first layer " -"print quality. Printing will start once preconditioning is complete." -msgstr "" -"การปรับสภาพความร้อนล่วงหน้าของฐานพิมพ์อุ่นช่วยปรับคุณภาพการพิมพ์ชั้นแรกให้เหมาะสมที่สุด " -"การพิมพ์จะเริ่มขึ้นเมื่อการปรับสภาพเบื้องต้นเสร็จสิ้น" +msgid "The heated bed's thermal preconditioning helps optimize the first layer print quality. Printing will start once preconditioning is complete." +msgstr "การปรับสภาพความร้อนล่วงหน้าของฐานพิมพ์อุ่นช่วยปรับคุณภาพการพิมพ์ชั้นแรกให้เหมาะสมที่สุด การพิมพ์จะเริ่มขึ้นเมื่อการปรับสภาพเบื้องต้นเสร็จสิ้น" #, c-format, boost-format msgid "Remaining time: %dmin%ds" @@ -3500,12 +3329,8 @@ msgstr "เวลาที่เหลือ: %d นาที %d วินาท msgid "Importing SLA archive" msgstr "การนำเข้าไฟล์เก็บถาวร SLA" -msgid "" -"The SLA archive doesn't contain any presets. Please activate some SLA " -"printer presets first before importing that SLA archive." -msgstr "" -"ไฟล์เก็บถาวร SLA ไม่มีค่าที่ตั้งไว้ล่วงหน้า โปรดเปิดใช้งานค่าที่ตั้งไว้ล่วงหน้าของเครื่องพิมพ์ SLA " -"ก่อนนำเข้าไฟล์เก็บถาวรนั้น" +msgid "The SLA archive doesn't contain any presets. Please activate some SLA printer presets first before importing that SLA archive." +msgstr "ไฟล์เก็บถาวร SLA ไม่มีค่าที่ตั้งไว้ล่วงหน้า โปรดเปิดใช้งานค่าที่ตั้งไว้ล่วงหน้าของเครื่องพิมพ์ SLA ก่อนนำเข้าไฟล์เก็บถาวรนั้น" msgid "Importing canceled." msgstr "การนำเข้าถูกยกเลิก" @@ -3513,12 +3338,8 @@ msgstr "การนำเข้าถูกยกเลิก" msgid "Importing done." msgstr "นำเข้าเรียบร้อยแล้ว" -msgid "" -"The imported SLA archive did not contain any presets. The current SLA " -"presets were used as fallback." -msgstr "" -"ไฟล์เก็บถาวร SLA ที่นำเข้าไม่มีการตั้งค่าล่วงหน้าใดๆ ค่าที่ตั้งไว้ล่วงหน้าของ SLA " -"ปัจจุบันถูกใช้เป็นทางเลือก" +msgid "The imported SLA archive did not contain any presets. The current SLA presets were used as fallback." +msgstr "ไฟล์เก็บถาวร SLA ที่นำเข้าไม่มีการตั้งค่าล่วงหน้าใดๆ ค่าที่ตั้งไว้ล่วงหน้าของ SLA ปัจจุบันถูกใช้เป็นทางเลือก" msgid "You cannot load an SLA project with a multi-part object on the bed" msgstr "คุณไม่สามารถโหลดโครงการ SLA ที่มีวัตถุหลายส่วนบนฐานพิมพ์ได้" @@ -3568,50 +3389,21 @@ msgstr "Orca Slicer ขึ้นอยู่กับ PrusaSlicer และ Bamb msgid "Libraries" msgstr "ห้องสมุด" -msgid "" -"This software uses open source components whose copyright and other " -"proprietary rights belong to their respective owners" -msgstr "" -"ซอฟต์แวร์นี้ใช้ส่วนประกอบโอเพ่นซอร์สซึ่งมีลิขสิทธิ์และกรรมสิทธิ์อื่น ๆ เป็นของเจ้าของที่เกี่ยวข้อง" +msgid "This software uses open source components whose copyright and other proprietary rights belong to their respective owners" +msgstr "ซอฟต์แวร์นี้ใช้ส่วนประกอบโอเพ่นซอร์สซึ่งมีลิขสิทธิ์และกรรมสิทธิ์อื่น ๆ เป็นของเจ้าของที่เกี่ยวข้อง" #, c-format, boost-format msgid "About %s" msgstr "เกี่ยวกับ %s" -msgid "" -"Open-source slicing stands on a tradition of collaboration and attribution. " -"Slic3r, created by Alessandro Ranellucci and the RepRap community, laid the " -"foundation. PrusaSlicer by Prusa Research built on that work, Bambu Studio " -"forked from PrusaSlicer, and SuperSlicer extended it with community-driven " -"enhancements. Each project carried the work of its predecessors forward, " -"crediting those who came before." -msgstr "" -"การแบ่งส่วนโอเพ่นซอร์สยืนหยัดบนพื้นฐานของการทำงานร่วมกันและการระบุแหล่งที่มา Slic3r " -"ซึ่งสร้างโดย Alessandro Ranellucci และชุมชน RepRap ได้วางรากฐาน PrusaSlicer โดย " -"Prusa Research สร้างขึ้นจากผลงานดังกล่าว Bambu Studio แยกจาก PrusaSlicer และ " -"SuperSlicer ได้ขยายขอบเขตด้วยการปรับปรุงที่ขับเคลื่อนโดยชุมชน " -"แต่ละโครงการได้สานต่องานของรุ่นก่อนไปข้างหน้า โดยให้เครดิตผู้ที่มาก่อนหน้านี้" +msgid "Open-source slicing stands on a tradition of collaboration and attribution. Slic3r, created by Alessandro Ranellucci and the RepRap community, laid the foundation. PrusaSlicer by Prusa Research built on that work, Bambu Studio forked from PrusaSlicer, and SuperSlicer extended it with community-driven enhancements. Each project carried the work of its predecessors forward, crediting those who came before." +msgstr "การแบ่งส่วนโอเพ่นซอร์สยืนหยัดบนพื้นฐานของการทำงานร่วมกันและการระบุแหล่งที่มา Slic3r ซึ่งสร้างโดย Alessandro Ranellucci และชุมชน RepRap ได้วางรากฐาน PrusaSlicer โดย Prusa Research สร้างขึ้นจากผลงานดังกล่าว Bambu Studio แยกจาก PrusaSlicer และ SuperSlicer ได้ขยายขอบเขตด้วยการปรับปรุงที่ขับเคลื่อนโดยชุมชน แต่ละโครงการได้สานต่องานของรุ่นก่อนไปข้างหน้า โดยให้เครดิตผู้ที่มาก่อนหน้านี้" -msgid "" -"OrcaSlicer began in that same spirit, drawing from PrusaSlicer, BambuStudio, " -"SuperSlicer, and CuraSlicer. But it has since grown far beyond its origins — " -"introducing advanced calibration tools, precise wall and seam control and " -"hundreds of other features." -msgstr "" -"OrcaSlicer เริ่มต้นด้วยจิตวิญญาณเดียวกัน โดยวาดจาก PrusaSlicer, BambuStudio, " -"SuperSlicer และ CuraSlicer แต่ตั้งแต่นั้นเป็นต้นมามันก็เติบโตไปไกลเกินกว่าต้นกำเนิด " -"โดยนำเสนอเครื่องมือสอบเทียบขั้นสูง การควบคุมผนังและรอยตะเข็บที่แม่นยำ และคุณสมบัติอื่น ๆ " -"หลายร้อยรายการ" +msgid "OrcaSlicer began in that same spirit, drawing from PrusaSlicer, BambuStudio, SuperSlicer, and CuraSlicer. But it has since grown far beyond its origins — introducing advanced calibration tools, precise wall and seam control and hundreds of other features." +msgstr "OrcaSlicer เริ่มต้นด้วยจิตวิญญาณเดียวกัน โดยวาดจาก PrusaSlicer, BambuStudio, SuperSlicer และ CuraSlicer แต่ตั้งแต่นั้นเป็นต้นมามันก็เติบโตไปไกลเกินกว่าต้นกำเนิด โดยนำเสนอเครื่องมือสอบเทียบขั้นสูง การควบคุมผนังและรอยตะเข็บที่แม่นยำ และคุณสมบัติอื่น ๆ หลายร้อยรายการ" -msgid "" -"Today, OrcaSlicer is the most widely used and actively developed open-source " -"slicer in the 3D printing community. Many of its innovations have been " -"adopted by other slicers, making it a driving force for the entire industry." -msgstr "" -"ปัจจุบัน OrcaSlicer " -"เป็นตัวแบ่งส่วนข้อมูลแบบโอเพ่นซอร์สที่ใช้กันอย่างแพร่หลายและได้รับการพัฒนาอย่างแข็งขันที่สุดในชุมชนการพิมพ์ " -"3 มิติ นวัตกรรมหลายอย่างของบริษัทได้ถูกนำไปใช้โดยตัวแบ่งส่วนข้อมูลอื่นๆ " -"ทำให้สิ่งนี้เป็นแรงผลักดันสำหรับอุตสาหกรรมทั้งหมด" +msgid "Today, OrcaSlicer is the most widely used and actively developed open-source slicer in the 3D printing community. Many of its innovations have been adopted by other slicers, making it a driving force for the entire industry." +msgstr "ปัจจุบัน OrcaSlicer เป็นตัวแบ่งส่วนข้อมูลแบบโอเพ่นซอร์สที่ใช้กันอย่างแพร่หลายและได้รับการพัฒนาอย่างแข็งขันที่สุดในชุมชนการพิมพ์ 3 มิติ นวัตกรรมหลายอย่างของบริษัทได้ถูกนำไปใช้โดยตัวแบ่งส่วนข้อมูลอื่นๆ ทำให้สิ่งนี้เป็นแรงผลักดันสำหรับอุตสาหกรรมทั้งหมด" msgid "Version" msgstr "เวอร์ชัน" @@ -3678,8 +3470,7 @@ msgid "Please input a valid value (K in %.1f~%.1f, N in %.1f~%.1f)" msgstr "โปรดป้อนค่าที่ถูกต้อง (K ใน %.1f~%.1f, N ใน %.1f~%.1f)" msgid "" -"The nozzle flow is not set. Please set the nozzle flow rate before editing " -"the filament.\n" +"The nozzle flow is not set. Please set the nozzle flow rate before editing the filament.\n" "'Device -> Print parts'" msgstr "" "ไม่ได้ตั้งค่าการไหลของหัวฉีด โปรดตั้งค่าอัตราการไหลของหัวฉีดก่อนที่จะแก้ไขเส้นพลาสติก\n" @@ -3697,13 +3488,8 @@ msgstr "สีกำหนดเอง" msgid "Dynamic flow calibration" msgstr "ปรับเทียบการไหลแบบไดนามิก" -msgid "" -"The nozzle temp and max volumetric speed will affect the calibration " -"results. Please fill in the same values as the actual printing. They can be " -"auto-filled by selecting a filament preset." -msgstr "" -"อุณหภูมิหัวฉีดและความเร็วปริมาตรสูงสุดจะส่งผลต่อผลการสอบเทียบ " -"กรุณากรอกค่าเดียวกันกับการพิมพ์จริง สามารถไส้ในเส้นได้อัตโนมัติโดยเลือกค่าเส้นสายที่ตั้งไว้ล่วงหน้า" +msgid "The nozzle temp and max volumetric speed will affect the calibration results. Please fill in the same values as the actual printing. They can be auto-filled by selecting a filament preset." +msgstr "อุณหภูมิหัวฉีดและความเร็วปริมาตรสูงสุดจะส่งผลต่อผลการสอบเทียบ กรุณากรอกค่าเดียวกันกับการพิมพ์จริง สามารถไส้ในเส้นได้อัตโนมัติโดยเลือกค่าเส้นสายที่ตั้งไว้ล่วงหน้า" msgid "Nozzle Diameter" msgstr "เส้นผ่านศูนย์กลางหัวฉีด" @@ -3735,13 +3521,8 @@ msgstr "เริ่ม" msgid "Next" msgstr "ถัดไป" -msgid "" -"Calibration completed. Please find the most uniform extrusion line on your " -"hot bed like the picture below, and fill the value on its left side into the " -"factor K input box." -msgstr "" -"การสอบเทียบเสร็จสิ้น โปรดค้นหาเส้นการอัดรีดที่สม่ำเสมอที่สุดบนฐานพิมพ์ร้อนของคุณดังภาพด้านล่าง " -"และกรอกค่าทางด้านซ้ายลงในกล่องอินพุตแฟคเตอร์ K" +msgid "Calibration completed. Please find the most uniform extrusion line on your hot bed like the picture below, and fill the value on its left side into the factor K input box." +msgstr "การสอบเทียบเสร็จสิ้น โปรดค้นหาเส้นการอัดรีดที่สม่ำเสมอที่สุดบนฐานพิมพ์ร้อนของคุณดังภาพด้านล่าง และกรอกค่าทางด้านซ้ายลงในกล่องอินพุตแฟคเตอร์ K" msgid "Save" msgstr "บันทึก" @@ -3771,8 +3552,7 @@ msgstr "ไม่ได้แมป" msgid "" "Upper half area: Original\n" -"Lower half area: The filament from original project will be used when " -"unmapped.\n" +"Lower half area: The filament from original project will be used when unmapped.\n" "And you can click it to modify" msgstr "" "พื้นที่ครึ่งบน: ต้นฉบับ\n" @@ -3831,21 +3611,12 @@ msgid "Nozzle" msgstr "หัวฉีด" #, c-format, boost-format -msgid "" -"Note: the filament type(%s) does not match with the filament type(%s) in the " -"slicing file. If you want to use this slot, you can install %s instead of %s " -"and change slot information on the 'Device' page." -msgstr "" -"หมายเหตุ: ประเภทเส้นพลาสติก (%s) ไม่ตรงกับประเภทเส้นพลาสติก (%s) ในไฟล์การแบ่งส่วน " -"หากคุณต้องการใช้ช่องนี้ คุณสามารถติดตั้ง %s แทน %s และเปลี่ยนข้อมูลช่องบนหน้า 'อุปกรณ์'" +msgid "Note: the filament type(%s) does not match with the filament type(%s) in the slicing file. If you want to use this slot, you can install %s instead of %s and change slot information on the 'Device' page." +msgstr "หมายเหตุ: ประเภทเส้นพลาสติก (%s) ไม่ตรงกับประเภทเส้นพลาสติก (%s) ในไฟล์การแบ่งส่วน หากคุณต้องการใช้ช่องนี้ คุณสามารถติดตั้ง %s แทน %s และเปลี่ยนข้อมูลช่องบนหน้า 'อุปกรณ์'" #, c-format, boost-format -msgid "" -"Note: the slot is empty or undefined. If you want to use this slot, you can " -"install %s and change slot information on the 'Device' page." -msgstr "" -"หมายเหตุ: ช่องว่างเปล่าหรือไม่ได้กำหนด หากคุณต้องการใช้ช่องนี้ คุณสามารถติดตั้ง %s " -"และเปลี่ยนข้อมูลช่องได้ในหน้า 'อุปกรณ์'" +msgid "Note: the slot is empty or undefined. If you want to use this slot, you can install %s and change slot information on the 'Device' page." +msgstr "หมายเหตุ: ช่องว่างเปล่าหรือไม่ได้กำหนด หากคุณต้องการใช้ช่องนี้ คุณสามารถติดตั้ง %s และเปลี่ยนข้อมูลช่องได้ในหน้า 'อุปกรณ์'" msgid "Note: Only filament-loaded slots can be selected." msgstr "หมายเหตุ: สามารถเลือกได้เฉพาะช่องที่ใส่ฟิลาเมนท์เท่านั้น" @@ -3862,18 +3633,10 @@ msgstr "ปิดใช้ AMS" msgid "Print with filament on external spool" msgstr "พิมพ์ด้วยเส้นพลาสติกจากแกนภายนอก" -msgid "" -"Please change the desiccant when it is too wet. The indicator may not " -"represent accurately in following cases: when the lid is open or the " -"desiccant pack is changed. It takes a few hours to absorb the moisture, and " -"low temperatures also slow down the process." -msgstr "" -"โปรดเปลี่ยนสารดูดความชื้นเมื่อเปียกเกินไป ตัวบ่งชี้อาจแสดงไม่ถูกต้องในกรณีต่อไปนี้: " -"เมื่อเปิดฝาหรือเปลี่ยนชุดดูดความชื้น การดูดซับความชื้นใช้เวลาหลายชั่วโมง " -"และอุณหภูมิที่ต่ำยังทำให้กระบวนการช้าลงอีกด้วย" +msgid "Please change the desiccant when it is too wet. The indicator may not represent accurately in following cases: when the lid is open or the desiccant pack is changed. It takes a few hours to absorb the moisture, and low temperatures also slow down the process." +msgstr "โปรดเปลี่ยนสารดูดความชื้นเมื่อเปียกเกินไป ตัวบ่งชี้อาจแสดงไม่ถูกต้องในกรณีต่อไปนี้: เมื่อเปิดฝาหรือเปลี่ยนชุดดูดความชื้น การดูดซับความชื้นใช้เวลาหลายชั่วโมง และอุณหภูมิที่ต่ำยังทำให้กระบวนการช้าลงอีกด้วย" -msgid "" -"Configure which AMS slot should be used for a filament used in the print job." +msgid "Configure which AMS slot should be used for a filament used in the print job." msgstr "กำหนดค่าช่อง AMS ที่จะใช้สำหรับเส้นพลาสติกที่ใช้ในงานพิมพ์" msgid "Filament used in this print job" @@ -3900,9 +3663,7 @@ msgstr "ซ้าย" msgid "Right" msgstr "ขวา" -msgid "" -"When the current material run out, the printer will continue to print in the " -"following order." +msgid "When the current material run out, the printer will continue to print in the following order." msgstr "เมื่อวัสดุปัจจุบันหมด เครื่องพิมพ์จะพิมพ์ต่อตามลำดับต่อไปนี้" msgid "Identical filament: same brand, type and color." @@ -3911,21 +3672,17 @@ msgstr "เส้นพลาสติกเหมือนกัน: ยี่ msgid "Group" msgstr "กลุ่ม" -msgid "" -"When the current material runs out, the printer would use identical filament " -"to continue printing." +msgid "When the current material runs out, the printer would use identical filament to continue printing." msgstr "เมื่อวัสดุที่ใช้ในปัจจุบันหมด เครื่องพิมพ์จะใช้เส้นพลาสติกที่เหมือนกันเพื่อพิมพ์ต่อ" msgid "The printer does not currently support auto refill." msgstr "ขณะนี้เครื่องพิมพ์ไม่รองรับการโหลดเส้นอัตโนมัติ" -msgid "" -"AMS filament backup is not enabled; please enable it in the AMS settings." +msgid "AMS filament backup is not enabled; please enable it in the AMS settings." msgstr "ไม่ได้เปิดใช้งานการสำรองข้อมูลเส้นพลาสติก AMS โปรดเปิดใช้งานในการตั้งค่า AMS" msgid "" -"When the current filament runs out, the printer will use identical filament " -"to continue printing.\n" +"When the current filament runs out, the printer will use identical filament to continue printing.\n" "*Identical filament: same brand, type and color." msgstr "" "เมื่อเส้นพลาสติกปัจจุบันหมด เครื่องพิมพ์จะใช้เส้นพลาสติกที่เหมือนกันเพื่อพิมพ์ต่อ\n" @@ -3943,69 +3700,40 @@ msgstr "การตั้งค่า AMS" msgid "Insertion update" msgstr "การอัพเดตการแทรก" -msgid "" -"The AMS will automatically read the filament information when inserting a " -"new Bambu Lab filament spool. This takes about 20 seconds." -msgstr "" -"AMS จะอ่านข้อมูลเส้นพลาสติกโดยอัตโนมัติเมื่อใส่ม้วนเส้นพลาสติก Bambu Lab ใหม่ " -"ขั้นตอนนี้ใช้เวลาประมาณ 20 วินาที" +msgid "The AMS will automatically read the filament information when inserting a new Bambu Lab filament spool. This takes about 20 seconds." +msgstr "AMS จะอ่านข้อมูลเส้นพลาสติกโดยอัตโนมัติเมื่อใส่ม้วนเส้นพลาสติก Bambu Lab ใหม่ ขั้นตอนนี้ใช้เวลาประมาณ 20 วินาที" -msgid "" -"Note: if a new filament is inserted during printing, the AMS will not " -"automatically read any information until printing is completed." -msgstr "" -"หมายเหตุ: หากใส่เส้นพลาสติกใหม่ระหว่างการพิมพ์ AMS จะไม่อ่านข้อมูลใดๆ " -"โดยอัตโนมัติจนกว่าการพิมพ์จะเสร็จสิ้น" +msgid "Note: if a new filament is inserted during printing, the AMS will not automatically read any information until printing is completed." +msgstr "หมายเหตุ: หากใส่เส้นพลาสติกใหม่ระหว่างการพิมพ์ AMS จะไม่อ่านข้อมูลใดๆ โดยอัตโนมัติจนกว่าการพิมพ์จะเสร็จสิ้น" -msgid "" -"When inserting a new filament, the AMS will not automatically read its " -"information, leaving it blank for you to enter manually." -msgstr "" -"เมื่อใส่เส้นพลาสติกใหม่ AMS จะไม่อ่านข้อมูลโดยอัตโนมัติ ปล่อยให้ว่างไว้เพื่อให้คุณป้อนด้วยตนเอง" +msgid "When inserting a new filament, the AMS will not automatically read its information, leaving it blank for you to enter manually." +msgstr "เมื่อใส่เส้นพลาสติกใหม่ AMS จะไม่อ่านข้อมูลโดยอัตโนมัติ ปล่อยให้ว่างไว้เพื่อให้คุณป้อนด้วยตนเอง" msgid "Update on startup" msgstr "อัปเดตเมื่อเริ่มโปรแกรม" -msgid "" -"The AMS will automatically read the information of inserted filament on " -"start-up. It will take about 1 minute. The reading process will rotate the " -"filament spools." -msgstr "" -"AMS จะอ่านข้อมูลของเส้นพลาสติกที่ใส่ไว้โดยอัตโนมัติเมื่อสตาร์ทเครื่อง จะใช้เวลาประมาณ 1 นาที " -"กระบวนการอ่านจะม้วนแกนเส้นพลาสติก" +msgid "The AMS will automatically read the information of inserted filament on start-up. It will take about 1 minute. The reading process will rotate the filament spools." +msgstr "AMS จะอ่านข้อมูลของเส้นพลาสติกที่ใส่ไว้โดยอัตโนมัติเมื่อสตาร์ทเครื่อง จะใช้เวลาประมาณ 1 นาที กระบวนการอ่านจะม้วนแกนเส้นพลาสติก" -msgid "" -"The AMS will not automatically read information from inserted filament " -"during startup and will continue to use the information recorded before the " -"last shutdown." -msgstr "" -"AMS จะไม่อ่านข้อมูลจากเส้นพลาสติกที่แทรกไว้โดยอัตโนมัติระหว่างการเริ่มต้นระบบ " -"และจะยังคงใช้ข้อมูลที่บันทึกไว้ก่อนการปิดระบบครั้งล่าสุด" +msgid "The AMS will not automatically read information from inserted filament during startup and will continue to use the information recorded before the last shutdown." +msgstr "AMS จะไม่อ่านข้อมูลจากเส้นพลาสติกที่แทรกไว้โดยอัตโนมัติระหว่างการเริ่มต้นระบบ และจะยังคงใช้ข้อมูลที่บันทึกไว้ก่อนการปิดระบบครั้งล่าสุด" msgid "Update remaining capacity" msgstr "อัพเดตความจุคงเหลือ" -msgid "" -"AMS will attempt to estimate the remaining capacity of the Bambu Lab " -"filaments." +msgid "AMS will attempt to estimate the remaining capacity of the Bambu Lab filaments." msgstr "AMS จะพยายามประเมินกำลังการผลิตที่เหลืออยู่ของเส้นพลาสติก Bambu Lab" msgid "AMS filament backup" msgstr "การสำรองข้อมูลเส้นพลาสติก AMS" -msgid "" -"AMS will continue to another spool with matching filament properties " -"automatically when current filament runs out." -msgstr "" -"AMS " -"จะดำเนินการต่อไปยังแกนม้วนอื่นที่มีคุณสมบัติเส้นพลาสติกที่ตรงกันโดยอัตโนมัติเมื่อเส้นพลาสติกปัจจุบันหมด" +msgid "AMS will continue to another spool with matching filament properties automatically when current filament runs out." +msgstr "AMS จะดำเนินการต่อไปยังแกนม้วนอื่นที่มีคุณสมบัติเส้นพลาสติกที่ตรงกันโดยอัตโนมัติเมื่อเส้นพลาสติกปัจจุบันหมด" msgid "Air Printing Detection" msgstr "การตรวจจับการพิมพ์ทางอากาศ" -msgid "" -"Detects clogging and filament grinding, halting printing immediately to " -"conserve time and filament." +msgid "Detects clogging and filament grinding, halting printing immediately to conserve time and filament." msgstr "ตรวจจับการอุดตันและการบดเส้นพลาสติก หยุดการพิมพ์ทันทีเพื่อประหยัดเวลาและเส้นพลาสติก" msgid "AMS Type" @@ -4026,12 +3754,8 @@ msgstr "การสลับประเภท AMS จำเป็นต้อ msgid "Arrange AMS Order" msgstr "จัดเรียงคำสั่งซื้อ AMS" -msgid "" -"AMS ID will be reset. If you want a specific ID sequence, disconnect all AMS " -"before resetting and connect them in the desired order after resetting." -msgstr "" -"รหัส AMS จะถูกรีเซ็ต หากคุณต้องการลำดับ ID เฉพาะ ให้ยกเลิกการเชื่อมต่อ AMS " -"ทั้งหมดก่อนที่จะรีเซ็ต และเชื่อมต่อตามลำดับที่ต้องการหลังจากรีเซ็ต" +msgid "AMS ID will be reset. If you want a specific ID sequence, disconnect all AMS before resetting and connect them in the desired order after resetting." +msgstr "รหัส AMS จะถูกรีเซ็ต หากคุณต้องการลำดับ ID เฉพาะ ให้ยกเลิกการเชื่อมต่อ AMS ทั้งหมดก่อนที่จะรีเซ็ต และเชื่อมต่อตามลำดับที่ต้องการหลังจากรีเซ็ต" msgid "File" msgstr "ไฟล์" @@ -4039,26 +3763,16 @@ msgstr "ไฟล์" msgid "Calibration" msgstr "การปรับเทียบ" -msgid "" -"Failed to download the plug-in. Please check your firewall settings and VPN " -"software and retry." -msgstr "" -"ดาวน์โหลดปลั๊กอินไม่สำเร็จ โปรดตรวจสอบการตั้งค่าไฟร์วอลล์และซอฟต์แวร์ VPN แล้วลองอีกครั้ง" +msgid "Failed to download the plug-in. Please check your firewall settings and VPN software and retry." +msgstr "ดาวน์โหลดปลั๊กอินไม่สำเร็จ โปรดตรวจสอบการตั้งค่าไฟร์วอลล์และซอฟต์แวร์ VPN แล้วลองอีกครั้ง" -msgid "" -"Failed to install the plug-in. The plug-in file may be in use. Please " -"restart OrcaSlicer and try again. Also check whether it is blocked or has " -"been deleted by anti-virus software." -msgstr "" -"ไม่สามารถติดตั้งปลั๊กอินได้ ไฟล์ปลั๊กอินอาจถูกใช้งานอยู่ โปรดรีสตาร์ท OrcaSlicer แล้วลองอีกครั้ง " -"ตรวจสอบด้วยว่าซอฟต์แวร์ป้องกันไวรัสบล็อกหรือลบหรือไม่" +msgid "Failed to install the plug-in. The plug-in file may be in use. Please restart OrcaSlicer and try again. Also check whether it is blocked or has been deleted by anti-virus software." +msgstr "ไม่สามารถติดตั้งปลั๊กอินได้ ไฟล์ปลั๊กอินอาจถูกใช้งานอยู่ โปรดรีสตาร์ท OrcaSlicer แล้วลองอีกครั้ง ตรวจสอบด้วยว่าซอฟต์แวร์ป้องกันไวรัสบล็อกหรือลบหรือไม่" msgid "Click here to see more info" msgstr "คลิกที่นี่เพื่อดูข้อมูลเพิ่มเติม" -msgid "" -"The network plug-in was installed but could not be loaded. Please restart " -"the application." +msgid "The network plug-in was installed but could not be loaded. Please restart the application." msgstr "ติดตั้งปลั๊กอินเครือข่ายแล้ว แต่ไม่สามารถโหลดได้ กรุณารีสตาร์ทแอปพลิเคชัน" msgid "Restart Required" @@ -4067,19 +3781,13 @@ msgstr "ต้องเริ่มใหม่" msgid "Please home all axes (click " msgstr "กรุณากลับบ้านทุกแกน (คลิก" -msgid "" -") to locate the toolhead's position. This prevents device moving beyond the " -"printable boundary and causing equipment wear." -msgstr "" -") เพื่อค้นหาตำแหน่งของหัวเครื่องมือ เพื่อป้องกันไม่ให้อุปกรณ์เคลื่อนที่เกินขอบเขตที่สามารถพิมพ์ได้ " -"และทำให้อุปกรณ์สึกหรอ" +msgid ") to locate the toolhead's position. This prevents device moving beyond the printable boundary and causing equipment wear." +msgstr ") เพื่อค้นหาตำแหน่งของหัวเครื่องมือ เพื่อป้องกันไม่ให้อุปกรณ์เคลื่อนที่เกินขอบเขตที่สามารถพิมพ์ได้ และทำให้อุปกรณ์สึกหรอ" msgid "Go Home" msgstr "กลับจุดอ้างอิง" -msgid "" -"An error occurred. The system may have run out of memory, or a bug may have " -"occurred." +msgid "An error occurred. The system may have run out of memory, or a bug may have occurred." msgstr "เกิดข้อผิดพลาด ระบบอาจมีหน่วยความจำไม่เพียงพอ หรืออาจเกิดบั๊กในโปรแกรม" #, boost-format @@ -4127,45 +3835,27 @@ msgstr "เกิดข้อผิดพลาดที่ไม่รู้จ #, boost-format msgid "" -"Copying of the temporary G-code to the output G-code failed. Maybe the SD " -"card is write locked?\n" +"Copying of the temporary G-code to the output G-code failed. Maybe the SD card is write locked?\n" "Error message: %1%" msgstr "" "การคัดลอก G-code ชั่วคราวไปยังเอาต์พุต G-code ล้มเหลว บางทีการ์ด SD อาจถูกล็อคการเขียน?\n" "ข้อความแสดงข้อผิดพลาด: %1%" #, boost-format -msgid "" -"Copying of the temporary G-code to the output G-code failed. There might be " -"problem with target device, please try exporting again or using different " -"device. The corrupted output G-code is at %1%.tmp." -msgstr "" -"การคัดลอก G-code ชั่วคราวไปยังเอาต์พุต G-code ล้มเหลว อาจมีปัญหากับอุปกรณ์เป้าหมาย " -"โปรดลองส่งออกอีกครั้งหรือใช้อุปกรณ์อื่น G-code เอาต์พุตที่เสียหายอยู่ที่ %1%.tmp" +msgid "Copying of the temporary G-code to the output G-code failed. There might be problem with target device, please try exporting again or using different device. The corrupted output G-code is at %1%.tmp." +msgstr "การคัดลอก G-code ชั่วคราวไปยังเอาต์พุต G-code ล้มเหลว อาจมีปัญหากับอุปกรณ์เป้าหมาย โปรดลองส่งออกอีกครั้งหรือใช้อุปกรณ์อื่น G-code เอาต์พุตที่เสียหายอยู่ที่ %1%.tmp" #, boost-format -msgid "" -"Renaming of the G-code after copying to the selected destination folder has " -"failed. Current path is %1%.tmp. Please try exporting again." -msgstr "" -"การเปลี่ยนชื่อ G-code หลังจากคัดลอกไปยังโฟลเดอร์ปลายทางที่เลือกล้มเหลว เส้นทางปัจจุบันคือ %1%." -"tmp โปรดลองส่งออกอีกครั้ง" +msgid "Renaming of the G-code after copying to the selected destination folder has failed. Current path is %1%.tmp. Please try exporting again." +msgstr "การเปลี่ยนชื่อ G-code หลังจากคัดลอกไปยังโฟลเดอร์ปลายทางที่เลือกล้มเหลว เส้นทางปัจจุบันคือ %1%.tmp โปรดลองส่งออกอีกครั้ง" #, boost-format -msgid "" -"Copying of the temporary G-code has finished but the original code at %1% " -"couldn't be opened during copy check. The output G-code is at %2%.tmp." -msgstr "" -"การคัดลอก G-code ชั่วคราวเสร็จสิ้นแล้ว แต่ไม่สามารถเปิดรหัสต้นฉบับที่ %1% " -"ได้ในระหว่างการตรวจสอบการคัดลอก G-code เอาต์พุตอยู่ที่ %2%.tmp" +msgid "Copying of the temporary G-code has finished but the original code at %1% couldn't be opened during copy check. The output G-code is at %2%.tmp." +msgstr "การคัดลอก G-code ชั่วคราวเสร็จสิ้นแล้ว แต่ไม่สามารถเปิดรหัสต้นฉบับที่ %1% ได้ในระหว่างการตรวจสอบการคัดลอก G-code เอาต์พุตอยู่ที่ %2%.tmp" #, boost-format -msgid "" -"Copying of the temporary G-code has finished but the exported code couldn't " -"be opened during copy check. The output G-code is at %1%.tmp." -msgstr "" -"การคัดลอก G-code ชั่วคราวเสร็จสิ้นแล้ว " -"แต่ไม่สามารถเปิดรหัสที่ส่งออกได้ในระหว่างการตรวจสอบการคัดลอก G-code เอาต์พุตอยู่ที่ %1%.tmp" +msgid "Copying of the temporary G-code has finished but the exported code couldn't be opened during copy check. The output G-code is at %1%.tmp." +msgstr "การคัดลอก G-code ชั่วคราวเสร็จสิ้นแล้ว แต่ไม่สามารถเปิดรหัสที่ส่งออกได้ในระหว่างการตรวจสอบการคัดลอก G-code เอาต์พุตอยู่ที่ %1%.tmp" #, boost-format msgid "G-code file exported to %1%" @@ -4197,14 +3887,10 @@ msgstr "ต้นทาง" msgid "Size in X and Y of the rectangular plate." msgstr "ขนาดของแผ่นสี่เหลี่ยมเป็น X และ Y" -msgid "" -"Distance of the 0,0 G-code coordinate from the front left corner of the " -"rectangle." +msgid "Distance of the 0,0 G-code coordinate from the front left corner of the rectangle." msgstr "ระยะห่างของพิกัด 0,0 G-code จากมุมซ้ายหน้าของสี่เหลี่ยมผืนผ้า" -msgid "" -"Diameter of the print bed. It is assumed that origin (0,0) is located in the " -"center." +msgid "Diameter of the print bed. It is assumed that origin (0,0) is located in the center." msgstr "เส้นผ่านศูนย์กลางของฐานพิมพ์ สันนิษฐานว่าจุดกำเนิด (0,0) อยู่ตรงกลาง" msgid "Rectangular" @@ -4240,8 +3926,7 @@ msgstr "ข้อผิดพลาด! โมเดลไม่ถูกต้ msgid "The selected file contains no geometry." msgstr "ไฟล์ที่เลือกไม่มีรูปทรงเรขาคณิต" -msgid "" -"The selected file contains several disjointed areas. This is not supported." +msgid "The selected file contains several disjointed areas. This is not supported." msgstr "ไฟล์ที่เลือกมีพื้นที่แยกจากกันหลายส่วน ซึ่งยังไม่รองรับ" msgid "Choose a file to import bed texture from (PNG/SVG):" @@ -4261,17 +3946,14 @@ msgstr "แนะนำให้ใช้อุณหภูมิต่ำสุ msgid "A maximum temperature below %d℃ is recommended for %s.\n" msgstr "แนะนำให้ใช้อุณหภูมิสูงสุดต่ำกว่า %d℃ สำหรับ %s\n" -msgid "" -"The recommended minimum temperature cannot be higher than the recommended " -"maximum temperature.\n" +msgid "The recommended minimum temperature cannot be higher than the recommended maximum temperature.\n" msgstr "อุณหภูมิต่ำสุดที่แนะนำต้องไม่สูงกว่าอุณหภูมิสูงสุดที่แนะนำ\n" msgid "Please check.\n" msgstr "กรุณาตรวจสอบ.\n" msgid "" -"The nozzle may become clogged when the temperature is out of the recommended " -"range.\n" +"The nozzle may become clogged when the temperature is out of the recommended range.\n" "Please make sure whether to use this temperature to print.\n" "\n" msgstr "" @@ -4280,11 +3962,12 @@ msgstr "" "\n" #, c-format, boost-format -msgid "" -"The recommended nozzle temperature for this filament type is [%d, %d] " -"degrees Celsius." +msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "อุณหภูมิหัวฉีดที่แนะนำสำหรับเส้นพลาสติกประเภทนี้คือ [%d, %d] องศาเซลเซียส" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + msgid "" "Too small max volumetric speed.\n" "Value was reset to 0.5" @@ -4293,13 +3976,8 @@ msgstr "" "รีเซ็ตเป็น 0.5" #, c-format, boost-format -msgid "" -"Current chamber temperature is higher than the material's safe temperature; " -"this may result in material softening and nozzle clogs. The maximum safe " -"temperature for the material is %d" -msgstr "" -"อุณหภูมิห้องพิมพ์ปัจจุบันสูงกว่าอุณหภูมิปลอดภัยของวัสดุ ซึ่งอาจทำให้วัสดุนิ่มและหัวฉีดอุดตัน " -"อุณหภูมิปลอดภัยสูงสุดของวัสดุนี้คือ %d" +msgid "Current chamber temperature is higher than the material's safe temperature; this may result in material softening and nozzle clogs. The maximum safe temperature for the material is %d" +msgstr "อุณหภูมิห้องพิมพ์ปัจจุบันสูงกว่าอุณหภูมิปลอดภัยของวัสดุ ซึ่งอาจทำให้วัสดุนิ่มและหัวฉีดอุดตัน อุณหภูมิปลอดภัยสูงสุดของวัสดุนี้คือ %d" msgid "" "Layer height too small\n" @@ -4326,8 +4004,7 @@ msgstr "" msgid "" "This setting is only used for tuning model size by small amounts.\n" -"For example, when the model size has small errors or when tolerances are " -"incorrect. For large adjustments, please use the model scale function.\n" +"For example, when the model size has small errors or when tolerances are incorrect. For large adjustments, please use the model scale function.\n" "\n" "The value will be reset to 0." msgstr "" @@ -4350,15 +4027,12 @@ msgstr "" "\n" "ค่าจะถูกรีเซ็ตเป็น 0" -msgid "" -"Alternate extra wall does't work well when ensure vertical shell thickness " -"is set to All." +msgid "Alternate extra wall does't work well when ensure vertical shell thickness is set to All." msgstr "ผนังเสริมสำรองทำงานได้ไม่ดีเมื่อตั้งค่าความหนาของเปลือกแนวตั้งเป็นทั้งหมด" msgid "" "Change these settings automatically?\n" -"Yes - Change ensure vertical shell thickness to Moderate and enable " -"alternate extra wall\n" +"Yes - Change ensure vertical shell thickness to Moderate and enable alternate extra wall\n" "No - Don't use alternate extra wall" msgstr "" "เปลี่ยนการตั้งค่าเหล่านี้โดยอัตโนมัติหรือไม่\n" @@ -4366,14 +4040,12 @@ msgstr "" "ไม่ - ห้ามใช้ผนังเสริมสำรอง" msgid "" -"Prime tower does not work when Adaptive Layer Height or Independent Support " -"Layer Height is on.\n" +"Prime tower does not work when Adaptive Layer Height or Independent Support Layer Height is on.\n" "Which do you want to keep?\n" "YES - Keep Prime Tower\n" "NO - Keep Adaptive Layer Height and Independent Support Layer Height" msgstr "" -"ไพรม์ทาวเวอร์ไม่ทำงานเมื่อเปิดใช้งาน Adaptive Layer Height หรือ Independent ส่วนรองรับ " -"Layer Height\n" +"ไพรม์ทาวเวอร์ไม่ทำงานเมื่อเปิดใช้งาน Adaptive Layer Height หรือ Independent ส่วนรองรับ Layer Height\n" "คุณต้องการเก็บอันไหน?\n" "ใช่ - เก็บ Prime Tower ไว้\n" "ไม่ - คงความสูงของเลเยอร์แบบปรับได้และความสูงของเลเยอร์รองรับที่เป็นอิสระ" @@ -4415,32 +4087,20 @@ msgstr "" "ความลึกของล็อคควรน้อยกว่าความลึกของผิวหนัง\n" "รีเซ็ตเป็น 50% ของความลึกของผิว" -msgid "" -"Both [Extrusion] and [Combined] modes of Fuzzy Skin require the Arachne Wall " -"Generator to be enabled." -msgstr "" -"ทั้งโหมด [อัดขึ้นรูป] และ [รวม] ของ Fuzzy Skin จำเป็นต้องเปิดใช้งาน Arachne Wall " -"Generator" +msgid "Both [Extrusion] and [Combined] modes of Fuzzy Skin require the Arachne Wall Generator to be enabled." +msgstr "ทั้งโหมด [อัดขึ้นรูป] และ [รวม] ของ Fuzzy Skin จำเป็นต้องเปิดใช้งาน Arachne Wall Generator" msgid "" "Change these settings automatically?\n" "Yes - Enable Arachne Wall Generator\n" -"No - Disable Arachne Wall Generator and set [Displacement] mode of the " -"Fuzzy Skin" +"No - Disable Arachne Wall Generator and set [Displacement] mode of the Fuzzy Skin" msgstr "" "เปลี่ยนการตั้งค่าเหล่านี้โดยอัตโนมัติหรือไม่\n" "ใช่ - เปิดใช้งาน Arachne Wall Generator\n" -"ไม่ - ปิดการใช้งาน Arachne Wall Generator และตั้งค่าโหมด [Displacement] ของ Fuzzy " -"Skin" +"ไม่ - ปิดการใช้งาน Arachne Wall Generator และตั้งค่าโหมด [Displacement] ของ Fuzzy Skin" -msgid "" -"Spiral mode only works when wall loops is 1, support is disabled, clumping " -"detection by probing is disabled, top shell layers is 0, sparse infill " -"density is 0 and timelapse type is traditional." -msgstr "" -"โหมดเกลียวจะทำงานเฉพาะเมื่อลูปติดผนังเป็น 1, ปิดใช้งานส่วนรองรับ, " -"การตรวจจับการจับตัวเป็นก้อนโดยการตรวจวัดถูกปิดใช้งาน, ชั้นเปลือกด้านบนเป็น 0, " -"ความหนาแน่นของไส้ในแบบกระจายเป็น 0 และประเภทไทม์แลปส์เป็นแบบดั้งเดิม" +msgid "Spiral mode only works when wall loops is 1, support is disabled, clumping detection by probing is disabled, top shell layers is 0, sparse infill density is 0 and timelapse type is traditional." +msgstr "โหมดเกลียวจะทำงานเฉพาะเมื่อลูปติดผนังเป็น 1, ปิดใช้งานส่วนรองรับ, การตรวจจับการจับตัวเป็นก้อนโดยการตรวจวัดถูกปิดใช้งาน, ชั้นเปลือกด้านบนเป็น 0, ความหนาแน่นของไส้ในแบบกระจายเป็น 0 และประเภทไทม์แลปส์เป็นแบบดั้งเดิม" msgid " But machines with I3 structure will not generate timelapse videos." msgstr "แต่เครื่องที่มีโครงสร้าง I3 จะไม่สร้างวิดีโอแบบไทม์แลปส์" @@ -4658,58 +4318,30 @@ msgstr "ไม่รองรับไทม์แลปส์ในขณะท msgid "Timelapse is not supported while the storage is readonly." msgstr "ไม่รองรับไทม์แลปส์ในขณะที่พื้นที่เก็บข้อมูลเป็นแบบอ่านอย่างเดียว" -msgid "" -"To ensure your safety, certain processing tasks (such as laser) can only be " -"resumed on printer." -msgstr "" -"เพื่อความปลอดภัยของคุณ งานการประมวลผลบางอย่าง (เช่น เลเซอร์) " -"สามารถดำเนินการต่อได้บนเครื่องพิมพ์เท่านั้น" +msgid "To ensure your safety, certain processing tasks (such as laser) can only be resumed on printer." +msgstr "เพื่อความปลอดภัยของคุณ งานการประมวลผลบางอย่าง (เช่น เลเซอร์) สามารถดำเนินการต่อได้บนเครื่องพิมพ์เท่านั้น" #, c-format, boost-format -msgid "" -"The chamber temperature is too high, which may cause the filament to soften. " -"Please wait until the chamber temperature drops below %d℃. You may open the " -"front door or enable fans to cool down." -msgstr "" -"อุณหภูมิในห้องเพาะเลี้ยงสูงเกินไป ซึ่งอาจทำให้เส้นพลาสติกนิ่มลง " -"โปรดรอจนกว่าอุณหภูมิห้องจะลดลงต่ำกว่า %d℃ คุณสามารถเปิดประตูหน้าหรือเปิดพัดลมให้เย็นลงได้" +msgid "The chamber temperature is too high, which may cause the filament to soften. Please wait until the chamber temperature drops below %d℃. You may open the front door or enable fans to cool down." +msgstr "อุณหภูมิในห้องเพาะเลี้ยงสูงเกินไป ซึ่งอาจทำให้เส้นพลาสติกนิ่มลง โปรดรอจนกว่าอุณหภูมิห้องจะลดลงต่ำกว่า %d℃ คุณสามารถเปิดประตูหน้าหรือเปิดพัดลมให้เย็นลงได้" #, c-format, boost-format -msgid "" -"AMS temperature is too high, which may cause the filament to soften. Please " -"wait until the AMS temperature drops below %d℃." -msgstr "" -"อุณหภูมิ AMS สูงเกินไป ซึ่งอาจทำให้เส้นพลาสติกอ่อนตัวลง โปรดรอจนกว่าอุณหภูมิ AMS จะลดลงต่ำกว่า " -"%d℃" +msgid "AMS temperature is too high, which may cause the filament to soften. Please wait until the AMS temperature drops below %d℃." +msgstr "อุณหภูมิ AMS สูงเกินไป ซึ่งอาจทำให้เส้นพลาสติกอ่อนตัวลง โปรดรอจนกว่าอุณหภูมิ AMS จะลดลงต่ำกว่า %d℃" -msgid "" -"The current chamber temperature or the target chamber temperature exceeds " -"45℃. In order to avoid extruder clogging, low temperature filament(PLA/PETG/" -"TPU) is not allowed to be loaded." -msgstr "" -"อุณหภูมิห้องปัจจุบันหรืออุณหภูมิห้องเป้าหมายเกิน 45°C เพื่อหลีกเลี่ยงการอุดตันของชุดดันเส้น " -"ไม่อนุญาตให้โหลดเส้นพลาสติกที่มีอุณหภูมิต่ำ (PLA/PETG/TPU)" +msgid "The current chamber temperature or the target chamber temperature exceeds 45℃. In order to avoid extruder clogging, low temperature filament(PLA/PETG/TPU) is not allowed to be loaded." +msgstr "อุณหภูมิห้องปัจจุบันหรืออุณหภูมิห้องเป้าหมายเกิน 45°C เพื่อหลีกเลี่ยงการอุดตันของชุดดันเส้น ไม่อนุญาตให้โหลดเส้นพลาสติกที่มีอุณหภูมิต่ำ (PLA/PETG/TPU)" -msgid "" -"Low temperature filament(PLA/PETG/TPU) is loaded in the extruder. In order " -"to avoid extruder clogging, it is not allowed to set the chamber temperature." -msgstr "" -"โหลดเส้นพลาสติกอุณหภูมิต่ำ (PLA/PETG/TPU) ลงในชุดดันเส้น เพื่อหลีกเลี่ยงการอุดตันของชุดดันเส้น " -"ไม่อนุญาตให้ตั้งอุณหภูมิห้องเพาะเลี้ยง" +msgid "Low temperature filament(PLA/PETG/TPU) is loaded in the extruder. In order to avoid extruder clogging, it is not allowed to set the chamber temperature." +msgstr "โหลดเส้นพลาสติกอุณหภูมิต่ำ (PLA/PETG/TPU) ลงในชุดดันเส้น เพื่อหลีกเลี่ยงการอุดตันของชุดดันเส้น ไม่อนุญาตให้ตั้งอุณหภูมิห้องเพาะเลี้ยง" -msgid "" -"When you set the chamber temperature below 40℃, the chamber temperature " -"control will not be activated, and the target chamber temperature will " -"automatically be set to 0℃." -msgstr "" -"เมื่อคุณตั้งอุณหภูมิห้องเพาะเลี้ยงให้ต่ำกว่า 40°C การควบคุมอุณหภูมิห้องเพาะเลี้ยงจะไม่ทำงาน " -"และอุณหภูมิห้องเพาะเลี้ยงเป้าหมายจะถูกตั้งค่าเป็น 0°C โดยอัตโนมัติ" +msgid "When you set the chamber temperature below 40℃, the chamber temperature control will not be activated, and the target chamber temperature will automatically be set to 0℃." +msgstr "เมื่อคุณตั้งอุณหภูมิห้องเพาะเลี้ยงให้ต่ำกว่า 40°C การควบคุมอุณหภูมิห้องเพาะเลี้ยงจะไม่ทำงาน และอุณหภูมิห้องเพาะเลี้ยงเป้าหมายจะถูกตั้งค่าเป็น 0°C โดยอัตโนมัติ" msgid "Failed to start print job" msgstr "ไม่สามารถเริ่มงานพิมพ์ได้" -msgid "" -"This calibration does not support the currently selected nozzle diameter" +msgid "This calibration does not support the currently selected nozzle diameter" msgstr "การสอบเทียบนี้ไม่รองรับเส้นผ่านศูนย์กลางหัวฉีดที่เลือกในปัจจุบัน" msgid "Current flowrate cali param is invalid" @@ -4893,9 +4525,7 @@ msgstr "" "ไม่ สำหรับ %s %s" #, boost-format -msgid "" -"Invalid input format. Expected vector of dimensions in the following format: " -"\"%1%\"" +msgid "Invalid input format. Expected vector of dimensions in the following format: \"%1%\"" msgstr "รูปแบบการป้อนข้อมูลไม่ถูกต้อง เวกเตอร์ที่คาดหวังของมิติข้อมูลในรูปแบบต่อไปนี้: \"%1%\"" msgid "Input value is out of range" @@ -4907,12 +4537,8 @@ msgstr "ส่วนขยายบางส่วนในอินพุตไ msgid "This parameter expects a valid template." msgstr "พารามิเตอร์นี้ต้องการเทมเพลตที่ถูกต้อง" -msgid "" -"Invalid pattern. Use N, N#K, or a comma-separated list with optional #K per " -"entry. Examples: 5, 5#2, 1,7,9, 5,9#2,18." -msgstr "" -"รูปแบบไม่ถูกต้อง ใช้ N, N#K หรือรายการที่คั่นด้วยเครื่องหมายจุลภาคโดยมีตัวเลือก #K " -"ให้เลือกต่อรายการ ตัวอย่าง: 5, 5#2, 1,7,9, 5,9#2,18" +msgid "Invalid pattern. Use N, N#K, or a comma-separated list with optional #K per entry. Examples: 5, 5#2, 1,7,9, 5,9#2,18." +msgstr "รูปแบบไม่ถูกต้อง ใช้ N, N#K หรือรายการที่คั่นด้วยเครื่องหมายจุลภาคโดยมีตัวเลือก #K ให้เลือกต่อรายการ ตัวอย่าง: 5, 5#2, 1,7,9, 5,9#2,18" #, boost-format msgid "Invalid format. Expected vector format: \"%1%\"" @@ -5122,12 +4748,8 @@ msgstr "เวลาทั้งหมด" msgid "Total cost" msgstr "ค่าใช้จ่ายทั้งหมด" -msgid "" -"Automatically re-slice according to the optimal filament grouping, and the " -"grouping results will be displayed after slicing." -msgstr "" -"สไลซ์ใหม่โดยอัตโนมัติตามการจัดกลุ่มเส้นพลาสติกที่เหมาะสมที่สุด " -"และผลลัพธ์การจัดกลุ่มจะแสดงหลังจากการสไลซ์" +msgid "Automatically re-slice according to the optimal filament grouping, and the grouping results will be displayed after slicing." +msgstr "สไลซ์ใหม่โดยอัตโนมัติตามการจัดกลุ่มเส้นพลาสติกที่เหมาะสมที่สุด และผลลัพธ์การจัดกลุ่มจะแสดงหลังจากการสไลซ์" msgid "Filament Grouping" msgstr "การจัดกลุ่มเส้นพลาสติก" @@ -5152,41 +4774,27 @@ msgstr "การจัดกลุ่มผลลัพธ์การแบ่ #, boost-format msgid "Increase %1%g filament and %2% changes compared to optimal grouping." -msgstr "" -"เพิ่ม %1%g เส้นพลาสติกและ %2% การเปลี่ยนแปลงเมื่อเปรียบเทียบกับการจัดกลุ่มที่เหมาะสมที่สุด" +msgstr "เพิ่ม %1%g เส้นพลาสติกและ %2% การเปลี่ยนแปลงเมื่อเปรียบเทียบกับการจัดกลุ่มที่เหมาะสมที่สุด" #, boost-format -msgid "" -"Increase %1%g filament and save %2% changes compared to optimal grouping." -msgstr "" -"เพิ่มเส้นพลาสติก %1%g และบันทึกการเปลี่ยนแปลง %2% เมื่อเปรียบเทียบกับการจัดกลุ่มที่เหมาะสมที่สุด" +msgid "Increase %1%g filament and save %2% changes compared to optimal grouping." +msgstr "เพิ่มเส้นพลาสติก %1%g และบันทึกการเปลี่ยนแปลง %2% เมื่อเปรียบเทียบกับการจัดกลุ่มที่เหมาะสมที่สุด" #, boost-format -msgid "" -"Save %1%g filament and increase %2% changes compared to optimal grouping." -msgstr "" -"ประหยัดเส้นพลาสติก %1%g และเพิ่มการเปลี่ยนแปลง %2% เมื่อเปรียบเทียบกับการจัดกลุ่มที่เหมาะสมที่สุด" +msgid "Save %1%g filament and increase %2% changes compared to optimal grouping." +msgstr "ประหยัดเส้นพลาสติก %1%g และเพิ่มการเปลี่ยนแปลง %2% เมื่อเปรียบเทียบกับการจัดกลุ่มที่เหมาะสมที่สุด" #, boost-format -msgid "" -"Save %1%g filament and %2% changes compared to a printer with one nozzle." -msgstr "" -"บันทึก %1%g เส้นพลาสติกและ %2% การเปลี่ยนแปลง เมื่อเปรียบเทียบกับเครื่องพิมพ์ที่มีหัวฉีดเดียว" +msgid "Save %1%g filament and %2% changes compared to a printer with one nozzle." +msgstr "บันทึก %1%g เส้นพลาสติกและ %2% การเปลี่ยนแปลง เมื่อเปรียบเทียบกับเครื่องพิมพ์ที่มีหัวฉีดเดียว" #, boost-format -msgid "" -"Save %1%g filament and increase %2% changes compared to a printer with one " -"nozzle." -msgstr "" -"ประหยัดเส้นพลาสติก %1%g และเพิ่มการเปลี่ยนแปลง %2% เมื่อเทียบกับเครื่องพิมพ์ที่มีหัวฉีดเพียงอันเดียว" +msgid "Save %1%g filament and increase %2% changes compared to a printer with one nozzle." +msgstr "ประหยัดเส้นพลาสติก %1%g และเพิ่มการเปลี่ยนแปลง %2% เมื่อเทียบกับเครื่องพิมพ์ที่มีหัวฉีดเพียงอันเดียว" #, boost-format -msgid "" -"Increase %1%g filament and save %2% changes compared to a printer with one " -"nozzle." -msgstr "" -"เพิ่มเส้นพลาสติก %1%g และประหยัดการเปลี่ยนแปลง %2% " -"เมื่อเปรียบเทียบกับเครื่องพิมพ์ที่มีหัวฉีดเพียงอันเดียว" +msgid "Increase %1%g filament and save %2% changes compared to a printer with one nozzle." +msgstr "เพิ่มเส้นพลาสติก %1%g และประหยัดการเปลี่ยนแปลง %2% เมื่อเปรียบเทียบกับเครื่องพิมพ์ที่มีหัวฉีดเพียงอันเดียว" msgid "Set to Optimal" msgstr "ตั้งค่าให้เหมาะสมที่สุด" @@ -5294,22 +4902,18 @@ msgid "Show normal mode" msgstr "แสดงโหมดปกติ" msgid "" -"An object is placed in the left/right nozzle-only area or exceeds the " -"printable height of the left nozzle.\n" -"Please ensure the filaments used by this object are not arranged to other " -"nozzles." +"An object is placed in the left/right nozzle-only area or exceeds the printable height of the left nozzle.\n" +"Please ensure the filaments used by this object are not arranged to other nozzles." msgstr "" "วัตถุถูกวางในพื้นที่เฉพาะหัวฉีดด้านซ้าย/ขวา หรือเกินความสูงที่สามารถพิมพ์ได้ของหัวฉีดด้านซ้าย\n" "โปรดตรวจสอบให้แน่ใจว่าเส้นพลาสติกที่ใช้โดยวัตถุนี้ไม่ได้ถูกจัดเรียงเข้ากับหัวฉีดอื่น" msgid "" "An object is laid over the boundary of plate or exceeds the height limit.\n" -"Please solve the problem by moving it totally on or off the plate, and " -"confirming that the height is within the build volume." +"Please solve the problem by moving it totally on or off the plate, and confirming that the height is within the build volume." msgstr "" "วัตถุวางอยู่เหนือขอบเขตของแผ่นหรือสูงเกินขีดจำกัดความสูง\n" -"โปรดแก้ไขปัญหาด้วยการเลื่อนเข้าหรือออกจากเพลตโดยสิ้นเชิง " -"และยืนยันว่าความสูงอยู่ภายในปริมาตรงานประกอบ" +"โปรดแก้ไขปัญหาด้วยการเลื่อนเข้าหรือออกจากเพลตโดยสิ้นเชิง และยืนยันว่าความสูงอยู่ภายในปริมาตรงานประกอบ" msgid "Variable layer height" msgstr "ความสูงของชั้นตัวแปร" @@ -5356,17 +4960,11 @@ msgstr "ปุ่มตัวเลข" msgid "Number keys can quickly change the color of objects" msgstr "ปุ่มตัวเลขสามารถเปลี่ยนสีของวัตถุได้อย่างรวดเร็ว" -msgid "" -"Following objects are laid over the boundary of plate or exceeds the height " -"limit:\n" +msgid "Following objects are laid over the boundary of plate or exceeds the height limit:\n" msgstr "วัตถุต่อไปนี้วางอยู่เหนือขอบเขตของแผ่นหรือสูงเกินขีดจำกัดความสูง:\n" -msgid "" -"Please solve the problem by moving it totally on or off the plate, and " -"confirming that the height is within the build volume.\n" -msgstr "" -"โปรดแก้ไขปัญหาด้วยการเลื่อนเข้าหรือออกจากเพลตโดยสิ้นเชิง " -"และยืนยันว่าความสูงอยู่ภายในปริมาตรงานประกอบ\n" +msgid "Please solve the problem by moving it totally on or off the plate, and confirming that the height is within the build volume.\n" +msgstr "โปรดแก้ไขปัญหาด้วยการเลื่อนเข้าหรือออกจากเพลตโดยสิ้นเชิง และยืนยันว่าความสูงอยู่ภายในปริมาตรงานประกอบ\n" msgid "left nozzle" msgstr "หัวฉีดซ้าย" @@ -5382,9 +4980,7 @@ msgstr "ตำแหน่งหรือขนาดของบางรุ่ msgid "The position or size of the model %s exceeds the %s's printable range." msgstr "ตำแหน่งหรือขนาดของโมเดล %s เกินช่วงที่สามารถพิมพ์ได้ของ %s" -msgid "" -" Please check and adjust the part's position or size to fit the printable " -"range:\n" +msgid " Please check and adjust the part's position or size to fit the printable range:\n" msgstr "โปรดตรวจสอบและปรับตำแหน่งหรือขนาดของชิ้นส่วนให้พอดีกับช่วงที่สามารถพิมพ์ได้:\n" #, boost-format @@ -5554,12 +5150,8 @@ msgid "Size:" msgstr "ขนาด:" #, c-format, boost-format -msgid "" -"Conflicts of G-code paths have been found at layer %d, Z = %.2lfmm. Please " -"separate the conflicted objects farther (%s <-> %s)." -msgstr "" -"พบความขัดแย้งของเส้นทางรหัส G ที่เลเยอร์ %d, Z = %.2lfmm " -"โปรดแยกวัตถุที่ขัดแย้งกันให้ไกลออกไป (%s <-> %s)" +msgid "Conflicts of G-code paths have been found at layer %d, Z = %.2lfmm. Please separate the conflicted objects farther (%s <-> %s)." +msgstr "พบความขัดแย้งของเส้นทางรหัส G ที่เลเยอร์ %d, Z = %.2lfmm โปรดแยกวัตถุที่ขัดแย้งกันให้ไกลออกไป (%s <-> %s)" msgid "An object is laid over the plate boundaries." msgstr "มีวัตถุวางอยู่เหนือขอบเขตของแผ่น" @@ -5578,32 +5170,20 @@ msgid "Tool %d" msgstr "เครื่องมือ %d" #, c-format, boost-format -msgid "" -"Filament %s is placed in the %s, but the generated G-code path exceeds the " -"printable range of the %s." -msgstr "" -"เส้นพลาสติก %s ถูกวางไว้ใน %s แต่เส้นทาง G-code ที่สร้างขึ้นเกินช่วงที่สามารถพิมพ์ได้ของ %s" +msgid "Filament %s is placed in the %s, but the generated G-code path exceeds the printable range of the %s." +msgstr "เส้นพลาสติก %s ถูกวางไว้ใน %s แต่เส้นทาง G-code ที่สร้างขึ้นเกินช่วงที่สามารถพิมพ์ได้ของ %s" #, c-format, boost-format -msgid "" -"Filaments %s are placed in the %s, but the generated G-code path exceeds the " -"printable range of the %s." -msgstr "" -"เส้นพลาสติก %s ถูกวางไว้ใน %s แต่เส้นทาง G-code ที่สร้างขึ้นเกินช่วงที่สามารถพิมพ์ได้ของ %s" +msgid "Filaments %s are placed in the %s, but the generated G-code path exceeds the printable range of the %s." +msgstr "เส้นพลาสติก %s ถูกวางไว้ใน %s แต่เส้นทาง G-code ที่สร้างขึ้นเกินช่วงที่สามารถพิมพ์ได้ของ %s" #, c-format, boost-format -msgid "" -"Filament %s is placed in the %s, but the generated G-code path exceeds the " -"printable height of the %s." -msgstr "" -"เส้นพลาสติก %s ถูกวางไว้ใน %s แต่เส้นทาง G-code ที่สร้างขึ้นเกินความสูงที่สามารถพิมพ์ได้ของ %s" +msgid "Filament %s is placed in the %s, but the generated G-code path exceeds the printable height of the %s." +msgstr "เส้นพลาสติก %s ถูกวางไว้ใน %s แต่เส้นทาง G-code ที่สร้างขึ้นเกินความสูงที่สามารถพิมพ์ได้ของ %s" #, c-format, boost-format -msgid "" -"Filaments %s are placed in the %s, but the generated G-code path exceeds the " -"printable height of the %s." -msgstr "" -"เส้นพลาสติก %s ถูกวางไว้ใน %s แต่เส้นทาง G-code ที่สร้างขึ้นเกินความสูงที่สามารถพิมพ์ได้ของ %s" +msgid "Filaments %s are placed in the %s, but the generated G-code path exceeds the printable height of the %s." +msgstr "เส้นพลาสติก %s ถูกวางไว้ใน %s แต่เส้นทาง G-code ที่สร้างขึ้นเกินความสูงที่สามารถพิมพ์ได้ของ %s" msgid "Open wiki for more information." msgstr "เปิดวิกิเพื่อดูข้อมูลเพิ่มเติม" @@ -5615,22 +5195,14 @@ msgstr "มองเห็นได้เฉพาะวัตถุที่ก msgid "Filaments %s cannot be printed directly on the surface of this plate." msgstr "ไม่สามารถพิมพ์เส้นพลาสติก %s ลงบนพื้นผิวของเพลตนี้ได้โดยตรง" -msgid "" -"PLA and PETG filaments detected in the mixture. Adjust parameters according " -"to the Wiki to ensure print quality." -msgstr "" -"ตรวจพบเส้นพลาสติก PLA และ PETG ในส่วนผสม ปรับพารามิเตอร์ตาม Wiki " -"เพื่อรับรองคุณภาพการพิมพ์" +msgid "PLA and PETG filaments detected in the mixture. Adjust parameters according to the Wiki to ensure print quality." +msgstr "ตรวจพบเส้นพลาสติก PLA และ PETG ในส่วนผสม ปรับพารามิเตอร์ตาม Wiki เพื่อรับรองคุณภาพการพิมพ์" msgid "The prime tower extends beyond the plate boundary." msgstr "หอคอยหลักขยายออกไปเกินขอบเขตแผ่นเปลือกโลก" -msgid "" -"Partial flushing volume set to 0. Multi-color printing may cause color " -"mixing in models. Please readjust flushing settings." -msgstr "" -"ตั้งค่าปริมาณการไล่เส้นบางส่วนเป็น 0 การพิมพ์หลายสีอาจทำให้เกิดการผสมสีในรุ่นต่างๆ " -"โปรดปรับการตั้งค่าการไล่เส้นใหม่" +msgid "Partial flushing volume set to 0. Multi-color printing may cause color mixing in models. Please readjust flushing settings." +msgstr "ตั้งค่าปริมาณการไล่เส้นบางส่วนเป็น 0 การพิมพ์หลายสีอาจทำให้เกิดการผสมสีในรุ่นต่างๆ โปรดปรับการตั้งค่าการไล่เส้นใหม่" msgid "Click Wiki for help." msgstr "คลิก Wiki เพื่อขอความช่วยเหลือ" @@ -5660,8 +5232,7 @@ msgid "Calibration program" msgstr "โปรแกรมสอบเทียบ" msgid "" -"The calibration program detects the status of your device automatically to " -"minimize deviation.\n" +"The calibration program detects the status of your device automatically to minimize deviation.\n" "It keeps the device performing optimally." msgstr "" "โปรแกรมปรับเทียบจะตรวจจับสถานะของอุปกรณ์ของคุณโดยอัตโนมัติเพื่อลดความเบี่ยงเบน\n" @@ -6019,11 +5590,8 @@ msgstr "ใช้มุมมองมุมฉาก" msgid "Auto Perspective" msgstr "มุมมองอัตโนมัติ" -msgid "" -"Automatically switch between orthographic and perspective when changing from " -"top/bottom/side views." -msgstr "" -"สลับระหว่างออร์โธกราฟิกและเปอร์สเปคทีฟโดยอัตโนมัติเมื่อเปลี่ยนจากมุมมองด้านบน/ล่าง/ด้านข้าง" +msgid "Automatically switch between orthographic and perspective when changing from top/bottom/side views." +msgstr "สลับระหว่างออร์โธกราฟิกและเปอร์สเปคทีฟโดยอัตโนมัติเมื่อเปลี่ยนจากมุมมองด้านบน/ล่าง/ด้านข้าง" msgid "Show &G-code Window" msgstr "แสดงหน้าต่าง &G-code" @@ -6194,15 +5762,12 @@ msgstr "เลือกโปรไฟล์ที่จะโหลด:" #, c-format, boost-format msgid "There is %d config imported. (Only non-system and compatible configs)" -msgid_plural "" -"There are %d configs imported. (Only non-system and compatible configs)" -msgstr[0] "" -"There is %d config imported. (Only non-system and compatible configs)" +msgid_plural "There are %d configs imported. (Only non-system and compatible configs)" +msgstr[0] "There is %d config imported. (Only non-system and compatible configs)" msgid "" "\n" -"Hint: Make sure you have added the corresponding printer before importing " -"the configs." +"Hint: Make sure you have added the corresponding printer before importing the configs." msgstr "" "\n" "คำแนะนำ: ตรวจสอบให้แน่ใจว่าคุณได้เพิ่มเครื่องพิมพ์ที่เกี่ยวข้องก่อนที่จะนำเข้าการกำหนดค่า" @@ -6241,18 +5806,13 @@ msgstr "เครื่องเล่นทำงานผิดปกติ msgid "The player is not loaded; please click the \"play\" button to retry." msgstr "โปรแกรมเล่นไม่ได้โหลด กรุณาคลิกปุ่ม \"เล่น\" เพื่อลองอีกครั้ง" -msgid "" -"The player is not loaded because the GStreamer GTK video sink is missing or " -"failed to initialize." -msgstr "" -"ไม่ได้โหลดโปรแกรมเล่นเนื่องจาก GStreamer GTK video sink หายไปหรือไม่สามารถเริ่มต้นได้" +msgid "The player is not loaded because the GStreamer GTK video sink is missing or failed to initialize." +msgstr "ไม่ได้โหลดโปรแกรมเล่นเนื่องจาก GStreamer GTK video sink หายไปหรือไม่สามารถเริ่มต้นได้" msgid "Please confirm if the printer is connected." msgstr "โปรดยืนยันว่าเครื่องพิมพ์เชื่อมต่ออยู่หรือไม่" -msgid "" -"The printer is currently busy downloading. Please try again after it " -"finishes." +msgid "The printer is currently busy downloading. Please try again after it finishes." msgstr "เครื่องพิมพ์กำลังยุ่งอยู่กับการดาวน์โหลด โปรดลองอีกครั้งหลังจากเสร็จสิ้น" msgid "Printer camera is malfunctioning." @@ -6261,8 +5821,7 @@ msgstr "กล้องเครื่องพิมพ์ทำงานผิ msgid "A problem occurred. Please update the printer firmware and try again." msgstr "เกิดปัญหาขึ้น โปรดอัปเดตเฟิร์มแวร์เครื่องพิมพ์แล้วลองอีกครั้ง" -msgid "" -"LAN Only Liveview is off. Please turn on the liveview on printer screen." +msgid "LAN Only Liveview is off. Please turn on the liveview on printer screen." msgstr "LAN Only Liveview ปิดอยู่ กรุณาเปิด liveview บนหน้าจอเครื่องพิมพ์" msgid "Please enter the IP of the printer to connect." @@ -6274,11 +5833,8 @@ msgstr "กำลังเริ่มต้น..." msgid "Connection Failed. Please check the network and try again" msgstr "การเชื่อมต่อล้มเหลว โปรดตรวจสอบเครือข่ายแล้วลองอีกครั้ง" -msgid "" -"Please check the network and try again. You can restart or update the " -"printer if the issue persists." -msgstr "" -"โปรดตรวจสอบเครือข่ายแล้วลองอีกครั้ง คุณสามารถรีสตาร์ทหรืออัปเดตเครื่องพิมพ์ได้หากปัญหายังคงมีอยู่" +msgid "Please check the network and try again. You can restart or update the printer if the issue persists." +msgstr "โปรดตรวจสอบเครือข่ายแล้วลองอีกครั้ง คุณสามารถรีสตาร์ทหรืออัปเดตเครื่องพิมพ์ได้หากปัญหายังคงมีอยู่" msgid "The printer has been logged out and cannot connect." msgstr "เครื่องพิมพ์ออกจากระบบและไม่สามารถเชื่อมต่อได้" @@ -6387,11 +5943,8 @@ msgstr "ไม่มีไฟล์" msgid "Load failed" msgstr "โหลดล้มเหลว" -msgid "" -"Browsing file in storage is not supported in current firmware. Please update " -"the printer firmware." -msgstr "" -"การเรียกดูไฟล์ในที่จัดเก็บข้อมูลไม่ได้รับส่วนรองรับในเฟิร์มแวร์ปัจจุบัน โปรดอัปเดตเฟิร์มแวร์เครื่องพิมพ์" +msgid "Browsing file in storage is not supported in current firmware. Please update the printer firmware." +msgstr "การเรียกดูไฟล์ในที่จัดเก็บข้อมูลไม่ได้รับส่วนรองรับในเฟิร์มแวร์ปัจจุบัน โปรดอัปเดตเฟิร์มแวร์เครื่องพิมพ์" msgid "LAN Connection Failed (Failed to view sdcard)" msgstr "การเชื่อมต่อ LAN ล้มเหลว (ไม่สามารถดู sdcard)" @@ -6401,10 +5954,8 @@ msgstr "ไม่รองรับการเรียกดูไฟล์ใ #, c-format, boost-format msgid "You are going to delete %u file from printer. Are you sure to continue?" -msgid_plural "" -"You are going to delete %u files from printer. Are you sure to continue?" -msgstr[0] "" -"You are going to delete %u file from printer. Are you sure to continue?" +msgid_plural "You are going to delete %u files from printer. Are you sure to continue?" +msgstr[0] "You are going to delete %u file from printer. Are you sure to continue?" msgid "Delete files" msgstr "ไฟล์ลบ" @@ -6425,12 +5976,8 @@ msgstr "ไม่สามารถดึงข้อมูลรุ่นจา msgid "Failed to parse model information." msgstr "ไม่สามารถแยกวิเคราะห์ข้อมูลโมเดล" -msgid "" -"The .gcode.3mf file contains no G-code data. Please slice it with Orca " -"Slicer and export a new .gcode.3mf file." -msgstr "" -"ไฟล์ .gcode.3mf ไม่มีข้อมูล G-code โปรดแบ่งส่วนด้วย Orca Slicer และส่งออกไฟล์ ." -"gcode.3mf ใหม่" +msgid "The .gcode.3mf file contains no G-code data. Please slice it with Orca Slicer and export a new .gcode.3mf file." +msgstr "ไฟล์ .gcode.3mf ไม่มีข้อมูล G-code โปรดแบ่งส่วนด้วย Orca Slicer และส่งออกไฟล์ .gcode.3mf ใหม่" #, c-format, boost-format msgid "File '%s' was lost! Please download it again." @@ -6463,11 +6010,8 @@ msgstr "กำลังดาวน์โหลด %d%%..." msgid "Air Condition" msgstr "ปรับอากาศ" -msgid "" -"Reconnecting the printer, the operation cannot be completed immediately, " -"please try again later." -msgstr "" -"กำลังเชื่อมต่อเครื่องพิมพ์ใหม่ ไม่สามารถดำเนินการให้เสร็จสิ้นได้ในทันที โปรดลองอีกครั้งในภายหลัง" +msgid "Reconnecting the printer, the operation cannot be completed immediately, please try again later." +msgstr "กำลังเชื่อมต่อเครื่องพิมพ์ใหม่ ไม่สามารถดำเนินการให้เสร็จสิ้นได้ในทันที โปรดลองอีกครั้งในภายหลัง" msgid "Timeout, please try again." msgstr "หมดเวลา โปรดลองอีกครั้ง" @@ -6488,9 +6032,7 @@ msgstr "" "โปรดตรวจสอบว่ามีการใส่ที่เก็บข้อมูลเข้าไปในเครื่องพิมพ์หรือไม่\n" "หากยังไม่สามารถอ่านได้ คุณสามารถลองฟอร์แมตที่จัดเก็บข้อมูลได้" -msgid "" -"The firmware version of the printer is too low. Please update the firmware " -"and try again." +msgid "The firmware version of the printer is too low. Please update the firmware and try again." msgstr "เวอร์ชันเฟิร์มแวร์ของเครื่องพิมพ์ต่ำเกินไป โปรดอัปเดตเฟิร์มแวร์แล้วลองอีกครั้ง" msgid "The file already exists, do you want to replace it?" @@ -6661,9 +6203,7 @@ msgstr "" msgid "How do you like this printing file?" msgstr "คุณชอบไฟล์การพิมพ์นี้อย่างไร?" -msgid "" -"(The model has already been rated. Your rating will overwrite the previous " -"rating.)" +msgid "(The model has already been rated. Your rating will overwrite the previous rating.)" msgstr "(แบบจำลองได้รับการจัดอันดับแล้ว การให้คะแนนของคุณจะเขียนทับการให้คะแนนครั้งก่อน)" msgid "Rate" @@ -6720,9 +6260,7 @@ msgstr "คุณแน่ใจหรือไม่ว่าต้องกา msgid "The printer is busy with another print job." msgstr "เครื่องพิมพ์กำลังยุ่งอยู่กับงานพิมพ์อื่น" -msgid "" -"When printing is paused, filament loading and unloading are only supported " -"for external slots." +msgid "When printing is paused, filament loading and unloading are only supported for external slots." msgstr "เมื่อหยุดการพิมพ์ชั่วคราว การโหลดฟิลาเมนท์และการขนถ่ายจะรองรับเฉพาะช่องภายนอกเท่านั้น" msgid "Current extruder is busy changing filament." @@ -6755,29 +6293,20 @@ msgstr "เลเยอร์: %s" msgid "Layer: %d/%d" msgstr "เลเยอร์: %d/%d" -msgid "" -"Please heat the nozzle to above 170℃ before loading or unloading filament." +msgid "Please heat the nozzle to above 170℃ before loading or unloading filament." msgstr "กรุณาตั้งอุณหภูมิหัวฉีดให้สูงกว่า 170°C ก่อนที่จะบรรจุหรือขนถ่ายเส้นพลาสติก" msgid "Chamber temperature cannot be changed in cooling mode while printing." msgstr "อุณหภูมิห้องเพาะเลี้ยงไม่สามารถเปลี่ยนแปลงได้ในโหมดทำความเย็นขณะพิมพ์" -msgid "" -"If the chamber temperature exceeds 40℃, the system will automatically switch " -"to heating mode. Please confirm whether to switch." -msgstr "" -"หากอุณหภูมิห้องเพาะเกิน 40°C ระบบจะเปลี่ยนเป็นโหมดทำความร้อนโดยอัตโนมัติ " -"โปรดยืนยันว่าจะสลับหรือไม่" +msgid "If the chamber temperature exceeds 40℃, the system will automatically switch to heating mode. Please confirm whether to switch." +msgstr "หากอุณหภูมิห้องเพาะเกิน 40°C ระบบจะเปลี่ยนเป็นโหมดทำความร้อนโดยอัตโนมัติ โปรดยืนยันว่าจะสลับหรือไม่" msgid "Please select an AMS slot before calibration" msgstr "โปรดเลือกช่อง AMS ก่อนการสอบเทียบ" -msgid "" -"Cannot read filament info: the filament is loaded to the tool head. Please " -"unload the filament and try again." -msgstr "" -"ไม่สามารถอ่านข้อมูลเส้นพลาสติกได้: โหลดเส้นพลาสติกไปที่หัวเครื่องมือแล้ว " -"โปรดยกเลิกการโหลดเส้นพลาสติกแล้วลองอีกครั้ง" +msgid "Cannot read filament info: the filament is loaded to the tool head. Please unload the filament and try again." +msgstr "ไม่สามารถอ่านข้อมูลเส้นพลาสติกได้: โหลดเส้นพลาสติกไปที่หัวเครื่องมือแล้ว โปรดยกเลิกการโหลดเส้นพลาสติกแล้วลองอีกครั้ง" msgid "This only takes effect during printing" msgstr "ซึ่งจะมีผลเฉพาะระหว่างการพิมพ์เท่านั้น" @@ -6794,12 +6323,8 @@ msgstr "สปอร์ต" msgid "Ludicrous" msgstr "เร็วสุด" -msgid "" -"Turning off the lights during the task will cause the failure of AI " -"monitoring, like spaghetti detection. Please choose carefully." -msgstr "" -"การปิดไฟระหว่างทำงานจะทำให้การตรวจสอบ AI ล้มเหลว เช่น การตรวจจับสปาเก็ตตี้ " -"โปรดเลือกอย่างระมัดระวัง" +msgid "Turning off the lights during the task will cause the failure of AI monitoring, like spaghetti detection. Please choose carefully." +msgstr "การปิดไฟระหว่างทำงานจะทำให้การตรวจสอบ AI ล้มเหลว เช่น การตรวจจับสปาเก็ตตี้ โปรดเลือกอย่างระมัดระวัง" msgid "Keep it On" msgstr "เก็บไว้บน" @@ -6853,11 +6378,9 @@ msgid " cannot be opened\n" msgstr "ไม่สามารถเปิดได้\n" msgid "" -"The following issues occurred during the process of uploading images. Do you " -"want to ignore them?\n" +"The following issues occurred during the process of uploading images. Do you want to ignore them?\n" "\n" -msgstr "" -"ปัญหาต่อไปนี้เกิดขึ้นระหว่างกระบวนการอัพโหลดรูปภาพ คุณต้องการที่จะเพิกเฉยต่อพวกเขาหรือไม่?\n" +msgstr "ปัญหาต่อไปนี้เกิดขึ้นระหว่างกระบวนการอัพโหลดรูปภาพ คุณต้องการที่จะเพิกเฉยต่อพวกเขาหรือไม่?\n" msgid "info" msgstr "ข้อมูล" @@ -6891,11 +6414,8 @@ msgstr "" "\n" "คุณต้องการเปลี่ยนเส้นทางไปยังหน้าเว็บเพื่อให้คะแนนหรือไม่" -msgid "" -"Some of your images failed to upload. Would you like to redirect to the " -"webpage to give a rating?" -msgstr "" -"รูปภาพบางรูปของคุณล้มเหลวในการอัปโหลด คุณต้องการเปลี่ยนเส้นทางไปยังหน้าเว็บเพื่อให้คะแนนหรือไม่" +msgid "Some of your images failed to upload. Would you like to redirect to the webpage to give a rating?" +msgstr "รูปภาพบางรูปของคุณล้มเหลวในการอัปโหลด คุณต้องการเปลี่ยนเส้นทางไปยังหน้าเว็บเพื่อให้คะแนนหรือไม่" msgid "You can select up to 16 images." msgstr "คุณสามารถเลือกได้สูงสุด 16 ภาพ" @@ -6967,9 +6487,7 @@ msgstr "ข้าม" msgid "Newer 3MF version" msgstr "เวอร์ชัน 3MF ที่ใหม่กว่า" -msgid "" -"The 3MF file version is in Beta and it is newer than the current OrcaSlicer " -"version." +msgid "The 3MF file version is in Beta and it is newer than the current OrcaSlicer version." msgstr "เวอร์ชันไฟล์ 3MF อยู่ในรุ่นเบต้าและใหม่กว่าเวอร์ชัน OrcaSlicer ปัจจุบัน" msgid "If you would like to try Orca Slicer Beta, you may click to" @@ -6981,8 +6499,7 @@ msgstr "ดาวน์โหลดเวอร์ชันเบต้า" msgid "The 3MF file version is newer than the current OrcaSlicer version." msgstr "เวอร์ชันไฟล์ 3MF ใหม่กว่าเวอร์ชัน OrcaSlicer ปัจจุบัน" -msgid "" -"Updating your OrcaSlicer could enable all functionality in the 3MF file." +msgid "Updating your OrcaSlicer could enable all functionality in the 3MF file." msgstr "การอัปเดต OrcaSlicer ของคุณสามารถเปิดใช้งานฟังก์ชันทั้งหมดในไฟล์ 3MF" msgid "Current Version: " @@ -7001,17 +6518,11 @@ msgstr "ยังไม่ใช่ตอนนี้" msgid "Server Exception" msgstr "ข้อยกเว้นของเซิร์ฟเวอร์" -msgid "" -"The server is unable to respond. Please click the link below to check the " -"server status." +msgid "The server is unable to respond. Please click the link below to check the server status." msgstr "เซิร์ฟเวอร์ไม่สามารถตอบสนองได้ กรุณาคลิกลิงค์ด้านล่างเพื่อตรวจสอบสถานะเซิร์ฟเวอร์" -msgid "" -"If the server is in a fault state, you can temporarily use offline printing " -"or local network printing." -msgstr "" -"หากเซิร์ฟเวอร์อยู่ในสถานะผิดปกติ " -"คุณสามารถใช้การพิมพ์ออฟไลน์หรือการพิมพ์ผ่านเครือข่ายท้องถิ่นได้ชั่วคราว" +msgid "If the server is in a fault state, you can temporarily use offline printing or local network printing." +msgstr "หากเซิร์ฟเวอร์อยู่ในสถานะผิดปกติ คุณสามารถใช้การพิมพ์ออฟไลน์หรือการพิมพ์ผ่านเครือข่ายท้องถิ่นได้ชั่วคราว" msgid "How to use LAN only mode" msgstr "วิธีใช้โหมด LAN เท่านั้น" @@ -7144,9 +6655,7 @@ msgstr "ตัดขั้วต่อ" msgid "Layers" msgstr "เลเยอร์" -msgid "" -"The application cannot run normally because OpenGL version is lower than " -"3.2.\n" +msgid "The application cannot run normally because OpenGL version is lower than 3.2.\n" msgstr "แอปพลิเคชันไม่สามารถทำงานได้ตามปกติเนื่องจากเวอร์ชัน OpenGL ต่ำกว่า 3.2\n" msgid "Please upgrade your graphics card driver." @@ -7177,28 +6686,19 @@ msgstr "ล่าง" msgid "Enable detection of build plate position" msgstr "เปิดใช้งานการตรวจจับตำแหน่งฐานรองแท่นพิมพ์" -msgid "" -"The localization tag of the build plate will be detected, and printing will " -"be paused if the tag is not in predefined range." -msgstr "" -"ตรวจพบแท็กระบุตำแหน่งของเพลต และการพิมพ์จะหยุดชั่วคราวหากแท็กไม่อยู่ในช่วงที่กำหนดไว้ล่วงหน้า" +msgid "The localization tag of the build plate will be detected, and printing will be paused if the tag is not in predefined range." +msgstr "ตรวจพบแท็กระบุตำแหน่งของเพลต และการพิมพ์จะหยุดชั่วคราวหากแท็กไม่อยู่ในช่วงที่กำหนดไว้ล่วงหน้า" msgid "Build Plate Detection" msgstr "ตรวจจับฐานพิมพ์" -msgid "" -"Identifies the type and position of the build plate on the heatbed. Pausing " -"printing if a mismatch is detected." -msgstr "" -"ระบุประเภทและตำแหน่งของแผ่นฐานรองพิมพ์บนฐานพิมพ์ทำความร้อน " -"หยุดการพิมพ์ชั่วคราวหากตรวจพบความไม่ตรงกัน" +msgid "Identifies the type and position of the build plate on the heatbed. Pausing printing if a mismatch is detected." +msgstr "ระบุประเภทและตำแหน่งของแผ่นฐานรองพิมพ์บนฐานพิมพ์ทำความร้อน หยุดการพิมพ์ชั่วคราวหากตรวจพบความไม่ตรงกัน" msgid "AI Detections" msgstr "การตรวจจับเอไอ" -msgid "" -"Printer will send assistant message or pause printing if any of the " -"following problem is detected." +msgid "Printer will send assistant message or pause printing if any of the following problem is detected." msgstr "เครื่องพิมพ์จะส่งข้อความผู้ช่วยหรือหยุดการพิมพ์ชั่วคราว หากตรวจพบปัญหาใดๆ ต่อไปนี้" msgid "Enable AI monitoring of printing" @@ -7237,12 +6737,8 @@ msgstr "กู้คืนอัตโนมัติจากการสูญ msgid "Store Sent Files on External Storage" msgstr "จัดเก็บไฟล์ที่ส่งไปยังที่จัดเก็บข้อมูลภายนอก" -msgid "" -"Save the printing files initiated from Bambu Studio, Bambu Handy and " -"MakerWorld on External Storage" -msgstr "" -"บันทึกไฟล์การพิมพ์ที่เริ่มต้นจาก Bambu Studio, Bambu Handy และ MakerWorld " -"บนที่จัดเก็บข้อมูลภายนอก" +msgid "Save the printing files initiated from Bambu Studio, Bambu Handy and MakerWorld on External Storage" +msgstr "บันทึกไฟล์การพิมพ์ที่เริ่มต้นจาก Bambu Studio, Bambu Handy และ MakerWorld บนที่จัดเก็บข้อมูลภายนอก" msgid "Allow Prompt Sound" msgstr "อนุญาตเสียงพร้อมท์" @@ -7364,13 +6860,10 @@ msgid " nozzle" msgstr "หัวฉีด" #, boost-format -msgid "" -"It is not recommended to print the following filament(s) with %1%: %2%\n" +msgid "It is not recommended to print the following filament(s) with %1%: %2%\n" msgstr "ไม่แนะนำให้พิมพ์เส้นพลาสติกต่อไปนี้ด้วย %1%: %2%\n" -msgid "" -"It is not recommended to use the following nozzle and filament " -"combinations:\n" +msgid "It is not recommended to use the following nozzle and filament combinations:\n" msgstr "ไม่แนะนำให้ใช้หัวฉีดและเส้นพลาสติกผสมกันดังต่อไปนี้:\n" #, boost-format @@ -7414,15 +6907,8 @@ msgstr "AMS(1 ช่อง)" msgid "Not installed" msgstr "ไม่ได้ติดตั้ง" -msgid "" -"The software does not support using different diameter of nozzles for one " -"print. If the left and right nozzles are inconsistent, we can only proceed " -"with single-head printing. Please confirm which nozzle you would like to use " -"for this project." -msgstr "" -"ซอฟต์แวร์ไม่รองรับการใช้หัวฉีดที่มีเส้นผ่านศูนย์กลางต่างกันในการพิมพ์ครั้งเดียว " -"หากหัวฉีดด้านซ้ายและขวาไม่สอดคล้องกัน เราสามารถดำเนินการพิมพ์แบบหัวเดียวเท่านั้น " -"โปรดยืนยันว่าคุณต้องการใช้หัวฉีดใดสำหรับโปรเจ็กต์นี้" +msgid "The software does not support using different diameter of nozzles for one print. If the left and right nozzles are inconsistent, we can only proceed with single-head printing. Please confirm which nozzle you would like to use for this project." +msgstr "ซอฟต์แวร์ไม่รองรับการใช้หัวฉีดที่มีเส้นผ่านศูนย์กลางต่างกันในการพิมพ์ครั้งเดียว หากหัวฉีดด้านซ้ายและขวาไม่สอดคล้องกัน เราสามารถดำเนินการพิมพ์แบบหัวเดียวเท่านั้น โปรดยืนยันว่าคุณต้องการใช้หัวฉีดใดสำหรับโปรเจ็กต์นี้" msgid "Switch diameter" msgstr "สลับเส้นผ่านศูนย์กลาง" @@ -7434,16 +6920,13 @@ msgid "Sync printer information" msgstr "ซิงค์ข้อมูลเครื่องพิมพ์" msgid "" -"The currently selected machine preset is inconsistent with the connected " -"printer type.\n" +"The currently selected machine preset is inconsistent with the connected printer type.\n" "Are you sure to continue syncing?" msgstr "" "ค่าที่ตั้งล่วงหน้าของเครื่องที่เลือกในปัจจุบันไม่สอดคล้องกับประเภทเครื่องพิมพ์ที่เชื่อมต่อ\n" "คุณแน่ใจหรือไม่ว่าจะดำเนินการซิงค์ต่อ?" -msgid "" -"There are unset nozzle types. Please set the nozzle types of all extruders " -"before synchronizing." +msgid "There are unset nozzle types. Please set the nozzle types of all extruders before synchronizing." msgstr "มีประเภทหัวฉีดที่ไม่ได้ตั้งค่า โปรดตั้งค่าประเภทหัวฉีดของชุดดันเส้นทั้งหมดก่อนทำการซิงโครไนซ์" msgid "Sync extruder infomation" @@ -7483,9 +6966,7 @@ msgid "Pellets" msgstr "เม็ด" #, c-format, boost-format -msgid "" -"After completing your operation, %s project will be closed and create a new " -"project." +msgid "After completing your operation, %s project will be closed and create a new project." msgstr "หลังจากเสร็จสิ้นการดำเนินการของคุณ โครงการ %s จะถูกปิดและสร้างโครงการใหม่" msgid "There are no compatible filaments, and sync is not performed." @@ -7496,19 +6977,15 @@ msgstr "ซิงค์เส้นพลาสติกกับ AMS" msgid "" "There are some unknown or incompatible filaments mapped to generic preset.\n" -"Please update Orca Slicer or restart Orca Slicer to check if there is an " -"update to system presets." +"Please update Orca Slicer or restart Orca Slicer to check if there is an update to system presets." msgstr "" "มีเส้นพลาสติกที่ไม่รู้จักหรือเข้ากันไม่ได้บางส่วนที่แมปกับค่าที่ตั้งล่วงหน้าทั่วไป\n" -"โปรดอัปเดต Orca Slicer หรือรีสตาร์ท Orca Slicer " -"เพื่อตรวจสอบว่ามีการอัปเดตการตั้งค่าล่วงหน้าของระบบหรือไม่" +"โปรดอัปเดต Orca Slicer หรือรีสตาร์ท Orca Slicer เพื่อตรวจสอบว่ามีการอัปเดตการตั้งค่าล่วงหน้าของระบบหรือไม่" msgid "Only filament color information has been synchronized from printer." msgstr "เฉพาะข้อมูลสีของเส้นพลาสติกเท่านั้นที่ได้รับการซิงโครไนซ์จากเครื่องพิมพ์" -msgid "" -"Filament type and color information have been synchronized, but slot " -"information is not included." +msgid "Filament type and color information have been synchronized, but slot information is not included." msgstr "ข้อมูลประเภทเส้นพลาสติกและสีได้รับการซิงโครไนซ์แล้ว แต่ไม่รวมข้อมูลช่อง" #, boost-format @@ -7516,53 +6993,30 @@ msgid "Do you want to save changes to \"%1%\"?" msgstr "คุณต้องการบันทึกการเปลี่ยนแปลงใน \"%1%\" หรือไม่?" #, c-format, boost-format -msgid "" -"Successfully unmounted. The device %s (%s) can now be safely removed from " -"the computer." -msgstr "" -"ยกเลิกการต่อเชื่อมสำเร็จแล้ว ขณะนี้สามารถลบอุปกรณ์ %s (%s) " -"ออกจากคอมพิวเตอร์ได้อย่างปลอดภัยแล้ว" +msgid "Successfully unmounted. The device %s (%s) can now be safely removed from the computer." +msgstr "ยกเลิกการต่อเชื่อมสำเร็จแล้ว ขณะนี้สามารถลบอุปกรณ์ %s (%s) ออกจากคอมพิวเตอร์ได้อย่างปลอดภัยแล้ว" #, c-format, boost-format msgid "Ejecting of device %s (%s) has failed." msgstr "การดีดอุปกรณ์ %s (%s) ล้มเหลว" -msgid "" -"Previously unsaved items have been detected. Do you want to restore them?" +msgid "Previously unsaved items have been detected. Do you want to restore them?" msgstr "ตรวจพบโปรเจ็กต์ที่ยังไม่ได้บันทึกก่อนหน้านี้ คุณต้องการกู้คืนหรือไม่" msgid "Restore" msgstr "คืนค่า" -msgid "" -"The current heatbed temperature is relatively high. The nozzle may clog when " -"printing this filament in a closed environment. Please open the front door " -"and/or remove the upper glass." -msgstr "" -"อุณหภูมิฐานพิมพ์ร้อนในปัจจุบันค่อนข้างสูง หัวฉีดอาจอุดตันเมื่อพิมพ์เส้นพลาสติกนี้ในตู้ปิด " -"กรุณาเปิดประตูหน้าและ/หรือถอดกระจกด้านบนออก" +msgid "The current heatbed temperature is relatively high. The nozzle may clog when printing this filament in a closed environment. Please open the front door and/or remove the upper glass." +msgstr "อุณหภูมิฐานพิมพ์ร้อนในปัจจุบันค่อนข้างสูง หัวฉีดอาจอุดตันเมื่อพิมพ์เส้นพลาสติกนี้ในตู้ปิด กรุณาเปิดประตูหน้าและ/หรือถอดกระจกด้านบนออก" -msgid "" -"The nozzle hardness required by the filament is higher than the default " -"nozzle hardness of the printer. Please replace the hardened nozzle or " -"filament, otherwise, the nozzle will be worn down or damaged." -msgstr "" -"ความแข็งของหัวฉีดที่ต้องการสำหรับเส้นพลาสติกนั้นสูงกว่าความแข็งของหัวฉีดเริ่มต้นของเครื่องพิมพ์ " -"โปรดเปลี่ยนหัวฉีดหรือเส้นพลาสติกที่แข็งแล้ว ไม่เช่นนั้นหัวฉีดจะเสียหายหรือเสียหาย" +msgid "The nozzle hardness required by the filament is higher than the default nozzle hardness of the printer. Please replace the hardened nozzle or filament, otherwise, the nozzle will be worn down or damaged." +msgstr "ความแข็งของหัวฉีดที่ต้องการสำหรับเส้นพลาสติกนั้นสูงกว่าความแข็งของหัวฉีดเริ่มต้นของเครื่องพิมพ์ โปรดเปลี่ยนหัวฉีดหรือเส้นพลาสติกที่แข็งแล้ว ไม่เช่นนั้นหัวฉีดจะเสียหายหรือเสียหาย" -msgid "" -"Enabling traditional timelapse photography may cause surface imperfections. " -"It is recommended to change to smooth mode." -msgstr "" -"การเปิดใช้งานการถ่ายภาพไทม์แลปส์แบบดั้งเดิมอาจทำให้เกิดความไม่สมบูรณ์ของพื้นผิวได้ " -"ขอแนะนำให้เปลี่ยนเป็นโหมดราบรื่น" +msgid "Enabling traditional timelapse photography may cause surface imperfections. It is recommended to change to smooth mode." +msgstr "การเปิดใช้งานการถ่ายภาพไทม์แลปส์แบบดั้งเดิมอาจทำให้เกิดความไม่สมบูรณ์ของพื้นผิวได้ ขอแนะนำให้เปลี่ยนเป็นโหมดราบรื่น" -msgid "" -"Smooth mode for timelapse is enabled, but the prime tower is off, which may " -"cause print defects. Please enable the prime tower, re-slice and print again." -msgstr "" -"เปิดใช้งานโหมด Smooth สำหรับไทม์แลปส์แล้ว แต่ไพรม์ทาวเวอร์ปิดอยู่ " -"ซึ่งอาจทำให้เกิดข้อบกพร่องในการพิมพ์ โปรดเปิดใช้งานไพร์มทาวเวอร์ สไลซ์ใหม่และพิมพ์อีกครั้ง" +msgid "Smooth mode for timelapse is enabled, but the prime tower is off, which may cause print defects. Please enable the prime tower, re-slice and print again." +msgstr "เปิดใช้งานโหมด Smooth สำหรับไทม์แลปส์แล้ว แต่ไพรม์ทาวเวอร์ปิดอยู่ ซึ่งอาจทำให้เกิดข้อบกพร่องในการพิมพ์ โปรดเปิดใช้งานไพร์มทาวเวอร์ สไลซ์ใหม่และพิมพ์อีกครั้ง" msgid "Expand sidebar" msgstr "ขยายแถบด้านข้าง" @@ -7586,67 +7040,41 @@ msgstr "โครงการแบมบูสตูดิโอ" msgid "The 3MF is not supported by OrcaSlicer, loading geometry data only." msgstr "OrcaSlicer ไม่รองรับ 3MF โดยจะโหลดข้อมูลเรขาคณิตเท่านั้น" -msgid "" -"The 3MF file was generated by an old OrcaSlicer version, loading geometry " -"data only." +msgid "The 3MF file was generated by an old OrcaSlicer version, loading geometry data only." msgstr "ไฟล์ 3MF สร้างขึ้นโดย OrcaSlicer เวอร์ชันเก่า โดยโหลดข้อมูลเรขาคณิตเท่านั้น" -msgid "" -"The 3MF file was generated by an older version, loading geometry data only." +msgid "The 3MF file was generated by an older version, loading geometry data only." msgstr "ไฟล์ 3MF ถูกสร้างขึ้นโดยเวอร์ชันเก่า โดยโหลดข้อมูลเรขาคณิตเท่านั้น" msgid "The 3MF file was generated by BambuStudio, loading geometry data only." msgstr "ไฟล์ 3MF สร้างโดย BambuStudio โดยโหลดข้อมูลเรขาคณิตเท่านั้น" -msgid "" -"This project was created with an OrcaSlicer 2.3.1-alpha and uses infill " -"rotation template settings that may not work properly with your current " -"infill pattern. This could result in weak support or print quality issues." -msgstr "" -"โปรเจ็กต์นี้สร้างขึ้นด้วย OrcaSlicer 2.3.1-alpha และใช้การตั้งค่าเทมเพลตการหมุน ไส้ใน " -"ที่อาจทำงานไม่ถูกต้องกับรูปแบบ ไส้ใน ปัจจุบันของคุณ " -"ซึ่งอาจส่งผลให้ส่วนรองรับไม่ดีหรือปัญหาคุณภาพการพิมพ์" +msgid "This project was created with an OrcaSlicer 2.3.1-alpha and uses infill rotation template settings that may not work properly with your current infill pattern. This could result in weak support or print quality issues." +msgstr "โปรเจ็กต์นี้สร้างขึ้นด้วย OrcaSlicer 2.3.1-alpha และใช้การตั้งค่าเทมเพลตการหมุน ไส้ใน ที่อาจทำงานไม่ถูกต้องกับรูปแบบ ไส้ใน ปัจจุบันของคุณ ซึ่งอาจส่งผลให้ส่วนรองรับไม่ดีหรือปัญหาคุณภาพการพิมพ์" -msgid "" -"Would you like OrcaSlicer to automatically fix this by clearing the rotation " -"template settings?" -msgstr "" -"คุณต้องการให้ OrcaSlicer แก้ไขปัญหานี้โดยอัตโนมัติโดยการล้างการตั้งค่าเทมเพลตการหมุนหรือไม่" +msgid "Would you like OrcaSlicer to automatically fix this by clearing the rotation template settings?" +msgstr "คุณต้องการให้ OrcaSlicer แก้ไขปัญหานี้โดยอัตโนมัติโดยการล้างการตั้งค่าเทมเพลตการหมุนหรือไม่" #, c-format, boost-format -msgid "" -"The 3MF file version %s is newer than %s's version %s, found the following " -"unrecognized keys:" +msgid "The 3MF file version %s is newer than %s's version %s, found the following unrecognized keys:" msgstr "ไฟล์ 3MF เวอร์ชัน %s ใหม่กว่าเวอร์ชัน %s ของ %s พบคีย์ที่ไม่รู้จักต่อไปนี้:" msgid "You should update your software.\n" msgstr "คุณควรอัพเกรดซอฟต์แวร์ของคุณดีกว่า\n" #, c-format, boost-format -msgid "" -"The 3MF file version %s is newer than %s's version %s, we suggest to upgrade " -"your software." -msgstr "" -"ไฟล์ 3MF เวอร์ชัน %s ใหม่กว่าเวอร์ชัน %s ของ %s เราขอแนะนำให้อัปเกรดซอฟต์แวร์ของคุณ" +msgid "The 3MF file version %s is newer than %s's version %s, we suggest to upgrade your software." +msgstr "ไฟล์ 3MF เวอร์ชัน %s ใหม่กว่าเวอร์ชัน %s ของ %s เราขอแนะนำให้อัปเกรดซอฟต์แวร์ของคุณ" #, c-format, boost-format -msgid "" -"The 3MF was created by BambuStudio (version %s), which is newer than the " -"compatible version %s. Found unrecognized settings:" -msgstr "" -"3MF ถูกสร้างขึ้นโดย BambuStudio (เวอร์ชัน %s) ซึ่งใหม่กว่าเวอร์ชัน %s ที่เข้ากันได้ " -"พบการตั้งค่าที่ไม่รู้จัก:" +msgid "The 3MF was created by BambuStudio (version %s), which is newer than the compatible version %s. Found unrecognized settings:" +msgstr "3MF ถูกสร้างขึ้นโดย BambuStudio (เวอร์ชัน %s) ซึ่งใหม่กว่าเวอร์ชัน %s ที่เข้ากันได้ พบการตั้งค่าที่ไม่รู้จัก:" #, c-format, boost-format -msgid "" -"The 3MF was created by BambuStudio (version %s), which is newer than the " -"compatible version %s. Some settings may not be fully compatible." -msgstr "" -"3MF ถูกสร้างขึ้นโดย BambuStudio (เวอร์ชัน %s) ซึ่งใหม่กว่าเวอร์ชัน %s ที่เข้ากันได้ " -"การตั้งค่าบางอย่างอาจเข้ากันไม่ได้อย่างสมบูรณ์" +msgid "The 3MF was created by BambuStudio (version %s), which is newer than the compatible version %s. Some settings may not be fully compatible." +msgstr "3MF ถูกสร้างขึ้นโดย BambuStudio (เวอร์ชัน %s) ซึ่งใหม่กว่าเวอร์ชัน %s ที่เข้ากันได้ การตั้งค่าบางอย่างอาจเข้ากันไม่ได้อย่างสมบูรณ์" -msgid "" -"The 3MF was created by BambuStudio. Some settings may differ from OrcaSlicer." +msgid "The 3MF was created by BambuStudio. Some settings may differ from OrcaSlicer." msgstr "3MF ถูกสร้างขึ้นโดย BambuStudio การตั้งค่าบางอย่างอาจแตกต่างจาก OrcaSlicer" msgid "Invalid values found in the 3MF:" @@ -7655,13 +7083,10 @@ msgstr "พบค่าที่ไม่ถูกต้องใน 3MF:" msgid "Please correct them in the Param tabs" msgstr "โปรดแก้ไขให้ถูกต้องในแท็บพารามิเตอร์" -msgid "" -"The 3MF has the following modified G-code in filament or printer presets:" +msgid "The 3MF has the following modified G-code in filament or printer presets:" msgstr "3MF มี G-code ที่แก้ไขแล้วต่อไปนี้ในฟิลาเมนต์หรือพรีเซ็ตเครื่องพิมพ์:" -msgid "" -"Please confirm that all modified G-code is safe to prevent any damage to the " -"machine!" +msgid "Please confirm that all modified G-code is safe to prevent any damage to the machine!" msgstr "โปรดยืนยันว่า G-code ที่แก้ไขทั้งหมดนั้นปลอดภัยเพื่อป้องกันความเสียหายต่อเครื่อง!" msgid "Modified G-code" @@ -7670,9 +7095,7 @@ msgstr "แก้ไขรหัส G" msgid "The 3MF has the following customized filament or printer presets:" msgstr "3MF มีเส้นพลาสติกที่กำหนดเองหรือการตั้งค่าเครื่องพิมพ์ไว้ล่วงหน้าดังต่อไปนี้:" -msgid "" -"Please confirm that the G-code within these presets is safe to prevent any " -"damage to the machine!" +msgid "Please confirm that the G-code within these presets is safe to prevent any damage to the machine!" msgstr "โปรดยืนยันว่ารหัส G ภายในค่าที่ตั้งล่วงหน้าเหล่านี้ปลอดภัยเพื่อป้องกันความเสียหายต่อเครื่อง!" msgid "Customized Preset" @@ -7730,13 +7153,10 @@ msgid "Auto-Drop" msgstr "วางอัตโนมัติ" #, c-format, boost-format -msgid "" -"Connected printer is %s. It must match the project preset for printing.\n" +msgid "Connected printer is %s. It must match the project preset for printing.\n" msgstr "เครื่องพิมพ์ที่เชื่อมต่อคือ %s โดยจะต้องตรงกับค่าที่ตั้งล่วงหน้าของโปรเจ็กต์สำหรับการพิมพ์\n" -msgid "" -"Do you want to sync the printer information and automatically switch the " -"preset?" +msgid "Do you want to sync the printer information and automatically switch the preset?" msgstr "คุณต้องการซิงค์ข้อมูลเครื่องพิมพ์และสลับการตั้งค่าล่วงหน้าโดยอัตโนมัติหรือไม่" msgid "Tips" @@ -7745,9 +7165,7 @@ msgstr "เคล็ดลับ" msgid "The file does not contain any geometry data." msgstr "ไฟล์นี้ไม่มีข้อมูลเรขาคณิตใดๆ" -msgid "" -"Your object appears to be too large, do you want to scale it down to fit the " -"print bed automatically?" +msgid "Your object appears to be too large, do you want to scale it down to fit the print bed automatically?" msgstr "วัตถุของคุณดูใหญ่เกินไป คุณต้องการย่อขนาดให้พอดีกับฐานพิมพ์โดยอัตโนมัติหรือไม่" msgid "Object too large" @@ -7883,9 +7301,7 @@ msgstr "กำลังสไลซ์ฐานพิมพ์ %d" msgid "Please resolve the slicing errors and publish again." msgstr "โปรดแก้ไขข้อผิดพลาดในการแบ่งส่วนและเผยแพร่อีกครั้ง" -msgid "" -"The network plug-in was not detected. Network related features are " -"unavailable." +msgid "The network plug-in was not detected. Network related features are unavailable." msgstr "ตรวจไม่พบปลั๊กอินเครือข่าย คุณสมบัติที่เกี่ยวข้องกับเครือข่ายไม่พร้อมใช้งาน" msgid "" @@ -7896,15 +7312,12 @@ msgstr "" "ไฟล์ที่โหลดมีเฉพาะ G-code ไม่สามารถเข้าหน้าเตรียมความพร้อมได้" msgid "" -"The nozzle type and AMS quantity information has not been synced from the " -"connected printer.\n" -"After syncing, software can optimize printing time and filament usage when " -"slicing.\n" +"The nozzle type and AMS quantity information has not been synced from the connected printer.\n" +"After syncing, software can optimize printing time and filament usage when slicing.\n" "Would you like to sync now?" msgstr "" "ข้อมูลประเภทหัวฉีดและข้อมูลปริมาณ AMS ไม่ได้ถูกซิงค์จากเครื่องพิมพ์ที่เชื่อมต่อ\n" -"หลังจากการซิงค์ " -"ซอฟต์แวร์จะสามารถปรับเวลาการพิมพ์และการใช้เส้นพลาสติกให้เหมาะสมเมื่อทำการตัด\n" +"หลังจากการซิงค์ ซอฟต์แวร์จะสามารถปรับเวลาการพิมพ์และการใช้เส้นพลาสติกให้เหมาะสมเมื่อทำการตัด\n" "คุณต้องการซิงค์ตอนนี้หรือไม่?" msgid "Sync now" @@ -7921,8 +7334,7 @@ msgstr "โหลดโปรเจกต์" msgid "" "Failed to save the project.\n" -"Please check whether the folder exists online or if other programs have the " -"project file open." +"Please check whether the folder exists online or if other programs have the project file open." msgstr "" "ไม่สามารถบันทึกโครงการ\n" "โปรดตรวจสอบว่าโฟลเดอร์ออนไลน์อยู่หรือมีโปรแกรมอื่นเปิดไฟล์โครงการหรือไม่" @@ -7949,16 +7361,13 @@ msgstr "ดาวน์โหลดล้มเหลว มีข้อยก msgid "Project downloaded %d%%" msgstr "ดาวน์โหลดโครงการแล้ว %d%%" -msgid "" -"Importing to Orca Slicer failed. Please download the file and manually " -"import it." +msgid "Importing to Orca Slicer failed. Please download the file and manually import it." msgstr "การนำเข้าไปยัง Orca Slicer ล้มเหลว โปรดดาวน์โหลดไฟล์และนำเข้าด้วยตนเอง" msgid "INFO:" msgstr "ข้อมูล:" -msgid "" -"No accelerations provided for calibration. Use default acceleration value " +msgid "No accelerations provided for calibration. Use default acceleration value " msgstr "ไม่มีการเร่งความเร็วสำหรับการสอบเทียบ ใช้ค่าความเร่งเริ่มต้น" msgid "No speeds provided for calibration. Use default optimal speed " @@ -8017,9 +7426,7 @@ msgstr "ไม่สามารถเพิ่มโมเดลได้เม msgid "All objects will be removed, continue?" msgstr "วัตถุทั้งหมดจะถูกลบ ดำเนินการต่อหรือไม่" -msgid "" -"The current project has unsaved changes. Would you like to save before " -"continuing?" +msgid "The current project has unsaved changes. Would you like to save before continuing?" msgstr "โปรเจ็กต์ปัจจุบันมีการเปลี่ยนแปลงที่ยังไม่ได้บันทึก บันทึกก่อนดำเนินการต่อหรือไม่" msgid "Number of copies:" @@ -8044,9 +7451,7 @@ msgid "Save Sliced file as:" msgstr "บันทึกไฟล์ที่สไลซ์เป็น:" #, c-format, boost-format -msgid "" -"The file %s has been sent to the printer's storage space and can be viewed " -"on the printer." +msgid "The file %s has been sent to the printer's storage space and can be viewed on the printer." msgstr "ไฟล์ %s ถูกส่งไปยังพื้นที่เก็บข้อมูลของเครื่องพิมพ์แล้ว และสามารถดูได้บนเครื่องพิมพ์" msgid "The nozzle type is not set. Please set the nozzle and try again." @@ -8055,12 +7460,8 @@ msgstr "ไม่ได้ตั้งค่าประเภทหัวฉี msgid "The nozzle type is not set. Please check." msgstr "ไม่ได้ตั้งค่าประเภทหัวฉีด กรุณาตรวจสอบ." -msgid "" -"Unable to perform boolean operation on model meshes. Only positive parts " -"will be kept. You may fix the meshes and try again." -msgstr "" -"ไม่สามารถดำเนินการบูลีนบนโมเดลเมชได้ จะเก็บเฉพาะส่วนที่เป็นบวกเท่านั้น " -"คุณอาจแก้ไขตาข่ายแล้วลองอีกครั้ง" +msgid "Unable to perform boolean operation on model meshes. Only positive parts will be kept. You may fix the meshes and try again." +msgstr "ไม่สามารถดำเนินการบูลีนบนโมเดลเมชได้ จะเก็บเฉพาะส่วนที่เป็นบวกเท่านั้น คุณอาจแก้ไขตาข่ายแล้วลองอีกครั้ง" #, boost-format msgid "Reason: part \"%1%\" is empty." @@ -8078,9 +7479,7 @@ msgstr "เหตุผล: ส่วน \"%1%\" มีจุดตัดกั msgid "Reason: \"%1%\" and another part have no intersection." msgstr "เหตุผล: \"%1%\" และอีกส่วนหนึ่งไม่มีจุดตัดกัน" -msgid "" -"Unable to perform boolean operation on model meshes. Only positive parts " -"will be exported." +msgid "Unable to perform boolean operation on model meshes. Only positive parts will be exported." msgstr "ไม่สามารถดำเนินการบูลีนบนโมเดลเมชได้ เฉพาะส่วนที่เป็นบวกเท่านั้นที่จะถูกส่งออก" msgid "Flashforge host is not available." @@ -8118,36 +7517,22 @@ msgid "Optimize Rotation" msgstr "เพิ่มประสิทธิภาพการหมุน" #, c-format, boost-format -msgid "" -"Printer not connected. Please go to the device page to connect %s before " -"syncing." +msgid "Printer not connected. Please go to the device page to connect %s before syncing." msgstr "ไม่ได้เชื่อมต่อเครื่องพิมพ์ โปรดไปที่หน้าอุปกรณ์เพื่อเชื่อมต่อ %s ก่อนที่จะทำการซิงค์" #, c-format, boost-format -msgid "" -"OrcaSlicer can't connect to %s. Please check if the printer is powered on " -"and connected to the network." -msgstr "" -"OrcaSlicer ไม่สามารถเชื่อมต่อกับ %s ได้ " -"โปรดตรวจสอบว่าเครื่องพิมพ์เปิดอยู่และเชื่อมต่อกับเครือข่ายหรือไม่" +msgid "OrcaSlicer can't connect to %s. Please check if the printer is powered on and connected to the network." +msgstr "OrcaSlicer ไม่สามารถเชื่อมต่อกับ %s ได้ โปรดตรวจสอบว่าเครื่องพิมพ์เปิดอยู่และเชื่อมต่อกับเครือข่ายหรือไม่" #, c-format, boost-format -msgid "" -"The currently connected printer on the device page is not %s. Please switch " -"to %s before syncing." +msgid "The currently connected printer on the device page is not %s. Please switch to %s before syncing." msgstr "เครื่องพิมพ์ที่เชื่อมต่ออยู่ในหน้าอุปกรณ์ไม่ใช่ %s โปรดสลับไปที่ %s ก่อนที่จะทำการซิงค์" -msgid "" -"There are no filaments on the printer. Please load the filaments on the " -"printer first." +msgid "There are no filaments on the printer. Please load the filaments on the printer first." msgstr "ไม่มีเส้นพลาสติกบนเครื่องพิมพ์ กรุณาใส่ฟิลาเมนต์บนเครื่องพิมพ์ก่อน" -msgid "" -"The filaments on the printer are all unknown types. Please go to the printer " -"screen or software device page to set the filament type." -msgstr "" -"เส้นพลาสติกบนเครื่องพิมพ์ล้วนเป็นประเภทที่ไม่รู้จัก " -"โปรดไปที่หน้าจอเครื่องพิมพ์หรือหน้าอุปกรณ์ซอฟต์แวร์เพื่อตั้งค่าประเภทเส้นพลาสติก" +msgid "The filaments on the printer are all unknown types. Please go to the printer screen or software device page to set the filament type." +msgstr "เส้นพลาสติกบนเครื่องพิมพ์ล้วนเป็นประเภทที่ไม่รู้จัก โปรดไปที่หน้าจอเครื่องพิมพ์หรือหน้าอุปกรณ์ซอฟต์แวร์เพื่อตั้งค่าประเภทเส้นพลาสติก" msgid "Device Page" msgstr "หน้าอุปกรณ์" @@ -8198,19 +7583,11 @@ msgid "Use \"Fix Model\" to repair the mesh." msgstr "ใช้ \"Fix Model\" เพื่อซ่อมแซมตาข่าย" #, c-format, boost-format -msgid "" -"Plate %d: %s is not suggested for use printing filament %s (%s). If you " -"still want to do this print job, please set this filament's bed temperature " -"to a number that is not zero." -msgstr "" -"เพลต %d: ไม่แนะนำให้ใช้ %s กับเส้นพลาสติก %s (%s) หากยังต้องการพิมพ์งานนี้ " -"โปรดตั้งอุณหภูมิฐานของเส้นพลาสติกให้ไม่เป็นศูนย์" +msgid "Plate %d: %s is not suggested for use printing filament %s (%s). If you still want to do this print job, please set this filament's bed temperature to a number that is not zero." +msgstr "เพลต %d: ไม่แนะนำให้ใช้ %s กับเส้นพลาสติก %s (%s) หากยังต้องการพิมพ์งานนี้ โปรดตั้งอุณหภูมิฐานของเส้นพลาสติกให้ไม่เป็นศูนย์" -msgid "" -"Currently, the object configuration form cannot be used with a multiple-" -"extruder printer." -msgstr "" -"ในปัจจุบัน แบบฟอร์มการกำหนดค่าออบเจ็กต์ไม่สามารถใช้กับเครื่องพิมพ์ที่มีชุดดันเส้นหลายเครื่องได้" +msgid "Currently, the object configuration form cannot be used with a multiple-extruder printer." +msgstr "ในปัจจุบัน แบบฟอร์มการกำหนดค่าออบเจ็กต์ไม่สามารถใช้กับเครื่องพิมพ์ที่มีชุดดันเส้นหลายเครื่องได้" msgid "Not available" msgstr "ไม่พร้อมใช้งาน" @@ -8341,22 +7718,11 @@ msgstr "เปิดใช้งานโหมดมืด" msgid "Allow only one OrcaSlicer instance" msgstr "อนุญาตอินสแตนซ์ OrcaSlicer เพียงอินสแตนซ์เดียวเท่านั้น" -msgid "" -"On OSX there is always only one instance of app running by default. However " -"it is allowed to run multiple instances of same app from the command line. " -"In such case this settings will allow only one instance." -msgstr "" -"บน OSX จะมีแอปเพียงอินสแตนซ์เดียวที่ทำงานตามค่าเริ่มต้นเสมอ อย่างไรก็ตาม " -"อนุญาตให้เรียกใช้แอปเดียวกันหลายอินสแตนซ์จากบรรทัดคำสั่ง ในกรณีเช่นนี้ " -"การตั้งค่านี้จะอนุญาตเพียงอินสแตนซ์เดียวเท่านั้น" +msgid "On OSX there is always only one instance of app running by default. However it is allowed to run multiple instances of same app from the command line. In such case this settings will allow only one instance." +msgstr "บน OSX จะมีแอปเพียงอินสแตนซ์เดียวที่ทำงานตามค่าเริ่มต้นเสมอ อย่างไรก็ตาม อนุญาตให้เรียกใช้แอปเดียวกันหลายอินสแตนซ์จากบรรทัดคำสั่ง ในกรณีเช่นนี้ การตั้งค่านี้จะอนุญาตเพียงอินสแตนซ์เดียวเท่านั้น" -msgid "" -"If this is enabled, when starting OrcaSlicer and another instance of the " -"same OrcaSlicer is already running, that instance will be reactivated " -"instead." -msgstr "" -"หากเปิดใช้งานนี้ เมื่อเริ่มต้น OrcaSlicer และอินสแตนซ์อื่นของ OrcaSlicer " -"เดียวกันกำลังทำงานอยู่แล้ว อินสแตนซ์นั้นจะถูกเปิดใช้งานอีกครั้งแทน" +msgid "If this is enabled, when starting OrcaSlicer and another instance of the same OrcaSlicer is already running, that instance will be reactivated instead." +msgstr "หากเปิดใช้งานนี้ เมื่อเริ่มต้น OrcaSlicer และอินสแตนซ์อื่นของ OrcaSlicer เดียวกันกำลังทำงานอยู่แล้ว อินสแตนซ์นั้นจะถูกเปิดใช้งานอีกครั้งแทน" msgid "Show splash screen" msgstr "แสดงหน้าจอเริ่มต้น" @@ -8367,9 +7733,7 @@ msgstr "แสดงหน้าจอเริ่มต้นระหว่า msgid "Show shared profiles notification" msgstr "แสดงการแจ้งเตือนโปรไฟล์ที่แชร์" -msgid "" -"Show a notification with a link to browse shared profiles when the selected " -"printer is changed." +msgid "Show a notification with a link to browse shared profiles when the selected printer is changed." msgstr "แสดงการแจ้งเตือนพร้อมลิงก์เพื่อเรียกดูโปรไฟล์ที่แชร์เมื่อเครื่องพิมพ์ที่เลือกมีการเปลี่ยนแปลง" msgid "Use window buttons on left side" @@ -8399,8 +7763,7 @@ msgstr "โหลดรูปทรงเท่านั้น" msgid "Load behaviour" msgstr "พฤติกรรมการโหลด" -msgid "" -"Should printer/filament/process settings be loaded when opening a 3MF file?" +msgid "Should printer/filament/process settings be loaded when opening a 3MF file?" msgstr "ควรโหลดการตั้งค่าเครื่องพิมพ์/เส้นพลาสติก/กระบวนการเมื่อเปิดไฟล์ 3MF หรือไม่" msgid "Maximum recent files" @@ -8418,16 +7781,13 @@ msgstr "อย่าเตือนเมื่อโหลด 3MF ด้วย msgid "Show options when importing STEP file" msgstr "แสดงตัวเลือกเมื่อนำเข้าไฟล์ STEP" -msgid "" -"If enabled, a parameter settings dialog will appear during STEP file import." +msgid "If enabled, a parameter settings dialog will appear during STEP file import." msgstr "หากเปิดใช้งาน กล่องโต้ตอบการตั้งค่าพารามิเตอร์จะปรากฏขึ้นระหว่างการนำเข้าไฟล์ STEP" msgid "Auto backup" msgstr "การสำรองข้อมูลอัตโนมัติ" -msgid "" -"Backup your project periodically to help with restoring from an occasional " -"crash." +msgid "Backup your project periodically to help with restoring from an occasional crash." msgstr "สำรองข้อมูลโปรเจ็กต์ของคุณเป็นระยะเพื่อกู้คืนจากข้อขัดข้องเป็นครั้งคราว" msgid "Preset" @@ -8436,12 +7796,8 @@ msgstr "พรีเซ็ต" msgid "Remember printer configuration" msgstr "จำการกำหนดค่าเครื่องพิมพ์" -msgid "" -"If enabled, Orca will remember and switch filament/process configuration for " -"each printer automatically." -msgstr "" -"หากเปิดใช้งาน Orca จะจดจำและสลับการกำหนดค่าเส้นพลาสติก/" -"กระบวนการสำหรับเครื่องพิมพ์แต่ละเครื่องโดยอัตโนมัติ" +msgid "If enabled, Orca will remember and switch filament/process configuration for each printer automatically." +msgstr "หากเปิดใช้งาน Orca จะจดจำและสลับการกำหนดค่าเส้นพลาสติก/กระบวนการสำหรับเครื่องพิมพ์แต่ละเครื่องโดยอัตโนมัติ" msgid "Group user filament presets" msgstr "การตั้งค่าเส้นพลาสติกผู้ใช้แบบกลุ่ม" @@ -8470,12 +7826,8 @@ msgstr "คุณสมบัติ" msgid "Multi device management" msgstr "การจัดการอุปกรณ์หลายเครื่อง" -msgid "" -"With this option enabled, you can send a task to multiple devices at the " -"same time and manage multiple devices." -msgstr "" -"เมื่อเปิดใช้งานตัวเลือกนี้ " -"คุณสามารถส่งงานไปยังอุปกรณ์หลายเครื่องพร้อมกันและจัดการอุปกรณ์หลายเครื่องได้" +msgid "With this option enabled, you can send a task to multiple devices at the same time and manage multiple devices." +msgstr "เมื่อเปิดใช้งานตัวเลือกนี้ คุณสามารถส่งงานไปยังอุปกรณ์หลายเครื่องพร้อมกันและจัดการอุปกรณ์หลายเครื่องได้" msgid "Pop up to select filament grouping mode" msgstr "ปรากฏขึ้นเพื่อเลือกโหมดการจัดกลุ่มเส้นพลาสติก" @@ -8487,18 +7839,13 @@ msgid "bits" msgstr "บิต" msgid "" -"Controls the quantization bit depth used when compressing the mesh to Draco " -"format.\n" -"0 = lossless compression (geometry is preserved at full precision). Valid " -"lossy values range from 8 to 30.\n" -"Lower values produce smaller files but lose more geometric detail; higher " -"values preserve more detail at the cost of larger files." +"Controls the quantization bit depth used when compressing the mesh to Draco format.\n" +"0 = lossless compression (geometry is preserved at full precision). Valid lossy values range from 8 to 30.\n" +"Lower values produce smaller files but lose more geometric detail; higher values preserve more detail at the cost of larger files." msgstr "" "ควบคุมความลึกบิตเชิงปริมาณที่ใช้ในการบีบอัด mesh เป็นรูปแบบ Draco\n" -"0 = การบีบอัดแบบไม่สูญเสีย (รูปทรงเรขาคณิตจะถูกรักษาไว้อย่างแม่นยำเต็มที่) " -"ค่าการสูญเสียที่ถูกต้องมีตั้งแต่ 8 ถึง 30\n" -"ค่าที่ต่ำกว่าจะทำให้ไฟล์มีขนาดเล็กลง แต่สูญเสียรายละเอียดทางเรขาคณิตมากขึ้น " -"ค่าที่สูงกว่าจะรักษารายละเอียดได้มากขึ้นโดยที่ไฟล์มีขนาดใหญ่กว่า" +"0 = การบีบอัดแบบไม่สูญเสีย (รูปทรงเรขาคณิตจะถูกรักษาไว้อย่างแม่นยำเต็มที่) ค่าการสูญเสียที่ถูกต้องมีตั้งแต่ 8 ถึง 30\n" +"ค่าที่ต่ำกว่าจะทำให้ไฟล์มีขนาดเล็กลง แต่สูญเสียรายละเอียดทางเรขาคณิตมากขึ้น ค่าที่สูงกว่าจะรักษารายละเอียดได้มากขึ้นโดยที่ไฟล์มีขนาดใหญ่กว่า" msgid "Behaviour" msgstr "พฤติกรรม" @@ -8515,26 +7862,16 @@ msgstr "จัดเรียงจานอัตโนมัติหลัง msgid "Auto slice after changes" msgstr "แบ่งส่วนอัตโนมัติหลังจากการเปลี่ยนแปลง" -msgid "" -"If enabled, OrcaSlicer will re-slice automatically whenever slicing-related " -"settings change." -msgstr "" -"หากเปิดใช้งาน OrcaSlicer " -"จะแบ่งส่วนใหม่โดยอัตโนมัติทุกครั้งที่การตั้งค่าที่เกี่ยวข้องกับการแบ่งมีการเปลี่ยนแปลง" +msgid "If enabled, OrcaSlicer will re-slice automatically whenever slicing-related settings change." +msgstr "หากเปิดใช้งาน OrcaSlicer จะแบ่งส่วนใหม่โดยอัตโนมัติทุกครั้งที่การตั้งค่าที่เกี่ยวข้องกับการแบ่งมีการเปลี่ยนแปลง" -msgid "" -"Delay in seconds before auto slicing starts, allowing multiple edits to be " -"grouped. Use 0 to slice immediately." -msgstr "" -"หน่วงเวลาเป็นวินาทีก่อนที่การแบ่งส่วนอัตโนมัติจะเริ่มขึ้น ทำให้สามารถจัดกลุ่มการแก้ไขได้หลายรายการ " -"ใช้ 0 เพื่อสไลซ์ทันที" +msgid "Delay in seconds before auto slicing starts, allowing multiple edits to be grouped. Use 0 to slice immediately." +msgstr "หน่วงเวลาเป็นวินาทีก่อนที่การแบ่งส่วนอัตโนมัติจะเริ่มขึ้น ทำให้สามารถจัดกลุ่มการแก้ไขได้หลายรายการ ใช้ 0 เพื่อสไลซ์ทันที" msgid "Remove mixed temperature restriction" msgstr "ลบข้อจำกัดอุณหภูมิแบบผสม" -msgid "" -"With this option enabled, you can print materials with a large temperature " -"difference together." +msgid "With this option enabled, you can print materials with a large temperature difference together." msgstr "เมื่อเปิดใช้งานตัวเลือกนี้ คุณสามารถพิมพ์วัสดุที่มีอุณหภูมิแตกต่างกันมากร่วมกันได้" msgid "Touchpad" @@ -8561,9 +7898,7 @@ msgstr "คูณความเร็ววงโคจรเพื่อกา msgid "Zoom to mouse position" msgstr "ซูมไปที่ตำแหน่งเมาส์" -msgid "" -"Zoom in towards the mouse pointer's position in the 3D view, rather than the " -"2D window center." +msgid "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center." msgstr "ซูมเข้าไปยังตำแหน่งของตัวชี้เมาส์ในมุมมอง 3 มิติ แทนที่จะซูมไปที่กึ่งกลางหน้าต่าง 2 มิติ" msgid "Use free camera" @@ -8617,8 +7952,7 @@ msgstr "ล้างตัวเลือกของฉันในการต msgid "Synchronizing printer preset" msgstr "กำลังซิงโครไนซ์การตั้งค่าเครื่องพิมพ์ล่วงหน้า" -msgid "" -"Clear my choice for synchronizing printer preset after loading the file." +msgid "Clear my choice for synchronizing printer preset after loading the file." msgstr "ล้างตัวเลือกของฉันในการซิงโครไนซ์พรีเซ็ตเครื่องพิมพ์หลังจากโหลดไฟล์" msgid "Graphics" @@ -8648,13 +7982,11 @@ msgstr "นอร์มัลแบบเรียบ" msgid "" "Applies smooth normals to the realistic view.\n" "\n" -"Requires manual scene reload to take effect (right-click on 3D view → " -"\"Reload All\")." +"Requires manual scene reload to take effect (right-click on 3D view → \"Reload All\")." msgstr "" "ใช้นอร์มัลแบบเรียบในมุมมองแบบสมจริง\n" "\n" -"ต้องโหลดฉากใหม่ด้วยตนเองจึงจะมีผล (คลิกขวาที่มุมมอง 3D → " -"\"Reload All\")." +"ต้องโหลดฉากใหม่ด้วยตนเองจึงจะมีผล (คลิกขวาที่มุมมอง 3D → \"Reload All\")." msgid "Anti-aliasing" msgstr "ต่อต้านนามแฝง" @@ -8664,11 +7996,9 @@ msgstr "ตัวคูณ MSAA" msgid "" "Set the Multi-Sample Anti-Aliasing level.\n" -"Higher values result in smoother edges, but the impact on performance is " -"exponential.\n" +"Higher values result in smoother edges, but the impact on performance is exponential.\n" "Lower values improve performance, at the cost of jagged edges.\n" -"If disabled, its recommended to enable FXAA to reduce jagged edges with " -"minimal performance impact.\n" +"If disabled, its recommended to enable FXAA to reduce jagged edges with minimal performance impact.\n" "\n" "Requires application restart." msgstr "" @@ -8725,13 +8055,10 @@ msgid "Stealth mode" msgstr "โหมดซ่อนตัว" msgid "" -"This disables all cloud features, including Orca Cloud profile syncing. " -"Users who prefer to work entirely offline can enable this option.\n" -"Note: When Stealth Mode is enabled, your user profiles will not be backed up " -"to Orca Cloud." +"This disables all cloud features, including Orca Cloud profile syncing. Users who prefer to work entirely offline can enable this option.\n" +"Note: When Stealth Mode is enabled, your user profiles will not be backed up to Orca Cloud." msgstr "" -"ตัวเลือกนี้จะปิดการใช้งานฟีเจอร์คลาวด์ทั้งหมด รวมถึงการซิงก์โปรไฟล์ Orca Cloud " -"ผู้ใช้ที่ต้องการทำงานแบบออฟไลน์ทั้งหมดสามารถเปิดตัวเลือกนี้ได้\n" +"ตัวเลือกนี้จะปิดการใช้งานฟีเจอร์คลาวด์ทั้งหมด รวมถึงการซิงก์โปรไฟล์ Orca Cloud ผู้ใช้ที่ต้องการทำงานแบบออฟไลน์ทั้งหมดสามารถเปิดตัวเลือกนี้ได้\n" "หมายเหตุ: เมื่อเปิดโหมดซ่อนตัว โปรไฟล์ผู้ใช้ของคุณจะไม่ถูกสำรองไปยัง Orca Cloud" msgid "Hide login side panel" @@ -8752,12 +8079,8 @@ msgstr "ผู้ให้บริการคลาวด์" msgid "Enable Bambu Cloud" msgstr "เปิดใช้งาน Bambu Cloud" -msgid "" -"Allow logging into Bambu Cloud alongside Orca Cloud. When enabled, a Bambu " -"login section appears on the homepage." -msgstr "" -"อนุญาตให้เข้าสู่ระบบ Bambu Cloud ควบคู่ไปกับ Orca Cloud เมื่อเปิดใช้งาน ส่วนเข้าสู่ระบบ " -"Bambu จะปรากฏบนหน้าแรก" +msgid "Allow logging into Bambu Cloud alongside Orca Cloud. When enabled, a Bambu login section appears on the homepage." +msgstr "อนุญาตให้เข้าสู่ระบบ Bambu Cloud ควบคู่ไปกับ Orca Cloud เมื่อเปิดใช้งาน ส่วนเข้าสู่ระบบ Bambu จะปรากฏบนหน้าแรก" msgid "Update & sync" msgstr "อัปเดตและซิงค์" @@ -8774,9 +8097,7 @@ msgstr "อัปเดตค่าที่ตั้งล่วงหน้า msgid "Use encrypted file for token storage" msgstr "ใช้ไฟล์ที่เข้ารหัสสำหรับการจัดเก็บโทเค็น" -msgid "" -"Store authentication tokens in an encrypted file instead of the system " -"keychain. (Requires restart)" +msgid "Store authentication tokens in an encrypted file instead of the system keychain. (Requires restart)" msgstr "จัดเก็บโทเค็นการรับรองความถูกต้องในไฟล์ที่เข้ารหัสแทนพวงกุญแจระบบ (ต้องรีสตาร์ท)" msgid "Filament Sync Options" @@ -8785,8 +8106,7 @@ msgstr "ตัวเลือกการซิงค์ฟิลาเมนต msgid "Filament sync mode" msgstr "โหมดการซิงค์ฟิลาเมนต์" -msgid "" -"Choose whether sync updates both filament preset and color, or only color." +msgid "Choose whether sync updates both filament preset and color, or only color." msgstr "เลือกว่าการซิงค์จะอัปเดตทั้งค่าที่ตั้งไว้ล่วงหน้าของเส้นพลาสติกและสี หรือเฉพาะสีเท่านั้น" msgid "Filament & Color" @@ -8839,9 +8159,7 @@ msgstr "ดาวน์โหลดปลั๊กอินเครือข่ msgid "Associate files to OrcaSlicer" msgstr "เชื่อมโยงไฟล์กับ OrcaSlicer" -msgid "" -"File associations for the Microsoft Store version are managed by Windows " -"Settings." +msgid "File associations for the Microsoft Store version are managed by Windows Settings." msgstr "การเชื่อมโยงไฟล์สำหรับเวอร์ชัน Microsoft Store จัดการผ่านการตั้งค่า Windows" msgid "Open Windows Default Apps Settings" @@ -8850,9 +8168,7 @@ msgstr "เปิดการตั้งค่าแอปเริ่มต้ msgid "Associate 3MF files to OrcaSlicer" msgstr "เชื่อมโยงไฟล์ 3MF กับ OrcaSlicer" -msgid "" -"If enabled, this sets OrcaSlicer as the default application to open 3MF " -"files." +msgid "If enabled, this sets OrcaSlicer as the default application to open 3MF files." msgstr "หากเปิดใช้งาน ให้ตั้งค่า OrcaSlicer เป็นแอปพลิเคชันเริ่มต้นเพื่อเปิดไฟล์ 3MF" msgid "Associate DRC files to OrcaSlicer" @@ -8864,17 +8180,13 @@ msgstr "หากเปิดใช้งาน ให้ตั้งค่า O msgid "Associate STL files to OrcaSlicer" msgstr "เชื่อมโยงไฟล์ STL กับ OrcaSlicer" -msgid "" -"If enabled, this sets OrcaSlicer as the default application to open STL " -"files." +msgid "If enabled, this sets OrcaSlicer as the default application to open STL files." msgstr "หากเปิดใช้งาน ให้ตั้งค่า OrcaSlicer เป็นแอปพลิเคชันเริ่มต้นเพื่อเปิดไฟล์ STL" msgid "Associate STEP files to OrcaSlicer" msgstr "เชื่อมโยงไฟล์ STEP กับ OrcaSlicer" -msgid "" -"If enabled, this sets OrcaSlicer as the default application to open STEP " -"files." +msgid "If enabled, this sets OrcaSlicer as the default application to open STEP files." msgstr "หากเปิดใช้งาน ให้ตั้งค่า OrcaSlicer เป็นแอปพลิเคชันเริ่มต้นเพื่อเปิดไฟล์ STEP" msgid "Associate web links to OrcaSlicer" @@ -8890,23 +8202,17 @@ msgid "(Experimental) Keep painted feature after mesh change" msgstr "(ทดลอง) เก็บคุณสมบัติการทาสีไว้หลังจากเปลี่ยนตาข่าย" msgid "" -"Attempt to keep painted features (color/seam/support/fuzzy etc.) after " -"changing the object mesh (such as cut/reload from disk/simplify/fix etc.)\n" +"Attempt to keep painted features (color/seam/support/fuzzy etc.) after changing the object mesh (such as cut/reload from disk/simplify/fix etc.)\n" "Highly experimental! Slow and may create artifact." msgstr "" -"พยายามคงคุณสมบัติการทาสีไว้ (สี/รอยตะเข็บ/ส่วนรองรับ/คลุมเครือ ฯลฯ) หลังจากเปลี่ยนตาข่ายวัตถุ " -"(เช่น ตัด/โหลดซ้ำจากดิสก์/ลดความซับซ้อน/แก้ไข ฯลฯ)\n" +"พยายามคงคุณสมบัติการทาสีไว้ (สี/รอยตะเข็บ/ส่วนรองรับ/คลุมเครือ ฯลฯ) หลังจากเปลี่ยนตาข่ายวัตถุ (เช่น ตัด/โหลดซ้ำจากดิสก์/ลดความซับซ้อน/แก้ไข ฯลฯ)\n" "น่าทดลองมาก! ช้าและอาจสร้างสิ่งประดิษฐ์" msgid "Show unsupported presets" msgstr "แสดงค่าที่ตั้งไว้ล่วงหน้าที่ไม่รองรับ" -msgid "" -"Show incompatible/unsupported presets in the printer and filament dropdown " -"lists. These presets cannot be selected." -msgstr "" -"แสดงค่าที่ตั้งไว้ล่วงหน้าที่ไม่เข้ากันหรือไม่รองรับในรายการเลือกเครื่องพิมพ์และเส้นพลาสติก " -"ไม่สามารถเลือกค่าที่ตั้งไว้ล่วงหน้าเหล่านี้ได้" +msgid "Show incompatible/unsupported presets in the printer and filament dropdown lists. These presets cannot be selected." +msgstr "แสดงค่าที่ตั้งไว้ล่วงหน้าที่ไม่เข้ากันหรือไม่รองรับในรายการเลือกเครื่องพิมพ์และเส้นพลาสติก ไม่สามารถเลือกค่าที่ตั้งไว้ล่วงหน้าเหล่านี้ได้" msgid "Allow Abnormal Storage" msgstr "อนุญาตให้จัดเก็บผิดปกติ" @@ -9200,8 +8506,7 @@ msgid "Preset \"%1%\" already exists." msgstr "มีพรีเซ็ต \"%1%\" อยู่แล้ว" #, boost-format -msgid "" -"Preset \"%1%\" already exists and is incompatible with the current printer." +msgid "Preset \"%1%\" already exists and is incompatible with the current printer." msgstr "ค่าที่ตั้งไว้ล่วงหน้า \"%1%\" มีอยู่แล้ว และเข้ากันไม่ได้กับเครื่องพิมพ์ปัจจุบัน" msgid "Please note that saving will overwrite the current preset." @@ -9283,10 +8588,8 @@ msgid "Auto Bed Leveling" msgstr "ปรับระดับฐานพิมพ์อัตโนมัติ" msgid "" -"This checks the flatness of heatbed. Leveling makes extruded height " -"uniform.\n" -"*Automatic mode: Run a leveling check(about 10 seconds). Skip if surface is " -"fine." +"This checks the flatness of heatbed. Leveling makes extruded height uniform.\n" +"*Automatic mode: Run a leveling check(about 10 seconds). Skip if surface is fine." msgstr "" "วิธีนี้จะตรวจสอบความเรียบของฐานพิมพ์ การปรับระดับทำให้ความสูงที่ฉีดเส้นออกมาสม่ำเสมอ\n" "*โหมดอัตโนมัติ: เรียกใช้การตรวจสอบการปรับระดับ (ประมาณ 10 วินาที) ข้ามไปหากพื้นผิวดี" @@ -9295,8 +8598,7 @@ msgid "Flow Dynamics Calibration" msgstr "ปรับเทียบไดนามิกการไหล" msgid "" -"This process determines the dynamic flow values to improve overall print " -"quality.\n" +"This process determines the dynamic flow values to improve overall print quality.\n" "*Automatic mode: Skip if the filament was calibrated recently." msgstr "" "กระบวนการนี้จะกำหนดค่าการไหลแบบไดนามิกเพื่อปรับปรุงคุณภาพการพิมพ์โดยรวม\n" @@ -9322,79 +8624,40 @@ msgid "High Flow" msgstr "อัตราไหลสูง" #, c-format, boost-format -msgid "" -"The nozzle flow setting of %s(%s) doesn't match with the slicing file(%s). " -"Please make sure the nozzle installed matches with settings in printer, then " -"set the corresponding printer preset while slicing." -msgstr "" -"การตั้งค่าการไหลของหัวฉีดของ %s(%s) ไม่ตรงกับไฟล์การแบ่งส่วน (%s) " -"โปรดตรวจสอบให้แน่ใจว่าหัวฉีดที่ติดตั้งตรงกับการตั้งค่าในเครื่องพิมพ์ " -"จากนั้นตั้งค่าเครื่องพิมพ์ล่วงหน้าที่เกี่ยวข้องขณะสไลซ์" +msgid "The nozzle flow setting of %s(%s) doesn't match with the slicing file(%s). Please make sure the nozzle installed matches with settings in printer, then set the corresponding printer preset while slicing." +msgstr "การตั้งค่าการไหลของหัวฉีดของ %s(%s) ไม่ตรงกับไฟล์การแบ่งส่วน (%s) โปรดตรวจสอบให้แน่ใจว่าหัวฉีดที่ติดตั้งตรงกับการตั้งค่าในเครื่องพิมพ์ จากนั้นตั้งค่าเครื่องพิมพ์ล่วงหน้าที่เกี่ยวข้องขณะสไลซ์" #, c-format, boost-format -msgid "" -"Filament %s does not match the filament in AMS slot %s. Please update the " -"printer firmware to support AMS slot assignment." -msgstr "" -"เส้นพลาสติก %s ไม่ตรงกับเส้นพลาสติกในช่อง AMS %s " -"โปรดอัปเดตเฟิร์มแวร์เครื่องพิมพ์เพื่อรองรับการกำหนดสล็อต AMS" +msgid "Filament %s does not match the filament in AMS slot %s. Please update the printer firmware to support AMS slot assignment." +msgstr "เส้นพลาสติก %s ไม่ตรงกับเส้นพลาสติกในช่อง AMS %s โปรดอัปเดตเฟิร์มแวร์เครื่องพิมพ์เพื่อรองรับการกำหนดสล็อต AMS" -msgid "" -"Filament does not match the filament in AMS slot. Please update the printer " -"firmware to support AMS slot assignment." -msgstr "" -"เส้นพลาสติกไม่ตรงกับเส้นพลาสติกในช่อง AMS " -"โปรดอัปเดตเฟิร์มแวร์เครื่องพิมพ์เพื่อรองรับการกำหนดสล็อต AMS" +msgid "Filament does not match the filament in AMS slot. Please update the printer firmware to support AMS slot assignment." +msgstr "เส้นพลาสติกไม่ตรงกับเส้นพลาสติกในช่อง AMS โปรดอัปเดตเฟิร์มแวร์เครื่องพิมพ์เพื่อรองรับการกำหนดสล็อต AMS" #, c-format, boost-format -msgid "" -"The selected printer (%s) is incompatible with the print file configuration " -"(%s). Please adjust the printer preset in the prepare page or choose a " -"compatible printer on this page." -msgstr "" -"เครื่องพิมพ์ที่เลือก (%s) เข้ากันไม่ได้กับการกำหนดค่าไฟล์การพิมพ์ (%s) " -"โปรดปรับการตั้งค่าล่วงหน้าของเครื่องพิมพ์ในหน้าจัดเตรียมหรือเลือกเครื่องพิมพ์ที่ใช้งานร่วมกันได้ในหน้านี้" +msgid "The selected printer (%s) is incompatible with the print file configuration (%s). Please adjust the printer preset in the prepare page or choose a compatible printer on this page." +msgstr "เครื่องพิมพ์ที่เลือก (%s) เข้ากันไม่ได้กับการกำหนดค่าไฟล์การพิมพ์ (%s) โปรดปรับการตั้งค่าล่วงหน้าของเครื่องพิมพ์ในหน้าจัดเตรียมหรือเลือกเครื่องพิมพ์ที่ใช้งานร่วมกันได้ในหน้านี้" -msgid "" -"When spiral vase mode is enabled, machines with I3 structure will not " -"generate timelapse videos." +msgid "When spiral vase mode is enabled, machines with I3 structure will not generate timelapse videos." msgstr "เมื่อเปิดใช้งานโหมดแจกันเกลียว เครื่องจักรที่มีโครงสร้าง I3 จะไม่สร้างวิดีโอไทม์แลปส์" -msgid "" -"The current printer does not support timelapse in Traditional Mode when " -"printing By-Object." +msgid "The current printer does not support timelapse in Traditional Mode when printing By-Object." msgstr "เครื่องพิมพ์ปัจจุบันไม่รองรับไทม์แลปส์ในโหมดดั้งเดิมเมื่อพิมพ์ By-Object" msgid "Errors" msgstr "ข้อผิดพลาด" -msgid "" -"More than one filament types have been mapped to the same external spool, " -"which may cause printing issues. The printer won't pause during printing." -msgstr "" -"มีการจับคู่เส้นพลาสติกมากกว่าหนึ่งประเภทกับแกนม้วนภายนอกเดียวกัน ซึ่งอาจทำให้เกิดปัญหาในการพิมพ์ " -"เครื่องพิมพ์จะไม่หยุดชั่วคราวระหว่างการพิมพ์" +msgid "More than one filament types have been mapped to the same external spool, which may cause printing issues. The printer won't pause during printing." +msgstr "มีการจับคู่เส้นพลาสติกมากกว่าหนึ่งประเภทกับแกนม้วนภายนอกเดียวกัน ซึ่งอาจทำให้เกิดปัญหาในการพิมพ์ เครื่องพิมพ์จะไม่หยุดชั่วคราวระหว่างการพิมพ์" -msgid "" -"The filament type setting of external spool is different from the filament " -"in the slicing file." +msgid "The filament type setting of external spool is different from the filament in the slicing file." msgstr "การตั้งค่าประเภทฟิลาเมนต์ของสปูลภายนอกแตกต่างจากฟิลาเมนต์ในไฟล์สไลซ์" -msgid "" -"The printer type selected when generating G-code is not consistent with the " -"currently selected printer. It is recommended that you use the same printer " -"type for slicing." -msgstr "" -"ประเภทเครื่องพิมพ์ที่เลือกเมื่อสร้าง G-code ไม่สอดคล้องกับเครื่องพิมพ์ที่เลือกในปัจจุบัน " -"ขอแนะนำให้คุณใช้เครื่องพิมพ์ประเภทเดียวกันในการตัด" +msgid "The printer type selected when generating G-code is not consistent with the currently selected printer. It is recommended that you use the same printer type for slicing." +msgstr "ประเภทเครื่องพิมพ์ที่เลือกเมื่อสร้าง G-code ไม่สอดคล้องกับเครื่องพิมพ์ที่เลือกในปัจจุบัน ขอแนะนำให้คุณใช้เครื่องพิมพ์ประเภทเดียวกันในการตัด" -msgid "" -"There are some unknown filaments in the AMS mappings. Please check whether " -"they are the required filaments. If they are okay, click \"Confirm\" to " -"start printing." -msgstr "" -"มีเส้นพลาสติกที่ไม่รู้จักบางอย่างในการแมป AMS โปรดตรวจสอบว่าเป็นเส้นพลาสติกที่ต้องการหรือไม่ " -"หากไม่เป็นไร ให้กด \"ยืนยัน\" เพื่อเริ่มพิมพ์" +msgid "There are some unknown filaments in the AMS mappings. Please check whether they are the required filaments. If they are okay, click \"Confirm\" to start printing." +msgstr "มีเส้นพลาสติกที่ไม่รู้จักบางอย่างในการแมป AMS โปรดตรวจสอบว่าเป็นเส้นพลาสติกที่ต้องการหรือไม่ หากไม่เป็นไร ให้กด \"ยืนยัน\" เพื่อเริ่มพิมพ์" msgid "Please check the following:" msgstr "กรุณาตรวจสอบสิ่งต่อไปนี้:" @@ -9402,17 +8665,13 @@ msgstr "กรุณาตรวจสอบสิ่งต่อไปนี้ msgid "Please fix the error above, otherwise printing cannot continue." msgstr "โปรดแก้ไขข้อผิดพลาดด้านบน ไม่เช่นนั้นการพิมพ์จะไม่สามารถดำเนินการต่อได้" -msgid "" -"Please click the confirm button if you still want to proceed with printing." +msgid "Please click the confirm button if you still want to proceed with printing." msgstr "โปรดคลิกปุ่มยืนยันหากคุณยังต้องการดำเนินการพิมพ์ต่อ" -msgid "" -"This checks the flatness of heatbed. Leveling makes extruded height uniform." +msgid "This checks the flatness of heatbed. Leveling makes extruded height uniform." msgstr "วิธีนี้จะตรวจสอบความเรียบของฐานพิมพ์ การปรับระดับทำให้ความสูงที่ฉีดเส้นออกมาสม่ำเสมอ" -msgid "" -"This process determines the dynamic flow values to improve overall print " -"quality." +msgid "This process determines the dynamic flow values to improve overall print quality." msgstr "กระบวนการนี้จะกำหนดค่าการไหลแบบไดนามิกเพื่อปรับปรุงคุณภาพการพิมพ์โดยรวม" msgid "Preparing print job" @@ -9431,45 +8690,23 @@ msgstr "หัวฉีด" msgid "both extruders" msgstr "ชุดดันเส้นทั้งสอง" -msgid "" -"Tips: If you changed your nozzle of your printer lately, Please go to " -"'Device -> Printer parts' to change your nozzle setting." -msgstr "" -"เคล็ดลับ: หากคุณเปลี่ยนหัวฉีดของเครื่องพิมพ์เมื่อเร็วๆ นี้ โปรดไปที่ 'อุปกรณ์ -> ชิ้นส่วนเครื่องพิมพ์' " -"เพื่อเปลี่ยนการตั้งค่าหัวฉีดของคุณ" +msgid "Tips: If you changed your nozzle of your printer lately, Please go to 'Device -> Printer parts' to change your nozzle setting." +msgstr "เคล็ดลับ: หากคุณเปลี่ยนหัวฉีดของเครื่องพิมพ์เมื่อเร็วๆ นี้ โปรดไปที่ 'อุปกรณ์ -> ชิ้นส่วนเครื่องพิมพ์' เพื่อเปลี่ยนการตั้งค่าหัวฉีดของคุณ" #, c-format, boost-format -msgid "" -"The %s diameter(%.1fmm) of current printer doesn't match with the slicing " -"file (%.1fmm). Please make sure the nozzle installed matches with settings " -"in printer, then set the corresponding printer preset when slicing." -msgstr "" -"เส้นผ่านศูนย์กลาง %s(%.1fmm) ของเครื่องพิมพ์ปัจจุบันไม่ตรงกับไฟล์การแบ่งส่วน (%.1fmm) " -"โปรดตรวจสอบให้แน่ใจว่าหัวฉีดที่ติดตั้งตรงกับการตั้งค่าในเครื่องพิมพ์ " -"จากนั้นตั้งค่าเครื่องพิมพ์ล่วงหน้าที่เกี่ยวข้องเมื่อสไลซ์" +msgid "The %s diameter(%.1fmm) of current printer doesn't match with the slicing file (%.1fmm). Please make sure the nozzle installed matches with settings in printer, then set the corresponding printer preset when slicing." +msgstr "เส้นผ่านศูนย์กลาง %s(%.1fmm) ของเครื่องพิมพ์ปัจจุบันไม่ตรงกับไฟล์การแบ่งส่วน (%.1fmm) โปรดตรวจสอบให้แน่ใจว่าหัวฉีดที่ติดตั้งตรงกับการตั้งค่าในเครื่องพิมพ์ จากนั้นตั้งค่าเครื่องพิมพ์ล่วงหน้าที่เกี่ยวข้องเมื่อสไลซ์" #, c-format, boost-format -msgid "" -"The current nozzle diameter (%.1fmm) doesn't match with the slicing file " -"(%.1fmm). Please make sure the nozzle installed matches with settings in " -"printer, then set the corresponding printer preset when slicing." -msgstr "" -"เส้นผ่านศูนย์กลางหัวฉีดปัจจุบัน (%.1fmm) ไม่ตรงกับไฟล์การแบ่งส่วน (%.1fmm) " -"โปรดตรวจสอบให้แน่ใจว่าหัวฉีดที่ติดตั้งตรงกับการตั้งค่าในเครื่องพิมพ์ " -"จากนั้นตั้งค่าเครื่องพิมพ์ล่วงหน้าที่เกี่ยวข้องเมื่อสไลซ์" +msgid "The current nozzle diameter (%.1fmm) doesn't match with the slicing file (%.1fmm). Please make sure the nozzle installed matches with settings in printer, then set the corresponding printer preset when slicing." +msgstr "เส้นผ่านศูนย์กลางหัวฉีดปัจจุบัน (%.1fmm) ไม่ตรงกับไฟล์การแบ่งส่วน (%.1fmm) โปรดตรวจสอบให้แน่ใจว่าหัวฉีดที่ติดตั้งตรงกับการตั้งค่าในเครื่องพิมพ์ จากนั้นตั้งค่าเครื่องพิมพ์ล่วงหน้าที่เกี่ยวข้องเมื่อสไลซ์" #, c-format, boost-format -msgid "" -"The hardness of current material (%s) exceeds the hardness of %s(%s). Please " -"verify the nozzle or material settings and try again." -msgstr "" -"ความแข็งของวัสดุปัจจุบัน (%s) เกินความแข็งของ %s(%s) " -"โปรดตรวจสอบการตั้งค่าหัวฉีดหรือวัสดุแล้วลองอีกครั้ง" +msgid "The hardness of current material (%s) exceeds the hardness of %s(%s). Please verify the nozzle or material settings and try again." +msgstr "ความแข็งของวัสดุปัจจุบัน (%s) เกินความแข็งของ %s(%s) โปรดตรวจสอบการตั้งค่าหัวฉีดหรือวัสดุแล้วลองอีกครั้ง" #, c-format, boost-format -msgid "" -"[ %s ] requires printing in a high-temperature environment. Please close the " -"door." +msgid "[ %s ] requires printing in a high-temperature environment. Please close the door." msgstr "[ %s ] จำเป็นต้องพิมพ์ในสภาพแวดล้อมที่มีอุณหภูมิสูง กรุณาปิดประตู." #, c-format, boost-format @@ -9484,9 +8721,7 @@ msgstr "เส้นพลาสติกบน %s อาจอ่อนตั msgid "The filament on %s is unknown and may soften. Please set filament." msgstr "ไม่ทราบเส้นพลาสติกบน %s และอาจอ่อนตัวลง กรุณาตั้งค่าเส้นพลาสติก" -msgid "" -"Unable to automatically match to suitable filament. Please click to manually " -"match." +msgid "Unable to automatically match to suitable filament. Please click to manually match." msgstr "ไม่สามารถจับคู่เส้นพลาสติกที่เหมาะสมได้โดยอัตโนมัติ กรุณาคลิกเพื่อจับคู่ด้วยตนเอง" msgid "Install toolhead enhanced cooling fan to prevent filament softening." @@ -9528,25 +8763,19 @@ msgstr "ไม่สามารถส่งงานพิมพ์ได้เ msgid "Cannot send a print job while the printer is updating firmware." msgstr "ไม่สามารถส่งงานพิมพ์ในขณะที่เครื่องพิมพ์กำลังอัปเดตเฟิร์มแวร์" -msgid "" -"The printer is executing instructions. Please restart printing after it ends." +msgid "The printer is executing instructions. Please restart printing after it ends." msgstr "เครื่องพิมพ์กำลังดำเนินการตามคำแนะนำ โปรดเริ่มการพิมพ์ใหม่หลังจากสิ้นสุด" msgid "AMS is setting up. Please try again later." msgstr "AMS กำลังจัดตั้ง โปรดลองอีกครั้งในภายหลัง" -msgid "" -"Not all filaments used in slicing are mapped to the printer. Please check " -"the mapping of filaments." -msgstr "" -"เส้นพลาสติกที่ใช้ในการตัดบางเส้นไม่ได้ถูกแมปกับเครื่องพิมพ์ โปรดตรวจสอบการแมปของเส้นพลาสติก" +msgid "Not all filaments used in slicing are mapped to the printer. Please check the mapping of filaments." +msgstr "เส้นพลาสติกที่ใช้ในการตัดบางเส้นไม่ได้ถูกแมปกับเครื่องพิมพ์ โปรดตรวจสอบการแมปของเส้นพลาสติก" msgid "Please do not mix-use the Ext with AMS." msgstr "กรุณาอย่าใช้ Ext ผสมกับ AMS" -msgid "" -"Invalid nozzle information, please refresh or manually set nozzle " -"information." +msgid "Invalid nozzle information, please refresh or manually set nozzle information." msgstr "ข้อมูลหัวฉีดไม่ถูกต้อง โปรดรีเฟรชหรือตั้งค่าข้อมูลหัวฉีดด้วยตนเอง" msgid "Storage needs to be inserted before printing via LAN." @@ -9567,43 +8796,23 @@ msgstr "ไม่สามารถส่งงานพิมพ์จานเ msgid "Storage needs to be inserted to record timelapse." msgstr "ต้องใส่ที่เก็บข้อมูลเพื่อบันทึกไทม์แลปส์" -msgid "" -"You have selected both external and AMS filaments for an extruder. You will " -"need to manually switch the external filament during printing." -msgstr "" -"คุณได้เลือกเส้นพลาสติกทั้งภายนอกและ AMS สำหรับชุดดันเส้น " -"คุณจะต้องสลับเส้นพลาสติกภายนอกด้วยตนเองระหว่างการพิมพ์" +msgid "You have selected both external and AMS filaments for an extruder. You will need to manually switch the external filament during printing." +msgstr "คุณได้เลือกเส้นพลาสติกทั้งภายนอกและ AMS สำหรับชุดดันเส้น คุณจะต้องสลับเส้นพลาสติกภายนอกด้วยตนเองระหว่างการพิมพ์" -msgid "" -"TPU 90A/TPU 85A is too soft and does not support automatic Flow Dynamics " -"calibration." +msgid "TPU 90A/TPU 85A is too soft and does not support automatic Flow Dynamics calibration." msgstr "TPU 90A/TPU 85A อ่อนเกินไปและไม่รองรับการปรับเทียบ Flow Dynamics อัตโนมัติ" -msgid "" -"Set dynamic flow calibration to 'OFF' to enable custom dynamic flow value." -msgstr "" -"ตั้งค่าการสอบเทียบโฟลว์แบบไดนามิกเป็น 'ปิด' เพื่อเปิดใช้งานค่าโฟลว์แบบไดนามิกที่กำหนดเอง" +msgid "Set dynamic flow calibration to 'OFF' to enable custom dynamic flow value." +msgstr "ตั้งค่าการสอบเทียบโฟลว์แบบไดนามิกเป็น 'ปิด' เพื่อเปิดใช้งานค่าโฟลว์แบบไดนามิกที่กำหนดเอง" msgid "This printer does not support printing all plates." msgstr "เครื่องพิมพ์นี้ไม่รองรับการพิมพ์เพลตทั้งหมด" -msgid "" -"The current firmware supports a maximum of 16 materials. You can either " -"reduce the number of materials to 16 or fewer on the Preparation Page, or " -"try updating the firmware. If you are still restricted after the update, " -"please wait for subsequent firmware support." -msgstr "" -"เฟิร์มแวร์ปัจจุบันรองรับวัสดุได้สูงสุด 16 รายการ คุณสามารถลดจำนวนวัสดุเหลือ 16 " -"ชิ้นหรือน้อยกว่านั้นได้ในหน้าการเตรียมการ หรือลองอัปเดตเฟิร์มแวร์ " -"หากคุณยังคงถูกจำกัดหลังจากการอัพเดต โปรดรอส่วนรองรับเฟิร์มแวร์ครั้งต่อไป" +msgid "The current firmware supports a maximum of 16 materials. You can either reduce the number of materials to 16 or fewer on the Preparation Page, or try updating the firmware. If you are still restricted after the update, please wait for subsequent firmware support." +msgstr "เฟิร์มแวร์ปัจจุบันรองรับวัสดุได้สูงสุด 16 รายการ คุณสามารถลดจำนวนวัสดุเหลือ 16 ชิ้นหรือน้อยกว่านั้นได้ในหน้าการเตรียมการ หรือลองอัปเดตเฟิร์มแวร์ หากคุณยังคงถูกจำกัดหลังจากการอัพเดต โปรดรอส่วนรองรับเฟิร์มแวร์ครั้งต่อไป" -msgid "" -"The type of external filament is unknown or does not match with the filament " -"type in the slicing file. Please make sure you have installed the correct " -"filament in the external spool." -msgstr "" -"ไม่ทราบประเภทของเส้นพลาสติกภายนอกหรือไม่ตรงกับประเภทเส้นพลาสติกในไฟล์สไลซ์ " -"โปรดตรวจสอบให้แน่ใจว่าคุณได้ติดตั้งเส้นพลาสติกที่ถูกต้องในแกนม้วนสายภายนอก" +msgid "The type of external filament is unknown or does not match with the filament type in the slicing file. Please make sure you have installed the correct filament in the external spool." +msgstr "ไม่ทราบประเภทของเส้นพลาสติกภายนอกหรือไม่ตรงกับประเภทเส้นพลาสติกในไฟล์สไลซ์ โปรดตรวจสอบให้แน่ใจว่าคุณได้ติดตั้งเส้นพลาสติกที่ถูกต้องในแกนม้วนสายภายนอก" msgid "Please refer to Wiki before use->" msgstr "โปรดดู Wiki ก่อนใช้งาน ->" @@ -9650,12 +8859,8 @@ msgstr "เครื่องพิมพ์ไม่รองรับการ msgid "Sending..." msgstr "กำลังส่ง..." -msgid "" -"File upload timed out. Please check if the firmware version supports this " -"operation or verify if the printer is functioning properly." -msgstr "" -"การอัปโหลดไฟล์หมดเวลา โปรดตรวจสอบว่าเวอร์ชันเฟิร์มแวร์รองรับการทำงานนี้หรือไม่ " -"หรือตรวจสอบว่าเครื่องพิมพ์ทำงานอย่างถูกต้องหรือไม่" +msgid "File upload timed out. Please check if the firmware version supports this operation or verify if the printer is functioning properly." +msgstr "การอัปโหลดไฟล์หมดเวลา โปรดตรวจสอบว่าเวอร์ชันเฟิร์มแวร์รองรับการทำงานนี้หรือไม่ หรือตรวจสอบว่าเครื่องพิมพ์ทำงานอย่างถูกต้องหรือไม่" msgid "Sending failed, please try again!" msgstr "ส่งไม่สำเร็จ กรุณาลองอีกครั้ง!" @@ -9730,18 +8935,8 @@ msgstr "อ่านและยอมรับ" msgid "Terms and Conditions" msgstr "ข้อกำหนดและเงื่อนไข" -msgid "" -"Thank you for purchasing a Bambu Lab device. Before using your Bambu Lab " -"device, please read the terms and conditions. By clicking to agree to use " -"your Bambu Lab device, you agree to abide by the Privacy Policy and Terms of " -"Use (collectively, the \"Terms\"). If you do not comply with or agree to the " -"Bambu Lab Privacy Policy, please do not use Bambu Lab equipment and services." -msgstr "" -"ขอขอบคุณที่ซื้ออุปกรณ์ Bambu Lab ก่อนใช้อุปกรณ์ Bambu Lab โปรดอ่านข้อกำหนดและเงื่อนไข " -"การคลิกเพื่อยอมรับการใช้อุปกรณ์ Bambu Lab ของคุณ " -"แสดงว่าคุณยินยอมที่จะปฏิบัติตามนโยบายความเป็นส่วนตัวและข้อกำหนดการใช้งาน (เรียกรวมกันว่า " -"\"ข้อกำหนด\") หากคุณไม่ปฏิบัติตามหรือยอมรับนโยบายความเป็นส่วนตัวของ Bambu Lab " -"โปรดอย่าใช้อุปกรณ์และบริการของ Bambu Lab" +msgid "Thank you for purchasing a Bambu Lab device. Before using your Bambu Lab device, please read the terms and conditions. By clicking to agree to use your Bambu Lab device, you agree to abide by the Privacy Policy and Terms of Use (collectively, the \"Terms\"). If you do not comply with or agree to the Bambu Lab Privacy Policy, please do not use Bambu Lab equipment and services." +msgstr "ขอขอบคุณที่ซื้ออุปกรณ์ Bambu Lab ก่อนใช้อุปกรณ์ Bambu Lab โปรดอ่านข้อกำหนดและเงื่อนไข การคลิกเพื่อยอมรับการใช้อุปกรณ์ Bambu Lab ของคุณ แสดงว่าคุณยินยอมที่จะปฏิบัติตามนโยบายความเป็นส่วนตัวและข้อกำหนดการใช้งาน (เรียกรวมกันว่า \"ข้อกำหนด\") หากคุณไม่ปฏิบัติตามหรือยอมรับนโยบายความเป็นส่วนตัวของ Bambu Lab โปรดอย่าใช้อุปกรณ์และบริการของ Bambu Lab" msgid "and" msgstr "และ" @@ -9756,29 +8951,8 @@ msgid "Statement about User Experience Improvement Program" msgstr "คำชี้แจงเกี่ยวกับโครงการปรับปรุงประสบการณ์ผู้ใช้" #, c-format, boost-format -msgid "" -"In the 3D Printing community, we learn from each other's successes and " -"failures to adjust our own slicing parameters and settings. %s follows the " -"same principle and uses machine learning to improve its performance from the " -"successes and failures of the vast number of prints by our users. We are " -"training %s to be smarter by feeding them the real-world data. If you are " -"willing, this service will access information from your error logs and usage " -"logs, which may include information described in Privacy Policy. We will not " -"collect any Personal Data by which an individual can be identified directly " -"or indirectly, including without limitation names, addresses, payment " -"information, or phone numbers. By enabling this service, you agree to these " -"terms and the statement about Privacy Policy." -msgstr "" -"ในชุมชนการพิมพ์ 3 มิติ " -"เราเรียนรู้จากความสำเร็จและความล้มเหลวของกันและกันในการปรับพารามิเตอร์และการตั้งค่าการแบ่งส่วนของเราเอง " -"%s " -"ปฏิบัติตามหลักการเดียวกันและใช้การเรียนรู้ของเครื่องเพื่อปรับปรุงประสิทธิภาพจากความสำเร็จและความล้มเหลวของงานพิมพ์จำนวนมากโดยผู้ใช้ของเรา " -"เรากำลังฝึก %s ให้ฉลาดขึ้นโดยป้อนข้อมูลจากโลกแห่งความเป็นจริงให้พวกเขา หากคุณเต็มใจ " -"บริการนี้จะเข้าถึงข้อมูลจากบันทึกข้อผิดพลาดและบันทึกการใช้งานของคุณ " -"ซึ่งอาจรวมถึงข้อมูลที่อธิบายไว้ในนโยบายความเป็นส่วนตัว เราจะไม่เก็บรวบรวมข้อมูลส่วนบุคคลใด ๆ " -"ที่สามารถระบุตัวบุคคลได้โดยตรงหรือโดยอ้อม รวมถึงแต่ไม่จำกัดเพียงชื่อ ที่อยู่ ข้อมูลการชำระเงิน " -"หรือหมายเลขโทรศัพท์ เมื่อเปิดใช้บริการนี้ " -"แสดงว่าคุณยอมรับข้อกำหนดเหล่านี้และคำชี้แจงเกี่ยวกับนโยบายความเป็นส่วนตัว" +msgid "In the 3D Printing community, we learn from each other's successes and failures to adjust our own slicing parameters and settings. %s follows the same principle and uses machine learning to improve its performance from the successes and failures of the vast number of prints by our users. We are training %s to be smarter by feeding them the real-world data. If you are willing, this service will access information from your error logs and usage logs, which may include information described in Privacy Policy. We will not collect any Personal Data by which an individual can be identified directly or indirectly, including without limitation names, addresses, payment information, or phone numbers. By enabling this service, you agree to these terms and the statement about Privacy Policy." +msgstr "ในชุมชนการพิมพ์ 3 มิติ เราเรียนรู้จากความสำเร็จและความล้มเหลวของกันและกันในการปรับพารามิเตอร์และการตั้งค่าการแบ่งส่วนของเราเอง %s ปฏิบัติตามหลักการเดียวกันและใช้การเรียนรู้ของเครื่องเพื่อปรับปรุงประสิทธิภาพจากความสำเร็จและความล้มเหลวของงานพิมพ์จำนวนมากโดยผู้ใช้ของเรา เรากำลังฝึก %s ให้ฉลาดขึ้นโดยป้อนข้อมูลจากโลกแห่งความเป็นจริงให้พวกเขา หากคุณเต็มใจ บริการนี้จะเข้าถึงข้อมูลจากบันทึกข้อผิดพลาดและบันทึกการใช้งานของคุณ ซึ่งอาจรวมถึงข้อมูลที่อธิบายไว้ในนโยบายความเป็นส่วนตัว เราจะไม่เก็บรวบรวมข้อมูลส่วนบุคคลใด ๆ ที่สามารถระบุตัวบุคคลได้โดยตรงหรือโดยอ้อม รวมถึงแต่ไม่จำกัดเพียงชื่อ ที่อยู่ ข้อมูลการชำระเงิน หรือหมายเลขโทรศัพท์ เมื่อเปิดใช้บริการนี้ แสดงว่าคุณยอมรับข้อกำหนดเหล่านี้และคำชี้แจงเกี่ยวกับนโยบายความเป็นส่วนตัว" msgid "Statement on User Experience Improvement Plan" msgstr "คำชี้แจงเกี่ยวกับแผนการปรับปรุงประสบการณ์ผู้ใช้" @@ -9815,48 +8989,23 @@ msgstr "ค้นหาในที่ตั้งไว้ล่วงหน้ msgid "Click to reset all settings to the last saved preset." msgstr "คลิกเพื่อรีเซ็ตการตั้งค่าทั้งหมดเป็นค่าที่ตั้งไว้ล่วงหน้าที่บันทึกไว้ล่าสุด" -msgid "" -"A prime tower is required for smooth timelapse mode. There may be flaws on " -"the model without a prime tower. Are you sure you want to disable the prime " -"tower?" -msgstr "" -"โหมดไทม์แลปส์แบบราบรื่นต้องใช้ไพรม์ทาวเวอร์ หากไม่มีไพรม์ทาวเวอร์อาจเกิดตำหนิบนโมเดลได้ " -"คุณแน่ใจหรือไม่ว่าต้องการปิดไพรม์ทาวเวอร์?" +msgid "A prime tower is required for smooth timelapse mode. There may be flaws on the model without a prime tower. Are you sure you want to disable the prime tower?" +msgstr "โหมดไทม์แลปส์แบบราบรื่นต้องใช้ไพรม์ทาวเวอร์ หากไม่มีไพรม์ทาวเวอร์อาจเกิดตำหนิบนโมเดลได้ คุณแน่ใจหรือไม่ว่าต้องการปิดไพรม์ทาวเวอร์?" -msgid "" -"A prime tower is required for clumping detection. There may be flaws on the " -"model without prime tower. Are you sure you want to disable prime tower?" -msgstr "" -"ต้องใช้ไพรม์ทาวเวอร์ในการตรวจจับการจับกันเป็นก้อน อาจมีตำหนิตรงรุ่นที่ไม่มีไพร์มทาวเวอร์ " -"คุณแน่ใจหรือไม่ว่าต้องการปิดการใช้งานไพร์มทาวเวอร์?" +msgid "A prime tower is required for clumping detection. There may be flaws on the model without prime tower. Are you sure you want to disable prime tower?" +msgstr "ต้องใช้ไพรม์ทาวเวอร์ในการตรวจจับการจับกันเป็นก้อน อาจมีตำหนิตรงรุ่นที่ไม่มีไพร์มทาวเวอร์ คุณแน่ใจหรือไม่ว่าต้องการปิดการใช้งานไพร์มทาวเวอร์?" -msgid "" -"Enabling both precise Z height and the prime tower may cause slicing errors. " -"Do you still want to enable?" -msgstr "" -"การเปิดใช้งานทั้งความสูง Z ที่แม่นยำและหอคอยหลักอาจทำให้เกิดข้อผิดพลาดในการแบ่งส่วน " -"คุณยังต้องการเปิดใช้งานหรือไม่?" +msgid "Enabling both precise Z height and the prime tower may cause slicing errors. Do you still want to enable?" +msgstr "การเปิดใช้งานทั้งความสูง Z ที่แม่นยำและหอคอยหลักอาจทำให้เกิดข้อผิดพลาดในการแบ่งส่วน คุณยังต้องการเปิดใช้งานหรือไม่?" -msgid "" -"A prime tower is required for clumping detection. There may be flaws on the " -"model without prime tower. Do you still want to enable clumping detection?" -msgstr "" -"ต้องใช้ไพรม์ทาวเวอร์ในการตรวจจับการจับกันเป็นก้อน อาจมีตำหนิตรงรุ่นที่ไม่มีไพร์มทาวเวอร์ " -"คุณยังต้องการเปิดใช้งานการตรวจจับการจับกันเป็นก้อนหรือไม่" +msgid "A prime tower is required for clumping detection. There may be flaws on the model without prime tower. Do you still want to enable clumping detection?" +msgstr "ต้องใช้ไพรม์ทาวเวอร์ในการตรวจจับการจับกันเป็นก้อน อาจมีตำหนิตรงรุ่นที่ไม่มีไพร์มทาวเวอร์ คุณยังต้องการเปิดใช้งานการตรวจจับการจับกันเป็นก้อนหรือไม่" -msgid "" -"Enabling both precise Z height and the prime tower may cause slicing errors. " -"Do you still want to enable precise Z height?" -msgstr "" -"การเปิดใช้งานทั้งความสูง Z ที่แม่นยำและหอคอยหลักอาจทำให้เกิดข้อผิดพลาดในการแบ่งส่วน " -"คุณยังต้องการเปิดใช้งานความสูง Z ที่แม่นยำหรือไม่" +msgid "Enabling both precise Z height and the prime tower may cause slicing errors. Do you still want to enable precise Z height?" +msgstr "การเปิดใช้งานทั้งความสูง Z ที่แม่นยำและหอคอยหลักอาจทำให้เกิดข้อผิดพลาดในการแบ่งส่วน คุณยังต้องการเปิดใช้งานความสูง Z ที่แม่นยำหรือไม่" -msgid "" -"A prime tower is required for smooth timelapse mode. There may be flaws on " -"the model without prime tower. Do you want to enable the prime tower?" -msgstr "" -"โหมดไทม์แลปส์แบบราบรื่นต้องใช้ไพรม์ทาวเวอร์ หากไม่มีไพรม์ทาวเวอร์อาจเกิดตำหนิบนโมเดลได้ " -"ต้องการเปิดใช้ไพรม์ทาวเวอร์หรือไม่?" +msgid "A prime tower is required for smooth timelapse mode. There may be flaws on the model without prime tower. Do you want to enable the prime tower?" +msgstr "โหมดไทม์แลปส์แบบราบรื่นต้องใช้ไพรม์ทาวเวอร์ หากไม่มีไพรม์ทาวเวอร์อาจเกิดตำหนิบนโมเดลได้ ต้องการเปิดใช้ไพรม์ทาวเวอร์หรือไม่?" msgid "Still print by object?" msgstr "ยังคงพิมพ์ตามวัตถุใช่ไหม" @@ -9869,14 +9018,11 @@ msgstr "" "คุณแน่ใจหรือว่าจะใช้พวกมันเป็นฐานส่วนรองรับ?\n" msgid "" -"When using support material for the support interface, we recommend the " -"following settings:\n" -"0 top Z distance, 0 interface spacing, interlaced rectilinear pattern and " -"disable independent support layer height." +"When using support material for the support interface, we recommend the following settings:\n" +"0 top Z distance, 0 interface spacing, interlaced rectilinear pattern and disable independent support layer height." msgstr "" "เมื่อใช้สื่อส่วนรองรับสำหรับอินเทอร์เฟซส่วนรองรับ เราขอแนะนำการตั้งค่าต่อไปนี้:\n" -"0 ระยะทาง Z บนสุด, ระยะห่างระหว่างอินเทอร์เฟซ 0, รูปแบบเส้นตรงแบบอินเทอร์เลซ " -"และปิดใช้งานความสูงของเลเยอร์รองรับอิสระ" +"0 ระยะทาง Z บนสุด, ระยะห่างระหว่างอินเทอร์เฟซ 0, รูปแบบเส้นตรงแบบอินเทอร์เลซ และปิดใช้งานความสูงของเลเยอร์รองรับอิสระ" msgid "" "Change these settings automatically?\n" @@ -9888,41 +9034,22 @@ msgstr "" "ไม่ - อย่าเปลี่ยนการตั้งค่าเหล่านี้ให้ฉัน" msgid "" -"When using soluble material for the support interface, we recommend the " -"following settings:\n" -"0 top Z distance, 0 interface spacing, interlaced rectilinear pattern, " -"disable independent support layer height\n" +"When using soluble material for the support interface, we recommend the following settings:\n" +"0 top Z distance, 0 interface spacing, interlaced rectilinear pattern, disable independent support layer height\n" "and use soluble materials for both support interface and support base." msgstr "" "เมื่อใช้วัสดุที่ละลายน้ำได้สำหรับอินเทอร์เฟซส่วนรองรับ เราขอแนะนำการตั้งค่าต่อไปนี้:\n" -"0 ระยะทาง Z บนสุด, ระยะห่างระหว่างอินเทอร์เฟซ 0, รูปแบบเส้นตรงแบบอินเทอร์เลซ, " -"ปิดใช้งานความสูงของเลเยอร์รองรับอิสระ\n" +"0 ระยะทาง Z บนสุด, ระยะห่างระหว่างอินเทอร์เฟซ 0, รูปแบบเส้นตรงแบบอินเทอร์เลซ, ปิดใช้งานความสูงของเลเยอร์รองรับอิสระ\n" "และใช้วัสดุที่ละลายน้ำได้สำหรับทั้งส่วนต่อประสานและฐานรองรับ" -msgid "" -"Enabling this option will modify the model's shape. If your print requires " -"precise dimensions or is part of an assembly, it's important to double-check " -"whether this change in geometry impacts the functionality of your print." -msgstr "" -"การเปิดใช้งานตัวเลือกนี้จะปรับเปลี่ยนรูปร่างของแบบจำลอง " -"หากการพิมพ์ของคุณต้องการขนาดที่แม่นยำหรือเป็นส่วนหนึ่งของชุดประกอบ " -"สิ่งสำคัญคือต้องตรวจสอบอีกครั้งว่าการเปลี่ยนแปลงทางเรขาคณิตนี้ส่งผลต่อการทำงานของการพิมพ์ของคุณหรือไม่" +msgid "Enabling this option will modify the model's shape. If your print requires precise dimensions or is part of an assembly, it's important to double-check whether this change in geometry impacts the functionality of your print." +msgstr "การเปิดใช้งานตัวเลือกนี้จะปรับเปลี่ยนรูปร่างของแบบจำลอง หากการพิมพ์ของคุณต้องการขนาดที่แม่นยำหรือเป็นส่วนหนึ่งของชุดประกอบ สิ่งสำคัญคือต้องตรวจสอบอีกครั้งว่าการเปลี่ยนแปลงทางเรขาคณิตนี้ส่งผลต่อการทำงานของการพิมพ์ของคุณหรือไม่" msgid "Are you sure you want to enable this option?" msgstr "คุณแน่ใจหรือไม่ว่าต้องการเปิดใช้งานตัวเลือกนี้" -msgid "" -"Infill patterns are typically designed to handle rotation automatically to " -"ensure proper printing and achieve their intended effects (e.g., Gyroid, " -"Cubic). Rotating the current sparse infill pattern may lead to insufficient " -"support. Please proceed with caution and thoroughly check for any potential " -"printing issues. Are you sure you want to enable this option?" -msgstr "" -"โดยทั่วไปรูปแบบไส้ในได้รับการออกแบบให้รองรับการหมุนโดยอัตโนมัติเพื่อให้แน่ใจว่าการพิมพ์ถูกต้องและบรรลุผลตามที่ต้องการ " -"(เช่น Gyroid, ลูกบาศก์) การหมุนรูปแบบ ไส้ใน " -"แบบกระจัดกระจายในปัจจุบันอาจทำให้ส่วนรองรับไม่เพียงพอ " -"โปรดดำเนินการด้วยความระมัดระวังและตรวจสอบปัญหาการพิมพ์ที่อาจเกิดขึ้นอย่างละเอียด " -"คุณแน่ใจหรือไม่ว่าต้องการเปิดใช้งานตัวเลือกนี้" +msgid "Infill patterns are typically designed to handle rotation automatically to ensure proper printing and achieve their intended effects (e.g., Gyroid, Cubic). Rotating the current sparse infill pattern may lead to insufficient support. Please proceed with caution and thoroughly check for any potential printing issues. Are you sure you want to enable this option?" +msgstr "โดยทั่วไปรูปแบบไส้ในได้รับการออกแบบให้รองรับการหมุนโดยอัตโนมัติเพื่อให้แน่ใจว่าการพิมพ์ถูกต้องและบรรลุผลตามที่ต้องการ (เช่น Gyroid, ลูกบาศก์) การหมุนรูปแบบ ไส้ใน แบบกระจัดกระจายในปัจจุบันอาจทำให้ส่วนรองรับไม่เพียงพอ โปรดดำเนินการด้วยความระมัดระวังและตรวจสอบปัญหาการพิมพ์ที่อาจเกิดขึ้นอย่างละเอียด คุณแน่ใจหรือไม่ว่าต้องการเปิดใช้งานตัวเลือกนี้" msgid "" "Layer height is too small.\n" @@ -9931,12 +9058,8 @@ msgstr "" "ความสูงของเลเยอร์น้อยเกินไป\n" "มันจะตั้งค่าเป็น min_layer_height\n" -msgid "" -"Layer height exceeds the limit in Printer Settings -> Extruder -> Layer " -"height limits, this may cause printing quality issues." -msgstr "" -"ความสูงของเลเยอร์เกินขีดจำกัดในการตั้งค่าเครื่องพิมพ์ -> ชุดดันเส้น -> " -"ขีดจำกัดความสูงของเลเยอร์ ซึ่งอาจทำให้เกิดปัญหาคุณภาพการพิมพ์" +msgid "Layer height exceeds the limit in Printer Settings -> Extruder -> Layer height limits, this may cause printing quality issues." +msgstr "ความสูงของเลเยอร์เกินขีดจำกัดในการตั้งค่าเครื่องพิมพ์ -> ชุดดันเส้น -> ขีดจำกัดความสูงของเลเยอร์ ซึ่งอาจทำให้เกิดปัญหาคุณภาพการพิมพ์" msgid "Adjust to the set range automatically?\n" msgstr "ปรับเป็นช่วงที่ตั้งไว้อัตโนมัติ?\n" @@ -9947,47 +9070,23 @@ msgstr "ปรับ" msgid "Ignore" msgstr "ละเว้น" -msgid "" -"Experimental feature: Retracting and cutting off the filament at a greater " -"distance during filament changes to minimize flush. Although it can notably " -"reduce flush, it may also elevate the risk of nozzle clogs or other printing " -"complications." -msgstr "" -"คุณลักษณะการทดลอง: " -"การดึงกลับและตัดเส้นพลาสติกออกในระยะห่างที่มากขึ้นระหว่างการเปลี่ยนเส้นพลาสติกเพื่อลดการไล่เส้น " -"แม้ว่าจะสามารถลดการไล่เส้นได้อย่างเห็นได้ชัด " -"แต่ก็อาจเพิ่มความเสี่ยงของการอุดตันของหัวฉีดหรือภาวะแทรกซ้อนในการพิมพ์อื่นๆ อีกด้วย" +msgid "Experimental feature: Retracting and cutting off the filament at a greater distance during filament changes to minimize flush. Although it can notably reduce flush, it may also elevate the risk of nozzle clogs or other printing complications." +msgstr "คุณลักษณะการทดลอง: การดึงกลับและตัดเส้นพลาสติกออกในระยะห่างที่มากขึ้นระหว่างการเปลี่ยนเส้นพลาสติกเพื่อลดการไล่เส้น แม้ว่าจะสามารถลดการไล่เส้นได้อย่างเห็นได้ชัด แต่ก็อาจเพิ่มความเสี่ยงของการอุดตันของหัวฉีดหรือภาวะแทรกซ้อนในการพิมพ์อื่นๆ อีกด้วย" + +msgid "Experimental feature: Retracting and cutting off the filament at a greater distance during filament changes to minimize flush. Although it can notably reduce flush, it may also elevate the risk of nozzle clogs or other printing complications. Please use with the latest printer firmware." +msgstr "คุณลักษณะการทดลอง: การดึงกลับและตัดเส้นพลาสติกออกในระยะห่างที่มากขึ้นระหว่างการเปลี่ยนเส้นพลาสติกเพื่อลดการไล่เส้น แม้ว่าจะสามารถลดการไล่เส้นได้อย่างเห็นได้ชัด แต่ก็อาจเพิ่มความเสี่ยงของการอุดตันของหัวฉีดหรือภาวะแทรกซ้อนในการพิมพ์อื่นๆ อีกด้วย กรุณาใช้กับเฟิร์มแวร์เครื่องพิมพ์ล่าสุด" msgid "" -"Experimental feature: Retracting and cutting off the filament at a greater " -"distance during filament changes to minimize flush. Although it can notably " -"reduce flush, it may also elevate the risk of nozzle clogs or other printing " -"complications. Please use with the latest printer firmware." -msgstr "" -"คุณลักษณะการทดลอง: " -"การดึงกลับและตัดเส้นพลาสติกออกในระยะห่างที่มากขึ้นระหว่างการเปลี่ยนเส้นพลาสติกเพื่อลดการไล่เส้น " -"แม้ว่าจะสามารถลดการไล่เส้นได้อย่างเห็นได้ชัด " -"แต่ก็อาจเพิ่มความเสี่ยงของการอุดตันของหัวฉีดหรือภาวะแทรกซ้อนในการพิมพ์อื่นๆ อีกด้วย " -"กรุณาใช้กับเฟิร์มแวร์เครื่องพิมพ์ล่าสุด" - -msgid "" -"When recording timelapse without toolhead, it is recommended to add a " -"\"Timelapse Wipe Tower\" \n" -"by right-click the empty position of build plate and choose \"Add Primitive" -"\"->\"Timelapse Wipe Tower\"." +"When recording timelapse without toolhead, it is recommended to add a \"Timelapse Wipe Tower\" \n" +"by right-click the empty position of build plate and choose \"Add Primitive\"->\"Timelapse Wipe Tower\"." msgstr "" "เมื่อบันทึกไทม์แลปส์โดยไม่มีหัวเครื่องมือ แนะนำให้เพิ่ม \"Timelapse Wipe Tower\" \n" -"โดยคลิกขวาที่ตำแหน่งว่างของแผ่นงานแล้วเลือก \"Add Primitive\"->\"Timelapse Wipe Tower" -"\"" +"โดยคลิกขวาที่ตำแหน่งว่างของแผ่นงานแล้วเลือก \"Add Primitive\"->\"Timelapse Wipe Tower\"" -msgid "" -"A copy of the current system preset will be created, which will be detached " -"from the system preset." -msgstr "" -"สำเนาของค่าที่ตั้งล่วงหน้าของระบบปัจจุบันจะถูกสร้างขึ้น ซึ่งจะแยกออกจากค่าที่ตั้งล่วงหน้าของระบบ" +msgid "A copy of the current system preset will be created, which will be detached from the system preset." +msgstr "สำเนาของค่าที่ตั้งล่วงหน้าของระบบปัจจุบันจะถูกสร้างขึ้น ซึ่งจะแยกออกจากค่าที่ตั้งล่วงหน้าของระบบ" -msgid "" -"The current custom preset will be detached from the parent system preset." +msgid "The current custom preset will be detached from the parent system preset." msgstr "ค่าที่ตั้งไว้ล่วงหน้าแบบกำหนดเองปัจจุบันจะแยกออกจากค่าที่ตั้งไว้ล่วงหน้าของระบบหลัก" msgid "Modifications to the current profile will be saved." @@ -10018,8 +9117,7 @@ msgstr "ค่าที่ตั้งล่วงหน้าปัจจุบ msgid "It can't be deleted or modified." msgstr "ไม่สามารถลบหรือแก้ไขได้" -msgid "" -"Any modifications should be saved as a new preset inherited from this one." +msgid "Any modifications should be saved as a new preset inherited from this one." msgstr "การแก้ไขใด ๆ ควรได้รับการบันทึกเป็นค่าที่ตั้งไว้ล่วงหน้าใหม่ซึ่งสืบทอดมาจากค่านี้" msgid "To do that please specify a new name for the preset." @@ -10085,13 +9183,8 @@ msgstr "ความเร็วชั้นอื่นๆ" msgid "Overhang speed" msgstr "ความเร็วส่วนยื่น" -msgid "" -"This is the speed for various overhang degrees. Overhang degrees are " -"expressed as a percentage of line width. 0 speed means no slowing down for " -"the overhang degree range and wall speed is used" -msgstr "" -"นี่คือความเร็วขององศาส่วนยื่นต่างๆ องศาที่ยื่นออกมาจะแสดงเป็นเปอร์เซ็นต์ของความกว้างของเส้น " -"ความเร็ว 0 หมายถึงไม่มีการชะลอความเร็วสำหรับช่วงองศายื่นและใช้ความเร็วของผนัง" +msgid "This is the speed for various overhang degrees. Overhang degrees are expressed as a percentage of line width. 0 speed means no slowing down for the overhang degree range and wall speed is used" +msgstr "นี่คือความเร็วขององศาส่วนยื่นต่างๆ องศาที่ยื่นออกมาจะแสดงเป็นเปอร์เซ็นต์ของความกว้างของเส้น ความเร็ว 0 หมายถึงไม่มีการชะลอความเร็วสำหรับช่วงองศายื่นและใช้ความเร็วของผนัง" msgid "Set speed for external and internal bridges" msgstr "ตั้งค่าความเร็วสำหรับบริดจ์ภายนอกและภายใน" @@ -10147,12 +9240,10 @@ msgstr "บ่อย" #, c-format, boost-format msgid "" "Following line %s contains reserved keywords.\n" -"Please remove it, or G-code visualization and print time estimation will be " -"broken." +"Please remove it, or G-code visualization and print time estimation will be broken." msgid_plural "" "Following lines %s contain reserved keywords.\n" -"Please remove them, or G-code visualization and print time estimation will " -"be broken." +"Please remove them, or G-code visualization and print time estimation will be broken." msgstr[0] "" "บรรทัดถัดไป %s มีคีย์เวิร์ดที่สงวนไว้\n" "กรุณาลบออก มิฉะนั้นการแสดงผล G-code และการประมาณเวลาพิมพ์จะทำงานผิดพลาด" @@ -10184,59 +9275,32 @@ msgstr "อุณหภูมิพิมพ์" msgid "Nozzle temperature when printing" msgstr "อุณหภูมิหัวฉีดเมื่อพิมพ์" -msgid "" -"Bed temperature when the Cool Plate SuperTack is installed. A value of 0 " -"means the filament does not support printing on the Cool Plate SuperTack." -msgstr "" -"อุณหภูมิฐานพิมพ์เมื่อติดตั้ง Cool Plate SuperTack ค่า 0 " -"หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool Plate SuperTack" +msgid "Bed temperature when the Cool Plate SuperTack is installed. A value of 0 means the filament does not support printing on the Cool Plate SuperTack." +msgstr "อุณหภูมิฐานพิมพ์เมื่อติดตั้ง Cool Plate SuperTack ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool Plate SuperTack" msgid "Cool Plate" msgstr "จานเย็น" -msgid "" -"This is the bed temperature when the Cool Plate is installed. A value of 0 " -"means the filament does not support printing on the Cool Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์เมื่อติดตั้ง Cool Plate ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool " -"Plate" +msgid "This is the bed temperature when the Cool Plate is installed. A value of 0 means the filament does not support printing on the Cool Plate." +msgstr "อุณหภูมิฐานพิมพ์เมื่อติดตั้ง Cool Plate ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool Plate" msgid "Textured Cool Plate" msgstr "เท็กซ์เจอร์ คูลเพลท" -msgid "" -"This is the bed temperature when the Textured Cool Plate is installed. A " -"value of 0 means the filament does not support printing on the Textured Cool " -"Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์เมื่อติดตั้ง Textured Cool Plate ค่า 0 " -"หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Textured Cool Plate" +msgid "This is the bed temperature when the Textured Cool Plate is installed. A value of 0 means the filament does not support printing on the Textured Cool Plate." +msgstr "อุณหภูมิฐานพิมพ์เมื่อติดตั้ง Textured Cool Plate ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Textured Cool Plate" -msgid "" -"This is the bed temperature when the engineering plate is installed. A value " -"of 0 means the filament does not support printing on the Engineering Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์เมื่อติดตั้ง Engineering Plate ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน " -"Engineering Plate" +msgid "This is the bed temperature when the engineering plate is installed. A value of 0 means the filament does not support printing on the Engineering Plate." +msgstr "อุณหภูมิฐานพิมพ์เมื่อติดตั้ง Engineering Plate ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Engineering Plate" msgid "Smooth PEI Plate / High Temp Plate" msgstr "แผ่น PEI เรียบ / แผ่นอุณหภูมิสูง" -msgid "" -"This is the bed temperature when the Smooth PEI Plate/High Temperature Plate " -"is installed. A value of 0 means the filament does not support printing on " -"the Smooth PEI Plate/High Temp Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์เมื่อติดตั้งแผ่น Smooth PEI/แผ่นอุณหภูมิสูง ค่า 0 " -"หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนแผ่น PEI แบบเรียบ/แผ่นอุณหภูมิสูง" +msgid "This is the bed temperature when the Smooth PEI Plate/High Temperature Plate is installed. A value of 0 means the filament does not support printing on the Smooth PEI Plate/High Temp Plate." +msgstr "อุณหภูมิฐานพิมพ์เมื่อติดตั้งแผ่น Smooth PEI/แผ่นอุณหภูมิสูง ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนแผ่น PEI แบบเรียบ/แผ่นอุณหภูมิสูง" -msgid "" -"This is the bed temperature when the Textured PEI Plate is installed. A " -"value of 0 means the filament does not support printing on the Textured PEI " -"Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์เมื่อติดตั้งเพลต PEI แบบมีพื้นผิว ค่า 0 " -"หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนเพลต PEI ที่มีพื้นผิว" +msgid "This is the bed temperature when the Textured PEI Plate is installed. A value of 0 means the filament does not support printing on the Textured PEI Plate." +msgstr "อุณหภูมิฐานพิมพ์เมื่อติดตั้งเพลต PEI แบบมีพื้นผิว ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนเพลต PEI ที่มีพื้นผิว" msgid "Volumetric speed limitation" msgstr "การจำกัดความเร็วตามปริมาตร" @@ -10250,22 +9314,13 @@ msgstr "พัดลมระบายความร้อนบางส่ว msgid "Min fan speed threshold" msgstr "เกณฑ์ความเร็วพัดลมขั้นต่ำ" -msgid "" -"The part cooling fan will run at the minimum fan speed when the estimated " -"layer time is longer than the threshold value. When the layer time is " -"shorter than the threshold, the fan speed will be interpolated between the " -"minimum and maximum fan speed according to layer printing time." -msgstr "" -"พัดลมระบายความร้อนจะทำงานที่ความเร็วต่ำสุดเมื่อเวลาเลเยอร์โดยประมาณยาวกว่าเกณฑ์ " -"เมื่อเวลาเลเยอร์สั้นกว่าเกณฑ์ " -"ความเร็วพัดลมจะถูกปรับระหว่างค่าต่ำสุดและสูงสุดตามเวลาพิมพ์ของเลเยอร์" +msgid "The part cooling fan will run at the minimum fan speed when the estimated layer time is longer than the threshold value. When the layer time is shorter than the threshold, the fan speed will be interpolated between the minimum and maximum fan speed according to layer printing time." +msgstr "พัดลมระบายความร้อนจะทำงานที่ความเร็วต่ำสุดเมื่อเวลาเลเยอร์โดยประมาณยาวกว่าเกณฑ์ เมื่อเวลาเลเยอร์สั้นกว่าเกณฑ์ ความเร็วพัดลมจะถูกปรับระหว่างค่าต่ำสุดและสูงสุดตามเวลาพิมพ์ของเลเยอร์" msgid "Max fan speed threshold" msgstr "เกณฑ์ความเร็วพัดลมสูงสุด" -msgid "" -"The part cooling fan will run at maximum speed when the estimated layer time " -"is shorter than the threshold value." +msgid "The part cooling fan will run at maximum speed when the estimated layer time is shorter than the threshold value." msgstr "ความเร็วพัดลมระบายความร้อนของชิ้นส่วนจะสูงสุดเมื่อเวลาเลเยอร์โดยประมาณสั้นกว่าค่าที่ตั้งไว้" msgid "Auxiliary part cooling fan" @@ -10387,9 +9442,7 @@ msgstr "ความเร็วการหลีกเลี่ยงการ msgid "Frequency" msgstr "ความถี่" -msgid "" -"The frequency of the anti-vibration signal will correspond to the natural " -"frequency of the frame." +msgid "The frequency of the anti-vibration signal will correspond to the natural frequency of the frame." msgstr "ความถี่ของสัญญาณป้องกันการสั่นสะเทือนจะสอดคล้องกับความถี่ธรรมชาติของเฟรม" msgid "Damping" @@ -10416,8 +9469,7 @@ msgstr "จำนวนชุดดันเส้นของเครื่อ msgid "" "Single Extruder Multi Material is selected,\n" "and all extruders must have the same diameter.\n" -"Do you want to change the diameter for all extruders to first extruder " -"nozzle diameter value?" +"Do you want to change the diameter for all extruders to first extruder nozzle diameter value?" msgstr "" "เลือกวัสดุหลายชุดดันเส้นเดี่ยว\n" "และชุดดันเส้นทั้งหมดจะต้องมีเส้นผ่านศูนย์กลางเท่ากัน\n" @@ -10432,12 +9484,8 @@ msgstr "ทาวเวอร์เช็ดหัวฉีด" msgid "Single extruder multi-material parameters" msgstr "พารามิเตอร์วัสดุหลายชุดดันเส้นเดี่ยว" -msgid "" -"This is a single extruder multi-material printer, diameters of all extruders " -"will be set to the new value. Do you want to proceed?" -msgstr "" -"นี่คือเครื่องพิมพ์หลายวัสดุที่ใช้ชุดดันเส้นเดี่ยว " -"โดยเส้นผ่านศูนย์กลางของชุดดันเส้นทั้งหมดจะถูกตั้งค่าเป็นค่าใหม่ คุณต้องการดำเนินการต่อหรือไม่?" +msgid "This is a single extruder multi-material printer, diameters of all extruders will be set to the new value. Do you want to proceed?" +msgstr "นี่คือเครื่องพิมพ์หลายวัสดุที่ใช้ชุดดันเส้นเดี่ยว โดยเส้นผ่านศูนย์กลางของชุดดันเส้นทั้งหมดจะถูกตั้งค่าเป็นค่าใหม่ คุณต้องการดำเนินการต่อหรือไม่?" msgid "Layer height limits" msgstr "การจำกัดความสูงของเลเยอร์" @@ -10449,8 +9497,7 @@ msgid "Retraction when switching material" msgstr "การร่นกลับเมื่อเปลี่ยนวัสดุ" msgid "" -"The Retract before wipe option could be only 100% when using the Firmware " -"Retraction mode.\n" +"The Retract before wipe option could be only 100% when using the Firmware Retraction mode.\n" "\n" "Shall I set it to 100% in order to enable Firmware Retraction?" msgstr "" @@ -10461,9 +9508,7 @@ msgstr "" msgid "Firmware Retraction" msgstr "การเพิกถอนเฟิร์มแวร์" -msgid "" -"Switching to a printer with different extruder types or numbers will discard " -"or reset changes to extruder or multi-nozzle-related parameters." +msgid "Switching to a printer with different extruder types or numbers will discard or reset changes to extruder or multi-nozzle-related parameters." msgstr "การเปลี่ยนไปใช้เครื่องพิมพ์ที่มีประเภทหรือหมายเลขชุดดันเส้นที่แตกต่างกันจะยกเลิกหรือรีเซ็ตการเปลี่ยนแปลงในชุดดันเส้นหรือพารามิเตอร์ที่เกี่ยวข้องกับหัวฉีดหลายตัว" msgid "Use Modified Value" @@ -10473,12 +9518,8 @@ msgid "Detached" msgstr "เดี่ยว" #, c-format, boost-format -msgid "" -"%d Filament Preset and %d Process Preset is attached to this printer. Those " -"presets would be deleted if the printer is deleted." -msgstr "" -"%d เส้นพลาสติก Preset และ %d Process Preset ถูกแนบไปกับเครื่องพิมพ์นี้ " -"ค่าที่ตั้งล่วงหน้าเหล่านั้นจะถูกลบหากเครื่องพิมพ์ถูกลบ" +msgid "%d Filament Preset and %d Process Preset is attached to this printer. Those presets would be deleted if the printer is deleted." +msgstr "%d เส้นพลาสติก Preset และ %d Process Preset ถูกแนบไปกับเครื่องพิมพ์นี้ ค่าที่ตั้งล่วงหน้าเหล่านั้นจะถูกลบหากเครื่องพิมพ์ถูกลบ" msgid "Presets inherited by other presets cannot be deleted!" msgstr "ค่าที่ตั้งล่วงหน้าที่สืบทอดมาจากค่าที่ตั้งล่วงหน้าอื่นไม่สามารถลบได้!" @@ -10498,12 +9539,10 @@ msgstr[0] "พรีเซ็ตต่อไปนี้จะถูกลบด msgid "" "Are you sure to delete the selected preset?\n" -"If the preset corresponds to a filament currently in use on your printer, " -"please reset the filament information for that slot." +"If the preset corresponds to a filament currently in use on your printer, please reset the filament information for that slot." msgstr "" "คุณแน่ใจหรือไม่ว่าต้องการลบค่าที่ตั้งล่วงหน้าที่เลือกไว้\n" -"หากค่าที่ตั้งไว้ล่วงหน้าสอดคล้องกับเส้นพลาสติกที่ใช้งานอยู่ในเครื่องพิมพ์ของคุณ " -"โปรดรีเซ็ตข้อมูลเส้นพลาสติกสำหรับช่องนั้น" +"หากค่าที่ตั้งไว้ล่วงหน้าสอดคล้องกับเส้นพลาสติกที่ใช้งานอยู่ในเครื่องพิมพ์ของคุณ โปรดรีเซ็ตข้อมูลเส้นพลาสติกสำหรับช่องนั้น" #, boost-format msgid "Are you sure you want to %1% the selected preset?" @@ -10519,8 +9558,7 @@ msgstr "" " %s ชั้นแรก %d %s, ชั้นอื่นๆ %d %s\n" " %s เดลต้าสูงสุด %d %s เดลต้าปัจจุบัน %d %s\n" -msgid "" -"Some first-layer and other-layer temperature pairs exceed safety limits.\n" +msgid "Some first-layer and other-layer temperature pairs exceed safety limits.\n" msgstr "คู่อุณหภูมิชั้นหนึ่งและชั้นอื่นๆ บางคู่เกินขีดจำกัดความปลอดภัย\n" msgid "" @@ -10668,20 +9706,12 @@ msgid "Preset \"%1%\" contains the following unsaved changes:" msgstr "ค่าที่ตั้งไว้ล่วงหน้า \"%1%\" มีการเปลี่ยนแปลงที่ยังไม่ได้บันทึกต่อไปนี้:" #, boost-format -msgid "" -"Preset \"%1%\" is not compatible with the new printer profile and it " -"contains the following unsaved changes:" -msgstr "" -"ค่าที่ตั้งไว้ล่วงหน้า \"%1%\" เข้ากันไม่ได้กับโปรไฟล์เครื่องพิมพ์ใหม่ " -"และประกอบด้วยการเปลี่ยนแปลงที่ยังไม่ได้บันทึกต่อไปนี้:" +msgid "Preset \"%1%\" is not compatible with the new printer profile and it contains the following unsaved changes:" +msgstr "ค่าที่ตั้งไว้ล่วงหน้า \"%1%\" เข้ากันไม่ได้กับโปรไฟล์เครื่องพิมพ์ใหม่ และประกอบด้วยการเปลี่ยนแปลงที่ยังไม่ได้บันทึกต่อไปนี้:" #, boost-format -msgid "" -"Preset \"%1%\" is not compatible with the new process profile and it " -"contains the following unsaved changes:" -msgstr "" -"ค่าที่ตั้งไว้ล่วงหน้า \"%1%\" เข้ากันไม่ได้กับโปรไฟล์กระบวนการใหม่ " -"และประกอบด้วยการเปลี่ยนแปลงที่ยังไม่ได้บันทึกต่อไปนี้:" +msgid "Preset \"%1%\" is not compatible with the new process profile and it contains the following unsaved changes:" +msgstr "ค่าที่ตั้งไว้ล่วงหน้า \"%1%\" เข้ากันไม่ได้กับโปรไฟล์กระบวนการใหม่ และประกอบด้วยการเปลี่ยนแปลงที่ยังไม่ได้บันทึกต่อไปนี้:" #, boost-format msgid "You have changed some settings of preset \"%1%\"." @@ -10696,20 +9726,17 @@ msgstr "" msgid "" "\n" -"You can save or discard the preset values you have modified, or choose to " -"transfer the values you have modified to the new preset." +"You can save or discard the preset values you have modified, or choose to transfer the values you have modified to the new preset." msgstr "" "\n" -"คุณสามารถบันทึกหรือละทิ้งค่าที่ตั้งไว้ล่วงหน้าที่คุณได้แก้ไข " -"หรือเลือกที่จะถ่ายโอนค่าที่คุณได้แก้ไขไปยังค่าที่ตั้งไว้ล่วงหน้าใหม่" +"คุณสามารถบันทึกหรือละทิ้งค่าที่ตั้งไว้ล่วงหน้าที่คุณได้แก้ไข หรือเลือกที่จะถ่ายโอนค่าที่คุณได้แก้ไขไปยังค่าที่ตั้งไว้ล่วงหน้าใหม่" msgid "You have previously modified your settings." msgstr "คุณได้แก้ไขการตั้งค่าของคุณก่อนหน้านี้" msgid "" "\n" -"You can discard the preset values you have modified, or choose to transfer " -"the modified values to the new project" +"You can discard the preset values you have modified, or choose to transfer the modified values to the new project" msgstr "" "\n" "คุณสามารถละทิ้งค่าที่ตั้งไว้ล่วงหน้าที่คุณได้แก้ไข หรือเลือกที่จะถ่ายโอนค่าที่แก้ไขไปยังโปรเจ็กต์ใหม่" @@ -10732,14 +9759,12 @@ msgstr "ค่าที่ตั้งไว้ล่วงหน้าด้า msgid "Right Preset Value" msgstr "ค่าที่ตั้งไว้ทางขวา" -msgid "" -"You can only transfer to current active profile because it has been modified." +msgid "You can only transfer to current active profile because it has been modified." msgstr "คุณสามารถถ่ายโอนไปยังโปรไฟล์ที่ใช้งานปัจจุบันได้เท่านั้นเนื่องจากมีการแก้ไข" msgid "" "Transfer the selected options from left preset to the right.\n" -"Note: New modified presets will be selected in settings tabs after close " -"this dialog." +"Note: New modified presets will be selected in settings tabs after close this dialog." msgstr "" "ถ่ายโอนตัวเลือกที่เลือกจากค่าที่ตั้งล่วงหน้าด้านซ้ายไปทางด้านขวา\n" "หมายเหตุ: ค่าที่ตั้งล่วงหน้าที่แก้ไขใหม่จะถูกเลือกในแท็บการตั้งค่าหลังจากปิดกล่องโต้ตอบนี้" @@ -10747,11 +9772,8 @@ msgstr "" msgid "Transfer values from left to right" msgstr "โอนค่าจากซ้ายไปขวา" -msgid "" -"If enabled, this dialog can be used for transfer selected values from left " -"to right preset." -msgstr "" -"หากเปิดใช้งาน กล่องโต้ตอบนี้สามารถใช้เพื่อโอนค่าที่เลือกจากค่าที่ตั้งไว้ล่วงหน้าจากซ้ายไปขวาได้" +msgid "If enabled, this dialog can be used for transfer selected values from left to right preset." +msgstr "หากเปิดใช้งาน กล่องโต้ตอบนี้สามารถใช้เพื่อโอนค่าที่เลือกจากค่าที่ตั้งไว้ล่วงหน้าจากซ้ายไปขวาได้" msgid "Add File" msgstr "เพิ่มไฟล์" @@ -10886,12 +9908,10 @@ msgid "—> " msgstr "—> " msgid "" -"Synchronizing AMS filaments will discard your modified but unsaved filament " -"presets.\n" +"Synchronizing AMS filaments will discard your modified but unsaved filament presets.\n" "Are you sure you want to continue?" msgstr "" -"การซิงโครไนซ์ฟิลาเมนต์ AMS " -"จะละทิ้งค่าที่ตั้งไว้ล่วงหน้าของฟิลาเมนต์ที่ได้รับการแก้ไขแต่ไม่ได้บันทึกไว้\n" +"การซิงโครไนซ์ฟิลาเมนต์ AMS จะละทิ้งค่าที่ตั้งไว้ล่วงหน้าของฟิลาเมนต์ที่ได้รับการแก้ไขแต่ไม่ได้บันทึกไว้\n" "คุณแน่ใจหรือไม่ว่าต้องการดำเนินการต่อ?" msgctxt "Sync_AMS" @@ -10908,9 +9928,7 @@ msgctxt "Sync_AMS" msgid "Plate" msgstr "ฐานพิมพ์" -msgid "" -"The connected printer does not match the currently selected printer. Please " -"change the selected printer." +msgid "The connected printer does not match the currently selected printer. Please change the selected printer." msgstr "เครื่องพิมพ์ที่เชื่อมต่อไม่ตรงกับเครื่องพิมพ์ที่เลือกในปัจจุบัน กรุณาเปลี่ยนเครื่องพิมพ์ที่เลือก" msgid "Mapping" @@ -10954,17 +9972,11 @@ msgstr "ใช้ AMS" msgid "Tip" msgstr "เคล็ดลับ" -msgid "" -"Only synchronize filament type and color, not including AMS slot information." +msgid "Only synchronize filament type and color, not including AMS slot information." msgstr "ซิงโครไนซ์ประเภทเส้นพลาสติกและสีเท่านั้น ไม่รวมข้อมูลสล็อต AMS" -msgid "" -"Replace the project filaments list sequentially based on printer filaments. " -"And unused printer filaments will be automatically added to the end of the " -"list." -msgstr "" -"แทนที่รายการเส้นพลาสติกของโครงการตามลำดับตามเส้นพลาสติกของเครื่องพิมพ์ " -"และเส้นพลาสติกเครื่องพิมพ์ที่ไม่ได้ใช้จะถูกเพิ่มเข้าที่ส่วนท้ายของรายการโดยอัตโนมัติ" +msgid "Replace the project filaments list sequentially based on printer filaments. And unused printer filaments will be automatically added to the end of the list." +msgstr "แทนที่รายการเส้นพลาสติกของโครงการตามลำดับตามเส้นพลาสติกของเครื่องพิมพ์ และเส้นพลาสติกเครื่องพิมพ์ที่ไม่ได้ใช้จะถูกเพิ่มเข้าที่ส่วนท้ายของรายการโดยอัตโนมัติ" msgid "Add unused AMS filaments to filaments list." msgstr "เพิ่มเส้นพลาสติก AMS ที่ไม่ได้ใช้ลงในรายการเส้นพลาสติก" @@ -10975,14 +9987,8 @@ msgstr "ผสานสีเดียวกันในโมเดลโดย msgid "After being synced, this action cannot be undone." msgstr "หลังจากซิงค์แล้ว การดำเนินการนี้ไม่สามารถยกเลิกได้" -msgid "" -"After being synced, the project's filament presets and colors will be " -"replaced with the mapped filament types and colors. This action cannot be " -"undone." -msgstr "" -"หลังจากที่ซิงค์แล้ว " -"ค่าที่ตั้งไว้ล่วงหน้าของเส้นพลาสติกและสีของโปรเจ็กต์จะถูกแทนที่ด้วยประเภทและสีของเส้นพลาสติกที่แมปไว้ " -"การดำเนินการนี้ไม่สามารถยกเลิกได้" +msgid "After being synced, the project's filament presets and colors will be replaced with the mapped filament types and colors. This action cannot be undone." +msgstr "หลังจากที่ซิงค์แล้ว ค่าที่ตั้งไว้ล่วงหน้าของเส้นพลาสติกและสีของโปรเจ็กต์จะถูกแทนที่ด้วยประเภทและสีของเส้นพลาสติกที่แมปไว้ การดำเนินการนี้ไม่สามารถยกเลิกได้" msgid "Are you sure to synchronize the filaments?" msgstr "คุณแน่ใจหรือว่าซิงโครไนซ์เส้นพลาสติก?" @@ -10996,37 +10002,27 @@ msgstr "ประสานข้อมูลเส้นพลาสติก" msgid "Add unused filaments to filaments list." msgstr "เพิ่มเส้นพลาสติกที่ไม่ได้ใช้ลงในรายการเส้นพลาสติก" -msgid "" -"Only synchronize filament type and color, not including slot information." +msgid "Only synchronize filament type and color, not including slot information." msgstr "ซิงโครไนซ์ประเภทเส้นพลาสติกและสีเท่านั้น ไม่รวมข้อมูลช่อง" msgid "Ext spool" msgstr "สปูลต่อ" -msgid "" -"Please check whether the nozzle type of the device is the same as the preset " -"nozzle type." +msgid "Please check whether the nozzle type of the device is the same as the preset nozzle type." msgstr "โปรดตรวจสอบว่าประเภทหัวฉีดของอุปกรณ์เหมือนกับประเภทหัวฉีดที่ตั้งไว้ล่วงหน้าหรือไม่" msgid "Storage is not available or is in read-only mode." msgstr "พื้นที่เก็บข้อมูลไม่พร้อมใช้งานหรืออยู่ในโหมดอ่านอย่างเดียว" #, c-format, boost-format -msgid "" -"The selected printer (%s) is incompatible with the chosen printer profile in " -"the slicer (%s)." +msgid "The selected printer (%s) is incompatible with the chosen printer profile in the slicer (%s)." msgstr "เครื่องพิมพ์ที่เลือก (%s) เข้ากันไม่ได้กับโปรไฟล์เครื่องพิมพ์ที่เลือกในตัวแบ่งส่วนข้อมูล (%s)" -msgid "" -"Timelapse is not supported because Print sequence is set to \"By object\"." +msgid "Timelapse is not supported because Print sequence is set to \"By object\"." msgstr "ไม่รองรับไทม์แลปส์เนื่องจากลำดับการพิมพ์ถูกตั้งค่าเป็น \"ตามวัตถุ\"" -msgid "" -"You selected external and AMS filament at the same time in an extruder, you " -"will need manually change external filament." -msgstr "" -"คุณเลือกเส้นพลาสติกภายนอกและเส้นพลาสติก AMS พร้อมกันในชุดดันเส้น " -"คุณจะต้องเปลี่ยนเส้นพลาสติกภายนอกด้วยตนเอง" +msgid "You selected external and AMS filament at the same time in an extruder, you will need manually change external filament." +msgstr "คุณเลือกเส้นพลาสติกภายนอกและเส้นพลาสติก AMS พร้อมกันในชุดดันเส้น คุณจะต้องเปลี่ยนเส้นพลาสติกภายนอกด้วยตนเอง" msgid "Successfully synchronized nozzle information." msgstr "ซิงโครไนซ์ข้อมูลหัวฉีดสำเร็จแล้ว" @@ -11055,25 +10051,13 @@ msgid "Ramming customization" msgstr "การปรับแต่งการกระแทก" msgid "" -"Ramming denotes the rapid extrusion just before a tool change in a single-" -"extruder MM printer. Its purpose is to properly shape the end of the " -"unloaded filament so it does not prevent insertion of the new filament and " -"can itself be reinserted later. This phase is important and different " -"materials can require different extrusion speeds to get the good shape. For " -"this reason, the extrusion rates during ramming are adjustable.\n" +"Ramming denotes the rapid extrusion just before a tool change in a single-extruder MM printer. Its purpose is to properly shape the end of the unloaded filament so it does not prevent insertion of the new filament and can itself be reinserted later. This phase is important and different materials can require different extrusion speeds to get the good shape. For this reason, the extrusion rates during ramming are adjustable.\n" "\n" -"This is an expert-level setting, incorrect adjustment will likely lead to " -"jams, extruder wheel grinding into filament etc." +"This is an expert-level setting, incorrect adjustment will likely lead to jams, extruder wheel grinding into filament etc." msgstr "" -"การชนหมายถึงการอัดขึ้นรูปอย่างรวดเร็วก่อนการเปลี่ยนเครื่องมือในเครื่องพิมพ์ MM แบบชุดดันเส้นเดี่ยว " -"จุดประสงค์คือเพื่อจัดรูปทรงส่วนปลายของเส้นพลาสติกที่ไม่ได้บรรจุอย่างเหมาะสม " -"เพื่อไม่ให้ป้องกันการใส่เส้นพลาสติกใหม่และสามารถใส่กลับเข้าไปใหม่ได้ในภายหลัง " -"ขั้นตอนนี้มีความสำคัญ " -"และวัสดุที่แตกต่างกันอาจต้องใช้ความเร็วการอัดขึ้นรูปที่แตกต่างกันเพื่อให้ได้รูปร่างที่ดี ด้วยเหตุนี้ " -"อัตราการอัดขึ้นรูประหว่างการชนจึงสามารถปรับได้\n" +"การชนหมายถึงการอัดขึ้นรูปอย่างรวดเร็วก่อนการเปลี่ยนเครื่องมือในเครื่องพิมพ์ MM แบบชุดดันเส้นเดี่ยว จุดประสงค์คือเพื่อจัดรูปทรงส่วนปลายของเส้นพลาสติกที่ไม่ได้บรรจุอย่างเหมาะสม เพื่อไม่ให้ป้องกันการใส่เส้นพลาสติกใหม่และสามารถใส่กลับเข้าไปใหม่ได้ในภายหลัง ขั้นตอนนี้มีความสำคัญ และวัสดุที่แตกต่างกันอาจต้องใช้ความเร็วการอัดขึ้นรูปที่แตกต่างกันเพื่อให้ได้รูปร่างที่ดี ด้วยเหตุนี้ อัตราการอัดขึ้นรูประหว่างการชนจึงสามารถปรับได้\n" "\n" -"นี่เป็นการตั้งค่าระดับผู้เชี่ยวชาญ การปรับที่ไม่ถูกต้องอาจทำให้เกิดการติดขัด " -"ล้อชุดดันเส้นบดเป็นเส้นพลาสติก ฯลฯ" +"นี่เป็นการตั้งค่าระดับผู้เชี่ยวชาญ การปรับที่ไม่ถูกต้องอาจทำให้เกิดการติดขัด ล้อชุดดันเส้นบดเป็นเส้นพลาสติก ฯลฯ" #, boost-format msgid "For constant flow rate, hold %1% while dragging." @@ -11091,13 +10075,8 @@ msgstr "ปริมาณ" msgid "Ramming line" msgstr "เส้นราม" -msgid "" -"Orca would re-calculate your flushing volumes everytime the filaments color " -"changed or filaments changed. You could disable the auto-calculate in Orca " -"Slicer > Preferences" -msgstr "" -"Orca จะคำนวณปริมาตรการไล่เส้นของคุณใหม่ทุกครั้งที่สีเส้นพลาสติกเปลี่ยนไปหรือเส้นพลาสติกเปลี่ยนไป " -"คุณสามารถปิดการใช้งานการคำนวณอัตโนมัติใน Orca Slicer > การตั้งค่า" +msgid "Orca would re-calculate your flushing volumes everytime the filaments color changed or filaments changed. You could disable the auto-calculate in Orca Slicer > Preferences" +msgstr "Orca จะคำนวณปริมาตรการไล่เส้นของคุณใหม่ทุกครั้งที่สีเส้นพลาสติกเปลี่ยนไปหรือเส้นพลาสติกเปลี่ยนไป คุณสามารถปิดการใช้งานการคำนวณอัตโนมัติใน Orca Slicer > การตั้งค่า" msgid "Flushing volume (mm³) for each filament pair." msgstr "ปริมาณการไล่เส้นชิ่ง (มม.) สำหรับคู่เส้นพลาสติกแต่ละคู่" @@ -11128,54 +10107,26 @@ msgstr "ปริมาณการไล่เส้นชิ่งสำหร msgid "Please choose the filament colour" msgstr "กรุณาเลือกสีเส้นพลาสติก" -msgid "" -"Native Wayland liveview requires the GStreamer GTK video sink. Please " -"install the gtksink plugin for GStreamer, then restart OrcaSlicer." -msgstr "" -"Native Wayland liveview ต้องใช้ GStreamer GTK video sink โปรดติดตั้งปลั๊กอิน gtksink " -"สำหรับ GStreamer จากนั้นรีสตาร์ท OrcaSlicer" +msgid "Native Wayland liveview requires the GStreamer GTK video sink. Please install the gtksink plugin for GStreamer, then restart OrcaSlicer." +msgstr "Native Wayland liveview ต้องใช้ GStreamer GTK video sink โปรดติดตั้งปลั๊กอิน gtksink สำหรับ GStreamer จากนั้นรีสตาร์ท OrcaSlicer" -msgid "" -"Failed to initialize the native Wayland GStreamer video sink. Please check " -"your GStreamer GTK plugin installation." -msgstr "" -"ไม่สามารถเริ่มต้น sink วิดีโอ Wayland GStreamer ดั้งเดิมได้ โปรดตรวจสอบการติดตั้งปลั๊กอิน " -"GStreamer GTK ของคุณ" +msgid "Failed to initialize the native Wayland GStreamer video sink. Please check your GStreamer GTK plugin installation." +msgstr "ไม่สามารถเริ่มต้น sink วิดีโอ Wayland GStreamer ดั้งเดิมได้ โปรดตรวจสอบการติดตั้งปลั๊กอิน GStreamer GTK ของคุณ" -msgid "" -"Windows Media Player is required for this task! Do you want to enable " -"'Windows Media Player' for your operation system?" -msgstr "" -"งานนี้ต้องใช้ Windows Media Player! คุณต้องการเปิดใช้งาน 'Windows Media Player' " -"สำหรับระบบปฏิบัติการของคุณหรือไม่?" +msgid "Windows Media Player is required for this task! Do you want to enable 'Windows Media Player' for your operation system?" +msgstr "งานนี้ต้องใช้ Windows Media Player! คุณต้องการเปิดใช้งาน 'Windows Media Player' สำหรับระบบปฏิบัติการของคุณหรือไม่?" -msgid "" -"BambuSource has not correctly been registered for media playing! Press Yes " -"to re-register it. You will be promoted twice" -msgstr "" -"BambuSource ยังไม่ได้รับการลงทะเบียนอย่างถูกต้องสำหรับการเล่นสื่อ! กดใช่เพื่อลงทะเบียนใหม่ " -"คุณจะได้รับการเลื่อนตำแหน่งสองครั้ง" +msgid "BambuSource has not correctly been registered for media playing! Press Yes to re-register it. You will be promoted twice" +msgstr "BambuSource ยังไม่ได้รับการลงทะเบียนอย่างถูกต้องสำหรับการเล่นสื่อ! กดใช่เพื่อลงทะเบียนใหม่ คุณจะได้รับการเลื่อนตำแหน่งสองครั้ง" -msgid "" -"Missing BambuSource component registered for media playing! Please re-" -"install OrcaSlicer or seek community help." -msgstr "" -"ไม่มีส่วนประกอบ BambuSource ที่ลงทะเบียนสำหรับการเล่นสื่อ! โปรดติดตั้ง OrcaSlicer " -"ใหม่หรือขอความช่วยเหลือจากชุมชน" +msgid "Missing BambuSource component registered for media playing! Please re-install OrcaSlicer or seek community help." +msgstr "ไม่มีส่วนประกอบ BambuSource ที่ลงทะเบียนสำหรับการเล่นสื่อ! โปรดติดตั้ง OrcaSlicer ใหม่หรือขอความช่วยเหลือจากชุมชน" -msgid "" -"Using a BambuSource from a different install, video play may not work " -"correctly! Press Yes to fix it." +msgid "Using a BambuSource from a different install, video play may not work correctly! Press Yes to fix it." msgstr "การใช้ BambuSource จากการติดตั้งอื่น การเล่นวิดีโออาจทำงานไม่ถูกต้อง! กดใช่เพื่อแก้ไข" -msgid "" -"Your system is missing H.264 codecs for GStreamer, which are required to " -"play video. (Try installing the gstreamer1.0-plugins-bad or gstreamer1.0-" -"libav packages, then restart Orca Slicer?)" -msgstr "" -"ระบบของคุณไม่มีตัวแปลงสัญญาณ H.264 สำหรับ GStreamer ซึ่งจำเป็นในการเล่นวิดีโอ " -"(ลองติดตั้งแพ็คเกจ gstreamer1.0-plugins-bad หรือ gstreamer1.0-libav จากนั้นรีสตาร์ท " -"Orca Slicer หรือไม่)" +msgid "Your system is missing H.264 codecs for GStreamer, which are required to play video. (Try installing the gstreamer1.0-plugins-bad or gstreamer1.0-libav packages, then restart Orca Slicer?)" +msgstr "ระบบของคุณไม่มีตัวแปลงสัญญาณ H.264 สำหรับ GStreamer ซึ่งจำเป็นในการเล่นวิดีโอ (ลองติดตั้งแพ็คเกจ gstreamer1.0-plugins-bad หรือ gstreamer1.0-libav จากนั้นรีสตาร์ท Orca Slicer หรือไม่)" msgid "Cloud agent is not available. Please restart OrcaSlicer and try again." msgstr "ตัวแทนระบบคลาวด์ไม่พร้อมใช้งาน โปรดรีสตาร์ท OrcaSlicer แล้วลองอีกครั้ง" @@ -11240,13 +10191,8 @@ msgstr "ปุ่มกลางของเมาส์" msgid "Zoom View" msgstr "ซูมดู" -msgid "" -"Auto orients selected objects or all objects. If there are selected objects, " -"it just orients the selected ones. Otherwise, it will orient all objects in " -"the current project." -msgstr "" -"ปรับทิศทางวัตถุที่เลือกหรือวัตถุทั้งหมดโดยอัตโนมัติ หากมีวัตถุที่เลือกไว้ " -"วัตถุนั้นจะปรับทิศทางวัตถุที่เลือกเท่านั้น มิฉะนั้นจะวางแนววัตถุทั้งหมดในโปรเจ็กต์ปัจจุบัน" +msgid "Auto orients selected objects or all objects. If there are selected objects, it just orients the selected ones. Otherwise, it will orient all objects in the current project." +msgstr "ปรับทิศทางวัตถุที่เลือกหรือวัตถุทั้งหมดโดยอัตโนมัติ หากมีวัตถุที่เลือกไว้ วัตถุนั้นจะปรับทิศทางวัตถุที่เลือกเท่านั้น มิฉะนั้นจะวางแนววัตถุทั้งหมดในโปรเจ็กต์ปัจจุบัน" msgid "Auto orients all objects on the active plate." msgstr "ปรับทิศทางวัตถุทั้งหมดบนเพลตที่ใช้งานอยู่โดยอัตโนมัติ" @@ -11444,8 +10390,7 @@ msgstr "ข้อมูลการอัปเดตเวอร์ชัน %s msgid "Network plug-in update" msgstr "การอัปเดตปลั๊กอินเครือข่าย" -msgid "" -"Click OK to update the Network plug-in the next time Orca Slicer launches." +msgid "Click OK to update the Network plug-in the next time Orca Slicer launches." msgstr "คลิกตกลงเพื่ออัปเดตปลั๊กอินเครือข่ายในครั้งถัดไปที่ Orca Slicer เริ่มทำงาน" #, c-format, boost-format @@ -11468,8 +10413,7 @@ msgid "Skip this Version" msgstr "ข้ามเวอร์ชันนี้" #, c-format, boost-format -msgid "" -"New version available: %s. Please update OrcaSlicer from the Microsoft Store." +msgid "New version available: %s. Please update OrcaSlicer from the Microsoft Store." msgstr "มีเวอร์ชันใหม่: %s กรุณาอัปเดต OrcaSlicer จาก Microsoft Store" msgid "Confirm and Update Nozzle" @@ -11478,23 +10422,16 @@ msgstr "ยืนยันและอัปเดตหัวฉีด" msgid "Connect the printer using IP and access code" msgstr "เชื่อมต่อเครื่องพิมพ์โดยใช้ IP และรหัสการเข้าถึง" -msgid "" -"Try the following methods to update the connection parameters and reconnect " -"to the printer." +msgid "Try the following methods to update the connection parameters and reconnect to the printer." msgstr "ลองวิธีการต่อไปนี้เพื่ออัพเดตพารามิเตอร์การเชื่อมต่อและเชื่อมต่อกับเครื่องพิมพ์อีกครั้ง" msgid "1. Please confirm Orca Slicer and your printer are in the same LAN." msgstr "1. โปรดยืนยันว่า Orca Slicer และเครื่องพิมพ์ของคุณอยู่ใน LAN เดียวกัน" -msgid "" -"2. If the IP and Access Code below are different from the actual values on " -"your printer, please correct them." -msgstr "" -"2. หาก IP และรหัสการเข้าถึงด้านล่างแตกต่างจากค่าจริงบนเครื่องพิมพ์ของคุณ โปรดแก้ไขให้ถูกต้อง" +msgid "2. If the IP and Access Code below are different from the actual values on your printer, please correct them." +msgstr "2. หาก IP และรหัสการเข้าถึงด้านล่างแตกต่างจากค่าจริงบนเครื่องพิมพ์ของคุณ โปรดแก้ไขให้ถูกต้อง" -msgid "" -"3. Please obtain the device SN from the printer side; it is usually found in " -"the device information on the printer screen." +msgid "3. Please obtain the device SN from the printer side; it is usually found in the device information on the printer screen." msgstr "3. โปรดรับอุปกรณ์ SN จากฝั่งเครื่องพิมพ์ มักจะพบในข้อมูลอุปกรณ์บนหน้าจอเครื่องพิมพ์" msgid "IP" @@ -11555,11 +10492,8 @@ msgstr "การเชื่อมต่อล้มเหลว! โปรด msgid "sending failed" msgstr "การส่งล้มเหลว" -msgid "" -"Failed to send. Click Retry to attempt sending again. If retrying does not " -"work, please check the reason." -msgstr "" -"ไม่สามารถส่งได้ คลิกลองอีกครั้งเพื่อพยายามส่งอีกครั้ง หากการลองใหม่ไม่ได้ผล โปรดตรวจสอบสาเหตุ" +msgid "Failed to send. Click Retry to attempt sending again. If retrying does not work, please check the reason." +msgstr "ไม่สามารถส่งได้ คลิกลองอีกครั้งเพื่อพยายามส่งอีกครั้ง หากการลองใหม่ไม่ได้ผล โปรดตรวจสอบสาเหตุ" msgid "reconnect" msgstr "เชื่อมต่อใหม่" @@ -11597,28 +10531,14 @@ msgstr "การอัปเดตล้มเหลว" msgid "Update successful" msgstr "อัปเดตสำเร็จ" -msgid "" -"Are you sure you want to update? This will take about 10 minutes. Do not " -"turn off the power while the printer is updating." -msgstr "" -"คุณแน่ใจหรือไม่ว่าต้องการอัปเดต การดำเนินการนี้จะใช้เวลาประมาณ 10 นาที " -"อย่าปิดเครื่องในขณะที่เครื่องพิมพ์กำลังอัปเดต" +msgid "Are you sure you want to update? This will take about 10 minutes. Do not turn off the power while the printer is updating." +msgstr "คุณแน่ใจหรือไม่ว่าต้องการอัปเดต การดำเนินการนี้จะใช้เวลาประมาณ 10 นาที อย่าปิดเครื่องในขณะที่เครื่องพิมพ์กำลังอัปเดต" -msgid "" -"An important update was detected and needs to be run before printing can " -"continue. Do you want to update now? You can also update later from 'Update " -"firmware'." -msgstr "" -"ตรวจพบการอัปเดตที่สำคัญและจำเป็นต้องดำเนินการก่อนจึงจะสามารถพิมพ์ต่อได้ " -"คุณต้องการอัปเดตตอนนี้หรือไม่? คุณสามารถอัปเดตภายหลังได้จาก 'อัปเกรดเฟิร์มแวร์'" +msgid "An important update was detected and needs to be run before printing can continue. Do you want to update now? You can also update later from 'Update firmware'." +msgstr "ตรวจพบการอัปเดตที่สำคัญและจำเป็นต้องดำเนินการก่อนจึงจะสามารถพิมพ์ต่อได้ คุณต้องการอัปเดตตอนนี้หรือไม่? คุณสามารถอัปเดตภายหลังได้จาก 'อัปเกรดเฟิร์มแวร์'" -msgid "" -"The firmware version is abnormal. Repairing and updating are required before " -"printing. Do you want to update now? You can also update later on the " -"printer or update next time you start Orca Slicer." -msgstr "" -"เวอร์ชันเฟิร์มแวร์ผิดปกติ จำเป็นต้องซ่อมแซมและอัปเดตก่อนพิมพ์ คุณต้องการอัปเดตตอนนี้หรือไม่? " -"คุณยังสามารถอัปเดตภายหลังบนเครื่องพิมพ์ หรืออัปเดตในครั้งถัดไปที่เปิด Orca Slicer" +msgid "The firmware version is abnormal. Repairing and updating are required before printing. Do you want to update now? You can also update later on the printer or update next time you start Orca Slicer." +msgstr "เวอร์ชันเฟิร์มแวร์ผิดปกติ จำเป็นต้องซ่อมแซมและอัปเดตก่อนพิมพ์ คุณต้องการอัปเดตตอนนี้หรือไม่? คุณยังสามารถอัปเดตภายหลังบนเครื่องพิมพ์ หรืออัปเดตในครั้งถัดไปที่เปิด Orca Slicer" msgid "Extension Board" msgstr "คณะกรรมการขยาย" @@ -11652,9 +10572,7 @@ msgstr "อัปเดตเป็น" msgid "Open G-code file:" msgstr "เปิดไฟล์ G-code:" -msgid "" -"One object has an empty first layer and can't be printed. Please Cut the " -"bottom or enable supports." +msgid "One object has an empty first layer and can't be printed. Please Cut the bottom or enable supports." msgstr "วัตถุหนึ่งมีชั้นแรกว่างเปล่าและไม่สามารถพิมพ์ได้ กรุณาตัดด้านล่างหรือเปิดใช้งานส่วนรองรับ" #, boost-format @@ -11665,9 +10583,7 @@ msgstr "วัตถุมีชั้นว่างระหว่าง %1% msgid "Object: %1%" msgstr "วัตถุ: %1%" -msgid "" -"Parts of the object at these heights may be too thin or the object may have " -"a faulty mesh." +msgid "Parts of the object at these heights may be too thin or the object may have a faulty mesh." msgstr "บางส่วนของวัตถุที่ความสูงเหล่านี้อาจบางเกินไป หรือวัตถุอาจมี mesh ผิดปกติ" msgid "Process change extrusion role G-code" @@ -11679,9 +10595,7 @@ msgstr "เส้นพลาสติกเปลี่ยนบทบาทก msgid "No object can be printed. It may be too small." msgstr "ไม่สามารถพิมพ์วัตถุได้ อาจจะเล็กเกินไป" -msgid "" -"Your print is very close to the priming regions. Make sure there is no " -"collision." +msgid "Your print is very close to the priming regions. Make sure there is no collision." msgstr "งานพิมพ์ของคุณอยู่ใกล้กับบริเวณรองพื้นมาก ตรวจสอบให้แน่ใจว่าไม่มีการชนกัน" msgid "" @@ -11709,8 +10623,7 @@ msgstr "" "Marlin < 2.1.2 ไม่รองรับการสร้างรูปร่างอินพุต\n" "ตรวจสอบเวอร์ชันเฟิร์มแวร์ของคุณและอัปเดตรสชาติ G-code ของคุณเป็น 'Marlin 2'" -msgid "" -"Input shaping is only supported by Klipper, RepRapFirmware and Marlin 2." +msgid "Input shaping is only supported by Klipper, RepRapFirmware and Marlin 2." msgstr "รูปร่างอินพุตรองรับเฉพาะ Klipper, RepRapFirmware และ Marlin 2 เท่านั้น" msgid "Grouping error: " @@ -11726,12 +10639,8 @@ msgstr "สะพานภายใน" msgid "Failed to calculate line width of %1%. Cannot get value of “%2%” " msgstr "ไม่สามารถคำนวณความกว้างของเส้น %1% ไม่สามารถรับค่า \"%2%\"" -msgid "" -"Invalid spacing supplied to Flow::with_spacing(), check your layer height " -"and extrusion width" -msgstr "" -"การเว้นวรรคที่ให้กับ Flow::with_spacing() ไม่ถูกต้อง " -"โปรดตรวจสอบความสูงของเลเยอร์และความกว้างของการอัดขึ้นรูป" +msgid "Invalid spacing supplied to Flow::with_spacing(), check your layer height and extrusion width" +msgstr "การเว้นวรรคที่ให้กับ Flow::with_spacing() ไม่ถูกต้อง โปรดตรวจสอบความสูงของเลเยอร์และความกว้างของการอัดขึ้นรูป" msgid "undefined error" msgstr "ข้อผิดพลาดที่ไม่ได้กำหนด" @@ -11827,8 +10736,7 @@ msgid "write callback failed" msgstr "การเขียนการโทรกลับล้มเหลว" #, boost-format -msgid "" -"%1% is too close to exclusion area. There may be collisions when printing." +msgid "%1% is too close to exclusion area. There may be collisions when printing." msgstr "%1% อยู่ใกล้พื้นที่แยกมากเกินไป อาจเกิดการชนกันเมื่อพิมพ์" #, boost-format @@ -11842,9 +10750,7 @@ msgstr "%1% สูงเกินไป และจะเกิดการช msgid " is too close to exclusion area, there may be collisions when printing." msgstr "อยู่ใกล้พื้นที่แยกมากเกินไป อาจเกิดการชนกันเมื่อพิมพ์" -msgid "" -" is too close to clumping detection area, there may be collisions when " -"printing." +msgid " is too close to clumping detection area, there may be collisions when printing." msgstr "อยู่ใกล้พื้นที่การตรวจจับการจับตัวกันมากเกินไป อาจเกิดการชนกันเมื่อพิมพ์" msgid "Prime Tower" @@ -11856,156 +10762,94 @@ msgstr "อยู่ใกล้ผู้อื่นมากเกินไป msgid " is too close to an exclusion area, and collisions will be caused.\n" msgstr "อยู่ใกล้เขตหวงห้ามมากเกินไปจะเกิดการชนกัน\n" -msgid "" -" is too close to clumping detection area, and collisions will be caused.\n" +msgid " is too close to clumping detection area, and collisions will be caused.\n" msgstr "อยู่ใกล้พื้นที่การตรวจจับการจับตัวกันมากเกินไป และจะเกิดการชนกัน\n" -msgid "" -"Selected nozzle temperatures are incompatible. Each filament's nozzle " -"temperature must fall within the recommended nozzle temperature range of the " -"other filaments. Otherwise, nozzle clogging or printer damage may occur." -msgstr "" -"อุณหภูมิหัวฉีดที่เลือกเข้ากันไม่ได้ " -"อุณหภูมิหัวฉีดของเส้นพลาสติกแต่ละเส้นต้องอยู่ในช่วงอุณหภูมิหัวฉีดที่แนะนำของเส้นพลาสติกอื่นๆ " -"มิฉะนั้นอาจเกิดการอุดตันของหัวฉีดหรือเครื่องพิมพ์เสียหายได้" +msgid "Selected nozzle temperatures are incompatible. Each filament's nozzle temperature must fall within the recommended nozzle temperature range of the other filaments. Otherwise, nozzle clogging or printer damage may occur." +msgstr "อุณหภูมิหัวฉีดที่เลือกเข้ากันไม่ได้ อุณหภูมิหัวฉีดของเส้นพลาสติกแต่ละเส้นต้องอยู่ในช่วงอุณหภูมิหัวฉีดที่แนะนำของเส้นพลาสติกอื่นๆ มิฉะนั้นอาจเกิดการอุดตันของหัวฉีดหรือเครื่องพิมพ์เสียหายได้" -msgid "" -"Invalid recommended nozzle temperature range. The lower bound must be lower " -"than the upper bound." +msgid "Invalid recommended nozzle temperature range. The lower bound must be lower than the upper bound." msgstr "ช่วงอุณหภูมิหัวฉีดที่แนะนำไม่ถูกต้อง ขอบเขตล่างจะต้องต่ำกว่าขอบเขตบน" -msgid "" -"If you still want to print, you can enable the option in Preferences / " -"Control / Slicing / Remove mixed temperature restriction." -msgstr "" -"หากคุณยังต้องการพิมพ์ คุณสามารถเปิดใช้งานตัวเลือกในการตั้งค่า / การควบคุม / การตัด / " -"ลบข้อจำกัดอุณหภูมิแบบผสมได้" +msgid "If you still want to print, you can enable the option in Preferences / Control / Slicing / Remove mixed temperature restriction." +msgstr "หากคุณยังต้องการพิมพ์ คุณสามารถเปิดใช้งานตัวเลือกในการตั้งค่า / การควบคุม / การตัด / ลบข้อจำกัดอุณหภูมิแบบผสมได้" msgid "No extrusions under current settings." msgstr "ไม่มีการอัดขึ้นรูปภายใต้การตั้งค่าปัจจุบัน" -msgid "" -"Smooth mode of timelapse is not supported when \"by object\" sequence is " -"enabled." +msgid "Smooth mode of timelapse is not supported when \"by object\" sequence is enabled." msgstr "ไม่รองรับโหมดไทม์แลปส์แบบราบรื่นเมื่อเปิดใช้งานลำดับ \"ตามวัตถุ\"" -msgid "" -"Clumping detection is not supported when \"by object\" sequence is enabled." +msgid "Clumping detection is not supported when \"by object\" sequence is enabled." msgstr "ไม่รองรับการตรวจจับการจับกันเป็นก้อนเมื่อเปิดใช้งานลำดับ \"ตามวัตถุ\"" -msgid "" -"Enabling both precise Z height and the prime tower may cause slicing errors." +msgid "Enabling both precise Z height and the prime tower may cause slicing errors." msgstr "การเปิดใช้งานทั้งความสูง Z ที่แม่นยำและหอคอยหลักอาจทำให้เกิดข้อผิดพลาดในการแบ่งส่วน" -msgid "" -"A prime tower is required for clumping detection; otherwise, there may be " -"flaws on the model." +msgid "A prime tower is required for clumping detection; otherwise, there may be flaws on the model." msgstr "จำเป็นต้องใช้หอคอยหลักในการตรวจจับการจับกันเป็นก้อน มิฉะนั้นอาจมีข้อบกพร่องในแบบจำลอง" -msgid "" -"Please select \"By object\" print sequence to print multiple objects in " -"spiral vase mode." +msgid "Please select \"By object\" print sequence to print multiple objects in spiral vase mode." msgstr "โปรดเลือกลำดับการพิมพ์ \"ตามวัตถุ\" เพื่อพิมพ์วัตถุหลายชิ้นในโหมดแจกันเกลียว" -msgid "" -"Spiral (vase) mode does not work when an object contains more than one " -"material." +msgid "Spiral (vase) mode does not work when an object contains more than one material." msgstr "โหมดแจกันเกลียวจะไม่ทำงานเมื่อวัตถุมีวัสดุมากกว่าหนึ่งชนิด" #, boost-format -msgid "" -"While the object %1% itself fits the build volume, it exceeds the maximum " -"build volume height because of material shrinkage compensation." -msgstr "" -"แม้ว่าวัตถุ %1% จะพอดีกับปริมาตรการสร้าง " -"แต่วัตถุนั้นเกินความสูงของปริมาตรการสร้างสูงสุดเนื่องจากการชดเชยการหดตัวของวัสดุ" +msgid "While the object %1% itself fits the build volume, it exceeds the maximum build volume height because of material shrinkage compensation." +msgstr "แม้ว่าวัตถุ %1% จะพอดีกับปริมาตรการสร้าง แต่วัตถุนั้นเกินความสูงของปริมาตรการสร้างสูงสุดเนื่องจากการชดเชยการหดตัวของวัสดุ" #, boost-format msgid "The object %1% exceeds the maximum build volume height." msgstr "วัตถุ %1% เกินความสูงของปริมาตรบิลด์สูงสุด" #, boost-format -msgid "" -"While the object %1% itself fits the build volume, its last layer exceeds " -"the maximum build volume height." -msgstr "" -"แม้ว่าออบเจ็กต์ %1% จะพอดีกับปริมาณการสร้าง " -"แต่เลเยอร์สุดท้ายก็เกินความสูงของปริมาตรการสร้างสูงสุด" +msgid "While the object %1% itself fits the build volume, its last layer exceeds the maximum build volume height." +msgstr "แม้ว่าออบเจ็กต์ %1% จะพอดีกับปริมาณการสร้าง แต่เลเยอร์สุดท้ายก็เกินความสูงของปริมาตรการสร้างสูงสุด" -msgid "" -"You might want to reduce the size of your model or change current print " -"settings and retry." +msgid "You might want to reduce the size of your model or change current print settings and retry." msgstr "คุณอาจต้องการลดขนาดแบบจำลองของคุณหรือเปลี่ยนการตั้งค่าการพิมพ์ปัจจุบันแล้วลองอีกครั้ง" msgid "Variable layer height is not supported with Organic supports." msgstr "ไม่รองรับความสูงของเลเยอร์ที่แปรผันได้ด้วยการรองรับแบบออร์แกนิก" -msgid "" -"Different nozzle diameters and different filament diameters may not work " -"well when the prime tower is enabled. It's very experimental, so please " -"proceed with caution." -msgstr "" -"เส้นผ่านศูนย์กลางของหัวฉีดที่แตกต่างกันและเส้นผ่านศูนย์กลางของเส้นพลาสติกที่แตกต่างกันอาจทำงานได้ไม่ดีนักเมื่อเปิดใช้งานไพรม์ทาวเวอร์ " -"ยังเป็นการทดลองอยู่มาก ดังนั้นโปรดดำเนินการด้วยความระมัดระวัง" +msgid "Different nozzle diameters and different filament diameters may not work well when the prime tower is enabled. It's very experimental, so please proceed with caution." +msgstr "เส้นผ่านศูนย์กลางของหัวฉีดที่แตกต่างกันและเส้นผ่านศูนย์กลางของเส้นพลาสติกที่แตกต่างกันอาจทำงานได้ไม่ดีนักเมื่อเปิดใช้งานไพรม์ทาวเวอร์ ยังเป็นการทดลองอยู่มาก ดังนั้นโปรดดำเนินการด้วยความระมัดระวัง" -msgid "" -"The Wipe Tower is currently only supported with the relative extruder " -"addressing (use_relative_e_distances=1)." -msgstr "" -"ขณะนี้ Wipe Tower รองรับการกำหนดที่อยู่ของชุดดันเส้นแบบสัมพันธ์เท่านั้น " -"(use_relative_e_distances=1)" +msgid "The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1)." +msgstr "ขณะนี้ Wipe Tower รองรับการกำหนดที่อยู่ของชุดดันเส้นแบบสัมพันธ์เท่านั้น (use_relative_e_distances=1)" -msgid "" -"Ooze prevention is only supported with the wipe tower when " -"'single_extruder_multi_material' is off." +msgid "Ooze prevention is only supported with the wipe tower when 'single_extruder_multi_material' is off." msgstr "รองรับการป้องกันน้ำซึมด้วยหอเช็ดเมื่อปิด 'single_extruder_multi_material' เท่านั้น" -msgid "" -"The prime tower is currently only supported for the Marlin, RepRap/Sprinter, " -"RepRapFirmware and Repetier G-code flavors." -msgstr "" -"ขณะนี้ไพรม์ทาวเวอร์รองรับเฉพาะรสชาติ Marlin, RepRap/Sprinter, RepRapFirmware และ " -"Repetier G-code เท่านั้น" +msgid "The prime tower is currently only supported for the Marlin, RepRap/Sprinter, RepRapFirmware and Repetier G-code flavors." +msgstr "ขณะนี้ไพรม์ทาวเวอร์รองรับเฉพาะรสชาติ Marlin, RepRap/Sprinter, RepRapFirmware และ Repetier G-code เท่านั้น" msgid "A prime tower is not supported in “By object” print." msgstr "ไม่รองรับไพรม์ทาวเวอร์ในการพิมพ์ \"ตามวัตถุ\"" -msgid "" -"A prime tower is not supported when adaptive layer height is on. It requires " -"that all objects have the same layer height." -msgstr "" -"ไม่รองรับไพรม์ทาวเวอร์เมื่อเปิดความสูงของเลเยอร์แบบปรับได้ " -"กำหนดให้วัตถุทั้งหมดมีความสูงของชั้นเท่ากัน" +msgid "A prime tower is not supported when adaptive layer height is on. It requires that all objects have the same layer height." +msgstr "ไม่รองรับไพรม์ทาวเวอร์เมื่อเปิดความสูงของเลเยอร์แบบปรับได้ กำหนดให้วัตถุทั้งหมดมีความสูงของชั้นเท่ากัน" -msgid "" -"A prime tower requires any “support gap” to be a multiple of layer height." +msgid "A prime tower requires any “support gap” to be a multiple of layer height." msgstr "ไพรม์ทาวเวอร์ต้องการให้ “support gap” เป็นจำนวนเท่าของความสูงชั้น" msgid "A prime tower requires that all objects have the same layer height." msgstr "ไพรม์ทาวเวอร์ต้องการให้วัตถุทั้งหมดมีความสูงชั้นเท่ากัน" -msgid "" -"A prime tower requires that all objects are printed over the same number of " -"raft layers." +msgid "A prime tower requires that all objects are printed over the same number of raft layers." msgstr "ไพรม์ทาวเวอร์ต้องการให้วัตถุทั้งหมดพิมพ์บนจำนวนชั้น raft เท่ากัน" -msgid "" -"The prime tower is only supported for multiple objects if they are printed " -"with the same support_top_z_distance." +msgid "The prime tower is only supported for multiple objects if they are printed with the same support_top_z_distance." msgstr "ไพรม์ทาวเวอร์รองรับวัตถุหลายชิ้นเท่านั้นหากพิมพ์ด้วย support_top_z_distance เท่ากัน" -msgid "" -"A prime tower requires that all objects are sliced with the same layer " -"height." +msgid "A prime tower requires that all objects are sliced with the same layer height." msgstr "ไพรม์ทาวเวอร์ต้องการให้วัตถุทั้งหมดถูกสไลซ์ด้วยความสูงชั้นเท่ากัน" -msgid "" -"The prime tower is only supported if all objects have the same variable " -"layer height." +msgid "The prime tower is only supported if all objects have the same variable layer height." msgstr "ไพรม์ทาวเวอร์ได้รับส่วนรองรับก็ต่อเมื่อวัตถุทั้งหมดมีความสูงของเลเยอร์ที่แปรผันเท่ากัน" -msgid "" -"One or more object were assigned an extruder that the printer does not have." +msgid "One or more object were assigned an extruder that the printer does not have." msgstr "วัตถุอย่างน้อยหนึ่งชิ้นถูกกำหนดให้เป็นชุดดันเส้นที่เครื่องพิมพ์ไม่มี" msgid "Line width too small" @@ -12014,53 +10858,31 @@ msgstr "ความกว้างของเส้นเล็กเกิน msgid "Line width too large" msgstr "ความกว้างของเส้นใหญ่เกินไป" -msgid "" -"Printing with multiple extruders of differing nozzle diameters. If support " -"is to be printed with the current filament (support_filament == 0 or " -"support_interface_filament == 0), all nozzles have to be of the same " -"diameter." -msgstr "" -"การพิมพ์ด้วยชุดดันเส้นหลายเครื่องที่มีเส้นผ่านศูนย์กลางหัวฉีดต่างกัน " -"หากจะพิมพ์ส่วนรองรับด้วยฟิลาเมนต์ปัจจุบัน (support_filament == 0 หรือ " -"support_interface_filament == 0) หัวฉีดทั้งหมดจะต้องมีเส้นผ่านศูนย์กลางเท่ากัน" +msgid "Printing with multiple extruders of differing nozzle diameters. If support is to be printed with the current filament (support_filament == 0 or support_interface_filament == 0), all nozzles have to be of the same diameter." +msgstr "การพิมพ์ด้วยชุดดันเส้นหลายเครื่องที่มีเส้นผ่านศูนย์กลางหัวฉีดต่างกัน หากจะพิมพ์ส่วนรองรับด้วยฟิลาเมนต์ปัจจุบัน (support_filament == 0 หรือ support_interface_filament == 0) หัวฉีดทั้งหมดจะต้องมีเส้นผ่านศูนย์กลางเท่ากัน" -msgid "" -"A prime tower requires that support has the same layer height as the object." +msgid "A prime tower requires that support has the same layer height as the object." msgstr "ไพรม์ทาวเวอร์ต้องการให้ส่วนรองรับมีความสูงชั้นเท่ากับวัตถุ" -msgid "" -"For Organic supports, two walls are supported only with the Hollow/Default " -"base pattern." -msgstr "" -"สำหรับการรองรับแบบออร์แกนิก ผนังทั้งสองได้รับการรองรับด้วยรูปแบบฐานกลวง/ค่าเริ่มต้นเท่านั้น" +msgid "For Organic supports, two walls are supported only with the Hollow/Default base pattern." +msgstr "สำหรับการรองรับแบบออร์แกนิก ผนังทั้งสองได้รับการรองรับด้วยรูปแบบฐานกลวง/ค่าเริ่มต้นเท่านั้น" -msgid "" -"The Lightning base pattern is not supported by this support type; " -"Rectilinear will be used instead." +msgid "The Lightning base pattern is not supported by this support type; Rectilinear will be used instead." msgstr "รูปแบบฐาน Lightning ไม่ได้รับส่วนรองรับโดยประเภทส่วนรองรับนี้ จะใช้เส้นตรงแทน" -msgid "" -"Organic support tree tip diameter must not be smaller than support material " -"extrusion width." +msgid "Organic support tree tip diameter must not be smaller than support material extrusion width." msgstr "เส้นผ่านศูนย์กลางปลายของฐานรองรับแบบออร์แกนิกต้องไม่เล็กกว่าความกว้างของการอัดขึ้นรูปวัสดุรองรับ" -msgid "" -"Organic support branch diameter must not be smaller than 2x support material " -"extrusion width." +msgid "Organic support branch diameter must not be smaller than 2x support material extrusion width." msgstr "เส้นผ่านศูนย์กลางกิ่งรองรับออร์แกนิกต้องไม่เล็กกว่า 2x ความกว้างของการอัดขึ้นรูปวัสดุรองรับ" -msgid "" -"Organic support branch diameter must not be smaller than support tree tip " -"diameter." +msgid "Organic support branch diameter must not be smaller than support tree tip diameter." msgstr "เส้นผ่านศูนย์กลางกิ่งรองรับอินทรีย์ต้องไม่เล็กกว่าเส้นผ่านศูนย์กลางปลายต้นรองรับ" -msgid "" -"The Hollow base pattern is not supported by this support type; Rectilinear " -"will be used instead." +msgid "The Hollow base pattern is not supported by this support type; Rectilinear will be used instead." msgstr "รูปแบบฐานกลวงไม่รองรับประเภทการรองรับนี้ จะใช้เส้นตรงแทน" -msgid "" -"Support enforcers are used but support is not enabled. Please enable support." +msgid "Support enforcers are used but support is not enabled. Please enable support." msgstr "มีการใช้กำหนดส่วนรองรับ แต่ไม่ได้เปิดใช้งานส่วนรองรับ กรุณาเปิดใช้งานส่วนรองรับ" msgid "Layer height cannot exceed nozzle diameter." @@ -12069,115 +10891,71 @@ msgstr "ความสูงของชั้นต้องไม่เกิ msgid "Bridge line width must not exceed nozzle diameter" msgstr "ความกว้างเส้นสะพานต้องไม่เกินเส้นผ่านศูนย์กลางหัวฉีด" -msgid "" -"\"G92 E0\" was found in before_layer_change_gcode, but the G or E are not " -"uppercase. Please change them to the exact uppercase \"G92 E0\"." -msgstr "" -"พบ \"G92 E0\" ใน before_layer_change_gcode แต่ G หรือ E ไม่ได้เป็นตัวพิมพ์ใหญ่ " -"กรุณาเปลี่ยนให้ตรงกับ \"G92 E0\" ตัวพิมพ์ใหญ่ทุกตัว" +msgid "\"G92 E0\" was found in before_layer_change_gcode, but the G or E are not uppercase. Please change them to the exact uppercase \"G92 E0\"." +msgstr "พบ \"G92 E0\" ใน before_layer_change_gcode แต่ G หรือ E ไม่ได้เป็นตัวพิมพ์ใหญ่ กรุณาเปลี่ยนให้ตรงกับ \"G92 E0\" ตัวพิมพ์ใหญ่ทุกตัว" -msgid "" -"\"G92 E0\" was found in layer_change_gcode, but the G or E are not " -"uppercase. Please change them to the exact uppercase \"G92 E0\"." -msgstr "" -"พบ \"G92 E0\" ใน layer_change_gcode แต่ G หรือ E ไม่ได้เป็นตัวพิมพ์ใหญ่ " -"กรุณาเปลี่ยนให้ตรงกับ \"G92 E0\" ตัวพิมพ์ใหญ่ทุกตัว" +msgid "\"G92 E0\" was found in layer_change_gcode, but the G or E are not uppercase. Please change them to the exact uppercase \"G92 E0\"." +msgstr "พบ \"G92 E0\" ใน layer_change_gcode แต่ G หรือ E ไม่ได้เป็นตัวพิมพ์ใหญ่ กรุณาเปลี่ยนให้ตรงกับ \"G92 E0\" ตัวพิมพ์ใหญ่ทุกตัว" -msgid "" -"Relative extruder addressing requires resetting the extruder position at " -"each layer to prevent loss of floating point accuracy. Add \"G92 E0\" to " -"layer_gcode." -msgstr "" -"การระบุตำแหน่งชุดดันเส้นแบบสัมพันธ์จำเป็นต้องรีเซ็ตตำแหน่งชุดดันเส้นในแต่ละชั้น " -"เพื่อป้องกันการสูญเสียความแม่นยำของจุดลอยตัว เพิ่ม \"G92 E0\" ลงใน layer_gcode" +msgid "Relative extruder addressing requires resetting the extruder position at each layer to prevent loss of floating point accuracy. Add \"G92 E0\" to layer_gcode." +msgstr "การระบุตำแหน่งชุดดันเส้นแบบสัมพันธ์จำเป็นต้องรีเซ็ตตำแหน่งชุดดันเส้นในแต่ละชั้น เพื่อป้องกันการสูญเสียความแม่นยำของจุดลอยตัว เพิ่ม \"G92 E0\" ลงใน layer_gcode" -msgid "" -"\"G92 E0\" was found in before_layer_change_gcode, which is incompatible " -"with absolute extruder addressing." -msgstr "" -"พบ \"G92 E0\" ใน before_layer_change_gcode " -"ซึ่งไม่เข้ากันกับการกำหนดที่อยู่ชุดดันเส้นแบบสัมบูรณ์" +msgid "\"G92 E0\" was found in before_layer_change_gcode, which is incompatible with absolute extruder addressing." +msgstr "พบ \"G92 E0\" ใน before_layer_change_gcode ซึ่งไม่เข้ากันกับการกำหนดที่อยู่ชุดดันเส้นแบบสัมบูรณ์" -msgid "" -"\"G92 E0\" was found in layer_change_gcode, which is incompatible with " -"absolute extruder addressing." -msgstr "" -"พบ \"G92 E0\" ใน layer_change_gcode ซึ่งไม่เข้ากันกับการกำหนดที่อยู่ชุดดันเส้นแบบสัมบูรณ์" +msgid "\"G92 E0\" was found in layer_change_gcode, which is incompatible with absolute extruder addressing." +msgstr "พบ \"G92 E0\" ใน layer_change_gcode ซึ่งไม่เข้ากันกับการกำหนดที่อยู่ชุดดันเส้นแบบสัมบูรณ์" #, c-format, boost-format msgid "Plate %d: %s does not support filament %s" msgstr "ฐานพิมพ์ %d: %s ไม่รองรับเส้นพลาสติก %s" -msgid "" -"Setting the jerk speed too low could lead to artifacts on curved surfaces" +msgid "Setting the jerk speed too low could lead to artifacts on curved surfaces" msgstr "การตั้งค่าความเร็วกระตุกต่ำเกินไปอาจทำให้เกิดสิ่งแปลกปลอมบนพื้นผิวโค้งได้" msgid "" -"The jerk setting exceeds the printer's maximum jerk (machine_max_jerk_x/" -"machine_max_jerk_y).\n" -"Orca will automatically cap the jerk speed to ensure it doesn't surpass the " -"printer's capabilities.\n" -"You can adjust the maximum jerk setting in your printer's configuration to " -"get higher speeds." +"The jerk setting exceeds the printer's maximum jerk (machine_max_jerk_x/machine_max_jerk_y).\n" +"Orca will automatically cap the jerk speed to ensure it doesn't surpass the printer's capabilities.\n" +"You can adjust the maximum jerk setting in your printer's configuration to get higher speeds." msgstr "" -"การตั้งค่าการกระตุกเกินการกระตุกสูงสุดของเครื่องพิมพ์ (machine_max_jerk_x/" -"machine_max_jerk_y)\n" +"การตั้งค่าการกระตุกเกินการกระตุกสูงสุดของเครื่องพิมพ์ (machine_max_jerk_x/machine_max_jerk_y)\n" "Orca จะจำกัดความเร็วการกระตุกโดยอัตโนมัติเพื่อให้แน่ใจว่าจะไม่เกินความสามารถของเครื่องพิมพ์\n" "คุณสามารถปรับการตั้งค่าการกระตุกสูงสุดในการกำหนดค่าเครื่องพิมพ์ของคุณเพื่อให้ได้ความเร็วที่สูงขึ้น" msgid "" -"Junction deviation setting exceeds the printer's maximum value " -"(machine_max_junction_deviation).\n" -"Orca will automatically cap the junction deviation to ensure it doesn't " -"surpass the printer's capabilities.\n" -"You can adjust the machine_max_junction_deviation value in your printer's " -"configuration to get higher limits." +"Junction deviation setting exceeds the printer's maximum value (machine_max_junction_deviation).\n" +"Orca will automatically cap the junction deviation to ensure it doesn't surpass the printer's capabilities.\n" +"You can adjust the machine_max_junction_deviation value in your printer's configuration to get higher limits." msgstr "" -"การตั้งค่าส่วนเบี่ยงเบนของจุดเชื่อมต่อเกินค่าสูงสุดของเครื่องพิมพ์ " -"(machine_max_junction_deviation)\n" -"Orca " -"จะจำกัดส่วนเบี่ยงเบนของจุดเชื่อมต่อโดยอัตโนมัติเพื่อให้แน่ใจว่าจะไม่เกินความสามารถของเครื่องพิมพ์\n" -"คุณสามารถปรับค่า machine_max_junction_deviation " -"ในการกำหนดค่าเครื่องพิมพ์ของคุณเพื่อให้ได้ขีดจำกัดที่สูงขึ้น" +"การตั้งค่าส่วนเบี่ยงเบนของจุดเชื่อมต่อเกินค่าสูงสุดของเครื่องพิมพ์ (machine_max_junction_deviation)\n" +"Orca จะจำกัดส่วนเบี่ยงเบนของจุดเชื่อมต่อโดยอัตโนมัติเพื่อให้แน่ใจว่าจะไม่เกินความสามารถของเครื่องพิมพ์\n" +"คุณสามารถปรับค่า machine_max_junction_deviation ในการกำหนดค่าเครื่องพิมพ์ของคุณเพื่อให้ได้ขีดจำกัดที่สูงขึ้น" msgid "" -"The acceleration setting exceeds the printer's maximum acceleration " -"(machine_max_acceleration_extruding).\n" -"Orca will automatically cap the acceleration speed to ensure it doesn't " -"surpass the printer's capabilities.\n" -"You can adjust the machine_max_acceleration_extruding value in your " -"printer's configuration to get higher speeds." +"The acceleration setting exceeds the printer's maximum acceleration (machine_max_acceleration_extruding).\n" +"Orca will automatically cap the acceleration speed to ensure it doesn't surpass the printer's capabilities.\n" +"You can adjust the machine_max_acceleration_extruding value in your printer's configuration to get higher speeds." msgstr "" -"การตั้งค่าความเร่งเกินความเร่งสูงสุดของเครื่องพิมพ์ " -"(machine_max_acceleration_extruding)\n" -"Orca " -"จะจำกัดความเร็วการเร่งความเร็วโดยอัตโนมัติเพื่อให้แน่ใจว่าจะไม่เกินความสามารถของเครื่องพิมพ์\n" -"คุณสามารถปรับค่า machine_max_acceleration_extruding " -"ในการกำหนดค่าเครื่องพิมพ์ของคุณเพื่อให้ได้ความเร็วที่สูงขึ้น" +"การตั้งค่าความเร่งเกินความเร่งสูงสุดของเครื่องพิมพ์ (machine_max_acceleration_extruding)\n" +"Orca จะจำกัดความเร็วการเร่งความเร็วโดยอัตโนมัติเพื่อให้แน่ใจว่าจะไม่เกินความสามารถของเครื่องพิมพ์\n" +"คุณสามารถปรับค่า machine_max_acceleration_extruding ในการกำหนดค่าเครื่องพิมพ์ของคุณเพื่อให้ได้ความเร็วที่สูงขึ้น" msgid "" -"The travel acceleration setting exceeds the printer's maximum travel " -"acceleration (machine_max_acceleration_travel).\n" -"Orca will automatically cap the travel acceleration speed to ensure it " -"doesn't surpass the printer's capabilities.\n" -"You can adjust the machine_max_acceleration_travel value in your printer's " -"configuration to get higher speeds." +"The travel acceleration setting exceeds the printer's maximum travel acceleration (machine_max_acceleration_travel).\n" +"Orca will automatically cap the travel acceleration speed to ensure it doesn't surpass the printer's capabilities.\n" +"You can adjust the machine_max_acceleration_travel value in your printer's configuration to get higher speeds." msgstr "" -"การตั้งค่าการเร่งความเร็วในการเดินทางเกินความเร็วการเคลื่อนที่สูงสุดของเครื่องพิมพ์ " -"(machine_max_acceleration_travel)\n" -"Orca " -"จะจำกัดความเร็วในการเร่งความเร็วโดยอัตโนมัติเพื่อให้แน่ใจว่าจะไม่เกินความสามารถของเครื่องพิมพ์\n" -"คุณสามารถปรับค่า machine_max_acceleration_travel " -"ในการกำหนดค่าเครื่องพิมพ์ของคุณเพื่อให้ได้ความเร็วที่สูงขึ้น" +"การตั้งค่าการเร่งความเร็วในการเดินทางเกินความเร็วการเคลื่อนที่สูงสุดของเครื่องพิมพ์ (machine_max_acceleration_travel)\n" +"Orca จะจำกัดความเร็วในการเร่งความเร็วโดยอัตโนมัติเพื่อให้แน่ใจว่าจะไม่เกินความสามารถของเครื่องพิมพ์\n" +"คุณสามารถปรับค่า machine_max_acceleration_travel ในการกำหนดค่าเครื่องพิมพ์ของคุณเพื่อให้ได้ความเร็วที่สูงขึ้น" -msgid "" -"The precise wall option will be ignored for outer-inner or inner-outer-inner " -"wall sequences." +msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "ตัวเลือกผนังที่แม่นยำจะถูกละเว้นสำหรับลำดับผนังด้านนอก-ด้านใน หรือด้านใน-ด้านนอก-ด้านใน" -msgid "" -"Filament shrinkage will not be used because filament shrinkage for the used " -"filaments does not match." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + +msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "การหดตัวของเส้นพลาสติกจะไม่ถูกนำมาใช้เนื่องจากการหดตัวของเส้นพลาสติกสำหรับเส้นพลาสติกที่ใช้ไม่ตรงกัน" msgid "Generating skirt & brim" @@ -12204,41 +10982,26 @@ msgstr "พื้นที่การพิมพ์ของชุดดัน msgid "Support parallel printheads" msgstr "รองรับหัวพิมพ์แบบขนาน" -msgid "" -"Enable printer settings for machines that can use multiple printheads in " -"parallel." +msgid "Enable printer settings for machines that can use multiple printheads in parallel." msgstr "เปิดการตั้งค่าเครื่องพิมพ์สำหรับเครื่องที่สามารถใช้หัวพิมพ์หลายหัวพร้อมกันแบบขนาน" msgid "Parallel printheads count" msgstr "จำนวนหัวพิมพ์แบบขนาน" -msgid "" -"Set the number of parallel printheads for machines like OrangeStorm Giga " -"printer." +msgid "Set the number of parallel printheads for machines like OrangeStorm Giga printer." msgstr "ตั้งจำนวนหัวพิมพ์แบบขนานสำหรับเครื่องเช่นเครื่องพิมพ์ OrangeStorm Giga" msgid "Parallel printheads bed exclude areas" msgstr "พื้นที่ยกเว้นบนเพลตตามจำนวนหัวพิมพ์แบบขนาน" -msgid "" -"Ordered list of bed exclude areas by parallel printhead count. Item 1 " -"applies to one printhead, item 2 to two printheads, and so on. Leave an item " -"empty for no excluded area." -msgstr "" -"รายการพื้นที่ยกเว้นบนเพลตตามจำนวนหัวพิมพ์แบบขนาน รายการที่ 1 ใช้กับหัวพิมพ์ 1 หัว รายการที่ 2 " -"ใช้กับ 2 หัว และต่อไปเรื่อยๆ ปล่อยรายการว่างหากไม่ต้องการพื้นที่ยกเว้น" +msgid "Ordered list of bed exclude areas by parallel printhead count. Item 1 applies to one printhead, item 2 to two printheads, and so on. Leave an item empty for no excluded area." +msgstr "รายการพื้นที่ยกเว้นบนเพลตตามจำนวนหัวพิมพ์แบบขนาน รายการที่ 1 ใช้กับหัวพิมพ์ 1 หัว รายการที่ 2 ใช้กับ 2 หัว และต่อไปเรื่อยๆ ปล่อยรายการว่างหากไม่ต้องการพื้นที่ยกเว้น" msgid "Excluded bed area" msgstr "พื้นที่ฐานพิมพ์ที่ยกเว้น" -msgid "" -"Unprintable area in XY plane. For example, X1 Series printers use the front " -"left corner to cut filament during filament change. The area is expressed as " -"polygon by points in following format: \"XxY, XxY, ...\"" -msgstr "" -"พื้นที่ที่ไม่สามารถพิมพ์ได้ในระนาบ XY ตัวอย่างเช่น เครื่องพิมพ์ X1 " -"ซีรีส์ใช้มุมซ้ายด้านหน้าเพื่อตัดเส้นพลาสติกระหว่างการเปลี่ยนเส้นพลาสติก " -"พื้นที่จะแสดงเป็นรูปหลายเหลี่ยมตามจุดในรูปแบบต่อไปนี้: \"XxY, XxY, ...\"" +msgid "Unprintable area in XY plane. For example, X1 Series printers use the front left corner to cut filament during filament change. The area is expressed as polygon by points in following format: \"XxY, XxY, ...\"" +msgstr "พื้นที่ที่ไม่สามารถพิมพ์ได้ในระนาบ XY ตัวอย่างเช่น เครื่องพิมพ์ X1 ซีรีส์ใช้มุมซ้ายด้านหน้าเพื่อตัดเส้นพลาสติกระหว่างการเปลี่ยนเส้นพลาสติก พื้นที่จะแสดงเป็นรูปหลายเหลี่ยมตามจุดในรูปแบบต่อไปนี้: \"XxY, XxY, ...\"" msgid "Bed custom texture" msgstr "พื้นผิวแบบกำหนดเองของฐานพิมพ์" @@ -12249,22 +11012,14 @@ msgstr "ฐานพิมพ์รุ่นสั่งทำพิเศษ" msgid "Elephant foot compensation" msgstr "การชดเชยอาการฐานบาน" -msgid "" -"This shrinks the first layer on the build plate to compensate for elephant " -"foot effect." +msgid "This shrinks the first layer on the build plate to compensate for elephant foot effect." msgstr "ย่อชั้นแรกบนฐานรองพิมพ์เพื่อชดเชยผลกระทบจากรอยอาการฐานบาน" msgid "Elephant foot compensation layers" msgstr "ชั้นชดเชยอาการฐานบาน" -msgid "" -"The number of layers on which the elephant foot compensation will be active. " -"The first layer will be shrunk by the elephant foot compensation value, then " -"the next layers will be linearly shrunk less, up to the layer indicated by " -"this value." -msgstr "" -"จำนวนชั้นที่การชดเชยอาการฐานบานจะทำงาน ชั้นแรกจะหดตามค่าการชดเชยอาการฐานบาน " -"จากนั้นชั้นถัดไปจะหดเป็นเส้นตรงน้อยลง จนถึงชั้นที่ระบุด้วยค่านี้" +msgid "The number of layers on which the elephant foot compensation will be active. The first layer will be shrunk by the elephant foot compensation value, then the next layers will be linearly shrunk less, up to the layer indicated by this value." +msgstr "จำนวนชั้นที่การชดเชยอาการฐานบานจะทำงาน ชั้นแรกจะหดตามค่าการชดเชยอาการฐานบาน จากนั้นชั้นถัดไปจะหดเป็นเส้นตรงน้อยลง จนถึงชั้นที่ระบุด้วยค่านี้" msgid "Elephant foot layers density" msgstr "ความหนาแน่นของชั้นอาการฐานบาน" @@ -12272,34 +11027,25 @@ msgstr "ความหนาแน่นของชั้นอาการฐ msgid "" "Density of internal solid infill for Elephant foot layers compensation.\n" "The initial value for the second layer is set.\n" -"Subsequent layers become linearly denser by the height specified in " -"elefant_foot_compensation_layers." +"Subsequent layers become linearly denser by the height specified in elefant_foot_compensation_layers." msgstr "" "ความหนาแน่นของวัสดุไส้ในแบบทึบภายในสำหรับการชดเชยชั้นอาการฐานบาน\n" "มีการตั้งค่าเริ่มต้นสำหรับเลเยอร์ที่สอง\n" -"เลเยอร์ต่อมาจะมีความหนาแน่นเชิงเส้นมากขึ้นตามความสูงที่ระบุใน " -"elefant_foot_compensation_layers" +"เลเยอร์ต่อมาจะมีความหนาแน่นเชิงเส้นมากขึ้นตามความสูงที่ระบุใน elefant_foot_compensation_layers" -msgid "" -"This is the height for each layer. Smaller layer heights give greater " -"accuracy but longer printing time." -msgstr "" -"ความสูงของการตัดแต่ละชั้น ความสูงของชั้นที่เล็กลงหมายถึงความแม่นยำและเวลาในการพิมพ์ที่มากขึ้น" +msgid "This is the height for each layer. Smaller layer heights give greater accuracy but longer printing time." +msgstr "ความสูงของการตัดแต่ละชั้น ความสูงของชั้นที่เล็กลงหมายถึงความแม่นยำและเวลาในการพิมพ์ที่มากขึ้น" msgid "Printable height" msgstr "ความสูงที่สามารถพิมพ์ได้" -msgid "" -"This is the maximum printable height which is limited by the height of the " -"build area." +msgid "This is the maximum printable height which is limited by the height of the build area." msgstr "ความสูงสูงสุดที่สามารถพิมพ์ได้ซึ่งถูกจำกัดโดยกลไกของเครื่องพิมพ์" msgid "Extruder printable height" msgstr "ความสูงที่สามารถพิมพ์ของชุดดันเส้นได้" -msgid "" -"Maximum printable height of this extruder which is limited by mechanism of " -"printer." +msgid "Maximum printable height of this extruder which is limited by mechanism of printer." msgstr "ความสูงสูงสุดที่สามารถพิมพ์ได้ของชุดดันเส้นนี้ซึ่งถูกจำกัดโดยกลไกของเครื่องพิมพ์" msgid "Preferred orientation" @@ -12320,13 +11066,8 @@ msgstr "อนุญาตให้ควบคุมเครื่องพิ msgid "Use 3MF instead of G-code" msgstr "ใช้ 3MF แทน G-code" -msgid "" -"Enable this if the printer accepts a 3MF file as the print job. When " -"enabled, Orca Slicer sends the sliced file as a .gcode.3mf, instead of a " -"plain .gcode file." -msgstr "" -"เปิดใช้งานหากเครื่องพิมพ์รับไฟล์ 3MF เป็นงานพิมพ์ เมื่อเปิดใช้งาน OrcaSlicer " -"จะส่งไฟล์ที่สไลซ์แล้วเป็น .gcode.3mf แทนไฟล์ .gcode ธรรมดา" +msgid "Enable this if the printer accepts a 3MF file as the print job. When enabled, Orca Slicer sends the sliced file as a .gcode.3mf, instead of a plain .gcode file." +msgstr "เปิดใช้งานหากเครื่องพิมพ์รับไฟล์ 3MF เป็นงานพิมพ์ เมื่อเปิดใช้งาน OrcaSlicer จะส่งไฟล์ที่สไลซ์แล้วเป็น .gcode.3mf แทนไฟล์ .gcode ธรรมดา" msgid "Printer Agent" msgstr "ตัวแทนเครื่องพิมพ์" @@ -12337,34 +11078,20 @@ msgstr "เลือกการใช้งานตัวแทนเครื msgid "Hostname, IP or URL" msgstr "ชื่อโฮสต์, IP หรือ URL" -msgid "" -"Orca Slicer can upload G-code files to a printer host. This field should " -"contain the hostname, IP address or URL of the printer host instance. Print " -"host behind HAProxy with basic auth enabled can be accessed by putting the " -"user name and password into the URL in the following format: https://" -"username:password@your-octopi-address/" -msgstr "" -"Orca Slicer สามารถอัปโหลดไฟล์ G-code ไปยังโฮสต์เครื่องพิมพ์ได้ ฟิลด์นี้ควรมีชื่อโฮสต์ ที่อยู่ IP " -"หรือ URL ของอินสแตนซ์โฮสต์ของเครื่องพิมพ์ โฮสต์การพิมพ์ที่อยู่เบื้องหลัง HAProxy " -"ที่เปิดใช้งานการรับรองความถูกต้องขั้นพื้นฐานสามารถเข้าถึงได้โดยการใส่ชื่อผู้ใช้และรหัสผ่านลงใน URL " -"ในรูปแบบต่อไปนี้: https://username:password@your-octopi-address/" +msgid "Orca Slicer can upload G-code files to a printer host. This field should contain the hostname, IP address or URL of the printer host instance. Print host behind HAProxy with basic auth enabled can be accessed by putting the user name and password into the URL in the following format: https://username:password@your-octopi-address/" +msgstr "Orca Slicer สามารถอัปโหลดไฟล์ G-code ไปยังโฮสต์เครื่องพิมพ์ได้ ฟิลด์นี้ควรมีชื่อโฮสต์ ที่อยู่ IP หรือ URL ของอินสแตนซ์โฮสต์ของเครื่องพิมพ์ โฮสต์การพิมพ์ที่อยู่เบื้องหลัง HAProxy ที่เปิดใช้งานการรับรองความถูกต้องขั้นพื้นฐานสามารถเข้าถึงได้โดยการใส่ชื่อผู้ใช้และรหัสผ่านลงใน URL ในรูปแบบต่อไปนี้: https://username:password@your-octopi-address/" msgid "Device UI" msgstr "UI ของอุปกรณ์" -msgid "" -"Specify the URL of your device user interface if it's not same as print_host." +msgid "Specify the URL of your device user interface if it's not same as print_host." msgstr "ระบุ URL ของอินเทอร์เฟซผู้ใช้อุปกรณ์ของคุณหากไม่เหมือนกับ print_host" msgid "API Key / Password" msgstr "คีย์ API / รหัสผ่าน" -msgid "" -"Orca Slicer can upload G-code files to a printer host. This field should " -"contain the API Key or the password required for authentication." -msgstr "" -"Orca Slicer สามารถอัปโหลดไฟล์ G-code ไปยังโฮสต์เครื่องพิมพ์ได้ ฟิลด์นี้ควรมีคีย์ API " -"หรือรหัสผ่านที่จำเป็นสำหรับการตรวจสอบสิทธิ์" +msgid "Orca Slicer can upload G-code files to a printer host. This field should contain the API Key or the password required for authentication." +msgstr "Orca Slicer สามารถอัปโหลดไฟล์ G-code ไปยังโฮสต์เครื่องพิมพ์ได้ ฟิลด์นี้ควรมีคีย์ API หรือรหัสผ่านที่จำเป็นสำหรับการตรวจสอบสิทธิ์" msgid "Serial Number" msgstr "หมายเลขซีเรียล" @@ -12378,13 +11105,8 @@ msgstr "ชื่อของเครื่องพิมพ์" msgid "HTTPS CA File" msgstr "ไฟล์ HTTPS CA" -msgid "" -"Custom CA certificate file can be specified for HTTPS OctoPrint connections, " -"in crt/pem format. If left blank, the default OS CA certificate repository " -"is used." -msgstr "" -"สามารถระบุไฟล์ใบรับรอง CA แบบกำหนดเองสำหรับการเชื่อมต่อ HTTPS OctoPrint ในรูปแบบ crt/" -"pem หากเว้นว่างไว้ ระบบจะใช้ที่เก็บใบรับรอง OS CA เริ่มต้น" +msgid "Custom CA certificate file can be specified for HTTPS OctoPrint connections, in crt/pem format. If left blank, the default OS CA certificate repository is used." +msgstr "สามารถระบุไฟล์ใบรับรอง CA แบบกำหนดเองสำหรับการเชื่อมต่อ HTTPS OctoPrint ในรูปแบบ crt/pem หากเว้นว่างไว้ ระบบจะใช้ที่เก็บใบรับรอง OS CA เริ่มต้น" msgid "User" msgstr "ผู้ใช้" @@ -12395,13 +11117,8 @@ msgstr "รหัสผ่าน" msgid "Ignore HTTPS certificate revocation checks" msgstr "ละเว้นการตรวจสอบการเพิกถอนใบรับรอง HTTPS" -msgid "" -"Ignore HTTPS certificate revocation checks in the case of missing or offline " -"distribution points. One may want to enable this option for self signed " -"certificates if connection fails." -msgstr "" -"ละเว้นการตรวจสอบการเพิกถอนใบรับรอง HTTPS ในกรณีที่จุดแจกจ่ายหายไปหรือออฟไลน์ " -"อาจต้องการเปิดใช้งานตัวเลือกนี้สำหรับใบรับรองที่ลงนามด้วยตนเองหากการเชื่อมต่อล้มเหลว" +msgid "Ignore HTTPS certificate revocation checks in the case of missing or offline distribution points. One may want to enable this option for self signed certificates if connection fails." +msgstr "ละเว้นการตรวจสอบการเพิกถอนใบรับรอง HTTPS ในกรณีที่จุดแจกจ่ายหายไปหรือออฟไลน์ อาจต้องการเปิดใช้งานตัวเลือกนี้สำหรับใบรับรองที่ลงนามด้วยตนเองหากการเชื่อมต่อล้มเหลว" msgid "Names of presets related to the physical printer." msgstr "ชื่อของค่าที่ตั้งล่วงหน้าที่เกี่ยวข้องกับเครื่องพิมพ์จริง" @@ -12418,23 +11135,14 @@ msgstr "HTTP ไดเจสต์" msgid "Avoid crossing walls" msgstr "หลีกเลี่ยงการข้ามผนัง" -msgid "" -"This detours to avoid traveling across walls, which may cause blobs on the " -"surface." +msgid "This detours to avoid traveling across walls, which may cause blobs on the surface." msgstr "ทางอ้อมเพื่อหลีกเลี่ยงการเดินทางข้ามผนัง ซึ่งอาจทำให้เกิดหยดบนพื้นผิว" msgid "Avoid crossing walls - Max detour length" msgstr "หลีกเลี่ยงการข้ามผนัง - ความยาวทางเบี่ยงสูงสุด" -msgid "" -"Maximum detour distance for avoiding crossing wall: The printer won't detour " -"if the detour distance is larger than this value. Detour length could be " -"specified either as an absolute value or as percentage (for example 50%) of " -"a direct travel path. A value of 0 will disable this." -msgstr "" -"ระยะทางเบี่ยงสูงสุดเพื่อหลีกเลี่ยงการข้ามผนัง เครื่องพิมพ์จะไม่อ้อมหากระยะทางเบี่ยงมากกว่าค่านี้ " -"ความยาวทางเบี่ยงสามารถระบุเป็นค่าสัมบูรณ์หรือเป็นเปอร์เซ็นต์ (เช่น 50%) " -"ของเส้นทางเดินทางโดยตรง ค่า 0 จะปิดการใช้งานตัวเลือกนี้" +msgid "Maximum detour distance for avoiding crossing wall: The printer won't detour if the detour distance is larger than this value. Detour length could be specified either as an absolute value or as percentage (for example 50%) of a direct travel path. A value of 0 will disable this." +msgstr "ระยะทางเบี่ยงสูงสุดเพื่อหลีกเลี่ยงการข้ามผนัง เครื่องพิมพ์จะไม่อ้อมหากระยะทางเบี่ยงมากกว่าค่านี้ ความยาวทางเบี่ยงสามารถระบุเป็นค่าสัมบูรณ์หรือเป็นเปอร์เซ็นต์ (เช่น 50%) ของเส้นทางเดินทางโดยตรง ค่า 0 จะปิดการใช้งานตัวเลือกนี้" msgid "mm or %" msgstr "มม. หรือ %" @@ -12442,47 +11150,23 @@ msgstr "มม. หรือ %" msgid "Other layers" msgstr "ชั้นอื่นๆ" -msgid "" -"Bed temperature for layers except the initial one. A value of 0 means the " -"filament does not support printing on the Cool Plate SuperTack." -msgstr "" -"อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 " -"หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool Plate SuperTack" +msgid "Bed temperature for layers except the initial one. A value of 0 means the filament does not support printing on the Cool Plate SuperTack." +msgstr "อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool Plate SuperTack" -msgid "" -"This is the bed temperature for layers except for the first one. A value of " -"0 means the filament does not support printing on the Cool Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 " -"หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool Plate" +msgid "This is the bed temperature for layers except for the first one. A value of 0 means the filament does not support printing on the Cool Plate." +msgstr "อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool Plate" -msgid "" -"This is the bed temperature for layers except for the first one. A value of " -"0 means the filament does not support printing on the Textured Cool Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 " -"หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Textured Cool Plate" +msgid "This is the bed temperature for layers except for the first one. A value of 0 means the filament does not support printing on the Textured Cool Plate." +msgstr "อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Textured Cool Plate" -msgid "" -"This is the bed temperature for layers except for the first one. A value of " -"0 means the filament does not support printing on the Engineering Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 " -"หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Engineering Plate" +msgid "This is the bed temperature for layers except for the first one. A value of 0 means the filament does not support printing on the Engineering Plate." +msgstr "อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Engineering Plate" -msgid "" -"This is the bed temperature for layers except for the first one. A value of " -"0 means the filament does not support printing on the High Temp Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 " -"หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนแผ่นอุณหภูมิสูง" +msgid "This is the bed temperature for layers except for the first one. A value of 0 means the filament does not support printing on the High Temp Plate." +msgstr "อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนแผ่นอุณหภูมิสูง" -msgid "" -"This is the bed temperature for layers except for the first one. A value of " -"0 means the filament does not support printing on the Textured PEI Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 " -"หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนเพลต PEI ที่มีพื้นผิว" +msgid "This is the bed temperature for layers except for the first one. A value of 0 means the filament does not support printing on the Textured PEI Plate." +msgstr "อุณหภูมิฐานพิมพ์สำหรับชั้นต่างๆ ยกเว้นอุณหภูมิเริ่มต้น ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนเพลต PEI ที่มีพื้นผิว" msgid "First layer" msgstr "ชั้นแรก" @@ -12490,39 +11174,23 @@ msgstr "ชั้นแรก" msgid "First layer bed temperature" msgstr "อุณหภูมิฐานพิมพ์ชั้นแรก" -msgid "" -"This is the bed temperature of the first layer. A value of 0 means the " -"filament does not support printing on the Cool Plate SuperTack." -msgstr "" -"อุณหภูมิฐานพิมพ์ชั้นแรก ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool Plate SuperTack" +msgid "This is the bed temperature of the first layer. A value of 0 means the filament does not support printing on the Cool Plate SuperTack." +msgstr "อุณหภูมิฐานพิมพ์ชั้นแรก ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool Plate SuperTack" -msgid "" -"This is the bed temperature of the first layer. A value of 0 means the " -"filament does not support printing on the Cool Plate." +msgid "This is the bed temperature of the first layer. A value of 0 means the filament does not support printing on the Cool Plate." msgstr "อุณหภูมิฐานพิมพ์ชั้นแรก ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Cool Plate" -msgid "" -"This is the bed temperature of the first layer. A value of 0 means the " -"filament does not support printing on the Textured Cool Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์ชั้นแรก ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Textured Cool Plate" +msgid "This is the bed temperature of the first layer. A value of 0 means the filament does not support printing on the Textured Cool Plate." +msgstr "อุณหภูมิฐานพิมพ์ชั้นแรก ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Textured Cool Plate" -msgid "" -"This is the bed temperature of the first layer. A value of 0 means the " -"filament does not support printing on the Engineering Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์ชั้นแรก ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Engineering Plate" +msgid "This is the bed temperature of the first layer. A value of 0 means the filament does not support printing on the Engineering Plate." +msgstr "อุณหภูมิฐานพิมพ์ชั้นแรก ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บน Engineering Plate" -msgid "" -"This is the bed temperature of the first layer. A value of 0 means the " -"filament does not support printing on the High Temp Plate." +msgid "This is the bed temperature of the first layer. A value of 0 means the filament does not support printing on the High Temp Plate." msgstr "อุณหภูมิฐานพิมพ์ชั้นแรก ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนแผ่นอุณหภูมิสูง" -msgid "" -"This is the bed temperature of the first layer. A value of 0 means the " -"filament does not support printing on the Textured PEI Plate." -msgstr "" -"อุณหภูมิฐานพิมพ์ชั้นแรก ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนเพลต PEI ที่มีพื้นผิว" +msgid "This is the bed temperature of the first layer. A value of 0 means the filament does not support printing on the Textured PEI Plate." +msgstr "อุณหภูมิฐานพิมพ์ชั้นแรก ค่า 0 หมายความว่าเส้นพลาสติกไม่รองรับการพิมพ์บนเพลต PEI ที่มีพื้นผิว" msgid "Plate types supported by the printer" msgstr "ประเภทฐานพิมพ์ที่เครื่องพิมพ์รองรับ" @@ -12530,8 +11198,7 @@ msgstr "ประเภทฐานพิมพ์ที่เครื่อง msgid "Default bed type" msgstr "ประเภทฐานพิมพ์เริ่มต้น" -msgid "" -"Default bed type for the printer (supports both numeric and string format)." +msgid "Default bed type for the printer (supports both numeric and string format)." msgstr "ประเภทฐานฐานพิมพ์เริ่มต้นสำหรับเครื่องพิมพ์ (รองรับทั้งรูปแบบตัวเลขและสตริง)" msgid "First layer print sequence" @@ -12552,82 +11219,44 @@ msgstr "G-code นี้จะถูกแทรกทุกครั้งท msgid "Bottom shell layers" msgstr "เลเยอร์ผนังด้านล่าง" -msgid "" -"This is the number of solid layers of bottom shell, including the bottom " -"surface layer. When the thickness calculated by this value is thinner than " -"bottom shell thickness, the bottom shell layers will be increased." -msgstr "" -"นี่คือจำนวนชั้นทึบของเปลือกด้านล่าง รวมถึงชั้นล่างของพื้นผิวด้วย " -"เมื่อความหนาที่คำนวณโดยค่านี้บางกว่าความหนาของเปลือกด้านล่าง ชั้นเปลือกด้านล่างจะเพิ่มขึ้น" +msgid "This is the number of solid layers of bottom shell, including the bottom surface layer. When the thickness calculated by this value is thinner than bottom shell thickness, the bottom shell layers will be increased." +msgstr "นี่คือจำนวนชั้นทึบของเปลือกด้านล่าง รวมถึงชั้นล่างของพื้นผิวด้วย เมื่อความหนาที่คำนวณโดยค่านี้บางกว่าความหนาของเปลือกด้านล่าง ชั้นเปลือกด้านล่างจะเพิ่มขึ้น" msgid "Bottom shell thickness" msgstr "ความหนาผนังด้านล่าง" -msgid "" -"The number of bottom solid layers is increased when slicing if the thickness " -"calculated by bottom shell layers is thinner than this value. This can avoid " -"having too thin a shell when layer height is small. 0 means that this " -"setting is disabled and the thickness of the bottom shell is determined " -"simply by the number of bottom shell layers." -msgstr "" -"จำนวนชั้นทึบด้านล่างจะเพิ่มขึ้นเมื่อสไลซ์หากความหนาที่คำนวณโดยชั้นเปลือกด้านล่างบางกว่าค่านี้ " -"วิธีนี้สามารถหลีกเลี่ยงไม่ให้เปลือกบางเกินไปเมื่อชั้นมีความสูงน้อย 0 " -"หมายความว่าการตั้งค่านี้ถูกปิดใช้งาน " -"และความหนาของเปลือกด้านล่างจะถูกกำหนดโดยชั้นเปลือกด้านล่างอย่างแน่นอน" +msgid "The number of bottom solid layers is increased when slicing if the thickness calculated by bottom shell layers is thinner than this value. This can avoid having too thin a shell when layer height is small. 0 means that this setting is disabled and the thickness of the bottom shell is determined simply by the number of bottom shell layers." +msgstr "จำนวนชั้นทึบด้านล่างจะเพิ่มขึ้นเมื่อสไลซ์หากความหนาที่คำนวณโดยชั้นเปลือกด้านล่างบางกว่าค่านี้ วิธีนี้สามารถหลีกเลี่ยงไม่ให้เปลือกบางเกินไปเมื่อชั้นมีความสูงน้อย 0 หมายความว่าการตั้งค่านี้ถูกปิดใช้งาน และความหนาของเปลือกด้านล่างจะถูกกำหนดโดยชั้นเปลือกด้านล่างอย่างแน่นอน" msgid "Apply gap fill" msgstr "ใช้การเติมช่องว่าง" msgid "" -"Enables gap fill for the selected solid surfaces. The minimum gap length " -"that will be filled can be controlled from the filter out tiny gaps option " -"below.\n" +"Enables gap fill for the selected solid surfaces. The minimum gap length that will be filled can be controlled from the filter out tiny gaps option below.\n" "\n" "Options:\n" -"1. Everywhere: Applies gap fill to top, bottom and internal solid surfaces " -"for maximum strength\n" -"2. Top and Bottom surfaces: Applies gap fill to top and bottom surfaces " -"only, balancing print speed, reducing potential over extrusion in the solid " -"infill and making sure the top and bottom surfaces have no pinhole gaps\n" +"1. Everywhere: Applies gap fill to top, bottom and internal solid surfaces for maximum strength\n" +"2. Top and Bottom surfaces: Applies gap fill to top and bottom surfaces only, balancing print speed, reducing potential over extrusion in the solid infill and making sure the top and bottom surfaces have no pinhole gaps\n" "3. Nowhere: Disables gap fill for all solid infill areas\n" "\n" -"Note that if using the classic perimeter generator, gap fill may also be " -"generated between perimeters, if a full width line cannot fit between them. " -"That perimeter gap fill is not controlled by this setting.\n" +"Note that if using the classic perimeter generator, gap fill may also be generated between perimeters, if a full width line cannot fit between them. That perimeter gap fill is not controlled by this setting.\n" "\n" -"If you would like all gap fill, including the classic perimeter generated " -"one, removed, set the filter out tiny gaps value to a large number, like " -"999999.\n" +"If you would like all gap fill, including the classic perimeter generated one, removed, set the filter out tiny gaps value to a large number, like 999999.\n" "\n" -"However this is not advised, as gap fill between perimeters is contributing " -"to the model's strength. For models where excessive gap fill is generated " -"between perimeters, a better option would be to switch to the arachne wall " -"generator and use this option to control whether the cosmetic top and bottom " -"surface gap fill is generated." +"However this is not advised, as gap fill between perimeters is contributing to the model's strength. For models where excessive gap fill is generated between perimeters, a better option would be to switch to the arachne wall generator and use this option to control whether the cosmetic top and bottom surface gap fill is generated." msgstr "" -"เปิดใช้งานการเติมช่องว่างสำหรับพื้นผิวทึบที่เลือก " -"ความยาวช่องว่างขั้นต่ำที่จะถูกอุดสามารถควบคุมได้จากตัวเลือกกรองช่องว่างเล็กๆ ด้านล่าง\n" +"เปิดใช้งานการเติมช่องว่างสำหรับพื้นผิวทึบที่เลือก ความยาวช่องว่างขั้นต่ำที่จะถูกอุดสามารถควบคุมได้จากตัวเลือกกรองช่องว่างเล็กๆ ด้านล่าง\n" "\n" "ตัวเลือก:\n" "1. ทุกที่: ใช้การเติมช่องว่างกับพื้นผิวแข็งด้านบน ด้านล่าง และภายในเพื่อความแข็งแรงสูงสุด\n" -"2. พื้นผิวด้านบนและด้านล่าง: ใช้การเติมช่องว่างกับพื้นผิวด้านบนและด้านล่างเท่านั้น " -"ปรับสมดุลความเร็วการพิมพ์ ลดโอกาสเกิดการอัดขึ้นรูปมากเกินไปเมื่อเติมช่องว่างในพื้นที่ทึบ " -"และตรวจสอบให้แน่ใจว่าพื้นผิวด้านบนและด้านล่างไม่มีช่องว่างรูเข็ม\n" +"2. พื้นผิวด้านบนและด้านล่าง: ใช้การเติมช่องว่างกับพื้นผิวด้านบนและด้านล่างเท่านั้น ปรับสมดุลความเร็วการพิมพ์ ลดโอกาสเกิดการอัดขึ้นรูปมากเกินไปเมื่อเติมช่องว่างในพื้นที่ทึบ และตรวจสอบให้แน่ใจว่าพื้นผิวด้านบนและด้านล่างไม่มีช่องว่างรูเข็ม\n" "3. ไม่มีที่ไหนเลย: ปิดใช้งานการเติมช่องว่างสำหรับพื้นที่ทึบทั้งหมด\n" "\n" -"โปรดทราบว่าหากใช้เครื่องสร้างเส้นรอบวงแบบคลาสสิก " -"การเติมช่องว่างอาจถูกสร้างขึ้นระหว่างเส้นรอบวงด้วย " -"หากเส้นความกว้างเต็มไม่สามารถพอดีระหว่างเส้นรอบวงได้ " -"การเติมช่องว่างขอบเขตนั้นไม่ได้ถูกควบคุมโดยการตั้งค่านี้\n" +"โปรดทราบว่าหากใช้เครื่องสร้างเส้นรอบวงแบบคลาสสิก การเติมช่องว่างอาจถูกสร้างขึ้นระหว่างเส้นรอบวงด้วย หากเส้นความกว้างเต็มไม่สามารถพอดีระหว่างเส้นรอบวงได้ การเติมช่องว่างขอบเขตนั้นไม่ได้ถูกควบคุมโดยการตั้งค่านี้\n" "\n" -"หากคุณต้องการให้ลบการเติมช่องว่างทั้งหมด รวมถึงเส้นรอบวงแบบคลาสสิกที่สร้างไว้ " -"ให้ตั้งค่าตัวกรองออกค่าช่องว่างเล็กๆ ให้เป็นตัวเลขจำนวนมาก เช่น 999999\n" +"หากคุณต้องการให้ลบการเติมช่องว่างทั้งหมด รวมถึงเส้นรอบวงแบบคลาสสิกที่สร้างไว้ ให้ตั้งค่าตัวกรองออกค่าช่องว่างเล็กๆ ให้เป็นตัวเลขจำนวนมาก เช่น 999999\n" "\n" -"อย่างไรก็ตาม ไม่แนะนำให้ทำเช่นนี้ " -"เนื่องจากการเติมช่องว่างระหว่างเส้นรอบวงมีส่วนทำให้โมเดลมีความแข็งแกร่ง " -"สำหรับโมเดลที่มีการเติมช่องว่างมากเกินไประหว่างเส้นรอบวง " -"ตัวเลือกที่ดีกว่าคือเปลี่ยนไปใช้เครื่องสร้างผนังแบบ Arachne " -"และใช้ตัวเลือกนี้เพื่อควบคุมว่าจะสร้างการเติมช่องว่างบนพื้นผิวด้านบนและด้านล่างที่สวยงามหรือไม่" +"อย่างไรก็ตาม ไม่แนะนำให้ทำเช่นนี้ เนื่องจากการเติมช่องว่างระหว่างเส้นรอบวงมีส่วนทำให้โมเดลมีความแข็งแกร่ง สำหรับโมเดลที่มีการเติมช่องว่างมากเกินไประหว่างเส้นรอบวง ตัวเลือกที่ดีกว่าคือเปลี่ยนไปใช้เครื่องสร้างผนังแบบ Arachne และใช้ตัวเลือกนี้เพื่อควบคุมว่าจะสร้างการเติมช่องว่างบนพื้นผิวด้านบนและด้านล่างที่สวยงามหรือไม่" msgid "Everywhere" msgstr "ทุกที่" @@ -12641,52 +11270,27 @@ msgstr "ไม่มีที่ไหนเลย" msgid "Force cooling for overhangs and bridges" msgstr "บังคับการระบายความร้อนสำหรับส่วนยื่นและสะพาน" -msgid "" -"Enable this option to allow adjustment of the part cooling fan speed for " -"specifically for overhangs, internal and external bridges. Setting the fan " -"speed specifically for these features can improve overall print quality and " -"reduce warping." -msgstr "" -"เปิดใช้งานตัวเลือกนี้เพื่อให้สามารถปรับความเร็วพัดลมระบายความร้อนของชิ้นส่วนสำหรับส่วนยื่น " -"บริดจ์ภายในและภายนอกโดยเฉพาะ " -"การตั้งค่าความเร็วพัดลมสำหรับคุณสมบัติเหล่านี้โดยเฉพาะสามารถปรับปรุงคุณภาพการพิมพ์โดยรวมและลดการบิดเบี้ยวได้" +msgid "Enable this option to allow adjustment of the part cooling fan speed for specifically for overhangs, internal and external bridges. Setting the fan speed specifically for these features can improve overall print quality and reduce warping." +msgstr "เปิดใช้งานตัวเลือกนี้เพื่อให้สามารถปรับความเร็วพัดลมระบายความร้อนของชิ้นส่วนสำหรับส่วนยื่น บริดจ์ภายในและภายนอกโดยเฉพาะ การตั้งค่าความเร็วพัดลมสำหรับคุณสมบัติเหล่านี้โดยเฉพาะสามารถปรับปรุงคุณภาพการพิมพ์โดยรวมและลดการบิดเบี้ยวได้" msgid "Overhangs and external bridges fan speed" msgstr "ส่วนยื่นและความเร็วพัดลมของสะพานภายนอก" msgid "" -"Use this part cooling fan speed when printing bridges or overhang walls with " -"an overhang threshold that exceeds the value set in the 'Overhangs cooling " -"threshold' parameter above. Increasing the cooling specifically for " -"overhangs and bridges can improve the overall print quality of these " -"features.\n" +"Use this part cooling fan speed when printing bridges or overhang walls with an overhang threshold that exceeds the value set in the 'Overhangs cooling threshold' parameter above. Increasing the cooling specifically for overhangs and bridges can improve the overall print quality of these features.\n" "\n" -"Please note, this fan speed is clamped on the lower end by the minimum fan " -"speed threshold set above. It is also adjusted upwards up to the maximum fan " -"speed threshold when the minimum layer time threshold is not met." +"Please note, this fan speed is clamped on the lower end by the minimum fan speed threshold set above. It is also adjusted upwards up to the maximum fan speed threshold when the minimum layer time threshold is not met." msgstr "" -"ใช้ความเร็วพัดลมระบายความร้อนส่วนนี้เมื่อพิมพ์สะพานหรือผนังที่ยื่นออกมาโดยมีเกณฑ์ยื่นเกินค่าที่ตั้งไว้ในพารามิเตอร์ " -"'เกณฑ์การระบายความร้อนที่ยื่นเกิน' ด้านบน " -"การเพิ่มการระบายความร้อนโดยเฉพาะสำหรับส่วนยื่นและสะพานสามารถปรับปรุงคุณภาพการพิมพ์โดยรวมของคุณสมบัติเหล่านี้ได้\n" +"ใช้ความเร็วพัดลมระบายความร้อนส่วนนี้เมื่อพิมพ์สะพานหรือผนังที่ยื่นออกมาโดยมีเกณฑ์ยื่นเกินค่าที่ตั้งไว้ในพารามิเตอร์ 'เกณฑ์การระบายความร้อนที่ยื่นเกิน' ด้านบน การเพิ่มการระบายความร้อนโดยเฉพาะสำหรับส่วนยื่นและสะพานสามารถปรับปรุงคุณภาพการพิมพ์โดยรวมของคุณสมบัติเหล่านี้ได้\n" "\n" -"โปรดทราบว่าความเร็วพัดลมนี้จะถูกยึดที่ปลายล่างตามเกณฑ์ความเร็วพัดลมขั้นต่ำที่ตั้งไว้ด้านบน " -"นอกจากนี้ยังปรับขึ้นไปถึงขีดจำกัดความเร็วพัดลมสูงสุด เมื่อไม่ตรงตามเกณฑ์เวลาเลเยอร์ขั้นต่ำ" +"โปรดทราบว่าความเร็วพัดลมนี้จะถูกยึดที่ปลายล่างตามเกณฑ์ความเร็วพัดลมขั้นต่ำที่ตั้งไว้ด้านบน นอกจากนี้ยังปรับขึ้นไปถึงขีดจำกัดความเร็วพัดลมสูงสุด เมื่อไม่ตรงตามเกณฑ์เวลาเลเยอร์ขั้นต่ำ" msgid "Overhang cooling activation threshold" msgstr "เกณฑ์การเปิดใช้งานการทำความเย็นเกิน" #, no-c-format, no-boost-format -msgid "" -"When the overhang exceeds this specified threshold, force the cooling fan to " -"run at the 'Overhang Fan Speed' set below. This threshold is expressed as a " -"percentage, indicating the portion of each line's width that is unsupported " -"by the layer beneath it. Setting this value to 0% forces the cooling fan to " -"run for all outer walls, regardless of the overhang degree." -msgstr "" -"เมื่อโอเวอร์แฮงค์เกินเกณฑ์ที่ระบุ ให้บังคับพัดลมระบายความร้อนให้ทำงานที่ " -"'ความเร็วพัดลมโอเวอร์แฮง' ที่ตั้งไว้ด้านล่าง เกณฑ์นี้แสดงเป็นเปอร์เซ็นต์ " -"ซึ่งระบุส่วนของความกว้างของแต่ละบรรทัดที่เลเยอร์ด้านล่างไม่รองรับ การตั้งค่านี้เป็น 0% " -"จะบังคับให้พัดลมระบายความร้อนทำงานบนผนังด้านนอกทั้งหมด โดยไม่คำนึงถึงระดับของส่วนยื่น" +msgid "When the overhang exceeds this specified threshold, force the cooling fan to run at the 'Overhang Fan Speed' set below. This threshold is expressed as a percentage, indicating the portion of each line's width that is unsupported by the layer beneath it. Setting this value to 0% forces the cooling fan to run for all outer walls, regardless of the overhang degree." +msgstr "เมื่อโอเวอร์แฮงค์เกินเกณฑ์ที่ระบุ ให้บังคับพัดลมระบายความร้อนให้ทำงานที่ 'ความเร็วพัดลมโอเวอร์แฮง' ที่ตั้งไว้ด้านล่าง เกณฑ์นี้แสดงเป็นเปอร์เซ็นต์ ซึ่งระบุส่วนของความกว้างของแต่ละบรรทัดที่เลเยอร์ด้านล่างไม่รองรับ การตั้งค่านี้เป็น 0% จะบังคับให้พัดลมระบายความร้อนทำงานบนผนังด้านนอกทั้งหมด โดยไม่คำนึงถึงระดับของส่วนยื่น" msgid "External bridge infill direction" msgstr "ทิศทางไส้ในสะพานภายนอก" @@ -12694,14 +11298,11 @@ msgstr "ทิศทางไส้ในสะพานภายนอก" #, no-c-format, no-boost-format msgid "" "External Bridging angle override.\n" -"If left to zero, the bridging angle will be calculated automatically for " -"each specific bridge.\n" +"If left to zero, the bridging angle will be calculated automatically for each specific bridge.\n" "Otherwise the provided angle will be used according to:\n" " - The absolute coordinates\n" -" - The absolute coordinates + Model rotation: If Align infill direction to " -"model is enabled\n" -" - The optimal automatic angle + this value: If 'Relative Bridge Angle' is " -"enabled\n" +" - The absolute coordinates + Model rotation: If Align infill direction to model is enabled\n" +" - The optimal automatic angle + this value: If 'Relative Bridge Angle' is enabled\n" "\n" "Use 180° for zero absolute angle." msgstr "" @@ -12719,14 +11320,11 @@ msgstr "ทิศทางไส้ในสะพานภายใน" msgid "" "Internal Bridging angle override.\n" -"If left to zero, the bridging angle will be calculated automatically for " -"each specific bridge.\n" +"If left to zero, the bridging angle will be calculated automatically for each specific bridge.\n" "Otherwise the provided angle will be used according to:\n" " - The absolute coordinates\n" -" - The absolute coordinates + Model rotation: If Align infill direction to " -"model is enabled\n" -" - The optimal automatic angle + this value: If 'Relative Bridge Angle' is " -"enabled\n" +" - The absolute coordinates + Model rotation: If Align infill direction to model is enabled\n" +" - The optimal automatic angle + this value: If 'Relative Bridge Angle' is enabled\n" "\n" "Use 180° for zero absolute angle." msgstr "" @@ -12742,30 +11340,22 @@ msgstr "" msgid "Relative bridge angle" msgstr "มุมสะพานแบบสัมพันธ์" -msgid "" -"When enabled, the bridge angle values are added to the automatically " -"calculated bridge direction instead of overriding it." -msgstr "" -"เมื่อเปิดใช้งาน ค่ามุมสะพานจะถูกบวกเข้ากับทิศทางสะพานที่คำนวณอัตโนมัติ แทนที่จะแทนที่ค่าเดิม" +msgid "When enabled, the bridge angle values are added to the automatically calculated bridge direction instead of overriding it." +msgstr "เมื่อเปิดใช้งาน ค่ามุมสะพานจะถูกบวกเข้ากับทิศทางสะพานที่คำนวณอัตโนมัติ แทนที่จะแทนที่ค่าเดิม" msgid "External bridge density" msgstr "ความหนาแน่นของสะพานภายนอก" msgid "" "Controls the density (spacing) of external bridge lines.\n" -"Theoretically, 100% means a solid bridge, but due to the tendency of bridge " -"extrusions to sag, 100% may not be sufficient.\n" +"Theoretically, 100% means a solid bridge, but due to the tendency of bridge extrusions to sag, 100% may not be sufficient.\n" "\n" "- Higher than 100% density (Recommended Max 125%):\n" -" - Pros: Produces smoother bridge surfaces, as overlapping lines provide " -"additional support during printing.\n" -" - Cons: Can cause overextrusion, which may reduce lower and upper surface " -"quality and increase the risk of warping.\n" +" - Pros: Produces smoother bridge surfaces, as overlapping lines provide additional support during printing.\n" +" - Cons: Can cause overextrusion, which may reduce lower and upper surface quality and increase the risk of warping.\n" "\n" "- Lower than 100% density (Min 10%):\n" -" - Pros: Can create a string-like first layer. Faster and with better " -"cooling because there is more space for air to circulate around the extruded " -"bridge.\n" +" - Pros: Can create a string-like first layer. Faster and with better cooling because there is more space for air to circulate around the extruded bridge.\n" " - Cons: May lead to sagging and poorer surface finish." msgstr "" "ควบคุมความหนาแน่น (ระยะห่าง) ของเส้นสะพานด้านนอก\n" @@ -12773,12 +11363,10 @@ msgstr "" "\n" "- ความหนาแน่นมากกว่า 100% (แนะนำสูงสุด 125%):\n" " - ข้อดี: ผิวสะพานเรียบขึ้น เพราะเส้นที่ทับซ้อนกันให้การรองรับเพิ่มเติมระหว่างพิมพ์\n" -" - ข้อเสีย: อาจเกิดการดันเส้นเกิน ซึ่งลดคุณภาพผิวด้านล่างและด้านบน " -"และเพิ่มความเสี่ยงการบิดเบี้ยว\n" +" - ข้อเสีย: อาจเกิดการดันเส้นเกิน ซึ่งลดคุณภาพผิวด้านล่างและด้านบน และเพิ่มความเสี่ยงการบิดเบี้ยว\n" "\n" "- ความหนาแน่นต่ำกว่า 100% (ต่ำสุด 10%):\n" -" - ข้อดี: ชั้นแรกอาจเป็นเส้นแบบเส้นใย " -"พิมพ์เร็วขึ้นและระบายความร้อนดีขึ้นเพราะมีพื้นที่ให้อากาศหมุนเวียนรอบเส้นสะพาน\n" +" - ข้อดี: ชั้นแรกอาจเป็นเส้นแบบเส้นใย พิมพ์เร็วขึ้นและระบายความร้อนดีขึ้นเพราะมีพื้นที่ให้อากาศหมุนเวียนรอบเส้นสะพาน\n" " - ข้อเสีย: อาจย้อยตัวและผิวไม่เรียบ" msgid "Internal bridge density" @@ -12786,66 +11374,49 @@ msgstr "ความหนาแน่นสะพานภายใน" msgid "" "Controls the density (spacing) of internal bridge lines.\n" -"Internal bridges act as intermediate support between sparse infill and top " -"solid infill and can strongly affect top surface quality.\n" +"Internal bridges act as intermediate support between sparse infill and top solid infill and can strongly affect top surface quality.\n" "\n" "- Higher than 100% density (Recommended Max 125%):\n" -" - Pros: Improves internal bridge strength and support under top layers, " -"reducing sagging and improving top-surface finish.\n" -" - Cons: Increases material use and print time; excessive density may cause " -"overextrusion and internal stresses.\n" +" - Pros: Improves internal bridge strength and support under top layers, reducing sagging and improving top-surface finish.\n" +" - Cons: Increases material use and print time; excessive density may cause overextrusion and internal stresses.\n" "\n" "- Lower than 100% density (Min 10%):\n" -" - Pros: Can reduce pillowing and improve cooling (more airflow through the " -"bridge), and may speed up printing.\n" -" - Cons: May reduce internal support, increasing the risk of sagging and " -"top surface defects.\n" +" - Pros: Can reduce pillowing and improve cooling (more airflow through the bridge), and may speed up printing.\n" +" - Cons: May reduce internal support, increasing the risk of sagging and top surface defects.\n" "\n" -"This option works particularly well when combined with the second internal " -"bridge over infill option to improve bridging further before solid infill is " -"extruded." +"This option works particularly well when combined with the second internal bridge over infill option to improve bridging further before solid infill is extruded." msgstr "" "ควบคุมความหนาแน่น (ระยะห่าง) ของเส้นสะพานด้านใน\n" -"สะพานด้านในทำหน้าที่เป็นส่วนรองรับชั่วคราวระหว่างไส้ในแบบโปร่งกับไส้ในแบบทึบด้านบน " -"และส่งผลต่อคุณภาพผิวด้านบนอย่างมาก\n" +"สะพานด้านในทำหน้าที่เป็นส่วนรองรับชั่วคราวระหว่างไส้ในแบบโปร่งกับไส้ในแบบทึบด้านบน และส่งผลต่อคุณภาพผิวด้านบนอย่างมาก\n" "\n" "- ความหนาแน่นมากกว่า 100% (แนะนำสูงสุด 125%):\n" -" - ข้อดี: เพิ่มความแข็งแรงของสะพานด้านในและการรองรับใต้ชั้นบน " -"ลดการย้อยตัวและปรับปรุงผิวด้านบน\n" -" - ข้อเสีย: ใช้วัสดุและเวลาพิมพ์มากขึ้น " -"ความหนาแน่นเกินไปอาจทำให้ดันเส้นเกินและเกิดความเครียดภายใน\n" +" - ข้อดี: เพิ่มความแข็งแรงของสะพานด้านในและการรองรับใต้ชั้นบน ลดการย้อยตัวและปรับปรุงผิวด้านบน\n" +" - ข้อเสีย: ใช้วัสดุและเวลาพิมพ์มากขึ้น ความหนาแน่นเกินไปอาจทำให้ดันเส้นเกินและเกิดความเครียดภายใน\n" "\n" "- ความหนาแน่นต่ำกว่า 100% (ต่ำสุด 10%):\n" -" - ข้อดี: ลดการโป่งของผิวด้านบนและระบายความร้อนดีขึ้น (อากาศไหลผ่านสะพานได้มากขึ้น) " -"และอาจพิมพ์เร็วขึ้น\n" +" - ข้อดี: ลดการโป่งของผิวด้านบนและระบายความร้อนดีขึ้น (อากาศไหลผ่านสะพานได้มากขึ้น) และอาจพิมพ์เร็วขึ้น\n" " - ข้อเสีย: ลดการรองรับภายใน เพิ่มความเสี่ยงการย้อยตัวและข้อบกพร่องบนผิวด้านบน\n" "\n" -"ตัวเลือกนี้ทำงานได้ดีเป็นพิเศษเมื่อใช้ร่วมกับตัวเลือกสะพานด้านในชั้นที่สองเหนือไส้ใน " -"เพื่อปรับปรุงการพิมพ์สะพานก่อนอัดไส้ในแบบทึบ" +"ตัวเลือกนี้ทำงานได้ดีเป็นพิเศษเมื่อใช้ร่วมกับตัวเลือกสะพานด้านในชั้นที่สองเหนือไส้ใน เพื่อปรับปรุงการพิมพ์สะพานก่อนอัดไส้ในแบบทึบ" msgid "Bridge flow ratio" msgstr "อัตราส่วนการไหลสะพาน" msgid "" "This value governs the thickness of the external (visible) bridge layer.\n" -"Values above 1.0: Increase the amount of material while maintaining line " -"spacing. This can improve line contact and strength.\n" -"Values below 1.0: Reduce the amount of material while adjusting line spacing " -"to maintain contact. This can improve sagging.\n" +"Values above 1.0: Increase the amount of material while maintaining line spacing. This can improve line contact and strength.\n" +"Values below 1.0: Reduce the amount of material while adjusting line spacing to maintain contact. This can improve sagging.\n" "\n" -"The actual bridge flow used is calculated by multiplying this value with the " -"filament flow ratio, and if set, the object's flow ratio." +"The actual bridge flow used is calculated by multiplying this value with the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ค่านี้กำหนดความหนาของชั้นสะพานด้านนอก (ที่มองเห็นได้)\n" "ค่ามากกว่า 1.0: เพิ่มปริมาณวัสดุโดยคงระยะห่างเส้น ช่วยเพิ่มการสัมผัสและความแข็งแรงของเส้น\n" "ค่าน้อยกว่า 1.0: ลดปริมาณวัสดุโดยปรับระยะห่างเส้นเพื่อคงการสัมผัส ช่วยลดการย้อยตัว\n" "\n" -"อัตราการไหลของสะพานจริงคำนวณจากค่านี้คูณอัตราการไหลของเส้นพลาสติก และหากตั้งค่าไว้ " -"อัตราการไหลของวัตถุ" +"อัตราการไหลของสะพานจริงคำนวณจากค่านี้คูณอัตราการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "" -"Line width of the Bridge. If expressed as a %, it will be computed over the " -"nozzle diameter.\n" +"Line width of the Bridge. If expressed as a %, it will be computed over the nozzle diameter.\n" "Recommended to use with a higher Bridge density or Bridge flow ratio.\n" "\n" "The maximum value is 100% or the nozzle diameter.\n" @@ -12861,39 +11432,29 @@ msgid "Internal bridge flow ratio" msgstr "อัตราส่วนการไหลสะพานภายใน" msgid "" -"This value governs the thickness of the internal bridge layer. This is the " -"first layer over sparse infill so increasing it may increase strength and " -"upper layer quality.\n" -"Values above 1.0: Increase the amount of material while maintaining line " -"spacing. This can improve line contact and strength.\n" -"Values below 1.0: Reduce the amount of material while adjusting line spacing " -"to maintain contact. This can improve sagging.\n" +"This value governs the thickness of the internal bridge layer. This is the first layer over sparse infill so increasing it may increase strength and upper layer quality.\n" +"Values above 1.0: Increase the amount of material while maintaining line spacing. This can improve line contact and strength.\n" +"Values below 1.0: Reduce the amount of material while adjusting line spacing to maintain contact. This can improve sagging.\n" "\n" -"The actual bridge flow used is calculated by multiplying this value with the " -"filament flow ratio, and if set, the object's flow ratio." +"The actual bridge flow used is calculated by multiplying this value with the filament flow ratio, and if set, the object's flow ratio." msgstr "" -"ค่านี้กำหนดความหนาของชั้นสะพานด้านใน ซึ่งเป็นชั้นแรกเหนือไส้ในแบบโปร่ง " -"การเพิ่มค่าอาจเพิ่มความแข็งแรงและคุณภาพชั้นบน\n" +"ค่านี้กำหนดความหนาของชั้นสะพานด้านใน ซึ่งเป็นชั้นแรกเหนือไส้ในแบบโปร่ง การเพิ่มค่าอาจเพิ่มความแข็งแรงและคุณภาพชั้นบน\n" "ค่ามากกว่า 1.0: เพิ่มปริมาณวัสดุโดยคงระยะห่างเส้น ช่วยเพิ่มการสัมผัสและความแข็งแรงของเส้น\n" "ค่าน้อยกว่า 1.0: ลดปริมาณวัสดุโดยปรับระยะห่างเส้นเพื่อคงการสัมผัส ช่วยลดการย้อยตัว\n" "\n" -"อัตราการไหลของสะพานจริงคำนวณจากค่านี้คูณอัตราการไหลของเส้นพลาสติก และหากตั้งค่าไว้ " -"อัตราการไหลของวัตถุ" +"อัตราการไหลของสะพานจริงคำนวณจากค่านี้คูณอัตราการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Top surface flow ratio" msgstr "อัตราส่วนการไหลผิวด้านบน" msgid "" -"This factor affects the amount of material for top solid infill. You can " -"decrease it slightly to have smooth surface finish.\n" +"This factor affects the amount of material for top solid infill. You can decrease it slightly to have smooth surface finish.\n" "\n" -"The actual top surface flow used is calculated by multiplying this value " -"with the filament flow ratio, and if set, the object's flow ratio." +"The actual top surface flow used is calculated by multiplying this value with the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุสำหรับไส้ในของแข็งด้านบน คุณสามารถลดลงเล็กน้อยเพื่อให้พื้นผิวเรียบ\n" "\n" -"การไหลของพื้นผิวด้านบนจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก " -"และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" +"การไหลของพื้นผิวด้านบนจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Bottom surface flow ratio" msgstr "อัตราส่วนการไหลผิวด้านล่าง" @@ -12901,13 +11462,11 @@ msgstr "อัตราส่วนการไหลผิวด้านล่ msgid "" "This factor affects the amount of material for bottom solid infill.\n" "\n" -"The actual bottom solid infill flow used is calculated by multiplying this " -"value with the filament flow ratio, and if set, the object's flow ratio." +"The actual bottom solid infill flow used is calculated by multiplying this value with the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุสำหรับไส้ในของแข็งด้านล่าง\n" "\n" -"การไหล ไส้ใน ของแข็งด้านล่างจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก " -"และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" +"การไหล ไส้ใน ของแข็งด้านล่างจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Set other flow ratios" msgstr "ตั้งค่าอัตราส่วนการไหลอื่นๆ" @@ -12919,16 +11478,13 @@ msgid "First layer flow ratio" msgstr "อัตราการไหลของชั้นแรก" msgid "" -"This factor affects the amount of material on the first layer for the " -"extrusion path roles listed in this section.\n" +"This factor affects the amount of material on the first layer for the extrusion path roles listed in this section.\n" "\n" -"For the first layer, the actual flow ratio for each path role (does not " -"affect brims and skirts) will be multiplied by this value." +"For the first layer, the actual flow ratio for each path role (does not affect brims and skirts) will be multiplied by this value." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุในชั้นแรกสำหรับบทบาทเส้นทางการอัดขึ้นรูปที่แสดงอยู่ในส่วนนี้\n" "\n" -"สำหรับชั้นแรก อัตราการไหลตามจริงสำหรับแต่ละบทบาทของเส้นทาง " -"(ไม่ส่งผลต่อขอบยึดชิ้นงานและเส้นล้อมชิ้นงาน) จะถูกคูณด้วยค่านี้" +"สำหรับชั้นแรก อัตราการไหลตามจริงสำหรับแต่ละบทบาทของเส้นทาง (ไม่ส่งผลต่อขอบยึดชิ้นงานและเส้นล้อมชิ้นงาน) จะถูกคูณด้วยค่านี้" msgid "Outer wall flow ratio" msgstr "อัตราส่วนการไหลของผนังด้านนอก" @@ -12936,13 +11492,11 @@ msgstr "อัตราส่วนการไหลของผนังด้ msgid "" "This factor affects the amount of material for outer walls.\n" "\n" -"The actual outer wall flow used is calculated by multiplying this value by " -"the filament flow ratio, and if set, the object's flow ratio." +"The actual outer wall flow used is calculated by multiplying this value by the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุสำหรับผนังด้านนอก\n" "\n" -"การไหลของผนังด้านนอกจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก " -"และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" +"การไหลของผนังด้านนอกจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Inner wall flow ratio" msgstr "อัตราส่วนการไหลของผนังด้านใน" @@ -12950,13 +11504,11 @@ msgstr "อัตราส่วนการไหลของผนังด้ msgid "" "This factor affects the amount of material for inner walls.\n" "\n" -"The actual inner wall flow used is calculated by multiplying this value by " -"the filament flow ratio, and if set, the object's flow ratio." +"The actual inner wall flow used is calculated by multiplying this value by the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุสำหรับผนังด้านใน\n" "\n" -"การไหลของผนังด้านในจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก " -"และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" +"การไหลของผนังด้านในจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Overhang flow ratio" msgstr "อัตราส่วนการไหลของส่วนยื่น" @@ -12964,13 +11516,11 @@ msgstr "อัตราส่วนการไหลของส่วนยื msgid "" "This factor affects the amount of material for overhangs.\n" "\n" -"The actual overhang flow used is calculated by multiplying this value by the " -"filament flow ratio, and if set, the object's flow ratio." +"The actual overhang flow used is calculated by multiplying this value by the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุสำหรับยื่น\n" "\n" -"การไหลยื่นออกมาจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ " -"อัตราการไหลของวัตถุ" +"การไหลยื่นออกมาจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Sparse infill flow ratio" msgstr "อัตราส่วนการไหลไส้ในแบบโปร่ง" @@ -12978,13 +11528,11 @@ msgstr "อัตราส่วนการไหลไส้ในแบบโ msgid "" "This factor affects the amount of material for sparse infill.\n" "\n" -"The actual sparse infill flow used is calculated by multiplying this value " -"by the filament flow ratio, and if set, the object's flow ratio." +"The actual sparse infill flow used is calculated by multiplying this value by the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุสำหรับไส้ในแบบโปร่ง\n" "\n" -"การไหล ไส้ใน แบบเบาบางจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก " -"และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" +"การไหล ไส้ใน แบบเบาบางจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Internal solid infill flow ratio" msgstr "อัตราส่วนการไหลไส้ในแบบทึบ" @@ -12992,13 +11540,11 @@ msgstr "อัตราส่วนการไหลไส้ในแบบท msgid "" "This factor affects the amount of material for internal solid infill.\n" "\n" -"The actual internal solid infill flow used is calculated by multiplying this " -"value by the filament flow ratio, and if set, the object's flow ratio." +"The actual internal solid infill flow used is calculated by multiplying this value by the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุสำหรับไส้ในของแข็งภายใน\n" "\n" -"การไหล ไส้ใน ของแข็งภายในจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก " -"และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" +"การไหล ไส้ใน ของแข็งภายในจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Gap fill flow ratio" msgstr "อัตราส่วนการไหลเติมช่องว่าง" @@ -13006,13 +11552,11 @@ msgstr "อัตราส่วนการไหลเติมช่องว msgid "" "This factor affects the amount of material for filling the gaps.\n" "\n" -"The actual gap filling flow used is calculated by multiplying this value by " -"the filament flow ratio, and if set, the object's flow ratio." +"The actual gap filling flow used is calculated by multiplying this value by the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุในการเติมช่องว่าง\n" "\n" -"อัตราการเติมช่องว่างจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก " -"และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" +"อัตราการเติมช่องว่างจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Support flow ratio" msgstr "อัตราส่วนการไหลส่วนรองรับ" @@ -13020,13 +11564,11 @@ msgstr "อัตราส่วนการไหลส่วนรองรั msgid "" "This factor affects the amount of material for support.\n" "\n" -"The actual support flow used is calculated by multiplying this value by the " -"filament flow ratio, and if set, the object's flow ratio." +"The actual support flow used is calculated by multiplying this value by the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุที่รองรับ\n" "\n" -"กระแสรองรับจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ " -"อัตราการไหลของวัตถุ" +"กระแสรองรับจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Support interface flow ratio" msgstr "อัตราส่วนการไหลผิวสัมผัสส่วนรองรับ" @@ -13034,32 +11576,22 @@ msgstr "อัตราส่วนการไหลผิวสัมผัส msgid "" "This factor affects the amount of material for the support interface.\n" "\n" -"The actual support interface flow used is calculated by multiplying this " -"value by the filament flow ratio, and if set, the object's flow ratio." +"The actual support interface flow used is calculated by multiplying this value by the filament flow ratio, and if set, the object's flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุสำหรับอินเทอร์เฟซส่วนรองรับ\n" "\n" -"โฟลว์อินเทอร์เฟซส่วนรองรับจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก " -"และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" +"โฟลว์อินเทอร์เฟซส่วนรองรับจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" msgid "Precise wall" msgstr "ผนังที่แม่นยำ" -msgid "" -"Improve shell precision by adjusting outer wall spacing. This also improves " -"layer consistency. NOTE: This option will be ignored for outer-inner or " -"inner-outer-inner wall sequences." -msgstr "" -"ปรับปรุงความแม่นยำของเปลือกโดยการปรับระยะห่างผนังด้านนอก " -"นอกจากนี้ยังช่วยปรับปรุงความสม่ำเสมอของชั้นอีกด้วย หมายเหตุ: " -"ตัวเลือกนี้จะถูกละเว้นสำหรับลำดับผนังด้านนอก-ด้านใน หรือด้านใน-ด้านนอก-ด้านใน" +msgid "Improve shell precision by adjusting outer wall spacing. This also improves layer consistency. NOTE: This option will be ignored for outer-inner or inner-outer-inner wall sequences." +msgstr "ปรับปรุงความแม่นยำของเปลือกโดยการปรับระยะห่างผนังด้านนอก นอกจากนี้ยังช่วยปรับปรุงความสม่ำเสมอของชั้นอีกด้วย หมายเหตุ: ตัวเลือกนี้จะถูกละเว้นสำหรับลำดับผนังด้านนอก-ด้านใน หรือด้านใน-ด้านนอก-ด้านใน" msgid "Only one wall on top surfaces" msgstr "มีเพียงผนังเดียวบนพื้นผิวด้านบน" -msgid "" -"Use only one wall on flat top surfaces, to give more space to the top infill " -"pattern." +msgid "Use only one wall on flat top surfaces, to give more space to the top infill pattern." msgstr "ใช้ผนังเพียงด้านเดียวบนพื้นผิวเรียบเพื่อเพิ่มพื้นที่ให้กับรูปแบบไส้ในด้านบน" msgid "One wall threshold" @@ -13067,36 +11599,22 @@ msgstr "เกณฑ์ผนังด้านหนึ่ง" #, no-c-format, no-boost-format msgid "" -"If a top surface has to be printed and it's partially covered by another " -"layer, it won't be considered at a top layer where its width is below this " -"value. This can be useful to not let the 'one perimeter on top' trigger on " -"surface that should be covered only by perimeters. This value can be a mm or " -"a % of the perimeter extrusion width.\n" -"Warning: If enabled, artifacts can be created if you have some thin features " -"on the next layer, like letters. Set this setting to 0 to remove these " -"artifacts." +"If a top surface has to be printed and it's partially covered by another layer, it won't be considered at a top layer where its width is below this value. This can be useful to not let the 'one perimeter on top' trigger on surface that should be covered only by perimeters. This value can be a mm or a % of the perimeter extrusion width.\n" +"Warning: If enabled, artifacts can be created if you have some thin features on the next layer, like letters. Set this setting to 0 to remove these artifacts." msgstr "" -"หากต้องพิมพ์พื้นผิวด้านบนและปิดบางส่วนด้วยชั้นอื่น " -"จะไม่ได้รับการพิจารณาที่ชั้นบนสุดซึ่งมีความกว้างต่ำกว่าค่านี้ วิธีนี้จะเป็นประโยชน์ในการไม่ปล่อยให้ " -"'เส้นรอบวงด้านบนหนึ่งเส้น' ทริกเกอร์บนพื้นผิวที่ควรครอบคลุมเฉพาะเส้นรอบวงเท่านั้น " -"ค่านี้อาจเป็นหน่วย มม. หรือ % ของความกว้างของการอัดขึ้นรูปเส้นรอบวง\n" -"คำเตือน: หากเปิดใช้งาน สามารถสร้างสิ่งประดิษฐ์ได้หากคุณมีคุณสมบัติบางๆ ในเลเยอร์ถัดไป เช่น " -"ตัวอักษร ตั้งค่านี้เป็น 0 เพื่อลบสิ่งประดิษฐ์เหล่านี้" +"หากต้องพิมพ์พื้นผิวด้านบนและปิดบางส่วนด้วยชั้นอื่น จะไม่ได้รับการพิจารณาที่ชั้นบนสุดซึ่งมีความกว้างต่ำกว่าค่านี้ วิธีนี้จะเป็นประโยชน์ในการไม่ปล่อยให้ 'เส้นรอบวงด้านบนหนึ่งเส้น' ทริกเกอร์บนพื้นผิวที่ควรครอบคลุมเฉพาะเส้นรอบวงเท่านั้น ค่านี้อาจเป็นหน่วย มม. หรือ % ของความกว้างของการอัดขึ้นรูปเส้นรอบวง\n" +"คำเตือน: หากเปิดใช้งาน สามารถสร้างสิ่งประดิษฐ์ได้หากคุณมีคุณสมบัติบางๆ ในเลเยอร์ถัดไป เช่น ตัวอักษร ตั้งค่านี้เป็น 0 เพื่อลบสิ่งประดิษฐ์เหล่านี้" msgid "Only one wall on first layer" msgstr "มีเพียงผนังเดียวในชั้นแรก" -msgid "" -"Use only one wall on first layer, to give more space to the bottom infill " -"pattern." +msgid "Use only one wall on first layer, to give more space to the bottom infill pattern." msgstr "ใช้ผนังเพียงชั้นเดียวในชั้นแรก เพื่อให้มีพื้นที่ด้านล่างมากขึ้น" msgid "Extra perimeters on overhangs" msgstr "เส้นรอบวงเพิ่มเติมบนส่วนยื่น" -msgid "" -"Create additional perimeter paths over steep overhangs and areas where " -"bridges cannot be anchored." +msgid "Create additional perimeter paths over steep overhangs and areas where bridges cannot be anchored." msgstr "สร้างเส้นทางเส้นรอบวงเพิ่มเติมเหนือส่วนยื่นชันและพื้นที่ที่ไม่สามารถยึดสะพานได้" msgid "Reverse on even" @@ -13106,15 +11624,11 @@ msgid "Overhang reversal" msgstr "การกลับด้านส่วนยื่นออกมา" msgid "" -"Extrude perimeters that have a part over an overhang in the reverse " -"direction on even layers. This alternating pattern can drastically improve " -"steep overhangs.\n" +"Extrude perimeters that have a part over an overhang in the reverse direction on even layers. This alternating pattern can drastically improve steep overhangs.\n" "\n" -"This setting can also help reduce part warping due to the reduction of " -"stresses in the part walls." +"This setting can also help reduce part warping due to the reduction of stresses in the part walls." msgstr "" -"รีดเส้นรอบวงที่มีส่วนยื่นออกมาในทิศทางย้อนกลับบนชั้นคู่ " -"รูปแบบการสลับนี้สามารถปรับปรุงระยะยื่นที่สูงชันได้อย่างมาก\n" +"รีดเส้นรอบวงที่มีส่วนยื่นออกมาในทิศทางย้อนกลับบนชั้นคู่ รูปแบบการสลับนี้สามารถปรับปรุงระยะยื่นที่สูงชันได้อย่างมาก\n" "\n" "การตั้งค่านี้ยังช่วยลดการบิดงอของชิ้นส่วนเนื่องจากการลดความเค้นในผนังชิ้นส่วนอีกด้วย" @@ -13124,40 +11638,26 @@ msgstr "กลับด้านเฉพาะขอบเขตภายใน msgid "" "Apply the reverse perimeters logic only on internal perimeters.\n" "\n" -"This setting greatly reduces part stresses as they are now distributed in " -"alternating directions. This should reduce part warping while also " -"maintaining external wall quality. This feature can be very useful for warp " -"prone material, like ABS/ASA, and also for elastic filaments, like TPU and " -"Silk PLA. It can also help reduce warping on floating regions over " -"supports.\n" +"This setting greatly reduces part stresses as they are now distributed in alternating directions. This should reduce part warping while also maintaining external wall quality. This feature can be very useful for warp prone material, like ABS/ASA, and also for elastic filaments, like TPU and Silk PLA. It can also help reduce warping on floating regions over supports.\n" "\n" -"For this setting to be the most effective, it is recommended to set the " -"Reverse Threshold to 0 so that all internal walls print in alternating " -"directions on even layers irrespective of their overhang degree." +"For this setting to be the most effective, it is recommended to set the Reverse Threshold to 0 so that all internal walls print in alternating directions on even layers irrespective of their overhang degree." msgstr "" "ใช้ตรรกะเส้นรอบวงย้อนกลับเฉพาะกับเส้นรอบวงภายในเท่านั้น\n" "\n" -"การตั้งค่านี้ช่วยลดความเค้นของชิ้นส่วนได้อย่างมาก เนื่องจากมีการกระจายไปในทิศทางสลับกัน " -"สิ่งนี้จะลดการบิดเบี้ยวของชิ้นส่วนในขณะที่ยังคงรักษาคุณภาพของผนังภายนอกไว้ด้วย " -"คุณลักษณะนี้มีประโยชน์มากสำหรับวัสดุที่บิดงอง่าย เช่น ABS/ASA และสำหรับเส้นพลาสติกยืดหยุ่น เช่น " -"TPU และ Silk PLA " -"นอกจากนี้ยังสามารถช่วยลดการบิดเบี้ยวในบริเวณที่ลอยอยู่เหนือส่วนรองรับได้อีกด้วย\n" +"การตั้งค่านี้ช่วยลดความเค้นของชิ้นส่วนได้อย่างมาก เนื่องจากมีการกระจายไปในทิศทางสลับกัน สิ่งนี้จะลดการบิดเบี้ยวของชิ้นส่วนในขณะที่ยังคงรักษาคุณภาพของผนังภายนอกไว้ด้วย คุณลักษณะนี้มีประโยชน์มากสำหรับวัสดุที่บิดงอง่าย เช่น ABS/ASA และสำหรับเส้นพลาสติกยืดหยุ่น เช่น TPU และ Silk PLA นอกจากนี้ยังสามารถช่วยลดการบิดเบี้ยวในบริเวณที่ลอยอยู่เหนือส่วนรองรับได้อีกด้วย\n" "\n" -"เพื่อให้การตั้งค่านี้มีประสิทธิภาพสูงสุด ขอแนะนำให้ตั้งค่า Reverse Threshold เป็น 0 " -"เพื่อให้ผนังภายในทั้งหมดพิมพ์ในทิศทางสลับกันบนเลเยอร์คู่ โดยไม่คำนึงถึงระดับส่วนยื่น" +"เพื่อให้การตั้งค่านี้มีประสิทธิภาพสูงสุด ขอแนะนำให้ตั้งค่า Reverse Threshold เป็น 0 เพื่อให้ผนังภายในทั้งหมดพิมพ์ในทิศทางสลับกันบนเลเยอร์คู่ โดยไม่คำนึงถึงระดับส่วนยื่น" msgid "Bridge counterbore holes" msgstr "สะพานหลุมเจาะ" msgid "" -"This option creates bridges for counterbore holes, allowing them to be " -"printed without support. Available modes include:\n" +"This option creates bridges for counterbore holes, allowing them to be printed without support. Available modes include:\n" "1. None: No bridge is created\n" "2. Partially Bridged: Only a part of the unsupported area will be bridged\n" "3. Sacrificial Layer: A full sacrificial bridge layer is created" msgstr "" -"ตัวเลือกนี้จะสร้างสะพานเชื่อมสำหรับรูเจาะเคาน์เตอร์ ทำให้สามารถพิมพ์ได้โดยไม่ต้องมีส่วนรองรับ " -"โหมดที่ใช้ได้ ได้แก่ :\n" +"ตัวเลือกนี้จะสร้างสะพานเชื่อมสำหรับรูเจาะเคาน์เตอร์ ทำให้สามารถพิมพ์ได้โดยไม่ต้องมีส่วนรองรับ โหมดที่ใช้ได้ ได้แก่ :\n" "1. ไม่มี: ไม่มีการสร้างสะพาน\n" "2. เชื่อมโยงบางส่วน: เฉพาะส่วนหนึ่งของพื้นที่ที่ไม่ได้รับส่วนรองรับเท่านั้นที่จะถูกเชื่อมโยง\n" "3. Sacrificial Layer: ชั้นสะพานบูชายัญเต็มรูปแบบจะถูกสร้างขึ้น" @@ -13176,83 +11676,53 @@ msgstr "เกณฑ์การกลับรายการส่วนเก #, no-c-format, no-boost-format msgid "" -"Number of mm the overhang need to be for the reversal to be considered " -"useful. Can be a % of the perimeter width.\n" +"Number of mm the overhang need to be for the reversal to be considered useful. Can be a % of the perimeter width.\n" "Value 0 enables reversal on every even layers regardless.\n" -"When Detect overhang wall is not enabled, this option is ignored and " -"reversal happens on every even layers regardless." +"When Detect overhang wall is not enabled, this option is ignored and reversal happens on every even layers regardless." msgstr "" -"ระยะยื่นต้องมีจำนวน มม. เพื่อให้การกลับรายการถือว่ามีประโยชน์ อาจเป็น % " -"ของความกว้างเส้นรอบวงได้\n" +"ระยะยื่นต้องมีจำนวน มม. เพื่อให้การกลับรายการถือว่ามีประโยชน์ อาจเป็น % ของความกว้างเส้นรอบวงได้\n" "ค่า 0 เปิดใช้งานการกลับรายการในทุกเลเยอร์คู่โดยไม่คำนึงถึง\n" -"เมื่อไม่ได้เปิดใช้งาน Detect ส่วนยื่น wall " -"ตัวเลือกนี้จะถูกละเว้นและการกลับรายการจะเกิดขึ้นในทุกเลเยอร์คู่โดยไม่คำนึงถึง" +"เมื่อไม่ได้เปิดใช้งาน Detect ส่วนยื่น wall ตัวเลือกนี้จะถูกละเว้นและการกลับรายการจะเกิดขึ้นในทุกเลเยอร์คู่โดยไม่คำนึงถึง" msgid "Slow down for overhangs" msgstr "ลดความเร็วสำหรับส่วนยื่น" -msgid "" -"Enable this option to slow down when printing overhangs. The speeds for " -"different overhang percentages are set below." -msgstr "" -"เปิดตัวเลือกนี้เพื่อลดความเร็วเมื่อพิมพ์ส่วนยื่น โดยกำหนดความเร็วตามเปอร์เซ็นต์ส่วนยื่นได้ด้านล่าง" +msgid "Enable this option to slow down when printing overhangs. The speeds for different overhang percentages are set below." +msgstr "เปิดตัวเลือกนี้เพื่อลดความเร็วเมื่อพิมพ์ส่วนยื่น โดยกำหนดความเร็วตามเปอร์เซ็นต์ส่วนยื่นได้ด้านล่าง" msgid "Slow down for curled perimeters" msgstr "ชะลอความเร็วลงสำหรับขอบเขตที่โค้งงอ" #, no-c-format, no-boost-format msgid "" -"Enable this option to slow down printing in areas where perimeters may have " -"curled upwards.\n" -"For example, additional slowdown will be applied when printing overhangs on " -"sharp corners like the front of the Benchy hull, reducing curling which " -"compounds over multiple layers.\n" +"Enable this option to slow down printing in areas where perimeters may have curled upwards.\n" +"For example, additional slowdown will be applied when printing overhangs on sharp corners like the front of the Benchy hull, reducing curling which compounds over multiple layers.\n" "\n" -"It is generally recommended to have this option switched on unless your " -"printer cooling is powerful enough or the print speed is slow enough that " -"perimeter curling does not happen. \n" -"If printing with a high external perimeter speed, this parameter may " -"introduce wall artifacts when slowing down, due to the potentially large " -"variance in print speeds causing the extruder to be unable to keep up with " -"the requested flow change.\n" -"Root cause of these artifacts is most likely PA tuning being slightly off, " -"especially when combined with a high PA smooth time.\n" +"It is generally recommended to have this option switched on unless your printer cooling is powerful enough or the print speed is slow enough that perimeter curling does not happen. \n" +"If printing with a high external perimeter speed, this parameter may introduce wall artifacts when slowing down, due to the potentially large variance in print speeds causing the extruder to be unable to keep up with the requested flow change.\n" +"Root cause of these artifacts is most likely PA tuning being slightly off, especially when combined with a high PA smooth time.\n" "\n" "Recommendations when enabling this option:\n" -"1. Reduce Pressure Advance smooth time to 0.015 - 0.02 so the extruder " -"reacts quickly to the speed changes.\n" -"2. Increase the minimum print speeds to limit the magnitude of the slowdown " -"and reduce the variance between fast and slow segments.\n" -"3. If artifacts still appear, enable Extrusion Rate Smoothing (ERS) to " -"further smooth the flow transitions.\n" +"1. Reduce Pressure Advance smooth time to 0.015 - 0.02 so the extruder reacts quickly to the speed changes.\n" +"2. Increase the minimum print speeds to limit the magnitude of the slowdown and reduce the variance between fast and slow segments.\n" +"3. If artifacts still appear, enable Extrusion Rate Smoothing (ERS) to further smooth the flow transitions.\n" "\n" -"Note: When this option is enabled, overhang perimeters are treated like " -"overhangs, meaning the overhang speed is applied even if the overhanging " -"perimeter is part of a bridge.\n" -"For example, when the perimeters are 100% overhanging, with no wall " -"supporting them from underneath, the 100% overhang speed will be applied." +"Note: When this option is enabled, overhang perimeters are treated like overhangs, meaning the overhang speed is applied even if the overhanging perimeter is part of a bridge.\n" +"For example, when the perimeters are 100% overhanging, with no wall supporting them from underneath, the 100% overhang speed will be applied." msgstr "" "เปิดใช้งานตัวเลือกนี้เพื่อชะลอการพิมพ์ในพื้นที่ที่เส้นรอบวงอาจงอขึ้น\n" -"ตัวอย่างเช่น จะชะลอเพิ่มเติมเมื่อพิมพ์ส่วนยื่นที่มุมแหลม เช่นด้านหน้าของตัวเรือ Benchy " -"ช่วยลดการงอที่สะสมข้ามหลายชั้น\n" +"ตัวอย่างเช่น จะชะลอเพิ่มเติมเมื่อพิมพ์ส่วนยื่นที่มุมแหลม เช่นด้านหน้าของตัวเรือ Benchy ช่วยลดการงอที่สะสมข้ามหลายชั้น\n" "\n" -"โดยทั่วไปแนะนำให้เปิดใช้งาน เว้นแต่ระบบระบายความร้อนของเครื่องพิมพ์แรงพอ " -"หรือความเร็วพิมพ์ช้าพอที่เส้นรอบวงจะไม่งอ\n" -"หากพิมพ์ด้วยความเร็วเส้นรอบวงด้านนอกสูง พารามิเตอร์นี้อาจทำให้เกิดข้อบกพร่องบนผนังเมื่อชะลอ " -"เนื่องจากความแตกต่างของความเร็วพิมพ์ที่อาจมาก " -"ทำให้ชุดดันเส้นตอบสนองการเปลี่ยนอัตราการไหลไม่ทัน\n" -"สาเหตุหลักของข้อบกพร่องเหล่านี้มักมาจากการปรับ PA คลาดเคลื่อนเล็กน้อย โดยเฉพาะเมื่อใช้ร่วมกับ " -"PA smooth time ที่สูง\n" +"โดยทั่วไปแนะนำให้เปิดใช้งาน เว้นแต่ระบบระบายความร้อนของเครื่องพิมพ์แรงพอ หรือความเร็วพิมพ์ช้าพอที่เส้นรอบวงจะไม่งอ\n" +"หากพิมพ์ด้วยความเร็วเส้นรอบวงด้านนอกสูง พารามิเตอร์นี้อาจทำให้เกิดข้อบกพร่องบนผนังเมื่อชะลอ เนื่องจากความแตกต่างของความเร็วพิมพ์ที่อาจมาก ทำให้ชุดดันเส้นตอบสนองการเปลี่ยนอัตราการไหลไม่ทัน\n" +"สาเหตุหลักของข้อบกพร่องเหล่านี้มักมาจากการปรับ PA คลาดเคลื่อนเล็กน้อย โดยเฉพาะเมื่อใช้ร่วมกับ PA smooth time ที่สูง\n" "\n" "คำแนะนำเมื่อเปิดใช้งานตัวเลือกนี้:\n" -"1. ลด Pressure Advance smooth time เป็น 0.015 - 0.02 " -"เพื่อให้ชุดดันเส้นตอบสนองการเปลี่ยนความเร็วได้เร็วขึ้น\n" +"1. ลด Pressure Advance smooth time เป็น 0.015 - 0.02 เพื่อให้ชุดดันเส้นตอบสนองการเปลี่ยนความเร็วได้เร็วขึ้น\n" "2. เพิ่มความเร็วพิมพ์ขั้นต่ำเพื่อจำกัดขนาดการชะลอและลดความแตกต่างระหว่างช่วงเร็วและช้า\n" -"3. หากยังมีข้อบกพร่อง ให้เปิดใช้งาน Extrusion Rate Smoothing (ERS) " -"เพื่อปรับการเปลี่ยนอัตราการไหลให้เรียบขึ้น\n" +"3. หากยังมีข้อบกพร่อง ให้เปิดใช้งาน Extrusion Rate Smoothing (ERS) เพื่อปรับการเปลี่ยนอัตราการไหลให้เรียบขึ้น\n" "\n" -"หมายเหตุ: เมื่อเปิดใช้งานตัวเลือกนี้ เส้นรอบวงส่วนยื่นจะถูกจัดเป็นส่วนยื่น " -"หมายความว่าจะใช้ความเร็วส่วนยื่นแม้เส้นรอบวงนั้นเป็นส่วนหนึ่งของสะพาน\n" +"หมายเหตุ: เมื่อเปิดใช้งานตัวเลือกนี้ เส้นรอบวงส่วนยื่นจะถูกจัดเป็นส่วนยื่น หมายความว่าจะใช้ความเร็วส่วนยื่นแม้เส้นรอบวงนั้นเป็นส่วนหนึ่งของสะพาน\n" "ตัวอย่างเช่น เมื่อเส้นรอบวงยื่น 100% โดยไม่มีผนังรองรับจากด้านล่าง จะใช้ความเร็วส่วนยื่น 100%" msgid "mm/s or %" @@ -13261,26 +11731,17 @@ msgstr "มิลลิเมตร/วินาที หรือ %" msgid "" "Speed of the externally visible bridge extrusions.\n" "\n" -"In addition, if Slow down for curled perimeters is disabled or Classic " -"overhang mode is enabled, it will be the print speed of overhang walls that " -"are supported by less than 13%, whether they are part of a bridge or an " -"overhang." +"In addition, if Slow down for curled perimeters is disabled or Classic overhang mode is enabled, it will be the print speed of overhang walls that are supported by less than 13%, whether they are part of a bridge or an overhang." msgstr "" "ความเร็วของการอัดขึ้นรูปสะพานที่มองเห็นได้จากภายนอก\n" "\n" -"นอกจากนี้ หากปิดใช้งานการชะลอความเร็วสำหรับขอบม้วนงอหรือเปิดใช้งานโหมดระยะยื่นแบบคลาสสิก " -"มันจะเป็นความเร็วในการพิมพ์ของผนังส่วนยื่นที่รองรับน้อยกว่า 13% " -"ไม่ว่าจะเป็นส่วนหนึ่งของสะพานหรือส่วนยื่นก็ตาม" +"นอกจากนี้ หากปิดใช้งานการชะลอความเร็วสำหรับขอบม้วนงอหรือเปิดใช้งานโหมดระยะยื่นแบบคลาสสิก มันจะเป็นความเร็วในการพิมพ์ของผนังส่วนยื่นที่รองรับน้อยกว่า 13% ไม่ว่าจะเป็นส่วนหนึ่งของสะพานหรือส่วนยื่นก็ตาม" msgid "Internal" msgstr "ภายใน" -msgid "" -"Speed of internal bridges. If the value is expressed as a percentage, it " -"will be calculated based on the bridge_speed. Default value is 150%." -msgstr "" -"ความเร็วของสะพานภายใน หากค่าแสดงเป็นเปอร์เซ็นต์ ค่าดังกล่าวจะถูกคำนวณตาม bridge_speed " -"ค่าเริ่มต้นคือ 150%" +msgid "Speed of internal bridges. If the value is expressed as a percentage, it will be calculated based on the bridge_speed. Default value is 150%." +msgstr "ความเร็วของสะพานภายใน หากค่าแสดงเป็นเปอร์เซ็นต์ ค่าดังกล่าวจะถูกคำนวณตาม bridge_speed ค่าเริ่มต้นคือ 150%" msgid "Brim width" msgstr "ความกว้าง ขอบยึดชิ้นงาน" @@ -13291,19 +11752,13 @@ msgstr "ระยะห่างจากแบบจำลองถึงเส msgid "Brim type" msgstr "ชนิด ขอบยึดชิ้นงาน" -msgid "" -"This controls the generation of the brim at outer and/or inner side of " -"models. Auto means the brim width is analyzed and calculated automatically." -msgstr "" -"วิธีนี้จะควบคุมการสร้างขอบยึดชิ้นงานที่ด้านนอกและ/หรือด้านในของรุ่น " -"อัตโนมัติหมายถึงความกว้างของขอบยึดชิ้นงานได้รับการวิเคราะห์และคำนวณโดยอัตโนมัติ" +msgid "This controls the generation of the brim at outer and/or inner side of models. Auto means the brim width is analyzed and calculated automatically." +msgstr "วิธีนี้จะควบคุมการสร้างขอบยึดชิ้นงานที่ด้านนอกและ/หรือด้านในของรุ่น อัตโนมัติหมายถึงความกว้างของขอบยึดชิ้นงานได้รับการวิเคราะห์และคำนวณโดยอัตโนมัติ" msgid "Brim-object gap" msgstr "ช่องว่าง ขอบยึดชิ้นงาน กับชิ้นงาน" -msgid "" -"This creates a gap between the innermost brim line and the object and can " -"make the brim easier to remove." +msgid "This creates a gap between the innermost brim line and the object and can make the brim easier to remove." msgstr "ช่องว่างระหว่างเส้นขอบยึดชิ้นงานด้านในสุดกับวัตถุสามารถทำให้ขอบยึดชิ้นงานหลุดออกได้ง่ายขึ้น" msgid "Brim flow ratio" @@ -13312,15 +11767,13 @@ msgstr "อัตราส่วนการไหล ขอบยึดชิ msgid "" "This factor affects the amount of material for brims.\n" "\n" -"The actual brim flow used is calculated by multiplying this value by the " -"filament flow ratio, and if set, the object's flow ratio.\n" +"The actual brim flow used is calculated by multiplying this value by the filament flow ratio, and if set, the object's flow ratio.\n" "\n" "Note: The resulting value will not be affected by the first-layer flow ratio." msgstr "" "ปัจจัยนี้ส่งผลต่อปริมาณวัสดุสำหรับขอบยึดชิ้นงาน\n" "\n" -"การไหลของขอบยึดชิ้นงานที่แท้จริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก " -"และหากตั้งค่าไว้ อัตราการไหลของวัตถุ\n" +"การไหลของขอบยึดชิ้นงานที่แท้จริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ\n" "\n" "หมายเหตุ: ค่าผลลัพธ์จะไม่ได้รับผลกระทบจากอัตราส่วนการไหลของชั้นแรก" @@ -13328,30 +11781,21 @@ msgid "Brim follows compensated outline" msgstr "ขอบยึดชิ้นงาน ปฏิบัติตามโครงร่างที่ได้รับการชดเชย" msgid "" -"When enabled, the brim is aligned with the first-layer perimeter geometry " -"after Elephant Foot Compensation is applied.\n" -"This option is intended for cases where Elephant Foot Compensation " -"significantly alters the first-layer footprint.\n" +"When enabled, the brim is aligned with the first-layer perimeter geometry after Elephant Foot Compensation is applied.\n" +"This option is intended for cases where Elephant Foot Compensation significantly alters the first-layer footprint.\n" "\n" -"If your current setup already works well, enabling it may be unnecessary and " -"can cause the brim to fuse with upper layers." +"If your current setup already works well, enabling it may be unnecessary and can cause the brim to fuse with upper layers." msgstr "" -"เมื่อเปิดใช้งาน " -"ขอบยึดชิ้นงานจะจัดแนวกับรูปทรงเส้นรอบวงชั้นแรกหลังจากใช้การชดเชยอาการฐานบาน\n" +"เมื่อเปิดใช้งาน ขอบยึดชิ้นงานจะจัดแนวกับรูปทรงเส้นรอบวงชั้นแรกหลังจากใช้การชดเชยอาการฐานบาน\n" "ตัวเลือกนี้มีไว้สำหรับกรณีที่การชดเชยอาการฐานบานเปลี่ยนแปลงรอยเท้าชั้นแรกอย่างมีนัยสำคัญ\n" "\n" -"หากการตั้งค่าปัจจุบันของคุณทำงานได้ดีอยู่แล้ว " -"การเปิดใช้งานอาจไม่จำเป็นและอาจทำให้ขอบยึดชิ้นงานหลอมรวมกับชั้นบนได้" +"หากการตั้งค่าปัจจุบันของคุณทำงานได้ดีอยู่แล้ว การเปิดใช้งานอาจไม่จำเป็นและอาจทำให้ขอบยึดชิ้นงานหลอมรวมกับชั้นบนได้" msgid "Combine brims" msgstr "รวมขอบยึดชิ้นงาน" -msgid "" -"Combine multiple brims into one when they are close to each other. This can " -"improve brim adhesion." -msgstr "" -"รวมขอบยึดชิ้นงานหลายอันเป็นอันเดียวเมื่ออยู่ใกล้กัน " -"วิธีนี้สามารถปรับปรุงการยึดเกาะของขอบยึดชิ้นงานได้" +msgid "Combine multiple brims into one when they are close to each other. This can improve brim adhesion." +msgstr "รวมขอบยึดชิ้นงานหลายอันเป็นอันเดียวเมื่ออยู่ใกล้กัน วิธีนี้สามารถปรับปรุงการยึดเกาะของขอบยึดชิ้นงานได้" msgid "Brim ears" msgstr "หู ขอบยึดชิ้นงาน" @@ -13375,12 +11819,10 @@ msgid "Brim ear detection radius" msgstr "รัศมีการตรวจจับขอบหู" msgid "" -"The geometry will be decimated before detecting sharp angles. This parameter " -"indicates the minimum length of the deviation for the decimation.\n" +"The geometry will be decimated before detecting sharp angles. This parameter indicates the minimum length of the deviation for the decimation.\n" "0 to deactivate." msgstr "" -"รูปทรงจะถูกทำลายก่อนที่จะตรวจจับมุมแหลม " -"พารามิเตอร์นี้ระบุความยาวขั้นต่ำของการเบี่ยงเบนสำหรับการทำลาย\n" +"รูปทรงจะถูกทำลายก่อนที่จะตรวจจับมุมแหลม พารามิเตอร์นี้ระบุความยาวขั้นต่ำของการเบี่ยงเบนสำหรับการทำลาย\n" "0 เพื่อปิดการใช้งาน" msgid "Select printers" @@ -13392,28 +11834,16 @@ msgstr "เครื่องที่รองรับขึ้นไป" msgid "Condition" msgstr "เงื่อนไข" -msgid "" -"A Boolean expression using the configuration values of an active printer " -"profile. If this expression evaluates to true, this profile is considered " -"compatible with the active printer profile." -msgstr "" -"นิพจน์บูลีนที่ใช้ค่าการกำหนดค่าของโปรไฟล์เครื่องพิมพ์ที่ใช้งานอยู่ หากนิพจน์นี้ประเมินว่าเป็นจริง " -"โปรไฟล์นี้จะถือว่าเข้ากันได้กับโปรไฟล์เครื่องพิมพ์ที่ใช้งานอยู่" +msgid "A Boolean expression using the configuration values of an active printer profile. If this expression evaluates to true, this profile is considered compatible with the active printer profile." +msgstr "นิพจน์บูลีนที่ใช้ค่าการกำหนดค่าของโปรไฟล์เครื่องพิมพ์ที่ใช้งานอยู่ หากนิพจน์นี้ประเมินว่าเป็นจริง โปรไฟล์นี้จะถือว่าเข้ากันได้กับโปรไฟล์เครื่องพิมพ์ที่ใช้งานอยู่" msgid "Select profiles" msgstr "โปรไฟล์เลือก" -msgid "" -"A Boolean expression using the configuration values of an active print " -"profile. If this expression evaluates to true, this profile is considered " -"compatible with the active print profile." -msgstr "" -"นิพจน์บูลีนที่ใช้ค่าการกำหนดค่าของโปรไฟล์การพิมพ์ที่ใช้งานอยู่ หากนิพจน์นี้ประเมินว่าเป็นจริง " -"โปรไฟล์นี้จะถือว่าเข้ากันได้กับโปรไฟล์การพิมพ์ที่ใช้งานอยู่" +msgid "A Boolean expression using the configuration values of an active print profile. If this expression evaluates to true, this profile is considered compatible with the active print profile." +msgstr "นิพจน์บูลีนที่ใช้ค่าการกำหนดค่าของโปรไฟล์การพิมพ์ที่ใช้งานอยู่ หากนิพจน์นี้ประเมินว่าเป็นจริง โปรไฟล์นี้จะถือว่าเข้ากันได้กับโปรไฟล์การพิมพ์ที่ใช้งานอยู่" -msgid "" -"This determines the print sequence, allowing you to print layer-by-layer or " -"object-by-object." +msgid "This determines the print sequence, allowing you to print layer-by-layer or object-by-object." msgstr "ลำดับการพิมพ์ ทีละชั้น หรือวัตถุต่อวัตถุ" msgid "By layer" @@ -13434,22 +11864,13 @@ msgstr "เป็นรายการวัตถุ" msgid "Slow printing down for better layer cooling" msgstr "ชะลอการพิมพ์ลงเพื่อการระบายความร้อนที่ดีขึ้น" -msgid "" -"Enable this option to slow printing speed down to ensure that the final " -"layer time is not shorter than the layer time threshold in \"Max fan speed " -"threshold\", so that the layer can be cooled for a longer time. This can " -"improve the quality for small details." -msgstr "" -"เปิดใช้งานตัวเลือกนี้เพื่อลดความเร็วในการพิมพ์ลงเพื่อทำให้เวลาเลเยอร์สุดท้ายไม่สั้นกว่าเกณฑ์เวลาของเลเยอร์ใน " -"\"ขีดจำกัดความเร็วพัดลมสูงสุด\" เพื่อให้เลเยอร์นั้นเย็นลงได้นานขึ้น " -"สิ่งนี้สามารถปรับปรุงคุณภาพการระบายความร้อนสำหรับเข็มและรายละเอียดเล็กๆ ได้" +msgid "Enable this option to slow printing speed down to ensure that the final layer time is not shorter than the layer time threshold in \"Max fan speed threshold\", so that the layer can be cooled for a longer time. This can improve the quality for small details." +msgstr "เปิดใช้งานตัวเลือกนี้เพื่อลดความเร็วในการพิมพ์ลงเพื่อทำให้เวลาเลเยอร์สุดท้ายไม่สั้นกว่าเกณฑ์เวลาของเลเยอร์ใน \"ขีดจำกัดความเร็วพัดลมสูงสุด\" เพื่อให้เลเยอร์นั้นเย็นลงได้นานขึ้น สิ่งนี้สามารถปรับปรุงคุณภาพการระบายความร้อนสำหรับเข็มและรายละเอียดเล็กๆ ได้" msgid "Normal printing" msgstr "การพิมพ์ปกติ" -msgid "" -"This is the default acceleration for both normal printing and travel after " -"the first layer." +msgid "This is the default acceleration for both normal printing and travel after the first layer." msgstr "การเร่งความเร็วเริ่มต้นของทั้งการพิมพ์และการเคลื่อนที่ตามปกติ ยกเว้นเลเยอร์เริ่มต้น" msgid "Default filament profile" @@ -13470,24 +11891,17 @@ msgstr "เปิดใช้งานการกรองอากาศ" msgid "Activate for better air filtration. G-code command: M106 P3 S(0-255)" msgstr "เปิดใช้งานเพื่อการกรองอากาศที่ดีขึ้น คำสั่งรหัส G: M106 P3 S(0-255)" -msgid "" -"Enable this to override the fan speed set in custom G-code during print." +msgid "Enable this to override the fan speed set in custom G-code during print." msgstr "เปิดใช้งานสิ่งนี้เพื่อแทนที่ความเร็วพัดลมที่ตั้งไว้ใน G-code แบบกำหนดเองระหว่างการพิมพ์" msgid "On completion" msgstr "เมื่อเสร็จสิ้น" -msgid "" -"Enable this to override the fan speed set in custom G-code after print " -"completion." +msgid "Enable this to override the fan speed set in custom G-code after print completion." msgstr "เปิดใช้งานสิ่งนี้เพื่อแทนที่ความเร็วพัดลมที่ตั้งไว้ใน G-code แบบกำหนดเองหลังจากพิมพ์เสร็จสิ้น" -msgid "" -"Speed of exhaust fan during printing. This speed will override the speed in " -"filament custom G-code." -msgstr "" -"ความเร็วพัดลมดูดอากาศระหว่างการพิมพ์ ความเร็วนี้จะแทนที่ความเร็วใน G-code " -"แบบกำหนดเองของฟิลาเมนต์" +msgid "Speed of exhaust fan during printing. This speed will override the speed in filament custom G-code." +msgstr "ความเร็วพัดลมดูดอากาศระหว่างการพิมพ์ ความเร็วนี้จะแทนที่ความเร็วใน G-code แบบกำหนดเองของฟิลาเมนต์" msgid "Speed of exhaust fan after printing completes." msgstr "ความเร็วของพัดลมดูดอากาศหลังการพิมพ์เสร็จสิ้น" @@ -13495,112 +11909,65 @@ msgstr "ความเร็วของพัดลมดูดอากาศ msgid "No cooling for the first" msgstr "ไม่มีการระบายความร้อนในช่วงแรก" -msgid "" -"Turn off all cooling fans for the first few layers. This can be used to " -"improve build plate adhesion." -msgstr "" -"ปิดพัดลมระบายความร้อนทั้งหมดในช่วงสองสามชั้นแรก สามารถใช้เพื่อปรับปรุงการยึดเกาะของแผ่นรองพื้น" +msgid "Turn off all cooling fans for the first few layers. This can be used to improve build plate adhesion." +msgstr "ปิดพัดลมระบายความร้อนทั้งหมดในช่วงสองสามชั้นแรก สามารถใช้เพื่อปรับปรุงการยึดเกาะของแผ่นรองพื้น" msgid "Don't support bridges" msgstr "ไม่สร้างส่วนรองรับสำหรับสะพาน" -msgid "" -"This disables supporting bridges, which decreases the amount of support " -"required. Bridges can usually be printed directly without support over a " -"reasonable distance." -msgstr "" -"ปิดการสร้างส่วนรองรับสำหรับสะพาน ช่วยลดปริมาณส่วนรองรับที่ต้องใช้ โดยทั่วไปสะพานสั้นๆ " -"พิมพ์ได้โดยตรงโดยไม่ต้องมีส่วนรองรับ" +msgid "This disables supporting bridges, which decreases the amount of support required. Bridges can usually be printed directly without support over a reasonable distance." +msgstr "ปิดการสร้างส่วนรองรับสำหรับสะพาน ช่วยลดปริมาณส่วนรองรับที่ต้องใช้ โดยทั่วไปสะพานสั้นๆ พิมพ์ได้โดยตรงโดยไม่ต้องมีส่วนรองรับ" msgid "Thick external bridges" msgstr "สะพานภายนอกหนา" msgid "" -"If enabled, bridge extrusion uses a line height equal to the nozzle " -"diameter.\n" -"This increases bridge strength and reliability, allowing longer spans, but " -"may worsen appearance.\n" -"If disabled, bridges may look better but are generally reliable only for " -"shorter spans." +"If enabled, bridge extrusion uses a line height equal to the nozzle diameter.\n" +"This increases bridge strength and reliability, allowing longer spans, but may worsen appearance.\n" +"If disabled, bridges may look better but are generally reliable only for shorter spans." msgstr "" "หากเปิดใช้งาน การดันเส้นสะพานจะใช้ความสูงเส้นเท่ากับเส้นผ่านศูนย์กลางหัวฉีด\n" -"ช่วยเพิ่มความแข็งแรงและความน่าเชื่อถือของสะพาน ทำให้ข้ามช่วงระยะไกลขึ้นได้ " -"แต่อาจทำให้รูปลักษณ์แย่ลง\n" +"ช่วยเพิ่มความแข็งแรงและความน่าเชื่อถือของสะพาน ทำให้ข้ามช่วงระยะไกลขึ้นได้ แต่อาจทำให้รูปลักษณ์แย่ลง\n" "หากปิดใช้งาน สะพานอาจดูดีขึ้น แต่โดยทั่วไปเชื่อถือได้เฉพาะช่วงสั้นๆ" msgid "Thick internal bridges" msgstr "สะพานภายในหนา" msgid "" -"If enabled, internal bridge extrusion uses a line height equal to the nozzle " -"diameter.\n" -"This increases internal bridge strength and reliability when printed over " -"sparse infill, but may worsen appearance.\n" -"If disabled, internal bridges may look better but can be less reliable over " -"sparse infill." +"If enabled, internal bridge extrusion uses a line height equal to the nozzle diameter.\n" +"This increases internal bridge strength and reliability when printed over sparse infill, but may worsen appearance.\n" +"If disabled, internal bridges may look better but can be less reliable over sparse infill." msgstr "" "หากเปิดใช้งาน การดันเส้นสะพานด้านในจะใช้ความสูงเส้นเท่ากับเส้นผ่านศูนย์กลางหัวฉีด\n" -"ช่วยเพิ่มความแข็งแรงและความน่าเชื่อถือของสะพานด้านในเมื่อพิมพ์เหนือไส้ในแบบโปร่ง " -"แต่อาจทำให้รูปลักษณ์แย่ลง\n" +"ช่วยเพิ่มความแข็งแรงและความน่าเชื่อถือของสะพานด้านในเมื่อพิมพ์เหนือไส้ในแบบโปร่ง แต่อาจทำให้รูปลักษณ์แย่ลง\n" "หากปิดใช้งาน สะพานด้านในอาจดูดีขึ้น แต่อาจน่าเชื่อถือน้อยลงเมื่อพิมพ์เหนือไส้ในแบบโปร่ง" msgid "Extra bridge layers (beta)" msgstr "เลเยอร์บริดจ์พิเศษ (เบต้า)" msgid "" -"This option enables the generation of an extra bridge layer over internal " -"and/or external bridges.\n" +"This option enables the generation of an extra bridge layer over internal and/or external bridges.\n" "\n" -"Extra bridge layers help improve bridge appearance and reliability, as the " -"solid infill is better supported. This is especially useful in fast " -"printers, where the bridge and solid infill speeds vary greatly. The extra " -"bridge layer results in reduced pillowing on top surfaces, as well as " -"reduced separation of the external bridge layer from its surrounding " -"perimeters.\n" +"Extra bridge layers help improve bridge appearance and reliability, as the solid infill is better supported. This is especially useful in fast printers, where the bridge and solid infill speeds vary greatly. The extra bridge layer results in reduced pillowing on top surfaces, as well as reduced separation of the external bridge layer from its surrounding perimeters.\n" "\n" -"It is generally recommended to set this to at least 'External bridge only', " -"unless specific issues with the sliced model are found.\n" +"It is generally recommended to set this to at least 'External bridge only', unless specific issues with the sliced model are found.\n" "\n" "Options:\n" -"1. Disabled - does not generate second bridge layers. This is the default " -"and is set for compatibility purposes\n" -"2. External bridge only - generates second bridge layers for external-facing " -"bridges only. Please note that small bridges that are shorter or narrower " -"than the set number of perimeters will be skipped as they would not benefit " -"from a second bridge layer. If generated, the second bridge layer will be " -"extruded parallel to the first bridge layer to reinforce the bridge " -"strength\n" -"3. Internal bridge only - generates second bridge layers for internal " -"bridges over sparse infill only. Please note that the internal bridges count " -"towards the top shell layer count of your model. The second internal bridge " -"layer will be extruded as close to perpendicular to the first as possible. " -"If multiple regions in the same island, with varying bridge angles are " -"present, the last region of that island will be selected as the angle " -"reference\n" -"4. Apply to all - generates second bridge layers for both internal and " -"external-facing bridges\n" +"1. Disabled - does not generate second bridge layers. This is the default and is set for compatibility purposes\n" +"2. External bridge only - generates second bridge layers for external-facing bridges only. Please note that small bridges that are shorter or narrower than the set number of perimeters will be skipped as they would not benefit from a second bridge layer. If generated, the second bridge layer will be extruded parallel to the first bridge layer to reinforce the bridge strength\n" +"3. Internal bridge only - generates second bridge layers for internal bridges over sparse infill only. Please note that the internal bridges count towards the top shell layer count of your model. The second internal bridge layer will be extruded as close to perpendicular to the first as possible. If multiple regions in the same island, with varying bridge angles are present, the last region of that island will be selected as the angle reference\n" +"4. Apply to all - generates second bridge layers for both internal and external-facing bridges\n" msgstr "" "ตัวเลือกนี้ช่วยให้สร้างชั้นสะพานพิเศษเหนือสะพานภายในและ/หรือภายนอกได้\n" "\n" -"ชั้นสะพานพิเศษช่วยปรับปรุงรูปลักษณ์และความน่าเชื่อถือของสะพาน " -"เพราะไส้ในแบบทึบได้รับการรองรับดีขึ้น " -"มีประโยชน์อย่างยิ่งกับเครื่องพิมพ์ความเร็วสูงที่ความเร็วสะพานและไส้ในแบบทึบต่างกันมาก " -"ชั้นสะพานพิเศษช่วยลดการโป่งของผิวด้านบน " -"รวมถึงลดการแยกตัวของชั้นสะพานภายนอกจากเส้นรอบวงโดยรอบ\n" +"ชั้นสะพานพิเศษช่วยปรับปรุงรูปลักษณ์และความน่าเชื่อถือของสะพาน เพราะไส้ในแบบทึบได้รับการรองรับดีขึ้น มีประโยชน์อย่างยิ่งกับเครื่องพิมพ์ความเร็วสูงที่ความเร็วสะพานและไส้ในแบบทึบต่างกันมาก ชั้นสะพานพิเศษช่วยลดการโป่งของผิวด้านบน รวมถึงลดการแยกตัวของชั้นสะพานภายนอกจากเส้นรอบวงโดยรอบ\n" "\n" -"โดยทั่วไปขอแนะนำให้ตั้งค่านี้เป็น 'สะพานภายนอกเท่านั้น' เป็นอย่างน้อย " -"เว้นแต่จะพบปัญหาเฉพาะกับโมเดลที่แบ่งส่วน\n" +"โดยทั่วไปขอแนะนำให้ตั้งค่านี้เป็น 'สะพานภายนอกเท่านั้น' เป็นอย่างน้อย เว้นแต่จะพบปัญหาเฉพาะกับโมเดลที่แบ่งส่วน\n" "\n" "ตัวเลือก:\n" "1. ปิดใช้งาน - ไม่สร้างชั้นสะพานที่สอง นี่เป็นค่าเริ่มต้นและตั้งค่าไว้เพื่อความเข้ากันได้\n" -"2. สะพานภายนอกเท่านั้น - สร้างชั้นสะพานที่สองสำหรับสะพานที่หันหน้าไปทางภายนอกเท่านั้น " -"โปรดทราบว่าสะพานขนาดเล็กที่สั้นกว่าหรือแคบกว่าจำนวนเส้นรอบวงที่ตั้งไว้จะถูกข้ามไป " -"เนื่องจากจะไม่ได้รับประโยชน์จากชั้นสะพานที่สอง หากสร้างขึ้น " -"ชั้นสะพานที่สองจะถูกอัดรีดขนานกับชั้นสะพานแรกเพื่อเสริมความแข็งแรงของสะพาน\n" -"3. สะพานภายในเท่านั้น - สร้างชั้นสะพานที่สองสำหรับสะพานภายในเหนือไส้ในแบบโปร่งเท่านั้น " -"โปรดทราบว่าสะพานภายในจะนับรวมกับจำนวนชั้นเปลือกด้านบนของโมเดล " -"ชั้นสะพานภายในที่สองจะถูกอัดรีดให้ใกล้เคียงกับแนวตั้งฉากกับชั้นแรกมากที่สุด " -"หากมีหลายพื้นที่ในเกาะเดียวกันพร้อมมุมสะพานต่างกัน พื้นที่สุดท้ายของเกาะนั้นจะถูกเลือกเป็นมุมอ้างอิง\n" +"2. สะพานภายนอกเท่านั้น - สร้างชั้นสะพานที่สองสำหรับสะพานที่หันหน้าไปทางภายนอกเท่านั้น โปรดทราบว่าสะพานขนาดเล็กที่สั้นกว่าหรือแคบกว่าจำนวนเส้นรอบวงที่ตั้งไว้จะถูกข้ามไป เนื่องจากจะไม่ได้รับประโยชน์จากชั้นสะพานที่สอง หากสร้างขึ้น ชั้นสะพานที่สองจะถูกอัดรีดขนานกับชั้นสะพานแรกเพื่อเสริมความแข็งแรงของสะพาน\n" +"3. สะพานภายในเท่านั้น - สร้างชั้นสะพานที่สองสำหรับสะพานภายในเหนือไส้ในแบบโปร่งเท่านั้น โปรดทราบว่าสะพานภายในจะนับรวมกับจำนวนชั้นเปลือกด้านบนของโมเดล ชั้นสะพานภายในที่สองจะถูกอัดรีดให้ใกล้เคียงกับแนวตั้งฉากกับชั้นแรกมากที่สุด หากมีหลายพื้นที่ในเกาะเดียวกันพร้อมมุมสะพานต่างกัน พื้นที่สุดท้ายของเกาะนั้นจะถูกเลือกเป็นมุมอ้างอิง\n" "4. นำไปใช้กับทั้งหมด - สร้างชั้นสะพานที่สองสำหรับสะพานที่หันหน้าไปทางภายในและภายนอก\n" msgid "External bridge only" @@ -13616,43 +11983,21 @@ msgid "Filter out small internal bridges" msgstr "กรองบริดจ์ภายในขนาดเล็กออก" msgid "" -"This option can help reduce pillowing on top surfaces in heavily slanted or " -"curved models.\n" -"By default, small internal bridges are filtered out and the internal solid " -"infill is printed directly over the sparse infill. This works well in most " -"cases, speeding up printing without too much compromise on top surface " -"quality.\n" -"However, in heavily slanted or curved models, especially where too low a " -"sparse infill density is used, this may result in curling of the unsupported " -"solid infill, causing pillowing.\n" -"Enabling limited filtering or no filtering will print internal bridge layer " -"over slightly unsupported internal solid infill. The options below control " -"the sensitivity of the filtering, i.e. they control where internal bridges " -"are created:\n" -"1. Filter - enables this option. This is the default behavior and works well " -"in most cases\n" -"2. Limited filtering - creates internal bridges on heavily slanted surfaces " -"while avoiding unnecessary bridges. This works well for most difficult " -"models\n" -"3. No filtering - creates internal bridges on every potential internal " -"overhang. This option is useful for heavily slanted top surface models; " -"however, in most cases, it creates too many unnecessary bridges." +"This option can help reduce pillowing on top surfaces in heavily slanted or curved models.\n" +"By default, small internal bridges are filtered out and the internal solid infill is printed directly over the sparse infill. This works well in most cases, speeding up printing without too much compromise on top surface quality.\n" +"However, in heavily slanted or curved models, especially where too low a sparse infill density is used, this may result in curling of the unsupported solid infill, causing pillowing.\n" +"Enabling limited filtering or no filtering will print internal bridge layer over slightly unsupported internal solid infill. The options below control the sensitivity of the filtering, i.e. they control where internal bridges are created:\n" +"1. Filter - enables this option. This is the default behavior and works well in most cases\n" +"2. Limited filtering - creates internal bridges on heavily slanted surfaces while avoiding unnecessary bridges. This works well for most difficult models\n" +"3. No filtering - creates internal bridges on every potential internal overhang. This option is useful for heavily slanted top surface models; however, in most cases, it creates too many unnecessary bridges." msgstr "" "ตัวเลือกนี้สามารถช่วยลดการหมอนอิงบนพื้นผิวด้านบนในรุ่นที่เอียงหรือโค้งมาก\n" -"ตามค่าเริ่มต้น บริดจ์ภายในขนาดเล็กจะถูกกรองออก และ ไส้ใน แบบทึบภายในจะถูกพิมพ์โดยตรงบน " -"ไส้ใน แบบกระจัดกระจาย วิธีนี้ใช้ได้ผลดีในกรณีส่วนใหญ่ " -"โดยจะช่วยเร่งการพิมพ์โดยไม่กระทบต่อคุณภาพพื้นผิวด้านบนมากเกินไป\n" -"อย่างไรก็ตาม ในรุ่นที่เอียงหรือโค้งมาก " -"โดยเฉพาะอย่างยิ่งเมื่อใช้ความหนาแน่นของไส้ในที่เบาบางต่ำเกินไป " -"อาจส่งผลให้ไส้ในที่เป็นของแข็งที่ไม่ได้รับส่วนรองรับโค้งงอ ทำให้เกิดการหมอนหนุน\n" -"การเปิดใช้งานการกรองแบบจำกัดหรือไม่มีการกรองจะพิมพ์เลเยอร์บริดจ์ภายในทับไส้ในโซลิดภายในที่ไม่รองรับเล็กน้อย " -"ตัวเลือกด้านล่างควบคุมความไวของการกรอง กล่าวคือ ควบคุมตำแหน่งที่สร้างบริดจ์ภายใน:\n" +"ตามค่าเริ่มต้น บริดจ์ภายในขนาดเล็กจะถูกกรองออก และ ไส้ใน แบบทึบภายในจะถูกพิมพ์โดยตรงบน ไส้ใน แบบกระจัดกระจาย วิธีนี้ใช้ได้ผลดีในกรณีส่วนใหญ่ โดยจะช่วยเร่งการพิมพ์โดยไม่กระทบต่อคุณภาพพื้นผิวด้านบนมากเกินไป\n" +"อย่างไรก็ตาม ในรุ่นที่เอียงหรือโค้งมาก โดยเฉพาะอย่างยิ่งเมื่อใช้ความหนาแน่นของไส้ในที่เบาบางต่ำเกินไป อาจส่งผลให้ไส้ในที่เป็นของแข็งที่ไม่ได้รับส่วนรองรับโค้งงอ ทำให้เกิดการหมอนหนุน\n" +"การเปิดใช้งานการกรองแบบจำกัดหรือไม่มีการกรองจะพิมพ์เลเยอร์บริดจ์ภายในทับไส้ในโซลิดภายในที่ไม่รองรับเล็กน้อย ตัวเลือกด้านล่างควบคุมความไวของการกรอง กล่าวคือ ควบคุมตำแหน่งที่สร้างบริดจ์ภายใน:\n" "1. ตัวกรอง - เปิดใช้งานตัวเลือกนี้ นี่เป็นพฤติกรรมเริ่มต้นและทำงานได้ดีในกรณีส่วนใหญ่\n" -"2. การกรองแบบจำกัด - สร้างสะพานภายในบนพื้นผิวที่ลาดเอียงอย่างมาก " -"ในขณะที่หลีกเลี่ยงสะพานที่ไม่จำเป็น วิธีนี้ใช้ได้ผลดีกับโมเดลที่ยากที่สุด\n" -"3. ไม่มีการกรอง - สร้างสะพานภายในบนทุกส่วนยื่นภายในที่อาจเกิดขึ้น " -"ตัวเลือกนี้มีประโยชน์สำหรับโมเดลพื้นผิวด้านบนที่เอียงมาก อย่างไรก็ตาม ในกรณีส่วนใหญ่ " -"มันจะสร้างบริดจ์ที่ไม่จำเป็นมากเกินไป" +"2. การกรองแบบจำกัด - สร้างสะพานภายในบนพื้นผิวที่ลาดเอียงอย่างมาก ในขณะที่หลีกเลี่ยงสะพานที่ไม่จำเป็น วิธีนี้ใช้ได้ผลดีกับโมเดลที่ยากที่สุด\n" +"3. ไม่มีการกรอง - สร้างสะพานภายในบนทุกส่วนยื่นภายในที่อาจเกิดขึ้น ตัวเลือกนี้มีประโยชน์สำหรับโมเดลพื้นผิวด้านบนที่เอียงมาก อย่างไรก็ตาม ในกรณีส่วนใหญ่ มันจะสร้างบริดจ์ที่ไม่จำเป็นมากเกินไป" msgid "Limited filtering" msgstr "การกรองที่จำกัด" @@ -13663,14 +12008,8 @@ msgstr "ไม่มีการกรอง" msgid "Max bridge length" msgstr "ความยาวสะพานสูงสุด" -msgid "" -"This is the maximum length of bridges that don't need support. Set it to 0 " -"if you want all bridges to be supported, and set it to a very large value if " -"you don't want any bridges to be supported." -msgstr "" -"ความยาวสูงสุดของสะพานที่ไม่ต้องการการรองรับ ตั้งค่าเป็น 0 " -"หากคุณต้องการให้บริดจ์ทั้งหมดได้รับส่วนรองรับ และตั้งค่าเป็นค่าที่สูงมากหากคุณไม่ต้องการให้บริดจ์ใดๆ " -"ได้รับการรองรับ" +msgid "This is the maximum length of bridges that don't need support. Set it to 0 if you want all bridges to be supported, and set it to a very large value if you don't want any bridges to be supported." +msgstr "ความยาวสูงสุดของสะพานที่ไม่ต้องการการรองรับ ตั้งค่าเป็น 0 หากคุณต้องการให้บริดจ์ทั้งหมดได้รับส่วนรองรับ และตั้งค่าเป็นค่าที่สูงมากหากคุณไม่ต้องการให้บริดจ์ใดๆ ได้รับการรองรับ" msgid "End G-code" msgstr "จบ G-code" @@ -13681,9 +12020,7 @@ msgstr "สิ้นสุด G-code เมื่อพิมพ์เสร็ msgid "Between Object G-code" msgstr "ระหว่างวัตถุ G-code" -msgid "" -"Insert G-code between objects. This parameter will only come into effect " -"when you print your models object by object." +msgid "Insert G-code between objects. This parameter will only come into effect when you print your models object by object." msgstr "แทรกรหัส G ระหว่างวัตถุ พารามิเตอร์นี้จะมีผลเมื่อคุณพิมพ์โมเดลของคุณทีละวัตถุเท่านั้น" msgid "Add end G-code when finishing the printing of this filament." @@ -13693,18 +12030,15 @@ msgid "Ensure vertical shell thickness" msgstr "ตรวจสอบความหนาของเปลือกแนวตั้ง" msgid "" -"Add solid infill near sloping surfaces to guarantee the vertical shell " -"thickness (top+bottom solid layers)\n" -"None: No solid infill will be added anywhere. Caution: Use this option " -"carefully if your model has sloped surfaces\n" +"Add solid infill near sloping surfaces to guarantee the vertical shell thickness (top+bottom solid layers)\n" +"None: No solid infill will be added anywhere. Caution: Use this option carefully if your model has sloped surfaces\n" "Critical Only: Avoid adding solid infill for walls\n" "Moderate: Add solid infill for heavily sloping surfaces only\n" "All: Add solid infill for all suitable sloping surfaces\n" "Default value is All." msgstr "" "เพิ่มไส้ในแบบทึบใกล้พื้นผิวลาดเอียงเพื่อรับประกันความหนาเปลือกในแนวตั้ง (ชั้นทึบบน + ล่าง)\n" -"ไม่มี: จะไม่เพิ่มไส้ในแบบทึบในส่วนใดเลย ข้อควรระวัง: " -"ใช้ตัวเลือกนี้อย่างระมัดระวังหากโมเดลมีพื้นผิวลาดเอียง\n" +"ไม่มี: จะไม่เพิ่มไส้ในแบบทึบในส่วนใดเลย ข้อควรระวัง: ใช้ตัวเลือกนี้อย่างระมัดระวังหากโมเดลมีพื้นผิวลาดเอียง\n" "เฉพาะจุดวิกฤต: หลีกเลี่ยงการเพิ่มไส้ในแบบทึบสำหรับผนัง\n" "ปานกลาง: เพิ่มไส้ในแบบทึบเฉพาะพื้นผิวที่ลาดเอียงมาก\n" "ทั้งหมด: เพิ่มไส้ในแบบทึบสำหรับพื้นผิวลาดเอียงที่เหมาะสมทั้งหมด\n" @@ -13749,51 +12083,31 @@ msgstr "เกลียวแปดเหลี่ยม" msgid "Bottom surface pattern" msgstr "รูปแบบผิวด้านล่าง" -msgid "" -"This is the line pattern of bottom surface infill, not including bridge " -"infill." +msgid "This is the line pattern of bottom surface infill, not including bridge infill." msgstr "รูปแบบเส้นของไส้ในพื้นผิวด้านล่าง ไม่ใช่ไส้ในแบบบริดจ์" msgid "Internal solid infill pattern" msgstr "รูปแบบไส้ในของแข็งภายใน" -msgid "" -"Line pattern of internal solid infill. if the detect narrow internal solid " -"infill be enabled, the concentric pattern will be used for the small area." -msgstr "" -"ลวดลายเส้นทึบภายใน หากเปิดใช้งานการตรวจจับไส้ในของแข็งภายในที่แคบ " -"รูปแบบศูนย์กลางจะถูกใช้สำหรับพื้นที่ขนาดเล็ก" +msgid "Line pattern of internal solid infill. if the detect narrow internal solid infill be enabled, the concentric pattern will be used for the small area." +msgstr "ลวดลายเส้นทึบภายใน หากเปิดใช้งานการตรวจจับไส้ในของแข็งภายในที่แคบ รูปแบบศูนย์กลางจะถูกใช้สำหรับพื้นที่ขนาดเล็ก" -msgid "" -"Line width of outer wall. If expressed as a %, it will be computed over the " -"nozzle diameter." +msgid "Line width of outer wall. If expressed as a %, it will be computed over the nozzle diameter." msgstr "ความกว้างของเส้นของผนังด้านนอก หากแสดงเป็น % จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" -msgid "" -"This is the printing speed for the outer walls of parts. These are generally " -"printed slower than inner walls for higher quality." -msgstr "" -"ความเร็วของผนังด้านนอกซึ่งอยู่ด้านนอกสุดและมองเห็นได้ " -"เคยช้ากว่าความเร็วผนังด้านในเพื่อให้ได้คุณภาพที่ดีขึ้น" +msgid "This is the printing speed for the outer walls of parts. These are generally printed slower than inner walls for higher quality." +msgstr "ความเร็วของผนังด้านนอกซึ่งอยู่ด้านนอกสุดและมองเห็นได้ เคยช้ากว่าความเร็วผนังด้านในเพื่อให้ได้คุณภาพที่ดีขึ้น" msgid "Small perimeters" msgstr "เส้นรอบวงเล็ก" -msgid "" -"This separate setting will affect the speed of perimeters having radius <= " -"small_perimeter_threshold (usually holes). If expressed as percentage (for " -"example: 80%) it will be calculated on the outer wall speed setting above. " -"Set to zero for auto." -msgstr "" -"การตั้งค่าแยกนี้จะส่งผลต่อความเร็วของเส้นรอบวงที่มีรัศมี <= small_perimeter_threshold " -"(โดยปกติคือรู) หากแสดงเป็นเปอร์เซ็นต์ (เช่น 80%) " -"ระบบจะคำนวณตามการตั้งค่าความเร็วผนังด้านนอกด้านบน ตั้งค่าเป็นศูนย์สำหรับรถยนต์" +msgid "This separate setting will affect the speed of perimeters having radius <= small_perimeter_threshold (usually holes). If expressed as percentage (for example: 80%) it will be calculated on the outer wall speed setting above. Set to zero for auto." +msgstr "การตั้งค่าแยกนี้จะส่งผลต่อความเร็วของเส้นรอบวงที่มีรัศมี <= small_perimeter_threshold (โดยปกติคือรู) หากแสดงเป็นเปอร์เซ็นต์ (เช่น 80%) ระบบจะคำนวณตามการตั้งค่าความเร็วผนังด้านนอกด้านบน ตั้งค่าเป็นศูนย์สำหรับรถยนต์" msgid "Small perimeters threshold" msgstr "เกณฑ์ขอบเขตขนาดเล็ก" -msgid "" -"This sets the threshold for small perimeter length. Default threshold is 0mm." +msgid "This sets the threshold for small perimeter length. Default threshold is 0mm." msgstr "นี่เป็นการกำหนดเกณฑ์สำหรับความยาวเส้นรอบวงเล็กน้อย เกณฑ์เริ่มต้นคือ 0 มม." msgid "Walls printing order" @@ -13802,42 +12116,19 @@ msgstr "สั่งพิมพ์ผนัง" msgid "" "Print sequence of the internal (inner) and external (outer) walls.\n" "\n" -"Use Inner/Outer for best overhangs. This is because the overhanging walls " -"can adhere to a neighbouring perimeter while printing. However, this option " -"results in slightly reduced surface quality as the external perimeter is " -"deformed by being squashed to the internal perimeter.\n" +"Use Inner/Outer for best overhangs. This is because the overhanging walls can adhere to a neighbouring perimeter while printing. However, this option results in slightly reduced surface quality as the external perimeter is deformed by being squashed to the internal perimeter.\n" "\n" -"Use Inner/Outer/Inner for the best external surface finish and dimensional " -"accuracy as the external wall is printed undisturbed from an internal " -"perimeter. However, overhang performance will reduce as there is no internal " -"perimeter to print the external wall against. This option requires a minimum " -"of 3 walls to be effective as it prints the internal walls from the 3rd " -"perimeter onwards first, then the external perimeter and, finally, the first " -"internal perimeter. This option is recommended against the Outer/Inner " -"option in most cases.\n" +"Use Inner/Outer/Inner for the best external surface finish and dimensional accuracy as the external wall is printed undisturbed from an internal perimeter. However, overhang performance will reduce as there is no internal perimeter to print the external wall against. This option requires a minimum of 3 walls to be effective as it prints the internal walls from the 3rd perimeter onwards first, then the external perimeter and, finally, the first internal perimeter. This option is recommended against the Outer/Inner option in most cases.\n" "\n" -"Use Outer/Inner for the same external wall quality and dimensional accuracy " -"benefits of Inner/Outer/Inner option. However, the Z seams will appear less " -"consistent as the first extrusion of a new layer starts on a visible surface." +"Use Outer/Inner for the same external wall quality and dimensional accuracy benefits of Inner/Outer/Inner option. However, the Z seams will appear less consistent as the first extrusion of a new layer starts on a visible surface." msgstr "" "ลำดับการพิมพ์ของผนังภายใน (ด้านใน) และภายนอก (ด้านนอก)\n" "\n" -"ใช้ด้านใน/ด้านนอกเพื่อให้ได้ระยะยื่นที่ดีที่สุด " -"เนื่องจากผนังที่ยื่นออกมาสามารถยึดติดกับปริมณฑลใกล้เคียงขณะพิมพ์ได้ อย่างไรก็ตาม " -"ตัวเลือกนี้ส่งผลให้คุณภาพพื้นผิวลดลงเล็กน้อย " -"เนื่องจากเส้นรอบวงภายนอกเสียรูปเนื่องจากการถูกแบนไปยังเส้นรอบวงภายใน\n" +"ใช้ด้านใน/ด้านนอกเพื่อให้ได้ระยะยื่นที่ดีที่สุด เนื่องจากผนังที่ยื่นออกมาสามารถยึดติดกับปริมณฑลใกล้เคียงขณะพิมพ์ได้ อย่างไรก็ตาม ตัวเลือกนี้ส่งผลให้คุณภาพพื้นผิวลดลงเล็กน้อย เนื่องจากเส้นรอบวงภายนอกเสียรูปเนื่องจากการถูกแบนไปยังเส้นรอบวงภายใน\n" "\n" -"ใช้ด้านใน/ด้านนอก/ด้านในเพื่อให้ได้พื้นผิวภายนอกที่ดีที่สุดและความแม่นยำของขนาด " -"เนื่องจากผนังภายนอกถูกพิมพ์โดยไม่ถูกรบกวนจากขอบเขตภายใน อย่างไรก็ตาม " -"ประสิทธิภาพส่วนยื่นจะลดลงเนื่องจากไม่มีขอบเขตภายในให้พิมพ์ติดกับผนังภายนอก " -"ตัวเลือกนี้ต้องใช้ผนังอย่างน้อย 3 แผ่นจึงจะมีประสิทธิภาพ เนื่องจากจะพิมพ์ผนังภายในจากปริมณฑลที่ 3 " -"เป็นต้นไป จากนั้นจึงพิมพ์ปริมณฑลภายนอก และสุดท้ายคือปริมณฑลภายในแรก " -"แนะนำให้ใช้ตัวเลือกนี้กับตัวเลือกด้านนอก/ด้านในในกรณีส่วนใหญ่\n" +"ใช้ด้านใน/ด้านนอก/ด้านในเพื่อให้ได้พื้นผิวภายนอกที่ดีที่สุดและความแม่นยำของขนาด เนื่องจากผนังภายนอกถูกพิมพ์โดยไม่ถูกรบกวนจากขอบเขตภายใน อย่างไรก็ตาม ประสิทธิภาพส่วนยื่นจะลดลงเนื่องจากไม่มีขอบเขตภายในให้พิมพ์ติดกับผนังภายนอก ตัวเลือกนี้ต้องใช้ผนังอย่างน้อย 3 แผ่นจึงจะมีประสิทธิภาพ เนื่องจากจะพิมพ์ผนังภายในจากปริมณฑลที่ 3 เป็นต้นไป จากนั้นจึงพิมพ์ปริมณฑลภายนอก และสุดท้ายคือปริมณฑลภายในแรก แนะนำให้ใช้ตัวเลือกนี้กับตัวเลือกด้านนอก/ด้านในในกรณีส่วนใหญ่\n" "\n" -"ใช้ด้านนอก/" -"ด้านในเพื่อคุณภาพผนังภายนอกที่เหมือนกันและประโยชน์ด้านความแม่นยำของมิติของตัวเลือกด้านใน/" -"ด้านนอก/ด้านใน อย่างไรก็ตาม รอยตะเข็บ Z " -"จะดูสม่ำเสมอน้อยลงเนื่องจากการอัดขึ้นรูปชั้นใหม่ครั้งแรกเริ่มต้นบนพื้นผิวที่มองเห็นได้" +"ใช้ด้านนอก/ด้านในเพื่อคุณภาพผนังภายนอกที่เหมือนกันและประโยชน์ด้านความแม่นยำของมิติของตัวเลือกด้านใน/ด้านนอก/ด้านใน อย่างไรก็ตาม รอยตะเข็บ Z จะดูสม่ำเสมอน้อยลงเนื่องจากการอัดขึ้นรูปชั้นใหม่ครั้งแรกเริ่มต้นบนพื้นผิวที่มองเห็นได้" msgid "Inner/Outer" msgstr "ภายใน/ภายนอก" @@ -13852,37 +12143,25 @@ msgid "Print infill first" msgstr "พิมพ์ไส้ในก่อน" msgid "" -"Order of wall/infill. When the tickbox is unchecked the walls are printed " -"first, which works best in most cases.\n" +"Order of wall/infill. When the tickbox is unchecked the walls are printed first, which works best in most cases.\n" "\n" -"Printing infill first may help with extreme overhangs as the walls have the " -"neighbouring infill to adhere to. However, the infill will slightly push out " -"the printed walls where it is attached to them, resulting in a worse " -"external surface finish. It can also cause the infill to shine through the " -"external surfaces of the part." +"Printing infill first may help with extreme overhangs as the walls have the neighbouring infill to adhere to. However, the infill will slightly push out the printed walls where it is attached to them, resulting in a worse external surface finish. It can also cause the infill to shine through the external surfaces of the part." msgstr "" -"ลำดับของผนัง/ไส้ใน เมื่อยกเลิกการเลือกช่องทำเครื่องหมาย ผนังจะถูกพิมพ์ก่อน " -"ซึ่งใช้งานได้ดีที่สุดในกรณีส่วนใหญ่\n" +"ลำดับของผนัง/ไส้ใน เมื่อยกเลิกการเลือกช่องทำเครื่องหมาย ผนังจะถูกพิมพ์ก่อน ซึ่งใช้งานได้ดีที่สุดในกรณีส่วนใหญ่\n" "\n" -"การพิมพ์แบบ ไส้ใน ก่อนอาจช่วยให้มีระยะยื่นมากเกินไป เนื่องจากผนังมี ไส้ใน ที่อยู่ใกล้เคียงให้ยึดติด " -"อย่างไรก็ตาม ไส้ในจะดันผนังที่พิมพ์ออกมาเล็กน้อยซึ่งติดอยู่ ส่งผลให้พื้นผิวภายนอกที่ได้คุณภาพแย่ลง " -"นอกจากนี้ยังสามารถทำให้ ไส้ใน ส่องผ่านพื้นผิวภายนอกของชิ้นส่วนได้" +"การพิมพ์แบบ ไส้ใน ก่อนอาจช่วยให้มีระยะยื่นมากเกินไป เนื่องจากผนังมี ไส้ใน ที่อยู่ใกล้เคียงให้ยึดติด อย่างไรก็ตาม ไส้ในจะดันผนังที่พิมพ์ออกมาเล็กน้อยซึ่งติดอยู่ ส่งผลให้พื้นผิวภายนอกที่ได้คุณภาพแย่ลง นอกจากนี้ยังสามารถทำให้ ไส้ใน ส่องผ่านพื้นผิวภายนอกของชิ้นส่วนได้" msgid "Wall loop direction" msgstr "ทิศทางของวงผนัง" msgid "" -"The direction which the contour wall loops are extruded when looking down " -"from the top.\n" -"Holes are printed in the opposite direction to the contour to maintain " -"alignment with layers whose contour polygons are incomplete and change " -"direction, also partially forming the contour of a hole.\n" +"The direction which the contour wall loops are extruded when looking down from the top.\n" +"Holes are printed in the opposite direction to the contour to maintain alignment with layers whose contour polygons are incomplete and change direction, also partially forming the contour of a hole.\n" "\n" "This option will be disabled if spiral vase mode is enabled." msgstr "" "ทิศทางที่ลูปผนังรูปร่างถูกอัดออกมาเมื่อมองลงมาจากด้านบน\n" -"รูจะถูกพิมพ์ในทิศทางตรงกันข้ามกับเส้นขอบเพื่อรักษาแนวเดียวกับชั้นที่มีรูปหลายเหลี่ยมเส้นขอบไม่สมบูรณ์และเปลี่ยนทิศทาง " -"รวมถึงสร้างรูปร่างของรูบางส่วนด้วย\n" +"รูจะถูกพิมพ์ในทิศทางตรงกันข้ามกับเส้นขอบเพื่อรักษาแนวเดียวกับชั้นที่มีรูปหลายเหลี่ยมเส้นขอบไม่สมบูรณ์และเปลี่ยนทิศทาง รวมถึงสร้างรูปร่างของรูบางส่วนด้วย\n" "\n" "ตัวเลือกนี้จะถูกปิดใช้งานหากเปิดใช้งานโหมดแจกันเกลียว" @@ -13895,22 +12174,16 @@ msgstr "ตามเข็มนาฬิกา" msgid "Height to rod" msgstr "ความสูงถึงก้าน" -msgid "" -"Distance from the nozzle tip to the lower rod. Used for collision avoidance " -"in by-object printing." +msgid "Distance from the nozzle tip to the lower rod. Used for collision avoidance in by-object printing." msgstr "ระยะห่างของปลายหัวฉีดถึงแกนล่าง ใช้สำหรับการหลีกเลี่ยงการชนกันในการพิมพ์ตามวัตถุ" msgid "Height to lid" msgstr "ความสูงถึงฝา" -msgid "" -"Distance from the nozzle tip to the lid. Used for collision avoidance in by-" -"object printing." +msgid "Distance from the nozzle tip to the lid. Used for collision avoidance in by-object printing." msgstr "ระยะห่างของปลายหัวฉีดถึงฝา ใช้สำหรับการหลีกเลี่ยงการชนกันในการพิมพ์ตามวัตถุ" -msgid "" -"Clearance radius around extruder: used for collision avoidance in by-object " -"printing." +msgid "Clearance radius around extruder: used for collision avoidance in by-object printing." msgstr "รัศมีระยะปลอดภัยรอบชุดดันเส้น ใช้สำหรับการหลีกเลี่ยงการชนกันในการพิมพ์ตามวัตถุ" msgid "Nozzle height" @@ -13922,61 +12195,25 @@ msgstr "ความสูงของปลายหัวฉีด" msgid "Bed mesh min" msgstr "ตาข่ายฐานพิมพ์ขั้นต่ำ" -msgid "" -"This option sets the min point for the allowed bed mesh area. Due to the " -"probe's XY offset, most printers are unable to probe the entire bed. To " -"ensure the probe point does not go outside the bed area, the minimum and " -"maximum points of the bed mesh should be set appropriately. OrcaSlicer " -"ensures that adaptive_bed_mesh_min/adaptive_bed_mesh_max values do not " -"exceed these min/max points. This information can usually be obtained from " -"your printer manufacturer. The default setting is (-99999, -99999), which " -"means there are no limits, thus allowing probing across the entire bed." -msgstr "" -"ตัวเลือกนี้จะตั้งค่าจุดต่ำสุดสำหรับพื้นที่ตาข่ายเบดที่อนุญาต เนื่องจากออฟเซ็ต XY ของโพรบ " -"เครื่องพิมพ์ส่วนใหญ่จึงไม่สามารถตรวจสอบทั้งเบดได้ " -"เพื่อให้แน่ใจว่าจุดโพรบไม่ออกไปนอกบริเวณฐานพิมพ์ " -"ควรตั้งค่าจุดต่ำสุดและสูงสุดของตาข่ายเบดอย่างเหมาะสม OrcaSlicer ช่วยให้มั่นใจได้ว่าค่าของ " -"adaptive_bed_mesh_min/adaptive_bed_mesh_max จะต้องไม่เกินจุดต่ำสุด/สูงสุดเหล่านี้ " -"โดยปกติข้อมูลนี้สามารถรับได้จากผู้ผลิตเครื่องพิมพ์ของคุณ การตั้งค่าเริ่มต้นคือ (-99999, -99999) " -"ซึ่งหมายความว่าไม่มีขีดจำกัด จึงสามารถตรวจวัดทั่วทั้งฐานพิมพ์ได้" +msgid "This option sets the min point for the allowed bed mesh area. Due to the probe's XY offset, most printers are unable to probe the entire bed. To ensure the probe point does not go outside the bed area, the minimum and maximum points of the bed mesh should be set appropriately. OrcaSlicer ensures that adaptive_bed_mesh_min/adaptive_bed_mesh_max values do not exceed these min/max points. This information can usually be obtained from your printer manufacturer. The default setting is (-99999, -99999), which means there are no limits, thus allowing probing across the entire bed." +msgstr "ตัวเลือกนี้จะตั้งค่าจุดต่ำสุดสำหรับพื้นที่ตาข่ายเบดที่อนุญาต เนื่องจากออฟเซ็ต XY ของโพรบ เครื่องพิมพ์ส่วนใหญ่จึงไม่สามารถตรวจสอบทั้งเบดได้ เพื่อให้แน่ใจว่าจุดโพรบไม่ออกไปนอกบริเวณฐานพิมพ์ ควรตั้งค่าจุดต่ำสุดและสูงสุดของตาข่ายเบดอย่างเหมาะสม OrcaSlicer ช่วยให้มั่นใจได้ว่าค่าของ adaptive_bed_mesh_min/adaptive_bed_mesh_max จะต้องไม่เกินจุดต่ำสุด/สูงสุดเหล่านี้ โดยปกติข้อมูลนี้สามารถรับได้จากผู้ผลิตเครื่องพิมพ์ของคุณ การตั้งค่าเริ่มต้นคือ (-99999, -99999) ซึ่งหมายความว่าไม่มีขีดจำกัด จึงสามารถตรวจวัดทั่วทั้งฐานพิมพ์ได้" msgid "Bed mesh max" msgstr "ตาข่ายฐานพิมพ์สูงสุด" -msgid "" -"This option sets the max point for the allowed bed mesh area. Due to the " -"probe's XY offset, most printers are unable to probe the entire bed. To " -"ensure the probe point does not go outside the bed area, the minimum and " -"maximum points of the bed mesh should be set appropriately. OrcaSlicer " -"ensures that adaptive_bed_mesh_min/adaptive_bed_mesh_max values do not " -"exceed these min/max points. This information can usually be obtained from " -"your printer manufacturer. The default setting is (99999, 99999), which " -"means there are no limits, thus allowing probing across the entire bed." -msgstr "" -"ตัวเลือกนี้จะตั้งค่าจุดสูงสุดสำหรับพื้นที่ตาข่ายฐานพิมพ์ที่อนุญาต เนื่องจากออฟเซ็ต XY ของโพรบ " -"เครื่องพิมพ์ส่วนใหญ่จึงไม่สามารถตรวจสอบทั้งเบดได้ " -"เพื่อให้แน่ใจว่าจุดโพรบไม่ออกไปนอกบริเวณฐานพิมพ์ " -"ควรตั้งค่าจุดต่ำสุดและสูงสุดของตาข่ายเบดอย่างเหมาะสม OrcaSlicer ช่วยให้มั่นใจได้ว่าค่าของ " -"adaptive_bed_mesh_min/adaptive_bed_mesh_max จะต้องไม่เกินจุดต่ำสุด/สูงสุดเหล่านี้ " -"โดยปกติข้อมูลนี้สามารถรับได้จากผู้ผลิตเครื่องพิมพ์ของคุณ การตั้งค่าเริ่มต้นคือ (99999, 99999) " -"ซึ่งหมายความว่าไม่มีขีดจำกัด จึงสามารถตรวจวัดทั่วทั้งฐานพิมพ์ได้" +msgid "This option sets the max point for the allowed bed mesh area. Due to the probe's XY offset, most printers are unable to probe the entire bed. To ensure the probe point does not go outside the bed area, the minimum and maximum points of the bed mesh should be set appropriately. OrcaSlicer ensures that adaptive_bed_mesh_min/adaptive_bed_mesh_max values do not exceed these min/max points. This information can usually be obtained from your printer manufacturer. The default setting is (99999, 99999), which means there are no limits, thus allowing probing across the entire bed." +msgstr "ตัวเลือกนี้จะตั้งค่าจุดสูงสุดสำหรับพื้นที่ตาข่ายฐานพิมพ์ที่อนุญาต เนื่องจากออฟเซ็ต XY ของโพรบ เครื่องพิมพ์ส่วนใหญ่จึงไม่สามารถตรวจสอบทั้งเบดได้ เพื่อให้แน่ใจว่าจุดโพรบไม่ออกไปนอกบริเวณฐานพิมพ์ ควรตั้งค่าจุดต่ำสุดและสูงสุดของตาข่ายเบดอย่างเหมาะสม OrcaSlicer ช่วยให้มั่นใจได้ว่าค่าของ adaptive_bed_mesh_min/adaptive_bed_mesh_max จะต้องไม่เกินจุดต่ำสุด/สูงสุดเหล่านี้ โดยปกติข้อมูลนี้สามารถรับได้จากผู้ผลิตเครื่องพิมพ์ของคุณ การตั้งค่าเริ่มต้นคือ (99999, 99999) ซึ่งหมายความว่าไม่มีขีดจำกัด จึงสามารถตรวจวัดทั่วทั้งฐานพิมพ์ได้" msgid "Probe point distance" msgstr "ระยะทางจุดโพรบ" -msgid "" -"This option sets the preferred distance between probe points (grid size) for " -"the X and Y directions, with the default being 50mm for both X and Y." -msgstr "" -"ตัวเลือกนี้จะตั้งค่าระยะห่างที่ต้องการระหว่างจุดโพรบ (ขนาดตาราง) สำหรับทิศทาง X และ Y " -"โดยค่าเริ่มต้นคือ 50 มม. สำหรับทั้ง X และ Y" +msgid "This option sets the preferred distance between probe points (grid size) for the X and Y directions, with the default being 50mm for both X and Y." +msgstr "ตัวเลือกนี้จะตั้งค่าระยะห่างที่ต้องการระหว่างจุดโพรบ (ขนาดตาราง) สำหรับทิศทาง X และ Y โดยค่าเริ่มต้นคือ 50 มม. สำหรับทั้ง X และ Y" msgid "Mesh margin" msgstr "ขอบตาข่าย" -msgid "" -"This option determines the additional distance by which the adaptive bed " -"mesh area should be expanded in the XY directions." +msgid "This option determines the additional distance by which the adaptive bed mesh area should be expanded in the XY directions." msgstr "ตัวเลือกนี้กำหนดระยะเพิ่มเติมที่ควรขยายพื้นที่ตาข่ายเบดแบบปรับได้ในทิศทาง XY" msgid "Grab length" @@ -13991,156 +12228,81 @@ msgstr "ใช้เป็นภาพช่วยเหลือบน UI เ msgid "Extruder offset" msgstr "การชดเชยชุดดันเส้น" -msgid "" -"The material may have volumetric change after switching between molten and " -"crystalline states. This setting changes all extrusion flow of this filament " -"in G-code proportionally. The recommended value range is between 0.95 and " -"1.05. You may be able to tune this value to get a nice flat surface if there " -"is slight overflow or underflow." -msgstr "" -"วัสดุอาจมีการเปลี่ยนแปลงเชิงปริมาตรหลังจากสลับระหว่างสถานะหลอมเหลวและสถานะผลึก " -"การตั้งค่านี้จะเปลี่ยนการไหลอัดรีดทั้งหมดของเส้นพลาสติกนี้ใน G-code ตามสัดส่วน " -"ช่วงค่าที่แนะนำคือระหว่าง 0.95 ถึง 1.05 " -"คุณอาจสามารถปรับค่านี้เพื่อให้ได้พื้นผิวที่เรียบสวยงามได้หากมีน้ำล้นหรืออันเดอร์โฟลว์เล็กน้อย" +msgid "The material may have volumetric change after switching between molten and crystalline states. This setting changes all extrusion flow of this filament in G-code proportionally. The recommended value range is between 0.95 and 1.05. You may be able to tune this value to get a nice flat surface if there is slight overflow or underflow." +msgstr "วัสดุอาจมีการเปลี่ยนแปลงเชิงปริมาตรหลังจากสลับระหว่างสถานะหลอมเหลวและสถานะผลึก การตั้งค่านี้จะเปลี่ยนการไหลอัดรีดทั้งหมดของเส้นพลาสติกนี้ใน G-code ตามสัดส่วน ช่วงค่าที่แนะนำคือระหว่าง 0.95 ถึง 1.05 คุณอาจสามารถปรับค่านี้เพื่อให้ได้พื้นผิวที่เรียบสวยงามได้หากมีน้ำล้นหรืออันเดอร์โฟลว์เล็กน้อย" msgid "" -"The material may have volumetric change after switching between molten and " -"crystalline states. This setting changes all extrusion flow of this filament " -"in G-code proportionally. The recommended value range is between 0.95 and " -"1.05. You may be able to tune this value to get a nice flat surface if there " -"is slight overflow or underflow.\n" +"The material may have volumetric change after switching between molten and crystalline states. This setting changes all extrusion flow of this filament in G-code proportionally. The recommended value range is between 0.95 and 1.05. You may be able to tune this value to get a nice flat surface if there is slight overflow or underflow.\n" "\n" -"The final object flow ratio is this value multiplied by the filament flow " -"ratio." +"The final object flow ratio is this value multiplied by the filament flow ratio." msgstr "" -"วัสดุอาจมีการเปลี่ยนแปลงเชิงปริมาตรหลังจากสลับระหว่างสถานะหลอมเหลวและสถานะผลึก " -"การตั้งค่านี้จะเปลี่ยนการไหลอัดรีดทั้งหมดของเส้นพลาสติกนี้ใน G-code ตามสัดส่วน " -"ช่วงค่าที่แนะนำคือระหว่าง 0.95 ถึง 1.05 " -"คุณอาจสามารถปรับค่านี้เพื่อให้ได้พื้นผิวที่เรียบสวยงามได้หากมีน้ำล้นหรืออันเดอร์โฟลว์เล็กน้อย\n" +"วัสดุอาจมีการเปลี่ยนแปลงเชิงปริมาตรหลังจากสลับระหว่างสถานะหลอมเหลวและสถานะผลึก การตั้งค่านี้จะเปลี่ยนการไหลอัดรีดทั้งหมดของเส้นพลาสติกนี้ใน G-code ตามสัดส่วน ช่วงค่าที่แนะนำคือระหว่าง 0.95 ถึง 1.05 คุณอาจสามารถปรับค่านี้เพื่อให้ได้พื้นผิวที่เรียบสวยงามได้หากมีน้ำล้นหรืออันเดอร์โฟลว์เล็กน้อย\n" "\n" "อัตราการไหลของวัตถุขั้นสุดท้ายคือค่านี้คูณด้วยอัตราการไหลของเส้นพลาสติก" msgid "Enable pressure advance" msgstr "เปิดใช้งานPressure Advance" -msgid "" -"Enable pressure advance, auto calibration result will be overwritten once " -"enabled." +msgid "Enable pressure advance, auto calibration result will be overwritten once enabled." msgstr "เปิดใช้งานการเลื่อนแรงดัน ผลลัพธ์การสอบเทียบอัตโนมัติจะถูกเขียนทับเมื่อเปิดใช้งาน" msgid "Pressure advance (Klipper) AKA Linear advance factor (Marlin)." -msgstr "" -"แรงดันล่วงหน้า (Pressure Advance) (Klipper) AKA Linear Advance Factor (Marlin)" +msgstr "แรงดันล่วงหน้า (Pressure Advance) (Klipper) AKA Linear Advance Factor (Marlin)" msgid "Enable adaptive pressure advance (beta)" msgstr "เปิดใช้งานการปรับPressure Advance (เบต้า)" #, no-c-format, no-boost-format msgid "" -"With increasing print speeds (and hence increasing volumetric flow through " -"the nozzle) and increasing accelerations, it has been observed that the " -"effective PA value typically decreases. This means that a single PA value is " -"not always 100% optimal for all features and a compromise value is usually " -"used that does not cause too much bulging on features with lower flow speed " -"and accelerations while also not causing gaps on faster features.\n" +"With increasing print speeds (and hence increasing volumetric flow through the nozzle) and increasing accelerations, it has been observed that the effective PA value typically decreases. This means that a single PA value is not always 100% optimal for all features and a compromise value is usually used that does not cause too much bulging on features with lower flow speed and accelerations while also not causing gaps on faster features.\n" "\n" -"This feature aims to address this limitation by modeling the response of " -"your printer's extrusion system depending on the volumetric flow speed and " -"acceleration it is printing at. Internally, it generates a fitted model that " -"can extrapolate the needed pressure advance for any given volumetric flow " -"speed and acceleration, which is then emitted to the printer depending on " -"the current print conditions.\n" +"This feature aims to address this limitation by modeling the response of your printer's extrusion system depending on the volumetric flow speed and acceleration it is printing at. Internally, it generates a fitted model that can extrapolate the needed pressure advance for any given volumetric flow speed and acceleration, which is then emitted to the printer depending on the current print conditions.\n" "\n" -"When enabled, the pressure advance value above is overridden. However, a " -"reasonable default value above is strongly recommended to act as a fallback " -"and for when tool changing.\n" +"When enabled, the pressure advance value above is overridden. However, a reasonable default value above is strongly recommended to act as a fallback and for when tool changing.\n" "\n" msgstr "" -"ด้วยความเร็วในการพิมพ์ที่เพิ่มขึ้น (และด้วยเหตุนี้จึงเพิ่มการไหลเชิงปริมาตรผ่านหัวฉีด) " -"และการเร่งความเร็วที่เพิ่มขึ้น พบว่าค่า PA ที่มีประสิทธิผลโดยทั่วไปจะลดลง ซึ่งหมายความว่าค่า PA " -"เดียวอาจไม่ได้เหมาะสมที่สุด 100% เสมอไปสำหรับคุณสมบัติทั้งหมด " -"และโดยปกติแล้วจะใช้ค่าประนีประนอมที่ไม่ทำให้เกิดการปูดมากเกินไปในคุณสมบัติที่มีความเร็วการไหลและความเร่งต่ำ " -"ขณะเดียวกันก็ไม่ทำให้เกิดช่องว่างในคุณสมบัติที่เร็วกว่า\n" +"ด้วยความเร็วในการพิมพ์ที่เพิ่มขึ้น (และด้วยเหตุนี้จึงเพิ่มการไหลเชิงปริมาตรผ่านหัวฉีด) และการเร่งความเร็วที่เพิ่มขึ้น พบว่าค่า PA ที่มีประสิทธิผลโดยทั่วไปจะลดลง ซึ่งหมายความว่าค่า PA เดียวอาจไม่ได้เหมาะสมที่สุด 100% เสมอไปสำหรับคุณสมบัติทั้งหมด และโดยปกติแล้วจะใช้ค่าประนีประนอมที่ไม่ทำให้เกิดการปูดมากเกินไปในคุณสมบัติที่มีความเร็วการไหลและความเร่งต่ำ ขณะเดียวกันก็ไม่ทำให้เกิดช่องว่างในคุณสมบัติที่เร็วกว่า\n" "\n" -"คุณลักษณะนี้มีจุดมุ่งหมายเพื่อแก้ไขข้อจำกัดนี้โดยการสร้างแบบจำลองการตอบสนองของระบบการอัดขึ้นรูปของเครื่องพิมพ์ของคุณ " -"โดยขึ้นอยู่กับความเร็วการไหลตามปริมาตรและความเร่งที่เครื่องพิมพ์ทำการพิมพ์ ภายใน " -"เครื่องพิมพ์จะสร้างแบบจำลองที่ติดตั้งไว้ซึ่งสามารถคาดเดาPressure " -"Advanceที่จำเป็นสำหรับความเร็วและความเร่งในการไหลตามปริมาตรที่กำหนด " -"ซึ่งจากนั้นจะปล่อยไปยังเครื่องพิมพ์โดยขึ้นอยู่กับสภาพการพิมพ์ในปัจจุบัน\n" +"คุณลักษณะนี้มีจุดมุ่งหมายเพื่อแก้ไขข้อจำกัดนี้โดยการสร้างแบบจำลองการตอบสนองของระบบการอัดขึ้นรูปของเครื่องพิมพ์ของคุณ โดยขึ้นอยู่กับความเร็วการไหลตามปริมาตรและความเร่งที่เครื่องพิมพ์ทำการพิมพ์ ภายใน เครื่องพิมพ์จะสร้างแบบจำลองที่ติดตั้งไว้ซึ่งสามารถคาดเดาPressure Advanceที่จำเป็นสำหรับความเร็วและความเร่งในการไหลตามปริมาตรที่กำหนด ซึ่งจากนั้นจะปล่อยไปยังเครื่องพิมพ์โดยขึ้นอยู่กับสภาพการพิมพ์ในปัจจุบัน\n" "\n" -"เมื่อเปิดใช้งาน ค่าล่วงหน้าของแรงดันด้านบนจะถูกแทนที่ อย่างไรก็ตาม " -"แนะนำให้ใช้ค่าเริ่มต้นที่สมเหตุสมผลด้านบนเพื่อเป็นทางเลือกและเมื่อมีการเปลี่ยนเครื่องมือ\n" +"เมื่อเปิดใช้งาน ค่าล่วงหน้าของแรงดันด้านบนจะถูกแทนที่ อย่างไรก็ตาม แนะนำให้ใช้ค่าเริ่มต้นที่สมเหตุสมผลด้านบนเพื่อเป็นทางเลือกและเมื่อมีการเปลี่ยนเครื่องมือ\n" msgid "Adaptive pressure advance measurements (beta)" msgstr "การวัดล่วงหน้าด้วยแรงดันแบบปรับได้ (เบต้า)" #, no-c-format, no-boost-format msgid "" -"Add sets of pressure advance (PA) values, the volumetric flow speeds and " -"accelerations they were measured at, separated by a comma. One set of values " -"per line. For example\n" +"Add sets of pressure advance (PA) values, the volumetric flow speeds and accelerations they were measured at, separated by a comma. One set of values per line. For example\n" "0.04,3.96,3000\n" "0.033,3.96,10000\n" "0.029,7.91,3000\n" "0.026,7.91,10000\n" "\n" "How to calibrate:\n" -"1. Run the pressure advance test for at least 3 speeds per acceleration " -"value. It is recommended that the test is run for at least the speed of the " -"external perimeters, the speed of the internal perimeters and the fastest " -"feature print speed in your profile (usually its the sparse or solid " -"infill). Then run them for the same speeds for the slowest and fastest print " -"accelerations, and no faster than the recommended maximum acceleration as " -"given by the Klipper input shaper\n" -"2. Take note of the optimal PA value for each volumetric flow speed and " -"acceleration. You can find the flow number by selecting flow from the color " -"scheme drop down and move the horizontal slider over the PA pattern lines. " -"The number should be visible at the bottom of the page. The ideal PA value " -"should be decreasing the higher the volumetric flow is. If it is not, " -"confirm that your extruder is functioning correctly. The slower and with " -"less acceleration you print, the larger the range of acceptable PA values. " -"If no difference is visible, use the PA value from the faster test\n" -"3. Enter the triplets of PA values, Flow and Accelerations in the text box " -"here and save your filament profile." +"1. Run the pressure advance test for at least 3 speeds per acceleration value. It is recommended that the test is run for at least the speed of the external perimeters, the speed of the internal perimeters and the fastest feature print speed in your profile (usually its the sparse or solid infill). Then run them for the same speeds for the slowest and fastest print accelerations, and no faster than the recommended maximum acceleration as given by the Klipper input shaper\n" +"2. Take note of the optimal PA value for each volumetric flow speed and acceleration. You can find the flow number by selecting flow from the color scheme drop down and move the horizontal slider over the PA pattern lines. The number should be visible at the bottom of the page. The ideal PA value should be decreasing the higher the volumetric flow is. If it is not, confirm that your extruder is functioning correctly. The slower and with less acceleration you print, the larger the range of acceptable PA values. If no difference is visible, use the PA value from the faster test\n" +"3. Enter the triplets of PA values, Flow and Accelerations in the text box here and save your filament profile." msgstr "" -"เพิ่มชุดของค่าความดันล่วงหน้า (PA) ความเร็วการไหลเชิงปริมาตร " -"และความเร่งที่วัดได้โดยคั่นด้วยเครื่องหมายจุลภาค หนึ่งชุดของค่าต่อบรรทัด ตัวอย่างเช่น\n" +"เพิ่มชุดของค่าความดันล่วงหน้า (PA) ความเร็วการไหลเชิงปริมาตร และความเร่งที่วัดได้โดยคั่นด้วยเครื่องหมายจุลภาค หนึ่งชุดของค่าต่อบรรทัด ตัวอย่างเช่น\n" "0.04,3.96,3000\n" "0.033,3.96,10000\n" "0.029,7.91,3000\n" "0.026,7.91,10000\n" "\n" "วิธีปรับเทียบ:\n" -"1. รันการทดสอบPressure Advanceอย่างน้อย 3 ความเร็วต่อค่าความเร่ง " -"ขอแนะนำให้ทำการทดสอบความเร็วของเส้นรอบวงภายนอก ความเร็วของเส้นรอบวงภายใน " -"และความเร็วการพิมพ์คุณลักษณะที่เร็วที่สุดในโปรไฟล์ของคุณเป็นอย่างน้อย " -"(โดยปกติจะเป็นการกรอกข้อมูลแบบเบาบางหรือทึบ) " -"จากนั้นรันด้วยความเร็วเท่ากันเพื่อการเร่งความเร็วการพิมพ์ที่ช้าที่สุดและเร็วที่สุด " -"และไม่เร็วกว่าการเร่งความเร็วสูงสุดที่แนะนำตามที่กำหนดโดย Klipper input Shaper\n" -"2. จดบันทึกค่า PA ที่เหมาะสมที่สุดสำหรับความเร็วการไหลและความเร่งตามปริมาตรแต่ละรายการ " -"คุณสามารถค้นหาหมายเลขโฟลว์ได้โดยเลือกโฟลว์จากรายการสีแบบเลื่อนลง " -"และเลื่อนแถบเลื่อนแนวนอนไปเหนือเส้นรูปแบบ PA หมายเลขควรปรากฏที่ด้านล่างของหน้า ค่า PA " -"ในอุดมคติควรลดลงตามอัตราการไหลตามปริมาตรที่สูงขึ้น หากไม่เป็นเช่นนั้น " -"ให้ยืนยันว่าชุดดันเส้นของคุณทำงานอย่างถูกต้อง ยิ่งคุณพิมพ์ช้าลงและเร่งความเร็วน้อยลง ช่วงของค่า PA " -"ที่ยอมรับได้ก็จะยิ่งมากขึ้นเท่านั้น หากไม่เห็นความแตกต่าง ให้ใช้ค่า PA จากการทดสอบที่เร็วกว่า\n" -"3. ป้อนค่า PA, การไหล และความเร่งสามเท่าในกล่องข้อความที่นี่ " -"และบันทึกโปรไฟล์เส้นพลาสติกของคุณ" +"1. รันการทดสอบPressure Advanceอย่างน้อย 3 ความเร็วต่อค่าความเร่ง ขอแนะนำให้ทำการทดสอบความเร็วของเส้นรอบวงภายนอก ความเร็วของเส้นรอบวงภายใน และความเร็วการพิมพ์คุณลักษณะที่เร็วที่สุดในโปรไฟล์ของคุณเป็นอย่างน้อย (โดยปกติจะเป็นการกรอกข้อมูลแบบเบาบางหรือทึบ) จากนั้นรันด้วยความเร็วเท่ากันเพื่อการเร่งความเร็วการพิมพ์ที่ช้าที่สุดและเร็วที่สุด และไม่เร็วกว่าการเร่งความเร็วสูงสุดที่แนะนำตามที่กำหนดโดย Klipper input Shaper\n" +"2. จดบันทึกค่า PA ที่เหมาะสมที่สุดสำหรับความเร็วการไหลและความเร่งตามปริมาตรแต่ละรายการ คุณสามารถค้นหาหมายเลขโฟลว์ได้โดยเลือกโฟลว์จากรายการสีแบบเลื่อนลง และเลื่อนแถบเลื่อนแนวนอนไปเหนือเส้นรูปแบบ PA หมายเลขควรปรากฏที่ด้านล่างของหน้า ค่า PA ในอุดมคติควรลดลงตามอัตราการไหลตามปริมาตรที่สูงขึ้น หากไม่เป็นเช่นนั้น ให้ยืนยันว่าชุดดันเส้นของคุณทำงานอย่างถูกต้อง ยิ่งคุณพิมพ์ช้าลงและเร่งความเร็วน้อยลง ช่วงของค่า PA ที่ยอมรับได้ก็จะยิ่งมากขึ้นเท่านั้น หากไม่เห็นความแตกต่าง ให้ใช้ค่า PA จากการทดสอบที่เร็วกว่า\n" +"3. ป้อนค่า PA, การไหล และความเร่งสามเท่าในกล่องข้อความที่นี่ และบันทึกโปรไฟล์เส้นพลาสติกของคุณ" msgid "Enable adaptive pressure advance for overhangs (beta)" msgstr "เปิดใช้งานการปรับPressure Advanceสำหรับระยะยื่น (เบต้า)" msgid "" -"Enable adaptive PA for overhangs as well as when flow changes within the " -"same feature. This is an experimental option, as if the PA profile is not " -"set accurately, it will cause uniformity issues on the external surfaces " -"before and after overhangs.\n" -"Not compatible with Prusa printers as they pause to process PA changes, " -"which causes delays and defects." +"Enable adaptive PA for overhangs as well as when flow changes within the same feature. This is an experimental option, as if the PA profile is not set accurately, it will cause uniformity issues on the external surfaces before and after overhangs.\n" +"Not compatible with Prusa printers as they pause to process PA changes, which causes delays and defects." msgstr "" -"เปิดใช้งาน PA แบบปรับตัวสำหรับส่วนยื่นและเมื่ออัตราการไหลเปลี่ยนภายในฟีเจอร์เดียวกัน " -"เป็นตัวเลือกทดลอง หากโปรไฟล์ PA ไม่แม่นยำ จะทำให้ผิวด้านนอกไม่สม่ำเสมอก่อนและหลังส่วนยื่น\n" -"ไม่รองรับเครื่องพิมพ์ Prusa เพราะจะหยุดชั่วคราวเพื่อประมวลผลการเปลี่ยน PA " -"ทำให้เกิดความล่าช้าและข้อบกพร่อง" +"เปิดใช้งาน PA แบบปรับตัวสำหรับส่วนยื่นและเมื่ออัตราการไหลเปลี่ยนภายในฟีเจอร์เดียวกัน เป็นตัวเลือกทดลอง หากโปรไฟล์ PA ไม่แม่นยำ จะทำให้ผิวด้านนอกไม่สม่ำเสมอก่อนและหลังส่วนยื่น\n" +"ไม่รองรับเครื่องพิมพ์ Prusa เพราะจะหยุดชั่วคราวเพื่อประมวลผลการเปลี่ยน PA ทำให้เกิดความล่าช้าและข้อบกพร่อง" msgid "Pressure advance for bridges" msgstr "แรงดันล่วงหน้า (Pressure Advance)สำหรับสะพาน" @@ -14148,66 +12310,40 @@ msgstr "แรงดันล่วงหน้า (Pressure Advance)สำห msgid "" "Pressure advance value for bridges. Set to 0 to disable.\n" "\n" -"A lower PA value when printing bridges helps reduce the appearance of slight " -"under extrusion immediately after bridges. This is caused by the pressure " -"drop in the nozzle when printing in the air and a lower PA helps counteract " -"this." +"A lower PA value when printing bridges helps reduce the appearance of slight under extrusion immediately after bridges. This is caused by the pressure drop in the nozzle when printing in the air and a lower PA helps counteract this." msgstr "" "ค่าPressure Advanceสำหรับสะพาน ตั้งค่าเป็น 0 เพื่อปิดใช้งาน\n" "\n" -"ค่า PA ที่ต่ำลงเมื่อพิมพ์บริดจ์จะช่วยลดลักษณะที่ปรากฏเล็กน้อยจากการอัดขึ้นรูปทันทีหลังจากบริดจ์ " -"สาเหตุนี้เกิดจากแรงดันตกในหัวฉีดเมื่อพิมพ์ในอากาศ และค่า PA ที่ต่ำกว่าจะช่วยแก้ปัญหานี้ได้" +"ค่า PA ที่ต่ำลงเมื่อพิมพ์บริดจ์จะช่วยลดลักษณะที่ปรากฏเล็กน้อยจากการอัดขึ้นรูปทันทีหลังจากบริดจ์ สาเหตุนี้เกิดจากแรงดันตกในหัวฉีดเมื่อพิมพ์ในอากาศ และค่า PA ที่ต่ำกว่าจะช่วยแก้ปัญหานี้ได้" -msgid "" -"Default line width if other line widths are set to 0. If expressed as a %, " -"it will be computed over the nozzle diameter." -msgstr "" -"ความกว้างของเส้นเริ่มต้นหากความกว้างของเส้นอื่นตั้งค่าเป็น 0 หากแสดงเป็น % " -"ระบบจะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" +msgid "Default line width if other line widths are set to 0. If expressed as a %, it will be computed over the nozzle diameter." +msgstr "ความกว้างของเส้นเริ่มต้นหากความกว้างของเส้นอื่นตั้งค่าเป็น 0 หากแสดงเป็น % ระบบจะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" msgid "Keep fan always on" msgstr "เปิดพัดลมไว้ตลอดเวลา" -msgid "" -"Enabling this setting means that part cooling fan will never stop entirely " -"and will instead run at least at minimum speed to reduce the frequency of " -"starting and stopping." -msgstr "" -"การเปิดใช้งานการตั้งค่านี้หมายความว่าพัดลมระบายความร้อนของชิ้นส่วนจะไม่หยุดทำงานโดยสิ้นเชิง " -"และจะทำงานที่ความเร็วขั้นต่ำเป็นอย่างน้อยเพื่อลดความถี่ในการสตาร์ทและหยุด" +msgid "Enabling this setting means that part cooling fan will never stop entirely and will instead run at least at minimum speed to reduce the frequency of starting and stopping." +msgstr "การเปิดใช้งานการตั้งค่านี้หมายความว่าพัดลมระบายความร้อนของชิ้นส่วนจะไม่หยุดทำงานโดยสิ้นเชิง และจะทำงานที่ความเร็วขั้นต่ำเป็นอย่างน้อยเพื่อลดความถี่ในการสตาร์ทและหยุด" msgid "Don't slow down outer walls" msgstr "อย่าทำให้ผนังด้านนอกช้าลง" msgid "" -"If enabled, this setting will ensure external perimeters are not slowed down " -"to meet the minimum layer time. This is particularly helpful in the below " -"scenarios:\n" +"If enabled, this setting will ensure external perimeters are not slowed down to meet the minimum layer time. This is particularly helpful in the below scenarios:\n" "1. To avoid changes in shine when printing glossy filaments\n" -"2. To avoid changes in external wall speed which may create slight wall " -"artifacts that appear like Z banding\n" -"3. To avoid printing at speeds which cause VFAs (fine artifacts) on the " -"external walls" +"2. To avoid changes in external wall speed which may create slight wall artifacts that appear like Z banding\n" +"3. To avoid printing at speeds which cause VFAs (fine artifacts) on the external walls" msgstr "" -"หากเปิดใช้งาน " -"การตั้งค่านี้จะช่วยให้แน่ใจว่าขอบเขตภายนอกจะไม่ช้าลงเพื่อให้ตรงตามเวลาขั้นต่ำของเลเยอร์ " -"สิ่งนี้มีประโยชน์อย่างยิ่งในสถานการณ์ด้านล่าง:\n" +"หากเปิดใช้งาน การตั้งค่านี้จะช่วยให้แน่ใจว่าขอบเขตภายนอกจะไม่ช้าลงเพื่อให้ตรงตามเวลาขั้นต่ำของเลเยอร์ สิ่งนี้มีประโยชน์อย่างยิ่งในสถานการณ์ด้านล่าง:\n" "1. เพื่อหลีกเลี่ยงการเปลี่ยนแปลงความมันเงาเมื่อพิมพ์เส้นพลาสติกมัน\n" -"2. " -"เพื่อหลีกเลี่ยงการเปลี่ยนแปลงความเร็วของผนังภายนอกซึ่งอาจสร้างสิ่งรบกวนผนังเล็กน้อยที่ดูเหมือนแถบ " -"Z\n" +"2. เพื่อหลีกเลี่ยงการเปลี่ยนแปลงความเร็วของผนังภายนอกซึ่งอาจสร้างสิ่งรบกวนผนังเล็กน้อยที่ดูเหมือนแถบ Z\n" "3. เพื่อหลีกเลี่ยงการพิมพ์ด้วยความเร็วซึ่งทำให้เกิด VFA (สิ่งประดิษฐ์ที่ดี) บนผนังภายนอก" msgid "Layer time" msgstr "เวลาเลเยอร์" -msgid "" -"The part cooling fan will be enabled for layers where the estimated time is " -"shorter than this value. Fan speed is interpolated between the minimum and " -"maximum fan speeds according to layer printing time." -msgstr "" -"พัดลมระบายความร้อนบางส่วนจะถูกเปิดใช้งานสำหรับเลเยอร์ที่เวลาโดยประมาณสั้นกว่าค่านี้ " -"ความเร็วพัดลมจะถูกประมาณค่าระหว่างความเร็วพัดลมขั้นต่ำและสูงสุดตามเวลาการพิมพ์เลเยอร์" +msgid "The part cooling fan will be enabled for layers where the estimated time is shorter than this value. Fan speed is interpolated between the minimum and maximum fan speeds according to layer printing time." +msgstr "พัดลมระบายความร้อนบางส่วนจะถูกเปิดใช้งานสำหรับเลเยอร์ที่เวลาโดยประมาณสั้นกว่าค่านี้ ความเร็วพัดลมจะถูกประมาณค่าระหว่างความเร็วพัดลมขั้นต่ำและสูงสุดตามเวลาการพิมพ์เลเยอร์" msgid "s" msgstr "วินาที" @@ -14231,11 +12367,8 @@ msgstr "คุณสามารถใส่บันทึกของคุณ msgid "Required nozzle HRC" msgstr "หัวฉีด HRC ที่จำเป็น" -msgid "" -"Minimum HRC of nozzle required to print the filament. A value of 0 means no " -"checking of the nozzle's HRC." -msgstr "" -"HRC ขั้นต่ำของหัวฉีดที่จำเป็นสำหรับการพิมพ์เส้นพลาสติก ศูนย์หมายถึงไม่มีการตรวจสอบ HRC ของหัวฉีด" +msgid "Minimum HRC of nozzle required to print the filament. A value of 0 means no checking of the nozzle's HRC." +msgstr "HRC ขั้นต่ำของหัวฉีดที่จำเป็นสำหรับการพิมพ์เส้นพลาสติก ศูนย์หมายถึงไม่มีการตรวจสอบ HRC ของหัวฉีด" msgid "Filament map to extruder" msgstr "แผนที่เส้นพลาสติกไปยังชุดดันเส้น" @@ -14264,74 +12397,41 @@ msgstr "เครื่องพิมพ์มีฮาร์ดแวร์ต msgid "Flush temperature" msgstr "อุณหภูมิไล่เส้น" -msgid "" -"Temperature when flushing filament. 0 indicates the upper bound of the " -"recommended nozzle temperature range." +msgid "Temperature when flushing filament. 0 indicates the upper bound of the recommended nozzle temperature range." msgstr "อุณหภูมิเมื่อทำการล้างเส้นพลาสติก 0 หมายถึงขอบเขตบนของช่วงอุณหภูมิหัวฉีดที่แนะนำ" msgid "Flush volumetric speed" msgstr "ความเร็วเชิงปริมาตรไล่เส้น" -msgid "" -"Volumetric speed when flushing filament. 0 indicates the max volumetric " -"speed." +msgid "Volumetric speed when flushing filament. 0 indicates the max volumetric speed." msgstr "ความเร็วตามปริมาตรเมื่อทำการล้างเส้นพลาสติก 0 หมายถึงความเร็วปริมาตรสูงสุด" -msgid "" -"This setting is the volume of filament that can be melted and extruded per " -"second. Printing speed is limited by max volumetric speed, in case of too " -"high and unreasonable speed setting. This value cannot be zero." -msgstr "" -"การตั้งค่านี้หมายถึงปริมาณเส้นพลาสติกที่สามารถหลอมและอัดขึ้นรูปต่อวินาทีได้ " -"ความเร็วในการพิมพ์จะถูกจำกัดด้วยความเร็วปริมาตรสูงสุด " -"ในกรณีที่ตั้งค่าความเร็วไว้สูงเกินไปและไม่เหมาะสม ไม่สามารถเป็นศูนย์ได้" +msgid "This setting is the volume of filament that can be melted and extruded per second. Printing speed is limited by max volumetric speed, in case of too high and unreasonable speed setting. This value cannot be zero." +msgstr "การตั้งค่านี้หมายถึงปริมาณเส้นพลาสติกที่สามารถหลอมและอัดขึ้นรูปต่อวินาทีได้ ความเร็วในการพิมพ์จะถูกจำกัดด้วยความเร็วปริมาตรสูงสุด ในกรณีที่ตั้งค่าความเร็วไว้สูงเกินไปและไม่เหมาะสม ไม่สามารถเป็นศูนย์ได้" msgid "Filament load time" msgstr "เวลาในการโหลดเส้นพลาสติก" -msgid "" -"Time to load new filament when switch filament. It's usually applicable for " -"single-extruder multi-material machines. For tool changers or multi-tool " -"machines, it's typically 0. For statistics only." -msgstr "" -"เวลาในการโหลดเส้นพลาสติกใหม่เมื่อเปลี่ยนเส้นพลาสติก " -"โดยปกติแล้วจะใช้ได้กับเครื่องจักรที่ใช้วัสดุหลายชุดดันเส้นเดี่ยว " -"สำหรับเครื่องเปลี่ยนเครื่องมือหรือเครื่องจักรหลายเครื่องมือ โดยทั่วไปจะเป็น 0 สำหรับสถิติเท่านั้น" +msgid "Time to load new filament when switch filament. It's usually applicable for single-extruder multi-material machines. For tool changers or multi-tool machines, it's typically 0. For statistics only." +msgstr "เวลาในการโหลดเส้นพลาสติกใหม่เมื่อเปลี่ยนเส้นพลาสติก โดยปกติแล้วจะใช้ได้กับเครื่องจักรที่ใช้วัสดุหลายชุดดันเส้นเดี่ยว สำหรับเครื่องเปลี่ยนเครื่องมือหรือเครื่องจักรหลายเครื่องมือ โดยทั่วไปจะเป็น 0 สำหรับสถิติเท่านั้น" msgid "Filament unload time" msgstr "เวลาขนถ่ายเส้นพลาสติก" -msgid "" -"Time to unload old filament when switch filament. It's usually applicable " -"for single-extruder multi-material machines. For tool changers or multi-tool " -"machines, it's typically 0. For statistics only." -msgstr "" -"ถึงเวลาขนเส้นพลาสติกเก่าออกเมื่อเปลี่ยนเส้นพลาสติก " -"โดยปกติแล้วจะใช้ได้กับเครื่องจักรที่ใช้วัสดุหลายชุดดันเส้นเดี่ยว " -"สำหรับเครื่องเปลี่ยนเครื่องมือหรือเครื่องจักรหลายเครื่องมือ โดยทั่วไปจะเป็น 0 สำหรับสถิติเท่านั้น" +msgid "Time to unload old filament when switch filament. It's usually applicable for single-extruder multi-material machines. For tool changers or multi-tool machines, it's typically 0. For statistics only." +msgstr "ถึงเวลาขนเส้นพลาสติกเก่าออกเมื่อเปลี่ยนเส้นพลาสติก โดยปกติแล้วจะใช้ได้กับเครื่องจักรที่ใช้วัสดุหลายชุดดันเส้นเดี่ยว สำหรับเครื่องเปลี่ยนเครื่องมือหรือเครื่องจักรหลายเครื่องมือ โดยทั่วไปจะเป็น 0 สำหรับสถิติเท่านั้น" msgid "Tool change time" msgstr "เวลาเปลี่ยนเครื่องมือ" -msgid "" -"Time taken to switch tools. It's usually applicable for tool changers or " -"multi-tool machines. For single-extruder multi-material machines, it's " -"typically 0. For statistics only." -msgstr "" -"เวลาที่ใช้ในการเปลี่ยนเครื่องมือ " -"โดยปกติแล้วจะใช้ได้กับเครื่องเปลี่ยนเครื่องมือหรือเครื่องจักรที่มีเครื่องมือหลายเครื่องมือ " -"สำหรับเครื่องจักรที่ใช้วัสดุหลายชนิดโดยใช้ชุดดันเส้นเดี่ยว โดยทั่วไปจะเป็น 0 สำหรับสถิติเท่านั้น" +msgid "Time taken to switch tools. It's usually applicable for tool changers or multi-tool machines. For single-extruder multi-material machines, it's typically 0. For statistics only." +msgstr "เวลาที่ใช้ในการเปลี่ยนเครื่องมือ โดยปกติแล้วจะใช้ได้กับเครื่องเปลี่ยนเครื่องมือหรือเครื่องจักรที่มีเครื่องมือหลายเครื่องมือ สำหรับเครื่องจักรที่ใช้วัสดุหลายชนิดโดยใช้ชุดดันเส้นเดี่ยว โดยทั่วไปจะเป็น 0 สำหรับสถิติเท่านั้น" msgid "Bed temperature type" msgstr "ประเภทอุณหภูมิฐานพิมพ์" -msgid "" -"This option determines how the bed temperature is set during slicing: based " -"on the temperature of the first filament or the highest temperature of the " -"printed filaments." -msgstr "" -"ตัวเลือกนี้จะกำหนดวิธีการตั้งค่าอุณหภูมิฐานในระหว่างการสไลซ์: " -"ขึ้นอยู่กับอุณหภูมิของเส้นพลาสติกเส้นแรกหรืออุณหภูมิสูงสุดของเส้นพลาสติกที่พิมพ์" +msgid "This option determines how the bed temperature is set during slicing: based on the temperature of the first filament or the highest temperature of the printed filaments." +msgstr "ตัวเลือกนี้จะกำหนดวิธีการตั้งค่าอุณหภูมิฐานในระหว่างการสไลซ์: ขึ้นอยู่กับอุณหภูมิของเส้นพลาสติกเส้นแรกหรืออุณหภูมิสูงสุดของเส้นพลาสติกที่พิมพ์" msgid "By First filament" msgstr "โดย เฟิร์ส ฟิลาเมนท์" @@ -14339,27 +12439,20 @@ msgstr "โดย เฟิร์ส ฟิลาเมนท์" msgid "By Highest Temp" msgstr "โดยอุณหภูมิสูงสุด" -msgid "" -"Filament diameter is used to calculate extrusion variables in G-code, so it " -"is important that this is accurate and precise." -msgstr "" -"เส้นผ่านศูนย์กลางของฟิลาเมนต์ใช้ในการคำนวณการอัดขึ้นรูปใน G-code " -"ดังนั้นจึงมีความสำคัญและควรมีความแม่นยำ" +msgid "Filament diameter is used to calculate extrusion variables in G-code, so it is important that this is accurate and precise." +msgstr "เส้นผ่านศูนย์กลางของฟิลาเมนต์ใช้ในการคำนวณการอัดขึ้นรูปใน G-code ดังนั้นจึงมีความสำคัญและควรมีความแม่นยำ" msgid "Pellet flow coefficient" msgstr "ค่าสัมประสิทธิ์การไหลของเม็ด" msgid "" -"Pellet flow coefficient is empirically derived and allows for volume " -"calculation for pellet printers.\n" +"Pellet flow coefficient is empirically derived and allows for volume calculation for pellet printers.\n" "\n" -"Internally it is converted to filament_diameter. All other volume " -"calculations remain the same.\n" +"Internally it is converted to filament_diameter. All other volume calculations remain the same.\n" "\n" "filament_diameter = sqrt( (4 * pellet_flow_coefficient) / PI )" msgstr "" -"ค่าสัมประสิทธิ์การไหลของเม็ดได้มาจากการทดลอง " -"และช่วยให้สามารถคำนวณปริมาตรสำหรับเครื่องพิมพ์เม็ดพลาสติกได้\n" +"ค่าสัมประสิทธิ์การไหลของเม็ดได้มาจากการทดลอง และช่วยให้สามารถคำนวณปริมาตรสำหรับเครื่องพิมพ์เม็ดพลาสติกได้\n" "\n" "ภายในจะถูกแปลงเป็น fil_diameter การคำนวณปริมาณอื่นๆ ทั้งหมดยังคงเหมือนเดิม\n" "\n" @@ -14369,19 +12462,13 @@ msgid "Adaptive volumetric speed" msgstr "ความเร็วตามปริมาตรแบบปรับได้" msgid "" -"When enabled, the extrusion flow is limited by the smaller of the fitted " -"value (calculated from line width and layer height) and the user-defined " -"maximum flow. When disabled, only the user-defined maximum flow is applied.\n" +"When enabled, the extrusion flow is limited by the smaller of the fitted value (calculated from line width and layer height) and the user-defined maximum flow. When disabled, only the user-defined maximum flow is applied.\n" "\n" -"Note: Experimental and incomplete feature imported from BBS. Functional for " -"some profiles that already have the variable saved." +"Note: Experimental and incomplete feature imported from BBS. Functional for some profiles that already have the variable saved." msgstr "" -"เมื่อเปิดใช้งาน การไหลของการอัดขึ้นรูปจะถูกจำกัดด้วยค่าที่น้อยกว่าของค่าที่ติดตั้ง " -"(คำนวณจากความกว้างของเส้นและความสูงของชั้น) และการไหลสูงสุดที่ผู้ใช้กำหนด เมื่อปิดใช้งาน " -"จะมีการใช้เฉพาะโฟลว์สูงสุดที่ผู้ใช้กำหนดเท่านั้น\n" +"เมื่อเปิดใช้งาน การไหลของการอัดขึ้นรูปจะถูกจำกัดด้วยค่าที่น้อยกว่าของค่าที่ติดตั้ง (คำนวณจากความกว้างของเส้นและความสูงของชั้น) และการไหลสูงสุดที่ผู้ใช้กำหนด เมื่อปิดใช้งาน จะมีการใช้เฉพาะโฟลว์สูงสุดที่ผู้ใช้กำหนดเท่านั้น\n" "\n" -"หมายเหตุ: คุณลักษณะทดลองและไม่สมบูรณ์นำเข้าจาก BBS " -"ใช้งานได้กับบางโปรไฟล์ที่ได้บันทึกตัวแปรไว้แล้ว" +"หมายเหตุ: คุณลักษณะทดลองและไม่สมบูรณ์นำเข้าจาก BBS ใช้งานได้กับบางโปรไฟล์ที่ได้บันทึกตัวแปรไว้แล้ว" msgid "Max volumetric speed multinomial coefficients" msgstr "ค่าสัมประสิทธิ์พหุนามความเร็วปริมาตรสูงสุด" @@ -14391,30 +12478,18 @@ msgstr "การหดตัว (XY)" #, no-c-format, no-boost-format msgid "" -"Enter the shrinkage percentage that the filament will get after cooling (94% " -"if you measure 94mm instead of 100mm). The part will be scaled in XY to " -"compensate. For multi-material prints, ensure filament shrinkage matches " -"across all used filaments\n" -"Be sure to allow enough space between objects, as this compensation is done " -"after the checks." +"Enter the shrinkage percentage that the filament will get after cooling (94% if you measure 94mm instead of 100mm). The part will be scaled in XY to compensate. For multi-material prints, ensure filament shrinkage matches across all used filaments\n" +"Be sure to allow enough space between objects, as this compensation is done after the checks." msgstr "" -"ป้อนเปอร์เซ็นต์การหดตัวที่เส้นพลาสติกจะได้รับหลังจากการทำความเย็น (94% หากคุณวัด 94 มม. " -"แทนที่จะเป็น 100 มม.) ชิ้นส่วนจะถูกปรับขนาดเป็น XY เพื่อชดเชย สำหรับการพิมพ์แบบหลายวัสดุ " -"ตรวจสอบให้แน่ใจว่าการหดตัวของเส้นพลาสติกตรงกันกับเส้นพลาสติกที่ใช้ทั้งหมด\n" -"ตรวจสอบให้แน่ใจว่าได้เว้นระยะห่างระหว่างวัตถุเพียงพอ " -"เนื่องจากการชดเชยนี้เสร็จสิ้นหลังจากการตรวจสอบ" +"ป้อนเปอร์เซ็นต์การหดตัวที่เส้นพลาสติกจะได้รับหลังจากการทำความเย็น (94% หากคุณวัด 94 มม. แทนที่จะเป็น 100 มม.) ชิ้นส่วนจะถูกปรับขนาดเป็น XY เพื่อชดเชย สำหรับการพิมพ์แบบหลายวัสดุ ตรวจสอบให้แน่ใจว่าการหดตัวของเส้นพลาสติกตรงกันกับเส้นพลาสติกที่ใช้ทั้งหมด\n" +"ตรวจสอบให้แน่ใจว่าได้เว้นระยะห่างระหว่างวัตถุเพียงพอ เนื่องจากการชดเชยนี้เสร็จสิ้นหลังจากการตรวจสอบ" msgid "Shrinkage (Z)" msgstr "การหดตัว (Z)" #, no-c-format, no-boost-format -msgid "" -"Enter the shrinkage percentage that the filament will get after cooling (94% " -"if you measure 94mm instead of 100mm). The part will be scaled in Z to " -"compensate." -msgstr "" -"ป้อนเปอร์เซ็นต์การหดตัวที่เส้นพลาสติกจะได้รับหลังจากการทำความเย็น (94% หากคุณวัด 94 มม. " -"แทนที่จะเป็น 100 มม.) ชิ้นส่วนจะถูกปรับขนาดเป็น Z เพื่อชดเชย" +msgid "Enter the shrinkage percentage that the filament will get after cooling (94% if you measure 94mm instead of 100mm). The part will be scaled in Z to compensate." +msgstr "ป้อนเปอร์เซ็นต์การหดตัวที่เส้นพลาสติกจะได้รับหลังจากการทำความเย็น (94% หากคุณวัด 94 มม. แทนที่จะเป็น 100 มม.) ชิ้นส่วนจะถูกปรับขนาดเป็น Z เพื่อชดเชย" msgid "Adhesiveness Category" msgstr "หมวดหมู่การยึดเกาะ" @@ -14437,39 +12512,26 @@ msgstr "ความเร็วที่ใช้ในช่วงเริ่ msgid "Unloading speed" msgstr "ความเร็วในการขนถ่าย" -msgid "" -"Speed used for unloading the filament on the wipe tower (does not affect " -"initial part of unloading just after ramming)." -msgstr "" -"ความเร็วที่ใช้ในการขนถ่ายเส้นพลาสติกบนไวด์ทาวเวอร์ " -"(ไม่ส่งผลต่อส่วนเริ่มแรกของการขนถ่ายหลังจากการชน)" +msgid "Speed used for unloading the filament on the wipe tower (does not affect initial part of unloading just after ramming)." +msgstr "ความเร็วที่ใช้ในการขนถ่ายเส้นพลาสติกบนไวด์ทาวเวอร์ (ไม่ส่งผลต่อส่วนเริ่มแรกของการขนถ่ายหลังจากการชน)" msgid "Unloading speed at the start" msgstr "ขนถ่ายความเร็วที่จุดเริ่มต้น" -msgid "" -"Speed used for unloading the tip of the filament immediately after ramming." +msgid "Speed used for unloading the tip of the filament immediately after ramming." msgstr "ความเร็วที่ใช้ในการขนถ่ายปลายเส้นพลาสติกทันทีหลังจากการชน" msgid "Delay after unloading" msgstr "ความล่าช้าหลังจากการขนถ่าย" -msgid "" -"Time to wait after the filament is unloaded. May help to get reliable tool " -"changes with flexible materials that may need more time to shrink to " -"original dimensions." -msgstr "" -"เวลาที่ต้องรอหลังจากขนเส้นพลาสติกออก " -"อาจช่วยให้มีการเปลี่ยนเครื่องมือที่เชื่อถือได้ด้วยวัสดุที่ยืดหยุ่นซึ่งอาจต้องใช้เวลามากขึ้นในการย่อขนาดให้เป็นขนาดดั้งเดิม" +msgid "Time to wait after the filament is unloaded. May help to get reliable tool changes with flexible materials that may need more time to shrink to original dimensions." +msgstr "เวลาที่ต้องรอหลังจากขนเส้นพลาสติกออก อาจช่วยให้มีการเปลี่ยนเครื่องมือที่เชื่อถือได้ด้วยวัสดุที่ยืดหยุ่นซึ่งอาจต้องใช้เวลามากขึ้นในการย่อขนาดให้เป็นขนาดดั้งเดิม" msgid "Number of cooling moves" msgstr "จำนวนการเคลื่อนย้ายความเย็น" -msgid "" -"Filament is cooled by being moved back and forth in the cooling tubes. " -"Specify desired number of these moves." -msgstr "" -"เส้นพลาสติกถูกทำให้เย็นลงโดยการเคลื่อนไปมาในท่อทำความเย็น ระบุจำนวนการเคลื่อนไหวที่ต้องการ" +msgid "Filament is cooled by being moved back and forth in the cooling tubes. Specify desired number of these moves." +msgstr "เส้นพลาสติกถูกทำให้เย็นลงโดยการเคลื่อนไปมาในท่อทำความเย็น ระบุจำนวนการเคลื่อนไหวที่ต้องการ" msgid "Stamping loading speed" msgstr "ความเร็วในการโหลดการประทับตรา" @@ -14480,14 +12542,8 @@ msgstr "ความเร็วที่ใช้ในการประทั msgid "Stamping distance measured from the center of the cooling tube" msgstr "ระยะการตอกวัดจากศูนย์กลางของท่อทำความเย็น" -msgid "" -"If set to non-zero value, filament is moved toward the nozzle between the " -"individual cooling moves (\"stamping\"). This option configures how long " -"this movement should be before the filament is retracted again." -msgstr "" -"หากตั้งค่าเป็นค่าที่ไม่ใช่ศูนย์ เส้นพลาสติกจะถูกย้ายไปยังหัวฉีดระหว่างการระบายความร้อนแต่ละครั้ง " -"(\"การประทับตรา\") " -"ตัวเลือกนี้จะกำหนดระยะเวลาการเคลื่อนไหวนี้ก่อนที่เส้นพลาสติกจะถูกดึงกลับอีกครั้ง" +msgid "If set to non-zero value, filament is moved toward the nozzle between the individual cooling moves (\"stamping\"). This option configures how long this movement should be before the filament is retracted again." +msgstr "หากตั้งค่าเป็นค่าที่ไม่ใช่ศูนย์ เส้นพลาสติกจะถูกย้ายไปยังหัวฉีดระหว่างการระบายความร้อนแต่ละครั้ง (\"การประทับตรา\") ตัวเลือกนี้จะกำหนดระยะเวลาการเคลื่อนไหวนี้ก่อนที่เส้นพลาสติกจะถูกดึงกลับอีกครั้ง" msgid "Speed of the first cooling move" msgstr "ความเร็วของการทำความเย็นครั้งแรก" @@ -14498,17 +12554,8 @@ msgstr "การเคลื่อนไหวที่เย็นลงจะ msgid "Minimal purge on wipe tower" msgstr "การล้างข้อมูลบน Wipe Tower น้อยที่สุด" -msgid "" -"After a tool change, the exact position of the newly loaded filament inside " -"the nozzle may not be known, and the filament pressure is likely not yet " -"stable. Before purging the print head into an infill or a sacrificial " -"object, Orca Slicer will always prime this amount of material into the wipe " -"tower to produce successive infill or sacrificial object extrusions reliably." -msgstr "" -"หลังจากเปลี่ยนเครื่องมือ อาจไม่ทราบตำแหน่งที่แน่นอนของเส้นพลาสติกที่เพิ่งโหลดใหม่ภายในหัวฉีด " -"และความดันเส้นพลาสติกก็มีแนวโน้มว่ายังไม่เสถียร ก่อนที่จะล้างหัวพิมพ์ลงในวัสดุไส้ในหรือวัตถุบูชายัญ " -"Orca Slicer " -"จะเตรียมวัสดุจำนวนนี้ลงในหอเช็ดเสมอเพื่อสร้างการอัดขึ้นรูปวัตถุแบบไส้ในหรือบูชายัญต่อเนื่องกันอย่างน่าเชื่อถือ" +msgid "After a tool change, the exact position of the newly loaded filament inside the nozzle may not be known, and the filament pressure is likely not yet stable. Before purging the print head into an infill or a sacrificial object, Orca Slicer will always prime this amount of material into the wipe tower to produce successive infill or sacrificial object extrusions reliably." +msgstr "หลังจากเปลี่ยนเครื่องมือ อาจไม่ทราบตำแหน่งที่แน่นอนของเส้นพลาสติกที่เพิ่งโหลดใหม่ภายในหัวฉีด และความดันเส้นพลาสติกก็มีแนวโน้มว่ายังไม่เสถียร ก่อนที่จะล้างหัวพิมพ์ลงในวัสดุไส้ในหรือวัตถุบูชายัญ Orca Slicer จะเตรียมวัสดุจำนวนนี้ลงในหอเช็ดเสมอเพื่อสร้างการอัดขึ้นรูปวัตถุแบบไส้ในหรือบูชายัญต่อเนื่องกันอย่างน่าเชื่อถือ" msgid "Wipe tower cooling" msgstr "เช็ดทาวเวอร์คูลลิ่ง" @@ -14519,27 +12566,19 @@ msgstr "อุณหภูมิลดลงก่อนเข้าหอใย msgid "Interface layer pre-extrusion distance" msgstr "ระยะการอัดรีดชั้นอินเตอร์เฟซ" -msgid "" -"Pre-extrusion distance for prime tower interface layer (where different " -"materials meet)." -msgstr "" -"ระยะก่อนการอัดขึ้นรูปสำหรับชั้นอินเทอร์เฟซของไพรม์ทาวเวอร์ (ที่วัสดุที่แตกต่างกันมาบรรจบกัน)" +msgid "Pre-extrusion distance for prime tower interface layer (where different materials meet)." +msgstr "ระยะก่อนการอัดขึ้นรูปสำหรับชั้นอินเทอร์เฟซของไพรม์ทาวเวอร์ (ที่วัสดุที่แตกต่างกันมาบรรจบกัน)" msgid "Interface layer pre-extrusion length" msgstr "ความยาวชั้นอินเตอร์เฟซก่อนการอัดขึ้นรูป" -msgid "" -"Pre-extrusion length for prime tower interface layer (where different " -"materials meet)." -msgstr "" -"ความยาวก่อนการอัดขึ้นรูปสำหรับชั้นอินเทอร์เฟซของไพรม์ทาวเวอร์ (ที่วัสดุที่แตกต่างกันมาบรรจบกัน)" +msgid "Pre-extrusion length for prime tower interface layer (where different materials meet)." +msgstr "ความยาวก่อนการอัดขึ้นรูปสำหรับชั้นอินเทอร์เฟซของไพรม์ทาวเวอร์ (ที่วัสดุที่แตกต่างกันมาบรรจบกัน)" msgid "Tower ironing area" msgstr "พื้นที่รีดผิวแบบทาวเวอร์" -msgid "" -"Ironing area for prime tower interface layer (where different materials " -"meet)." +msgid "Ironing area for prime tower interface layer (where different materials meet)." msgstr "พื้นที่รีดผิวสำหรับชั้นอินเทอร์เฟซของไพร์มทาวเวอร์ (บริเวณที่วัสดุต่างกันมาบรรจบกัน)" msgid "mm²" @@ -14548,20 +12587,14 @@ msgstr "มม.²" msgid "Interface layer purge length" msgstr "ความยาวการล้างเลเยอร์อินเทอร์เฟซ" -msgid "" -"Purge length for prime tower interface layer (where different materials " -"meet)." +msgid "Purge length for prime tower interface layer (where different materials meet)." msgstr "ความยาวในการไล่ล้างสำหรับชั้นอินเทอร์เฟซของไพรม์ทาวเวอร์ (เมื่อวัสดุต่างกันมาบรรจบกัน)" msgid "Interface layer print temperature" msgstr "อุณหภูมิการพิมพ์เลเยอร์อินเทอร์เฟซ" -msgid "" -"Print temperature for prime tower interface layer (where different materials " -"meet). If set to -1, use max recommended nozzle temperature." -msgstr "" -"อุณหภูมิการพิมพ์สำหรับชั้นอินเทอร์เฟซของไพรม์ทาวเวอร์ (เมื่อวัสดุต่างกันมาบรรจบกัน) หากตั้งค่าเป็น " -"-1 ให้ใช้อุณหภูมิหัวฉีดสูงสุดที่แนะนำ" +msgid "Print temperature for prime tower interface layer (where different materials meet). If set to -1, use max recommended nozzle temperature." +msgstr "อุณหภูมิการพิมพ์สำหรับชั้นอินเทอร์เฟซของไพรม์ทาวเวอร์ (เมื่อวัสดุต่างกันมาบรรจบกัน) หากตั้งค่าเป็น -1 ให้ใช้อุณหภูมิหัวฉีดสูงสุดที่แนะนำ" msgid "Speed of the last cooling move" msgstr "ความเร็วของการทำความเย็นครั้งล่าสุด" @@ -14572,24 +12605,14 @@ msgstr "การเคลื่อนไหวที่เย็นลงจะ msgid "Ramming parameters" msgstr "พารามิเตอร์การกระแทก" -msgid "" -"This string is edited by RammingDialog and contains ramming specific " -"parameters." +msgid "This string is edited by RammingDialog and contains ramming specific parameters." msgstr "สตริงนี้ได้รับการแก้ไขโดย RammingDialog และมีพารามิเตอร์เฉพาะของการชน" msgid "Enable ramming for multi-tool setups" msgstr "เปิดใช้งานการกระแทกสำหรับการตั้งค่าหลายเครื่องมือ" -msgid "" -"Perform ramming when using multi-tool printer (i.e. when the 'Single " -"Extruder Multimaterial' in Printer Settings is unchecked). When checked, a " -"small amount of filament is rapidly extruded on the wipe tower just before " -"the tool change. This option is only used when the wipe tower is enabled." -msgstr "" -"ทำการกระแทกเมื่อใช้เครื่องพิมพ์แบบหลายเครื่องมือ (เช่น เมื่อไม่ได้เลือก 'Single ชุดดันเส้น " -"Multimaterial' ในการตั้งค่าเครื่องพิมพ์) เมื่อตรวจสอบแล้ว " -"เส้นพลาสติกจำนวนเล็กน้อยจะถูกอัดรีดอย่างรวดเร็วบนไวด์ทาวเวอร์ก่อนที่จะเปลี่ยนเครื่องมือ " -"ตัวเลือกนี้ใช้เฉพาะเมื่อเปิดใช้งาน Wipe Tower เท่านั้น" +msgid "Perform ramming when using multi-tool printer (i.e. when the 'Single Extruder Multimaterial' in Printer Settings is unchecked). When checked, a small amount of filament is rapidly extruded on the wipe tower just before the tool change. This option is only used when the wipe tower is enabled." +msgstr "ทำการกระแทกเมื่อใช้เครื่องพิมพ์แบบหลายเครื่องมือ (เช่น เมื่อไม่ได้เลือก 'Single ชุดดันเส้น Multimaterial' ในการตั้งค่าเครื่องพิมพ์) เมื่อตรวจสอบแล้ว เส้นพลาสติกจำนวนเล็กน้อยจะถูกอัดรีดอย่างรวดเร็วบนไวด์ทาวเวอร์ก่อนที่จะเปลี่ยนเครื่องมือ ตัวเลือกนี้ใช้เฉพาะเมื่อเปิดใช้งาน Wipe Tower เท่านั้น" msgid "Multi-tool ramming volume" msgstr "ปริมาณการกระแทกหลายเครื่องมือ" @@ -14618,25 +12641,19 @@ msgstr "ประเภทวัสดุของเส้นพลาสติ msgid "Soluble material" msgstr "วัสดุที่ละลายน้ำได้" -msgid "" -"Soluble material is commonly used to print supports and support interfaces." +msgid "Soluble material is commonly used to print supports and support interfaces." msgstr "วัสดุที่ละลายน้ำได้มักใช้ในการพิมพ์ส่วนรองรับและส่วนต่อประสานรองรับ" msgid "Filament ramming length" msgstr "ความยาวการกระแทกของเส้นพลาสติก" -msgid "" -"When changing the extruder, it is recommended to extrude a certain length of " -"filament from the original extruder. This helps minimize nozzle oozing." -msgstr "" -"เมื่อเปลี่ยนชุดดันเส้น แนะนำให้รีดเส้นพลาสติกที่มีความยาวจำนวนหนึ่งจากชุดดันเส้นเดิม " -"ซึ่งจะช่วยลดการไหลของหัวฉีด" +msgid "When changing the extruder, it is recommended to extrude a certain length of filament from the original extruder. This helps minimize nozzle oozing." +msgstr "เมื่อเปลี่ยนชุดดันเส้น แนะนำให้รีดเส้นพลาสติกที่มีความยาวจำนวนหนึ่งจากชุดดันเส้นเดิม ซึ่งจะช่วยลดการไหลของหัวฉีด" msgid "Support material" msgstr "วัสดุส่วนรองรับ" -msgid "" -"Support material is commonly used to print supports and support interfaces." +msgid "Support material is commonly used to print supports and support interfaces." msgstr "วัสดุรองรับมักใช้ในการพิมพ์ส่วนรองรับและอินเทอร์เฟซรองรับ" msgid "Filament printable" @@ -14648,13 +12665,8 @@ msgstr "เส้นพลาสติกสามารถพิมพ์ได msgid "Softening temperature" msgstr "อุณหภูมิอ่อนลง" -msgid "" -"The material softens at this temperature, so when the bed temperature is " -"equal to or greater than this, it's highly recommended to open the front " -"door and/or remove the upper glass to avoid clogs." -msgstr "" -"วัสดุจะอ่อนตัวลงที่อุณหภูมินี้ ดังนั้นเมื่ออุณหภูมิฐานพิมพ์เท่ากับหรือมากกว่านี้ " -"ขอแนะนำอย่างยิ่งให้เปิดประตูหน้าและ/หรือถอดกระจกด้านบนออกเพื่อหลีกเลี่ยงการอุดตัน" +msgid "The material softens at this temperature, so when the bed temperature is equal to or greater than this, it's highly recommended to open the front door and/or remove the upper glass to avoid clogs." +msgstr "วัสดุจะอ่อนตัวลงที่อุณหภูมินี้ ดังนั้นเมื่ออุณหภูมิฐานพิมพ์เท่ากับหรือมากกว่านี้ ขอแนะนำอย่างยิ่งให้เปิดประตูหน้าและ/หรือถอดกระจกด้านบนออกเพื่อหลีกเลี่ยงการอุดตัน" msgid "Price" msgstr "ราคา" @@ -14677,79 +12689,50 @@ msgstr "(ไม่ระบุ)" msgid "Sparse infill direction" msgstr "ทิศทางไส้ในแบบโปร่ง" -msgid "" -"This is the angle for sparse infill pattern, which controls the start or " -"main direction of lines." +msgid "This is the angle for sparse infill pattern, which controls the start or main direction of lines." msgstr "มุมสำหรับรูปแบบไส้ในแบบกระจาย ซึ่งควบคุมจุดเริ่มต้นหรือทิศทางหลักของเส้น" msgid "Solid infill direction" msgstr "ทิศทางไส้ในแบบทึบ" -msgid "" -"Angle for solid infill pattern, which controls the start or main direction " -"of line." +msgid "Angle for solid infill pattern, which controls the start or main direction of line." msgstr "มุมสำหรับรูปแบบไส้ในแบบทึบ ซึ่งควบคุมจุดเริ่มต้นหรือทิศทางหลักของเส้น" msgid "Sparse infill density" msgstr "ความหนาแน่นไส้ในแบบโปร่ง" #, no-c-format, no-boost-format -msgid "" -"Density of internal sparse infill, 100% turns all sparse infill into solid " -"infill and internal solid infill pattern will be used." -msgstr "" -"ความหนาแน่นของไส้ในแบบโปร่งภายใน 100% จะเปลี่ยนไส้ในแบบโปร่งทั้งหมดให้เป็นไส้ในแบบทึบ " -"และจะใช้รูปแบบไส้ในแบบทึบภายใน" +msgid "Density of internal sparse infill, 100% turns all sparse infill into solid infill and internal solid infill pattern will be used." +msgstr "ความหนาแน่นของไส้ในแบบโปร่งภายใน 100% จะเปลี่ยนไส้ในแบบโปร่งทั้งหมดให้เป็นไส้ในแบบทึบ และจะใช้รูปแบบไส้ในแบบทึบภายใน" msgid "Align infill direction to model" msgstr "จัดทิศทาง ไส้ใน ให้ตรงกับโมเดล" msgid "" -"Aligns infill, bridge, ironing and surface fill directions to follow the " -"model's orientation on the build plate.\n" -"When enabled, directions rotate with the model to maintain optimal strength " -"characteristics." +"Aligns infill, bridge, ironing and surface fill directions to follow the model's orientation on the build plate.\n" +"When enabled, directions rotate with the model to maintain optimal strength characteristics." msgstr "" -"จัดทิศทางไส้ใน สะพาน การรีดเรียบ " -"และการเติมผิวให้สอดคล้องกับการวางแนวของโมเดลบนฐานรองพิมพ์\n" +"จัดทิศทางไส้ใน สะพาน การรีดเรียบ และการเติมผิวให้สอดคล้องกับการวางแนวของโมเดลบนฐานรองพิมพ์\n" "เมื่อเปิดใช้งาน ทิศทางจะหมุนตามโมเดลเพื่อรักษาคุณสมบัติความแข็งแรงที่เหมาะสม" msgid "Insert solid layers" msgstr "แทรกชั้นทึบ" -msgid "" -"Insert solid infill at specific layers. Use N to insert every Nth layer, N#K " -"to insert K consecutive solid layers every N layers (K is optional, e.g. " -"'5#' equals '5#1'), or a comma-separated list (e.g. 1,7,9) to insert at " -"explicit layers. Layers are 1-based." -msgstr "" -"แทรก ไส้ใน แบบทึบที่ชั้นเฉพาะ ใช้ N เพื่อแทรกทุกเลเยอร์ N, N#K เพื่อแทรก K " -"เลเยอร์ทึบต่อเนื่องกันทุกๆ เลเยอร์ N (K เป็นทางเลือก เช่น '5#' เท่ากับ '5#1') " -"หรือรายการที่คั่นด้วยเครื่องหมายจุลภาค (เช่น 1,7,9) เพื่อแทรกในเลเยอร์ที่ชัดเจน เลเยอร์เป็นแบบ " -"1" +msgid "Insert solid infill at specific layers. Use N to insert every Nth layer, N#K to insert K consecutive solid layers every N layers (K is optional, e.g. '5#' equals '5#1'), or a comma-separated list (e.g. 1,7,9) to insert at explicit layers. Layers are 1-based." +msgstr "แทรก ไส้ใน แบบทึบที่ชั้นเฉพาะ ใช้ N เพื่อแทรกทุกเลเยอร์ N, N#K เพื่อแทรก K เลเยอร์ทึบต่อเนื่องกันทุกๆ เลเยอร์ N (K เป็นทางเลือก เช่น '5#' เท่ากับ '5#1') หรือรายการที่คั่นด้วยเครื่องหมายจุลภาค (เช่น 1,7,9) เพื่อแทรกในเลเยอร์ที่ชัดเจน เลเยอร์เป็นแบบ 1" msgid "Fill Multiline" msgstr "ไส้ในหลายบรรทัด" -msgid "" -"Using multiple lines for the infill pattern, if supported by infill pattern." +msgid "Using multiple lines for the infill pattern, if supported by infill pattern." msgstr "การใช้หลายบรรทัดสำหรับรูปแบบ ไส้ใน หากรองรับโดยรูปแบบ ไส้ใน" msgid "Z-buckling bias optimization (experimental)" msgstr "การปรับชดเชยการโก่งตัวตามแกน Z ให้เหมาะสม (ทดลอง)" -#, no-c-format, no-boost-format -msgid "" -"Tightens the gyroid wave along the Z (vertical) axis at low infill density " -"to shorten the effective vertical column length and improve Z-axis " -"compression buckling resistance. Filament use is preserved. No effect at " -"~30% sparse infill density and above. Only applies when Sparse infill " -"pattern is set to Gyroid." -msgstr "" -"ปรับคลื่นไจรอยด์ให้ถี่ขึ้นตามแกน Z (แนวตั้ง) เมื่อความหนาแน่นไส้ในต่ำ " -"เพื่อลดความยาวช่วงเสาแนวตั้งที่มีผลจริง และเพิ่มความต้านทานการโก่งตัวจากแรงอัดตามแกน Z " -"โดยยังใช้เส้นพลาสติกเท่าเดิม ไม่มีผลเมื่อความหนาแน่นไส้ในแบบโปร่งประมาณ ~30% ขึ้นไป " -"ใช้เฉพาะเมื่อรูปแบบไส้ในแบบโปร่งตั้งเป็นไจรอยด์เท่านั้น" +#, fuzzy, c-format, boost-format +msgid "Tightens the gyroid wave along the Z (vertical) axis at low infill density to shorten the effective vertical column length and improve Z-axis compression buckling resistance. Filament use is preserved. No effect at ~30% sparse infill density and above. Only applies when Sparse infill pattern is set to Gyroid." +msgstr "ปรับคลื่นไจรอยด์ให้ถี่ขึ้นตามแกน Z (แนวตั้ง) เมื่อความหนาแน่นไส้ในต่ำ เพื่อลดความยาวช่วงเสาแนวตั้งที่มีผลจริง และเพิ่มความต้านทานการโก่งตัวจากแรงอัดตามแกน Z โดยยังใช้เส้นพลาสติกเท่าเดิม ไม่มีผลเมื่อความหนาแน่นไส้ในแบบโปร่งประมาณ ~30% ขึ้นไป ใช้เฉพาะเมื่อรูปแบบไส้ในแบบโปร่งตั้งเป็นไจรอยด์เท่านั้น" msgid "Sparse infill pattern" msgstr "รูปแบบไส้ในแบบโปร่ง" @@ -14817,24 +12800,19 @@ msgstr "ไจรอยด์" msgid "Lateral lattice angle 1" msgstr "มุมขัดแตะด้านข้าง 1" -msgid "" -"The angle of the first set of Lateral lattice elements in the Z direction. " -"Zero is vertical." +msgid "The angle of the first set of Lateral lattice elements in the Z direction. Zero is vertical." msgstr "มุมขององค์ประกอบขัดแตะด้านข้างชุดแรกในทิศทาง Z ศูนย์คือแนวตั้ง" msgid "Lateral lattice angle 2" msgstr "มุมขัดแตะด้านข้าง 2" -msgid "" -"The angle of the second set of Lateral lattice elements in the Z direction. " -"Zero is vertical." +msgid "The angle of the second set of Lateral lattice elements in the Z direction. Zero is vertical." msgstr "มุมขององค์ประกอบขัดแตะด้านข้างชุดที่สองในทิศทาง Z ศูนย์คือแนวตั้ง" msgid "Infill overhang angle" msgstr "ไส้ในมุมยื่น" -msgid "" -"The angle of the infill angled lines. 60° will result in a pure honeycomb." +msgid "The angle of the infill angled lines. 60° will result in a pure honeycomb." msgstr "มุมของเส้นมุมที่ไส้ในเข้าไป 60° ก็จะได้รังผึ้งที่บริสุทธิ์" msgid "Lightning overhang angle" @@ -14847,8 +12825,7 @@ msgid "Prune angle" msgstr "มุมตัดแต่ง" msgid "" -"Controls how aggressively short or unsupported Lightning branches are " -"pruned.\n" +"Controls how aggressively short or unsupported Lightning branches are pruned.\n" "This angle is converted internally to a per-layer distance." msgstr "" "กำหนดระดับการตัดกิ่ง Lightning ที่สั้นหรือไม่มีส่วนรองรับออก\n" @@ -14864,24 +12841,10 @@ msgid "Sparse infill anchor length" msgstr "ความยาวสมอ ไส้ใน เบาบาง" msgid "" -"Connect an infill line to an internal perimeter with a short segment of an " -"additional perimeter. If expressed as percentage (example: 15%) it is " -"calculated over infill extrusion width. Orca Slicer tries to connect two " -"close infill lines to a short perimeter segment. If no such perimeter " -"segment shorter than infill_anchor_max is found, the infill line is " -"connected to a perimeter segment at just one side and the length of the " -"perimeter segment taken is limited to this parameter, but no longer than " -"anchor_length_max.\n" -"Set this parameter to zero to disable anchoring perimeters connected to a " -"single infill line." +"Connect an infill line to an internal perimeter with a short segment of an additional perimeter. If expressed as percentage (example: 15%) it is calculated over infill extrusion width. Orca Slicer tries to connect two close infill lines to a short perimeter segment. If no such perimeter segment shorter than infill_anchor_max is found, the infill line is connected to a perimeter segment at just one side and the length of the perimeter segment taken is limited to this parameter, but no longer than anchor_length_max.\n" +"Set this parameter to zero to disable anchoring perimeters connected to a single infill line." msgstr "" -"เชื่อมต่อเส้นไส้ในเข้ากับเส้นรอบวงภายในด้วยส่วนสั้นของเส้นรอบวงเพิ่มเติม หากระบุเป็นเปอร์เซ็นต์ " -"(ตัวอย่าง: 15%) ระบบจะคำนวณจากความกว้างการอัดรีดของไส้ใน Orca Slicer " -"จะพยายามเชื่อมต่อเส้นไส้ในสองเส้นที่อยู่ใกล้กันเข้ากับส่วนเส้นรอบวงสั้น ๆ " -"หากไม่พบส่วนเส้นรอบวงที่สั้นกว่า infill_anchor_max " -"เส้นไส้ในจะถูกเชื่อมต่อกับส่วนเส้นรอบวงเพียงด้านเดียว " -"และความยาวของส่วนเส้นรอบวงที่ใช้จะถูกจำกัดด้วยพารามิเตอร์นี้ แต่ต้องไม่เกิน " -"anchor_length_max\n" +"เชื่อมต่อเส้นไส้ในเข้ากับเส้นรอบวงภายในด้วยส่วนสั้นของเส้นรอบวงเพิ่มเติม หากระบุเป็นเปอร์เซ็นต์ (ตัวอย่าง: 15%) ระบบจะคำนวณจากความกว้างการอัดรีดของไส้ใน Orca Slicer จะพยายามเชื่อมต่อเส้นไส้ในสองเส้นที่อยู่ใกล้กันเข้ากับส่วนเส้นรอบวงสั้น ๆ หากไม่พบส่วนเส้นรอบวงที่สั้นกว่า infill_anchor_max เส้นไส้ในจะถูกเชื่อมต่อกับส่วนเส้นรอบวงเพียงด้านเดียว และความยาวของส่วนเส้นรอบวงที่ใช้จะถูกจำกัดด้วยพารามิเตอร์นี้ แต่ต้องไม่เกิน anchor_length_max\n" "ตั้งค่าพารามิเตอร์นี้เป็นศูนย์เพื่อปิดใช้งานเส้นรอบวงยึดที่เชื่อมต่อกับเส้นไส้ในเพียงเส้นเดียว" msgid "0 (no open anchors)" @@ -14894,23 +12857,10 @@ msgid "Maximum length of the infill anchor" msgstr "ความยาวสูงสุดของพุก ไส้ใน" msgid "" -"Connect an infill line to an internal perimeter with a short segment of an " -"additional perimeter. If expressed as percentage (example: 15%) it is " -"calculated over infill extrusion width. Orca Slicer tries to connect two " -"close infill lines to a short perimeter segment. If no such perimeter " -"segment shorter than this parameter is found, the infill line is connected " -"to a perimeter segment at just one side and the length of the perimeter " -"segment taken is limited to infill_anchor, but no longer than this " -"parameter.\n" -"If set to 0, the old algorithm for infill connection will be used, it should " -"create the same result as with 1000 & 0." +"Connect an infill line to an internal perimeter with a short segment of an additional perimeter. If expressed as percentage (example: 15%) it is calculated over infill extrusion width. Orca Slicer tries to connect two close infill lines to a short perimeter segment. If no such perimeter segment shorter than this parameter is found, the infill line is connected to a perimeter segment at just one side and the length of the perimeter segment taken is limited to infill_anchor, but no longer than this parameter.\n" +"If set to 0, the old algorithm for infill connection will be used, it should create the same result as with 1000 & 0." msgstr "" -"เชื่อมต่อเส้นไส้ในเข้ากับเส้นรอบวงภายในด้วยส่วนสั้นของเส้นรอบวงเพิ่มเติม หากระบุเป็นเปอร์เซ็นต์ " -"(ตัวอย่าง: 15%) ระบบจะคำนวณจากความกว้างการอัดรีดของไส้ใน Orca Slicer " -"จะพยายามเชื่อมต่อเส้นไส้ในสองเส้นที่อยู่ใกล้กันเข้ากับส่วนเส้นรอบวงสั้น ๆ " -"หากไม่พบส่วนเส้นรอบวงที่สั้นกว่าพารามิเตอร์นี้ เส้นไส้ในจะถูกเชื่อมต่อกับส่วนเส้นรอบวงเพียงด้านเดียว " -"และความยาวของส่วนเส้นรอบวงที่ใช้จะถูกจำกัดไว้ที่ infill_anchor " -"แต่ต้องไม่ยาวเกินพารามิเตอร์นี้\n" +"เชื่อมต่อเส้นไส้ในเข้ากับเส้นรอบวงภายในด้วยส่วนสั้นของเส้นรอบวงเพิ่มเติม หากระบุเป็นเปอร์เซ็นต์ (ตัวอย่าง: 15%) ระบบจะคำนวณจากความกว้างการอัดรีดของไส้ใน Orca Slicer จะพยายามเชื่อมต่อเส้นไส้ในสองเส้นที่อยู่ใกล้กันเข้ากับส่วนเส้นรอบวงสั้น ๆ หากไม่พบส่วนเส้นรอบวงที่สั้นกว่าพารามิเตอร์นี้ เส้นไส้ในจะถูกเชื่อมต่อกับส่วนเส้นรอบวงเพียงด้านเดียว และความยาวของส่วนเส้นรอบวงที่ใช้จะถูกจำกัดไว้ที่ infill_anchor แต่ต้องไม่ยาวเกินพารามิเตอร์นี้\n" "หากตั้งค่าเป็น 0 จะใช้อัลกอริทึมเดิมสำหรับการเชื่อมต่อไส้ใน ซึ่งควรให้ผลลัพธ์เดียวกับ 1000 & 0" msgid "0 (Simple connect)" @@ -14922,42 +12872,25 @@ msgstr "การเร่งความเร็วของผนังด้ msgid "Acceleration of travel moves." msgstr "การเร่งความเร็วของการเดินทาง" -msgid "" -"This is the acceleration of top surface infill. Using a lower value may " -"improve top surface quality." +msgid "This is the acceleration of top surface infill. Using a lower value may improve top surface quality." msgstr "ความเร่งของไส้ในพื้นผิวด้านบน การใช้ค่าที่ต่ำกว่าอาจปรับปรุงคุณภาพพื้นผิวด้านบนได้" msgid "Acceleration of outer wall: using a lower value can improve quality." msgstr "ความเร่งของผนังด้านนอก การใช้ค่าที่ต่ำกว่าสามารถปรับปรุงคุณภาพได้" -msgid "" -"Acceleration of bridges. If the value is expressed as a percentage (e.g. " -"50%), it will be calculated based on the outer wall acceleration." -msgstr "" -"การเร่งความเร็วของสะพาน หากค่าแสดงเป็นเปอร์เซ็นต์ (เช่น 50%) " -"ค่าดังกล่าวจะคำนวณตามความเร่งของผนังด้านนอก" +msgid "Acceleration of bridges. If the value is expressed as a percentage (e.g. 50%), it will be calculated based on the outer wall acceleration." +msgstr "การเร่งความเร็วของสะพาน หากค่าแสดงเป็นเปอร์เซ็นต์ (เช่น 50%) ค่าดังกล่าวจะคำนวณตามความเร่งของผนังด้านนอก" msgid "mm/s² or %" msgstr "มม./วินาที² หรือ %" -msgid "" -"Acceleration of sparse infill. If the value is expressed as a percentage (e." -"g. 100%), it will be calculated based on the default acceleration." -msgstr "" -"ความเร่งของไส้ในแบบโปร่ง หากค่าแสดงเป็นเปอร์เซ็นต์ (เช่น 100%) " -"ค่านั้นจะถูกคำนวณตามความเร่งเริ่มต้น" +msgid "Acceleration of sparse infill. If the value is expressed as a percentage (e.g. 100%), it will be calculated based on the default acceleration." +msgstr "ความเร่งของไส้ในแบบโปร่ง หากค่าแสดงเป็นเปอร์เซ็นต์ (เช่น 100%) ค่านั้นจะถูกคำนวณตามความเร่งเริ่มต้น" -msgid "" -"Acceleration of internal solid infill. If the value is expressed as a " -"percentage (e.g. 100%), it will be calculated based on the default " -"acceleration." -msgstr "" -"ความเร่งของไส้ในของแข็งภายใน หากค่าแสดงเป็นเปอร์เซ็นต์ (เช่น 100%) " -"ค่านั้นจะถูกคำนวณตามความเร่งเริ่มต้น" +msgid "Acceleration of internal solid infill. If the value is expressed as a percentage (e.g. 100%), it will be calculated based on the default acceleration." +msgstr "ความเร่งของไส้ในของแข็งภายใน หากค่าแสดงเป็นเปอร์เซ็นต์ (เช่น 100%) ค่านั้นจะถูกคำนวณตามความเร่งเริ่มต้น" -msgid "" -"This is the printing acceleration for the first layer. Using limited " -"acceleration can improve build plate adhesion." +msgid "This is the printing acceleration for the first layer. Using limited acceleration can improve build plate adhesion." msgstr "ความเร่งของชั้นแรก การใช้ค่าที่ต่ำกว่าสามารถปรับปรุงการยึดเกาะของเพลตได้" msgid "First layer travel" @@ -14980,16 +12913,13 @@ msgid "accel_to_decel" msgstr "accel_to_decel" #, c-format, boost-format -msgid "" -"Klipper's max_accel_to_decel will be adjusted to this %% of acceleration." +msgid "Klipper's max_accel_to_decel will be adjusted to this %% of acceleration." msgstr "max_accel_to_decel ของ Klipper จะถูกปรับเป็น %% ของการเร่งความเร็วนี้" msgid "Default jerk." msgstr "กระตุกเริ่มต้น" -msgid "" -"Marlin Firmware Junction Deviation (replaces the traditional XY Jerk " -"setting)." +msgid "Marlin Firmware Junction Deviation (replaces the traditional XY Jerk setting)." msgstr "Marlin Firmware Junction Deviation (แทนที่การตั้งค่า XY Jerk แบบดั้งเดิม)" msgid "Jerk of outer walls." @@ -15017,19 +12947,14 @@ msgstr "" "กระตุกการเดินทางของชั้นแรก\n" "ค่าเปอร์เซ็นต์สัมพันธ์กับ Travel Jerk" -msgid "" -"Line width of the first layer. If expressed as a %, it will be computed over " -"the nozzle diameter." +msgid "Line width of the first layer. If expressed as a %, it will be computed over the nozzle diameter." msgstr "ความกว้างของเส้นของชั้นแรก หากแสดงเป็น % จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" msgid "First layer height" msgstr "ความสูงของชั้นแรก" -msgid "" -"Height of the first layer. Making the first layer height thicker can improve " -"build plate adhesion." -msgstr "" -"ความสูงของชั้นแรก การเพิ่มความหนาของชั้นแรกสามารถช่วยให้ยึดเกาะกับฐานพิมพ์ได้ดีขึ้น" +msgid "Height of the first layer. Making the first layer height thicker can improve build plate adhesion." +msgstr "ความสูงของชั้นแรก การเพิ่มความหนาของชั้นแรกสามารถช่วยให้ยึดเกาะกับฐานพิมพ์ได้ดีขึ้น" msgid "This is the speed for the first layer except for solid infill sections." msgstr "ความเร็วของชั้นแรก ยกเว้นส่วน ไส้ใน ที่เป็นของแข็ง" @@ -15049,11 +12974,8 @@ msgstr "ความเร็วเดินหัวเปล่าของเ msgid "Number of slow layers" msgstr "จำนวนชั้นที่พิมพ์ช้าลง" -msgid "" -"The first few layers are printed slower than normal. The speed is gradually " -"increased in a linear fashion over the specified number of layers." -msgstr "" -"สองสามชั้นแรกจะพิมพ์ช้ากว่าปกติ ความเร็วจะค่อยๆ เพิ่มขึ้นในลักษณะเชิงเส้นตามจำนวนเลเยอร์ที่ระบุ" +msgid "The first few layers are printed slower than normal. The speed is gradually increased in a linear fashion over the specified number of layers." +msgstr "สองสามชั้นแรกจะพิมพ์ช้ากว่าปกติ ความเร็วจะค่อยๆ เพิ่มขึ้นในลักษณะเชิงเส้นตามจำนวนเลเยอร์ที่ระบุ" msgid "First layer nozzle temperature" msgstr "อุณหภูมิหัวฉีดชั้นแรก" @@ -15064,17 +12986,8 @@ msgstr "อุณหภูมิหัวฉีดสำหรับการพ msgid "Full fan speed at layer" msgstr "ความเร็วพัดลมเต็มชั้น" -msgid "" -"Fan speed will be ramped up linearly from zero at layer " -"\"close_fan_the_first_x_layers\" to maximum at layer \"full_fan_speed_layer" -"\". \"full_fan_speed_layer\" will be ignored if lower than " -"\"close_fan_the_first_x_layers\", in which case the fan will be running at " -"maximum allowed speed at layer \"close_fan_the_first_x_layers\" + 1." -msgstr "" -"ความเร็วพัดลมจะเพิ่มขึ้นเชิงเส้นจากศูนย์ที่เลเยอร์ \"close_fan_the_first_x_layers\" " -"ไปจนถึงสูงสุดที่เลเยอร์ \"full_fan_speed_layer\" \"full_fan_speed_layer\" " -"จะถูกละเว้นหากต่ำกว่า \"close_fan_the_first_x_layers\" ซึ่งในกรณีนี้ " -"พัดลมจะทำงานด้วยความเร็วสูงสุดที่อนุญาตที่เลเยอร์ \"close_fan_the_first_x_layers\" + 1" +msgid "Fan speed will be ramped up linearly from zero at layer \"close_fan_the_first_x_layers\" to maximum at layer \"full_fan_speed_layer\". \"full_fan_speed_layer\" will be ignored if lower than \"close_fan_the_first_x_layers\", in which case the fan will be running at maximum allowed speed at layer \"close_fan_the_first_x_layers\" + 1." +msgstr "ความเร็วพัดลมจะเพิ่มขึ้นเชิงเส้นจากศูนย์ที่เลเยอร์ \"close_fan_the_first_x_layers\" ไปจนถึงสูงสุดที่เลเยอร์ \"full_fan_speed_layer\" \"full_fan_speed_layer\" จะถูกละเว้นหากต่ำกว่า \"close_fan_the_first_x_layers\" ซึ่งในกรณีนี้ พัดลมจะทำงานด้วยความเร็วสูงสุดที่อนุญาตที่เลเยอร์ \"close_fan_the_first_x_layers\" + 1" msgid "layer" msgstr "ชั้น" @@ -15083,16 +12996,11 @@ msgid "Support interface fan speed" msgstr "ความเร็วพัดลมผิวสัมผัสส่วนรองรับ" msgid "" -"This part cooling fan speed is applied when printing support interfaces. " -"Setting this parameter to a higher than regular speed reduces the layer " -"binding strength between supports and the supported part, making them easier " -"to separate.\n" +"This part cooling fan speed is applied when printing support interfaces. Setting this parameter to a higher than regular speed reduces the layer binding strength between supports and the supported part, making them easier to separate.\n" "Set to -1 to disable it.\n" "This setting is overridden by disable_fan_first_layers." msgstr "" -"ความเร็วพัดลมระบายความร้อนในส่วนนี้จะถูกนำไปใช้เมื่อพิมพ์อินเทอร์เฟซที่รองรับ " -"การตั้งค่าพารามิเตอร์นี้ให้สูงกว่าความเร็วปกติจะช่วยลดความแข็งแรงในการผูกเลเยอร์ระหว่างส่วนรองรับและส่วนที่รองรับ " -"ทำให้แยกออกจากกันได้ง่ายขึ้น\n" +"ความเร็วพัดลมระบายความร้อนในส่วนนี้จะถูกนำไปใช้เมื่อพิมพ์อินเทอร์เฟซที่รองรับ การตั้งค่าพารามิเตอร์นี้ให้สูงกว่าความเร็วปกติจะช่วยลดความแข็งแรงในการผูกเลเยอร์ระหว่างส่วนรองรับและส่วนที่รองรับ ทำให้แยกออกจากกันได้ง่ายขึ้น\n" "ตั้งค่าเป็น -1 เพื่อปิดใช้งาน\n" "การตั้งค่านี้ถูกแทนที่โดย Disable_fan_first_layers" @@ -15100,82 +13008,50 @@ msgid "Internal bridges fan speed" msgstr "ความเร็วพัดลมภายในสะพาน" msgid "" -"The part cooling fan speed used for all internal bridges. Set to -1 to use " -"the overhang fan speed settings instead.\n" +"The part cooling fan speed used for all internal bridges. Set to -1 to use the overhang fan speed settings instead.\n" "\n" -"Reducing the internal bridges fan speed, compared to your regular fan speed, " -"can help reduce part warping due to excessive cooling applied over a large " -"surface for a prolonged period of time." +"Reducing the internal bridges fan speed, compared to your regular fan speed, can help reduce part warping due to excessive cooling applied over a large surface for a prolonged period of time." msgstr "" -"ความเร็วพัดลมระบายความร้อนชิ้นส่วนที่ใช้สำหรับบริดจ์ภายในทั้งหมด ตั้งค่าเป็น -1 " -"เพื่อใช้การตั้งค่าความเร็วพัดลมที่ยื่นออกมาแทน\n" +"ความเร็วพัดลมระบายความร้อนชิ้นส่วนที่ใช้สำหรับบริดจ์ภายในทั้งหมด ตั้งค่าเป็น -1 เพื่อใช้การตั้งค่าความเร็วพัดลมที่ยื่นออกมาแทน\n" "\n" -"การลดความเร็วพัดลมบริดจ์ภายในเมื่อเปรียบเทียบกับความเร็วพัดลมปกติ " -"สามารถช่วยลดการบิดงอของชิ้นส่วนเนื่องจากการระบายความร้อนที่มากเกินไปบนพื้นผิวขนาดใหญ่เป็นระยะเวลานาน" +"การลดความเร็วพัดลมบริดจ์ภายในเมื่อเปรียบเทียบกับความเร็วพัดลมปกติ สามารถช่วยลดการบิดงอของชิ้นส่วนเนื่องจากการระบายความร้อนที่มากเกินไปบนพื้นผิวขนาดใหญ่เป็นระยะเวลานาน" msgid "Ironing fan speed" msgstr "ความเร็วพัดลมรีดผิว" msgid "" -"This part cooling fan speed is applied when ironing. Setting this parameter " -"to a lower than regular speed reduces possible nozzle clogging due to the " -"low volumetric flow rate, making the interface smoother.\n" +"This part cooling fan speed is applied when ironing. Setting this parameter to a lower than regular speed reduces possible nozzle clogging due to the low volumetric flow rate, making the interface smoother.\n" "Set to -1 to disable it." msgstr "" -"ความเร็วพัดลมระบายความร้อนส่วนนี้ใช้กับการรีดผิว " -"การตั้งค่าพารามิเตอร์นี้ให้ต่ำกว่าความเร็วปกติจะช่วยลดปัญหาการอุดตันของหัวฉีดที่อาจเกิดขึ้นได้เนื่องจากอัตราการไหลของปริมาตรต่ำ " -"ทำให้อินเทอร์เฟซราบรื่นยิ่งขึ้น\n" +"ความเร็วพัดลมระบายความร้อนส่วนนี้ใช้กับการรีดผิว การตั้งค่าพารามิเตอร์นี้ให้ต่ำกว่าความเร็วปกติจะช่วยลดปัญหาการอุดตันของหัวฉีดที่อาจเกิดขึ้นได้เนื่องจากอัตราการไหลของปริมาตรต่ำ ทำให้อินเทอร์เฟซราบรื่นยิ่งขึ้น\n" "ตั้งค่าเป็น -1 เพื่อปิดใช้งาน" msgid "Ironing flow" msgstr "รีดผิวไหล" -msgid "" -"Filament-specific override for ironing flow. This allows you to customize " -"the ironing flow for each filament type. Too high value results in " -"overextrusion on the surface." -msgstr "" -"การแทนที่เส้นพลาสติกเฉพาะสำหรับกระแสการรีดผิว " -"ซึ่งช่วยให้คุณปรับแต่งกระแสการรีดผิวสำหรับเส้นพลาสติกแต่ละประเภทได้ " -"ค่าที่สูงเกินไปส่งผลให้เกิดการอัดขึ้นรูปมากเกินไปบนพื้นผิว" +msgid "Filament-specific override for ironing flow. This allows you to customize the ironing flow for each filament type. Too high value results in overextrusion on the surface." +msgstr "การแทนที่เส้นพลาสติกเฉพาะสำหรับกระแสการรีดผิว ซึ่งช่วยให้คุณปรับแต่งกระแสการรีดผิวสำหรับเส้นพลาสติกแต่ละประเภทได้ ค่าที่สูงเกินไปส่งผลให้เกิดการอัดขึ้นรูปมากเกินไปบนพื้นผิว" msgid "Ironing line spacing" msgstr "ระยะห่างระหว่างสายรีดผิว" -msgid "" -"Filament-specific override for ironing line spacing. This allows you to " -"customize the spacing between ironing lines for each filament type." -msgstr "" -"การแทนที่เส้นพลาสติกเฉพาะสำหรับระยะห่างระหว่างรีดผิว " -"ซึ่งช่วยให้คุณปรับแต่งระยะห่างระหว่างเส้นรีดผิวสำหรับเส้นพลาสติกแต่ละประเภทได้" +msgid "Filament-specific override for ironing line spacing. This allows you to customize the spacing between ironing lines for each filament type." +msgstr "การแทนที่เส้นพลาสติกเฉพาะสำหรับระยะห่างระหว่างรีดผิว ซึ่งช่วยให้คุณปรับแต่งระยะห่างระหว่างเส้นรีดผิวสำหรับเส้นพลาสติกแต่ละประเภทได้" msgid "Ironing inset" msgstr "อุปกรณ์รีดผิว" -msgid "" -"Filament-specific override for ironing inset. This allows you to customize " -"the distance to keep from the edges when ironing for each filament type." -msgstr "" -"การแทนที่เส้นพลาสติกเฉพาะสำหรับส่วนเสริมการรีดผิว " -"ซึ่งช่วยให้คุณปรับแต่งระยะห่างจากขอบเมื่อรีดผิวสำหรับเส้นพลาสติกแต่ละประเภทได้" +msgid "Filament-specific override for ironing inset. This allows you to customize the distance to keep from the edges when ironing for each filament type." +msgstr "การแทนที่เส้นพลาสติกเฉพาะสำหรับส่วนเสริมการรีดผิว ซึ่งช่วยให้คุณปรับแต่งระยะห่างจากขอบเมื่อรีดผิวสำหรับเส้นพลาสติกแต่ละประเภทได้" msgid "Ironing speed" msgstr "ความเร็วรีดผิว" -msgid "" -"Filament-specific override for ironing speed. This allows you to customize " -"the print speed of ironing lines for each filament type." -msgstr "" -"การแทนที่เส้นพลาสติกเฉพาะเพื่อความเร็วในการรีดผิว " -"ซึ่งช่วยให้คุณปรับแต่งความเร็วในการพิมพ์ของเส้นรีดผิวสำหรับเส้นพลาสติกแต่ละประเภทได้" +msgid "Filament-specific override for ironing speed. This allows you to customize the print speed of ironing lines for each filament type." +msgstr "การแทนที่เส้นพลาสติกเฉพาะเพื่อความเร็วในการรีดผิว ซึ่งช่วยให้คุณปรับแต่งความเร็วในการพิมพ์ของเส้นรีดผิวสำหรับเส้นพลาสติกแต่ละประเภทได้" -msgid "" -"This setting makes the toolhead randomly jitter while printing walls so that " -"the surface has a rough textured look. This setting controls the fuzzy " -"position." -msgstr "" -"การตั้งค่านี้ทำให้หัวพิมพ์สั่นแบบสุ่มขณะพิมพ์ผนัง เพื่อให้พื้นผิวมีลักษณะหยาบ การตั้งค่านี้ควบคุมตำแหน่งของ " -"fuzzy skin" +msgid "This setting makes the toolhead randomly jitter while printing walls so that the surface has a rough textured look. This setting controls the fuzzy position." +msgstr "การตั้งค่านี้ทำให้หัวพิมพ์สั่นแบบสุ่มขณะพิมพ์ผนัง เพื่อให้พื้นผิวมีลักษณะหยาบ การตั้งค่านี้ควบคุมตำแหน่งของ fuzzy skin" msgid "Painted only" msgstr "ทาสีเท่านั้น" @@ -15195,17 +13071,13 @@ msgstr "ผนังทั้งหมด" msgid "Fuzzy skin thickness" msgstr "ความหนาผิวฟัซซี" -msgid "" -"The width of jittering: it’s recommended to keep this lower than the outer " -"wall line width." +msgid "The width of jittering: it’s recommended to keep this lower than the outer wall line width." msgstr "ความกว้างของการสั่นแบบสุ่ม แนะนำให้ตั้งต่ำกว่าความกว้างเส้นผนังด้านนอก" msgid "Fuzzy skin point distance" msgstr "ระยะจุดผิวฟัซซี" -msgid "" -"The average distance between the random points introduced on each line " -"segment." +msgid "The average distance between the random points introduced on each line segment." msgstr "ระยะห่างเฉลี่ยระหว่างจุดสุ่มที่แนะนำในแต่ละส่วนของเส้น" msgid "Apply fuzzy skin to first layer" @@ -15220,41 +13092,18 @@ msgstr "โหมดสร้างผิวฟัซซี" #, c-format, boost-format msgid "" "Fuzzy skin generation mode. Works only with Arachne!\n" -"Displacement: Сlassic mode when the pattern is formed by shifting the nozzle " -"sideways from the original path.\n" -"Extrusion: The mode when the pattern formed by the amount of extruded " -"plastic. This is the fast and straight algorithm without unnecessary nozzle " -"shake that gives a smooth pattern. But it is more useful for forming loose " -"walls in the entire they array.\n" -"Combined: Joint mode [Displacement] + [Extrusion]. The appearance of the " -"walls is similar to [Displacement] Mode, but it leaves no pores between the " -"perimeters.\n" +"Displacement: Сlassic mode when the pattern is formed by shifting the nozzle sideways from the original path.\n" +"Extrusion: The mode when the pattern formed by the amount of extruded plastic. This is the fast and straight algorithm without unnecessary nozzle shake that gives a smooth pattern. But it is more useful for forming loose walls in the entire they array.\n" +"Combined: Joint mode [Displacement] + [Extrusion]. The appearance of the walls is similar to [Displacement] Mode, but it leaves no pores between the perimeters.\n" "\n" -"Attention! The [Extrusion] and [Combined] modes works only the " -"fuzzy_skin_thickness parameter not more than the thickness of printed loop. " -"At the same time, the width of the extrusion for a particular layer should " -"also not be below a certain level. It is usually equal 15-25%% of a layer " -"height. Therefore, the maximum fuzzy skin thickness with a perimeter width " -"of 0.4 mm and a layer height of 0.2 mm will be 0.4-(0.2*0.25)=±0.35mm! If " -"you enter a higher parameter than this, the error Flow::spacing() will " -"displayed, and the model will not be sliced. You can choose this number " -"until this error is repeated." +"Attention! The [Extrusion] and [Combined] modes works only the fuzzy_skin_thickness parameter not more than the thickness of printed loop. At the same time, the width of the extrusion for a particular layer should also not be below a certain level. It is usually equal 15-25%% of a layer height. Therefore, the maximum fuzzy skin thickness with a perimeter width of 0.4 mm and a layer height of 0.2 mm will be 0.4-(0.2*0.25)=±0.35mm! If you enter a higher parameter than this, the error Flow::spacing() will displayed, and the model will not be sliced. You can choose this number until this error is repeated." msgstr "" "โหมดการสร้างผิวฟัซซี ใช้ได้กับ Arachne เท่านั้น!\n" "การกระจัด: โหมดคลาสสิกเมื่อรูปแบบถูกสร้างขึ้นโดยการเลื่อนหัวฉีดไปด้านข้างจากเส้นทางเดิม\n" -"การอัดขึ้นรูป: โหมดเมื่อรูปแบบเกิดขึ้นจากปริมาณของพลาสติกที่อัดขึ้นรูป " -"นี่เป็นอัลกอริธึมที่รวดเร็วและตรงไปตรงมา โดยไม่มีการเขย่าหัวฉีดโดยไม่จำเป็นซึ่งให้รูปแบบที่ราบรื่น " -"แต่จะมีประโยชน์มากกว่าสำหรับการสร้างผนังที่หลวมทั่วทั้งบริเวณ\n" -"รวม: โหมดข้อต่อ [การแทนที่] + [การอัดขึ้นรูป] ลักษณะของผนังจะคล้ายกับโหมด [Displacement] " -"แต่ไม่มีรูพรุนระหว่างเส้นรอบวง\n" +"การอัดขึ้นรูป: โหมดเมื่อรูปแบบเกิดขึ้นจากปริมาณของพลาสติกที่อัดขึ้นรูป นี่เป็นอัลกอริธึมที่รวดเร็วและตรงไปตรงมา โดยไม่มีการเขย่าหัวฉีดโดยไม่จำเป็นซึ่งให้รูปแบบที่ราบรื่น แต่จะมีประโยชน์มากกว่าสำหรับการสร้างผนังที่หลวมทั่วทั้งบริเวณ\n" +"รวม: โหมดข้อต่อ [การแทนที่] + [การอัดขึ้นรูป] ลักษณะของผนังจะคล้ายกับโหมด [Displacement] แต่ไม่มีรูพรุนระหว่างเส้นรอบวง\n" "\n" -"ความสนใจ! โหมด [การอัดขึ้นรูป] และ [รวม] ใช้งานได้เฉพาะพารามิเตอร์ " -"fuzzy_skin_thickness ซึ่งไม่เกินความหนาของลูปที่พิมพ์ ในขณะเดียวกัน " -"ความกว้างของการอัดขึ้นรูปสำหรับชั้นใดชั้นหนึ่งก็ไม่ควรต่ำกว่าระดับที่กำหนดด้วย โดยปกติจะเท่ากับ " -"15-25%% ของความสูงของชั้น ดังนั้น ความหนาของผิวฟัซซีสูงสุดที่มีความกว้างเส้นรอบวง 0.4 มม. " -"และความสูงของชั้น 0.2 มม. จะเป็น 0.4-(0.2*0.25)=±0.35 มม.! " -"หากคุณป้อนพารามิเตอร์ที่สูงกว่านี้ ข้อผิดพลาด Flow::spacing() จะปรากฏขึ้น " -"และโมเดลจะไม่ถูกแบ่งส่วน คุณสามารถเลือกหมายเลขนี้ได้จนกว่าข้อผิดพลาดนี้จะเกิดขึ้นซ้ำ" +"ความสนใจ! โหมด [การอัดขึ้นรูป] และ [รวม] ใช้งานได้เฉพาะพารามิเตอร์ fuzzy_skin_thickness ซึ่งไม่เกินความหนาของลูปที่พิมพ์ ในขณะเดียวกัน ความกว้างของการอัดขึ้นรูปสำหรับชั้นใดชั้นหนึ่งก็ไม่ควรต่ำกว่าระดับที่กำหนดด้วย โดยปกติจะเท่ากับ 15-25%% ของความสูงของชั้น ดังนั้น ความหนาของผิวฟัซซีสูงสุดที่มีความกว้างเส้นรอบวง 0.4 มม. และความสูงของชั้น 0.2 มม. จะเป็น 0.4-(0.2*0.25)=±0.35 มม.! หากคุณป้อนพารามิเตอร์ที่สูงกว่านี้ ข้อผิดพลาด Flow::spacing() จะปรากฏขึ้น และโมเดลจะไม่ถูกแบ่งส่วน คุณสามารถเลือกหมายเลขนี้ได้จนกว่าข้อผิดพลาดนี้จะเกิดขึ้นซ้ำ" msgid "Displacement" msgstr "การกระจัด" @@ -15273,22 +13122,17 @@ msgid "" "Classic: Classic uniform random noise.\n" "Perlin: Perlin noise, which gives a more consistent texture.\n" "Billow: Similar to perlin noise, but clumpier.\n" -"Ridged Multifractal: Ridged noise with sharp, jagged features. Creates " -"marble-like textures.\n" -"Voronoi: Divides the surface into voronoi cells, and displaces each one by a " -"random amount. Creates a patchwork texture.\n" -"Ripple: Uniform ripple pattern that ripples left and right of the original " -"path. Repeating pattern, woven appearance." +"Ridged Multifractal: Ridged noise with sharp, jagged features. Creates marble-like textures.\n" +"Voronoi: Divides the surface into voronoi cells, and displaces each one by a random amount. Creates a patchwork texture.\n" +"Ripple: Uniform ripple pattern that ripples left and right of the original path. Repeating pattern, woven appearance." msgstr "" "ประเภทเสียงรบกวนที่ใช้สำหรับการสร้างผิวที่คลุมเครือ:\n" "คลาสสิก: เสียงสุ่มเครื่องแบบคลาสสิก\n" "Perlin: เสียง Perlin ซึ่งให้เนื้อสัมผัสที่สม่ำเสมอยิ่งขึ้น\n" "Billow: คล้ายกับเสียงเพอร์ลิน แต่เป็นกลุ่มมากกว่า\n" "Ridged Multifractal: สัญญาณรบกวนที่คมชัดพร้อมคุณสมบัติหยัก สร้างพื้นผิวเหมือนหินอ่อน\n" -"โวโรนอย: แบ่งพื้นผิวออกเป็นเซลล์โวโรนอย และแทนที่แต่ละเซลล์ด้วยจำนวนสุ่ม " -"สร้างพื้นผิวแบบเย็บปะติดปะต่อกัน\n" -"ระลอกคลื่น: รูปแบบระลอกคลื่นสม่ำเสมอที่กระเพื่อมไปทางซ้ายและขวาของเส้นทางเดิม ลายซ้ำ " -"ลักษณะการทอ." +"โวโรนอย: แบ่งพื้นผิวออกเป็นเซลล์โวโรนอย และแทนที่แต่ละเซลล์ด้วยจำนวนสุ่ม สร้างพื้นผิวแบบเย็บปะติดปะต่อกัน\n" +"ระลอกคลื่น: รูปแบบระลอกคลื่นสม่ำเสมอที่กระเพื่อมไปทางซ้ายและขวาของเส้นทางเดิม ลายซ้ำ ลักษณะการทอ." msgid "Classic" msgstr "คลาสสิค" @@ -15311,31 +13155,20 @@ msgstr "ระลอกคลื่น" msgid "Fuzzy skin feature size" msgstr "ขนาดลักษณะผิวฟัซซี" -msgid "" -"The base size of the coherent noise features, in mm. Higher values will " -"result in larger features." -msgstr "" -"ขนาดฐานของคุณสมบัติเสียงที่สอดคล้องกัน หน่วยเป็น มม. ค่าที่สูงกว่าจะส่งผลให้มีคุณลักษณะที่ใหญ่ขึ้น" +msgid "The base size of the coherent noise features, in mm. Higher values will result in larger features." +msgstr "ขนาดฐานของคุณสมบัติเสียงที่สอดคล้องกัน หน่วยเป็น มม. ค่าที่สูงกว่าจะส่งผลให้มีคุณลักษณะที่ใหญ่ขึ้น" msgid "Fuzzy Skin Noise Octaves" msgstr "อ็อกเทฟเสียงผิวฟัซซี" -msgid "" -"The number of octaves of coherent noise to use. Higher values increase the " -"detail of the noise, but also increase computation time." -msgstr "" -"จำนวนอ็อกเทฟของสัญญาณรบกวนที่สอดคล้องกันที่จะใช้ ค่าที่สูงกว่าจะเพิ่มรายละเอียดของสัญญาณรบกวน " -"แต่ยังเพิ่มเวลาในการคำนวณด้วย" +msgid "The number of octaves of coherent noise to use. Higher values increase the detail of the noise, but also increase computation time." +msgstr "จำนวนอ็อกเทฟของสัญญาณรบกวนที่สอดคล้องกันที่จะใช้ ค่าที่สูงกว่าจะเพิ่มรายละเอียดของสัญญาณรบกวน แต่ยังเพิ่มเวลาในการคำนวณด้วย" msgid "Fuzzy skin noise persistence" msgstr "ความคงอยู่ของเสียงผิวเลือน" -msgid "" -"The decay rate for higher octaves of the coherent noise. Lower values will " -"result in smoother noise." -msgstr "" -"อัตราการสลายตัวของอ็อกเทฟที่สูงขึ้นของสัญญาณรบกวนที่สอดคล้องกัน " -"ค่าที่ต่ำกว่าจะส่งผลให้มีสัญญาณรบกวนที่นุ่มนวลขึ้น" +msgid "The decay rate for higher octaves of the coherent noise. Lower values will result in smoother noise." +msgstr "อัตราการสลายตัวของอ็อกเทฟที่สูงขึ้นของสัญญาณรบกวนที่สอดคล้องกัน ค่าที่ต่ำกว่าจะส่งผลให้มีสัญญาณรบกวนที่นุ่มนวลขึ้น" msgid "Number of ripples per layer" msgstr "จำนวนระลอกคลื่นต่อชั้น" @@ -15347,45 +13180,33 @@ msgid "Ripple offset" msgstr "ระลอกชดเชย" msgid "" -"Shifts the ripple phase forward along the print path by the specified " -"percentage of a wavelength each layer period.\n" +"Shifts the ripple phase forward along the print path by the specified percentage of a wavelength each layer period.\n" "- 0% keeps every layer identical.\n" -"- 50% shifts the pattern by half a wavelength, effectively inverting the " -"phase.\n" -"- 100% shifts the pattern by a full wavelength, returning to the original " -"phase.\n" +"- 50% shifts the pattern by half a wavelength, effectively inverting the phase.\n" +"- 100% shifts the pattern by a full wavelength, returning to the original phase.\n" "\n" -"The shift is applied once every number of layers set by Layers between " -"ripple offset, so layers within the same group are printed identically." +"The shift is applied once every number of layers set by Layers between ripple offset, so layers within the same group are printed identically." msgstr "" "เลื่อนระยะระลอกคลื่นไปข้างหน้าตามเส้นทางการพิมพ์ตามเปอร์เซ็นต์ที่ระบุของความยาวคลื่นในแต่ละช่วงของเลเยอร์\n" "- 0% ทำให้ทุกชั้นเหมือนกัน\n" "- 50% เลื่อนรูปแบบลงครึ่งหนึ่งของความยาวคลื่น จึงสามารถกลับเฟสได้อย่างมีประสิทธิภาพ\n" "- 100% เลื่อนรูปแบบตามความยาวคลื่นเต็ม และกลับสู่เฟสเดิม\n" "\n" -"การเปลี่ยนแปลงจะใช้ทุกๆ จำนวนเลเยอร์ที่กำหนดโดยเลเยอร์ระหว่างออฟเซ็ตระลอกคลื่น " -"ดังนั้นเลเยอร์ภายในกลุ่มเดียวกันจึงถูกพิมพ์เหมือนกัน" +"การเปลี่ยนแปลงจะใช้ทุกๆ จำนวนเลเยอร์ที่กำหนดโดยเลเยอร์ระหว่างออฟเซ็ตระลอกคลื่น ดังนั้นเลเยอร์ภายในกลุ่มเดียวกันจึงถูกพิมพ์เหมือนกัน" msgid "Layers between ripple offset" msgstr "เลเยอร์ระหว่างการชดเชยระลอกคลื่น" msgid "" -"Specifies how many consecutive layers share the same ripple phase before the " -"offset is applied.\n" +"Specifies how many consecutive layers share the same ripple phase before the offset is applied.\n" "For example:\n" -"- 1 = Layer 1 is printed with the base ripple pattern, then layer 2 is " -"shifted by the configured offset, then layer 3 returns to the base pattern, " -"and so on.\n" -"- 3 = Layers 1 to 3 are printed with the base ripple pattern, then layers 4 " -"to 6 are shifted by the configured offset, then layers 7 to 9 return to the " -"base pattern, etc." +"- 1 = Layer 1 is printed with the base ripple pattern, then layer 2 is shifted by the configured offset, then layer 3 returns to the base pattern, and so on.\n" +"- 3 = Layers 1 to 3 are printed with the base ripple pattern, then layers 4 to 6 are shifted by the configured offset, then layers 7 to 9 return to the base pattern, etc." msgstr "" "ระบุจำนวนเลเยอร์ที่ต่อเนื่องกันที่ใช้เฟสระลอกคลื่นเดียวกันก่อนที่จะใช้ออฟเซ็ต\n" "ตัวอย่างเช่น:\n" -"- 1 = เลเยอร์ 1 ถูกพิมพ์ด้วยรูปแบบระลอกคลื่นฐาน จากนั้นเลเยอร์ 2 " -"จะถูกเลื่อนโดยออฟเซ็ตที่กำหนดค่าไว้ จากนั้นเลเยอร์ 3 จะกลับสู่รูปแบบฐาน และอื่นๆ\n" -"- 3 = เลเยอร์ 1 ถึง 3 จะถูกพิมพ์ด้วยรูปแบบระลอกฐาน จากนั้นเลเยอร์ 4 ถึง 6 " -"จะถูกเลื่อนโดยออฟเซ็ตที่กำหนดค่าไว้ จากนั้นเลเยอร์ 7 ถึง 9 จะกลับสู่รูปแบบพื้นฐาน เป็นต้น" +"- 1 = เลเยอร์ 1 ถูกพิมพ์ด้วยรูปแบบระลอกคลื่นฐาน จากนั้นเลเยอร์ 2 จะถูกเลื่อนโดยออฟเซ็ตที่กำหนดค่าไว้ จากนั้นเลเยอร์ 3 จะกลับสู่รูปแบบฐาน และอื่นๆ\n" +"- 3 = เลเยอร์ 1 ถึง 3 จะถูกพิมพ์ด้วยรูปแบบระลอกฐาน จากนั้นเลเยอร์ 4 ถึง 6 จะถูกเลื่อนโดยออฟเซ็ตที่กำหนดค่าไว้ จากนั้นเลเยอร์ 7 ถึง 9 จะกลับสู่รูปแบบพื้นฐาน เป็นต้น" msgid "Filter out tiny gaps" msgstr "กรองช่องว่างเล็กๆ ออกไป" @@ -15393,83 +13214,47 @@ msgstr "กรองช่องว่างเล็กๆ ออกไป" msgid "Layers and Perimeters" msgstr "ชั้นและปริมณฑล" -msgid "" -"Don't print gap fill with a length is smaller than the threshold specified " -"(in mm). This setting applies to top, bottom and solid infill and, if using " -"the classic perimeter generator, to wall gap fill." -msgstr "" -"อย่าพิมพ์การเติมช่องว่างโดยมีความยาวน้อยกว่าเกณฑ์ที่ระบุ (เป็นมม.) " -"การตั้งค่านี้ใช้กับการเติมช่องว่างด้านบน ด้านล่าง และทึบ " -"และหากใช้เครื่องกำเนิดเส้นรอบวงแบบคลาสสิก ก็สามารถทำการเติมช่องว่างที่ผนังได้" +msgid "Don't print gap fill with a length is smaller than the threshold specified (in mm). This setting applies to top, bottom and solid infill and, if using the classic perimeter generator, to wall gap fill." +msgstr "อย่าพิมพ์การเติมช่องว่างโดยมีความยาวน้อยกว่าเกณฑ์ที่ระบุ (เป็นมม.) การตั้งค่านี้ใช้กับการเติมช่องว่างด้านบน ด้านล่าง และทึบ และหากใช้เครื่องกำเนิดเส้นรอบวงแบบคลาสสิก ก็สามารถทำการเติมช่องว่างที่ผนังได้" -msgid "" -"This is the speed for gap infill. Gaps usually have irregular line width and " -"should be printed more slowly." -msgstr "" -"ความเร็วของการเติมช่องว่าง Gap มักจะมีความกว้างของเส้นไม่สม่ำเสมอ และควรพิมพ์ให้ช้าลง" +msgid "This is the speed for gap infill. Gaps usually have irregular line width and should be printed more slowly." +msgstr "ความเร็วของการเติมช่องว่าง Gap มักจะมีความกว้างของเส้นไม่สม่ำเสมอ และควรพิมพ์ให้ช้าลง" msgid "Precise Z height" msgstr "ความสูง Z ที่แม่นยำ" -msgid "" -"Enable this to get precise Z height of object after slicing. It will get the " -"precise object height by fine-tuning the layer heights of the last few " -"layers. Note that this is an experimental parameter." -msgstr "" -"เปิดใช้งานสิ่งนี้เพื่อรับความสูง Z ของวัตถุที่แม่นยำหลังจากการแบ่งส่วน " -"มันจะได้ความสูงของวัตถุที่แม่นยำโดยการปรับความสูงของเลเยอร์ของสองสามเลเยอร์สุดท้ายอย่างละเอียด " -"โปรดทราบว่านี่เป็นพารามิเตอร์ทดลอง" +msgid "Enable this to get precise Z height of object after slicing. It will get the precise object height by fine-tuning the layer heights of the last few layers. Note that this is an experimental parameter." +msgstr "เปิดใช้งานสิ่งนี้เพื่อรับความสูง Z ของวัตถุที่แม่นยำหลังจากการแบ่งส่วน มันจะได้ความสูงของวัตถุที่แม่นยำโดยการปรับความสูงของเลเยอร์ของสองสามเลเยอร์สุดท้ายอย่างละเอียด โปรดทราบว่านี่เป็นพารามิเตอร์ทดลอง" msgid "Arc fitting" msgstr "ข้อต่อส่วนโค้ง" msgid "" -"Enable this to get a G-code file which has G2 and G3 moves. The fitting " -"tolerance is same as the resolution.\n" +"Enable this to get a G-code file which has G2 and G3 moves. The fitting tolerance is same as the resolution.\n" "\n" -"Note: For Klipper machines, this option is recommended to be disabled. " -"Klipper does not benefit from arc commands as these are split again into " -"line segments by the firmware. This results in a reduction in surface " -"quality as line segments are converted to arcs by the slicer and then back " -"to line segments by the firmware." +"Note: For Klipper machines, this option is recommended to be disabled. Klipper does not benefit from arc commands as these are split again into line segments by the firmware. This results in a reduction in surface quality as line segments are converted to arcs by the slicer and then back to line segments by the firmware." msgstr "" -"เปิดใช้งานสิ่งนี้เพื่อรับไฟล์ G-code ซึ่งมีการเคลื่อนไหว G2 และ G3 " -"ความคลาดเคลื่อนในการติดตั้งจะเหมือนกับความละเอียด\n" +"เปิดใช้งานสิ่งนี้เพื่อรับไฟล์ G-code ซึ่งมีการเคลื่อนไหว G2 และ G3 ความคลาดเคลื่อนในการติดตั้งจะเหมือนกับความละเอียด\n" "\n" -"หมายเหตุ: สำหรับเครื่อง Klipper แนะนำให้ปิดการใช้งานตัวเลือกนี้ Klipper " -"ไม่ได้รับประโยชน์จากคำสั่ง arc " -"เนื่องจากคำสั่งเหล่านี้จะถูกแบ่งออกเป็นส่วนของบรรทัดอีกครั้งโดยเฟิร์มแวร์ " -"ซึ่งส่งผลให้คุณภาพพื้นผิวลดลง เนื่องจากส่วนของเส้นถูกแปลงเป็นส่วนโค้งโดยตัวแบ่งส่วนข้อมูล " -"จากนั้นเฟิร์มแวร์จะแปลงกลับไปยังส่วนของเส้นตรง" +"หมายเหตุ: สำหรับเครื่อง Klipper แนะนำให้ปิดการใช้งานตัวเลือกนี้ Klipper ไม่ได้รับประโยชน์จากคำสั่ง arc เนื่องจากคำสั่งเหล่านี้จะถูกแบ่งออกเป็นส่วนของบรรทัดอีกครั้งโดยเฟิร์มแวร์ ซึ่งส่งผลให้คุณภาพพื้นผิวลดลง เนื่องจากส่วนของเส้นถูกแปลงเป็นส่วนโค้งโดยตัวแบ่งส่วนข้อมูล จากนั้นเฟิร์มแวร์จะแปลงกลับไปยังส่วนของเส้นตรง" msgid "Add line number" msgstr "เพิ่มหมายเลขบรรทัด" -msgid "" -"Enable this to add line number(Nx) at the beginning of each G-code line." +msgid "Enable this to add line number(Nx) at the beginning of each G-code line." msgstr "เปิดใช้งานสิ่งนี้เพื่อเพิ่มหมายเลขบรรทัด (Nx) ที่จุดเริ่มต้นของบรรทัด G-code แต่ละบรรทัด" msgid "Scan first layer" msgstr "สแกนชั้นแรก" -msgid "" -"Enable this to allow the camera on the printer to check the quality of the " -"first layer." +msgid "Enable this to allow the camera on the printer to check the quality of the first layer." msgstr "เปิดใช้งานสิ่งนี้เพื่อให้กล้องบนเครื่องพิมพ์สามารถตรวจสอบคุณภาพของเลเยอร์แรกได้" msgid "Power Loss Recovery" msgstr "การกู้คืนการสูญเสียพลังงาน" -msgid "" -"Choose how to control power loss recovery. When set to Printer " -"configuration, the slicer will not emit power loss recovery G-code and will " -"leave the printer's configuration unchanged. Applicable to Bambu Lab or " -"Marlin 2 firmware based printers." -msgstr "" -"เลือกวิธีควบคุมการกู้คืนพลังงานที่สูญเสียไป เมื่อตั้งค่าเป็นการกำหนดค่าเครื่องพิมพ์ " -"ตัวแบ่งส่วนข้อมูลจะไม่ปล่อย G-code การกู้คืนการสูญเสียพลังงาน " -"และจะปล่อยให้การกำหนดค่าของเครื่องพิมพ์ไม่เปลี่ยนแปลง ใช้ได้กับเครื่องพิมพ์ที่ใช้เฟิร์มแวร์ Bambu " -"Lab หรือ Marlin 2" +msgid "Choose how to control power loss recovery. When set to Printer configuration, the slicer will not emit power loss recovery G-code and will leave the printer's configuration unchanged. Applicable to Bambu Lab or Marlin 2 firmware based printers." +msgstr "เลือกวิธีควบคุมการกู้คืนพลังงานที่สูญเสียไป เมื่อตั้งค่าเป็นการกำหนดค่าเครื่องพิมพ์ ตัวแบ่งส่วนข้อมูลจะไม่ปล่อย G-code การกู้คืนการสูญเสียพลังงาน และจะปล่อยให้การกำหนดค่าของเครื่องพิมพ์ไม่เปลี่ยนแปลง ใช้ได้กับเครื่องพิมพ์ที่ใช้เฟิร์มแวร์ Bambu Lab หรือ Marlin 2" msgid "Printer configuration" msgstr "การกำหนดค่าเครื่องพิมพ์" @@ -15477,12 +13262,8 @@ msgstr "การกำหนดค่าเครื่องพิมพ์" msgid "Nozzle type" msgstr "ชนิดหัวฉีด" -msgid "" -"The metallic material of the nozzle: This determines the abrasive resistance " -"of the nozzle and what kind of filament can be printed." -msgstr "" -"วัสดุโลหะของหัวฉีด สิ่งนี้จะกำหนดความต้านทานต่อการขัดถูของหัวฉีด " -"และชนิดของฟิลาเมนท์ที่สามารถพิมพ์ได้" +msgid "The metallic material of the nozzle: This determines the abrasive resistance of the nozzle and what kind of filament can be printed." +msgstr "วัสดุโลหะของหัวฉีด สิ่งนี้จะกำหนดความต้านทานต่อการขัดถูของหัวฉีด และชนิดของฟิลาเมนท์ที่สามารถพิมพ์ได้" msgid "Hardened steel" msgstr "เหล็กชุบแข็ง" @@ -15496,9 +13277,7 @@ msgstr "ทังสเตนคาร์ไบด์" msgid "Nozzle HRC" msgstr "หัวฉีด HRC" -msgid "" -"The nozzle's hardness. Zero means no checking for nozzle hardness during " -"slicing." +msgid "The nozzle's hardness. Zero means no checking for nozzle hardness during slicing." msgstr "ความแข็งของหัวฉีด ค่าศูนย์หมายถึงไม่ต้องตรวจสอบความแข็งของหัวฉีดระหว่างการตัด" msgid "HRC" @@ -15528,26 +13307,16 @@ msgstr "ตำแหน่งวัตถุที่ดีที่สุด" msgid "Best auto arranging position in range [0,1] w.r.t. bed shape." msgstr "ตำแหน่งการจัดเรียงอัตโนมัติที่ดีที่สุดในช่วง [0,1] w.r.t. รูปร่างฐานพิมพ์" -msgid "" -"Enable this option if machine has auxiliary part cooling fan. G-code " -"command: M106 P2 S(0-255)." -msgstr "" -"เปิดใช้งานตัวเลือกนี้หากเครื่องมีพัดลมระบายความร้อนชิ้นส่วนเสริม คำสั่งรหัส G: M106 P2 S(0-255)" +msgid "Enable this option if machine has auxiliary part cooling fan. G-code command: M106 P2 S(0-255)." +msgstr "เปิดใช้งานตัวเลือกนี้หากเครื่องมีพัดลมระบายความร้อนชิ้นส่วนเสริม คำสั่งรหัส G: M106 P2 S(0-255)" msgid "" -"Start the fan this number of seconds earlier than its target start time (you " -"can use fractional seconds). It assumes infinite acceleration for this time " -"estimation, and will only take into account G1 and G0 moves (arc fitting is " -"unsupported).\n" -"It won't move fan commands from custom G-code (they act as a sort of " -"'barrier').\n" -"It won't move fan commands into the start G-code if the 'only custom start G-" -"code' is activated.\n" +"Start the fan this number of seconds earlier than its target start time (you can use fractional seconds). It assumes infinite acceleration for this time estimation, and will only take into account G1 and G0 moves (arc fitting is unsupported).\n" +"It won't move fan commands from custom G-code (they act as a sort of 'barrier').\n" +"It won't move fan commands into the start G-code if the 'only custom start G-code' is activated.\n" "Use 0 to deactivate." msgstr "" -"เริ่มพัดลมตามจำนวนวินาทีนี้เร็วกว่าเวลาเริ่มต้นเป้าหมาย (คุณสามารถใช้เศษส่วนวินาทีได้) " -"โดยจะใช้ความเร่งอนันต์สำหรับการประมาณเวลานี้ และจะพิจารณาเฉพาะการเคลื่อนที่ของ G1 และ G0 " -"เท่านั้น (ไม่รองรับการปรับส่วนโค้ง)\n" +"เริ่มพัดลมตามจำนวนวินาทีนี้เร็วกว่าเวลาเริ่มต้นเป้าหมาย (คุณสามารถใช้เศษส่วนวินาทีได้) โดยจะใช้ความเร่งอนันต์สำหรับการประมาณเวลานี้ และจะพิจารณาเฉพาะการเคลื่อนที่ของ G1 และ G0 เท่านั้น (ไม่รองรับการปรับส่วนโค้ง)\n" "มันจะไม่ย้ายคำสั่งพัดลมจาก G-code ที่กำหนดเอง (คำสั่งเหล่านั้นทำหน้าที่เป็น 'อุปสรรค')\n" "มันจะไม่ย้ายคำสั่งพัดลมไปที่รหัส G เริ่มต้นหากเปิดใช้งาน 'รหัส G-รหัสเริ่มต้นแบบกำหนดเองเท่านั้น'\n" "ใช้ 0 เพื่อปิดใช้งาน" @@ -15562,50 +13331,24 @@ msgid "Fan kick-start time" msgstr "เวลาเริ่มเตะพัดลม" msgid "" -"Emit a max fan speed command for this amount of seconds before reducing to " -"target speed to kick-start the cooling fan.\n" -"This is useful for fans where a low PWM/power may be insufficient to get the " -"fan started spinning from a stop, or to get the fan up to speed faster.\n" +"Emit a max fan speed command for this amount of seconds before reducing to target speed to kick-start the cooling fan.\n" +"This is useful for fans where a low PWM/power may be insufficient to get the fan started spinning from a stop, or to get the fan up to speed faster.\n" "Set to 0 to deactivate." msgstr "" "ปล่อยคำสั่งความเร็วพัดลมสูงสุดเป็นเวลาไม่กี่วินาทีก่อนที่จะลดความเร็วลงตามเป้าหมายเพื่อสตาร์ทพัดลมระบายความร้อน\n" -"สิ่งนี้มีประโยชน์สำหรับพัดลมที่ความเร็ว/PWM ต่ำอาจไม่เพียงพอที่จะทำให้พัดลมเริ่มหมุนจากจุดหยุด " -"หรือเพื่อให้พัดลมทำงานเร็วขึ้น\n" +"สิ่งนี้มีประโยชน์สำหรับพัดลมที่ความเร็ว/PWM ต่ำอาจไม่เพียงพอที่จะทำให้พัดลมเริ่มหมุนจากจุดหยุด หรือเพื่อให้พัดลมทำงานเร็วขึ้น\n" "ตั้งค่าเป็น 0 เพื่อปิดใช้งาน" msgid "Minimum non-zero part cooling fan speed" msgstr "ความเร็วพัดลมระบายความร้อนชิ้นส่วนขั้นต่ำที่ไม่เป็นศูนย์" msgid "" -"Some part-cooling fans cannot start spinning when commanded below a certain " -"PWM duty cycle. When set above 0, any non-zero part-cooling fan command will " -"be raised to at least this percentage so the fan reliably starts. A fan " -"command of 0 (fan off) is always honoured exactly. This clamp is applied " -"after every other fan calculation (first-layer ramp, layer-time " -"interpolation, overhang/bridge/support-interface/ironing overrides), so " -"scaling still operates within the range [this value, 100%].\n" -"If your firmware already disables the fan below a threshold (for example " -"Klipper's [fan] off_below: 0.10 shuts the fan off whenever the commanded " -"duty cycle is below 10%), this option and the firmware threshold should " -"ideally be set to the same value. Matching them (e.g. off_below: 0.10 in " -"Klipper and 10% here) guarantees the slicer never emits a non-zero value " -"that the firmware would silently drop, and the fan never receives a value " -"below the one you know it can actually spool at.\n" +"Some part-cooling fans cannot start spinning when commanded below a certain PWM duty cycle. When set above 0, any non-zero part-cooling fan command will be raised to at least this percentage so the fan reliably starts. A fan command of 0 (fan off) is always honoured exactly. This clamp is applied after every other fan calculation (first-layer ramp, layer-time interpolation, overhang/bridge/support-interface/ironing overrides), so scaling still operates within the range [this value, 100%].\n" +"If your firmware already disables the fan below a threshold (for example Klipper's [fan] off_below: 0.10 shuts the fan off whenever the commanded duty cycle is below 10%), this option and the firmware threshold should ideally be set to the same value. Matching them (e.g. off_below: 0.10 in Klipper and 10% here) guarantees the slicer never emits a non-zero value that the firmware would silently drop, and the fan never receives a value below the one you know it can actually spool at.\n" "Set to 0 to deactivate." msgstr "" -"พัดลมระบายความร้อนบางส่วนไม่สามารถเริ่มหมุนได้เมื่อได้รับคำสั่งให้ต่ำกว่ารอบการทำงานของ PWM " -"ที่กำหนด เมื่อตั้งค่าสูงกว่า 0 " -"คำสั่งพัดลมระบายความร้อนที่ไม่เป็นศูนย์จะเพิ่มขึ้นเป็นเปอร์เซ็นต์เป็นอย่างน้อย " -"เพื่อให้พัดลมเริ่มทำงานได้อย่างน่าเชื่อถือ คำสั่งพัดลมเป็น 0 (ปิดพัดลม) จะได้รับเกียรติเสมอ " -"แคลมป์นี้จะถูกนำไปใช้หลังจากการคำนวณพัดลมอื่นๆ ทุกครั้ง (การลาดชั้นแรก การแก้ไขเลเยอร์ไทม์ " -"ส่วนยื่น/บริดจ์/ส่วนรองรับ/การแทนที่การรีดผิว) ดังนั้นการปรับขนาดยังคงทำงานภายในช่วง [ค่านี้ " -"100%]\n" -"หากเฟิร์มแวร์ของคุณปิดใช้งานพัดลมที่ต่ำกว่าเกณฑ์อยู่แล้ว (เช่น [พัดลม] off_below ของ Klipper: " -"0.10 จะปิดพัดลมเมื่อใดก็ตามที่รอบการทำงานที่ได้รับคำสั่งต่ำกว่า 10%) " -"ตัวเลือกนี้และเกณฑ์ของเฟิร์มแวร์ควรได้รับการตั้งค่าตามอุดมคติให้เป็นค่าเดียวกัน การจับคู่พวกมัน (เช่น " -"off_below: 0.10 ใน Klipper และ 10% ที่นี่) " -"รับประกันว่าตัวแบ่งส่วนข้อมูลจะไม่ปล่อยค่าที่ไม่ใช่ศูนย์ซึ่งเฟิร์มแวร์จะดรอปอย่างเงียบๆ " -"และพัดลมจะไม่ได้รับค่าที่ต่ำกว่าค่าที่คุณรู้ว่าสามารถสปูลได้จริง\n" +"พัดลมระบายความร้อนบางส่วนไม่สามารถเริ่มหมุนได้เมื่อได้รับคำสั่งให้ต่ำกว่ารอบการทำงานของ PWM ที่กำหนด เมื่อตั้งค่าสูงกว่า 0 คำสั่งพัดลมระบายความร้อนที่ไม่เป็นศูนย์จะเพิ่มขึ้นเป็นเปอร์เซ็นต์เป็นอย่างน้อย เพื่อให้พัดลมเริ่มทำงานได้อย่างน่าเชื่อถือ คำสั่งพัดลมเป็น 0 (ปิดพัดลม) จะได้รับเกียรติเสมอ แคลมป์นี้จะถูกนำไปใช้หลังจากการคำนวณพัดลมอื่นๆ ทุกครั้ง (การลาดชั้นแรก การแก้ไขเลเยอร์ไทม์ ส่วนยื่น/บริดจ์/ส่วนรองรับ/การแทนที่การรีดผิว) ดังนั้นการปรับขนาดยังคงทำงานภายในช่วง [ค่านี้ 100%]\n" +"หากเฟิร์มแวร์ของคุณปิดใช้งานพัดลมที่ต่ำกว่าเกณฑ์อยู่แล้ว (เช่น [พัดลม] off_below ของ Klipper: 0.10 จะปิดพัดลมเมื่อใดก็ตามที่รอบการทำงานที่ได้รับคำสั่งต่ำกว่า 10%) ตัวเลือกนี้และเกณฑ์ของเฟิร์มแวร์ควรได้รับการตั้งค่าตามอุดมคติให้เป็นค่าเดียวกัน การจับคู่พวกมัน (เช่น off_below: 0.10 ใน Klipper และ 10% ที่นี่) รับประกันว่าตัวแบ่งส่วนข้อมูลจะไม่ปล่อยค่าที่ไม่ใช่ศูนย์ซึ่งเฟิร์มแวร์จะดรอปอย่างเงียบๆ และพัดลมจะไม่ได้รับค่าที่ต่ำกว่าค่าที่คุณรู้ว่าสามารถสปูลได้จริง\n" "ตั้งค่าเป็น 0 เพื่อปิดใช้งาน" msgid "%" @@ -15664,15 +13407,8 @@ msgstr "เปิดใช้งานตัวเลือกนี้หาก msgid "Label objects" msgstr "ติดป้ายกำกับวัตถุ" -msgid "" -"Enable this to add comments into the G-code labeling print moves with what " -"object they belong to, which is useful for the Octoprint CancelObject plug-" -"in. This setting is NOT compatible with Single Extruder Multi Material setup " -"and Wipe into Object / Wipe into Infill." -msgstr "" -"เปิดใช้งานสิ่งนี้เพื่อเพิ่มความคิดเห็นลงในการพิมพ์การติดฉลาก G-code ด้วยวัตถุที่อยู่ในนั้น " -"ซึ่งมีประโยชน์สำหรับปลั๊กอิน Octoprint CancelObject การตั้งค่านี้เข้ากันไม่ได้กับการตั้งค่า " -"Single ชุดดันเส้น Multi Material และ Wipe into Object / Wipe into ไส้ใน" +msgid "Enable this to add comments into the G-code labeling print moves with what object they belong to, which is useful for the Octoprint CancelObject plug-in. This setting is NOT compatible with Single Extruder Multi Material setup and Wipe into Object / Wipe into Infill." +msgstr "เปิดใช้งานสิ่งนี้เพื่อเพิ่มความคิดเห็นลงในการพิมพ์การติดฉลาก G-code ด้วยวัตถุที่อยู่ในนั้น ซึ่งมีประโยชน์สำหรับปลั๊กอิน Octoprint CancelObject การตั้งค่านี้เข้ากันไม่ได้กับการตั้งค่า Single ชุดดันเส้น Multi Material และ Wipe into Object / Wipe into ไส้ใน" msgid "Exclude objects" msgstr "ไม่รวมวัตถุ" @@ -15683,95 +13419,44 @@ msgstr "เปิดใช้งานตัวเลือกนี้เพื msgid "Verbose G-code" msgstr "G-code แบบละเอียด" -msgid "" -"Enable this to get a commented G-code file, with each line explained by a " -"descriptive text. If you print from SD card, the additional weight of the " -"file could make your firmware slow down." -msgstr "" -"เปิดใช้งานสิ่งนี้เพื่อรับไฟล์ G-code ที่มีความคิดเห็น โดยแต่ละบรรทัดจะอธิบายด้วยข้อความอธิบาย " -"หากคุณพิมพ์จากการ์ด SD น้ำหนักที่เพิ่มขึ้นของไฟล์อาจทำให้เฟิร์มแวร์ของคุณช้าลง" +msgid "Enable this to get a commented G-code file, with each line explained by a descriptive text. If you print from SD card, the additional weight of the file could make your firmware slow down." +msgstr "เปิดใช้งานสิ่งนี้เพื่อรับไฟล์ G-code ที่มีความคิดเห็น โดยแต่ละบรรทัดจะอธิบายด้วยข้อความอธิบาย หากคุณพิมพ์จากการ์ด SD น้ำหนักที่เพิ่มขึ้นของไฟล์อาจทำให้เฟิร์มแวร์ของคุณช้าลง" msgid "Infill combination" msgstr "ไส้ในชุดค่าผสม" -msgid "" -"Automatically combine sparse infill of several layers to print together in " -"order to reduce time. Walls are still printed with original layer height." -msgstr "" -"รวมไส้ในแบบโปร่งของหลายชั้นโดยอัตโนมัติเพื่อพิมพ์เข้าด้วยกันเพื่อลดเวลา " -"ผนังยังคงพิมพ์ด้วยความสูงชั้นเดิม" +msgid "Automatically combine sparse infill of several layers to print together in order to reduce time. Walls are still printed with original layer height." +msgstr "รวมไส้ในแบบโปร่งของหลายชั้นโดยอัตโนมัติเพื่อพิมพ์เข้าด้วยกันเพื่อลดเวลา ผนังยังคงพิมพ์ด้วยความสูงชั้นเดิม" msgid "Infill shift step" msgstr "ขั้นตอนไส้ในกะ" -msgid "" -"This parameter adds a slight displacement to each layer of infill to create " -"a cross texture." +msgid "This parameter adds a slight displacement to each layer of infill to create a cross texture." msgstr "พารามิเตอร์นี้จะเพิ่มการกระจัดเล็กน้อยในแต่ละชั้นของ ไส้ใน เพื่อสร้างพื้นผิวแบบกากบาท" msgid "Sparse infill rotation template" msgstr "เทมเพลตการหมุน ไส้ใน แบบกระจัดกระจาย" -msgid "" -"Rotate the sparse infill direction per layer using a template of angles. " -"Enter comma-separated degrees (e.g., '0,30,60,90'). Angles are applied in " -"order by layer and repeat when the list ends. Advanced syntax is supported: " -"'+5' rotates +5° every layer; '+5#5' rotates +5° every 5 layers. See the " -"Wiki for details. When a template is set, the standard infill direction " -"setting is ignored. Note: some infill patterns (e.g., Gyroid) control " -"rotation themselves; use with care." -msgstr "" -"หมุนทิศทางไส้ในแบบโปร่งต่อเลเยอร์โดยใช้เทมเพลตมุม ป้อนองศาที่คั่นด้วยเครื่องหมายจุลภาค (เช่น " -"'0,30,60,90') มุมจะถูกนำไปใช้ตามลำดับชั้นและทำซ้ำเมื่อรายการสิ้นสุด รองรับไวยากรณ์ขั้นสูง: " -"'+5' หมุน +5° ทุกเลเยอร์; '+5#5' หมุน +5° ทุกๆ 5 เลเยอร์ ดูวิกิสำหรับรายละเอียด " -"เมื่อตั้งค่าเทมเพลต การตั้งค่าทิศทางไส้ในมาตรฐานจะถูกละเว้น หมายเหตุ: รูปแบบไส้ในบางรูปแบบ " -"(เช่น ไจรอยด์) จะควบคุมการหมุนด้วยตัวเอง ใช้ด้วยความระมัดระวัง" +msgid "Rotate the sparse infill direction per layer using a template of angles. Enter comma-separated degrees (e.g., '0,30,60,90'). Angles are applied in order by layer and repeat when the list ends. Advanced syntax is supported: '+5' rotates +5° every layer; '+5#5' rotates +5° every 5 layers. See the Wiki for details. When a template is set, the standard infill direction setting is ignored. Note: some infill patterns (e.g., Gyroid) control rotation themselves; use with care." +msgstr "หมุนทิศทางไส้ในแบบโปร่งต่อเลเยอร์โดยใช้เทมเพลตมุม ป้อนองศาที่คั่นด้วยเครื่องหมายจุลภาค (เช่น '0,30,60,90') มุมจะถูกนำไปใช้ตามลำดับชั้นและทำซ้ำเมื่อรายการสิ้นสุด รองรับไวยากรณ์ขั้นสูง: '+5' หมุน +5° ทุกเลเยอร์; '+5#5' หมุน +5° ทุกๆ 5 เลเยอร์ ดูวิกิสำหรับรายละเอียด เมื่อตั้งค่าเทมเพลต การตั้งค่าทิศทางไส้ในมาตรฐานจะถูกละเว้น หมายเหตุ: รูปแบบไส้ในบางรูปแบบ (เช่น ไจรอยด์) จะควบคุมการหมุนด้วยตัวเอง ใช้ด้วยความระมัดระวัง" msgid "Solid infill rotation template" msgstr "เทมเพลตการหมุน ไส้ใน ที่เป็นของแข็ง" -msgid "" -"This parameter adds a rotation of solid infill direction to each layer " -"according to the specified template. The template is a comma-separated list " -"of angles in degrees, e.g. '0,90'. The first angle is applied to the first " -"layer, the second angle to the second layer, and so on. If there are more " -"layers than angles, the angles will be repeated. Note that not all solid " -"infill patterns support rotation." -msgstr "" -"พารามิเตอร์นี้จะเพิ่มการหมุนของทิศทางไส้ในแบบทึบลงในแต่ละชั้นตามเทมเพลตที่ระบุ " -"เทมเพลตคือรายการมุมในหน่วยองศาที่คั่นด้วยเครื่องหมายจุลภาค เช่น '0,90'. " -"มุมแรกใช้กับเลเยอร์แรก มุมที่สองกับเลเยอร์ที่สอง และอื่นๆ หากมีชั้นมากกว่ามุม มุมจะเกิดซ้ำ " -"โปรดทราบว่ารูปแบบไส้ในแบบทึบบางรูปแบบไม่รองรับการหมุน" +msgid "This parameter adds a rotation of solid infill direction to each layer according to the specified template. The template is a comma-separated list of angles in degrees, e.g. '0,90'. The first angle is applied to the first layer, the second angle to the second layer, and so on. If there are more layers than angles, the angles will be repeated. Note that not all solid infill patterns support rotation." +msgstr "พารามิเตอร์นี้จะเพิ่มการหมุนของทิศทางไส้ในแบบทึบลงในแต่ละชั้นตามเทมเพลตที่ระบุ เทมเพลตคือรายการมุมในหน่วยองศาที่คั่นด้วยเครื่องหมายจุลภาค เช่น '0,90'. มุมแรกใช้กับเลเยอร์แรก มุมที่สองกับเลเยอร์ที่สอง และอื่นๆ หากมีชั้นมากกว่ามุม มุมจะเกิดซ้ำ โปรดทราบว่ารูปแบบไส้ในแบบทึบบางรูปแบบไม่รองรับการหมุน" msgid "Skeleton infill density" msgstr "ความหนาแน่นของโครงกระดูก" -msgid "" -"The remaining part of the model contour after removing a certain depth from " -"the surface is called the skeleton. This parameter is used to adjust the " -"density of this section. When two regions have the same sparse infill " -"settings but different skeleton densities, their skeleton areas will develop " -"overlapping sections. Default is as same as infill density." -msgstr "" -"ส่วนที่เหลือของรูปร่างของแบบจำลองหลังจากลบความลึกบางส่วนออกจากพื้นผิวแล้วเรียกว่าโครงกระดูก " -"พารามิเตอร์นี้ใช้เพื่อปรับความหนาแน่นของส่วนนี้ เมื่อสองภูมิภาคมีการตั้งค่าไส้ในแบบโปร่งเหมือนกัน " -"แต่มีความหนาแน่นของโครงกระดูกต่างกัน พื้นที่โครงกระดูกของพวกมันจะพัฒนาส่วนที่ทับซ้อนกัน " -"ค่าเริ่มต้นจะเหมือนกับความหนาแน่นของ ไส้ใน" +msgid "The remaining part of the model contour after removing a certain depth from the surface is called the skeleton. This parameter is used to adjust the density of this section. When two regions have the same sparse infill settings but different skeleton densities, their skeleton areas will develop overlapping sections. Default is as same as infill density." +msgstr "ส่วนที่เหลือของรูปร่างของแบบจำลองหลังจากลบความลึกบางส่วนออกจากพื้นผิวแล้วเรียกว่าโครงกระดูก พารามิเตอร์นี้ใช้เพื่อปรับความหนาแน่นของส่วนนี้ เมื่อสองภูมิภาคมีการตั้งค่าไส้ในแบบโปร่งเหมือนกัน แต่มีความหนาแน่นของโครงกระดูกต่างกัน พื้นที่โครงกระดูกของพวกมันจะพัฒนาส่วนที่ทับซ้อนกัน ค่าเริ่มต้นจะเหมือนกับความหนาแน่นของ ไส้ใน" msgid "Skin infill density" msgstr "ไส้ในความหนาแน่นของผิวหนัง" -msgid "" -"The portion of the model's outer surface within a certain depth range is " -"called the skin. This parameter is used to adjust the density of this " -"section. When two regions have the same sparse infill settings but different " -"skin densities, this area will not be split into two separate regions. " -"Default is as same as infill density." -msgstr "" -"ส่วนของพื้นผิวด้านนอกของแบบจำลองภายในช่วงความลึกที่กำหนดเรียกว่าผิวหนัง " -"พารามิเตอร์นี้ใช้เพื่อปรับความหนาแน่นของส่วนนี้ เมื่อสองภูมิภาคมีการตั้งค่าไส้ในแบบโปร่งเหมือนกัน " -"แต่มีความหนาแน่นของผิวหนังต่างกัน พื้นที่นี้จะไม่ถูกแบ่งออกเป็นสองภูมิภาคที่แยกจากกัน " -"ค่าเริ่มต้นจะเหมือนกับความหนาแน่นของ ไส้ใน" +msgid "The portion of the model's outer surface within a certain depth range is called the skin. This parameter is used to adjust the density of this section. When two regions have the same sparse infill settings but different skin densities, this area will not be split into two separate regions. Default is as same as infill density." +msgstr "ส่วนของพื้นผิวด้านนอกของแบบจำลองภายในช่วงความลึกที่กำหนดเรียกว่าผิวหนัง พารามิเตอร์นี้ใช้เพื่อปรับความหนาแน่นของส่วนนี้ เมื่อสองภูมิภาคมีการตั้งค่าไส้ในแบบโปร่งเหมือนกัน แต่มีความหนาแน่นของผิวหนังต่างกัน พื้นที่นี้จะไม่ถูกแบ่งออกเป็นสองภูมิภาคที่แยกจากกัน ค่าเริ่มต้นจะเหมือนกับความหนาแน่นของ ไส้ใน" msgid "Skin infill depth" msgstr "ไส้ในความลึกให้กับผิว" @@ -15800,13 +13485,8 @@ msgstr "ปรับความกว้างของเส้นของเ msgid "Symmetric infill Y axis" msgstr "แกน Y ไส้ในแบบสมมาตร" -msgid "" -"If the model has two parts that are symmetric about the Y axis, and you want " -"these parts to have symmetric textures, please click this option on one of " -"the parts." -msgstr "" -"หากแบบจำลองมีสองส่วนที่สมมาตรเกี่ยวกับแกน Y และคุณต้องการให้ส่วนเหล่านี้มีพื้นผิวที่สมมาตร " -"โปรดคลิกตัวเลือกนี้บนส่วนใดส่วนหนึ่ง" +msgid "If the model has two parts that are symmetric about the Y axis, and you want these parts to have symmetric textures, please click this option on one of the parts." +msgstr "หากแบบจำลองมีสองส่วนที่สมมาตรเกี่ยวกับแกน Y และคุณต้องการให้ส่วนเหล่านี้มีพื้นผิวที่สมมาตร โปรดคลิกตัวเลือกนี้บนส่วนใดส่วนหนึ่ง" msgid "Infill combination - Max layer height" msgstr "ชุดค่าผสม ไส้ใน - ความสูงของชั้นสูงสุด" @@ -15814,25 +13494,19 @@ msgstr "ชุดค่าผสม ไส้ใน - ความสูงข msgid "" "Maximum layer height for the combined sparse infill.\n" "\n" -"Set it to 0 or 100% to use the nozzle diameter (for maximum reduction in " -"print time) or a value of ~80% to maximize sparse infill strength.\n" +"Set it to 0 or 100% to use the nozzle diameter (for maximum reduction in print time) or a value of ~80% to maximize sparse infill strength.\n" "\n" -"The number of layers over which infill is combined is derived by dividing " -"this value with the layer height and rounded down to the nearest decimal.\n" +"The number of layers over which infill is combined is derived by dividing this value with the layer height and rounded down to the nearest decimal.\n" "\n" -"Use either absolute mm values (eg. 0.32mm for a 0.4mm nozzle) or % values " -"(eg 80%). This value must not be larger than the nozzle diameter." +"Use either absolute mm values (eg. 0.32mm for a 0.4mm nozzle) or % values (eg 80%). This value must not be larger than the nozzle diameter." msgstr "" "ความสูงสูงสุดของชั้นสำหรับไส้ในแบบกระจายแบบรวม\n" "\n" -"ตั้งค่าเป็น 0 หรือ 100% เพื่อใช้เส้นผ่านศูนย์กลางหัวฉีด (เพื่อลดเวลาการพิมพ์สูงสุด) หรือค่า ~80% " -"เพื่อเพิ่มความแข็งแรงของวัสดุไส้ในแบบโปร่งให้สูงสุด\n" +"ตั้งค่าเป็น 0 หรือ 100% เพื่อใช้เส้นผ่านศูนย์กลางหัวฉีด (เพื่อลดเวลาการพิมพ์สูงสุด) หรือค่า ~80% เพื่อเพิ่มความแข็งแรงของวัสดุไส้ในแบบโปร่งให้สูงสุด\n" "\n" -"จำนวนเลเยอร์ที่รวม ไส้ใน " -"ได้มาโดยการหารค่านี้ด้วยความสูงของเลเยอร์และปัดเศษลงให้เป็นทศนิยมที่ใกล้ที่สุด\n" +"จำนวนเลเยอร์ที่รวม ไส้ใน ได้มาโดยการหารค่านี้ด้วยความสูงของเลเยอร์และปัดเศษลงให้เป็นทศนิยมที่ใกล้ที่สุด\n" "\n" -"ใช้ค่าสัมบูรณ์ มม. (เช่น 0.32 มม. สำหรับหัวฉีด 0.4 มม.) หรือค่า % (เช่น 80%) " -"ค่านี้ต้องไม่ใหญ่กว่าเส้นผ่านศูนย์กลางของหัวฉีด" +"ใช้ค่าสัมบูรณ์ มม. (เช่น 0.32 มม. สำหรับหัวฉีด 0.4 มม.) หรือค่า % (เช่น 80%) ค่านี้ต้องไม่ใหญ่กว่าเส้นผ่านศูนย์กลางของหัวฉีด" msgid "Enable clumping detection" msgstr "เปิดใช้งานการตรวจจับการจับกันเป็นก้อน" @@ -15856,42 +13530,22 @@ msgstr "" "เส้นพลาสติกสำหรับพิมพ์ไส้ในแบบโปร่งภายใน\n" "\"ค่าเริ่มต้น\" ใช้เส้นพลาสติกของวัตถุ/ชิ้นส่วนที่ใช้งานอยู่" -msgid "" -"Line width of internal sparse infill. If expressed as a %, it will be " -"computed over the nozzle diameter." -msgstr "" -"ความกว้างของเส้นของไส้ในแบบกระจัดกระจายภายใน หากแสดงเป็น % " -"จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" +msgid "Line width of internal sparse infill. If expressed as a %, it will be computed over the nozzle diameter." +msgstr "ความกว้างของเส้นของไส้ในแบบกระจัดกระจายภายใน หากแสดงเป็น % จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" msgid "Infill/wall overlap" msgstr "ไส้ในซ้อนทับผนัง" #, no-c-format, no-boost-format -msgid "" -"This allows the infill area to be enlarged slightly to overlap with walls " -"for better bonding. The percentage value is relative to line width of sparse " -"infill. Set this value to ~10-15% to minimize potential over extrusion and " -"accumulation of material resulting in rough top surfaces." -msgstr "" -"พื้นที่ไส้ในจะขยายใหญ่ขึ้นเล็กน้อยเพื่อให้ทับซ้อนกับผนังเพื่อการยึดเกาะที่ดีขึ้น " -"ค่าเปอร์เซ็นต์สัมพันธ์กับความกว้างของเส้นของไส้ในแบบกระจัดกระจาย ตั้งค่านี้เป็น ~10-15% " -"เพื่อลดโอกาสเกิดการอัดขึ้นรูปและการสะสมของวัสดุ ส่งผลให้พื้นผิวด้านบนขรุขระ" +msgid "This allows the infill area to be enlarged slightly to overlap with walls for better bonding. The percentage value is relative to line width of sparse infill. Set this value to ~10-15% to minimize potential over extrusion and accumulation of material resulting in rough top surfaces." +msgstr "พื้นที่ไส้ในจะขยายใหญ่ขึ้นเล็กน้อยเพื่อให้ทับซ้อนกับผนังเพื่อการยึดเกาะที่ดีขึ้น ค่าเปอร์เซ็นต์สัมพันธ์กับความกว้างของเส้นของไส้ในแบบกระจัดกระจาย ตั้งค่านี้เป็น ~10-15% เพื่อลดโอกาสเกิดการอัดขึ้นรูปและการสะสมของวัสดุ ส่งผลให้พื้นผิวด้านบนขรุขระ" msgid "Top/Bottom solid infill/wall overlap" msgstr "ด้านบน/ด้านล่างของช่องทึบ/ผนังทับซ้อนกัน" #, no-c-format, no-boost-format -msgid "" -"Top solid infill area is enlarged slightly to overlap with wall for better " -"bonding and to minimize the appearance of pinholes where the top infill " -"meets the walls. A value of 25-30% is a good starting point, minimizing the " -"appearance of pinholes. The percentage value is relative to line width of " -"sparse infill." -msgstr "" -"พื้นที่ไส้ในของแข็งด้านบนจะถูกขยายให้ใหญ่ขึ้นเล็กน้อยเพื่อให้ทับซ้อนกับผนังเพื่อการยึดเกาะที่ดีขึ้น " -"และเพื่อลดการเกิดรูเข็มที่ซึ่งอินฟิลด้านบนบรรจบกับผนัง ค่า 25-30% ถือเป็นจุดเริ่มต้นที่ดี " -"โดยช่วยลดการเกิดรูเข็มให้เหลือน้อยที่สุด " -"ค่าเปอร์เซ็นต์สัมพันธ์กับความกว้างของเส้นของไส้ในแบบกระจัดกระจาย" +msgid "Top solid infill area is enlarged slightly to overlap with wall for better bonding and to minimize the appearance of pinholes where the top infill meets the walls. A value of 25-30% is a good starting point, minimizing the appearance of pinholes. The percentage value is relative to line width of sparse infill." +msgstr "พื้นที่ไส้ในของแข็งด้านบนจะถูกขยายให้ใหญ่ขึ้นเล็กน้อยเพื่อให้ทับซ้อนกับผนังเพื่อการยึดเกาะที่ดีขึ้น และเพื่อลดการเกิดรูเข็มที่ซึ่งอินฟิลด้านบนบรรจบกับผนัง ค่า 25-30% ถือเป็นจุดเริ่มต้นที่ดี โดยช่วยลดการเกิดรูเข็มให้เหลือน้อยที่สุด ค่าเปอร์เซ็นต์สัมพันธ์กับความกว้างของเส้นของไส้ในแบบกระจัดกระจาย" msgid "This is the speed for internal sparse infill." msgstr "ความเร็วของ ไส้ใน เบาบางภายใน" @@ -15905,45 +13559,26 @@ msgstr "ชื่อของโปรไฟล์ผู้ปกครอง" msgid "Interface shells" msgstr "เชลล์อินเตอร์เฟส" -msgid "" -"Force the generation of solid shells between adjacent materials/volumes. " -"Useful for multi-extruder prints with translucent materials or manual " -"soluble support material." -msgstr "" -"บังคับการสร้างเปลือกแข็งระหว่างวัสดุ/ปริมาตรที่อยู่ติดกัน " -"มีประโยชน์สำหรับการพิมพ์แบบหลายชุดดันเส้นด้วยวัสดุโปร่งแสงหรือวัสดุรองรับที่ละลายน้ำได้ด้วยตนเอง" +msgid "Force the generation of solid shells between adjacent materials/volumes. Useful for multi-extruder prints with translucent materials or manual soluble support material." +msgstr "บังคับการสร้างเปลือกแข็งระหว่างวัสดุ/ปริมาตรที่อยู่ติดกัน มีประโยชน์สำหรับการพิมพ์แบบหลายชุดดันเส้นด้วยวัสดุโปร่งแสงหรือวัสดุรองรับที่ละลายน้ำได้ด้วยตนเอง" msgid "Maximum width of a segmented region" msgstr "ความกว้างสูงสุดของขอบเขตที่แบ่งส่วน" -msgid "" -"Maximum width of a segmented region. A value of 0 disables this feature." +msgid "Maximum width of a segmented region. A value of 0 disables this feature." msgstr "ความกว้างสูงสุดของขอบเขตที่แบ่งส่วน ศูนย์ปิดใช้งานคุณลักษณะนี้" msgid "Interlocking depth of a segmented region" msgstr "ความลึกที่ประสานกันของภูมิภาคที่แบ่งส่วน" -msgid "" -"Interlocking depth of a segmented region. It will be ignored if " -"\"mmu_segmented_region_max_width\" is zero or if " -"\"mmu_segmented_region_interlocking_depth\" is bigger than " -"\"mmu_segmented_region_max_width\". Zero disables this feature." -msgstr "" -"ความลึกที่ประสานกันของภูมิภาคที่แบ่งส่วน ระบบจะไม่สนใจหาก " -"\"mmu_segmented_region_max_width\" เป็นศูนย์ หรือหาก " -"\"mmu_segmented_region_interlocking_detail\" ใหญ่กว่า " -"\"mmu_segmented_region_max_width\" ศูนย์ปิดใช้งานคุณลักษณะนี้" +msgid "Interlocking depth of a segmented region. It will be ignored if \"mmu_segmented_region_max_width\" is zero or if \"mmu_segmented_region_interlocking_depth\" is bigger than \"mmu_segmented_region_max_width\". Zero disables this feature." +msgstr "ความลึกที่ประสานกันของภูมิภาคที่แบ่งส่วน ระบบจะไม่สนใจหาก \"mmu_segmented_region_max_width\" เป็นศูนย์ หรือหาก \"mmu_segmented_region_interlocking_detail\" ใหญ่กว่า \"mmu_segmented_region_max_width\" ศูนย์ปิดใช้งานคุณลักษณะนี้" msgid "Use beam interlocking" msgstr "ใช้การประสานลำแสง" -msgid "" -"Generate interlocking beam structure at the locations where different " -"filaments touch. This improves the adhesion between filaments, especially " -"models printed in different materials." -msgstr "" -"สร้างโครงสร้างลำแสงที่เชื่อมต่อกันในตำแหน่งที่เส้นพลาสติกต่างๆ สัมผัสกัน " -"ซึ่งจะช่วยปรับปรุงการยึดเกาะระหว่างเส้นพลาสติก โดยเฉพาะรุ่นที่พิมพ์ด้วยวัสดุที่แตกต่างกัน" +msgid "Generate interlocking beam structure at the locations where different filaments touch. This improves the adhesion between filaments, especially models printed in different materials." +msgstr "สร้างโครงสร้างลำแสงที่เชื่อมต่อกันในตำแหน่งที่เส้นพลาสติกต่างๆ สัมผัสกัน ซึ่งจะช่วยปรับปรุงการยึดเกาะระหว่างเส้นพลาสติก โดยเฉพาะรุ่นที่พิมพ์ด้วยวัสดุที่แตกต่างกัน" msgid "Interlocking beam width" msgstr "ความกว้างของลำแสงที่เชื่อมต่อกัน" @@ -15960,40 +13595,26 @@ msgstr "การวางแนวของคานลูกโซ่" msgid "Interlocking beam layers" msgstr "ชั้นลำแสงที่เชื่อมต่อกัน" -msgid "" -"The height of the beams of the interlocking structure, measured in number of " -"layers. Less layers is stronger, but more prone to defects." -msgstr "" -"ความสูงของคานของโครงสร้างที่เชื่อมต่อกัน วัดเป็นจำนวนชั้น ชั้นที่น้อยลงจะแข็งแกร่งขึ้น " -"แต่มีแนวโน้มที่จะเกิดข้อบกพร่องมากขึ้น" +msgid "The height of the beams of the interlocking structure, measured in number of layers. Less layers is stronger, but more prone to defects." +msgstr "ความสูงของคานของโครงสร้างที่เชื่อมต่อกัน วัดเป็นจำนวนชั้น ชั้นที่น้อยลงจะแข็งแกร่งขึ้น แต่มีแนวโน้มที่จะเกิดข้อบกพร่องมากขึ้น" msgid "Interlocking depth" msgstr "ความลึกที่ประสานกัน" -msgid "" -"The distance from the boundary between filaments to generate interlocking " -"structure, measured in cells. Too few cells will result in poor adhesion." -msgstr "" -"ระยะห่างจากขอบเขตระหว่างเส้นพลาสติกเพื่อสร้างโครงสร้างที่เชื่อมต่อกัน วัดในเซลล์ " -"จำนวนเซลล์ที่มากเกินไปจะทำให้การยึดเกาะไม่ดี" +msgid "The distance from the boundary between filaments to generate interlocking structure, measured in cells. Too few cells will result in poor adhesion." +msgstr "ระยะห่างจากขอบเขตระหว่างเส้นพลาสติกเพื่อสร้างโครงสร้างที่เชื่อมต่อกัน วัดในเซลล์ จำนวนเซลล์ที่มากเกินไปจะทำให้การยึดเกาะไม่ดี" msgid "Interlocking boundary avoidance" msgstr "การหลีกเลี่ยงขอบเขตที่ประสานกัน" -msgid "" -"The distance from the outside of a model where interlocking structures will " -"not be generated, measured in cells." +msgid "The distance from the outside of a model where interlocking structures will not be generated, measured in cells." msgstr "ระยะห่างจากด้านนอกของแบบจำลองซึ่งจะไม่สร้างโครงสร้างที่เชื่อมต่อกัน โดยวัดเป็นเซลล์" msgid "Ironing type" msgstr "ชนิดการรีดผิว" -msgid "" -"Ironing uses a small flow to print at the same height of a surface to make " -"flat surfaces smoother. This setting controls which layers are being ironed." -msgstr "" -"การรีดผิวคือการใช้การไหลเล็กน้อยเพื่อพิมพ์บนพื้นผิวที่มีความสูงเท่ากันอีกครั้งเพื่อให้พื้นผิวเรียบเรียบยิ่งขึ้น " -"การตั้งค่านี้ควบคุมว่าชั้นใดที่จะรีด" +msgid "Ironing uses a small flow to print at the same height of a surface to make flat surfaces smoother. This setting controls which layers are being ironed." +msgstr "การรีดผิวคือการใช้การไหลเล็กน้อยเพื่อพิมพ์บนพื้นผิวที่มีความสูงเท่ากันอีกครั้งเพื่อให้พื้นผิวเรียบเรียบยิ่งขึ้น การตั้งค่านี้ควบคุมว่าชั้นใดที่จะรีด" msgid "No ironing" msgstr "ไม่รีดผิว" @@ -16013,20 +13634,13 @@ msgstr "รูปแบบการรีดผิว" msgid "The pattern that will be used when ironing." msgstr "รูปแบบที่จะใช้ในการรีด" -msgid "" -"This is the amount of material to be extruded during ironing. It is relative " -"to the flow of normal layer height. Too high a value will result in " -"overextrusion on the surface." -msgstr "" -"ปริมาณวัสดุที่จะพ่นออกมาระหว่างรีดผิว สัมพันธ์กับการไหลของความสูงของชั้นปกติ " -"ค่าที่สูงเกินไปส่งผลให้เกิดการอัดขึ้นรูปมากเกินไปบนพื้นผิว" +msgid "This is the amount of material to be extruded during ironing. It is relative to the flow of normal layer height. Too high a value will result in overextrusion on the surface." +msgstr "ปริมาณวัสดุที่จะพ่นออกมาระหว่างรีดผิว สัมพันธ์กับการไหลของความสูงของชั้นปกติ ค่าที่สูงเกินไปส่งผลให้เกิดการอัดขึ้นรูปมากเกินไปบนพื้นผิว" msgid "This is the distance between the lines used for ironing." msgstr "ระยะห่างระหว่างเส้นรีดผิว" -msgid "" -"The distance to keep from the edges. A value of 0 sets this to half of the " -"nozzle diameter." +msgid "The distance to keep from the edges. A value of 0 sets this to half of the nozzle diameter." msgstr "ระยะห่างที่ต้องเก็บจากขอบ ค่า 0 ตั้งค่านี้เป็นครึ่งหนึ่งของเส้นผ่านศูนย์กลางหัวฉีด" msgid "This is the print speed for ironing lines." @@ -16093,9 +13707,7 @@ msgstr "G-code การตรวจจับการจับตัวเป msgid "Silent Mode" msgstr "โหมดเงียบ" -msgid "" -"Whether the machine supports silent mode in which machine uses lower " -"acceleration to print more quietly" +msgid "Whether the machine supports silent mode in which machine uses lower acceleration to print more quietly" msgstr "เครื่องรองรับโหมดเงียบซึ่งเครื่องใช้ความเร่งในการพิมพ์ต่ำกว่าหรือไม่" msgid "Emit limits to G-code" @@ -16111,12 +13723,8 @@ msgstr "" "หากเปิดใช้งาน ขีดจำกัดของเครื่องจะถูกส่งไปยังไฟล์ G-code\n" "ตัวเลือกนี้จะถูกละเว้นหากตั้งค่ารสชาติ G-code เป็น Klipper" -msgid "" -"This G-code will be used as a code for the pause print. Users can insert " -"pause G-code in the G-code viewer." -msgstr "" -"G-code นี้จะใช้เป็นรหัสสำหรับการหยุดการพิมพ์ชั่วคราว ผู้ใช้สามารถแทรก G-code " -"หยุดชั่วคราวในโปรแกรมดู G-code" +msgid "This G-code will be used as a code for the pause print. Users can insert pause G-code in the G-code viewer." +msgstr "G-code นี้จะใช้เป็นรหัสสำหรับการหยุดการพิมพ์ชั่วคราว ผู้ใช้สามารถแทรก G-code หยุดชั่วคราวในโปรแกรมดู G-code" msgid "This G-code will be used as a custom code." msgstr "รหัส G นี้จะใช้เป็นรหัสที่กำหนดเอง" @@ -16130,15 +13738,8 @@ msgstr "เปิดใช้งานการชดเชยการไหล msgid "Flow Compensation Model" msgstr "แบบจำลองการชดเชยการไหล" -msgid "" -"Flow Compensation Model, used to adjust the flow for small infill areas. The " -"model is expressed as a comma separated pair of values for extrusion length " -"and flow correction factor. Each pair is on a separate line, followed by a " -"semicolon, in the following format: \"1.234, 5.678;\"" -msgstr "" -"Flow Compensation Model ใช้เพื่อปรับการไหลสำหรับพื้นที่ไส้ในขนาดเล็ก " -"แบบจำลองนี้จะแสดงเป็นคู่ของค่าที่คั่นด้วยเครื่องหมายจุลภาคสำหรับความยาวการอัดขึ้นรูปและปัจจัยการแก้ไขการไหล " -"แต่ละคู่อยู่บนบรรทัดแยกกัน ตามด้วยอัฒภาค ในรูปแบบต่อไปนี้: \"1.234, 5.678;\"" +msgid "Flow Compensation Model, used to adjust the flow for small infill areas. The model is expressed as a comma separated pair of values for extrusion length and flow correction factor. Each pair is on a separate line, followed by a semicolon, in the following format: \"1.234, 5.678;\"" +msgstr "Flow Compensation Model ใช้เพื่อปรับการไหลสำหรับพื้นที่ไส้ในขนาดเล็ก แบบจำลองนี้จะแสดงเป็นคู่ของค่าที่คั่นด้วยเครื่องหมายจุลภาคสำหรับความยาวการอัดขึ้นรูปและปัจจัยการแก้ไขการไหล แต่ละคู่อยู่บนบรรทัดแยกกัน ตามด้วยอัฒภาค ในรูปแบบต่อไปนี้: \"1.234, 5.678;\"" msgid "Maximum speed X" msgstr "ความเร็วสูงสุด X" @@ -16216,8 +13817,7 @@ msgid "Maximum Junction Deviation" msgstr "ส่วนเบี่ยงเบนทางแยกสูงสุด" msgid "" -"Maximum junction deviation (M205 J, only apply if JD > 0 for Marlin " -"Firmware\n" +"Maximum junction deviation (M205 J, only apply if JD > 0 for Marlin Firmware\n" "If your Marlin 2 printer uses Classic Jerk set this value to 0.)" msgstr "" "ค่าเบี่ยงเบนจุดเชื่อมต่อสูงสุด (M205 J ใช้เฉพาะเมื่อ JD > 0 สำหรับเฟิร์มแวร์ Marlin\n" @@ -16257,12 +13857,10 @@ msgid "Resonance avoidance" msgstr "การหลีกเลี่ยงการสั่นพ้อง" msgid "" -"By reducing the speed of the outer wall to avoid the resonance zone of the " -"printer, ringing on the surface of the model are avoided.\n" +"By reducing the speed of the outer wall to avoid the resonance zone of the printer, ringing on the surface of the model are avoided.\n" "Please turn this option off when testing ringing." msgstr "" -"โดยการลดความเร็วของผนังด้านนอกเพื่อหลีกเลี่ยงโซนสั่นพ้องของเครื่องพิมพ์ " -"หลีกเลี่ยงรอยคลื่นบนพื้นผิวของโมเดล\n" +"โดยการลดความเร็วของผนังด้านนอกเพื่อหลีกเลี่ยงโซนสั่นพ้องของเครื่องพิมพ์ หลีกเลี่ยงรอยคลื่นบนพื้นผิวของโมเดล\n" "โปรดปิดตัวเลือกนี้เมื่อทดสอบการสั่นพ้อง" msgid "Min" @@ -16378,72 +13976,39 @@ msgstr "" "ศูนย์จะใช้อัตราส่วนการทำให้หมาด ๆ ของเฟิร์มแวร์\n" "หากต้องการปิดใช้งานการสร้างอินพุต ให้ใช้ประเภทปิดใช้งาน" -msgid "" -"The part cooling fan speed may be increased when auto cooling is enabled. " -"This is the maximum speed for the part cooling fan." -msgstr "" -"ความเร็วพัดลมระบายความร้อนบางส่วนอาจเพิ่มขึ้นเมื่อเปิดใช้งานการระบายความร้อนอัตโนมัติ " -"นี่คือความเร็วสูงสุดสำหรับพัดลมระบายความร้อนของชิ้นส่วน" +msgid "The part cooling fan speed may be increased when auto cooling is enabled. This is the maximum speed for the part cooling fan." +msgstr "ความเร็วพัดลมระบายความร้อนบางส่วนอาจเพิ่มขึ้นเมื่อเปิดใช้งานการระบายความร้อนอัตโนมัติ นี่คือความเร็วสูงสุดสำหรับพัดลมระบายความร้อนของชิ้นส่วน" -msgid "" -"The highest printable layer height for the extruder. Used to limit the " -"maximum layer height when enable adaptive layer height." -msgstr "" -"ความสูงของชั้นสูงสุดที่สามารถพิมพ์ได้สำหรับชุดดันเส้น " -"ใช้เพื่อจำกัดความสูงของเลเยอร์สูงสุดเมื่อเปิดใช้งานความสูงของเลเยอร์แบบปรับได้" +msgid "The highest printable layer height for the extruder. Used to limit the maximum layer height when enable adaptive layer height." +msgstr "ความสูงของชั้นสูงสุดที่สามารถพิมพ์ได้สำหรับชุดดันเส้น ใช้เพื่อจำกัดความสูงของเลเยอร์สูงสุดเมื่อเปิดใช้งานความสูงของเลเยอร์แบบปรับได้" msgid "Extrusion rate smoothing" msgstr "อัตราการอัดรีดให้เรียบ" msgid "" -"This parameter smooths out sudden extrusion rate changes that happen when " -"the printer transitions from printing a high flow (high speed/larger width) " -"extrusion to a lower flow (lower speed/smaller width) extrusion and vice " -"versa.\n" +"This parameter smooths out sudden extrusion rate changes that happen when the printer transitions from printing a high flow (high speed/larger width) extrusion to a lower flow (lower speed/smaller width) extrusion and vice versa.\n" "\n" -"It defines the maximum rate by which the extruded volumetric flow in mm³/s " -"can change over time. Higher values mean higher extrusion rate changes are " -"allowed, resulting in faster speed transitions.\n" +"It defines the maximum rate by which the extruded volumetric flow in mm³/s can change over time. Higher values mean higher extrusion rate changes are allowed, resulting in faster speed transitions.\n" "\n" "A value of 0 disables the feature.\n" "\n" -"For a high speed, high flow direct drive printer (like the Bambu lab or " -"Voron) this value is usually not needed. However it can provide some " -"marginal benefit in certain cases where feature speeds vary greatly. For " -"example, when there are aggressive slowdowns due to overhangs. In these " -"cases a high value of around 300-350 mm³/s² is recommended as this allows " -"for just enough smoothing to assist pressure advance achieve a smoother flow " -"transition.\n" +"For a high speed, high flow direct drive printer (like the Bambu lab or Voron) this value is usually not needed. However it can provide some marginal benefit in certain cases where feature speeds vary greatly. For example, when there are aggressive slowdowns due to overhangs. In these cases a high value of around 300-350 mm³/s² is recommended as this allows for just enough smoothing to assist pressure advance achieve a smoother flow transition.\n" "\n" -"For slower printers without pressure advance, the value should be set much " -"lower. A value of 10-15 mm³/s² is a good starting point for direct drive " -"extruders and 5-10 mm³/s² for Bowden style.\n" +"For slower printers without pressure advance, the value should be set much lower. A value of 10-15 mm³/s² is a good starting point for direct drive extruders and 5-10 mm³/s² for Bowden style.\n" "\n" "This feature is known as Pressure Equalizer in Prusa slicer.\n" "\n" "Note: this parameter disables arc fitting." msgstr "" -"พารามิเตอร์นี้จะทำให้การเปลี่ยนแปลงอัตราการอัดขึ้นรูปกะทันหันที่เกิดขึ้นเมื่อเครื่องพิมพ์เปลี่ยนจากการพิมพ์ที่มีอัตราการไหลสูง " -"(ความเร็วสูง/ความกว้างมากขึ้น) ไปเป็นการไหลที่ต่ำกว่า (ความเร็วต่ำ/ความกว้างน้อยลง) " -"และในทางกลับกัน\n" +"พารามิเตอร์นี้จะทำให้การเปลี่ยนแปลงอัตราการอัดขึ้นรูปกะทันหันที่เกิดขึ้นเมื่อเครื่องพิมพ์เปลี่ยนจากการพิมพ์ที่มีอัตราการไหลสูง (ความเร็วสูง/ความกว้างมากขึ้น) ไปเป็นการไหลที่ต่ำกว่า (ความเร็วต่ำ/ความกว้างน้อยลง) และในทางกลับกัน\n" "\n" -"โดยจะกำหนดอัตราสูงสุดที่การไหลเชิงปริมาตรที่อัดออกมาในหน่วย mm³/s " -"สามารถเปลี่ยนแปลงได้ตลอดเวลา " -"ค่าที่สูงกว่าหมายถึงอนุญาตให้มีการเปลี่ยนแปลงอัตราการอัดขึ้นรูปที่สูงขึ้น " -"ส่งผลให้การเปลี่ยนความเร็วเร็วขึ้น\n" +"โดยจะกำหนดอัตราสูงสุดที่การไหลเชิงปริมาตรที่อัดออกมาในหน่วย mm³/s สามารถเปลี่ยนแปลงได้ตลอดเวลา ค่าที่สูงกว่าหมายถึงอนุญาตให้มีการเปลี่ยนแปลงอัตราการอัดขึ้นรูปที่สูงขึ้น ส่งผลให้การเปลี่ยนความเร็วเร็วขึ้น\n" "\n" "ค่า 0 จะปิดใช้งานคุณลักษณะนี้\n" "\n" -"สำหรับเครื่องพิมพ์แบบขับเคลื่อนโดยตรงความเร็วสูงที่มีอัตราการไหลสูง (เช่น ห้องปฏิบัติการ Bambu " -"หรือ Voron) โดยปกติไม่จำเป็นต้องใช้ค่านี้ อย่างไรก็ตาม " -"มันสามารถให้ประโยชน์เล็กน้อยในบางกรณีที่ความเร็วของคุณสมบัติแตกต่างกันมาก ตัวอย่างเช่น " -"เมื่อมีการชะลอตัวอย่างรุนแรงเนื่องจากการโอเวอร์แฮงค์ ในกรณีเหล่านี้ แนะนำให้ใช้ค่าที่สูงประมาณ " -"300-350 mm³/s² เนื่องจากจะทำให้มีการปรับให้เรียบเพียงพอเพื่อช่วยให้Pressure " -"Advanceบรรลุการเปลี่ยนแปลงการไหลที่ราบรื่นยิ่งขึ้น\n" +"สำหรับเครื่องพิมพ์แบบขับเคลื่อนโดยตรงความเร็วสูงที่มีอัตราการไหลสูง (เช่น ห้องปฏิบัติการ Bambu หรือ Voron) โดยปกติไม่จำเป็นต้องใช้ค่านี้ อย่างไรก็ตาม มันสามารถให้ประโยชน์เล็กน้อยในบางกรณีที่ความเร็วของคุณสมบัติแตกต่างกันมาก ตัวอย่างเช่น เมื่อมีการชะลอตัวอย่างรุนแรงเนื่องจากการโอเวอร์แฮงค์ ในกรณีเหล่านี้ แนะนำให้ใช้ค่าที่สูงประมาณ 300-350 mm³/s² เนื่องจากจะทำให้มีการปรับให้เรียบเพียงพอเพื่อช่วยให้Pressure Advanceบรรลุการเปลี่ยนแปลงการไหลที่ราบรื่นยิ่งขึ้น\n" "\n" -"สำหรับเครื่องพิมพ์ที่ช้ากว่าซึ่งไม่มีการดันล่วงหน้า ควรตั้งค่าให้ต่ำลงมาก ค่า 10-15 มม./วินาที² " -"เป็นจุดเริ่มต้นที่ดีสำหรับชุดดันเส้นแบบขับเคลื่อนโดยตรง และ 5-10 มม./วินาที² สำหรับรูปแบบ " -"Bowden\n" +"สำหรับเครื่องพิมพ์ที่ช้ากว่าซึ่งไม่มีการดันล่วงหน้า ควรตั้งค่าให้ต่ำลงมาก ค่า 10-15 มม./วินาที² เป็นจุดเริ่มต้นที่ดีสำหรับชุดดันเส้นแบบขับเคลื่อนโดยตรง และ 5-10 มม./วินาที² สำหรับรูปแบบ Bowden\n" "\n" "คุณลักษณะนี้เรียกว่า Pressure Equalizer ในตัวแบ่งส่วนข้อมูล Prusa\n" "\n" @@ -16456,50 +14021,33 @@ msgid "Smoothing segment length" msgstr "ความยาวส่วนที่เรียบ" msgid "" -"A lower value results in smoother extrusion rate transitions. However, this " -"results in a significantly larger G-code file and more instructions for the " -"printer to process.\n" +"A lower value results in smoother extrusion rate transitions. However, this results in a significantly larger G-code file and more instructions for the printer to process.\n" "\n" -"Default value of 3 works well for most cases. If your printer is stuttering, " -"increase this value to reduce the number of adjustments made.\n" +"Default value of 3 works well for most cases. If your printer is stuttering, increase this value to reduce the number of adjustments made.\n" "\n" "Allowed values: 0.5-5" msgstr "" -"ค่าที่ต่ำกว่าส่งผลให้อัตราการอัดรีดเปลี่ยนผ่านได้เรียบขึ้น อย่างไรก็ตาม ไฟล์ G-code " -"จะมีขนาดใหญ่ขึ้นอย่างเห็นได้ชัดและมีคำสั่งให้เครื่องพิมพ์ประมวลผลมากขึ้น\n" +"ค่าที่ต่ำกว่าส่งผลให้อัตราการอัดรีดเปลี่ยนผ่านได้เรียบขึ้น อย่างไรก็ตาม ไฟล์ G-code จะมีขนาดใหญ่ขึ้นอย่างเห็นได้ชัดและมีคำสั่งให้เครื่องพิมพ์ประมวลผลมากขึ้น\n" "\n" -"ค่าเริ่มต้นของ 3 ทำงานได้ดีในกรณีส่วนใหญ่ หากเครื่องพิมพ์ของคุณกระตุก " -"ให้เพิ่มค่านี้เพื่อลดจำนวนการปรับเปลี่ยน\n" +"ค่าเริ่มต้นของ 3 ทำงานได้ดีในกรณีส่วนใหญ่ หากเครื่องพิมพ์ของคุณกระตุก ให้เพิ่มค่านี้เพื่อลดจำนวนการปรับเปลี่ยน\n" "\n" "ค่าที่อนุญาต: 0.5-5" msgid "Apply only on external features" msgstr "ใช้กับคุณสมบัติภายนอกเท่านั้น" -msgid "" -"Applies extrusion rate smoothing only on external perimeters and overhangs. " -"This can help reduce artefacts due to sharp speed transitions on externally " -"visible overhangs without impacting the print speed of features that will " -"not be visible to the user." -msgstr "" -"ใช้การปรับให้เรียบด้วยอัตราการอัดขึ้นรูปเฉพาะกับขอบด้านนอกและส่วนยื่นเท่านั้น " -"วิธีนี้สามารถช่วยลดสิ่งแปลกปลอมเนื่องจากการเปลี่ยนความเร็วที่คมชัดบนส่วนยื่นซึ่งมองเห็นได้จากภายนอก " -"โดยไม่ส่งผลกระทบต่อความเร็วในการพิมพ์ของคุณลักษณะที่ผู้ใช้จะมองไม่เห็น" +msgid "Applies extrusion rate smoothing only on external perimeters and overhangs. This can help reduce artefacts due to sharp speed transitions on externally visible overhangs without impacting the print speed of features that will not be visible to the user." +msgstr "ใช้การปรับให้เรียบด้วยอัตราการอัดขึ้นรูปเฉพาะกับขอบด้านนอกและส่วนยื่นเท่านั้น วิธีนี้สามารถช่วยลดสิ่งแปลกปลอมเนื่องจากการเปลี่ยนความเร็วที่คมชัดบนส่วนยื่นซึ่งมองเห็นได้จากภายนอก โดยไม่ส่งผลกระทบต่อความเร็วในการพิมพ์ของคุณลักษณะที่ผู้ใช้จะมองไม่เห็น" msgid "Minimum speed for part cooling fan." msgstr "ความเร็วขั้นต่ำสำหรับพัดลมระบายความร้อนชิ้นส่วน" msgid "" -"Speed of auxiliary part cooling fan. Auxiliary fan will run at this speed " -"during printing except the first several layers which is defined by no " -"cooling layers.\n" -"Please enable auxiliary_fan in printer settings to use this feature. G-code " -"command: M106 P2 S(0-255)" +"Speed of auxiliary part cooling fan. Auxiliary fan will run at this speed during printing except the first several layers which is defined by no cooling layers.\n" +"Please enable auxiliary_fan in printer settings to use this feature. G-code command: M106 P2 S(0-255)" msgstr "" -"ความเร็วของพัดลมระบายความร้อนชิ้นส่วนเสริม พัดลมเสริมจะทำงานที่ความเร็วนี้ในระหว่างการพิมพ์ " -"ยกเว้นหลายชั้นแรกซึ่งถูกกำหนดโดยไม่มีชั้นระบายความร้อน\n" -"โปรดเปิดใช้งาน auxiliary_fan ในการตั้งค่าเครื่องพิมพ์เพื่อใช้คุณสมบัตินี้ คำสั่งรหัส G: M106 P2 " -"S(0-255)" +"ความเร็วของพัดลมระบายความร้อนชิ้นส่วนเสริม พัดลมเสริมจะทำงานที่ความเร็วนี้ในระหว่างการพิมพ์ ยกเว้นหลายชั้นแรกซึ่งถูกกำหนดโดยไม่มีชั้นระบายความร้อน\n" +"โปรดเปิดใช้งาน auxiliary_fan ในการตั้งค่าเครื่องพิมพ์เพื่อใช้คุณสมบัตินี้ คำสั่งรหัส G: M106 P2 S(0-255)" msgid "For the first" msgstr "สำหรับครั้งแรก" @@ -16508,38 +14056,23 @@ msgid "Set special auxiliary cooling fan for the first certain layers." msgstr "ตั้งพัดลมระบายความร้อนเสริมพิเศษสำหรับบางชั้นแรก" msgid "" -"Auxiliary fan speed will be ramped up linearly from layer \"For the first\" " -"to maximum at layer \"Full fan speed at layer\".\n" -"\"Full fan speed at layer\" will be ignored if lower than \"For the first\", " -"in which case the fan will run at maximum allowed speed at layer \"For the " -"first\" + 1." +"Auxiliary fan speed will be ramped up linearly from layer \"For the first\" to maximum at layer \"Full fan speed at layer\".\n" +"\"Full fan speed at layer\" will be ignored if lower than \"For the first\", in which case the fan will run at maximum allowed speed at layer \"For the first\" + 1." msgstr "" -"ความเร็วพัดลมเสริมจะเพิ่มขึ้นเชิงเส้นจากเลเยอร์ \"สำหรับอันแรก\" ไปจนถึงสูงสุดที่เลเยอร์ " -"\"ความเร็วพัดลมเต็มในเลเยอร์\"\n" -"\"ความเร็วพัดลมเต็มที่เลเยอร์\" จะถูกละเว้นหากต่ำกว่า \"สำหรับครั้งแรก\" ซึ่งในกรณีนี้ " -"พัดลมจะทำงานที่ความเร็วสูงสุดที่อนุญาตที่เลเยอร์ \"สำหรับครั้งแรก\" + 1" +"ความเร็วพัดลมเสริมจะเพิ่มขึ้นเชิงเส้นจากเลเยอร์ \"สำหรับอันแรก\" ไปจนถึงสูงสุดที่เลเยอร์ \"ความเร็วพัดลมเต็มในเลเยอร์\"\n" +"\"ความเร็วพัดลมเต็มที่เลเยอร์\" จะถูกละเว้นหากต่ำกว่า \"สำหรับครั้งแรก\" ซึ่งในกรณีนี้ พัดลมจะทำงานที่ความเร็วสูงสุดที่อนุญาตที่เลเยอร์ \"สำหรับครั้งแรก\" + 1" -msgid "" -"Special auxiliary cooling fan speed, effective only for the first x layers." +msgid "Special auxiliary cooling fan speed, effective only for the first x layers." msgstr "ความเร็วพัดลมระบายความร้อนเสริมพิเศษ มีผลเฉพาะ x เลเยอร์แรกเท่านั้น" -msgid "" -"The lowest printable layer height for the extruder. Used to limit the " -"minimum layer height when enable adaptive layer height." -msgstr "" -"ความสูงของชั้นต่ำสุดที่สามารถพิมพ์ได้สำหรับชุดดันเส้น " -"ใช้เพื่อจำกัดความสูงของเลเยอร์ขั้นต่ำเมื่อเปิดใช้งานความสูงของเลเยอร์แบบปรับได้" +msgid "The lowest printable layer height for the extruder. Used to limit the minimum layer height when enable adaptive layer height." +msgstr "ความสูงของชั้นต่ำสุดที่สามารถพิมพ์ได้สำหรับชุดดันเส้น ใช้เพื่อจำกัดความสูงของเลเยอร์ขั้นต่ำเมื่อเปิดใช้งานความสูงของเลเยอร์แบบปรับได้" msgid "Min print speed" msgstr "ความเร็วในการพิมพ์ขั้นต่ำ" -msgid "" -"The minimum print speed to which the printer slows down to maintain the " -"minimum layer time defined above when the slowdown for better layer cooling " -"is enabled." -msgstr "" -"ความเร็วการพิมพ์ขั้นต่ำที่เครื่องพิมพ์ช้าลง เพื่อรักษาเวลาเลเยอร์ขั้นต่ำที่กำหนดไว้ข้างต้น " -"เมื่อเปิดใช้งานการชะลอตัวเพื่อการระบายความร้อนของเลเยอร์ที่ดีขึ้น" +msgid "The minimum print speed to which the printer slows down to maintain the minimum layer time defined above when the slowdown for better layer cooling is enabled." +msgstr "ความเร็วการพิมพ์ขั้นต่ำที่เครื่องพิมพ์ช้าลง เพื่อรักษาเวลาเลเยอร์ขั้นต่ำที่กำหนดไว้ข้างต้น เมื่อเปิดใช้งานการชะลอตัวเพื่อการระบายความร้อนของเลเยอร์ที่ดีขึ้น" msgid "The diameter of nozzle." msgstr "เส้นผ่านศูนย์กลางของหัวฉีด" @@ -16547,20 +14080,14 @@ msgstr "เส้นผ่านศูนย์กลางของหัวฉ msgid "Configuration notes" msgstr "บันทึกการกำหนดค่า" -msgid "" -"You can put here your personal notes. This text will be added to the G-code " -"header comments." -msgstr "" -"คุณสามารถใส่บันทึกส่วนตัวของคุณได้ที่นี่ ข้อความนี้จะถูกเพิ่มลงในความคิดเห็นส่วนหัวของ G-code" +msgid "You can put here your personal notes. This text will be added to the G-code header comments." +msgstr "คุณสามารถใส่บันทึกส่วนตัวของคุณได้ที่นี่ ข้อความนี้จะถูกเพิ่มลงในความคิดเห็นส่วนหัวของ G-code" msgid "Host Type" msgstr "ประเภทโฮสต์" -msgid "" -"Orca Slicer can upload G-code files to a printer host. This field must " -"contain the kind of the host." -msgstr "" -"Orca Slicer สามารถอัปโหลดไฟล์ G-code ไปยังโฮสต์เครื่องพิมพ์ได้ ฟิลด์นี้จะต้องมีประเภทของโฮสต์" +msgid "Orca Slicer can upload G-code files to a printer host. This field must contain the kind of the host." +msgstr "Orca Slicer สามารถอัปโหลดไฟล์ G-code ไปยังโฮสต์เครื่องพิมพ์ได้ ฟิลด์นี้จะต้องมีประเภทของโฮสต์" msgid "Nozzle volume" msgstr "ปริมาณหัวฉีด" @@ -16583,63 +14110,34 @@ msgstr "ความยาวของท่อระบายความร้ msgid "High extruder current on filament swap" msgstr "กระแสไฟของชุดดันเส้นสูงในการเปลี่ยนเส้นพลาสติก" -msgid "" -"It may be beneficial to increase the extruder motor current during the " -"filament exchange sequence to allow for rapid ramming feed rates and to " -"overcome resistance when loading a filament with an ugly shaped tip." -msgstr "" -"อาจเป็นประโยชน์ในการเพิ่มกระแสมอเตอร์ของชุดดันเส้นในระหว่างลำดับการแลกเปลี่ยนเส้นพลาสติกเพื่อให้อัตราการป้อนชนอย่างรวดเร็ว " -"และเอาชนะความต้านทานเมื่อโหลดเส้นพลาสติกด้วยปลายที่มีรูปร่างน่าเกลียด" +msgid "It may be beneficial to increase the extruder motor current during the filament exchange sequence to allow for rapid ramming feed rates and to overcome resistance when loading a filament with an ugly shaped tip." +msgstr "อาจเป็นประโยชน์ในการเพิ่มกระแสมอเตอร์ของชุดดันเส้นในระหว่างลำดับการแลกเปลี่ยนเส้นพลาสติกเพื่อให้อัตราการป้อนชนอย่างรวดเร็ว และเอาชนะความต้านทานเมื่อโหลดเส้นพลาสติกด้วยปลายที่มีรูปร่างน่าเกลียด" msgid "Filament parking position" msgstr "ตำแหน่งจอดฟิลาเมนต์" -msgid "" -"Distance of the extruder tip from the position where the filament is parked " -"when unloaded. This should match the value in printer firmware." -msgstr "" -"ระยะห่างของปลายชุดดันเส้นจากตำแหน่งที่เส้นพลาสติกจอดอยู่เมื่อขนถ่ายออก " -"ซึ่งควรตรงกับค่าในเฟิร์มแวร์เครื่องพิมพ์" +msgid "Distance of the extruder tip from the position where the filament is parked when unloaded. This should match the value in printer firmware." +msgstr "ระยะห่างของปลายชุดดันเส้นจากตำแหน่งที่เส้นพลาสติกจอดอยู่เมื่อขนถ่ายออก ซึ่งควรตรงกับค่าในเฟิร์มแวร์เครื่องพิมพ์" msgid "Extra loading distance" msgstr "ระยะโหลดเพิ่มเติม" -msgid "" -"When set to zero, the distance the filament is moved from parking position " -"during load is exactly the same as it was moved back during unload. When " -"positive, it is loaded further, if negative, the loading move is shorter " -"than unloading." -msgstr "" -"เมื่อตั้งค่าเป็นศูนย์ " -"ระยะที่เส้นพลาสติกเคลื่อนจากตำแหน่งพักระหว่างโหลดจะเท่ากับระยะที่เคลื่อนกลับระหว่างถอดโหลดพอดี " -"หากเป็นค่าบวก เส้นพลาสติกจะถูกโหลดเข้าไปไกลขึ้น หากเป็นค่าลบ " -"การเคลื่อนที่ขณะโหลดจะสั้นกว่าตอนถอดโหลด" +msgid "When set to zero, the distance the filament is moved from parking position during load is exactly the same as it was moved back during unload. When positive, it is loaded further, if negative, the loading move is shorter than unloading." +msgstr "เมื่อตั้งค่าเป็นศูนย์ ระยะที่เส้นพลาสติกเคลื่อนจากตำแหน่งพักระหว่างโหลดจะเท่ากับระยะที่เคลื่อนกลับระหว่างถอดโหลดพอดี หากเป็นค่าบวก เส้นพลาสติกจะถูกโหลดเข้าไปไกลขึ้น หากเป็นค่าลบ การเคลื่อนที่ขณะโหลดจะสั้นกว่าตอนถอดโหลด" msgid "Start end points" msgstr "เริ่มต้นจุดสิ้นสุด" -msgid "" -"The start and end points which are from the cutter area to the excess chute." +msgid "The start and end points which are from the cutter area to the excess chute." msgstr "จุดเริ่มต้นและจุดสิ้นสุดตั้งแต่บริเวณเครื่องตัดถึงถังขยะ" msgid "Reduce infill retraction" msgstr "ลดการหดตัวของ ไส้ใน" -msgid "" -"Don't retract when the travel is entirely within an infill area. That means " -"the oozing can't been seen. This can reduce times of retraction for complex " -"model and save printing time, but make slicing and G-code generating slower. " -"Note that z-hop is also not performed in areas where retraction is skipped." -msgstr "" -"อย่าถอยกลับเมื่อการเดินทางอยู่ภายในพื้นที่ที่ไส้ในเข้าไปทั้งหมด " -"นั่นหมายความว่าไม่สามารถมองเห็นการรั่วไหลได้ " -"วิธีนี้จะช่วยลดเวลาในการดึงกลับสำหรับโมเดลที่ซับซ้อนและประหยัดเวลาในการพิมพ์ " -"แต่จะทำให้การแบ่งส่วนและการสร้าง G-code ช้าลง โปรดทราบว่า z-hop " -"จะไม่ดำเนินการในพื้นที่ที่มีการข้ามการถอนกลับ" +msgid "Don't retract when the travel is entirely within an infill area. That means the oozing can't been seen. This can reduce times of retraction for complex model and save printing time, but make slicing and G-code generating slower. Note that z-hop is also not performed in areas where retraction is skipped." +msgstr "อย่าถอยกลับเมื่อการเดินทางอยู่ภายในพื้นที่ที่ไส้ในเข้าไปทั้งหมด นั่นหมายความว่าไม่สามารถมองเห็นการรั่วไหลได้ วิธีนี้จะช่วยลดเวลาในการดึงกลับสำหรับโมเดลที่ซับซ้อนและประหยัดเวลาในการพิมพ์ แต่จะทำให้การแบ่งส่วนและการสร้าง G-code ช้าลง โปรดทราบว่า z-hop จะไม่ดำเนินการในพื้นที่ที่มีการข้ามการถอนกลับ" -msgid "" -"This option will drop the temperature of the inactive extruders to prevent " -"oozing." +msgid "This option will drop the temperature of the inactive extruders to prevent oozing." msgstr "ตัวเลือกนี้จะทำให้อุณหภูมิของชุดดันเส้นที่ไม่ใช้งานลดลงเพื่อป้องกันการไหลซึม" msgid "Filename format" @@ -16657,33 +14155,21 @@ msgstr "ปรับเปลี่ยนรูปทรงเพื่อพิ msgid "Make overhangs printable - Maximum angle" msgstr "ทำให้ส่วนยื่นสามารถพิมพ์ได้ - มุมสูงสุด" -msgid "" -"Maximum angle of overhangs to allow after making more steep overhangs " -"printable.90° will not change the model at all and allow any overhang, while " -"0 will replace all overhangs with conical material." -msgstr "" -"มุมยื่นสูงสุดของระยะยื่นที่อนุญาตหลังจากพิมพ์ระยะยื่นที่ชันมากขึ้นแล้ว 90° " -"จะไม่เปลี่ยนโมเดลเลยและยอมให้มีระยะยื่นใดๆ ในขณะที่ 0 จะแทนที่ระยะยื่นทั้งหมดด้วยวัสดุทรงกรวย" +msgid "Maximum angle of overhangs to allow after making more steep overhangs printable.90° will not change the model at all and allow any overhang, while 0 will replace all overhangs with conical material." +msgstr "มุมยื่นสูงสุดของระยะยื่นที่อนุญาตหลังจากพิมพ์ระยะยื่นที่ชันมากขึ้นแล้ว 90° จะไม่เปลี่ยนโมเดลเลยและยอมให้มีระยะยื่นใดๆ ในขณะที่ 0 จะแทนที่ระยะยื่นทั้งหมดด้วยวัสดุทรงกรวย" msgid "Make overhangs printable - Hole area" msgstr "ทำให้ส่วนยื่นสามารถพิมพ์ได้ - พื้นที่รู" -msgid "" -"Maximum area of a hole in the base of the model before it's filled by " -"conical material. A value of 0 will fill all the holes in the model base." -msgstr "" -"พื้นที่สูงสุดของรูที่ฐานของแบบจำลองก่อนที่จะไส้ในด้วยวัสดุทรงกรวย ค่า 0 จะไส้ในเต็มทุกรูในฐานโมเดล" +msgid "Maximum area of a hole in the base of the model before it's filled by conical material. A value of 0 will fill all the holes in the model base." +msgstr "พื้นที่สูงสุดของรูที่ฐานของแบบจำลองก่อนที่จะไส้ในด้วยวัสดุทรงกรวย ค่า 0 จะไส้ในเต็มทุกรูในฐานโมเดล" msgid "Detect overhang walls" msgstr "ตรวจจับผนังส่วนยื่น" #, c-format, boost-format -msgid "" -"This detects the overhang percentage relative to line width and uses a " -"different speed to print. For 100%% overhang, bridging speed is used." -msgstr "" -"ตรวจจับเปอร์เซ็นต์ระยะยื่นที่สัมพันธ์กับความกว้างของเส้น และใช้ความเร็วที่แตกต่างกันในการพิมพ์ " -"สำหรับระยะยื่น 100%% จะใช้ความเร็วบริดจ์" +msgid "This detects the overhang percentage relative to line width and uses a different speed to print. For 100%% overhang, bridging speed is used." +msgstr "ตรวจจับเปอร์เซ็นต์ระยะยื่นที่สัมพันธ์กับความกว้างของเส้น และใช้ความเร็วที่แตกต่างกันในการพิมพ์ สำหรับระยะยื่น 100%% จะใช้ความเร็วบริดจ์" msgid "Outer walls" msgstr "ผนังชั้นนอก" @@ -16705,9 +14191,7 @@ msgstr "" "เส้นพลาสติกสำหรับพิมพ์ผนังชั้นใน\n" "\"ค่าเริ่มต้น\" ใช้เส้นพลาสติกของวัตถุ/ชิ้นส่วนที่ใช้งานอยู่" -msgid "" -"Line width of inner wall. If expressed as a %, it will be computed over the " -"nozzle diameter." +msgid "Line width of inner wall. If expressed as a %, it will be computed over the nozzle diameter." msgstr "ความกว้างของเส้นของผนังด้านใน หากแสดงเป็น % จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" msgid "This is the speed for inner walls." @@ -16720,44 +14204,26 @@ msgid "Alternate extra wall" msgstr "ผนังเสริมสำรอง" msgid "" -"This setting adds an extra wall to every other layer. This way the infill " -"gets wedged vertically between the walls, resulting in stronger prints.\n" +"This setting adds an extra wall to every other layer. This way the infill gets wedged vertically between the walls, resulting in stronger prints.\n" "\n" -"When this option is enabled, the ensure vertical shell thickness option " -"needs to be disabled.\n" +"When this option is enabled, the ensure vertical shell thickness option needs to be disabled.\n" "\n" -"Using lightning infill together with this option is not recommended as there " -"is limited infill to anchor the extra perimeters to." +"Using lightning infill together with this option is not recommended as there is limited infill to anchor the extra perimeters to." msgstr "" -"การตั้งค่านี้จะเพิ่มผนังพิเศษแบบชั้นเว้นชั้น วิธีนี้จะทำให้ไส้ในถูกหนีบในแนวตั้งระหว่างผนัง " -"ส่งผลให้งานพิมพ์แข็งแรงขึ้น\n" +"การตั้งค่านี้จะเพิ่มผนังพิเศษแบบชั้นเว้นชั้น วิธีนี้จะทำให้ไส้ในถูกหนีบในแนวตั้งระหว่างผนัง ส่งผลให้งานพิมพ์แข็งแรงขึ้น\n" "\n" "เมื่อเปิดใช้งานตัวเลือกนี้ จะต้องปิดใช้งานตัวเลือกตรวจสอบความหนาของเปลือกแนวตั้ง\n" "\n" "ไม่แนะนำให้ใช้ไส้ในแบบสายฟ้าร่วมกับตัวเลือกนี้ เนื่องจากมีไส้ในจำกัดสำหรับยึดเส้นรอบวงเสริม" -msgid "" -"If you want to process the output G-code through custom scripts, just list " -"their absolute paths here. Separate multiple scripts with a semicolon. " -"Scripts will be passed the absolute path to the G-code file as the first " -"argument, and they can access the Orca Slicer config settings by reading " -"environment variables." -msgstr "" -"หากคุณต้องการประมวลผลเอาต์พุต G-code ผ่านสคริปต์ที่กำหนดเอง " -"เพียงระบุเส้นทางสัมบูรณ์ของสคริปต์ไว้ที่นี่ แยกสคริปต์หลายรายการด้วยเครื่องหมายอัฒภาค " -"สคริปต์จะถูกส่งผ่านเส้นทางสัมบูรณ์ไปยังไฟล์ G-code เป็นอาร์กิวเมนต์แรก " -"และสคริปต์เหล่านี้สามารถเข้าถึงการตั้งค่าการกำหนดค่า Orca Slicer " -"ได้โดยการอ่านตัวแปรสภาพแวดล้อม" +msgid "If you want to process the output G-code through custom scripts, just list their absolute paths here. Separate multiple scripts with a semicolon. Scripts will be passed the absolute path to the G-code file as the first argument, and they can access the Orca Slicer config settings by reading environment variables." +msgstr "หากคุณต้องการประมวลผลเอาต์พุต G-code ผ่านสคริปต์ที่กำหนดเอง เพียงระบุเส้นทางสัมบูรณ์ของสคริปต์ไว้ที่นี่ แยกสคริปต์หลายรายการด้วยเครื่องหมายอัฒภาค สคริปต์จะถูกส่งผ่านเส้นทางสัมบูรณ์ไปยังไฟล์ G-code เป็นอาร์กิวเมนต์แรก และสคริปต์เหล่านี้สามารถเข้าถึงการตั้งค่าการกำหนดค่า Orca Slicer ได้โดยการอ่านตัวแปรสภาพแวดล้อม" msgid "Change extrusion role G-code (process)" msgstr "เปลี่ยนบทบาทการอัดขึ้นรูป G-code (กระบวนการ)" -msgid "" -"This G-code is inserted when the extrusion role is changed. It runs after " -"the machine and filament extrusion role G-code." -msgstr "" -"G-code นี้จะถูกแทรกเมื่อบทบาทการอัดขึ้นรูปมีการเปลี่ยนแปลง " -"มันทำงานหลังจากบทบาทการอัดขึ้นรูปของเครื่องจักรและการอัดขึ้นรูปเส้นพลาสติก G-code" +msgid "This G-code is inserted when the extrusion role is changed. It runs after the machine and filament extrusion role G-code." +msgstr "G-code นี้จะถูกแทรกเมื่อบทบาทการอัดขึ้นรูปมีการเปลี่ยนแปลง มันทำงานหลังจากบทบาทการอัดขึ้นรูปของเครื่องจักรและการอัดขึ้นรูปเส้นพลาสติก G-code" msgid "Printer type" msgstr "ประเภทเครื่องพิมพ์" @@ -16777,12 +14243,8 @@ msgstr "ตัวแปรเครื่องพิมพ์" msgid "Raft contact Z distance" msgstr "ระยะสัมผัสฐานรองชิ้นงาน Z" -msgid "" -"Z gap between raft and object. If Support Top Z Distance is 0, this value is " -"ignored and the object is printed in direct contact with the raft (no gap)." -msgstr "" -"ช่องว่าง Z ระหว่างฐานรองชิ้นงานกับวัตถุ หากระยะ Z สูงสุดที่รองรับคือ 0 ค่านี้จะถูกละเว้น " -"และวัตถุจะถูกพิมพ์โดยสัมผัสโดยตรงกับฐานรองชิ้นงาน (ไม่มีช่องว่าง)" +msgid "Z gap between raft and object. If Support Top Z Distance is 0, this value is ignored and the object is printed in direct contact with the raft (no gap)." +msgstr "ช่องว่าง Z ระหว่างฐานรองชิ้นงานกับวัตถุ หากระยะ Z สูงสุดที่รองรับคือ 0 ค่านี้จะถูกละเว้น และวัตถุจะถูกพิมพ์โดยสัมผัสโดยตรงกับฐานรองชิ้นงาน (ไม่มีช่องว่าง)" msgid "Raft expansion" msgstr "การขยาย ฐานรองชิ้นงาน" @@ -16805,33 +14267,22 @@ msgstr "ขยายฐานรองชิ้นงานหรือชั้ msgid "Raft layers" msgstr "จำนวนชั้น ฐานรองชิ้นงาน" -msgid "" -"Object will be raised by this number of support layers. Use this function to " -"avoid warping when printing ABS." +msgid "Object will be raised by this number of support layers. Use this function to avoid warping when printing ABS." msgstr "วัตถุจะถูกยกขึ้นตามจำนวนชั้นรองรับนี้ ใช้ฟังก์ชันนี้เพื่อหลีกเลี่ยงการบิดงอเมื่อพิมพ์ ABS" -msgid "" -"The G-code path is generated after simplifying the contour of models to " -"avoid too many points and G-code lines. Smaller values mean higher " -"resolution and more time required to slice." -msgstr "" -"เส้นทาง G-code ถูกสร้างขึ้นหลังจากลดความซับซ้อนของรูปร่างของโมเดล เพื่อหลีกเลี่ยงจุดและเส้น G-" -"code ที่มากเกินไป ค่าที่น้อยลงหมายถึงความละเอียดสูงขึ้นและมีเวลามากขึ้นในการตัด" +msgid "The G-code path is generated after simplifying the contour of models to avoid too many points and G-code lines. Smaller values mean higher resolution and more time required to slice." +msgstr "เส้นทาง G-code ถูกสร้างขึ้นหลังจากลดความซับซ้อนของรูปร่างของโมเดล เพื่อหลีกเลี่ยงจุดและเส้น G-code ที่มากเกินไป ค่าที่น้อยลงหมายถึงความละเอียดสูงขึ้นและมีเวลามากขึ้นในการตัด" msgid "Travel distance threshold" msgstr "เกณฑ์ระยะทางการเดินทาง" -msgid "" -"Only trigger retraction when the travel distance is longer than this " -"threshold." +msgid "Only trigger retraction when the travel distance is longer than this threshold." msgstr "ทริกเกอร์การถอนกลับเมื่อระยะการเดินทางยาวกว่าเกณฑ์นี้เท่านั้น" msgid "Retract amount before wipe" msgstr "ถอนจำนวนก่อนเช็ด" -msgid "" -"This is the length of fast retraction before a wipe, relative to retraction " -"length." +msgid "This is the length of fast retraction before a wipe, relative to retraction length." msgstr "ความยาวของการดึงกลับอย่างรวดเร็วก่อนเช็ด สัมพันธ์กับความยาวการดึงกลับ" msgid "Retract on layer change" @@ -16843,32 +14294,19 @@ msgstr "บังคับให้ถอนกลับเมื่อเปล msgid "Retraction Length" msgstr "ระยะดึงกลับ" -msgid "" -"Some amount of material in extruder is pulled back to avoid ooze during long " -"travel. Set zero to disable retraction." -msgstr "" -"วัสดุบางส่วนในชุดดันเส้นถูกดึงกลับเพื่อหลีกเลี่ยงไม่ให้ซึ่มในระหว่างการเดินทางระยะไกล " -"ตั้งค่าเป็นศูนย์เพื่อปิดใช้งานการเพิกถอน" +msgid "Some amount of material in extruder is pulled back to avoid ooze during long travel. Set zero to disable retraction." +msgstr "วัสดุบางส่วนในชุดดันเส้นถูกดึงกลับเพื่อหลีกเลี่ยงไม่ให้ซึ่มในระหว่างการเดินทางระยะไกล ตั้งค่าเป็นศูนย์เพื่อปิดใช้งานการเพิกถอน" msgid "Long retraction when cut (beta)" msgstr "การถอยกลับยาวเมื่อตัด (เบต้า)" -msgid "" -"Experimental feature: Retracting and cutting off the filament at a longer " -"distance during changes to minimize purge. While this reduces flush " -"significantly, it may also raise the risk of nozzle clogs or other printing " -"problems." -msgstr "" -"คุณลักษณะการทดลอง: " -"การดึงกลับและตัดเส้นพลาสติกออกในระยะไกลระหว่างการเปลี่ยนแปลงเพื่อลดการไล่เส้น " -"แม้ว่าวิธีนี้จะช่วยลดไล่เส้นได้อย่างมาก แต่ก็อาจเพิ่มความเสี่ยงที่หัวฉีดอุดตันหรือปัญหาการพิมพ์อื่นๆ อีกด้วย" +msgid "Experimental feature: Retracting and cutting off the filament at a longer distance during changes to minimize purge. While this reduces flush significantly, it may also raise the risk of nozzle clogs or other printing problems." +msgstr "คุณลักษณะการทดลอง: การดึงกลับและตัดเส้นพลาสติกออกในระยะไกลระหว่างการเปลี่ยนแปลงเพื่อลดการไล่เส้น แม้ว่าวิธีนี้จะช่วยลดไล่เส้นได้อย่างมาก แต่ก็อาจเพิ่มความเสี่ยงที่หัวฉีดอุดตันหรือปัญหาการพิมพ์อื่นๆ อีกด้วย" msgid "Retraction distance when cut" msgstr "ระยะการดึงกลับเมื่อตัด" -msgid "" -"Experimental feature: Retraction length before cutting off during filament " -"change." +msgid "Experimental feature: Retraction length before cutting off during filament change." msgstr "คุณลักษณะการทดลอง: ความยาวการดึงกลับก่อนตัดออกระหว่างการเปลี่ยนเส้นพลาสติก" msgid "Long retraction when extruder change" @@ -16880,33 +14318,20 @@ msgstr "ระยะการดึงกลับเมื่อชุดดั msgid "Z-hop height" msgstr "ความสูงยกแกน Z" -msgid "" -"Whenever there is a retraction, the nozzle is lifted a little to create " -"clearance between the nozzle and the print. This prevents the nozzle from " -"hitting the print when traveling more. Using spiral lines to lift z can " -"prevent stringing." -msgstr "" -"เมื่อใดก็ตามที่การดึงกลับเสร็จสิ้น หัวฉีดจะถูกยกขึ้นเล็กน้อยเพื่อสร้างระยะห่างระหว่างหัวฉีดและงานพิมพ์ " -"ป้องกันไม่ให้หัวฉีดชนกับงานพิมพ์ขณะเคลื่อนตัว การใช้เส้นเกลียวเพื่อยก Z สามารถป้องกันการร้อยสายได้" +msgid "Whenever there is a retraction, the nozzle is lifted a little to create clearance between the nozzle and the print. This prevents the nozzle from hitting the print when traveling more. Using spiral lines to lift z can prevent stringing." +msgstr "เมื่อใดก็ตามที่การดึงกลับเสร็จสิ้น หัวฉีดจะถูกยกขึ้นเล็กน้อยเพื่อสร้างระยะห่างระหว่างหัวฉีดและงานพิมพ์ ป้องกันไม่ให้หัวฉีดชนกับงานพิมพ์ขณะเคลื่อนตัว การใช้เส้นเกลียวเพื่อยก Z สามารถป้องกันการร้อยสายได้" msgid "Z-hop lower boundary" msgstr "ขอบเขตล่างของ Z-hop" -msgid "" -"Z-hop will only come into effect when Z is above this value and is below the " -"parameter: \"Z-hop upper boundary\"." -msgstr "" -"Z-hop จะมีผลเฉพาะเมื่อ Z อยู่เหนือค่านี้และต่ำกว่าพารามิเตอร์: \"Z-hop upper boundary\"" +msgid "Z-hop will only come into effect when Z is above this value and is below the parameter: \"Z-hop upper boundary\"." +msgstr "Z-hop จะมีผลเฉพาะเมื่อ Z อยู่เหนือค่านี้และต่ำกว่าพารามิเตอร์: \"Z-hop upper boundary\"" msgid "Z-hop upper boundary" msgstr "ขอบเขตบนของ Z-hop" -msgid "" -"If this value is positive, Z-hop will only come into effect when Z is above " -"the parameter: \"Z-hop lower boundary\" and is below this value." -msgstr "" -"หากค่านี้เป็นค่าบวก Z-hop จะมีผลเฉพาะเมื่อ Z อยู่เหนือพารามิเตอร์: \"Z-hop lower boundary" -"\" และอยู่ต่ำกว่าค่านี้" +msgid "If this value is positive, Z-hop will only come into effect when Z is above the parameter: \"Z-hop lower boundary\" and is below this value." +msgstr "หากค่านี้เป็นค่าบวก Z-hop จะมีผลเฉพาะเมื่อ Z อยู่เหนือพารามิเตอร์: \"Z-hop lower boundary\" และอยู่ต่ำกว่าค่านี้" msgid "Z-hop type" msgstr "ประเภท Z-hop" @@ -16923,38 +14348,26 @@ msgstr "เกลียว" msgid "Traveling angle" msgstr "มุมการเดินทาง" -msgid "" -"Traveling angle for Slope and Spiral Z-hop type. Setting it to 90° results " -"in Normal Lift." -msgstr "" -"มุมการเคลื่อนที่สำหรับประเภท Slope และ Spiral Z-hop การตั้งค่าเป็น 90° จะทำให้ได้ Normal " -"Lift" +msgid "Traveling angle for Slope and Spiral Z-hop type. Setting it to 90° results in Normal Lift." +msgstr "มุมการเคลื่อนที่สำหรับประเภท Slope และ Spiral Z-hop การตั้งค่าเป็น 90° จะทำให้ได้ Normal Lift" msgid "Only lift Z above" msgstr "ยก Z ขึ้นด้านบนเท่านั้น" -msgid "" -"If you set this to a positive value, Z lift will only take place above the " -"specified absolute Z." +msgid "If you set this to a positive value, Z lift will only take place above the specified absolute Z." msgstr "หากคุณตั้งค่านี้เป็นค่าบวก การยก Z จะเกิดขึ้นเหนือค่า Z สัมบูรณ์ที่ระบุเท่านั้น" msgid "Only lift Z below" msgstr "ยก Z ด้านล่างเท่านั้น" -msgid "" -"If you set this to a positive value, Z lift will only take place below the " -"specified absolute Z." +msgid "If you set this to a positive value, Z lift will only take place below the specified absolute Z." msgstr "หากคุณตั้งค่านี้เป็นค่าบวก การยก Z จะเกิดขึ้นต่ำกว่าค่า Z สัมบูรณ์ที่ระบุเท่านั้น" msgid "On surfaces" msgstr "บนพื้นผิว" -msgid "" -"Enforce Z-Hop behavior. This setting is impacted by the above settings (Only " -"lift Z above/below)." -msgstr "" -"บังคับใช้พฤติกรรม Z-Hop การตั้งค่านี้ได้รับผลกระทบจากการตั้งค่าด้านบน (เฉพาะการยก Z ด้านบน/" -"ล่างเท่านั้น)" +msgid "Enforce Z-Hop behavior. This setting is impacted by the above settings (Only lift Z above/below)." +msgstr "บังคับใช้พฤติกรรม Z-Hop การตั้งค่านี้ได้รับผลกระทบจากการตั้งค่าด้านบน (เฉพาะการยก Z ด้านบน/ล่างเท่านั้น)" msgid "All Surfaces" msgstr "พื้นผิวทั้งหมด" @@ -16977,16 +14390,10 @@ msgstr "โบว์เดน" msgid "Extra length on restart" msgstr "ความยาวพิเศษเมื่อรีสตาร์ท" -msgid "" -"When the retraction is compensated after the travel move, the extruder will " -"push this additional amount of filament. This setting is rarely needed." -msgstr "" -"เมื่อชดเชยการดึงกลับหลังการเคลื่อนที่เดินทาง ชุดดันเส้นจะดันเส้นพลาสติกเพิ่มเติมในปริมาณนี้ " -"การตั้งค่านี้ไม่ค่อยจำเป็น" +msgid "When the retraction is compensated after the travel move, the extruder will push this additional amount of filament. This setting is rarely needed." +msgstr "เมื่อชดเชยการดึงกลับหลังการเคลื่อนที่เดินทาง ชุดดันเส้นจะดันเส้นพลาสติกเพิ่มเติมในปริมาณนี้ การตั้งค่านี้ไม่ค่อยจำเป็น" -msgid "" -"When the retraction is compensated after changing tool, the extruder will " -"push this additional amount of filament." +msgid "When the retraction is compensated after changing tool, the extruder will push this additional amount of filament." msgstr "เมื่อชดเชยการดึงกลับหลังเปลี่ยนเครื่องมือ ชุดดันเส้นจะดันเส้นพลาสติกเพิ่มเติมในปริมาณนี้" msgid "Retraction speed" @@ -16998,20 +14405,14 @@ msgstr "ความเร็วในการดึงเส้นพลาส msgid "Deretraction speed" msgstr "ความเร็วในการถอนกลับ" -msgid "" -"Speed for reloading filament into the nozzle. Zero means same speed of " -"retraction." +msgid "Speed for reloading filament into the nozzle. Zero means same speed of retraction." msgstr "ความเร็วในการบรรจุเส้นพลาสติกลงในหัวฉีด ศูนย์หมายถึงความเร็วการถอยกลับเท่ากัน" msgid "Use firmware retraction" msgstr "ใช้การเพิกถอนเฟิร์มแวร์" -msgid "" -"This experimental setting uses G10 and G11 commands to have the firmware " -"handle the retraction. This is only supported in recent Marlin." -msgstr "" -"การตั้งค่าทดลองนี้ใช้คำสั่ง G10 และ G11 เพื่อให้เฟิร์มแวร์จัดการกับการเพิกถอน สิ่งนี้รองรับใน " -"Marlin ล่าสุดเท่านั้น" +msgid "This experimental setting uses G10 and G11 commands to have the firmware handle the retraction. This is only supported in recent Marlin." +msgstr "การตั้งค่าทดลองนี้ใช้คำสั่ง G10 และ G11 เพื่อให้เฟิร์มแวร์จัดการกับการเพิกถอน สิ่งนี้รองรับใน Marlin ล่าสุดเท่านั้น" msgid "Show auto-calibration marks" msgstr "แสดงเครื่องหมายปรับเทียบอัตโนมัติ" @@ -17019,8 +14420,7 @@ msgstr "แสดงเครื่องหมายปรับเทียบ msgid "Disable set remaining print time" msgstr "ปิดใช้งานการตั้งค่าเวลาการพิมพ์ที่เหลืออยู่" -msgid "" -"Disable generating of the M73: Set remaining print time in the final G-code." +msgid "Disable generating of the M73: Set remaining print time in the final G-code." msgstr "ปิดการใช้งานการสร้าง M73: ตั้งเวลาการพิมพ์ที่เหลืออยู่ใน G-code สุดท้าย" msgid "Seam position" @@ -17044,24 +14444,18 @@ msgstr "สุ่ม" msgid "Staggered inner seams" msgstr "รอยตะเข็บด้านในเซ" -msgid "" -"This option causes the inner seams to be shifted backwards based on their " -"depth, forming a zigzag pattern." +msgid "This option causes the inner seams to be shifted backwards based on their depth, forming a zigzag pattern." msgstr "ตัวเลือกนี้จะทำให้รอยตะเข็บด้านในเลื่อนไปข้างหลังตามความลึก ทำให้เกิดลวดลายซิกแซก" msgid "Seam gap" msgstr "ช่องว่างรอยตะเข็บ" msgid "" -"In order to reduce the visibility of the seam in a closed loop extrusion, " -"the loop is interrupted and shortened by a specified amount.\n" -"This amount can be specified in millimeters or as a percentage of the " -"current extruder diameter. The default value for this parameter is 10%." +"In order to reduce the visibility of the seam in a closed loop extrusion, the loop is interrupted and shortened by a specified amount.\n" +"This amount can be specified in millimeters or as a percentage of the current extruder diameter. The default value for this parameter is 10%." msgstr "" -"เพื่อลดการมองเห็นรอยตะเข็บในการอัดขึ้นรูปแบบวงปิด " -"วงจะถูกขัดจังหวะและทำให้สั้นลงตามจำนวนที่ระบุ\n" -"ปริมาณนี้สามารถระบุได้ในหน่วยมิลลิเมตรหรือเป็นเปอร์เซ็นต์ของเส้นผ่านศูนย์กลางของชุดดันเส้นในปัจจุบัน " -"ค่าเริ่มต้นสำหรับพารามิเตอร์นี้คือ 10%" +"เพื่อลดการมองเห็นรอยตะเข็บในการอัดขึ้นรูปแบบวงปิด วงจะถูกขัดจังหวะและทำให้สั้นลงตามจำนวนที่ระบุ\n" +"ปริมาณนี้สามารถระบุได้ในหน่วยมิลลิเมตรหรือเป็นเปอร์เซ็นต์ของเส้นผ่านศูนย์กลางของชุดดันเส้นในปัจจุบัน ค่าเริ่มต้นสำหรับพารามิเตอร์นี้คือ 10%" msgid "Scarf joint seam (beta)" msgstr "รอยต่อผ้าพันคอ (เบต้า)" @@ -17072,63 +14466,31 @@ msgstr "ใช้ข้อต่อผ้าพันคอเพื่อลด msgid "Conditional scarf joint" msgstr "ข้อต่อผ้าพันคอแบบมีเงื่อนไข" -msgid "" -"Apply scarf joints only to smooth perimeters where traditional seams do not " -"conceal the seams at sharp corners effectively." -msgstr "" -"ใช้ข้อต่อผ้าพันคอกับขอบเรียบเท่านั้น " -"โดยที่รอยตะเข็บแบบเดิมไม่สามารถปกปิดรอยตะเข็บที่มุมแหลมคมได้อย่างมีประสิทธิภาพ" +msgid "Apply scarf joints only to smooth perimeters where traditional seams do not conceal the seams at sharp corners effectively." +msgstr "ใช้ข้อต่อผ้าพันคอกับขอบเรียบเท่านั้น โดยที่รอยตะเข็บแบบเดิมไม่สามารถปกปิดรอยตะเข็บที่มุมแหลมคมได้อย่างมีประสิทธิภาพ" msgid "Conditional angle threshold" msgstr "เกณฑ์มุมแบบมีเงื่อนไข" msgid "" -"This option sets the threshold angle for applying a conditional scarf joint " -"seam.\n" -"If the maximum angle within the perimeter loop exceeds this value " -"(indicating the absence of sharp corners), a scarf joint seam will be used. " -"The default value is 155°." +"This option sets the threshold angle for applying a conditional scarf joint seam.\n" +"If the maximum angle within the perimeter loop exceeds this value (indicating the absence of sharp corners), a scarf joint seam will be used. The default value is 155°." msgstr "" "ตัวเลือกนี้จะกำหนดมุมเกณฑ์สำหรับการใช้รอยตะเข็บข้อต่อผ้าพันคอแบบมีเงื่อนไข\n" -"หากมุมสูงสุดภายในวงรอบปริมณฑลเกินค่านี้ (แสดงว่าไม่มีมุมแหลมคม) จะใช้รอยตะเข็บข้อต่อผ้าพันคอ " -"ค่าเริ่มต้นคือ 155°" +"หากมุมสูงสุดภายในวงรอบปริมณฑลเกินค่านี้ (แสดงว่าไม่มีมุมแหลมคม) จะใช้รอยตะเข็บข้อต่อผ้าพันคอ ค่าเริ่มต้นคือ 155°" msgid "Conditional overhang threshold" msgstr "เกณฑ์ระยะยื่นแบบมีเงื่อนไข" #, no-c-format, no-boost-format -msgid "" -"This option determines the overhang threshold for the application of scarf " -"joint seams. If the unsupported portion of the perimeter is less than this " -"threshold, scarf joint seams will be applied. The default threshold is set " -"at 40% of the external wall's width. Due to performance considerations, the " -"degree of overhang is estimated." -msgstr "" -"ตัวเลือกนี้จะกำหนดเกณฑ์ส่วนยื่นสำหรับการใช้รอยตะเข็บข้อต่อผ้าพันคอ " -"หากส่วนที่ไม่ได้รับส่วนรองรับของเส้นรอบวงน้อยกว่าเกณฑ์นี้ จะมีการเย็บรอยตะเข็บผ้าพันคอ " -"เกณฑ์เริ่มต้นตั้งไว้ที่ 40% ของความกว้างของผนังภายนอก เมื่อพิจารณาถึงประสิทธิภาพแล้ว " -"ระดับของระยะยื่นจึงถูกประมาณไว้" +msgid "This option determines the overhang threshold for the application of scarf joint seams. If the unsupported portion of the perimeter is less than this threshold, scarf joint seams will be applied. The default threshold is set at 40% of the external wall's width. Due to performance considerations, the degree of overhang is estimated." +msgstr "ตัวเลือกนี้จะกำหนดเกณฑ์ส่วนยื่นสำหรับการใช้รอยตะเข็บข้อต่อผ้าพันคอ หากส่วนที่ไม่ได้รับส่วนรองรับของเส้นรอบวงน้อยกว่าเกณฑ์นี้ จะมีการเย็บรอยตะเข็บผ้าพันคอ เกณฑ์เริ่มต้นตั้งไว้ที่ 40% ของความกว้างของผนังภายนอก เมื่อพิจารณาถึงประสิทธิภาพแล้ว ระดับของระยะยื่นจึงถูกประมาณไว้" msgid "Scarf joint speed" msgstr "ความเร็วของข้อต่อผ้าพันคอ" -msgid "" -"This option sets the printing speed for scarf joints. It is recommended to " -"print scarf joints at a slow speed (less than 100 mm/s). It's also advisable " -"to enable 'Extrusion rate smoothing' if the set speed varies significantly " -"from the speed of the outer or inner walls. If the speed specified here is " -"higher than the speed of the outer or inner walls, the printer will default " -"to the slower of the two speeds. When specified as a percentage (e.g., 80%), " -"the speed is calculated based on the respective outer or inner wall speed. " -"The default value is set to 100%." -msgstr "" -"ตัวเลือกนี้จะตั้งค่าความเร็วในการพิมพ์สำหรับข้อต่อผ้าพันคอ " -"ขอแนะนำให้พิมพ์ข้อต่อผ้าพันคอด้วยความเร็วต่ำ (น้อยกว่า 100 มม./วินาที) ขอแนะนำให้เปิดใช้งาน " -"'การปรับอัตราการอัดรีดให้เรียบ' " -"หากความเร็วที่ตั้งไว้แตกต่างอย่างมากจากความเร็วของผนังด้านนอกหรือด้านใน " -"หากความเร็วที่ระบุที่นี่สูงกว่าความเร็วของผนังด้านนอกหรือด้านใน " -"เครื่องพิมพ์จะตั้งค่าเริ่มต้นไว้ที่ความเร็วที่ช้ากว่าทั้งสอง เมื่อระบุเป็นเปอร์เซ็นต์ (เช่น 80%) " -"ความเร็วจะคำนวณตามความเร็วผนังด้านนอกหรือด้านในตามลำดับ ค่าเริ่มต้นตั้งไว้ที่ 100%" +msgid "This option sets the printing speed for scarf joints. It is recommended to print scarf joints at a slow speed (less than 100 mm/s). It's also advisable to enable 'Extrusion rate smoothing' if the set speed varies significantly from the speed of the outer or inner walls. If the speed specified here is higher than the speed of the outer or inner walls, the printer will default to the slower of the two speeds. When specified as a percentage (e.g., 80%), the speed is calculated based on the respective outer or inner wall speed. The default value is set to 100%." +msgstr "ตัวเลือกนี้จะตั้งค่าความเร็วในการพิมพ์สำหรับข้อต่อผ้าพันคอ ขอแนะนำให้พิมพ์ข้อต่อผ้าพันคอด้วยความเร็วต่ำ (น้อยกว่า 100 มม./วินาที) ขอแนะนำให้เปิดใช้งาน 'การปรับอัตราการอัดรีดให้เรียบ' หากความเร็วที่ตั้งไว้แตกต่างอย่างมากจากความเร็วของผนังด้านนอกหรือด้านใน หากความเร็วที่ระบุที่นี่สูงกว่าความเร็วของผนังด้านนอกหรือด้านใน เครื่องพิมพ์จะตั้งค่าเริ่มต้นไว้ที่ความเร็วที่ช้ากว่าทั้งสอง เมื่อระบุเป็นเปอร์เซ็นต์ (เช่น 80%) ความเร็วจะคำนวณตามความเร็วผนังด้านนอกหรือด้านในตามลำดับ ค่าเริ่มต้นตั้งไว้ที่ 100%" msgid "Scarf joint flow ratio" msgstr "อัตราการไหลของข้อต่อผ้าพันคอ" @@ -17141,12 +14503,10 @@ msgstr "ความสูงเริ่มต้นของผ้าพัน msgid "" "Start height of the scarf.\n" -"This amount can be specified in millimeters or as a percentage of the " -"current layer height. The default value for this parameter is 0." +"This amount can be specified in millimeters or as a percentage of the current layer height. The default value for this parameter is 0." msgstr "" "เริ่มต้นความสูงของผ้าพันคอ\n" -"จำนวนนี้สามารถระบุได้ในหน่วยมิลลิเมตรหรือเป็นเปอร์เซ็นต์ของความสูงของเลเยอร์ปัจจุบัน " -"ค่าเริ่มต้นสำหรับพารามิเตอร์นี้คือ 0" +"จำนวนนี้สามารถระบุได้ในหน่วยมิลลิเมตรหรือเป็นเปอร์เซ็นต์ของความสูงของเลเยอร์ปัจจุบัน ค่าเริ่มต้นสำหรับพารามิเตอร์นี้คือ 0" msgid "Scarf around entire wall" msgstr "ผ้าพันคอพันรอบผนังทั้งหมด" @@ -17157,9 +14517,7 @@ msgstr "ผ้าพันคอยาวตลอดความยาวขอ msgid "Scarf length" msgstr "ความยาวผ้าพันคอ" -msgid "" -"Length of the scarf. Setting this parameter to zero effectively disables the " -"scarf." +msgid "Length of the scarf. Setting this parameter to zero effectively disables the scarf." msgstr "ความยาวของผ้าพันคอ. การตั้งค่าพารามิเตอร์นี้เป็นศูนย์จะปิดใช้ผ้าพันคออย่างมีประสิทธิภาพ" msgid "Scarf steps" @@ -17177,60 +14535,32 @@ msgstr "ใช้ข้อต่อผ้าพันคอสำหรับผ msgid "Role base wipe speed" msgstr "ความเร็วในการล้างฐานบทบาท" -msgid "" -"The wipe speed is determined by the speed of the current extrusion role. e." -"g. if a wipe action is executed immediately following an outer wall " -"extrusion, the speed of the outer wall extrusion will be utilized for the " -"wipe action." -msgstr "" -"ความเร็วในการเช็ดถูกกำหนดโดยความเร็วของบทบาทการอัดขึ้นรูปในปัจจุบัน เช่น " -"หากการดำเนินการเช็ดถูกดำเนินการทันทีหลังจากการอัดขึ้นรูปผนังด้านนอก " -"ความเร็วของการอัดขึ้นรูปผนังด้านนอกจะถูกใช้สำหรับการดำเนินการเช็ด" +msgid "The wipe speed is determined by the speed of the current extrusion role. e.g. if a wipe action is executed immediately following an outer wall extrusion, the speed of the outer wall extrusion will be utilized for the wipe action." +msgstr "ความเร็วในการเช็ดถูกกำหนดโดยความเร็วของบทบาทการอัดขึ้นรูปในปัจจุบัน เช่น หากการดำเนินการเช็ดถูกดำเนินการทันทีหลังจากการอัดขึ้นรูปผนังด้านนอก ความเร็วของการอัดขึ้นรูปผนังด้านนอกจะถูกใช้สำหรับการดำเนินการเช็ด" msgid "Wipe on loops" msgstr "เช็ดบนลูป" -msgid "" -"To minimize the visibility of the seam in a closed loop extrusion, a small " -"inward movement is executed before the extruder leaves the loop." -msgstr "" -"เพื่อลดการมองเห็นรอยต่อในการอัดรีดแบบวงปิด " -"จะมีการเคลื่อนตัวเข้าด้านในเล็กน้อยก่อนที่ชุดดันเส้นจะออกจากวง" +msgid "To minimize the visibility of the seam in a closed loop extrusion, a small inward movement is executed before the extruder leaves the loop." +msgstr "เพื่อลดการมองเห็นรอยต่อในการอัดรีดแบบวงปิด จะมีการเคลื่อนตัวเข้าด้านในเล็กน้อยก่อนที่ชุดดันเส้นจะออกจากวง" msgid "Wipe before external loop" msgstr "เช็ดก่อนวนรอบภายนอก" msgid "" -"To minimize visibility of potential overextrusion at the start of an " -"external perimeter when printing with Outer/Inner or Inner/Outer/Inner wall " -"print order, the de-retraction is performed slightly on the inside from the " -"start of the external perimeter. That way any potential over extrusion is " -"hidden from the outside surface.\n" +"To minimize visibility of potential overextrusion at the start of an external perimeter when printing with Outer/Inner or Inner/Outer/Inner wall print order, the de-retraction is performed slightly on the inside from the start of the external perimeter. That way any potential over extrusion is hidden from the outside surface.\n" "\n" -"This is useful when printing with Outer/Inner or Inner/Outer/Inner wall " -"print order as in these modes it is more likely an external perimeter is " -"printed immediately after a de-retraction move." +"This is useful when printing with Outer/Inner or Inner/Outer/Inner wall print order as in these modes it is more likely an external perimeter is printed immediately after a de-retraction move." msgstr "" -"เพื่อลดการมองเห็นการอัดขึ้นรูปมากเกินไปที่อาจเกิดขึ้นที่จุดเริ่มต้นของขอบเขตภายนอกเมื่อพิมพ์ด้วยลำดับการพิมพ์ด้านนอก/" -"ด้านในหรือด้านใน/ด้านนอก/ด้านใน " -"การยกเลิกการดึงกลับจะดำเนินการเล็กน้อยจากด้านในจากจุดเริ่มต้นของขอบเขตภายนอก " -"ด้วยวิธีนี้ศักยภาพในการอัดขึ้นรูปจะถูกซ่อนจากพื้นผิวด้านนอก\n" +"เพื่อลดการมองเห็นการอัดขึ้นรูปมากเกินไปที่อาจเกิดขึ้นที่จุดเริ่มต้นของขอบเขตภายนอกเมื่อพิมพ์ด้วยลำดับการพิมพ์ด้านนอก/ด้านในหรือด้านใน/ด้านนอก/ด้านใน การยกเลิกการดึงกลับจะดำเนินการเล็กน้อยจากด้านในจากจุดเริ่มต้นของขอบเขตภายนอก ด้วยวิธีนี้ศักยภาพในการอัดขึ้นรูปจะถูกซ่อนจากพื้นผิวด้านนอก\n" "\n" -"สิ่งนี้มีประโยชน์เมื่อพิมพ์ด้วยลำดับการพิมพ์ด้านนอก/ด้านในหรือด้านใน/ด้านนอก/ด้านใน " -"เนื่องจากในโหมดเหล่านี้ มีแนวโน้มว่าปริมณฑลภายนอกจะถูกพิมพ์ทันทีหลังจากการยกเลิกการถอยกลับ" +"สิ่งนี้มีประโยชน์เมื่อพิมพ์ด้วยลำดับการพิมพ์ด้านนอก/ด้านในหรือด้านใน/ด้านนอก/ด้านใน เนื่องจากในโหมดเหล่านี้ มีแนวโน้มว่าปริมณฑลภายนอกจะถูกพิมพ์ทันทีหลังจากการยกเลิกการถอยกลับ" msgid "Wipe speed" msgstr "ความเร็วเช็ดหัวฉีด" -msgid "" -"The wipe speed is determined by the speed setting specified in this " -"configuration. If the value is expressed as a percentage (e.g. 80%), it will " -"be calculated based on the travel speed setting above. The default value for " -"this parameter is 80%." -msgstr "" -"ความเร็วในการเช็ดถูกกำหนดโดยการตั้งค่าความเร็วที่ระบุในการกำหนดค่านี้ " -"หากค่าแสดงเป็นเปอร์เซ็นต์ (เช่น 80%) ระบบจะคำนวณตามการตั้งค่าความเร็วการเดินทางด้านบน " -"ค่าเริ่มต้นสำหรับพารามิเตอร์นี้คือ 80%" +msgid "The wipe speed is determined by the speed setting specified in this configuration. If the value is expressed as a percentage (e.g. 80%), it will be calculated based on the travel speed setting above. The default value for this parameter is 80%." +msgstr "ความเร็วในการเช็ดถูกกำหนดโดยการตั้งค่าความเร็วที่ระบุในการกำหนดค่านี้ หากค่าแสดงเป็นเปอร์เซ็นต์ (เช่น 80%) ระบบจะคำนวณตามการตั้งค่าความเร็วการเดินทางด้านบน ค่าเริ่มต้นสำหรับพารามิเตอร์นี้คือ 80%" msgid "Skirt distance" msgstr "ระยะห่างของเส้นล้อมชิ้นงาน" @@ -17241,9 +14571,7 @@ msgstr "ระยะห่างจากเส้นล้อมชิ้นง msgid "Skirt start point" msgstr "จุดเริ่มต้นเส้นล้อมชิ้นงาน" -msgid "" -"Angle from the object center to skirt start point. Zero is the most right " -"position, counter clockwise is positive angle." +msgid "Angle from the object center to skirt start point. Zero is the most right position, counter clockwise is positive angle." msgstr "มุมจากศูนย์กลางวัตถุถึงจุดเริ่มต้นสเกิร์ต ศูนย์คือตำแหน่งที่ถูกต้องที่สุด ทวนเข็มนาฬิกาคือมุมบวก" msgid "Skirt height" @@ -17255,36 +14583,22 @@ msgstr "เส้นล้อมชิ้นงานกี่ชั้น.. โ msgid "Single loop after first layer" msgstr "วนรอบเดียวหลังจากชั้นแรก" -msgid "" -"Limits the skirt/draft shield loops to one wall after the first layer. This " -"is useful, on occasion, to conserve filament but may cause the draft shield/" -"skirt to warp / crack." -msgstr "" -"จำกัดห่วงสเกิร์ต/โล่ครอบไว้ที่ผนังด้านหนึ่งหลังจากชั้นแรก " -"สิ่งนี้มีประโยชน์ในบางครั้งเพื่ออนุรักษ์เส้นพลาสติก แต่อาจทำให้โครง/เส้นล้อมชิ้นงานบิดเบี้ยว/แตกร้าวได้" +msgid "Limits the skirt/draft shield loops to one wall after the first layer. This is useful, on occasion, to conserve filament but may cause the draft shield/skirt to warp / crack." +msgstr "จำกัดห่วงสเกิร์ต/โล่ครอบไว้ที่ผนังด้านหนึ่งหลังจากชั้นแรก สิ่งนี้มีประโยชน์ในบางครั้งเพื่ออนุรักษ์เส้นพลาสติก แต่อาจทำให้โครง/เส้นล้อมชิ้นงานบิดเบี้ยว/แตกร้าวได้" msgid "Draft shield" msgstr "โล่ร่าง" msgid "" -"A draft shield is useful to protect an ABS or ASA print from warping and " -"detaching from print bed due to wind draft. It is usually needed only with " -"open frame printers, i.e. without an enclosure.\n" +"A draft shield is useful to protect an ABS or ASA print from warping and detaching from print bed due to wind draft. It is usually needed only with open frame printers, i.e. without an enclosure.\n" "\n" -"Enabled = skirt is as tall as the highest printed object. Otherwise 'Skirt " -"height' is used.\n" -"Note: With the draft shield active, the skirt will be printed at skirt " -"distance from the object. Therefore, if brims are active it may intersect " -"with them. To avoid this, increase the skirt distance value.\n" +"Enabled = skirt is as tall as the highest printed object. Otherwise 'Skirt height' is used.\n" +"Note: With the draft shield active, the skirt will be printed at skirt distance from the object. Therefore, if brims are active it may intersect with them. To avoid this, increase the skirt distance value.\n" msgstr "" -"แผงครอบมีประโยชน์ในการปกป้องงานพิมพ์ ABS หรือ ASA " -"จากการบิดงอและการหลุดออกจากฐานพิมพ์เนื่องจากกระแสลม " -"โดยทั่วไปจำเป็นต้องใช้กับเครื่องพิมพ์แบบเปิดเฟรมเท่านั้น กล่าวคือ ไม่มีกล่องหุ้ม\n" +"แผงครอบมีประโยชน์ในการปกป้องงานพิมพ์ ABS หรือ ASA จากการบิดงอและการหลุดออกจากฐานพิมพ์เนื่องจากกระแสลม โดยทั่วไปจำเป็นต้องใช้กับเครื่องพิมพ์แบบเปิดเฟรมเท่านั้น กล่าวคือ ไม่มีกล่องหุ้ม\n" "\n" "Enabled = เส้นล้อมชิ้นงานสูงเท่ากับวัตถุที่พิมพ์สูงสุด มิฉะนั้น จะใช้ 'ความสูงของเส้นล้อมชิ้นงาน'\n" -"หมายเหตุ: เมื่อใช้งานดราฟชีลด์ เส้นล้อมชิ้นงานจะถูกพิมพ์ที่ระยะห่างจากเส้นล้อมชิ้นงานจากวัตถุ " -"ดังนั้นหากขอบยึดชิ้นงานยังทำงานอยู่ ขอบยึดชิ้นงานอาจตัดกัน เพื่อหลีกเลี่ยงปัญหานี้ " -"ให้เพิ่มค่าระยะห่างของเส้นล้อมชิ้นงาน\n" +"หมายเหตุ: เมื่อใช้งานดราฟชีลด์ เส้นล้อมชิ้นงานจะถูกพิมพ์ที่ระยะห่างจากเส้นล้อมชิ้นงานจากวัตถุ ดังนั้นหากขอบยึดชิ้นงานยังทำงานอยู่ ขอบยึดชิ้นงานอาจตัดกัน เพื่อหลีกเลี่ยงปัญหานี้ ให้เพิ่มค่าระยะห่างของเส้นล้อมชิ้นงาน\n" msgid "Enabled" msgstr "เปิดใช้" @@ -17292,9 +14606,7 @@ msgstr "เปิดใช้" msgid "Skirt type" msgstr "ประเภทเส้นล้อมชิ้นงาน" -msgid "" -"Combined - single skirt for all objects, Per object - individual object " -"skirt." +msgid "Combined - single skirt for all objects, Per object - individual object skirt." msgstr "รวม - เส้นล้อมชิ้นงานเดี่ยวสำหรับวัตถุทั้งหมด ต่อวัตถุ - เส้นล้อมชิ้นงานวัตถุแต่ละรายการ" msgid "Per object" @@ -17303,49 +14615,36 @@ msgstr "ต่อวัตถุ" msgid "Skirt loops" msgstr "ห่วงเส้นล้อมชิ้นงาน" -msgid "" -"This is the number of loops for the skirt. 0 means the skirt is disabled." +msgid "This is the number of loops for the skirt. 0 means the skirt is disabled." msgstr "จำนวนห่วงสำหรับเส้นล้อมชิ้นงาน ศูนย์หมายถึงปิดการใช้งานเส้นล้อมชิ้นงาน" msgid "Skirt speed" msgstr "ความเร็ว เส้นล้อมชิ้นงาน" msgid "Speed of skirt, in mm/s. Zero means use default layer extrusion speed." -msgstr "" -"ความเร็วของเส้นล้อมชิ้นงาน มีหน่วยเป็น mm/s ศูนย์หมายถึงใช้ความเร็วการอัดรีดเลเยอร์เริ่มต้น" +msgstr "ความเร็วของเส้นล้อมชิ้นงาน มีหน่วยเป็น mm/s ศูนย์หมายถึงใช้ความเร็วการอัดรีดเลเยอร์เริ่มต้น" msgid "Skirt minimum extrusion length" msgstr "ความยาวการอัดรีดขั้นต่ำของเส้นล้อมชิ้นงาน" msgid "" -"Minimum filament extrusion length in mm when printing the skirt. Zero means " -"this feature is disabled.\n" +"Minimum filament extrusion length in mm when printing the skirt. Zero means this feature is disabled.\n" "\n" -"Using a non-zero value is useful if the printer is set up to print without a " -"prime line.\n" -"Final number of loops is not taking into account while arranging or " -"validating objects distance. Increase loop number in such case." +"Using a non-zero value is useful if the printer is set up to print without a prime line.\n" +"Final number of loops is not taking into account while arranging or validating objects distance. Increase loop number in such case." msgstr "" -"ความยาวการอัดขึ้นรูปเส้นพลาสติกขั้นต่ำเป็นมม. เมื่อพิมพ์เส้นล้อมชิ้นงาน " -"ศูนย์หมายความว่าคุณลักษณะนี้ถูกปิดใช้งาน\n" +"ความยาวการอัดขึ้นรูปเส้นพลาสติกขั้นต่ำเป็นมม. เมื่อพิมพ์เส้นล้อมชิ้นงาน ศูนย์หมายความว่าคุณลักษณะนี้ถูกปิดใช้งาน\n" "\n" "การใช้ค่าที่ไม่ใช่ศูนย์จะมีประโยชน์หากเครื่องพิมพ์ได้รับการตั้งค่าให้พิมพ์โดยไม่มีเส้นสำคัญ\n" "จำนวนลูปสุดท้ายไม่ได้คำนึงถึงขณะจัดเรียงหรือตรวจสอบระยะห่างของวัตถุ เพิ่มจำนวนลูปในกรณีเช่นนี้" -msgid "" -"The printing speed in exported G-code will be slowed down when the estimated " -"layer time is shorter than this value in order to get better cooling for " -"these layers." -msgstr "" -"ความเร็วในการพิมพ์ใน G-code ที่ส่งออกจะลดลงเมื่อเวลาเลเยอร์โดยประมาณสั้นกว่าค่านี้ " -"เพื่อให้เลเยอร์เหล่านี้เย็นลงได้ดีขึ้น" +msgid "The printing speed in exported G-code will be slowed down when the estimated layer time is shorter than this value in order to get better cooling for these layers." +msgstr "ความเร็วในการพิมพ์ใน G-code ที่ส่งออกจะลดลงเมื่อเวลาเลเยอร์โดยประมาณสั้นกว่าค่านี้ เพื่อให้เลเยอร์เหล่านี้เย็นลงได้ดีขึ้น" msgid "Minimum sparse infill threshold" msgstr "เกณฑ์ไส้ในแบบกระจัดกระจายขั้นต่ำ" -msgid "" -"Sparse infill areas which are smaller than this threshold value are replaced " -"by internal solid infill." +msgid "Sparse infill areas which are smaller than this threshold value are replaced by internal solid infill." msgstr "พื้นที่ไส้ในแบบกระจัดกระจายที่เล็กกว่าค่าเกณฑ์นี้จะถูกแทนที่ด้วยไส้ในแบบทึบภายใน" msgid "" @@ -17369,89 +14668,44 @@ msgstr "" "เส้นพลาสติกสำหรับพิมพ์พื้นผิวด้านล่าง\n" "\"ค่าเริ่มต้น\" ใช้เส้นพลาสติกของวัตถุ/ชิ้นส่วนที่ใช้งานอยู่" -msgid "" -"Line width of internal solid infill. If expressed as a %, it will be " -"computed over the nozzle diameter." -msgstr "" -"ความกว้างของเส้นของ ไส้ใน ทึบภายใน หากแสดงเป็น % จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" +msgid "Line width of internal solid infill. If expressed as a %, it will be computed over the nozzle diameter." +msgstr "ความกว้างของเส้นของ ไส้ใน ทึบภายใน หากแสดงเป็น % จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" -msgid "" -"This is the speed for internal solid infill, not including the top or bottom " -"surface." +msgid "This is the speed for internal solid infill, not including the top or bottom surface." msgstr "ความเร็วของไส้ในของแข็งภายใน ไม่ใช่พื้นผิวด้านบนและด้านล่าง" -msgid "" -"This enables spiraling, which smooths out the Z moves of the outer contour " -"and turns a solid model into a single walled print with solid bottom layers. " -"The final generated model has no seam." -msgstr "" -"Spiralize จะทำให้การเคลื่อนที่ Z ของเส้นขอบด้านนอกเรียบเนียนขึ้น " -"และเปลี่ยนโมเดลทึบให้เป็นภาพพิมพ์ผนังเดี่ยวพร้อมชั้นล่างสุดทึบ โมเดลที่สร้างขึ้นขั้นสุดท้ายไม่มีรอยตะเข็บ" +msgid "This enables spiraling, which smooths out the Z moves of the outer contour and turns a solid model into a single walled print with solid bottom layers. The final generated model has no seam." +msgstr "Spiralize จะทำให้การเคลื่อนที่ Z ของเส้นขอบด้านนอกเรียบเนียนขึ้น และเปลี่ยนโมเดลทึบให้เป็นภาพพิมพ์ผนังเดี่ยวพร้อมชั้นล่างสุดทึบ โมเดลที่สร้างขึ้นขั้นสุดท้ายไม่มีรอยตะเข็บ" msgid "Smooth Spiral" msgstr "เกลียวเรียบ" -msgid "" -"Smooth Spiral smooths out X and Y moves as well, resulting in no visible " -"seam at all, even in the XY directions on walls that are not vertical." -msgstr "" -"Smooth Spiral ช่วยให้การเคลื่อนที่ของ X และ Y เป็นไปอย่างราบรื่น " -"ส่งผลให้มองไม่เห็นรอยตะเข็บเลย แม้แต่ในทิศทาง XY บนผนังที่ไม่ใช่แนวตั้งก็ตาม" +msgid "Smooth Spiral smooths out X and Y moves as well, resulting in no visible seam at all, even in the XY directions on walls that are not vertical." +msgstr "Smooth Spiral ช่วยให้การเคลื่อนที่ของ X และ Y เป็นไปอย่างราบรื่น ส่งผลให้มองไม่เห็นรอยตะเข็บเลย แม้แต่ในทิศทาง XY บนผนังที่ไม่ใช่แนวตั้งก็ตาม" msgid "Max XY Smoothing" msgstr "การปรับให้เรียบสูงสุด XY" #, no-c-format, no-boost-format -msgid "" -"Maximum distance to move points in XY to try to achieve a smooth spiral. If " -"expressed as a %, it will be computed over nozzle diameter." -msgstr "" -"ระยะทางสูงสุดเพื่อย้ายจุดใน XY เพื่อพยายามให้ได้เกลียวเรียบ หากแสดงเป็น % " -"จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" +msgid "Maximum distance to move points in XY to try to achieve a smooth spiral. If expressed as a %, it will be computed over nozzle diameter." +msgstr "ระยะทางสูงสุดเพื่อย้ายจุดใน XY เพื่อพยายามให้ได้เกลียวเรียบ หากแสดงเป็น % จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" msgid "Spiral starting flow ratio" msgstr "อัตราการไหลเริ่มต้นของเกลียว" #, no-c-format, no-boost-format -msgid "" -"Sets the starting flow ratio while transitioning from the last bottom layer " -"to the spiral. Normally the spiral transition scales the flow ratio from 0% " -"to 100% during the first loop which can in some cases lead to under " -"extrusion at the start of the spiral." -msgstr "" -"ตั้งค่าอัตราส่วนการไหลเริ่มต้นขณะเปลี่ยนจากชั้นล่างสุดสุดท้ายเป็นเกลียว " -"โดยปกติการเปลี่ยนผ่านของเกลียวจะปรับขนาดอัตราส่วนการไหลจาก 0% เป็น 100% ในระหว่างลูปแรก " -"ซึ่งในบางกรณีอาจนำไปสู่การรีดขึ้นรูปที่จุดเริ่มต้นของเกลียว" +msgid "Sets the starting flow ratio while transitioning from the last bottom layer to the spiral. Normally the spiral transition scales the flow ratio from 0% to 100% during the first loop which can in some cases lead to under extrusion at the start of the spiral." +msgstr "ตั้งค่าอัตราส่วนการไหลเริ่มต้นขณะเปลี่ยนจากชั้นล่างสุดสุดท้ายเป็นเกลียว โดยปกติการเปลี่ยนผ่านของเกลียวจะปรับขนาดอัตราส่วนการไหลจาก 0% เป็น 100% ในระหว่างลูปแรก ซึ่งในบางกรณีอาจนำไปสู่การรีดขึ้นรูปที่จุดเริ่มต้นของเกลียว" msgid "Spiral finishing flow ratio" msgstr "อัตราการไหลการตกแต่งเกลียว" #, no-c-format, no-boost-format -msgid "" -"Sets the finishing flow ratio while ending the spiral. Normally the spiral " -"transition scales the flow ratio from 100% to 0% during the last loop which " -"can in some cases lead to under extrusion at the end of the spiral." -msgstr "" -"ตั้งค่าอัตราส่วนการไหลขั้นสุดท้ายขณะสิ้นสุดเกลียว " -"โดยปกติการเปลี่ยนผ่านของเกลียวจะปรับขนาดอัตราส่วนการไหลจาก 100% เป็น 0% " -"ในระหว่างลูปสุดท้าย ซึ่งในบางกรณีอาจนำไปสู่การรีดขึ้นรูปที่ปลายเกลียว" +msgid "Sets the finishing flow ratio while ending the spiral. Normally the spiral transition scales the flow ratio from 100% to 0% during the last loop which can in some cases lead to under extrusion at the end of the spiral." +msgstr "ตั้งค่าอัตราส่วนการไหลขั้นสุดท้ายขณะสิ้นสุดเกลียว โดยปกติการเปลี่ยนผ่านของเกลียวจะปรับขนาดอัตราส่วนการไหลจาก 100% เป็น 0% ในระหว่างลูปสุดท้าย ซึ่งในบางกรณีอาจนำไปสู่การรีดขึ้นรูปที่ปลายเกลียว" -msgid "" -"If smooth or traditional mode is selected, a timelapse video will be " -"generated for each print. After each layer is printed, a snapshot is taken " -"with the chamber camera. All of these snapshots are composed into a " -"timelapse video when printing completes. If smooth mode is selected, the " -"toolhead will move to the excess chute after each layer is printed and then " -"take a snapshot. Since the melt filament may leak from the nozzle during the " -"process of taking a snapshot, a prime tower is required for smooth mode to " -"wipe the nozzle." -msgstr "" -"หากเลือกโหมดเรียบหรือโหมดดั้งเดิม วิดีโอไทม์แลปส์จะถูกสร้างขึ้นสำหรับการพิมพ์แต่ละครั้ง " -"หลังจากพิมพ์แต่ละชั้นแล้ว กล้องจะถ่ายภาพสแนปช็อตด้วยกล้องแชมเบอร์ " -"สแน็ปช็อตทั้งหมดนี้จะถูกประกอบเป็นวิดีโอไทม์แลปส์เมื่อการพิมพ์เสร็จสิ้น หากเลือกโหมดเรียบ " -"หัวเครื่องมือจะย้ายไปยังรางส่วนเกินหลังจากพิมพ์แต่ละเลเยอร์แล้วจึงถ่ายภาพสแน็ปช็อต " -"เนื่องจากเส้นพลาสติกที่หลอมละลายอาจรั่วไหลออกจากหัวฉีดในระหว่างขั้นตอนการถ่ายภาพ " -"จึงจำเป็นต้องมีไพรม์ทาวเวอร์เพื่อให้โหมดราบรื่นในการเช็ดหัวฉีด" +msgid "If smooth or traditional mode is selected, a timelapse video will be generated for each print. After each layer is printed, a snapshot is taken with the chamber camera. All of these snapshots are composed into a timelapse video when printing completes. If smooth mode is selected, the toolhead will move to the excess chute after each layer is printed and then take a snapshot. Since the melt filament may leak from the nozzle during the process of taking a snapshot, a prime tower is required for smooth mode to wipe the nozzle." +msgstr "หากเลือกโหมดเรียบหรือโหมดดั้งเดิม วิดีโอไทม์แลปส์จะถูกสร้างขึ้นสำหรับการพิมพ์แต่ละครั้ง หลังจากพิมพ์แต่ละชั้นแล้ว กล้องจะถ่ายภาพสแนปช็อตด้วยกล้องแชมเบอร์ สแน็ปช็อตทั้งหมดนี้จะถูกประกอบเป็นวิดีโอไทม์แลปส์เมื่อการพิมพ์เสร็จสิ้น หากเลือกโหมดเรียบ หัวเครื่องมือจะย้ายไปยังรางส่วนเกินหลังจากพิมพ์แต่ละเลเยอร์แล้วจึงถ่ายภาพสแน็ปช็อต เนื่องจากเส้นพลาสติกที่หลอมละลายอาจรั่วไหลออกจากหัวฉีดในระหว่างขั้นตอนการถ่ายภาพ จึงจำเป็นต้องมีไพรม์ทาวเวอร์เพื่อให้โหมดราบรื่นในการเช็ดหัวฉีด" msgid "Traditional" msgstr "แบบดั้งเดิม" @@ -17460,13 +14714,8 @@ msgid "Temperature variation" msgstr "การเปลี่ยนแปลงของอุณหภูมิ" #. TRN PrintSettings : "Ooze prevention" > "Temperature variation" -msgid "" -"Temperature difference to be applied when an extruder is not active. The " -"value is not used when 'idle_temperature' in filament settings is set to non-" -"zero value." -msgstr "" -"ความแตกต่างของอุณหภูมิที่จะใช้เมื่อชุดดันเส้นไม่ทำงาน ค่าจะไม่ถูกใช้เมื่อตั้งค่า " -"'idle_temperature' ในการตั้งค่าเส้นพลาสติกเป็นค่าที่ไม่ใช่ศูนย์" +msgid "Temperature difference to be applied when an extruder is not active. The value is not used when 'idle_temperature' in filament settings is set to non-zero value." +msgstr "ความแตกต่างของอุณหภูมิที่จะใช้เมื่อชุดดันเส้นไม่ทำงาน ค่าจะไม่ถูกใช้เมื่อตั้งค่า 'idle_temperature' ในการตั้งค่าเส้นพลาสติกเป็นค่าที่ไม่ใช่ศูนย์" msgid "∆℃" msgstr "∆℃" @@ -17474,36 +14723,17 @@ msgstr "∆℃" msgid "Preheat time" msgstr "เวลาอุ่นเครื่อง" -msgid "" -"To reduce the waiting time after tool change, Orca can preheat the next tool " -"while the current tool is still in use. This setting specifies the time in " -"seconds to preheat the next tool. Orca will insert a M104 command to preheat " -"the tool in advance." -msgstr "" -"เพื่อลดเวลารอหลังจากเปลี่ยนเครื่องมือ Orca " -"สามารถอุ่นเครื่องมือถัดไปในขณะที่เครื่องมือปัจจุบันยังคงใช้งานอยู่ " -"การตั้งค่านี้ระบุเวลาเป็นวินาทีเพื่ออุ่นเครื่องมือถัดไป Orca จะแทรกคำสั่ง M104 เพื่ออุ่นเครื่องล่วงหน้า" +msgid "To reduce the waiting time after tool change, Orca can preheat the next tool while the current tool is still in use. This setting specifies the time in seconds to preheat the next tool. Orca will insert a M104 command to preheat the tool in advance." +msgstr "เพื่อลดเวลารอหลังจากเปลี่ยนเครื่องมือ Orca สามารถอุ่นเครื่องมือถัดไปในขณะที่เครื่องมือปัจจุบันยังคงใช้งานอยู่ การตั้งค่านี้ระบุเวลาเป็นวินาทีเพื่ออุ่นเครื่องมือถัดไป Orca จะแทรกคำสั่ง M104 เพื่ออุ่นเครื่องล่วงหน้า" msgid "Preheat steps" msgstr "อุ่นเครื่องตามขั้นตอน" -msgid "" -"Insert multiple preheat commands (e.g. M104.1). Only useful for Prusa XL. " -"For other printers, please set it to 1." -msgstr "" -"ใส่คำสั่งอุ่นล่วงหน้าหลายคำสั่ง (เช่น M104.1) มีประโยชน์สำหรับ Prusa XL เท่านั้น " -"สำหรับเครื่องพิมพ์อื่นๆ โปรดตั้งค่าเป็น 1" +msgid "Insert multiple preheat commands (e.g. M104.1). Only useful for Prusa XL. For other printers, please set it to 1." +msgstr "ใส่คำสั่งอุ่นล่วงหน้าหลายคำสั่ง (เช่น M104.1) มีประโยชน์สำหรับ Prusa XL เท่านั้น สำหรับเครื่องพิมพ์อื่นๆ โปรดตั้งค่าเป็น 1" -msgid "" -"G-code written at the very top of the output file, before any other content. " -"Useful for adding metadata that printer firmware reads from the first lines " -"of the file (e.g. estimated print time, filament usage). Supports " -"placeholders like {print_time_sec} and {used_filament_length}." -msgstr "" -"G-code เขียนไว้ที่ด้านบนสุดของไฟล์เอาต์พุต ก่อนเนื้อหาอื่นๆ " -"มีประโยชน์สำหรับการเพิ่มข้อมูลเมตาที่เฟิร์มแวร์เครื่องพิมพ์อ่านจากบรรทัดแรกของไฟล์ (เช่น " -"เวลาในการพิมพ์โดยประมาณ การใช้เส้นพลาสติก) รองรับตัวยึดตำแหน่ง เช่น {print_time_sec} " -"และ {used_filament_length}" +msgid "G-code written at the very top of the output file, before any other content. Useful for adding metadata that printer firmware reads from the first lines of the file (e.g. estimated print time, filament usage). Supports placeholders like {print_time_sec} and {used_filament_length}." +msgstr "G-code เขียนไว้ที่ด้านบนสุดของไฟล์เอาต์พุต ก่อนเนื้อหาอื่นๆ มีประโยชน์สำหรับการเพิ่มข้อมูลเมตาที่เฟิร์มแวร์เครื่องพิมพ์อ่านจากบรรทัดแรกของไฟล์ (เช่น เวลาในการพิมพ์โดยประมาณ การใช้เส้นพลาสติก) รองรับตัวยึดตำแหน่ง เช่น {print_time_sec} และ {used_filament_length}" msgid "Start G-code" msgstr "เริ่ม G-code" @@ -17523,30 +14753,14 @@ msgstr "ใช้หัวฉีดเดี่ยวเพื่อพิมพ msgid "Manual Filament Change" msgstr "การเปลี่ยนเส้นพลาสติกด้วยตนเอง" -msgid "" -"Enable this option to omit the custom Change filament G-code only at the " -"beginning of the print. The tool change command (e.g., T0) will be skipped " -"throughout the entire print. This is useful for manual multi-material " -"printing, where we use M600/PAUSE to trigger the manual filament change " -"action." -msgstr "" -"เปิดใช้งานตัวเลือกนี้เพื่อละเว้น G-code " -"เปลี่ยนฟิลาเมนต์แบบกำหนดเองเฉพาะตอนเริ่มต้นการพิมพ์เท่านั้น คำสั่งเปลี่ยนเครื่องมือ (เช่น T0) " -"จะถูกข้ามไปตลอดการพิมพ์ทั้งหมด สิ่งนี้มีประโยชน์สำหรับการพิมพ์หลายวัสดุด้วยตนเอง โดยที่เราใช้ " -"M600/PAUSE เพื่อกระตุ้นการดำเนินการเปลี่ยนเส้นพลาสติกด้วยตนเอง" +msgid "Enable this option to omit the custom Change filament G-code only at the beginning of the print. The tool change command (e.g., T0) will be skipped throughout the entire print. This is useful for manual multi-material printing, where we use M600/PAUSE to trigger the manual filament change action." +msgstr "เปิดใช้งานตัวเลือกนี้เพื่อละเว้น G-code เปลี่ยนฟิลาเมนต์แบบกำหนดเองเฉพาะตอนเริ่มต้นการพิมพ์เท่านั้น คำสั่งเปลี่ยนเครื่องมือ (เช่น T0) จะถูกข้ามไปตลอดการพิมพ์ทั้งหมด สิ่งนี้มีประโยชน์สำหรับการพิมพ์หลายวัสดุด้วยตนเอง โดยที่เราใช้ M600/PAUSE เพื่อกระตุ้นการดำเนินการเปลี่ยนเส้นพลาสติกด้วยตนเอง" msgid "Wipe tower type" msgstr "ชนิดทาวเวอร์เช็ด" -msgid "" -"Choose the wipe tower implementation for multi-material prints. Type 1 is " -"recommended for Bambu and Qidi printers with a filament cutter. Type 2 " -"offers better compatibility with multi-tool and MMU printers and provide " -"overall better compatibility." -msgstr "" -"เลือกการใช้งานไวด์ทาวเวอร์สำหรับการพิมพ์แบบหลายวัสดุ แนะนำให้ใช้ประเภท 1 สำหรับเครื่องพิมพ์ " -"Bambu และ Qidi ที่มีเครื่องตัดเส้นพลาสติก Type 2 " -"ให้ความเข้ากันได้ที่ดีกว่ากับเครื่องพิมพ์หลายเครื่องมือและ MMU และให้ความเข้ากันได้โดยรวมดีขึ้น" +msgid "Choose the wipe tower implementation for multi-material prints. Type 1 is recommended for Bambu and Qidi printers with a filament cutter. Type 2 offers better compatibility with multi-tool and MMU printers and provide overall better compatibility." +msgstr "เลือกการใช้งานไวด์ทาวเวอร์สำหรับการพิมพ์แบบหลายวัสดุ แนะนำให้ใช้ประเภท 1 สำหรับเครื่องพิมพ์ Bambu และ Qidi ที่มีเครื่องตัดเส้นพลาสติก Type 2 ให้ความเข้ากันได้ที่ดีกว่ากับเครื่องพิมพ์หลายเครื่องมือและ MMU และให้ความเข้ากันได้โดยรวมดีขึ้น" msgid "Type 1" msgstr "ประเภทที่ 1" @@ -17566,63 +14780,31 @@ msgstr "เปิดใช้งานการอัดกระแทกเส msgid "Tool change on wipe tower" msgstr "การเปลี่ยนเครื่องมือบนไวด์ทาวเวอร์" -msgid "" -"Force the toolhead to travel to the wipe tower before issuing the tool " -"change command (Tx). Only relevant for multi-extruder (multi-toolhead) " -"printers using a Type 2 wipe tower. By default Orca skips the travel on " -"multi-toolhead machines because the firmware handles the head swap, which " -"can result in the Tx command being issued above the printed part. Enable " -"this option if you want the tool change to always be issued above the wipe " -"tower instead." -msgstr "" -"บังคับให้หัวเครื่องมือเคลื่อนที่ไปที่หอเช็ดก่อนที่จะออกคำสั่งเปลี่ยนเครื่องมือ (Tx) " -"เกี่ยวข้องเฉพาะกับเครื่องพิมพ์ที่มีชุดดันเส้นหลายเครื่อง (หลายหัวเครื่องมือ) ที่ใช้แผ่นเช็ดแบบ Type 2 " -"ตามค่าเริ่มต้น Orca " -"จะข้ามการเดินทางบนเครื่องที่มีหัวเครื่องมือหลายหัวเนื่องจากเฟิร์มแวร์จัดการการสลับหัว " -"ซึ่งอาจส่งผลให้มีการออกคำสั่ง Tx เหนือส่วนที่พิมพ์ " -"เปิดใช้งานตัวเลือกนี้หากคุณต้องการให้ทำการเปลี่ยนแปลงเครื่องมือเหนือหอเช็ดแทนเสมอ" +msgid "Force the toolhead to travel to the wipe tower before issuing the tool change command (Tx). Only relevant for multi-extruder (multi-toolhead) printers using a Type 2 wipe tower. By default Orca skips the travel on multi-toolhead machines because the firmware handles the head swap, which can result in the Tx command being issued above the printed part. Enable this option if you want the tool change to always be issued above the wipe tower instead." +msgstr "บังคับให้หัวเครื่องมือเคลื่อนที่ไปที่หอเช็ดก่อนที่จะออกคำสั่งเปลี่ยนเครื่องมือ (Tx) เกี่ยวข้องเฉพาะกับเครื่องพิมพ์ที่มีชุดดันเส้นหลายเครื่อง (หลายหัวเครื่องมือ) ที่ใช้แผ่นเช็ดแบบ Type 2 ตามค่าเริ่มต้น Orca จะข้ามการเดินทางบนเครื่องที่มีหัวเครื่องมือหลายหัวเนื่องจากเฟิร์มแวร์จัดการการสลับหัว ซึ่งอาจส่งผลให้มีการออกคำสั่ง Tx เหนือส่วนที่พิมพ์ เปิดใช้งานตัวเลือกนี้หากคุณต้องการให้ทำการเปลี่ยนแปลงเครื่องมือเหนือหอเช็ดแทนเสมอ" msgid "No sparse layers (beta)" msgstr "ไม่มีชั้นกระจัดกระจาย (เบต้า)" -msgid "" -"If enabled, the wipe tower will not be printed on layers with no tool " -"changes. On layers with a tool change, extruder will travel downward to " -"print the wipe tower. User is responsible for ensuring there is no collision " -"with the print." -msgstr "" -"หากเปิดใช้งาน หอเช็ดจะไม่ถูกพิมพ์บนเลเยอร์โดยไม่มีการเปลี่ยนแปลงเครื่องมือ " -"บนเลเยอร์ที่มีการเปลี่ยนเครื่องมือ ชุดดันเส้นจะเคลื่อนลงด้านล่างเพื่อพิมพ์ไวด์ทาวเวอร์ " -"ผู้ใช้มีหน้าที่รับผิดชอบในการตรวจสอบให้แน่ใจว่าไม่มีการชนกันกับงานพิมพ์" +msgid "If enabled, the wipe tower will not be printed on layers with no tool changes. On layers with a tool change, extruder will travel downward to print the wipe tower. User is responsible for ensuring there is no collision with the print." +msgstr "หากเปิดใช้งาน หอเช็ดจะไม่ถูกพิมพ์บนเลเยอร์โดยไม่มีการเปลี่ยนแปลงเครื่องมือ บนเลเยอร์ที่มีการเปลี่ยนเครื่องมือ ชุดดันเส้นจะเคลื่อนลงด้านล่างเพื่อพิมพ์ไวด์ทาวเวอร์ ผู้ใช้มีหน้าที่รับผิดชอบในการตรวจสอบให้แน่ใจว่าไม่มีการชนกันกับงานพิมพ์" msgid "Prime all printing extruders" msgstr "ใช้ชุดดันเส้นการพิมพ์ทั้งหมด" -msgid "" -"If enabled, all printing extruders will be primed at the front edge of the " -"print bed at the start of the print." -msgstr "" -"หากเปิดใช้งาน ชุดดันเส้นการพิมพ์ทั้งหมดจะถูกลงสีพื้นที่ขอบด้านหน้าของฐานพิมพ์เมื่อเริ่มต้นการพิมพ์" +msgid "If enabled, all printing extruders will be primed at the front edge of the print bed at the start of the print." +msgstr "หากเปิดใช้งาน ชุดดันเส้นการพิมพ์ทั้งหมดจะถูกลงสีพื้นที่ขอบด้านหน้าของฐานพิมพ์เมื่อเริ่มต้นการพิมพ์" msgid "Slice gap closing radius" msgstr "รัศมีการปิดช่องว่างของ Slice" -msgid "" -"Cracks smaller than 2x gap closing radius are being filled during the " -"triangle mesh slicing. The gap closing operation may reduce the final print " -"resolution, therefore it is advisable to keep the value reasonably low." -msgstr "" -"รอยแตกร้าวที่มีขนาดเล็กกว่า 2 " -"เท่าของรัศมีการปิดช่องว่างจะถูกไส้ในเต็มระหว่างการตัดตาข่ายสามเหลี่ยม " -"การดำเนินการปิดช่องว่างอาจลดความละเอียดในการพิมพ์ขั้นสุดท้าย " -"ดังนั้นจึงแนะนำให้รักษาค่าให้ต่ำพอสมควร" +msgid "Cracks smaller than 2x gap closing radius are being filled during the triangle mesh slicing. The gap closing operation may reduce the final print resolution, therefore it is advisable to keep the value reasonably low." +msgstr "รอยแตกร้าวที่มีขนาดเล็กกว่า 2 เท่าของรัศมีการปิดช่องว่างจะถูกไส้ในเต็มระหว่างการตัดตาข่ายสามเหลี่ยม การดำเนินการปิดช่องว่างอาจลดความละเอียดในการพิมพ์ขั้นสุดท้าย ดังนั้นจึงแนะนำให้รักษาค่าให้ต่ำพอสมควร" msgid "Slicing Mode" msgstr "โหมดการแบ่งส่วน" -msgid "" -"Use \"Even-odd\" for 3DLabPrint airplane models. Use \"Close holes\" to " -"close all holes in the model." +msgid "Use \"Even-odd\" for 3DLabPrint airplane models. Use \"Close holes\" to close all holes in the model." msgstr "ใช้ \"เลขคู่\" สำหรับโมเดลเครื่องบิน 3DLabPrint ใช้ \"ปิดรู\" เพื่อปิดรูทั้งหมดในโมเดล" msgid "Regular" @@ -17637,15 +14819,8 @@ msgstr "ปิดรู" msgid "Z offset" msgstr "ออฟเซ็ต Z" -msgid "" -"This value will be added (or subtracted) from all the Z coordinates in the " -"output G-code. It is used to compensate for bad Z endstop position: for " -"example, if your endstop zero actually leaves the nozzle 0.3mm far from the " -"print bed, set this to -0.3 (or fix your endstop)." -msgstr "" -"ค่านี้จะถูกบวก (หรือลบ) จากพิกัด Z ทั้งหมดใน G-code เอาท์พุต ใช้เพื่อชดเชยตำแหน่งปลาย Z " -"ที่ไม่ดี: ตัวอย่างเช่น หากศูนย์ปลายสุดของคุณปล่อยหัวฉีดให้ห่างจากฐานพิมพ์ 0.3 มม. ให้ตั้งค่านี้เป็น " -"-0.3 (หรือแก้ไขจุดปลายสุดของคุณ)" +msgid "This value will be added (or subtracted) from all the Z coordinates in the output G-code. It is used to compensate for bad Z endstop position: for example, if your endstop zero actually leaves the nozzle 0.3mm far from the print bed, set this to -0.3 (or fix your endstop)." +msgstr "ค่านี้จะถูกบวก (หรือลบ) จากพิกัด Z ทั้งหมดใน G-code เอาท์พุต ใช้เพื่อชดเชยตำแหน่งปลาย Z ที่ไม่ดี: ตัวอย่างเช่น หากศูนย์ปลายสุดของคุณปล่อยหัวฉีดให้ห่างจากฐานพิมพ์ 0.3 มม. ให้ตั้งค่านี้เป็น -0.3 (หรือแก้ไขจุดปลายสุดของคุณ)" msgid "Enable support" msgstr "เปิดใช้ส่วนรองรับ" @@ -17653,13 +14828,8 @@ msgstr "เปิดใช้ส่วนรองรับ" msgid "This enables support generation." msgstr "เปิดใช้การสร้างส่วนรองรับ" -msgid "" -"Normal (auto) and Tree (auto) are used to generate support automatically. If " -"Normal (manual) or Tree (manual) is selected, only support enforcers are " -"generated." -msgstr "" -"ปกติ (อัตโนมัติ) และ Tree (อัตโนมัติ) ใช้เพื่อสร้างส่วนรองรับโดยอัตโนมัติ หากเลือก ปกติ " -"(ด้วยตนเอง) หรือ ต้นไม้ (ด้วยตนเอง) จะมีการสร้างเฉพาะกำหนดส่วนรองรับเท่านั้น" +msgid "Normal (auto) and Tree (auto) are used to generate support automatically. If Normal (manual) or Tree (manual) is selected, only support enforcers are generated." +msgstr "ปกติ (อัตโนมัติ) และ Tree (อัตโนมัติ) ใช้เพื่อสร้างส่วนรองรับโดยอัตโนมัติ หากเลือก ปกติ (ด้วยตนเอง) หรือ ต้นไม้ (ด้วยตนเอง) จะมีการสร้างเฉพาะกำหนดส่วนรองรับเท่านั้น" msgid "Normal (auto)" msgstr "ปกติ (อัตโนมัติ)" @@ -17700,9 +14870,7 @@ msgstr "อย่าสร้างส่วนรองรับบนพื้ msgid "Support critical regions only" msgstr "รองรับภูมิภาคที่สำคัญเท่านั้น" -msgid "" -"Only create support for critical regions including sharp tail, cantilever, " -"etc." +msgid "Only create support for critical regions including sharp tail, cantilever, etc." msgstr "สร้างการรองรับเฉพาะบริเวณที่สำคัญเท่านั้น เช่น หางแหลม คานยื่น เป็นต้น" msgid "Ignore small overhangs" @@ -17720,44 +14888,30 @@ msgstr "ช่องว่าง Z ระหว่างด้านบนขอ msgid "Bottom Z distance" msgstr "ระยะ Z ล่าง" -msgid "" -"Z gap between the object and the support bottom. If Support Top Z Distance " -"is 0 and the bottom has interface layers, this value is ignored and the " -"support is printed in direct contact with the object (no gap)." -msgstr "" -"ช่องว่าง Z ระหว่างวัตถุและฐานรองรับ หากระยะ Z สูงสุดที่รองรับคือ 0 " -"และด้านล่างมีเลเยอร์อินเทอร์เฟซ ค่านี้จะถูกละเว้น และส่วนรองรับจะถูกพิมพ์โดยสัมผัสโดยตรงกับวัตถุ " -"(ไม่มีช่องว่าง)" +msgid "Z gap between the object and the support bottom. If Support Top Z Distance is 0 and the bottom has interface layers, this value is ignored and the support is printed in direct contact with the object (no gap)." +msgstr "ช่องว่าง Z ระหว่างวัตถุและฐานรองรับ หากระยะ Z สูงสุดที่รองรับคือ 0 และด้านล่างมีเลเยอร์อินเทอร์เฟซ ค่านี้จะถูกละเว้น และส่วนรองรับจะถูกพิมพ์โดยสัมผัสโดยตรงกับวัตถุ (ไม่มีช่องว่าง)" msgid "Support/raft base" msgstr "ส่วนรองรับ/ฐานฐานรองชิ้นงาน" msgid "" "Filament to print support base and raft.\n" -"\"Default\" means no specific filament for support and current filament is " -"used." -msgstr "" -"เส้นพลาสติกพิมพ์ฐานรองรับและฐานรองชิ้นงาน \"ค่าเริ่มต้น\" " -"หมายถึงไม่มีการใช้เส้นพลาสติกเฉพาะเพื่อรองรับและใช้เส้นพลาสติกปัจจุบัน" +"\"Default\" means no specific filament for support and current filament is used." +msgstr "เส้นพลาสติกพิมพ์ฐานรองรับและฐานรองชิ้นงาน \"ค่าเริ่มต้น\" หมายถึงไม่มีการใช้เส้นพลาสติกเฉพาะเพื่อรองรับและใช้เส้นพลาสติกปัจจุบัน" msgid "Avoid interface filament for base" msgstr "หลีกเลี่ยงเส้นพลาสติกอินเทอร์เฟซสำหรับฐาน" -msgid "" -"Avoid using support interface filament to print support base if possible." +msgid "Avoid using support interface filament to print support base if possible." msgstr "หลีกเลี่ยงการใช้เส้นพลาสติกส่วนต่อประสานเพื่อพิมพ์ฐานรองรับหากเป็นไปได้" -msgid "" -"Line width of support. If expressed as a %, it will be computed over the " -"nozzle diameter." +msgid "Line width of support. If expressed as a %, it will be computed over the nozzle diameter." msgstr "ความกว้างของเส้นรองรับ หากแสดงเป็น % จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" msgid "Loop pattern interface" msgstr "รูปแบบการใช้อินเทอร์เฟซแบบวนซ้ำ" -msgid "" -"This covers the top contact layer of the supports with loops. It is disabled " -"by default." +msgid "This covers the top contact layer of the supports with loops. It is disabled by default." msgstr "ครอบคลุมชั้นสัมผัสด้านบนของส่วนรองรับด้วยลูป ปิดใช้งานตามค่าเริ่มต้น" msgid "Support/raft interface" @@ -17765,11 +14919,8 @@ msgstr "ส่วนต่อประสานส่วนรองรับ / msgid "" "Filament to print support interface.\n" -"\"Default\" means no specific filament for support interface and current " -"filament is used." -msgstr "" -"เส้นพลาสติกสำหรับพิมพ์ส่วนต่อประสานส่วนรองรับ \"ค่าเริ่มต้น\" " -"หมายความว่าไม่มีการใช้ฟิลาเมนต์เฉพาะสำหรับอินเทอร์เฟซรองรับและมีการใช้ฟิลาเมนต์ปัจจุบัน" +"\"Default\" means no specific filament for support interface and current filament is used." +msgstr "เส้นพลาสติกสำหรับพิมพ์ส่วนต่อประสานส่วนรองรับ \"ค่าเริ่มต้น\" หมายความว่าไม่มีการใช้ฟิลาเมนต์เฉพาะสำหรับอินเทอร์เฟซรองรับและมีการใช้ฟิลาเมนต์ปัจจุบัน" msgid "Top interface layers" msgstr "เลเยอร์อินเทอร์เฟซบนสุด" @@ -17811,22 +14962,15 @@ msgstr "รูปแบบฐาน" msgid "" "Line pattern of support.\n" "\n" -"The Default option for Tree supports is Hollow, which means no base pattern. " -"For other support types, the Default option is the Rectilinear pattern.\n" +"The Default option for Tree supports is Hollow, which means no base pattern. For other support types, the Default option is the Rectilinear pattern.\n" "\n" -"NOTE: For Organic supports, the two walls are supported only with the Hollow/" -"Default base pattern. The Lightning base pattern is supported only by Tree " -"Slim/Strong/Hybrid supports. For the other support types, the Rectilinear " -"will be used instead of Lightning." +"NOTE: For Organic supports, the two walls are supported only with the Hollow/Default base pattern. The Lightning base pattern is supported only by Tree Slim/Strong/Hybrid supports. For the other support types, the Rectilinear will be used instead of Lightning." msgstr "" "รูปแบบเส้นของส่วนรองรับ\n" "\n" -"ตัวเลือกเริ่มต้นสำหรับส่วนรองรับ Tree คือ Hollow ซึ่งหมายความว่าไม่มีรูปแบบพื้นฐาน " -"สำหรับส่วนรองรับประเภทอื่นๆ ตัวเลือกเริ่มต้นคือรูปแบบเส้นตรง\n" +"ตัวเลือกเริ่มต้นสำหรับส่วนรองรับ Tree คือ Hollow ซึ่งหมายความว่าไม่มีรูปแบบพื้นฐาน สำหรับส่วนรองรับประเภทอื่นๆ ตัวเลือกเริ่มต้นคือรูปแบบเส้นตรง\n" "\n" -"หมายเหตุ: สำหรับส่วนรองรับทั่วไป ผนังทั้งสองได้รับการรองรับเฉพาะรูปแบบฐานกลวง/" -"ค่าเริ่มต้นเท่านั้น รูปแบบฐาน Lightning รองรับเฉพาะ Tree Slim/Strong/Hybrid เท่านั้น " -"สำหรับส่วนรองรับประเภทอื่นๆ Rectilinear จะถูกใช้แทน Lightning" +"หมายเหตุ: สำหรับส่วนรองรับทั่วไป ผนังทั้งสองได้รับการรองรับเฉพาะรูปแบบฐานกลวง/ค่าเริ่มต้นเท่านั้น รูปแบบฐาน Lightning รองรับเฉพาะ Tree Slim/Strong/Hybrid เท่านั้น สำหรับส่วนรองรับประเภทอื่นๆ Rectilinear จะถูกใช้แทน Lightning" msgid "Rectilinear grid" msgstr "ตารางเป็นเส้นตรง" @@ -17837,13 +14981,8 @@ msgstr "กลวง" msgid "Interface pattern" msgstr "รูปแบบอินเทอร์เฟซ" -msgid "" -"This is the line pattern for support interfaces. The default pattern for non-" -"soluble support interfaces is Rectilinear while the default pattern for " -"soluble support interfaces is Concentric." -msgstr "" -"รูปแบบเส้นของอินเทอร์เฟซส่วนรองรับ รูปแบบเริ่มต้นสำหรับอินเทอร์เฟซส่วนรองรับที่ไม่ละลายน้ำคือ " -"Rectilinear ในขณะที่รูปแบบเริ่มต้นสำหรับอินเทอร์เฟซส่วนรองรับที่ละลายน้ำได้คือ Concentric" +msgid "This is the line pattern for support interfaces. The default pattern for non-soluble support interfaces is Rectilinear while the default pattern for soluble support interfaces is Concentric." +msgstr "รูปแบบเส้นของอินเทอร์เฟซส่วนรองรับ รูปแบบเริ่มต้นสำหรับอินเทอร์เฟซส่วนรองรับที่ไม่ละลายน้ำคือ Rectilinear ในขณะที่รูปแบบเริ่มต้นสำหรับอินเทอร์เฟซส่วนรองรับที่ละลายน้ำได้คือ Concentric" msgid "Rectilinear Interlaced" msgstr "เป็นเส้นตรงอินเทอร์เลซ" @@ -17864,20 +15003,11 @@ msgid "This is the speed for support." msgstr "ความเร็วของส่วนรองรับ" msgid "" -"Style and shape of the support. For normal support, projecting the supports " -"into a regular grid will create more stable supports (default), while snug " -"support towers will save material and reduce object scarring.\n" -"For tree support, slim and organic style will merge branches more " -"aggressively and save a lot of material (default organic), while hybrid " -"style will create similar structure to normal support under large flat " -"overhangs." +"Style and shape of the support. For normal support, projecting the supports into a regular grid will create more stable supports (default), while snug support towers will save material and reduce object scarring.\n" +"For tree support, slim and organic style will merge branches more aggressively and save a lot of material (default organic), while hybrid style will create similar structure to normal support under large flat overhangs." msgstr "" -"สไตล์และรูปทรงของส่วนรองรับ สำหรับการรองรับตามปกติ " -"การฉายส่วนรองรับลงในตารางปกติจะสร้างการรองรับที่มีความเสถียรมากขึ้น (ค่าเริ่มต้น) " -"ในขณะที่เสารองรับที่สบายจะช่วยประหยัดวัสดุและลดการเกิดแผลเป็นของวัตถุ\n" -"สำหรับการรองรับแบบต้นไม้ รูปแบบที่เพรียวบางและออร์แกนิกจะผสานกิ่งก้านเข้าด้วยกันอย่างดุดันยิ่งขึ้น " -"และประหยัดวัสดุได้มาก (ค่าเริ่มต้นแบบออร์แกนิก) " -"ในขณะที่รูปแบบไฮบริดจะสร้างโครงสร้างที่คล้ายกันกับการรองรับปกติภายใต้ส่วนยื่นแบนขนาดใหญ่" +"สไตล์และรูปทรงของส่วนรองรับ สำหรับการรองรับตามปกติ การฉายส่วนรองรับลงในตารางปกติจะสร้างการรองรับที่มีความเสถียรมากขึ้น (ค่าเริ่มต้น) ในขณะที่เสารองรับที่สบายจะช่วยประหยัดวัสดุและลดการเกิดแผลเป็นของวัตถุ\n" +"สำหรับการรองรับแบบต้นไม้ รูปแบบที่เพรียวบางและออร์แกนิกจะผสานกิ่งก้านเข้าด้วยกันอย่างดุดันยิ่งขึ้น และประหยัดวัสดุได้มาก (ค่าเริ่มต้นแบบออร์แกนิก) ในขณะที่รูปแบบไฮบริดจะสร้างโครงสร้างที่คล้ายกันกับการรองรับปกติภายใต้ส่วนยื่นแบนขนาดใหญ่" msgid "Default (Grid/Organic)" msgstr "ค่าเริ่มต้น (กริด/ออร์แกนิก)" @@ -17900,92 +15030,55 @@ msgstr "ต้นไม้ไฮบริด" msgid "Independent support layer height" msgstr "ความสูงของชั้นรองรับอิสระ" -msgid "" -"Support layer uses layer height independent with object layer. This is to " -"support customizing Z-gap and save print time. This option will be invalid " -"when the prime tower is enabled." -msgstr "" -"เลเยอร์ส่วนรองรับใช้ความสูงของเลเยอร์ที่เป็นอิสระจากเลเยอร์วัตถุ เพื่อรองรับการปรับแต่ง Z-gap " -"และประหยัดเวลาในการพิมพ์ ตัวเลือกนี้จะไม่ถูกต้องเมื่อเปิดใช้งานไพรม์ทาวเวอร์" +msgid "Support layer uses layer height independent with object layer. This is to support customizing Z-gap and save print time. This option will be invalid when the prime tower is enabled." +msgstr "เลเยอร์ส่วนรองรับใช้ความสูงของเลเยอร์ที่เป็นอิสระจากเลเยอร์วัตถุ เพื่อรองรับการปรับแต่ง Z-gap และประหยัดเวลาในการพิมพ์ ตัวเลือกนี้จะไม่ถูกต้องเมื่อเปิดใช้งานไพรม์ทาวเวอร์" msgid "Threshold angle" msgstr "มุมเกณฑ์" msgid "" -"Support will be generated for overhangs whose slope angle is below the " -"threshold. The smaller this value is, the steeper the overhang that can be " -"printed without support.\n" -"Note: If set to 0, normal supports use the Threshold overlap instead, while " -"tree supports fall back to a default value of 30." +"Support will be generated for overhangs whose slope angle is below the threshold. The smaller this value is, the steeper the overhang that can be printed without support.\n" +"Note: If set to 0, normal supports use the Threshold overlap instead, while tree supports fall back to a default value of 30." msgstr "" -"ส่วนรองรับจะถูกสร้างขึ้นสำหรับส่วนยื่นที่มีมุมลาดต่ำกว่าเกณฑ์ ยิ่งค่านี้น้อยลง " -"ระยะยื่นที่สามารถพิมพ์โดยไม่ต้องรองรับก็จะยิ่งชันมากขึ้น\n" -"หมายเหตุ: หากตั้งค่าเป็น 0 ส่วนรองรับปกติจะใช้ Threshold ทับซ้อนกันแทน " -"ในขณะที่ส่วนรองรับแบบทรีถอยกลับไปเป็นค่าเริ่มต้นที่ 30" +"ส่วนรองรับจะถูกสร้างขึ้นสำหรับส่วนยื่นที่มีมุมลาดต่ำกว่าเกณฑ์ ยิ่งค่านี้น้อยลง ระยะยื่นที่สามารถพิมพ์โดยไม่ต้องรองรับก็จะยิ่งชันมากขึ้น\n" +"หมายเหตุ: หากตั้งค่าเป็น 0 ส่วนรองรับปกติจะใช้ Threshold ทับซ้อนกันแทน ในขณะที่ส่วนรองรับแบบทรีถอยกลับไปเป็นค่าเริ่มต้นที่ 30" msgid "Threshold overlap" msgstr "การทับซ้อนกันของเกณฑ์" -msgid "" -"If threshold angle is zero, support will be generated for overhangs whose " -"overlap is below the threshold. The smaller this value is, the steeper the " -"overhang that can be printed without support." -msgstr "" -"หากมุมเกณฑ์เป็นศูนย์ ระบบจะสร้างส่วนรองรับสำหรับส่วนยื่นที่มีการทับซ้อนกันต่ำกว่าเกณฑ์ ยิ่งค่านี้น้อยลง " -"ระยะยื่นที่สามารถพิมพ์โดยไม่ต้องรองรับก็จะยิ่งชันมากขึ้น" +msgid "If threshold angle is zero, support will be generated for overhangs whose overlap is below the threshold. The smaller this value is, the steeper the overhang that can be printed without support." +msgstr "หากมุมเกณฑ์เป็นศูนย์ ระบบจะสร้างส่วนรองรับสำหรับส่วนยื่นที่มีการทับซ้อนกันต่ำกว่าเกณฑ์ ยิ่งค่านี้น้อยลง ระยะยื่นที่สามารถพิมพ์โดยไม่ต้องรองรับก็จะยิ่งชันมากขึ้น" msgid "Tree support branch angle" msgstr "มุมกิ่งกิ่งรองรับต้นไม้" -msgid "" -"This setting determines the maximum overhang angle that the branches of tree " -"support are allowed to make. If the angle is increased, the branches can be " -"printed more horizontally, allowing them to reach farther." -msgstr "" -"การตั้งค่านี้จะกำหนดมุมยื่นสูงสุดที่อนุญาตให้กิ่งก้านของต้นไม้รองรับได้ หากมุมเพิ่มขึ้น " -"กิ่งก้านสามารถพิมพ์ในแนวนอนได้มากขึ้น เพื่อให้สามารถขยายได้ไกลขึ้น" +msgid "This setting determines the maximum overhang angle that the branches of tree support are allowed to make. If the angle is increased, the branches can be printed more horizontally, allowing them to reach farther." +msgstr "การตั้งค่านี้จะกำหนดมุมยื่นสูงสุดที่อนุญาตให้กิ่งก้านของต้นไม้รองรับได้ หากมุมเพิ่มขึ้น กิ่งก้านสามารถพิมพ์ในแนวนอนได้มากขึ้น เพื่อให้สามารถขยายได้ไกลขึ้น" msgid "Preferred Branch Angle" msgstr "มุมสาขาที่ต้องการ" #. TRN PrintSettings: "Organic supports" > "Preferred Branch Angle" -msgid "" -"The preferred angle of the branches, when they do not have to avoid the " -"model. Use a lower angle to make them more vertical and more stable. Use a " -"higher angle for branches to merge faster." -msgstr "" -"มุมที่ต้องการของกิ่งก้านเมื่อไม่จำเป็นต้องหลีกเลี่ยงโมเดล " -"ใช้มุมที่ต่ำกว่าเพื่อทำให้เป็นแนวตั้งมากขึ้นและมั่นคงยิ่งขึ้น ใช้มุมที่สูงขึ้นเพื่อให้กิ่งก้านผสานเร็วขึ้น" +msgid "The preferred angle of the branches, when they do not have to avoid the model. Use a lower angle to make them more vertical and more stable. Use a higher angle for branches to merge faster." +msgstr "มุมที่ต้องการของกิ่งก้านเมื่อไม่จำเป็นต้องหลีกเลี่ยงโมเดล ใช้มุมที่ต่ำกว่าเพื่อทำให้เป็นแนวตั้งมากขึ้นและมั่นคงยิ่งขึ้น ใช้มุมที่สูงขึ้นเพื่อให้กิ่งก้านผสานเร็วขึ้น" msgid "Tree support branch distance" msgstr "ต้นไม้รองรับระยะห่างกิ่งก้าน" -msgid "" -"This setting determines the distance between neighboring tree support nodes." +msgid "This setting determines the distance between neighboring tree support nodes." msgstr "การตั้งค่านี้กำหนดระยะห่างระหว่างโหนดส่วนรองรับทรีที่อยู่ใกล้เคียง" msgid "Branch Density" msgstr "ความหนาแน่นของสาขา" #. TRN PrintSettings: "Organic supports" > "Branch Density" -msgid "" -"Adjusts the density of the support structure used to generate the tips of " -"the branches. A higher value results in better overhangs but the supports " -"are harder to remove, thus it is recommended to enable top support " -"interfaces instead of a high branch density value if dense interfaces are " -"needed." -msgstr "" -"ปรับความหนาแน่นของโครงสร้างรองรับที่ใช้สร้างส่วนปลายของกิ่งก้าน " -"ค่าที่สูงกว่าส่งผลให้มีระยะยื่นที่ดีกว่า แต่ส่วนรองรับจะถอดออกได้ยาก " -"ดังนั้นจึงแนะนำให้เปิดใช้งานอินเทอร์เฟซส่วนรองรับด้านบนแทนค่าความหนาแน่นของสาขาที่สูง " -"หากจำเป็นต้องใช้อินเทอร์เฟซที่หนาแน่น" +msgid "Adjusts the density of the support structure used to generate the tips of the branches. A higher value results in better overhangs but the supports are harder to remove, thus it is recommended to enable top support interfaces instead of a high branch density value if dense interfaces are needed." +msgstr "ปรับความหนาแน่นของโครงสร้างรองรับที่ใช้สร้างส่วนปลายของกิ่งก้าน ค่าที่สูงกว่าส่งผลให้มีระยะยื่นที่ดีกว่า แต่ส่วนรองรับจะถอดออกได้ยาก ดังนั้นจึงแนะนำให้เปิดใช้งานอินเทอร์เฟซส่วนรองรับด้านบนแทนค่าความหนาแน่นของสาขาที่สูง หากจำเป็นต้องใช้อินเทอร์เฟซที่หนาแน่น" msgid "Auto brim width" msgstr "ความกว้างขอบยึดชิ้นงานอัตโนมัติ" -msgid "" -"Enabling this option means the width of the brim for tree support will be " -"automatically calculated." +msgid "Enabling this option means the width of the brim for tree support will be automatically calculated." msgstr "การเปิดใช้งานตัวเลือกนี้หมายความว่าความกว้างของขอบเพื่อรองรับต้นไม้จะถูกคำนวณโดยอัตโนมัติ" msgid "Tree support brim width" @@ -18012,44 +15105,26 @@ msgid "Branch Diameter Angle" msgstr "มุมเส้นผ่านศูนย์กลางสาขา" #. TRN PrintSettings: "Organic supports" > "Branch Diameter Angle" -msgid "" -"The angle of the branches' diameter as they gradually become thicker towards " -"the bottom. An angle of 0 will cause the branches to have uniform thickness " -"over their length. A bit of an angle can increase stability of the organic " -"support." -msgstr "" -"มุมของเส้นผ่านศูนย์กลางกิ่งจะค่อยๆหนาขึ้นจนถึงด้านล่าง มุม 0 " -"จะทำให้กิ่งมีความหนาสม่ำเสมอตลอดความยาว " -"มุมเล็กน้อยสามารถเพิ่มความเสถียรของส่วนรองรับแบบออร์แกนิกได้" +msgid "The angle of the branches' diameter as they gradually become thicker towards the bottom. An angle of 0 will cause the branches to have uniform thickness over their length. A bit of an angle can increase stability of the organic support." +msgstr "มุมของเส้นผ่านศูนย์กลางกิ่งจะค่อยๆหนาขึ้นจนถึงด้านล่าง มุม 0 จะทำให้กิ่งมีความหนาสม่ำเสมอตลอดความยาว มุมเล็กน้อยสามารถเพิ่มความเสถียรของส่วนรองรับแบบออร์แกนิกได้" msgid "Support wall loops" msgstr "รองรับห่วงติดผนัง" -msgid "" -"This setting specifies the count of support walls in the range of [0,2]. 0 " -"means auto." +msgid "This setting specifies the count of support walls in the range of [0,2]. 0 means auto." msgstr "การตั้งค่านี้ระบุจำนวนผนังรองรับในช่วง [0,2] 0 หมายถึงอัตโนมัติ" msgid "Tree support with infill" msgstr "ส่วนรองรับต้นไม้พร้อมไส้ใน" -msgid "" -"This setting specifies whether to add infill inside large hollows of tree " -"support." +msgid "This setting specifies whether to add infill inside large hollows of tree support." msgstr "การตั้งค่านี้ระบุว่าจะเพิ่มไส้ในภายในโพรงต้นไม้ขนาดใหญ่หรือไม่" msgid "Ironing Support Interface" msgstr "อินเทอร์เฟซรองรับการรีดผิว" -msgid "" -"Ironing is using small flow to print on same height of support interface " -"again to make it more smooth. This setting controls whether support " -"interface being ironed. When enabled, support interface will be extruded as " -"solid too." -msgstr "" -"การรีดผิวใช้การไหลเพียงเล็กน้อยเพื่อพิมพ์บนส่วนรองรับที่มีความสูงเท่ากันอีกครั้งเพื่อให้เรียบยิ่งขึ้น " -"การตั้งค่านี้ควบคุมว่าจะรีดอินเทอร์เฟซส่วนรองรับหรือไม่ เมื่อเปิดใช้งาน " -"อินเทอร์เฟซส่วนรองรับจะถูกอัดออกมาเป็นของแข็งเช่นกัน" +msgid "Ironing is using small flow to print on same height of support interface again to make it more smooth. This setting controls whether support interface being ironed. When enabled, support interface will be extruded as solid too." +msgstr "การรีดผิวใช้การไหลเพียงเล็กน้อยเพื่อพิมพ์บนส่วนรองรับที่มีความสูงเท่ากันอีกครั้งเพื่อให้เรียบยิ่งขึ้น การตั้งค่านี้ควบคุมว่าจะรีดอินเทอร์เฟซส่วนรองรับหรือไม่ เมื่อเปิดใช้งาน อินเทอร์เฟซส่วนรองรับจะถูกอัดออกมาเป็นของแข็งเช่นกัน" msgid "Support Ironing Pattern" msgstr "รองรับรูปแบบการรีดผิว" @@ -18057,14 +15132,8 @@ msgstr "รองรับรูปแบบการรีดผิว" msgid "Support Ironing flow" msgstr "รองรับกระแสการรีด" -msgid "" -"The amount of material to extrude during ironing. Relative to flow of normal " -"support interface layer height. Too high value results in overextrusion on " -"the surface." -msgstr "" -"ปริมาณวัสดุที่จะพ่นออกมาระหว่างรีดผิว " -"สัมพันธ์กับโฟลว์ของความสูงของเลเยอร์อินเทอร์เฟซส่วนรองรับปกติ " -"ค่าที่สูงเกินไปส่งผลให้เกิดการอัดขึ้นรูปมากเกินไปบนพื้นผิว" +msgid "The amount of material to extrude during ironing. Relative to flow of normal support interface layer height. Too high value results in overextrusion on the surface." +msgstr "ปริมาณวัสดุที่จะพ่นออกมาระหว่างรีดผิว สัมพันธ์กับโฟลว์ของความสูงของเลเยอร์อินเทอร์เฟซส่วนรองรับปกติ ค่าที่สูงเกินไปส่งผลให้เกิดการอัดขึ้นรูปมากเกินไปบนพื้นผิว" msgid "Support Ironing line spacing" msgstr "รองรับระยะห่างระหว่างสายรีดผิว" @@ -18073,62 +15142,31 @@ msgid "Activate temperature control" msgstr "เปิดใช้งานการควบคุมอุณหภูมิ" msgid "" -"Enable this option for automated chamber temperature control. This option " -"activates the emitting of an M191 command before the \"machine_start_gcode" -"\"\n" -" which sets the chamber temperature and waits until it is reached. In " -"addition, it emits an M141 command at the end of the print to turn off the " -"chamber heater, if present.\n" +"Enable this option for automated chamber temperature control. This option activates the emitting of an M191 command before the \"machine_start_gcode\"\n" +" which sets the chamber temperature and waits until it is reached. In addition, it emits an M141 command at the end of the print to turn off the chamber heater, if present.\n" "\n" -"This option relies on the firmware supporting the M191 and M141 commands " -"either via macros or natively and is usually used when an active chamber " -"heater is installed." +"This option relies on the firmware supporting the M191 and M141 commands either via macros or natively and is usually used when an active chamber heater is installed." msgstr "" -"เปิดใช้งานตัวเลือกนี้สำหรับการควบคุมอุณหภูมิห้องอัตโนมัติ ตัวเลือกนี้จะเปิดใช้งานการส่งคำสั่ง M191 " -"ก่อน \"machine_start_gcode\"\n" -" ซึ่งจะตั้งอุณหภูมิห้องอบและรอจนกว่าจะถึงอุณหภูมิห้อง นอกจากนี้ ยังส่งคำสั่ง M141 " -"เมื่อสิ้นสุดการพิมพ์เพื่อปิดเครื่องทำความร้อนในห้อง (หากมี)\n" +"เปิดใช้งานตัวเลือกนี้สำหรับการควบคุมอุณหภูมิห้องอัตโนมัติ ตัวเลือกนี้จะเปิดใช้งานการส่งคำสั่ง M191 ก่อน \"machine_start_gcode\"\n" +" ซึ่งจะตั้งอุณหภูมิห้องอบและรอจนกว่าจะถึงอุณหภูมิห้อง นอกจากนี้ ยังส่งคำสั่ง M141 เมื่อสิ้นสุดการพิมพ์เพื่อปิดเครื่องทำความร้อนในห้อง (หากมี)\n" "\n" -"ตัวเลือกนี้ขึ้นอยู่กับเฟิร์มแวร์ที่รองรับคำสั่ง M191 และ M141 ไม่ว่าจะผ่านทางมาโครหรือแบบเนทิฟ " -"และโดยปกติจะใช้เมื่อมีการติดตั้งเครื่องทำความร้อนในห้องแบบแอคทีฟ" +"ตัวเลือกนี้ขึ้นอยู่กับเฟิร์มแวร์ที่รองรับคำสั่ง M191 และ M141 ไม่ว่าจะผ่านทางมาโครหรือแบบเนทิฟ และโดยปกติจะใช้เมื่อมีการติดตั้งเครื่องทำความร้อนในห้องแบบแอคทีฟ" msgid "Chamber temperature" msgstr "อุณหภูมิห้องพิมพ์" msgid "" -"For high-temperature materials like ABS, ASA, PC, and PA, a higher chamber " -"temperature can help suppress or reduce warping and potentially lead to " -"higher interlayer bonding strength. However, at the same time, a higher " -"chamber temperature will reduce the efficiency of air filtration for ABS and " -"ASA.\n" +"For high-temperature materials like ABS, ASA, PC, and PA, a higher chamber temperature can help suppress or reduce warping and potentially lead to higher interlayer bonding strength. However, at the same time, a higher chamber temperature will reduce the efficiency of air filtration for ABS and ASA.\n" "\n" -"For PLA, PETG, TPU, PVA, and other low-temperature materials, this option " -"should be disabled (set to 0) as the chamber temperature should be low to " -"avoid extruder clogging caused by material softening at the heat break.\n" +"For PLA, PETG, TPU, PVA, and other low-temperature materials, this option should be disabled (set to 0) as the chamber temperature should be low to avoid extruder clogging caused by material softening at the heat break.\n" "\n" -"If enabled, this parameter also sets a G-code variable named " -"chamber_temperature, which can be used to pass the desired chamber " -"temperature to your print start macro, or a heat soak macro like this: " -"PRINT_START (other variables) CHAMBER_TEMP=[chamber_temperature]. This may " -"be useful if your printer does not support M141/M191 commands, or if you " -"desire to handle heat soaking in the print start macro if no active chamber " -"heater is installed." +"If enabled, this parameter also sets a G-code variable named chamber_temperature, which can be used to pass the desired chamber temperature to your print start macro, or a heat soak macro like this: PRINT_START (other variables) CHAMBER_TEMP=[chamber_temperature]. This may be useful if your printer does not support M141/M191 commands, or if you desire to handle heat soaking in the print start macro if no active chamber heater is installed." msgstr "" -"สำหรับวัสดุที่มีอุณหภูมิสูง เช่น ABS, ASA, PC และ PA " -"อุณหภูมิห้องที่สูงขึ้นสามารถช่วยลดหรือลดการบิดงอ " -"และอาจนำไปสู่ความแข็งแรงการยึดเกาะระหว่างชั้นที่สูงขึ้น อย่างไรก็ตาม ในเวลาเดียวกัน " -"อุณหภูมิห้องที่สูงขึ้นจะลดประสิทธิภาพการกรองอากาศสำหรับ ABS และ ASA\n" +"สำหรับวัสดุที่มีอุณหภูมิสูง เช่น ABS, ASA, PC และ PA อุณหภูมิห้องที่สูงขึ้นสามารถช่วยลดหรือลดการบิดงอ และอาจนำไปสู่ความแข็งแรงการยึดเกาะระหว่างชั้นที่สูงขึ้น อย่างไรก็ตาม ในเวลาเดียวกัน อุณหภูมิห้องที่สูงขึ้นจะลดประสิทธิภาพการกรองอากาศสำหรับ ABS และ ASA\n" "\n" -"สำหรับ PLA, PETG, TPU, PVA และวัสดุที่มีอุณหภูมิต่ำอื่นๆ ควรปิดใช้งานตัวเลือกนี้ (ตั้งค่าเป็น 0) " -"เนื่องจากอุณหภูมิห้องควรต่ำเพื่อหลีกเลี่ยงการอุดตันของชุดดันเส้นที่เกิดจากวัสดุอ่อนตัวเมื่อความร้อนแตก\n" +"สำหรับ PLA, PETG, TPU, PVA และวัสดุที่มีอุณหภูมิต่ำอื่นๆ ควรปิดใช้งานตัวเลือกนี้ (ตั้งค่าเป็น 0) เนื่องจากอุณหภูมิห้องควรต่ำเพื่อหลีกเลี่ยงการอุดตันของชุดดันเส้นที่เกิดจากวัสดุอ่อนตัวเมื่อความร้อนแตก\n" "\n" -"หากเปิดใช้งาน พารามิเตอร์นี้จะตั้งค่าตัวแปร G-code ชื่อ Chamber_temperature " -"ซึ่งสามารถใช้เพื่อส่งอุณหภูมิห้องเพาะเลี้ยงที่ต้องการไปยังมาโครเริ่มการพิมพ์ของคุณ " -"หรือมาโครความร้อนแช่เช่นนี้: PRINT_START (ตัวแปรอื่นๆ) " -"CHAMBER_TEMP=[chamber_temperature] " -"วิธีนี้อาจเป็นประโยชน์หากเครื่องพิมพ์ของคุณไม่รองรับคำสั่ง M141/M191 " -"หรือหากคุณต้องการจัดการกับความร้อนที่แช่อยู่ในมาโครเริ่มการพิมพ์ " -"หากไม่มีการติดตั้งเครื่องทำความร้อนในห้องที่ใช้งานอยู่" +"หากเปิดใช้งาน พารามิเตอร์นี้จะตั้งค่าตัวแปร G-code ชื่อ Chamber_temperature ซึ่งสามารถใช้เพื่อส่งอุณหภูมิห้องเพาะเลี้ยงที่ต้องการไปยังมาโครเริ่มการพิมพ์ของคุณ หรือมาโครความร้อนแช่เช่นนี้: PRINT_START (ตัวแปรอื่นๆ) CHAMBER_TEMP=[chamber_temperature] วิธีนี้อาจเป็นประโยชน์หากเครื่องพิมพ์ของคุณไม่รองรับคำสั่ง M141/M191 หรือหากคุณต้องการจัดการกับความร้อนที่แช่อยู่ในมาโครเริ่มการพิมพ์ หากไม่มีการติดตั้งเครื่องทำความร้อนในห้องที่ใช้งานอยู่" msgid "Nozzle temperature after the first layer" msgstr "อุณหภูมิหัวฉีดสำหรับชั้นหลังจากอันแรก" @@ -18136,18 +15174,11 @@ msgstr "อุณหภูมิหัวฉีดสำหรับชั้น msgid "Detect thin walls" msgstr "ตรวจจับผนังบาง" -msgid "" -"This detects thin walls which can’t contain two lines and uses a single line " -"to print. It may not print as well because it’s not a closed loop." -msgstr "" -"ตรวจจับผนังบางๆ ที่ไม่สามารถมีความกว้างสองบรรทัดได้ และใช้บรรทัดเดียวในการพิมพ์ " -"อาจจะพิมพ์ได้ไม่ดีนักเพราะไม่ใช่วงปิด" +msgid "This detects thin walls which can’t contain two lines and uses a single line to print. It may not print as well because it’s not a closed loop." +msgstr "ตรวจจับผนังบางๆ ที่ไม่สามารถมีความกว้างสองบรรทัดได้ และใช้บรรทัดเดียวในการพิมพ์ อาจจะพิมพ์ได้ไม่ดีนักเพราะไม่ใช่วงปิด" -msgid "" -"This G-code is inserted when filament is changed, including T commands to " -"trigger tool change." -msgstr "" -"รหัส G นี้จะถูกแทรกเมื่อมีการเปลี่ยนเส้นพลาสติก รวมถึงคำสั่ง T เพื่อกระตุ้นการเปลี่ยนเครื่องมือ" +msgid "This G-code is inserted when filament is changed, including T commands to trigger tool change." +msgstr "รหัส G นี้จะถูกแทรกเมื่อมีการเปลี่ยนเส้นพลาสติก รวมถึงคำสั่ง T เพื่อกระตุ้นการเปลี่ยนเครื่องมือ" msgid "This G-code is inserted when the extrusion role is changed." msgstr "G-code นี้จะถูกแทรกเมื่อบทบาทการอัดขึ้นรูปมีการเปลี่ยนแปลง" @@ -18155,16 +15186,11 @@ msgstr "G-code นี้จะถูกแทรกเมื่อบทบา msgid "Change extrusion role G-code (filament)" msgstr "เปลี่ยนบทบาทการอัดขึ้นรูป G-code (เส้นพลาสติก)" -msgid "" -"This G-code is inserted when the extrusion role is changed for the active " -"filament." +msgid "This G-code is inserted when the extrusion role is changed for the active filament." msgstr "รหัส G นี้จะถูกแทรกเมื่อมีการเปลี่ยนบทบาทการอัดขึ้นรูปสำหรับเส้นพลาสติกที่ใช้งานอยู่" -msgid "" -"Line width for top surfaces. If expressed as a %, it will be computed over " -"the nozzle diameter." -msgstr "" -"ความกว้างของเส้นสำหรับพื้นผิวด้านบน หากแสดงเป็น % จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" +msgid "Line width for top surfaces. If expressed as a %, it will be computed over the nozzle diameter." +msgstr "ความกว้างของเส้นสำหรับพื้นผิวด้านบน หากแสดงเป็น % จะคำนวณตามเส้นผ่านศูนย์กลางของหัวฉีด" msgid "This is the speed for solid top surface infill." msgstr "ความเร็วของไส้ในพื้นผิวด้านบนซึ่งเป็นของแข็ง" @@ -18172,54 +15198,29 @@ msgstr "ความเร็วของไส้ในพื้นผิวด msgid "Top shell layers" msgstr "เลเยอร์ผนังด้านบน" -msgid "" -"This is the number of solid layers of top shell, including the top surface " -"layer. When the thickness calculated by this value is thinner than the top " -"shell thickness, the top shell layers will be increased" -msgstr "" -"นี่คือจำนวนชั้นทึบของเปลือกด้านบน รวมถึงชั้นผิวด้านบนด้วย " -"เมื่อความหนาที่คำนวณโดยค่านี้บางกว่าความหนาของเปลือกด้านบน ชั้นเปลือกด้านบนจะเพิ่มขึ้น" +msgid "This is the number of solid layers of top shell, including the top surface layer. When the thickness calculated by this value is thinner than the top shell thickness, the top shell layers will be increased" +msgstr "นี่คือจำนวนชั้นทึบของเปลือกด้านบน รวมถึงชั้นผิวด้านบนด้วย เมื่อความหนาที่คำนวณโดยค่านี้บางกว่าความหนาของเปลือกด้านบน ชั้นเปลือกด้านบนจะเพิ่มขึ้น" msgid "Top shell thickness" msgstr "ความหนาผนังด้านบน" -msgid "" -"The number of top solid layers is increased when slicing if the thickness " -"calculated by top shell layers is thinner than this value. This can avoid " -"having too thin a shell when layer height is small. 0 means that this " -"setting is disabled and thickness of top shell is determined simply by the " -"number of top shell layers." -msgstr "" -"จำนวนชั้นทึบด้านบนจะเพิ่มขึ้นเมื่อสไลซ์หากความหนาที่คำนวณโดยชั้นเปลือกด้านบนบางกว่าค่านี้ " -"วิธีนี้สามารถหลีกเลี่ยงไม่ให้เปลือกบางเกินไปเมื่อชั้นมีความสูงน้อย 0 " -"หมายความว่าการตั้งค่านี้ถูกปิดใช้งาน " -"และความหนาของเปลือกด้านบนถูกกำหนดโดยชั้นเปลือกด้านบนอย่างแน่นอน" +msgid "The number of top solid layers is increased when slicing if the thickness calculated by top shell layers is thinner than this value. This can avoid having too thin a shell when layer height is small. 0 means that this setting is disabled and thickness of top shell is determined simply by the number of top shell layers." +msgstr "จำนวนชั้นทึบด้านบนจะเพิ่มขึ้นเมื่อสไลซ์หากความหนาที่คำนวณโดยชั้นเปลือกด้านบนบางกว่าค่านี้ วิธีนี้สามารถหลีกเลี่ยงไม่ให้เปลือกบางเกินไปเมื่อชั้นมีความสูงน้อย 0 หมายความว่าการตั้งค่านี้ถูกปิดใช้งาน และความหนาของเปลือกด้านบนถูกกำหนดโดยชั้นเปลือกด้านบนอย่างแน่นอน" msgid "Top surface density" msgstr "ความหนาแน่นผิวด้านบน" -msgid "" -"Density of top surface layer. A value of 100% creates a fully solid, smooth " -"top layer. Reducing this value results in a textured top surface, according " -"to the chosen top surface pattern. A value of 0% will result in only the " -"walls on the top layer being created. Intended for aesthetic or functional " -"purposes, not to fix issues such as over-extrusion." -msgstr "" -"ความหนาแน่นของชั้นผิวด้านบน ค่า 100% จะสร้างชั้นบนสุดที่เรียบและแข็งเต็มที่ " -"การลดค่านี้ส่งผลให้พื้นผิวด้านบนมีพื้นผิวตามรูปแบบพื้นผิวด้านบนที่เลือก ค่า 0% " -"จะส่งผลให้มีการสร้างเฉพาะผนังชั้นบนสุดเท่านั้น มีวัตถุประสงค์เพื่อความสวยงามหรือการใช้งาน " -"ไม่ใช่เพื่อแก้ไขปัญหา เช่น การอัดขึ้นรูปมากเกินไป" +msgid "Density of top surface layer. A value of 100% creates a fully solid, smooth top layer. Reducing this value results in a textured top surface, according to the chosen top surface pattern. A value of 0% will result in only the walls on the top layer being created. Intended for aesthetic or functional purposes, not to fix issues such as over-extrusion." +msgstr "ความหนาแน่นของชั้นผิวด้านบน ค่า 100% จะสร้างชั้นบนสุดที่เรียบและแข็งเต็มที่ การลดค่านี้ส่งผลให้พื้นผิวด้านบนมีพื้นผิวตามรูปแบบพื้นผิวด้านบนที่เลือก ค่า 0% จะส่งผลให้มีการสร้างเฉพาะผนังชั้นบนสุดเท่านั้น มีวัตถุประสงค์เพื่อความสวยงามหรือการใช้งาน ไม่ใช่เพื่อแก้ไขปัญหา เช่น การอัดขึ้นรูปมากเกินไป" msgid "Bottom surface density" msgstr "ความหนาแน่นผิวด้านล่าง" msgid "" -"Density of the bottom surface layer. Intended for aesthetic or functional " -"purposes, not to fix issues such as over-extrusion.\n" +"Density of the bottom surface layer. Intended for aesthetic or functional purposes, not to fix issues such as over-extrusion.\n" "WARNING: Lowering this value may negatively affect bed adhesion." msgstr "" -"ความหนาแน่นของชั้นผิวด้านล่าง มีวัตถุประสงค์เพื่อความสวยงามหรือการใช้งาน ไม่ใช่เพื่อแก้ไขปัญหา " -"เช่น การอัดขึ้นรูปมากเกินไป\n" +"ความหนาแน่นของชั้นผิวด้านล่าง มีวัตถุประสงค์เพื่อความสวยงามหรือการใช้งาน ไม่ใช่เพื่อแก้ไขปัญหา เช่น การอัดขึ้นรูปมากเกินไป\n" "คำเตือน: การลดค่านี้อาจส่งผลเสียต่อการยึดเกาะของฐานพิมพ์" msgid "This is the speed at which traveling is done." @@ -18228,13 +15229,8 @@ msgstr "ความเร็วที่ใช้ในการเคลื่ msgid "Wipe while retracting" msgstr "เช็ดขณะดึงกลับ" -msgid "" -"This moves the nozzle along the last extrusion path when retracting to clean " -"any leaked material on the nozzle. This can minimize blobs when printing a " -"new part after traveling." -msgstr "" -"เลื่อนหัวฉีดไปตามเส้นทางการอัดขึ้นรูปสุดท้ายเมื่อถอยกลับเพื่อทำความสะอาดวัสดุที่รั่วไหลบนหัวฉีด " -"วิธีนี้จะช่วยลดรอยหยดเมื่อพิมพ์ชิ้นส่วนใหม่หลังการเดินทาง" +msgid "This moves the nozzle along the last extrusion path when retracting to clean any leaked material on the nozzle. This can minimize blobs when printing a new part after traveling." +msgstr "เลื่อนหัวฉีดไปตามเส้นทางการอัดขึ้นรูปสุดท้ายเมื่อถอยกลับเพื่อทำความสะอาดวัสดุที่รั่วไหลบนหัวฉีด วิธีนี้จะช่วยลดรอยหยดเมื่อพิมพ์ชิ้นส่วนใหม่หลังการเดินทาง" msgid "Wipe distance" msgstr "ระยะเช็ดหัวฉีด" @@ -18242,28 +15238,18 @@ msgstr "ระยะเช็ดหัวฉีด" msgid "" "Describe how long the nozzle will move along the last path when retracting.\n" "\n" -"Depending on how long the wipe operation lasts, how fast and long the " -"extruder/filament retraction settings are, a retraction move may be needed " -"to retract the remaining filament.\n" +"Depending on how long the wipe operation lasts, how fast and long the extruder/filament retraction settings are, a retraction move may be needed to retract the remaining filament.\n" "\n" -"Setting a value in the retract amount before wipe setting below will perform " -"any excess retraction before the wipe, else it will be performed after." +"Setting a value in the retract amount before wipe setting below will perform any excess retraction before the wipe, else it will be performed after." msgstr "" "อธิบายว่าหัวฉีดจะเคลื่อนที่ไปตามเส้นทางสุดท้ายเมื่อหดกลับนานแค่ไหน\n" "\n" -"ขึ้นอยู่กับระยะเวลาของการเช็ด การตั้งค่าการดึงกลับของเส้นพลาสติก/" -"เส้นพลาสติกจะเร็วและนานเพียงใด อาจจำเป็นต้องดึงเส้นพลาสติกกลับเพื่อดึงเส้นพลาสติกที่เหลืออยู่\n" +"ขึ้นอยู่กับระยะเวลาของการเช็ด การตั้งค่าการดึงกลับของเส้นพลาสติก/เส้นพลาสติกจะเร็วและนานเพียงใด อาจจำเป็นต้องดึงเส้นพลาสติกกลับเพื่อดึงเส้นพลาสติกที่เหลืออยู่\n" "\n" -"การตั้งค่าในจำนวนการถอนก่อนการล้างการตั้งค่าด้านล่างจะทำการถอนส่วนที่เกินก่อนการล้าง " -"มิฉะนั้นจะดำเนินการหลังจากนั้น" +"การตั้งค่าในจำนวนการถอนก่อนการล้างการตั้งค่าด้านล่างจะทำการถอนส่วนที่เกินก่อนการล้าง มิฉะนั้นจะดำเนินการหลังจากนั้น" -msgid "" -"The wiping tower can be used to clean up residue on the nozzle and stabilize " -"the chamber pressure inside the nozzle in order to avoid appearance defects " -"when printing objects." -msgstr "" -"หอเช็ดสามารถใช้เพื่อทำความสะอาดสิ่งตกค้างบนหัวฉีด และทำให้แรงดันในห้องภายในหัวฉีดคงที่ " -"เพื่อหลีกเลี่ยงข้อบกพร่องในลักษณะที่ปรากฏเมื่อพิมพ์วัตถุ" +msgid "The wiping tower can be used to clean up residue on the nozzle and stabilize the chamber pressure inside the nozzle in order to avoid appearance defects when printing objects." +msgstr "หอเช็ดสามารถใช้เพื่อทำความสะอาดสิ่งตกค้างบนหัวฉีด และทำให้แรงดันในห้องภายในหัวฉีดคงที่ เพื่อหลีกเลี่ยงข้อบกพร่องในลักษณะที่ปรากฏเมื่อพิมพ์วัตถุ" msgid "Internal ribs" msgstr "ซี่โครงภายใน" @@ -18277,9 +15263,7 @@ msgstr "ปริมาตรการไล่เส้น" msgid "Flush multiplier" msgstr "ตัวคูณการไล่เส้น" -msgid "" -"The actual flushing volumes is equal to the flush multiplier value " -"multiplied by the flushing volumes in the table." +msgid "The actual flushing volumes is equal to the flush multiplier value multiplied by the flushing volumes in the table." msgstr "ปริมาตรการไล่เส้นตามจริงจะเท่ากับตัวคูณการไล่เส้นคูณด้วยปริมาตรการไล่เส้นในตาราง" msgid "Prime volume" @@ -18297,60 +15281,36 @@ msgstr "เช็ดมุมการหมุนของทาวเวอร msgid "Wipe tower rotation angle with respect to X axis." msgstr "เช็ดมุมการหมุนของทาวเวอร์ตามแกน X" -msgid "" -"Brim width of prime tower, negative number means auto calculated width based " -"on the height of prime tower." -msgstr "" -"ความกว้างขอบของหอคอยหลัก " -"ตัวเลขติดลบหมายถึงความกว้างที่คำนวณโดยอัตโนมัติตามความสูงของหอคอยหลัก" +msgid "Brim width of prime tower, negative number means auto calculated width based on the height of prime tower." +msgstr "ความกว้างขอบของหอคอยหลัก ตัวเลขติดลบหมายถึงความกว้างที่คำนวณโดยอัตโนมัติตามความสูงของหอคอยหลัก" msgid "Stabilization cone apex angle" msgstr "มุมเอเพ็กซ์ของกรวยป้องกันการสั่นไหว" -msgid "" -"Angle at the apex of the cone that is used to stabilize the wipe tower. " -"Larger angle means wider base." +msgid "Angle at the apex of the cone that is used to stabilize the wipe tower. Larger angle means wider base." msgstr "มุมที่ปลายกรวยที่ใช้เพื่อรักษาเสถียรภาพของหอเช็ด มุมที่ใหญ่ขึ้นหมายถึงฐานที่กว้างขึ้น" msgid "Maximum wipe tower print speed" msgstr "ความเร็วการพิมพ์ไวต์ทาวเวอร์สูงสุด" msgid "" -"The maximum print speed when purging in the wipe tower and printing the wipe " -"tower sparse layers. When purging, if the sparse infill speed or calculated " -"speed from the filament max volumetric speed is lower, the lowest will be " -"used instead.\n" +"The maximum print speed when purging in the wipe tower and printing the wipe tower sparse layers. When purging, if the sparse infill speed or calculated speed from the filament max volumetric speed is lower, the lowest will be used instead.\n" "\n" -"When printing the sparse layers, if the internal perimeter speed or " -"calculated speed from the filament max volumetric speed is lower, the lowest " -"will be used instead.\n" +"When printing the sparse layers, if the internal perimeter speed or calculated speed from the filament max volumetric speed is lower, the lowest will be used instead.\n" "\n" -"Increasing this speed may affect the tower's stability as well as increase " -"the force with which the nozzle collides with any blobs that may have formed " -"on the wipe tower.\n" +"Increasing this speed may affect the tower's stability as well as increase the force with which the nozzle collides with any blobs that may have formed on the wipe tower.\n" "\n" -"Before increasing this parameter beyond the default of 90 mm/s, make sure " -"your printer can reliably bridge at the increased speeds and that ooze when " -"tool changing is well controlled.\n" +"Before increasing this parameter beyond the default of 90 mm/s, make sure your printer can reliably bridge at the increased speeds and that ooze when tool changing is well controlled.\n" "\n" -"For the wipe tower external perimeters the internal perimeter speed is used " -"regardless of this setting." +"For the wipe tower external perimeters the internal perimeter speed is used regardless of this setting." msgstr "" -"ความเร็วในการพิมพ์สูงสุดเมื่อทำการล้างข้อมูลใน Wipe Tower และการพิมพ์ Wipe Tower " -"บางเลเยอร์ เมื่อทำการไล่ล้าง " -"หากความเร็วไส้ในแบบโปร่งหรือความเร็วที่คำนวณจากความเร็วปริมาตรสูงสุดของเส้นพลาสติกต่ำกว่า " -"ความเร็วต่ำสุดจะถูกนำมาใช้แทน\n" +"ความเร็วในการพิมพ์สูงสุดเมื่อทำการล้างข้อมูลใน Wipe Tower และการพิมพ์ Wipe Tower บางเลเยอร์ เมื่อทำการไล่ล้าง หากความเร็วไส้ในแบบโปร่งหรือความเร็วที่คำนวณจากความเร็วปริมาตรสูงสุดของเส้นพลาสติกต่ำกว่า ความเร็วต่ำสุดจะถูกนำมาใช้แทน\n" "\n" -"เมื่อพิมพ์ชั้นเบาบาง " -"หากความเร็วเส้นรอบวงภายในหรือความเร็วที่คำนวณจากความเร็วปริมาตรสูงสุดของเส้นพลาสติกต่ำกว่า " -"ความเร็วต่ำสุดจะถูกนำมาใช้แทน\n" +"เมื่อพิมพ์ชั้นเบาบาง หากความเร็วเส้นรอบวงภายในหรือความเร็วที่คำนวณจากความเร็วปริมาตรสูงสุดของเส้นพลาสติกต่ำกว่า ความเร็วต่ำสุดจะถูกนำมาใช้แทน\n" "\n" -"การเพิ่มความเร็วนี้อาจส่งผลต่อเสถียรภาพของทาวเวอร์ รวมทั้งเพิ่มแรงที่หัวฉีดชนกับหยดใดๆ " -"ที่อาจก่อตัวบนทาวเวอร์เช็ด\n" +"การเพิ่มความเร็วนี้อาจส่งผลต่อเสถียรภาพของทาวเวอร์ รวมทั้งเพิ่มแรงที่หัวฉีดชนกับหยดใดๆ ที่อาจก่อตัวบนทาวเวอร์เช็ด\n" "\n" -"ก่อนที่จะเพิ่มพารามิเตอร์นี้เกินกว่าค่าเริ่มต้นที่ 90 มม./วินาที " -"ตรวจสอบให้แน่ใจว่าเครื่องพิมพ์ของคุณสามารถเชื่อมต่อที่ความเร็วที่เพิ่มขึ้นได้อย่างน่าเชื่อถือ " -"และจะมีการควบคุมอย่างดีเมื่อเปลี่ยนเครื่องมือ\n" +"ก่อนที่จะเพิ่มพารามิเตอร์นี้เกินกว่าค่าเริ่มต้นที่ 90 มม./วินาที ตรวจสอบให้แน่ใจว่าเครื่องพิมพ์ของคุณสามารถเชื่อมต่อที่ความเร็วที่เพิ่มขึ้นได้อย่างน่าเชื่อถือ และจะมีการควบคุมอย่างดีเมื่อเปลี่ยนเครื่องมือ\n" "\n" "สำหรับปริมณฑลภายนอกของไวต์ทาวเวอร์ ความเร็วของปริมณฑลภายในจะถูกใช้โดยไม่คำนึงถึงการตั้งค่านี้" @@ -18359,10 +15319,8 @@ msgstr "ชนิดติดผนัง" msgid "" "Wipe tower outer wall type.\n" -"1. Rectangle: The default wall type, a rectangle with fixed width and " -"height.\n" -"2. Cone: A cone with a fillet at the bottom to help stabilize the wipe " -"tower.\n" +"1. Rectangle: The default wall type, a rectangle with fixed width and height.\n" +"2. Cone: A cone with a fillet at the bottom to help stabilize the wipe tower.\n" "3. Rib: Adds four ribs to the tower wall for enhanced stability." msgstr "" "เช็ดทาวเวอร์ชนิดผนังด้านนอก\n" @@ -18379,13 +15337,8 @@ msgstr "ซี่โครง" msgid "Extra rib length" msgstr "ความยาวซี่โครงพิเศษ" -msgid "" -"Positive values can increase the size of the rib wall, while negative values " -"can reduce the size. However, the size of the rib wall can not be smaller " -"than that determined by the cleaning volume." -msgstr "" -"ค่าบวกสามารถเพิ่มขนาดของผนังซี่โครงได้ ในขณะที่ค่าลบสามารถลดขนาดได้ อย่างไรก็ตาม " -"ขนาดของผนังซี่โครงต้องไม่เล็กกว่าที่กำหนดโดยปริมาตรการทำความสะอาด" +msgid "Positive values can increase the size of the rib wall, while negative values can reduce the size. However, the size of the rib wall can not be smaller than that determined by the cleaning volume." +msgstr "ค่าบวกสามารถเพิ่มขนาดของผนังซี่โครงได้ ในขณะที่ค่าลบสามารถลดขนาดได้ อย่างไรก็ตาม ขนาดของผนังซี่โครงต้องไม่เล็กกว่าที่กำหนดโดยปริมาตรการทำความสะอาด" msgid "Rib width" msgstr "ความกว้างของซี่โครง" @@ -18399,23 +15352,14 @@ msgstr "ผนังเนื้อ" msgid "The wall of prime tower will fillet." msgstr "ผนังของไพร์มทาวเวอร์จะแล่เป็นเนื้อเดียวกัน" -msgid "" -"The extruder to use when printing perimeter of the wipe tower. Set to 0 to " -"use the one that is available (non-soluble would be preferred)." -msgstr "" -"ชุดดันเส้นที่จะใช้ในการพิมพ์ปริมณฑลของหอเช็ด ตั้งค่าเป็น 0 เพื่อใช้อันที่มีอยู่ " -"(แนะนำให้ใช้แบบไม่ละลายน้ำ)" +msgid "The extruder to use when printing perimeter of the wipe tower. Set to 0 to use the one that is available (non-soluble would be preferred)." +msgstr "ชุดดันเส้นที่จะใช้ในการพิมพ์ปริมณฑลของหอเช็ด ตั้งค่าเป็น 0 เพื่อใช้อันที่มีอยู่ (แนะนำให้ใช้แบบไม่ละลายน้ำ)" msgid "Purging volumes - load/unload volumes" msgstr "การล้างไดรฟ์ข้อมูล - โหลด/ยกเลิกการโหลดไดรฟ์ข้อมูล" -msgid "" -"This vector saves required volumes to change from/to each tool used on the " -"wipe tower. These values are used to simplify creation of the full purging " -"volumes below." -msgstr "" -"เวกเตอร์นี้จะบันทึกปริมาณที่ต้องการเพื่อเปลี่ยนจาก/ไปยังแต่ละเครื่องมือที่ใช้บนไวด์ทาวเวอร์ " -"ค่าเหล่านี้ใช้เพื่อทำให้การสร้างวอลุ่มการล้างข้อมูลทั้งหมดด้านล่างง่ายขึ้น" +msgid "This vector saves required volumes to change from/to each tool used on the wipe tower. These values are used to simplify creation of the full purging volumes below." +msgstr "เวกเตอร์นี้จะบันทึกปริมาณที่ต้องการเพื่อเปลี่ยนจาก/ไปยังแต่ละเครื่องมือที่ใช้บนไวด์ทาวเวอร์ ค่าเหล่านี้ใช้เพื่อทำให้การสร้างวอลุ่มการล้างข้อมูลทั้งหมดด้านล่างง่ายขึ้น" msgid "Skip points" msgstr "ข้ามจุด" @@ -18426,21 +15370,14 @@ msgstr "ผนังของไพร์มทาวเวอร์จะข้ msgid "Enable tower interface features" msgstr "เปิดใช้งานคุณสมบัติอินเทอร์เฟซแบบทาวเวอร์" -msgid "" -"Enable optimized prime tower interface behavior when different materials " -"meet." +msgid "Enable optimized prime tower interface behavior when different materials meet." msgstr "เปิดใช้งานพฤติกรรมอินเทอร์เฟซของไพรม์ทาวเวอร์ที่ได้รับการปรับให้เหมาะสมเมื่อวัสดุที่แตกต่างกันมาบรรจบกัน" msgid "Cool down from interface boost during prime tower" msgstr "เย็นลงจากการเพิ่มอินเทอร์เฟซระหว่างหอคอยหลัก" -msgid "" -"When interface-layer temperature boost is active, set the nozzle back to " -"print temperature at the start of the prime tower so it cools down during " -"the tower." -msgstr "" -"เมื่อเปิดใช้งานการเพิ่มอุณหภูมิของชั้นอินเทอร์เฟซ " -"ให้ตั้งค่าหัวฉีดกลับไปเป็นอุณหภูมิการพิมพ์ที่จุดเริ่มต้นของไพรม์ทาวเวอร์ เพื่อให้เย็นลงระหว่างทาวเวอร์" +msgid "When interface-layer temperature boost is active, set the nozzle back to print temperature at the start of the prime tower so it cools down during the tower." +msgstr "เมื่อเปิดใช้งานการเพิ่มอุณหภูมิของชั้นอินเทอร์เฟซ ให้ตั้งค่าหัวฉีดกลับไปเป็นอุณหภูมิการพิมพ์ที่จุดเริ่มต้นของไพรม์ทาวเวอร์ เพื่อให้เย็นลงระหว่างทาวเวอร์" msgid "Infill gap" msgstr "การเติมช่องว่าง" @@ -18448,31 +15385,14 @@ msgstr "การเติมช่องว่าง" msgid "Infill gap." msgstr "การเติมช่องว่าง." -msgid "" -"Purging after filament change will be done inside objects' infills. This may " -"lower the amount of waste and decrease the print time. If the walls are " -"printed with transparent filament, the mixed color infill will be visible. " -"It will not take effect unless the prime tower is enabled." -msgstr "" -"การล้างหลังจากเปลี่ยนเส้นพลาสติกจะดำเนินการภายในส่วนไส้ในของวัตถุ " -"สิ่งนี้อาจลดปริมาณขยะและลดเวลาในการพิมพ์ หากผนังพิมพ์ด้วยเส้นพลาสติกโปร่งใส " -"จะเห็นไส้ในสีผสมไว้ด้านนอก มันจะไม่มีผลเว้นแต่จะเปิดใช้งานไพรม์ทาวเวอร์" +msgid "Purging after filament change will be done inside objects' infills. This may lower the amount of waste and decrease the print time. If the walls are printed with transparent filament, the mixed color infill will be visible. It will not take effect unless the prime tower is enabled." +msgstr "การล้างหลังจากเปลี่ยนเส้นพลาสติกจะดำเนินการภายในส่วนไส้ในของวัตถุ สิ่งนี้อาจลดปริมาณขยะและลดเวลาในการพิมพ์ หากผนังพิมพ์ด้วยเส้นพลาสติกโปร่งใส จะเห็นไส้ในสีผสมไว้ด้านนอก มันจะไม่มีผลเว้นแต่จะเปิดใช้งานไพรม์ทาวเวอร์" -msgid "" -"Purging after filament change will be done inside objects' support. This may " -"lower the amount of waste and decrease the print time. It will not take " -"effect unless a prime tower is enabled." -msgstr "" -"การล้างข้อมูลหลังจากเปลี่ยนเส้นพลาสติกจะดำเนินการภายในส่วนรองรับของวัตถุ " -"สิ่งนี้อาจลดปริมาณขยะและลดเวลาในการพิมพ์ มันจะไม่มีผลเว้นแต่จะเปิดใช้งานไพรม์ทาวเวอร์" +msgid "Purging after filament change will be done inside objects' support. This may lower the amount of waste and decrease the print time. It will not take effect unless a prime tower is enabled." +msgstr "การล้างข้อมูลหลังจากเปลี่ยนเส้นพลาสติกจะดำเนินการภายในส่วนรองรับของวัตถุ สิ่งนี้อาจลดปริมาณขยะและลดเวลาในการพิมพ์ มันจะไม่มีผลเว้นแต่จะเปิดใช้งานไพรม์ทาวเวอร์" -msgid "" -"This object will be used to purge the nozzle after a filament change to save " -"filament and decrease the print time. Colors of the objects will be mixed as " -"a result. It will not take effect unless the prime tower is enabled." -msgstr "" -"วัตถุนี้จะใช้ในการล้างหัวฉีดหลังจากเปลี่ยนเส้นพลาสติกเพื่อประหยัดเส้นพลาสติกและลดเวลาในการพิมพ์ " -"สีของวัตถุจะผสมกัน มันจะไม่มีผลเว้นแต่จะเปิดใช้งานไพรม์ทาวเวอร์" +msgid "This object will be used to purge the nozzle after a filament change to save filament and decrease the print time. Colors of the objects will be mixed as a result. It will not take effect unless the prime tower is enabled." +msgstr "วัตถุนี้จะใช้ในการล้างหัวฉีดหลังจากเปลี่ยนเส้นพลาสติกเพื่อประหยัดเส้นพลาสติกและลดเวลาในการพิมพ์ สีของวัตถุจะผสมกัน มันจะไม่มีผลเว้นแต่จะเปิดใช้งานไพรม์ทาวเวอร์" msgid "Maximal bridging distance" msgstr "ระยะเชื่อมต่อสูงสุด" @@ -18489,61 +15409,35 @@ msgstr "ระยะห่างของเส้นไล่ล้างบน msgid "Extra flow for purging" msgstr "กระแสพิเศษสำหรับการล้าง" -msgid "" -"Extra flow used for the purging lines on the wipe tower. This makes the " -"purging lines thicker or narrower than they normally would be. The spacing " -"is adjusted automatically." -msgstr "" -"การไหลพิเศษที่ใช้สำหรับท่อไล่ล้างบนหอเช็ด ซึ่งจะทำให้เส้นการล้างหนาหรือแคบกว่าปกติ " -"ระยะห่างจะถูกปรับโดยอัตโนมัติ" +msgid "Extra flow used for the purging lines on the wipe tower. This makes the purging lines thicker or narrower than they normally would be. The spacing is adjusted automatically." +msgstr "การไหลพิเศษที่ใช้สำหรับท่อไล่ล้างบนหอเช็ด ซึ่งจะทำให้เส้นการล้างหนาหรือแคบกว่าปกติ ระยะห่างจะถูกปรับโดยอัตโนมัติ" msgid "Idle temperature" msgstr "อุณหภูมิว่าง" -msgid "" -"Nozzle temperature when the tool is currently not used in multi-tool setups. " -"This is only used when 'Ooze prevention' is active in Print Settings. Set to " -"0 to disable." -msgstr "" -"อุณหภูมิหัวฉีดเมื่อไม่ได้ใช้เครื่องมือในการตั้งค่าหลายเครื่องมือ ใช้เฉพาะเมื่อมีการเปิดใช้งาน " -"'การป้องกันน้ำซึม' ในการตั้งค่าการพิมพ์ ตั้งค่าเป็น 0 เพื่อปิดใช้งาน" +msgid "Nozzle temperature when the tool is currently not used in multi-tool setups. This is only used when 'Ooze prevention' is active in Print Settings. Set to 0 to disable." +msgstr "อุณหภูมิหัวฉีดเมื่อไม่ได้ใช้เครื่องมือในการตั้งค่าหลายเครื่องมือ ใช้เฉพาะเมื่อมีการเปิดใช้งาน 'การป้องกันน้ำซึม' ในการตั้งค่าการพิมพ์ ตั้งค่าเป็น 0 เพื่อปิดใช้งาน" msgid "X-Y hole compensation" msgstr "การชดเชยรู X-Y" -msgid "" -"Holes in objects will expand or contract in the XY plane by the set value. " -"Positive values make holes bigger and negative values make holes smaller. " -"This function is used to adjust sizes slightly when objects have assembly " -"issues." -msgstr "" -"รูในวัตถุจะขยายหรือหดตัวในระนาบ XY ตามค่าที่กำหนดค่าไว้ ค่าบวกจะทำให้รูมีขนาดใหญ่ขึ้น " -"ค่าลบจะทำให้รูเล็กลง ฟังก์ชันนี้ใช้เพื่อปรับขนาดเล็กน้อยเมื่อวัตถุมีปัญหาในการประกอบ" +msgid "Holes in objects will expand or contract in the XY plane by the set value. Positive values make holes bigger and negative values make holes smaller. This function is used to adjust sizes slightly when objects have assembly issues." +msgstr "รูในวัตถุจะขยายหรือหดตัวในระนาบ XY ตามค่าที่กำหนดค่าไว้ ค่าบวกจะทำให้รูมีขนาดใหญ่ขึ้น ค่าลบจะทำให้รูเล็กลง ฟังก์ชันนี้ใช้เพื่อปรับขนาดเล็กน้อยเมื่อวัตถุมีปัญหาในการประกอบ" msgid "X-Y contour compensation" msgstr "การชดเชยรูปร่าง X-Y" -msgid "" -"Contours of objects will expand or contract in the XY plane by the set " -"value. Positive values make contours bigger and negative values make " -"contours smaller. This function is used to adjust sizes slightly when " -"objects have assembly issues." -msgstr "" -"รูปทรงของวัตถุจะขยายหรือหดตัวในระนาบ XY ตามค่าที่กำหนดค่าไว้ " -"ค่าบวกจะทำให้เส้นขอบมีขนาดใหญ่ขึ้น ค่าลบจะทำให้เส้นขอบมีขนาดเล็กลง " -"ฟังก์ชันนี้ใช้เพื่อปรับขนาดเล็กน้อยเมื่อวัตถุมีปัญหาในการประกอบ" +msgid "Contours of objects will expand or contract in the XY plane by the set value. Positive values make contours bigger and negative values make contours smaller. This function is used to adjust sizes slightly when objects have assembly issues." +msgstr "รูปทรงของวัตถุจะขยายหรือหดตัวในระนาบ XY ตามค่าที่กำหนดค่าไว้ ค่าบวกจะทำให้เส้นขอบมีขนาดใหญ่ขึ้น ค่าลบจะทำให้เส้นขอบมีขนาดเล็กลง ฟังก์ชันนี้ใช้เพื่อปรับขนาดเล็กน้อยเมื่อวัตถุมีปัญหาในการประกอบ" msgid "Convert holes to polyholes" msgstr "แปลงรูเป็นโพลีโฮล" msgid "" -"Search for almost-circular holes that span more than one layer and convert " -"the geometry to polyholes. Use the nozzle size and the (biggest) diameter to " -"compute the polyhole.\n" +"Search for almost-circular holes that span more than one layer and convert the geometry to polyholes. Use the nozzle size and the (biggest) diameter to compute the polyhole.\n" "See http://hydraraptor.blogspot.com/2011/02/polyholes.html" msgstr "" -"ค้นหารูเกือบเป็นวงกลมที่ขยายมากกว่าหนึ่งชั้น และแปลงรูปทรงเป็นโพลีโฮล " -"ใช้ขนาดหัวฉีดและเส้นผ่านศูนย์กลาง (ใหญ่ที่สุด) เพื่อคำนวณรูโพลี\n" +"ค้นหารูเกือบเป็นวงกลมที่ขยายมากกว่าหนึ่งชั้น และแปลงรูปทรงเป็นโพลีโฮล ใช้ขนาดหัวฉีดและเส้นผ่านศูนย์กลาง (ใหญ่ที่สุด) เพื่อคำนวณรูโพลี\n" "ดูhttp://hydraraptor.blogspot.com/2011/02/polyholes.html" msgid "Polyhole detection margin" @@ -18552,14 +15446,11 @@ msgstr "ขอบการตรวจจับโพลีโฮล" #, no-c-format, no-boost-format msgid "" "Maximum defection of a point to the estimated radius of the circle.\n" -"As cylinders are often exported as triangles of varying size, points may not " -"be on the circle circumference. This setting allows you some leeway to " -"broaden the detection.\n" +"As cylinders are often exported as triangles of varying size, points may not be on the circle circumference. This setting allows you some leeway to broaden the detection.\n" "In mm or in % of the radius." msgstr "" "การเบี่ยงเบนสูงสุดของจุดจนถึงรัศมีโดยประมาณของวงกลม\n" -"เนื่องจากทรงกระบอกมักถูกส่งออกเป็นรูปสามเหลี่ยมที่มีขนาดต่างกัน จุดต่างๆ " -"อาจไม่อยู่บนเส้นรอบวงของวงกลม การตั้งค่านี้ช่วยให้คุณมีเวลามากขึ้นในการขยายการตรวจจับ\n" +"เนื่องจากทรงกระบอกมักถูกส่งออกเป็นรูปสามเหลี่ยมที่มีขนาดต่างกัน จุดต่างๆ อาจไม่อยู่บนเส้นรอบวงของวงกลม การตั้งค่านี้ช่วยให้คุณมีเวลามากขึ้นในการขยายการตรวจจับ\n" "เป็นมิลลิเมตรหรือเป็น % ของรัศมี" msgid "Polyhole twist" @@ -18571,44 +15462,23 @@ msgstr "หมุนโพลีโฮลทุกชั้น" msgid "G-code thumbnails" msgstr "ภาพขนาดย่อ G-code" -msgid "" -"Picture sizes to be stored into a .gcode and .sl1 / .sl1s files, in the " -"following format: \"XxY, XxY, ...\"" -msgstr "" -"ขนาดรูปภาพที่จะจัดเก็บไว้ในไฟล์ .gcode และ .sl1 / .sl1s ในรูปแบบต่อไปนี้: \"XxY, " -"XxY, ...\"" +msgid "Picture sizes to be stored into a .gcode and .sl1 / .sl1s files, in the following format: \"XxY, XxY, ...\"" +msgstr "ขนาดรูปภาพที่จะจัดเก็บไว้ในไฟล์ .gcode และ .sl1 / .sl1s ในรูปแบบต่อไปนี้: \"XxY, XxY, ...\"" msgid "Format of G-code thumbnails" msgstr "รูปแบบของภาพขนาดย่อ G-code" -msgid "" -"Format of G-code thumbnails: PNG for best quality, JPG for smallest size, " -"QOI for low memory firmware." -msgstr "" -"รูปแบบของภาพขนาดย่อ G-code: PNG สำหรับคุณภาพที่ดีที่สุด, JPG สำหรับขนาดที่เล็กที่สุด, QOI " -"สำหรับเฟิร์มแวร์หน่วยความจำเหลือน้อย" +msgid "Format of G-code thumbnails: PNG for best quality, JPG for smallest size, QOI for low memory firmware." +msgstr "รูปแบบของภาพขนาดย่อ G-code: PNG สำหรับคุณภาพที่ดีที่สุด, JPG สำหรับขนาดที่เล็กที่สุด, QOI สำหรับเฟิร์มแวร์หน่วยความจำเหลือน้อย" msgid "Use relative E distances" msgstr "ใช้ระยะห่าง E สัมพัทธ์" -msgid "" -"Relative extrusion is recommended when using \"label_objects\" option. Some " -"extruders work better with this option unchecked (absolute extrusion mode). " -"Wipe tower is only compatible with relative mode. It is recommended on most " -"printers. Default is checked." -msgstr "" -"แนะนำให้ใช้การอัดขึ้นรูปแบบสัมพัทธ์เมื่อใช้ตัวเลือก \"label_objects\" " -"ชุดดันเส้นบางชนิดทำงานได้ดีกว่าหากไม่ได้เลือกตัวเลือกนี้ (โหมดการอัดขึ้นรูปสัมบูรณ์) Wipe Tower " -"ใช้งานได้กับโหมดสัมพัทธ์เท่านั้น แนะนำให้ใช้กับเครื่องพิมพ์ส่วนใหญ่ เลือกค่าเริ่มต้นแล้ว" +msgid "Relative extrusion is recommended when using \"label_objects\" option. Some extruders work better with this option unchecked (absolute extrusion mode). Wipe tower is only compatible with relative mode. It is recommended on most printers. Default is checked." +msgstr "แนะนำให้ใช้การอัดขึ้นรูปแบบสัมพัทธ์เมื่อใช้ตัวเลือก \"label_objects\" ชุดดันเส้นบางชนิดทำงานได้ดีกว่าหากไม่ได้เลือกตัวเลือกนี้ (โหมดการอัดขึ้นรูปสัมบูรณ์) Wipe Tower ใช้งานได้กับโหมดสัมพัทธ์เท่านั้น แนะนำให้ใช้กับเครื่องพิมพ์ส่วนใหญ่ เลือกค่าเริ่มต้นแล้ว" -msgid "" -"The classic wall generator produces walls with constant extrusion width and " -"for very thin areas, gap-fill is used. The Arachne engine produces walls " -"with variable extrusion width." -msgstr "" -"เครื่องกำเนิดผนังแบบคลาสสิกสร้างผนังที่มีความกว้างของการอัดขึ้นรูปคงที่ " -"และสำหรับพื้นที่ที่บางมากจะใช้การเติมช่องว่าง เครื่องยนต์ Arachne " -"สร้างผนังที่มีความกว้างของการอัดขึ้นรูปที่หลากหลาย" +msgid "The classic wall generator produces walls with constant extrusion width and for very thin areas, gap-fill is used. The Arachne engine produces walls with variable extrusion width." +msgstr "เครื่องกำเนิดผนังแบบคลาสสิกสร้างผนังที่มีความกว้างของการอัดขึ้นรูปคงที่ และสำหรับพื้นที่ที่บางมากจะใช้การเติมช่องว่าง เครื่องยนต์ Arachne สร้างผนังที่มีความกว้างของการอัดขึ้นรูปที่หลากหลาย" msgid "Arachne" msgstr "อารัคเน่" @@ -18616,154 +15486,74 @@ msgstr "อารัคเน่" msgid "Wall transition length" msgstr "ความยาวการเปลี่ยนผนัง" -msgid "" -"When transitioning between different numbers of walls as the part becomes " -"thinner, a certain amount of space is allotted to split or join the wall " -"segments. It's expressed as a percentage over nozzle diameter." -msgstr "" -"เมื่อเปลี่ยนระหว่างผนังจำนวนต่างๆ เมื่อชิ้นส่วนบางลง " -"จะมีการแบ่งพื้นที่จำนวนหนึ่งเพื่อแยกหรือรวมส่วนของผนัง " -"โดยแสดงเป็นเปอร์เซ็นต์ของเส้นผ่านศูนย์กลางของหัวฉีด" +msgid "When transitioning between different numbers of walls as the part becomes thinner, a certain amount of space is allotted to split or join the wall segments. It's expressed as a percentage over nozzle diameter." +msgstr "เมื่อเปลี่ยนระหว่างผนังจำนวนต่างๆ เมื่อชิ้นส่วนบางลง จะมีการแบ่งพื้นที่จำนวนหนึ่งเพื่อแยกหรือรวมส่วนของผนัง โดยแสดงเป็นเปอร์เซ็นต์ของเส้นผ่านศูนย์กลางของหัวฉีด" msgid "Wall transitioning filter margin" msgstr "ขอบตัวกรองการเปลี่ยนผนัง" -msgid "" -"Prevent transitioning back and forth between one extra wall and one less. " -"This margin extends the range of extrusion widths which follow to [Minimum " -"wall width - margin, 2 * Minimum wall width + margin]. Increasing this " -"margin reduces the number of transitions, which reduces the number of " -"extrusion starts/stops and travel time. However, large extrusion width " -"variation can lead to under- or overextrusion problems. It's expressed as a " -"percentage over nozzle diameter." -msgstr "" -"ป้องกันการเปลี่ยนไปมาระหว่างผนังพิเศษหนึ่งอันและน้อยกว่าหนึ่งอัน " -"ขอบนี้จะขยายช่วงความกว้างของการอัดขึ้นรูปซึ่งเป็นไปตาม [ความกว้างของผนังขั้นต่ำ - ขอบ 2 * " -"ความกว้างของผนังขั้นต่ำ + ขอบ] การเพิ่มระยะขอบนี้จะลดจำนวนการเปลี่ยน ซึ่งจะลดจำนวนการเริ่ม/" -"หยุดการอัดขึ้นรูปและเวลาการเดินทาง อย่างไรก็ตาม " -"ความกว้างของการอัดขึ้นรูปที่หลากหลายอาจทำให้เกิดปัญหาการอัดขึ้นรูปน้อยเกินไปหรือมากเกินไปได้ " -"โดยแสดงเป็นเปอร์เซ็นต์ของเส้นผ่านศูนย์กลางของหัวฉีด" +msgid "Prevent transitioning back and forth between one extra wall and one less. This margin extends the range of extrusion widths which follow to [Minimum wall width - margin, 2 * Minimum wall width + margin]. Increasing this margin reduces the number of transitions, which reduces the number of extrusion starts/stops and travel time. However, large extrusion width variation can lead to under- or overextrusion problems. It's expressed as a percentage over nozzle diameter." +msgstr "ป้องกันการเปลี่ยนไปมาระหว่างผนังพิเศษหนึ่งอันและน้อยกว่าหนึ่งอัน ขอบนี้จะขยายช่วงความกว้างของการอัดขึ้นรูปซึ่งเป็นไปตาม [ความกว้างของผนังขั้นต่ำ - ขอบ 2 * ความกว้างของผนังขั้นต่ำ + ขอบ] การเพิ่มระยะขอบนี้จะลดจำนวนการเปลี่ยน ซึ่งจะลดจำนวนการเริ่ม/หยุดการอัดขึ้นรูปและเวลาการเดินทาง อย่างไรก็ตาม ความกว้างของการอัดขึ้นรูปที่หลากหลายอาจทำให้เกิดปัญหาการอัดขึ้นรูปน้อยเกินไปหรือมากเกินไปได้ โดยแสดงเป็นเปอร์เซ็นต์ของเส้นผ่านศูนย์กลางของหัวฉีด" msgid "Wall transitioning threshold angle" msgstr "มุมการเปลี่ยนผ่านของผนัง" -msgid "" -"When to create transitions between even and odd numbers of walls. A wedge " -"shape with an angle greater than this setting will not have transitions and " -"no walls will be printed in the center to fill the remaining space. Reducing " -"this setting reduces the number and length of these center walls, but may " -"leave gaps or overextrude." -msgstr "" -"เมื่อใดควรสร้างการเปลี่ยนระหว่างผนังเลขคู่และเลขคี่ รูปร่างลิ่มที่มีมุมมากกว่าการตั้งค่านี้ " -"จะไม่มีการเปลี่ยน และจะไม่มีการพิมพ์ผนังตรงกลางเพื่อไส้ในเต็มพื้นที่ที่เหลือ " -"การลดการตั้งค่านี้จะช่วยลดจำนวนและความยาวของผนังตรงกลาง " -"แต่อาจทำให้เกิดช่องว่างหรืออัดแน่นเกินไป" +msgid "When to create transitions between even and odd numbers of walls. A wedge shape with an angle greater than this setting will not have transitions and no walls will be printed in the center to fill the remaining space. Reducing this setting reduces the number and length of these center walls, but may leave gaps or overextrude." +msgstr "เมื่อใดควรสร้างการเปลี่ยนระหว่างผนังเลขคู่และเลขคี่ รูปร่างลิ่มที่มีมุมมากกว่าการตั้งค่านี้ จะไม่มีการเปลี่ยน และจะไม่มีการพิมพ์ผนังตรงกลางเพื่อไส้ในเต็มพื้นที่ที่เหลือ การลดการตั้งค่านี้จะช่วยลดจำนวนและความยาวของผนังตรงกลาง แต่อาจทำให้เกิดช่องว่างหรืออัดแน่นเกินไป" msgid "Wall distribution count" msgstr "จำนวนการกระจายผนัง" -msgid "" -"The number of walls, counted from the center, over which the variation needs " -"to be spread. Lower values mean that the outer walls don't change in width." -msgstr "" -"จำนวนผนัง นับจากจุดศูนย์กลาง ซึ่งต้องกระจายรูปแบบออกไป " -"ค่าที่ต่ำกว่าหมายความว่าผนังด้านนอกไม่เปลี่ยนความกว้าง" +msgid "The number of walls, counted from the center, over which the variation needs to be spread. Lower values mean that the outer walls don't change in width." +msgstr "จำนวนผนัง นับจากจุดศูนย์กลาง ซึ่งต้องกระจายรูปแบบออกไป ค่าที่ต่ำกว่าหมายความว่าผนังด้านนอกไม่เปลี่ยนความกว้าง" msgid "Minimum feature size" msgstr "ขนาดคุณสมบัติขั้นต่ำ" -msgid "" -"Minimum thickness of thin features. Model features that are thinner than " -"this value will not be printed, while features thicker than than this value " -"will be widened to the minimum wall width. It's expressed as a percentage " -"over nozzle diameter." -msgstr "" -"ความหนาขั้นต่ำของคุณสมบัติบาง คุณลักษณะของโมเดลที่บางกว่าค่านี้จะไม่ถูกพิมพ์ " -"ในขณะที่คุณลักษณะที่หนากว่าค่านี้จะถูกขยายให้เป็นความกว้างของผนังขั้นต่ำ " -"โดยแสดงเป็นเปอร์เซ็นต์ของเส้นผ่านศูนย์กลางของหัวฉีด" +msgid "Minimum thickness of thin features. Model features that are thinner than this value will not be printed, while features thicker than than this value will be widened to the minimum wall width. It's expressed as a percentage over nozzle diameter." +msgstr "ความหนาขั้นต่ำของคุณสมบัติบาง คุณลักษณะของโมเดลที่บางกว่าค่านี้จะไม่ถูกพิมพ์ ในขณะที่คุณลักษณะที่หนากว่าค่านี้จะถูกขยายให้เป็นความกว้างของผนังขั้นต่ำ โดยแสดงเป็นเปอร์เซ็นต์ของเส้นผ่านศูนย์กลางของหัวฉีด" msgid "Minimum wall length" msgstr "ความยาวผนังขั้นต่ำ" msgid "" -"Adjust this value to prevent short, unclosed walls from being printed, which " -"could increase print time. Higher values remove more and longer walls.\n" +"Adjust this value to prevent short, unclosed walls from being printed, which could increase print time. Higher values remove more and longer walls.\n" "\n" -"NOTE: Bottom and top surfaces will not be affected by this value to prevent " -"visual gaps on the outside of the model. Adjust 'One wall threshold' in the " -"Advanced settings below to adjust the sensitivity of what is considered a " -"top-surface. 'One wall threshold' is only visible if this setting is set " -"above the default value of 0.5, or if single-wall top surfaces is enabled." +"NOTE: Bottom and top surfaces will not be affected by this value to prevent visual gaps on the outside of the model. Adjust 'One wall threshold' in the Advanced settings below to adjust the sensitivity of what is considered a top-surface. 'One wall threshold' is only visible if this setting is set above the default value of 0.5, or if single-wall top surfaces is enabled." msgstr "" -"ปรับค่านี้เพื่อป้องกันการพิมพ์ผนังที่สั้นและไม่ปิด ซึ่งอาจเพิ่มเวลาในการพิมพ์ " -"ค่าที่สูงกว่าจะลบผนังที่ยาวขึ้นเรื่อยๆ\n" +"ปรับค่านี้เพื่อป้องกันการพิมพ์ผนังที่สั้นและไม่ปิด ซึ่งอาจเพิ่มเวลาในการพิมพ์ ค่าที่สูงกว่าจะลบผนังที่ยาวขึ้นเรื่อยๆ\n" "\n" -"หมายเหตุ: พื้นผิวด้านล่างและด้านบนจะไม่ได้รับผลกระทบจากค่านี้ " -"เพื่อป้องกันช่องว่างการมองเห็นด้านนอกของแบบจำลอง ปรับ 'เกณฑ์ผนังด้านเดียว' " -"ในการตั้งค่าขั้นสูงด้านล่างเพื่อปรับความไวของสิ่งที่ถือเป็นพื้นผิวด้านบน 'เกณฑ์ผนังด้านเดียว' " -"จะมองเห็นได้ก็ต่อเมื่อการตั้งค่านี้ตั้งไว้สูงกว่าค่าเริ่มต้นที่ 0.5 " -"หรือหากเปิดใช้งานพื้นผิวด้านบนแบบผนังเดียว" +"หมายเหตุ: พื้นผิวด้านล่างและด้านบนจะไม่ได้รับผลกระทบจากค่านี้ เพื่อป้องกันช่องว่างการมองเห็นด้านนอกของแบบจำลอง ปรับ 'เกณฑ์ผนังด้านเดียว' ในการตั้งค่าขั้นสูงด้านล่างเพื่อปรับความไวของสิ่งที่ถือเป็นพื้นผิวด้านบน 'เกณฑ์ผนังด้านเดียว' จะมองเห็นได้ก็ต่อเมื่อการตั้งค่านี้ตั้งไว้สูงกว่าค่าเริ่มต้นที่ 0.5 หรือหากเปิดใช้งานพื้นผิวด้านบนแบบผนังเดียว" msgid "Maximum wall resolution" msgstr "ความละเอียดผนังสูงสุด" -msgid "" -"This value determines the smallest wall line segment length in mm. The " -"smaller you set this value, the more accurate and precise the walls will be." -msgstr "" -"ค่านี้กำหนดความยาวส่วนของเส้นผนังที่เล็กที่สุดเป็นหน่วยมม. ยิ่งคุณตั้งค่านี้น้อย " -"ผนังก็จะยิ่งแม่นยำและแม่นยำมากขึ้นเท่านั้น" +msgid "This value determines the smallest wall line segment length in mm. The smaller you set this value, the more accurate and precise the walls will be." +msgstr "ค่านี้กำหนดความยาวส่วนของเส้นผนังที่เล็กที่สุดเป็นหน่วยมม. ยิ่งคุณตั้งค่านี้น้อย ผนังก็จะยิ่งแม่นยำและแม่นยำมากขึ้นเท่านั้น" msgid "Maximum wall deviation" msgstr "ส่วนเบี่ยงเบนของผนังสูงสุด" -msgid "" -"The maximum deviation allowed when reducing the resolution for the 'Maximum " -"wall resolution' setting. If you increase this, the print will be less " -"accurate, but the G-Code will be smaller. 'Maximum wall deviation' limits " -"'Maximum wall resolution', so if the two conflict, 'Maximum wall deviation' " -"takes precedence." -msgstr "" -"ค่าเบี่ยงเบนสูงสุดที่อนุญาตเมื่อลดความละเอียดสำหรับการตั้งค่า 'ความละเอียดสูงสุดของผนัง' " -"หากเพิ่มค่านี้ การพิมพ์จะแม่นยำน้อยลง แต่ G-Code จะน้อยลง 'ค่าเบี่ยงเบนของผนังสูงสุด' จะจำกัด " -"'ความละเอียดของผนังสูงสุด' ดังนั้นหากทั้งสองข้อขัดแย้งกัน 'ค่าเบี่ยงเบนของผนังสูงสุด' " -"จะมีความสำคัญเหนือกว่า" +msgid "The maximum deviation allowed when reducing the resolution for the 'Maximum wall resolution' setting. If you increase this, the print will be less accurate, but the G-Code will be smaller. 'Maximum wall deviation' limits 'Maximum wall resolution', so if the two conflict, 'Maximum wall deviation' takes precedence." +msgstr "ค่าเบี่ยงเบนสูงสุดที่อนุญาตเมื่อลดความละเอียดสำหรับการตั้งค่า 'ความละเอียดสูงสุดของผนัง' หากเพิ่มค่านี้ การพิมพ์จะแม่นยำน้อยลง แต่ G-Code จะน้อยลง 'ค่าเบี่ยงเบนของผนังสูงสุด' จะจำกัด 'ความละเอียดของผนังสูงสุด' ดังนั้นหากทั้งสองข้อขัดแย้งกัน 'ค่าเบี่ยงเบนของผนังสูงสุด' จะมีความสำคัญเหนือกว่า" msgid "First layer minimum wall width" msgstr "ความกว้างขั้นต่ำของผนังชั้นแรก" -msgid "" -"The minimum wall width that should be used for the first layer is " -"recommended to be set to the same size as the nozzle. This adjustment is " -"expected to enhance adhesion." -msgstr "" -"แนะนำให้กำหนดความกว้างของผนังขั้นต่ำที่ควรใช้สำหรับชั้นแรกให้เป็นขนาดเดียวกับหัวฉีด " -"การปรับนี้คาดว่าจะช่วยเพิ่มการยึดเกาะ" +msgid "The minimum wall width that should be used for the first layer is recommended to be set to the same size as the nozzle. This adjustment is expected to enhance adhesion." +msgstr "แนะนำให้กำหนดความกว้างของผนังขั้นต่ำที่ควรใช้สำหรับชั้นแรกให้เป็นขนาดเดียวกับหัวฉีด การปรับนี้คาดว่าจะช่วยเพิ่มการยึดเกาะ" msgid "Minimum wall width" msgstr "ความกว้างของผนังขั้นต่ำ" -msgid "" -"Width of the wall that will replace thin features (according to the Minimum " -"feature size) of the model. If the Minimum wall width is thinner than the " -"thickness of the feature, the wall will become as thick as the feature " -"itself. It's expressed as a percentage over nozzle diameter." -msgstr "" -"ความกว้างของผนังที่จะมาแทนที่คุณสมบัติบาง (ตามขนาดคุณสมบัติขั้นต่ำ) ของแบบจำลอง " -"หากความกว้างของผนังขั้นต่ำบางกว่าความหนาของคุณสมบัติ ผนังจะหนาเท่ากับคุณสมบัตินั้นเอง " -"โดยแสดงเป็นเปอร์เซ็นต์ของเส้นผ่านศูนย์กลางของหัวฉีด" +msgid "Width of the wall that will replace thin features (according to the Minimum feature size) of the model. If the Minimum wall width is thinner than the thickness of the feature, the wall will become as thick as the feature itself. It's expressed as a percentage over nozzle diameter." +msgstr "ความกว้างของผนังที่จะมาแทนที่คุณสมบัติบาง (ตามขนาดคุณสมบัติขั้นต่ำ) ของแบบจำลอง หากความกว้างของผนังขั้นต่ำบางกว่าความหนาของคุณสมบัติ ผนังจะหนาเท่ากับคุณสมบัตินั้นเอง โดยแสดงเป็นเปอร์เซ็นต์ของเส้นผ่านศูนย์กลางของหัวฉีด" msgid "Detect narrow internal solid infills" msgstr "ตรวจจับไส้ในของแข็งภายในที่แคบ" -msgid "" -"This option will auto-detect narrow internal solid infill areas. If enabled, " -"the concentric pattern will be used for the area to speed up printing. " -"Otherwise, the rectilinear pattern will be used by default." -msgstr "" -"ตัวเลือกนี้จะตรวจจับพื้นที่ไส้ในของแข็งภายในที่แคบโดยอัตโนมัติ หากเปิดใช้งาน " -"ระบบจะใช้รูปแบบศูนย์กลางสำหรับพื้นที่เพื่อเพิ่มความเร็วในการพิมพ์ มิฉะนั้น " -"ระบบจะใช้รูปแบบเส้นตรงเป็นค่าเริ่มต้น" +msgid "This option will auto-detect narrow internal solid infill areas. If enabled, the concentric pattern will be used for the area to speed up printing. Otherwise, the rectilinear pattern will be used by default." +msgstr "ตัวเลือกนี้จะตรวจจับพื้นที่ไส้ในของแข็งภายในที่แคบโดยอัตโนมัติ หากเปิดใช้งาน ระบบจะใช้รูปแบบศูนย์กลางสำหรับพื้นที่เพื่อเพิ่มความเร็วในการพิมพ์ มิฉะนั้น ระบบจะใช้รูปแบบเส้นตรงเป็นค่าเริ่มต้น" msgid "invalid value " msgstr "ค่าไม่ถูกต้อง" @@ -18894,14 +15684,10 @@ msgstr "การนับซ้ำของทั้งโมเดล" msgid "Ensure on bed" msgstr "มั่นใจบนฐานพิมพ์" -msgid "" -"Lift the object above the bed when it is partially below. Disabled by " -"default." +msgid "Lift the object above the bed when it is partially below. Disabled by default." msgstr "ยกสิ่งของไว้เหนือฐานพิมพ์เมื่ออยู่ด้านล่างบางส่วน ปิดใช้งานตามค่าเริ่มต้น" -msgid "" -"Arrange the supplied models in a plate and merge them in a single model in " -"order to perform actions once." +msgid "Arrange the supplied models in a plate and merge them in a single model in order to perform actions once." msgstr "จัดเรียงโมเดลที่ให้มาในจานและรวมเข้าด้วยกันเป็นโมเดลเดียวเพื่อดำเนินการเพียงครั้งเดียว" msgid "Convert Unit" @@ -18961,24 +15747,19 @@ msgstr "โคลนวัตถุในรายการโหลด" msgid "Load uptodate process/machine settings when using uptodate" msgstr "โหลดการตั้งค่ากระบวนการ/เครื่อง uptodate เมื่อใช้ uptodate" -msgid "" -"load up-to-date process/machine settings from the specified file when using " -"up-to-date" +msgid "load up-to-date process/machine settings from the specified file when using up-to-date" msgstr "โหลดการตั้งค่ากระบวนการ/เครื่อง uptodate จากไฟล์ที่ระบุเมื่อใช้ uptodate" msgid "Load uptodate filament settings when using uptodate" msgstr "โหลดการตั้งค่าเส้นพลาสติก uptodate เมื่อใช้ uptodate" -msgid "" -"Load uptodate filament settings from the specified file when using uptodate." +msgid "Load uptodate filament settings from the specified file when using uptodate." msgstr "โหลดการตั้งค่าเส้นพลาสติก uptodate จากไฟล์ที่ระบุเมื่อใช้ uptodate" msgid "Downward machines check" msgstr "เช็คเครื่องลง" -msgid "" -"If enabled, check whether current machine downward compatible with the " -"machines in the list." +msgid "If enabled, check whether current machine downward compatible with the machines in the list." msgstr "หากเปิดใช้งาน ให้ตรวจสอบว่าเครื่องปัจจุบันรุ่นล่างเข้ากันได้กับเครื่องในรายการหรือไม่" msgid "Downward machines settings" @@ -18996,13 +15777,8 @@ msgstr "โหลดรายการวัตถุประกอบจาก msgid "Data directory" msgstr "ไดเร็กทอรีข้อมูล" -msgid "" -"Load and store settings at the given directory. This is useful for " -"maintaining different profiles or including configurations from a network " -"storage." -msgstr "" -"โหลดและจัดเก็บการตั้งค่าไว้ที่ไดเร็กทอรีที่กำหนด " -"สิ่งนี้มีประโยชน์สำหรับการรักษาโปรไฟล์ที่แตกต่างกันหรือรวมถึงการกำหนดค่าจากที่จัดเก็บข้อมูลเครือข่าย" +msgid "Load and store settings at the given directory. This is useful for maintaining different profiles or including configurations from a network storage." +msgstr "โหลดและจัดเก็บการตั้งค่าไว้ที่ไดเร็กทอรีที่กำหนด สิ่งนี้มีประโยชน์สำหรับการรักษาโปรไฟล์ที่แตกต่างกันหรือรวมถึงการกำหนดค่าจากที่จัดเก็บข้อมูลเครือข่าย" msgid "Output directory" msgstr "ไดเร็กทอรีเอาต์พุต" @@ -19013,12 +15789,8 @@ msgstr "ไดเร็กทอรีเอาต์พุตสำหรับ msgid "Debug level" msgstr "ระดับการแก้ไขข้อบกพร่อง" -msgid "" -"Sets debug logging level. 0:fatal, 1:error, 2:warning, 3:info, 4:debug, 5:" -"trace\n" -msgstr "" -"ตั้งค่าระดับการบันทึกการดีบัก 0: ร้ายแรง, 1: ข้อผิดพลาด, 2: คำเตือน, 3: ข้อมูล, 4: ดีบัก, 5: " -"ติดตาม\n" +msgid "Sets debug logging level. 0:fatal, 1:error, 2:warning, 3:info, 4:debug, 5:trace\n" +msgstr "ตั้งค่าระดับการบันทึกการดีบัก 0: ร้ายแรง, 1: ข้อผิดพลาด, 2: คำเตือน, 3: ข้อมูล, 4: ดีบัก, 5: ติดตาม\n" msgid "Log file" msgstr "ไฟล์บันทึก" @@ -19059,9 +15831,7 @@ msgstr "หากเปิดใช้งาน การจัดเรีย msgid "Avoid extrusion calibrate region when arranging" msgstr "หลีกเลี่ยงการปรับเทียบขอบเขตการอัดขึ้นรูปเมื่อทำการจัดเรียง" -msgid "" -"If enabled, Arrange will avoid extrusion calibrate region when placing " -"objects." +msgid "If enabled, Arrange will avoid extrusion calibrate region when placing objects." msgstr "หากเปิดใช้งาน Arrange จะหลีกเลี่ยงขอบเขตการปรับเทียบการอัดขึ้นรูปเมื่อวางวัตถุ" msgid "Skip modified G-code in 3MF" @@ -19106,23 +15876,11 @@ msgstr "Z-hop ปัจจุบัน" msgid "Contains Z-hop present at the beginning of the custom G-code block." msgstr "มี Z-hop อยู่ที่จุดเริ่มต้นของบล็อก G-code ที่กำหนดเอง" -msgid "" -"Position of the extruder at the beginning of the custom G-code block. If the " -"custom G-code travels somewhere else, it should write to this variable so " -"OrcaSlicer knows where it travels from when it gets control back." -msgstr "" -"ตำแหน่งของชุดดันเส้นที่จุดเริ่มต้นของบล็อก G-code แบบกำหนดเอง หาก G-code " -"แบบกำหนดเองเดินทางไปที่อื่น ควรเขียนลงในตัวแปรนี้เพื่อให้ OrcaSlicer " -"รู้ว่าโค้ดเดินทางจากที่ใดเมื่อได้รับการควบคุมกลับ" +msgid "Position of the extruder at the beginning of the custom G-code block. If the custom G-code travels somewhere else, it should write to this variable so OrcaSlicer knows where it travels from when it gets control back." +msgstr "ตำแหน่งของชุดดันเส้นที่จุดเริ่มต้นของบล็อก G-code แบบกำหนดเอง หาก G-code แบบกำหนดเองเดินทางไปที่อื่น ควรเขียนลงในตัวแปรนี้เพื่อให้ OrcaSlicer รู้ว่าโค้ดเดินทางจากที่ใดเมื่อได้รับการควบคุมกลับ" -msgid "" -"Retraction state at the beginning of the custom G-code block. If the custom " -"G-code moves the extruder axis, it should write to this variable so " -"OrcaSlicer de-retracts correctly when it gets control back." -msgstr "" -"สถานะการเพิกถอนที่จุดเริ่มต้นของบล็อก G-code ที่กำหนดเอง หาก G-code " -"แบบกำหนดเองย้ายแกนชุดดันเส้น ควรเขียนลงในตัวแปรนี้เพื่อให้ OrcaSlicer " -"ยกเลิกการดึงกลับอย่างถูกต้องเมื่อได้รับการควบคุมกลับ" +msgid "Retraction state at the beginning of the custom G-code block. If the custom G-code moves the extruder axis, it should write to this variable so OrcaSlicer de-retracts correctly when it gets control back." +msgstr "สถานะการเพิกถอนที่จุดเริ่มต้นของบล็อก G-code ที่กำหนดเอง หาก G-code แบบกำหนดเองย้ายแกนชุดดันเส้น ควรเขียนลงในตัวแปรนี้เพื่อให้ OrcaSlicer ยกเลิกการดึงกลับอย่างถูกต้องเมื่อได้รับการควบคุมกลับ" msgid "Extra de-retraction" msgstr "การยกเลิกการดึงกลับเพิ่มเติม" @@ -19133,9 +15891,7 @@ msgstr "การดันเส้นเตรียมชุดดันเส msgid "Absolute E position" msgstr "ตำแหน่งสัมบูรณ์ E" -msgid "" -"Current position of the extruder axis. Only used with absolute extruder " -"addressing." +msgid "Current position of the extruder axis. Only used with absolute extruder addressing." msgstr "ตำแหน่งปัจจุบันของแกนชุดดันเส้น ใช้กับการกำหนดที่อยู่ของชุดดันเส้นแบบสัมบูรณ์เท่านั้น" msgid "Current extruder" @@ -19147,9 +15903,7 @@ msgstr "ดัชนีค่าศูนย์ของชุดดันเส msgid "Current object index" msgstr "ดัชนีวัตถุปัจจุบัน" -msgid "" -"Specific for sequential printing. Zero-based index of currently printed " -"object." +msgid "Specific for sequential printing. Zero-based index of currently printed object." msgstr "เฉพาะสำหรับการพิมพ์ตามลำดับ ดัชนีแบบศูนย์ของวัตถุที่พิมพ์ในปัจจุบัน" msgid "Has wipe tower" @@ -19161,32 +15915,25 @@ msgstr "มีการสร้างเช็ดทาวเวอร์ใน msgid "Initial extruder" msgstr "ชุดดันเส้นเริ่มต้น" -msgid "" -"Zero-based index of the first extruder used in the print. Same as " -"initial_tool." +msgid "Zero-based index of the first extruder used in the print. Same as initial_tool." msgstr "ดัชนีแบบศูนย์ของชุดดันเส้นตัวแรกที่ใช้ในการพิมพ์ เช่นเดียวกับ Initial_tool" msgid "Initial tool" msgstr "เครื่องมือเริ่มต้น" -msgid "" -"Zero-based index of the first extruder used in the print. Same as " -"initial_extruder." +msgid "Zero-based index of the first extruder used in the print. Same as initial_extruder." msgstr "ดัชนีแบบศูนย์ของชุดดันเส้นตัวแรกที่ใช้ในการพิมพ์ เช่นเดียวกับ Initial_extruder" msgid "Is extruder used?" msgstr "ใช้ชุดดันเส้นหรือไม่?" -msgid "" -"Vector of booleans stating whether a given extruder is used in the print." +msgid "Vector of booleans stating whether a given extruder is used in the print." msgstr "เวกเตอร์ของบูลีนที่ระบุว่ามีการใช้ชุดดันเส้นที่กำหนดในการพิมพ์หรือไม่" msgid "Number of extruders" msgstr "จำนวนชุดดันเส้น" -msgid "" -"Total number of extruders, regardless of whether they are used in the " -"current print." +msgid "Total number of extruders, regardless of whether they are used in the current print." msgstr "จำนวนชุดดันเส้นทั้งหมด ไม่ว่าจะใช้ในการพิมพ์ปัจจุบันหรือไม่ก็ตาม" msgid "Has single extruder MM priming" @@ -19216,19 +15963,13 @@ msgstr "ปริมาตรรวมของเส้นพลาสติก msgid "Weight per extruder" msgstr "น้ำหนักต่อชุดดันเส้น" -msgid "" -"Weight per extruder extruded during the entire print. Calculated from " -"filament_density value in Filament Settings." -msgstr "" -"น้ำหนักต่อชุดดันเส้นที่อัดออกมาระหว่างการพิมพ์ทั้งหมด คำนวณจากค่า fil_density " -"ในการตั้งค่าเส้นพลาสติก" +msgid "Weight per extruder extruded during the entire print. Calculated from filament_density value in Filament Settings." +msgstr "น้ำหนักต่อชุดดันเส้นที่อัดออกมาระหว่างการพิมพ์ทั้งหมด คำนวณจากค่า fil_density ในการตั้งค่าเส้นพลาสติก" msgid "Total weight" msgstr "น้ำหนักรวม" -msgid "" -"Total weight of the print. Calculated from filament_density value in " -"Filament Settings." +msgid "Total weight of the print. Calculated from filament_density value in Filament Settings." msgstr "น้ำหนักรวมของการพิมพ์ คำนวณจากค่า fil_density ในการตั้งค่าเส้นพลาสติก" msgid "Total layer count" @@ -19240,18 +15981,11 @@ msgstr "จำนวนชั้นในการพิมพ์ทั้งห msgid "Print time (normal mode)" msgstr "เวลาในการพิมพ์ (โหมดปกติ)" -msgid "" -"Estimated print time when printed in normal mode (i.e. not in silent mode). " -"Same as print_time." -msgstr "" -"เวลาพิมพ์โดยประมาณเมื่อพิมพ์ในโหมดปกติ (เช่น ไม่อยู่ในโหมดเงียบ) เช่นเดียวกับ print_time" +msgid "Estimated print time when printed in normal mode (i.e. not in silent mode). Same as print_time." +msgstr "เวลาพิมพ์โดยประมาณเมื่อพิมพ์ในโหมดปกติ (เช่น ไม่อยู่ในโหมดเงียบ) เช่นเดียวกับ print_time" -msgid "" -"Estimated print time when printed in normal mode (i.e. not in silent mode). " -"Same as normal_print_time." -msgstr "" -"เวลาพิมพ์โดยประมาณเมื่อพิมพ์ในโหมดปกติ (เช่น ไม่อยู่ในโหมดเงียบ) " -"เช่นเดียวกับเวลาปกติ_print_time" +msgid "Estimated print time when printed in normal mode (i.e. not in silent mode). Same as normal_print_time." +msgstr "เวลาพิมพ์โดยประมาณเมื่อพิมพ์ในโหมดปกติ (เช่น ไม่อยู่ในโหมดเงียบ) เช่นเดียวกับเวลาปกติ_print_time" msgid "Print time (silent mode)" msgstr "เวลาในการพิมพ์ (โหมดเงียบ)" @@ -19259,19 +15993,14 @@ msgstr "เวลาในการพิมพ์ (โหมดเงียบ) msgid "Estimated print time when printed in silent mode." msgstr "เวลาการพิมพ์โดยประมาณเมื่อพิมพ์ในโหมดเงียบ" -msgid "" -"Total cost of all material used in the print. Calculated from filament_cost " -"value in Filament Settings." +msgid "Total cost of all material used in the print. Calculated from filament_cost value in Filament Settings." msgstr "ต้นทุนรวมของวัสดุทั้งหมดที่ใช้ในการพิมพ์ คำนวณจากค่า fil_cost ในการตั้งค่า เส้นพลาสติก" msgid "Total wipe tower cost" msgstr "ต้นทุนเช็ดทาวเวอร์ทั้งหมด" -msgid "" -"Total cost of the material wasted on the wipe tower. Calculated from " -"filament_cost value in Filament Settings." -msgstr "" -"ต้นทุนรวมของวัสดุที่เสียไปบนไวด์ทาวเวอร์ คำนวณจากค่า fil_cost ในการตั้งค่า เส้นพลาสติก" +msgid "Total cost of the material wasted on the wipe tower. Calculated from filament_cost value in Filament Settings." +msgstr "ต้นทุนรวมของวัสดุที่เสียไปบนไวด์ทาวเวอร์ คำนวณจากค่า fil_cost ในการตั้งค่า เส้นพลาสติก" msgid "Wipe tower volume" msgstr "เช็ดปริมาตรทาวเวอร์" @@ -19288,17 +16017,13 @@ msgstr "ความยาวรวมของเส้นพลาสติก msgid "Print time (seconds)" msgstr "เวลาในการพิมพ์ (วินาที)" -msgid "" -"Total estimated print time in seconds. Replaced with actual value during " -"post-processing." +msgid "Total estimated print time in seconds. Replaced with actual value during post-processing." msgstr "เวลาพิมพ์ทั้งหมดโดยประมาณเป็นวินาที แทนที่ด้วยค่าจริงระหว่างการประมวลผลภายหลัง" msgid "Filament length (meters)" msgstr "ความยาวเส้นพลาสติก (เมตร)" -msgid "" -"Total filament length used in meters. Replaced with actual value during post-" -"processing." +msgid "Total filament length used in meters. Replaced with actual value during post-processing." msgstr "ความยาวเส้นพลาสติกทั้งหมดที่ใช้เป็นเมตร แทนที่ด้วยค่าจริงระหว่างการประมวลผลภายหลัง" msgid "Number of objects" @@ -19317,13 +16042,10 @@ msgid "Scale per object" msgstr "มาตราส่วนต่อวัตถุ" msgid "" -"Contains a string with the information about what scaling was applied to the " -"individual objects. Indexing of the objects is zero-based (first object has " -"index 0).\n" +"Contains a string with the information about what scaling was applied to the individual objects. Indexing of the objects is zero-based (first object has index 0).\n" "Example: 'x:100% y:50% z:100%'." msgstr "" -"ประกอบด้วยสตริงที่มีข้อมูลเกี่ยวกับการปรับสเกลที่ใช้กับออบเจ็กต์แต่ละรายการ " -"การทำดัชนีของวัตถุเป็นแบบศูนย์ (วัตถุแรกมีดัชนี 0)\n" +"ประกอบด้วยสตริงที่มีข้อมูลเกี่ยวกับการปรับสเกลที่ใช้กับออบเจ็กต์แต่ละรายการ การทำดัชนีของวัตถุเป็นแบบศูนย์ (วัตถุแรกมีดัชนี 0)\n" "ตัวอย่าง: 'x:100% y:50% z:100%'" msgid "Input filename without extension" @@ -19332,24 +16054,17 @@ msgstr "ป้อนชื่อไฟล์โดยไม่มีนามส msgid "Source filename of the first object, without extension." msgstr "ชื่อไฟล์ต้นฉบับของออบเจ็กต์แรก โดยไม่มีนามสกุล" -msgid "" -"The vector has two elements: X and Y coordinate of the point. Values in mm." +msgid "The vector has two elements: X and Y coordinate of the point. Values in mm." msgstr "เวกเตอร์มีสององค์ประกอบ: พิกัด X และ Y ของจุด ค่าเป็น มม." -msgid "" -"The vector has two elements: X and Y dimension of the bounding box. Values " -"in mm." +msgid "The vector has two elements: X and Y dimension of the bounding box. Values in mm." msgstr "เวกเตอร์มีสององค์ประกอบ: มิติ X และ Y ของกรอบขอบเขต ค่าเป็น มม." msgid "First layer convex hull" msgstr "ชั้นแรกเป็นตัวถังนูน" -msgid "" -"Vector of points of the first layer convex hull. Each element has the " -"following format:'[x, y]' (x and y are floating-point numbers in mm)." -msgstr "" -"เวกเตอร์ของจุดของตัวเรือนูนชั้นแรก แต่ละองค์ประกอบมีรูปแบบดังนี้:'[x, y]' (x และ y " -"เป็นตัวเลขทศนิยมในหน่วย มม.)" +msgid "Vector of points of the first layer convex hull. Each element has the following format:'[x, y]' (x and y are floating-point numbers in mm)." +msgstr "เวกเตอร์ของจุดของตัวเรือนูนชั้นแรก แต่ละองค์ประกอบมีรูปแบบดังนี้:'[x, y]' (x และ y เป็นตัวเลขทศนิยมในหน่วย มม.)" msgid "Bottom-left corner of the first layer bounding box" msgstr "มุมล่างซ้ายของกล่องขอบชั้นแรก" @@ -19396,12 +16111,8 @@ msgstr "ชื่อของค่าที่ตั้งล่วงหน้ msgid "Filament preset name" msgstr "ชื่อฟิลาเมนต์ที่ตั้งไว้ล่วงหน้า" -msgid "" -"Names of the filament presets used for slicing. The variable is a vector " -"containing one name for each extruder." -msgstr "" -"ชื่อของค่าที่ตั้งไว้ล่วงหน้าของฟิลาเมนท์ที่ใช้สำหรับการสไลซ์ " -"ตัวแปรคือเวกเตอร์ที่มีชื่อเดียวสำหรับชุดดันเส้นแต่ละเครื่อง" +msgid "Names of the filament presets used for slicing. The variable is a vector containing one name for each extruder." +msgstr "ชื่อของค่าที่ตั้งไว้ล่วงหน้าของฟิลาเมนท์ที่ใช้สำหรับการสไลซ์ ตัวแปรคือเวกเตอร์ที่มีชื่อเดียวสำหรับชุดดันเส้นแต่ละเครื่อง" msgid "Printer preset name" msgstr "ชื่อที่ตั้งไว้ล่วงหน้าของเครื่องพิมพ์" @@ -19424,9 +16135,7 @@ msgstr "ดัชนีของเลเยอร์ปัจจุบัน msgid "Layer Z" msgstr "เลเยอร์ Z" -msgid "" -"Height of the current layer above the print bed, measured to the top of the " -"layer." +msgid "Height of the current layer above the print bed, measured to the top of the layer." msgstr "ความสูงของเลเยอร์ปัจจุบันเหนือฐานพิมพ์พิมพ์ วัดจนถึงด้านบนของเลเยอร์" msgid "Maximal layer Z" @@ -19469,9 +16178,7 @@ msgid "large overhangs" msgstr "ส่วนยื่นขนาดใหญ่" #, c-format, boost-format -msgid "" -"It seems object %s has %s. Please re-orient the object or enable support " -"generation." +msgid "It seems object %s has %s. Please re-orient the object or enable support generation." msgstr "ดูเหมือนว่าวัตถุ %s มี %s โปรดปรับทิศทางวัตถุใหม่หรือเปิดใช้งานการสร้างส่วนรองรับ" msgid "Generating support" @@ -19483,24 +16190,18 @@ msgstr "กำลังปรับเส้นทางพิมพ์ให้ msgid "Slicing mesh" msgstr "กำลังสไลซ์เมช" -msgid "" -"No layers were detected. You might want to repair your STL file(s) or check " -"their size or thickness and retry.\n" -msgstr "" -"ไม่พบเลเยอร์ คุณอาจต้องการซ่อมแซมไฟล์ STL ของคุณ " -"หรือตรวจสอบขนาดหรือความหนาแล้วลองอีกครั้ง\n" +msgid "No layers were detected. You might want to repair your STL file(s) or check their size or thickness and retry.\n" +msgstr "ไม่พบเลเยอร์ คุณอาจต้องการซ่อมแซมไฟล์ STL ของคุณ หรือตรวจสอบขนาดหรือความหนาแล้วลองอีกครั้ง\n" msgid "" -"An object's XY size compensation will not be used because it is also color-" -"painted.\n" +"An object's XY size compensation will not be used because it is also color-painted.\n" "XY Size compensation cannot be combined with color-painting." msgstr "" "การชดเชยขนาด XY ของวัตถุจะไม่ถูกนำมาใช้เนื่องจากวัตถุนั้นถูกลงสีด้วย\n" "การชดเชยขนาด XY ไม่สามารถใช้ร่วมกับการวาดภาพสีได้" msgid "" -"An object has enabled XY Size compensation which will not be used because it " -"is also fuzzy skin painted.\n" +"An object has enabled XY Size compensation which will not be used because it is also fuzzy skin painted.\n" "XY Size compensation cannot be combined with fuzzy skin painting." msgstr "" "วัตถุได้เปิดใช้งานการชดเชยขนาด XY ซึ่งจะไม่ถูกใช้เนื่องจากเป็นสีที่ไม่ชัดเจนเช่นกัน\n" @@ -19521,9 +16222,7 @@ msgstr "การประสานไฟล์โมเดลล้มเหล msgid "The supplied file couldn't be read because it's empty." msgstr "ไม่สามารถอ่านไฟล์ที่ให้มาได้เนื่องจากไฟล์ว่างเปล่า" -msgid "" -"Unknown file format: input file must have .stl, .obj, or .amf(.xml) " -"extension." +msgid "Unknown file format: input file must have .stl, .obj, or .amf(.xml) extension." msgstr "รูปแบบไฟล์ที่ไม่รู้จัก ไฟล์อินพุตต้องมีนามสกุล .stl, .obj, .amf(.xml)" msgid "Unknown file format: input file must have .3mf or .zip.amf extension." @@ -19580,8 +16279,7 @@ msgstr "เสร็จ" msgid "How can I use calibration results?" msgstr "จะใช้ผลการสอบเทียบได้อย่างไร?" -msgid "" -"You could change the Flow Dynamics Calibration Factor in material editing" +msgid "You could change the Flow Dynamics Calibration Factor in material editing" msgstr "คุณสามารถเปลี่ยน Flow Dynamics Calibration Factor ในการแก้ไขวัสดุได้" msgid "" @@ -19640,8 +16338,7 @@ msgstr "สร้างค่าที่ตั้งล่วงหน้าใ msgid "Could not find parameter: %s." msgstr "ไม่พบพารามิเตอร์: %s" -msgid "" -"Are you sure to cancel the current calibration and return to the home page?" +msgid "Are you sure to cancel the current calibration and return to the home page?" msgstr "คุณแน่ใจหรือไม่ว่าจะยกเลิกการสอบเทียบปัจจุบันและกลับสู่หน้าแรก" msgid "No Printer Connected!" @@ -19657,47 +16354,30 @@ msgid "The input value size must be 3." msgstr "ขนาดค่าอินพุตต้องเป็น 3" msgid "" -"This machine type can only hold 16 historical results per nozzle. You can " -"delete the existing historical results and then start calibration. Or you " -"can continue the calibration, but you cannot create new calibration " -"historical results.\n" +"This machine type can only hold 16 historical results per nozzle. You can delete the existing historical results and then start calibration. Or you can continue the calibration, but you cannot create new calibration historical results.\n" "Do you still want to continue the calibration?" msgstr "" -"เครื่องประเภทนี้สามารถเก็บผลลัพธ์ประวัติได้ 16 รายการต่อหัวฉีดเท่านั้น " -"คุณสามารถลบผลลัพธ์ในอดีตที่มีอยู่แล้วเริ่มการสอบเทียบได้ หรือคุณสามารถดำเนินการสอบเทียบต่อไปได้ " -"แต่คุณไม่สามารถสร้างผลลัพธ์ในอดีตของการสอบเทียบใหม่ได้\n" +"เครื่องประเภทนี้สามารถเก็บผลลัพธ์ประวัติได้ 16 รายการต่อหัวฉีดเท่านั้น คุณสามารถลบผลลัพธ์ในอดีตที่มีอยู่แล้วเริ่มการสอบเทียบได้ หรือคุณสามารถดำเนินการสอบเทียบต่อไปได้ แต่คุณไม่สามารถสร้างผลลัพธ์ในอดีตของการสอบเทียบใหม่ได้\n" "คุณยังต้องการทำการสอบเทียบต่อไปหรือไม่" #, c-format, boost-format -msgid "" -"Only one of the results with the same name: %s will be saved. Are you sure " -"you want to override the other results?" -msgstr "" -"มีเพียงผลลัพธ์เดียวเท่านั้นที่มีชื่อเดียวกัน: %s จะถูกบันทึก คุณแน่ใจหรือไม่ว่าต้องการแทนที่ผลลัพธ์อื่นๆ" +msgid "Only one of the results with the same name: %s will be saved. Are you sure you want to override the other results?" +msgstr "มีเพียงผลลัพธ์เดียวเท่านั้นที่มีชื่อเดียวกัน: %s จะถูกบันทึก คุณแน่ใจหรือไม่ว่าต้องการแทนที่ผลลัพธ์อื่นๆ" + +#, c-format, boost-format +msgid "There is already a previous calibration result with the same name: %s. Only one result with a name is saved. Are you sure you want to overwrite the previous result?" +msgstr "มีผลการสอบเทียบในอดีตที่มีชื่อเดียวกันอยู่แล้ว: %s บันทึกผลลัพธ์ที่มีชื่อเดียวกันเพียงรายการเดียวเท่านั้น คุณแน่ใจหรือไม่ว่าต้องการแทนที่ผลลัพธ์ในอดีต" #, c-format, boost-format msgid "" -"There is already a previous calibration result with the same name: %s. Only " -"one result with a name is saved. Are you sure you want to overwrite the " -"previous result?" -msgstr "" -"มีผลการสอบเทียบในอดีตที่มีชื่อเดียวกันอยู่แล้ว: %s บันทึกผลลัพธ์ที่มีชื่อเดียวกันเพียงรายการเดียวเท่านั้น " -"คุณแน่ใจหรือไม่ว่าต้องการแทนที่ผลลัพธ์ในอดีต" - -#, c-format, boost-format -msgid "" -"Within the same extruder, the name(%s) must be unique when the filament " -"type, nozzle diameter, and nozzle flow are the same.\n" +"Within the same extruder, the name(%s) must be unique when the filament type, nozzle diameter, and nozzle flow are the same.\n" "Are you sure you want to override the historical result?" msgstr "" -"ภายในชุดดันเส้นเดียวกัน ชื่อ(%s) จะต้องไม่ซ้ำกันเมื่อประเภทเส้นพลาสติก เส้นผ่านศูนย์กลางของหัวฉีด " -"และการไหลของหัวฉีดเหมือนกัน\n" +"ภายในชุดดันเส้นเดียวกัน ชื่อ(%s) จะต้องไม่ซ้ำกันเมื่อประเภทเส้นพลาสติก เส้นผ่านศูนย์กลางของหัวฉีด และการไหลของหัวฉีดเหมือนกัน\n" "คุณแน่ใจหรือไม่ว่าต้องการแทนที่ผลลัพธ์ในอดีต" #, c-format, boost-format -msgid "" -"This machine type can only hold %d historical results per nozzle. This " -"result will not be saved." +msgid "This machine type can only hold %d historical results per nozzle. This result will not be saved." msgstr "ประเภทเครื่องนี้สามารถเก็บผลลัพธ์ประวัติได้เพียง %d รายการต่อหัวฉีด ผลลัพธ์นี้จะไม่ถูกบันทึก" msgid "Connecting to printer..." @@ -19725,18 +16405,12 @@ msgid "When do you need Flow Dynamics Calibration" msgstr "เมื่อใดที่คุณต้องการ Flow Dynamics Calibration" msgid "" -"We now have added the auto-calibration for different filaments, which is " -"fully automated and the result will be saved into the printer for future " -"use. You only need to do the calibration in the following limited cases:\n" -"1. If you introduce a new filament of different brands/models or the " -"filament is damp;\n" +"We now have added the auto-calibration for different filaments, which is fully automated and the result will be saved into the printer for future use. You only need to do the calibration in the following limited cases:\n" +"1. If you introduce a new filament of different brands/models or the filament is damp;\n" "2. If the nozzle is worn out or replaced with a new one;\n" -"3. If the max volumetric speed or print temperature is changed in the " -"filament setting." +"3. If the max volumetric speed or print temperature is changed in the filament setting." msgstr "" -"ตอนนี้เราได้เพิ่มการปรับเทียบอัตโนมัติสำหรับเส้นพลาสติกต่างๆ ซึ่งเป็นระบบอัตโนมัติเต็มรูปแบบ " -"และผลลัพธ์จะถูกบันทึกไว้ในเครื่องพิมพ์เพื่อใช้ในอนาคต " -"คุณจะต้องทำการสอบเทียบเฉพาะในกรณีที่จำกัดต่อไปนี้เท่านั้น:\n" +"ตอนนี้เราได้เพิ่มการปรับเทียบอัตโนมัติสำหรับเส้นพลาสติกต่างๆ ซึ่งเป็นระบบอัตโนมัติเต็มรูปแบบ และผลลัพธ์จะถูกบันทึกไว้ในเครื่องพิมพ์เพื่อใช้ในอนาคต คุณจะต้องทำการสอบเทียบเฉพาะในกรณีที่จำกัดต่อไปนี้เท่านั้น:\n" "1. หากคุณแนะนำเส้นพลาสติกใหม่ของยี่ห้อ/รุ่นที่แตกต่างกัน หรือเส้นพลาสติกชื้น\n" "2. หากหัวฉีดชำรุดหรือเปลี่ยนหัวฉีดใหม่\n" "3. หากความเร็วปริมาตรสูงสุดหรืออุณหภูมิการพิมพ์เปลี่ยนแปลงในการตั้งค่าเส้นพลาสติก" @@ -19747,115 +16421,54 @@ msgstr "เกี่ยวกับการสอบเทียบนี้" msgid "" "Please find the details of Flow Dynamics Calibration from our wiki.\n" "\n" -"Usually the calibration is unnecessary. When you start a single color/" -"material print, with the \"flow dynamics calibration\" option checked in the " -"print start menu, the printer will follow the old way, calibrate the " -"filament before the print; When you start a multi color/material print, the " -"printer will use the default compensation parameter for the filament during " -"every filament switch which will have a good result in most cases.\n" +"Usually the calibration is unnecessary. When you start a single color/material print, with the \"flow dynamics calibration\" option checked in the print start menu, the printer will follow the old way, calibrate the filament before the print; When you start a multi color/material print, the printer will use the default compensation parameter for the filament during every filament switch which will have a good result in most cases.\n" "\n" -"Please note that there are a few cases that can make the calibration results " -"unreliable, such as insufficient adhesion on the build plate. Improving " -"adhesion can be achieved by washing the build plate or applying glue. For " -"more information on this topic, please refer to our Wiki.\n" +"Please note that there are a few cases that can make the calibration results unreliable, such as insufficient adhesion on the build plate. Improving adhesion can be achieved by washing the build plate or applying glue. For more information on this topic, please refer to our Wiki.\n" "\n" -"The calibration results have about 10 percent jitter in our test, which may " -"cause the result not exactly the same in each calibration. We are still " -"investigating the root cause to do improvements with new updates." +"The calibration results have about 10 percent jitter in our test, which may cause the result not exactly the same in each calibration. We are still investigating the root cause to do improvements with new updates." msgstr "" "โปรดดูรายละเอียดของ Flow Dynamics Calibration จากวิกิของเรา\n" "\n" -"โดยปกติแล้วการปรับเทียบจะไม่จำเป็น เมื่อคุณเริ่มพิมพ์สี/วัสดุเดียว โดยเลือกตัวเลือก \"flow " -"dynamics calibration\" ในเมนูเริ่มการพิมพ์ เครื่องพิมพ์จะปฏิบัติตามวิธีเก่า " -"ปรับเทียบเส้นพลาสติกก่อนพิมพ์ เมื่อคุณเริ่มการพิมพ์หลายสี/วัสดุ " -"เครื่องพิมพ์จะใช้พารามิเตอร์การชดเชยเริ่มต้นสำหรับเส้นพลาสติกในระหว่างการเปลี่ยนเส้นพลาสติกทุกครั้ง " -"ซึ่งจะให้ผลลัพธ์ที่ดีในกรณีส่วนใหญ่\n" +"โดยปกติแล้วการปรับเทียบจะไม่จำเป็น เมื่อคุณเริ่มพิมพ์สี/วัสดุเดียว โดยเลือกตัวเลือก \"flow dynamics calibration\" ในเมนูเริ่มการพิมพ์ เครื่องพิมพ์จะปฏิบัติตามวิธีเก่า ปรับเทียบเส้นพลาสติกก่อนพิมพ์ เมื่อคุณเริ่มการพิมพ์หลายสี/วัสดุ เครื่องพิมพ์จะใช้พารามิเตอร์การชดเชยเริ่มต้นสำหรับเส้นพลาสติกในระหว่างการเปลี่ยนเส้นพลาสติกทุกครั้ง ซึ่งจะให้ผลลัพธ์ที่ดีในกรณีส่วนใหญ่\n" "\n" -"โปรดทราบว่ามีบางกรณีที่อาจทำให้ผลการสอบเทียบไม่น่าเชื่อถือ เช่น " -"การยึดเกาะบนฐานรองพิมพ์ไม่เพียงพอ " -"การปรับปรุงการยึดเกาะสามารถทำได้โดยการล้างแผ่นฐานรองพิมพ์หรือใช้กาว " -"สำหรับข้อมูลเพิ่มเติมเกี่ยวกับหัวข้อนี้ โปรดดูที่ Wiki ของเรา\n" +"โปรดทราบว่ามีบางกรณีที่อาจทำให้ผลการสอบเทียบไม่น่าเชื่อถือ เช่น การยึดเกาะบนฐานรองพิมพ์ไม่เพียงพอ การปรับปรุงการยึดเกาะสามารถทำได้โดยการล้างแผ่นฐานรองพิมพ์หรือใช้กาว สำหรับข้อมูลเพิ่มเติมเกี่ยวกับหัวข้อนี้ โปรดดูที่ Wiki ของเรา\n" "\n" -"ผลการสอบเทียบมีความแปรปรวนประมาณ 10 เปอร์เซ็นต์ในการทดสอบของเรา " -"ซึ่งอาจทำให้ผลลัพธ์ไม่เหมือนกันทุกครั้งที่สอบเทียบ " -"เรายังคงตรวจสอบสาเหตุที่แท้จริงเพื่อปรับปรุงในอัปเดตใหม่" +"ผลการสอบเทียบมีความแปรปรวนประมาณ 10 เปอร์เซ็นต์ในการทดสอบของเรา ซึ่งอาจทำให้ผลลัพธ์ไม่เหมือนกันทุกครั้งที่สอบเทียบ เรายังคงตรวจสอบสาเหตุที่แท้จริงเพื่อปรับปรุงในอัปเดตใหม่" msgid "When to use Flow Rate Calibration" msgstr "เมื่อใดจึงจะใช้การปรับเทียบอัตราการไหล" msgid "" -"After using Flow Dynamics Calibration, there might still be some extrusion " -"issues, such as:\n" -"1. Over-Extrusion: Excess material on your printed object, forming blobs or " -"zits, or the layers seem thicker than expected and not uniform\n" -"2. Under-Extrusion: Very thin layers, weak infill strength, or gaps in the " -"top layer of the model, even when printing slowly\n" +"After using Flow Dynamics Calibration, there might still be some extrusion issues, such as:\n" +"1. Over-Extrusion: Excess material on your printed object, forming blobs or zits, or the layers seem thicker than expected and not uniform\n" +"2. Under-Extrusion: Very thin layers, weak infill strength, or gaps in the top layer of the model, even when printing slowly\n" "3. Poor Surface Quality: The surface of your prints seems rough or uneven\n" -"4. Weak Structural Integrity: Prints break easily or don't seem as sturdy as " -"they should be" +"4. Weak Structural Integrity: Prints break easily or don't seem as sturdy as they should be" msgstr "" "หลังจากใช้ Flow Dynamics Calibration แล้ว อาจยังมีปัญหาการอัดขึ้นรูปอยู่บ้าง เช่น:\n" -"1. การอัดขึ้นรูปมากเกินไป: วัสดุส่วนเกินบนวัตถุที่พิมพ์ของคุณ ก่อตัวเป็นหยดหรือสิว หรือชั้นต่างๆ " -"ดูหนากว่าที่คาดไว้และไม่สม่ำเสมอ\n" -"2. Under-Extrusion: ชั้นที่บางมาก ความแข็งแรงในไส้ในที่อ่อนแอ " -"หรือมีช่องว่างในชั้นบนสุดของแบบจำลอง แม้ว่าจะพิมพ์ช้าก็ตาม\n" +"1. การอัดขึ้นรูปมากเกินไป: วัสดุส่วนเกินบนวัตถุที่พิมพ์ของคุณ ก่อตัวเป็นหยดหรือสิว หรือชั้นต่างๆ ดูหนากว่าที่คาดไว้และไม่สม่ำเสมอ\n" +"2. Under-Extrusion: ชั้นที่บางมาก ความแข็งแรงในไส้ในที่อ่อนแอ หรือมีช่องว่างในชั้นบนสุดของแบบจำลอง แม้ว่าจะพิมพ์ช้าก็ตาม\n" "3. คุณภาพพื้นผิวไม่ดี: พื้นผิวงานพิมพ์ของคุณดูหยาบหรือไม่สม่ำเสมอ\n" "4. ความสมบูรณ์ของโครงสร้างที่อ่อนแอ: งานพิมพ์แตกหักง่ายหรือดูไม่แข็งแรงเท่าที่ควร" -msgid "" -"In addition, Flow Rate Calibration is crucial for foaming materials like LW-" -"PLA used in RC planes. These materials expand greatly when heated, and " -"calibration provides a useful reference flow rate." -msgstr "" -"นอกจากนี้ การสอบเทียบอัตราการไหลยังเป็นสิ่งสำคัญสำหรับวัสดุที่เกิดฟอง เช่น LW-PLA " -"ที่ใช้ในเครื่องบิน RC วัสดุเหล่านี้จะขยายตัวอย่างมากเมื่อถูกความร้อน " -"และการสอบเทียบจะให้อัตราการไหลอ้างอิงที่เป็นประโยชน์" +msgid "In addition, Flow Rate Calibration is crucial for foaming materials like LW-PLA used in RC planes. These materials expand greatly when heated, and calibration provides a useful reference flow rate." +msgstr "นอกจากนี้ การสอบเทียบอัตราการไหลยังเป็นสิ่งสำคัญสำหรับวัสดุที่เกิดฟอง เช่น LW-PLA ที่ใช้ในเครื่องบิน RC วัสดุเหล่านี้จะขยายตัวอย่างมากเมื่อถูกความร้อน และการสอบเทียบจะให้อัตราการไหลอ้างอิงที่เป็นประโยชน์" + +msgid "Flow Rate Calibration measures the ratio of expected to actual extrusion volumes. The default setting works well in Bambu Lab printers and official filaments as they were pre-calibrated and fine-tuned. For a regular filament, you usually won't need to perform a Flow Rate Calibration unless you still see the listed defects after you have done other calibrations. For more details, please check out the wiki article." +msgstr "การสอบเทียบอัตราการไหลจะวัดอัตราส่วนของปริมาณที่คาดหวังต่อปริมาณการอัดขึ้นรูปจริง การตั้งค่าเริ่มต้นทำงานได้ดีในเครื่องพิมพ์ Bambu Lab และเส้นพลาสติกอย่างเป็นทางการ เนื่องจากมีการสอบเทียบล่วงหน้าและปรับแต่งอย่างละเอียด สำหรับเส้นพลาสติกทั่วไป โดยปกติแล้วคุณไม่จำเป็นต้องทำการสอบเทียบอัตราการไหล เว้นแต่คุณยังคงเห็นข้อบกพร่องที่ระบุไว้หลังจากคุณทำการสอบเทียบอื่นๆ แล้ว สำหรับรายละเอียดเพิ่มเติม โปรดดูบทความวิกิ" msgid "" -"Flow Rate Calibration measures the ratio of expected to actual extrusion " -"volumes. The default setting works well in Bambu Lab printers and official " -"filaments as they were pre-calibrated and fine-tuned. For a regular " -"filament, you usually won't need to perform a Flow Rate Calibration unless " -"you still see the listed defects after you have done other calibrations. For " -"more details, please check out the wiki article." +"Auto Flow Rate Calibration utilizes Bambu Lab's Micro-Lidar technology, directly measuring the calibration patterns. However, please be advised that the efficacy and accuracy of this method may be compromised with specific types of materials. Particularly, filaments that are transparent or semi-transparent, have sparkles, or have a highly-reflective finish may not be suitable for this calibration and can produce less-than-desirable results.\n" +"\n" +"The calibration results may vary between each calibration or filament. We are still improving the accuracy and compatibility of this calibration through firmware updates over time.\n" +"\n" +"Caution: Flow Rate Calibration is an advanced process, to be attempted only by those who fully understand its purpose and implications. Incorrect usage can lead to sub-par prints or printer damage. Please make sure to carefully read and understand the process before doing it." msgstr "" -"การสอบเทียบอัตราการไหลจะวัดอัตราส่วนของปริมาณที่คาดหวังต่อปริมาณการอัดขึ้นรูปจริง " -"การตั้งค่าเริ่มต้นทำงานได้ดีในเครื่องพิมพ์ Bambu Lab และเส้นพลาสติกอย่างเป็นทางการ " -"เนื่องจากมีการสอบเทียบล่วงหน้าและปรับแต่งอย่างละเอียด สำหรับเส้นพลาสติกทั่วไป " -"โดยปกติแล้วคุณไม่จำเป็นต้องทำการสอบเทียบอัตราการไหล " -"เว้นแต่คุณยังคงเห็นข้อบกพร่องที่ระบุไว้หลังจากคุณทำการสอบเทียบอื่นๆ แล้ว สำหรับรายละเอียดเพิ่มเติม " -"โปรดดูบทความวิกิ" - -msgid "" -"Auto Flow Rate Calibration utilizes Bambu Lab's Micro-Lidar technology, " -"directly measuring the calibration patterns. However, please be advised that " -"the efficacy and accuracy of this method may be compromised with specific " -"types of materials. Particularly, filaments that are transparent or semi-" -"transparent, have sparkles, or have a highly-reflective finish may not be " -"suitable for this calibration and can produce less-than-desirable results.\n" +"การสอบเทียบอัตราการไหลอัตโนมัติใช้เทคโนโลยี Micro-Lidar ของ Bambu Lab ซึ่งวัดรูปแบบการสอบเทียบโดยตรง อย่างไรก็ตาม โปรดทราบว่าประสิทธิภาพและความแม่นยำของวิธีการนี้อาจลดลงกับวัสดุบางประเภท โดยเฉพาะอย่างยิ่ง เส้นพลาสติกที่โปร่งใสหรือกึ่งโปร่งใส มีอนุภาคเป็นประกาย หรือมีพื้นผิวที่มีการสะท้อนแสงสูง อาจไม่เหมาะสำหรับการสอบเทียบนี้ และให้ผลลัพธ์ที่ได้น้อยกว่าที่ต้องการ\n" "\n" -"The calibration results may vary between each calibration or filament. We " -"are still improving the accuracy and compatibility of this calibration " -"through firmware updates over time.\n" +"ผลการสอบเทียบอาจแตกต่างกันไปในแต่ละการสอบเทียบหรือเส้นพลาสติก เรายังคงปรับปรุงความแม่นยำและความเข้ากันได้ของการสอบเทียบนี้ผ่านการอัพเดตเฟิร์มแวร์เมื่อเวลาผ่านไป\n" "\n" -"Caution: Flow Rate Calibration is an advanced process, to be attempted only " -"by those who fully understand its purpose and implications. Incorrect usage " -"can lead to sub-par prints or printer damage. Please make sure to carefully " -"read and understand the process before doing it." -msgstr "" -"การสอบเทียบอัตราการไหลอัตโนมัติใช้เทคโนโลยี Micro-Lidar ของ Bambu Lab " -"ซึ่งวัดรูปแบบการสอบเทียบโดยตรง อย่างไรก็ตาม " -"โปรดทราบว่าประสิทธิภาพและความแม่นยำของวิธีการนี้อาจลดลงกับวัสดุบางประเภท โดยเฉพาะอย่างยิ่ง " -"เส้นพลาสติกที่โปร่งใสหรือกึ่งโปร่งใส มีอนุภาคเป็นประกาย หรือมีพื้นผิวที่มีการสะท้อนแสงสูง " -"อาจไม่เหมาะสำหรับการสอบเทียบนี้ และให้ผลลัพธ์ที่ได้น้อยกว่าที่ต้องการ\n" -"\n" -"ผลการสอบเทียบอาจแตกต่างกันไปในแต่ละการสอบเทียบหรือเส้นพลาสติก " -"เรายังคงปรับปรุงความแม่นยำและความเข้ากันได้ของการสอบเทียบนี้ผ่านการอัพเดตเฟิร์มแวร์เมื่อเวลาผ่านไป\n" -"\n" -"ข้อควรระวัง: " -"การสอบเทียบอัตราการไหลเป็นกระบวนการขั้นสูงที่จะดำเนินการได้เฉพาะผู้ที่เข้าใจวัตถุประสงค์และความหมายของกระบวนการเท่านั้น " -"การใช้งานที่ไม่ถูกต้องอาจทำให้งานพิมพ์ด้อยคุณภาพหรือเครื่องพิมพ์เสียหายได้ " -"โปรดอ่านและทำความเข้าใจกระบวนการอย่างละเอียดก่อนดำเนินการ" +"ข้อควรระวัง: การสอบเทียบอัตราการไหลเป็นกระบวนการขั้นสูงที่จะดำเนินการได้เฉพาะผู้ที่เข้าใจวัตถุประสงค์และความหมายของกระบวนการเท่านั้น การใช้งานที่ไม่ถูกต้องอาจทำให้งานพิมพ์ด้อยคุณภาพหรือเครื่องพิมพ์เสียหายได้ โปรดอ่านและทำความเข้าใจกระบวนการอย่างละเอียดก่อนดำเนินการ" msgid "When you need Max Volumetric Speed Calibration" msgstr "เมื่อคุณต้องการการสอบเทียบความเร็วตามปริมาตรสูงสุด" @@ -19875,16 +16488,10 @@ msgstr "วัสดุที่มีเส้นผ่านศูนย์ก msgid "We found the best Flow Dynamics Calibration Factor" msgstr "เราพบปัจจัยการปรับเทียบ Flow Dynamics ที่ดีที่สุด" -msgid "" -"Part of the calibration failed! You may clean the plate and retry. The " -"failed test result would be dropped." -msgstr "" -"การสอบเทียบบางส่วนล้มเหลว! คุณสามารถทำความสะอาดจานแล้วลองอีกครั้ง " -"ผลการทดสอบที่ล้มเหลวจะถูกยกเลิก" +msgid "Part of the calibration failed! You may clean the plate and retry. The failed test result would be dropped." +msgstr "การสอบเทียบบางส่วนล้มเหลว! คุณสามารถทำความสะอาดจานแล้วลองอีกครั้ง ผลการทดสอบที่ล้มเหลวจะถูกยกเลิก" -msgid "" -"*We recommend you to add brand, materia, type, and even humidity level in " -"the Name" +msgid "*We recommend you to add brand, materia, type, and even humidity level in the Name" msgstr "*เราขอแนะนำให้คุณเพิ่มแบรนด์ วัสดุ ประเภท และแม้แต่ระดับความชื้นในชื่อ" msgid "Please enter the name you want to save to printer." @@ -19957,11 +16564,8 @@ msgstr "การสอบเทียบแบบละเอียดตาม msgid "Title" msgstr "ชื่อเรื่อง" -msgid "" -"A test model will be printed. Please clear the build plate and place it back " -"to the hot bed before calibration." -msgstr "" -"แบบจำลองทดสอบจะถูกพิมพ์ โปรดเคลียร์เพลตฐานพิมพ์และวางกลับไว้บนฐานพิมพ์ร้อนก่อนทำการสอบเทียบ" +msgid "A test model will be printed. Please clear the build plate and place it back to the hot bed before calibration." +msgstr "แบบจำลองทดสอบจะถูกพิมพ์ โปรดเคลียร์เพลตฐานพิมพ์และวางกลับไว้บนฐานพิมพ์ร้อนก่อนทำการสอบเทียบ" msgid "Printing Parameters" msgstr "พารามิเตอร์การพิมพ์" @@ -19976,9 +16580,7 @@ msgid "Please connect the printer first before synchronizing." msgstr "โปรดเชื่อมต่อเครื่องพิมพ์ก่อนที่จะซิงโครไนซ์" #, c-format, boost-format -msgid "" -"Printer %s nozzle information has not been set. Please configure it before " -"proceeding with the calibration." +msgid "Printer %s nozzle information has not been set. Please configure it before proceeding with the calibration." msgstr "ข้อมูลหัวฉีดของเครื่องพิมพ์ %s ไม่ได้ถูกตั้งค่า โปรดกำหนดค่าก่อนดำเนินการสอบเทียบต่อ" msgid "AMS and nozzle information are synced" @@ -20018,22 +16620,13 @@ msgstr "%s เข้ากันไม่ได้กับ %s" msgid "TPU is not supported for Flow Dynamics Auto-Calibration." msgstr "ไม่รองรับ TPU สำหรับการปรับเทียบอัตโนมัติของ Flow Dynamics" -msgid "" -"Selected nozzle temperatures are incompatible. For multi-material printing, " -"each filament's nozzle temperature must be within the recommended nozzle " -"temperature range of the other filaments. Otherwise, nozzle clogging or " -"printer damage may occur." -msgstr "" -"อุณหภูมิหัวฉีดที่เลือกเข้ากันไม่ได้ สำหรับการพิมพ์หลายวัสดุ " -"อุณหภูมิหัวฉีดของเส้นพลาสติกแต่ละเส้นจะต้องอยู่ในช่วงอุณหภูมิหัวฉีดที่แนะนำของเส้นพลาสติกอื่นๆ " -"มิฉะนั้นอาจเกิดการอุดตันของหัวฉีดหรือเครื่องพิมพ์เสียหายได้" +msgid "Selected nozzle temperatures are incompatible. For multi-material printing, each filament's nozzle temperature must be within the recommended nozzle temperature range of the other filaments. Otherwise, nozzle clogging or printer damage may occur." +msgstr "อุณหภูมิหัวฉีดที่เลือกเข้ากันไม่ได้ สำหรับการพิมพ์หลายวัสดุ อุณหภูมิหัวฉีดของเส้นพลาสติกแต่ละเส้นจะต้องอยู่ในช่วงอุณหภูมิหัวฉีดที่แนะนำของเส้นพลาสติกอื่นๆ มิฉะนั้นอาจเกิดการอุดตันของหัวฉีดหรือเครื่องพิมพ์เสียหายได้" msgid "Sync AMS and nozzle information" msgstr "ซิงค์ข้อมูล AMS และหัวฉีด" -msgid "" -"Calibration only supports cases where the left and right nozzle diameters " -"are identical." +msgid "Calibration only supports cases where the left and right nozzle diameters are identical." msgstr "การสอบเทียบรองรับเฉพาะกรณีที่เส้นผ่านศูนย์กลางหัวฉีดซ้ายและขวาเท่ากัน" msgid "From k Value" @@ -20083,13 +16676,8 @@ msgid "Edit Flow Dynamics Calibration" msgstr "แก้ไขปรับเทียบไดนามิกการไหล" #, c-format, boost-format -msgid "" -"Within the same extruder, the name '%s' must be unique when the filament " -"type, nozzle diameter, and nozzle flow are identical. Please choose a " -"different name." -msgstr "" -"ภายในชุดดันเส้นเดียวกัน ชื่อ '%s' จะต้องไม่ซ้ำกันเมื่อประเภทเส้นพลาสติก " -"เส้นผ่านศูนย์กลางของหัวฉีด และการไหลของหัวฉีดเหมือนกัน โปรดเลือกชื่ออื่น" +msgid "Within the same extruder, the name '%s' must be unique when the filament type, nozzle diameter, and nozzle flow are identical. Please choose a different name." +msgstr "ภายในชุดดันเส้นเดียวกัน ชื่อ '%s' จะต้องไม่ซ้ำกันเมื่อประเภทเส้นพลาสติก เส้นผ่านศูนย์กลางของหัวฉีด และการไหลของหัวฉีดเหมือนกัน โปรดเลือกชื่ออื่น" msgid "New Flow Dynamic Calibration" msgstr "การสอบเทียบแบบไดนามิกของ Flow ใหม่" @@ -20300,8 +16888,7 @@ msgstr "ริงกิ้งทาวเวอร์" msgid "Fast Tower" msgstr "ฟาสท์ ทาวเวอร์" -msgid "" -"Please ensure the selected type is compatible with your firmware version." +msgid "Please ensure the selected type is compatible with your firmware version." msgstr "โปรดตรวจสอบให้แน่ใจว่าประเภทที่เลือกเข้ากันได้กับเวอร์ชันเฟิร์มแวร์ของคุณ" msgid "" @@ -20381,8 +16968,7 @@ msgstr "" "กรุณากรอกค่าที่ถูกต้อง:\n" "(0 < ความถี่ < 500)" -msgid "" -"Please input a valid damping factor (0 <= DampingStart < DampingEnd <= 1)" +msgid "Please input a valid damping factor (0 <= DampingStart < DampingEnd <= 1)" msgstr "โปรดป้อนปัจจัยการหน่วงที่ถูกต้อง (0 <= DampingStart < DampingEnd <= 1)" msgid "Cornering test" @@ -20405,21 +16991,17 @@ msgstr "หมายเหตุ: ค่าที่ต่ำกว่า = ม msgid "" "Marlin 2 Junction Deviation detected:\n" -"To test Classic Jerk, set 'Maximum Junction Deviation' in Motion ability to " -"0." +"To test Classic Jerk, set 'Maximum Junction Deviation' in Motion ability to 0." msgstr "" "ตรวจพบส่วนเบี่ยงเบนทางแยก Marlin 2:\n" -"หากต้องการทดสอบ Classic Jerk ให้ตั้งค่า 'Maximum Junction Deviation' " -"ในความสามารถในการเคลื่อนไหวเป็น 0" +"หากต้องการทดสอบ Classic Jerk ให้ตั้งค่า 'Maximum Junction Deviation' ในความสามารถในการเคลื่อนไหวเป็น 0" msgid "" "Marlin 2 Classic Jerk detected:\n" -"To test Junction Deviation, set 'Maximum Junction Deviation' in Motion " -"ability to a value > 0." +"To test Junction Deviation, set 'Maximum Junction Deviation' in Motion ability to a value > 0." msgstr "" "ตรวจพบ Marlin 2 Classic Jerk:\n" -"ในการทดสอบค่าเบี่ยงเบนของทางแยก ให้ตั้งค่า 'ค่าเบี่ยงเบนทางแยกสูงสุด' " -"ในความสามารถในการเคลื่อนที่เป็นค่า > 0" +"ในการทดสอบค่าเบี่ยงเบนของทางแยก ให้ตั้งค่า 'ค่าเบี่ยงเบนทางแยกสูงสุด' ในความสามารถในการเคลื่อนที่เป็นค่า > 0" msgid "" "RepRap detected: Jerk in mm/s.\n" @@ -20517,21 +17099,16 @@ msgstr "กำลังโหลดช่อง IFS จากเครื่อ msgid "Slice the plate first to get project material information." msgstr "สไลซ์เพลตก่อนเพื่อให้ได้ข้อมูลวัสดุของโปรเจ็กต์" -msgid "" -"This plate uses multiple materials. Enable IFS and assign each tool to a " -"printer slot." +msgid "This plate uses multiple materials. Enable IFS and assign each tool to a printer slot." msgstr "เพลตนี้ใช้หลายวัสดุ เปิดใช้ IFS และกำหนดเครื่องมือแต่ละตัวให้ช่องบนเครื่องพิมพ์" msgid "Each project material must be assigned to an IFS slot before printing." msgstr "วัสดุของแต่ละโปรเจ็กต์ต้องถูกกำหนดให้กับช่อง IFS ก่อนพิมพ์" -msgid "" -"Each project material must be assigned to a loaded IFS slot before printing." +msgid "Each project material must be assigned to a loaded IFS slot before printing." msgstr "วัสดุของแต่ละโปรเจ็กต์ต้องถูกกำหนดให้กับช่อง IFS ที่โหลดแล้วก่อนพิมพ์" -msgid "" -"Each project material must match the material loaded in the selected IFS " -"slot." +msgid "Each project material must match the material loaded in the selected IFS slot." msgstr "วัสดุของแต่ละโปรเจ็กต์ต้องตรงกับวัสดุที่โหลดในช่อง IFS ที่เลือก" msgid "Print host upload queue" @@ -20571,9 +17148,7 @@ msgstr "กำลังยกเลิก" msgid "Error uploading to print host" msgstr "เกิดข้อผิดพลาดในการอัปโหลดไปยังโฮสต์การพิมพ์" -msgid "" -"The selected bed type does not match the file. Please confirm before " -"starting the print." +msgid "The selected bed type does not match the file. Please confirm before starting the print." msgstr "ประเภทฐานพิมพ์ที่เลือกไม่ตรงกับไฟล์ โปรดยืนยันก่อนเริ่มพิมพ์" msgid "Heated Bed Leveling" @@ -20724,8 +17299,7 @@ msgstr "ไม่ได้เลือกผู้ขาย โปรดเล msgid "Custom vendor missing; please input custom vendor." msgstr "ผู้ขายที่กำหนดเองหายไป โปรดป้อนผู้ขายที่กำหนดเอง" -msgid "" -"\"Bambu\" or \"Generic\" cannot be used as a Vendor for custom filaments." +msgid "\"Bambu\" or \"Generic\" cannot be used as a Vendor for custom filaments." msgstr "ไม่สามารถใช้ \"Bambu\" หรือ \"Generic\" เป็นผู้จำหน่ายเส้นพลาสติกสั่งทำพิเศษได้" msgid "Filament type is not selected, please reselect type." @@ -20734,9 +17308,7 @@ msgstr "ไม่ได้เลือกประเภทเส้นพลา msgid "Filament serial missing; please input serial." msgstr "ไม่ได้ป้อนซีเรียลของฟิลาเมนต์ โปรดป้อนซีเรียล" -msgid "" -"There may be disallowed characters in the vendor or serial input of the " -"filament. Please delete and re-enter." +msgid "There may be disallowed characters in the vendor or serial input of the filament. Please delete and re-enter." msgstr "อาจมีอักขระที่ไม่อนุญาตในช่องผู้ผลิตหรือซีเรียลของเส้นพลาสติก โปรดลบแล้วป้อนใหม่" msgid "All inputs in the custom vendor or serial are spaces. Please re-enter." @@ -20745,15 +17317,13 @@ msgstr "อินพุตทั้งหมดในผู้จำหน่า msgid "The vendor cannot be a number; please re-enter." msgstr "ผู้ผลิตต้องไม่เป็นตัวเลข โปรดป้อนใหม่" -msgid "" -"You have not selected a printer or preset yet. Please select at least one." +msgid "You have not selected a printer or preset yet. Please select at least one." msgstr "คุณยังไม่ได้เลือกเครื่องพิมพ์หรือค่าที่ตั้งไว้ล่วงหน้า โปรดเลือกอย่างน้อยหนึ่งรายการ" #, c-format, boost-format msgid "" "The Filament name %s you created already exists.\n" -"If you continue, the preset created will be displayed with its full name. Do " -"you want to continue?" +"If you continue, the preset created will be displayed with its full name. Do you want to continue?" msgstr "" "ชื่อเส้นพลาสติก %s ที่คุณสร้างมีอยู่แล้ว\n" "หากคุณดำเนินการต่อ ค่าที่ตั้งไว้ล่วงหน้าที่สร้างขึ้นจะแสดงพร้อมชื่อเต็ม คุณต้องการดำเนินการต่อหรือไม่?" @@ -20769,8 +17339,7 @@ msgstr "" "คุณต้องการเขียนใหม่หรือไม่?" msgid "" -"We would rename the presets as \"Vendor Type Serial @printer you selected" -"\".\n" +"We would rename the presets as \"Vendor Type Serial @printer you selected\".\n" "To add preset for more printers, please go to printer selection" msgstr "" "เราจะเปลี่ยนชื่อค่าที่ตั้งล่วงหน้าเป็น \"Vendor Type Serial @printer ที่คุณเลือก\"\n" @@ -20858,30 +17427,20 @@ msgstr "เทมเพลตที่ตั้งไว้ล่วงหน้ msgid "Process Preset Template" msgstr "ประมวลผลเทมเพลตที่กำหนดไว้ล่วงหน้า" -msgid "" -"You have not yet chosen which printer preset to create based on. Please " -"choose the vendor and model of the printer" +msgid "You have not yet chosen which printer preset to create based on. Please choose the vendor and model of the printer" msgstr "คุณยังไม่ได้เลือกพรีเซ็ตเครื่องพิมพ์ที่จะใช้สร้าง โปรดเลือกผู้จำหน่ายและรุ่นของเครื่องพิมพ์" -msgid "" -"You have entered a disallowed character in the printable area section on the " -"first page. Please use only numbers." -msgstr "" -"คุณได้ป้อนข้อมูลที่ไม่ถูกต้องในส่วนพื้นที่ที่สามารถพิมพ์ได้ในหน้าแรก โปรดตรวจสอบก่อนที่จะสร้างมัน" +msgid "You have entered a disallowed character in the printable area section on the first page. Please use only numbers." +msgstr "คุณได้ป้อนข้อมูลที่ไม่ถูกต้องในส่วนพื้นที่ที่สามารถพิมพ์ได้ในหน้าแรก โปรดตรวจสอบก่อนที่จะสร้างมัน" msgid "" -"The printer preset you created already has a preset with the same name. Do " -"you want to overwrite it?\n" -"\tYes: Overwrite the printer preset with the same name, and filament and " -"process presets with the same preset name will be recreated \n" -"and filament and process presets without the same preset name will be " -"reserved.\n" +"The printer preset you created already has a preset with the same name. Do you want to overwrite it?\n" +"\tYes: Overwrite the printer preset with the same name, and filament and process presets with the same preset name will be recreated \n" +"and filament and process presets without the same preset name will be reserved.\n" "\tCancel: Do not create a preset; return to the creation interface." msgstr "" -"ค่าที่ตั้งไว้ล่วงหน้าของเครื่องพิมพ์ที่คุณสร้างมีการตั้งค่าล่วงหน้าที่มีชื่อเดียวกันอยู่แล้ว " -"คุณต้องการเขียนทับมันหรือไม่?\n" -"\tใช่: เขียนทับพรีเซ็ตเครื่องพิมพ์ด้วยชื่อเดียวกัน " -"จากนั้นฟิลาเมนต์และพรีเซ็ตกระบวนการที่มีชื่อพรีเซ็ตเดียวกันจะถูกสร้างขึ้นใหม่ \n" +"ค่าที่ตั้งไว้ล่วงหน้าของเครื่องพิมพ์ที่คุณสร้างมีการตั้งค่าล่วงหน้าที่มีชื่อเดียวกันอยู่แล้ว คุณต้องการเขียนทับมันหรือไม่?\n" +"\tใช่: เขียนทับพรีเซ็ตเครื่องพิมพ์ด้วยชื่อเดียวกัน จากนั้นฟิลาเมนต์และพรีเซ็ตกระบวนการที่มีชื่อพรีเซ็ตเดียวกันจะถูกสร้างขึ้นใหม่ \n" "และค่าที่ตั้งล่วงหน้าของเส้นพลาสติกและกระบวนการที่ไม่มีชื่อที่ตั้งไว้ล่วงหน้าเหมือนกันจะถูกสงวนไว้\n" "\tยกเลิก: อย่าสร้างค่าที่ตั้งล่วงหน้า กลับไปที่อินเทอร์เฟซการสร้าง" @@ -20903,26 +17462,19 @@ msgstr "ไม่พบผู้ขาย โปรดเลือกใหม msgid "Current vendor has no models, please reselect." msgstr "ผู้จำหน่ายปัจจุบันไม่มีรุ่น โปรดเลือกใหม่" -msgid "" -"You have not selected the vendor and model or input the custom vendor and " -"model." +msgid "You have not selected the vendor and model or input the custom vendor and model." msgstr "คุณยังไม่ได้เลือกผู้จำหน่ายและรุ่น หรือป้อนผู้จำหน่ายและรุ่นที่กำหนดเอง" -msgid "" -"There may be escape characters in the custom printer vendor or model. Please " -"delete and re-enter." +msgid "There may be escape characters in the custom printer vendor or model. Please delete and re-enter." msgstr "อาจมีอักขระหลีกในผู้จำหน่ายเครื่องพิมพ์แบบกำหนดเองหรือรุ่น กรุณาลบและป้อนใหม่" -msgid "" -"All inputs in the custom printer vendor or model are spaces. Please re-enter." +msgid "All inputs in the custom printer vendor or model are spaces. Please re-enter." msgstr "อินพุตทั้งหมดในผู้จำหน่ายเครื่องพิมพ์แบบกำหนดเองหรือรุ่นคือช่องว่าง กรุณาเข้าใหม่อีกครั้ง" msgid "Please check bed printable shape and origin input." msgstr "โปรดตรวจสอบรูปร่างที่สามารถพิมพ์ฐานพิมพ์ได้และอินพุตจุดเริ่มต้น" -msgid "" -"You have not yet selected the printer to replace the nozzle for; please " -"choose a printer." +msgid "You have not yet selected the printer to replace the nozzle for; please choose a printer." msgstr "คุณยังไม่ได้เลือกเครื่องพิมพ์ที่จะเปลี่ยนหัวฉีด โปรดเลือก" msgid "The entered nozzle diameter is invalid, please re-enter:\n" @@ -20968,25 +17520,19 @@ msgstr "สร้างเส้นพลาสติกแล้ว" msgid "" "Please go to filament settings to edit your presets if you need to.\n" -"Please note that nozzle temperature, hot bed temperature, and maximum " -"volumetric speed each have a significant impact on printing quality. Please " -"set them carefully." +"Please note that nozzle temperature, hot bed temperature, and maximum volumetric speed each have a significant impact on printing quality. Please set them carefully." msgstr "" "โปรดไปที่การตั้งค่าฟิลาเมนต์เพื่อแก้ไขค่าที่ตั้งล่วงหน้าของคุณหากคุณต้องการ\n" -"โปรดทราบว่าอุณหภูมิหัวฉีด อุณหภูมิฐานพิมพ์ร้อน " -"และความเร็วปริมาตรสูงสุดมีผลกระทบอย่างมากต่อคุณภาพการพิมพ์ โปรดตั้งค่าอย่างระมัดระวัง" +"โปรดทราบว่าอุณหภูมิหัวฉีด อุณหภูมิฐานพิมพ์ร้อน และความเร็วปริมาตรสูงสุดมีผลกระทบอย่างมากต่อคุณภาพการพิมพ์ โปรดตั้งค่าอย่างระมัดระวัง" msgid "" "\n" "\n" -"Orca has detected that your user presets synchronization function is not " -"enabled, which may result in unsuccessful Filament settings on the Device " -"page.\n" +"Orca has detected that your user presets synchronization function is not enabled, which may result in unsuccessful Filament settings on the Device page.\n" "Click \"Sync user presets\" to enable the synchronization function." msgstr "" "\n" -"Orca ตรวจพบว่าไม่ได้เปิดใช้งานฟังก์ชันการซิงโครไนซ์ที่ตั้งไว้ล่วงหน้าของผู้ใช้ของคุณ " -"ซึ่งอาจส่งผลให้การตั้งค่า เส้นพลาสติก บนหน้าอุปกรณ์ไม่สำเร็จ\n" +"Orca ตรวจพบว่าไม่ได้เปิดใช้งานฟังก์ชันการซิงโครไนซ์ที่ตั้งไว้ล่วงหน้าของผู้ใช้ของคุณ ซึ่งอาจส่งผลให้การตั้งค่า เส้นพลาสติก บนหน้าอุปกรณ์ไม่สำเร็จ\n" "คลิก \"ซิงค์การตั้งค่าล่วงหน้าของผู้ใช้\" เพื่อเปิดใช้งานฟังก์ชันการซิงโครไนซ์" msgid "Printer Setting" @@ -21027,10 +17573,8 @@ msgstr "ส่งออกสำเร็จ" #, c-format, boost-format msgid "" -"The '%s' folder already exists in the current directory. Do you want to " -"clear it and rebuild it?\n" -"If not, a time suffix will be added, and you can modify the name after " -"creation." +"The '%s' folder already exists in the current directory. Do you want to clear it and rebuild it?\n" +"If not, a time suffix will be added, and you can modify the name after creation." msgstr "" "โฟลเดอร์ '%s' มีอยู่แล้วในไดเร็กทอรีปัจจุบัน คุณต้องการล้างมันและสร้างใหม่หรือไม่\n" "หากไม่เป็นเช่นนั้น ระบบจะเพิ่มส่วนต่อท้ายเวลา และคุณสามารถแก้ไขชื่อได้หลังการสร้าง" @@ -21046,8 +17590,7 @@ msgstr "" "กรุณาปิดและลองอีกครั้ง" msgid "" -"Printer and all the filament and process presets that belongs to the " -"printer.\n" +"Printer and all the filament and process presets that belongs to the printer.\n" "Can be shared with others." msgstr "" "เครื่องพิมพ์และเส้นพลาสติกและค่าที่ตั้งล่วงหน้ากระบวนการทั้งหมดที่เป็นของเครื่องพิมพ์\n" @@ -21060,36 +17603,25 @@ msgstr "" "ชุดพรีเซ็ตเส้นพลาสติกของผู้ใช้\n" "สามารถแบ่งปันกับผู้อื่นได้" -msgid "" -"Only display printers with changes to printer, filament, and process presets " -"are displayed." -msgstr "" -"แสดงเฉพาะชื่อเครื่องพิมพ์ที่มีการเปลี่ยนแปลงเครื่องพิมพ์ เส้นพลาสติก " -"และการตั้งค่าล่วงหน้าของกระบวนการ" +msgid "Only display printers with changes to printer, filament, and process presets are displayed." +msgstr "แสดงเฉพาะชื่อเครื่องพิมพ์ที่มีการเปลี่ยนแปลงเครื่องพิมพ์ เส้นพลาสติก และการตั้งค่าล่วงหน้าของกระบวนการ" msgid "Only display the filament names with changes to filament presets." msgstr "แสดงเฉพาะชื่อเส้นพลาสติกที่มีการเปลี่ยนแปลงการตั้งค่าล่วงหน้าของเส้นพลาสติก" -msgid "" -"Only printer names with user printer presets will be displayed, and each " -"preset you choose will be exported as a zip." -msgstr "" -"เฉพาะชื่อเครื่องพิมพ์ที่มีการตั้งค่าเครื่องพิมพ์ล่วงหน้าของผู้ใช้เท่านั้นที่จะแสดง " -"และการตั้งค่าล่วงหน้าแต่ละรายการที่คุณเลือกจะถูกส่งออกเป็นไฟล์ ZIP" +msgid "Only printer names with user printer presets will be displayed, and each preset you choose will be exported as a zip." +msgstr "เฉพาะชื่อเครื่องพิมพ์ที่มีการตั้งค่าเครื่องพิมพ์ล่วงหน้าของผู้ใช้เท่านั้นที่จะแสดง และการตั้งค่าล่วงหน้าแต่ละรายการที่คุณเลือกจะถูกส่งออกเป็นไฟล์ ZIP" msgid "" "Only the filament names with user filament presets will be displayed, \n" -"and all user filament presets in each filament name you select will be " -"exported as a zip." +"and all user filament presets in each filament name you select will be exported as a zip." msgstr "" "เฉพาะชื่อเส้นพลาสติกที่มีการตั้งค่าล่วงหน้าของเส้นพลาสติกผู้ใช้เท่านั้นที่จะถูกแสดง \n" -"และค่าฟิลาเมนต์ของผู้ใช้ทั้งหมดที่กำหนดไว้ล่วงหน้าในแต่ละชื่อฟิลาเมนต์ที่คุณเลือกจะถูกส่งออกเป็นไฟล์ " -"ZIP" +"และค่าฟิลาเมนต์ของผู้ใช้ทั้งหมดที่กำหนดไว้ล่วงหน้าในแต่ละชื่อฟิลาเมนต์ที่คุณเลือกจะถูกส่งออกเป็นไฟล์ ZIP" msgid "" "Only printer names with changed process presets will be displayed, \n" -"and all user process presets in each printer name you select will be " -"exported as a zip." +"and all user process presets in each printer name you select will be exported as a zip." msgstr "" "เฉพาะชื่อเครื่องพิมพ์ที่มีการตั้งค่าล่วงหน้าของกระบวนการที่เปลี่ยนแปลงเท่านั้นที่จะปรากฏขึ้น \n" "และกระบวนการของผู้ใช้ที่ตั้งไว้ล่วงหน้าในชื่อเครื่องพิมพ์แต่ละเครื่องที่คุณเลือกจะถูกส่งออกเป็นไฟล์ ZIP" @@ -21109,12 +17641,8 @@ msgstr "แก้ไขเส้นพลาสติก" msgid "Filament presets under this filament" msgstr "เส้นพลาสติกที่ตั้งไว้ล่วงหน้าภายใต้เส้นพลาสติกนี้" -msgid "" -"Note: If the only preset under this filament is deleted, the filament will " -"be deleted after exiting the dialog." -msgstr "" -"หมายเหตุ: หากลบค่าที่กำหนดไว้ล่วงหน้าภายใต้เส้นพลาสติกนี้ " -"เส้นพลาสติกจะถูกลบหลังจากออกจากกล่องโต้ตอบ" +msgid "Note: If the only preset under this filament is deleted, the filament will be deleted after exiting the dialog." +msgstr "หมายเหตุ: หากลบค่าที่กำหนดไว้ล่วงหน้าภายใต้เส้นพลาสติกนี้ เส้นพลาสติกจะถูกลบหลังจากออกจากกล่องโต้ตอบ" msgid "Presets inherited by other presets cannot be deleted" msgstr "ค่าที่ตั้งล่วงหน้าที่สืบทอดมาจากค่าที่ตั้งล่วงหน้าอื่นไม่สามารถลบได้" @@ -21137,8 +17665,7 @@ msgstr "+ เพิ่มพรีเซ็ต" msgid "" "All the filament presets belong to this filament would be deleted.\n" -"If you are using this filament on your printer, please reset the filament " -"information for that slot." +"If you are using this filament on your printer, please reset the filament information for that slot." msgstr "" "ค่าที่ตั้งไว้ล่วงหน้าของเส้นพลาสติกทั้งหมดที่เป็นของเส้นพลาสติกนี้จะถูกลบ\n" "หากคุณใช้เส้นพลาสติกนี้กับเครื่องพิมพ์ของคุณ โปรดรีเซ็ตข้อมูลเส้นพลาสติกสำหรับช่องนั้น" @@ -21200,23 +17727,16 @@ msgstr "ต้องการเครื่องพิมพ์ที่เล msgid "The start, end or step is not valid value." msgstr "จุดเริ่มต้น สิ้นสุด หรือขั้นตอนไม่ใช่ค่าที่ถูกต้อง" -msgid "" -"The number of printer extruders and the printer selected for calibration " -"does not match." +msgid "The number of printer extruders and the printer selected for calibration does not match." msgstr "จำนวนชุดดันเส้นของเครื่องพิมพ์และเครื่องพิมพ์ที่เลือกสำหรับการสอบเทียบไม่ตรงกัน" #, c-format, boost-format -msgid "" -"The nozzle diameter of %s extruder is 0.2mm which does not support automatic " -"Flow Dynamics calibration." -msgstr "" -"เส้นผ่านศูนย์กลางหัวฉีดของชุดดันเส้น %s คือ 0.2 มม. ซึ่งไม่รองรับการสอบเทียบ Flow Dynamics " -"อัตโนมัติ" +msgid "The nozzle diameter of %s extruder is 0.2mm which does not support automatic Flow Dynamics calibration." +msgstr "เส้นผ่านศูนย์กลางหัวฉีดของชุดดันเส้น %s คือ 0.2 มม. ซึ่งไม่รองรับการสอบเทียบ Flow Dynamics อัตโนมัติ" #, c-format, boost-format msgid "" -"The currently selected nozzle diameter of %s extruder does not match the " -"actual nozzle diameter.\n" +"The currently selected nozzle diameter of %s extruder does not match the actual nozzle diameter.\n" "Please click the Sync button above and restart the calibration." msgstr "" "เส้นผ่านศูนย์กลางหัวฉีดที่เลือกในปัจจุบันของชุดดันเส้น %s ไม่ตรงกับเส้นผ่านศูนย์กลางหัวฉีดจริง\n" @@ -21231,18 +17751,14 @@ msgstr "" #, c-format, boost-format msgid "" -"The currently selected nozzle type of %s extruder does not match the actual " -"printer nozzle type.\n" +"The currently selected nozzle type of %s extruder does not match the actual printer nozzle type.\n" "Please click the Sync button above and restart the calibration." msgstr "" "ประเภทหัวฉีดที่เลือกในปัจจุบันของชุดดันเส้น %s ไม่ตรงกับประเภทหัวฉีดของเครื่องพิมพ์จริง\n" "โปรดคลิกปุ่มซิงค์ด้านบนแล้วเริ่มการปรับเทียบใหม่" -msgid "" -"Unable to calibrate: maybe because the set calibration value range is too " -"large, or the step is too small" -msgstr "" -"ไม่สามารถสอบเทียบ: อาจเป็นเพราะช่วงค่าการสอบเทียบที่ตั้งไว้ใหญ่เกินไป หรือขั้นตอนเล็กเกินไป" +msgid "Unable to calibrate: maybe because the set calibration value range is too large, or the step is too small" +msgstr "ไม่สามารถสอบเทียบ: อาจเป็นเพราะช่วงค่าการสอบเทียบที่ตั้งไว้ใหญ่เกินไป หรือขั้นตอนเล็กเกินไป" msgid "Physical Printer" msgstr "เครื่องพิมพ์ทางกายภาพ" @@ -21250,12 +17766,8 @@ msgstr "เครื่องพิมพ์ทางกายภาพ" msgid "Print Host upload" msgstr "อัพโหลดโฮสต์การพิมพ์" -msgid "" -"Select the network agent implementation for printer communication. Available " -"agents are registered at startup." -msgstr "" -"เลือกการใช้งานตัวแทนเครือข่ายสำหรับการสื่อสารของเครื่องพิมพ์ " -"ตัวแทนที่มีอยู่จะได้รับการลงทะเบียนเมื่อเริ่มต้น" +msgid "Select the network agent implementation for printer communication. Available agents are registered at startup." +msgstr "เลือกการใช้งานตัวแทนเครือข่ายสำหรับการสื่อสารของเครื่องพิมพ์ ตัวแทนที่มีอยู่จะได้รับการลงทะเบียนเมื่อเริ่มต้น" msgid "Select a Flashforge printer" msgstr "เลือกเครื่องพิมพ์ Flashforge" @@ -21281,11 +17793,8 @@ msgstr "ดู webui โฮสต์การพิมพ์ในแท็บ msgid "Replace the BambuLab's device tab with print host webui" msgstr "แทนที่แท็บอุปกรณ์ของ BambuLab ด้วย webui โฮสต์การพิมพ์" -msgid "" -"HTTPS CA file is optional. It is only needed if you use HTTPS with a self-" -"signed certificate." -msgstr "" -"ไฟล์ HTTPS CA เป็นทางเลือก จำเป็นเฉพาะเมื่อคุณใช้ HTTPS กับใบรับรองที่ลงนามด้วยตนเอง" +msgid "HTTPS CA file is optional. It is only needed if you use HTTPS with a self-signed certificate." +msgstr "ไฟล์ HTTPS CA เป็นทางเลือก จำเป็นเฉพาะเมื่อคุณใช้ HTTPS กับใบรับรองที่ลงนามด้วยตนเอง" msgid "Certificate files (*.crt, *.pem)|*.crt;*.pem|All files|*.*" msgstr "ไฟล์ใบรับรอง (*.crt, *.pem)|*.crt;*.pem|ไฟล์ทั้งหมด|*.*" @@ -21294,17 +17803,11 @@ msgid "Open CA certificate file" msgstr "เปิดไฟล์ใบรับรอง CA" #, c-format, boost-format -msgid "" -"On this system, %s uses HTTPS certificates from the system Certificate Store " -"or Keychain." +msgid "On this system, %s uses HTTPS certificates from the system Certificate Store or Keychain." msgstr "บนระบบนี้ %s ใช้ใบรับรอง HTTPS จากระบบที่จัดเก็บใบรับรองหรือพวงกุญแจ" -msgid "" -"To use a custom CA file, please import your CA file into Certificate Store / " -"Keychain." -msgstr "" -"หากต้องการใช้ไฟล์ CA ที่กำหนดเอง โปรดนำเข้าไฟล์ CA ของคุณไปที่ Certificate Store / " -"Keychain" +msgid "To use a custom CA file, please import your CA file into Certificate Store / Keychain." +msgstr "หากต้องการใช้ไฟล์ CA ที่กำหนดเอง โปรดนำเข้าไฟล์ CA ของคุณไปที่ Certificate Store / Keychain" msgid "Login/Test" msgstr "เข้าสู่ระบบ/ทดสอบ" @@ -21385,12 +17888,8 @@ msgstr "การเชื่อมต่อกับ FlashAir ทำงาน msgid "Could not connect to FlashAir" msgstr "ไม่สามารถเชื่อมต่อกับ FlashAir ได้" -msgid "" -"Note: FlashAir with firmware 2.00.02 or newer and activated upload function " -"is required." -msgstr "" -"หมายเหตุ: จำเป็นต้องมี FlashAir ที่มีเฟิร์มแวร์ 2.00.02 หรือใหม่กว่า " -"และเปิดใช้งานฟังก์ชันอัพโหลดแล้ว" +msgid "Note: FlashAir with firmware 2.00.02 or newer and activated upload function is required." +msgstr "หมายเหตุ: จำเป็นต้องมี FlashAir ที่มีเฟิร์มแวร์ 2.00.02 หรือใหม่กว่า และเปิดใช้งานฟังก์ชันอัพโหลดแล้ว" msgid "Connection to MKS is working correctly." msgstr "การเชื่อมต่อกับ MKS ทำงานอย่างถูกต้อง" @@ -21480,372 +17979,146 @@ msgstr "" "เนื้อหาข้อความ: \"%1%\"\n" "ข้อผิดพลาด: \"%2%\"" -msgid "" -"It has a small layer height. This results in almost negligible layer lines " -"and high print quality. It is suitable for most printing cases." -msgstr "" -"มีความสูงของชั้นเล็ก ๆ ส่งผลให้เส้นชั้นแทบไม่มีความสำคัญและคุณภาพการพิมพ์สูง " -"เหมาะสำหรับกรณีการพิมพ์ส่วนใหญ่" +msgid "It has a small layer height. This results in almost negligible layer lines and high print quality. It is suitable for most printing cases." +msgstr "มีความสูงของชั้นเล็ก ๆ ส่งผลให้เส้นชั้นแทบไม่มีความสำคัญและคุณภาพการพิมพ์สูง เหมาะสำหรับกรณีการพิมพ์ส่วนใหญ่" -msgid "" -"Compared with the default profile of a 0.2 mm nozzle, it has lower speeds " -"and acceleration, and the sparse infill pattern is Gyroid. This results in " -"much higher print quality but a much longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีความเร็วและความเร่งที่ต่ำกว่า " -"และรูปแบบไส้ในแบบโปร่งคือ Gyroid ส่งผลให้คุณภาพการพิมพ์สูงขึ้นมาก แต่ใช้เวลาพิมพ์นานกว่ามาก" +msgid "Compared with the default profile of a 0.2 mm nozzle, it has lower speeds and acceleration, and the sparse infill pattern is Gyroid. This results in much higher print quality but a much longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีความเร็วและความเร่งที่ต่ำกว่า และรูปแบบไส้ในแบบโปร่งคือ Gyroid ส่งผลให้คุณภาพการพิมพ์สูงขึ้นมาก แต่ใช้เวลาพิมพ์นานกว่ามาก" -msgid "" -"Compared with the default profile of a 0.2 mm nozzle, it has a slightly " -"bigger layer height. This results in almost negligible layer lines and " -"slightly shorter print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีความสูงของชั้นที่ใหญ่กว่าเล็กน้อย " -"ส่งผลให้เส้นเลเยอร์แทบไม่มีนัยสำคัญและใช้เวลาพิมพ์สั้นลงเล็กน้อย" +msgid "Compared with the default profile of a 0.2 mm nozzle, it has a slightly bigger layer height. This results in almost negligible layer lines and slightly shorter print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีความสูงของชั้นที่ใหญ่กว่าเล็กน้อย ส่งผลให้เส้นเลเยอร์แทบไม่มีนัยสำคัญและใช้เวลาพิมพ์สั้นลงเล็กน้อย" -msgid "" -"Compared with the default profile of a 0.2 mm nozzle, it has a bigger layer " -"height. This results in slightly visible layer lines but shorter print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีความสูงของชั้นที่ใหญ่กว่า " -"ส่งผลให้มองเห็นเส้นเลเยอร์ได้เล็กน้อยแต่ใช้เวลาพิมพ์สั้นลง" +msgid "Compared with the default profile of a 0.2 mm nozzle, it has a bigger layer height. This results in slightly visible layer lines but shorter print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีความสูงของชั้นที่ใหญ่กว่า ส่งผลให้มองเห็นเส้นเลเยอร์ได้เล็กน้อยแต่ใช้เวลาพิมพ์สั้นลง" -msgid "" -"Compared with the default profile of a 0.2 mm nozzle, it has a smaller layer " -"height. This results in almost invisible layer lines and higher print " -"quality but longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีความสูงของชั้นที่เล็กกว่า " -"ส่งผลให้มีเส้นชั้นที่แทบจะมองไม่เห็นและคุณภาพการพิมพ์ที่สูงขึ้นแต่ใช้เวลาพิมพ์นานขึ้น" +msgid "Compared with the default profile of a 0.2 mm nozzle, it has a smaller layer height. This results in almost invisible layer lines and higher print quality but longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีความสูงของชั้นที่เล็กกว่า ส่งผลให้มีเส้นชั้นที่แทบจะมองไม่เห็นและคุณภาพการพิมพ์ที่สูงขึ้นแต่ใช้เวลาพิมพ์นานขึ้น" -msgid "" -"Compared with the default profile of a 0.2 mm nozzle, it has a smaller layer " -"lines, lower speeds and acceleration, and the sparse infill pattern is " -"Gyroid. This results in almost invisible layer lines and much higher print " -"quality but much longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีเส้นชั้นที่เล็กกว่า " -"ความเร็วและความเร่งที่ต่ำกว่า และรูปแบบไส้ในแบบโปร่งคือ Gyroid " -"ส่งผลให้มีเส้นชั้นที่แทบจะมองไม่เห็นและคุณภาพการพิมพ์ที่สูงขึ้นมาก แต่ใช้เวลาพิมพ์นานกว่ามาก" +msgid "Compared with the default profile of a 0.2 mm nozzle, it has a smaller layer lines, lower speeds and acceleration, and the sparse infill pattern is Gyroid. This results in almost invisible layer lines and much higher print quality but much longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีเส้นชั้นที่เล็กกว่า ความเร็วและความเร่งที่ต่ำกว่า และรูปแบบไส้ในแบบโปร่งคือ Gyroid ส่งผลให้มีเส้นชั้นที่แทบจะมองไม่เห็นและคุณภาพการพิมพ์ที่สูงขึ้นมาก แต่ใช้เวลาพิมพ์นานกว่ามาก" -msgid "" -"Compared with the default profile of a 0.2 mm nozzle, it has a smaller layer " -"height. This results in minimal layer lines and higher print quality but " -"longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีความสูงของชั้นที่เล็กกว่า " -"ส่งผลให้มีเส้นชั้นน้อยที่สุดและคุณภาพการพิมพ์สูงขึ้นแต่ใช้เวลาพิมพ์นานขึ้น" +msgid "Compared with the default profile of a 0.2 mm nozzle, it has a smaller layer height. This results in minimal layer lines and higher print quality but longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีความสูงของชั้นที่เล็กกว่า ส่งผลให้มีเส้นชั้นน้อยที่สุดและคุณภาพการพิมพ์สูงขึ้นแต่ใช้เวลาพิมพ์นานขึ้น" -msgid "" -"Compared with the default profile of a 0.2 mm nozzle, it has a smaller layer " -"lines, lower speeds and acceleration, and the sparse infill pattern is " -"Gyroid. This results in minimal layer lines and much higher print quality " -"but much longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีเส้นชั้นที่เล็กกว่า " -"ความเร็วและความเร่งที่ต่ำกว่า และรูปแบบไส้ในแบบโปร่งคือ Gyroid " -"ส่งผลให้มีเส้นชั้นน้อยที่สุดและคุณภาพการพิมพ์สูงขึ้นมาก แต่ใช้เวลาพิมพ์นานกว่ามาก" +msgid "Compared with the default profile of a 0.2 mm nozzle, it has a smaller layer lines, lower speeds and acceleration, and the sparse infill pattern is Gyroid. This results in minimal layer lines and much higher print quality but much longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.2 มม. จะมีเส้นชั้นที่เล็กกว่า ความเร็วและความเร่งที่ต่ำกว่า และรูปแบบไส้ในแบบโปร่งคือ Gyroid ส่งผลให้มีเส้นชั้นน้อยที่สุดและคุณภาพการพิมพ์สูงขึ้นมาก แต่ใช้เวลาพิมพ์นานกว่ามาก" -msgid "" -"It has a normal layer height. This results in average layer lines and print " -"quality. It is suitable for most printing cases." -msgstr "" -"มีความสูงของชั้นปกติ ซึ่งส่งผลให้ได้เส้นชั้นเฉลี่ยและคุณภาพการพิมพ์ เหมาะสำหรับกรณีการพิมพ์ส่วนใหญ่" +msgid "It has a normal layer height. This results in average layer lines and print quality. It is suitable for most printing cases." +msgstr "มีความสูงของชั้นปกติ ซึ่งส่งผลให้ได้เส้นชั้นเฉลี่ยและคุณภาพการพิมพ์ เหมาะสำหรับกรณีการพิมพ์ส่วนใหญ่" -msgid "" -"Compared with the default profile of a 0.4 mm nozzle, it has more wall loops " -"and a higher sparse infill density. This results in higher print strength " -"but more filament consumption and longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. " -"จะมีห่วงติดผนังมากกว่าและมีความหนาแน่นของช่องไส้ในที่เบากว่า " -"ส่งผลให้มีความแข็งแรงในการพิมพ์สูงขึ้นแต่ใช้เส้นพลาสติกมากขึ้นและใช้เวลาพิมพ์นานขึ้น" +msgid "Compared with the default profile of a 0.4 mm nozzle, it has more wall loops and a higher sparse infill density. This results in higher print strength but more filament consumption and longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีห่วงติดผนังมากกว่าและมีความหนาแน่นของช่องไส้ในที่เบากว่า ส่งผลให้มีความแข็งแรงในการพิมพ์สูงขึ้นแต่ใช้เส้นพลาสติกมากขึ้นและใช้เวลาพิมพ์นานขึ้น" -msgid "" -"Compared with the default profile of a 0.4 mm nozzle, it has a bigger layer " -"height. This results in more apparent layer lines and lower print quality, " -"but slightly shorter print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่ใหญ่กว่า " -"ส่งผลให้มีเส้นชั้นที่ชัดเจนมากขึ้นและคุณภาพการพิมพ์ลดลง แต่ใช้เวลาพิมพ์สั้นลงเล็กน้อย" +msgid "Compared with the default profile of a 0.4 mm nozzle, it has a bigger layer height. This results in more apparent layer lines and lower print quality, but slightly shorter print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่ใหญ่กว่า ส่งผลให้มีเส้นชั้นที่ชัดเจนมากขึ้นและคุณภาพการพิมพ์ลดลง แต่ใช้เวลาพิมพ์สั้นลงเล็กน้อย" -msgid "" -"Compared with the default profile of a 0.4 mm nozzle, it has a bigger layer " -"height. This results in more apparent layer lines and lower print quality, " -"but shorter print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่ใหญ่กว่า " -"ส่งผลให้มีเส้นชั้นที่ชัดเจนมากขึ้นและคุณภาพการพิมพ์ลดลง แต่ใช้เวลาพิมพ์สั้นลง" +msgid "Compared with the default profile of a 0.4 mm nozzle, it has a bigger layer height. This results in more apparent layer lines and lower print quality, but shorter print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่ใหญ่กว่า ส่งผลให้มีเส้นชั้นที่ชัดเจนมากขึ้นและคุณภาพการพิมพ์ลดลง แต่ใช้เวลาพิมพ์สั้นลง" -msgid "" -"Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer " -"height. This results in less apparent layer lines and higher print quality " -"but longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่เล็กกว่า " -"ส่งผลให้มีเส้นชั้นที่ชัดเจนน้อยลงและคุณภาพการพิมพ์สูงขึ้นแต่ใช้เวลาพิมพ์นานขึ้น" +msgid "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height. This results in less apparent layer lines and higher print quality but longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่เล็กกว่า ส่งผลให้มีเส้นชั้นที่ชัดเจนน้อยลงและคุณภาพการพิมพ์สูงขึ้นแต่ใช้เวลาพิมพ์นานขึ้น" -msgid "" -"Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer " -"height, lower speeds and acceleration, and the sparse infill pattern is " -"Gyroid. This results in less apparent layer lines and much higher print " -"quality but much longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่เล็กกว่า " -"ความเร็วและความเร่งที่ต่ำกว่า และรูปแบบไส้ในแบบโปร่งคือ Gyroid " -"ส่งผลให้เส้นเลเยอร์ปรากฏน้อยลงและคุณภาพการพิมพ์สูงขึ้นมาก แต่ใช้เวลาพิมพ์นานกว่ามาก" +msgid "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height, lower speeds and acceleration, and the sparse infill pattern is Gyroid. This results in less apparent layer lines and much higher print quality but much longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่เล็กกว่า ความเร็วและความเร่งที่ต่ำกว่า และรูปแบบไส้ในแบบโปร่งคือ Gyroid ส่งผลให้เส้นเลเยอร์ปรากฏน้อยลงและคุณภาพการพิมพ์สูงขึ้นมาก แต่ใช้เวลาพิมพ์นานกว่ามาก" -msgid "" -"Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer " -"height. This results in almost negligible layer lines and higher print " -"quality but longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่เล็กกว่า " -"ส่งผลให้เส้นเลเยอร์แทบไม่มีความสำคัญและคุณภาพการพิมพ์สูงขึ้นแต่ใช้เวลาพิมพ์นานขึ้น" +msgid "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height. This results in almost negligible layer lines and higher print quality but longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่เล็กกว่า ส่งผลให้เส้นเลเยอร์แทบไม่มีความสำคัญและคุณภาพการพิมพ์สูงขึ้นแต่ใช้เวลาพิมพ์นานขึ้น" -msgid "" -"Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer " -"height, lower speeds and acceleration, and the sparse infill pattern is " -"Gyroid. This results in almost negligible layer lines and much higher print " -"quality but much longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่เล็กกว่า " -"ความเร็วและความเร่งที่ต่ำกว่า และรูปแบบไส้ในแบบโปร่งคือ Gyroid " -"ส่งผลให้เส้นเลเยอร์แทบไม่มีความสำคัญและคุณภาพการพิมพ์สูงขึ้นมาก แต่ใช้เวลาพิมพ์นานกว่ามาก" +msgid "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height, lower speeds and acceleration, and the sparse infill pattern is Gyroid. This results in almost negligible layer lines and much higher print quality but much longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่เล็กกว่า ความเร็วและความเร่งที่ต่ำกว่า และรูปแบบไส้ในแบบโปร่งคือ Gyroid ส่งผลให้เส้นเลเยอร์แทบไม่มีความสำคัญและคุณภาพการพิมพ์สูงขึ้นมาก แต่ใช้เวลาพิมพ์นานกว่ามาก" -msgid "" -"Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer " -"height. This results in almost negligible layer lines and longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่เล็กกว่า " -"ส่งผลให้เส้นชั้นแทบไม่มีนัยสำคัญและใช้เวลาพิมพ์นานขึ้น" +msgid "Compared with the default profile of a 0.4 mm nozzle, it has a smaller layer height. This results in almost negligible layer lines and longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.4 มม. จะมีความสูงของชั้นที่เล็กกว่า ส่งผลให้เส้นชั้นแทบไม่มีนัยสำคัญและใช้เวลาพิมพ์นานขึ้น" -msgid "" -"It has a big layer height. This results in apparent layer lines and ordinary " -"print quality and print time." +msgid "It has a big layer height. This results in apparent layer lines and ordinary print quality and print time." msgstr "มีความสูงของชั้นใหญ่ ส่งผลให้ได้เส้นชั้นที่ชัดเจนและคุณภาพการพิมพ์และเวลาในการพิมพ์ตามปกติ" -msgid "" -"Compared with the default profile of a 0.6 mm nozzle, it has more wall loops " -"and a higher sparse infill density. This results in higher print strength " -"but more filament consumption and longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.6 มม. " -"จะมีห่วงติดผนังมากกว่าและมีความหนาแน่นของช่องไส้ในที่เบากว่า " -"ส่งผลให้มีความแข็งแรงในการพิมพ์สูงขึ้นแต่ใช้เส้นพลาสติกมากขึ้นและใช้เวลาพิมพ์นานขึ้น" +msgid "Compared with the default profile of a 0.6 mm nozzle, it has more wall loops and a higher sparse infill density. This results in higher print strength but more filament consumption and longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.6 มม. จะมีห่วงติดผนังมากกว่าและมีความหนาแน่นของช่องไส้ในที่เบากว่า ส่งผลให้มีความแข็งแรงในการพิมพ์สูงขึ้นแต่ใช้เส้นพลาสติกมากขึ้นและใช้เวลาพิมพ์นานขึ้น" -msgid "" -"Compared with the default profile of a 0.6 mm nozzle, it has a bigger layer " -"height. This results in more apparent layer lines and lower print quality, " -"but shorter print time in some cases." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.6 มม. จะมีความสูงของชั้นที่ใหญ่กว่า " -"ซึ่งส่งผลให้มีเส้นชั้นที่ชัดเจนมากขึ้นและคุณภาพการพิมพ์ลดลง แต่เวลาในการพิมพ์สั้นลงในบางกรณี" +msgid "Compared with the default profile of a 0.6 mm nozzle, it has a bigger layer height. This results in more apparent layer lines and lower print quality, but shorter print time in some cases." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.6 มม. จะมีความสูงของชั้นที่ใหญ่กว่า ซึ่งส่งผลให้มีเส้นชั้นที่ชัดเจนมากขึ้นและคุณภาพการพิมพ์ลดลง แต่เวลาในการพิมพ์สั้นลงในบางกรณี" -msgid "" -"Compared with the default profile of a 0.6 mm nozzle, it has a bigger layer " -"height. This results in much more apparent layer lines and much lower print " -"quality, but shorter print time in some cases." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.6 มม. จะมีความสูงของชั้นที่ใหญ่กว่า " -"ซึ่งส่งผลให้มีเส้นชั้นที่ชัดเจนมากขึ้นและคุณภาพการพิมพ์ลดลงมาก แต่ในบางกรณีใช้เวลาพิมพ์สั้นลง" +msgid "Compared with the default profile of a 0.6 mm nozzle, it has a bigger layer height. This results in much more apparent layer lines and much lower print quality, but shorter print time in some cases." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.6 มม. จะมีความสูงของชั้นที่ใหญ่กว่า ซึ่งส่งผลให้มีเส้นชั้นที่ชัดเจนมากขึ้นและคุณภาพการพิมพ์ลดลงมาก แต่ในบางกรณีใช้เวลาพิมพ์สั้นลง" -msgid "" -"Compared with the default profile of a 0.6 mm nozzle, it has a smaller layer " -"height. This results in less apparent layer lines and slight higher print " -"quality but longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.6 มม. จะมีความสูงของชั้นที่เล็กกว่า " -"ส่งผลให้มีเส้นชั้นที่ชัดเจนน้อยลงและคุณภาพการพิมพ์สูงขึ้นเล็กน้อยแต่ใช้เวลาพิมพ์นานขึ้น" +msgid "Compared with the default profile of a 0.6 mm nozzle, it has a smaller layer height. This results in less apparent layer lines and slight higher print quality but longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.6 มม. จะมีความสูงของชั้นที่เล็กกว่า ส่งผลให้มีเส้นชั้นที่ชัดเจนน้อยลงและคุณภาพการพิมพ์สูงขึ้นเล็กน้อยแต่ใช้เวลาพิมพ์นานขึ้น" -msgid "" -"Compared with the default profile of a 0.6 mm nozzle, it has a smaller layer " -"height. This results in less apparent layer lines and higher print quality " -"but longer print time." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.6 มม. จะมีความสูงของชั้นที่เล็กกว่า " -"ส่งผลให้มีเส้นชั้นที่ชัดเจนน้อยลงและคุณภาพการพิมพ์สูงขึ้นแต่ใช้เวลาพิมพ์นานขึ้น" +msgid "Compared with the default profile of a 0.6 mm nozzle, it has a smaller layer height. This results in less apparent layer lines and higher print quality but longer print time." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.6 มม. จะมีความสูงของชั้นที่เล็กกว่า ส่งผลให้มีเส้นชั้นที่ชัดเจนน้อยลงและคุณภาพการพิมพ์สูงขึ้นแต่ใช้เวลาพิมพ์นานขึ้น" -msgid "" -"It has a very big layer height. This results in very apparent layer lines, " -"low print quality and shorter print time." +msgid "It has a very big layer height. This results in very apparent layer lines, low print quality and shorter print time." msgstr "มีความสูงของชั้นที่ใหญ่มาก ส่งผลให้มีเส้นชั้นที่ชัดเจน คุณภาพการพิมพ์ต่ำ และใช้เวลาพิมพ์สั้นลง" -msgid "" -"Compared with the default profile of a 0.8 mm nozzle, it has a bigger layer " -"height. This results in very apparent layer lines and much lower print " -"quality, but shorter print time in some cases." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.8 มม. จะมีความสูงของชั้นที่ใหญ่กว่า " -"ซึ่งส่งผลให้มีเส้นชั้นที่ชัดเจนและคุณภาพการพิมพ์ลดลงมาก แต่ในบางกรณีใช้เวลาพิมพ์สั้นลง" +msgid "Compared with the default profile of a 0.8 mm nozzle, it has a bigger layer height. This results in very apparent layer lines and much lower print quality, but shorter print time in some cases." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.8 มม. จะมีความสูงของชั้นที่ใหญ่กว่า ซึ่งส่งผลให้มีเส้นชั้นที่ชัดเจนและคุณภาพการพิมพ์ลดลงมาก แต่ในบางกรณีใช้เวลาพิมพ์สั้นลง" -msgid "" -"Compared with the default profile of a 0.8 mm nozzle, it has a much bigger " -"layer height. This results in extremely apparent layer lines and much lower " -"print quality, but much shorter print time in some cases." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.8 มม. จะมีความสูงของชั้นที่ใหญ่กว่ามาก " -"ซึ่งส่งผลให้มีเส้นชั้นที่ชัดเจนมากและคุณภาพการพิมพ์ต่ำลงมาก แต่ในบางกรณีใช้เวลาพิมพ์สั้นลงมาก" +msgid "Compared with the default profile of a 0.8 mm nozzle, it has a much bigger layer height. This results in extremely apparent layer lines and much lower print quality, but much shorter print time in some cases." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.8 มม. จะมีความสูงของชั้นที่ใหญ่กว่ามาก ซึ่งส่งผลให้มีเส้นชั้นที่ชัดเจนมากและคุณภาพการพิมพ์ต่ำลงมาก แต่ในบางกรณีใช้เวลาพิมพ์สั้นลงมาก" -msgid "" -"Compared with the default profile of a 0.8 mm nozzle, it has a slightly " -"smaller layer height. This results in slightly less but still apparent layer " -"lines and slightly higher print quality but longer print time in some cases." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.8 มม. จะมีความสูงของชั้นที่เล็กกว่าเล็กน้อย " -"ซึ่งส่งผลให้มีเส้นเลเยอร์น้อยลงเล็กน้อยแต่ยังคงปรากฏชัดเจน และคุณภาพการพิมพ์สูงขึ้นเล็กน้อย " -"แต่ใช้เวลาพิมพ์นานขึ้นในบางกรณี" +msgid "Compared with the default profile of a 0.8 mm nozzle, it has a slightly smaller layer height. This results in slightly less but still apparent layer lines and slightly higher print quality but longer print time in some cases." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.8 มม. จะมีความสูงของชั้นที่เล็กกว่าเล็กน้อย ซึ่งส่งผลให้มีเส้นเลเยอร์น้อยลงเล็กน้อยแต่ยังคงปรากฏชัดเจน และคุณภาพการพิมพ์สูงขึ้นเล็กน้อย แต่ใช้เวลาพิมพ์นานขึ้นในบางกรณี" -msgid "" -"Compared with the default profile of a 0.8 mm nozzle, it has a smaller layer " -"height. This results in less but still apparent layer lines and slightly " -"higher print quality but longer print time in some cases." -msgstr "" -"เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.8 มม. จะมีความสูงของชั้นที่เล็กกว่า " -"ซึ่งส่งผลให้มีเส้นเลเยอร์น้อยลงแต่ยังคงปรากฏชัดเจน และคุณภาพการพิมพ์สูงขึ้นเล็กน้อย " -"แต่ใช้เวลาพิมพ์นานขึ้นในบางกรณี" +msgid "Compared with the default profile of a 0.8 mm nozzle, it has a smaller layer height. This results in less but still apparent layer lines and slightly higher print quality but longer print time in some cases." +msgstr "เมื่อเปรียบเทียบกับโปรไฟล์เริ่มต้นของหัวฉีดขนาด 0.8 มม. จะมีความสูงของชั้นที่เล็กกว่า ซึ่งส่งผลให้มีเส้นเลเยอร์น้อยลงแต่ยังคงปรากฏชัดเจน และคุณภาพการพิมพ์สูงขึ้นเล็กน้อย แต่ใช้เวลาพิมพ์นานขึ้นในบางกรณี" -msgid "" -"This is neither a commonly used filament, nor one of Bambu filaments, and it " -"varies a lot from brand to brand. So, it's highly recommended to ask its " -"vendor for suitable profile before printing and adjust some parameters " -"according to its performances." -msgstr "" -"นี่ไม่ใช่เส้นพลาสติกที่ใช้กันทั่วไปหรือไม่ใช่เส้นพลาสติก Bambu เส้นใดเส้นหนึ่ง " -"และมีความแตกต่างกันมากในแต่ละยี่ห้อ " -"ดังนั้นจึงขอแนะนำอย่างยิ่งให้สอบถามผู้จำหน่ายเกี่ยวกับโปรไฟล์ที่เหมาะสมก่อนพิมพ์ " -"และปรับพารามิเตอร์บางอย่างตามประสิทธิภาพ" +msgid "This is neither a commonly used filament, nor one of Bambu filaments, and it varies a lot from brand to brand. So, it's highly recommended to ask its vendor for suitable profile before printing and adjust some parameters according to its performances." +msgstr "นี่ไม่ใช่เส้นพลาสติกที่ใช้กันทั่วไปหรือไม่ใช่เส้นพลาสติก Bambu เส้นใดเส้นหนึ่ง และมีความแตกต่างกันมากในแต่ละยี่ห้อ ดังนั้นจึงขอแนะนำอย่างยิ่งให้สอบถามผู้จำหน่ายเกี่ยวกับโปรไฟล์ที่เหมาะสมก่อนพิมพ์ และปรับพารามิเตอร์บางอย่างตามประสิทธิภาพ" -msgid "" -"When printing this filament, there's a risk of warping and low layer " -"adhesion strength. To get better results, please refer to this wiki: " -"Printing Tips for High Temp / Engineering materials." -msgstr "" -"เมื่อพิมพ์ฟิลาเมนต์นี้ มีความเสี่ยงที่จะเกิดการบิดงอและมีการยึดเกาะต่ำ เพื่อให้ได้ผลลัพธ์ที่ดีขึ้น " -"โปรดดูที่วิกินี้: เคล็ดลับการพิมพ์สำหรับวัสดุอุณหภูมิสูง / วิศวกรรม" +msgid "When printing this filament, there's a risk of warping and low layer adhesion strength. To get better results, please refer to this wiki: Printing Tips for High Temp / Engineering materials." +msgstr "เมื่อพิมพ์ฟิลาเมนต์นี้ มีความเสี่ยงที่จะเกิดการบิดงอและมีการยึดเกาะต่ำ เพื่อให้ได้ผลลัพธ์ที่ดีขึ้น โปรดดูที่วิกินี้: เคล็ดลับการพิมพ์สำหรับวัสดุอุณหภูมิสูง / วิศวกรรม" -msgid "" -"When printing this filament, there's a risk of nozzle clogging, oozing, " -"warping and low layer adhesion strength. To get better results, please refer " -"to this wiki: Printing Tips for High Temp / Engineering materials." -msgstr "" -"เมื่อพิมพ์ฟิลาเมนต์นี้ มีความเสี่ยงที่หัวฉีดจะอุดตัน ไหลซึม บิดเบี้ยว และมีความแข็งแรงในการยึดเกาะต่ำ " -"เพื่อให้ได้ผลลัพธ์ที่ดีขึ้น โปรดดูที่วิกินี้: เคล็ดลับการพิมพ์สำหรับวัสดุอุณหภูมิสูง / วิศวกรรม" +msgid "When printing this filament, there's a risk of nozzle clogging, oozing, warping and low layer adhesion strength. To get better results, please refer to this wiki: Printing Tips for High Temp / Engineering materials." +msgstr "เมื่อพิมพ์ฟิลาเมนต์นี้ มีความเสี่ยงที่หัวฉีดจะอุดตัน ไหลซึม บิดเบี้ยว และมีความแข็งแรงในการยึดเกาะต่ำ เพื่อให้ได้ผลลัพธ์ที่ดีขึ้น โปรดดูที่วิกินี้: เคล็ดลับการพิมพ์สำหรับวัสดุอุณหภูมิสูง / วิศวกรรม" -msgid "" -"To get better transparent or translucent results with the corresponding " -"filament, please refer to this wiki: Printing tips for transparent PETG." -msgstr "" -"หากต้องการผลลัพธ์ที่โปร่งใสหรือโปร่งแสงดีขึ้นด้วยเส้นพลาสติกที่เกี่ยวข้อง โปรดดูที่วิกินี้: " -"เคล็ดลับการพิมพ์สำหรับ PETG แบบโปร่งใส" +msgid "To get better transparent or translucent results with the corresponding filament, please refer to this wiki: Printing tips for transparent PETG." +msgstr "หากต้องการผลลัพธ์ที่โปร่งใสหรือโปร่งแสงดีขึ้นด้วยเส้นพลาสติกที่เกี่ยวข้อง โปรดดูที่วิกินี้: เคล็ดลับการพิมพ์สำหรับ PETG แบบโปร่งใส" -msgid "" -"To make the prints get higher gloss, please dry the filament before use, and " -"set the outer wall speed to be 40 to 60 mm/s when slicing." -msgstr "" -"เพื่อให้งานพิมพ์มีความมันวาวมากขึ้น โปรดทำให้เส้นพลาสติกแห้งก่อนใช้งาน " -"และตั้งค่าความเร็วผนังด้านนอกเป็น 40 ถึง 60 มม./วินาที เมื่อสไลซ์" +msgid "To make the prints get higher gloss, please dry the filament before use, and set the outer wall speed to be 40 to 60 mm/s when slicing." +msgstr "เพื่อให้งานพิมพ์มีความมันวาวมากขึ้น โปรดทำให้เส้นพลาสติกแห้งก่อนใช้งาน และตั้งค่าความเร็วผนังด้านนอกเป็น 40 ถึง 60 มม./วินาที เมื่อสไลซ์" -msgid "" -"This filament is only used to print models with a low density usually, and " -"some special parameters are required. To get better printing quality, please " -"refer to this wiki: Instructions for printing RC model with foaming PLA (PLA " -"Aero)." -msgstr "" -"เส้นพลาสติกนี้ใช้สำหรับพิมพ์แบบจำลองที่มีความหนาแน่นต่ำเท่านั้น " -"และจำเป็นต้องมีพารามิเตอร์พิเศษบางอย่าง หากต้องการคุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: " -"คำแนะนำสำหรับการพิมพ์รุ่น RC ด้วยฟอง PLA (PLA Aero)" +msgid "This filament is only used to print models with a low density usually, and some special parameters are required. To get better printing quality, please refer to this wiki: Instructions for printing RC model with foaming PLA (PLA Aero)." +msgstr "เส้นพลาสติกนี้ใช้สำหรับพิมพ์แบบจำลองที่มีความหนาแน่นต่ำเท่านั้น และจำเป็นต้องมีพารามิเตอร์พิเศษบางอย่าง หากต้องการคุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: คำแนะนำสำหรับการพิมพ์รุ่น RC ด้วยฟอง PLA (PLA Aero)" -msgid "" -"This filament is only used to print models with a low density usually, and " -"some special parameters are required. To get better printing quality, please " -"refer to this wiki: ASA Aero Printing Guide." -msgstr "" -"เส้นพลาสติกนี้ใช้สำหรับพิมพ์แบบจำลองที่มีความหนาแน่นต่ำเท่านั้น " -"และจำเป็นต้องมีพารามิเตอร์พิเศษบางอย่าง หากต้องการคุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: ASA " -"Aero Printing Guide" +msgid "This filament is only used to print models with a low density usually, and some special parameters are required. To get better printing quality, please refer to this wiki: ASA Aero Printing Guide." +msgstr "เส้นพลาสติกนี้ใช้สำหรับพิมพ์แบบจำลองที่มีความหนาแน่นต่ำเท่านั้น และจำเป็นต้องมีพารามิเตอร์พิเศษบางอย่าง หากต้องการคุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: ASA Aero Printing Guide" -msgid "" -"This filament is too soft and not compatible with the AMS. Printing it is of " -"many requirements, and to get better printing quality, please refer to this " -"wiki: TPU printing guide." -msgstr "" -"เส้นพลาสติกนี้อ่อนเกินไปและเข้ากันไม่ได้กับ AMS การพิมพ์นั้นมีข้อกำหนดหลายประการ " -"และเพื่อให้ได้คุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: คู่มือการพิมพ์ TPU" +msgid "This filament is too soft and not compatible with the AMS. Printing it is of many requirements, and to get better printing quality, please refer to this wiki: TPU printing guide." +msgstr "เส้นพลาสติกนี้อ่อนเกินไปและเข้ากันไม่ได้กับ AMS การพิมพ์นั้นมีข้อกำหนดหลายประการ และเพื่อให้ได้คุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: คู่มือการพิมพ์ TPU" -msgid "" -"This filament has high enough hardness (about 67D) and is compatible with " -"the AMS. Printing it is of many requirements, and to get better printing " -"quality, please refer to this wiki: TPU printing guide." -msgstr "" -"เส้นพลาสติกนี้มีความแข็งสูงเพียงพอ (ประมาณ 67D) และเข้ากันได้กับ AMS " -"การพิมพ์นั้นมีข้อกำหนดหลายประการ และเพื่อให้ได้คุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: คู่มือการพิมพ์ TPU" +msgid "This filament has high enough hardness (about 67D) and is compatible with the AMS. Printing it is of many requirements, and to get better printing quality, please refer to this wiki: TPU printing guide." +msgstr "เส้นพลาสติกนี้มีความแข็งสูงเพียงพอ (ประมาณ 67D) และเข้ากันได้กับ AMS การพิมพ์นั้นมีข้อกำหนดหลายประการ และเพื่อให้ได้คุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: คู่มือการพิมพ์ TPU" -msgid "" -"If you are to print a kind of soft TPU, please don't slice with this " -"profile, and it is only for TPU that has high enough hardness (not less than " -"55D) and is compatible with the AMS. To get better printing quality, please " -"refer to this wiki: TPU printing guide." -msgstr "" -"หากคุณต้องการพิมพ์ TPU แบบอ่อน โปรดอย่าเฉือนด้วยโปรไฟล์นี้ และสำหรับ TPU " -"เท่านั้นที่มีความแข็งสูงเพียงพอ (ไม่น้อยกว่า 55D) และเข้ากันได้กับ AMS " -"หากต้องการคุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: คู่มือการพิมพ์ TPU" +msgid "If you are to print a kind of soft TPU, please don't slice with this profile, and it is only for TPU that has high enough hardness (not less than 55D) and is compatible with the AMS. To get better printing quality, please refer to this wiki: TPU printing guide." +msgstr "หากคุณต้องการพิมพ์ TPU แบบอ่อน โปรดอย่าเฉือนด้วยโปรไฟล์นี้ และสำหรับ TPU เท่านั้นที่มีความแข็งสูงเพียงพอ (ไม่น้อยกว่า 55D) และเข้ากันได้กับ AMS หากต้องการคุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: คู่มือการพิมพ์ TPU" -msgid "" -"This is a water-soluble support filament, and usually it is only for the " -"support structure and not for the model body. Printing this filament is of " -"many requirements, and to get better printing quality, please refer to this " -"wiki: PVA Printing Guide." -msgstr "" -"นี่คือเส้นพลาสติกรองรับที่ละลายน้ำได้ และโดยปกติจะใช้สำหรับโครงสร้างรองรับเท่านั้น " -"ไม่ใช่สำหรับตัวโมเดล การพิมพ์เส้นพลาสติกนี้มีข้อกำหนดหลายประการ " -"และเพื่อให้ได้คุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: คู่มือการพิมพ์ PVA" +msgid "This is a water-soluble support filament, and usually it is only for the support structure and not for the model body. Printing this filament is of many requirements, and to get better printing quality, please refer to this wiki: PVA Printing Guide." +msgstr "นี่คือเส้นพลาสติกรองรับที่ละลายน้ำได้ และโดยปกติจะใช้สำหรับโครงสร้างรองรับเท่านั้น ไม่ใช่สำหรับตัวโมเดล การพิมพ์เส้นพลาสติกนี้มีข้อกำหนดหลายประการ และเพื่อให้ได้คุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: คู่มือการพิมพ์ PVA" -msgid "" -"This is a non-water-soluble support filament, and usually it is only for the " -"support structure and not for the model body. To get better printing " -"quality, please refer to this wiki: Printing Tips for Support Filament and " -"Support Function." -msgstr "" -"นี่คือเส้นพลาสติกรองรับที่ไม่ละลายน้ำ และโดยปกติจะใช้สำหรับโครงสร้างรองรับเท่านั้น " -"ไม่ใช่สำหรับตัวโมเดล หากต้องการคุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: " -"เคล็ดลับการพิมพ์สำหรับเส้นพลาสติกรองรับและฟังก์ชันรองรับ" +msgid "This is a non-water-soluble support filament, and usually it is only for the support structure and not for the model body. To get better printing quality, please refer to this wiki: Printing Tips for Support Filament and Support Function." +msgstr "นี่คือเส้นพลาสติกรองรับที่ไม่ละลายน้ำ และโดยปกติจะใช้สำหรับโครงสร้างรองรับเท่านั้น ไม่ใช่สำหรับตัวโมเดล หากต้องการคุณภาพการพิมพ์ที่ดีขึ้น โปรดดูที่วิกินี้: เคล็ดลับการพิมพ์สำหรับเส้นพลาสติกรองรับและฟังก์ชันรองรับ" -msgid "" -"The generic presets are conservatively tuned for compatibility with a wider " -"range of filaments. For higher printing quality and speeds, please use Bambu " -"filaments with Bambu presets." -msgstr "" -"ค่าที่ตั้งไว้ล่วงหน้าทั่วไปได้รับการปรับแต่งอย่างระมัดระวังเพื่อให้เข้ากันได้กับเส้นพลาสติกที่หลากหลายมากขึ้น " -"เพื่อคุณภาพการพิมพ์และความเร็วที่สูงขึ้น โปรดใช้เส้นพลาสติก Bambu กับการตั้งค่าล่วงหน้าของ Bambu" +msgid "The generic presets are conservatively tuned for compatibility with a wider range of filaments. For higher printing quality and speeds, please use Bambu filaments with Bambu presets." +msgstr "ค่าที่ตั้งไว้ล่วงหน้าทั่วไปได้รับการปรับแต่งอย่างระมัดระวังเพื่อให้เข้ากันได้กับเส้นพลาสติกที่หลากหลายมากขึ้น เพื่อคุณภาพการพิมพ์และความเร็วที่สูงขึ้น โปรดใช้เส้นพลาสติก Bambu กับการตั้งค่าล่วงหน้าของ Bambu" msgid "High quality profile for 0.2mm nozzle, prioritizing print quality." msgstr "โปรไฟล์คุณภาพสูงสำหรับหัวฉีดขนาด 0.2 มม. โดยให้ความสำคัญกับคุณภาพการพิมพ์" -msgid "" -"High quality profile for 0.16mm layer height, prioritizing print quality and " -"strength." -msgstr "" -"โปรไฟล์คุณภาพสูงสำหรับความสูงของชั้น 0.16 มม. ให้ความสำคัญกับคุณภาพและความแข็งแรงในการพิมพ์" +msgid "High quality profile for 0.16mm layer height, prioritizing print quality and strength." +msgstr "โปรไฟล์คุณภาพสูงสำหรับความสูงของชั้น 0.16 มม. ให้ความสำคัญกับคุณภาพและความแข็งแรงในการพิมพ์" msgid "Standard profile for 0.16mm layer height, prioritizing speed." msgstr "โปรไฟล์มาตรฐานสำหรับความสูงของชั้น 0.16 มม. โดยให้ความสำคัญกับความเร็ว" -msgid "" -"High quality profile for 0.2mm layer height, prioritizing strength and print " -"quality." -msgstr "" -"โปรไฟล์คุณภาพสูงสำหรับความสูงของชั้น 0.2 มม. " -"โดยให้ความสำคัญกับความแข็งแกร่งและคุณภาพการพิมพ์" +msgid "High quality profile for 0.2mm layer height, prioritizing strength and print quality." +msgstr "โปรไฟล์คุณภาพสูงสำหรับความสูงของชั้น 0.2 มม. โดยให้ความสำคัญกับความแข็งแกร่งและคุณภาพการพิมพ์" msgid "Standard profile for 0.4mm nozzle, prioritizing speed." msgstr "โปรไฟล์มาตรฐานสำหรับหัวฉีดขนาด 0.4 มม. โดยให้ความสำคัญกับความเร็ว" -msgid "" -"High quality profile for 0.6mm nozzle, prioritizing print quality and " -"strength." -msgstr "" -"โปรไฟล์คุณภาพสูงสำหรับหัวฉีดขนาด 0.6 มม. ให้ความสำคัญกับคุณภาพและความแข็งแรงในการพิมพ์" +msgid "High quality profile for 0.6mm nozzle, prioritizing print quality and strength." +msgstr "โปรไฟล์คุณภาพสูงสำหรับหัวฉีดขนาด 0.6 มม. ให้ความสำคัญกับคุณภาพและความแข็งแรงในการพิมพ์" msgid "Strength profile for 0.6mm nozzle, prioritizing strength." msgstr "โปรไฟล์ความแข็งแกร่งสำหรับหัวฉีดขนาด 0.6 มม. โดยให้ความสำคัญกับความแข็งแรง" @@ -21886,8 +18159,7 @@ msgstr "สถานะอุปกรณ์" msgid "AMS Status" msgstr "สถานะ AMS" -msgid "" -"Please select the devices you would like to manage here (up to 6 devices)" +msgid "Please select the devices you would like to manage here (up to 6 devices)" msgstr "โปรดเลือกอุปกรณ์ที่คุณต้องการจัดการที่นี่ (สูงสุด 6 อุปกรณ์)" msgid "Printing Options" @@ -21902,16 +18174,13 @@ msgstr "ตัวเลือกส่ง" msgid "Send to" msgstr "ส่งไปที่" -msgid "" -"printers at the same time. (It depends on how many devices can undergo " -"heating at the same time.)" +msgid "printers at the same time. (It depends on how many devices can undergo heating at the same time.)" msgstr "เครื่องพิมพ์ในเวลาเดียวกัน (ขึ้นอยู่กับจำนวนอุปกรณ์ที่สามารถทำความร้อนได้ในเวลาเดียวกัน)" msgid "Wait" msgstr "รอ" -msgid "" -"minute each batch. (It depends on how long it takes to complete heating.)" +msgid "minute each batch. (It depends on how long it takes to complete heating.)" msgstr "นาทีในแต่ละชุด (ขึ้นอยู่กับระยะเวลาในการทำความร้อนให้เสร็จสิ้น)" msgid "Task Sending" @@ -22012,18 +18281,11 @@ msgstr "โหมดความสะดวกสบาย" msgid "Custom Mode" msgstr "โหมดกำหนดเอง" -msgid "" -"Generates filament grouping for the left and right nozzles based on the most " -"filament-saving principles to minimize waste." +msgid "Generates filament grouping for the left and right nozzles based on the most filament-saving principles to minimize waste." msgstr "สร้างการจัดกลุ่มเส้นพลาสติกสำหรับหัวฉีดด้านซ้ายและขวาตามหลักการประหยัดเส้นพลาสติกมากที่สุดเพื่อลดของเสีย" -msgid "" -"Generates filament grouping for the left and right nozzles based on the " -"printer's actual filament status, reducing the need for manual filament " -"adjustment." -msgstr "" -"สร้างการจัดกลุ่มเส้นพลาสติกสำหรับหัวฉีดด้านซ้ายและขวาตามสถานะเส้นพลาสติกที่แท้จริงของเครื่องพิมพ์ " -"ซึ่งช่วยลดความจำเป็นในการปรับเส้นพลาสติกด้วยตนเอง" +msgid "Generates filament grouping for the left and right nozzles based on the printer's actual filament status, reducing the need for manual filament adjustment." +msgstr "สร้างการจัดกลุ่มเส้นพลาสติกสำหรับหัวฉีดด้านซ้ายและขวาตามสถานะเส้นพลาสติกที่แท้จริงของเครื่องพิมพ์ ซึ่งช่วยลดความจำเป็นในการปรับเส้นพลาสติกด้วยตนเอง" msgid "Manually assign filament to the left or right nozzle" msgstr "กำหนดเส้นพลาสติกให้กับหัวฉีดด้านซ้ายหรือขวาด้วยตนเอง" @@ -22043,9 +18305,7 @@ msgstr "เราจะสไลซ์ตามวิธีการจัดก msgid "Tip: You can drag the filaments to reassign them to different nozzles." msgstr "เคล็ดลับ: คุณสามารถลากเส้นพลาสติกเพื่อกำหนดใหม่ให้กับหัวฉีดที่แตกต่างกันได้" -msgid "" -"The filament grouping method for current plate is determined by the dropdown " -"option at the slicing plate button." +msgid "The filament grouping method for current plate is determined by the dropdown option at the slicing plate button." msgstr "วิธีการจัดกลุ่มเส้นพลาสติกสำหรับเพลตปัจจุบันถูกกำหนดโดยตัวเลือกแบบเลื่อนลงที่ปุ่มแผ่นสไลซ์" msgid "Connected to Obico successfully!" @@ -22124,12 +18384,8 @@ msgstr "รหัสข้อผิดพลาด: %1%" msgid "Upload failed" msgstr "อัปโหลดล้มเหลว" -msgid "" -"The file has been transferred, but some unknown errors occurred. Please " -"check the device page for the file and try to start printing again." -msgstr "" -"ไฟล์ถูกส่งแล้ว แต่เกิดข้อผิดพลาดที่ไม่ทราบสาเหตุ " -"โปรดตรวจสอบไฟล์ในหน้าอุปกรณ์แล้วลองเริ่มพิมพ์อีกครั้ง" +msgid "The file has been transferred, but some unknown errors occurred. Please check the device page for the file and try to start printing again." +msgstr "ไฟล์ถูกส่งแล้ว แต่เกิดข้อผิดพลาดที่ไม่ทราบสาเหตุ โปรดตรวจสอบไฟล์ในหน้าอุปกรณ์แล้วลองเริ่มพิมพ์อีกครั้ง" msgid "Failed to open file for upload." msgstr "เปิดไฟล์สำหรับอัปโหลดไม่สำเร็จ" @@ -22149,9 +18405,7 @@ msgstr "คำนวณ checksum ของไฟล์ไม่สำเร็ msgid "Error code not found" msgstr "ไม่พบรหัสข้อผิดพลาด" -msgid "" -"The printer is busy, Please check the device page for the file and try to " -"start printing again." +msgid "The printer is busy, Please check the device page for the file and try to start printing again." msgstr "เครื่องพิมพ์ไม่ว่าง โปรดตรวจสอบไฟล์ในหน้าอุปกรณ์แล้วลองเริ่มพิมพ์อีกครั้ง" msgid "The file is lost, please check and try again." @@ -22178,19 +18432,13 @@ msgstr "เชื่อมต่อ CrealityPrint สำเร็จ!" msgid "Could not connect to CrealityPrint" msgstr "ไม่สามารถเชื่อมต่อ CrealityPrint ได้" -msgid "" -"Connection timed out. Please check if the printer and computer network are " -"functioning properly, and confirm that they are on the same network." -msgstr "" -"การเชื่อมต่อหมดเวลา กรุณาตรวจสอบว่าเครื่องพิมพ์และเครือข่ายของคอมพิวเตอร์ทำงานปกติ " -"และอยู่ในเครือข่ายเดียวกัน" +msgid "Connection timed out. Please check if the printer and computer network are functioning properly, and confirm that they are on the same network." +msgstr "การเชื่อมต่อหมดเวลา กรุณาตรวจสอบว่าเครื่องพิมพ์และเครือข่ายของคอมพิวเตอร์ทำงานปกติ และอยู่ในเครือข่ายเดียวกัน" msgid "The Hostname/IP/URL could not be parsed, please check it and try again." msgstr "ไม่สามารถแยกวิเคราะห์ Hostname/IP/URL ได้ กรุณาตรวจสอบและลองอีกครั้ง" -msgid "" -"File/data transfer interrupted. Please check the printer and network, then " -"try it again." +msgid "File/data transfer interrupted. Please check the printer and network, then try it again." msgstr "การถ่ายโอนไฟล์/ข้อมูลถูกขัดจังหวะ กรุณาตรวจสอบเครื่องพิมพ์และเครือข่าย แล้วลองอีกครั้ง" msgid "The provided state is not correct." @@ -22226,9 +18474,7 @@ msgstr "สร้างหูขอบยึดชิ้นงานนกโด msgid "Add or Select" msgstr "เพิ่มหรือเลือก" -msgid "" -"Warning: The brim type is not set to \"painted\", the brim ears will not " -"take effect!" +msgid "Warning: The brim type is not set to \"painted\", the brim ears will not take effect!" msgstr "คำเตือน: ไม่ได้ตั้งค่าประเภทขอบยึดชิ้นงานเป็น \"ทาสี\" หูขอบยึดชิ้นงานจะไม่เกิดผล!" msgid "Set the brim type of this object to \"painted\"" @@ -22311,15 +18557,11 @@ msgstr "มีการอัปเดตปลั๊กอินเครือ msgid "Bambu Network Plug-in Required" msgstr "ต้องใช้ปลั๊กอินเครือข่าย Bambu" -msgid "" -"The Bambu Network Plug-in is corrupted or incompatible. Please reinstall it." +msgid "The Bambu Network Plug-in is corrupted or incompatible. Please reinstall it." msgstr "ปลั๊กอินเครือข่าย Bambu เสียหายหรือเข้ากันไม่ได้ กรุณาติดตั้งใหม่" -msgid "" -"The Bambu Network Plug-in is required for cloud features, printer discovery, " -"and remote printing." -msgstr "" -"ปลั๊กอินเครือข่าย Bambu จำเป็นสำหรับคุณสมบัติคลาวด์ การค้นหาเครื่องพิมพ์ และการพิมพ์ระยะไกล" +msgid "The Bambu Network Plug-in is required for cloud features, printer discovery, and remote printing." +msgstr "ปลั๊กอินเครือข่าย Bambu จำเป็นสำหรับคุณสมบัติคลาวด์ การค้นหาเครื่องพิมพ์ และการพิมพ์ระยะไกล" #, c-format, boost-format msgid "Error: %s" @@ -22362,8 +18604,7 @@ msgstr "อย่าถามอีก" msgid "The Bambu Network Plug-in has been installed successfully." msgstr "ติดตั้งปลั๊กอินเครือข่าย Bambu สำเร็จแล้ว" -msgid "" -"A restart is required to load the new plug-in. Would you like to restart now?" +msgid "A restart is required to load the new plug-in. Would you like to restart now?" msgstr "จำเป็นต้องรีสตาร์ทเพื่อโหลดปลั๊กอินใหม่ คุณต้องการรีสตาร์ทตอนนี้หรือไม่?" msgid "Restart Now" @@ -22381,12 +18622,8 @@ msgstr "ความเร็วปริมาตร" msgid "Step file import parameters" msgstr "พารามิเตอร์การนำเข้าไฟล์ขั้นตอน" -msgid "" -"Smaller linear and angular deflections result in higher-quality " -"transformations but increase the processing time." -msgstr "" -"การโก่งตัวเชิงเส้นและเชิงมุมที่น้อยลงส่งผลให้มีการแปลงคุณภาพสูงขึ้น " -"แต่จะใช้เวลาในการประมวลผลเพิ่มขึ้น" +msgid "Smaller linear and angular deflections result in higher-quality transformations but increase the processing time." +msgstr "การโก่งตัวเชิงเส้นและเชิงมุมที่น้อยลงส่งผลให้มีการแปลงคุณภาพสูงขึ้น แต่จะใช้เวลาในการประมวลผลเพิ่มขึ้น" msgid "Linear Deflection" msgstr "การโก่งตัวเชิงเส้น" @@ -22448,42 +18685,25 @@ msgstr "ส่งออกชุดค่าที่ตั้งไว้ล่ msgid "Save preset bundle" msgstr "บันทึกชุดค่าที่ตั้งไว้ล่วงหน้า" -msgid "" -"Performing desktop integration failed - boost::filesystem::canonical did not " -"return appimage path." -msgstr "" -"การผสานรวมเดสก์ท็อปล้มเหลว - boost::filesystem::canonical ไม่ได้คืนค่าเส้นทาง " -"AppImage" +msgid "Performing desktop integration failed - boost::filesystem::canonical did not return appimage path." +msgstr "การผสานรวมเดสก์ท็อปล้มเหลว - boost::filesystem::canonical ไม่ได้คืนค่าเส้นทาง AppImage" msgid "Performing desktop integration failed - Could not find executable." msgstr "การผสานรวมเดสก์ท็อปล้มเหลว - ไม่พบไฟล์ที่รันได้" -msgid "" -"Performing desktop integration failed because the application directory was " -"not found." +msgid "Performing desktop integration failed because the application directory was not found." msgstr "การผสานรวมเดสก์ท็อปล้มเหลว เนื่องจากไม่พบไดเรกทอรีแอปพลิเคชัน" -msgid "" -"Performing desktop integration failed - could not create Gcodeviewer desktop " -"file. OrcaSlicer desktop file was probably created successfully." -msgstr "" -"การผสานรวมเดสก์ท็อปล้มเหลว - ไม่สามารถสร้างไฟล์เดสก์ท็อป Gcodeviewer ได้ ไฟล์เดสก์ท็อป " -"OrcaSlicer อาจถูกสร้างสำเร็จแล้ว" +msgid "Performing desktop integration failed - could not create Gcodeviewer desktop file. OrcaSlicer desktop file was probably created successfully." +msgstr "การผสานรวมเดสก์ท็อปล้มเหลว - ไม่สามารถสร้างไฟล์เดสก์ท็อป Gcodeviewer ได้ ไฟล์เดสก์ท็อป OrcaSlicer อาจถูกสร้างสำเร็จแล้ว" -msgid "" -"Performing downloader desktop integration failed - boost::filesystem::" -"canonical did not return appimage path." -msgstr "" -"การผสานรวมเดสก์ท็อปของตัวดาวน์โหลดล้มเหลว - boost::filesystem::canonical " -"ไม่ได้ส่งคืนเส้นทาง AppImage" +msgid "Performing downloader desktop integration failed - boost::filesystem::canonical did not return appimage path." +msgstr "การผสานรวมเดสก์ท็อปของตัวดาวน์โหลดล้มเหลว - boost::filesystem::canonical ไม่ได้ส่งคืนเส้นทาง AppImage" -msgid "" -"Performing downloader desktop integration failed - Could not find executable." +msgid "Performing downloader desktop integration failed - Could not find executable." msgstr "การผสานรวมเดสก์ท็อปของตัวดาวน์โหลดล้มเหลว - ไม่พบไฟล์ที่รันได้" -msgid "" -"Performing downloader desktop integration failed because the application " -"directory was not found." +msgid "Performing downloader desktop integration failed because the application directory was not found." msgstr "การผสานรวมเดสก์ท็อปของตัวดาวน์โหลดล้มเหลว เนื่องจากไม่พบไดเรกทอรีแอปพลิเคชัน" msgid "Desktop Integration" @@ -22512,21 +18732,16 @@ msgstr "ดูตัวอย่างไฟล์บีบอัด" msgid "Open File" msgstr "เปิดไฟล์" -msgid "" -"The filament may not be compatible with the current machine settings. " -"Generic filament presets will be used." +msgid "The filament may not be compatible with the current machine settings. Generic filament presets will be used." msgstr "เส้นพลาสติกอาจไม่เข้ากันกับการตั้งค่าเครื่องปัจจุบัน จะใช้การตั้งค่าฟิลาเมนต์ทั่วไป" -msgid "" -"The filament model is unknown. Still using the previous filament preset." +msgid "The filament model is unknown. Still using the previous filament preset." msgstr "ไม่ทราบแบบจำลองเส้นพลาสติก ยังคงใช้ค่าที่ตั้งไว้ล่วงหน้าของฟิลาเมนต์ก่อนหน้านี้" msgid "The filament model is unknown. Generic filament presets will be used." msgstr "ไม่ทราบแบบจำลองเส้นพลาสติก จะใช้การตั้งค่าฟิลาเมนต์ทั่วไป" -msgid "" -"The filament may not be compatible with the current machine settings. A " -"random filament preset will be used." +msgid "The filament may not be compatible with the current machine settings. A random filament preset will be used." msgstr "เส้นพลาสติกอาจไม่เข้ากันกับการตั้งค่าเครื่องปัจจุบัน ระบบจะใช้การตั้งค่าฟิลาเมนต์แบบสุ่ม" msgid "The filament model is unknown. A random filament preset will be used." @@ -22535,8 +18750,7 @@ msgstr "ไม่ทราบแบบจำลองเส้นพลาสต #: resources/data/hints.ini: [hint:Precise wall] msgid "" "Precise wall\n" -"Did you know that turning on precise wall can improve precision and layer " -"consistency?" +"Did you know that turning on precise wall can improve precision and layer consistency?" msgstr "" "ผนังที่แม่นยำ\n" "คุณรู้หรือไม่ว่าการเปิดผนังที่แม่นยำสามารถปรับปรุงความแม่นยำและความสม่ำเสมอของชั้นได้" @@ -22544,14 +18758,10 @@ msgstr "" #: resources/data/hints.ini: [hint:Sandwich mode] msgid "" "Sandwich mode\n" -"Did you know that you can use sandwich mode (inner-outer-inner) to improve " -"precision and layer consistency if your model doesn't have very steep " -"overhangs?" +"Did you know that you can use sandwich mode (inner-outer-inner) to improve precision and layer consistency if your model doesn't have very steep overhangs?" msgstr "" "โหมดแซนด์วิช\n" -"คุณรู้ไหมว่าคุณสามารถใช้โหมดแซนวิช (ด้านใน-ด้านนอก-ด้านใน) " -"เพื่อปรับปรุงความแม่นยำและความสม่ำเสมอของเลเยอร์ได้ " -"หากแบบจำลองของคุณไม่มีระยะยื่นที่สูงชันมากนัก" +"คุณรู้ไหมว่าคุณสามารถใช้โหมดแซนวิช (ด้านใน-ด้านนอก-ด้านใน) เพื่อปรับปรุงความแม่นยำและความสม่ำเสมอของเลเยอร์ได้ หากแบบจำลองของคุณไม่มีระยะยื่นที่สูงชันมากนัก" #: resources/data/hints.ini: [hint:Chamber temperature] msgid "" @@ -22564,12 +18774,10 @@ msgstr "" #: resources/data/hints.ini: [hint:Calibration] msgid "" "Calibration\n" -"Did you know that calibrating your printer can do wonders? Check out our " -"beloved calibration solution in OrcaSlicer." +"Did you know that calibrating your printer can do wonders? Check out our beloved calibration solution in OrcaSlicer." msgstr "" "การสอบเทียบ\n" -"คุณรู้หรือไม่ว่าการปรับเทียบเครื่องพิมพ์ของคุณสามารถสร้างสิ่งมหัศจรรย์ได้ " -"ตรวจสอบโซลูชันการสอบเทียบที่เราชื่นชอบใน OrcaSlicer" +"คุณรู้หรือไม่ว่าการปรับเทียบเครื่องพิมพ์ของคุณสามารถสร้างสิ่งมหัศจรรย์ได้ ตรวจสอบโซลูชันการสอบเทียบที่เราชื่นชอบใน OrcaSlicer" #: resources/data/hints.ini: [hint:Auxiliary fan] msgid "" @@ -22598,18 +18806,15 @@ msgstr "" #: resources/data/hints.ini: [hint:Switch workspaces] msgid "" "Switch workspaces\n" -"You can switch between Prepare and Preview workspaces by " -"pressing the Tab key." +"You can switch between Prepare and Preview workspaces by pressing the Tab key." msgstr "" "สลับพื้นที่ทำงาน\n" -"คุณสามารถสลับระหว่างพื้นที่ทำงาน จัดเตรียม และ ดูตัวอย่าง ได้โดยการกดปุ่ม " -"Tab" +"คุณสามารถสลับระหว่างพื้นที่ทำงาน จัดเตรียม และ ดูตัวอย่าง ได้โดยการกดปุ่ม Tab" #: resources/data/hints.ini: [hint:How to use keyboard shortcuts] msgid "" "How to use keyboard shortcuts\n" -"Did you know that Orca Slicer offers a wide range of keyboard shortcuts and " -"3D scene operations?" +"Did you know that Orca Slicer offers a wide range of keyboard shortcuts and 3D scene operations?" msgstr "" "วิธีใช้แป้นพิมพ์ลัด\n" "คุณรู้หรือไม่ว่า Orca Slicer มีแป้นพิมพ์ลัดและการทำงานของฉาก 3 มิติที่หลากหลาย" @@ -22617,20 +18822,15 @@ msgstr "" #: resources/data/hints.ini: [hint:Reverse on even] msgid "" "Reverse on even\n" -"Did you know that Reverse on even feature can significantly improve " -"the surface quality of your overhangs? However, it can cause wall " -"inconsistencies so use carefully!" +"Did you know that Reverse on even feature can significantly improve the surface quality of your overhangs? However, it can cause wall inconsistencies so use carefully!" msgstr "" "ย้อนกลับในคู่\n" -"คุณรู้หรือไม่ว่าคุณลักษณะ ย้อนกลับเมื่อสม่ำเสมอ " -"สามารถปรับปรุงคุณภาพพื้นผิวของระยะยื่นของคุณได้อย่างมาก อย่างไรก็ตาม " -"อาจทำให้เกิดความไม่สอดคล้องกันของผนังได้ ดังนั้นโปรดใช้อย่างระมัดระวัง!" +"คุณรู้หรือไม่ว่าคุณลักษณะ ย้อนกลับเมื่อสม่ำเสมอ สามารถปรับปรุงคุณภาพพื้นผิวของระยะยื่นของคุณได้อย่างมาก อย่างไรก็ตาม อาจทำให้เกิดความไม่สอดคล้องกันของผนังได้ ดังนั้นโปรดใช้อย่างระมัดระวัง!" #: resources/data/hints.ini: [hint:Cut Tool] msgid "" "Cut Tool\n" -"Did you know that you can cut a model at any angle and position with the " -"cutting tool?" +"Did you know that you can cut a model at any angle and position with the cutting tool?" msgstr "" "เครื่องมือตัด\n" "คุณรู้หรือไม่ว่าคุณสามารถตัดแบบจำลองได้ทุกมุมและทุกตำแหน่งด้วยเครื่องมือตัด" @@ -22638,12 +18838,10 @@ msgstr "" #: resources/data/hints.ini: [hint:Fix Model] msgid "" "Fix Model\n" -"Did you know that you can fix a corrupted 3D model to avoid a lot of slicing " -"problems on the Windows system?" +"Did you know that you can fix a corrupted 3D model to avoid a lot of slicing problems on the Windows system?" msgstr "" "แก้ไขโมเดล\n" -"คุณรู้ไหมว่าคุณสามารถแก้ไขโมเดล 3 มิติที่เสียหายได้เพื่อหลีกเลี่ยงปัญหาการแบ่งส่วนในระบบ Windows " -"มากมาย" +"คุณรู้ไหมว่าคุณสามารถแก้ไขโมเดล 3 มิติที่เสียหายได้เพื่อหลีกเลี่ยงปัญหาการแบ่งส่วนในระบบ Windows มากมาย" #: resources/data/hints.ini: [hint:Timelapse] msgid "" @@ -22664,8 +18862,7 @@ msgstr "" #: resources/data/hints.ini: [hint:Auto-Orient] msgid "" "Auto-Orient\n" -"Did you know that you can rotate objects to an optimal orientation for " -"printing with a simple click?" +"Did you know that you can rotate objects to an optimal orientation for printing with a simple click?" msgstr "" "ปรับทิศทางอัตโนมัติ\n" "คุณรู้หรือไม่ว่าคุณสามารถหมุนวัตถุให้อยู่ในแนวที่เหมาะสมที่สุดสำหรับการพิมพ์ด้วยการคลิกเพียงครั้งเดียว" @@ -22673,19 +18870,15 @@ msgstr "" #: resources/data/hints.ini: [hint:Lay on Face] msgid "" "Lay on Face\n" -"Did you know that you can quickly orient a model so that one of its faces " -"sits on the print bed? Select the \"Place on face\" function or press the " -"F key." +"Did you know that you can quickly orient a model so that one of its faces sits on the print bed? Select the \"Place on face\" function or press the F key." msgstr "" "วางบนหน้า\n" -"คุณรู้ไหมว่าคุณสามารถปรับทิศทางแบบจำลองได้อย่างรวดเร็วเพื่อให้ผิวหน้าด้านใดด้านหนึ่งวางอยู่บนฐานพิมพ์ " -"เลือกฟังก์ชัน \"วางบนหน้า\" หรือกดปุ่ม F" +"คุณรู้ไหมว่าคุณสามารถปรับทิศทางแบบจำลองได้อย่างรวดเร็วเพื่อให้ผิวหน้าด้านใดด้านหนึ่งวางอยู่บนฐานพิมพ์ เลือกฟังก์ชัน \"วางบนหน้า\" หรือกดปุ่ม F" #: resources/data/hints.ini: [hint:Object List] msgid "" "Object List\n" -"Did you know that you can view all objects/parts in a list and change " -"settings for each object/part?" +"Did you know that you can view all objects/parts in a list and change settings for each object/part?" msgstr "" "รายการวัตถุ\n" "คุณรู้ไหมว่าคุณสามารถดูวัตถุ/ชิ้นส่วนทั้งหมดในรายการและเปลี่ยนการตั้งค่าสำหรับแต่ละวัตถุ/ชิ้นส่วนได้" @@ -22693,8 +18886,7 @@ msgstr "" #: resources/data/hints.ini: [hint:Search Functionality] msgid "" "Search Functionality\n" -"Did you know that you use the Search tool to quickly find a specific Orca " -"Slicer setting?" +"Did you know that you use the Search tool to quickly find a specific Orca Slicer setting?" msgstr "" "ฟังก์ชั่นการค้นหา\n" "คุณรู้ไหมว่าคุณใช้เครื่องมือค้นหาเพื่อค้นหาการตั้งค่า Orca Slicer ที่ต้องการอย่างรวดเร็ว" @@ -22702,18 +18894,15 @@ msgstr "" #: resources/data/hints.ini: [hint:Simplify Model] msgid "" "Simplify Model\n" -"Did you know that you can reduce the number of triangles in a mesh using the " -"Simplify mesh feature? Right-click the model and select Simplify model." +"Did you know that you can reduce the number of triangles in a mesh using the Simplify mesh feature? Right-click the model and select Simplify model." msgstr "" "ลดความซับซ้อนของโมเดล\n" -"คุณรู้ไหมว่าคุณสามารถลดจำนวนสามเหลี่ยมใน mesh ได้โดยใช้ฟีเจอร์ Simplify mesh " -"คลิกขวาที่โมเดลแล้วเลือกลดความซับซ้อนของโมเดล" +"คุณรู้ไหมว่าคุณสามารถลดจำนวนสามเหลี่ยมใน mesh ได้โดยใช้ฟีเจอร์ Simplify mesh คลิกขวาที่โมเดลแล้วเลือกลดความซับซ้อนของโมเดล" #: resources/data/hints.ini: [hint:Slicing Parameter Table] msgid "" "Slicing Parameter Table\n" -"Did you know that you can view all objects/parts on a table and change " -"settings for each object/part?" +"Did you know that you can view all objects/parts on a table and change settings for each object/part?" msgstr "" "ตารางพารามิเตอร์การแบ่งส่วน\n" "คุณรู้ไหมว่าคุณสามารถดูวัตถุ/ชิ้นส่วนทั้งหมดบนโต๊ะและเปลี่ยนการตั้งค่าสำหรับแต่ละวัตถุ/ชิ้นส่วนได้" @@ -22721,8 +18910,7 @@ msgstr "" #: resources/data/hints.ini: [hint:Split to Objects/Parts] msgid "" "Split to Objects/Parts\n" -"Did you know that you can split a big object into small ones for easy " -"colorizing or printing?" +"Did you know that you can split a big object into small ones for easy colorizing or printing?" msgstr "" "แยกเป็นวัตถุ/ชิ้นส่วน\n" "คุณรู้ไหมว่าคุณสามารถแบ่งวัตถุขนาดใหญ่ออกเป็นชิ้นเล็กเพื่อให้ระบายสีหรือพิมพ์ได้ง่าย" @@ -22730,112 +18918,82 @@ msgstr "" #: resources/data/hints.ini: [hint:Subtract a Part] msgid "" "Subtract a Part\n" -"Did you know that you can subtract one mesh from another using the Negative " -"part modifier? That way you can, for example, create easily resizable holes " -"directly in Orca Slicer." +"Did you know that you can subtract one mesh from another using the Negative part modifier? That way you can, for example, create easily resizable holes directly in Orca Slicer." msgstr "" "ลบส่วนหนึ่ง\n" -"คุณรู้ไหมว่าคุณสามารถลบหนึ่ง mesh จากอีกอันหนึ่งได้โดยใช้ Negative part modifier? ด้วยวิธีนี้ " -"คุณสามารถสร้างรูที่ปรับขนาดได้อย่างง่ายดายโดยตรงใน Orca Slicer" +"คุณรู้ไหมว่าคุณสามารถลบหนึ่ง mesh จากอีกอันหนึ่งได้โดยใช้ Negative part modifier? ด้วยวิธีนี้ คุณสามารถสร้างรูที่ปรับขนาดได้อย่างง่ายดายโดยตรงใน Orca Slicer" #: resources/data/hints.ini: [hint:STEP] msgid "" "STEP\n" -"Did you know that you can improve your print quality by slicing a STEP file " -"instead of an STL?\n" -"Orca Slicer supports slicing STEP files, providing smoother results than a " -"lower resolution STL. Give it a try!" +"Did you know that you can improve your print quality by slicing a STEP file instead of an STL?\n" +"Orca Slicer supports slicing STEP files, providing smoother results than a lower resolution STL. Give it a try!" msgstr "" "ขั้นตอน\n" "คุณรู้ไหมว่าคุณสามารถปรับปรุงคุณภาพการพิมพ์ได้โดยการแบ่งไฟล์ STEP แทนที่จะเป็น STL\n" -"Orca Slicer รองรับการแบ่งไฟล์ STEP ซึ่งให้ผลลัพธ์ที่นุ่มนวลกว่า STL ที่มีความละเอียดต่ำกว่า " -"ลองดูสิ!" +"Orca Slicer รองรับการแบ่งไฟล์ STEP ซึ่งให้ผลลัพธ์ที่นุ่มนวลกว่า STL ที่มีความละเอียดต่ำกว่า ลองดูสิ!" #: resources/data/hints.ini: [hint:Z seam location] msgid "" "Z seam location\n" -"Did you know that you can customize the location of the Z seam, and even " -"paint it on your print, to have it in a less visible location? This improves " -"the overall look of your model. Check it out!" +"Did you know that you can customize the location of the Z seam, and even paint it on your print, to have it in a less visible location? This improves the overall look of your model. Check it out!" msgstr "" "ตำแหน่งรอยตะเข็บ Z\n" -"คุณรู้ไหมว่าคุณสามารถปรับแต่งตำแหน่งของรอยตะเข็บ Z " -"และแม้แต่ทาสีบนงานพิมพ์เพื่อให้อยู่ในตำแหน่งที่มองเห็นได้น้อยลง " -"สิ่งนี้จะช่วยปรับปรุงรูปลักษณ์โดยรวมของโมเดลของคุณ ตรวจสอบออก!" +"คุณรู้ไหมว่าคุณสามารถปรับแต่งตำแหน่งของรอยตะเข็บ Z และแม้แต่ทาสีบนงานพิมพ์เพื่อให้อยู่ในตำแหน่งที่มองเห็นได้น้อยลง สิ่งนี้จะช่วยปรับปรุงรูปลักษณ์โดยรวมของโมเดลของคุณ ตรวจสอบออก!" #: resources/data/hints.ini: [hint:Fine-tuning for flow rate] msgid "" "Fine-tuning for flow rate\n" -"Did you know that flow rate can be fine-tuned for even better-looking " -"prints? Depending on the material, you can improve the overall finish of the " -"printed model by doing some fine-tuning." +"Did you know that flow rate can be fine-tuned for even better-looking prints? Depending on the material, you can improve the overall finish of the printed model by doing some fine-tuning." msgstr "" "Fine-tuning for flow rate\n" -"คุณรู้หรือไม่ว่าอัตราการไหลสามารถปรับได้อย่างละเอียดเพื่อให้งานพิมพ์ดูดีขึ้น " -"คุณสามารถปรับปรุงการตกแต่งโดยรวมของโมเดลที่พิมพ์ออกมาได้โดยการปรับแต่งแบบละเอียด " -"ทั้งนี้ขึ้นอยู่กับวัสดุ" +"คุณรู้หรือไม่ว่าอัตราการไหลสามารถปรับได้อย่างละเอียดเพื่อให้งานพิมพ์ดูดีขึ้น คุณสามารถปรับปรุงการตกแต่งโดยรวมของโมเดลที่พิมพ์ออกมาได้โดยการปรับแต่งแบบละเอียด ทั้งนี้ขึ้นอยู่กับวัสดุ" #: resources/data/hints.ini: [hint:Split your prints into plates] msgid "" "Split your prints into plates\n" -"Did you know that you can split a model that has a lot of parts into " -"individual plates ready to print? This will simplify the process of keeping " -"track of all the parts." +"Did you know that you can split a model that has a lot of parts into individual plates ready to print? This will simplify the process of keeping track of all the parts." msgstr "" "แบ่งงานพิมพ์ของคุณออกเป็นจาน\n" -"คุณรู้ไหมว่าคุณสามารถแบ่งแบบจำลองที่มีชิ้นส่วนจำนวนมากออกเป็นเพลตแต่ละอันที่พร้อมพิมพ์ได้ " -"สิ่งนี้จะทำให้กระบวนการติดตามทุกส่วนง่ายขึ้น" +"คุณรู้ไหมว่าคุณสามารถแบ่งแบบจำลองที่มีชิ้นส่วนจำนวนมากออกเป็นเพลตแต่ละอันที่พร้อมพิมพ์ได้ สิ่งนี้จะทำให้กระบวนการติดตามทุกส่วนง่ายขึ้น" #: resources/data/hints.ini: [hint:Speed up your print with Adaptive Layer #: Height] msgid "" "Speed up your print with Adaptive Layer Height\n" -"Did you know that you can print a model even faster by using the Adaptive " -"Layer Height option? Check it out!" +"Did you know that you can print a model even faster by using the Adaptive Layer Height option? Check it out!" msgstr "" "เร่งความเร็วการพิมพ์ของคุณด้วย Adaptive Layer Height\n" -"คุณรู้ไหมว่าคุณสามารถพิมพ์แบบจำลองได้เร็วยิ่งขึ้นด้วยการใช้ตัวเลือก Adaptive Layer Height " -"ตรวจสอบออก!" +"คุณรู้ไหมว่าคุณสามารถพิมพ์แบบจำลองได้เร็วยิ่งขึ้นด้วยการใช้ตัวเลือก Adaptive Layer Height ตรวจสอบออก!" #: resources/data/hints.ini: [hint:Support painting] msgid "" "Support painting\n" -"Did you know that you can paint the location of your supports? This feature " -"makes it easy to place the support material only on the sections of the " -"model that actually need it." +"Did you know that you can paint the location of your supports? This feature makes it easy to place the support material only on the sections of the model that actually need it." msgstr "" "ส่วนรองรับการวาดภาพ\n" -"คุณรู้ไหมว่าคุณสามารถทาสีตำแหน่งของส่วนรองรับของคุณได้? " -"คุณสมบัตินี้ทำให้ง่ายต่อการวางวัสดุรองรับเฉพาะส่วนของรุ่นที่ต้องการจริงๆ" +"คุณรู้ไหมว่าคุณสามารถทาสีตำแหน่งของส่วนรองรับของคุณได้? คุณสมบัตินี้ทำให้ง่ายต่อการวางวัสดุรองรับเฉพาะส่วนของรุ่นที่ต้องการจริงๆ" #: resources/data/hints.ini: [hint:Different types of supports] msgid "" "Different types of supports\n" -"Did you know that you can choose from multiple types of supports? Tree " -"supports work great for organic models while saving filament and improving " -"print speed. Check them out!" +"Did you know that you can choose from multiple types of supports? Tree supports work great for organic models while saving filament and improving print speed. Check them out!" msgstr "" "ส่วนรองรับประเภทต่าง ๆ\n" -"คุณรู้ไหมว่าคุณสามารถเลือกส่วนรองรับได้หลายประเภท? " -"ส่วนรองรับแบบต้นไม้เหมาะกับโมเดลทรงออร์แกนิก " -"ช่วยประหยัดเส้นพลาสติกและเพิ่มความเร็วในการพิมพ์ ลองดูได้เลย!" +"คุณรู้ไหมว่าคุณสามารถเลือกส่วนรองรับได้หลายประเภท? ส่วนรองรับแบบต้นไม้เหมาะกับโมเดลทรงออร์แกนิก ช่วยประหยัดเส้นพลาสติกและเพิ่มความเร็วในการพิมพ์ ลองดูได้เลย!" #: resources/data/hints.ini: [hint:Printing Silk Filament] msgid "" "Printing Silk Filament\n" -"Did you know that Silk filament needs special consideration to print " -"successfully? A higher temperature and lower speed are always recommended " -"for the best results." +"Did you know that Silk filament needs special consideration to print successfully? A higher temperature and lower speed are always recommended for the best results." msgstr "" "การพิมพ์เส้นพลาสติก Silk\n" -"คุณรู้ไหมว่าเส้นพลาสติก Silk ต้องตั้งค่าด้วยความระมัดระวังเป็นพิเศษเพื่อให้พิมพ์สำเร็จ " -"โดยทั่วไปแนะนำให้ใช้อุณหภูมิสูงขึ้นและความเร็วต่ำลงเพื่อผลลัพธ์ที่ดีที่สุด" +"คุณรู้ไหมว่าเส้นพลาสติก Silk ต้องตั้งค่าด้วยความระมัดระวังเป็นพิเศษเพื่อให้พิมพ์สำเร็จ โดยทั่วไปแนะนำให้ใช้อุณหภูมิสูงขึ้นและความเร็วต่ำลงเพื่อผลลัพธ์ที่ดีที่สุด" #: resources/data/hints.ini: [hint:Brim for better adhesion] msgid "" "Brim for better adhesion\n" -"Did you know that when printed models have a small contact interface with " -"the printing surface, it's recommended to use a brim?" +"Did you know that when printed models have a small contact interface with the printing surface, it's recommended to use a brim?" msgstr "" "ขอบยึดชิ้นงานเพื่อการยึดเกาะที่ดีขึ้น\n" "คุณรู้หรือไม่ว่าเมื่อแบบจำลองที่พิมพ์มีส่วนติดต่อขนาดเล็กกับพื้นผิวการพิมพ์ ขอแนะนำให้ใช้ขอบยึดชิ้นงาน" @@ -22843,8 +19001,7 @@ msgstr "" #: resources/data/hints.ini: [hint:Set parameters for multiple objects] msgid "" "Set parameters for multiple objects\n" -"Did you know that you can set slicing parameters for all selected objects at " -"once?" +"Did you know that you can set slicing parameters for all selected objects at once?" msgstr "" "ตั้งค่าพารามิเตอร์สำหรับวัตถุหลายรายการ\n" "คุณรู้ไหมว่าคุณสามารถตั้งค่าพารามิเตอร์การแบ่งส่วนสำหรับวัตถุที่เลือกทั้งหมดได้ในคราวเดียว" @@ -22860,18 +19017,15 @@ msgstr "" #: resources/data/hints.ini: [hint:Flush into support/objects/infill] msgid "" "Flush into support/objects/infill\n" -"Did you know that you can reduce wasted filament by flushing it into support/" -"objects/infill during filament changes?" +"Did you know that you can reduce wasted filament by flushing it into support/objects/infill during filament changes?" msgstr "" "ไล่เส้นเข้าไปในส่วนรองรับ/วัตถุ/ไส้ใน\n" -"คุณรู้ไหมว่าคุณสามารถลดเส้นพลาสติกที่เสียไปได้ โดยไล่เส้นเข้าไปในส่วนรองรับ วัตถุ " -"หรือไส้ในระหว่างเปลี่ยนเส้นพลาสติก" +"คุณรู้ไหมว่าคุณสามารถลดเส้นพลาสติกที่เสียไปได้ โดยไล่เส้นเข้าไปในส่วนรองรับ วัตถุ หรือไส้ในระหว่างเปลี่ยนเส้นพลาสติก" #: resources/data/hints.ini: [hint:Improve strength] msgid "" "Improve strength\n" -"Did you know that you can use more wall loops and higher sparse infill " -"density to improve the strength of the model?" +"Did you know that you can use more wall loops and higher sparse infill density to improve the strength of the model?" msgstr "" "ปรับปรุงความแข็งแรง\n" "คุณรู้ไหมว่าคุณสามารถใช้ลูปติดผนังได้มากขึ้นและมีความหนาแน่นของไส้ในแบบโปร่งที่สูงขึ้นเพื่อปรับปรุงความแข็งแกร่งของแบบจำลอง" @@ -22880,43 +19034,27 @@ msgstr "" #: door opened] msgid "" "When do you need to print with the printer door opened?\n" -"Did you know that opening the printer door can reduce the probability of " -"extruder/hotend clogging when printing lower temperature filament with a " -"higher enclosure temperature? There is more info about this in the Wiki." +"Did you know that opening the printer door can reduce the probability of extruder/hotend clogging when printing lower temperature filament with a higher enclosure temperature? There is more info about this in the Wiki." msgstr "" "เมื่อใดที่คุณจำเป็นต้องพิมพ์โดยเปิดประตูเครื่องพิมพ์?\n" -"คุณรู้หรือไม่ว่าการเปิดประตูเครื่องพิมพ์สามารถลดโอกาสที่ชุดดันเส้น/" -"ฮอตเอนด์จะอุดตันเมื่อพิมพ์เส้นพลาสติกที่มีอุณหภูมิต่ำลงและมีอุณหภูมิของกรอบที่สูงขึ้น " -"ข้อมูลเพิ่มเติมเกี่ยวกับเรื่องนี้ใน Wiki" +"คุณรู้หรือไม่ว่าการเปิดประตูเครื่องพิมพ์สามารถลดโอกาสที่ชุดดันเส้น/ฮอตเอนด์จะอุดตันเมื่อพิมพ์เส้นพลาสติกที่มีอุณหภูมิต่ำลงและมีอุณหภูมิของกรอบที่สูงขึ้น ข้อมูลเพิ่มเติมเกี่ยวกับเรื่องนี้ใน Wiki" #: resources/data/hints.ini: [hint:Avoid warping] msgid "" "Avoid warping\n" -"Did you know that when printing materials that are prone to warping such as " -"ABS, appropriately increasing the heatbed temperature can reduce the " -"probability of warping?" +"Did you know that when printing materials that are prone to warping such as ABS, appropriately increasing the heatbed temperature can reduce the probability of warping?" msgstr "" "หลีกเลี่ยงการบิดเบี้ยว\n" -"คุณรู้หรือไม่ว่าเมื่อพิมพ์วัสดุที่มีแนวโน้มที่จะเกิดการบิดเบี้ยว เช่น ABS " -"การเพิ่มอุณหภูมิฐานพิมพ์อย่างเหมาะสมสามารถลดความน่าจะเป็นของการบิดเบี้ยวได้" +"คุณรู้หรือไม่ว่าเมื่อพิมพ์วัสดุที่มีแนวโน้มที่จะเกิดการบิดเบี้ยว เช่น ABS การเพิ่มอุณหภูมิฐานพิมพ์อย่างเหมาะสมสามารถลดความน่าจะเป็นของการบิดเบี้ยวได้" -#~ msgid "" -#~ "This is the height of the first layer. Making the first layer height " -#~ "thicker can improve build plate adhesion." +#~ msgid "This is the height of the first layer. Making the first layer height thicker can improve build plate adhesion." #~ msgstr "ความสูงของชั้นแรก การทำให้ชั้นแรกหนาขึ้นสามารถปรับปรุงการยึดเกาะของแผ่นรองพื้นได้" #~ msgid "Enable network plug-in" #~ msgstr "เปิดใช้งานปลั๊กอินเครือข่าย" -#~ msgid "" -#~ "Enable adaptive PA for overhangs as well as when flow changes within the " -#~ "same feature. This is an experimental option, as if the PA profile is not " -#~ "set accurately, it will cause uniformity issues on the external surfaces " -#~ "before and after overhangs.\n" -#~ msgstr "" -#~ "เปิดใช้งาน PA แบบปรับได้สำหรับส่วนยื่นและเมื่อโฟลว์เปลี่ยนแปลงภายในฟีเจอร์เดียวกัน " -#~ "นี่เป็นตัวเลือกทดลอง ราวกับว่าโปรไฟล์ PA ไม่ได้ตั้งค่าอย่างถูกต้อง " -#~ "ก็จะทำให้เกิดปัญหาความสม่ำเสมอบนพื้นผิวภายนอกก่อนและหลังระยะยื่น\n" +#~ msgid "Enable adaptive PA for overhangs as well as when flow changes within the same feature. This is an experimental option, as if the PA profile is not set accurately, it will cause uniformity issues on the external surfaces before and after overhangs.\n" +#~ msgstr "เปิดใช้งาน PA แบบปรับได้สำหรับส่วนยื่นและเมื่อโฟลว์เปลี่ยนแปลงภายในฟีเจอร์เดียวกัน นี่เป็นตัวเลือกทดลอง ราวกับว่าโปรไฟล์ PA ไม่ได้ตั้งค่าอย่างถูกต้อง ก็จะทำให้เกิดปัญหาความสม่ำเสมอบนพื้นผิวภายนอกก่อนและหลังระยะยื่น\n" #~ msgid "Perform" #~ msgstr "ดำเนินการ" @@ -23025,19 +19163,11 @@ msgstr "" #~ msgid "Cloud Error" #~ msgstr "ข้อผิดพลาดคลาวด์" -#~ msgid "" -#~ "This disables all cloud services e.g. Orca Cloud and Bambu Cloud. This " -#~ "stops the transmission of data to Bambu's cloud services too. Users who " -#~ "don't use BBL machines or use LAN mode only can safely turn on this " -#~ "function." -#~ msgstr "" -#~ "การดำเนินการนี้จะปิดใช้งานบริการคลาวด์ทั้งหมด เช่น ออร์ก้าคลาวด์และแบมบูคลาวด์ " -#~ "ซึ่งจะหยุดการส่งข้อมูลไปยังบริการคลาวด์ของ Bambu ด้วยเช่นกัน ผู้ใช้ที่ไม่ได้ใช้เครื่อง BBL " -#~ "หรือใช้โหมด LAN เท่านั้นสามารถเปิดฟังก์ชันนี้ได้อย่างปลอดภัย" +#~ msgid "This disables all cloud services e.g. Orca Cloud and Bambu Cloud. This stops the transmission of data to Bambu's cloud services too. Users who don't use BBL machines or use LAN mode only can safely turn on this function." +#~ msgstr "การดำเนินการนี้จะปิดใช้งานบริการคลาวด์ทั้งหมด เช่น ออร์ก้าคลาวด์และแบมบูคลาวด์ ซึ่งจะหยุดการส่งข้อมูลไปยังบริการคลาวด์ของ Bambu ด้วยเช่นกัน ผู้ใช้ที่ไม่ได้ใช้เครื่อง BBL หรือใช้โหมด LAN เท่านั้นสามารถเปิดฟังก์ชันนี้ได้อย่างปลอดภัย" #~ msgid "" -#~ "The Wipe option is not available when using the Firmware Retraction " -#~ "mode.\n" +#~ "The Wipe option is not available when using the Firmware Retraction mode.\n" #~ "\n" #~ "Shall I disable it in order to enable Firmware Retraction?" #~ msgstr "" @@ -23045,171 +19175,93 @@ msgstr "" #~ "\n" #~ "ฉันควรปิดการใช้งานเพื่อเปิดใช้งานการถอนเฟิร์มแวร์หรือไม่" -#~ msgid "" -#~ "\"G92 E0\" was found in before_layer_gcode, which is incompatible with " -#~ "absolute extruder addressing." -#~ msgstr "" -#~ "พบ \"G92 E0\" ใน before_layer_gcode " -#~ "ซึ่งเข้ากันไม่ได้กับการระบุที่อยู่ของชุดดันเส้นแบบสัมบูรณ์" +#~ msgid "\"G92 E0\" was found in before_layer_gcode, which is incompatible with absolute extruder addressing." +#~ msgstr "พบ \"G92 E0\" ใน before_layer_gcode ซึ่งเข้ากันไม่ได้กับการระบุที่อยู่ของชุดดันเส้นแบบสัมบูรณ์" -#~ msgid "" -#~ "\"G92 E0\" was found in layer_gcode, which is incompatible with absolute " -#~ "extruder addressing." -#~ msgstr "" -#~ "พบ \"G92 E0\" ใน layer_gcode ซึ่งเข้ากันไม่ได้กับการกำหนดที่อยู่ของชุดดันเส้นแบบสัมบูรณ์" +#~ msgid "\"G92 E0\" was found in layer_gcode, which is incompatible with absolute extruder addressing." +#~ msgstr "พบ \"G92 E0\" ใน layer_gcode ซึ่งเข้ากันไม่ได้กับการกำหนดที่อยู่ของชุดดันเส้นแบบสัมบูรณ์" #, no-c-format, no-boost-format -#~ msgid "" -#~ "Bridging angle override. If left to zero, the bridging angle will be " -#~ "calculated automatically. Otherwise the provided angle will be used for " -#~ "external bridges. Use 180° for zero angle." -#~ msgstr "" -#~ "การแทนที่มุมเชื่อมโยง หากปล่อยให้เหลือศูนย์ มุมเชื่อมโยงจะถูกคำนวณโดยอัตโนมัติ " -#~ "มิฉะนั้นจะใช้มุมที่ให้ไว้สำหรับสะพานภายนอก ใช้ 180° สำหรับมุมศูนย์" +#~ msgid "Bridging angle override. If left to zero, the bridging angle will be calculated automatically. Otherwise the provided angle will be used for external bridges. Use 180° for zero angle." +#~ msgstr "การแทนที่มุมเชื่อมโยง หากปล่อยให้เหลือศูนย์ มุมเชื่อมโยงจะถูกคำนวณโดยอัตโนมัติ มิฉะนั้นจะใช้มุมที่ให้ไว้สำหรับสะพานภายนอก ใช้ 180° สำหรับมุมศูนย์" #~ msgid "" -#~ "Internal bridging angle override. If left to zero, the bridging angle " -#~ "will be calculated automatically. Otherwise the provided angle will be " -#~ "used for internal bridges. Use 180° for zero angle.\n" +#~ "Internal bridging angle override. If left to zero, the bridging angle will be calculated automatically. Otherwise the provided angle will be used for internal bridges. Use 180° for zero angle.\n" #~ "\n" -#~ "It is recommended to leave it at 0 unless there is a specific model need " -#~ "not to." +#~ "It is recommended to leave it at 0 unless there is a specific model need not to." #~ msgstr "" -#~ "การแทนที่มุมเชื่อมต่อภายใน หากปล่อยให้เหลือศูนย์ มุมเชื่อมโยงจะถูกคำนวณโดยอัตโนมัติ " -#~ "มิฉะนั้นจะใช้มุมที่ให้ไว้สำหรับสะพานภายใน ใช้ 180° สำหรับมุมศูนย์\n" +#~ "การแทนที่มุมเชื่อมต่อภายใน หากปล่อยให้เหลือศูนย์ มุมเชื่อมโยงจะถูกคำนวณโดยอัตโนมัติ มิฉะนั้นจะใช้มุมที่ให้ไว้สำหรับสะพานภายใน ใช้ 180° สำหรับมุมศูนย์\n" #~ "\n" #~ "แนะนำให้ปล่อยไว้ที่ 0 เว้นแต่ว่ามีรุ่นเฉพาะที่ไม่จำเป็นต้องทำ" #~ msgid "" -#~ "Controls the density (spacing) of external bridge lines. Default is " -#~ "100%.\n" +#~ "Controls the density (spacing) of external bridge lines. Default is 100%.\n" #~ "\n" -#~ "Lower density external bridges can help improve reliability as there is " -#~ "more space for air to circulate around the extruded bridge, improving its " -#~ "cooling speed. Minimum is 10%.\n" +#~ "Lower density external bridges can help improve reliability as there is more space for air to circulate around the extruded bridge, improving its cooling speed. Minimum is 10%.\n" #~ "\n" -#~ "Higher densities can produce smoother bridge surfaces, as overlapping " -#~ "lines provide additional support during printing. Maximum is 120%.\n" +#~ "Higher densities can produce smoother bridge surfaces, as overlapping lines provide additional support during printing. Maximum is 120%.\n" #~ "Note: Bridge density that is too high can cause warping or overextrusion." #~ msgstr "" #~ "ควบคุมความหนาแน่น (ระยะห่าง) ของเส้นสะพานภายนอก ค่าเริ่มต้นคือ 100%\n" #~ "\n" -#~ "สะพานภายนอกที่มีความหนาแน่นต่ำสามารถช่วยปรับปรุงความน่าเชื่อถือได้ " -#~ "เนื่องจากมีพื้นที่ให้อากาศไหลเวียนรอบสะพานที่อัดขึ้นรูปมากขึ้น " -#~ "ซึ่งช่วยเพิ่มความเร็วในการทำความเย็น ขั้นต่ำคือ 10%\n" +#~ "สะพานภายนอกที่มีความหนาแน่นต่ำสามารถช่วยปรับปรุงความน่าเชื่อถือได้ เนื่องจากมีพื้นที่ให้อากาศไหลเวียนรอบสะพานที่อัดขึ้นรูปมากขึ้น ซึ่งช่วยเพิ่มความเร็วในการทำความเย็น ขั้นต่ำคือ 10%\n" #~ "\n" -#~ "ความหนาแน่นที่สูงขึ้นสามารถสร้างพื้นผิวสะพานที่นุ่มนวลขึ้น " -#~ "เนื่องจากเส้นที่ทับซ้อนกันจะให้ส่วนรองรับเพิ่มไส้ในในระหว่างการพิมพ์ สูงสุดคือ 120%\n" +#~ "ความหนาแน่นที่สูงขึ้นสามารถสร้างพื้นผิวสะพานที่นุ่มนวลขึ้น เนื่องจากเส้นที่ทับซ้อนกันจะให้ส่วนรองรับเพิ่มไส้ในในระหว่างการพิมพ์ สูงสุดคือ 120%\n" #~ "หมายเหตุ: ความหนาแน่นของสะพานที่สูงเกินไปอาจทำให้เกิดการบิดงอหรืออัดขึ้นรูปมากเกินไปได้" #~ msgid "" -#~ "Controls the density (spacing) of internal bridge lines. 100% means solid " -#~ "bridge. Default is 100%.\n" +#~ "Controls the density (spacing) of internal bridge lines. 100% means solid bridge. Default is 100%.\n" #~ "\n" -#~ "Lower density internal bridges can help reduce top surface pillowing and " -#~ "improve internal bridge reliability as there is more space for air to " -#~ "circulate around the extruded bridge, improving its cooling speed.\n" +#~ "Lower density internal bridges can help reduce top surface pillowing and improve internal bridge reliability as there is more space for air to circulate around the extruded bridge, improving its cooling speed.\n" #~ "\n" -#~ "This option works particularly well when combined with the second " -#~ "internal bridge over infill option, further improving internal bridging " -#~ "structure before solid infill is extruded." +#~ "This option works particularly well when combined with the second internal bridge over infill option, further improving internal bridging structure before solid infill is extruded." #~ msgstr "" -#~ "ควบคุมความหนาแน่น (ระยะห่าง) ของเส้นสะพานภายใน 100% หมายถึงสะพานที่มั่นคง " -#~ "ค่าเริ่มต้นคือ 100%\n" +#~ "ควบคุมความหนาแน่น (ระยะห่าง) ของเส้นสะพานภายใน 100% หมายถึงสะพานที่มั่นคง ค่าเริ่มต้นคือ 100%\n" #~ "\n" -#~ "สะพานภายในที่มีความหนาแน่นต่ำสามารถช่วยลดการบุผิวด้านบน " -#~ "และปรับปรุงความน่าเชื่อถือของสะพานภายใน เนื่องจากมีพื้นที่ให้อากาศไหลเวียนรอบๆ " -#~ "สะพานที่อัดขึ้นรูปมากขึ้น ซึ่งช่วยเพิ่มความเร็วในการทำความเย็น\n" +#~ "สะพานภายในที่มีความหนาแน่นต่ำสามารถช่วยลดการบุผิวด้านบน และปรับปรุงความน่าเชื่อถือของสะพานภายใน เนื่องจากมีพื้นที่ให้อากาศไหลเวียนรอบๆ สะพานที่อัดขึ้นรูปมากขึ้น ซึ่งช่วยเพิ่มความเร็วในการทำความเย็น\n" #~ "\n" -#~ "ตัวเลือกนี้ทำงานได้ดีเป็นพิเศษเมื่อรวมกับตัวเลือกบริดจ์ภายในตัวที่สองเหนือตัวเลือกไส้ใน " -#~ "ซึ่งจะช่วยปรับปรุงโครงสร้างการเชื่อมต่อภายในเพิ่มไส้ในก่อนที่จะอัดรีดไส้ในแบบทึบ" +#~ "ตัวเลือกนี้ทำงานได้ดีเป็นพิเศษเมื่อรวมกับตัวเลือกบริดจ์ภายในตัวที่สองเหนือตัวเลือกไส้ใน ซึ่งจะช่วยปรับปรุงโครงสร้างการเชื่อมต่อภายในเพิ่มไส้ในก่อนที่จะอัดรีดไส้ในแบบทึบ" #~ msgid "" -#~ "Decrease this value slightly (for example 0.9) to reduce the amount of " -#~ "material for bridge, to improve sag.\n" +#~ "Decrease this value slightly (for example 0.9) to reduce the amount of material for bridge, to improve sag.\n" #~ "\n" -#~ "The actual bridge flow used is calculated by multiplying this value with " -#~ "the filament flow ratio, and if set, the object's flow ratio." +#~ "The actual bridge flow used is calculated by multiplying this value with the filament flow ratio, and if set, the object's flow ratio." #~ msgstr "" #~ "ลดค่านี้ลงเล็กน้อย (เช่น 0.9) เพื่อลดปริมาณวัสดุสำหรับสะพานและปรับปรุงการย้อย\n" #~ "\n" -#~ "การไหลของบริดจ์จริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก " -#~ "และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" +#~ "การไหลของบริดจ์จริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของเส้นพลาสติก และหากตั้งค่าไว้ อัตราการไหลของวัตถุ" #~ msgid "" -#~ "This value governs the thickness of the internal bridge layer. This is " -#~ "the first layer over sparse infill. Decrease this value slightly (for " -#~ "example 0.9) to improve surface quality over sparse infill.\n" +#~ "This value governs the thickness of the internal bridge layer. This is the first layer over sparse infill. Decrease this value slightly (for example 0.9) to improve surface quality over sparse infill.\n" #~ "\n" -#~ "The actual internal bridge flow used is calculated by multiplying this " -#~ "value with the bridge flow ratio, the filament flow ratio, and if set, " -#~ "the object's flow ratio." +#~ "The actual internal bridge flow used is calculated by multiplying this value with the bridge flow ratio, the filament flow ratio, and if set, the object's flow ratio." #~ msgstr "" -#~ "ค่านี้ควบคุมความหนาของชั้นบริดจ์ภายใน นี่เป็นชั้นแรกที่อยู่เหนือไส้ในแบบโปร่ง ลดค่านี้เล็กน้อย " -#~ "(เช่น 0.9) เพื่อปรับปรุงคุณภาพพื้นผิวมากกว่าไส้ในแบบโปร่ง\n" +#~ "ค่านี้ควบคุมความหนาของชั้นบริดจ์ภายใน นี่เป็นชั้นแรกที่อยู่เหนือไส้ในแบบโปร่ง ลดค่านี้เล็กน้อย (เช่น 0.9) เพื่อปรับปรุงคุณภาพพื้นผิวมากกว่าไส้ในแบบโปร่ง\n" #~ "\n" -#~ "การไหลของบริดจ์ภายในจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของบริดจ์ " -#~ "อัตราการไหลของเส้นพลาสติก และอัตราการไหลของวัตถุหากตั้งค่าไว้" +#~ "การไหลของบริดจ์ภายในจริงที่ใช้คำนวณโดยการคูณค่านี้ด้วยอัตราส่วนการไหลของบริดจ์ อัตราการไหลของเส้นพลาสติก และอัตราการไหลของวัตถุหากตั้งค่าไว้" #, no-c-format, no-boost-format #~ msgid "" -#~ "Enable this option to slow down printing in areas where perimeters may " -#~ "have curled upwards. For example, additional slowdown will be applied " -#~ "when printing overhangs on sharp corners like the front of the Benchy " -#~ "hull, reducing curling which compounds over multiple layers.\n" +#~ "Enable this option to slow down printing in areas where perimeters may have curled upwards. For example, additional slowdown will be applied when printing overhangs on sharp corners like the front of the Benchy hull, reducing curling which compounds over multiple layers.\n" #~ "\n" -#~ "It is generally recommended to have this option switched on unless your " -#~ "printer cooling is powerful enough or the print speed slow enough that " -#~ "perimeter curling does not happen. If printing with a high external " -#~ "perimeter speed, this parameter may introduce slight artifacts when " -#~ "slowing down due to the large variance in print speeds. If you notice " -#~ "artifacts, ensure your pressure advance is tuned correctly.\n" +#~ "It is generally recommended to have this option switched on unless your printer cooling is powerful enough or the print speed slow enough that perimeter curling does not happen. If printing with a high external perimeter speed, this parameter may introduce slight artifacts when slowing down due to the large variance in print speeds. If you notice artifacts, ensure your pressure advance is tuned correctly.\n" #~ "\n" -#~ "Note: When this option is enabled, overhang perimeters are treated like " -#~ "overhangs, meaning the overhang speed is applied even if the overhanging " -#~ "perimeter is part of a bridge. For example, when the perimeters are 100% " -#~ "overhanging, with no wall supporting them from underneath, the 100% " -#~ "overhang speed will be applied." +#~ "Note: When this option is enabled, overhang perimeters are treated like overhangs, meaning the overhang speed is applied even if the overhanging perimeter is part of a bridge. For example, when the perimeters are 100% overhanging, with no wall supporting them from underneath, the 100% overhang speed will be applied." #~ msgstr "" -#~ "เปิดใช้งานตัวเลือกนี้เพื่อทำให้การพิมพ์ช้าลงในพื้นที่ที่ขอบด้านนอกอาจโค้งงอขึ้น ตัวอย่างเช่น " -#~ "การชะลอตัวเพิ่มไส้ในจะถูกนำไปใช้เมื่อพิมพ์ส่วนยื่นบนมุมที่แหลมคม เช่น ด้านหน้าของตัวถัง Benchy " -#~ "ซึ่งช่วยลดการม้วนงอซึ่งเกิดขึ้นบนหลายชั้น\n" +#~ "เปิดใช้งานตัวเลือกนี้เพื่อทำให้การพิมพ์ช้าลงในพื้นที่ที่ขอบด้านนอกอาจโค้งงอขึ้น ตัวอย่างเช่น การชะลอตัวเพิ่มไส้ในจะถูกนำไปใช้เมื่อพิมพ์ส่วนยื่นบนมุมที่แหลมคม เช่น ด้านหน้าของตัวถัง Benchy ซึ่งช่วยลดการม้วนงอซึ่งเกิดขึ้นบนหลายชั้น\n" #~ "\n" -#~ "โดยทั่วไป แนะนำให้เปิดตัวเลือกนี้ เว้นแต่ว่าการระบายความร้อนของเครื่องพิมพ์จะแรงเพียงพอ " -#~ "หรือความเร็วในการพิมพ์ช้าพอที่จะไม่เกิดการม้วนงอของเส้นรอบวง " -#~ "หากการพิมพ์ด้วยความเร็วรอบนอกสูง " -#~ "พารามิเตอร์นี้อาจเกิดข้อผิดพลาดเล็กน้อยเมื่อลดความเร็วลงเนื่องจากความเร็วการพิมพ์แตกต่างกันมาก " -#~ "หากคุณสังเกตเห็นสิ่งผิดปกติ ตรวจสอบให้แน่ใจว่าการปรับPressure Advanceของคุณถูกต้อง\n" +#~ "โดยทั่วไป แนะนำให้เปิดตัวเลือกนี้ เว้นแต่ว่าการระบายความร้อนของเครื่องพิมพ์จะแรงเพียงพอ หรือความเร็วในการพิมพ์ช้าพอที่จะไม่เกิดการม้วนงอของเส้นรอบวง หากการพิมพ์ด้วยความเร็วรอบนอกสูง พารามิเตอร์นี้อาจเกิดข้อผิดพลาดเล็กน้อยเมื่อลดความเร็วลงเนื่องจากความเร็วการพิมพ์แตกต่างกันมาก หากคุณสังเกตเห็นสิ่งผิดปกติ ตรวจสอบให้แน่ใจว่าการปรับPressure Advanceของคุณถูกต้อง\n" #~ "\n" -#~ "หมายเหตุ: เมื่อเปิดใช้งานตัวเลือกนี้ เส้นรอบวงส่วนยื่นจะถือว่าเหมือนกับส่วนยื่น " -#~ "ซึ่งหมายความว่าความเร็วส่วนยื่นจะถูกใช้ แม้ว่าเส้นรอบวงส่วนยื่นจะเป็นส่วนหนึ่งของสะพานก็ตาม " -#~ "ตัวอย่างเช่น เมื่อเส้นรอบวงยื่นออกมา 100% โดยไม่มีผนังรองรับจากด้านล่าง " -#~ "ระบบจะใช้ความเร็วยื่น 100%" +#~ "หมายเหตุ: เมื่อเปิดใช้งานตัวเลือกนี้ เส้นรอบวงส่วนยื่นจะถือว่าเหมือนกับส่วนยื่น ซึ่งหมายความว่าความเร็วส่วนยื่นจะถูกใช้ แม้ว่าเส้นรอบวงส่วนยื่นจะเป็นส่วนหนึ่งของสะพานก็ตาม ตัวอย่างเช่น เมื่อเส้นรอบวงยื่นออกมา 100% โดยไม่มีผนังรองรับจากด้านล่าง ระบบจะใช้ความเร็วยื่น 100%" -#~ msgid "" -#~ "If enabled, bridges are more reliable, can bridge longer distances, but " -#~ "may look worse. If disabled, bridges look better but are reliable just " -#~ "for shorter bridged distances." -#~ msgstr "" -#~ "หากเปิดใช้งาน สะพานจะมีความน่าเชื่อถือมากกว่า สามารถเชื่อมสะพานในระยะทางที่ไกลกว่าได้ " -#~ "แต่อาจดูแย่กว่านั้น หากปิดใช้งาน " -#~ "สะพานจะดูดีขึ้นแต่จะเชื่อถือได้สำหรับระยะทางสะพานที่สั้นกว่าเท่านั้น" +#~ msgid "If enabled, bridges are more reliable, can bridge longer distances, but may look worse. If disabled, bridges look better but are reliable just for shorter bridged distances." +#~ msgstr "หากเปิดใช้งาน สะพานจะมีความน่าเชื่อถือมากกว่า สามารถเชื่อมสะพานในระยะทางที่ไกลกว่าได้ แต่อาจดูแย่กว่านั้น หากปิดใช้งาน สะพานจะดูดีขึ้นแต่จะเชื่อถือได้สำหรับระยะทางสะพานที่สั้นกว่าเท่านั้น" -#~ msgid "" -#~ "If enabled, thick internal bridges will be used. It's usually recommended " -#~ "to have this feature turned on. However, consider turning it off if you " -#~ "are using large nozzles." -#~ msgstr "" -#~ "หากเปิดใช้งาน บริดจ์ภายในแบบหนาจะถูกนำมาใช้ โดยปกติจะแนะนำให้เปิดฟีเจอร์นี้ อย่างไรก็ตาม " -#~ "ให้พิจารณาปิดหากคุณใช้หัวฉีดขนาดใหญ่" +#~ msgid "If enabled, thick internal bridges will be used. It's usually recommended to have this feature turned on. However, consider turning it off if you are using large nozzles." +#~ msgstr "หากเปิดใช้งาน บริดจ์ภายในแบบหนาจะถูกนำมาใช้ โดยปกติจะแนะนำให้เปิดฟีเจอร์นี้ อย่างไรก็ตาม ให้พิจารณาปิดหากคุณใช้หัวฉีดขนาดใหญ่" -#~ msgid "" -#~ "Aligns infill and surface fill directions to follow the model's " -#~ "orientation on the build plate. When enabled, fill directions rotate with " -#~ "the model to maintain optimal strength characteristics." -#~ msgstr "" -#~ "จัดทิศทางไส้ในแบบไส้ในและแบบไส้ในพื้นผิวให้สอดคล้องกับการวางแนวของแบบจำลองบนฐานรองพิมพ์ " -#~ "เมื่อเปิดใช้งาน ทิศทางไส้ในจะหมุนตามโมเดลเพื่อรักษาลักษณะความแข็งแกร่งที่เหมาะสมที่สุด" +#~ msgid "Aligns infill and surface fill directions to follow the model's orientation on the build plate. When enabled, fill directions rotate with the model to maintain optimal strength characteristics." +#~ msgstr "จัดทิศทางไส้ในแบบไส้ในและแบบไส้ในพื้นผิวให้สอดคล้องกับการวางแนวของแบบจำลองบนฐานรองพิมพ์ เมื่อเปิดใช้งาน ทิศทางไส้ในจะหมุนตามโมเดลเพื่อรักษาลักษณะความแข็งแกร่งที่เหมาะสมที่สุด" #~ msgid "Filament to print internal sparse infill." #~ msgstr "เส้นพลาสติกสำหรับพิมพ์ ไส้ใน เบาบางภายใน" @@ -23223,16 +19275,8 @@ msgstr "" #~ msgid "Filament to print solid infill." #~ msgstr "ฟิลาเมนต์สำหรับพิมพ์ไส้แข็ง" -#~ msgid "" -#~ "Filament to print support base and raft. \"Default\" means no specific " -#~ "filament for support and current filament is used." -#~ msgstr "" -#~ "เส้นพลาสติกพิมพ์ฐานรองรับและฐานรองชิ้นงาน \"ค่าเริ่มต้น\" " -#~ "หมายถึงไม่มีการใช้เส้นพลาสติกเฉพาะเพื่อรองรับและใช้เส้นพลาสติกปัจจุบัน" +#~ msgid "Filament to print support base and raft. \"Default\" means no specific filament for support and current filament is used." +#~ msgstr "เส้นพลาสติกพิมพ์ฐานรองรับและฐานรองชิ้นงาน \"ค่าเริ่มต้น\" หมายถึงไม่มีการใช้เส้นพลาสติกเฉพาะเพื่อรองรับและใช้เส้นพลาสติกปัจจุบัน" -#~ msgid "" -#~ "Filament to print support interface. \"Default\" means no specific " -#~ "filament for support interface and current filament is used." -#~ msgstr "" -#~ "เส้นพลาสติกสำหรับพิมพ์ส่วนต่อประสานส่วนรองรับ \"ค่าเริ่มต้น\" " -#~ "หมายความว่าไม่มีการใช้ฟิลาเมนต์เฉพาะสำหรับอินเทอร์เฟซรองรับและมีการใช้ฟิลาเมนต์ปัจจุบัน" +#~ msgid "Filament to print support interface. \"Default\" means no specific filament for support interface and current filament is used." +#~ msgstr "เส้นพลาสติกสำหรับพิมพ์ส่วนต่อประสานส่วนรองรับ \"ค่าเริ่มต้น\" หมายความว่าไม่มีการใช้ฟิลาเมนต์เฉพาะสำหรับอินเทอร์เฟซรองรับและมีการใช้ฟิลาเมนต์ปัจจุบัน" diff --git a/localization/i18n/tr/OrcaSlicer_tr.po b/localization/i18n/tr/OrcaSlicer_tr.po index 13c5456a49..a20151e359 100644 --- a/localization/i18n/tr/OrcaSlicer_tr.po +++ b/localization/i18n/tr/OrcaSlicer_tr.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2026-04-08 23:59+0300\n" "Last-Translator: GlauTech\n" "Language-Team: \n" @@ -4063,6 +4063,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "Bu filament tipinin tavsiye edilen Nozul sıcaklığı [%d, %d] derece santigrattır." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11160,6 +11163,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "Dış–iç veya iç–dış–iç duvar sıralamaları için 'Hassas duvar' seçeneği yok sayılacaktır." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "Filament büzülmesi kullanılmayacaktır çünkü kullanılan filamentlerin filament büzülmesi önemli ölçüde farklılık göstermektedir." diff --git a/localization/i18n/uk/OrcaSlicer_uk.po b/localization/i18n/uk/OrcaSlicer_uk.po index 89856c9fee..7a758bc090 100644 --- a/localization/i18n/uk/OrcaSlicer_uk.po +++ b/localization/i18n/uk/OrcaSlicer_uk.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: orcaslicerua\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2025-03-07 09:30+0200\n" "Last-Translator: \n" "Language-Team: Ukrainian\n" @@ -4071,6 +4071,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "Рекомендована температура сопла для цього типу нитки становить [%d, %d] градусів Цельсія" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11165,6 +11168,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "" +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "" diff --git a/localization/i18n/vi/OrcaSlicer_vi.po b/localization/i18n/vi/OrcaSlicer_vi.po index 5d66819cf1..f3a6cb6212 100644 --- a/localization/i18n/vi/OrcaSlicer_vi.po +++ b/localization/i18n/vi/OrcaSlicer_vi.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2025-10-02 17:43+0700\n" "Last-Translator: \n" "Language-Team: hainguyen.ts13@gmail.com\n" @@ -4036,6 +4036,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "Nhiệt độ vòi phun khuyến nghị cho loại filament này là [%d, %d] độ C." +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11083,6 +11086,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "Tùy chọn thành chính xác sẽ bị bỏ qua cho trình tự thành ngoài-trong hoặc trong-ngoài-trong." +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "Co ngót filament sẽ không được sử dụng vì co ngót filament của các filament đã dùng khác nhau đáng kể." diff --git a/localization/i18n/zh_CN/OrcaSlicer_zh_CN.po b/localization/i18n/zh_CN/OrcaSlicer_zh_CN.po index 4190ee1ae3..34e44eb505 100644 --- a/localization/i18n/zh_CN/OrcaSlicer_zh_CN.po +++ b/localization/i18n/zh_CN/OrcaSlicer_zh_CN.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Slic3rPE\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2026-06-11 12:37-0300\n" "Last-Translator: Handle \n" "Language-Team: \n" @@ -4059,6 +4059,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "该耗材的推荐喷嘴温度是[%d, %d]摄氏度" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11170,6 +11173,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "当壁序列为外内或内外内时,精确墙壁选项将被忽略。" +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "不会使用耗材收缩率,因为所用耗材的耗材收缩率不匹配。" diff --git a/localization/i18n/zh_TW/OrcaSlicer_zh_TW.po b/localization/i18n/zh_TW/OrcaSlicer_zh_TW.po index e6611da9e4..16b323b5f5 100644 --- a/localization/i18n/zh_TW/OrcaSlicer_zh_TW.po +++ b/localization/i18n/zh_TW/OrcaSlicer_zh_TW.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Orca Slicer\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-19 10:33-0300\n" +"POT-Creation-Date: 2026-06-22 20:13-0300\n" "PO-Revision-Date: 2025-11-28 13:48-0600\n" "Last-Translator: tntchn <15895303+tntchn@users.noreply.github.com>\n" "Language-Team: \n" @@ -4077,6 +4077,9 @@ msgstr "" msgid "The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius." msgstr "該線材的推薦噴嘴溫度是攝氏 [%d, %d] 度" +msgid "Adaptive Pressure Advance model validation failed:\n" +msgstr "" + # TODO: Review, changed by lang refactor. PR 14254 msgid "" "Too small max volumetric speed.\n" @@ -11231,6 +11234,9 @@ msgstr "" msgid "The precise wall option will be ignored for outer-inner or inner-outer-inner wall sequences." msgstr "當壁序列為外內或內外內時,精確牆壁選項將被忽略。" +msgid "The Adaptive Pressure Advance model for one or more extruders may contain invalid values." +msgstr "" + msgid "Filament shrinkage will not be used because filament shrinkage for the used filaments does not match." msgstr "線材收縮補償將被停用,因為所使用的線材之間的收縮率差異過大。" From ddbee84e683d94acf7e7e077c0f773973e647ceb Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Tue, 23 Jun 2026 00:14:17 -0500 Subject: [PATCH 060/389] render the G-code preview upright (designed view) + toggle UI --- src/slic3r/GUI/GCodeViewer.cpp | 78 +++++++++++++++++++++++++--------- src/slic3r/GUI/GCodeViewer.hpp | 2 - src/slic3r/GUI/GLCanvas3D.cpp | 19 +++++++++ src/slic3r/GUI/GUI_Preview.cpp | 11 +++++ src/slic3r/GUI/GUI_Preview.hpp | 2 + src/slic3r/GUI/Plater.cpp | 31 ++++---------- src/slic3r/GUI/Plater.hpp | 4 ++ 7 files changed, 104 insertions(+), 43 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 1263e3fed6..9d9090480f 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1140,6 +1140,14 @@ static Transform3d compute_belt_back_transform(const PrintConfig& cfg) const Transform3d mf_inv = mft.is_active() ? Transform3d(mft.transform().inverse()) : Transform3d::Identity(); + // Forward G-code axis remap as an affine matrix (out_i = sign * in[r_i % 3], plus a + // build-volume offset for Rev axes). This is the matrix form of the per-point + // GCodeWriter::apply_axis_remap (row convention: each OUTPUT axis selects an input + // axis + sign) and MUST stay in sync with it. The build-volume max matches what the + // writer is fed in GCode.cpp (printable_area max + printable_height). NB: this is the + // transpose of the column convention used by BeltTransformPipeline::build_preslice_remap + // — the two remaps are not interchangeable. (Follow-up: precompute this matrix once in + // GCodeWriter and share it with apply_axis_remap to remove the parallel encoding.) Transform3d ar = Transform3d::Identity(); const int rr[3] = { int(cfg.gcode_remap_x.value), int(cfg.gcode_remap_y.value), int(cfg.gcode_remap_z.value) }; if (rr[0] != 0 || rr[1] != 1 || rr[2] != 2) { @@ -1172,6 +1180,14 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const { m_loaded_as_preview = false; + // Belt printers: drive the designed/raw view UI (legend checkbox, hotkey B, canvas-toolbar + // menu item) from the loaded print here. Plater::set_bed_shape also calls set_belt_printer(), + // but only on bed-shape changes — not reliably on every slice/preview load — so the UI was + // staying hidden even though the (config-driven) designed view rendered. The tilt magnitude + // comes from the G-code header (gcode_result.belt_tilt_angle, abs of the slicing rotation). + m_belt_view_enabled = print.config().belt_printer.value; + m_belt_angle_deg = gcode_result.belt_tilt_angle; + const bool current_top_layer_only = m_viewer.is_top_layer_only_view_range(); const bool required_top_layer_only = get_app_config()->get_bool("seq_top_layer_only"); if (current_top_layer_only != required_top_layer_only) @@ -1260,23 +1276,36 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const // inverse to well outside the model body; if one becomes the bbox minimum it // drags the min-corner anchor by ~20mm. Drop moves that land clearly outside the // (correct) model bbox — a geometric filter, not a role guess. + // Tolerance around the model bbox for outlier rejection, and the minimum fraction + // of MOVES (by count) the clip must retain before we trust it over the full bbox. + // Count, not bbox extent: a single far-flung outlier move (e.g. a belt-entry purge + // that maps to y~0) inflates the full bbox so much that a size-fraction test would + // wrongly reject the clip and re-include the outlier, dragging the min-corner anchor + // by ~the offset. By count the clip keeps ~100% of moves here and ~0% only when the + // object is genuinely offset from the belt entry (the real fall-back-to-full case). + constexpr double ANCHOR_CLIP_MARGIN_MM = 10.0; + constexpr double ANCHOR_CLIP_MIN_KEEP = 0.5; BoundingBoxf3 tp_bb_clip, tp_bb_full; - const double y_lo = model_bb.defined ? model_bb.min.y() - 10.0 : -1e30; - const double y_hi = model_bb.defined ? model_bb.max.y() + 10.0 : 1e30; + size_t n_filtered = 0, n_clip = 0; + const double y_lo = model_bb.defined ? model_bb.min.y() - ANCHOR_CLIP_MARGIN_MM : -1e30; + const double y_hi = model_bb.defined ? model_bb.max.y() + ANCHOR_CLIP_MARGIN_MM : 1e30; for (const GCodeProcessorResult::MoveVertex& mv : gcode_result.moves) if (mv.type == EMoveType::Extrude && mv.layer_id >= 1) { // skip layer-0 prime/skirt + ++n_filtered; const Vec3d p = belt_inv * mv.position.cast(); tp_bb_full.merge(p); - if (p.y() >= y_lo && p.y() <= y_hi) + if (p.y() >= y_lo && p.y() <= y_hi) { tp_bb_clip.merge(p); + ++n_clip; + } } - // Use the clipped bbox only when it still holds the bulk of the body (outliers - // removed). If the object sits far from the belt entry the toolpaths are grossly - // offset and the clip would drop most of them — fall back to the full bbox so the - // min-corner anchor still recovers that gross translation rather than breaking. + // Use the clipped bbox when it still holds the bulk of the moves (outliers removed). + // If the object sits far from the belt entry the toolpaths are grossly offset and the + // clip drops most of them — fall back to the full bbox so the min-corner anchor still + // recovers that gross translation rather than breaking. const BoundingBoxf3& tp_bb = - (tp_bb_clip.defined && tp_bb_full.defined && - tp_bb_clip.size().y() >= 0.5 * tp_bb_full.size().y()) ? tp_bb_clip : tp_bb_full; + (tp_bb_clip.defined && n_filtered > 0 && + double(n_clip) >= ANCHOR_CLIP_MIN_KEEP * double(n_filtered)) ? tp_bb_clip : tp_bb_full; if (model_bb.defined && tp_bb.defined) { // Anchor the back-transformed toolpath body onto the upright model bbox by // its MIN corner. (Center anchoring was tried and regressed when the toolpath @@ -1287,9 +1316,8 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const // translation, which this min-corner step recovers. const Vec3d d = model_bb.min - tp_bb.min; belt_inv = Transform3d(Eigen::Translation3d(d)) * belt_inv; - BOOST_LOG_TRIVIAL(debug) << "[BELT-PREVIEW] z_origin=" << gcode_result.belt_z_origin - << " model_bb.y=[" << model_bb.min.y() << "," << model_bb.max.y() - << "] tp_bb.y=[" << tp_bb.min.y() << "," << tp_bb.max.y() << "] d.y=" << d.y(); + BOOST_LOG_TRIVIAL(debug) << "[BELT-PREVIEW] anchor d=[" << d.x() << "," << d.y() << "," << d.z() + << "] (clip kept " << n_clip << "/" << n_filtered << " moves)"; } } libvgcode::GCodeInputData data = libvgcode::convert(gcode_result, str_tool_colors, str_color_print_colors, m_viewer, @@ -2423,12 +2451,12 @@ void GCodeViewer::render_toolpaths() { const Camera& camera = wxGetApp().plater()->get_camera(); Matrix4f view = camera.get_view_matrix().matrix().cast(); - // Belt "designed" (upright) view is now produced by back-transforming the - // toolpath GEOMETRY into model space at load time (see load_as_gcode -> - // libvgcode::convert with m_belt_inverse_transform). The camera is therefore - // left untouched here; transforming the view as well would double-apply the - // inverse. Keeping m_belt_inverse_transform on the geometry (not the camera) - // also keeps the bed and toolpaths in the same frame so they stay aligned. + // Belt "designed" (upright) view is produced by back-transforming the toolpath + // GEOMETRY into model space at load time (see load_as_gcode -> + // compute_belt_back_transform -> libvgcode::convert). The camera is left untouched + // here; transforming the view as well would double-apply the inverse. Baking the + // transform into the geometry (not the camera) also keeps the bed and toolpaths in + // the same frame so they stay aligned. const libvgcode::Mat4x4 converted_view_matrix = libvgcode::convert(view); const libvgcode::Mat4x4 converted_projetion_matrix = libvgcode::convert(static_cast(camera.get_projection_matrix().matrix().cast())); #if VGCODE_ENABLE_COG_AND_TOOL_MARKERS @@ -4822,7 +4850,19 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv ImGui::TextColored(ImVec4(0.f, 0.59f, 0.53f, 1.f), "%s", _u8L("Belt Printer").c_str()); ImGui::Dummy({ window_padding, 0 }); ImGui::SameLine(); - ImGui::Checkbox(_u8L("Show designed view (upright) [B]").c_str(), &m_belt_show_designed); + // Checked = show the raw machine-frame G-code (designed/upright view off). Worded to + // match the canvas-toolbar menu item "Show raw G-code (belt only)". m_belt_show_designed + // is the inverse of this checkbox, so bind a temporary and flip it on change. + bool show_raw = !m_belt_show_designed; + if (ImGui::Checkbox(_u8L("Show raw G-code (belt only) [B]").c_str(), &show_raw)) { + m_belt_show_designed = !show_raw; + // The designed-view back-transform is baked into the toolpath geometry at load + // time, so the toggle only takes effect once the preview is re-converted. Defer + // the refresh to the next event-loop tick (CallAfter) to avoid re-entering the + // preview load from inside legend rendering. + if (Plater* plater = wxGetApp().plater()) + plater->CallAfter([plater]() { plater->refresh_belt_view(); }); + } } legend_height = ImGui::GetCurrentWindow()->Size.y; diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index d5173b02e5..a0dc4ab3f7 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -247,7 +247,6 @@ mutable bool m_no_render_path { false }; float m_belt_angle_deg = 0.f; bool m_belt_show_designed = true; // Toggle: designed (upright, back-transformed) view by default; // turn off (hotkey B) to inspect the raw machine-frame G-code. - Transform3d m_belt_inverse_transform{Transform3d::Identity()}; libvgcode::Viewer m_viewer; bool m_loaded_as_preview{ false }; @@ -349,7 +348,6 @@ public: void export_toolpaths_to_obj(const char* filename) const; void set_belt_printer(bool enabled, float angle_deg) { m_belt_view_enabled = enabled; m_belt_angle_deg = angle_deg; } - void set_belt_inverse_transform(const Transform3d& t) { m_belt_inverse_transform = t; } bool is_belt_view() const { return m_belt_view_enabled && m_belt_angle_deg > 0.f; } void toggle_belt_show_designed() { if (m_belt_view_enabled) m_belt_show_designed = !m_belt_show_designed; } bool is_belt_show_designed() const { return m_belt_show_designed; } diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 5df82877d1..e948860345 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3512,6 +3512,10 @@ void GLCanvas3D::on_char(wxKeyEvent& evt) if (dynamic_cast(m_canvas->GetParent()) != nullptr && m_gcode_viewer.is_belt_view()) { m_gcode_viewer.toggle_belt_show_designed(); + // The designed-view back-transform is baked into the toolpath geometry at load + // time, so the toggle only takes visual effect once the preview is re-converted. + if (Plater* plater = wxGetApp().plater()) + plater->refresh_belt_view(); m_dirty = true; } break; @@ -9190,6 +9194,21 @@ void GLCanvas3D::_render_canvas_toolbar() ImGui::TextColored(enable ? ImVec4(1,1,1,1) : ImGui::GetStyleColorVec4(ImGuiCol_TextDisabled), "%s", into_u8(condition ? ImGui::VisibleIcon : ImGui::HiddenIcon).c_str()); }; + // Belt printers, G-code preview only: toggle the designed (upright) view vs the raw + // machine-frame G-code. Same state as hotkey B and the legend checkbox; the reload is + // deferred (CallAfter) so the preview is not rebuilt mid-render. + if (m_canvas_type == ECanvasType::CanvasPreview && m_gcode_viewer.is_belt_view()) { + create_menu_item( _utf8(L("Show raw G-code (belt only)")), + true, + !m_gcode_viewer.is_belt_show_designed(), // eye lit = raw machine-frame G-code (designed view off) + [this, p]{ + m_gcode_viewer.toggle_belt_show_designed(); + p->CallAfter([p]{ p->refresh_belt_view(); }); + } + ); + ImGui::Separator(); + } + create_menu_item( _utf8(L("3D Navigator")), m_canvas_type != ECanvasType::CanvasAssembleView, // not work on assembly wxGetApp().show_3d_navigator(), diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index ea3ae5d21d..b56613e165 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -351,6 +351,17 @@ void Preview::reload_print(bool only_gcode) m_only_gcode = only_gcode; } +void Preview::refresh_belt_view() +{ + // Re-run the G-code preview conversion so the belt "designed view" toggle takes effect + // (the back-transform is baked into the toolpath geometry in GCodeViewer::load_as_gcode, + // and belt printers are exempt from the same-result-id load cache so the re-convert runs). + // Reset m_loaded_print to bypass the "already loaded" guard the way reload_print does, but + // keep the current layer (Z) range and only-gcode mode so the view doesn't jump on toggle. + m_loaded_print = nullptr; + load_print(true /*keep_z_range*/, m_only_gcode); +} + //BBS: always load shell at preview void Preview::load_shells(const Print& print, bool force_previewing) { diff --git a/src/slic3r/GUI/GUI_Preview.hpp b/src/slic3r/GUI/GUI_Preview.hpp index 5469e32b71..d8c137574b 100644 --- a/src/slic3r/GUI/GUI_Preview.hpp +++ b/src/slic3r/GUI/GUI_Preview.hpp @@ -141,6 +141,8 @@ public: //BBS: add only gcode mode void load_print(bool keep_z_range = false, bool only_gcode = false); void reload_print(bool only_gcode = false); + // Belt printers: re-convert the G-code preview so the "designed view" toggle takes effect. + void refresh_belt_view(); //BBS: always load shell at preview void load_shells(const Print& print, bool force_previewing = false); void reset_shells(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 061e12791e..c3b38a5e0e 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -11381,31 +11381,13 @@ void Plater::priv::set_bed_shape(const Pointfs &shape, bed.set_belt_printer(true, static_cast(belt_angle), tilt_axis); if (preview) preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, static_cast(belt_angle)); - - // Compute the inverse of the mesh-side belt transform for the G-code - // viewer. The sole mesh transform is the slicing rotation; build its - // matrix from config and hand the viewer its inverse (rotation is - // orthogonal, so the inverse is the transpose). - Transform3d forward = Transform3d::Identity(); - if (rot_axis != BeltRotationAxis::None && std::abs(rot_angle) > EPSILON) { - Vec3d unit_axis = Vec3d::UnitX(); - switch (rot_axis) { - case BeltRotationAxis::X: unit_axis = Vec3d::UnitX(); break; - case BeltRotationAxis::Y: unit_axis = Vec3d::UnitY(); break; - case BeltRotationAxis::Z: unit_axis = Vec3d::UnitZ(); break; - default: break; - } - forward.linear() = Eigen::AngleAxisd(Geometry::deg2rad(rot_angle), unit_axis).toRotationMatrix(); - } - Transform3d inverse = forward.inverse(); - if (preview) - preview->get_canvas3d()->get_gcode_viewer().set_belt_inverse_transform(inverse); + // The belt "designed view" back-transform is rebuilt from the print config at + // G-code load time (GCodeViewer::compute_belt_back_transform), so no mesh-side + // inverse needs to be pushed to the viewer here. } else { bed.set_belt_printer(false, 0.f); - if (preview) { + if (preview) preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(false, 0.f); - preview->get_canvas3d()->get_gcode_viewer().set_belt_inverse_transform(Transform3d::Identity()); - } } } @@ -14166,6 +14148,11 @@ void Plater::reload_print() p->preview->reload_print(); } +void Plater::refresh_belt_view() +{ + p->preview->refresh_belt_view(); +} + // BBS wxString Plater::get_project_name() { diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index c947630794..45ff9f8458 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -329,6 +329,10 @@ public: void load_gcode(const wxString& filename); void reload_gcode_from_disk(); void reload_print(); + // Belt printers: re-run the G-code preview conversion so the "designed view" toggle + // (hotkey B / legend checkbox) takes effect; the back-transform is applied to the + // toolpath geometry at load time. Keeps the current layer range and only-gcode mode. + void refresh_belt_view(); // SoftFever void calib_pa(const Calib_Params& params); From 2ca843a38e06001eb7e3686283c34b8da6ccae24 Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Wed, 24 Jun 2026 22:01:29 -0500 Subject: [PATCH 061/389] Belt Printing: Bugfix: Solid Organic Tree Base, Slim Tree Skirt, Renderer (#14395) * fix tree support brim * treesupport3d part 1: more diagnostic logging. (todo once things are fixed: remove this / gate it properly) * make area under Z=0 in rotated slice pipeline not solid * fix solid Z=0 layer for belt printers * fix renderer * clean up logging * final review pass --- src/libslic3r/Support/SupportCommon.cpp | 9 +++- src/libslic3r/Support/TreeModelVolumes.cpp | 16 +++++--- src/libslic3r/Support/TreeSupport.cpp | 48 ++++++++++++++++------ src/libslic3r/Support/TreeSupport3D.cpp | 36 ++++++++++++++-- src/slic3r/GUI/GCodeViewer.cpp | 43 +++++++++++++++---- 5 files changed, 121 insertions(+), 31 deletions(-) diff --git a/src/libslic3r/Support/SupportCommon.cpp b/src/libslic3r/Support/SupportCommon.cpp index eaf5159d9c..ed3a8fc01f 100644 --- a/src/libslic3r/Support/SupportCommon.cpp +++ b/src/libslic3r/Support/SupportCommon.cpp @@ -1775,7 +1775,14 @@ void generate_support_toolpaths( bool sheath = support_params.with_sheath; bool no_sort = false; bool done = false; - if (base_layer.layer->bottom_z < EPSILON) { + // Belt printers have no flat bed first layer — the belt is the tilted + // build surface — so the dense raft_first_layer_density flange must not + // fire anywhere, including the layer at z=0 (the belt-surface line). + // (belt_floor_shear_factor is non-zero only when belt_printer is on.) + // For every other printer type, support z is never negative, so this + // matches the original "first layer at z=0" behaviour unchanged. + const bool is_belt_printer = std::abs(slicing_params.belt_floor_shear_factor) > EPSILON; + if (! is_belt_printer && base_layer.layer->bottom_z < EPSILON) { // Base flange (the 1st layer). filler = filler_first_layer; filler->angle = Geometry::deg2rad(float(config.support_angle.value + 90.)); diff --git a/src/libslic3r/Support/TreeModelVolumes.cpp b/src/libslic3r/Support/TreeModelVolumes.cpp index ebc3d2c958..b1e3cdd6dd 100644 --- a/src/libslic3r/Support/TreeModelVolumes.cpp +++ b/src/libslic3r/Support/TreeModelVolumes.cpp @@ -172,11 +172,17 @@ TreeModelVolumes::TreeModelVolumes( if (ctx.is_active() && pcfg2.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { m_belt_floor = ctx.compute_per_layer_floors(num_layers, [&](size_t layer_idx) -> double { - // Use local print_z (subtract global offset from object layer). - return (layer_idx >= num_raft_layers) - ? print_object.get_layer(layer_idx - num_raft_layers)->print_z - - print_object.belt_global_z_offset() - : 0.; + // Object layers: local print_z (subtract global offset). + if (layer_idx >= num_raft_layers) + return print_object.get_layer(layer_idx - num_raft_layers)->print_z + - print_object.belt_global_z_offset(); + // Belt raft layers (below the object): each carries its own + // local print_z in m_raft_layers. The belt floor is a tilted + // plane, so the half-plane to clip grows as print_z drops — + // using 0 here clipped every below-object layer against the + // Z=0 belt surface, under-clipping the raft region and leaving + // a dense support mass below the floor. + return (layer_idx < m_raft_layers.size()) ? m_raft_layers[layer_idx] : 0.; }); } } diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 904da75f7f..457bc5d8d2 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1506,6 +1506,16 @@ void TreeSupport::generate_toolpaths() // ORCA: base angle used for explicit interlaced interface orientation. const float base_support_angle = Geometry::deg2rad(object_config.support_angle.value); + // Belt floor: the lowest support layer rests on the moving, tilted belt, not + // on a flat bed — so it must NOT get the bed first-layer treatment (a brim on + // interface areas, a first-layer-flow sheath at raft_first_layer_density on + // base areas). That treatment draws a loop along the Z=0 belt-floor line that + // reads as a stray brim/skirt. Gate those layer_id==0 special cases off when + // the belt floor is active; false on non-belt printers so behavior is unchanged. + BeltFloorContext belt_ctx; + const bool belt_floor_active = belt_ctx.init(m_slicing_params, *m_print_config) + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly; + // generate tree support tool paths tbb::parallel_for( tbb::blocked_range(m_raft_layers, m_object->support_layer_count()), @@ -1539,7 +1549,7 @@ void TreeSupport::generate_toolpaths() filler_interface->angle = base_support_angle + M_PI_2; // default interface angle is perpendicular to support angle if (area_group.type != SupportLayer::BaseType) { // interface - if (layer_id == 0) { + if (layer_id == 0 && !belt_floor_active) { Flow flow = m_raft_layers == 0 ? m_object->print()->brim_flow() : support_flow; ExtrusionRole brim_role = (area_group.type == SupportLayer::RoofType && !area_group.interface_as_base) ? erSupportMaterialInterface : erSupportMaterial; @@ -1623,7 +1633,7 @@ void TreeSupport::generate_toolpaths() } else { // base_areas - bool support_base_on_bed = (layer_id == 0 && m_raft_layers == 0); + bool support_base_on_bed = (layer_id == 0 && m_raft_layers == 0 && !belt_floor_active); Flow flow = support_base_on_bed ? m_support_params.first_layer_flow : support_flow; bool need_infill = with_infill; if(m_object_config->support_base_pattern==smpDefault) @@ -1644,7 +1654,7 @@ void TreeSupport::generate_toolpaths() std::unique_ptr base_eec = std::make_unique(); base_eec->no_sort = true; ExtrusionEntitiesPtr &base_dst = base_eec->entities; - if (layer_id == 0) { + if (layer_id == 0 && !belt_floor_active) { float density = float(m_object_config->raft_first_layer_density.value * 0.01); fill_expolygons_with_sheath_generate_paths(base_dst, loops, filler_support.get(), density, erSupportMaterial, flow, m_support_params, true, false); @@ -1916,9 +1926,6 @@ void TreeSupport::generate() if (!belt_ext_layers.empty()) { auto &sl_vec = m_object->support_layers(); sl_vec.insert(sl_vec.begin(), belt_ext_layers.begin(), belt_ext_layers.end()); - BOOST_LOG_TRIVIAL(debug) << "[BELT-CALIB] wedge ext layers=" << belt_ext_layers.size() - << " z=" << belt_ext_layers.front()->print_z << ".." << belt_ext_layers.back()->print_z - << " seeded=" << seeded; } } } @@ -2177,6 +2184,16 @@ void TreeSupport::draw_circles() coordf_t support_extrusion_width = m_support_params.support_extrusion_width; const float tree_brim_width = config.tree_support_brim_width.value; + // Belt floor: the first object layer is not on a flat bed — it rests on the + // tilted, moving belt. So the first-object-layer adhesion features (the tree + // support brim, the hybrid first-layer base expansion) must be suppressed: + // their expanded contact rings project to a stray brim/skirt loop sitting in + // the Z=0 belt plane around the support footprint. false on non-belt printers, + // so behavior there is unchanged. + BeltFloorContext belt_ctx; + const bool belt_floor_active = belt_ctx.init(m_slicing_params, *m_print_config) + && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly; + if (m_object->support_layer_count() <= m_raft_layers) return; BOOST_LOG_TRIVIAL(info) << "draw_circles for object: " << m_object->model_object()->name; @@ -2287,7 +2304,7 @@ void TreeSupport::draw_circles() circle.points[i] = circle.points[i] * scale + node.position; } } - if (obj_layer_nr == 0 && m_raft_layers == 0) { + if (obj_layer_nr == 0 && m_raft_layers == 0 && !belt_floor_active) { double brim_width = !config.tree_support_auto_brim ? tree_brim_width : std::max(MIN_BRANCH_RADIUS_FIRST_LAYER, std::min(node.radius + node.dist_mm_to_top / (scale * branch_radius) * 0.5, MAX_BRANCH_RADIUS_FIRST_LAYER) - node.radius); auto tmp=offset(circle, scale_(brim_width)); if(!tmp.empty()) @@ -2352,12 +2369,19 @@ void TreeSupport::draw_circles() base_areas = intersection_ex(base_areas, m_machine_border); // Belt floor: clip tree support polygons by the belt surface plane. - // ts_layer->print_z is at LOCAL Z (global offset applied later in - // _generate_support_material), so use init_local to subtract - // belt_global_z_offset from z_shift. + // Non-organic tree support layers inherit their print_z from the + // (already globally-offset) object layers — see plan_layer_heights() + // and add_tree_support_layer(); only ORGANIC layers get the global + // Z offset applied later in _generate_support_material(). So here + // ts_layer->print_z is in the GLOBAL frame and we must use init() + // (global), not init_local(): mixing a local-frame clip plane with + // a global print_z displaces the cutoff line by belt_global_z_offset + // along the shear axis, leaving an un-clipped wedge of support below + // the belt floor. In per-object (non-global) mode belt_global_z_offset + // is 0 so init() and init_local() coincide — this is a no-op there. { BeltFloorContext ctx; - if (ctx.init_local(m_slicing_params, *m_print_config, m_object->belt_global_z_offset()) + if (ctx.init(m_slicing_params, *m_print_config) && m_print_config->belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { Polygons belt_surface = ctx.surface_polygon(ts_layer->print_z); base_areas = diff_ex(base_areas, belt_surface); @@ -2500,7 +2524,7 @@ void TreeSupport::draw_circles() // part. area_poly is collected from ePolygon nodes above, which are the normal // support nodes in Hybrid mode. Apply the expansion before area_groups and // lslices are built so toolpaths and brim avoidance use the same footprint. - if (layer_nr == 0 && m_raft_layers == 0 && m_support_params.support_style == smsTreeHybrid && + if (layer_nr == 0 && m_raft_layers == 0 && !belt_floor_active && m_support_params.support_style == smsTreeHybrid && m_object_config->raft_first_layer_expansion.value > 0.f) { ExPolygons expanded_base_areas; const float inflate_factor_1st_layer = float(scale_(m_object_config->raft_first_layer_expansion.value)); diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index 89e6c014f1..3386d72837 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -4016,12 +4016,20 @@ void organic_draw_branches( std::vector bottom_extra_slices; Polygons rest_support; coord_t bottom_radius = support_element_radius(config, *branch.path.front()); + // Belt printer (GeneratorOnly belt floor): the tilted belt surface is the + // build surface, so a branch should terminate ON the belt with a thin tip, + // not stamp its full footprint straight down to Z=0 and weld neighbouring + // branches into a solid floor slab. m_belt_floor is only populated in that + // mode, so it doubles as the gate (no effect on other printer types). + const bool belt_mode = !volumes.m_belt_floor.empty(); // Don't propagate further than 1.5 * bottom radius. //LayerIndex layers_propagate_max = 2 * bottom_radius / config.layer_height; LayerIndex layers_propagate_max = 5 * bottom_radius / config.layer_height; - LayerIndex layer_bottommost = branch.path.front()->state.verylost ? + LayerIndex layer_bottommost = (branch.path.front()->state.verylost && !belt_mode) ? // If the tree bottom is hanging in the air, bring it down to some surface. 0 : + // In belt mode never force-drop to Z=0 (the belt clip below handles + // termination); otherwise the "verylost" branch welds into the slab. //FIXME the "verylost" branches should stop when crossing another support. std::max(0, layer_begin - layers_propagate_max); double support_area_min_radius = M_PI * sqr(double(config.branch_radius)); @@ -4033,14 +4041,28 @@ void organic_draw_branches( Polygons collision = volumes.getCollision(0, collision_layer, false); rest_support = diff_clipped(rest_support.empty() ? slice_front_contact : rest_support, collision, ApplySafetyOffset::Yes); // Belt floor: clip propagated support at belt surface. - if (layer_idx < LayerIndex(volumes.m_belt_floor.size()) && !volumes.m_belt_floor[layer_idx].empty()) + bool belt_cut = false; + if (layer_idx < LayerIndex(volumes.m_belt_floor.size()) && !volumes.m_belt_floor[layer_idx].empty()) { + double area_before = area(rest_support); rest_support = diff(rest_support, volumes.m_belt_floor[layer_idx]); + // The belt counts as "reached" only when it actually removes part + // of this branch's footprint. The belt half-plane is non-empty at + // every near-belt layer, so testing non-emptiness alone would + // terminate a laterally-distant branch ~1 layer above true contact, + // leaving a gap. Require a real area reduction instead. + belt_cut = belt_mode && area(rest_support) < area_before - tiny_area; + } remove_small(rest_support, tiny_area); double rest_support_area = area(rest_support); if (rest_support_area < support_area_stop) // Don't propagate a fraction of the tree contact surface. break; bottom_extra_slices.push_back({ rest_support, rest_support_area }); + // Belt mode: once the belt surface actually starts cutting this branch + // it has reached the belt — keep this last (belt-clipped) slice as the + // contact and stop, rather than stamping the footprint further down. + if (belt_cut) + break; } // Now remove those bottom slices that are not supported at all. #if 0 @@ -4058,7 +4080,10 @@ void organic_draw_branches( } } #endif - if (config.settings.support_floor_layers > 0) { + // Belt mode: no solid support-floor pad under these branches — it is what + // welds neighbouring belt-terminating branches into the dense Z=0 slab. + // They simply taper out onto the tilted belt as distributed thin contacts. + if (!belt_mode && config.settings.support_floor_layers > 0) { Polygons contacts; if (!bottom_extra_slices.empty()) { const int contact_idx = int(bottom_extra_slices.size()) - 1; // Use the lowest contact slice as the footprint. @@ -4097,7 +4122,10 @@ void organic_draw_branches( } // ORCA: retain bottom contacts even when no placeable areas intersect. - if (branch.has_root && config.support_rests_on_model && branch.path.front()->state.layer_idx > 0 && + // Skipped in belt mode (m_belt_floor populated) so we don't re-introduce a + // solid floor pad for branches that terminate on the tilted belt surface. + if (volumes.m_belt_floor.empty() && + branch.has_root && config.support_rests_on_model && branch.path.front()->state.layer_idx > 0 && config.settings.support_floor_layers > 0 && config.z_distance_bottom_layers > 0 && bottom_contacts.empty() && !slice_front_contact.empty()) bottom_contacts.emplace_back(slice_front_contact); diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 9d9090480f..22c2cc85db 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1289,16 +1289,41 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const size_t n_filtered = 0, n_clip = 0; const double y_lo = model_bb.defined ? model_bb.min.y() - ANCHOR_CLIP_MARGIN_MM : -1e30; const double y_hi = model_bb.defined ? model_bb.max.y() + ANCHOR_CLIP_MARGIN_MM : 1e30; - for (const GCodeProcessorResult::MoveVertex& mv : gcode_result.moves) - if (mv.type == EMoveType::Extrude && mv.layer_id >= 1) { // skip layer-0 prime/skirt - ++n_filtered; - const Vec3d p = belt_inv * mv.position.cast(); - tp_bb_full.merge(p); - if (p.y() >= y_lo && p.y() <= y_hi) { - tp_bb_clip.merge(p); - ++n_clip; + // The anchor aligns the toolpath body onto the object-only model bbox, so it must be + // built from OBJECT-body toolpaths only. Support, skirt, brim and wipe-tower extrusions + // are not part of the model mesh and extend past it (support especially reaches well + // beyond the object on a belt), so including them drags tp_bb.min and shifts the whole + // back-transformed g-code off the mesh — but only when those features are present. That + // is the "g-code shifts vs mesh as soon as supports are enabled" bug. Filter them out. + auto is_object_body = [](ExtrusionRole r) { + return r != erSupportMaterial && r != erSupportMaterialInterface + && r != erSupportTransition + && r != erSkirt && r != erBrim && r != erWipeTower; + }; + auto accumulate = [&](bool body_only) { + tp_bb_clip = BoundingBoxf3(); + tp_bb_full = BoundingBoxf3(); + n_filtered = 0; + n_clip = 0; + for (const GCodeProcessorResult::MoveVertex& mv : gcode_result.moves) + if (mv.type == EMoveType::Extrude && mv.layer_id >= 1 // skip layer-0 prime/skirt + && (!body_only || is_object_body(mv.extrusion_role))) { + ++n_filtered; + const Vec3d p = belt_inv * mv.position.cast(); + tp_bb_full.merge(p); + if (p.y() >= y_lo && p.y() <= y_hi) { + tp_bb_clip.merge(p); + ++n_clip; + } } - } + }; + accumulate(/*body_only=*/true); + // Fallback: a plate with no object-body extrusions above layer 0 (e.g. a + // support-only object) would leave tp_bb undefined and silently skip the + // anchor. Re-accumulate over ALL extrude moves so the min-corner anchor is + // still computed rather than letting the preview float by the placement offset. + if (n_filtered == 0) + accumulate(/*body_only=*/false); // Use the clipped bbox when it still holds the bulk of the moves (outliers removed). // If the object sits far from the belt entry the toolpaths are grossly offset and the // clip drops most of them — fall back to the full bbox so the min-corner anchor still From c950c3fb6bed70fc27cd16200808e780fadf120f Mon Sep 17 00:00:00 2001 From: Joseph Robertson <32232925+HarrierPigeon@users.noreply.github.com> Date: Thu, 25 Jun 2026 22:39:12 -0500 Subject: [PATCH 062/389] Add BabyBelt Pro Profile, Courtesy of Rexit (#14424) --- resources/profiles/Printcepts.json | 54 +++++++ .../Printcepts/BabyBelt Pro_bed_texture.svg | 70 +++++++++ .../Printcepts/BabyBelt Pro_cover.png | Bin 0 -> 55870 bytes .../filament/Generic PETG @BabyBelt Pro.json | 112 ++++++++++++++ .../filament/Generic PLA @BabyBelt Pro.json | 112 ++++++++++++++ .../filament/eSUN PLA @BabyBelt Pro.json | 34 +++++ .../machine/BabyBelt Pro 0.4 nozzle.json | 87 +++++++++++ .../Printcepts/machine/BabyBelt Pro.json | 12 ++ .../Printcepts/machine/fdm_belt_common.json | 99 ++++++++++++ .../machine/fdm_klipper_common.json | 141 ++++++++++++++++++ .../machine/fdm_machine_common.json | 119 +++++++++++++++ .../0.20mm Standard @BabyBelt Pro.json | 22 +++ .../process/fdm_process_common.json | 108 ++++++++++++++ 13 files changed, 970 insertions(+) create mode 100644 resources/profiles/Printcepts.json create mode 100644 resources/profiles/Printcepts/BabyBelt Pro_bed_texture.svg create mode 100644 resources/profiles/Printcepts/BabyBelt Pro_cover.png create mode 100644 resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json create mode 100644 resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json create mode 100644 resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json create mode 100644 resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json create mode 100644 resources/profiles/Printcepts/machine/BabyBelt Pro.json create mode 100644 resources/profiles/Printcepts/machine/fdm_belt_common.json create mode 100644 resources/profiles/Printcepts/machine/fdm_klipper_common.json create mode 100644 resources/profiles/Printcepts/machine/fdm_machine_common.json create mode 100644 resources/profiles/Printcepts/process/0.20mm Standard @BabyBelt Pro.json create mode 100644 resources/profiles/Printcepts/process/fdm_process_common.json diff --git a/resources/profiles/Printcepts.json b/resources/profiles/Printcepts.json new file mode 100644 index 0000000000..3f2f47443f --- /dev/null +++ b/resources/profiles/Printcepts.json @@ -0,0 +1,54 @@ +{ + "name": "Printcepts", + "version": "01.00.00.00", + "force_update": "0", + "description": "Printcepts belt printer configurations", + "machine_model_list": [ + { + "name": "BabyBelt Pro", + "sub_path": "machine/BabyBelt Pro.json" + } + ], + "process_list": [ + { + "name": "fdm_process_common", + "sub_path": "process/fdm_process_common.json" + }, + { + "name": "0.20mm Standard @BabyBelt Pro", + "sub_path": "process/0.20mm Standard @BabyBelt Pro.json" + } + ], + "filament_list": [ + { + "name": "Generic PLA @BabyBelt Pro", + "sub_path": "filament/Generic PLA @BabyBelt Pro.json" + }, + { + "name": "eSUN PLA @BabyBelt Pro", + "sub_path": "filament/eSUN PLA @BabyBelt Pro.json" + }, + { + "name": "Generic PETG @BabyBelt Pro", + "sub_path": "filament/Generic PETG @BabyBelt Pro.json" + } + ], + "machine_list": [ + { + "name": "fdm_machine_common", + "sub_path": "machine/fdm_machine_common.json" + }, + { + "name": "fdm_klipper_common", + "sub_path": "machine/fdm_klipper_common.json" + }, + { + "name": "fdm_belt_common", + "sub_path": "machine/fdm_belt_common.json" + }, + { + "name": "BabyBelt Pro 0.4 nozzle", + "sub_path": "machine/BabyBelt Pro 0.4 nozzle.json" + } + ] +} diff --git a/resources/profiles/Printcepts/BabyBelt Pro_bed_texture.svg b/resources/profiles/Printcepts/BabyBelt Pro_bed_texture.svg new file mode 100644 index 0000000000..3193c6a284 --- /dev/null +++ b/resources/profiles/Printcepts/BabyBelt Pro_bed_texture.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/profiles/Printcepts/BabyBelt Pro_cover.png b/resources/profiles/Printcepts/BabyBelt Pro_cover.png new file mode 100644 index 0000000000000000000000000000000000000000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Ig%vyYY2(!+*(k*fN;oWDcD#n^HSF0GTt)IAY)pUhr}{2z4u(5GO1?_;HwTb9c8_Z_{SlM||5jJ6}( zXQqsvW9-%f%tq+yCC$cJ^=t#CU?DfcoL!Wq z-moQGLXrED4LM4$G99b99^6kWqI9oDVxYHyFBR;+toI}PewQku9>s5B#%ib5*WtIRy zN1%FJ)|U0~JNAJ%f+h)qWm=Iy2@(r-BY8IEsnoa~SOd=p(fnX&<=*kK$?<&{9eq~H z(f9x4FXo&jowZ}hyQ4bzL&tvT@Ud2SiD$tmzlSUTM;R|`=vOvE)eyGOF0{!y%p&I`m>dJ6QufQ1j00000NkvXXu0mjfYcK?m literal 0 HcmV?d00001 diff --git a/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json new file mode 100644 index 0000000000..026e6ab07d --- /dev/null +++ b/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json @@ -0,0 +1,112 @@ +{ + "type": "filament", + "name": "Generic PETG @BabyBelt Pro", + "inherits": "Generic PETG @System", + "from": "system", + "instantiation": "true", + "compatible_printers": [ + "BabyBelt Pro 0.4 nozzle" + ], + "filament_type": [ + "PETG" + ], + "filament_vendor": [ + "Generic" + ], + "filament_settings_id": [ + "Generic PETG @BabyBelt Pro" + ], + "filament_diameter": [ + "1.75" + ], + "filament_density": [ + "1.27" + ], + "filament_flow_ratio": [ + "0.95" + ], + "filament_cost": [ + "25" + ], + "filament_max_volumetric_speed": [ + "10" + ], + "nozzle_temperature": [ + "240" + ], + "nozzle_temperature_initial_layer": [ + "245" + ], + "nozzle_temperature_range_low": [ + "220" + ], + "nozzle_temperature_range_high": [ + "260" + ], + "temperature_vitrification": [ + "70" + ], + "hot_plate_temp": [ + "80" + ], + "hot_plate_temp_initial_layer": [ + "80" + ], + "cool_plate_temp": [ + "80" + ], + "cool_plate_temp_initial_layer": [ + "80" + ], + "textured_plate_temp": [ + "80" + ], + "textured_plate_temp_initial_layer": [ + "80" + ], + "fan_min_speed": [ + "40" + ], + "fan_max_speed": [ + "60" + ], + "overhang_fan_threshold": [ + "25%" + ], + "overhang_fan_speed": [ + "80" + ], + "close_fan_the_first_x_layers": [ + "3" + ], + "full_fan_speed_layer": [ + "8" + ], + "slow_down_min_speed": [ + "20" + ], + "slow_down_layer_time": [ + "4" + ], + "fan_cooling_layer_time": [ + "100" + ], + "reduce_fan_stop_start_freq": [ + "1" + ], + "filament_retraction_length": [ + "2" + ], + "filament_retraction_speed": [ + "40" + ], + "filament_deretraction_speed": [ + "40" + ], + "filament_z_hop": [ + "0.4" + ], + "filament_start_gcode": [ + "; Generic PETG @BabyBelt Pro — belt PETG, bed 80C" + ] +} diff --git a/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json new file mode 100644 index 0000000000..e89fb51e19 --- /dev/null +++ b/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json @@ -0,0 +1,112 @@ +{ + "type": "filament", + "name": "Generic PLA @BabyBelt Pro", + "inherits": "Generic PLA @System", + "from": "system", + "instantiation": "true", + "compatible_printers": [ + "BabyBelt Pro 0.4 nozzle" + ], + "filament_type": [ + "PLA" + ], + "filament_vendor": [ + "Generic" + ], + "filament_settings_id": [ + "Generic PLA @BabyBelt Pro" + ], + "filament_diameter": [ + "1.75" + ], + "filament_density": [ + "1.24" + ], + "filament_flow_ratio": [ + "0.98" + ], + "filament_cost": [ + "20" + ], + "filament_max_volumetric_speed": [ + "12" + ], + "nozzle_temperature": [ + "215" + ], + "nozzle_temperature_initial_layer": [ + "220" + ], + "nozzle_temperature_range_low": [ + "190" + ], + "nozzle_temperature_range_high": [ + "240" + ], + "temperature_vitrification": [ + "45" + ], + "hot_plate_temp": [ + "75" + ], + "hot_plate_temp_initial_layer": [ + "75" + ], + "cool_plate_temp": [ + "75" + ], + "cool_plate_temp_initial_layer": [ + "75" + ], + "textured_plate_temp": [ + "75" + ], + "textured_plate_temp_initial_layer": [ + "75" + ], + "fan_min_speed": [ + "100" + ], + "fan_max_speed": [ + "100" + ], + "overhang_fan_threshold": [ + "50%" + ], + "overhang_fan_speed": [ + "100" + ], + "close_fan_the_first_x_layers": [ + "3" + ], + "full_fan_speed_layer": [ + "8" + ], + "slow_down_min_speed": [ + "20" + ], + "slow_down_layer_time": [ + "4" + ], + "fan_cooling_layer_time": [ + "100" + ], + "reduce_fan_stop_start_freq": [ + "1" + ], + "filament_retraction_length": [ + "1.5" + ], + "filament_retraction_speed": [ + "35" + ], + "filament_deretraction_speed": [ + "30" + ], + "filament_z_hop": [ + "0.4" + ], + "filament_start_gcode": [ + "; Generic PLA @BabyBelt Pro — belt PLA, bed 75C" + ] +} diff --git a/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json new file mode 100644 index 0000000000..30cf1a9a3a --- /dev/null +++ b/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json @@ -0,0 +1,34 @@ +{ + "type": "filament", + "name": "eSUN PLA @BabyBelt Pro", + "inherits": "Generic PLA @BabyBelt Pro", + "from": "system", + "instantiation": "true", + "compatible_printers": [ + "BabyBelt Pro 0.4 nozzle" + ], + "filament_type": [ + "PLA" + ], + "filament_vendor": [ + "eSUN" + ], + "filament_settings_id": [ + "eSUN PLA @BabyBelt Pro" + ], + "nozzle_temperature_initial_layer": [ + "200" + ], + "nozzle_temperature": [ + "200" + ], + "enable_pressure_advance": [ + "1" + ], + "pressure_advance": [ + "0.12" + ], + "filament_max_volumetric_speed": [ + "20" + ] +} diff --git a/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json b/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json new file mode 100644 index 0000000000..61b37d268b --- /dev/null +++ b/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json @@ -0,0 +1,87 @@ +{ + "type": "machine", + "name": "BabyBelt Pro 0.4 nozzle", + "inherits": "fdm_belt_common", + "from": "system", + "setting_id": "GMPC0BBP01", + "instantiation": "true", + "printer_model": "BabyBelt Pro", + "printer_variant": "0.4", + "nozzle_diameter": [ + "0.4" + ], + "default_filament_profile": [ + "Generic PLA @BabyBelt Pro" + ], + "default_print_profile": "0.20mm Standard @BabyBelt Pro", + "printable_area": [ + "0x0", + "95x0", + "95x500", + "0x500" + ], + "printable_height": "100", + "best_object_pos": "0.5,0.05", + "nozzle_type": [ + "hardened_steel" + ], + "printer_extruder_id": [ + "1" + ], + "printer_extruder_variant": [ + "Direct Drive Standard" + ], + "thumbnails": [ + "48x48/PNG", + "300x300/PNG" + ], + "machine_max_acceleration_e": [ + "500", + "5000" + ], + "machine_max_acceleration_extruding": [ + "500", + "20000" + ], + "machine_max_acceleration_retracting": [ + "500", + "5000" + ], + "machine_max_acceleration_x": [ + "500", + "20000" + ], + "machine_max_acceleration_y": [ + "500", + "20000" + ], + "machine_max_junction_deviation": [ + "0.01" + ], + "machine_max_speed_x": [ + "50", + "200" + ], + "machine_max_speed_y": [ + "50", + "200" + ], + "machine_max_speed_z": [ + "5", + "12" + ], + "retraction_length": [ + "1.5" + ], + "retraction_speed": [ + "20" + ], + "deretraction_speed": [ + "25" + ], + "retract_lift_enforce": [ + "Top and Bottom" + ], + "support_chamber_temp_control": "0", + "machine_start_gcode": ";Start GCode\nPRINT_START ANGLE=[belt_slice_rotation_angle] EXTRUDER=[nozzle_temperature_initial_layer] BED=[hot_plate_temp_initial_layer] MATERIAL=[filament_type]\n" +} diff --git a/resources/profiles/Printcepts/machine/BabyBelt Pro.json b/resources/profiles/Printcepts/machine/BabyBelt Pro.json new file mode 100644 index 0000000000..eb711541bd --- /dev/null +++ b/resources/profiles/Printcepts/machine/BabyBelt Pro.json @@ -0,0 +1,12 @@ +{ + "type": "machine_model", + "name": "BabyBelt Pro", + "model_id": "Printcepts_BabyBelt_Pro", + "nozzle_diameter": "0.4", + "machine_tech": "FFF", + "family": "Printcepts", + "bed_model": "", + "bed_texture": "BabyBelt Pro_bed_texture.svg", + "hotend_model": "", + "default_materials": "Generic PLA @BabyBelt Pro;Generic PETG @BabyBelt Pro" +} diff --git a/resources/profiles/Printcepts/machine/fdm_belt_common.json b/resources/profiles/Printcepts/machine/fdm_belt_common.json new file mode 100644 index 0000000000..b010742d78 --- /dev/null +++ b/resources/profiles/Printcepts/machine/fdm_belt_common.json @@ -0,0 +1,99 @@ +{ + "type": "machine", + "name": "fdm_belt_common", + "inherits": "fdm_klipper_common", + "from": "system", + "instantiation": "false", + "gcode_flavor": "klipper", + "single_extruder_multi_material": "0", + "default_filament_profile": [ + "Generic PLA @System" + ], + "default_print_profile": "0.20mm Standard @System", + "max_layer_height": [ + "0.32" + ], + "min_layer_height": [ + "0.08" + ], + "deretraction_speed": [ + "30" + ], + "extruder_colour": [ + "#FCE94F" + ], + "extruder_offset": [ + "0x0" + ], + "long_retractions_when_cut": [ + "0" + ], + "nozzle_diameter": [ + "0.4" + ], + "retract_before_wipe": [ + "70%" + ], + "retract_length_toolchange": [ + "2" + ], + "retract_lift_above": [ + "0" + ], + "retract_lift_below": [ + "0" + ], + "retract_lift_enforce": [ + "All Surfaces" + ], + "retract_restart_extra": [ + "0" + ], + "retract_restart_extra_toolchange": [ + "0" + ], + "retract_when_changing_layer": [ + "1" + ], + "retraction_distances_when_cut": [ + "18" + ], + "retraction_length": [ + "0.8" + ], + "retraction_minimum_travel": [ + "1" + ], + "retraction_speed": [ + "30" + ], + "travel_slope": [ + "3" + ], + "wipe": [ + "1" + ], + "wipe_distance": [ + "1" + ], + "z_hop": [ + "0.4" + ], + "z_hop_types": [ + "Normal Lift" + ], + "gcode_remap_x": "rev_x", + "gcode_remap_y": "pos_z", + "gcode_remap_z": "pos_y", + "printer_extruder_id": [ + "1" + ], + "belt_printer": "1", + "belt_slice_rotation": "x", + "belt_slice_rotation_angle": "45", + "belt_slice_rotation_global": "1", + "build_plate_tilt_x": "45", + "purge_in_prime_tower": "0", + "scan_first_layer": "0", + "auxiliary_fan": "0" +} diff --git a/resources/profiles/Printcepts/machine/fdm_klipper_common.json b/resources/profiles/Printcepts/machine/fdm_klipper_common.json new file mode 100644 index 0000000000..36f3fe13c6 --- /dev/null +++ b/resources/profiles/Printcepts/machine/fdm_klipper_common.json @@ -0,0 +1,141 @@ +{ + "type": "machine", + "name": "fdm_klipper_common", + "inherits": "fdm_machine_common", + "from": "system", + "instantiation": "false", + "gcode_flavor": "klipper", + "machine_max_acceleration_e": [ + "5000", + "5000" + ], + "machine_max_acceleration_extruding": [ + "20000", + "20000" + ], + "machine_max_acceleration_retracting": [ + "5000", + "5000" + ], + "machine_max_acceleration_travel": [ + "20000", + "20000" + ], + "machine_max_acceleration_x": [ + "20000", + "20000" + ], + "machine_max_acceleration_y": [ + "20000", + "20000" + ], + "machine_max_acceleration_z": [ + "500", + "200" + ], + "machine_max_speed_e": [ + "25", + "25" + ], + "machine_max_speed_x": [ + "500", + "200" + ], + "machine_max_speed_y": [ + "500", + "200" + ], + "machine_max_speed_z": [ + "12", + "12" + ], + "machine_max_jerk_e": [ + "2.5", + "2.5" + ], + "machine_max_jerk_x": [ + "9", + "9" + ], + "machine_max_jerk_y": [ + "9", + "9" + ], + "machine_max_jerk_z": [ + "0.2", + "0.4" + ], + "machine_min_extruding_rate": [ + "0", + "0" + ], + "machine_min_travel_rate": [ + "0", + "0" + ], + "max_layer_height": [ + "0.32" + ], + "min_layer_height": [ + "0.08" + ], + "printable_height": "250", + "extruder_clearance_radius": "65", + "extruder_clearance_height_to_rod": "36", + "extruder_clearance_height_to_lid": "140", + "printer_settings_id": "", + "printer_technology": "FFF", + "printer_variant": "0.4", + "retraction_minimum_travel": [ + "1" + ], + "retract_before_wipe": [ + "70%" + ], + "retract_when_changing_layer": [ + "1" + ], + "retraction_length": [ + "0.8" + ], + "retract_length_toolchange": [ + "2" + ], + "z_hop": [ + "0.4" + ], + "retract_restart_extra": [ + "0" + ], + "retract_restart_extra_toolchange": [ + "0" + ], + "retraction_speed": [ + "30" + ], + "deretraction_speed": [ + "30" + ], + "z_hop_types": "Normal Lift", + "silent_mode": "0", + "single_extruder_multi_material": "1", + "change_filament_gcode": "", + "wipe": [ + "1" + ], + "default_filament_profile": [ + "Generic PLA @System" + ], + "default_print_profile": "0.20mm Standard @MyKlipper", + "bed_exclude_area": [ + "0x0" + ], + "machine_start_gcode": "M190 S[bed_temperature_initial_layer_single]\nM109 S[nozzle_temperature_initial_layer]\nPRINT_START EXTRUDER=[nozzle_temperature_initial_layer] BED=[bed_temperature_initial_layer_single]\n", + "machine_end_gcode": "PRINT_END", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", + "machine_pause_gcode": "PAUSE", + "scan_first_layer": "0", + "nozzle_type": "undefine", + "auxiliary_fan": "0" +} diff --git a/resources/profiles/Printcepts/machine/fdm_machine_common.json b/resources/profiles/Printcepts/machine/fdm_machine_common.json new file mode 100644 index 0000000000..963f39c9d8 --- /dev/null +++ b/resources/profiles/Printcepts/machine/fdm_machine_common.json @@ -0,0 +1,119 @@ +{ + "type": "machine", + "name": "fdm_machine_common", + "from": "system", + "instantiation": "false", + "printer_technology": "FFF", + "deretraction_speed": [ + "40" + ], + "extruder_colour": [ + "#FCE94F" + ], + "extruder_offset": [ + "0x0" + ], + "gcode_flavor": "marlin", + "silent_mode": "0", + "machine_max_acceleration_e": [ + "5000" + ], + "machine_max_acceleration_extruding": [ + "10000" + ], + "machine_max_acceleration_retracting": [ + "1000" + ], + "machine_max_acceleration_x": [ + "10000" + ], + "machine_max_acceleration_y": [ + "10000" + ], + "machine_max_acceleration_z": [ + "500" + ], + "machine_max_speed_e": [ + "60" + ], + "machine_max_speed_x": [ + "500" + ], + "machine_max_speed_y": [ + "500" + ], + "machine_max_speed_z": [ + "10" + ], + "machine_max_jerk_e": [ + "5" + ], + "machine_max_jerk_x": [ + "8" + ], + "machine_max_jerk_y": [ + "8" + ], + "machine_max_jerk_z": [ + "0.4" + ], + "machine_min_extruding_rate": [ + "0" + ], + "machine_min_travel_rate": [ + "0" + ], + "max_layer_height": [ + "0.32" + ], + "min_layer_height": [ + "0.08" + ], + "printable_height": "250", + "extruder_clearance_radius": "65", + "extruder_clearance_height_to_rod": "36", + "extruder_clearance_height_to_lid": "140", + "nozzle_diameter": [ + "0.4" + ], + "printer_settings_id": "", + "printer_variant": "0.4", + "retraction_minimum_travel": [ + "2" + ], + "retract_before_wipe": [ + "70%" + ], + "retract_when_changing_layer": [ + "1" + ], + "retraction_length": [ + "1" + ], + "retract_length_toolchange": [ + "1" + ], + "z_hop": [ + "0" + ], + "retract_restart_extra": [ + "0" + ], + "retract_restart_extra_toolchange": [ + "0" + ], + "retraction_speed": [ + "60" + ], + "single_extruder_multi_material": "1", + "change_filament_gcode": "", + "wipe": [ + "1" + ], + "default_print_profile": "", + "machine_start_gcode": "G0 Z20 F9000\nG92 E0; G1 E-10 F1200\nG28\nM970 Q1 A10 B10 C130 K0\nM970 Q1 A10 B131 C250 K1\nM974 Q1 S1 P0\nM970 Q0 A10 B10 C130 H20 K0\nM970 Q0 A10 B131 C250 K1\nM974 Q0 S1 P0\nM220 S100 ;Reset Feedrate\nM221 S100 ;Reset Flowrate\nG29 ;Home\nG90;\nG92 E0 ;Reset Extruder \nG1 Z2.0 F3000 ;Move Z Axis up \nG1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position\nM109 S205;\nG1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line\nG1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little\nG1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line\nG92 E0 ;Reset Extruder \nG1 X110 Y110 Z2.0 F3000 ;Move Z Axis up", + "machine_end_gcode": "M400 ; wait for buffer to clear\nG92 E0 ; zero the extruder\nG1 E-4.0 F3600; retract \nG91\nG1 Z3;\nM104 S0 ; turn off hotend\nM140 S0 ; turn off bed\nM106 S0 ; turn off fan\nG90 \nG0 X110 Y200 F3600 \nprint_end", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", + "machine_pause_gcode": "M601" +} diff --git a/resources/profiles/Printcepts/process/0.20mm Standard @BabyBelt Pro.json b/resources/profiles/Printcepts/process/0.20mm Standard @BabyBelt Pro.json new file mode 100644 index 0000000000..7f7a810762 --- /dev/null +++ b/resources/profiles/Printcepts/process/0.20mm Standard @BabyBelt Pro.json @@ -0,0 +1,22 @@ +{ + "type": "process", + "name": "0.20mm Standard @BabyBelt Pro", + "inherits": "fdm_process_common", + "from": "system", + "instantiation": "true", + "layer_height": "0.2", + "initial_layer_print_height": "0.2", + "initial_layer_line_width": "0.42", + "wall_loops": "2", + "reduce_infill_retraction": "1", + "detect_overhang_wall": "1", + "skirt_loops": "0", + "skirt_distance": "0", + "sparse_infill_pattern": "grid", + "sparse_infill_speed": "200", + "support_base_pattern": "rectilinear", + "support_interface_pattern": "rectilinear", + "compatible_printers": [ + "BabyBelt Pro 0.4 nozzle" + ] +} diff --git a/resources/profiles/Printcepts/process/fdm_process_common.json b/resources/profiles/Printcepts/process/fdm_process_common.json new file mode 100644 index 0000000000..b8e882770a --- /dev/null +++ b/resources/profiles/Printcepts/process/fdm_process_common.json @@ -0,0 +1,108 @@ +{ + "type": "process", + "name": "fdm_process_common", + "from": "system", + "instantiation": "false", + "adaptive_layer_height": "0", + "reduce_crossing_wall": "0", + "max_travel_detour_distance": "0", + "bottom_surface_pattern": "monotonic", + "bottom_shell_thickness": "0", + "bridge_speed": "50", + "brim_width": "5", + "brim_object_gap": "0.1", + "compatible_printers": [], + "compatible_printers_condition": "", + "print_sequence": "by layer", + "default_acceleration": "1000", + "initial_layer_acceleration": "500", + "top_surface_acceleration": "1000", + "travel_acceleration": "1000", + "inner_wall_acceleration": "1000", + "outer_wall_acceleration": "700", + "bridge_no_support": "0", + "draft_shield": "disabled", + "elefant_foot_compensation": "0", + "enable_arc_fitting": "0", + "wall_infill_order": "inner wall/outer wall/infill", + "infill_direction": "45", + "sparse_infill_density": "15%", + "sparse_infill_pattern": "crosshatch", + "initial_layer_print_height": "0.2", + "infill_combination": "0", + "infill_wall_overlap": "25%", + "interface_shells": "0", + "ironing_flow": "10%", + "ironing_spacing": "0.15", + "ironing_speed": "30", + "ironing_type": "no ironing", + "reduce_infill_retraction": "1", + "filename_format": "{input_filename_base}_{layer_height}mm_{filament_type[initial_tool]}_{printer_model}_{print_time}.gcode", + "detect_overhang_wall": "1", + "slowdown_for_curled_perimeters": "1", + "overhang_1_4_speed": "0", + "overhang_2_4_speed": "50", + "overhang_3_4_speed": "30", + "overhang_4_4_speed": "10", + "line_width": "110%", + "inner_wall_line_width": "110%", + "outer_wall_line_width": "100%", + "top_surface_line_width": "93.75%", + "sparse_infill_line_width": "110%", + "initial_layer_line_width": "120%", + "internal_solid_infill_line_width": "120%", + "support_line_width": "96%", + "wall_loops": "3", + "print_settings_id": "", + "raft_layers": "0", + "seam_position": "aligned", + "skirt_distance": "2", + "skirt_height": "3", + "min_skirt_length": "4", + "skirt_loops": "0", + "minimum_sparse_infill_area": "15", + "spiral_mode": "0", + "standby_temperature_delta": "-5", + "enable_support": "0", + "resolution": "0.012", + "support_type": "normal(auto)", + "support_on_build_plate_only": "0", + "support_top_z_distance": "0.2", + "support_bottom_z_distance": "0.2", + "support_filament": "0", + "support_interface_loop_pattern": "0", + "support_interface_filament": "0", + "support_interface_top_layers": "2", + "support_interface_bottom_layers": "2", + "support_interface_spacing": "0.5", + "support_interface_speed": "80", + "support_base_pattern": "default", + "support_base_pattern_spacing": "2.5", + "support_speed": "150", + "support_threshold_angle": "30", + "support_object_xy_distance": "0.35", + "tree_support_branch_angle": "30", + "tree_support_wall_count": "0", + "tree_support_with_infill": "0", + "detect_thin_wall": "0", + "top_surface_pattern": "monotonicline", + "top_shell_thickness": "0.8", + "enable_prime_tower": "1", + "wipe_tower_no_sparse_layers": "0", + "prime_tower_width": "60", + "xy_hole_compensation": "0", + "xy_contour_compensation": "0", + "layer_height": "0.2", + "bottom_shell_layers": "3", + "top_shell_layers": "4", + "bridge_flow": "1", + "initial_layer_speed": "45", + "initial_layer_infill_speed": "45", + "outer_wall_speed": "45", + "inner_wall_speed": "80", + "sparse_infill_speed": "150", + "internal_solid_infill_speed": "150", + "top_surface_speed": "50", + "gap_infill_speed": "30", + "travel_speed": "200" +} From b61ba98183041234405decc3e08d4b0d4550ad55 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sun, 2 Aug 2026 16:20:22 -0500 Subject: [PATCH 063/389] belt: adapt BeltGCodeWriter to upstream's per-extruder speed options Upstream retyped travel_speed and travel_speed_z to ConfigOptionFloatsNullable and initial_layer_travel_speed to ConfigOptionFloatsOrPercentsNullable, so the scalar .value / get_abs_value() accessors no longer compile. BeltGCodeWriter.cpp is belt-only and merged without conflict, so this only surfaced at build time. Index them the way the base GCodeWriter does -- .get_at(m_cached_extruder_idx) and get_abs_value_at(..., m_cached_extruder_idx) -- keeping belt's per-point first_layer_for_point test rather than the base class's m_is_first_layer. m_cached_extruder_idx moves from private to the existing protected block that already exposes writer state to subclasses, so the belt writer resolves the per-extruder index identically to the base writer instead of guessing one. --- src/libslic3r/BeltGCodeWriter.cpp | 15 ++++++++------- src/libslic3r/GCodeWriter.hpp | 7 +++++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index 7c645edf43..f46b1f2c35 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -87,7 +87,8 @@ std::string BeltGCodeWriter::travel_to_xy(const Vec2d &point, const std::string m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, Vec3d(point.x(), point.y(), m_pos.z())); auto speed = first_layer_for_point - ? this->config.get_abs_value("initial_layer_travel_speed") : this->config.travel_speed.value; + ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) + : this->config.travel_speed.get_at(m_cached_extruder_idx); w.emit_f(speed * 60.0); w.emit_comment(GCodeWriter::full_gcode_comment, comment); return w.string(); @@ -110,13 +111,13 @@ std::string BeltGCodeWriter::_travel_to_z(double z, const std::string &comment) { m_pos(2) = z; - double speed = this->config.travel_speed_z.value; + double speed = this->config.travel_speed_z.get_at(m_cached_extruder_idx); if (speed == 0.) { const bool first_layer_for_point = belt_point_on_first_layer( m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, Vec3d(m_pos.x(), m_pos.y(), z)); - speed = first_layer_for_point ? this->config.get_abs_value("initial_layer_travel_speed") - : this->config.travel_speed.value; + speed = first_layer_for_point ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) + : this->config.travel_speed.get_at(m_cached_extruder_idx); } // Belt printer: a Z-only move in slicing frame needs to emit both Y and Z in machine coords. @@ -182,8 +183,8 @@ std::string BeltGCodeWriter::travel_to_xyz(const Vec3d &point, const std::string const bool first_layer_for_point = belt_point_on_first_layer( m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, point); auto travel_speed = - first_layer_for_point ? this->config.get_abs_value("initial_layer_travel_speed") - : this->config.travel_speed.value; + first_layer_for_point ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) + : this->config.travel_speed.get_at(m_cached_extruder_idx); // Handle pending z_hop if (std::abs(m_to_lift) > EPSILON) { @@ -253,7 +254,7 @@ std::string BeltGCodeWriter::travel_to_xyz(const Vec3d &point, const std::string // Belt mode: always emit full XYZ GCodeG1Formatter w; w.emit_xyz(point_on_plate); - w.emit_f(this->config.travel_speed.value * 60.0); + w.emit_f(this->config.travel_speed.get_at(m_cached_extruder_idx) * 60.0); w.emit_comment(GCodeWriter::full_gcode_comment, comment); m_pos = dest_point; diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 2671851f53..da2ce35cd6 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -167,14 +167,17 @@ protected: // Apply axis remap to a point. Returns pos unchanged if remap is identity. Vec3d apply_axis_remap(const Vec3d &pos) const; + // Motion uses the global/base process variant until a filament becomes active. + // Protected so BeltGCodeWriter indexes the per-extruder speed options (travel_speed, + // travel_speed_z, initial_layer_travel_speed) exactly as the base writer does. + size_t m_cached_extruder_idx; + private: // Extruders are sorted by their ID, so that binary search is possible. std::vector m_filament_extruders; bool m_single_extruder_multi_material; std::vector m_curr_filament_extruder; int m_curr_extruder_id; - // Motion uses the global/base process variant until a filament becomes active. - size_t m_cached_extruder_idx; unsigned int m_last_acceleration; unsigned int m_last_travel_acceleration; std::vector m_max_travel_acceleration; From 8f6802fff834194628850163c7059bd1d790bd20 Mon Sep 17 00:00:00 2001 From: HarrierPigeon Date: Mon, 25 May 2026 17:01:13 -0600 Subject: [PATCH 064/389] step one: post-process analysis --- src/libslic3r/GCode/GCodeProcessor.cpp | 60 +++++++++++++------ src/libslic3r/GCode/GCodeProcessor.hpp | 7 +++ src/libslic3r/GCode/MachineFrameTransform.cpp | 17 ++++-- src/libslic3r/GCode/MachineFrameTransform.hpp | 10 +++- 4 files changed, 71 insertions(+), 23 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index ba2ae5db45..bc84963da0 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2765,6 +2765,32 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const int return ps; }; + // Belt-printer post-gcode shear/scale/post_remap is applied as the final + // step of BeltGCodeWriter::to_machine_coords, so MoveVertex.position is + // in the printer's machine frame. Undo it here so XY area and Z height + // checks operate in the build-volume frame that printable_area / + // printable_height are defined in. For non-belt printers + // (is_active() == false) apply_inverse is identity and behaviour is + // unchanged from before. + const bool machine_frame_active = m_machine_frame_transform.is_active(); + auto compare_pos = [&](const GCodeProcessorResult::MoveVertex &move) -> Vec3d { + Vec3d pos = move.position.cast(); + if (!machine_frame_active) + return pos; + Vec3d extruder_off = Vec3d::Zero(); + if (size_t(move.extruder_id) < m_extruder_offsets.size()) + extruder_off = m_extruder_offsets[move.extruder_id].cast(); + // Strip plate + extruder offsets to recover the raw machine-frame + // coordinate that was emitted into the G-code (see store_move_vertex). + Vec3d machine(pos.x() - m_x_offset - extruder_off.x(), + pos.y() - m_y_offset - extruder_off.y(), + pos.z() - extruder_off.z() + m_z_offset); + Vec3d build = m_machine_frame_transform.apply_inverse(machine); + // Re-apply plate offset so the result matches plate_printable_poly, + // which is translated by plate_offset below. + return Vec3d(build.x() + m_x_offset, build.y() + m_y_offset, build.z()); + }; + struct GCodePosInfo { Points pos; @@ -2775,28 +2801,23 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const int std::map> gcode_path_pos; // object_id, filament_id, pos for (const GCodeProcessorResult::MoveVertex &move : m_result.moves) { // sometimes, the start line extrude was outside the edge of plate a little, this is allowed, so do not include into the gcode_path_pos - if (move.type == EMoveType::Extrude /* && move.extrusion_role != ExtrusionRole::erFlush || move.type == EMoveType::Travel*/) + if (move.type == EMoveType::Extrude /* && move.extrusion_role != ExtrusionRole::erFlush || move.type == EMoveType::Travel*/) { + const Vec3d cp = compare_pos(move); + // For belt printers we read Z from the inverse-transformed position + // (post-origin-snap, pre-machine-frame). Otherwise keep the + // original print_z source (the slicer's layer-Z comment) so + // non-belt behaviour is bit-for-bit unchanged. + const float z_for_height = machine_frame_active ? float(cp.z()) : move.print_z; if (move.extrusion_role == ExtrusionRole::erCustom) { - /*if (move.is_arc_move_with_interpolation_points()) { - for (int i = 0; i < move.interpolation_points.size(); i++) { - gcode_path_pos[move.object_label_id][int(move.extruder_id)].pos_custom.emplace_back(to_2d(move.interpolation_points[i].cast())); - } - } else {*/ - gcode_path_pos[move.object_label_id][int(move.extruder_id)].pos_custom.emplace_back(to_2d(move.position.cast())); - //} + gcode_path_pos[move.object_label_id][int(move.extruder_id)].pos_custom.emplace_back(to_2d(cp)); gcode_path_pos[move.object_label_id][int(move.extruder_id)].max_print_z_custom = - std::max(gcode_path_pos[move.object_label_id][int(move.extruder_id)].max_print_z_custom, move.print_z); + std::max(gcode_path_pos[move.object_label_id][int(move.extruder_id)].max_print_z_custom, z_for_height); } else { - /*if (move.is_arc_move_with_interpolation_points()) { - for (int i = 0; i < move.interpolation_points.size(); i++) { - gcode_path_pos[move.object_label_id][int(move.extruder_id)].pos.emplace_back(to_2d(move.interpolation_points[i].cast())); - } - } else {*/ - gcode_path_pos[move.object_label_id][int(move.extruder_id)].pos.emplace_back(to_2d(move.position.cast())); - //} + gcode_path_pos[move.object_label_id][int(move.extruder_id)].pos.emplace_back(to_2d(cp)); gcode_path_pos[move.object_label_id][int(move.extruder_id)].max_print_z = std::max(gcode_path_pos[move.object_label_id][int(move.extruder_id)].max_print_z, - move.print_z); + z_for_height); } + } } bool valid = true; @@ -3036,6 +3057,11 @@ void GCodeProcessor::apply_config(const PrintConfig& config) m_result.printable_height = config.printable_height; + // Belt printer: cache the post-gcode machine-frame transform so the + // multi-extruder validator can undo it and compare against build-volume + // bounds rather than machine-frame positions. + m_machine_frame_transform.init_from_config(config); + auto filament_maps = config.option("filament_map"); if (filament_maps != nullptr) { m_filament_maps = filament_maps->values; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index ce61d25ee4..63f38bf5ef 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -7,6 +7,7 @@ #include "libslic3r/PrintConfig.hpp" #include "libslic3r/CustomGCode.hpp" #include "libslic3r/MultiNozzleUtils.hpp" +#include "libslic3r/GCode/MachineFrameTransform.hpp" #include #include @@ -1145,6 +1146,12 @@ class Print; double m_x_offset{ 0 }; double m_y_offset{ 0 }; + // Belt-printer post-gcode shear/scale/post_remap. Used by + // check_multi_extruder_gcode_valid to undo the machine-frame + // transform on move positions so bounds checks operate in the + // pre-machine-frame (build-volume) frame. + MachineFrameTransform m_machine_frame_transform; + unsigned int m_line_id; unsigned int m_last_line_id; float m_feedrate; // mm/s diff --git a/src/libslic3r/GCode/MachineFrameTransform.cpp b/src/libslic3r/GCode/MachineFrameTransform.cpp index bdc172d7a4..3d322b4303 100644 --- a/src/libslic3r/GCode/MachineFrameTransform.cpp +++ b/src/libslic3r/GCode/MachineFrameTransform.cpp @@ -7,8 +7,9 @@ namespace Slic3r { bool MachineFrameTransform::init_from_config(const PrintConfig &config) { - m_active = false; - m_transform = Transform3d::Identity(); + m_active = false; + m_transform = Transform3d::Identity(); + m_transform_inverse = Transform3d::Identity(); if (!config.belt_printer.value) return false; @@ -59,8 +60,9 @@ bool MachineFrameTransform::init_from_config(const PrintConfig &config) if (combined.isApprox(Transform3d::Identity())) return false; - m_transform = combined; - m_active = true; + m_transform = combined; + m_transform_inverse = combined.inverse(); + m_active = true; return true; } @@ -71,4 +73,11 @@ Vec3d MachineFrameTransform::apply(const Vec3d &pos) const return m_transform * pos; } +Vec3d MachineFrameTransform::apply_inverse(const Vec3d &pos) const +{ + if (!m_active) + return pos; + return m_transform_inverse * pos; +} + } // namespace Slic3r diff --git a/src/libslic3r/GCode/MachineFrameTransform.hpp b/src/libslic3r/GCode/MachineFrameTransform.hpp index f5e71398da..744a7976c5 100644 --- a/src/libslic3r/GCode/MachineFrameTransform.hpp +++ b/src/libslic3r/GCode/MachineFrameTransform.hpp @@ -31,6 +31,11 @@ public: // Apply the transform to a point. Returns pos unchanged if not active. Vec3d apply(const Vec3d &pos) const; + // Apply the inverse transform. Returns pos unchanged if not active. + // Used by validators that need to compare emitted machine-frame + // coordinates against build-volume bounds. + Vec3d apply_inverse(const Vec3d &pos) const; + bool is_active() const { return m_active; } // The composed shear*scale transform (identity when inactive). Exposed so the @@ -39,8 +44,9 @@ public: const Transform3d& transform() const { return m_transform; } private: - bool m_active = false; - Transform3d m_transform = Transform3d::Identity(); + bool m_active = false; + Transform3d m_transform = Transform3d::Identity(); + Transform3d m_transform_inverse = Transform3d::Identity(); }; } // namespace Slic3r From 79fd847ce3d466e52a75709806422fa5337d071f Mon Sep 17 00:00:00 2001 From: HarrierPigeon Date: Mon, 25 May 2026 17:19:58 -0600 Subject: [PATCH 065/389] fix pre-slice warnings --- src/libslic3r/Print.cpp | 93 +++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 75d73e546e..c9fd0118d0 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -13,6 +13,7 @@ #include "Time.hpp" #include "GCode.hpp" #include "BeltGCode.hpp" +#include "BeltTransform.hpp" #include "GCode/WipeTower.hpp" #include "GCode/WipeTower2.hpp" #include "Utils.hpp" @@ -1430,57 +1431,57 @@ StringObjectException Print::validate(std::vector *warnin return profile; }; - // Checks that the print does not exceed the max print height + // Checks that the print does not exceed the max print height. + // For belt printers the slicing-frame Z spans the sheared X-length and + // is not comparable to printable_height (which is gantry clearance in the + // build-volume frame). Compare against the model's pre-shear Z instead, + // mirroring the bbox computed in PrintObject::update_slicing_parameters. + const bool belt_printer = this->config().belt_printer.value; + const double shrinkage_compensation_z = this->shrinkage_compensation().z(); for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx) { const PrintObject &print_object = *m_objects[print_object_idx]; - // Belt printer: the sliced (virtual) Z is belt travel along the conveyor, not - // build height, so the loop below (which measures the sliced layer stack) is - // meaningless here. The real ceiling is the usable vertical clearance above the - // belt, which printable_height holds directly: the gantry travels up the tilted - // plane, so a part of height z needs gantry reach z / cos(tilt), and the machine's - // gantry-axis range is sized to accommodate that (e.g. IdeaFormer IR3 V2: ~354 mm - // of gantry travel = 250 mm vertical at 45°, and printable_height = 250). So compare - // the upright object height against printable_height directly. - if (m_config.belt_printer.value) { - const double max_h = m_config.printable_height.value; - double obj_top = 0.0; - const ModelObject *mo = print_object.model_object(); - for (const ModelInstance *mi : mo->instances) - obj_top = std::max(obj_top, mo->instance_bounding_box(*mi).max.z()); - if (obj_top > max_h + EPSILON) - return StringObjectException{ - Slic3r::format(_u8L("The object %1% exceeds the maximum printable height " - "above the belt (%2% mm)."), - print_object.model_object()->name, max_h), - print_object.model_object(), "" }; - continue; - } - //FIXME It is quite expensive to generate object layers just to get the print height! - if (auto layers = generate_object_layers(print_object.slicing_parameters(), layer_height_profile(print_object_idx), print_object.config().precise_z_height.value); - !layers.empty()) { - Vec3d test =this->shrinkage_compensation(); - const double shrinkage_compensation_z = this->shrinkage_compensation().z(); - - if (shrinkage_compensation_z != 1. && layers.back() > (this->config().printable_height / shrinkage_compensation_z + EPSILON)) { - // The object exceeds the maximum build volume height because of shrinkage compensation. - return StringObjectException{ - Slic3r::format(_u8L("While the object %1% itself fits the build volume, it exceeds the maximum build volume height because of material shrinkage compensation."), print_object.model_object()->name), - print_object.model_object(), - "" - }; - } else if (layers.back() > this->config().printable_height + EPSILON) { - // Test whether the last slicing plane is below or above the print volume. - return StringObjectException{ - 0.5 * (layers[layers.size() - 2] + layers.back()) > this->config().printable_height + EPSILON ? - Slic3r::format(_u8L("The object %1% exceeds the maximum build volume height."), print_object.model_object()->name) : - Slic3r::format(_u8L("While the object %1% itself fits the build volume, its last layer exceeds the maximum build volume height."), print_object.model_object()->name) + - " " + _u8L("You might want to reduce the size of your model or change current print settings and retry."), - print_object.model_object(), - "" - }; + double effective_max_z = 0; + bool last_layer_below_max = false; + bool have_height = false; + + if (belt_printer) { + double raw_z = print_object.model_object()->max_z(); + if (BeltTransformPipeline::has_preslice_remap(this->config())) + raw_z = BeltTransformPipeline::remap_bbox(*print_object.model_object(), this->config()).size().z(); + effective_max_z = raw_z; + have_height = raw_z > 0; + } else { + //FIXME It is quite expensive to generate object layers just to get the print height! + auto layers = generate_object_layers(print_object.slicing_parameters(), layer_height_profile(print_object_idx), print_object.config().precise_z_height.value); + if (!layers.empty()) { + effective_max_z = layers.back(); + last_layer_below_max = layers.size() >= 2 && + 0.5 * (layers[layers.size() - 2] + layers.back()) <= this->config().printable_height + EPSILON; + have_height = true; } } + + if (!have_height) + continue; + + if (shrinkage_compensation_z != 1. && effective_max_z > (this->config().printable_height / shrinkage_compensation_z + EPSILON)) { + // The object exceeds the maximum build volume height because of shrinkage compensation. + return StringObjectException{ + Slic3r::format(_u8L("While the object %1% itself fits the build volume, it exceeds the maximum build volume height because of material shrinkage compensation."), print_object.model_object()->name), + print_object.model_object(), + "" + }; + } else if (effective_max_z > this->config().printable_height + EPSILON) { + return StringObjectException{ + last_layer_below_max ? + Slic3r::format(_u8L("While the object %1% itself fits the build volume, its last layer exceeds the maximum build volume height."), print_object.model_object()->name) + + " " + _u8L("You might want to reduce the size of your model or change current print settings and retry.") : + Slic3r::format(_u8L("The object %1% exceeds the maximum build volume height."), print_object.model_object()->name), + print_object.model_object(), + "" + }; + } } // Some of the objects has variable layer height applied by painting or by a table. From 0342e06d87c516a6d68fdaf81ef5e3a4dd233645 Mon Sep 17 00:00:00 2001 From: HarrierPigeon Date: Tue, 26 May 2026 03:46:32 -0600 Subject: [PATCH 066/389] last step in fixing the g-code stuff up --- src/libslic3r/GCode/GCodeProcessor.cpp | 2 ++ src/libslic3r/GCode/GCodeProcessor.hpp | 6 ++++++ src/libslic3r/Print.cpp | 11 ++++++++++- src/slic3r/GUI/GCodeViewer.cpp | 2 ++ src/slic3r/GUI/GCodeViewer.hpp | 2 ++ src/slic3r/GUI/GLCanvas3D.cpp | 6 +++++- 6 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index bc84963da0..9cad57e693 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2530,6 +2530,7 @@ void GCodeProcessorResult::reset() { long_retraction_when_cut = false; timelapse_warning_code = 0; printable_height = 0.0f; + machine_frame_transform_active = false; settings_ids.reset(); filaments_count = 0; backtrace_enabled = false; @@ -3061,6 +3062,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config) // multi-extruder validator can undo it and compare against build-volume // bounds rather than machine-frame positions. m_machine_frame_transform.init_from_config(config); + m_result.machine_frame_transform_active = m_machine_frame_transform.is_active(); auto filament_maps = config.option("filament_map"); if (filament_maps != nullptr) { diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 63f38bf5ef..7b90840ad2 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -285,6 +285,11 @@ class Print; // as gcode_Z + this offset, so the designed-view back-transform must subtract it // to recover the model's belt coordinate. float belt_z_origin{ 0.f }; + // Belt printer: post-gcode shear/scale/post_remap is configured and + // non-identity. When set, the layer Z values in `moves` are in the + // machine frame and should not be compared against `printable_height` + // (which lives in the build-volume frame). + bool machine_frame_transform_active{ false }; RemapAxis preslice_remap_x{ RemapAxis::PosX }; RemapAxis preslice_remap_y{ RemapAxis::PosY }; RemapAxis preslice_remap_z{ RemapAxis::PosZ }; @@ -377,6 +382,7 @@ class Print; initial_layer_time = other.initial_layer_time; belt_tilt_angle = other.belt_tilt_angle; belt_z_origin = other.belt_z_origin; + machine_frame_transform_active = other.machine_frame_transform_active; preslice_remap_x = other.preslice_remap_x; preslice_remap_y = other.preslice_remap_y; preslice_remap_z = other.preslice_remap_z; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index c9fd0118d0..ba28f96804 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -14,6 +14,7 @@ #include "GCode.hpp" #include "BeltGCode.hpp" #include "BeltTransform.hpp" +#include "GCode/MachineFrameTransform.hpp" #include "GCode/WipeTower.hpp" #include "GCode/WipeTower2.hpp" #include "Utils.hpp" @@ -1436,9 +1437,17 @@ StringObjectException Print::validate(std::vector *warnin // is not comparable to printable_height (which is gantry clearance in the // build-volume frame). Compare against the model's pre-shear Z instead, // mirroring the bbox computed in PrintObject::update_slicing_parameters. + // When the post-gcode MachineFrameTransform is active the printer's + // physical Z mapping is non-trivial — skip the check entirely. const bool belt_printer = this->config().belt_printer.value; + bool skip_max_height_check = false; + if (belt_printer) { + MachineFrameTransform machine_frame; + machine_frame.init_from_config(this->config()); + skip_max_height_check = machine_frame.is_active(); + } const double shrinkage_compensation_z = this->shrinkage_compensation().z(); - for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx) { + for (size_t print_object_idx = 0; !skip_max_height_check && print_object_idx < m_objects.size(); ++ print_object_idx) { const PrintObject &print_object = *m_objects[print_object_idx]; double effective_max_z = 0; diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index a034f3dce8..42a4f6b9fb 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1521,6 +1521,7 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const m_custom_gcode_per_print_z = gcode_result.custom_gcode_per_print_z; m_max_print_height = gcode_result.printable_height; + m_machine_frame_transform_active = gcode_result.machine_frame_transform_active; m_z_offset = gcode_result.z_offset; @@ -1736,6 +1737,7 @@ void GCodeViewer::reset() m_paths_bounding_box = BoundingBoxf3(); m_max_bounding_box = BoundingBoxf3(); m_max_print_height = 0.0f; + m_machine_frame_transform_active = false; m_z_offset = 0.0f; m_extruders_count = 0; m_filament_diameters = std::vector(); diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index 66d9cbb444..9ee680d889 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -203,6 +203,7 @@ private: //BBS: add shell bounding box BoundingBoxf3 m_shell_bounding_box; float m_max_print_height{ 0.0f }; + bool m_machine_frame_transform_active{ false }; float m_z_offset{ 0.0f }; ConfigOptionMode m_user_mode; @@ -289,6 +290,7 @@ public: std::vector get_plater_extruder(); const float get_max_print_height() const { return m_max_print_height; } + bool is_machine_frame_transform_active() const { return m_machine_frame_transform_active; } const BoundingBoxf3& get_paths_bounding_box() const { return m_paths_bounding_box; } const BoundingBoxf3& get_max_bounding_box() const { return m_max_bounding_box; } const BoundingBoxf3& get_shell_bounding_box() const { return m_shell_bounding_box; } diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 3345a88386..e3e84bc1c7 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -10315,7 +10315,11 @@ void GLCanvas3D::_set_warning_notification_if_needed(EWarning warning) if (current_printer_technology() != ptSLA) { unsigned int max_z_layer = m_gcode_viewer.get_layers_z_range().back(); if (warning == EWarning::ToolHeightOutside) // check if max z_layer height exceed max print height - show = m_gcode_viewer.has_data() && (m_gcode_viewer.get_layers_zs()[max_z_layer] - m_gcode_viewer.get_max_print_height() >= 1e-6); + // Belt printer with active post-gcode machine-frame transform: layer Z values + // live in the machine frame, not the build-volume frame, so the comparison + // against printable_height is meaningless. Suppress the warning entirely. + show = m_gcode_viewer.has_data() && !m_gcode_viewer.is_machine_frame_transform_active() + && (m_gcode_viewer.get_layers_zs()[max_z_layer] - m_gcode_viewer.get_max_print_height() >= 1e-6); else if (warning == EWarning::ToolpathOutside) { // check if max x,y coords exceed bed area show = m_gcode_viewer.has_data() && !m_gcode_viewer.is_contained_in_bed() && (m_gcode_viewer.get_max_print_height() -m_gcode_viewer.get_layers_zs()[max_z_layer] >= 1e-6); From 04554abae62e0e7f5b77ab74dd9a56385d55a46d Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 27 Jun 2026 01:47:20 -0500 Subject: [PATCH 067/389] Fix belt printer illegal gantry move at print start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On a belt printer the first travel of the print emitted a bogus move to the bed corner with the nozzle far up the gantry, e.g. G1 X95 Y168.19 Z237.857 F12000 right after the first "; printing object" line. Y168 (≈ the layer Z) is out of the gantry's range. Root cause: the layer-change z-hop is deferred via lazy_lift and consumed by the first BeltGCodeWriter::travel_to_xyz, whose NormalLift branch does a separate lift-in-place via _travel_to_z(target.z()). On a normal printer _travel_to_z emits a Z-only move, but in belt mode Z is coupled to Y/X, so _travel_to_z re-emits the current m_pos through the belt shear. At print start (and after custom gcode) m_pos.xy is still the uninitialised origin (0,0), which the back-transform + axis-remap shear into machine (X=bed_max, Y=layer_z) — the illegal move. Guard the NormalLift branch on is_current_position_clear(), matching the SlopeLift branch directly above it which already does so. When the position isn't established there is nothing to lift over, and the xy_z_move that follows travels straight to the destination with full XYZ, establishing the correct position. Bookkeeping is unaffected: in this path m_lifted stays 0, so no spurious restore move is produced. Verified by re-slicing the repro project: the start-of-print move is now G1 X44.946 Y.621 Z237.857 (straight to the first object point), no move touches the bed-max X edge, and the max Y over the whole file is 62.8mm (printable_height 100). --- src/libslic3r/BeltGCodeWriter.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index f46b1f2c35..e1dad4177f 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -217,7 +217,17 @@ std::string BeltGCodeWriter::travel_to_xyz(const Vec3d &point, const std::string w0.emit_comment(GCodeWriter::full_gcode_comment, comment); slop_move = w0.string(); } - else if (m_to_lift_type == LiftType::NormalLift) { + else if (m_to_lift_type == LiftType::NormalLift && this->is_current_position_clear()) { + // Only lift-in-place when the current position is known. On a normal + // printer _travel_to_z emits a Z-only move, but in belt mode Z is coupled + // to Y/X, so _travel_to_z re-emits the current m_pos through the belt + // shear. At print start (and after custom gcode) m_pos.xy is still the + // uninitialised origin (0,0), which shears into a bogus machine point + // (e.g. X=bed_max, Y=layer_z) far up the gantry. Skipping the separate + // lift here is safe: there is nothing to lift over yet, and the + // xy_z_move below travels straight to the destination with full XYZ, + // establishing the correct position. This mirrors the SlopeLift branch + // above, which already guards on is_current_position_clear(). slop_move = _travel_to_z(target.z(), "normal lift Z"); } } From 02e313a115f3ad18cc58e4b76e3b0d7f0077d443 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 27 Jun 2026 17:50:49 -0500 Subject: [PATCH 068/389] Add belt-printer regression test for start-of-print gantry move MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Locks in the fix from the previous commit. A fresh BeltGCodeWriter has an unestablished planar position (is_current_position_clear() == false) and its m_pos.xy is the origin (0,0). With a pending NormalLift z-hop, travel_to_xyz used to lift in place via _travel_to_z(), which in belt mode shears the origin into a machine Y ~= the layer Z — a move far up the gantry. The test configures an X-tilt 45 deg belt transform, defers a z-hop via lazy_lift, travels to a near-belt first point (transformed gantry Y ~= 1mm), and asserts no emitted move has Y anywhere near the layer Z. Verified to fail without the fix (max emitted Y = 100.0 vs the destination's ~1.0) and pass with it. --- tests/fff_print/test_gcodewriter.cpp | 73 ++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/tests/fff_print/test_gcodewriter.cpp b/tests/fff_print/test_gcodewriter.cpp index b09b38e794..b2a11becbc 100644 --- a/tests/fff_print/test_gcodewriter.cpp +++ b/tests/fff_print/test_gcodewriter.cpp @@ -15,6 +15,11 @@ #include #include "test_helpers.hpp" +#include +#include +#include "libslic3r/BeltGCodeWriter.hpp" +#include "libslic3r/GCodeReader.hpp" +#include "libslic3r/PrintConfig.hpp" using namespace Slic3r; using namespace Slic3r::Test; @@ -847,3 +852,71 @@ TEST_CASE("Custom G-code motion limits are restored before generated moves", "[G REQUIRE(gcode.find("M204 S6000 ; adjust acceleration", custom_gcode_pos) != std::string::npos); REQUIRE(gcode.find("M205 X8 Y8 ; adjust jerk", custom_gcode_pos) != std::string::npos); } + +// Regression test for the belt-printer "illegal gantry move at print start" bug. +// +// On a belt printer the layer-change z-hop is deferred (lazy_lift) and consumed +// by the first travel_to_xyz, whose NormalLift branch lifts in place via +// _travel_to_z(). On a normal printer _travel_to_z emits a Z-only move, but in +// belt mode Z is coupled to Y/X, so _travel_to_z re-emits the current m_pos +// through the belt shear. At print start (and after custom gcode) +// is_current_position_clear() is false and m_pos.xy is still the uninitialised +// origin (0,0), which shears into machine (X=bed_max, Y=layer_z) — a move far up +// the gantry, e.g. "G1 X95 Y168.19 Z237.857". The fix guards that lift on +// is_current_position_clear(), mirroring the SlopeLift branch. +SCENARIO("Belt: the first travel does not lift through the uninitialised origin", "[GCodeWriter][belt]") +{ + GIVEN("A fresh BeltGCodeWriter configured for an X-tilt 45 degree belt") { + // Machine-frame + slicer->world back-transform config (X tilt, 45 deg). + PrintConfig belt_config; + belt_config.belt_printer.value = true; + belt_config.gcode_back_transform.value = true; + belt_config.belt_slice_rotation.value = BeltRotationAxis::X; + belt_config.belt_slice_rotation_angle.value = 45.0; + belt_config.belt_slice_rotation_global.value = true; + belt_config.belt_preslice_global.value = true; + belt_config.belt_frame_tilt_decouple.value = false; + belt_config.belt_frame_tilt_angle.value = 45.0; + + BeltGCodeWriter writer; + writer.set_machine_frame_transform(belt_config); + writer.set_belt_back_transform(belt_config); + + std::vector extruder_ids { 0 }; + writer.set_extruders(extruder_ids); + writer.set_extruder(0); + writer.config.travel_speed.value = 100.0; + writer.config.z_hop.values = { 0.4 }; + writer.config.retract_lift_above.values = { 0.0 }; + writer.config.retract_lift_below.values = { 0.0 }; + + // A fresh writer has not established its planar position yet — this is the + // precondition that made the origin leak into the first move. + REQUIRE_FALSE(writer.is_current_position_clear()); + + WHEN("a layer-change z-hop is pending and we travel to the first object point") { + // Defer a z-hop, exactly as a retract on layer change leaves it. + writer.lazy_lift(LiftType::NormalLift); + + // First object point in slicing coordinates: a near-belt point (y ~= -z) + // so its transformed gantry Y is small (~1mm). The bogus origin lift, in + // contrast, would shear to machine Y ~= nominal_z. + const double nominal_z = 100.0; + std::string gcode = writer.travel_to_xyz(Vec3d(10.0, -(nominal_z - 1.0), nominal_z)); + + THEN("no emitted move flies up the gantry; machine Y stays near the part") { + double max_y = std::numeric_limits::lowest(); + GCodeReader reader; + reader.parse_buffer(gcode, [&max_y](GCodeReader &, const GCodeReader::GCodeLine &line) { + if (line.cmd_is("G1") && line.has(Y)) + max_y = std::max(max_y, double(line.y())); + }); + // The destination shears to machine Y ~= 1mm. The old origin-lift bug + // produced a separate move at machine Y ~= nominal_z (100mm), so any + // Y well above the part means the origin leaked into a move. + REQUIRE(max_y > 0.0); // the destination move was emitted and parsed + REQUIRE(max_y < 10.0); // ... and nothing flew up the gantry + } + } + } +} From a83cd8aa296e5415311515ceb7b5b3ddedea4903 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Mon, 29 Jun 2026 02:58:58 -0500 Subject: [PATCH 069/389] Fix belt printer phantom extrusion line from Y=0 in preview On a belt printer the sliced preview drew a stray extrusion-colored line from Y~=0 to the model, rendered in the first extrusion role's color. It is not a travel and does not occur on non-belt printers. GCodeProcessor::store_move_vertex pins a move's stored Z to the first-layer height during the start-G-code "prepare" stage. That is a harmless cosmetic tidy-up on a normal printer, but on a belt printer the designed-view back-transform couples machine Z into the rendered model Y (the belt tilt mixes the height and belt-feed axes). Pinning Z back-transforms the last prepare-stage move (the unretract before the first extrusion) to model Y ~= 0, and libvgcode then draws a phantom extrusion segment from Y ~= 0 to the first real toolpath. Keep the real Z for belt printers (gated on belt_tilt_angle, parsed from the G-code header before the body) so prepare-stage moves back-transform correctly. Non-belt processing is byte-identical. The emitted G-code was already correct; this is a preview-geometry fix. --- src/libslic3r/GCode/GCodeProcessor.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 9cad57e693..43536c30b9 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -7067,6 +7067,22 @@ void GCodeProcessor::store_move_vertex(EMoveType type, EMovePathType path_type, m_result.print_statistics.total_travel_distance += m_travel_dist; } + // During the start G-code "prepare" stage the toolhead Z is not yet a real + // print height on a normal printer, so it is pinned to the first-layer height + // to keep the preview tidy. Belt printers are the exception: there the Z is + // written explicitly by BeltGCodeWriter and the designed-view back-transform + // couples machine Z into the rendered model Y (the belt tilt mixes the height + // and belt-feed axes). Overriding Z therefore back-transforms the last + // prepare-stage move (the unretract before the first extrusion) to model + // Y ~= 0, and the libvgcode path builder then draws a phantom extrusion + // segment from Y ~= 0 to the first real toolpath. Keep the real Z for belt + // printers so prepare-stage moves map correctly. Gated on belt_tilt_angle (set + // from the G-code header before the body is processed) so non-belt processing + // is byte-identical. + const float store_z = (m_processing_start_custom_gcode && m_result.belt_tilt_angle == 0.f) + ? m_first_layer_height + : m_end_position[Z] - m_z_offset; + m_result.moves.push_back({ m_last_line_id, type, @@ -7074,7 +7090,7 @@ void GCodeProcessor::store_move_vertex(EMoveType type, EMovePathType path_type, static_cast(filament_id), m_cp_color.current, //BBS: add plate's offset to the rendering vertices - Vec3f(m_end_position[X] + m_x_offset, m_end_position[Y] + m_y_offset, m_processing_start_custom_gcode ? m_first_layer_height : m_end_position[Z]- m_z_offset) + m_extruder_offsets[filament_id], + Vec3f(m_end_position[X] + m_x_offset, m_end_position[Y] + m_y_offset, store_z) + m_extruder_offsets[filament_id], static_cast(m_end_position[E] - m_start_position[E]), m_feedrate, 0.0f, // actual feedrate From 613dad92a13cfcdaa9df326d5bacb32941041ba7 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Mon, 29 Jun 2026 02:59:07 -0500 Subject: [PATCH 070/389] Add belt-printer regression test for prepare-stage move Z Processes a minimal belt start sequence through GCodeProcessor::process_buffer and asserts the move preceding the first extrusion keeps its real Z, so it can no longer back-transform to model Y~=0 and produce the phantom extrusion line. Belt printers are non-Bambu, so the processor uses the compatible reserved tags ("TYPE:"); the test sets s_IsBBLPrinter=false (saved/restored via an RAII guard) to mirror the real printer. Proven to fail without the fix (the prepare-stage move's Z is pinned to the first-layer height, 0 here) and pass with it. --- tests/fff_print/test_gcodewriter.cpp | 79 +++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/tests/fff_print/test_gcodewriter.cpp b/tests/fff_print/test_gcodewriter.cpp index b2a11becbc..6af11d8d23 100644 --- a/tests/fff_print/test_gcodewriter.cpp +++ b/tests/fff_print/test_gcodewriter.cpp @@ -15,6 +15,8 @@ #include #include "test_helpers.hpp" +#include +#include "libslic3r/GCode/GCodeProcessor.hpp" #include #include #include "libslic3r/BeltGCodeWriter.hpp" @@ -885,7 +887,8 @@ SCENARIO("Belt: the first travel does not lift through the uninitialised origin" std::vector extruder_ids { 0 }; writer.set_extruders(extruder_ids); writer.set_extruder(0); - writer.config.travel_speed.value = 100.0; + // travel_speed became per-extruder (ConfigOptionFloatsNullable) upstream. + writer.config.travel_speed.values = { 100.0 }; writer.config.z_hop.values = { 0.4 }; writer.config.retract_lift_above.values = { 0.0 }; writer.config.retract_lift_below.values = { 0.0 }; @@ -920,3 +923,77 @@ SCENARIO("Belt: the first travel does not lift through the uninitialised origin" } } } + +// Regression test for the belt-printer "phantom extrusion line from Y=0" bug. +// +// GCodeProcessor::store_move_vertex pins a move's stored Z to the first-layer +// height while m_processing_start_custom_gcode is set (the start G-code "prepare" +// stage), because on a normal printer the toolhead Z there is not yet a real print +// height. On a belt printer that override is wrong: Z is written explicitly and the +// designed-view back-transform couples machine Z into the rendered model Y (the +// belt tilt mixes the height and belt-feed axes). Overriding it back-transforms the +// last prepare-stage move (the unretract right before the first extrusion) to +// model Y ~= 0, and libvgcode then draws a phantom extrusion segment from Y ~= 0 to +// the first real toolpath — rendered in the first extrusion role's color. The fix +// keeps the real Z for belt printers (gated on belt_tilt_angle). Here we assert the +// prepare-stage move keeps its real Z so it can no longer leak to Y ~= 0. +SCENARIO("Belt: start-gcode prepare-stage moves keep their real Z", "[GCode][belt]") +{ + // Belt printers are non-Bambu, so the G-code uses the "compatible" reserved + // tags ("TYPE:" for the extrusion role). The processor selects the tag table + // from the static s_IsBBLPrinter flag, so mirror the belt-printer setting here + // (saved/restored so test ordering stays unaffected). + struct BBLPrinterGuard { + bool prev = GCodeProcessor::s_IsBBLPrinter; + BBLPrinterGuard() { GCodeProcessor::s_IsBBLPrinter = false; } + ~BBLPrinterGuard() { GCodeProcessor::s_IsBBLPrinter = prev; } + } bbl_guard; + + GIVEN("A belt G-code whose start sequence travels to a high machine Z before the first extrusion") { + // The leading "; belt_slice_rotation_angle = 45" header sets belt_tilt_angle + // (parsed before the body), enabling the belt code path. ;TYPE:Custom before + // any G1 turns on the prepare stage; ;TYPE:Outer wall turns it off, exactly + // as a sliced belt print is laid out. + const std::string gcode = + "; belt_slice_rotation_angle = 45\n" + "G90\n" + "G21\n" + "M83\n" + ";TYPE:Custom\n" + "G1 E-1.5 F2100\n" // retract at the (0,0,0) origin + "G1 X45 Y0.3 Z50 F12000\n" // travel to the approach point (prepare stage) + "G1 E1.5 F1800\n" // unretract in place (prepare stage) + ";TYPE:Outer wall\n" + "G1 X46 Y0.3 Z50 E0.05\n"; // first extrusion, same Z as the approach + + GCodeProcessor processor; + processor.process_buffer(gcode); + const GCodeProcessorResult& result = processor.get_result(); + + THEN("the belt code path is active") { + REQUIRE_THAT(result.belt_tilt_angle, Catch::Matchers::WithinAbs(45.0, 1e-4)); + } + + WHEN("locating the first extrusion and the move that precedes it") { + size_t first_extrude = result.moves.size(); + for (size_t i = 0; i < result.moves.size(); ++i) + if (result.moves[i].type == EMoveType::Extrude) { first_extrude = i; break; } + + THEN("an extrusion and a preceding move exist") { + REQUIRE(first_extrude < result.moves.size()); + REQUIRE(first_extrude > 0); + } + + THEN("the preceding prepare-stage move shares the extrusion's real Z (no leak to Y=0)") { + const float extrude_z = result.moves[first_extrude].position.z(); + const float prev_z = result.moves[first_extrude - 1].position.z(); + // The first extrusion is at the real Z=50; before the fix the + // prepare-stage move's Z was pinned to the first-layer height + // (0 here) instead, which back-transforms to model Y ~= 0 and + // produces the phantom extrusion segment. + REQUIRE_THAT(extrude_z, Catch::Matchers::WithinAbs(50.0, 1e-3)); + REQUIRE_THAT(prev_z, Catch::Matchers::WithinAbs(50.0, 1e-3)); + } + } + } +} From f563df04f674ec01caeec25a4e807596e53232c9 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Mon, 3 Aug 2026 01:52:43 -0500 Subject: [PATCH 071/389] belt: default first_layer_plane to Auto, not BeltAffine BeltAffine activates the FirstLayerPlane evaluator unconditionally, so on a non-belt printer on_first_layer(point) stopped agreeing with the legacy slicing-layer-0 test. Every per-path first-layer call site in _extrude then took the non-first-layer branch, and first-layer speeds were skipped: brim came out at the volumetric fallback (24.6 mm/s) instead of initial_layer_speed (10 mm/s). This is the shared speed path, so it affected all printers on this branch, not just belt ones. Auto resolves to BeltAffine only when belt_printer is set with a non-zero slicing rotation, and to XY (evaluator inactive, legacy behaviour) otherwise -- exactly what the option's own description already promised. Caught by "Brim uses first layer speed" (upstream #14616), which arrived with the upstream merge; the bad default dates back to a9bae54f20 (#30). Verified against a pristine upstream/main build, which passes the same test. tests/fff_print: 100/100 test cases, 1085 assertions (was 99/100). Both belt regression tests still pass, confirming Auto still resolves to BeltAffine for belt printers. Note: this changes a config default. Projects and profiles that stored first_layer_plane explicitly are unaffected; those relying on the default will now get correct first-layer speeds on non-belt printers, so their G-code changes accordingly. --- src/libslic3r/PrintConfig.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 2b513afe1d..b2984164ee 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -7209,7 +7209,13 @@ void PrintConfigDef::init_fff_params() def->enum_values = {"auto", "xy", "yz", "xz", "belt_affine"}; def->enum_labels = {L("Auto"), L("XY (machine bed)"), L("YZ"), L("XZ"), L("Belt affine plane")}; def->mode = comExpert; - def->set_default_value(new ConfigOptionEnum(FirstLayerPlaneMode::BeltAffine)); + // Auto, not BeltAffine: BeltAffine activates the plane evaluator unconditionally, so on a + // non-belt printer on_first_layer(point) stopped agreeing with the legacy slicing-layer-0 + // test and first-layer speeds were skipped (brim printed at the volumetric fallback rather + // than initial_layer_speed). Auto resolves to BeltAffine only when belt_printer is set with + // a non-zero slicing rotation, and to XY (evaluator inactive, legacy behaviour) otherwise -- + // which is what this option's own description promises. + def->set_default_value(new ConfigOptionEnum(FirstLayerPlaneMode::Auto)); def = this->add("first_layer_plane_offset", coFloat); def->label = L("Belt plane offset"); From 725df641086532a61dcd20648ef862187934961b Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Tue, 4 Aug 2026 17:00:49 -0500 Subject: [PATCH 072/389] profiles: fix belt printer CI failures (slice check + setting_id) The belt-printer branch is failing two profile gates. Both stem from the three belt-only vendors (Custom's generic belt printer, IdeaFormer, Printcepts) not existing upstream, so upstream maintenance passed them by. Slice check: 4 of 1015 printers failed - Custom's MyBeltPrinter 0.2/0.4/ 0.6/0.8 nozzle all fell back to "Default Setting". No process profile in the Custom vendor listed any MyBeltPrinter in compatible_printers, and Custom's fdm_belt_common pointed default_print_profile at "0.20mm Standard @System", which does not exist in that vendor's index, so the generic belt printer had no usable process at all. This gap dates to when MyBeltPrinter was added (2026-04-07); it only started failing now because the slice-check job is newer than that. Adds two process profiles modelled on the sibling @MyKlipper ones: - 0.20mm Standard @MyBeltPrinter - 0.4/0.6/0.8 nozzles - 0.12mm Fine @MyBeltPrinter - 0.2/0.4 nozzles The split is forced by hardware: the 0.2 nozzle preset caps max_layer_height at 0.16, so a single 0.20mm profile cannot legally cover it. fdm_belt_common now defaults to the standard profile and the 0.2 nozzle preset overrides to the fine one. setting_id: 14 files failed the rules introduced in #14432. That migration renumbered 7425 files across 61 vendors but skipped these three, leaving BabyBelt Pro, IdeaFormer IR3 V2 and MyBeltPrinter squatting the "G*" id space reserved for Bambu (GMPC0BBP01, GMIF001, GM_BELT_00x) and four instantiated filament/process presets carrying no setting_id at all. Regenerated with scripts/assign_vendor_setting_ids.py. Also repoints the identical dangling "0.20mm Standard @System" in Printcepts' and IdeaFormer's fdm_belt_common at their own real process profiles. That is a no-op today because both concrete printers override it, but it is the same landmine that took out MyBeltPrinter. Vendor index versions bumped so check_installed_vendor_profiles() will re-install the corrected profiles over an existing install. Note: changing a shipped preset's setting_id can orphan user presets that reference it as base_id. #14432 accepted that tradeoff for 61 vendors; this keeps these three consistent with the rest. Verified: orca_extra_profile_check.py reports 0 errors across 66 vendors (was 14 files with errors), and OrcaSlicer_profile_validator -s slices all 1015 printer presets successfully (was 4 failures). --- resources/profiles/Custom.json | 10 +++++++++- .../machine/MyBeltPrinter 0.2 nozzle.json | 3 ++- .../machine/MyBeltPrinter 0.4 nozzle.json | 2 +- .../machine/MyBeltPrinter 0.6 nozzle.json | 2 +- .../machine/MyBeltPrinter 0.8 nozzle.json | 2 +- .../Custom/machine/fdm_belt_common.json | 2 +- .../process/0.12mm Fine @MyBeltPrinter.json | 20 +++++++++++++++++++ .../0.20mm Standard @MyBeltPrinter.json | 17 ++++++++++++++++ resources/profiles/IdeaFormer.json | 2 +- .../Generic PETG @IdeaFormer IR3 V2.json | 1 + .../Generic PLA @IdeaFormer IR3 V2.json | 1 + .../filament/eSUN PLA @IdeaFormer IR3 V2.json | 1 + .../machine/IdeaFormer IR3 V2 0.4 nozzle.json | 2 +- .../IdeaFormer/machine/fdm_belt_common.json | 2 +- .../0.20mm Standard @IdeaFormer IR3 V2.json | 1 + resources/profiles/Printcepts.json | 2 +- .../filament/Generic PETG @BabyBelt Pro.json | 1 + .../filament/Generic PLA @BabyBelt Pro.json | 1 + .../filament/eSUN PLA @BabyBelt Pro.json | 1 + .../machine/BabyBelt Pro 0.4 nozzle.json | 2 +- .../Printcepts/machine/fdm_belt_common.json | 2 +- .../0.20mm Standard @BabyBelt Pro.json | 1 + 22 files changed, 66 insertions(+), 12 deletions(-) create mode 100644 resources/profiles/Custom/process/0.12mm Fine @MyBeltPrinter.json create mode 100644 resources/profiles/Custom/process/0.20mm Standard @MyBeltPrinter.json diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index ba1ddc14f4..9030b881e3 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,6 +1,6 @@ { "name": "Custom Printer", - "version": "02.04.00.03", + "version": "02.04.00.04", "force_update": "0", "description": "My configurations", "machine_model_list": [ @@ -66,6 +66,14 @@ "name": "0.16mm Optimal @MyKlipper", "sub_path": "process/0.16mm Optimal @MyKlipper.json" }, + { + "name": "0.12mm Fine @MyBeltPrinter", + "sub_path": "process/0.12mm Fine @MyBeltPrinter.json" + }, + { + "name": "0.20mm Standard @MyBeltPrinter", + "sub_path": "process/0.20mm Standard @MyBeltPrinter.json" + }, { "name": "0.20mm Standard @MyKlipper", "sub_path": "process/0.20mm Standard @MyKlipper.json" diff --git a/resources/profiles/Custom/machine/MyBeltPrinter 0.2 nozzle.json b/resources/profiles/Custom/machine/MyBeltPrinter 0.2 nozzle.json index 5e7655fbe1..1226f4dd68 100644 --- a/resources/profiles/Custom/machine/MyBeltPrinter 0.2 nozzle.json +++ b/resources/profiles/Custom/machine/MyBeltPrinter 0.2 nozzle.json @@ -3,9 +3,10 @@ "name": "MyBeltPrinter 0.2 nozzle", "inherits": "fdm_belt_common", "from": "system", - "setting_id": "GM_BELT_001", + "setting_id": "3w1uyJdmm14QhDnH", "instantiation": "true", "printer_model": "Generic Belt Printer", + "default_print_profile": "0.12mm Fine @MyBeltPrinter", "nozzle_diameter": [ "0.2" ], diff --git a/resources/profiles/Custom/machine/MyBeltPrinter 0.4 nozzle.json b/resources/profiles/Custom/machine/MyBeltPrinter 0.4 nozzle.json index 73be69ba61..e8149509ca 100644 --- a/resources/profiles/Custom/machine/MyBeltPrinter 0.4 nozzle.json +++ b/resources/profiles/Custom/machine/MyBeltPrinter 0.4 nozzle.json @@ -3,7 +3,7 @@ "name": "MyBeltPrinter 0.4 nozzle", "inherits": "fdm_belt_common", "from": "system", - "setting_id": "GM_BELT_002", + "setting_id": "6nRHUtvJOUffocbu", "instantiation": "true", "printer_model": "Generic Belt Printer", "nozzle_diameter": [ diff --git a/resources/profiles/Custom/machine/MyBeltPrinter 0.6 nozzle.json b/resources/profiles/Custom/machine/MyBeltPrinter 0.6 nozzle.json index 49646db06d..b8ca999dca 100644 --- a/resources/profiles/Custom/machine/MyBeltPrinter 0.6 nozzle.json +++ b/resources/profiles/Custom/machine/MyBeltPrinter 0.6 nozzle.json @@ -3,7 +3,7 @@ "name": "MyBeltPrinter 0.6 nozzle", "inherits": "fdm_belt_common", "from": "system", - "setting_id": "GM_BELT_003", + "setting_id": "K0m9HbUNwKT4UCJV", "instantiation": "true", "printer_model": "Generic Belt Printer", "nozzle_diameter": [ diff --git a/resources/profiles/Custom/machine/MyBeltPrinter 0.8 nozzle.json b/resources/profiles/Custom/machine/MyBeltPrinter 0.8 nozzle.json index 412291754e..b546b5b288 100644 --- a/resources/profiles/Custom/machine/MyBeltPrinter 0.8 nozzle.json +++ b/resources/profiles/Custom/machine/MyBeltPrinter 0.8 nozzle.json @@ -3,7 +3,7 @@ "name": "MyBeltPrinter 0.8 nozzle", "inherits": "fdm_belt_common", "from": "system", - "setting_id": "GM_BELT_004", + "setting_id": "rHAweDz4eNwttPNA", "instantiation": "true", "printer_model": "Generic Belt Printer", "nozzle_diameter": [ diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index b010742d78..86245e7377 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -9,7 +9,7 @@ "default_filament_profile": [ "Generic PLA @System" ], - "default_print_profile": "0.20mm Standard @System", + "default_print_profile": "0.20mm Standard @MyBeltPrinter", "max_layer_height": [ "0.32" ], diff --git a/resources/profiles/Custom/process/0.12mm Fine @MyBeltPrinter.json b/resources/profiles/Custom/process/0.12mm Fine @MyBeltPrinter.json new file mode 100644 index 0000000000..15814e6725 --- /dev/null +++ b/resources/profiles/Custom/process/0.12mm Fine @MyBeltPrinter.json @@ -0,0 +1,20 @@ +{ + "type": "process", + "name": "0.12mm Fine @MyBeltPrinter", + "inherits": "fdm_process_klipper_common", + "from": "system", + "setting_id": "EugqqdLJ423bgEwN", + "instantiation": "true", + "layer_height": "0.12", + "initial_layer_print_height": "0.12", + "bottom_shell_layers": "5", + "top_shell_layers": "6", + "support_top_z_distance": "0.08", + "support_bottom_z_distance": "0.08", + "skirt_loops": "0", + "skirt_distance": "0", + "compatible_printers": [ + "MyBeltPrinter 0.2 nozzle", + "MyBeltPrinter 0.4 nozzle" + ] +} diff --git a/resources/profiles/Custom/process/0.20mm Standard @MyBeltPrinter.json b/resources/profiles/Custom/process/0.20mm Standard @MyBeltPrinter.json new file mode 100644 index 0000000000..6c10b250d6 --- /dev/null +++ b/resources/profiles/Custom/process/0.20mm Standard @MyBeltPrinter.json @@ -0,0 +1,17 @@ +{ + "type": "process", + "name": "0.20mm Standard @MyBeltPrinter", + "inherits": "fdm_process_klipper_common", + "from": "system", + "setting_id": "YzCDAgH3uLOM53pF", + "instantiation": "true", + "layer_height": "0.2", + "initial_layer_print_height": "0.2", + "skirt_loops": "0", + "skirt_distance": "0", + "compatible_printers": [ + "MyBeltPrinter 0.4 nozzle", + "MyBeltPrinter 0.6 nozzle", + "MyBeltPrinter 0.8 nozzle" + ] +} diff --git a/resources/profiles/IdeaFormer.json b/resources/profiles/IdeaFormer.json index a021e7c164..4a8519353b 100644 --- a/resources/profiles/IdeaFormer.json +++ b/resources/profiles/IdeaFormer.json @@ -1,6 +1,6 @@ { "name": "IdeaFormer", - "version": "02.00.00.02", + "version": "02.00.00.03", "force_update": "0", "description": "IdeaFormer belt printer configurations", "machine_model_list": [ diff --git a/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json index c51b20abbc..22ec0737d7 100644 --- a/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json @@ -3,6 +3,7 @@ "name": "Generic PETG @IdeaFormer IR3 V2", "inherits": "Generic PETG @System", "from": "system", + "setting_id": "n4zaXcUUzTqAxq5f", "instantiation": "true", "compatible_printers": [ "IdeaFormer IR3 V2 0.4 nozzle" diff --git a/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json index c86ba651da..74c2011bca 100644 --- a/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json @@ -3,6 +3,7 @@ "name": "Generic PLA @IdeaFormer IR3 V2", "inherits": "Generic PLA @System", "from": "system", + "setting_id": "1xjycsEAFh6KQIhp", "instantiation": "true", "compatible_printers": [ "IdeaFormer IR3 V2 0.4 nozzle" diff --git a/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json index d34131842a..7431aff5b1 100644 --- a/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json @@ -3,6 +3,7 @@ "name": "eSUN PLA @IdeaFormer IR3 V2", "inherits": "Generic PLA @IdeaFormer IR3 V2", "from": "system", + "setting_id": "XqkviBmFHEglXueX", "instantiation": "true", "compatible_printers": [ "IdeaFormer IR3 V2 0.4 nozzle" diff --git a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json index b6f128ca86..5f477ef0bb 100644 --- a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json +++ b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json @@ -3,7 +3,7 @@ "name": "IdeaFormer IR3 V2 0.4 nozzle", "inherits": "fdm_belt_common", "from": "system", - "setting_id": "GMIF001", + "setting_id": "MDQZgwRgg72lmjtu", "instantiation": "true", "printer_model": "IdeaFormer IR3 V2", "printer_variant": "0.4", diff --git a/resources/profiles/IdeaFormer/machine/fdm_belt_common.json b/resources/profiles/IdeaFormer/machine/fdm_belt_common.json index b010742d78..25daeb34a7 100644 --- a/resources/profiles/IdeaFormer/machine/fdm_belt_common.json +++ b/resources/profiles/IdeaFormer/machine/fdm_belt_common.json @@ -9,7 +9,7 @@ "default_filament_profile": [ "Generic PLA @System" ], - "default_print_profile": "0.20mm Standard @System", + "default_print_profile": "0.20mm Standard @IdeaFormer IR3 V2", "max_layer_height": [ "0.32" ], diff --git a/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json index b06b2e2192..c2e46e4154 100644 --- a/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/process/0.20mm Standard @IdeaFormer IR3 V2.json @@ -3,6 +3,7 @@ "name": "0.20mm Standard @IdeaFormer IR3 V2", "inherits": "fdm_process_common", "from": "system", + "setting_id": "91atcIwv5728phqX", "instantiation": "true", "layer_height": "0.2", "initial_layer_print_height": "0.2", diff --git a/resources/profiles/Printcepts.json b/resources/profiles/Printcepts.json index 3f2f47443f..61d418b8ab 100644 --- a/resources/profiles/Printcepts.json +++ b/resources/profiles/Printcepts.json @@ -1,6 +1,6 @@ { "name": "Printcepts", - "version": "01.00.00.00", + "version": "01.00.00.01", "force_update": "0", "description": "Printcepts belt printer configurations", "machine_model_list": [ diff --git a/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json index 026e6ab07d..939edbf233 100644 --- a/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json +++ b/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json @@ -3,6 +3,7 @@ "name": "Generic PETG @BabyBelt Pro", "inherits": "Generic PETG @System", "from": "system", + "setting_id": "gCzHpDNgVwQR6tgk", "instantiation": "true", "compatible_printers": [ "BabyBelt Pro 0.4 nozzle" diff --git a/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json index e89fb51e19..aa11e4c598 100644 --- a/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json +++ b/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json @@ -3,6 +3,7 @@ "name": "Generic PLA @BabyBelt Pro", "inherits": "Generic PLA @System", "from": "system", + "setting_id": "24PpcnhVx9v5f4fD", "instantiation": "true", "compatible_printers": [ "BabyBelt Pro 0.4 nozzle" diff --git a/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json index 30cf1a9a3a..7ab984eea7 100644 --- a/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json +++ b/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json @@ -3,6 +3,7 @@ "name": "eSUN PLA @BabyBelt Pro", "inherits": "Generic PLA @BabyBelt Pro", "from": "system", + "setting_id": "EH3X7oE0DU5tSpjW", "instantiation": "true", "compatible_printers": [ "BabyBelt Pro 0.4 nozzle" diff --git a/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json b/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json index 61b37d268b..620498e0d4 100644 --- a/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json +++ b/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json @@ -3,7 +3,7 @@ "name": "BabyBelt Pro 0.4 nozzle", "inherits": "fdm_belt_common", "from": "system", - "setting_id": "GMPC0BBP01", + "setting_id": "34OWINlJpJgA9DwQ", "instantiation": "true", "printer_model": "BabyBelt Pro", "printer_variant": "0.4", diff --git a/resources/profiles/Printcepts/machine/fdm_belt_common.json b/resources/profiles/Printcepts/machine/fdm_belt_common.json index b010742d78..fe3a58272e 100644 --- a/resources/profiles/Printcepts/machine/fdm_belt_common.json +++ b/resources/profiles/Printcepts/machine/fdm_belt_common.json @@ -9,7 +9,7 @@ "default_filament_profile": [ "Generic PLA @System" ], - "default_print_profile": "0.20mm Standard @System", + "default_print_profile": "0.20mm Standard @BabyBelt Pro", "max_layer_height": [ "0.32" ], diff --git a/resources/profiles/Printcepts/process/0.20mm Standard @BabyBelt Pro.json b/resources/profiles/Printcepts/process/0.20mm Standard @BabyBelt Pro.json index 7f7a810762..f592cfe87e 100644 --- a/resources/profiles/Printcepts/process/0.20mm Standard @BabyBelt Pro.json +++ b/resources/profiles/Printcepts/process/0.20mm Standard @BabyBelt Pro.json @@ -3,6 +3,7 @@ "name": "0.20mm Standard @BabyBelt Pro", "inherits": "fdm_process_common", "from": "system", + "setting_id": "JGfGtqX6CWjCt437", "instantiation": "true", "layer_height": "0.2", "initial_layer_print_height": "0.2", From 55b4dca9bc04e0db47febbe6f035e68951e585c8 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 6 Aug 2026 01:08:44 -0500 Subject: [PATCH 073/389] Belt printers: brim laid onto the tilted belt, with a leading apron A belt printer slices in a rotated frame, so the belt surface is a tilted plane rather than the Z=0 bed plane. Each slicing layer touches the belt only along a narrow strip at its leading edge - about 0.2mm at 45 degrees - so a part's first layer is really a first line, with almost no contact patch to hold it down while the belt drags it forward. Brim was hard-disabled on belt printers, leaving no remedy at all. Generate the brim on the belt plane instead. The object's belt footprint is the union over layers of each slice clipped to that layer's contact band; the brim is offset from it in a "flattened" frame where the shear axis is stretched by 1/cos(tilt), so ordinary Clipper offsets measure true on-belt distance. It is emitted as cross-belt lines, one per layer band, anchored to a fixed fraction of the band so every line shares a nozzle-to-belt clearance and therefore comes out the same width; flow is matched to the resulting band pitch, keeping the sheet uniform and gap-free. Three new controls, all belt-only: * Leading brim length - extends the brim ahead of the part along the belt, on every downhill-facing edge of its contact area. This apron necessarily prints BELOW the object's first layer, since layer 0 is the part's leading contact, so it needs brim-only bands of its own. * Extra brim width - widens the brim sideways across the belt only. * Brim type "Leading edge only" - brim at the part's first belt contact and nothing after it. Appended last in BrimType so no existing value shifts; degrades to an outer brim off belt printers, with a warning. The apron bands are lightweight records rather than a Layer subclass, so no fabricated Layer::id() can leak into initial-layer temperature selection, the spiral vase probe, cooling or gradual interpolation. They are generated in posSupportMaterial because their print_z values must exist before ToolOrdering is built at psWipeTower, and they are emitted from a short dedicated branch in process_layer that runs before any layer pointer is dereferenced. The footprint is closed before offsetting outwards: a belt contact patch is often a broken-up strip, and the merged offset rings of two islands closer than 2 x brim_width would otherwise fill the space between them - space that lies under the part. Also fixes a pre-existing bug where PrintObject::get_first_layer_bbox() overwrote a valid bbox with an unassigned one on any belt printer with a brim configured, because has_brim() was true while make_brim() returned early. Belt brim is refused alongside the prime tower and spiral vase, and requires one instance per PrintObject - translating an instance along the belt axis changes its physical belt-floor Z. Untilted belt printers are unchanged: they still get no brim, since the plate brim is emitted out of skirt_brim_groups(), which _make_skirt() never builds for a belt printer. --- src/libslic3r/BeltBrim.cpp | 491 ++++++++++++++++++ src/libslic3r/BeltBrim.hpp | 169 ++++++ src/libslic3r/Brim.cpp | 13 +- src/libslic3r/CMakeLists.txt | 2 + src/libslic3r/GCode.cpp | 145 +++++- src/libslic3r/GCode.hpp | 36 +- src/libslic3r/GCode/ToolOrdering.cpp | 45 +- src/libslic3r/GCode/ToolOrdering.hpp | 4 + src/libslic3r/Preset.cpp | 2 +- src/libslic3r/Print.cpp | 119 ++++- src/libslic3r/Print.hpp | 31 ++ src/libslic3r/PrintConfig.cpp | 42 ++ src/libslic3r/PrintConfig.hpp | 6 + src/libslic3r/PrintObject.cpp | 55 ++ src/libslic3r/Support/BeltFloorContext.cpp | 2 +- src/libslic3r/Support/BeltFloorContext.hpp | 6 + src/libslic3r/Support/SupportCommon.cpp | 4 +- .../Support/SupportSpotsGenerator.cpp | 4 +- src/slic3r/GUI/ConfigManipulation.cpp | 45 +- src/slic3r/GUI/GUI_Factories.cpp | 18 +- src/slic3r/GUI/Tab.cpp | 2 + tests/fff_print/test_skirt_brim.cpp | 192 +++++++ tests/libslic3r/CMakeLists.txt | 1 + tests/libslic3r/test_belt_brim.cpp | 341 ++++++++++++ 24 files changed, 1744 insertions(+), 31 deletions(-) create mode 100644 src/libslic3r/BeltBrim.cpp create mode 100644 src/libslic3r/BeltBrim.hpp create mode 100644 tests/libslic3r/test_belt_brim.cpp diff --git a/src/libslic3r/BeltBrim.cpp b/src/libslic3r/BeltBrim.cpp new file mode 100644 index 0000000000..40ecc60f58 --- /dev/null +++ b/src/libslic3r/BeltBrim.cpp @@ -0,0 +1,491 @@ +#include "BeltBrim.hpp" + +#include "ClipperUtils.hpp" +#include "Flow.hpp" +#include "Layer.hpp" +#include "Polygon.hpp" +#include "Print.hpp" +#include "ShortestPath.hpp" +#include "Support/BeltFloorContext.hpp" + +#include + +namespace Slic3r { + +// ---------------------------------------------------------------- scaling + +static inline Point scale_u_point(const Point &p, int from_axis, double factor) +{ + // llround, not a cast: casting truncates toward zero, so a round trip would + // walk every vertex toward the origin by up to one unit per pass. + return from_axis == 0 ? + Point(coord_t(std::llround(double(p.x()) * factor)), p.y()) : + Point(p.x(), coord_t(std::llround(double(p.y()) * factor))); +} + +static inline void scale_u_polygon(Polygon &poly, int from_axis, double factor) +{ + for (Point &p : poly.points) + p = scale_u_point(p, from_axis, factor); +} + +ExPolygons belt_scale_u(const ExPolygons &src, const BeltBrimFrame &frame, double factor) +{ + ExPolygons out = src; + for (ExPolygon &ex : out) { + scale_u_polygon(ex.contour, frame.from_axis, factor); + for (Polygon &hole : ex.holes) + scale_u_polygon(hole, frame.from_axis, factor); + } + return out; +} + +Polylines belt_scale_u(const Polylines &src, const BeltBrimFrame &frame, double factor) +{ + Polylines out = src; + for (Polyline &pl : out) + for (Point &p : pl.points) + p = scale_u_point(p, frame.from_axis, factor); + return out; +} + +// ---------------------------------------------------------------- sweep + +ExPolygons sweep_ex(const ExPolygons &src, const Point &t) +{ + if (src.empty()) + return {}; + if (t == Point(0, 0)) + return src; + + // One parallelogram per boundary edge. Together with P and P + t these + // cover the Minkowski sum exactly: for any q = p + s*t with p in P and + // s in [0, 1], let s* be the smallest lambda >= 0 with q - lambda*t in P. + // Either s* == 0 (so q is in P) or q - s* * t lies on some boundary edge e, + // putting q in that edge's parallelogram. Hole edges must be included, or + // holes narrower than t along t would wrongly survive the sweep. + Polygons quads; + for (const ExPolygon &ex : src) + for (size_t c = 0; c < ex.num_contours(); ++ c) + for (const Line &e : ex.contour_or_hole(c).lines()) { + if (e.a == e.b) + continue; + Polygon q; + q.points = { e.a, e.b, e.b + t, e.a + t }; + // The non-zero fill rule counts a clockwise ring as -1, which + // would punch a hole instead of adding material. Edges parallel + // to t give a zero-area quad; Clipper discards those harmlessly. + if (q.is_clockwise()) + q.reverse(); + quads.emplace_back(std::move(q)); + } + + ExPolygons shifted = src; + for (ExPolygon &ex : shifted) + ex.translate(t); + + // union_ex(ExPolygons, Polygons) uses pftNonZero, which is the fill rule the + // argument above relies on. + return union_ex(union_ex(src, shifted), quads); +} + +// ---------------------------------------------------------------- brim region + +ExPolygons belt_brim_region(const ExPolygons &footprint_flat, + bool has_outer, + bool has_inner, + coord_t brim_width, + coord_t object_gap, + coord_t leading, + coord_t lateral, + const BeltBrimFrame &frame) +{ + if (footprint_flat.empty() || (! has_outer && ! has_inner)) + return {}; + + ExPolygons out; + + if (has_outer) { + // Offset the outer ring from the contours only, so a hole cannot punch + // through it. Same reasoning as the plate brim in Brim.cpp. + Polygons contours; + contours.reserve(footprint_flat.size()); + for (const ExPolygon &ex : footprint_flat) + contours.emplace_back(ex.contour); + + // Inner and outer boundary offset from the same polygon, to avoid + // round-off mismatch between them. + ExPolygons inner = offset_ex(contours, float(object_gap), jtRound, SCALED_RESOLUTION); + + // Close the interior before offsetting outwards. A belt contact patch is often a + // narrow, broken-up strip, and the offset rings of two islands less than + // 2 x brim_width apart merge and fill the space between them - space that lies + // UNDER the part, which is not what "outer brim" means. Closing also swallows + // holes in the patch for the same reason. Concavity-filling only, so an apron or + // any other outward protrusion is untouched. + ExPolygons envelope = brim_width > 0 ? closing_ex(inner, float(brim_width)) : inner; + + ExPolygons base = envelope; + if (leading > 0) { + // Sweep downhill from the gapped keep-out, so the apron is contiguous with + // the ring instead of starting inside the gap. + const Point t = frame.from_axis == 0 ? + Point(frame.downhill_sign() * leading, 0) : + Point(0, frame.downhill_sign() * leading); + base = union_ex(base, sweep_ex(envelope, t)); + } + if (lateral > 0) { + // Across the belt, both ways. Swept from `base` so the apron is widened + // too, and in the flattened frame the cross-belt axis is unscaled, so this + // distance is already a true on-belt distance. + const Point t = frame.from_axis == 0 ? Point(0, lateral) : Point(lateral, 0); + ExPolygons widened = union_ex(sweep_ex(base, t), sweep_ex(base, Point(-t.x(), -t.y()))); + base = union_ex(base, to_polygons(widened)); + } + ExPolygons outer = offset_ex(base, float(brim_width), jtRound, SCALED_RESOLUTION); + expolygons_append(out, diff_ex(outer, envelope)); + } + + if (has_inner) { + // Holes reversed so a negative offset grows inward, mirroring Brim.cpp. + // No apron here: an apron growing into a hole interior is never useful. + Polygons holes; + for (const ExPolygon &ex : footprint_flat) + polygons_append(holes, ex.holes); + polygons_reverse(holes); + if (! holes.empty()) { + ExPolygons hole_inner = offset_ex(holes, - float(brim_width + object_gap)); + ExPolygons hole_outer = offset_ex(holes, - float(object_gap)); + expolygons_append(out, intersection_ex(diff_ex(hole_outer, hole_inner), holes)); + } + } + + return union_ex(out); +} + +// ---------------------------------------------------------------- line lattice + +std::vector belt_brim_line_positions(coord_t u_lo, + coord_t u_hi, + coord_t pitch_u, + coord_t u_anchor) +{ + std::vector out; + if (pitch_u <= 0 || u_hi <= u_lo) + return out; + + // Walk the lattice from just below u_lo. Integer arithmetic throughout, so + // the half-open interval needs no epsilon: a point landing exactly on u_hi + // belongs to the next band. + int64_t k = int64_t(std::floor(double(u_lo - u_anchor) / double(pitch_u))) - 1; + while (u_anchor + coord_t(k) * pitch_u < u_lo) + ++ k; + for (;; ++ k) { + const coord_t u = u_anchor + coord_t(k) * pitch_u; + if (u >= u_hi) + break; + out.emplace_back(u); + } + return out; +} + +// ---------------------------------------------------------------- pipeline + +// A band of the belt surface as an explicit box, clamped to `bounds` along the +// shear axis. Deliberately not BeltFloorContext::surface_polygon(): those +// half-planes span +-1000 mm, which is wasteful to clip against and dangerous to +// feed through the flattening scale. +static Polygon band_box(const BoundingBox &bounds, int from_axis, coordf_t u_lo, coordf_t u_hi) +{ + coord_t lo = scale_(u_lo); + coord_t hi = scale_(u_hi); + const coord_t bmin = from_axis == 0 ? bounds.min.x() : bounds.min.y(); + const coord_t bmax = from_axis == 0 ? bounds.max.x() : bounds.max.y(); + lo = std::max(lo, bmin); + hi = std::min(hi, bmax); + Polygon poly; + if (hi <= lo) + return poly; + if (from_axis == 0) + poly.points = { Point(lo, bounds.min.y()), Point(hi, bounds.min.y()), + Point(hi, bounds.max.y()), Point(lo, bounds.max.y()) }; + else + poly.points = { Point(bounds.min.x(), lo), Point(bounds.max.x(), lo), + Point(bounds.max.x(), hi), Point(bounds.min.x(), hi) }; + return poly; +} + +// Everything the per-band line generator needs, gathered once per object. +struct BeltBrimContext +{ + BeltFloorContext ctx; + BeltBrimFrame frame; + ExPolygons region; // brim region, object-local slicing XY + BoundingBox region_bbox; + Flow brim_flow; + coord_t pitch_u = 0; + coord_t u_anchor = 0; + double in_plane_pitch = 0.; // mm +}; + +// Emit the cross-belt brim lines that belong to the band [print_z - height, print_z]. +static void belt_brim_band_paths(const BeltBrimContext &bc, + coordf_t print_z, + coordf_t height, + const Polygons &obstacles, + ExtrusionEntityCollection &out, + ExPolygons &areas_out) +{ + coordf_t u_lo = bc.ctx.cutoff_u(print_z - height); + coordf_t u_hi = bc.ctx.cutoff_u(print_z); + if (u_lo > u_hi) + std::swap(u_lo, u_hi); + + // How wide this band is measured ON the belt, versus one nominal bead. + const double band_in_plane = (u_hi - u_lo) * bc.frame.u_stretch(); + + // Fraction of the layer height at which a line sits above the belt. Toward the + // downhill edge, so the sheet is reasonably thick while the nozzle stays clear of + // the belt itself. + static constexpr double BAND_CLEARANCE_FRACTION = 0.75; + + std::vector us; + double uniform_clearance = 0.; // 0 => derive per line from its own position + double line_pitch = bc.in_plane_pitch; + if (band_in_plane <= bc.in_plane_pitch + EPSILON) { + // Steep belt, which is the normal case: the band is narrower than one bead, so + // exactly one line fits. Place it at a FIXED fraction of the band rather than + // on a nominal-spacing lattice. On a lattice each line lands at an arbitrary + // point in its band, the clearance sweeps [0, height] from band to band, and the + // bead width therefore varies by 2x - visible as ragged, uneven brim lines. + // Anchoring to the band makes the clearance identical everywhere, so every bead + // is the same width. + // + // The spacing is then whatever the bands give (height / sin(tilt) on the belt) + // rather than the nominal bead spacing, so the flow below is matched to THAT + // pitch. Matched flow at the real pitch is what keeps the sheet uniform and + // gap-free; using nominal flow at band spacing would over-feed it. + us.push_back(scale_(bc.ctx.cutoff_u(print_z - BAND_CLEARANCE_FRACTION * height))); + uniform_clearance = BAND_CLEARANCE_FRACTION * height; + line_pitch = band_in_plane; + } else { + // Shallow belt: the band is wider than a bead, so it takes several lines and they + // have to sit on the nominal lattice. Their clearances then differ, and so do + // their widths - unavoidable here, but shallow belts are the rare case. + us = belt_brim_line_positions(scale_(u_lo), scale_(u_hi), bc.pitch_u, bc.u_anchor); + } + if (us.empty()) + return; + + const Polygons region_polys = to_polygons(bc.region); + + // One lattice line at a time: the clearance - and therefore the extrusion + // volume - is a property of the line's u, so the pieces of different lines + // must not be pooled before the flow is resolved. + // Overshoot the region so the clip, not the line's ends, decides the extent. + const coord_t margin = coord_t(SCALED_EPSILON) + 1; + for (const coord_t u : us) { + Polyline line; + if (bc.frame.from_axis == 0) + line.points = { Point(u, coord_t(bc.region_bbox.min.y() - margin)), + Point(u, coord_t(bc.region_bbox.max.y() + margin)) }; + else + line.points = { Point(coord_t(bc.region_bbox.min.x() - margin), u), + Point(coord_t(bc.region_bbox.max.x() + margin), u) }; + + Polylines pieces = intersection_pl(Polylines{ line }, region_polys); + if (! obstacles.empty()) + pieces = diff_pl(pieces, obstacles); + if (pieces.empty()) + continue; + + // Nozzle-to-belt clearance for this line. Constant along the line, because the + // belt height depends only on the shear-axis coordinate. Band-anchored lines + // share one clearance by construction; lattice lines (shallow belts) each get + // their own, clamped so neither end of a band yields an unprintable bead. + double clearance = uniform_clearance; + if (clearance <= 0.) { + const Point probe = bc.frame.from_axis == 0 ? Point(u, 0) : Point(0, u); + clearance = print_z - bc.ctx.floor_print_z(probe); + clearance = std::min(std::max(clearance, 0.5 * height), height); + } + + // with_cross_section, not with_height: it reaches the prescribed volume while + // KEEPING the extrusion spacing, so the bead is sized to fill exactly one + // pitch x clearance cell of the sheet. + const Flow f = bc.brim_flow.with_cross_section(float(line_pitch * clearance)); + + // Footprint of these beads, for the first-layer convex hull and bbox. + for (const Polygon &p : offset(pieces, 0.5f * float(f.scaled_width()))) + areas_out.emplace_back(ExPolygon(p)); + + extrusion_entities_append_paths(out.entities, chain_polylines(std::move(pieces)), + erBrim, f.mm3_per_mm(), f.width(), float(clearance)); + } +} + +// Union of everything actually extruded at `print_z` by any object, expressed in +// `self`'s local slicing frame. Includes `self` itself: its slice at this Z can +// overhang outside the belt footprint and land in the brim ring, which the +// flattened brim_object_gap - a belt-plane separation - does not cover. +static Polygons belt_brim_obstacles(const Print &print, const PrintObject &self, coordf_t print_z, coordf_t tol) +{ + const Point shift_self = self.instances().empty() ? Point(0, 0) + : self.instances().front().shift_without_plate_offset(); + Polygons out; + for (const PrintObject *o : print.objects()) + for (const PrintInstance &inst : o->instances()) { + const Point delta = inst.shift_without_plate_offset() - shift_self; + if (const Layer *l = o->get_layer_at_printz(print_z, tol)) { + Polygons ps = to_polygons(l->lslices); + for (Polygon &p : ps) + p.translate(delta); + polygons_append(out, std::move(ps)); + } + if (const SupportLayer *sl = o->get_support_layer_at_printz(print_z, tol)) { + Polygons ps = sl->support_fills.polygons_covered_by_spacing(); + for (Polygon &p : ps) + p.translate(delta); + polygons_append(out, std::move(ps)); + } + } + return union_(out); +} + +void make_belt_brim(PrintObject &object) +{ + object.clear_belt_brim(); + if (! object.has_belt_brim()) + return; + + const Print &print = *object.print(); + BeltBrimContext bc; + if (! bc.ctx.init(object.slicing_parameters(), print.config())) + return; + bc.frame = BeltBrimFrame{ bc.ctx.shear_factor(), bc.ctx.from_axis() }; + + const size_t nlayers = object.layers().size(); + if (nlayers == 0) + return; + + // 1. Belt footprint: the union of each layer's slice clipped to that layer's + // own contact band. This is the object's bottom face, which on a belt is + // spread over every layer instead of sitting in layer 0. + ExPolygons footprint_acc; + for (size_t i = 0; i < nlayers; ++ i) { + const Layer &layer = *object.layers()[i]; + if (layer.lslices.empty()) + continue; + // print_z - height, not the previous layer's print_z: variable layer + // heights make the latter wrong. + coordf_t u_lo = bc.ctx.cutoff_u(layer.print_z - layer.height); + coordf_t u_hi = bc.ctx.cutoff_u(layer.print_z); + if (u_lo > u_hi) + std::swap(u_lo, u_hi); + BoundingBox bb = get_extents(layer.lslices); + bb.offset(scale_(1.)); + const Polygon band = band_box(bb, bc.frame.from_axis, u_lo, u_hi); + if (band.empty()) + continue; + expolygons_append(footprint_acc, intersection_ex(layer.lslices, Polygons{ band })); + } + const ExPolygons footprint = union_ex(footprint_acc); + if (footprint.empty()) + return; + + // 2. Brim region, offset in the flattened (true on-belt) metric. + const PrintObjectConfig &cfg = object.config(); + bc.brim_flow = print.brim_flow(); + const double flow_w = bc.brim_flow.scaled_spacing() * SCALING_FACTOR; + // Quantize to an even number of lines, as the plate brim does. + const coord_t width = scale_(std::floor(cfg.brim_width.value / flow_w / 2) * flow_w * 2); + const coord_t leading = scale_(cfg.leading_brim_length.value); + const coord_t lateral = scale_(cfg.extra_brim_width.value); + const coord_t gap = scale_(cfg.brim_object_gap.value); + + // Belt printers collapse Auto / Mouse ear / Painted to outer-only: the auto width + // heuristic and flat ear discs have no meaning on a tilted plane. Leading-edge-only + // is an outer brim too; it is narrowed down to the first contact below. + const BrimType bt = cfg.brim_type.value; + const bool has_outer = bt == btOuterOnly || bt == btOuterAndInner + || bt == btAutoBrim || bt == btEar || bt == btPainted + || bt == btLeadingEdgeOnly; + const bool has_inner = bt == btInnerOnly || bt == btOuterAndInner; + + bc.region = belt_unflatten( + belt_brim_region(belt_flatten(footprint, bc.frame), has_outer, has_inner, + width, gap, leading, lateral, bc.frame), + bc.frame); + + if (bt == btLeadingEdgeOnly && ! bc.region.empty()) { + // Keep only what lies at or downhill of the object's FIRST contact with the + // belt, so the part is supported as it lands and nothing is printed alongside + // it afterwards. The cut is the uphill edge of the first layer's contact band: + // everything past it belongs to later contacts. + const coordf_t u_cut = bc.ctx.cutoff_u(object.layers().front()->print_z); + BoundingBox keep_bb = get_extents(bc.region); + keep_bb.offset(scale_(1.)); + const bool low_side = bc.frame.shear > 0.; // downhill is -u + const Polygon keep = band_box(keep_bb, bc.frame.from_axis, + low_side ? unscale(bc.frame.from_axis == 0 ? keep_bb.min.x() : keep_bb.min.y()) : u_cut, + low_side ? u_cut : unscale(bc.frame.from_axis == 0 ? keep_bb.max.x() : keep_bb.max.y())); + bc.region = keep.empty() ? ExPolygons{} : intersection_ex(bc.region, Polygons{ keep }); + } + + if (bc.region.empty()) + return; + bc.region_bbox = get_extents(bc.region); + + // 3. Line lattice. Fixed pitch in the flattened metric, anchored at the + // footprint's leading-most edge so lines stay collinear across + // disconnected islands and across the apron prologue. + bc.pitch_u = std::max(1, coord_t(bc.brim_flow.scaled_spacing() * bc.frame.cos_tilt())); + bc.in_plane_pitch = unscale(bc.pitch_u) * bc.frame.u_stretch(); + { + const BoundingBox fbb = get_extents(footprint); + const bool low_side = bc.frame.shear > 0.; + bc.u_anchor = bc.frame.from_axis == 0 ? (low_side ? fbb.min.x() : fbb.max.x()) + : (low_side ? fbb.min.y() : fbb.max.y()); + } + + // 4. Bands coincident with an object layer. + std::vector by_layer(nlayers); + std::vector areas_by_layer(nlayers); + for (size_t i = 0; i < nlayers; ++ i) { + const Layer &layer = *object.layers()[i]; + const Polygons obstacles = belt_brim_obstacles(print, object, layer.print_z, 0.5 * layer.height); + belt_brim_band_paths(bc, layer.print_z, layer.height, obstacles, by_layer[i], areas_by_layer[i]); + } + + // 5. Apron prologue: the part of the region downhill of the object's first + // layer, which has no object layer to ride on. + std::vector prologue; + { + const Layer &first = *object.layers().front(); + const coordf_t h = first.height; + const bool low_side = bc.frame.shear > 0.; + const coord_t u_lead_s = bc.frame.from_axis == 0 + ? (low_side ? bc.region_bbox.min.x() : bc.region_bbox.max.x()) + : (low_side ? bc.region_bbox.min.y() : bc.region_bbox.max.y()); + const coordf_t u_lead = unscale(u_lead_s); + // print_z at which the belt surface crosses the region's leading edge. + const coordf_t z_lead = bc.ctx.shear_factor() * u_lead + + bc.ctx.floor_offset() + bc.ctx.z_shift(); + if (h > EPSILON) + for (coordf_t z = first.print_z - h; z > z_lead - h; z -= h) { + const Polygons obstacles = belt_brim_obstacles(print, object, z, 0.5 * h); + BeltBrimBand band; + band.print_z = z; + band.height = h; + belt_brim_band_paths(bc, z, h, obstacles, band.fills, band.areas); + if (! band.fills.empty()) + prologue.emplace_back(std::move(band)); + } + // Lowest Z first, so collect_layers_to_print sees them in print order. + std::reverse(prologue.begin(), prologue.end()); + } + + object.set_belt_brim(std::move(by_layer), std::move(areas_by_layer), std::move(prologue)); +} + +} // namespace Slic3r diff --git a/src/libslic3r/BeltBrim.hpp b/src/libslic3r/BeltBrim.hpp new file mode 100644 index 0000000000..d6f0980bc8 --- /dev/null +++ b/src/libslic3r/BeltBrim.hpp @@ -0,0 +1,169 @@ +#ifndef slic3r_BeltBrim_hpp_ +#define slic3r_BeltBrim_hpp_ + +#include "ExPolygon.hpp" +#include "ExtrusionEntityCollection.hpp" +#include "Point.hpp" +#include "Polyline.hpp" + +#include +#include + +// Belt-printer brim geometry. +// +// A belt printer slices in a ROTATED frame, so the belt surface is not the +// Z=0 bed plane but a tilted plane in slicing space: +// +// z_slicing(u) = shear * u + floor_offset + z_shift, u = X or Y +// +// where `shear == tan(tilt)` (SlicingParameters::belt_floor_shear_factor) and +// the axis is selected by SlicingParameters::belt_floor_from_axis. See +// Support/BeltFloorContext.hpp for the canonical accessors. +// +// Consequences that drive everything in this file: +// +// * A horizontal slicing layer touches the belt only along a narrow strip at +// its leading edge, `layer_height / shear` wide (~0.2 mm at 45 degrees). +// The object's belt footprint - its bottom face - is therefore spread over +// every layer, not contained in layer 0. +// * Distances measured in slicing XY are NOT on-belt distances: moving `du` +// along the shear axis travels `du / cos(tilt)` across the belt. So brim +// offsets have to be taken in a "flattened" space where the shear axis is +// stretched by `1 / cos(tilt)`, then mapped back. +// * Brim ahead of the part (downhill) lies at slicing Z BELOW the object's +// first layer, because the object's layer 0 is precisely its leading +// contact with the belt. +// +// Everything here is pure geometry on ExPolygons/Polylines so it can be unit +// tested without a Print. Keep user-visible strings out of this file: it is +// not listed in localization/i18n/list.txt. + +namespace Slic3r { + +// Tilt window within which the BELT plane, not the bed plane, is the adhesion +// surface. Below ~1 degree a belt is a flat bed as far as adhesion goes, and the +// contact band would be layer_height/sin(tilt) - tens of millimetres - so the +// ordinary plate brim is both correct and cheaper. Above ~85 degrees the whole +// brim compresses into a sliver and is not worth generating. +inline constexpr double BELT_BRIM_MIN_TILT_DEG = 1.; +inline constexpr double BELT_BRIM_MAX_TILT_DEG = 85.; + +// Description of the tilted belt plane, reduced to what the brim geometry needs. +struct BeltBrimFrame +{ + // tan(tilt). Sign selects which way is downhill. + double shear = 0.; + // 0 = X, 1 = Y. Matches BeltFloorContext::from_axis(). + int from_axis = 1; + + // 1 / cos(tilt). Stretch factor that turns a projected distance along + // `from_axis` into the true distance travelled across the belt. + double u_stretch() const { return std::sqrt(1. + shear * shear); } + // cos(tilt). The inverse mapping. + double cos_tilt() const { return 1. / this->u_stretch(); } + // Downhill is where the belt surface is lower, i.e. printed earlier, i.e. + // the leading edge of the part. For shear > 0 that is -u. + int downhill_sign() const { return shear > 0. ? -1 : +1; } +}; + +// Scale only the `from_axis` component by `factor`, rounding to nearest. +// +// Deliberately not MultiPoint::scale(fx, fy) / ExPolygon::scale(fx, fy): those +// truncate toward zero, which is asymmetric about the origin and loses up to a +// full coordinate unit per vertex on every round trip. +ExPolygons belt_scale_u(const ExPolygons &src, const BeltBrimFrame &frame, double factor); +Polylines belt_scale_u(const Polylines &src, const BeltBrimFrame &frame, double factor); + +// Into / out of the space where Euclidean offsets equal true on-belt distances. +inline ExPolygons belt_flatten(const ExPolygons &src, const BeltBrimFrame &frame) + { return belt_scale_u(src, frame, frame.u_stretch()); } +inline ExPolygons belt_unflatten(const ExPolygons &src, const BeltBrimFrame &frame) + { return belt_scale_u(src, frame, frame.cos_tilt()); } + +// Minkowski sum of `src` with the segment [0, t]: the region swept by sliding +// `src` along t. Used to grow the brim downhill for "extra brim width". +// +// Implemented as union_(P, P + t, {parallelogram per boundary edge}) over ALL +// contours including holes, with every parallelogram forced counter-clockwise +// so the non-zero fill rule closes holes narrower than t along the sweep +// direction. A hole survives exactly when it is wider than |t| measured along +// t - not when it is wider in its narrowest Euclidean direction. +ExPolygons sweep_ex(const ExPolygons &src, const Point &t); + +// Brim region for one already-flattened belt footprint. All lengths are scaled +// and measured in the flattened (true on-belt) metric. +// +// `has_outer` / `has_inner` are the resolved BrimType: belt printers collapse +// Auto / Mouse ear / Painted to outer-only, so the caller does that mapping and +// this function never needs PrintConfig. +// +// Two directional extras are applied to the footprint before the outer offset, so +// each one buys reach in one direction only: +// +// `leading` (leading_brim_length) sweeps the footprint DOWNHILL along the belt, +// so every leading-facing edge gains an apron ahead of it. +// `lateral` (extra_brim_width) sweeps it BOTH WAYS across the belt, widening +// the brim sideways without pushing it further ahead or behind. +// +// Neither is applied to the inner (hole) ring. +ExPolygons belt_brim_region(const ExPolygons &footprint_flat, + bool has_outer, + bool has_inner, + coord_t brim_width, + coord_t object_gap, + coord_t leading, + coord_t lateral, + const BeltBrimFrame &frame); + +// Brim line positions for one layer band. +// +// Lines sit on a fixed lattice `u_anchor + k * pitch_u` so the on-belt spacing +// between neighbouring brim lines is constant regardless of how the lattice +// falls across layer bands. Snapping to band centres instead would quantise +// the spacing to whole bands and under-deposit by ~35% at 45 degrees. +// +// The band is half-open, [u_lo, u_hi), so every lattice point belongs to +// exactly one band: none duplicated at a boundary, none dropped. A band +// narrower than the pitch simply yields nothing; a band much wider (shallow +// tilt) yields several lines. +std::vector belt_brim_line_positions(coord_t u_lo, + coord_t u_hi, + coord_t pitch_u, + coord_t u_anchor); + +// ---------------------------------------------------------------- pipeline + +// One brim-only layer printed BEFORE the object's first layer, carrying the +// apron that has to be stuck to the belt ahead of the part. +// +// Deliberately not a Layer subclass. A synthetic Layer would inherit id() +// semantics that leak into initial-layer temperature selection, the spiral vase +// probe, gradual interpolation, avoid-crossing-perimeters and cooling, all of +// which key off Layer::id() == 0 or off a layer's regions. A plain record +// carries only what the emitter needs. +// +// `height` is the LAYER height, used for the Z move and ordering metadata only. +// Each extrusion path inside `fills` carries its own height, equal to that +// line's nozzle-to-belt clearance, which varies across the band. +struct BeltBrimBand +{ + coordf_t print_z = 0.; + coordf_t height = 0.; + // erBrim paths in the object's local slicing frame, untranslated. + ExtrusionEntityCollection fills; + // Footprint of those paths, for the first-layer convex hull / bbox. + ExPolygons areas; +}; + +class PrintObject; + +// Generate the belt brim for one object: fills its per-object-layer bands and +// its apron prologue. No-op unless PrintObject::has_belt_brim(). +// +// Runs inside posSupportMaterial rather than the brim step, because the prologue +// print_z values must exist before ToolOrdering is built at psWipeTower. +void make_belt_brim(PrintObject &object); + +} // namespace Slic3r + +#endif // slic3r_BeltBrim_hpp_ diff --git a/src/libslic3r/Brim.cpp b/src/libslic3r/Brim.cpp index 13a6aa819a..1fd71ab13a 100644 --- a/src/libslic3r/Brim.cpp +++ b/src/libslic3r/Brim.cpp @@ -453,7 +453,9 @@ static ExPolygons outer_inner_brim_area(const Print& print, const bool use_auto_brim_ears = object->config().brim_type == btEar; const bool use_brim_ears = object->config().brim_type == btPainted; const bool has_inner_brim = brim_type == btInnerOnly || brim_type == btOuterAndInner || use_auto_brim_ears || use_brim_ears; - const bool has_outer_brim = brim_type == btOuterOnly || brim_type == btOuterAndInner || brim_type == btAutoBrim || use_auto_brim_ears || use_brim_ears; + // btLeadingEdgeOnly is a belt-printer mode; on a flat bed there is no leading + // edge, so it degrades to an ordinary outer brim rather than silently to none. + const bool has_outer_brim = brim_type == btOuterOnly || brim_type == btOuterAndInner || brim_type == btAutoBrim || brim_type == btLeadingEdgeOnly || use_auto_brim_ears || use_brim_ears; coord_t ear_detection_length = scale_(object->config().brim_ears_detection_length.value); coordf_t brim_ears_max_angle = object->config().brim_ears_max_angle.value; //ORCA: Select brim base slices from EFC-compensated outline when enabled. @@ -868,7 +870,14 @@ void make_brim(const Print& print, PrintTryCancel try_cancel, Polygons& islands_ std::vector& printExtruders, std::map* objectBrimAreasByInstanceOut) { - // Belt printer: brim is not compatible with belt printing. + // Belt printers never use the flat plate brim. + // + // With a tilted belt the brim has to be laid onto the belt plane over many layers, + // which BeltBrim.cpp does during posSupportMaterial. With an untilted belt this + // could in principle fall through and produce an ordinary brim, but it would never + // reach the G-code: the plate brim is emitted out of skirt_brim_groups(), which + // _make_skirt() builds, and that returns early for every belt printer. Running the + // generator anyway would just burn time on geometry nobody prints. if (print.config().belt_printer.value) return; diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index e3f00179ff..c8796265db 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -80,6 +80,8 @@ set(lisbslic3r_sources BoundingBox.hpp BridgeDetector.cpp BridgeDetector.hpp + BeltBrim.cpp + BeltBrim.hpp BeltGCode.cpp BeltGCode.hpp BeltGCodeWriter.cpp diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index c85ed1159e..f2caca404f 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2125,6 +2125,17 @@ std::vector GCode::collect_layers_to_print(const PrintObjec std::vector> warning_ranges; + // Belt printers: the brim apron is stuck to the belt AHEAD of the part, which + // on a tilted belt means below the object's first layer. Those bands carry no + // object or support layer, so they are emitted first and handled by + // process_layer()'s brim-only branch. Already ordered lowest print_z first. + for (const BeltBrimBand &band : object.belt_brim_prologue()) { + LayerToPrint prologue_layer; + prologue_layer.belt_brim_band = &band; + prologue_layer.original_object = &object; + layers_to_print.push_back(prologue_layer); + } + // Pair the object layers with the support layers by z. size_t idx_object_layer = 0; size_t idx_support_layer = 0; @@ -2967,6 +2978,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato zs.push_back(layer->print_z); for (auto layer : object->support_layers()) zs.push_back(layer->print_z); + // Belt brim apron bands each get their own change_layer() call. + for (const BeltBrimBand &band : object->belt_brim_prologue()) + zs.push_back(band.print_z); std::sort(zs.begin(), zs.end()); //BBS: merge numerically very close Z values. auto end_it = std::unique(zs.begin(), zs.end()); @@ -2986,6 +3000,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato zs.push_back(layer->print_z); for (auto layer : object->support_layers()) zs.push_back(layer->print_z); + // See the ByObject branch: apron bands are real printed layers. + for (const BeltBrimBand &band : object->belt_brim_prologue()) + zs.push_back(band.print_z); } if (!zs.empty()) { @@ -5163,8 +5180,39 @@ std::string GCode::generate_object_skirt_group(const Print &print, object_skirt_tools, layer, extruder_id, m_skirt_group_done[group_idx]); } -std::string GCode::generate_object_brim(const Print &print, const PrintObject &object, size_t instance_id, bool first_layer) +std::string GCode::generate_object_brim(const Print &print, const PrintObject &object, size_t instance_id, bool first_layer, + const Layer *object_layer) { + // Belt printers lay the brim onto the tilted belt over many layers, so there is + // nothing special about the first one. The bands that coincide with an object + // layer are emitted here; those below the object's first layer are apron and go + // through process_belt_brim_layer() instead. + if (object.has_belt_brim()) { + if (object_layer == nullptr) + return {}; + const std::vector &by_layer = object.belt_brim_by_layer(); + const size_t layer_idx = object_layer->id(); + if (layer_idx >= by_layer.size() || by_layer[layer_idx].empty()) + return {}; + std::string gcode; + // The band geometry is in the object's local slicing frame, exactly like its + // perimeters, so it needs this instance's origin. The caller does not set it + // until later, and the plate brim path deliberately uses (0, 0) because its + // geometry is already in plate coordinates. + m_config.apply(print.default_region_config()); + m_config.apply(object.config(), true); + const Point &offset = object.instances()[instance_id].shift; + this->set_origin(unscale(offset)); + this->on_set_origin(&object, offset); + m_avoid_crossing_perimeters.use_external_mp(); + for (const ExtrusionEntity *ee : by_layer[layer_idx].entities) + if (ee != nullptr) + gcode += this->extrude_entity(*ee, "brim", NOZZLE_CONFIG(support_speed)); + m_avoid_crossing_perimeters.use_external_mp(false); + m_avoid_crossing_perimeters.disable_once(); + return gcode; + } + if (!first_layer) return {}; @@ -5201,6 +5249,86 @@ std::string GCode::generate_object_brim(const Print &print, const PrintObject &o return {}; } +// Belt printers: emit one brim-only apron layer. On a tilted belt the brim ahead +// of the part lands at slicing Z below the object's first layer, because the +// object's layer 0 IS its leading contact with the belt. Those layers carry brim +// and nothing else. +// +// This is intentionally a short path rather than a variant of process_layer(): an +// apron band has no Layer, and giving it a synthetic one would feed a fabricated +// Layer::id() into initial-layer temperature selection, the spiral vase probe, +// gradual interpolation and cooling. Correct first-layer treatment comes from +// FirstLayerPlane in BeltAffine mode, which is evaluated per point. +LayerResult GCode::process_belt_brim_layer( + const Print &print, + const std::vector &layers, + const LayerTools &layer_tools, + const bool last_layer, + const size_t single_object_instance_idx) +{ + // layer_id 0: the apron precedes every object layer and nothing downstream + // indexes by it. spiral_vase_enable false: spiral vase is refused alongside + // belt brim in Print::validate(). cooling_buffer_flush true: an apron layer is + // a complete layer, and the default (object_layer || raft_layer || last_layer) + // would be false here, so fan and slowdown would never be applied to it. + LayerResult result { {}, 0, false, true }; + if (layer_tools.extruders.empty()) + // Nothing to extrude. + return result; + + coordf_t print_z = 0.; + for (const LayerToPrint <p : layers) + if (ltp.belt_brim_band != nullptr) { + print_z = ltp.belt_brim_band->print_z; + break; + } + + m_cur_layer_idx = m_belt_brim_layer_idx ++; + + // Publish the band's Z for _extrude()'s first-layer-plane probe, and make sure + // it cannot leak past this layer even if an extrusion throws. + struct BeltBrimZGuard { + std::optional &slot; + ~BeltBrimZGuard() { slot.reset(); } + } z_guard { m_belt_brim_z }; + m_belt_brim_z = print_z; + m_layer = nullptr; + + std::string gcode; + const unsigned int extruder_id = layer_tools.extruders.front(); + if (m_writer->filament() == nullptr || m_writer->filament()->id() != extruder_id) + gcode += this->set_extruder(extruder_id, print_z); + gcode += this->change_layer(print_z); + + for (const LayerToPrint <p : layers) { + const BeltBrimBand *band = ltp.belt_brim_band; + if (band == nullptr || band->fills.empty() || ltp.original_object == nullptr) + continue; + const PrintObject &object = *ltp.original_object; + // Speeds, flow and retraction all read m_config. + m_config.apply(print.default_region_config()); + m_config.apply(object.config(), true); + const size_t i_begin = single_object_instance_idx == size_t(-1) ? 0 : single_object_instance_idx; + const size_t i_end = single_object_instance_idx == size_t(-1) ? object.instances().size() + : single_object_instance_idx + 1; + for (size_t i = i_begin; i < i_end && i < object.instances().size(); ++ i) { + // Band geometry is object-local, like the object's own extrusions. + const Point &offset = object.instances()[i].shift; + this->set_origin(unscale(offset)); + this->on_set_origin(&object, offset); + m_avoid_crossing_perimeters.use_external_mp(); + for (const ExtrusionEntity *ee : band->fills.entities) + if (ee != nullptr) + gcode += this->extrude_entity(*ee, "brim", NOZZLE_CONFIG(support_speed)); + m_avoid_crossing_perimeters.use_external_mp(false); + m_avoid_crossing_perimeters.disable_once(); + } + } + + result.gcode = std::move(gcode); + return result; +} + // Bedslinger model. The heavier the bed load, the lower the achievable Y acceleration for a given // drive force (a = F / (bed_mass + printed_mass)). Reads machine_max_force_Y / machine_bed_mass_Y (both // default 0, i.e. absent on every existing printer), in which case it just returns the min configured Y @@ -5523,6 +5651,13 @@ LayerResult GCode::process_layer( } } + // Belt printers: a brim-only apron layer has neither an object nor a support + // layer, so it must be handled before layer_ptr is dereferenced below. + if (object_layer == nullptr && support_layer == nullptr && + std::any_of(layers.begin(), layers.end(), + [](const LayerToPrint &l) { return l.belt_brim_band != nullptr; })) + return this->process_belt_brim_layer(print, layers, layer_tools, last_layer, single_object_instance_idx); + const Layer* layer_ptr = nullptr; if (object_layer != nullptr) layer_ptr = object_layer; @@ -6481,7 +6616,8 @@ LayerResult GCode::process_layer( const LayerToPrint &layer_to_print = layers[instance_to_print.layer_id]; if (visit.first_visit && print_wipe_extrusions == (is_anything_overridden ? 1 : 0)) { gcode += generate_object_skirt_group(print, instance_to_print.print_object, instance_to_print.instance_id, layer_tools, layer, extruder_id); - gcode += generate_object_brim(print, instance_to_print.print_object, instance_to_print.instance_id, first_layer); + gcode += generate_object_brim(print, instance_to_print.print_object, instance_to_print.instance_id, first_layer, + layer_to_print.object_layer); } // To control print speed of the 1st object layer printed over raft interface. @@ -7591,10 +7727,13 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // evaluator is inactive (non-belt printers, or belt printers without // a Z-axis shear) `path_on_first_layer` falls back to the legacy // layer-id check, so behavior is bit-identical to the pre-feature path. + // A belt brim apron band has no Layer of its own, so it publishes its Z + // through m_belt_brim_z instead; without that the plane would be probed at + // Z=0 and the apron mis-classified for fan and speed. const Vec3d path_point_mm{ unscale(path.first_point().x()), unscale(path.first_point().y()), - m_layer ? m_layer->print_z : 0.0 + m_layer ? m_layer->print_z : (m_belt_brim_z ? *m_belt_brim_z : 0.0) }; const bool path_on_first_layer = this->on_first_layer(path_point_mm); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 8655683727..d4c7bf9bc3 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -290,6 +291,13 @@ public: const Layer* object_layer; const SupportLayer* support_layer; const PrintObject* original_object; //BBS: used for shared object logic + // Belt printers only: an apron band that prints BELOW the object's first + // layer, so it has no object or support layer of its own. Deliberately + // not a Layer, so it cannot leak Layer::id() semantics into initial-layer + // temperature, spiral vase, cooling or interpolation logic. When this is + // the only thing set, layer() is null and process_layer() takes its + // dedicated brim-only branch. + const BeltBrimBand* belt_brim_band { nullptr }; const Layer* layer() const { if (object_layer != nullptr) @@ -319,6 +327,12 @@ public: count++; } + // A brim-only apron band contributes no object/support layer, and + // averaging zero terms would yield NaN. Never folded into the + // average, so the non-belt result is bit-identical. + if (count == 0 && belt_brim_band != nullptr) + return belt_brim_band->print_z; + return sum_z / count; } }; @@ -389,7 +403,20 @@ protected: std::string generate_object_brim(const Print &print, const PrintObject &object, size_t instance_id, - bool first_layer); + bool first_layer, + const Layer *object_layer); + + // Belt printers: emit one brim-only apron layer. These print below the + // object's first layer, so there is no object or support layer for the normal + // process_layer() machinery to work from. Kept to the minimum a layer needs - + // tool, Z move, extrusions - so that nothing here can perturb the + // Layer::id()-based logic the ordinary path relies on. + LayerResult process_belt_brim_layer( + const Print &print, + const std::vector &layers, + const LayerTools &layer_tools, + const bool last_layer, + const size_t single_object_instance_idx); LayerResult process_layer( const Print &print, @@ -780,6 +807,13 @@ protected: // resolvers. Distinct from m_layer_index (an export progress counter starting at -1). size_t m_cur_layer_idx{0}; + // Belt brim apron layers only. They have no Layer, so the print_z that + // _extrude() needs for the first-layer-plane probe is published here instead. + // Scoped by BeltBrimZGuard in process_belt_brim_layer(), never left set. + std::optional m_belt_brim_z; + // Counter standing in for Layer::id() on apron layers, which precede layer 0. + size_t m_belt_brim_layer_idx{0}; + std::set m_initial_layer_extruders; std::vector> m_sorted_layer_filaments; // BBS diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index f37025d4e7..e0520a3694 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -468,6 +468,11 @@ ToolOrdering::ToolOrdering(const PrintObject &object, unsigned int first_extrude zs.emplace_back(layer->print_z); for (auto layer : object.support_layers()) zs.emplace_back(layer->print_z); + // Belt brim apron bands sit below the object's first layer and have no + // layer of their own, but tools_for_layer() asserts an exact Z match, so + // their print_z must be part of the ordering. + for (const BeltBrimBand &band : object.belt_brim_prologue()) + zs.emplace_back(band.print_z); this->initialize_layers(zs); } @@ -512,6 +517,10 @@ ToolOrdering::ToolOrdering(const Print &print, unsigned int first_extruder, bool zs.emplace_back(layer->print_z); for (auto layer : object->support_layers()) zs.emplace_back(layer->print_z); + // See the single-object ctor: belt brim apron bands need their own + // ordering entries or tools_for_layer() will assert. + for (const BeltBrimBand &band : object->belt_brim_prologue()) + zs.emplace_back(band.print_z); max_layer_height = std::max(max_layer_height, object->config().layer_height.value); } @@ -860,6 +869,30 @@ void ToolOrdering::collect_extruders(const PrintObject &object, const std::vecto } } + // Belt brim apron bands own their layers outright: they print below the + // object's first layer, so no object or support layer claims an extruder there + // and process_layer() would bail out at "Nothing to extrude". Claim the + // object's outer wall filament, in the same raw 1-based domain the loops above + // push. Deliberately not layer_tools.has_object, which drives skirt marking + // and wiping overrides. + if (! object.belt_brim_prologue().empty()) { + unsigned int brim_filament = 0; + for (size_t i = 0; i < object.num_printing_regions(); ++ i) { + const unsigned int f = object.printing_region(i).config().outer_wall_filament_id.value; + if (f > 0 && (brim_filament == 0 || f < brim_filament)) + brim_filament = f; + } + if (brim_filament == 0) + brim_filament = 1; + for (const BeltBrimBand &band : object.belt_brim_prologue()) { + if (band.fills.empty()) + continue; + LayerTools &layer_tools = this->tools_for_layer(band.print_z); + layer_tools.extruders.push_back(brim_filament); + layer_tools.has_belt_brim = true; + } + } + for (auto& layer : m_layer_tools) { // Sort and remove duplicates sort_remove_duplicates(layer.extruders); @@ -902,12 +935,20 @@ void ToolOrdering::fill_wipe_tower_partitions(const PrintConfig &config, coordf_ } //FIXME this is a hack to get the ball rolling. + // The `print_z < object_bottom_z` clause reads "below the object" as "raft + // gap". On a belt printer that is wrong: the brim apron legitimately prints + // below the object's first layer, and treating those layers as raft would put a + // wipe tower at negative Z. Belt brim and the prime tower are mutually + // exclusive (rejected in Print::validate()), so simply drop the clause there. + const bool belt_no_raft_gap = config.belt_printer.value; for (LayerTools < : m_layer_tools) lt.has_wipe_tower |= (lt.has_object && (config.timelapse_type == TimelapseType::tlSmooth || lt.wipe_tower_partitions > 0)) - || lt.print_z < object_bottom_z + EPSILON; + || (! belt_no_raft_gap && lt.print_z < object_bottom_z + EPSILON); // Test for a raft, insert additional wipe tower layer to fill in the raft separation gap. - for (size_t i = 0; i + 1 < m_layer_tools.size(); ++ i) { + // Skipped on belt printers for the same reason as the clause above: layers + // below the object are brim apron, not raft. + for (size_t i = 0; ! belt_no_raft_gap && i + 1 < m_layer_tools.size(); ++ i) { const LayerTools < = m_layer_tools[i]; const LayerTools <_next = m_layer_tools[i + 1]; if (lt.print_z < object_bottom_z + EPSILON && lt_next.print_z >= object_bottom_z + EPSILON) { diff --git a/src/libslic3r/GCode/ToolOrdering.hpp b/src/libslic3r/GCode/ToolOrdering.hpp index c77b152fe9..0d7526c72e 100644 --- a/src/libslic3r/GCode/ToolOrdering.hpp +++ b/src/libslic3r/GCode/ToolOrdering.hpp @@ -161,6 +161,10 @@ public: // Should a skirt be printed at this layer? // Layers are marked for infinite skirt aka draft shield. Not all the layers have to be printed. bool has_skirt = false; + // Belt printers: is this one of the brim-only apron layers below the object's + // first layer? Kept separate from has_object so skirt marking and wiping + // overrides are unaffected. + bool has_belt_brim = false; // Will there be anything extruded on this layer for the wipe tower? // Due to the support layers possibly interleaving the object layers, // wipe tower will be disabled for some support only layers. diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index dc89c2b1df..3e6e2b9aaf 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1090,7 +1090,7 @@ static std::vector s_Preset_print_options{ "top_surface_speed", "support_speed", "support_object_xy_distance", "support_object_first_layer_gap", "support_interface_speed", "bridge_speed", "internal_bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed", "outer_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "skirt_type", "skirt_loops", "skirt_speed","min_skirt_length", "skirt_distance", "skirt_start_angle", "skirt_height","single_loop_draft_shield", "draft_shield", - "brim_width", "brim_object_gap", "brim_flow_ratio", "brim_use_efc_outline", "combine_brims", "brim_type", "brim_ears_max_angle", "brim_ears_detection_length", "enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap","enforce_support_layers", + "brim_width", "leading_brim_length", "extra_brim_width", "brim_object_gap", "brim_flow_ratio", "brim_use_efc_outline", "combine_brims", "brim_type", "brim_ears_max_angle", "brim_ears_detection_length", "enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap","enforce_support_layers", "raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion", "support_base_pattern", "support_base_pattern_spacing", "support_expansion", "support_style", // BBS diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index ba28f96804..189f9e178e 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -641,6 +641,24 @@ bool Print::has_brim() const return std::any_of(m_objects.begin(), m_objects.end(), [](PrintObject *object) { return object->has_brim(); }); } +bool Print::has_tilted_belt() const +{ + if (! m_config.belt_printer.value) + return false; + // A Z rotation leaves the belt floor flat (BeltTransform forces shear = 0) and no + // rotation at all means the machine is geometrically a flat bed. + const BeltRotationAxis axis = m_config.belt_slice_rotation.value; + if (axis != BeltRotationAxis::X && axis != BeltRotationAxis::Y) + return false; + const double tilt = std::abs(m_config.belt_slice_rotation_angle.value); + return tilt >= BELT_BRIM_MIN_TILT_DEG && tilt <= BELT_BRIM_MAX_TILT_DEG; +} + +bool Print::has_belt_brim() const +{ + return std::any_of(m_objects.begin(), m_objects.end(), [](PrintObject *object) { return object->has_belt_brim(); }); +} + //BBS std::vector Print::layers_sorted_for_object(float start, float end, std::vector &layers_of_objects, std::vector &boundingBox_for_objects, VecOfPoints &objects_instances_shift) { @@ -1342,6 +1360,65 @@ StringObjectException Print::validate(std::vector *warnin } if (m_config.draft_shield != dsDisabled) return { L("Draft shield is not compatible with belt printer mode.") }; + + // Belt brim spans many layers and owns the layers below the object, which + // neither the prime tower nor spiral vase can share. + if (this->has_belt_brim()) { + if (m_config.enable_prime_tower.value) + return { L("Brim is not compatible with the prime tower on a belt printer. " + "Disable one of them.") }; + if (m_config.spiral_mode.value) + return { L("Brim is not compatible with spiral vase mode on a belt printer. " + "Disable one of them.") }; + } + + for (const PrintObject *object : m_objects) { + const PrintObjectConfig &ocfg = object->config(); + const bool wants_brim = ocfg.brim_type != btNoBrim + && (ocfg.brim_width.value > 0. || ocfg.leading_brim_length.value > 0. + || ocfg.extra_brim_width.value > 0.); + if (! wants_brim) + continue; + + if (! this->has_tilted_belt()) { + if (std::abs(m_config.belt_slice_rotation_angle.value) > BELT_BRIM_MAX_TILT_DEG) + warn(L("The belt is too steep for a brim, so no brim will be generated."), + "brim_width", object->model_object()); + else + warn(L("A brim is only generated when the belt is tilted. Set a belt tilt angle, " + "or remove the brim setting."), + "brim_type", object->model_object()); + } + + if (ocfg.brim_type == btAutoBrim || ocfg.brim_type == btEar || ocfg.brim_type == btPainted) + warn(L("Belt printers support outer and inner brim only. Auto, Mouse ear and Painted " + "brim are printed as Outer brim only, using Brim width."), + "brim_type", object->model_object()); + + if (ocfg.leading_brim_length.value > 0. && ocfg.brim_object_gap.value > 0.) + warn(L("Brim-object gap separates the leading brim from the object's leading edge, " + "which is the edge it is meant to anchor. Set the gap to 0 when using leading " + "brim length."), + "brim_object_gap", object->model_object()); + + if (ocfg.leading_brim_length.value > 0. && object->instances().size() > 1) + warn(L("This object has several instances sharing one belt position, so no brim is " + "generated for it. Arrange the copies along the belt instead."), + "leading_brim_length", object->model_object()); + } + if (this->has_belt_brim() && m_objects.size() > 1) + warn(L("Leading brim length extends ahead of each object along the belt, and Arrange does " + "not reserve that space. Leave room between objects."), + "leading_brim_length"); + } else { + // "Leading edge only" describes where a part meets a moving belt, so it has no + // meaning on a fixed bed. Brim.cpp prints it as an ordinary outer brim rather + // than silently producing nothing; say so. + for (const PrintObject *object : m_objects) + if (object->config().brim_type == btLeadingEdgeOnly) + warn(L("\"Leading edge only\" brim applies to belt printers. On this printer it is " + "printed as an ordinary outer brim."), + "brim_type", object->model_object()); } if (nozzles < 2 && extruders.size() > 1) { @@ -2251,8 +2328,28 @@ BoundingBox PrintObject::get_first_layer_bbox(float& a, float& layer_height, std a += area(slice); } } - if (has_brim()) + // Guard on `defined`: make_brim() can return before assigning this (it does on + // belt printers, where has_brim() is still true but the plate brim is skipped), + // and overwriting a valid bbox with an undefined one corrupted the first-layer + // centre and the GUI's first-layer area readout. + if (has_brim() && firstLayerObjectBrimBoundingBox.defined) bbox = firstLayerObjectBrimBoundingBox; + // Belt brim: the apron reaches ahead of the object along the belt. + if (has_belt_brim()) { + const Point shift = instances().empty() ? Point(0, 0) : instances()[0].shift_without_plate_offset(); + for (const ExPolygons &areas : m_belt_brim_areas_by_layer) + for (const ExPolygon &ex : areas) { + BoundingBox bb = get_extents(ex.contour); + bb.translate(shift.x(), shift.y()); + bbox.merge(bb); + } + for (const BeltBrimBand &band : m_belt_brim_prologue) + for (const ExPolygon &ex : band.areas) { + BoundingBox bb = get_extents(ex.contour); + bb.translate(shift.x(), shift.y()); + bbox.merge(bb); + } + } return bbox; } @@ -2804,6 +2901,26 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) } + // Belt brim: bound the first-layer convex hull by the lowest apron band, so + // bed levelling and the initial purge line account for brim that reaches + // ahead of every object. + if (this->has_belt_brim()) { + for (PrintObject *object : m_objects) { + if (! object->has_belt_brim() || object->belt_brim_prologue().empty()) + continue; + const BeltBrimBand &lowest = object->belt_brim_prologue().front(); + for (const PrintInstance &instance : object->instances()) + for (const ExPolygon &ex : lowest.areas) { + Polygon poly = ex.contour; + poly.translate(instance.shift); + append(m_first_layer_convex_hull.points, std::move(poly.points)); + } + } + } + + // Unchanged for belt printers: _make_skirt() already returns early for them, and + // the belt brim does not populate m_brimMapByInstance, which is what the + // skirt/brim grouping reads. if (has_skirt() || has_infinite_skirt() || has_brim()) { // Generate skirt/brim groups after brim so per-object and draft-shield footprints // include brims when grouping and offsetting skirt loops. diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index bb61c210a7..72a12918c7 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -17,6 +17,7 @@ #include "GCode/ThumbnailData.hpp" #include "GCode/GCodeProcessor.hpp" #include "MultiMaterialSegmentation.hpp" +#include "BeltBrim.hpp" #include "BeltTransform.hpp" #include "ObjectID.hpp" #include "libslic3r.h" @@ -384,6 +385,21 @@ public: && ! this->has_raft(); } + // Belt brim. A tilted belt needs its brim laid onto the belt plane over many + // layers instead of as one flat first-layer ring, so it is generated by + // BeltBrim.cpp and stored per layer here. Deliberately separate from + // has_brim(): that predicate feeds PrintRegion extruder collection, support + // trimming and the spiral vase probe, and widening it would perturb belt + // support output. + bool has_belt_brim() const; + const std::vector& belt_brim_by_layer() const { return m_belt_brim_by_layer; } + const std::vector& belt_brim_areas_by_layer() const { return m_belt_brim_areas_by_layer; } + const std::vector& belt_brim_prologue() const { return m_belt_brim_prologue; } + void clear_belt_brim(); + void set_belt_brim(std::vector &&by_layer, + std::vector &&areas, + std::vector &&prologue); + // BBS const ExtrusionEntityCollection& object_skirt() const { return m_skirt; @@ -576,6 +592,12 @@ private: SlicingParameters m_slicing_params; LayerPtrs m_layers; SupportLayerPtrs m_support_layers; + // Belt brim, generated in posSupportMaterial by BeltBrim.cpp. Object-local + // slicing frame, one entry per object layer plus a prologue of brim-only + // bands that print below the object's first layer. + std::vector m_belt_brim_by_layer; + std::vector m_belt_brim_areas_by_layer; + std::vector m_belt_brim_prologue; // BBS std::shared_ptr m_tree_support_preview_cache; @@ -971,6 +993,15 @@ public: bool has_infinite_skirt() const; bool has_skirt() const; bool has_brim() const; + // True when the belt is tilted enough that the BELT plane, not the bed plane, is + // the adhesion surface. The flat plate brim is geometrically meaningless then + // and must not run, whatever the per-object brim settings say - in particular + // brim_type "Auto", which has_brim() reports as enabled even at width 0. + bool has_tilted_belt() const; + // True when at least one object actually gets a tilted-belt brim generated. + // Implies has_tilted_belt(), but additionally requires the object's own brim + // settings to ask for one. + bool has_belt_brim() const; //BBS bool has_auto_brim() const { return std::any_of(m_objects.begin(), m_objects.end(), [](PrintObject* object) { return object->config().brim_type == btAutoBrim; }); diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index b2984164ee..f641699d91 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -508,6 +508,7 @@ static const t_config_enum_values s_keys_map_BrimType = { {"auto_brim", btAutoBrim}, // BBS {"brim_ears", btEar}, // Orca {"painted", btPainted}, // BBS + {"leading_edge_only", btLeadingEdgeOnly}, // belt printers }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BrimType) @@ -1899,6 +1900,45 @@ void PrintConfigDef::init_fff_params() def->mode = comSimple; def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("leading_brim_length", coFloat); + def->label = L("Leading brim length"); + def->category = L("Support"); + def->tooltip = L("Belt printers only. Extends the brim AHEAD of the object along the belt, on " + "every downhill-facing edge of its contact area - both the object's first " + "contact with the belt and any island that lands later. This apron is laid " + "onto the belt before the object reaches it, so the leading edge has " + "something already stuck down to hold on to.\n\n" + "Measured on the belt surface, and added on top of Brim width: the brim " + "reaches Brim-object gap + Leading brim length + Brim width ahead of the " + "object. Set Brim-object gap to 0, or the apron will not touch the object it " + "is meant to anchor.\n\n" + "On a tilted belt each layer lays one strip of the brim, so the thickness of " + "the resulting brim sheet is set by flow rather than by layer height. Use " + "Brim flow ratio to tune it.\n\n" + "Set to 0 to disable."); + def->sidetext = L("mm"); // millimeters, CIS languages need translation + def->min = 0; + def->max = 100; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.)); + + def = this->add("extra_brim_width", coFloat); + def->label = L("Extra brim width"); + def->category = L("Support"); + def->tooltip = L("Belt printers only. Widens the brim SIDEWAYS, across the belt, without " + "extending it further ahead of or behind the object. Use it when a part needs " + "more grip along its length than Brim width alone gives.\n\n" + "Measured on the belt surface, and added on top of Brim width: the brim " + "reaches Brim-object gap + Brim width + Extra brim width to either side of " + "the object. To extend the brim ahead of the object instead, use Leading brim " + "length.\n\n" + "Set to 0 to disable."); + def->sidetext = L("mm"); // millimeters, CIS languages need translation + def->min = 0; + def->max = 100; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("brim_type", coEnum); def->label = L("Brim type"); def->category = L("Support"); @@ -1912,6 +1952,7 @@ void PrintConfigDef::init_fff_params() def->enum_values.emplace_back("inner_only"); def->enum_values.emplace_back("outer_and_inner"); def->enum_values.emplace_back("no_brim"); + def->enum_values.emplace_back("leading_edge_only"); def->enum_labels.emplace_back(L("Auto")); def->enum_labels.emplace_back(L("Mouse ear")); def->enum_labels.emplace_back(L("Painted")); @@ -1919,6 +1960,7 @@ void PrintConfigDef::init_fff_params() def->enum_labels.emplace_back(L("Inner brim only")); def->enum_labels.emplace_back(L("Outer and inner brim")); def->enum_labels.emplace_back(L("No-brim")); + def->enum_labels.emplace_back(L("Leading edge only")); def->mode = comSimple; def->set_default_value(new ConfigOptionEnum(btAutoBrim)); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index acc5f56105..3342a54b6d 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -391,6 +391,10 @@ enum BrimType { btInnerOnly, btOuterAndInner, btNoBrim, + // Belt printers: brim only where the part first touches the belt, nothing after + // that. Appended last so no existing value shifts. On a non-belt printer this + // has no meaning and behaves as btOuterOnly. + btLeadingEdgeOnly, }; enum TimelapseType : int { @@ -1140,6 +1144,8 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, brim_use_efc_outline)) ((ConfigOptionEnum, brim_type)) ((ConfigOptionFloat, brim_width)) + ((ConfigOptionFloat, leading_brim_length)) + ((ConfigOptionFloat, extra_brim_width)) ((ConfigOptionFloat, brim_ears_detection_length)) ((ConfigOptionFloat, brim_ears_max_angle)) ((ConfigOptionFloat, skirt_start_angle)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index e8f7a8e08f..1b8ddf3a9e 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -969,6 +969,13 @@ void PrintObject::generate_support_material() this->_generate_support_material(); m_print->throw_if_canceled(); } + // Belt brim rides here rather than in the brim step because its apron + // prologue introduces print_z values below the object's first layer, and + // those must exist before ToolOrdering is built at psWipeTower - one step + // ahead of psSkirtBrim. The brim options already invalidate + // posSupportMaterial, so this needs no extra invalidation edges. + make_belt_brim(*this); + m_print->throw_if_canceled(); BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material EXIT tid=" << std::this_thread::get_id() << " obj=" << this; this->set_done(posSupportMaterial); } else { @@ -1142,6 +1149,52 @@ void PrintObject::clear_support_layers() l->cantilevers.clear(); } } + // Belt brim is owned by the same step, so it must die with it or an + // invalidate-without-rerun would leave stale bands (and stale prologue Zs) + // behind. Unconditional: unlike support layers it is never shared. + this->clear_belt_brim(); +} + +// Belt brim ------------------------------------------------------------------ +// +// The tilt test is answered from the print CONFIG, not from SlicingParameters: +// invalidating posSupportMaterial clears m_slicing_params.valid, and this is +// queried from Print::process() dispatch, Brim.cpp and the G-code emitter, where +// a stale zero shear factor would silently drop the brim. BeltBrim.cpp itself +// reads the real belt floor through BeltFloorContext, where the parameters are +// guaranteed current. +bool PrintObject::has_belt_brim() const +{ + if (! m_print->has_tilted_belt()) + return false; + // Translating an instance along the belt axis changes its physical belt-floor + // Z, so one set of bands cannot serve several instances sharing a PrintObject. + // belt_force_separate() in PrintApply.cpp gives one instance per object + // whenever a global belt flag is set, which the shipped belt profiles do. + if (m_instances.size() > 1) + 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.) + return false; + return ! this->has_raft(); +} + +void PrintObject::clear_belt_brim() +{ + m_belt_brim_by_layer.clear(); + m_belt_brim_areas_by_layer.clear(); + m_belt_brim_prologue.clear(); +} + +void PrintObject::set_belt_brim(std::vector &&by_layer, + std::vector &&areas, + std::vector &&prologue) +{ + m_belt_brim_by_layer = std::move(by_layer); + m_belt_brim_areas_by_layer = std::move(areas); + m_belt_brim_prologue = std::move(prologue); } std::shared_ptr PrintObject::alloc_tree_support_preview_cache() @@ -1184,6 +1237,8 @@ bool PrintObject::invalidate_state_by_config_options( bool invalidated = false; for (const t_config_option_key &opt_key : opt_keys) { if ( opt_key == "brim_width" + || opt_key == "leading_brim_length" + || opt_key == "extra_brim_width" || opt_key == "brim_object_gap" || opt_key == "brim_use_efc_outline" || opt_key == "brim_type" diff --git a/src/libslic3r/Support/BeltFloorContext.cpp b/src/libslic3r/Support/BeltFloorContext.cpp index d2ffcfd397..eb6cf3670c 100644 --- a/src/libslic3r/Support/BeltFloorContext.cpp +++ b/src/libslic3r/Support/BeltFloorContext.cpp @@ -66,7 +66,7 @@ Polygons BeltFloorContext::half_plane(coordf_t print_z, bool belt_surface) const if (!m_active) return {}; - const double cutoff = (print_z - m_z_shift - m_floor_offset) / m_shear_factor; + const double cutoff = this->cutoff_u(print_z); const coord_t cutoff_scaled = scale_(cutoff); const coord_t large_bound = scale_(1e3); diff --git a/src/libslic3r/Support/BeltFloorContext.hpp b/src/libslic3r/Support/BeltFloorContext.hpp index 7b8b704ef6..3a45a6eba8 100644 --- a/src/libslic3r/Support/BeltFloorContext.hpp +++ b/src/libslic3r/Support/BeltFloorContext.hpp @@ -47,6 +47,12 @@ public: // Returns -infinity if not active. double floor_print_z(const Point &pos_slicing) const; + // The from_axis coordinate (unscaled, slicing frame) where the belt surface + // crosses a horizontal plane at print_z. Inverse of floor_print_z() along + // the shear axis. Only meaningful when is_active(). + coordf_t cutoff_u(coordf_t print_z) const + { return (print_z - m_z_shift - m_floor_offset) / m_shear_factor; } + // Pre-compute belt floor polygons for a range of layers. // layer_print_z(i) returns the print_z for layer index i. std::vector compute_per_layer_floors( diff --git a/src/libslic3r/Support/SupportCommon.cpp b/src/libslic3r/Support/SupportCommon.cpp index e6b93f1717..4ab571edd1 100644 --- a/src/libslic3r/Support/SupportCommon.cpp +++ b/src/libslic3r/Support/SupportCommon.cpp @@ -268,7 +268,9 @@ SupportGeneratorLayersPtr generate_raft_base( // The object does not have a raft. // Calculate the area covered by the brim. const BrimType brim_type = object.config().brim_type; - const bool brim_outer = brim_type == btOuterOnly || brim_type == btOuterAndInner; + // btLeadingEdgeOnly only means anything on a belt printer, where this code path + // does not run; elsewhere it degrades to an outer brim (see Brim.cpp). + const bool brim_outer = brim_type == btOuterOnly || brim_type == btOuterAndInner || brim_type == btLeadingEdgeOnly; const bool brim_inner = brim_type == btInnerOnly || brim_type == btOuterAndInner; // BBS: the pattern of raft and brim are the same, thus the brim can be serpated by support raft. const auto brim_object_gap = scaled(object.config().brim_object_gap.value); diff --git a/src/libslic3r/Support/SupportSpotsGenerator.cpp b/src/libslic3r/Support/SupportSpotsGenerator.cpp index 6fb4908e67..aa79fdb9b8 100644 --- a/src/libslic3r/Support/SupportSpotsGenerator.cpp +++ b/src/libslic3r/Support/SupportSpotsGenerator.cpp @@ -761,7 +761,9 @@ std::tuple build_object_part_from_slice(const size_t &slice_i // thus has lower adhesion. For now this effect will be neglected. ExPolygon slice_poly = layer->lslices[slice_idx]; ExPolygons brim; - if (params.brim_type == BrimType::btOuterAndInner || params.brim_type == BrimType::btOuterOnly) { + // btLeadingEdgeOnly degrades to an outer brim off belt printers (see Brim.cpp). + if (params.brim_type == BrimType::btOuterAndInner || params.brim_type == BrimType::btOuterOnly + || params.brim_type == BrimType::btLeadingEdgeOnly) { Polygon brim_hole = slice_poly.contour; brim_hole.reverse(); Polygons c = expand(slice_poly.contour, scale_(params.brim_width)); // For very small polygons, the expand may result in empty vector, even thought the input is correct. diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index f95260e0c2..3fc69d6e4b 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -630,11 +630,25 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in const bool gcf_is_klipper = gcflavor == GCodeFlavor::gcfKlipper; // Belt printer: detect early since it affects multiple toggle decisions below. + // `is_belt_tilted` is the stricter test that mirrors PrintObject::has_belt_brim(): + // only a tilted belt gets the belt-plane brim, while a belt printer with no + // rotation is geometrically a flat bed and keeps the ordinary plate brim. bool is_belt_printer = false; + bool is_belt_tilted = false; { - const auto *belt_opt = preset_bundle->printers.get_edited_preset().config.option("belt_printer"); + const auto &printer_cfg = preset_bundle->printers.get_edited_preset().config; + const auto *belt_opt = printer_cfg.option("belt_printer"); if (belt_opt) is_belt_printer = belt_opt->value; + const auto *axis = printer_cfg.option>("belt_slice_rotation"); + const auto *angle = printer_cfg.option("belt_slice_rotation_angle"); + if (is_belt_printer && axis != nullptr && angle != nullptr) { + // Same window as Print::has_tilted_belt(); shared constants so the GUI and + // the backend cannot drift apart. + const double tilt = std::abs(angle->value); + is_belt_tilted = (axis->value == BeltRotationAxis::X || axis->value == BeltRotationAxis::Y) + && tilt >= BELT_BRIM_MIN_TILT_DEG && tilt <= BELT_BRIM_MAX_TILT_DEG; + } } bool have_volumetric_extrusion_rate_slope = config->option("max_volumetric_extrusion_rate_slope")->value > 0; @@ -808,21 +822,34 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in toggle_field("skirt_height", false); } - bool have_brim = (config->opt_enum("brim_type") != btNoBrim) && !is_belt_printer; - if (is_belt_printer) - toggle_field("brim_type", false); + // Belt printers now get a brim too, laid onto the tilted belt by BeltBrim.cpp, + // so brim type / width / object gap all apply. A belt printer with no tilt is + // geometrically a flat bed and uses the ordinary plate brim, hence the separate + // is_belt_tilted test. + bool have_brim = config->opt_enum("brim_type") != btNoBrim; toggle_field("brim_object_gap", have_brim); - toggle_field("brim_use_efc_outline", have_brim); - toggle_field("combine_brims", have_brim); - bool have_brim_width = (config->opt_enum("brim_type") != btNoBrim) && config->opt_enum("brim_type") != btAutoBrim && + // Both are first-layer-only concepts that the belt path cannot honour. + toggle_field("brim_use_efc_outline", have_brim && !is_belt_tilted); + toggle_field("combine_brims", have_brim && !is_belt_tilted); + bool have_brim_width = have_brim && config->opt_enum("brim_type") != btAutoBrim && config->opt_enum("brim_type") != btPainted; - toggle_field("brim_width", have_brim_width); + // On a tilted belt Auto / Mouse ear / Painted all collapse to outer-only at the + // configured width, so the width field has to stay live for them too. + toggle_field("brim_width", have_brim_width || (have_brim && is_belt_tilted)); toggle_field("brim_flow_ratio", have_brim); + // Paired toggle_line + toggle_field: cb_toggle_line is null in the per-object + // override panel, so the row cannot be hidden there and greying out is the + // fallback. Both extras are belt-only: one extends the brim ahead along the belt, + // the other widens it across the belt. + for (auto el : { "leading_brim_length", "extra_brim_width" }) { + toggle_line(el, is_belt_tilted); + toggle_field(el, is_belt_tilted && have_brim); + } // Wall filament selectors use the same logic as in Print::extruders(). toggle_field("outer_wall_filament_id", have_perimeters || have_brim); toggle_field("inner_wall_filament_id", have_perimeters || have_brim); - bool have_brim_ear = (config->opt_enum("brim_type") == btEar); + bool have_brim_ear = (config->opt_enum("brim_type") == btEar) && !is_belt_tilted; const auto brim_width = config->opt_float("brim_width"); // disable brim_ears_max_angle and brim_ears_detection_length if brim_width is 0 toggle_field("brim_ears_max_angle", brim_width > 0.0f); diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 6b51167163..19241cbd93 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -86,15 +86,15 @@ std::map> SettingsFactory::OBJECT_C {"make_overhang_printable_angle","", 8},{"make_overhang_printable_hole_size","",9}, {"wall_sequence","",10}, {"precise_z_height", "",10} }}, - { L("Support"), {{"brim_type", "",1},{"brim_width", "",2},{"brim_object_gap", "",3},{"brim_flow_ratio", "",4},{"brim_use_efc_outline", "",5}, - {"enable_support", "",6},{"support_type", "",7},{"support_threshold_angle", "",8}, {"support_threshold_overlap", "",9}, {"support_on_build_plate_only", "",10}, - {"support_filament", "",11},{"support_interface_filament", "",12},{"support_expansion", "",13},{"support_style", "",14}, - {"tree_support_brim_width", "",15}, {"tree_support_branch_angle", "",16},{"tree_support_branch_angle_organic","",17}, {"tree_support_wall_count", "",18},{"tree_support_branch_diameter_angle", "",19},//tree support - {"support_bottom_z_distance", "",20},{"support_top_z_distance", "",21},{"support_base_pattern", "",22},{"support_base_pattern_spacing", "",23}, - {"support_interface_top_layers", "",24},{"support_interface_bottom_layers", "",25},{"support_interface_spacing", "",26},{"support_bottom_interface_spacing", "",27}, - {"support_object_xy_distance", "",28}, {"bridge_no_support", "",29},{"max_bridge_length", "",30},{"support_critical_regions_only", "",31},{"support_remove_small_overhang","",32}, - {"build_plate_tilt_x","",33},{"build_plate_tilt_y","",34}, - {"support_object_first_layer_gap","",35} + { L("Support"), {{"brim_type", "",1},{"brim_width", "",2},{"leading_brim_length", "",3},{"extra_brim_width", "",4},{"brim_object_gap", "",5},{"brim_flow_ratio", "",6},{"brim_use_efc_outline", "",7}, + {"enable_support", "",8},{"support_type", "",9},{"support_threshold_angle", "",10}, {"support_threshold_overlap", "",11}, {"support_on_build_plate_only", "",12}, + {"support_filament", "",13},{"support_interface_filament", "",14},{"support_expansion", "",15},{"support_style", "",16}, + {"tree_support_brim_width", "",17}, {"tree_support_branch_angle", "",18},{"tree_support_branch_angle_organic","",19}, {"tree_support_wall_count", "",20},{"tree_support_branch_diameter_angle", "",21},//tree support + {"support_bottom_z_distance", "",22},{"support_top_z_distance", "",23},{"support_base_pattern", "",24},{"support_base_pattern_spacing", "",25}, + {"support_interface_top_layers", "",26},{"support_interface_bottom_layers", "",27},{"support_interface_spacing", "",28},{"support_bottom_interface_spacing", "",29}, + {"support_object_xy_distance", "",30}, {"bridge_no_support", "",31},{"max_bridge_length", "",32},{"support_critical_regions_only", "",33},{"support_remove_small_overhang","",34}, + {"build_plate_tilt_x","",35},{"build_plate_tilt_y","",36}, + {"support_object_first_layer_gap","",37} }}, { L("Speed"), {{"support_speed", "",12}, {"support_interface_speed", "",13} }} diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 0613467ac8..7a4cefe4fa 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3071,6 +3071,8 @@ void TabPrint::build() optgroup = page->new_optgroup(L("Brim"), L"param_adhension"); optgroup->append_single_option_line("brim_type", "others_settings_brim#type"); optgroup->append_single_option_line("brim_width", "others_settings_brim#width"); + optgroup->append_single_option_line("leading_brim_length", "others_settings_brim#leading-length"); + optgroup->append_single_option_line("extra_brim_width", "others_settings_brim#extra-width"); optgroup->append_single_option_line("brim_object_gap", "others_settings_brim#brim-object-gap"); optgroup->append_single_option_line("brim_flow_ratio", "others_settings_brim#brim-flow-ratio"); optgroup->append_single_option_line("brim_use_efc_outline", "others_settings_brim#brim-use-efc-outline"); diff --git a/tests/fff_print/test_skirt_brim.cpp b/tests/fff_print/test_skirt_brim.cpp index 3f63d3de5f..755dec06e0 100644 --- a/tests/fff_print/test_skirt_brim.cpp +++ b/tests/fff_print/test_skirt_brim.cpp @@ -1,6 +1,8 @@ #include +#include "libslic3r/ClipperUtils.hpp" #include "libslic3r/GCodeReader.hpp" +#include "libslic3r/Layer.hpp" #include "libslic3r/Config.hpp" #include "libslic3r/Geometry.hpp" #include "libslic3r/Geometry/ConvexHull.hpp" @@ -441,3 +443,193 @@ SCENARIO("Skirt and brim generation", "[SkirtBrim]") { } } } + +// Belt printers --------------------------------------------------------------- +// +// On a tilted belt the brim is laid onto the belt PLANE rather than into the Z=0 +// bed plane, so it is spread across many layers instead of living on the first +// one. The discriminating measurement is the number of contiguous brim runs in +// the G-code: a flat plate brim gives a single run, a belt brim gives one per +// layer that carries a band. Distinct Z values are useless here, because the +// machine-frame transform couples Y into Z so every belt move has its own Z. +static DynamicPrintConfig belt_brim_config() +{ + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "belt_printer", 1 }, + { "belt_slice_rotation", "x" }, + { "belt_slice_rotation_angle", 45 }, + { "belt_slice_rotation_global", 1 }, + { "gcode_remap_x", "rev_x" }, + { "gcode_remap_y", "pos_z" }, + { "gcode_remap_z", "pos_y" }, + { "layer_height", 0.2 }, + { "initial_layer_print_height", 0.2 }, + { "skirt_loops", 0 }, + { "top_shell_layers", 0 }, + { "bottom_shell_layers", 1 }, + { "machine_start_gcode", "T[initial_tool]\n" }, + }); + return config; +} + +TEST_CASE("Belt brim spans many layers instead of one", "[SkirtBrim][belt]") +{ + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "outer_only" }, + { "brim_width", 5 }, + }); + const std::string gcode = slice({ cube(20) }, config); + // A plate-brim implementation would score 1 here. + CHECK(role_passes(gcode, "brim") > 10); +} + +TEST_CASE("Belt brim is absent when both widths are zero", "[SkirtBrim][belt]") +{ + // The "no effect when disabled" guard: brim_type Auto is the shipped default and + // reports has_brim() even at width 0, so this also pins the gate that keeps the + // flat plate brim from running on a tilted belt. + const char *brim_type = GENERATE("auto_brim", "outer_only", "no_brim"); + DYNAMIC_SECTION("brim_type " << brim_type) { + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", brim_type }, + { "brim_width", 0 }, + { "leading_brim_length", 0 }, + { "extra_brim_width", 0 }, + }); + const std::string gcode = slice({ cube(20) }, config); + CHECK(role_passes(gcode, "brim") == 0); + } +} + +TEST_CASE("Leading brim length alone produces a belt brim", "[SkirtBrim][belt]") +{ + // Exercises the leading_brim_length-only enablement path and the downhill sweep. + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "outer_only" }, + { "brim_width", 0 }, + { "leading_brim_length", 5 }, + { "brim_object_gap", 0 }, + }); + const std::string gcode = slice({ cube(20) }, config); + CHECK(role_passes(gcode, "brim") > 0); +} + +TEST_CASE("Leading brim length reaches further ahead of the object", "[SkirtBrim][belt]") +{ + // Compared between two runs rather than against an absolute coordinate, so the + // assertion survives any change of origin or axis remap. + auto brim_extent = [](double extra) { + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "outer_only" }, + { "brim_width", 3 }, + { "leading_brim_length", extra }, + { "brim_object_gap", 0 }, + }); + const std::string gcode = slice({ cube(20) }, config); + // The apron prints before the object reaches the belt, so it shows up as brim + // extrusion at the lowest machine Z of any brim move. + double min_z = std::numeric_limits::max(); + GCodeReader parser; + parser.parse_buffer(gcode, [&min_z](GCodeReader &self, const GCodeReader::GCodeLine &line) { + if (line.extruding(self) && line.comment().find("brim") != std::string_view::npos) + min_z = std::min(min_z, static_cast(self.z())); + }); + return min_z; + }; + const double without = brim_extent(0.); + const double with = brim_extent(10.); + REQUIRE(without < std::numeric_limits::max()); + REQUIRE(with < std::numeric_limits::max()); + CHECK(with < without); +} + +TEST_CASE("Every brim type slices on a belt printer", "[SkirtBrim][belt]") +{ + // Auto / Mouse ear / Painted collapse to outer-only rather than crashing or + // silently producing nothing. + const char *brim_type = GENERATE("auto_brim", "brim_ears", "painted", "outer_only", + "inner_only", "outer_and_inner", "no_brim"); + DYNAMIC_SECTION("brim_type " << brim_type) { + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", brim_type }, + { "brim_width", 5 }, + }); + const std::string gcode = slice({ cube(20) }, config); + REQUIRE(! gcode.empty()); + if (std::string(brim_type) == "no_brim") + CHECK(role_passes(gcode, "brim") == 0); + else if (std::string(brim_type) != "inner_only") + // A solid cube has no holes, so inner_only legitimately yields nothing. + CHECK(role_passes(gcode, "brim") > 0); + } +} + +TEST_CASE("An untilted belt printer gets no brim", "[SkirtBrim][belt]") +{ + // Belt brim needs a tilt to have a belt plane to lie on, and the flat plate brim + // cannot reach the G-code on any belt printer: it is emitted out of + // skirt_brim_groups(), which _make_skirt() builds, and that returns early for every + // belt printer. So an untilted belt printer gets nothing - unchanged by this + // feature. Making the flat brim work here would mean reopening the belt skirt gate, + // which is a separate change; Print::validate() warns instead. + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "belt_slice_rotation", "none" }, + { "brim_type", "outer_only" }, + { "brim_width", 5 }, + }); + const std::string gcode = slice({ cube(20) }, config); + CHECK(role_passes(gcode, "brim") == 0); +} + +TEST_CASE("Belt brim does not resurrect the skirt", "[SkirtBrim][belt]") +{ + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "outer_only" }, + { "brim_width", 5 }, + { "skirt_loops", 2 }, + }); + const std::string gcode = slice({ cube(20) }, config); + CHECK(role_passes(gcode, "skirt") == 0); +} + +TEST_CASE("Belt brim lines all have the same width", "[SkirtBrim][belt]") +{ + // Each brim line's extrusion volume comes from its nozzle-to-belt clearance. Anchoring + // every line to a fixed fraction of its own band gives them all the same clearance, so + // they all come out the same width. The nominal-spacing lattice this replaced let each + // line land wherever it fell inside its band, so the clearance - and the width with it - + // varied by 2x, which showed up as visibly ragged brim. + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "outer_only" }, + { "brim_width", 5 }, + { "brim_object_gap", 0 }, + }); + Print print; + init_and_process_print({ cube(20) }, print, config); + const PrintObject *obj = print.objects().front(); + + std::vector widths; + auto collect = [&widths](const ExtrusionEntityCollection &coll) { + for (const ExtrusionEntity *ee : coll.entities) + if (const auto *path = dynamic_cast(ee)) + widths.push_back(path->width); + }; + for (const ExtrusionEntityCollection &band : obj->belt_brim_by_layer()) + collect(band); + for (const BeltBrimBand &band : obj->belt_brim_prologue()) + collect(band.fills); + + REQUIRE(widths.size() > 10); + const float lo = *std::min_element(widths.begin(), widths.end()); + const float hi = *std::max_element(widths.begin(), widths.end()); + CHECK_THAT(hi, Catch::Matchers::WithinRel(lo, 1e-4)); +} diff --git a/tests/libslic3r/CMakeLists.txt b/tests/libslic3r/CMakeLists.txt index 7524c27479..b564a948d7 100644 --- a/tests/libslic3r/CMakeLists.txt +++ b/tests/libslic3r/CMakeLists.txt @@ -8,6 +8,7 @@ add_executable(${_TEST_NAME}_tests test_arachne_walls.cpp test_arrange.cpp test_bambu_networking.cpp + test_belt_brim.cpp test_calib.cpp test_clipper_offset.cpp test_clipper_utils.cpp diff --git a/tests/libslic3r/test_belt_brim.cpp b/tests/libslic3r/test_belt_brim.cpp new file mode 100644 index 0000000000..9f645817e9 --- /dev/null +++ b/tests/libslic3r/test_belt_brim.cpp @@ -0,0 +1,341 @@ +#include + +#include "libslic3r/BeltBrim.hpp" +#include "libslic3r/BoundingBox.hpp" +#include "libslic3r/ClipperUtils.hpp" +#include "libslic3r/ExPolygon.hpp" + +using namespace Slic3r; + +// Pure-geometry tests for the belt brim. No Print, no slicing: everything here is +// a property of the tilted-belt mapping and the sweep/lattice helpers, which is +// exactly the part that has to be right before any G-code is worth looking at. + +static ExPolygon make_box(coord_t x0, coord_t y0, coord_t x1, coord_t y1) +{ + ExPolygon out; + out.contour.points = { Point(x0, y0), Point(x1, y0), Point(x1, y1), Point(x0, y1) }; + return out; +} + +static void add_hole(ExPolygon &ex, coord_t x0, coord_t y0, coord_t x1, coord_t y1) +{ + Polygon hole; + // Holes run clockwise, opposite the contour. + hole.points = { Point(x0, y0), Point(x0, y1), Point(x1, y1), Point(x1, y0) }; + ex.holes.emplace_back(std::move(hole)); +} + +SCENARIO("sweep_ex sweeps a box", "[BeltBrim]") { + const coord_t mm = scale_(1.); + GIVEN("a 10x10 mm box") { + const ExPolygons src { make_box(0, 0, 10 * mm, 10 * mm) }; + + WHEN("swept 5 mm along -Y") { + const ExPolygons out = sweep_ex(src, Point(0, -5 * mm)); + THEN("it becomes one 10x15 mm box") { + REQUIRE(out.size() == 1); + REQUIRE(out.front().holes.empty()); + const BoundingBox bb = get_extents(out); + CHECK(bb.min.y() == -5 * mm); + CHECK(bb.max.y() == 10 * mm); + CHECK(bb.min.x() == 0); + CHECK(bb.max.x() == 10 * mm); + CHECK_THAT(unscale(unscale(out.front().area())), + Catch::Matchers::WithinRel(150., 1e-6)); + } + } + + WHEN("swept by a zero vector") { + THEN("it is unchanged") { + const ExPolygons out = sweep_ex(src, Point(0, 0)); + REQUIRE(out.size() == 1); + CHECK(out.front().area() == src.front().area()); + } + } + + WHEN("swept diagonally") { + // For a convex P, area(P + [0,t]) == area(P) + |t| * width of P + // perpendicular to t. For a square swept along (1,1)/sqrt2 the + // perpendicular width is the diagonal, 10*sqrt2. + const ExPolygons out = sweep_ex(src, Point(3 * mm, 3 * mm)); + THEN("area grows by |t| times the perpendicular width") { + const double expected = 100. + std::sqrt(2. * 9.) * (10. * std::sqrt(2.)); + CHECK_THAT(unscale(unscale(out.front().area())), + Catch::Matchers::WithinRel(expected, 1e-6)); + } + } + } +} + +SCENARIO("sweep_ex closes holes narrower than the sweep", "[BeltBrim]") { + const coord_t mm = scale_(1.); + // This is the assertion that catches the two likeliest implementation bugs: + // omitting hole boundaries from the parallelogram set, or using the wrong + // Clipper fill rule. Note hole survival depends on the hole's extent ALONG + // the sweep direction, not on its narrowest dimension. + GIVEN("a 20x20 mm box with a hole 2 mm tall in the sweep direction") { + ExPolygon ex = make_box(0, 0, 20 * mm, 20 * mm); + add_hole(ex, 5 * mm, 9 * mm, 15 * mm, 11 * mm); + WHEN("swept 5 mm along -Y") { + const ExPolygons out = sweep_ex(ExPolygons{ ex }, Point(0, -5 * mm)); + THEN("the hole is filled in") { + REQUIRE(out.size() == 1); + CHECK(out.front().holes.empty()); + } + } + } + GIVEN("a 20x20 mm box with a hole 12 mm tall in the sweep direction") { + ExPolygon ex = make_box(0, 0, 20 * mm, 20 * mm); + add_hole(ex, 5 * mm, 4 * mm, 15 * mm, 16 * mm); + WHEN("swept 5 mm along -Y") { + const ExPolygons out = sweep_ex(ExPolygons{ ex }, Point(0, -5 * mm)); + THEN("the hole survives, shrunk by the sweep") { + REQUIRE(out.size() == 1); + REQUIRE(out.front().holes.size() == 1); + const BoundingBox hb = get_extents(out.front().holes.front()); + CHECK(hb.max.y() - hb.min.y() == 7 * mm); + } + } + } + GIVEN("a box whose edges are parallel to the sweep vector") { + // Degenerate parallelograms; Clipper must simply discard them. + const ExPolygons src { make_box(0, 0, 10 * mm, 10 * mm) }; + WHEN("swept along +X") { + const ExPolygons out = sweep_ex(src, Point(4 * mm, 0)); + THEN("the result is the expected rectangle") { + REQUIRE(out.size() == 1); + const BoundingBox bb = get_extents(out); + CHECK(bb.min.x() == 0); + CHECK(bb.max.x() == 14 * mm); + } + } + } + GIVEN("a reversed (clockwise) contour") { + ExPolygon ex = make_box(0, 0, 10 * mm, 10 * mm); + ex.contour.reverse(); + WHEN("swept") { + const ExPolygons out = sweep_ex(ExPolygons{ ex }, Point(0, -5 * mm)); + THEN("material is still produced") { + REQUIRE(! out.empty()); + CHECK(get_extents(out).min.y() == -5 * mm); + } + } + } +} + +SCENARIO("Belt flattening round-trips and rescales only the shear axis", "[BeltBrim]") { + const coord_t mm = scale_(1.); + const double shear = GENERATE(0.1, 0.5, 1.0, 3.0); + const int from_axis = GENERATE(0, 1); + DYNAMIC_SECTION("shear " << shear << " axis " << from_axis) { + const BeltBrimFrame frame { shear, from_axis }; + + // An L shape with a hole, so contours and holes are both exercised. + ExPolygon ex; + ex.contour.points = { Point(0, 0), Point(20 * mm, 0), Point(20 * mm, 6 * mm), + Point(6 * mm, 6 * mm), Point(6 * mm, 20 * mm), Point(0, 20 * mm) }; + add_hole(ex, 2 * mm, 2 * mm, 4 * mm, 4 * mm); + const ExPolygons src { ex }; + + const ExPolygons round_tripped = belt_unflatten(belt_flatten(src, frame), frame); + REQUIRE(round_tripped.size() == src.size()); + REQUIRE(round_tripped.front().holes.size() == src.front().holes.size()); + for (size_t c = 0; c < src.front().num_contours(); ++ c) { + const Points &a = src.front().contour_or_hole(c).points; + const Points &b = round_tripped.front().contour_or_hole(c).points; + REQUIRE(a.size() == b.size()); + for (size_t i = 0; i < a.size(); ++ i) { + // Rounding, not truncation, so the round trip stays within a + // couple of coordinate units. + CHECK(std::abs(a[i].x() - b[i].x()) <= 2); + CHECK(std::abs(a[i].y() - b[i].y()) <= 2); + // The axis that is not stretched must come back untouched. + if (from_axis == 0) + CHECK(a[i].y() == b[i].y()); + else + CHECK(a[i].x() == b[i].x()); + } + } + } +} + +SCENARIO("Flattening makes shear-axis distances true on-belt distances", "[BeltBrim]") { + // The property the whole design rests on: an in-plane distance w projects to + // dw = w * cos(tilt) along the shear axis, so stretching that axis by + // 1/cos(tilt) makes ordinary Clipper offsets measure real on-belt distance. + const coord_t mm = scale_(1.); + const double shear = GENERATE(0.1, 0.5, 1.0, 3.0); + const int from_axis = GENERATE(0, 1); + DYNAMIC_SECTION("shear " << shear << " axis " << from_axis) { + const BeltBrimFrame frame { shear, from_axis }; + const double stretch = std::sqrt(1. + shear * shear); + CHECK_THAT(frame.u_stretch(), Catch::Matchers::WithinRel(stretch, 1e-12)); + CHECK_THAT(frame.cos_tilt() * frame.u_stretch(), Catch::Matchers::WithinRel(1., 1e-12)); + + // Two points 1 mm apart along the shear axis are stretch mm apart once + // flattened. + ExPolygon seg = make_box(0, 0, 1 * mm, 1 * mm); + const BoundingBox flat = get_extents(belt_flatten(ExPolygons{ seg }, frame)); + const coord_t span_u = from_axis == 0 ? flat.max.x() - flat.min.x() + : flat.max.y() - flat.min.y(); + CHECK_THAT(unscale(span_u), Catch::Matchers::WithinRel(stretch, 1e-5)); + } +} + +SCENARIO("belt_brim_line_positions walks an exact lattice", "[BeltBrim]") { + const coord_t pitch = 420; // arbitrary units; the point is exactness + const coord_t anchor = 1000; + + GIVEN("a band narrower than the pitch containing no lattice point") { + // Between anchor+0 and anchor+pitch, pick a window that misses both. + const std::vector us = belt_brim_line_positions(anchor + 100, anchor + 300, pitch, anchor); + THEN("nothing is emitted") { CHECK(us.empty()); } + } + GIVEN("a band containing exactly one lattice point") { + const std::vector us = belt_brim_line_positions(anchor - 10, anchor + 10, pitch, anchor); + THEN("that point is emitted") { + REQUIRE(us.size() == 1); + CHECK(us.front() == anchor); + } + } + GIVEN("a wide band, as at a shallow belt tilt") { + const std::vector us = belt_brim_line_positions(anchor, anchor + 5 * pitch, pitch, anchor); + THEN("several lines are emitted at exactly the pitch") { + REQUIRE(us.size() == 5); + for (size_t i = 1; i < us.size(); ++ i) + CHECK(us[i] - us[i - 1] == pitch); + } + } + GIVEN("two adjacent bands sharing a boundary") { + // Half-open ownership: a lattice point landing on the shared bound belongs + // to the upper band only, so no line is duplicated or dropped. + const coord_t bound = anchor + 2 * pitch; + const std::vector lower = belt_brim_line_positions(anchor, bound, pitch, anchor); + const std::vector upper = belt_brim_line_positions(bound, bound + 2 * pitch, pitch, anchor); + THEN("the boundary point appears exactly once, in the upper band") { + CHECK(std::count(lower.begin(), lower.end(), bound) == 0); + CHECK(std::count(upper.begin(), upper.end(), bound) == 1); + CHECK(lower.size() == 2); + CHECK(upper.size() == 2); + } + } + GIVEN("a lattice anchored below zero") { + THEN("negative lattice points are handled") { + const std::vector us = belt_brim_line_positions(-3 * pitch, -pitch, pitch, 0); + REQUIRE(us.size() == 2); + CHECK(us.front() == -3 * pitch); + CHECK(us.back() == -2 * pitch); + } + } + GIVEN("a degenerate pitch or band") { + THEN("nothing is emitted rather than looping forever") { + CHECK(belt_brim_line_positions(0, 1000, 0, 0).empty()); + CHECK(belt_brim_line_positions(1000, 1000, pitch, 0).empty()); + CHECK(belt_brim_line_positions(1000, 500, pitch, 0).empty()); + } + } +} + +SCENARIO("belt_brim_region reduces to the plate brim without an apron", "[BeltBrim]") { + const coord_t mm = scale_(1.); + const BeltBrimFrame frame { 1.0, 1 }; + const ExPolygons footprint { make_box(0, 0, 20 * mm, 20 * mm) }; + const coord_t width = 3 * mm; + const coord_t gap = 1 * mm; + + GIVEN("outer brim, no apron") { + const ExPolygons region = belt_brim_region(footprint, true, false, width, gap, 0, 0, frame); + THEN("it matches the plate brim ring built from the same offsets") { + const ExPolygons inner = offset_ex(Polygons{ footprint.front().contour }, float(gap), jtRound, SCALED_RESOLUTION); + const ExPolygons outer = offset_ex(inner, float(width), jtRound, SCALED_RESOLUTION); + const ExPolygons expect = diff_ex(outer, inner); + // Not exact: the region is offset from the CLOSED footprint, and closing a + // single convex island is a geometric no-op but still round-trips every + // vertex through a dilate/erode, which perturbs the area in the 8th + // significant figure. + CHECK_THAT(unscale(unscale(area(region))), + Catch::Matchers::WithinRel(unscale(unscale(area(expect))), 1e-6)); + } + } + GIVEN("no outer and no inner brim") { + THEN("the region is empty") { + CHECK(belt_brim_region(footprint, false, false, width, gap, 5 * mm, 0, frame).empty()); + } + } + GIVEN("an apron but no brim width") { + const ExPolygons region = belt_brim_region(footprint, true, false, 0, 0, 5 * mm, 0, frame); + THEN("brim appears only downhill of the footprint") { + REQUIRE(! region.empty()); + const BoundingBox rb = get_extents(region); + // shear > 0 means downhill is -u, and from_axis 1 means u is Y. + CHECK(rb.min.y() < 0); + CHECK(rb.max.y() <= 0 + 2); // nothing above the footprint's own base + } + } +} + +SCENARIO("The apron follows the sign of the shear", "[BeltBrim]") { + // Guards the one sign convention that is easiest to get backwards: which way + // is downhill, i.e. which way the belt carries the part. + const coord_t mm = scale_(1.); + const ExPolygons footprint { make_box(0, 0, 20 * mm, 20 * mm) }; + + const ExPolygons pos = belt_brim_region(footprint, true, false, 0, 0, 5 * mm, 0, BeltBrimFrame{ 1.0, 1 }); + const ExPolygons neg = belt_brim_region(footprint, true, false, 0, 0, 5 * mm, 0, BeltBrimFrame{ -1.0, 1 }); + REQUIRE(! pos.empty()); + REQUIRE(! neg.empty()); + CHECK(get_extents(pos).min.y() < 0); + CHECK(get_extents(neg).max.y() > 20 * mm); +} + +SCENARIO("Outer belt brim does not fill the space between contact islands", "[BeltBrim]") { + // A belt contact patch is often a narrow, broken-up strip. Offsetting each island + // outwards by brim_width merges the rings of any two islands closer than + // 2 x brim_width and fills the space between them - and on a belt that space is + // UNDERNEATH the part, which is not what "outer brim only" means. Closing the + // footprint before the outward offset is what prevents it. + const coord_t mm = scale_(1.); + const BeltBrimFrame frame { 1.0, 1 }; + const coord_t width = 3 * mm; + + GIVEN("two contact islands 4 mm apart, closer than 2 x brim width") { + const ExPolygons footprint { + make_box(0, 0, 10 * mm, 10 * mm), + make_box(14 * mm, 0, 24 * mm, 10 * mm), + }; + const ExPolygons region = belt_brim_region(footprint, true, false, width, 0, 0, 0, frame); + THEN("no brim is placed in the gap between them") { + REQUIRE(! region.empty()); + // Midpoint of the gap, and a point just inside either edge of it. + for (const coord_t x : { 12 * mm, coord_t(10.5 * mm), coord_t(13.5 * mm) }) { + const Point probe(x, 5 * mm); + bool covered = false; + for (const ExPolygon &ex : region) + if (ex.contains(probe)) { covered = true; break; } + CHECK(! covered); + } + } + THEN("brim is still placed outside the pair") { + bool outside_covered = false; + const Point probe(-1 * mm, 5 * mm); // 1 mm left of the left island + for (const ExPolygon &ex : region) + if (ex.contains(probe)) { outside_covered = true; break; } + CHECK(outside_covered); + } + } + + GIVEN("an apron on a fragmented footprint") { + const ExPolygons footprint { + make_box(0, 0, 10 * mm, 10 * mm), + make_box(14 * mm, 0, 24 * mm, 10 * mm), + }; + // Closing fills concavities only, so an outward protrusion such as the apron must + // survive it untouched. + const ExPolygons region = belt_brim_region(footprint, true, false, width, 0, 5 * mm, 0, frame); + THEN("the apron still reaches downhill") { + REQUIRE(! region.empty()); + CHECK(get_extents(region).min.y() <= -5 * mm); + } + } +} From b1905ebc20e0f065519909dd0fa6670911a0610a Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 6 Aug 2026 01:08:44 -0500 Subject: [PATCH 074/389] Belt brim: fixes from review Six issues found by reviewing the previous commit against belt-printer, two of them release-blocking. Data race (high). Print::process() runs generate_support_material() for all objects in a tbb::parallel_for, and make_belt_brim() runs at its tail, but belt_brim_obstacles() read every OTHER object's support_layers() - which a concurrent task may be inside clear_support_layers() deleting. That is a use-after-free, and even when it survives, the obstacle set depends on which object finishes first. Only this object's own supports are consulted now; they are complete at that point. Foreign objects still contribute their slices, which are finished and immutable before the support phase. Apron bands dropped (high), two separate causes. An apron band prints below its own object's first layer, but another object can already be printing at that print_z, in which case process_layer() takes the ordinary path and never emitted the band - the emission is now shared by both paths. Separately, a band whose print_z matched a support layer of the SAME object was overwritten in the print-wide merge, which keeps one record per object per z and could not detect the collision because LayerToPrint::layer() is null for a band. The per-object pairing loop is now a three-way merge over object, support and apron streams, so each object contributes at most one record per z. Multi-instance was far too strict (medium). It refused belt brim for every multi-instance object, killing plain brim width and inner brim too, and only warned when a leading length was set. Only movement ALONG the belt changes an instance's belt-floor Z, so copies side by side ACROSS the belt share one set of bands perfectly well; belt_brim_instances_compatible() now tests just that, and the warning fires whenever the brim is actually suppressed. Apron layer bookkeeping (medium). Apron layers count toward m_layer_count and advance m_layer_index, but emitted no Z/height tags, left m_last_layer_z, m_max_layer_z and m_last_height stale - so the first object layer computed its height against a pre-apron Z - and skipped before_layer_change_gcode and layer_change_gcode entirely. All of that now matches the ordinary path. Obstacle cost (low). belt_brim_obstacles() ran a full-plate union per band. A bounding-box pre-filter drops non-overlapping objects before materialising any polygon, and the union is skipped for trivial inputs. Deliberately unchanged: every apron band still reports cooling layer_id 0. CoolingBuffer uses it for the initial_layer_fan_speed override and the close_fan_the_first_x_layers gate, and every band lies on the belt plane itself, so it is all first-layer material by the only definition that means anything on a belt. Numbering the bands would ramp the fan up while still printing on the belt. Now documented at the assignment rather than left implicit. --- src/libslic3r/BeltBrim.cpp | 49 ++++++++--- src/libslic3r/GCode.cpp | 121 +++++++++++++++++++++++----- src/libslic3r/GCode.hpp | 8 ++ src/libslic3r/Print.cpp | 11 ++- src/libslic3r/Print.hpp | 3 + src/libslic3r/PrintObject.cpp | 28 +++++-- tests/fff_print/test_skirt_brim.cpp | 104 ++++++++++++++++++++++++ 7 files changed, 282 insertions(+), 42 deletions(-) diff --git a/src/libslic3r/BeltBrim.cpp b/src/libslic3r/BeltBrim.cpp index 40ecc60f58..fa119c6609 100644 --- a/src/libslic3r/BeltBrim.cpp +++ b/src/libslic3r/BeltBrim.cpp @@ -324,24 +324,46 @@ static void belt_brim_band_paths(const BeltBrimContext &bc, } } -// Union of everything actually extruded at `print_z` by any object, expressed in -// `self`'s local slicing frame. Includes `self` itself: its slice at this Z can -// overhang outside the belt footprint and land in the brim ring, which the -// flattened brim_object_gap - a belt-plane separation - does not cover. -static Polygons belt_brim_obstacles(const Print &print, const PrintObject &self, coordf_t print_z, coordf_t tol) +// Union of everything extruded at `print_z` that the brim must keep clear of, expressed +// in `self`'s local slicing frame. Includes `self` itself: its slice at this Z can +// overhang outside the belt footprint and land in the brim ring, which the flattened +// brim_object_gap - a belt-plane separation - does not cover. +// +// THREADING: this runs inside posSupportMaterial, which Print::process() executes for all +// objects in a tbb::parallel_for (Print.cpp). Object slices are finished by then and safe +// to read across objects, but SUPPORT layers are not: another object's thread may be +// inside clear_support_layers() - which deletes the SupportLayer pointers - right now, so +// touching a foreign object's support_layers() here is a use-after-free. Only this +// object's own supports are consulted; they are complete, because make_belt_brim() runs at +// the tail of this object's own generate_support_material(). The cost is that the brim +// does not dodge a *different* object's support at the same Z, which needs the objects to +// overlap in the belt direction in the first place. +// `region_bbox` bounds the brim; anything outside it cannot clip a brim line, so whole +// objects are skipped without materialising their polygons. On a typical plate the +// objects do not overlap and every foreign object drops out here, which matters because +// this runs once per band - hundreds of times per object. +static Polygons belt_brim_obstacles(const Print &print, const PrintObject &self, + const BoundingBox ®ion_bbox, coordf_t print_z, coordf_t tol) { const Point shift_self = self.instances().empty() ? Point(0, 0) : self.instances().front().shift_without_plate_offset(); Polygons out; - for (const PrintObject *o : print.objects()) + for (const PrintObject *o : print.objects()) { + const bool is_self = (o == &self); for (const PrintInstance &inst : o->instances()) { const Point delta = inst.shift_without_plate_offset() - shift_self; if (const Layer *l = o->get_layer_at_printz(print_z, tol)) { - Polygons ps = to_polygons(l->lslices); - for (Polygon &p : ps) - p.translate(delta); - polygons_append(out, std::move(ps)); + BoundingBox lb = get_extents(l->lslices); + lb.translate(delta.x(), delta.y()); + if (lb.overlap(region_bbox)) { + Polygons ps = to_polygons(l->lslices); + for (Polygon &p : ps) + p.translate(delta); + polygons_append(out, std::move(ps)); + } } + if (! is_self) + continue; if (const SupportLayer *sl = o->get_support_layer_at_printz(print_z, tol)) { Polygons ps = sl->support_fills.polygons_covered_by_spacing(); for (Polygon &p : ps) @@ -349,6 +371,9 @@ static Polygons belt_brim_obstacles(const Print &print, const PrintObject &self, polygons_append(out, std::move(ps)); } } + } + if (out.size() < 2) + return out; // union_() of 0 or 1 polygons is pure overhead return union_(out); } @@ -453,7 +478,7 @@ void make_belt_brim(PrintObject &object) std::vector areas_by_layer(nlayers); for (size_t i = 0; i < nlayers; ++ i) { const Layer &layer = *object.layers()[i]; - const Polygons obstacles = belt_brim_obstacles(print, object, layer.print_z, 0.5 * layer.height); + const Polygons obstacles = belt_brim_obstacles(print, object, bc.region_bbox, layer.print_z, 0.5 * layer.height); belt_brim_band_paths(bc, layer.print_z, layer.height, obstacles, by_layer[i], areas_by_layer[i]); } @@ -473,7 +498,7 @@ void make_belt_brim(PrintObject &object) + bc.ctx.floor_offset() + bc.ctx.z_shift(); if (h > EPSILON) for (coordf_t z = first.print_z - h; z > z_lead - h; z -= h) { - const Polygons obstacles = belt_brim_obstacles(print, object, z, 0.5 * h); + const Polygons obstacles = belt_brim_obstacles(print, object, bc.region_bbox, z, 0.5 * h); BeltBrimBand band; band.print_z = z; band.height = h; diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index f2caca404f..5b76f53ab5 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2125,22 +2125,20 @@ std::vector GCode::collect_layers_to_print(const PrintObjec std::vector> warning_ranges; - // Belt printers: the brim apron is stuck to the belt AHEAD of the part, which - // on a tilted belt means below the object's first layer. Those bands carry no - // object or support layer, so they are emitted first and handled by - // process_layer()'s brim-only branch. Already ordered lowest print_z first. - for (const BeltBrimBand &band : object.belt_brim_prologue()) { - LayerToPrint prologue_layer; - prologue_layer.belt_brim_band = &band; - prologue_layer.original_object = &object; - layers_to_print.push_back(prologue_layer); - } - // Pair the object layers with the support layers by z. + // + // Belt printers add a third stream: brim apron bands, which sit on the belt AHEAD of + // the part and so print below the object's first layer. They are merged here rather + // than pushed as standalone records, because a band's print_z can coincide with a + // support layer of this same object - and the print-wide merge downstream keeps only + // one record per object per z, so a standalone band would be silently overwritten. size_t idx_object_layer = 0; size_t idx_support_layer = 0; + size_t idx_brim_band = 0; + const auto &brim_bands = object.belt_brim_prologue(); // ordered by ascending print_z const LayerToPrint* last_extrusion_layer = nullptr; - while (idx_object_layer < object.layers().size() || idx_support_layer < object.support_layers().size()) { + while (idx_object_layer < object.layers().size() || idx_support_layer < object.support_layers().size() + || idx_brim_band < brim_bands.size()) { LayerToPrint layer_to_print; double print_z_min = std::numeric_limits::max(); if (idx_object_layer < object.layers().size()) { @@ -2153,6 +2151,11 @@ std::vector GCode::collect_layers_to_print(const PrintObjec print_z_min = std::min(print_z_min, layer_to_print.support_layer->print_z); } + if (idx_brim_band < brim_bands.size()) { + layer_to_print.belt_brim_band = &brim_bands[idx_brim_band++]; + print_z_min = std::min(print_z_min, layer_to_print.belt_brim_band->print_z); + } + if (layer_to_print.object_layer && layer_to_print.object_layer->print_z > print_z_min + EPSILON) { layer_to_print.object_layer = nullptr; --idx_object_layer; @@ -2163,11 +2166,17 @@ std::vector GCode::collect_layers_to_print(const PrintObjec --idx_support_layer; } + if (layer_to_print.belt_brim_band && layer_to_print.belt_brim_band->print_z > print_z_min + EPSILON) { + layer_to_print.belt_brim_band = nullptr; + --idx_brim_band; + } + layer_to_print.original_object = &object; layers_to_print.push_back(layer_to_print); bool has_extrusions = (layer_to_print.object_layer && layer_to_print.object_layer->has_extrusions()) - || (layer_to_print.support_layer && layer_to_print.support_layer->has_extrusions()); + || (layer_to_print.support_layer && layer_to_print.support_layer->has_extrusions()) + || (layer_to_print.belt_brim_band && ! layer_to_print.belt_brim_band->fills.empty()); // Check that there are extrusions on the very first layer. The case with empty // first layer may result in skirt/brim in the air and maybe other issues. @@ -5266,20 +5275,26 @@ LayerResult GCode::process_belt_brim_layer( const bool last_layer, const size_t single_object_instance_idx) { - // layer_id 0: the apron precedes every object layer and nothing downstream - // indexes by it. spiral_vase_enable false: spiral vase is refused alongside - // belt brim in Print::validate(). cooling_buffer_flush true: an apron layer is - // a complete layer, and the default (object_layer || raft_layer || last_layer) - // would be false here, so fan and slowdown would never be applied to it. + // layer_id 0 is deliberate, not a placeholder. CoolingBuffer reads it for the + // initial_layer_fan_speed override and the close_fan_the_first_x_layers gate + // (CoolingBuffer.cpp), and every apron band is first-layer material by the only + // definition that means anything on a belt: it lies on the belt plane itself. Numbering + // the bands 1, 2, 3... would ramp the fan up while still printing on the belt. + // spiral_vase_enable false: spiral vase is refused alongside belt brim in + // Print::validate(). cooling_buffer_flush true: an apron layer is a complete layer, and + // the default (object_layer || raft_layer || last_layer) is false here, so fan and + // slowdown would otherwise never be applied to it. LayerResult result { {}, 0, false, true }; if (layer_tools.extruders.empty()) // Nothing to extrude. return result; coordf_t print_z = 0.; + coordf_t height = 0.; for (const LayerToPrint <p : layers) if (ltp.belt_brim_band != nullptr) { print_z = ltp.belt_brim_band->print_z; + height = ltp.belt_brim_band->height; break; } @@ -5298,8 +5313,63 @@ LayerResult GCode::process_belt_brim_layer( const unsigned int extruder_id = layer_tools.extruders.front(); if (m_writer->filament() == nullptr || m_writer->filament()->id() != extruder_id) gcode += this->set_extruder(extruder_id, print_z); + + // An apron band is a real printed layer: it is counted in m_layer_count, it advances + // m_layer_index through change_layer(), and the G-code viewer needs its Z/height tags. + // Keep the same caches and hooks the ordinary path maintains, or the first object layer + // would compute its height against a stale pre-apron Z and layer-change templates would + // skip these layers entirely. + { + char buf[64]; + sprintf(buf, ";%s%g\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change).c_str(), print_z); + gcode += buf; + sprintf(buf, ";Z:%g\n", print_z); + gcode += buf; + const float band_height = float(height); + sprintf(buf, ";%s%g\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Height).c_str(), band_height); + gcode += buf; + m_last_layer_z = float(print_z); + m_max_layer_z = std::max(m_max_layer_z, m_last_layer_z); + m_last_height = band_height; + } + + if (! m_config.before_layer_change_gcode.value.empty()) { + DynamicConfig config; + config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index + 1)); + config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); + config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); + gcode += this->placeholder_parser_process("before_layer_change_gcode", + print.config().before_layer_change_gcode.value, m_writer->filament()->id(), &config) + "\n"; + } + gcode += this->change_layer(print_z); + if (! m_config.layer_change_gcode.value.empty()) { + DynamicConfig config; + config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); + config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); + config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); + gcode += this->placeholder_parser_process("layer_change_gcode", + print.config().layer_change_gcode.value, m_writer->filament()->id(), &config) + "\n"; + } + + gcode += this->emit_belt_brim_bands(print, layers, single_object_instance_idx); + + result.gcode = std::move(gcode); + return result; +} + +// Emit every apron band carried by this set of layers. +// +// Shared by the brim-only branch above and the ordinary process_layer() path. Both need +// it: an apron band prints below its OWN object's first layer, but on a multi-object belt +// another object can already be printing at that print_z, in which case the layer has an +// object layer, takes the ordinary path, and the band would be silently dropped. +std::string GCode::emit_belt_brim_bands(const Print &print, + const std::vector &layers, + const size_t single_object_instance_idx) +{ + std::string gcode; for (const LayerToPrint <p : layers) { const BeltBrimBand *band = ltp.belt_brim_band; if (band == nullptr || band->fills.empty() || ltp.original_object == nullptr) @@ -5324,9 +5394,7 @@ LayerResult GCode::process_belt_brim_layer( m_avoid_crossing_perimeters.disable_once(); } } - - result.gcode = std::move(gcode); - return result; + return gcode; } // Bedslinger model. The heavier the bed load, the lower the achievable Y acceleration for a given @@ -5821,6 +5889,17 @@ LayerResult GCode::process_layer( //BBS: set layer time fan speed after layer change gcode gcode += ";_SET_FAN_SPEED_CHANGING_LAYER\n"; + // Belt printers: an apron band prints below its own object's first layer, but with + // several objects on the belt another one can already be printing at this print_z. + // The layer then has an object layer and takes this ordinary path instead of the + // brim-only branch, so the band has to be emitted here or it would be dropped. + // Before any object extrusion at this Z, as the brim must go down first. + if (print.has_belt_brim()) { + const Vec2d saved_origin = m_origin; + gcode += this->emit_belt_brim_bands(print, layers, single_object_instance_idx); + this->set_origin(saved_origin); + } + //Calibration Layer-specific GCode // ORCA-Belt: on belt printers the calibration object is counter-rotated to // stand upright in slicing space on top of a support wedge, so its first diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index d4c7bf9bc3..54b7e8abd4 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -418,6 +418,14 @@ protected: const bool last_layer, const size_t single_object_instance_idx); + // Emit the apron bands carried by these layers. Called from both the brim-only + // branch and the ordinary path, since a band's print_z can coincide with another + // object's layer on a multi-object belt. + std::string emit_belt_brim_bands( + const Print &print, + const std::vector &layers, + const size_t single_object_instance_idx); + LayerResult process_layer( const Print &print, // Set of object & print layers of the same PrintObject and with the same print_z. diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 189f9e178e..2df4cde79b 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1401,10 +1401,13 @@ StringObjectException Print::validate(std::vector *warnin "brim length."), "brim_object_gap", object->model_object()); - if (ocfg.leading_brim_length.value > 0. && object->instances().size() > 1) - warn(L("This object has several instances sharing one belt position, so no brim is " - "generated for it. Arrange the copies along the belt instead."), - "leading_brim_length", object->model_object()); + // Unconditional: this suppresses the WHOLE belt brim, not just the apron, so a + // user asking for any brim at all needs to be told they are getting none. + if (! object->belt_brim_instances_compatible()) + warn(L("This object's copies are spaced along the belt, so they would each need " + "their own brim and none is generated. Print them as separate objects, or " + "arrange the copies side by side across the belt."), + "brim_type", object->model_object()); } if (this->has_belt_brim() && m_objects.size() > 1) warn(L("Leading brim length extends ahead of each object along the belt, and Arrange does " diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index 72a12918c7..4b1f4891f2 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -392,6 +392,9 @@ public: // trimming and the spiral vase probe, and widening it would perturb belt // support output. bool has_belt_brim() const; + // False when this object's instances sit at different points ALONG the belt, which + // would need a separate set of bands each. Public so validate() can explain it. + bool belt_brim_instances_compatible() const; const std::vector& belt_brim_by_layer() const { return m_belt_brim_by_layer; } const std::vector& belt_brim_areas_by_layer() const { return m_belt_brim_areas_by_layer; } const std::vector& belt_brim_prologue() const { return m_belt_brim_prologue; } diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 1b8ddf3a9e..c5d5409d73 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1167,11 +1167,7 @@ bool PrintObject::has_belt_brim() const { if (! m_print->has_tilted_belt()) return false; - // Translating an instance along the belt axis changes its physical belt-floor - // Z, so one set of bands cannot serve several instances sharing a PrintObject. - // belt_force_separate() in PrintApply.cpp gives one instance per object - // whenever a global belt flag is set, which the shipped belt profiles do. - if (m_instances.size() > 1) + if (! this->belt_brim_instances_compatible()) return false; if (m_config.brim_type == btNoBrim) return false; @@ -1181,6 +1177,28 @@ bool PrintObject::has_belt_brim() const return ! this->has_raft(); } +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 + // the same height on the belt. Moving an instance ALONG the belt axis changes its + // physical belt-floor Z and would put its brim at the wrong height; moving it ACROSS + // the belt does not, so side-by-side copies are fine. + // + // belt_force_separate() in PrintApply.cpp already gives one instance per PrintObject + // whenever a global belt flag is set, which the shipped belt profiles do - this only + // matters for configurations that do not. + if (m_instances.size() <= 1) + return true; + const int axis = m_slicing_params.belt_floor_from_axis; + const Point &ref = m_instances.front().shift; + for (const PrintInstance &inst : m_instances) { + const coord_t along = axis == 0 ? inst.shift.x() - ref.x() : inst.shift.y() - ref.y(); + if (std::abs(along) > SCALED_EPSILON) + return false; + } + return true; +} + void PrintObject::clear_belt_brim() { m_belt_brim_by_layer.clear(); diff --git a/tests/fff_print/test_skirt_brim.cpp b/tests/fff_print/test_skirt_brim.cpp index 755dec06e0..b5d315db2a 100644 --- a/tests/fff_print/test_skirt_brim.cpp +++ b/tests/fff_print/test_skirt_brim.cpp @@ -633,3 +633,107 @@ TEST_CASE("Belt brim lines all have the same width", "[SkirtBrim][belt]") const float hi = *std::max_element(widths.begin(), widths.end()); CHECK_THAT(hi, Catch::Matchers::WithinRel(lo, 1e-4)); } + +TEST_CASE("Belt apron survives another object printing at the same Z", "[SkirtBrim][belt]") +{ + // An apron band prints below its OWN object's first layer, but with two objects on the + // belt the second one is already printing at that print_z. The layer then has an + // object layer and takes the ordinary process_layer() path rather than the brim-only + // branch, so the band must be emitted from both or it is silently dropped. A + // single-object print cannot exercise this. + auto brim_passes = [](int object_count) { + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "outer_only" }, + { "brim_width", 3 }, + { "leading_brim_length", 8 }, + { "brim_object_gap", 0 }, + }); + std::vector meshes; + for (int i = 0; i < object_count; ++ i) { + TriangleMesh m = cube(20); + // Offset along the belt so the second object starts well after the first. + m.translate(0.f, float(40 * i), 0.f); + meshes.emplace_back(std::move(m)); + } + Print print; + Model model; + init_print(std::move(meshes), print, model, config); + print.process(); + return role_passes(gcode(print), "brim"); + }; + + const int one = brim_passes(1); + const int two = brim_passes(2); + REQUIRE(one > 0); + // Two identical objects should carry twice the brim. Merely asserting `two > one` + // would not be decisive: the FIRST object's apron survives the bug, because nothing + // else is printing that early, so only the second object's apron goes missing. + // Requiring close to 2x is what actually detects the dropped bands. + CHECK(two >= 1.8 * one); +} + +TEST_CASE("Belt brim allows instances placed across the belt", "[SkirtBrim][belt]") +{ + // Only movement ALONG the belt changes an instance's belt-floor Z, so copies placed + // side by side ACROSS it share one set of bands and must still get a brim. The first + // version of this guard refused every multi-instance object outright, silently + // dropping the brim. + // + // The global belt flags are off here so the instances stay in one PrintObject; with + // them on, PrintApply splits each instance into its own object and the case cannot + // arise at all. + auto multi_instance_has_brim = [](double dx, double dy) { + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "belt_slice_rotation_global", 0 }, + { "belt_preslice_global", 0 }, + { "preslice_remap_global", 0 }, + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "brim_object_gap", 0 }, + }); + Print print; + Model model; + ModelObject *object = model.add_object(); + object->name += "object.stl"; + object->add_volume(cube(20)); + object->add_instance()->set_offset(Vec3d(80., 80., 0.)); + object->add_instance()->set_offset(Vec3d(80. + dx, 80. + dy, 0.)); + object->ensure_on_bed(); + print.auto_assign_extruders(object); + print.apply(model, config); + print.validate(); + print.set_status_silent(); + print.process(); + REQUIRE(print.objects().size() == 1); + REQUIRE(print.objects().front()->instances().size() == 2); + return print.objects().front()->has_belt_brim(); + }; + + // X is across the belt when the tilt is about X, since the shear then runs along Y. + CHECK(multi_instance_has_brim(40., 0.)); + // Y is along the belt: the copies sit at different belt heights and would each need + // their own bands, so the brim is refused (and validate() warns). + CHECK_FALSE(multi_instance_has_brim(0., 40.)); +} + +TEST_CASE("Belt brim coexists with support material", "[SkirtBrim][belt]") +{ + // Supports put extra layers into the same z stream as the apron bands, which is what + // the three-way merge in collect_layers_to_print() exists to handle: a band sharing a + // print_z with a support layer of the SAME object used to overwrite it in the + // print-wide merge. A smoke test - it cannot prove the collision occurred - but it + // does exercise the merge with all three streams populated. + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "leading_brim_length", 6 }, + { "brim_object_gap", 0 }, + { "enable_support", 1 }, + }); + const std::string gc = slice({ TestMesh::overhang }, config); + REQUIRE(! gc.empty()); + CHECK(role_passes(gc, "brim") > 0); +} From 849e6493f81a2961a4ed5588d1ce94f3d7760418 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 6 Aug 2026 03:54:19 -0500 Subject: [PATCH 075/389] Belt brim: offer "Leading edge only" only on belt printers "Leading edge only" describes where a part meets a moving belt, so it has no meaning on a fixed bed and should not clutter the Brim type dropdown there. Filtered the same way support_style and wipe_tower_wall_type already are a few lines above in TabPrint::toggle_options(): the field holds its own copy of the option definition, and Choice maps the combobox selection straight onto that copy's enum_values, so rewriting the values, the labels and the combobox items together keeps the mapping correct. The entry is kept when it is the current value, so opening a project that uses it on a non-belt printer cannot leave the control displaying an option it does not offer - which would silently rewrite the setting on the next edit. Print::validate() already warns that it prints as an ordinary outer brim there. Matches the scope of the existing precedents: the per-object override panel is not filtered. --- src/slic3r/GUI/Tab.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 7a4cefe4fa..5508b6e099 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3227,6 +3227,41 @@ void TabPrint::toggle_options() cb->SetValue(n); } + // "Leading edge only" describes where a part meets a moving belt, so it is offered only + // on belt printers. Same pattern as support_style above: the field owns a copy of the + // option definition, and Choice maps the combobox selection straight onto that copy's + // enum_values, so rewriting both together keeps the mapping correct. + field = m_active_page->get_field("brim_type"); + if (auto choice = dynamic_cast(field)) { + bool is_belt_printer = false; + if (m_preset_bundle) { + const auto *belt_opt = m_preset_bundle->printers.get_edited_preset().config.option("belt_printer"); + if (belt_opt) + is_belt_printer = belt_opt->value; + } + auto def = print_config_def.get("brim_type"); + const auto current = m_config->opt_enum("brim_type"); + auto &opt = const_cast(field->m_opt); + auto cb = dynamic_cast(choice->window); + if (cb != nullptr) { + auto n = cb->GetValue(); + opt.enum_values.clear(); + opt.enum_labels.clear(); + cb->Clear(); + for (size_t i = 0; i < def->enum_values.size(); ++ i) { + // Keep the entry if it is already selected, so switching to a non-belt + // printer cannot leave the control showing a value it does not offer. + if (def->enum_values[i] == "leading_edge_only" && ! is_belt_printer + && current != btLeadingEdgeOnly) + continue; + opt.enum_values.push_back(def->enum_values[i]); + opt.enum_labels.push_back(def->enum_labels[i]); + cb->Append(_(def->enum_labels[i])); + } + cb->SetValue(n); + } + } + // BBL printers do not support cone wipe tower field = m_active_page->get_field("wipe_tower_wall_type"); if (auto choice = dynamic_cast(field)) { From 88d5e9e4425c18089140b4811bfe6a2f5d1d162a Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 5 Aug 2026 03:34:04 -0500 Subject: [PATCH 076/389] Fix: reset BuildVolume belt state when leaving belt mode (R1) Non-belt branch of set_bed_shape reset only the 3DBed renderer, not the BuildVolume; Bed3D::set_shape early-returns on unchanged bed, so a belt->normal switch or in-place belt toggle-off left the BuildVolume with m_is_belt_printer=true and inflated Y bounds -> out-of-bounds objects treated as printable on a normal printer. --- src/slic3r/GUI/Plater.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index a67e424fc8..365384ecf9 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -12387,6 +12387,12 @@ void Plater::priv::set_bed_shape(const Pointfs &shape, // G-code load time (GCodeViewer::compute_belt_back_transform), so no mesh-side // inverse needs to be pushed to the viewer here. } else { + // Reset the BuildVolume belt state too: Bed3D::set_shape early-returns when + // the bed params are unchanged, so a belt->normal switch (or toggling belt off + // on the same printer) would otherwise leave the BuildVolume with + // m_is_belt_printer=true and an inflated Y bbox, wrongly treating out-of-bounds + // objects as printable. Idempotent for a printer that was never belt. + bed.build_volume().set_belt_printer(false, 0., false); bed.set_belt_printer(false, 0.f); if (preview) preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(false, 0.f); From 0d921803255337b688587df114f534f3e96bf3cd Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 5 Aug 2026 03:34:04 -0500 Subject: [PATCH 077/389] Fix: clear belt fields in GCodeProcessorResult::reset() (R2) reset() cleared the sibling machine_frame_transform_active but not belt_tilt_angle/belt_z_origin/preslice_remap_*; a reused result carried stale belt metadata into a subsequent normal print, flipping the store_z branch and corrupting start-gcode preview Z for non-belt prints. --- src/libslic3r/GCode/GCodeProcessor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 43536c30b9..e872a2f652 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2531,6 +2531,11 @@ void GCodeProcessorResult::reset() { timelapse_warning_code = 0; printable_height = 0.0f; machine_frame_transform_active = false; + belt_tilt_angle = 0.f; + belt_z_origin = 0.f; + preslice_remap_x = RemapAxis::PosX; + preslice_remap_y = RemapAxis::PosY; + preslice_remap_z = RemapAxis::PosZ; settings_ids.reset(); filaments_count = 0; backtrace_enabled = false; From 10810908a96169cb364cca96d561804484b4e4b4 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 5 Aug 2026 03:35:09 -0500 Subject: [PATCH 078/389] Fix: restore atomic node invalidation in TreeSupport::drop_nodes + drop unused var (R3, R9) The 2-node merge moved the two valid=false writes outside the mutex that upstream held together with the contact_nodes push_back; restore a single critical section per branch (belt branch also guards to_buildplate). Remove an unused top_interface_layers local in drop_nodes. --- src/libslic3r/Support/TreeSupport.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index faed27164f..412104e0ed 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -2859,7 +2859,6 @@ void TreeSupport::drop_nodes() const size_t tip_layers = base_radius / layer_height; //The number of layers to be shrinking the circle to create a tip. This produces a 45 degree angle. const coordf_t radius_sample_resolution = m_ts_data->m_radius_sample_resolution; const bool support_on_buildplate_only = config.support_on_build_plate_only.value; - const size_t top_interface_layers = config.support_interface_top_layers.value; const auto belt_floor_mode = m_print_config->belt_support_floor_mode.value; const bool has_belt_floor = std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON && belt_floor_mode == BeltSupportFloorMode::GeneratorOnly; @@ -3100,19 +3099,21 @@ void TreeSupport::drop_nodes() // Treat as object-surface termination (not buildplate) so // the node gets floor/interface areas instead of base pads. if (has_belt_floor && print_z_next <= belt_floor_print_z(next_position)) { + std::scoped_lock lock(m_ts_data->m_mutex); node_parent->to_buildplate = false; + neighbour->valid = false; + p_node->valid = false; } else { const bool to_buildplate = !is_inside_ex(get_collision(0, obj_layer_nr_next), next_position); SupportNode* next_node = m_ts_data->create_node(next_position, node_parent->distance_to_top + 1, obj_layer_nr_next, node_parent->support_roof_layers_below - (node_parent->distance_to_top >= 0 ? 1 : 0), to_buildplate, node_parent, print_z_next, height_next); get_max_move_dist(next_node); - m_ts_data->m_mutex.lock(); + std::scoped_lock lock(m_ts_data->m_mutex); contact_nodes[layer_nr_next].push_back(next_node); - m_ts_data->m_mutex.unlock(); + neighbour->valid = false; + p_node->valid = false; } - neighbour->valid = false; - p_node->valid = false; } else if (neighbours.size() > 1) //Don't merge leaf nodes because we would then incur movement greater than the maximum move distance. { From 049612022a8233c2757e4f8b418518fd3f91d22e Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 5 Aug 2026 03:35:58 -0500 Subject: [PATCH 079/389] Perf: avoid unconditional lower-layer polygon copies in support overhang paths (R4, R5) SupportMaterial::detect_overhangs copied lower_layer_polygons per region even without build-plate tilt; hoist the tilted copy out of the region loop and use the original polygons directly when untilted. TreeSupport3D flattened lslices_extrudable to Polygons unconditionally; restore the upstream ExPolygons offset on the untilted path. --- src/libslic3r/Support/SupportMaterial.cpp | 27 ++++++++++++++--------- src/libslic3r/Support/TreeSupport3D.cpp | 7 ++++-- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/libslic3r/Support/SupportMaterial.cpp b/src/libslic3r/Support/SupportMaterial.cpp index ae5ba5849e..9230807b4b 100644 --- a/src/libslic3r/Support/SupportMaterial.cpp +++ b/src/libslic3r/Support/SupportMaterial.cpp @@ -1475,6 +1475,19 @@ static inline ExPolygons detect_overhangs( } } + // Apply build plate tilt: shift lower layer polygons to simulate tilted gravity. + // This is loop-invariant across regions, so compute it once here. + const Polygons *effective_lower = &lower_layer_polygons; + Polygons tilted_lower; + if (has_tilt) { + tilted_lower = lower_layer_polygons; + const double lh = lower_layer.height; + Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), + coord_t(scale_(lh * tan(tilt_x_rad)))); + translate(tilted_lower, tilt_shift); + effective_lower = &tilted_lower; + } + for (LayerRegion *layerm : layer.regions()) { // Extrusion width accounts for the roundings of the extrudates. // It is the maximum widh of the extrudate. @@ -1491,17 +1504,9 @@ static inline ExPolygons detect_overhangs( // Overhang polygons for this layer and region. Polygons diff_polygons; Polygons layerm_polygons = to_polygons(layerm->slices.surfaces); - // Apply build plate tilt: shift lower layer polygons to simulate tilted gravity - Polygons effective_lower = lower_layer_polygons; - if (has_tilt) { - const double lh = lower_layer.height; - Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), - coord_t(scale_(lh * tan(tilt_x_rad)))); - translate(effective_lower, tilt_shift); - } if (lower_layer_offset == 0.f) { // Support everything. - diff_polygons = diff(layerm_polygons, effective_lower); + diff_polygons = diff(layerm_polygons, *effective_lower); if (buildplate_only) { // Don't support overhangs above the top surfaces. // This step is done before the contact surface is calculated by growing the overhang region. @@ -1512,7 +1517,7 @@ static inline ExPolygons detect_overhangs( //FIXME cache the lower layer offset if this layer has multiple regions. diff_polygons = diff(layerm_polygons, - expand(effective_lower, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS)); + expand(*effective_lower, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS)); if (buildplate_only && ! annotations.buildplate_covered[layer_id].empty()) { // Don't support overhangs above the top surfaces. // This step is done before the contact surface is calculated by growing the overhang region. @@ -1522,7 +1527,7 @@ static inline ExPolygons detect_overhangs( // Offset the support regions back to a full overhang, restrict them to the full overhang. // This is done to increase size of the supporting columns below, as they are calculated by // propagating these contact surfaces downwards. - diff_polygons = diff(intersection(expand(diff_polygons, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS), layerm_polygons), effective_lower); + diff_polygons = diff(intersection(expand(diff_polygons, lower_layer_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS), layerm_polygons), *effective_lower); } //FIXME add user defined filtering here based on minimal area or minimum radius or whatever. diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index 702815e5bb..66b4338d24 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -260,14 +260,17 @@ static std::vector>> group_me } else lower_layer_offset = scaled(lower_layer.height / tan_threshold); // Apply build plate tilt: shift lower layer polygons to simulate tilted gravity - Polygons lower_src = to_polygons(lower_layer.lslices_extrudable); + Polygons lower_layer_offseted; if (has_tilt) { + Polygons lower_src = to_polygons(lower_layer.lslices_extrudable); const double lh = lower_layer.height; Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), coord_t(scale_(lh * tan(tilt_x_rad)))); translate(lower_src, tilt_shift); + lower_layer_offseted = offset(lower_src, lower_layer_offset); + } else { + lower_layer_offseted = offset(lower_layer.lslices_extrudable, lower_layer_offset); } - Polygons lower_layer_offseted = offset(lower_src, lower_layer_offset); overhangs = diff(current_layer.lslices_extrudable, lower_layer_offseted); if (lower_layer_offset == 0) { raw_overhangs = overhangs; From f8fe5a07cdbd026a08550cf809ed3aaad70495f5 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 5 Aug 2026 03:35:25 -0500 Subject: [PATCH 080/389] Perf: hoist frame-invariant slope up_direction/normal_z out of the per-volume render loop (R6) Belt slope-shading changes recomputed up_direction (with a printer-preset config lookup) and normal_z per volume; both are frame-invariant. Compute once before the to_render loop and reuse the already-hoisted support_normal_z. Uniforms are still set per volume; visuals unchanged. --- src/slic3r/GUI/3DScene.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index 6f7ca47919..1dd11bccf6 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -1075,6 +1075,20 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, const float support_normal_z = get_selection_support_normal_z(); + // Compute up direction accounting for build plate tilt. This is frame-invariant + // (config cannot change mid-render), so compute it once before the volume loop. + Vec3f up_direction = Vec3f::UnitZ(); + { + const DynamicPrintConfig& prt_cfg = GUI::wxGetApp().preset_bundle->printers.get_edited_preset().config; + double tilt_x_deg = prt_cfg.opt_float("build_plate_tilt_x"); + double tilt_y_deg = prt_cfg.opt_float("build_plate_tilt_y"); + if (tilt_x_deg != 0. || tilt_y_deg != 0.) { + double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); + double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); + up_direction = Vec3f(float(tan(tilt_y_rad)), float(tan(tilt_x_rad)), 1.f).normalized(); + } + } + for (GLVolumeWithIdAndZ& volume : to_render) { #if ENABLE_MODIFIERS_ALWAYS_TRANSPARENT if (type == ERenderType::Transparent) { @@ -1132,21 +1146,6 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, shader->set_uniform("print_volume.type", -1); } - const float normal_z = get_selection_support_normal_z(); - - // Compute up direction accounting for build plate tilt - Vec3f up_direction = Vec3f::UnitZ(); - { - const DynamicPrintConfig& prt_cfg = GUI::wxGetApp().preset_bundle->printers.get_edited_preset().config; - double tilt_x_deg = prt_cfg.opt_float("build_plate_tilt_x"); - double tilt_y_deg = prt_cfg.opt_float("build_plate_tilt_y"); - if (tilt_x_deg != 0. || tilt_y_deg != 0.) { - double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); - double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); - up_direction = Vec3f(float(tan(tilt_y_rad)), float(tan(tilt_x_rad)), 1.f).normalized(); - } - } - // Per-extruder printable-height shading. The flag is set to // 2.0 only for multi-extruder printers (two per-extruder heights); otherwise it is forced to 0.0 // on every render so no stale flag survives a multi->single-extruder plate switch, keeping the @@ -1167,7 +1166,7 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, shader->set_uniform("volume_world_matrix", volume.first->world_matrix()); shader->set_uniform("slope.actived", m_slope.isGlobalActive && !volume.first->is_modifier && !volume.first->is_wipe_tower); shader->set_uniform("slope.volume_world_normal_matrix", static_cast(volume.first->world_matrix().matrix().block(0, 0, 3, 3).inverse().transpose().cast())); - shader->set_uniform("slope.normal_z", normal_z); + shader->set_uniform("slope.normal_z", support_normal_z); shader->set_uniform("slope.up_direction", up_direction); #if ENABLE_ENVIRONMENT_MAP From 6fd2de76e6b9274b4811d8f92cfc8c9acd00416c Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 5 Aug 2026 03:35:12 -0500 Subject: [PATCH 081/389] Fix: preserve upstream select-by-angle behavior when build plate is untilted (R7) select_facets_by_angle replaced upstream's limit.dot(down) threshold with cos(threshold), changing facet selection for non-uniformly-scaled/mirror objects on ALL printers. Restore the exact upstream computation when no build-plate tilt is active; keep the tilted-gravity form only under tilt. --- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index 26afdbbe33..c0d791aa00 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -567,7 +567,12 @@ void GLGizmoFdmSupports::select_facets_by_angle(float threshold_deg, bool block) auto [tilt_x_deg, tilt_y_deg] = get_build_plate_tilt(); double tilt_x_rad = tilt_x_deg * M_PI / 180.0; double tilt_y_rad = tilt_y_deg * M_PI / 180.0; - Vec3d gravity_dir = Vec3d(-tan(tilt_y_rad), -tan(tilt_x_rad), -1.0).normalized(); + const bool has_tilt = (tilt_x_deg != 0. || tilt_y_deg != 0.); + // NB: use an if, not a ?:, so each branch converts to Vec3d independently + // (the two Eigen expression types don't unify in a ternary). + Vec3d gravity_dir = -Vec3d::UnitZ(); + if (has_tilt) + gravity_dir = Vec3d(-tan(tilt_y_rad), -tan(tilt_x_rad), -1.0).normalized(); int mesh_id = -1; for (const ModelVolume* mv : mo->volumes) { @@ -578,7 +583,16 @@ void GLGizmoFdmSupports::select_facets_by_angle(float threshold_deg, bool block) const Transform3d trafo_matrix = mi->get_matrix_no_offset() * mv->get_matrix_no_offset(); Vec3f down = (trafo_matrix.inverse() * gravity_dir).cast().normalized(); - float dot_limit = std::cos(threshold); + float dot_limit; + if (!has_tilt) { + // Exact upstream computation: threshold derived from a tilted limit + // vector transformed into mesh space, so non-uniform/mirror/shear + // transforms behave identically to upstream. + Vec3f limit = (trafo_matrix.inverse() * Vec3d(std::sin(threshold), 0, -std::cos(threshold))).cast().normalized(); + dot_limit = limit.dot(down); + } else { + dot_limit = std::cos(threshold); + } // Now calculate dot product of vert_direction and facets' normals. int idx = 0; From 7fc86db5f0c3876d641dc278d13ff4a93da4428b Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 5 Aug 2026 03:37:48 -0500 Subject: [PATCH 082/389] Fix: only clear belt-derived build_plate_tilt on genuine belt->off transition (R8) update_fff() zeroed any build_plate_tilt matching the dormant belt-derived tilt (default X/45) within 0.01, wiping a legitimate manual tilt on a non-belt tilted-bed printer. Track the belt->non-belt transition and the exact values belt-sync wrote, clearing only those on an in-place toggle; reset tracking on preset load so preset switches never wipe tilt. --- src/slic3r/GUI/Tab.cpp | 43 +++++++++++++++++++++++++++++++----------- src/slic3r/GUI/Tab.hpp | 7 +++++++ 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 5508b6e099..8de8bf6e84 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -5875,6 +5875,18 @@ if (is_marlin_flavor) // this gets executed after preset is loaded and before GUI fields are updated void TabPrinter::on_preset_loaded() { + // R8: reset the belt-tilt transition tracking to reflect the freshly loaded preset WITHOUT + // running update_fff()'s reset logic. on_preset_loaded() is called from Tab::load_current_preset() + // on every printer preset load, right before update()->update_fff(). Seeding m_was_belt_printer + // from the loaded preset's belt_printer flag means a preset switch (belt preset -> non-belt preset) + // enters update_fff() with m_was_belt_printer==false, so the belt->off clear branch is skipped and + // the newly loaded preset's manual tilt is preserved. An in-place belt toggle does NOT go through + // here (only through on_value_change->update), so m_was_belt_printer stays true there and the clear + // still fires. Seed m_belt_synced_tilt from the loaded tilt as a safeguard. + m_was_belt_printer = m_config->opt_bool("belt_printer"); + m_belt_synced_tilt_x = m_config->opt_float("build_plate_tilt_x"); + m_belt_synced_tilt_y = m_config->opt_float("build_plate_tilt_y"); + // Orca //update nozzle_volume_type const Preset& current_printer = m_preset_bundle->printers.get_selected_preset(); @@ -6477,9 +6489,15 @@ void TabPrinter::update_fff() // Belt printer: auto-sync build_plate_tilt_{x,y} (which drives support gravity tilt) // from the belt slicing rotation, the single source of truth for the physical tilt. - // Tilt about X drives tilt_x, tilt about Y drives tilt_y. When belt mode is off, - // reset whichever tilt axis matches a leftover belt value so we don't clobber a - // manually-set tilt on a non-belt tilted printer. + // Tilt about X drives tilt_x, tilt about Y drives tilt_y. + // + // R8: value-guessing (zeroing any tilt matching the dormant belt-derived tilt) wiped a + // legitimate manual build_plate_tilt on a non-belt tilted-bed printer, because the belt + // defaults (rotation=X, angle=45) make a manual tilt of 45 look belt-derived. Instead we + // track the belt->non-belt transition and the exact values belt-sync wrote, and clear the + // tilt only on a genuine in-place belt-off toggle, and only if the value is still what + // belt-sync last wrote. Preset switches reset the tracking in on_preset_loaded(), so they + // never trip the reset. if (m_config->opt_bool("belt_printer")) { auto rot_axis = m_config->option>("belt_slice_rotation")->value; const auto tilt = BeltTransformPipeline::physical_tilt( @@ -6488,17 +6506,20 @@ void TabPrinter::update_fff() m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(tilt.tilt_x_deg)); if (m_config->opt_float("build_plate_tilt_y") != tilt.tilt_y_deg) m_config->set_key_value("build_plate_tilt_y", new ConfigOptionFloat(tilt.tilt_y_deg)); - } else { - const auto tilt = BeltTransformPipeline::physical_tilt( - m_config->option>("belt_slice_rotation")->value, - m_config->opt_float("belt_slice_rotation_angle")); - double tx = m_config->opt_float("build_plate_tilt_x"); - double ty = m_config->opt_float("build_plate_tilt_y"); - if (tx != 0. && std::abs(tx - tilt.tilt_x_deg) < 0.01) + // Remember exactly what belt-sync wrote, so an in-place belt-off toggle can distinguish + // a still-belt-derived tilt (safe to clear) from a since-edited manual one (keep). + m_belt_synced_tilt_x = tilt.tilt_x_deg; + m_belt_synced_tilt_y = tilt.tilt_y_deg; + } else if (m_was_belt_printer) { + // Genuine in-place belt->off toggle on the same preset (on_preset_loaded() was not called + // since the last update, so m_was_belt_printer still reflects belt mode). Clear each axis + // only if it still holds the value belt-sync last wrote; a manual override is preserved. + if (m_config->opt_float("build_plate_tilt_x") == m_belt_synced_tilt_x) m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(0.)); - if (ty != 0. && std::abs(ty - tilt.tilt_y_deg) < 0.01) + if (m_config->opt_float("build_plate_tilt_y") == m_belt_synced_tilt_y) m_config->set_key_value("build_plate_tilt_y", new ConfigOptionFloat(0.)); } + m_was_belt_printer = m_config->opt_bool("belt_printer"); toggle_options(); } diff --git a/src/slic3r/GUI/Tab.hpp b/src/slic3r/GUI/Tab.hpp index 9be9bc17f8..996f1b7d97 100644 --- a/src/slic3r/GUI/Tab.hpp +++ b/src/slic3r/GUI/Tab.hpp @@ -623,6 +623,13 @@ private: bool m_rebuild_kinematics_page = false; void update_input_shaper_menu(GCodeFlavor flavor); + // R8: track the belt->non-belt transition so update_fff() only clears the belt-derived + // build_plate_tilt on a genuine in-place belt-off toggle, never on a manual tilt or a + // preset switch. m_belt_synced_tilt_{x,y} hold the exact values belt-sync last wrote. + bool m_was_belt_printer = false; + double m_belt_synced_tilt_x = 0.; + double m_belt_synced_tilt_y = 0.; + ogStaticText* m_fff_print_host_upload_description_line {nullptr}; ogStaticText* m_sla_print_host_upload_description_line {nullptr}; From c1a90fc451df1c18bd5fef9000e518e9f2c259f3 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 5 Aug 2026 03:39:47 -0500 Subject: [PATCH 083/389] Fix: correct axis-remap G-code emission and belt first-layer travel speed (B2, B3) - BeltGCodeWriter::travel_to_xyz final branch used config.travel_speed instead of the computed first-layer-aware travel_speed. - extrude_to_xyz decided emit_xyz vs emit_xy from pre-remap Z; emit full XYZ whenever an axis remap is active so remapped machine-Z is never dropped. - base travel_to_xyz now applies apply_axis_remap() on all emitted destinations (standalone remap on non-belt printers was unremapped). - spiral/arc travels fall back to normal linear lift under active remap (endpoint-only remap can't preserve arc plane/I-J). - set_axis_remap() is now synced unconditionally each export to avoid a reused writer retaining a stale non-identity mapping. --- src/libslic3r/BeltGCodeWriter.cpp | 4 ++- src/libslic3r/GCode.cpp | 14 +++++----- src/libslic3r/GCodeWriter.cpp | 45 +++++++++++++++++++++++++------ 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index e1dad4177f..4824d76f69 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -264,7 +264,9 @@ std::string BeltGCodeWriter::travel_to_xyz(const Vec3d &point, const std::string // Belt mode: always emit full XYZ GCodeG1Formatter w; w.emit_xyz(point_on_plate); - w.emit_f(this->config.travel_speed.get_at(m_cached_extruder_idx) * 60.0); + // Use the first-layer-aware travel_speed computed at the top of this function, + // not the raw config travel_speed, so initial-layer travels are correctly slowed. + w.emit_f(travel_speed * 60.0); w.emit_comment(GCodeWriter::full_gcode_comment, comment); m_pos = dest_point; diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 5b76f53ab5..46d8593182 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2952,16 +2952,18 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato this->init_belt_writer(print, is_bbl_printers); // Standalone axis remap (works with or without belt mode). + // Sync the writer's remap state to the current export UNCONDITIONALLY — even at + // the identity mapping (0,1,2) — so a reused writer never retains a stale + // non-identity mapping from a prior export. has_axis_remap() returns false at + // identity, so identity/default output stays unchanged. { int rx = int(print.config().gcode_remap_x.value); int ry = int(print.config().gcode_remap_y.value); int rz = int(print.config().gcode_remap_z.value); - if (rx != 0 || ry != 1 || rz != 2) { - m_writer->set_axis_remap(rx, ry, rz); - BoundingBoxf bbox_bed(print.config().printable_area.values); - m_writer->set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), - print.config().printable_height.value)); - } + m_writer->set_axis_remap(rx, ry, rz); + BoundingBoxf bbox_bed(print.config().printable_area.values); + m_writer->set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), + print.config().printable_height.value)); } // Build the FirstLayerPlane evaluator. When inactive (non-belt printers diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 491317e567..f3566b0a4b 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -936,7 +936,10 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co Vec2d temp = delta_no_z.normalized() * delta(2) / tan(this->filament()->travel_slope()); Vec3d slope_top_point = Vec3d(temp(0), temp(1), delta(2)) + source; GCodeG1Formatter w0; - w0.emit_xyz(slope_top_point); + // A slope lift is a straight (linear) diagonal move, so remapping its + // endpoint is exact. Route the destination through apply_axis_remap() + // when a remap is active (no-op at identity). + w0.emit_xyz(has_axis_remap() ? apply_axis_remap(slope_top_point) : slope_top_point); w0.emit_f(travel_speed * 60.0); //BBS w0.emit_comment(GCodeWriter::full_gcode_comment, comment); @@ -950,7 +953,14 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co std::string xy_z_move; { GCodeG1Formatter w0; - if (this->is_current_position_clear()) { + if (has_axis_remap()) { + // Remap may couple XY with Z; emit full XYZ in machine coordinates. + w0.emit_xyz(apply_axis_remap(target)); + w0.emit_f(travel_speed * 60.0); + w0.emit_comment(GCodeWriter::full_gcode_comment, comment); + xy_z_move = w0.string(); + } + else if (this->is_current_position_clear()) { w0.emit_xyz(target); w0.emit_f(travel_speed * 60.0); w0.emit_comment(GCodeWriter::full_gcode_comment, comment); @@ -988,7 +998,13 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co Vec3d point_on_plate = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; std::string out_string; GCodeG1Formatter w; - if (!this->is_current_position_clear()) + if (has_axis_remap()) { + // Remap may couple XY with Z; emit full XYZ in machine coordinates. + w.emit_xyz(apply_axis_remap(point_on_plate)); + w.emit_f(this->config.travel_speed.get_at(m_cached_extruder_idx) * 60.0); + w.emit_comment(GCodeWriter::full_gcode_comment, comment); + out_string = w.string(); + } else if (!this->is_current_position_clear()) { //force to move xy first then z after filament change w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); @@ -1053,6 +1069,14 @@ std::string GCodeWriter::_travel_to_z(double z, const std::string &comment) std::string GCodeWriter::_spiral_travel_to_z(double z, const Vec2d &ij_offset, const std::string &comment) { + // A circular XY arc / spiral lift cannot be correctly axis-remapped by + // transforming only its endpoint: the arc plane (G17/XY) and the I-J center + // would change under the remap. When an axis remap is active, fall back to a + // plain linear lift instead of emitting a possibly-wrong spiral/arc. This + // single guard covers every spiral call site (lazy/eager lift and travel_to_xyz). + if (has_axis_remap()) + return _travel_to_z(z, comment); + std::string output; double speed = this->config.travel_speed_z.get_at(m_cached_extruder_idx); @@ -1199,14 +1223,19 @@ std::string GCodeWriter::extrude_to_xyz(const Vec3d &point, double dE, const std //BBS: take plate offset into consider Vec3d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset, point(2) }; - if (has_axis_remap()) - point_on_plate = apply_axis_remap(point_on_plate); - GCodeG1Formatter w; - if (z_changed) + if (has_axis_remap()) { + // z_changed was computed from the ORIGINAL slicing Z, but an axis remap can + // make machine-Z depend on slicing X/Y. An X/Y-only move (slicing-Z + // unchanged) would then drop the required machine-Z word, so always emit + // full XYZ whenever a remap is active. + point_on_plate = apply_axis_remap(point_on_plate); w.emit_xyz(point_on_plate); - else + } else if (z_changed) { + w.emit_xyz(point_on_plate); + } else { w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); + } if (!force_no_extrusion) w.emit_e(filament()->E()); //BBS From 1bd3404c03be5d4dcdbf8f0c245f3fea632b38ef Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 6 Aug 2026 15:29:40 -0500 Subject: [PATCH 084/389] 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. --- src/libslic3r/GCode.cpp | 116 ++++++++++++++++++++++++--- src/libslic3r/GCode/ToolOrdering.cpp | 38 +++++++-- src/libslic3r/Print.cpp | 10 ++- src/libslic3r/Print.hpp | 6 ++ src/libslic3r/PrintObject.cpp | 29 ++++++- 5 files changed, 175 insertions(+), 24 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 46d8593182..976c99fd9a 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -5891,16 +5891,12 @@ LayerResult GCode::process_layer( //BBS: set layer time fan speed after layer change gcode gcode += ";_SET_FAN_SPEED_CHANGING_LAYER\n"; - // Belt printers: an apron band prints below its own object's first layer, but with - // several objects on the belt another one can already be printing at this print_z. - // The layer then has an object layer and takes this ordinary path instead of the - // brim-only branch, so the band has to be emitted here or it would be dropped. - // Before any object extrusion at this Z, as the brim must go down first. - if (print.has_belt_brim()) { - const Vec2d saved_origin = m_origin; - gcode += this->emit_belt_brim_bands(print, layers, single_object_instance_idx); - this->set_origin(saved_origin); - } + // Belt printers: ordinary-layer apron bands (a band whose print_z coincides with an + // object/support layer, so it takes this path rather than the brim-only branch) are + // NOT emitted here anymore. They used to be laid down with whatever tool happened to + // be active; instead they are now emitted inside the extruder loop below, in their + // own brim-filament pass and before that pass's object extrusion, so the brim goes + // down first with the correct tool. See the emit_belt_brim_for_extruder call. //Calibration Layer-specific GCode // ORCA-Belt: on belt printers the calibration object is counter-rotated to @@ -6584,6 +6580,49 @@ LayerResult GCode::process_layer( // Extrude the skirt, brim, support, perimeters, infill ordered by the extruders. m_skirt_group_done.resize(print.skirt_brim_groups().size()); + + // Belt brim bookkeeping. A coincident belt_brim_by_layer band must be emitted + // exactly once, in its object's brim-filament pass; this records which have gone + // down so the in-visit emit and the end-of-layer orphan sweep never double it. + // Key = (LayerToPrint index, instance_id). + std::set> belt_brim_emitted; + + // Emit every ORDINARY-layer apron band (belt_brim_prologue band coinciding with an + // object/support layer) whose brim filament is this pass's extruder. Mirrors + // emit_belt_brim_bands() per band, but filtered to one brim filament so each band + // prints in the correct tool's pass (Finding B). extruder_id is 0-based (the + // reindexed tool domain); belt_brim_filament() is 1-based, so subtract one. + auto emit_belt_brim_for_extruder = [this, &print, &layers, single_object_instance_idx](unsigned int extruder_id) -> std::string { + std::string gc; + for (const LayerToPrint <p : layers) { + const BeltBrimBand *band = ltp.belt_brim_band; + if (band == nullptr || band->fills.empty() || ltp.original_object == nullptr) + continue; + const PrintObject &object = *ltp.original_object; + if (! object.has_belt_brim() || (unsigned int)(object.belt_brim_filament() - 1) != extruder_id) + continue; + // Speeds, flow and retraction all read m_config. + m_config.apply(print.default_region_config()); + m_config.apply(object.config(), true); + const size_t i_begin = single_object_instance_idx == size_t(-1) ? 0 : single_object_instance_idx; + const size_t i_end = single_object_instance_idx == size_t(-1) ? object.instances().size() + : single_object_instance_idx + 1; + for (size_t i = i_begin; i < i_end && i < object.instances().size(); ++ i) { + // Band geometry is object-local, like the object's own extrusions. + const Point &offset = object.instances()[i].shift; + this->set_origin(unscale(offset)); + this->on_set_origin(&object, offset); + m_avoid_crossing_perimeters.use_external_mp(); + for (const ExtrusionEntity *ee : band->fills.entities) + if (ee != nullptr) + gc += this->extrude_entity(*ee, "brim", NOZZLE_CONFIG(support_speed)); + m_avoid_crossing_perimeters.use_external_mp(false); + m_avoid_crossing_perimeters.disable_once(); + } + } + return gc; + }; + for (unsigned int extruder_id : layer_tools.extruders) { if (print.config().skirt_type == stCombined && !print.skirt_brim_groups().empty()) { @@ -6681,6 +6720,16 @@ LayerResult GCode::process_layer( if (layer_tools.has_wipe_tower && m_wipe_tower) m_last_processor_extrusion_role = erWipeTower; + // Belt printers: now that this pass's tool is selected, lay down any ordinary-layer + // apron band whose brim filament is this extruder, before the object extrusion at + // this Z (brim goes down first, with the correct tool). Restore the origin so the + // object-setup code below is unaffected. + if (print.has_belt_brim()) { + const Vec2d saved_origin = m_origin; + gcode += emit_belt_brim_for_extruder(extruder_id); + this->set_origin(saved_origin); + } + auto &filament_plan = filament_to_print_instances[extruder_id]; std::vector &instances_to_print = filament_plan.first; const std::vector &instance_visits = filament_plan.second; @@ -6697,8 +6746,20 @@ LayerResult GCode::process_layer( const LayerToPrint &layer_to_print = layers[instance_to_print.layer_id]; if (visit.first_visit && print_wipe_extrusions == (is_anything_overridden ? 1 : 0)) { gcode += generate_object_skirt_group(print, instance_to_print.print_object, instance_to_print.instance_id, layer_tools, layer, extruder_id); - gcode += generate_object_brim(print, instance_to_print.print_object, instance_to_print.instance_id, first_layer, - layer_to_print.object_layer); + const PrintObject &vobj = instance_to_print.print_object; + if (vobj.has_belt_brim()) { + // Coincident belt brim: emit once, only in this object's brim-filament + // pass (extruder_id and belt_brim_filament()-1 are both 0-based here), + // and dedup on the LayerToPrint index (not Layer::id()) so the orphan + // sweep below never re-emits it. + if (extruder_id == (unsigned int)(vobj.belt_brim_filament() - 1) && + belt_brim_emitted.insert({ instance_to_print.layer_id, instance_to_print.instance_id }).second) + gcode += generate_object_brim(print, vobj, instance_to_print.instance_id, first_layer, + layer_to_print.object_layer); + } else { + gcode += generate_object_brim(print, vobj, instance_to_print.instance_id, first_layer, + layer_to_print.object_layer); + } } // To control print speed of the 1st object layer printed over raft interface. @@ -6886,6 +6947,37 @@ LayerResult GCode::process_layer( } } } + + // Belt brim orphan sweep (Finding C). A coincident belt_brim_by_layer band lives on + // an object layer, but that layer can yield no InstanceVisit above - a zero-extrusion + // lead-in slice with no coinciding support - so the in-visit emit never fired and the + // band would be dropped. Emit any such band exactly once here, keyed the same way as + // the in-visit emit so already-printed bands are skipped. These orphan layers carry + // no object material, so ending on the brim's position is harmless; we still save and + // restore m_origin, and only toolchange when the brim filament differs from the active + // one - a no-op on single-extruder prints, keeping their output unchanged. + if (print.has_belt_brim()) { + const Vec2d saved_origin = m_origin; + for (const LayerToPrint <p : layers) { + const PrintObject *obj = ltp.original_object; + if (obj == nullptr || ! obj->has_belt_brim() || ltp.object_layer == nullptr) + continue; + const size_t ltp_idx = size_t(<p - layers.data()); + const unsigned int brim0 = (unsigned int)(obj->belt_brim_filament() - 1); + const size_t i_begin = single_object_instance_idx == size_t(-1) ? 0 : single_object_instance_idx; + const size_t i_end = single_object_instance_idx == size_t(-1) ? obj->instances().size() + : single_object_instance_idx + 1; + for (size_t instance_id = i_begin; instance_id < i_end && instance_id < obj->instances().size(); ++ instance_id) { + if (! belt_brim_emitted.insert({ ltp_idx, instance_id }).second) + continue; + if (m_writer->filament() == nullptr || m_writer->filament()->id() != brim0) + gcode += this->set_extruder(brim0, print_z); + gcode += generate_object_brim(print, *obj, instance_id, first_layer, ltp.object_layer); + } + } + this->set_origin(saved_origin); + } + if (first_layer) { for (auto iter = by_extruder.begin(); iter != by_extruder.end(); ++iter) { if (!iter->second.empty()) diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index e0520a3694..f96748848f 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -876,14 +876,9 @@ void ToolOrdering::collect_extruders(const PrintObject &object, const std::vecto // push. Deliberately not layer_tools.has_object, which drives skirt marking // and wiping overrides. if (! object.belt_brim_prologue().empty()) { - unsigned int brim_filament = 0; - for (size_t i = 0; i < object.num_printing_regions(); ++ i) { - const unsigned int f = object.printing_region(i).config().outer_wall_filament_id.value; - if (f > 0 && (brim_filament == 0 || f < brim_filament)) - brim_filament = f; - } - if (brim_filament == 0) - brim_filament = 1; + // 1-based, same domain the object/support pushes above use; reindexed to 0-based + // with the rest of the list later. + const unsigned int brim_filament = object.belt_brim_filament(); for (const BeltBrimBand &band : object.belt_brim_prologue()) { if (band.fills.empty()) continue; @@ -893,6 +888,25 @@ void ToolOrdering::collect_extruders(const PrintObject &object, const std::vecto } } + // Coincident brim bands (belt_brim_by_layer) print ON an object layer rather than + // below it, but that layer can produce no InstanceVisit in process_layer - a + // zero-extrusion lead-in slice with no coinciding support - and the band would then + // be silently dropped. Register the brim filament on every layer that carries a + // coincident band, in the same 1-based domain as the prologue push above, so a brim + // pass always exists there. + if (object.has_belt_brim()) { + const unsigned int brim_filament = object.belt_brim_filament(); + const auto &by_layer = object.belt_brim_by_layer(); + const size_t n = std::min(by_layer.size(), object.layers().size()); + for (size_t i = 0; i < n; ++ i) { + if (by_layer[i].empty()) + continue; + LayerTools &layer_tools = this->tools_for_layer(object.layers()[i]->print_z); + layer_tools.extruders.push_back(brim_filament); + layer_tools.has_belt_brim = true; + } + } + for (auto& layer : m_layer_tools) { // Sort and remove duplicates sort_remove_duplicates(layer.extruders); @@ -940,6 +954,14 @@ void ToolOrdering::fill_wipe_tower_partitions(const PrintConfig &config, coordf_ // below the object's first layer, and treating those layers as raft would put a // wipe tower at negative Z. Belt brim and the prime tower are mutually // exclusive (rejected in Print::validate()), so simply drop the clause there. + // + // Gate on config.belt_printer, NOT on has_belt_brim: every layer below the + // object bottom on a belt printer is legitimately a sub-object stream - brim + // apron, belt support printed below Z0, or the object's own lead-in - and none of + // them is ever raft, because Print::validate() rejects raft_layers>0 on a belt + // printer outright. Narrowing this to has_belt_brim would reclassify + // belt-support-below-floor layers as raft on brim-less belt prints and reintroduce + // the negative-Z wipe tower, so the broad belt_printer gate is correct. const bool belt_no_raft_gap = config.belt_printer.value; for (LayerTools < : m_layer_tools) lt.has_wipe_tower |= (lt.has_object && (config.timelapse_type == TimelapseType::tlSmooth || lt.wipe_tower_partitions > 0)) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 2df4cde79b..017fa19736 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1374,9 +1374,15 @@ StringObjectException Print::validate(std::vector *warnin for (const PrintObject *object : m_objects) { const PrintObjectConfig &ocfg = object->config(); + // Mirror PrintObject::has_belt_brim(): an inner-only brim needs a positive + // brim_width (leading/extra widen only the outer ring), so keep this + // predicate in step or the belt-brim warnings below would fire for a brim + // that has_belt_brim() rejects. const bool wants_brim = ocfg.brim_type != btNoBrim - && (ocfg.brim_width.value > 0. || ocfg.leading_brim_length.value > 0. - || ocfg.extra_brim_width.value > 0.); + && (ocfg.brim_type == btInnerOnly + ? ocfg.brim_width.value > 0. + : (ocfg.brim_width.value > 0. || ocfg.leading_brim_length.value > 0. + || ocfg.extra_brim_width.value > 0.)); if (! wants_brim) continue; diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index 4b1f4891f2..ff5a505360 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -392,6 +392,12 @@ public: // trimming and the spiral vase probe, and widening it would perturb belt // support output. bool has_belt_brim() const; + // Brim filament for this object's belt brim, returned in the 1-based domain of + // PrintRegion::outer_wall_filament_id and the raw values pushed into + // LayerTools::extruders in ToolOrdering::collect_extruders (ToolOrdering reindexes + // the whole list to 0-based afterwards). Lowest positive outer_wall_filament_id + // over the printing regions, 1 if none is explicitly set. + unsigned int belt_brim_filament() const; // False when this object's instances sit at different points ALONG the belt, which // would need a separate set of bands each. Public so validate() can explain it. bool belt_brim_instances_compatible() const; diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index c5d5409d73..68cedfc534 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -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 From a453cb1eba0626f627a8f6136e1c015ec7078482 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 6 Aug 2026 15:38:31 -0500 Subject: [PATCH 085/389] tests: cover belt-brim first-contact emission, tool selection, inner/leading-edge, and predicate (E) Deterministic tests for: coincident brim at first belt contact not dropped (C), single- and multi-extruder brim tool selection with no doubling (B), multi-object apron ordering, inner-only+leading-only not rejecting prime tower/spiral (D), and inner/holed + leading-edge-only geometry. --- tests/fff_print/test_skirt_brim.cpp | 297 ++++++++++++++++++++++++++++ tests/libslic3r/test_belt_brim.cpp | 74 +++++++ 2 files changed, 371 insertions(+) diff --git a/tests/fff_print/test_skirt_brim.cpp b/tests/fff_print/test_skirt_brim.cpp index b5d315db2a..486be88f40 100644 --- a/tests/fff_print/test_skirt_brim.cpp +++ b/tests/fff_print/test_skirt_brim.cpp @@ -9,7 +9,12 @@ #include +#include #include +#include +#include +#include +#include #include "test_helpers.hpp" // get access to init_print, etc @@ -473,6 +478,298 @@ static DynamicPrintConfig belt_brim_config() return config; } +// Same belt as belt_brim_config(), but with `filaments` distinct filaments so the brim's +// tool selection can be observed. Kept separate from belt_brim_config() so the existing +// single-filament belt tests are untouched. +static DynamicPrintConfig belt_brim_multifilament_config(unsigned int filaments, + std::initializer_list extra = {}) +{ + DynamicPrintConfig config = multifilament_config(filaments); + config.set_deserialize_strict({ + { "belt_printer", 1 }, + { "belt_slice_rotation", "x" }, + { "belt_slice_rotation_angle", 45 }, + { "belt_slice_rotation_global", 1 }, + { "gcode_remap_x", "rev_x" }, + { "gcode_remap_y", "pos_z" }, + { "gcode_remap_z", "pos_y" }, + { "layer_height", 0.2 }, + { "initial_layer_print_height", 0.2 }, + { "skirt_loops", 0 }, + { "top_shell_layers", 0 }, + { "bottom_shell_layers", 1 }, + { "machine_start_gcode", "T[initial_tool]\n" }, + }); + if (extra.size() > 0) + config.set_deserialize_strict(extra); + return config; +} + +// 0-based tool indices used by extrusions whose role comment contains `role` (needs +// gcode_comments). Mirrors tools_for_role in test_multifilament.cpp; statics do not cross +// translation units, so it is repeated here. +static std::set belt_tools_for_role(const std::string &gcode, const std::string &role) +{ + std::set tools; + int current_tool = 0; + GCodeReader reader; + reader.parse_buffer(gcode, [&](GCodeReader &self, const GCodeReader::GCodeLine &line) { + const std::string cmd(line.cmd()); + if (cmd.size() >= 2 && cmd[0] == 'T' && std::isdigit((unsigned char) cmd[1])) + current_tool = std::stoi(cmd.substr(1)); + else if (line.extruding(self) && std::string(line.comment()).find(role) != std::string::npos) + tools.insert(current_tool); + }); + return tools; +} + +// Machine Z of the first extruding move whose role comment contains `role`, in file order; +// numeric_limits::max() when the role never extrudes. +static double first_role_z(const std::string &gcode, const std::string &role) +{ + double z = std::numeric_limits::max(); + GCodeReader parser; + parser.parse_buffer(gcode, [&z, &role](GCodeReader &self, const GCodeReader::GCodeLine &line) { + if (line.extruding(self) && line.comment().find(role) != std::string_view::npos) { + z = self.z(); + self.quit_parsing(); + } + }); + return z; +} + +// Number of object layers that carry a belt brim band. Each such band is emitted as one +// contiguous brim pass, so for a single object whose first-contact layer carries a band +// (the apron prologue folds into that layer's pass) this equals role_passes(gcode, "brim"). +static int nonempty_belt_brim_layers(const PrintObject &object) +{ + int n = 0; + for (const ExtrusionEntityCollection &band : object.belt_brim_by_layer()) + if (! band.empty()) + ++ n; + return n; +} + +// For each active tool, the ordinal (1-based, over extruding moves) of the FIRST move whose +// role comment contains `role`. Lets a per-object ordering check key off the object's +// unique wall filament. +static std::map first_move_by_tool(const std::string &gcode, const std::string &role) +{ + std::map first; + int tool = 0; + long idx = 0; + GCodeReader reader; + reader.parse_buffer(gcode, [&](GCodeReader &self, const GCodeReader::GCodeLine &line) { + const std::string cmd(line.cmd()); + if (cmd.size() >= 2 && cmd[0] == 'T' && std::isdigit((unsigned char) cmd[1])) { + tool = std::stoi(cmd.substr(1)); + return; + } + if (! line.extruding(self)) + return; + ++ idx; + if (std::string(line.comment()).find(role) != std::string::npos && ! first.count(tool)) + first[tool] = idx; + }); + return first; +} + +// C - the band coincident with the object's FIRST contact with the belt must not be dropped: +// a belt brim has to appear at or below the object's first perimeter. On the unfixed feature +// the first-contact band is dropped and the first brim then appears only at a later (higher) +// layer. Machine Z is meaningful and shared between roles under the belt remap, so the first +// brim's Z must not exceed the first perimeter's. Both with and without support. +TEST_CASE("Belt brim is laid at the object's first belt contact", "[SkirtBrim][belt]") +{ + const bool support = GENERATE(false, true); + DYNAMIC_SECTION("enable_support=" << support) { + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "leading_brim_length", 0 }, + { "extra_brim_width", 0 }, + { "brim_object_gap", 0 }, + { "enable_support", support ? 1 : 0 }, + }); + const std::string gcode = slice({ cube(20) }, config); + + const double brim_z = first_role_z(gcode, "brim"); + const double peri_z = first_role_z(gcode, "perimeter"); + REQUIRE(brim_z < std::numeric_limits::max()); + REQUIRE(peri_z < std::numeric_limits::max()); + CHECK(brim_z <= peri_z + EPSILON); + } +} + +// C control - when the band's own object layer has extrusion (any interior layer of a solid +// cube), the band takes the ordinary process_layer() path and must be drawn immediately +// before that layer's perimeters, and exactly once: never dropped, never double-emitted. +TEST_CASE("Belt brim on an object layer precedes its perimeters, once", "[SkirtBrim][belt]") +{ + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "brim_object_gap", 0 }, + }); + Print print; + Model model; + init_print({ cube(20) }, print, model, config); + const std::string gc = gcode(print); + + // Ordering: the first thing extruded is brim, then perimeter. + const std::vector seq = role_sequence(gc, { "brim", "perimeter" }); + REQUIRE(seq.size() >= 2); + CHECK(seq[0] == "brim"); + CHECK(seq[1] == "perimeter"); + + // Exactly once: every band is one contiguous pass (the apron prologue folds into the + // first layer's), so the pass count equals the number of layers carrying a band - not + // twice it, which double-emission would give, nor fewer, which a dropped band would. + const int bands = nonempty_belt_brim_layers(*print.objects().front()); + REQUIRE(bands > 0); + CHECK(role_passes(gc, "brim") == bands); +} + +// B - single extruder (filament id 1). Every band must survive the 1-based -> 0-based +// filament-id conversion the apron path performs: a wrong conversion drops all single-extruder +// bands, so the pass count would collapse. The expected count is derived from the sliced +// layers, not a ratio. +TEST_CASE("Belt brim on a single extruder emits every band once", "[SkirtBrim][belt]") +{ + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "brim_object_gap", 0 }, + }); + Print print; + Model model; + init_print({ cube(20) }, print, model, config); + const std::string gc = gcode(print); + + const int expected = nonempty_belt_brim_layers(*print.objects().front()); + REQUIRE(expected > 0); + CHECK(role_passes(gc, "brim") == expected); + CHECK(belt_tools_for_role(gc, "brim") == std::set{ 0 }); // filament 1 -> tool 0 +} + +// B - multi extruder (wall filament id 2). Every belt-brim line must print on the object's +// wall filament (index 2 -> tool 1), and the total number of passes must equal the +// single-extruder baseline: no per-filament doubling. +TEST_CASE("Belt brim on a multi-extruder object uses the wall filament, no doubling", "[SkirtBrim][belt]") +{ + // Single-extruder baseline built the same way (same nozzle/flow), so the band geometry - + // and thus the band count - is identical and only the filament assignment differs. + DynamicPrintConfig base = belt_brim_multifilament_config(1, { + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "brim_object_gap", 0 }, + }); + const int baseline = role_passes(slice({ cube(20) }, base), "brim"); + REQUIRE(baseline > 0); + + DynamicPrintConfig config = belt_brim_multifilament_config(2, { + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "brim_object_gap", 0 }, + { "outer_wall_filament_id", 2 }, + { "inner_wall_filament_id", 2 }, + }); + const std::string gc = slice({ cube(20) }, config); + + CHECK(belt_tools_for_role(gc, "brim") == std::set{ 1 }); // filament 2 -> tool 1 + CHECK(role_passes(gc, "brim") == baseline); +} + +// B - two objects offset ALONG the belt (Y, since the tilt is about X), each with its own +// wall filament. Each object's brim/apron must print on that object's filament AND before +// that object's own perimeters. The object is identified by its unique tool. +TEST_CASE("Belt brim of each object precedes its perimeters on its own filament", "[SkirtBrim][belt]") +{ + DynamicPrintConfig config = belt_brim_multifilament_config(2, { + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "leading_brim_length", 6 }, + { "brim_object_gap", 0 }, + }); + + std::vector meshes; + meshes.emplace_back(cube(20)); + TriangleMesh second = cube(20); + second.translate(0.f, 40.f, 0.f); // offset along the belt so it lands well after the first + meshes.emplace_back(std::move(second)); + + const std::vector> overrides { + { { "outer_wall_filament_id", 1 }, { "inner_wall_filament_id", 1 } }, + { { "outer_wall_filament_id", 2 }, { "inner_wall_filament_id", 2 } }, + }; + Print print; + Model model; + init_print(std::move(meshes), print, model, config, &overrides, /*arrange=*/false); + print.process(); + const std::string gc = gcode(print); + + // Both brims appear, each on its object's wall filament (1 -> T0, 2 -> T1). + CHECK(belt_tools_for_role(gc, "brim") == std::set{ 0, 1 }); + + const std::map brim_first = first_move_by_tool(gc, "brim"); + const std::map peri_first = first_move_by_tool(gc, "perimeter"); + for (int tool : { 0, 1 }) { + REQUIRE(brim_first.count(tool) == 1); + REQUIRE(peri_first.count(tool) == 1); + CHECK(brim_first.at(tool) < peri_first.at(tool)); + } +} + +// D - the belt-brim predicate must not fire on a request that produces no belt brim. +// leading_brim_length / extra_brim_width only feed the OUTER ring, so inner_only with zero +// brim_width yields nothing and must not claim the layers the prime tower / spiral vase need. +TEST_CASE("Belt inner-only leading brim does not reject the prime tower or spiral vase", "[SkirtBrim][belt]") +{ + auto inner_leading = [](std::initializer_list extra) { + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "inner_only" }, + { "brim_width", 0 }, + { "leading_brim_length", 6 }, + { "brim_object_gap", 0 }, + }); + config.set_deserialize_strict(extra); + return config; + }; + + SECTION("prime tower is left alone") { + Print print; + Model model; + init_print({ cube(20) }, print, model, inner_leading({ { "enable_prime_tower", 1 } })); + CHECK_FALSE(print.objects().front()->has_belt_brim()); + CHECK(print.validate().string.empty()); + } + SECTION("spiral vase is left alone") { + Print print; + Model model; + init_print({ cube(20) }, print, model, inner_leading({ { "spiral_mode", 1 } })); + CHECK_FALSE(print.objects().front()->has_belt_brim()); + CHECK(print.validate().string.empty()); + } + SECTION("a real inner brim still rejects the prime tower") { + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "brim_type", "inner_only" }, + { "brim_width", 4 }, + { "brim_object_gap", 0 }, + { "enable_prime_tower", 1 }, + }); + Print print; + Model model; + init_print({ cube(20) }, print, model, config); + CHECK(print.objects().front()->has_belt_brim()); + CHECK_FALSE(print.validate().string.empty()); + } +} + TEST_CASE("Belt brim spans many layers instead of one", "[SkirtBrim][belt]") { DynamicPrintConfig config = belt_brim_config(); diff --git a/tests/libslic3r/test_belt_brim.cpp b/tests/libslic3r/test_belt_brim.cpp index 9f645817e9..d5e99dafaa 100644 --- a/tests/libslic3r/test_belt_brim.cpp +++ b/tests/libslic3r/test_belt_brim.cpp @@ -275,6 +275,80 @@ SCENARIO("belt_brim_region reduces to the plate brim without an apron", "[BeltBr } } +SCENARIO("belt_brim_region builds an inner ring inside a hole", "[BeltBrim]") { + // Holed prisms (a washer) are the only footprints an inner brim has anything to grab. + // The inner path offsets the hole boundary inward and keeps the ring between the two + // offsets, clipped back inside the hole - it must be non-empty and live in the hole, + // never spill out onto the plate. No apron is applied to the inner ring. + const coord_t mm = scale_(1.); + const BeltBrimFrame frame { 1.0, 1 }; + const coord_t width = 3 * mm; + const coord_t gap = 1 * mm; + + GIVEN("a 40x40 mm washer with a 20 mm square hole") { + ExPolygon washer = make_box(0, 0, 40 * mm, 40 * mm); + add_hole(washer, 10 * mm, 10 * mm, 30 * mm, 30 * mm); + const ExPolygons footprint { washer }; + const BoundingBox hole_bb = get_extents(washer.holes.front()); + + WHEN("an inner-only brim is requested") { + const ExPolygons region = belt_brim_region(footprint, false, true, width, gap, 0, 0, frame); + THEN("a non-empty ring is produced strictly inside the hole") { + REQUIRE(! region.empty()); + CHECK(area(region) > 0); + const BoundingBox rb = get_extents(region); + CHECK(rb.min.x() >= hole_bb.min.x()); + CHECK(rb.min.y() >= hole_bb.min.y()); + CHECK(rb.max.x() <= hole_bb.max.x()); + CHECK(rb.max.y() <= hole_bb.max.y()); + } + } + WHEN("no inner brim is requested") { + THEN("the hole contributes nothing") { + CHECK(belt_brim_region(footprint, false, false, width, gap, 0, 0, frame).empty()); + } + } + } +} + +SCENARIO("Leading-edge-only retains the downhill half of the brim region", "[BeltBrim]") { + // BeltBrim.cpp ~445-458 clips the region to the object's first-contact band and keeps + // only what lies at or downhill of it. That clip is built with band_box(), which is + // file-static, so the rectangular half-band is reconstructed here with the SAME sign + // rule the code uses (low_side = shear > 0, i.e. downhill is -u) to pin the convention + // for both tilt signs. downhill_sign() is the exported accessor the flag mirrors. + const coord_t mm = scale_(1.); + const double shear = GENERATE(1.0, -1.0); + DYNAMIC_SECTION("shear " << shear) { + const BeltBrimFrame frame { shear, 1 }; // from_axis 1 => u is Y + CHECK((frame.downhill_sign() < 0) == (frame.shear > 0.)); + + const ExPolygons region { make_box(0, 0, 20 * mm, 20 * mm) }; // straddles the cut + const coord_t u_cut = 8 * mm; + const BoundingBox bb = get_extents(region); + + const bool low_side = frame.shear > 0.; + const coord_t lo = low_side ? bb.min.y() : u_cut; + const coord_t hi = low_side ? u_cut : bb.max.y(); + Polygon keep; + keep.points = { Point(bb.min.x(), lo), Point(bb.max.x(), lo), + Point(bb.max.x(), hi), Point(bb.min.x(), hi) }; + const ExPolygons kept = intersection_ex(region, Polygons{ keep }); + + REQUIRE(! kept.empty()); + const BoundingBox kb = get_extents(kept); + if (frame.shear > 0.) { + // downhill is -u: nothing above the cut survives. + CHECK(kb.max.y() <= u_cut + 2); + CHECK(kb.min.y() < u_cut); + } else { + // downhill is +u: nothing below the cut survives. + CHECK(kb.min.y() >= u_cut - 2); + CHECK(kb.max.y() > u_cut); + } + } +} + SCENARIO("The apron follows the sign of the shear", "[BeltBrim]") { // Guards the one sign convention that is easiest to get backwards: which way // is downhill, i.e. which way the belt carries the part. From 8b2e28817d03cf4cad7b5870798904765a6db1a8 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 8 Aug 2026 12:33:41 -0500 Subject: [PATCH 086/389] fix non 45 degree slicing methods after regression created while cleaning up UI --- src/CMakeLists.txt | 8 +++- src/libslic3r/GCode/MachineFrameTransform.cpp | 33 +++++++++-------- src/libslic3r/GCode/MachineFrameTransform.hpp | 2 +- src/libslic3r/PrintConfig.cpp | 6 +-- tests/fff_print/test_gcodewriter.cpp | 37 +++++++++++++++++++ 5 files changed, 66 insertions(+), 20 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 79b49cfd16..1e650df95b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -90,6 +90,12 @@ if (SLIC3R_GUI) # list(REMOVE_ITEM wxWidgets_LIBRARIES oleacc) find_package(wxInspector REQUIRED) + # wxInspector 1.0.0 installs its headers but accidentally declares the + # INSTALL_INTERFACE include directory PRIVATE, so its imported target does + # not expose them to consumers. Restore the package prefix include path until + # the upstream export is fixed. + get_filename_component(WXINSPECTOR_PREFIX "${wxInspector_DIR}/../../.." ABSOLUTE) + target_include_directories(wxInspector::wxInspector INTERFACE "${WXINSPECTOR_PREFIX}/include") list(APPEND wxWidgets_LIBRARIES "wxInspector::wxInspector") message(STATUS "wx libs: ${wxWidgets_LIBRARIES}") @@ -175,7 +181,7 @@ endif () # Add the Slic3r GUI library, libcurl, OpenGL and GLU libraries. if (SLIC3R_GUI) # target_link_libraries(OrcaSlicer ws2_32 uxtheme setupapi libslic3r_gui ${wxWidgets_LIBRARIES}) -target_link_libraries(OrcaSlicer libslic3r_gui) +target_link_libraries(OrcaSlicer libslic3r_gui wxInspector::wxInspector) if (MSVC) # Generate debug symbols even in release mode. target_link_options(OrcaSlicer PUBLIC "$<$:/DEBUG>") diff --git a/src/libslic3r/GCode/MachineFrameTransform.cpp b/src/libslic3r/GCode/MachineFrameTransform.cpp index 3d322b4303..af09ba7353 100644 --- a/src/libslic3r/GCode/MachineFrameTransform.cpp +++ b/src/libslic3r/GCode/MachineFrameTransform.cpp @@ -29,31 +29,34 @@ bool MachineFrameTransform::init_from_config(const PrintConfig &config) return false; const double angle_rad = Geometry::deg2rad(angle_deg); - const double cos_a = std::cos(angle_rad); - if (std::abs(cos_a) <= EPSILON) + const double sin_a = std::sin(angle_rad); + if (std::abs(sin_a) <= EPSILON) return false; - const double tan_a = std::sin(angle_rad) / cos_a; - const double inv_cos = 1.0 / cos_a; + const double cot_a = std::cos(angle_rad) / sin_a; + const double inv_sin = 1.0 / std::abs(sin_a); - // Couple the height axis (Z) to the belt-feed axis and stretch the belt-feed - // axis by 1/cos so a unit slicing move maps to the correct belt travel. The - // shear sign matches the belt-floor slope derived from the same rotation in - // BeltTransformPipeline::compute_belt_height_and_floor: - // tilt about X: feed axis Y, Z += +tan·Y, scale Y *= 1/cos - // tilt about Y: feed axis X, Z += -tan·X, scale X *= 1/cos + // This stage runs after the conventional belt axis swap. For an X-axis + // slicing rotation, remapped Y is model height and remapped Z is travel + // along the belt. Convert those Cartesian coordinates to machine axes with + // the established belt-printer convention: + // machine gantry = model height / sin(a) + // machine belt = model belt + model height * cot(a) + // The Y-rotation case is the same mapping on X/Z, with the rotation sign. + // At 45 degrees tan/cot and sin/cos are equal, which previously hid the + // incorrect complementary-angle formulas used by this unified transform. Matrix3d shear = Matrix3d::Identity(); Matrix3d scale = Matrix3d::Identity(); if (axis == BeltRotationAxis::X) { - shear(2, 1) = tan_a; // Z from Y - scale(1, 1) = inv_cos; // Y + shear(2, 1) = cot_a; // Z from Y + scale(1, 1) = inv_sin; // Y } else { // BeltRotationAxis::Y - shear(2, 0) = -tan_a; // Z from X - scale(0, 0) = inv_cos; // X + shear(2, 0) = -cot_a; // Z from X + scale(0, 0) = inv_sin; // X } // Apply shear first, then scale (the historical default ShearThenScale order: // result = scale * shear * p). For the canonical 45°/X belt this maps - // (x,y,z) -> (x, y/cos, y + z), matching the previous per-axis config. + // (x,y,z) -> (x, y/sin, y + z), matching the previous per-axis config. Transform3d combined = Transform3d::Identity(); combined.linear() = scale * shear; diff --git a/src/libslic3r/GCode/MachineFrameTransform.hpp b/src/libslic3r/GCode/MachineFrameTransform.hpp index 744a7976c5..83519bdbe4 100644 --- a/src/libslic3r/GCode/MachineFrameTransform.hpp +++ b/src/libslic3r/GCode/MachineFrameTransform.hpp @@ -15,7 +15,7 @@ namespace Slic3r { // // Derived entirely from the single belt tilt (belt_slice_rotation axis + // belt_slice_rotation_angle): a shear coupling the height axis to the belt-feed -// axis (factor tan a) plus a 1/cos a scale on the belt-feed axis. The expert +// axis (factor cot a) plus a 1/sin a scale on the gantry-height axis. The expert // belt_frame_tilt_decouple flag lets the machine-frame angle differ from the // pre-slice rotation angle via belt_frame_tilt_angle. class MachineFrameTransform diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index f641699d91..d0ce14ec35 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -7216,9 +7216,9 @@ void PrintConfigDef::init_fff_params() def = this->add("gcode_back_transform", coBool); def->label = L("G-code back-transform"); def->category = L("Printable space"); - def->tooltip = L("Reverse the shear/scale transform applied during slicing so G-code " - "coordinates are in the machine's physical coordinate space. " - "Requires at least one shear axis with global mode enabled."); + def->tooltip = L("Undo the pre-slice mesh transform before applying the G-code axis remap " + "and machine-frame shear/scale. Required for the standard belt-printer " + "rotation pipeline."); def->mode = comExpert; def->set_default_value(new ConfigOptionBool(true)); diff --git a/tests/fff_print/test_gcodewriter.cpp b/tests/fff_print/test_gcodewriter.cpp index 6af11d8d23..22ca387bbb 100644 --- a/tests/fff_print/test_gcodewriter.cpp +++ b/tests/fff_print/test_gcodewriter.cpp @@ -20,12 +20,49 @@ #include #include #include "libslic3r/BeltGCodeWriter.hpp" +#include "libslic3r/BeltTransform.hpp" #include "libslic3r/GCodeReader.hpp" #include "libslic3r/PrintConfig.hpp" using namespace Slic3r; using namespace Slic3r::Test; +TEST_CASE("Belt machine coordinates retain a non-45-degree slicing angle", "[GCodeWriter][belt]") +{ + PrintConfig config; + config.belt_printer.value = true; + config.belt_slice_rotation.value = BeltRotationAxis::X; + config.belt_slice_rotation_angle.value = 30.; + config.belt_slice_rotation_global.value = true; + config.gcode_back_transform.value = true; + config.gcode_remap_x.value = RemapAxis::PosX; + config.gcode_remap_y.value = RemapAxis::PosZ; + config.gcode_remap_z.value = RemapAxis::PosY; + + BeltGCodeWriter writer; + writer.set_belt_back_transform(config); + writer.set_machine_frame_transform(config); + writer.set_axis_remap(int(config.gcode_remap_x.value), + int(config.gcode_remap_y.value), + int(config.gcode_remap_z.value)); + + // Start with a point in the unrotated model frame, then feed the writer the + // same rotated coordinate produced by the pre-slice mesh transform. The + // back-transform must recover the model point before the axis swap and + // machine-frame shear/scale are applied. + const Vec3d model(4., 10., 3.); + Transform3d forward = BeltTransformPipeline::build_forward_transform(config); + const Vec3d machine = writer.to_machine_coords(forward * model); + + // The conventional X-tilt remap produces (x, z, y). At 30 degrees the + // gantry coordinate is z/sin(30) and belt travel is y + z*cot(30). + // The complementary tan/inv-cos formulas accidentally used by the unified + // transform are indistinguishable at 45 degrees, but fail this case. + REQUIRE_THAT(machine.x(), Catch::Matchers::WithinAbs(4., 1e-9)); + REQUIRE_THAT(machine.y(), Catch::Matchers::WithinAbs(3. / std::sin(Geometry::deg2rad(30.)), 1e-9)); + REQUIRE_THAT(machine.z(), Catch::Matchers::WithinAbs(10. + 3. / std::tan(Geometry::deg2rad(30.)), 1e-9)); +} + // Arrange on a finite bed, not an unbounded InfiniteBed: the latter places items // near INT64_MIN/4 (~2.3e18), which reaches ClipperLib's coordinate limit and throws // "Coordinate outside allowed range" on Windows/arm64. A 500x500 bed keeps coordinates From 88726d76e84547ff9613b847323ffd53836399e3 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 04:24:41 -0500 Subject: [PATCH 087/389] Purge tower part 1 --- result.json | 10 ++ src/libslic3r/GCode/ToolOrdering.cpp | 4 + src/libslic3r/Preset.cpp | 2 + src/libslic3r/Print.cpp | 223 ++++++++++++++++++++++++- src/libslic3r/Print.hpp | 12 ++ src/libslic3r/PrintConfig.cpp | 24 +++ src/libslic3r/PrintConfig.hpp | 5 + src/libslic3r/PrintObject.cpp | 3 +- src/libslic3r/PrintObjectSlice.cpp | 21 +++ src/slic3r/GUI/ConfigManipulation.cpp | 17 +- src/slic3r/GUI/GLCanvas3D.cpp | 8 +- src/slic3r/GUI/Jobs/ArrangeJob.cpp | 6 + src/slic3r/GUI/Plater.cpp | 227 ++++++++++++++++++++++++++ src/slic3r/GUI/Tab.cpp | 1 + 14 files changed, 548 insertions(+), 15 deletions(-) create mode 100644 result.json diff --git a/result.json b/result.json new file mode 100644 index 0000000000..517f6bffa5 --- /dev/null +++ b/result.json @@ -0,0 +1,10 @@ +{ + "error_string": "Success.", + "export_time": 0, + "layer_height": 0.0, + "plate_index": 0, + "prepare_time": 0, + "return_code": 0, + "sparse_infill_density": 0.0, + "wall_loops": 0 +} diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index f96748848f..85a8436c3e 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -381,6 +381,10 @@ bool ToolOrdering::insert_wipe_tower_extruder() { if (!m_print_config_ptr || !m_print_config_ptr->enable_prime_tower) return false; + // Belt mode has no classic wipe tower; the dedicated wipe tower filament + // must not inject extra toolchanges into the purge prism planning. + if (m_print_config_ptr->belt_printer) + return false; if (m_print_config_ptr->wipe_tower_filament == 0) return false; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 3e6e2b9aaf..092923e336 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1160,6 +1160,8 @@ static std::vector s_Preset_print_options{ "prime_volume", "prime_tower_infill_gap", "prime_tower_flat_ironing", + "belt_purge_tower_width", + "belt_purge_tower_object", "enable_tower_interface_features", "enable_tower_interface_cooldown_during_tower", "wipe_tower_no_sparse_layers", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 017fa19736..390bba1ff2 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -22,6 +22,7 @@ #include "MaterialType.hpp" #include "Model.hpp" #include "format.hpp" +#include "LocalesUtils.hpp" #include #include @@ -389,6 +390,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "prime_volume" || opt_key == "flush_into_infill" || opt_key == "flush_into_support" + || opt_key == "belt_purge_tower_width" || opt_key == "initial_layer_infill_speed" || opt_key == "travel_speed" || opt_key == "travel_speed_z" @@ -1473,6 +1475,15 @@ StringObjectException Print::validate(std::vector *warnin } if (m_config.enable_prime_tower) { + if (m_config.belt_printer.value && m_config.print_sequence == PrintSequence::ByObject + && extruders.size() > 1 && warning != nullptr) { + StringObjectException warningtemp; + warningtemp.string = L("The belt purge tower is not generated in \"By object\" print sequence; " + "filament changes will not be purged."); + warningtemp.opt_key = "enable_prime_tower"; + warningtemp.is_warning = true; + *warning = warningtemp; + } for (const PrintObject* object : m_objects) { if (object->config().precise_z_height.value) { warn(L("Enabling both precise Z height and the prime tower may cause slicing errors."), "precise_z_height"); @@ -1596,7 +1607,7 @@ StringObjectException Print::validate(std::vector *warnin return {_u8L("Variable layer height is not supported with Organic supports.") }; } - if (this->has_wipe_tower() && ! m_objects.empty()) { + if ((this->has_wipe_tower() || this->has_belt_purge_tower()) && ! m_objects.empty()) { // Make sure all extruders use same diameter filament and have the same nozzle diameter // EPSILON comparison is used for nozzles and 10 % tolerance is used for filaments double first_nozzle_diam = m_config.nozzle_diameter.get_at(extruders.front()); @@ -1612,12 +1623,17 @@ StringObjectException Print::validate(std::vector *warnin } } - if (! m_config.use_relative_e_distances) - return { L("The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1).") }; + // The following two constraints come from the classic wipe tower G-code + // generator; purging into the belt purge prism uses normal object + // extrusions and does not need them. + if (this->has_wipe_tower()) { + if (! m_config.use_relative_e_distances) + return { L("The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1).") }; + + if (m_config.ooze_prevention && m_config.single_extruder_multi_material) + return {L("Ooze prevention is only supported with the wipe tower when 'single_extruder_multi_material' is off.")}; + } - if (m_config.ooze_prevention && m_config.single_extruder_multi_material) - return {L("Ooze prevention is only supported with the wipe tower when 'single_extruder_multi_material' is off.")}; - #if 0 if (m_config.gcode_flavor != gcfRepRapSprinter && m_config.gcode_flavor != gcfRepRapFirmware && m_config.gcode_flavor != gcfRepetier && m_config.gcode_flavor != gcfMarlinLegacy && m_config.gcode_flavor != gcfMarlinFirmware) @@ -2708,7 +2724,10 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) m_wipe_tower_data.clear(); m_tool_ordering.clear(); - if (this->has_wipe_tower()) { + if (this->has_belt_purge_tower() && this->config().print_sequence != PrintSequence::ByObject) { + this->_plan_belt_purge(); + } + else if (this->has_wipe_tower()) { this->_make_wipe_tower(); } else if (this->config().print_sequence != PrintSequence::ByObject) { @@ -4085,6 +4104,13 @@ int Print::get_config_index(int filament_id, int layer_id, const std::vector 2) return true; @@ -4097,6 +4123,16 @@ bool Print::has_wipe_tower() const return false; } +// Belt purge prism: purging after filament changes is routed into a sliced +// prism object via the flush-into-objects machinery instead of a wipe tower. +bool Print::has_belt_purge_tower() const +{ + return m_config.belt_printer.value + && m_config.enable_prime_tower.value + && !m_config.spiral_mode.value + && m_config.filament_diameter.values.size() > 1; +} + const WipeTowerData &Print::wipe_tower_data(size_t filaments_cnt) const { // If the wipe tower wasn't created yet, make sure the depth and brim_width members are set to default. @@ -4183,6 +4219,179 @@ bool Print::enable_timelapse_print() const return m_config.timelapse_type.value == TimelapseType::tlSmooth; } +// Belt mode: snap the purge prism's layer grid onto the printed objects' grid. +// After belt slicing every object's layer print_z carries a per-object global +// z offset (mesh-vertex-scan belt_z_shift + instance-Y-dependent terms), so +// objects at different belt-Y positions do not share a layer grid. Purge +// marking looks absorbers up with get_layer_at_printz(lt.print_z, EPSILON), +// so the prism only absorbs purge at toolchange print_z values that coincide +// with one of its own layers. Shifting the prism by at most half a layer +// (a sub-layer-height displacement along the belt) makes its grid residue +// match the reference object's; both grids step by the same layer height +// (enforced by validate()), so matching residues means exact layer matches. +void Print::_align_belt_purge_layers() +{ + PrintObject *prism = nullptr; + for (PrintObject *po : m_objects) + if (po->config().belt_purge_tower_object.value) { + prism = po; + break; + } + if (prism == nullptr || prism->layers().empty()) + return; + + const double h = prism->config().layer_height.value; + if (h <= EPSILON) + return; + + // Grid residue of an object's layer grid: identical for all of an object's + // layers above the first since they step by h. + auto grid_offset = [h](const PrintObject *po) { + const double z = po->layers().front()->print_z; + return z - std::floor(z / h) * h; // in [0, h) + }; + + // Reference grid: the tallest non-prism object (proxy for the object with + // the most toolchange layers). + const PrintObject *ref = nullptr; + double ref_top = -std::numeric_limits::max(); + for (const PrintObject *po : m_objects) { + if (po->config().belt_purge_tower_object.value || po->layers().empty()) + continue; + const double top = po->layers().back()->print_z; + if (top > ref_top) { + ref_top = top; + ref = po; + } + } + if (ref == nullptr) + return; + + const double ref_offset = grid_offset(ref); + bool grids_mismatch = false; + for (const PrintObject *po : m_objects) { + if (po == ref || po->config().belt_purge_tower_object.value || po->layers().empty()) + continue; + double d = std::abs(grid_offset(po) - ref_offset); + d = std::min(d, h - d); + if (d > 5. * EPSILON) { + grids_mismatch = true; + break; + } + } + + // Shift normalized to (-h/2, h/2]. + double delta = ref_offset - grid_offset(prism); + if (delta > 0.5 * h) + delta -= h; + else if (delta <= -0.5 * h) + delta += h; + + BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] purge prism grid snap" + << " ref=" << ref->model_object()->name + << " ref_offset=" << ref_offset + << " prism_offset=" << grid_offset(prism) + << " delta=" << delta + << " grids_mismatch=" << grids_mismatch; + + prism->belt_shift_layer_grid(delta); + + if (grids_mismatch) + this->active_step_add_warning( + PrintStateBase::WarningLevel::NON_CRITICAL, + _u8L("Objects on the plate are sliced on different layer grids; the belt purge tower can only follow " + "one of them. Filament changes on layers of the other objects may not be fully purged.")); +} + +// Belt mode replacement for _make_wipe_tower(): plan filament-change purging +// into the belt purge prism (and any other flush_into_* object) using the +// flush-into-objects machinery, without generating classic wipe tower G-code. +// The toolchange itself is emitted by GCode::set_extruder() via the +// change_filament_gcode macro; the overrides marked here make the new +// filament's first extrusions land in the purge prism. +void Print::_plan_belt_purge() +{ + m_wipe_tower_data.clear(); + + // Must run before ToolOrdering is built: LayerTools merge per-object layer + // print_z values, and the prism only absorbs purge where its (snapped) + // layers coincide with the toolchange layers. + this->_align_belt_purge_layers(); + + const unsigned int number_of_extruders = (unsigned int) m_config.filament_colour.values.size(); + + // No initial priming extrusions: there is no tower to prime on. + m_wipe_tower_data.tool_ordering = ToolOrdering(*this, (unsigned int) -1, false); + m_wipe_tower_data.tool_ordering.sort_and_build_data(*this, (unsigned int) -1, false); + + if (m_wipe_tower_data.tool_ordering.empty() || m_wipe_tower_data.tool_ordering.last_extruder() == unsigned(-1)) + throw Slic3r::SlicingError("The print is empty. The model is not printable with current print settings."); + + if (!m_wipe_tower_data.tool_ordering.has_wipe_tower()) + // No toolchanges anywhere, nothing to purge. + return; + + this->throw_if_canceled(); + + // Flush volumes per filament pair, mirroring the generic wipe tower path: + // full flush matrix for single extruder multi material with purging enabled, + // plain prime volume otherwise. + std::vector flush_matrix(cast( + get_flush_volumes_matrix(m_config.flush_volumes_matrix.values, 0, m_config.nozzle_diameter.values.size()))); + std::vector> wipe_volumes; + for (unsigned int i = 0; i < number_of_extruders; ++i) + wipe_volumes.push_back(std::vector(flush_matrix.begin() + i * number_of_extruders, + flush_matrix.begin() + (i + 1) * number_of_extruders)); + const bool use_flush_matrix = m_config.purge_in_prime_tower && m_config.single_extruder_multi_material; + const float flush_multiplier = (float) m_config.flush_multiplier.get_at(0); + + float total_leftover = 0.f; + float worst_layer_leftover = 0.f; + double worst_layer_z = 0.; + + unsigned int current_extruder_id = m_wipe_tower_data.tool_ordering.first_extruder(); + for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { + float layer_leftover = 0.f; + for (const unsigned int extruder_id : layer_tools.extruders) { + if (extruder_id == current_extruder_id) + continue; + float volume_to_wipe = use_flush_matrix ? + wipe_volumes[current_extruder_id][extruder_id] * flush_multiplier : + (float) m_config.prime_volume; + float leftover = layer_tools.wiping_extrusions().mark_wiping_extrusions(*this, current_extruder_id, extruder_id, + volume_to_wipe); + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] purge toolchange print_z=" << layer_tools.print_z + << " filament " << current_extruder_id << "->" << extruder_id + << " requested=" << volume_to_wipe + << " absorbed=" << volume_to_wipe - leftover + << " leftover=" << leftover; + layer_leftover += leftover; + current_extruder_id = extruder_id; + } + layer_tools.wiping_extrusions().ensure_perimeters_infills_order(*this); + if (layer_leftover > 0.f) { + total_leftover += layer_leftover; + if (layer_leftover > worst_layer_leftover) { + worst_layer_leftover = layer_leftover; + worst_layer_z = layer_tools.print_z; + } + } + this->throw_if_canceled(); + } + + if (total_leftover > 1.f) { + this->active_step_add_warning( + PrintStateBase::WarningLevel::CRITICAL, + Slic3r::format(_u8L("The belt purge tower cannot absorb the full purge volume: %1% mm³ in total could not " + "be purged (worst layer: %2% mm³ at height %3%). The print may show color bleeding. " + "Increase the belt purge tower width, or reduce flushing volumes."), + int(std::ceil(total_leftover)), int(std::ceil(worst_layer_leftover)), + Slic3r::float_to_string_decimal_point(worst_layer_z, 2))); + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge planning leftover total=" << total_leftover + << " worst_layer=" << worst_layer_leftover << " at print_z=" << worst_layer_z; + } +} + void Print::_make_wipe_tower() { m_wipe_tower_data.clear(); diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index ff5a505360..fc78c5efef 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -558,6 +558,10 @@ private: std::vector> detect_extruder_geometric_unprintables() const; void slice_volumes(); + // Belt mode: shift the sliced layer grid (layer print_z and the belt floor + // clipping shift) by delta, used by Print::_align_belt_purge_layers() to + // snap the purge prism's layers onto the printed objects' layer grid. + void belt_shift_layer_grid(double delta); //BBS ExPolygons _shrink_contour_holes(double contour_delta, double hole_delta, const ExPolygons& polys) const; // BBS @@ -1085,6 +1089,8 @@ public: // Wipe tower support. bool has_wipe_tower() const; + // Belt purge prism (belt-mode replacement for the wipe tower). + bool has_belt_purge_tower() const; const WipeTowerData& wipe_tower_data(size_t filaments_cnt = 0) const; const ToolOrdering& tool_ordering() const { return m_tool_ordering; } @@ -1330,6 +1336,12 @@ private: void _make_skirt(); void _make_wipe_tower(); + // Belt mode: route filament-change purging into the belt purge prism + // (flush-into-objects) without generating a classic wipe tower. + void _plan_belt_purge(); + // Belt mode: shift the purge prism's layer grid to match the printed + // objects' grid so toolchange layers find prism layers to purge into. + void _align_belt_purge_layers(); void finalize_first_layer_convex_hull(); void update_filament_self_index_cache(); // Deduplicates, per filament, the (extruder type x volume type) variants the grouping diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index d0ce14ec35..cef9a840a8 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -7321,6 +7321,20 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionEnum(BeltSupportZOffsetMode::Unconditional)); } + def = this->add("belt_purge_tower_width", coFloat); + def->label = L("Belt purge tower width"); + def->category = L("Printable space"); + def->tooltip = L("Width (machine X, across the belt) of the purge prism that is automatically " + "generated on belt printers when the prime tower is enabled and multiple " + "filaments are used. Filament-change purging is routed into this prism's " + "extrusions instead of a classic wipe tower. Its height is computed " + "automatically from the worst-case purge volume per layer: a wider prism " + "results in a shorter one."); + def->sidetext = L("mm"); + def->min = 1.; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(35.)); + def = this->add("tree_support_branch_angle", coFloat); def->label = L("Tree support branch angle"); def->category = L("Support"); @@ -7966,6 +7980,16 @@ void PrintConfigDef::init_fff_params() "It will not take effect unless the prime tower is enabled."); def->set_default_value(new ConfigOptionBool(false)); + // Internal marker (not shown in any settings tab): identifies the auto-generated + // belt purge prism so it can be updated/removed by the auto-manager and aligned + // to the object layer grid by the backend. Persisted to 3mf like any per-object key. + def = this->add("belt_purge_tower_object", coBool); + def->category = L("Flush options"); + def->label = L("Belt purge tower object"); + def->tooltip = L("Marks the auto-generated belt purge prism. Managed automatically; do not set manually."); + def->mode = comDevelop; + def->set_default_value(new ConfigOptionBool(false)); + def = this->add("wipe_tower_bridging", coFloat); def->label = L("Maximal bridging distance"); def->tooltip = L("Maximal distance between supports on sparse infill sections."); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 3342a54b6d..ffd0320149 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1228,6 +1228,9 @@ PRINT_CONFIG_CLASS_DEFINE( // BBS ((ConfigOptionBool, flush_into_infill)) ((ConfigOptionBool, flush_into_support)) + // Marker for the auto-generated belt purge prism; identifies the object to + // the auto-manager (GUI) and the layer-grid alignment step (backend). + ((ConfigOptionBool, belt_purge_tower_object)) // BBS ((ConfigOptionFloat, tree_support_branch_distance)) ((ConfigOptionFloat, tree_support_tip_diameter)) @@ -1802,6 +1805,8 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, belt_support_floor_offset)) ((ConfigOptionEnum, belt_support_floor_mode)) ((ConfigOptionEnum, belt_support_z_offset_mode)) + // Width (machine X, across the belt) of the auto-generated belt purge prism. + ((ConfigOptionFloat, belt_purge_tower_width)) //BBS ((ConfigOptionInts, additional_cooling_fan_speed)) ((ConfigOptionInts, close_additional_fan_first_x_layers)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 68cedfc534..cd0bc34a8e 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1663,7 +1663,8 @@ bool PrintObject::invalidate_state_by_config_options( } else if ( opt_key == "flush_into_infill" || opt_key == "flush_into_objects" - || opt_key == "flush_into_support") { + || opt_key == "flush_into_support" + || opt_key == "belt_purge_tower_object") { invalidated |= m_print->invalidate_step(psWipeTower); invalidated |= m_print->invalidate_step(psGCodeExport); } else { diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 1212100eac..b95bc4903f 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1392,6 +1392,27 @@ void apply_fuzzy_skin_segmentation(PrintObject &print_object, ThrowOnCancel thro }); // end of parallel_for } +// Belt mode: shift the sliced layer grid by delta. Mirrors the global_z_offset +// application in slice() — layer print_z and belt_floor_z_shift move together +// so belt floor clipping stays consistent with the shifted grid. Used by +// Print::_align_belt_purge_layers() to snap the purge prism onto the printed +// objects' layer grid; |delta| <= half a layer height, i.e. a sub-layer shift +// of the prism along the belt. +void PrintObject::belt_shift_layer_grid(double delta) +{ + if (std::abs(delta) < EPSILON) + return; + for (Layer *layer : m_layers) + layer->print_z += delta; + for (SupportLayer *layer : m_support_layers) + layer->print_z += delta; + m_slicing_params.belt_floor_z_shift += delta; + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] belt_shift_layer_grid" + << " obj=" << this->model_object()->name + << " delta=" << delta + << " first_layer.print_z=" << (m_layers.empty() ? 0. : m_layers.front()->print_z); +} + // 1) Decides Z positions of the layers, // 2) Initializes layers and their regions // 3) Slices the object meshes diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 3fc69d6e4b..ffd4d43a71 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -971,11 +971,16 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in toggle_line("preheat_steps", have_ooze_prevention && (preheat_steps > 0)); bool have_prime_tower = config->opt_bool("enable_prime_tower"); + // ORCA-Belt: belt printers replace the classic wipe tower with the + // auto-generated belt purge prism — only its width is tunable; the + // classic tower geometry options do not apply. (is_belt_printer is + // computed at the top of this function.) + toggle_line("belt_purge_tower_width", have_prime_tower && is_belt_printer); for (auto el : {"prime_tower_width", "prime_tower_brim_width", "prime_tower_skip_points", "wipe_tower_wall_type", "prime_tower_infill_gap","prime_tower_enable_framework", "enable_tower_interface_features"}) - toggle_line(el, have_prime_tower); + toggle_line(el, have_prime_tower && !is_belt_printer); toggle_line("enable_tower_interface_cooldown_during_tower", - have_prime_tower && config->opt_bool("enable_tower_interface_features")); + have_prime_tower && !is_belt_printer && config->opt_bool("enable_tower_interface_features")); bool purge_in_primetower = preset_bundle->printers.get_edited_preset().config.opt_bool("purge_in_prime_tower"); @@ -983,17 +988,17 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in "wipe_tower_extra_spacing", "wipe_tower_max_purge_speed", "wipe_tower_bridging", "wipe_tower_extra_flow", "wipe_tower_no_sparse_layers"}) - toggle_line(el, have_prime_tower && supports_wipe_tower_2); + toggle_line(el, have_prime_tower && supports_wipe_tower_2 && !is_belt_printer); WipeTowerWallType wipe_tower_wall_type = config->opt_enum("wipe_tower_wall_type"); - bool have_rib_wall = (wipe_tower_wall_type == WipeTowerWallType::wtwRib)&&have_prime_tower; - toggle_line("wipe_tower_cone_angle", have_prime_tower && supports_wipe_tower_2 && wipe_tower_wall_type == WipeTowerWallType::wtwCone); + bool have_rib_wall = (wipe_tower_wall_type == WipeTowerWallType::wtwRib)&&have_prime_tower&&!is_belt_printer; + toggle_line("wipe_tower_cone_angle", have_prime_tower && supports_wipe_tower_2 && !is_belt_printer && wipe_tower_wall_type == WipeTowerWallType::wtwCone); toggle_line("wipe_tower_extra_rib_length", have_rib_wall); toggle_line("wipe_tower_rib_width", have_rib_wall); toggle_line("wipe_tower_fillet_wall", have_rib_wall); toggle_field("prime_tower_width", have_prime_tower && !have_rib_wall); - toggle_line("single_extruder_multi_material_priming", !bSEMM && have_prime_tower && supports_wipe_tower_2); + toggle_line("single_extruder_multi_material_priming", !bSEMM && have_prime_tower && supports_wipe_tower_2 && !is_belt_printer); toggle_line("prime_volume",have_prime_tower && (!purge_in_primetower || !bSEMM)); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index e3e84bc1c7..8ff05862a8 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2866,7 +2866,13 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re need_wipe_tower |= dynamic_cast(dconfig.option("enable_wrapping_detection"))->value; } - if (wt && (need_wipe_tower || filaments_count > 1) && !wxGetApp().plater()->only_gcode_mode() && !wxGetApp().plater()->is_gcode_3mf()) { + // Belt printers replace the classic wipe tower with the auto-generated + // belt purge prism (a real model object), so never draw the tower widget. + bool is_belt_printer = false; + if (const auto *belt_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option("belt_printer")) + is_belt_printer = belt_opt->value; + + if (wt && !is_belt_printer && (need_wipe_tower || filaments_count > 1) && !wxGetApp().plater()->only_gcode_mode() && !wxGetApp().plater()->is_gcode_3mf()) { for (int plate_id = 0; plate_id < n_plates; plate_id++) { // If print ByObject and there is only one object in the plate, the wipe tower is allowed to be generated. PartPlate* part_plate = ppl.get_plate(plate_id); diff --git a/src/slic3r/GUI/Jobs/ArrangeJob.cpp b/src/slic3r/GUI/Jobs/ArrangeJob.cpp index 6b74b71af1..4e143de7d8 100644 --- a/src/slic3r/GUI/Jobs/ArrangeJob.cpp +++ b/src/slic3r/GUI/Jobs/ArrangeJob.cpp @@ -291,6 +291,12 @@ void ArrangeJob::prepare_wipe_tower() bool enable_prime_tower = op && op->getBool(); if (!enable_prime_tower || params.is_seq_print) return; + // Belt printers have no classic wipe tower; purging goes into the belt + // purge prism, which is a real model object and arranges like any other. + if (const auto *belt_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option("belt_printer"); + belt_opt && belt_opt->value) + return; + bool smooth_timelapse = false; auto sop = current_config.option("timelapse_type"); if (sop) { smooth_timelapse = sop->getInt() == TimelapseType::tlSmooth; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 365384ecf9..d03c389dc7 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5475,6 +5475,10 @@ struct Plater::priv void exit_gizmo(); void remove(size_t obj_idx); bool delete_object_from_model(size_t obj_idx, bool refresh_immediately = true); //BBS + // ORCA-Belt: keep the auto-generated belt purge prism in sync with the + // config and plate contents. Returns true when the model was mutated + // (caller should refresh the scene). + bool ensure_belt_purge_tower(); void delete_all_objects_from_model(); void reset(bool apply_presets_change = false); void center_selection(); @@ -8879,6 +8883,225 @@ void Plater::priv::process_validation_warnings(const std::vectorconfig.option("belt_purge_tower_object"); + return opt != nullptr && opt->getBool(); + }; + + std::vector prism_idxs; + for (int i = 0; i < (int) model.objects.size(); ++i) + if (is_prism(model.objects[i])) + prism_idxs.push_back(i); + + // Deletes prism objects, keeping the sidebar and part plates in sync + // (same primitives as Plater::priv::remove(), minus scene update — the + // caller refreshes the scene). + auto remove_prisms = [this](const std::vector &idxs) { + for (auto it = idxs.rbegin(); it != idxs.rend(); ++it) { + model.delete_object(size_t(*it)); + partplate_list.notify_instance_removed(*it, -1); + sidebar->obj_list()->delete_object_from_list(size_t(*it)); + } + }; + + const auto &printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config; + const auto &print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; + auto &project_config = wxGetApp().preset_bundle->project_config; + + const auto *belt_opt = printer_config.option("belt_printer"); + const bool belt = belt_opt != nullptr && belt_opt->value; + const bool prime_tower_enabled = print_config.has("enable_prime_tower") && print_config.opt_bool("enable_prime_tower"); + const auto *seq_opt = print_config.option>("print_sequence"); + const bool by_object = seq_opt != nullptr && seq_opt->value == PrintSequence::ByObject; + + // Filaments used and bounding extent of the non-prism objects on the + // current plate (1-based filament ids; volume extruder 0 = object default). + PartPlate *plate = partplate_list.get_curr_plate(); + std::set filaments; + double y_min = std::numeric_limits::max(); + double y_max = -std::numeric_limits::max(); + double z_max = 0.; + bool have_objects = false; + if (belt && plate != nullptr) { + for (int obj_idx = 0; obj_idx < (int) model.objects.size(); ++obj_idx) { + const ModelObject *mo = model.objects[obj_idx]; + if (is_prism(mo)) + continue; + int obj_extruder = 1; + if (const ConfigOption *opt = mo->config.option("extruder"); opt != nullptr && opt->getInt() > 0) + obj_extruder = opt->getInt(); + bool any_instance_on_plate = false; + for (int inst_idx = 0; inst_idx < (int) mo->instances.size(); ++inst_idx) { + if (!plate->contain_instance_totally(obj_idx, inst_idx)) + continue; + any_instance_on_plate = true; + const BoundingBoxf3 bb = mo->instance_bounding_box(inst_idx); + y_min = std::min(y_min, bb.min.y()); + y_max = std::max(y_max, bb.max.y()); + z_max = std::max(z_max, bb.max.z()); + } + if (!any_instance_on_plate) + continue; + have_objects = true; + for (const ModelVolume *mv : mo->volumes) + for (int e : mv->get_extruders()) + filaments.insert(e > 0 ? e : obj_extruder); + } + } + + const bool wanted = belt && prime_tower_enabled && !by_object && have_objects && filaments.size() > 1; + if (!wanted) { + if (prism_idxs.empty()) + return false; + remove_prisms(prism_idxs); + BOOST_LOG_TRIVIAL(info) << "[BELT-DEBUG] belt purge tower removed (conditions not met)"; + return true; + } + + // --- Sizing ----------------------------------------------------------- + const double width = print_config.has("belt_purge_tower_width") ? std::max(1., print_config.opt_float("belt_purge_tower_width")) : 35.; + const double layer_h = print_config.has("layer_height") ? print_config.opt_float("layer_height") : 0.2; + + // Belt tilt: standard belt printers rotate about X. For other axes (or no + // rotation) fall back to vertical slicing geometry (theta = 90 deg); the + // backend leftover warning catches any resulting under-absorption. + double theta = M_PI / 2.; + const auto *axis_opt = printer_config.option>("belt_slice_rotation"); + const auto *angle_opt = printer_config.option("belt_slice_rotation_angle"); + if (axis_opt != nullptr && axis_opt->value == BeltRotationAxis::X && angle_opt != nullptr && std::abs(angle_opt->value) > EPSILON) + theta = std::clamp(Geometry::deg2rad(std::abs(angle_opt->value)), Geometry::deg2rad(5.), M_PI / 2.); + const double sin_t = std::sin(theta); + const double cot_t = std::cos(theta) / sin_t; + + // Worst-case purge volume of one layer: up to (filament count - 1) + // toolchanges, each needing the worst flush matrix entry (mirrors the + // volume selection in Print::_plan_belt_purge()). + const bool use_matrix = (print_config.has("purge_in_prime_tower") && print_config.opt_bool("purge_in_prime_tower")) + && (printer_config.has("single_extruder_multi_material") && printer_config.opt_bool("single_extruder_multi_material")); + double max_flush = print_config.has("prime_volume") ? print_config.opt_float("prime_volume") : 45.; + if (use_matrix) { + const size_t extruder_nums = wxGetApp().preset_bundle->get_printer_extruder_count(); + const std::vector matrix = get_flush_volumes_matrix( + project_config.option("flush_volumes_matrix")->values, 0, extruder_nums); + const auto * multi_opt = project_config.option("flush_multiplier"); + const double multiplier = multi_opt != nullptr && !multi_opt->values.empty() ? multi_opt->get_at(0) : 1.; + const int n_total = (int) (std::sqrt(double(matrix.size())) + 0.5); + double m = 0.; + for (int i : filaments) + for (int j : filaments) + if (i != j && i <= n_total && j <= n_total) + m = std::max(m, matrix[size_t(i - 1) * n_total + size_t(j - 1)]); + if (m > 0.) + max_flush = m * multiplier; + } + const double v_layer = double(filaments.size() - 1) * max_flush; + + // One tilted slicing plane cuts a width x (height/sin) rectangle out of + // the prism interior; one layer slab absorbs that area x layer height. + const double eta = 0.85; // perimeters/infill packing safety factor + double height = v_layer * sin_t / (width * layer_h * eta); + const double printable_height = printer_config.has("printable_height") ? printer_config.opt_float("printable_height") : 250.; + height = std::clamp(height, 2. * layer_h, std::max(2. * layer_h, printable_height)); + + // Length along the belt: cover the objects' Y extent; a slicing plane + // spans height*cot(theta) of belt travel, so pad both ends with the full + // lead-in (tilt sign is padded symmetrically) plus the objects' top + // overhang along the belt. + const double margin = 10.; + const double lead = height * cot_t; + double y_start = y_min - lead - margin; + double y_end = y_max + (z_max + height) * cot_t + margin; + + const Vec3d plate_origin = plate->get_origin(); + const auto *bed_opt = printer_config.option("printable_area"); + const bool infinite_y = printer_config.has("belt_printer_infinite_y") && printer_config.opt_bool("belt_printer_infinite_y"); + double lane_x = plate_origin.x() + 5.; // fallback left lane + if (bed_opt != nullptr && !bed_opt->values.empty()) { + const BoundingBoxf bed_ext = get_extents(bed_opt->values); + lane_x = plate_origin.x() + bed_ext.min.x() + 5.; + if (!infinite_y) { + y_start = std::max(y_start, plate_origin.y() + bed_ext.min.y() + 1.); + y_end = std::min(y_end, plate_origin.y() + bed_ext.max.y() - 1.); + } + } + const double length = std::max(y_end - y_start, 10.); + + const Vec3d desired_size(width, length, height); + const Vec3d desired_center(lane_x + 0.5 * width, y_start + 0.5 * length, 0.5 * height); + + // --- Idempotence check ------------------------------------------------- + // Coarse tolerances so object nudges and sizing jitter do not regenerate + // the prism on every background-process tick. + if (prism_idxs.size() == 1) { + const ModelObject *prism = model.objects[prism_idxs.front()]; + const BoundingBoxf3 bb = prism->bounding_box_exact(); + if ((bb.size() - desired_size).cwiseAbs().maxCoeff() < 5. && (bb.center() - desired_center).cwiseAbs().maxCoeff() < 5.) + return false; + } + + // --- (Re)create --------------------------------------------------------- + if (!prism_idxs.empty()) + remove_prisms(prism_idxs); + + ModelObject *new_object = model.add_object(); + new_object->name = _u8L("Belt Purge Tower"); + new_object->add_instance(); + ModelVolume *new_volume = new_object->add_volume(make_cube(width, length, height)); + new_volume->name = new_object->name; + + auto &cfg = new_object->config; + cfg.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); + cfg.set_key_value("flush_into_objects", new ConfigOptionBool(true)); + cfg.set_key_value("extruder", new ConfigOptionInt(1)); + // Sacrificial solid prism: one wall, no shells, dense rectilinear infill — + // every extrusion is overriddable, so the absorbed volume matches the + // cross-section x layer-height estimate used for the height above. + cfg.set_key_value("wall_loops", new ConfigOptionInt(1)); + cfg.set_key_value("top_shell_layers", new ConfigOptionInt(0)); + cfg.set_key_value("bottom_shell_layers", new ConfigOptionInt(0)); + cfg.set_key_value("sparse_infill_density", new ConfigOptionPercent(100)); + cfg.set_key_value("sparse_infill_pattern", new ConfigOptionEnum(ipRectilinear)); + cfg.set_key_value("enable_support", new ConfigOptionBool(false)); + cfg.set_key_value("brim_type", new ConfigOptionEnum(btNoBrim)); + cfg.set_key_value("seam_slope_type", new ConfigOptionEnum(SeamScarfType::None)); + cfg.set_key_value("precise_z_height", new ConfigOptionBool(false)); + + new_object->invalidate_bounding_box(); + const BoundingBoxf3 mesh_bb = new_volume->mesh().bounding_box(); + new_object->translate(-mesh_bb.center()); + new_object->instances.front()->set_offset(desired_center); + new_object->ensure_on_bed(); + new_object->instances.front()->set_assemble_transformation(new_object->instances.front()->get_transformation()); + + const size_t obj_idx = model.objects.size() - 1; + // Registers the object in the sidebar and notifies the part plates; + // selection is left untouched (auto-managed object). + sidebar->obj_list()->add_object_to_list(obj_idx, /*call_selection_changed=*/false); + + BOOST_LOG_TRIVIAL(info) << "[BELT-DEBUG] belt purge tower generated" + << " W=" << width << " L=" << length << " H=" << height + << " v_layer=" << v_layer << " max_flush=" << max_flush + << " filaments=" << filaments.size() + << " theta_deg=" << Geometry::rad2deg(theta) + << " center=(" << desired_center.x() << "," << desired_center.y() << ")"; + return true; +} + // Update background processing thread from the current config and Model. // Returns a bitmask of UpdateBackgroundProcessReturnState. unsigned int Plater::priv::update_background_process(bool force_validation, bool postpone_error_messages, bool switch_print) @@ -8889,6 +9112,10 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool // If the update_background_process() was not called by the timer, kill the timer, // so the update_restart_background_process() will not be called again in vain. background_process_timer.Stop(); + // ORCA-Belt: sync the auto-managed belt purge prism before the model is + // applied to the Print below, so the prism change rides this same apply. + if (printer_technology == ptFFF && this->ensure_belt_purge_tower()) + return_state |= UPDATE_BACKGROUND_PROCESS_REFRESH_SCENE; // Update the "out of print bed" state of ModelInstances. update_print_volume_state(); // Apply new config to the possibly running background task. diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 8de8bf6e84..25287c79c3 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3009,6 +3009,7 @@ void TabPrint::build() optgroup->append_single_option_line("enable_tower_interface_cooldown_during_tower", "multimaterial_settings_prime_tower"); optgroup->append_single_option_line("prime_tower_enable_framework", "multimaterial_settings_prime_tower"); optgroup->append_single_option_line("prime_tower_width", "multimaterial_settings_prime_tower#width"); + optgroup->append_single_option_line("belt_purge_tower_width", "multimaterial_settings_prime_tower"); optgroup->append_single_option_line("prime_volume", "multimaterial_settings_prime_tower"); optgroup->append_single_option_line("prime_tower_brim_width", "multimaterial_settings_prime_tower#brim-width"); optgroup->append_single_option_line("prime_tower_infill_gap", "multimaterial_settings_prime_tower"); From ec4e9717d3bdc17a0cbf1db3312497fe0e16131a Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 05:30:25 -0500 Subject: [PATCH 088/389] Part Two: Functional Results --- src/slic3r/GUI/Plater.cpp | 134 ++++++++++++++++++++++++++------------ 1 file changed, 92 insertions(+), 42 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index d03c389dc7..cda0a1557e 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5479,6 +5479,21 @@ struct Plater::priv // config and plate contents. Returns true when the model was mutated // (caller should refresh the scene). bool ensure_belt_purge_tower(); + // Inputs of the last belt purge prism generation. Idempotence is keyed on + // these (not the prism's resulting bbox): the prism gets nudged by plate + // assignment after creation, so comparing its bbox would falsely detect a + // change and regenerate it on every background-process tick — which would + // re-invalidate a freshly sliced result and make the preview unreachable. + struct BeltPurgeSignature { + bool valid = false; + int filament_count = 0; + long key[7] = {0}; // rounded geometry inputs (0.1 mm units) + bool operator==(const BeltPurgeSignature &o) const { + if (valid != o.valid || filament_count != o.filament_count) return false; + for (int i = 0; i < 7; ++i) if (key[i] != o.key[i]) return false; + return true; + } + } m_belt_purge_sig; void delete_all_objects_from_model(); void reset(bool apply_presets_change = false); void center_selection(); @@ -8933,6 +8948,8 @@ bool Plater::priv::ensure_belt_purge_tower() // current plate (1-based filament ids; volume extruder 0 = object default). PartPlate *plate = partplate_list.get_curr_plate(); std::set filaments; + double x_min = std::numeric_limits::max(); + double x_max = -std::numeric_limits::max(); double y_min = std::numeric_limits::max(); double y_max = -std::numeric_limits::max(); double z_max = 0.; @@ -8951,6 +8968,8 @@ bool Plater::priv::ensure_belt_purge_tower() continue; any_instance_on_plate = true; const BoundingBoxf3 bb = mo->instance_bounding_box(inst_idx); + x_min = std::min(x_min, bb.min.x()); + x_max = std::max(x_max, bb.max.x()); y_min = std::min(y_min, bb.min.y()); y_max = std::max(y_max, bb.max.y()); z_max = std::max(z_max, bb.max.z()); @@ -8966,10 +8985,11 @@ bool Plater::priv::ensure_belt_purge_tower() const bool wanted = belt && prime_tower_enabled && !by_object && have_objects && filaments.size() > 1; if (!wanted) { + m_belt_purge_sig = BeltPurgeSignature{}; if (prism_idxs.empty()) return false; remove_prisms(prism_idxs); - BOOST_LOG_TRIVIAL(info) << "[BELT-DEBUG] belt purge tower removed (conditions not met)"; + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] belt purge tower removed (conditions not met)"; return true; } @@ -8977,17 +8997,27 @@ bool Plater::priv::ensure_belt_purge_tower() const double width = print_config.has("belt_purge_tower_width") ? std::max(1., print_config.opt_float("belt_purge_tower_width")) : 35.; const double layer_h = print_config.has("layer_height") ? print_config.opt_float("layer_height") : 0.2; - // Belt tilt: standard belt printers rotate about X. For other axes (or no - // rotation) fall back to vertical slicing geometry (theta = 90 deg); the - // backend leftover warning catches any resulting under-absorption. - double theta = M_PI / 2.; - const auto *axis_opt = printer_config.option>("belt_slice_rotation"); + // Belt geometry. The rotation axis is the gantry tilt axis; the belt + // travels along the *other* horizontal axis (X-rotation -> belt along Y, + // the CR-30 default). The purge prism is a long bar laid along the belt + // travel direction, beside the parts. For no/Z rotation we fall back to + // vertical slicing geometry (theta = 90 deg). + const auto *axis_opt = printer_config.option>("belt_slice_rotation"); const auto *angle_opt = printer_config.option("belt_slice_rotation_angle"); - if (axis_opt != nullptr && axis_opt->value == BeltRotationAxis::X && angle_opt != nullptr && std::abs(angle_opt->value) > EPSILON) + const BeltRotationAxis rot = axis_opt != nullptr ? axis_opt->value : BeltRotationAxis::X; + const bool belt_is_y = (rot != BeltRotationAxis::Y); // X / None / Z -> belt along Y + double theta = M_PI / 2.; + if ((rot == BeltRotationAxis::X || rot == BeltRotationAxis::Y) && angle_opt != nullptr && std::abs(angle_opt->value) > EPSILON) theta = std::clamp(Geometry::deg2rad(std::abs(angle_opt->value)), Geometry::deg2rad(5.), M_PI / 2.); const double sin_t = std::sin(theta); const double cot_t = std::cos(theta) / sin_t; + // Parts' extent along the belt-travel axis and the lateral (across-belt) axis. + const double belt_min = belt_is_y ? y_min : x_min; + const double belt_max = belt_is_y ? y_max : x_max; + const double lat_min = belt_is_y ? x_min : y_min; + const double lat_max = belt_is_y ? x_max : y_max; + // Worst-case purge volume of one layer: up to (filament count - 1) // toolchanges, each needing the worst flush matrix entry (mirrors the // volume selection in Print::_plan_belt_purge()). @@ -9018,41 +9048,56 @@ bool Plater::priv::ensure_belt_purge_tower() const double printable_height = printer_config.has("printable_height") ? printer_config.opt_float("printable_height") : 250.; height = std::clamp(height, 2. * layer_h, std::max(2. * layer_h, printable_height)); - // Length along the belt: cover the objects' Y extent; a slicing plane - // spans height*cot(theta) of belt travel, so pad both ends with the full - // lead-in (tilt sign is padded symmetrically) plus the objects' top - // overhang along the belt. - const double margin = 10.; - const double lead = height * cot_t; - double y_start = y_min - lead - margin; - double y_end = y_max + (z_max + height) * cot_t + margin; + // --- Idempotence (input-keyed) ---------------------------------------- + // Key on the generation inputs, NOT the prism's resulting bbox: plate + // assignment nudges the prism after creation, so a bbox comparison sees a + // "change" every tick and regenerates the prism, which re-invalidates any + // freshly sliced result and makes the G-code preview unreachable. + auto q = [](double v) { return std::lround(v * 10.0); }; // 0.1 mm quantization + BeltPurgeSignature sig; + sig.valid = true; + sig.filament_count = (int) filaments.size(); + sig.key[0] = q(width); + sig.key[1] = q(layer_h); + sig.key[2] = q(height); + sig.key[3] = q(belt_min); + sig.key[4] = q(belt_max); + sig.key[5] = q(lat_min); + sig.key[6] = q(z_max); + if (prism_idxs.size() == 1 && sig == m_belt_purge_sig) + return false; // already up to date — do not touch the model - const Vec3d plate_origin = plate->get_origin(); - const auto *bed_opt = printer_config.option("printable_area"); - const bool infinite_y = printer_config.has("belt_printer_infinite_y") && printer_config.opt_bool("belt_printer_infinite_y"); - double lane_x = plate_origin.x() + 5.; // fallback left lane - if (bed_opt != nullptr && !bed_opt->values.empty()) { - const BoundingBoxf bed_ext = get_extents(bed_opt->values); - lane_x = plate_origin.x() + bed_ext.min.x() + 5.; - if (!infinite_y) { - y_start = std::max(y_start, plate_origin.y() + bed_ext.min.y() + 1.); - y_end = std::min(y_end, plate_origin.y() + bed_ext.max.y() - 1.); - } + // --- Position ---------------------------------------------------------- + // Lay the bar along the belt, anchored at the parts' belt-axis minimum so + // it leads the print at the belt entry. A tilted slicing plane through a + // part of height z reaches belt position y + z*cot(theta), so extend the + // trailing end to cover the tallest part's upper toolchanges plus the + // prism's own tilt span. + const double margin = 5.; + const double belt_start = belt_min - margin; // anchored at parts' belt minimum + const double belt_end = belt_max + (z_max + height) * cot_t + margin; // trailing tilt allowance + const double length = std::max(belt_end - belt_start, 10.); + const double belt_center = 0.5 * (belt_start + belt_end); + + // Lateral placement: just beside the parts (the -lateral side by default, + // flipping to the +lateral side if that would fall off the bed). + const Vec3d plate_origin = plate->get_origin(); + const double gap = 5.; + double lat_center = lat_min - gap - 0.5 * width; + if (const auto *bed_opt = printer_config.option("printable_area"); + bed_opt != nullptr && !bed_opt->values.empty()) { + const BoundingBoxf bed_ext = get_extents(bed_opt->values); + const double bed_lat_min = plate_origin[belt_is_y ? 0 : 1] + (belt_is_y ? bed_ext.min.x() : bed_ext.min.y()); + if (lat_center - 0.5 * width < bed_lat_min) + lat_center = lat_max + gap + 0.5 * width; // not enough room on the -lateral side } - const double length = std::max(y_end - y_start, 10.); - const Vec3d desired_size(width, length, height); - const Vec3d desired_center(lane_x + 0.5 * width, y_start + 0.5 * length, 0.5 * height); - - // --- Idempotence check ------------------------------------------------- - // Coarse tolerances so object nudges and sizing jitter do not regenerate - // the prism on every background-process tick. - if (prism_idxs.size() == 1) { - const ModelObject *prism = model.objects[prism_idxs.front()]; - const BoundingBoxf3 bb = prism->bounding_box_exact(); - if ((bb.size() - desired_size).cwiseAbs().maxCoeff() < 5. && (bb.center() - desired_center).cwiseAbs().maxCoeff() < 5.) - return false; - } + // Orient the bar: long axis = belt travel, width = lateral, height = Z. + const double size_x = belt_is_y ? width : length; + const double size_y = belt_is_y ? length : width; + const Vec3d desired_center(belt_is_y ? lat_center : belt_center, + belt_is_y ? belt_center : lat_center, + 0.5 * height); // --- (Re)create --------------------------------------------------------- if (!prism_idxs.empty()) @@ -9061,7 +9106,7 @@ bool Plater::priv::ensure_belt_purge_tower() ModelObject *new_object = model.add_object(); new_object->name = _u8L("Belt Purge Tower"); new_object->add_instance(); - ModelVolume *new_volume = new_object->add_volume(make_cube(width, length, height)); + ModelVolume *new_volume = new_object->add_volume(make_cube(size_x, size_y, height)); new_volume->name = new_object->name; auto &cfg = new_object->config; @@ -9093,12 +9138,17 @@ bool Plater::priv::ensure_belt_purge_tower() // selection is left untouched (auto-managed object). sidebar->obj_list()->add_object_to_list(obj_idx, /*call_selection_changed=*/false); - BOOST_LOG_TRIVIAL(info) << "[BELT-DEBUG] belt purge tower generated" + // Record the inputs that produced this prism so subsequent ticks are no-ops + // until the parts/config actually change. + m_belt_purge_sig = sig; + + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] belt purge tower generated" + << " belt_is_y=" << belt_is_y << " W=" << width << " L=" << length << " H=" << height << " v_layer=" << v_layer << " max_flush=" << max_flush << " filaments=" << filaments.size() << " theta_deg=" << Geometry::rad2deg(theta) - << " center=(" << desired_center.x() << "," << desired_center.y() << ")"; + << " center=(" << desired_center.x() << "," << desired_center.y() << "," << desired_center.z() << ")"; return true; } From 854dae8dd24ccd5e815b5aea1837b346bcb31215 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 06:04:10 -0500 Subject: [PATCH 089/389] strategy incremental --- src/libslic3r/Print.cpp | 27 ++++++++++++++++++++++ src/slic3r/GUI/Plater.cpp | 48 +++++++++++++++++++++++---------------- 2 files changed, 56 insertions(+), 19 deletions(-) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 390bba1ff2..b5d3701e41 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -4345,6 +4345,21 @@ void Print::_plan_belt_purge() const bool use_flush_matrix = m_config.purge_in_prime_tower && m_config.single_extruder_multi_material; const float flush_multiplier = (float) m_config.flush_multiplier.get_at(0); + // Diagnostic: the prism only absorbs purge at toolchange layers whose + // print_z coincides with one of its own layers. Compare the prism's layer + // print_z range to the toolchange print_z range and count how many + // toolchange layers actually land on a prism layer. This distinguishes a + // range/grid-alignment failure (no coverage) from a capacity shortfall + // (covered but not enough cross-section). + const PrintObject *diag_prism = nullptr; + for (const PrintObject *po : m_objects) + if (po->config().belt_purge_tower_object.value && !po->layers().empty()) { diag_prism = po; break; } + if (diag_prism != nullptr) + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge prism layer range print_z=[" + << diag_prism->layers().front()->print_z << ", " << diag_prism->layers().back()->print_z + << "] nlayers=" << diag_prism->layers().size(); + int tc_layers = 0, tc_layers_covered = 0; + float total_leftover = 0.f; float worst_layer_leftover = 0.f; double worst_layer_z = 0.; @@ -4352,9 +4367,16 @@ void Print::_plan_belt_purge() unsigned int current_extruder_id = m_wipe_tower_data.tool_ordering.first_extruder(); for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { float layer_leftover = 0.f; + bool layer_has_tc = false; for (const unsigned int extruder_id : layer_tools.extruders) { if (extruder_id == current_extruder_id) continue; + if (!layer_has_tc) { + layer_has_tc = true; + ++tc_layers; + if (diag_prism != nullptr && diag_prism->get_layer_at_printz(layer_tools.print_z, EPSILON) != nullptr) + ++tc_layers_covered; + } float volume_to_wipe = use_flush_matrix ? wipe_volumes[current_extruder_id][extruder_id] * flush_multiplier : (float) m_config.prime_volume; @@ -4379,6 +4401,11 @@ void Print::_plan_belt_purge() this->throw_if_canceled(); } + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge coverage: " << tc_layers_covered << "/" << tc_layers + << " toolchange layers land on a prism layer" + << (tc_layers > 0 && tc_layers_covered == 0 ? " (RANGE/GRID MISALIGNMENT — prism absorbs nothing)" : + tc_layers_covered < tc_layers ? " (partial coverage)" : " (full coverage)"); + if (total_leftover > 1.f) { this->active_step_add_warning( PrintStateBase::WarningLevel::CRITICAL, diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index cda0a1557e..6e3ccd6da3 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9041,12 +9041,19 @@ bool Plater::priv::ensure_belt_purge_tower() } const double v_layer = double(filaments.size() - 1) * max_flush; - // One tilted slicing plane cuts a width x (height/sin) rectangle out of - // the prism interior; one layer slab absorbs that area x layer height. - const double eta = 0.85; // perimeters/infill packing safety factor - double height = v_layer * sin_t / (width * layer_h * eta); + // Height from the per-layer purge demand. A tilted slicing plane cuts a + // width x (height/sin) rectangle out of the bar, so one layer slab absorbs + // width * (height/sin) * layer_height of purge. Solve for the height that + // holds the worst-case per-layer purge, with: + // eta - infill/perimeter packing (not all of the cross-section is solid) + // safety - margin for the tilt ramp at the bar ends and layer-grid + // alignment slop, where a layer cuts less than the full section + // and a minimum so the tower is a real printable body rather than a sliver. + const double eta = 0.85; + const double safety = 1.6; const double printable_height = printer_config.has("printable_height") ? printer_config.opt_float("printable_height") : 250.; - height = std::clamp(height, 2. * layer_h, std::max(2. * layer_h, printable_height)); + double height = safety * v_layer * sin_t / (width * layer_h * eta); + height = std::clamp(height, 8.0, std::max(8.0, printable_height)); // --- Idempotence (input-keyed) ---------------------------------------- // Key on the generation inputs, NOT the prism's resulting bbox: plate @@ -9068,28 +9075,31 @@ bool Plater::priv::ensure_belt_purge_tower() return false; // already up to date — do not touch the model // --- Position ---------------------------------------------------------- - // Lay the bar along the belt, anchored at the parts' belt-axis minimum so - // it leads the print at the belt entry. A tilted slicing plane through a - // part of height z reaches belt position y + z*cot(theta), so extend the - // trailing end to cover the tallest part's upper toolchanges plus the - // prism's own tilt span. + // Default belt-printer placement (per user request): + // - belt-travel axis: anchored at the parts' belt-axis MINIMUM (the belt + // entry / parts' min Y for an X-rotation belt) so the tower leads in. + // - across-belt axis: parked right up against the bed's MAXIMUM edge + // (max X for an X-rotation belt), out of the way of the parts. + // The bar extends from the parts' belt minimum past the parts; a tilted + // slicing plane through a part of height z reaches belt position + // y + z*cot(theta), so the trailing end covers the tallest part's upper + // toolchanges plus the bar's own tilt span. const double margin = 5.; - const double belt_start = belt_min - margin; // anchored at parts' belt minimum + const double belt_start = belt_min; // parts' belt-axis minimum const double belt_end = belt_max + (z_max + height) * cot_t + margin; // trailing tilt allowance const double length = std::max(belt_end - belt_start, 10.); const double belt_center = 0.5 * (belt_start + belt_end); - // Lateral placement: just beside the parts (the -lateral side by default, - // flipping to the +lateral side if that would fall off the bed). + // Across-belt: flush against the bed's maximum edge (small inset), falling + // back to just past the parts if the bed shape is unavailable. const Vec3d plate_origin = plate->get_origin(); - const double gap = 5.; - double lat_center = lat_min - gap - 0.5 * width; + const double inset = 1.; + double lat_center = lat_max + 5. + 0.5 * width; if (const auto *bed_opt = printer_config.option("printable_area"); bed_opt != nullptr && !bed_opt->values.empty()) { - const BoundingBoxf bed_ext = get_extents(bed_opt->values); - const double bed_lat_min = plate_origin[belt_is_y ? 0 : 1] + (belt_is_y ? bed_ext.min.x() : bed_ext.min.y()); - if (lat_center - 0.5 * width < bed_lat_min) - lat_center = lat_max + gap + 0.5 * width; // not enough room on the -lateral side + const BoundingBoxf bed_ext = get_extents(bed_opt->values); + const double bed_lat_max = plate_origin[belt_is_y ? 0 : 1] + (belt_is_y ? bed_ext.max.x() : bed_ext.max.y()); + lat_center = bed_lat_max - inset - 0.5 * width; } // Orient the bar: long axis = belt travel, width = lateral, height = Z. From 60e9ee26c9f8701abb25b0fa69c46419e45f9f50 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 06:27:42 -0500 Subject: [PATCH 090/389] strategy incremental 2 --- src/slic3r/GUI/Plater.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6e3ccd6da3..0dd0210ba4 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9090,15 +9090,18 @@ bool Plater::priv::ensure_belt_purge_tower() const double length = std::max(belt_end - belt_start, 10.); const double belt_center = 0.5 * (belt_start + belt_end); - // Across-belt: flush against the bed's maximum edge (small inset), falling - // back to just past the parts if the bed shape is unavailable. - const Vec3d plate_origin = plate->get_origin(); + // Across-belt: flush against the bed's maximum edge, inset by half the bar + // width so the bar's far edge sits on the boundary and the whole bar stays + // on the bed (otherwise the center lands on the edge and half the bar hangs + // off → "objects laid over the boundary" → no slicing). Coordinates are in + // the printable_area / instance frame (do NOT add plate origin — the belt + // calibration objects are positioned the same way, see _calib_temp_belt_*). const double inset = 1.; - double lat_center = lat_max + 5. + 0.5 * width; + double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts if (const auto *bed_opt = printer_config.option("printable_area"); bed_opt != nullptr && !bed_opt->values.empty()) { const BoundingBoxf bed_ext = get_extents(bed_opt->values); - const double bed_lat_max = plate_origin[belt_is_y ? 0 : 1] + (belt_is_y ? bed_ext.max.x() : bed_ext.max.y()); + const double bed_lat_max = belt_is_y ? bed_ext.max.x() : bed_ext.max.y(); lat_center = bed_lat_max - inset - 0.5 * width; } From 62d8f22f52d4fc04d2ed157f8911694d6cf961c6 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 07:02:14 -0500 Subject: [PATCH 091/389] purge tower still centered on X max --- src/slic3r/GUI/Plater.cpp | 47 +++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 0dd0210ba4..d00396d97e 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9010,7 +9010,6 @@ bool Plater::priv::ensure_belt_purge_tower() if ((rot == BeltRotationAxis::X || rot == BeltRotationAxis::Y) && angle_opt != nullptr && std::abs(angle_opt->value) > EPSILON) theta = std::clamp(Geometry::deg2rad(std::abs(angle_opt->value)), Geometry::deg2rad(5.), M_PI / 2.); const double sin_t = std::sin(theta); - const double cot_t = std::cos(theta) / sin_t; // Parts' extent along the belt-travel axis and the lateral (across-belt) axis. const double belt_min = belt_is_y ? y_min : x_min; @@ -9075,36 +9074,46 @@ bool Plater::priv::ensure_belt_purge_tower() return false; // already up to date — do not touch the model // --- Position ---------------------------------------------------------- - // Default belt-printer placement (per user request): - // - belt-travel axis: anchored at the parts' belt-axis MINIMUM (the belt - // entry / parts' min Y for an X-rotation belt) so the tower leads in. - // - across-belt axis: parked right up against the bed's MAXIMUM edge - // (max X for an X-rotation belt), out of the way of the parts. - // The bar extends from the parts' belt minimum past the parts; a tilted - // slicing plane through a part of height z reaches belt position - // y + z*cot(theta), so the trailing end covers the tallest part's upper - // toolchanges plus the bar's own tilt span. + // Belt-travel axis: anchor the bar at the parts' belt-axis MINIMUM and span + // just the parts' belt extent (+ small margin). Filament changes happen + // over the parts' belt band, so the bar must sit there to absorb them; + // extending it far up the belt moves its body away from the toolchange + // layers and the purge goes unabsorbed (empirically, moving the tower + // toward the parts' Y-min clears the "cannot absorb" warning). const double margin = 5.; - const double belt_start = belt_min; // parts' belt-axis minimum - const double belt_end = belt_max + (z_max + height) * cot_t + margin; // trailing tilt allowance + const double belt_start = belt_min; // parts' belt-axis minimum + const double belt_end = belt_max + margin; // just past the parts — stay low / near the parts const double length = std::max(belt_end - belt_start, 10.); const double belt_center = 0.5 * (belt_start + belt_end); // Across-belt: flush against the bed's maximum edge, inset by half the bar // width so the bar's far edge sits on the boundary and the whole bar stays - // on the bed (otherwise the center lands on the edge and half the bar hangs - // off → "objects laid over the boundary" → no slicing). Coordinates are in - // the printable_area / instance frame (do NOT add plate origin — the belt - // calibration objects are positioned the same way, see _calib_temp_belt_*). - const double inset = 1.; - double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts + // on the bed. The bed (printable_area) is plate-local but model instances + // live in the plate's world frame, so add the plate origin's lateral + // component (plate-origin compensation is needed throughout the belt + // pipeline). lat_min/lat_max come from instance_bounding_box (world frame). + const Vec3d plate_origin = plate->get_origin(); + const double lat_origin = plate_origin[belt_is_y ? 0 : 1]; + const double inset = 1.; + double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts + BoundingBoxf bed_ext_dbg; if (const auto *bed_opt = printer_config.option("printable_area"); bed_opt != nullptr && !bed_opt->values.empty()) { const BoundingBoxf bed_ext = get_extents(bed_opt->values); + bed_ext_dbg = bed_ext; const double bed_lat_max = belt_is_y ? bed_ext.max.x() : bed_ext.max.y(); - lat_center = bed_lat_max - inset - 0.5 * width; + lat_center = lat_origin + bed_lat_max - inset - 0.5 * width; } + // Ground-truth diagnostic for placement frames (warning level so it lands + // in the GUI debug log): plate origin, bed extents, parts bbox, result. + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge place" + << " plate_origin=(" << plate_origin.x() << "," << plate_origin.y() << ")" + << " parts_x=[" << x_min << "," << x_max << "] parts_y=[" << y_min << "," << y_max << "] z_max=" << z_max + << " bed_ext=[" << bed_ext_dbg.min.x() << "," << bed_ext_dbg.min.y() + << " -> " << bed_ext_dbg.max.x() << "," << bed_ext_dbg.max.y() << "]" + << " lat_center=" << lat_center << " belt=[" << belt_start << "," << belt_end << "]"; + // Orient the bar: long axis = belt travel, width = lateral, height = Z. const double size_x = belt_is_y ? width : length; const double size_y = belt_is_y ? length : width; From 7cc50d750c2928629e443e7501004915f710e51c Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 07:20:12 -0500 Subject: [PATCH 092/389] automated placement works --- src/slic3r/GUI/Plater.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index d00396d97e..b634a65440 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9148,11 +9148,18 @@ bool Plater::priv::ensure_belt_purge_tower() cfg.set_key_value("seam_slope_type", new ConfigOptionEnum(SeamScarfType::None)); cfg.set_key_value("precise_z_height", new ConfigOptionBool(false)); + // Position by the belt-calibration pattern: drop to the bed, then translate + // the instance by the delta between the object's ACTUAL bbox center and the + // target. Setting the instance offset directly is unreliable here — the + // freshly added cube's local frame is not centered, so set_offset() lands + // the min corner (not the center) on the target, leaving the bar centered + // on the bed edge with half of it hanging off. new_object->invalidate_bounding_box(); - const BoundingBoxf3 mesh_bb = new_volume->mesh().bounding_box(); - new_object->translate(-mesh_bb.center()); - new_object->instances.front()->set_offset(desired_center); new_object->ensure_on_bed(); + const BoundingBoxf3 cur = new_object->bounding_box_exact(); + new_object->translate_instances(Vec3d(desired_center.x() - cur.center().x(), + desired_center.y() - cur.center().y(), + 0.0)); new_object->instances.front()->set_assemble_transformation(new_object->instances.front()->get_transformation()); const size_t obj_idx = model.objects.size() - 1; @@ -9170,7 +9177,9 @@ bool Plater::priv::ensure_belt_purge_tower() << " v_layer=" << v_layer << " max_flush=" << max_flush << " filaments=" << filaments.size() << " theta_deg=" << Geometry::rad2deg(theta) - << " center=(" << desired_center.x() << "," << desired_center.y() << "," << desired_center.z() << ")"; + << " desired_center=(" << desired_center.x() << "," << desired_center.y() << "," << desired_center.z() << ")" + << " achieved_center=(" << new_object->bounding_box_exact().center().x() << "," + << new_object->bounding_box_exact().center().y() << ")"; return true; } From 79c93733d33c327d7a1cc30ed1ae6d66865950dd Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 08:00:16 -0500 Subject: [PATCH 093/389] purge tower additional compensation --- src/slic3r/GUI/Plater.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b634a65440..f20a9ec60f 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9074,17 +9074,22 @@ bool Plater::priv::ensure_belt_purge_tower() return false; // already up to date — do not touch the model // --- Position ---------------------------------------------------------- - // Belt-travel axis: anchor the bar at the parts' belt-axis MINIMUM and span - // just the parts' belt extent (+ small margin). Filament changes happen - // over the parts' belt band, so the bar must sit there to absorb them; - // extending it far up the belt moves its body away from the toolchange - // layers and the purge goes unabsorbed (empirically, moving the tower - // toward the parts' Y-min clears the "cannot absorb" warning). - const double margin = 5.; - const double belt_start = belt_min; // parts' belt-axis minimum - const double belt_end = belt_max + margin; // just past the parts — stay low / near the parts - const double length = std::max(belt_end - belt_start, 10.); - const double belt_center = 0.5 * (belt_start + belt_end); + // Belt-travel axis: span the parts' belt band, extended at BOTH tilted ends + // by the ramp allowance. The bar's tilted ends are triangular ramps where a + // slicing plane cuts less than the full height, so those layers can't hold a + // full purge. Pull the leading edge toward Y=0 below the parts' minimum and + // push the trailing edge past the parts' maximum, each by height/sin(theta) + // (= sqrt(2)*height at 45 deg), so the full-cross-section region covers the + // whole parts' band and every toolchange layer gets a full slice of the bar. + // (Filament changes happen over the parts' belt band — empirically the tower + // must sit there, anchored near the parts' Y-min, to clear the "cannot + // absorb" warning.) + const double margin = 5.; + const double ramp_compensation = height / sin_t; + const double belt_start = std::max(0.0, belt_min - ramp_compensation); // leading ramp, toward Y=0 + const double belt_end = belt_max + margin + ramp_compensation; // trailing ramp, past the parts + const double length = std::max(belt_end - belt_start, 10.); + const double belt_center = 0.5 * (belt_start + belt_end); // Across-belt: flush against the bed's maximum edge, inset by half the bar // width so the bar's far edge sits on the boundary and the whole bar stays From d367bcef923d22d7ecf297ab2e49f3b9d17fbc70 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 08:13:45 -0500 Subject: [PATCH 094/389] extra height compensation --- src/slic3r/GUI/Plater.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index f20a9ec60f..33fd309f0e 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9010,6 +9010,7 @@ bool Plater::priv::ensure_belt_purge_tower() if ((rot == BeltRotationAxis::X || rot == BeltRotationAxis::Y) && angle_opt != nullptr && std::abs(angle_opt->value) > EPSILON) theta = std::clamp(Geometry::deg2rad(std::abs(angle_opt->value)), Geometry::deg2rad(5.), M_PI / 2.); const double sin_t = std::sin(theta); + const double cot_t = std::cos(theta) / sin_t; // Parts' extent along the belt-travel axis and the lateral (across-belt) axis. const double belt_min = belt_is_y ? y_min : x_min; @@ -9074,20 +9075,22 @@ bool Plater::priv::ensure_belt_purge_tower() return false; // already up to date — do not touch the model // --- Position ---------------------------------------------------------- - // Belt-travel axis: span the parts' belt band, extended at BOTH tilted ends - // by the ramp allowance. The bar's tilted ends are triangular ramps where a - // slicing plane cuts less than the full height, so those layers can't hold a - // full purge. Pull the leading edge toward Y=0 below the parts' minimum and - // push the trailing edge past the parts' maximum, each by height/sin(theta) - // (= sqrt(2)*height at 45 deg), so the full-cross-section region covers the - // whole parts' band and every toolchange layer gets a full slice of the bar. - // (Filament changes happen over the parts' belt band — empirically the tower - // must sit there, anchored near the parts' Y-min, to clear the "cannot - // absorb" warning.) + // Belt-travel axis. With the mesh rotated by theta before slicing, a machine + // point (y,z) maps to slicing-Z = y*sin(theta) + z*cos(theta). The parts + // occupy slicing-Z in [y_min*sin, y_max*sin + z_max*cos], and the bar's + // FULL-cross-section region (the part not in a triangular end ramp) spans + // slicing-Z [belt_start*sin + H*cos, belt_end*sin]. Covering the parts' + // whole band therefore needs: + // - leading edge belt_start <= y_min - H*cot(theta) (bar's own ramp) + // - trailing edge belt_end >= y_max + z_max*cot(theta) (parts' top + // features print further up the belt, so the bar must reach there). + // The leading side uses the bar-ramp allowance height/sin (>= H*cot, slight + // over-cover); the trailing side adds the parts' height projection + // z_max*cot, which dominates the bar's own ramp. const double margin = 5.; const double ramp_compensation = height / sin_t; - const double belt_start = std::max(0.0, belt_min - ramp_compensation); // leading ramp, toward Y=0 - const double belt_end = belt_max + margin + ramp_compensation; // trailing ramp, past the parts + const double belt_start = std::max(0.0, belt_min - ramp_compensation); // leading ramp, toward Y=0 + const double belt_end = belt_max + margin + ramp_compensation + z_max * cot_t; // + parts' top-feature belt reach const double length = std::max(belt_end - belt_start, 10.); const double belt_center = 0.5 * (belt_start + belt_end); From 131b61b726c30550f833d0c4757bfc6414603909 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 08:45:33 -0500 Subject: [PATCH 095/389] auto purge tower height calculation works --- src/slic3r/GUI/Plater.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 33fd309f0e..656a7d31e2 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9021,7 +9021,13 @@ bool Plater::priv::ensure_belt_purge_tower() // Worst-case purge volume of one layer: up to (filament count - 1) // toolchanges, each needing the worst flush matrix entry (mirrors the // volume selection in Print::_plan_belt_purge()). - const bool use_matrix = (print_config.has("purge_in_prime_tower") && print_config.opt_bool("purge_in_prime_tower")) + // NOTE: both purge_in_prime_tower and single_extruder_multi_material are + // PRINTER options (Preset.cpp s_Preset_printer_options) — read them from the + // printer preset. Reading purge_in_prime_tower from the print preset returns + // has()==false, collapsing use_matrix to false and sizing the tower for the + // small prime_volume instead of the real color-change flush. This must match + // the backend Print::_plan_belt_purge() which reads both from the merged config. + const bool use_matrix = (printer_config.has("purge_in_prime_tower") && printer_config.opt_bool("purge_in_prime_tower")) && (printer_config.has("single_extruder_multi_material") && printer_config.opt_bool("single_extruder_multi_material")); double max_flush = print_config.has("prime_volume") ? print_config.opt_float("prime_volume") : 45.; if (use_matrix) { From c80f1ab312285d7884a021abd9815d4bf230ccde Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 09:51:48 -0500 Subject: [PATCH 096/389] cancel top of purge tower early if no extra parts to print --- src/libslic3r/Print.cpp | 21 +++++++++++++++++++++ src/libslic3r/Print.hpp | 3 +++ src/libslic3r/PrintObjectSlice.cpp | 25 +++++++++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index b5d3701e41..5a0a6f8d8b 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -4345,6 +4345,27 @@ void Print::_plan_belt_purge() const bool use_flush_matrix = m_config.purge_in_prime_tower && m_config.single_extruder_multi_material; const float flush_multiplier = (float) m_config.flush_multiplier.get_at(0); + // Cancel the purge prism early: pre-scan the tool ordering for the highest + // print_z that actually has a toolchange, then drop the prism's layers above + // it so the tower stops at the last color swap (saves filament/time). This + // MUST happen before the marking loop below: ensure_perimeters_infills_order + // force-overrides the prism's extrusions on every layer (it is a dedicated + // flush object), so truncating afterwards would leave dangling overrides + // pointing into deleted layers. + { + double last_tc_z = -1.; + unsigned int cur_ext = m_wipe_tower_data.tool_ordering.first_extruder(); + for (const auto < : m_wipe_tower_data.tool_ordering.layer_tools()) + for (const unsigned int e : lt.extruders) + if (e != cur_ext) { last_tc_z = lt.print_z; cur_ext = e; } + if (last_tc_z >= 0.) + for (PrintObject *po : m_objects) + if (po->config().belt_purge_tower_object.value) { + po->belt_truncate_layers_above(last_tc_z); + break; + } + } + // Diagnostic: the prism only absorbs purge at toolchange layers whose // print_z coincides with one of its own layers. Compare the prism's layer // print_z range to the toolchange print_z range and count how many diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index fc78c5efef..2591f6cbd1 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -562,6 +562,9 @@ private: // clipping shift) by delta, used by Print::_align_belt_purge_layers() to // snap the purge prism's layers onto the printed objects' layer grid. void belt_shift_layer_grid(double delta); + // Belt mode: remove layers above z (cancel the purge prism past the last + // toolchange). Returns how many layers were dropped. + size_t belt_truncate_layers_above(coordf_t z); //BBS ExPolygons _shrink_contour_holes(double contour_delta, double hole_delta, const ExPolygons& polys) const; // BBS diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index b95bc4903f..f13b208a3a 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1413,6 +1413,31 @@ void PrintObject::belt_shift_layer_grid(double delta) << " first_layer.print_z=" << (m_layers.empty() ? 0. : m_layers.front()->print_z); } +// Belt mode: drop layers strictly above z (used to cancel the purge prism early +// once there are no more toolchanges above z, so the tower stops at the last +// color swap instead of wasting filament up the rest of the belt). Each layer's +// cross-section is already sliced, so removing upper layers does not affect the +// last toolchange's coverage. Deletes the Layer objects and clears the new top +// layer's upper-layer link. Returns the number of layers removed. +size_t PrintObject::belt_truncate_layers_above(coordf_t z) +{ + size_t keep = m_layers.size(); + while (keep > 0 && m_layers[keep - 1]->print_z > z + EPSILON) + --keep; + if (keep >= m_layers.size()) + return 0; + const size_t removed = m_layers.size() - keep; + for (size_t i = keep; i < m_layers.size(); ++i) + delete m_layers[i]; + m_layers.resize(keep); + if (!m_layers.empty()) + m_layers.back()->upper_layer = nullptr; + BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] truncate purge prism above print_z=" << z + << " kept=" << keep << " removed=" << removed + << " new_top=" << (m_layers.empty() ? 0. : m_layers.back()->print_z); + return removed; +} + // 1) Decides Z positions of the layers, // 2) Initializes layers and their regions // 3) Slices the object meshes From bcfb09481c4fdfdb10ca63e4a419518c5ce6b608 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 11:30:37 -0500 Subject: [PATCH 097/389] pull purge tower into its own files, make purge tower semi-transparent like other purge towers --- src/libslic3r/Preset.cpp | 1 + src/libslic3r/Print.cpp | 25 +- src/libslic3r/PrintConfig.cpp | 11 + src/libslic3r/PrintConfig.hpp | 3 + src/slic3r/CMakeLists.txt | 2 + src/slic3r/GUI/BeltPurgeTower.cpp | 311 +++++++++++++++++++++++++ src/slic3r/GUI/BeltPurgeTower.hpp | 48 ++++ src/slic3r/GUI/ConfigManipulation.cpp | 11 +- src/slic3r/GUI/GLCanvas3D.cpp | 22 ++ src/slic3r/GUI/Plater.cpp | 322 +------------------------- src/slic3r/GUI/Tab.cpp | 14 +- 11 files changed, 443 insertions(+), 327 deletions(-) create mode 100644 src/slic3r/GUI/BeltPurgeTower.cpp create mode 100644 src/slic3r/GUI/BeltPurgeTower.hpp diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 092923e336..1d99f19608 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1412,6 +1412,7 @@ static std::vector s_Preset_printer_options { "belt_preslice_global", "first_layer_plane", "first_layer_plane_offset", "first_layer_plane_thickness", "belt_support_floor_offset", "belt_support_floor_mode", "belt_support_z_offset_mode", + "enable_belt_purge_tower", "gcode_flavor", "fan_kickstart", "part_cooling_fan_min_pwm", "fan_speedup_time", "fan_speedup_overhangs", "single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 5a0a6f8d8b..4004cd81de 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -359,6 +359,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "hot_plate_temp" || opt_key == "textured_plate_temp" || opt_key == "enable_prime_tower" + || opt_key == "enable_belt_purge_tower" || opt_key == "enable_wrapping_detection" || opt_key == "prime_tower_enable_framework" || opt_key == "prime_tower_width" @@ -1474,16 +1475,18 @@ StringObjectException Print::validate(std::vector *warnin add_warning(layer_warning); } + if (m_config.belt_printer.value && m_config.enable_belt_purge_tower.value + && m_config.print_sequence == PrintSequence::ByObject + && extruders.size() > 1 && warning != nullptr) { + StringObjectException warningtemp; + warningtemp.string = L("The belt purge tower is not generated in \"By object\" print sequence; " + "filament changes will not be purged."); + warningtemp.opt_key = "enable_belt_purge_tower"; + warningtemp.is_warning = true; + *warning = warningtemp; + } + if (m_config.enable_prime_tower) { - if (m_config.belt_printer.value && m_config.print_sequence == PrintSequence::ByObject - && extruders.size() > 1 && warning != nullptr) { - StringObjectException warningtemp; - warningtemp.string = L("The belt purge tower is not generated in \"By object\" print sequence; " - "filament changes will not be purged."); - warningtemp.opt_key = "enable_prime_tower"; - warningtemp.is_warning = true; - *warning = warningtemp; - } for (const PrintObject* object : m_objects) { if (object->config().precise_z_height.value) { warn(L("Enabling both precise Z height and the prime tower may cause slicing errors."), "precise_z_height"); @@ -4127,8 +4130,10 @@ bool Print::has_wipe_tower() const // prism object via the flush-into-objects machinery instead of a wipe tower. bool Print::has_belt_purge_tower() const { + // Its own purge-tower "type", gated by the belt-only enable_belt_purge_tower + // option (not the classic enable_prime_tower). return m_config.belt_printer.value - && m_config.enable_prime_tower.value + && m_config.enable_belt_purge_tower.value && !m_config.spiral_mode.value && m_config.filament_diameter.values.size() > 1; } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index cef9a840a8..3be885a49e 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -7321,6 +7321,17 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionEnum(BeltSupportZOffsetMode::Unconditional)); } + def = this->add("enable_belt_purge_tower", coBool); + def->label = L("Enable belt purge tower"); + def->category = L("Multimaterial"); + def->tooltip = L("Belt-printer replacement for the wipe/prime tower. When enabled on a belt " + "printer, a purge prism is automatically generated next to the printed parts " + "and filament-change purging is routed into it (the classic wipe tower cannot " + "be used on belt printers because its G-code bypasses the belt transform). " + "Only available on belt printers."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + def = this->add("belt_purge_tower_width", coFloat); def->label = L("Belt purge tower width"); def->category = L("Printable space"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index ffd0320149..07d8f3e3af 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1807,6 +1807,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionEnum, belt_support_z_offset_mode)) // Width (machine X, across the belt) of the auto-generated belt purge prism. ((ConfigOptionFloat, belt_purge_tower_width)) + // Belt-printer-only "type" of purge tower: enables the auto-generated belt + // purge prism (the belt replacement for the classic wipe/prime tower). + ((ConfigOptionBool, enable_belt_purge_tower)) //BBS ((ConfigOptionInts, additional_cooling_fan_speed)) ((ConfigOptionInts, close_additional_fan_first_x_layers)) diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index b98396f943..bdef8b587f 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -397,6 +397,8 @@ set(SLIC3R_GUI_SOURCES GUI/ParamsPanel.hpp GUI/PartPlate.cpp GUI/PartPlate.hpp + GUI/BeltPurgeTower.cpp + GUI/BeltPurgeTower.hpp GUI/FilamentGroupPopup.hpp GUI/FilamentGroupPopup.cpp GUI/PhysicalPrinterDialog.cpp diff --git a/src/slic3r/GUI/BeltPurgeTower.cpp b/src/slic3r/GUI/BeltPurgeTower.cpp new file mode 100644 index 0000000000..47ff6b6bd4 --- /dev/null +++ b/src/slic3r/GUI/BeltPurgeTower.cpp @@ -0,0 +1,311 @@ +#include "BeltPurgeTower.hpp" + +#include "GUI_App.hpp" +#include "GUI_ObjectList.hpp" +#include "PartPlate.hpp" +#include "I18N.hpp" + +#include "libslic3r/Model.hpp" +#include "libslic3r/Preset.hpp" +#include "libslic3r/PresetBundle.hpp" +#include "libslic3r/PrintConfig.hpp" +#include "libslic3r/TriangleMesh.hpp" +#include "libslic3r/Geometry.hpp" +#include "libslic3r/BoundingBox.hpp" + +#include +#include +#include +#include +#include + +#include + +namespace Slic3r { +namespace GUI { + +// The classic wipe tower is disabled in belt mode (its G-code bypasses the belt +// transform), so filament-change purging is routed into this prism via +// flush_into_objects (see Print::_plan_belt_purge()). The prism is a real model +// object so it is sliced through the normal pipeline and picks up the belt +// rotation. Width across the belt is user-set (belt_purge_tower_width); height +// is sized so each tilted slicing plane's cross-section through the prism can +// absorb the worst-case purge volume of one layer; length follows the printed +// objects along the belt (plus ramp/height compensation at both tilted ends). +bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, ObjectList *obj_list, BeltPurgeSignature &sig) +{ + auto is_prism = [](const ModelObject *mo) { + const ConfigOption *opt = mo->config.option("belt_purge_tower_object"); + return opt != nullptr && opt->getBool(); + }; + + std::vector prism_idxs; + for (int i = 0; i < (int) model.objects.size(); ++i) + if (is_prism(model.objects[i])) + prism_idxs.push_back(i); + + // Deletes prism objects, keeping the sidebar and part plates in sync + // (same primitives as Plater::priv::remove(), minus scene update — the + // caller refreshes the scene). + auto remove_prisms = [&](const std::vector &idxs) { + for (auto it = idxs.rbegin(); it != idxs.rend(); ++it) { + model.delete_object(size_t(*it)); + partplate_list.notify_instance_removed(*it, -1); + obj_list->delete_object_from_list(size_t(*it)); + } + }; + + const auto &printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config; + const auto &print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; + auto &project_config = wxGetApp().preset_bundle->project_config; + + const auto *belt_opt = printer_config.option("belt_printer"); + const bool belt = belt_opt != nullptr && belt_opt->value; + // Belt purge tower is its own type, gated by the belt-only printer option + // enable_belt_purge_tower (not the classic process enable_prime_tower). + const bool prime_tower_enabled = printer_config.has("enable_belt_purge_tower") && printer_config.opt_bool("enable_belt_purge_tower"); + const auto *seq_opt = print_config.option>("print_sequence"); + const bool by_object = seq_opt != nullptr && seq_opt->value == PrintSequence::ByObject; + + // Filaments used and bounding extent of the non-prism objects on the + // current plate (1-based filament ids; volume extruder 0 = object default). + PartPlate *plate = partplate_list.get_curr_plate(); + std::set filaments; + double x_min = std::numeric_limits::max(); + double x_max = -std::numeric_limits::max(); + double y_min = std::numeric_limits::max(); + double y_max = -std::numeric_limits::max(); + double z_max = 0.; + bool have_objects = false; + if (belt && plate != nullptr) { + for (int obj_idx = 0; obj_idx < (int) model.objects.size(); ++obj_idx) { + const ModelObject *mo = model.objects[obj_idx]; + if (is_prism(mo)) + continue; + int obj_extruder = 1; + if (const ConfigOption *opt = mo->config.option("extruder"); opt != nullptr && opt->getInt() > 0) + obj_extruder = opt->getInt(); + bool any_instance_on_plate = false; + for (int inst_idx = 0; inst_idx < (int) mo->instances.size(); ++inst_idx) { + if (!plate->contain_instance_totally(obj_idx, inst_idx)) + continue; + any_instance_on_plate = true; + const BoundingBoxf3 bb = mo->instance_bounding_box(inst_idx); + x_min = std::min(x_min, bb.min.x()); + x_max = std::max(x_max, bb.max.x()); + y_min = std::min(y_min, bb.min.y()); + y_max = std::max(y_max, bb.max.y()); + z_max = std::max(z_max, bb.max.z()); + } + if (!any_instance_on_plate) + continue; + have_objects = true; + for (const ModelVolume *mv : mo->volumes) + for (int e : mv->get_extruders()) + filaments.insert(e > 0 ? e : obj_extruder); + } + } + + const bool wanted = belt && prime_tower_enabled && !by_object && have_objects && filaments.size() > 1; + if (!wanted) { + sig = BeltPurgeSignature{}; + if (prism_idxs.empty()) + return false; + remove_prisms(prism_idxs); + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] belt purge tower removed (conditions not met)"; + return true; + } + + // --- Sizing ----------------------------------------------------------- + const double width = print_config.has("belt_purge_tower_width") ? std::max(1., print_config.opt_float("belt_purge_tower_width")) : 35.; + const double layer_h = print_config.has("layer_height") ? print_config.opt_float("layer_height") : 0.2; + + // Belt geometry. The rotation axis is the gantry tilt axis; the belt + // travels along the *other* horizontal axis (X-rotation -> belt along Y, + // the CR-30 default). The purge prism is a long bar laid along the belt + // travel direction, beside the parts. For no/Z rotation we fall back to + // vertical slicing geometry (theta = 90 deg). + const auto *axis_opt = printer_config.option>("belt_slice_rotation"); + const auto *angle_opt = printer_config.option("belt_slice_rotation_angle"); + const BeltRotationAxis rot = axis_opt != nullptr ? axis_opt->value : BeltRotationAxis::X; + const bool belt_is_y = (rot != BeltRotationAxis::Y); // X / None / Z -> belt along Y + double theta = M_PI / 2.; + if ((rot == BeltRotationAxis::X || rot == BeltRotationAxis::Y) && angle_opt != nullptr && std::abs(angle_opt->value) > EPSILON) + theta = std::clamp(Geometry::deg2rad(std::abs(angle_opt->value)), Geometry::deg2rad(5.), M_PI / 2.); + const double sin_t = std::sin(theta); + const double cot_t = std::cos(theta) / sin_t; + + // Parts' extent along the belt-travel axis and the lateral (across-belt) axis. + const double belt_min = belt_is_y ? y_min : x_min; + const double belt_max = belt_is_y ? y_max : x_max; + const double lat_min = belt_is_y ? x_min : y_min; + const double lat_max = belt_is_y ? x_max : y_max; + + // Worst-case purge volume of one layer: up to (filament count - 1) + // toolchanges, each needing the worst flush matrix entry (mirrors the + // volume selection in Print::_plan_belt_purge()). + // NOTE: both purge_in_prime_tower and single_extruder_multi_material are + // PRINTER options (Preset.cpp s_Preset_printer_options) — read them from the + // printer preset. Reading purge_in_prime_tower from the print preset returns + // has()==false, collapsing use_matrix to false and sizing the tower for the + // small prime_volume instead of the real color-change flush. This must match + // the backend Print::_plan_belt_purge() which reads both from the merged config. + const bool use_matrix = (printer_config.has("purge_in_prime_tower") && printer_config.opt_bool("purge_in_prime_tower")) + && (printer_config.has("single_extruder_multi_material") && printer_config.opt_bool("single_extruder_multi_material")); + double max_flush = print_config.has("prime_volume") ? print_config.opt_float("prime_volume") : 45.; + if (use_matrix) { + const size_t extruder_nums = wxGetApp().preset_bundle->get_printer_extruder_count(); + const std::vector matrix = get_flush_volumes_matrix( + project_config.option("flush_volumes_matrix")->values, 0, extruder_nums); + const auto * multi_opt = project_config.option("flush_multiplier"); + const double multiplier = multi_opt != nullptr && !multi_opt->values.empty() ? multi_opt->get_at(0) : 1.; + const int n_total = (int) (std::sqrt(double(matrix.size())) + 0.5); + double m = 0.; + for (int i : filaments) + for (int j : filaments) + if (i != j && i <= n_total && j <= n_total) + m = std::max(m, matrix[size_t(i - 1) * n_total + size_t(j - 1)]); + if (m > 0.) + max_flush = m * multiplier; + } + const double v_layer = double(filaments.size() - 1) * max_flush; + + // Height from the per-layer purge demand. A tilted slicing plane cuts a + // width x (height/sin) rectangle out of the bar, so one layer slab absorbs + // width * (height/sin) * layer_height of purge. Solve for the height that + // holds the worst-case per-layer purge, with eta (infill/perimeter packing) + // and a safety margin for the tilt ramps / grid-alignment slop, plus a + // minimum so the tower is a real printable body rather than a sliver. + const double eta = 0.85; + const double safety = 1.6; + const double printable_height = printer_config.has("printable_height") ? printer_config.opt_float("printable_height") : 250.; + double height = safety * v_layer * sin_t / (width * layer_h * eta); + height = std::clamp(height, 8.0, std::max(8.0, printable_height)); + + // --- Idempotence (input-keyed) ---------------------------------------- + auto q = [](double v) { return std::lround(v * 10.0); }; // 0.1 mm quantization + BeltPurgeSignature new_sig; + new_sig.valid = true; + new_sig.filament_count = (int) filaments.size(); + new_sig.key[0] = q(width); + new_sig.key[1] = q(layer_h); + new_sig.key[2] = q(height); + new_sig.key[3] = q(belt_min); + new_sig.key[4] = q(belt_max); + new_sig.key[5] = q(lat_min); + new_sig.key[6] = q(z_max); + if (prism_idxs.size() == 1 && new_sig == sig) + return false; // already up to date — do not touch the model + + // --- Position ---------------------------------------------------------- + // Belt-travel axis. With the mesh rotated by theta before slicing, a machine + // point (y,z) maps to slicing-Z = y*sin(theta) + z*cos(theta). The parts + // occupy slicing-Z in [y_min*sin, y_max*sin + z_max*cos], and the bar's + // FULL-cross-section region (the part not in a triangular end ramp) spans + // slicing-Z [belt_start*sin + H*cos, belt_end*sin]. Covering the parts' + // whole band needs belt_start <= y_min - H*cot (bar's own leading ramp) and + // belt_end >= y_max + z_max*cot (parts' top features print further up the + // belt). The trailing z_max*cot term dominates the bar's own ramp. + const double margin = 5.; + const double ramp_compensation = height / sin_t; + const double belt_start = std::max(0.0, belt_min - ramp_compensation); // leading ramp, toward Y=0 + const double belt_end = belt_max + margin + ramp_compensation + z_max * cot_t; // + parts' top-feature belt reach + const double length = std::max(belt_end - belt_start, 10.); + const double belt_center = 0.5 * (belt_start + belt_end); + + // Across-belt: flush against the bed's maximum edge, inset by half the bar + // width so the bar's far edge sits on the boundary and the whole bar stays + // on the bed. The bed (printable_area) is plate-local but model instances + // live in the plate's world frame, so add the plate origin's lateral + // component. lat_min/lat_max come from instance_bounding_box (world frame). + const Vec3d plate_origin = plate->get_origin(); + const double lat_origin = plate_origin[belt_is_y ? 0 : 1]; + const double inset = 1.; + double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts + BoundingBoxf bed_ext_dbg; + if (const auto *bed_opt = printer_config.option("printable_area"); + bed_opt != nullptr && !bed_opt->values.empty()) { + const BoundingBoxf bed_ext = get_extents(bed_opt->values); + bed_ext_dbg = bed_ext; + const double bed_lat_max = belt_is_y ? bed_ext.max.x() : bed_ext.max.y(); + lat_center = lat_origin + bed_lat_max - inset - 0.5 * width; + } + + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge place" + << " plate_origin=(" << plate_origin.x() << "," << plate_origin.y() << ")" + << " parts_x=[" << x_min << "," << x_max << "] parts_y=[" << y_min << "," << y_max << "] z_max=" << z_max + << " bed_ext=[" << bed_ext_dbg.min.x() << "," << bed_ext_dbg.min.y() + << " -> " << bed_ext_dbg.max.x() << "," << bed_ext_dbg.max.y() << "]" + << " lat_center=" << lat_center << " belt=[" << belt_start << "," << belt_end << "]"; + + // Orient the bar: long axis = belt travel, width = lateral, height = Z. + const double size_x = belt_is_y ? width : length; + const double size_y = belt_is_y ? length : width; + const Vec3d desired_center(belt_is_y ? lat_center : belt_center, + belt_is_y ? belt_center : lat_center, + 0.5 * height); + + // --- (Re)create --------------------------------------------------------- + if (!prism_idxs.empty()) + remove_prisms(prism_idxs); + + ModelObject *new_object = model.add_object(); + new_object->name = _u8L("Belt Purge Tower"); + new_object->add_instance(); + ModelVolume *new_volume = new_object->add_volume(make_cube(size_x, size_y, height)); + new_volume->name = new_object->name; + + auto &cfg = new_object->config; + cfg.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); + cfg.set_key_value("flush_into_objects", new ConfigOptionBool(true)); + cfg.set_key_value("extruder", new ConfigOptionInt(1)); + // Sacrificial solid prism: one wall, no shells, dense rectilinear infill — + // every extrusion is overriddable, so the absorbed volume matches the + // cross-section x layer-height estimate used for the height above. + cfg.set_key_value("wall_loops", new ConfigOptionInt(1)); + cfg.set_key_value("top_shell_layers", new ConfigOptionInt(0)); + cfg.set_key_value("bottom_shell_layers", new ConfigOptionInt(0)); + cfg.set_key_value("sparse_infill_density", new ConfigOptionPercent(100)); + cfg.set_key_value("sparse_infill_pattern", new ConfigOptionEnum(ipRectilinear)); + cfg.set_key_value("enable_support", new ConfigOptionBool(false)); + cfg.set_key_value("brim_type", new ConfigOptionEnum(btNoBrim)); + cfg.set_key_value("seam_slope_type", new ConfigOptionEnum(SeamScarfType::None)); + cfg.set_key_value("precise_z_height", new ConfigOptionBool(false)); + + // Position by the belt-calibration pattern: drop to the bed, then translate + // the instance by the delta between the object's ACTUAL bbox center and the + // target. Setting the instance offset directly is unreliable here — the + // freshly added cube's local frame is not centered, so set_offset() lands + // the min corner (not the center) on the target, leaving the bar centered + // on the bed edge with half of it hanging off. + new_object->invalidate_bounding_box(); + new_object->ensure_on_bed(); + const BoundingBoxf3 cur = new_object->bounding_box_exact(); + new_object->translate_instances(Vec3d(desired_center.x() - cur.center().x(), + desired_center.y() - cur.center().y(), + 0.0)); + new_object->instances.front()->set_assemble_transformation(new_object->instances.front()->get_transformation()); + + const size_t obj_idx = model.objects.size() - 1; + // Registers the object in the sidebar and notifies the part plates; + // selection is left untouched (auto-managed object). + obj_list->add_object_to_list(obj_idx, /*call_selection_changed=*/false); + + // Record the inputs that produced this prism so subsequent ticks are no-ops + // until the parts/config actually change. + sig = new_sig; + + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] belt purge tower generated" + << " belt_is_y=" << belt_is_y + << " W=" << width << " L=" << length << " H=" << height + << " v_layer=" << v_layer << " max_flush=" << max_flush + << " filaments=" << filaments.size() + << " theta_deg=" << Geometry::rad2deg(theta) + << " desired_center=(" << desired_center.x() << "," << desired_center.y() << "," << desired_center.z() << ")" + << " achieved_center=(" << new_object->bounding_box_exact().center().x() << "," + << new_object->bounding_box_exact().center().y() << ")"; + return true; +} + +} // namespace GUI +} // namespace Slic3r diff --git a/src/slic3r/GUI/BeltPurgeTower.hpp b/src/slic3r/GUI/BeltPurgeTower.hpp new file mode 100644 index 0000000000..b1735303c5 --- /dev/null +++ b/src/slic3r/GUI/BeltPurgeTower.hpp @@ -0,0 +1,48 @@ +#ifndef slic3r_GUI_BeltPurgeTower_hpp_ +#define slic3r_GUI_BeltPurgeTower_hpp_ + +// ORCA-Belt: auto-managed purge prism for belt printers. +// +// Kept in its own translation unit (not buried in Plater.cpp) so it stays out +// of the way of unrelated upstream changes and carries no regression risk for +// normal printers: nothing here runs unless the printer is a belt printer with +// the belt purge tower enabled. See Slic3r::GUI::ensure_belt_purge_tower(). + +namespace Slic3r { +class Model; +class PartPlateList; +namespace GUI { +class ObjectList; + +// Inputs of the last belt purge prism generation. Idempotence is keyed on these +// (not the prism's resulting bbox): the prism gets nudged by plate assignment +// after creation, so comparing its bbox would falsely detect a change and +// regenerate it on every background-process tick — which would re-invalidate a +// freshly sliced result and make the G-code preview unreachable. +struct BeltPurgeSignature +{ + bool valid = false; + int filament_count = 0; + long key[7] = {0}; // rounded geometry inputs (0.1 mm units) + bool operator==(const BeltPurgeSignature &o) const + { + if (valid != o.valid || filament_count != o.filament_count) + return false; + for (int i = 0; i < 7; ++i) + if (key[i] != o.key[i]) + return false; + return true; + } +}; + +// Keep the auto-generated belt purge prism in sync with the current config and +// plate contents. Creates / updates / removes the marked prism ModelObject. +// Returns true when the model was mutated (caller should refresh the scene). +// Runs on every background-process update, so it is idempotent: it only mutates +// the model when the desired prism differs from the cached signature in `sig`. +bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, ObjectList *obj_list, BeltPurgeSignature &sig); + +} // namespace GUI +} // namespace Slic3r + +#endif // slic3r_GUI_BeltPurgeTower_hpp_ diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index ffd4d43a71..71a111ef29 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -972,10 +972,13 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in bool have_prime_tower = config->opt_bool("enable_prime_tower"); // ORCA-Belt: belt printers replace the classic wipe tower with the - // auto-generated belt purge prism — only its width is tunable; the - // classic tower geometry options do not apply. (is_belt_printer is - // computed at the top of this function.) - toggle_line("belt_purge_tower_width", have_prime_tower && is_belt_printer); + // auto-generated belt purge prism, enabled by the belt-only printer option + // enable_belt_purge_tower. Its width (a process option) is only relevant + // then. (is_belt_printer is computed at the top of this function.) + const bool have_belt_purge_tower = is_belt_printer + && preset_bundle->printers.get_edited_preset().config.has("enable_belt_purge_tower") + && preset_bundle->printers.get_edited_preset().config.opt_bool("enable_belt_purge_tower"); + toggle_line("belt_purge_tower_width", have_belt_purge_tower); for (auto el : {"prime_tower_width", "prime_tower_brim_width", "prime_tower_skip_points", "wipe_tower_wall_type", "prime_tower_infill_gap","prime_tower_enable_framework", "enable_tower_interface_features"}) toggle_line(el, have_prime_tower && !is_belt_printer); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 8ff05862a8..ca517c4303 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2948,6 +2948,28 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re } update_volumes_colors_by_extruder(); + + // ORCA-Belt: render the auto-generated belt purge prism like a wipe tower — + // semi-transparent, in its (filament) color. It is a real sliced object, so + // the G-code preview already shows the actual per-layer purge colors; here in + // the editor we just make the block translucent so it reads as a purge tower + // rather than a solid part. update_colors_by_extruder() preserves alpha when + // not updating alpha, so lowering it once sticks across recolors. + if (m_model != nullptr) { + for (GLVolume *volume : m_volumes.volumes) { + if (volume == nullptr || volume->volume_idx() < 0) + continue; + const int obj_idx = volume->object_idx(); + if (obj_idx < 0 || obj_idx >= (int) m_model->objects.size()) + continue; + const ConfigOption *opt = m_model->objects[obj_idx]->config.option("belt_purge_tower_object"); + if (opt != nullptr && opt->getBool()) { + volume->color.a(0.66f); + volume->force_transparent = true; + } + } + } + // Update selection indices based on the old/new GLVolumeCollection. if (m_selection.get_mode() == Selection::Instance) m_selection.instances_changed(instance_ids_selected); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 656a7d31e2..c2ddb897bf 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -105,6 +105,7 @@ #include "GUI_Preview.hpp" #include "3DBed.hpp" #include "PartPlate.hpp" +#include "BeltPurgeTower.hpp" #include "Camera.hpp" #include "Mouse3DController.hpp" #include "Tab.hpp" @@ -5476,24 +5477,10 @@ struct Plater::priv void remove(size_t obj_idx); bool delete_object_from_model(size_t obj_idx, bool refresh_immediately = true); //BBS // ORCA-Belt: keep the auto-generated belt purge prism in sync with the - // config and plate contents. Returns true when the model was mutated - // (caller should refresh the scene). + // config and plate contents (thin wrapper over GUI::ensure_belt_purge_tower + // in BeltPurgeTower.cpp). Returns true when the model was mutated. bool ensure_belt_purge_tower(); - // Inputs of the last belt purge prism generation. Idempotence is keyed on - // these (not the prism's resulting bbox): the prism gets nudged by plate - // assignment after creation, so comparing its bbox would falsely detect a - // change and regenerate it on every background-process tick — which would - // re-invalidate a freshly sliced result and make the preview unreachable. - struct BeltPurgeSignature { - bool valid = false; - int filament_count = 0; - long key[7] = {0}; // rounded geometry inputs (0.1 mm units) - bool operator==(const BeltPurgeSignature &o) const { - if (valid != o.valid || filament_count != o.filament_count) return false; - for (int i = 0; i < 7; ++i) if (key[i] != o.key[i]) return false; - return true; - } - } m_belt_purge_sig; + BeltPurgeSignature m_belt_purge_sig; void delete_all_objects_from_model(); void reset(bool apply_presets_change = false); void center_selection(); @@ -8898,305 +8885,16 @@ void Plater::priv::process_validation_warnings(const std::vectorconfig.option("belt_purge_tower_object"); - return opt != nullptr && opt->getBool(); - }; - - std::vector prism_idxs; - for (int i = 0; i < (int) model.objects.size(); ++i) - if (is_prism(model.objects[i])) - prism_idxs.push_back(i); - - // Deletes prism objects, keeping the sidebar and part plates in sync - // (same primitives as Plater::priv::remove(), minus scene update — the - // caller refreshes the scene). - auto remove_prisms = [this](const std::vector &idxs) { - for (auto it = idxs.rbegin(); it != idxs.rend(); ++it) { - model.delete_object(size_t(*it)); - partplate_list.notify_instance_removed(*it, -1); - sidebar->obj_list()->delete_object_from_list(size_t(*it)); - } - }; - - const auto &printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config; - const auto &print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; - auto &project_config = wxGetApp().preset_bundle->project_config; - - const auto *belt_opt = printer_config.option("belt_printer"); - const bool belt = belt_opt != nullptr && belt_opt->value; - const bool prime_tower_enabled = print_config.has("enable_prime_tower") && print_config.opt_bool("enable_prime_tower"); - const auto *seq_opt = print_config.option>("print_sequence"); - const bool by_object = seq_opt != nullptr && seq_opt->value == PrintSequence::ByObject; - - // Filaments used and bounding extent of the non-prism objects on the - // current plate (1-based filament ids; volume extruder 0 = object default). - PartPlate *plate = partplate_list.get_curr_plate(); - std::set filaments; - double x_min = std::numeric_limits::max(); - double x_max = -std::numeric_limits::max(); - double y_min = std::numeric_limits::max(); - double y_max = -std::numeric_limits::max(); - double z_max = 0.; - bool have_objects = false; - if (belt && plate != nullptr) { - for (int obj_idx = 0; obj_idx < (int) model.objects.size(); ++obj_idx) { - const ModelObject *mo = model.objects[obj_idx]; - if (is_prism(mo)) - continue; - int obj_extruder = 1; - if (const ConfigOption *opt = mo->config.option("extruder"); opt != nullptr && opt->getInt() > 0) - obj_extruder = opt->getInt(); - bool any_instance_on_plate = false; - for (int inst_idx = 0; inst_idx < (int) mo->instances.size(); ++inst_idx) { - if (!plate->contain_instance_totally(obj_idx, inst_idx)) - continue; - any_instance_on_plate = true; - const BoundingBoxf3 bb = mo->instance_bounding_box(inst_idx); - x_min = std::min(x_min, bb.min.x()); - x_max = std::max(x_max, bb.max.x()); - y_min = std::min(y_min, bb.min.y()); - y_max = std::max(y_max, bb.max.y()); - z_max = std::max(z_max, bb.max.z()); - } - if (!any_instance_on_plate) - continue; - have_objects = true; - for (const ModelVolume *mv : mo->volumes) - for (int e : mv->get_extruders()) - filaments.insert(e > 0 ? e : obj_extruder); - } - } - - const bool wanted = belt && prime_tower_enabled && !by_object && have_objects && filaments.size() > 1; - if (!wanted) { - m_belt_purge_sig = BeltPurgeSignature{}; - if (prism_idxs.empty()) - return false; - remove_prisms(prism_idxs); - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] belt purge tower removed (conditions not met)"; - return true; - } - - // --- Sizing ----------------------------------------------------------- - const double width = print_config.has("belt_purge_tower_width") ? std::max(1., print_config.opt_float("belt_purge_tower_width")) : 35.; - const double layer_h = print_config.has("layer_height") ? print_config.opt_float("layer_height") : 0.2; - - // Belt geometry. The rotation axis is the gantry tilt axis; the belt - // travels along the *other* horizontal axis (X-rotation -> belt along Y, - // the CR-30 default). The purge prism is a long bar laid along the belt - // travel direction, beside the parts. For no/Z rotation we fall back to - // vertical slicing geometry (theta = 90 deg). - const auto *axis_opt = printer_config.option>("belt_slice_rotation"); - const auto *angle_opt = printer_config.option("belt_slice_rotation_angle"); - const BeltRotationAxis rot = axis_opt != nullptr ? axis_opt->value : BeltRotationAxis::X; - const bool belt_is_y = (rot != BeltRotationAxis::Y); // X / None / Z -> belt along Y - double theta = M_PI / 2.; - if ((rot == BeltRotationAxis::X || rot == BeltRotationAxis::Y) && angle_opt != nullptr && std::abs(angle_opt->value) > EPSILON) - theta = std::clamp(Geometry::deg2rad(std::abs(angle_opt->value)), Geometry::deg2rad(5.), M_PI / 2.); - const double sin_t = std::sin(theta); - const double cot_t = std::cos(theta) / sin_t; - - // Parts' extent along the belt-travel axis and the lateral (across-belt) axis. - const double belt_min = belt_is_y ? y_min : x_min; - const double belt_max = belt_is_y ? y_max : x_max; - const double lat_min = belt_is_y ? x_min : y_min; - const double lat_max = belt_is_y ? x_max : y_max; - - // Worst-case purge volume of one layer: up to (filament count - 1) - // toolchanges, each needing the worst flush matrix entry (mirrors the - // volume selection in Print::_plan_belt_purge()). - // NOTE: both purge_in_prime_tower and single_extruder_multi_material are - // PRINTER options (Preset.cpp s_Preset_printer_options) — read them from the - // printer preset. Reading purge_in_prime_tower from the print preset returns - // has()==false, collapsing use_matrix to false and sizing the tower for the - // small prime_volume instead of the real color-change flush. This must match - // the backend Print::_plan_belt_purge() which reads both from the merged config. - const bool use_matrix = (printer_config.has("purge_in_prime_tower") && printer_config.opt_bool("purge_in_prime_tower")) - && (printer_config.has("single_extruder_multi_material") && printer_config.opt_bool("single_extruder_multi_material")); - double max_flush = print_config.has("prime_volume") ? print_config.opt_float("prime_volume") : 45.; - if (use_matrix) { - const size_t extruder_nums = wxGetApp().preset_bundle->get_printer_extruder_count(); - const std::vector matrix = get_flush_volumes_matrix( - project_config.option("flush_volumes_matrix")->values, 0, extruder_nums); - const auto * multi_opt = project_config.option("flush_multiplier"); - const double multiplier = multi_opt != nullptr && !multi_opt->values.empty() ? multi_opt->get_at(0) : 1.; - const int n_total = (int) (std::sqrt(double(matrix.size())) + 0.5); - double m = 0.; - for (int i : filaments) - for (int j : filaments) - if (i != j && i <= n_total && j <= n_total) - m = std::max(m, matrix[size_t(i - 1) * n_total + size_t(j - 1)]); - if (m > 0.) - max_flush = m * multiplier; - } - const double v_layer = double(filaments.size() - 1) * max_flush; - - // Height from the per-layer purge demand. A tilted slicing plane cuts a - // width x (height/sin) rectangle out of the bar, so one layer slab absorbs - // width * (height/sin) * layer_height of purge. Solve for the height that - // holds the worst-case per-layer purge, with: - // eta - infill/perimeter packing (not all of the cross-section is solid) - // safety - margin for the tilt ramp at the bar ends and layer-grid - // alignment slop, where a layer cuts less than the full section - // and a minimum so the tower is a real printable body rather than a sliver. - const double eta = 0.85; - const double safety = 1.6; - const double printable_height = printer_config.has("printable_height") ? printer_config.opt_float("printable_height") : 250.; - double height = safety * v_layer * sin_t / (width * layer_h * eta); - height = std::clamp(height, 8.0, std::max(8.0, printable_height)); - - // --- Idempotence (input-keyed) ---------------------------------------- - // Key on the generation inputs, NOT the prism's resulting bbox: plate - // assignment nudges the prism after creation, so a bbox comparison sees a - // "change" every tick and regenerates the prism, which re-invalidates any - // freshly sliced result and makes the G-code preview unreachable. - auto q = [](double v) { return std::lround(v * 10.0); }; // 0.1 mm quantization - BeltPurgeSignature sig; - sig.valid = true; - sig.filament_count = (int) filaments.size(); - sig.key[0] = q(width); - sig.key[1] = q(layer_h); - sig.key[2] = q(height); - sig.key[3] = q(belt_min); - sig.key[4] = q(belt_max); - sig.key[5] = q(lat_min); - sig.key[6] = q(z_max); - if (prism_idxs.size() == 1 && sig == m_belt_purge_sig) - return false; // already up to date — do not touch the model - - // --- Position ---------------------------------------------------------- - // Belt-travel axis. With the mesh rotated by theta before slicing, a machine - // point (y,z) maps to slicing-Z = y*sin(theta) + z*cos(theta). The parts - // occupy slicing-Z in [y_min*sin, y_max*sin + z_max*cos], and the bar's - // FULL-cross-section region (the part not in a triangular end ramp) spans - // slicing-Z [belt_start*sin + H*cos, belt_end*sin]. Covering the parts' - // whole band therefore needs: - // - leading edge belt_start <= y_min - H*cot(theta) (bar's own ramp) - // - trailing edge belt_end >= y_max + z_max*cot(theta) (parts' top - // features print further up the belt, so the bar must reach there). - // The leading side uses the bar-ramp allowance height/sin (>= H*cot, slight - // over-cover); the trailing side adds the parts' height projection - // z_max*cot, which dominates the bar's own ramp. - const double margin = 5.; - const double ramp_compensation = height / sin_t; - const double belt_start = std::max(0.0, belt_min - ramp_compensation); // leading ramp, toward Y=0 - const double belt_end = belt_max + margin + ramp_compensation + z_max * cot_t; // + parts' top-feature belt reach - const double length = std::max(belt_end - belt_start, 10.); - const double belt_center = 0.5 * (belt_start + belt_end); - - // Across-belt: flush against the bed's maximum edge, inset by half the bar - // width so the bar's far edge sits on the boundary and the whole bar stays - // on the bed. The bed (printable_area) is plate-local but model instances - // live in the plate's world frame, so add the plate origin's lateral - // component (plate-origin compensation is needed throughout the belt - // pipeline). lat_min/lat_max come from instance_bounding_box (world frame). - const Vec3d plate_origin = plate->get_origin(); - const double lat_origin = plate_origin[belt_is_y ? 0 : 1]; - const double inset = 1.; - double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts - BoundingBoxf bed_ext_dbg; - if (const auto *bed_opt = printer_config.option("printable_area"); - bed_opt != nullptr && !bed_opt->values.empty()) { - const BoundingBoxf bed_ext = get_extents(bed_opt->values); - bed_ext_dbg = bed_ext; - const double bed_lat_max = belt_is_y ? bed_ext.max.x() : bed_ext.max.y(); - lat_center = lat_origin + bed_lat_max - inset - 0.5 * width; - } - - // Ground-truth diagnostic for placement frames (warning level so it lands - // in the GUI debug log): plate origin, bed extents, parts bbox, result. - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge place" - << " plate_origin=(" << plate_origin.x() << "," << plate_origin.y() << ")" - << " parts_x=[" << x_min << "," << x_max << "] parts_y=[" << y_min << "," << y_max << "] z_max=" << z_max - << " bed_ext=[" << bed_ext_dbg.min.x() << "," << bed_ext_dbg.min.y() - << " -> " << bed_ext_dbg.max.x() << "," << bed_ext_dbg.max.y() << "]" - << " lat_center=" << lat_center << " belt=[" << belt_start << "," << belt_end << "]"; - - // Orient the bar: long axis = belt travel, width = lateral, height = Z. - const double size_x = belt_is_y ? width : length; - const double size_y = belt_is_y ? length : width; - const Vec3d desired_center(belt_is_y ? lat_center : belt_center, - belt_is_y ? belt_center : lat_center, - 0.5 * height); - - // --- (Re)create --------------------------------------------------------- - if (!prism_idxs.empty()) - remove_prisms(prism_idxs); - - ModelObject *new_object = model.add_object(); - new_object->name = _u8L("Belt Purge Tower"); - new_object->add_instance(); - ModelVolume *new_volume = new_object->add_volume(make_cube(size_x, size_y, height)); - new_volume->name = new_object->name; - - auto &cfg = new_object->config; - cfg.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); - cfg.set_key_value("flush_into_objects", new ConfigOptionBool(true)); - cfg.set_key_value("extruder", new ConfigOptionInt(1)); - // Sacrificial solid prism: one wall, no shells, dense rectilinear infill — - // every extrusion is overriddable, so the absorbed volume matches the - // cross-section x layer-height estimate used for the height above. - cfg.set_key_value("wall_loops", new ConfigOptionInt(1)); - cfg.set_key_value("top_shell_layers", new ConfigOptionInt(0)); - cfg.set_key_value("bottom_shell_layers", new ConfigOptionInt(0)); - cfg.set_key_value("sparse_infill_density", new ConfigOptionPercent(100)); - cfg.set_key_value("sparse_infill_pattern", new ConfigOptionEnum(ipRectilinear)); - cfg.set_key_value("enable_support", new ConfigOptionBool(false)); - cfg.set_key_value("brim_type", new ConfigOptionEnum(btNoBrim)); - cfg.set_key_value("seam_slope_type", new ConfigOptionEnum(SeamScarfType::None)); - cfg.set_key_value("precise_z_height", new ConfigOptionBool(false)); - - // Position by the belt-calibration pattern: drop to the bed, then translate - // the instance by the delta between the object's ACTUAL bbox center and the - // target. Setting the instance offset directly is unreliable here — the - // freshly added cube's local frame is not centered, so set_offset() lands - // the min corner (not the center) on the target, leaving the bar centered - // on the bed edge with half of it hanging off. - new_object->invalidate_bounding_box(); - new_object->ensure_on_bed(); - const BoundingBoxf3 cur = new_object->bounding_box_exact(); - new_object->translate_instances(Vec3d(desired_center.x() - cur.center().x(), - desired_center.y() - cur.center().y(), - 0.0)); - new_object->instances.front()->set_assemble_transformation(new_object->instances.front()->get_transformation()); - - const size_t obj_idx = model.objects.size() - 1; - // Registers the object in the sidebar and notifies the part plates; - // selection is left untouched (auto-managed object). - sidebar->obj_list()->add_object_to_list(obj_idx, /*call_selection_changed=*/false); - - // Record the inputs that produced this prism so subsequent ticks are no-ops - // until the parts/config actually change. - m_belt_purge_sig = sig; - - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] belt purge tower generated" - << " belt_is_y=" << belt_is_y - << " W=" << width << " L=" << length << " H=" << height - << " v_layer=" << v_layer << " max_flush=" << max_flush - << " filaments=" << filaments.size() - << " theta_deg=" << Geometry::rad2deg(theta) - << " desired_center=(" << desired_center.x() << "," << desired_center.y() << "," << desired_center.z() << ")" - << " achieved_center=(" << new_object->bounding_box_exact().center().x() << "," - << new_object->bounding_box_exact().center().y() << ")"; - return true; + return GUI::ensure_belt_purge_tower(model, partplate_list, sidebar->obj_list(), m_belt_purge_sig); } + // Update background processing thread from the current config and Model. // Returns a bitmask of UpdateBackgroundProcessReturnState. unsigned int Plater::priv::update_background_process(bool force_validation, bool postpone_error_messages, bool switch_print) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 25287c79c3..bf0ce6e65e 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -5699,6 +5699,12 @@ if (is_marlin_flavor) optgroup->append_single_option_line("enable_filament_ramming", "printer_multimaterial_wipe_tower#enable-filament-ramming"); optgroup->append_single_option_line("tool_change_on_wipe_tower", "printer_multimaterial_wipe_tower#tool-change-on-wipe-tower"); + // Orca-Belt: belt printers replace the classic wipe tower with an + // auto-generated purge prism; this is its enable (gated to belt printers + // in toggle_options()). + optgroup = page->new_optgroup(L("Belt purge tower"), "param_tower"); + optgroup->append_single_option_line("enable_belt_purge_tower", "printer_multimaterial_wipe_tower"); + optgroup = page->new_optgroup(L("Single extruder multi-material parameters"), "param_settings"); optgroup->append_single_option_line("cooling_tube_retraction", "printer_multimaterial_semm_parameters#cooling-tube-position"); @@ -6233,8 +6239,14 @@ void TabPrinter::toggle_options() } if (m_active_page->title() == L("Multimaterial")) { + // Orca-Belt: belt printers use the belt purge tower instead of the classic + // wipe tower — show its enable only on belt printers, and hide the classic + // wipe-tower fields there (the classic tower's G-code bypasses the belt transform). + const bool is_belt_printer = m_config->opt_bool("belt_printer"); + toggle_line("enable_belt_purge_tower", is_belt_printer); + const bool supports_wipe_tower_2 = !is_BBL_printer && m_config->opt_enum("wipe_tower_type") == WipeTowerType::Type2; - toggle_line("wipe_tower_type", !is_BBL_printer); + toggle_line("wipe_tower_type", !is_BBL_printer && !is_belt_printer); // SoftFever: hide specific settings for BBL printer for (auto el : { "enable_filament_ramming", From 5ea6ccc56a7a5664783475603b4e9006e027afb2 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 13 Jun 2026 14:35:00 -0500 Subject: [PATCH 098/389] cleanup, early purge tower stop if no longer necessary --- src/libslic3r/BeltPurge.cpp | 316 +++++++++++++++++++++++++++++ src/libslic3r/CMakeLists.txt | 1 + src/libslic3r/Print.cpp | 231 --------------------- src/libslic3r/PrintObjectSlice.cpp | 45 ---- 4 files changed, 317 insertions(+), 276 deletions(-) create mode 100644 src/libslic3r/BeltPurge.cpp diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp new file mode 100644 index 0000000000..a9c2ffceb8 --- /dev/null +++ b/src/libslic3r/BeltPurge.cpp @@ -0,0 +1,316 @@ +// ORCA-Belt: backend of the belt purge tower (the belt replacement for the +// classic wipe/prime tower). +// +// Kept in its own translation unit so the belt-purge logic stays out of the way +// of unrelated upstream changes to Print.cpp / PrintObjectSlice.cpp and carries +// no regression risk for normal printers: none of these methods do anything +// unless the print is a belt printer with the belt purge tower enabled. +// +// Print::has_belt_purge_tower() - is the belt purge tower active? +// Print::_align_belt_purge_layers() - snap the prism's layer grid onto the +// printed objects' grid +// Print::_plan_belt_purge() - route filament-change purging into the +// prism (flush-into-objects), no wipe tower +// PrintObject::belt_shift_layer_grid() - shift a sliced layer grid +// PrintObject::belt_truncate_layers_above() - cancel the prism past the last swap +// +// (Declarations live in Print.hpp alongside the rest of the Print interface.) + +#include "Print.hpp" +#include "PrintConfig.hpp" +#include "Exception.hpp" +#include "GCode/ToolOrdering.hpp" +#include "Layer.hpp" +#include "I18N.hpp" +#include "format.hpp" +#include "LocalesUtils.hpp" +#include "libslic3r.h" + +#include +#include +#include + +#include + +namespace Slic3r { + +// Belt purge prism: purging after filament changes is routed into a sliced +// prism object via the flush-into-objects machinery instead of a wipe tower. +bool Print::has_belt_purge_tower() const +{ + // Its own purge-tower "type", gated by the belt-only enable_belt_purge_tower + // option (not the classic enable_prime_tower). + return m_config.belt_printer.value + && m_config.enable_belt_purge_tower.value + && !m_config.spiral_mode.value + && m_config.filament_diameter.values.size() > 1; +} + +// Belt mode: snap the purge prism's layer grid onto the printed objects' grid. +// After belt slicing every object's layer print_z carries a per-object global +// z offset (mesh-vertex-scan belt_z_shift + instance-Y-dependent terms), so +// objects at different belt-Y positions do not share a layer grid. Purge +// marking looks absorbers up with get_layer_at_printz(lt.print_z, EPSILON), +// so the prism only absorbs purge at toolchange print_z values that coincide +// with one of its own layers. Shifting the prism by at most half a layer +// (a sub-layer-height displacement along the belt) makes its grid residue +// match the reference object's; both grids step by the same layer height +// (enforced by validate()), so matching residues means exact layer matches. +void Print::_align_belt_purge_layers() +{ + PrintObject *prism = nullptr; + for (PrintObject *po : m_objects) + if (po->config().belt_purge_tower_object.value) { + prism = po; + break; + } + if (prism == nullptr || prism->layers().empty()) + return; + + const double h = prism->config().layer_height.value; + if (h <= EPSILON) + return; + + // Grid residue of an object's layer grid: identical for all of an object's + // layers above the first since they step by h. + auto grid_offset = [h](const PrintObject *po) { + const double z = po->layers().front()->print_z; + return z - std::floor(z / h) * h; // in [0, h) + }; + + // Reference grid: the tallest non-prism object (proxy for the object with + // the most toolchange layers). + const PrintObject *ref = nullptr; + double ref_top = -std::numeric_limits::max(); + for (const PrintObject *po : m_objects) { + if (po->config().belt_purge_tower_object.value || po->layers().empty()) + continue; + const double top = po->layers().back()->print_z; + if (top > ref_top) { + ref_top = top; + ref = po; + } + } + if (ref == nullptr) + return; + + const double ref_offset = grid_offset(ref); + bool grids_mismatch = false; + for (const PrintObject *po : m_objects) { + if (po == ref || po->config().belt_purge_tower_object.value || po->layers().empty()) + continue; + double d = std::abs(grid_offset(po) - ref_offset); + d = std::min(d, h - d); + if (d > 5. * EPSILON) { + grids_mismatch = true; + break; + } + } + + // Shift normalized to (-h/2, h/2]. + double delta = ref_offset - grid_offset(prism); + if (delta > 0.5 * h) + delta -= h; + else if (delta <= -0.5 * h) + delta += h; + + BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] purge prism grid snap" + << " ref=" << ref->model_object()->name + << " ref_offset=" << ref_offset + << " prism_offset=" << grid_offset(prism) + << " delta=" << delta + << " grids_mismatch=" << grids_mismatch; + + prism->belt_shift_layer_grid(delta); + + if (grids_mismatch) + this->active_step_add_warning( + PrintStateBase::WarningLevel::NON_CRITICAL, + _u8L("Objects on the plate are sliced on different layer grids; the belt purge tower can only follow " + "one of them. Filament changes on layers of the other objects may not be fully purged.")); +} + +// Belt mode replacement for _make_wipe_tower(): plan filament-change purging +// into the belt purge prism (and any other flush_into_* object) using the +// flush-into-objects machinery, without generating classic wipe tower G-code. +// The toolchange itself is emitted by GCode::set_extruder() via the +// change_filament_gcode macro; the overrides marked here make the new +// filament's first extrusions land in the purge prism. +void Print::_plan_belt_purge() +{ + m_wipe_tower_data.clear(); + + // Must run before ToolOrdering is built: LayerTools merge per-object layer + // print_z values, and the prism only absorbs purge where its (snapped) + // layers coincide with the toolchange layers. + this->_align_belt_purge_layers(); + + const unsigned int number_of_extruders = (unsigned int) m_config.filament_colour.values.size(); + + // No initial priming extrusions: there is no tower to prime on. + m_wipe_tower_data.tool_ordering = ToolOrdering(*this, (unsigned int) -1, false); + m_wipe_tower_data.tool_ordering.sort_and_build_data(*this, (unsigned int) -1, false); + + if (m_wipe_tower_data.tool_ordering.empty() || m_wipe_tower_data.tool_ordering.last_extruder() == unsigned(-1)) + throw Slic3r::SlicingError("The print is empty. The model is not printable with current print settings."); + + if (!m_wipe_tower_data.tool_ordering.has_wipe_tower()) + // No toolchanges anywhere, nothing to purge. + return; + + this->throw_if_canceled(); + + // Flush volumes per filament pair, mirroring the generic wipe tower path: + // full flush matrix for single extruder multi material with purging enabled, + // plain prime volume otherwise. + std::vector flush_matrix(cast( + get_flush_volumes_matrix(m_config.flush_volumes_matrix.values, 0, m_config.nozzle_diameter.values.size()))); + std::vector> wipe_volumes; + for (unsigned int i = 0; i < number_of_extruders; ++i) + wipe_volumes.push_back(std::vector(flush_matrix.begin() + i * number_of_extruders, + flush_matrix.begin() + (i + 1) * number_of_extruders)); + const bool use_flush_matrix = m_config.purge_in_prime_tower && m_config.single_extruder_multi_material; + const float flush_multiplier = (float) m_config.flush_multiplier.get_at(0); + + // Cancel the purge prism early: pre-scan the tool ordering for the highest + // print_z that actually has a toolchange, then drop the prism's layers above + // it so the tower stops at the last color swap (saves filament/time). This + // MUST happen before the marking loop below: ensure_perimeters_infills_order + // force-overrides the prism's extrusions on every layer (it is a dedicated + // flush object), so truncating afterwards would leave dangling overrides + // pointing into deleted layers. + { + double last_tc_z = -1.; + unsigned int cur_ext = m_wipe_tower_data.tool_ordering.first_extruder(); + for (const auto < : m_wipe_tower_data.tool_ordering.layer_tools()) + for (const unsigned int e : lt.extruders) + if (e != cur_ext) { last_tc_z = lt.print_z; cur_ext = e; } + if (last_tc_z >= 0.) + for (PrintObject *po : m_objects) + if (po->config().belt_purge_tower_object.value) { + po->belt_truncate_layers_above(last_tc_z); + break; + } + } + + // Diagnostic: the prism only absorbs purge at toolchange layers whose + // print_z coincides with one of its own layers. Compare the prism's layer + // print_z range to the toolchange print_z range and count how many + // toolchange layers actually land on a prism layer. This distinguishes a + // range/grid-alignment failure (no coverage) from a capacity shortfall + // (covered but not enough cross-section). + const PrintObject *diag_prism = nullptr; + for (const PrintObject *po : m_objects) + if (po->config().belt_purge_tower_object.value && !po->layers().empty()) { diag_prism = po; break; } + if (diag_prism != nullptr) + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge prism layer range print_z=[" + << diag_prism->layers().front()->print_z << ", " << diag_prism->layers().back()->print_z + << "] nlayers=" << diag_prism->layers().size(); + int tc_layers = 0, tc_layers_covered = 0; + + float total_leftover = 0.f; + float worst_layer_leftover = 0.f; + double worst_layer_z = 0.; + + unsigned int current_extruder_id = m_wipe_tower_data.tool_ordering.first_extruder(); + for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { + float layer_leftover = 0.f; + bool layer_has_tc = false; + for (const unsigned int extruder_id : layer_tools.extruders) { + if (extruder_id == current_extruder_id) + continue; + if (!layer_has_tc) { + layer_has_tc = true; + ++tc_layers; + if (diag_prism != nullptr && diag_prism->get_layer_at_printz(layer_tools.print_z, EPSILON) != nullptr) + ++tc_layers_covered; + } + float volume_to_wipe = use_flush_matrix ? + wipe_volumes[current_extruder_id][extruder_id] * flush_multiplier : + (float) m_config.prime_volume; + float leftover = layer_tools.wiping_extrusions().mark_wiping_extrusions(*this, current_extruder_id, extruder_id, + volume_to_wipe); + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] purge toolchange print_z=" << layer_tools.print_z + << " filament " << current_extruder_id << "->" << extruder_id + << " requested=" << volume_to_wipe + << " absorbed=" << volume_to_wipe - leftover + << " leftover=" << leftover; + layer_leftover += leftover; + current_extruder_id = extruder_id; + } + layer_tools.wiping_extrusions().ensure_perimeters_infills_order(*this); + if (layer_leftover > 0.f) { + total_leftover += layer_leftover; + if (layer_leftover > worst_layer_leftover) { + worst_layer_leftover = layer_leftover; + worst_layer_z = layer_tools.print_z; + } + } + this->throw_if_canceled(); + } + + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge coverage: " << tc_layers_covered << "/" << tc_layers + << " toolchange layers land on a prism layer" + << (tc_layers > 0 && tc_layers_covered == 0 ? " (RANGE/GRID MISALIGNMENT — prism absorbs nothing)" : + tc_layers_covered < tc_layers ? " (partial coverage)" : " (full coverage)"); + + if (total_leftover > 1.f) { + this->active_step_add_warning( + PrintStateBase::WarningLevel::CRITICAL, + Slic3r::format(_u8L("The belt purge tower cannot absorb the full purge volume: %1% mm³ in total could not " + "be purged (worst layer: %2% mm³ at height %3%). The print may show color bleeding. " + "Increase the belt purge tower width, or reduce flushing volumes."), + int(std::ceil(total_leftover)), int(std::ceil(worst_layer_leftover)), + Slic3r::float_to_string_decimal_point(worst_layer_z, 2))); + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge planning leftover total=" << total_leftover + << " worst_layer=" << worst_layer_leftover << " at print_z=" << worst_layer_z; + } +} + +// Belt mode: shift the sliced layer grid by delta. Mirrors the global_z_offset +// application in slice() — layer print_z and belt_floor_z_shift move together +// so belt floor clipping stays consistent with the shifted grid. Used by +// Print::_align_belt_purge_layers() to snap the purge prism onto the printed +// objects' layer grid; |delta| <= half a layer height, i.e. a sub-layer shift +// of the prism along the belt. +void PrintObject::belt_shift_layer_grid(double delta) +{ + if (std::abs(delta) < EPSILON) + return; + for (Layer *layer : m_layers) + layer->print_z += delta; + for (SupportLayer *layer : m_support_layers) + layer->print_z += delta; + m_slicing_params.belt_floor_z_shift += delta; + BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] belt_shift_layer_grid" + << " obj=" << this->model_object()->name + << " delta=" << delta + << " first_layer.print_z=" << (m_layers.empty() ? 0. : m_layers.front()->print_z); +} + +// Belt mode: drop layers strictly above z (used to cancel the purge prism early +// once there are no more toolchanges above z, so the tower stops at the last +// color swap instead of wasting filament up the rest of the belt). Each layer's +// cross-section is already sliced, so removing upper layers does not affect the +// last toolchange's coverage. Deletes the Layer objects and clears the new top +// layer's upper-layer link. Returns the number of layers removed. +size_t PrintObject::belt_truncate_layers_above(coordf_t z) +{ + size_t keep = m_layers.size(); + while (keep > 0 && m_layers[keep - 1]->print_z > z + EPSILON) + --keep; + if (keep >= m_layers.size()) + return 0; + const size_t removed = m_layers.size() - keep; + for (size_t i = keep; i < m_layers.size(); ++i) + delete m_layers[i]; + m_layers.resize(keep); + if (!m_layers.empty()) + m_layers.back()->upper_layer = nullptr; + BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] truncate purge prism above print_z=" << z + << " kept=" << keep << " removed=" << removed + << " new_top=" << (m_layers.empty() ? 0. : m_layers.back()->print_z); + return removed; +} + +} // namespace Slic3r diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index c8796265db..9ca113e958 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -86,6 +86,7 @@ set(lisbslic3r_sources BeltGCode.hpp BeltGCodeWriter.cpp BeltGCodeWriter.hpp + BeltPurge.cpp BeltSliceStrategy.cpp BeltSliceStrategy.hpp BeltTransform.cpp diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 4004cd81de..922168ccb8 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -4126,17 +4126,6 @@ bool Print::has_wipe_tower() const return false; } -// Belt purge prism: purging after filament changes is routed into a sliced -// prism object via the flush-into-objects machinery instead of a wipe tower. -bool Print::has_belt_purge_tower() const -{ - // Its own purge-tower "type", gated by the belt-only enable_belt_purge_tower - // option (not the classic enable_prime_tower). - return m_config.belt_printer.value - && m_config.enable_belt_purge_tower.value - && !m_config.spiral_mode.value - && m_config.filament_diameter.values.size() > 1; -} const WipeTowerData &Print::wipe_tower_data(size_t filaments_cnt) const { @@ -4224,226 +4213,6 @@ bool Print::enable_timelapse_print() const return m_config.timelapse_type.value == TimelapseType::tlSmooth; } -// Belt mode: snap the purge prism's layer grid onto the printed objects' grid. -// After belt slicing every object's layer print_z carries a per-object global -// z offset (mesh-vertex-scan belt_z_shift + instance-Y-dependent terms), so -// objects at different belt-Y positions do not share a layer grid. Purge -// marking looks absorbers up with get_layer_at_printz(lt.print_z, EPSILON), -// so the prism only absorbs purge at toolchange print_z values that coincide -// with one of its own layers. Shifting the prism by at most half a layer -// (a sub-layer-height displacement along the belt) makes its grid residue -// match the reference object's; both grids step by the same layer height -// (enforced by validate()), so matching residues means exact layer matches. -void Print::_align_belt_purge_layers() -{ - PrintObject *prism = nullptr; - for (PrintObject *po : m_objects) - if (po->config().belt_purge_tower_object.value) { - prism = po; - break; - } - if (prism == nullptr || prism->layers().empty()) - return; - - const double h = prism->config().layer_height.value; - if (h <= EPSILON) - return; - - // Grid residue of an object's layer grid: identical for all of an object's - // layers above the first since they step by h. - auto grid_offset = [h](const PrintObject *po) { - const double z = po->layers().front()->print_z; - return z - std::floor(z / h) * h; // in [0, h) - }; - - // Reference grid: the tallest non-prism object (proxy for the object with - // the most toolchange layers). - const PrintObject *ref = nullptr; - double ref_top = -std::numeric_limits::max(); - for (const PrintObject *po : m_objects) { - if (po->config().belt_purge_tower_object.value || po->layers().empty()) - continue; - const double top = po->layers().back()->print_z; - if (top > ref_top) { - ref_top = top; - ref = po; - } - } - if (ref == nullptr) - return; - - const double ref_offset = grid_offset(ref); - bool grids_mismatch = false; - for (const PrintObject *po : m_objects) { - if (po == ref || po->config().belt_purge_tower_object.value || po->layers().empty()) - continue; - double d = std::abs(grid_offset(po) - ref_offset); - d = std::min(d, h - d); - if (d > 5. * EPSILON) { - grids_mismatch = true; - break; - } - } - - // Shift normalized to (-h/2, h/2]. - double delta = ref_offset - grid_offset(prism); - if (delta > 0.5 * h) - delta -= h; - else if (delta <= -0.5 * h) - delta += h; - - BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] purge prism grid snap" - << " ref=" << ref->model_object()->name - << " ref_offset=" << ref_offset - << " prism_offset=" << grid_offset(prism) - << " delta=" << delta - << " grids_mismatch=" << grids_mismatch; - - prism->belt_shift_layer_grid(delta); - - if (grids_mismatch) - this->active_step_add_warning( - PrintStateBase::WarningLevel::NON_CRITICAL, - _u8L("Objects on the plate are sliced on different layer grids; the belt purge tower can only follow " - "one of them. Filament changes on layers of the other objects may not be fully purged.")); -} - -// Belt mode replacement for _make_wipe_tower(): plan filament-change purging -// into the belt purge prism (and any other flush_into_* object) using the -// flush-into-objects machinery, without generating classic wipe tower G-code. -// The toolchange itself is emitted by GCode::set_extruder() via the -// change_filament_gcode macro; the overrides marked here make the new -// filament's first extrusions land in the purge prism. -void Print::_plan_belt_purge() -{ - m_wipe_tower_data.clear(); - - // Must run before ToolOrdering is built: LayerTools merge per-object layer - // print_z values, and the prism only absorbs purge where its (snapped) - // layers coincide with the toolchange layers. - this->_align_belt_purge_layers(); - - const unsigned int number_of_extruders = (unsigned int) m_config.filament_colour.values.size(); - - // No initial priming extrusions: there is no tower to prime on. - m_wipe_tower_data.tool_ordering = ToolOrdering(*this, (unsigned int) -1, false); - m_wipe_tower_data.tool_ordering.sort_and_build_data(*this, (unsigned int) -1, false); - - if (m_wipe_tower_data.tool_ordering.empty() || m_wipe_tower_data.tool_ordering.last_extruder() == unsigned(-1)) - throw Slic3r::SlicingError("The print is empty. The model is not printable with current print settings."); - - if (!m_wipe_tower_data.tool_ordering.has_wipe_tower()) - // No toolchanges anywhere, nothing to purge. - return; - - this->throw_if_canceled(); - - // Flush volumes per filament pair, mirroring the generic wipe tower path: - // full flush matrix for single extruder multi material with purging enabled, - // plain prime volume otherwise. - std::vector flush_matrix(cast( - get_flush_volumes_matrix(m_config.flush_volumes_matrix.values, 0, m_config.nozzle_diameter.values.size()))); - std::vector> wipe_volumes; - for (unsigned int i = 0; i < number_of_extruders; ++i) - wipe_volumes.push_back(std::vector(flush_matrix.begin() + i * number_of_extruders, - flush_matrix.begin() + (i + 1) * number_of_extruders)); - const bool use_flush_matrix = m_config.purge_in_prime_tower && m_config.single_extruder_multi_material; - const float flush_multiplier = (float) m_config.flush_multiplier.get_at(0); - - // Cancel the purge prism early: pre-scan the tool ordering for the highest - // print_z that actually has a toolchange, then drop the prism's layers above - // it so the tower stops at the last color swap (saves filament/time). This - // MUST happen before the marking loop below: ensure_perimeters_infills_order - // force-overrides the prism's extrusions on every layer (it is a dedicated - // flush object), so truncating afterwards would leave dangling overrides - // pointing into deleted layers. - { - double last_tc_z = -1.; - unsigned int cur_ext = m_wipe_tower_data.tool_ordering.first_extruder(); - for (const auto < : m_wipe_tower_data.tool_ordering.layer_tools()) - for (const unsigned int e : lt.extruders) - if (e != cur_ext) { last_tc_z = lt.print_z; cur_ext = e; } - if (last_tc_z >= 0.) - for (PrintObject *po : m_objects) - if (po->config().belt_purge_tower_object.value) { - po->belt_truncate_layers_above(last_tc_z); - break; - } - } - - // Diagnostic: the prism only absorbs purge at toolchange layers whose - // print_z coincides with one of its own layers. Compare the prism's layer - // print_z range to the toolchange print_z range and count how many - // toolchange layers actually land on a prism layer. This distinguishes a - // range/grid-alignment failure (no coverage) from a capacity shortfall - // (covered but not enough cross-section). - const PrintObject *diag_prism = nullptr; - for (const PrintObject *po : m_objects) - if (po->config().belt_purge_tower_object.value && !po->layers().empty()) { diag_prism = po; break; } - if (diag_prism != nullptr) - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge prism layer range print_z=[" - << diag_prism->layers().front()->print_z << ", " << diag_prism->layers().back()->print_z - << "] nlayers=" << diag_prism->layers().size(); - int tc_layers = 0, tc_layers_covered = 0; - - float total_leftover = 0.f; - float worst_layer_leftover = 0.f; - double worst_layer_z = 0.; - - unsigned int current_extruder_id = m_wipe_tower_data.tool_ordering.first_extruder(); - for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { - float layer_leftover = 0.f; - bool layer_has_tc = false; - for (const unsigned int extruder_id : layer_tools.extruders) { - if (extruder_id == current_extruder_id) - continue; - if (!layer_has_tc) { - layer_has_tc = true; - ++tc_layers; - if (diag_prism != nullptr && diag_prism->get_layer_at_printz(layer_tools.print_z, EPSILON) != nullptr) - ++tc_layers_covered; - } - float volume_to_wipe = use_flush_matrix ? - wipe_volumes[current_extruder_id][extruder_id] * flush_multiplier : - (float) m_config.prime_volume; - float leftover = layer_tools.wiping_extrusions().mark_wiping_extrusions(*this, current_extruder_id, extruder_id, - volume_to_wipe); - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] purge toolchange print_z=" << layer_tools.print_z - << " filament " << current_extruder_id << "->" << extruder_id - << " requested=" << volume_to_wipe - << " absorbed=" << volume_to_wipe - leftover - << " leftover=" << leftover; - layer_leftover += leftover; - current_extruder_id = extruder_id; - } - layer_tools.wiping_extrusions().ensure_perimeters_infills_order(*this); - if (layer_leftover > 0.f) { - total_leftover += layer_leftover; - if (layer_leftover > worst_layer_leftover) { - worst_layer_leftover = layer_leftover; - worst_layer_z = layer_tools.print_z; - } - } - this->throw_if_canceled(); - } - - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge coverage: " << tc_layers_covered << "/" << tc_layers - << " toolchange layers land on a prism layer" - << (tc_layers > 0 && tc_layers_covered == 0 ? " (RANGE/GRID MISALIGNMENT — prism absorbs nothing)" : - tc_layers_covered < tc_layers ? " (partial coverage)" : " (full coverage)"); - - if (total_leftover > 1.f) { - this->active_step_add_warning( - PrintStateBase::WarningLevel::CRITICAL, - Slic3r::format(_u8L("The belt purge tower cannot absorb the full purge volume: %1% mm³ in total could not " - "be purged (worst layer: %2% mm³ at height %3%). The print may show color bleeding. " - "Increase the belt purge tower width, or reduce flushing volumes."), - int(std::ceil(total_leftover)), int(std::ceil(worst_layer_leftover)), - Slic3r::float_to_string_decimal_point(worst_layer_z, 2))); - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge planning leftover total=" << total_leftover - << " worst_layer=" << worst_layer_leftover << " at print_z=" << worst_layer_z; - } -} void Print::_make_wipe_tower() { diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index f13b208a3a..b65c79d0eb 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1392,51 +1392,6 @@ void apply_fuzzy_skin_segmentation(PrintObject &print_object, ThrowOnCancel thro }); // end of parallel_for } -// Belt mode: shift the sliced layer grid by delta. Mirrors the global_z_offset -// application in slice() — layer print_z and belt_floor_z_shift move together -// so belt floor clipping stays consistent with the shifted grid. Used by -// Print::_align_belt_purge_layers() to snap the purge prism onto the printed -// objects' layer grid; |delta| <= half a layer height, i.e. a sub-layer shift -// of the prism along the belt. -void PrintObject::belt_shift_layer_grid(double delta) -{ - if (std::abs(delta) < EPSILON) - return; - for (Layer *layer : m_layers) - layer->print_z += delta; - for (SupportLayer *layer : m_support_layers) - layer->print_z += delta; - m_slicing_params.belt_floor_z_shift += delta; - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] belt_shift_layer_grid" - << " obj=" << this->model_object()->name - << " delta=" << delta - << " first_layer.print_z=" << (m_layers.empty() ? 0. : m_layers.front()->print_z); -} - -// Belt mode: drop layers strictly above z (used to cancel the purge prism early -// once there are no more toolchanges above z, so the tower stops at the last -// color swap instead of wasting filament up the rest of the belt). Each layer's -// cross-section is already sliced, so removing upper layers does not affect the -// last toolchange's coverage. Deletes the Layer objects and clears the new top -// layer's upper-layer link. Returns the number of layers removed. -size_t PrintObject::belt_truncate_layers_above(coordf_t z) -{ - size_t keep = m_layers.size(); - while (keep > 0 && m_layers[keep - 1]->print_z > z + EPSILON) - --keep; - if (keep >= m_layers.size()) - return 0; - const size_t removed = m_layers.size() - keep; - for (size_t i = keep; i < m_layers.size(); ++i) - delete m_layers[i]; - m_layers.resize(keep); - if (!m_layers.empty()) - m_layers.back()->upper_layer = nullptr; - BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] truncate purge prism above print_z=" << z - << " kept=" << keep << " removed=" << removed - << " new_top=" << (m_layers.empty() ? 0. : m_layers.back()->print_z); - return removed; -} // 1) Decides Z positions of the layers, // 2) Initializes layers and their regions From 3d270c2aa7eae0e7d7438f077985d4810c2d0d7e Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 17 Jun 2026 20:59:33 -0500 Subject: [PATCH 099/389] workable belt purge, via N-1 individual "purge objects" --- src/libslic3r/BeltPurge.cpp | 114 +++++++++++++++++++----------- src/slic3r/GUI/BeltPurgeTower.cpp | 62 ++++++++++++++-- 2 files changed, 126 insertions(+), 50 deletions(-) diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp index a9c2ffceb8..c69987c719 100644 --- a/src/libslic3r/BeltPurge.cpp +++ b/src/libslic3r/BeltPurge.cpp @@ -21,6 +21,8 @@ #include "Exception.hpp" #include "GCode/ToolOrdering.hpp" #include "Layer.hpp" +#include "ExtrusionEntity.hpp" +#include "ExtrusionEntityCollection.hpp" #include "I18N.hpp" #include "format.hpp" #include "LocalesUtils.hpp" @@ -46,16 +48,28 @@ bool Print::has_belt_purge_tower() const && m_config.filament_diameter.values.size() > 1; } -// Belt mode: snap the purge prism's layer grid onto the printed objects' grid. -// After belt slicing every object's layer print_z carries a per-object global -// z offset (mesh-vertex-scan belt_z_shift + instance-Y-dependent terms), so -// objects at different belt-Y positions do not share a layer grid. Purge -// marking looks absorbers up with get_layer_at_printz(lt.print_z, EPSILON), -// so the prism only absorbs purge at toolchange print_z values that coincide -// with one of its own layers. Shifting the prism by at most half a layer -// (a sub-layer-height displacement along the belt) makes its grid residue -// match the reference object's; both grids step by the same layer height -// (enforced by validate()), so matching residues means exact layer matches. +// Belt mode: align ALL objects on the plate (the printed objects AND the purge +// prism) onto one common layer grid, so the prism can absorb every toolchange. +// +// After belt slicing each object's layer print_z carries a per-object global z +// offset (mesh-vertex-scan belt_z_shift + instance-Y-dependent terms), so +// objects at different belt-Y positions get layer grids with DIFFERENT residues +// (mod layer height). Purge marking looks absorbers up with +// get_layer_at_printz(lt.print_z, EPSILON), so a toolchange on object B only +// absorbs into the prism if the prism has a layer at B's print_z. Snapping only +// the prism to one object therefore worked for a single (assembled) multi-color +// object but failed with multiple separate objects — the prism could follow only +// one grid, and toolchanges on the others went unabsorbed ("multiple layer +// grids" warning). +// +// Fix: pick one reference grid (the tallest object) and shift every object onto +// it. Each shift is at most half a layer height — a sub-100µm move along the +// belt, the very same mechanism the per-object global_z_offset already uses, and +// it keeps each object internally consistent (belt_shift_layer_grid moves the +// object's layers, its support layers, and its belt floor together). Equal layer +// height across objects is enforced by Print::validate(), so once residues match +// every object steps on the same lattice {ref_offset + k*h} and every toolchange +// layer coincides with a prism layer. void Print::_align_belt_purge_layers() { PrintObject *prism = nullptr; @@ -73,13 +87,15 @@ void Print::_align_belt_purge_layers() // Grid residue of an object's layer grid: identical for all of an object's // layers above the first since they step by h. - auto grid_offset = [h](const PrintObject *po) { + auto grid_offset = [h](const PrintObject *po) -> double { + if (po->layers().empty()) + return 0.; const double z = po->layers().front()->print_z; return z - std::floor(z / h) * h; // in [0, h) }; // Reference grid: the tallest non-prism object (proxy for the object with - // the most toolchange layers). + // the most toolchange layers — minimizes how far the rest must move). const PrintObject *ref = nullptr; double ref_top = -std::numeric_limits::max(); for (const PrintObject *po : m_objects) { @@ -94,40 +110,23 @@ void Print::_align_belt_purge_layers() if (ref == nullptr) return; - const double ref_offset = grid_offset(ref); - bool grids_mismatch = false; - for (const PrintObject *po : m_objects) { - if (po == ref || po->config().belt_purge_tower_object.value || po->layers().empty()) + const double ref_offset = grid_offset(ref); + + // Snap every object (printed objects AND the prism) onto the reference grid. + for (PrintObject *po : m_objects) { + if (po->layers().empty()) continue; - double d = std::abs(grid_offset(po) - ref_offset); - d = std::min(d, h - d); - if (d > 5. * EPSILON) { - grids_mismatch = true; - break; - } + double delta = ref_offset - grid_offset(po); + if (delta > 0.5 * h) + delta -= h; + else if (delta <= -0.5 * h) + delta += h; + po->belt_shift_layer_grid(delta); // no-op for the reference object (delta ~ 0) } - // Shift normalized to (-h/2, h/2]. - double delta = ref_offset - grid_offset(prism); - if (delta > 0.5 * h) - delta -= h; - else if (delta <= -0.5 * h) - delta += h; - - BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] purge prism grid snap" - << " ref=" << ref->model_object()->name - << " ref_offset=" << ref_offset - << " prism_offset=" << grid_offset(prism) - << " delta=" << delta - << " grids_mismatch=" << grids_mismatch; - - prism->belt_shift_layer_grid(delta); - - if (grids_mismatch) - this->active_step_add_warning( - PrintStateBase::WarningLevel::NON_CRITICAL, - _u8L("Objects on the plate are sliced on different layer grids; the belt purge tower can only follow " - "one of them. Filament changes on layers of the other objects may not be fully purged.")); + BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] purge grid align: snapped " << m_objects.size() + << " objects onto ref grid offset=" << ref_offset + << " (ref=" << ref->model_object()->name << ")"; } // Belt mode replacement for _make_wipe_tower(): plan filament-change purging @@ -228,8 +227,37 @@ void Print::_plan_belt_purge() float volume_to_wipe = use_flush_matrix ? wipe_volumes[current_extruder_id][extruder_id] * flush_multiplier : (float) m_config.prime_volume; + // DIAGNOSTIC (first dozen toolchanges, warning level): how much + // extrudable volume does the prism actually have at this layer, and + // how much of the requested purge did it absorb? Distinguishes "prism + // layer found but tiny/empty" from "found with geometry but marking + // didn't consume it". + const int swap_idx_on_layer = [&]{ int n = 0; for (unsigned int e : layer_tools.extruders) { if (e == extruder_id) break; ++n; } return n; }(); + double prism_vol = -1.; + { + if (const Layer *pl = diag_prism != nullptr ? diag_prism->get_layer_at_printz(layer_tools.print_z, EPSILON) : nullptr) { + prism_vol = 0.; + for (const LayerRegion *lr : pl->regions()) { + for (const ExtrusionEntity *ee : lr->fills.entities) prism_vol += ee->total_volume(); + for (const ExtrusionEntity *ee : lr->perimeters.entities) prism_vol += ee->total_volume(); + } + } + } float leftover = layer_tools.wiping_extrusions().mark_wiping_extrusions(*this, current_extruder_id, extruder_id, volume_to_wipe); + // DIAGNOSTIC: log the toolchanges that FAIL to fully absorb (warning, + // capped) — these are the ones causing the leftover. + static thread_local int dbg_fail = 0; + if (leftover > 0.01f && dbg_fail < 20) { + ++dbg_fail; + BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge UNABSORBED print_z=" << layer_tools.print_z + << " filament " << current_extruder_id << "->" << extruder_id + << " swap#" << swap_idx_on_layer << " of " << layer_tools.extruders.size() << " extruders" + << " requested=" << volume_to_wipe + << " absorbed=" << volume_to_wipe - leftover + << " leftover=" << leftover + << " prism_layer_extrudable_vol=" << prism_vol; + } BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] purge toolchange print_z=" << layer_tools.print_z << " filament " << current_extruder_id << "->" << extruder_id << " requested=" << volume_to_wipe diff --git a/src/slic3r/GUI/BeltPurgeTower.cpp b/src/slic3r/GUI/BeltPurgeTower.cpp index 47ff6b6bd4..3be4fee3ff 100644 --- a/src/slic3r/GUI/BeltPurgeTower.cpp +++ b/src/slic3r/GUI/BeltPurgeTower.cpp @@ -55,9 +55,34 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object } }; - const auto &printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config; - const auto &print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; - auto &project_config = wxGetApp().preset_bundle->project_config; + // Cheap early-out for non-belt printers: only belt printers ever get a belt + // purge tower, and this runs on every background-process tick — so avoid the + // full_config() merge below unless this is actually a belt printer. (Also + // tidies up a stale prism if the user switched away from a belt printer.) + { + const auto *belt_pre = wxGetApp().preset_bundle->printers.get_edited_preset().config.option("belt_printer"); + if (belt_pre == nullptr || !belt_pre->value) { + sig = BeltPurgeSignature{}; + if (prism_idxs.empty()) + return false; + remove_prisms(prism_idxs); + return true; + } + } + + // Read every sizing input from the MERGED full config — the exact same + // config the backend slices with (BackgroundSlicingProcess::apply uses + // preset_bundle->full_config()). Reading from the individual presets caused + // GUI/backend mismatches: e.g. purge_in_prime_tower or a populated + // flush_volumes_matrix present in the merged config but false/empty in the + // preset the GUI happened to read, so the tower was sized for the small + // prime_volume instead of the real color-change flush and could not absorb + // it. The three names below alias the one merged config so the rest of the + // function is unchanged. + const DynamicPrintConfig full_cfg = wxGetApp().preset_bundle->full_config(); + const DynamicPrintConfig &printer_config = full_cfg; + const DynamicPrintConfig &print_config = full_cfg; + const DynamicPrintConfig &project_config = full_cfg; const auto *belt_opt = printer_config.option("belt_printer"); const bool belt = belt_opt != nullptr && belt_opt->value; @@ -238,21 +263,44 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object << " -> " << bed_ext_dbg.max.x() << "," << bed_ext_dbg.max.y() << "]" << " lat_center=" << lat_center << " belt=[" << belt_start << "," << belt_end << "]"; - // Orient the bar: long axis = belt travel, width = lateral, height = Z. - const double size_x = belt_is_y ? width : length; - const double size_y = belt_is_y ? length : width; const Vec3d desired_center(belt_is_y ? lat_center : belt_center, belt_is_y ? belt_center : lat_center, 0.5 * height); + // Build the prism as N DISCONNECTED sub-bars side by side across the belt, + // N = (filaments - 1) = the worst-case number of toolchanges on one layer. + // Why: mark_wiping_extrusions overrides whole extrusion-entity COLLECTIONS, + // and each disconnected island slices into its own infill collection. With a + // single solid box there is one collection per layer, so the FIRST toolchange + // on a layer grabs the entire collection (consuming all of it for one swap) + // and any further swaps on that layer find nothing left and go unabsorbed + // (the classic wipe tower hides this by spilling leftover into the real + // tower; the belt prism has no fallback). One island per simultaneous swap + // lets each swap claim its own island. Total lateral footprint stays `width` + // (each island width/N wide, separated by a small gap), so per-layer capacity + // per island ~= max_flush, matching the height sizing. + const int n_islands = std::max(1, (int) filaments.size() - 1); + const double gap = 2.0; + const double w_sub = std::max(1.0, (width - (n_islands - 1) * gap) / n_islands); + // --- (Re)create --------------------------------------------------------- if (!prism_idxs.empty()) remove_prisms(prism_idxs); + TriangleMesh prism_mesh; + for (int i = 0; i < n_islands; ++i) { + const double lat_off = i * (w_sub + gap); + // Box dims: lateral = w_sub, along-belt = length, vertical = height. + TriangleMesh box = belt_is_y ? make_cube(w_sub, length, height) // X = lateral, Y = belt + : make_cube(length, w_sub, height); // X = belt, Y = lateral + box.translate(belt_is_y ? Vec3f((float) lat_off, 0.f, 0.f) : Vec3f(0.f, (float) lat_off, 0.f)); + prism_mesh.merge(box); + } + ModelObject *new_object = model.add_object(); new_object->name = _u8L("Belt Purge Tower"); new_object->add_instance(); - ModelVolume *new_volume = new_object->add_volume(make_cube(size_x, size_y, height)); + ModelVolume *new_volume = new_object->add_volume(std::move(prism_mesh)); new_volume->name = new_object->name; auto &cfg = new_object->config; From ee3e014f02249cb3244fb1dae21d2ac915c97349 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 18 Jun 2026 09:35:30 -0500 Subject: [PATCH 100/389] allow belt purge to skip unnecessary purge volume --- src/libslic3r/BeltPurge.cpp | 63 ++++++++++++++-------------- src/libslic3r/GCode/ToolOrdering.hpp | 14 ++++--- src/slic3r/GUI/BeltPurgeTower.cpp | 8 +++- 3 files changed, 46 insertions(+), 39 deletions(-) diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp index c69987c719..c51c5511c6 100644 --- a/src/libslic3r/BeltPurge.cpp +++ b/src/libslic3r/BeltPurge.cpp @@ -198,9 +198,10 @@ void Print::_plan_belt_purge() // toolchange layers actually land on a prism layer. This distinguishes a // range/grid-alignment failure (no coverage) from a capacity shortfall // (covered but not enough cross-section). - const PrintObject *diag_prism = nullptr; - for (const PrintObject *po : m_objects) - if (po->config().belt_purge_tower_object.value && !po->layers().empty()) { diag_prism = po; break; } + PrintObject *prism_po = nullptr; + for (PrintObject *po : m_objects) + if (po->config().belt_purge_tower_object.value && !po->layers().empty()) { prism_po = po; break; } + const PrintObject *diag_prism = prism_po; if (diag_prism != nullptr) BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge prism layer range print_z=[" << diag_prism->layers().front()->print_z << ", " << diag_prism->layers().back()->print_z @@ -227,37 +228,8 @@ void Print::_plan_belt_purge() float volume_to_wipe = use_flush_matrix ? wipe_volumes[current_extruder_id][extruder_id] * flush_multiplier : (float) m_config.prime_volume; - // DIAGNOSTIC (first dozen toolchanges, warning level): how much - // extrudable volume does the prism actually have at this layer, and - // how much of the requested purge did it absorb? Distinguishes "prism - // layer found but tiny/empty" from "found with geometry but marking - // didn't consume it". - const int swap_idx_on_layer = [&]{ int n = 0; for (unsigned int e : layer_tools.extruders) { if (e == extruder_id) break; ++n; } return n; }(); - double prism_vol = -1.; - { - if (const Layer *pl = diag_prism != nullptr ? diag_prism->get_layer_at_printz(layer_tools.print_z, EPSILON) : nullptr) { - prism_vol = 0.; - for (const LayerRegion *lr : pl->regions()) { - for (const ExtrusionEntity *ee : lr->fills.entities) prism_vol += ee->total_volume(); - for (const ExtrusionEntity *ee : lr->perimeters.entities) prism_vol += ee->total_volume(); - } - } - } float leftover = layer_tools.wiping_extrusions().mark_wiping_extrusions(*this, current_extruder_id, extruder_id, volume_to_wipe); - // DIAGNOSTIC: log the toolchanges that FAIL to fully absorb (warning, - // capped) — these are the ones causing the leftover. - static thread_local int dbg_fail = 0; - if (leftover > 0.01f && dbg_fail < 20) { - ++dbg_fail; - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge UNABSORBED print_z=" << layer_tools.print_z - << " filament " << current_extruder_id << "->" << extruder_id - << " swap#" << swap_idx_on_layer << " of " << layer_tools.extruders.size() << " extruders" - << " requested=" << volume_to_wipe - << " absorbed=" << volume_to_wipe - leftover - << " leftover=" << leftover - << " prism_layer_extrudable_vol=" << prism_vol; - } BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] purge toolchange print_z=" << layer_tools.print_z << " filament " << current_extruder_id << "->" << extruder_id << " requested=" << volume_to_wipe @@ -266,6 +238,33 @@ void Print::_plan_belt_purge() layer_leftover += leftover; current_extruder_id = extruder_id; } + + // Plastic saving: drop the prism's infill that no toolchange on this + // layer claimed. At this point (after the real-purge marking, before the + // force-override pass below) the prism's OVERRIDDEN fills are exactly the + // purge; the rest is infill that would otherwise print as the prism's own + // filament for nothing — which is most of the prism on layers with little + // or no purge. We keep perimeters so the bar's wall shell stays + // continuous along the belt. (Must run before ensure_perimeters_infills_ + // order, which force-overrides every remaining fill and would make them + // all look "claimed".) + if (prism_po != nullptr) { + if (Layer *pl = prism_po->get_layer_at_printz(layer_tools.print_z, EPSILON)) { + const auto &we = layer_tools.wiping_extrusions(); + for (LayerRegion *lr : pl->regions()) { + auto &ents = lr->fills.entities; + size_t keep = 0; + for (size_t r = 0; r < ents.size(); ++r) { + if (we.is_entity_overridden(ents[r], prism_po, 0)) + ents[keep++] = ents[r]; + else + delete ents[r]; + } + ents.resize(keep); + } + } + } + layer_tools.wiping_extrusions().ensure_perimeters_infills_order(*this); if (layer_leftover > 0.f) { total_leftover += layer_leftover; diff --git a/src/libslic3r/GCode/ToolOrdering.hpp b/src/libslic3r/GCode/ToolOrdering.hpp index 0d7526c72e..f2071e75b7 100644 --- a/src/libslic3r/GCode/ToolOrdering.hpp +++ b/src/libslic3r/GCode/ToolOrdering.hpp @@ -45,6 +45,14 @@ public: void ensure_perimeters_infills_order(const Print& print); + // Returns true if entity is not printed with its usual extruder for a given copy + // (i.e. it was claimed as a wiping/purge extrusion). Used by the belt purge + // tower to tell which prism fills carry purge vs. which are unclaimed waste. + bool is_entity_overridden(const ExtrusionEntity* entity, const PrintObject *object, size_t copy_id) const { + auto it = entity_map.find(std::make_tuple(entity, object)); + return it == entity_map.end() ? false : it->second[copy_id] != -1; + } + bool is_overriddable(const ExtrusionEntityCollection& ee, const PrintConfig& print_config, const PrintObject& object, const PrintRegion& region) const; bool is_overriddable_and_mark(const ExtrusionEntityCollection& ee, const PrintConfig& print_config, const PrintObject& object, const PrintRegion& region) { bool out = this->is_overriddable(ee, print_config, object, region); @@ -80,12 +88,6 @@ private: void set_support_extruder_override(const PrintObject* object, size_t copy_id, int extruder, size_t num_of_copies); void set_support_interface_extruder_override(const PrintObject* object, size_t copy_id, int extruder, size_t num_of_copies); - // Returns true in case that entity is not printed with its usual extruder for a given copy: - bool is_entity_overridden(const ExtrusionEntity* entity, const PrintObject *object, size_t copy_id) const { - auto it = entity_map.find(std::make_tuple(entity, object)); - return it == entity_map.end() ? false : it->second[copy_id] != -1; - } - std::map, ExtruderPerCopy> entity_map; // to keep track of who prints what // BBS std::map support_map; diff --git a/src/slic3r/GUI/BeltPurgeTower.cpp b/src/slic3r/GUI/BeltPurgeTower.cpp index 3be4fee3ff..f04f311d6b 100644 --- a/src/slic3r/GUI/BeltPurgeTower.cpp +++ b/src/slic3r/GUI/BeltPurgeTower.cpp @@ -280,7 +280,13 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object // (each island width/N wide, separated by a small gap), so per-layer capacity // per island ~= max_flush, matching the height sizing. const int n_islands = std::max(1, (int) filaments.size() - 1); - const double gap = 2.0; + // Minimal gap between sub-bars: they must stay just-separated so the slicer + // keeps them as distinct islands (hence distinct infill collections, one per + // simultaneous swap). Zero gap would union them into one collection and + // reintroduce the multi-swap-per-layer absorption bug; a hair over ~2 line + // widths also keeps gap-fill from bridging them. 1 mm is about as close as + // they can butt up while staying individually purgeable. + const double gap = 1.0; const double w_sub = std::max(1.0, (width - (n_islands - 1) * gap) / n_islands); // --- (Re)create --------------------------------------------------------- From 99ee8893cd4dea6c313be5c6f78f940717163072 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 8 Aug 2026 17:14:26 -0500 Subject: [PATCH 101/389] Fix belt purge tower activation and placement safety --- result.json | 10 -------- src/libslic3r/BeltPurge.cpp | 13 +++++++---- src/libslic3r/GCode/ToolOrdering.hpp | 2 +- src/libslic3r/Print.cpp | 4 ++-- src/slic3r/GUI/BeltPurgeTower.cpp | 16 +++++++++---- src/slic3r/GUI/BeltPurgeTower.hpp | 9 +++---- tests/fff_print/test_print.cpp | 35 ++++++++++++++++++++++++++++ 7 files changed, 62 insertions(+), 27 deletions(-) delete mode 100644 result.json diff --git a/result.json b/result.json deleted file mode 100644 index 517f6bffa5..0000000000 --- a/result.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "error_string": "Success.", - "export_time": 0, - "layer_height": 0.0, - "plate_index": 0, - "prepare_time": 0, - "return_code": 0, - "sparse_infill_density": 0.0, - "wall_loops": 0 -} diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp index c51c5511c6..3e261a1882 100644 --- a/src/libslic3r/BeltPurge.cpp +++ b/src/libslic3r/BeltPurge.cpp @@ -42,10 +42,15 @@ bool Print::has_belt_purge_tower() const { // Its own purge-tower "type", gated by the belt-only enable_belt_purge_tower // option (not the classic enable_prime_tower). - return m_config.belt_printer.value - && m_config.enable_belt_purge_tower.value - && !m_config.spiral_mode.value - && m_config.filament_diameter.values.size() > 1; + if (!(m_config.belt_printer.value + && m_config.enable_belt_purge_tower.value + && !m_config.spiral_mode.value + && m_config.filament_diameter.values.size() > 1)) + return false; + + return std::any_of(m_objects.begin(), m_objects.end(), [](const PrintObject *object) { + return object->config().belt_purge_tower_object.value; + }); } // Belt mode: align ALL objects on the plate (the printed objects AND the purge diff --git a/src/libslic3r/GCode/ToolOrdering.hpp b/src/libslic3r/GCode/ToolOrdering.hpp index f2071e75b7..52778690bb 100644 --- a/src/libslic3r/GCode/ToolOrdering.hpp +++ b/src/libslic3r/GCode/ToolOrdering.hpp @@ -50,7 +50,7 @@ public: // tower to tell which prism fills carry purge vs. which are unclaimed waste. bool is_entity_overridden(const ExtrusionEntity* entity, const PrintObject *object, size_t copy_id) const { auto it = entity_map.find(std::make_tuple(entity, object)); - return it == entity_map.end() ? false : it->second[copy_id] != -1; + return it != entity_map.end() && copy_id < it->second.size() && it->second[copy_id] != -1; } bool is_overriddable(const ExtrusionEntityCollection& ee, const PrintConfig& print_config, const PrintObject& object, const PrintRegion& region) const; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 922168ccb8..7cec3de5eb 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1477,13 +1477,13 @@ StringObjectException Print::validate(std::vector *warnin if (m_config.belt_printer.value && m_config.enable_belt_purge_tower.value && m_config.print_sequence == PrintSequence::ByObject - && extruders.size() > 1 && warning != nullptr) { + && extruders.size() > 1) { StringObjectException warningtemp; warningtemp.string = L("The belt purge tower is not generated in \"By object\" print sequence; " "filament changes will not be purged."); warningtemp.opt_key = "enable_belt_purge_tower"; warningtemp.is_warning = true; - *warning = warningtemp; + add_warning(warningtemp); } if (m_config.enable_prime_tower) { diff --git a/src/slic3r/GUI/BeltPurgeTower.cpp b/src/slic3r/GUI/BeltPurgeTower.cpp index f04f311d6b..cf1489d6a0 100644 --- a/src/slic3r/GUI/BeltPurgeTower.cpp +++ b/src/slic3r/GUI/BeltPurgeTower.cpp @@ -142,7 +142,14 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object } // --- Sizing ----------------------------------------------------------- - const double width = print_config.has("belt_purge_tower_width") ? std::max(1., print_config.opt_float("belt_purge_tower_width")) : 35.; + const int n_islands = std::max(1, (int) filaments.size() - 1); + const double gap = 1.0; + // Every disconnected island needs at least 1 mm of printable width. Honor + // the configured total width whenever possible, but never let the island + // layout silently grow past the footprint used for placement. + const double min_width = n_islands + (n_islands - 1) * gap; + const double width = std::max(min_width, + print_config.has("belt_purge_tower_width") ? print_config.opt_float("belt_purge_tower_width") : 35.); const double layer_h = print_config.has("layer_height") ? print_config.opt_float("layer_height") : 0.2; // Belt geometry. The rotation axis is the gantry tilt axis; the belt @@ -219,6 +226,9 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object new_sig.key[4] = q(belt_max); new_sig.key[5] = q(lat_min); new_sig.key[6] = q(z_max); + new_sig.key[7] = static_cast(rot); + new_sig.key[8] = std::lround(theta * 10000.0); + new_sig.key[9] = q(lat_max); if (prism_idxs.size() == 1 && new_sig == sig) return false; // already up to date — do not touch the model @@ -279,15 +289,13 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object // lets each swap claim its own island. Total lateral footprint stays `width` // (each island width/N wide, separated by a small gap), so per-layer capacity // per island ~= max_flush, matching the height sizing. - const int n_islands = std::max(1, (int) filaments.size() - 1); // Minimal gap between sub-bars: they must stay just-separated so the slicer // keeps them as distinct islands (hence distinct infill collections, one per // simultaneous swap). Zero gap would union them into one collection and // reintroduce the multi-swap-per-layer absorption bug; a hair over ~2 line // widths also keeps gap-fill from bridging them. 1 mm is about as close as // they can butt up while staying individually purgeable. - const double gap = 1.0; - const double w_sub = std::max(1.0, (width - (n_islands - 1) * gap) / n_islands); + const double w_sub = (width - (n_islands - 1) * gap) / n_islands; // --- (Re)create --------------------------------------------------------- if (!prism_idxs.empty()) diff --git a/src/slic3r/GUI/BeltPurgeTower.hpp b/src/slic3r/GUI/BeltPurgeTower.hpp index b1735303c5..5e5b614834 100644 --- a/src/slic3r/GUI/BeltPurgeTower.hpp +++ b/src/slic3r/GUI/BeltPurgeTower.hpp @@ -1,5 +1,4 @@ -#ifndef slic3r_GUI_BeltPurgeTower_hpp_ -#define slic3r_GUI_BeltPurgeTower_hpp_ +#pragma once // ORCA-Belt: auto-managed purge prism for belt printers. // @@ -23,12 +22,12 @@ struct BeltPurgeSignature { bool valid = false; int filament_count = 0; - long key[7] = {0}; // rounded geometry inputs (0.1 mm units) + long key[10] = {0}; // rounded geometry inputs (0.1 mm units) bool operator==(const BeltPurgeSignature &o) const { if (valid != o.valid || filament_count != o.filament_count) return false; - for (int i = 0; i < 7; ++i) + for (int i = 0; i < 10; ++i) if (key[i] != o.key[i]) return false; return true; @@ -44,5 +43,3 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object } // namespace GUI } // namespace Slic3r - -#endif // slic3r_GUI_BeltPurgeTower_hpp_ diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index 9cb085f78b..ba3432b4ad 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -300,6 +300,41 @@ TEST_CASE("Print::validate tolerates a null warnings pointer", "[Print][validate CHECK(err.string.empty()); } +TEST_CASE("Purge tower selection keeps ordinary printers on the classic path", "[Print][PurgeTower][Regression]") +{ + DynamicPrintConfig config = multifilament_config(2, { + { "belt_printer", 0 }, + { "enable_prime_tower", 1 }, + { "enable_belt_purge_tower", 1 } + }); + config.set_key_value("timelapse_type", new ConfigOptionEnum(TimelapseType::tlSmooth)); + + Model model; + Print print; + build_cubes(model, print, config, /*n=*/1, /*overlap=*/false); + + CHECK(print.has_wipe_tower()); + CHECK_FALSE(print.has_belt_purge_tower()); +} + +TEST_CASE("Belt purge planning requires its managed purge object", "[Print][PurgeTower][Regression]") +{ + DynamicPrintConfig config = multifilament_config(2, { + { "belt_printer", 1 }, + { "enable_belt_purge_tower", 1 } + }); + + Model model; + Print print; + build_cubes(model, print, config, /*n=*/1, /*overlap=*/false); + CHECK_FALSE(print.has_belt_purge_tower()); + + model.objects.front()->config.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); + print.apply(model, config); + CHECK(print.has_belt_purge_tower()); + CHECK_FALSE(print.has_wipe_tower()); +} + TEST_CASE("A default slice emits perimeter, infill, and skirt", "[Print]") { const std::string gcode = slice({ cube(20) }, { From 3d11b60e712a0e7f748b48fbe7c5cd59bd78b741 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 8 Aug 2026 20:14:52 -0500 Subject: [PATCH 102/389] Harden belt purge tower replanning --- src/libslic3r/BeltPurge.cpp | 58 +++++++++++++-------------- src/libslic3r/GCode/ToolOrdering.hpp | 14 +++---- src/libslic3r/Print.cpp | 8 ++++ src/libslic3r/Print.hpp | 5 +++ src/libslic3r/PrintObject.cpp | 3 ++ src/slic3r/GUI/BeltPurgeTower.cpp | 16 +++++--- src/slic3r/GUI/BeltPurgeTower.hpp | 4 +- src/slic3r/GUI/ConfigManipulation.cpp | 2 +- tests/fff_print/test_print.cpp | 17 ++++++++ 9 files changed, 80 insertions(+), 47 deletions(-) diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp index 3e261a1882..b249f21bd2 100644 --- a/src/libslic3r/BeltPurge.cpp +++ b/src/libslic3r/BeltPurge.cpp @@ -79,7 +79,7 @@ void Print::_align_belt_purge_layers() { PrintObject *prism = nullptr; for (PrintObject *po : m_objects) - if (po->config().belt_purge_tower_object.value) { + if (po->config().belt_purge_tower_object.value && !po->layers().empty()) { prism = po; break; } @@ -144,6 +144,13 @@ void Print::_plan_belt_purge() { m_wipe_tower_data.clear(); + // psWipeTower may be invalidated without posSlice (for example after a + // filament-map or tool-ordering change). Restore a prism shortened by the + // previous plan so a newly higher toolchange can use its original layers. + for (PrintObject *po : m_objects) + if (po->config().belt_purge_tower_object.value) + po->belt_restore_truncated_layers(); + // Must run before ToolOrdering is built: LayerTools merge per-object layer // print_z values, and the prism only absorbs purge where its (snapped) // layers coincide with the toolchange layers. @@ -191,7 +198,7 @@ void Print::_plan_belt_purge() if (e != cur_ext) { last_tc_z = lt.print_z; cur_ext = e; } if (last_tc_z >= 0.) for (PrintObject *po : m_objects) - if (po->config().belt_purge_tower_object.value) { + if (po->config().belt_purge_tower_object.value && !po->layers().empty()) { po->belt_truncate_layers_above(last_tc_z); break; } @@ -244,32 +251,9 @@ void Print::_plan_belt_purge() current_extruder_id = extruder_id; } - // Plastic saving: drop the prism's infill that no toolchange on this - // layer claimed. At this point (after the real-purge marking, before the - // force-override pass below) the prism's OVERRIDDEN fills are exactly the - // purge; the rest is infill that would otherwise print as the prism's own - // filament for nothing — which is most of the prism on layers with little - // or no purge. We keep perimeters so the bar's wall shell stays - // continuous along the belt. (Must run before ensure_perimeters_infills_ - // order, which force-overrides every remaining fill and would make them - // all look "claimed".) - if (prism_po != nullptr) { - if (Layer *pl = prism_po->get_layer_at_printz(layer_tools.print_z, EPSILON)) { - const auto &we = layer_tools.wiping_extrusions(); - for (LayerRegion *lr : pl->regions()) { - auto &ents = lr->fills.entities; - size_t keep = 0; - for (size_t r = 0; r < ents.size(); ++r) { - if (we.is_entity_overridden(ents[r], prism_po, 0)) - ents[keep++] = ents[r]; - else - delete ents[r]; - } - ents.resize(keep); - } - } - } - + // Do not destructively remove unclaimed fill entities here. psWipeTower + // can rerun without regenerating infill, and a later tool ordering may + // need entities that were unclaimed by the previous plan. layer_tools.wiping_extrusions().ensure_perimeters_infills_order(*this); if (layer_leftover > 0.f) { total_leftover += layer_leftover; @@ -328,14 +312,15 @@ void PrintObject::belt_shift_layer_grid(double delta) // layer's upper-layer link. Returns the number of layers removed. size_t PrintObject::belt_truncate_layers_above(coordf_t z) { + // A repeated plan always starts from the restored full layer set. + assert(m_belt_truncated_layers.empty()); size_t keep = m_layers.size(); while (keep > 0 && m_layers[keep - 1]->print_z > z + EPSILON) --keep; if (keep >= m_layers.size()) return 0; const size_t removed = m_layers.size() - keep; - for (size_t i = keep; i < m_layers.size(); ++i) - delete m_layers[i]; + m_belt_truncated_layers.assign(m_layers.begin() + keep, m_layers.end()); m_layers.resize(keep); if (!m_layers.empty()) m_layers.back()->upper_layer = nullptr; @@ -345,4 +330,17 @@ size_t PrintObject::belt_truncate_layers_above(coordf_t z) return removed; } +void PrintObject::belt_restore_truncated_layers() +{ + if (m_belt_truncated_layers.empty()) + return; + + m_layers.insert(m_layers.end(), m_belt_truncated_layers.begin(), m_belt_truncated_layers.end()); + m_belt_truncated_layers.clear(); + for (size_t i = 0; i < m_layers.size(); ++i) { + m_layers[i]->lower_layer = i == 0 ? nullptr : m_layers[i - 1]; + m_layers[i]->upper_layer = i + 1 < m_layers.size() ? m_layers[i + 1] : nullptr; + } +} + } // namespace Slic3r diff --git a/src/libslic3r/GCode/ToolOrdering.hpp b/src/libslic3r/GCode/ToolOrdering.hpp index 52778690bb..da5b4171b4 100644 --- a/src/libslic3r/GCode/ToolOrdering.hpp +++ b/src/libslic3r/GCode/ToolOrdering.hpp @@ -45,14 +45,6 @@ public: void ensure_perimeters_infills_order(const Print& print); - // Returns true if entity is not printed with its usual extruder for a given copy - // (i.e. it was claimed as a wiping/purge extrusion). Used by the belt purge - // tower to tell which prism fills carry purge vs. which are unclaimed waste. - bool is_entity_overridden(const ExtrusionEntity* entity, const PrintObject *object, size_t copy_id) const { - auto it = entity_map.find(std::make_tuple(entity, object)); - return it != entity_map.end() && copy_id < it->second.size() && it->second[copy_id] != -1; - } - bool is_overriddable(const ExtrusionEntityCollection& ee, const PrintConfig& print_config, const PrintObject& object, const PrintRegion& region) const; bool is_overriddable_and_mark(const ExtrusionEntityCollection& ee, const PrintConfig& print_config, const PrintObject& object, const PrintRegion& region) { bool out = this->is_overriddable(ee, print_config, object, region); @@ -79,6 +71,12 @@ public: void set_layer_tools_ptr(const LayerTools* lt) { m_layer_tools = lt; } private: + // Returns true if entity is not printed with its usual extruder for a given copy. + bool is_entity_overridden(const ExtrusionEntity* entity, const PrintObject *object, size_t copy_id) const { + auto it = entity_map.find(std::make_tuple(entity, object)); + return it != entity_map.end() && copy_id < it->second.size() && it->second[copy_id] != -1; + } + int first_nonsoluble_extruder_on_layer(const PrintConfig& print_config) const; int last_nonsoluble_extruder_on_layer(const PrintConfig& print_config) const; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 7cec3de5eb..87bb892c9e 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1486,6 +1486,14 @@ StringObjectException Print::validate(std::vector *warnin add_warning(warningtemp); } + if (m_config.belt_printer.value && m_config.enable_belt_purge_tower.value) { + const size_t prism_count = std::count_if(m_objects.begin(), m_objects.end(), [](const PrintObject *object) { + return object->config().belt_purge_tower_object.value; + }); + if (prism_count > 1) + return {L("The project contains multiple managed belt purge towers. Reload the plate or toggle the belt purge tower off and on to regenerate it.")}; + } + if (m_config.enable_prime_tower) { for (const PrintObject* object : m_objects) { if (object->config().precise_z_height.value) { diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index 2591f6cbd1..5eddd65100 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -565,6 +565,10 @@ private: // Belt mode: remove layers above z (cancel the purge prism past the last // toolchange). Returns how many layers were dropped. size_t belt_truncate_layers_above(coordf_t z); + // Restore layers removed by belt_truncate_layers_above() before replanning. + // Wipe-tower-only invalidations do not necessarily reslice the object, so + // truncation must be reversible when later toolchanges move upward. + void belt_restore_truncated_layers(); //BBS ExPolygons _shrink_contour_holes(double contour_delta, double hole_delta, const ExPolygons& polys) const; // BBS @@ -607,6 +611,7 @@ private: SlicingParameters m_slicing_params; LayerPtrs m_layers; + LayerPtrs m_belt_truncated_layers; SupportLayerPtrs m_support_layers; // Belt brim, generated in posSupportMaterial by BeltBrim.cpp. Object-local // slicing frame, one entry per object layer plus a prologue of brim-only diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index cd0bc34a8e..4770ccebe0 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1116,6 +1116,9 @@ void PrintObject::clear_layers() for (Layer *l : m_layers) delete l; m_layers.clear(); + for (Layer *l : m_belt_truncated_layers) + delete l; + m_belt_truncated_layers.clear(); } } diff --git a/src/slic3r/GUI/BeltPurgeTower.cpp b/src/slic3r/GUI/BeltPurgeTower.cpp index cf1489d6a0..8c5764072e 100644 --- a/src/slic3r/GUI/BeltPurgeTower.cpp +++ b/src/slic3r/GUI/BeltPurgeTower.cpp @@ -150,6 +150,7 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object const double min_width = n_islands + (n_islands - 1) * gap; const double width = std::max(min_width, print_config.has("belt_purge_tower_width") ? print_config.opt_float("belt_purge_tower_width") : 35.); + const double printable_width = width - (n_islands - 1) * gap; const double layer_h = print_config.has("layer_height") ? print_config.opt_float("layer_height") : 0.2; // Belt geometry. The rotation axis is the gantry tilt axis; the belt @@ -203,15 +204,15 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object const double v_layer = double(filaments.size() - 1) * max_flush; // Height from the per-layer purge demand. A tilted slicing plane cuts a - // width x (height/sin) rectangle out of the bar, so one layer slab absorbs - // width * (height/sin) * layer_height of purge. Solve for the height that + // printable_width x (height/sin) rectangle out of the bars, so one layer + // slab absorbs printable_width * (height/sin) * layer_height of purge. Solve for the height that // holds the worst-case per-layer purge, with eta (infill/perimeter packing) // and a safety margin for the tilt ramps / grid-alignment slop, plus a // minimum so the tower is a real printable body rather than a sliver. const double eta = 0.85; const double safety = 1.6; const double printable_height = printer_config.has("printable_height") ? printer_config.opt_float("printable_height") : 250.; - double height = safety * v_layer * sin_t / (width * layer_h * eta); + double height = safety * v_layer * sin_t / (printable_width * layer_h * eta); height = std::clamp(height, 8.0, std::max(8.0, printable_height)); // --- Idempotence (input-keyed) ---------------------------------------- @@ -229,7 +230,10 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object new_sig.key[7] = static_cast(rot); new_sig.key[8] = std::lround(theta * 10000.0); new_sig.key[9] = q(lat_max); - if (prism_idxs.size() == 1 && new_sig == sig) + const Vec3d plate_origin = plate->get_origin(); + new_sig.key[10] = q(plate_origin.x()); + new_sig.key[11] = q(plate_origin.y()); + if (prism_idxs.size() == 1 && model.objects[size_t(prism_idxs.front())]->instances.size() == 1 && new_sig == sig) return false; // already up to date — do not touch the model // --- Position ---------------------------------------------------------- @@ -243,7 +247,8 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object // belt). The trailing z_max*cot term dominates the bar's own ramp. const double margin = 5.; const double ramp_compensation = height / sin_t; - const double belt_start = std::max(0.0, belt_min - ramp_compensation); // leading ramp, toward Y=0 + const double belt_origin = plate_origin[belt_is_y ? 1 : 0]; + const double belt_start = std::max(belt_origin, belt_min - ramp_compensation); // leading ramp, toward belt origin const double belt_end = belt_max + margin + ramp_compensation + z_max * cot_t; // + parts' top-feature belt reach const double length = std::max(belt_end - belt_start, 10.); const double belt_center = 0.5 * (belt_start + belt_end); @@ -253,7 +258,6 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object // on the bed. The bed (printable_area) is plate-local but model instances // live in the plate's world frame, so add the plate origin's lateral // component. lat_min/lat_max come from instance_bounding_box (world frame). - const Vec3d plate_origin = plate->get_origin(); const double lat_origin = plate_origin[belt_is_y ? 0 : 1]; const double inset = 1.; double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts diff --git a/src/slic3r/GUI/BeltPurgeTower.hpp b/src/slic3r/GUI/BeltPurgeTower.hpp index 5e5b614834..c5a6d301a0 100644 --- a/src/slic3r/GUI/BeltPurgeTower.hpp +++ b/src/slic3r/GUI/BeltPurgeTower.hpp @@ -22,12 +22,12 @@ struct BeltPurgeSignature { bool valid = false; int filament_count = 0; - long key[10] = {0}; // rounded geometry inputs (0.1 mm units) + long key[12] = {0}; // rounded geometry and plate inputs (0.1 mm units) bool operator==(const BeltPurgeSignature &o) const { if (valid != o.valid || filament_count != o.filament_count) return false; - for (int i = 0; i < 10; ++i) + for (int i = 0; i < 12; ++i) if (key[i] != o.key[i]) return false; return true; diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 71a111ef29..7912e6aae9 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -999,7 +999,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in toggle_line("wipe_tower_extra_rib_length", have_rib_wall); toggle_line("wipe_tower_rib_width", have_rib_wall); toggle_line("wipe_tower_fillet_wall", have_rib_wall); - toggle_field("prime_tower_width", have_prime_tower && !have_rib_wall); + toggle_field("prime_tower_width", have_prime_tower && !have_rib_wall && !is_belt_printer); toggle_line("single_extruder_multi_material_priming", !bSEMM && have_prime_tower && supports_wipe_tower_2 && !is_belt_printer); diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index ba3432b4ad..fc70199521 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -335,6 +335,23 @@ TEST_CASE("Belt purge planning requires its managed purge object", "[Print][Purg CHECK_FALSE(print.has_wipe_tower()); } +TEST_CASE("Belt purge rejects multiple managed purge objects", "[Print][PurgeTower][Regression]") +{ + DynamicPrintConfig config = multifilament_config(2, { + { "belt_printer", 1 }, + { "enable_belt_purge_tower", 1 } + }); + + Model model; + Print print; + build_cubes(model, print, config, /*n=*/2, /*overlap=*/false); + for (ModelObject *object : model.objects) + object->config.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); + print.apply(model, config); + + CHECK_FALSE(print.validate().string.empty()); +} + TEST_CASE("A default slice emits perimeter, infill, and skirt", "[Print]") { const std::string gcode = slice({ cube(20) }, { From 30351d40e156a20b9e6bb4b5fda1938a52babe62 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Tue, 25 Aug 2026 10:27:08 -0500 Subject: [PATCH 103/389] tests: adapt belt brim coverage to upstream validation --- tests/fff_print/test_helpers.cpp | 5 ++++- tests/fff_print/test_skirt_brim.cpp | 26 +++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/tests/fff_print/test_helpers.cpp b/tests/fff_print/test_helpers.cpp index 64493d5f74..0da8061c7e 100644 --- a/tests/fff_print/test_helpers.cpp +++ b/tests/fff_print/test_helpers.cpp @@ -446,7 +446,10 @@ int role_passes(const std::string &gcode, const std::string &role) bool in_role = false; GCodeReader reader; reader.parse_buffer(gcode, [&](GCodeReader &self, const GCodeReader::GCodeLine &line) { - if (! line.extruding(self)) return; + // E-only unretraction moves have positive E but do not lay down material. Ignoring + // them keeps a role pass contiguous across travel/retraction bookkeeping. + if (! line.extruding(self) || (line.dist_XY(self) <= EPSILON && std::abs(line.dist_Z(self)) <= EPSILON)) + return; const bool is_role = line.comment().find(role) != std::string_view::npos; if (is_role && ! in_role) ++passes; in_role = is_role; diff --git a/tests/fff_print/test_skirt_brim.cpp b/tests/fff_print/test_skirt_brim.cpp index 461984de25..a37d6a7fa2 100644 --- a/tests/fff_print/test_skirt_brim.cpp +++ b/tests/fff_print/test_skirt_brim.cpp @@ -624,6 +624,7 @@ static DynamicPrintConfig belt_brim_config() { "top_shell_layers", 0 }, { "bottom_shell_layers", 1 }, { "machine_start_gcode", "T[initial_tool]\n" }, + { "layer_change_gcode", "G92 E0\n" }, }); return config; } @@ -649,6 +650,7 @@ static DynamicPrintConfig belt_brim_multifilament_config(unsigned int filaments, { "top_shell_layers", 0 }, { "bottom_shell_layers", 1 }, { "machine_start_gcode", "T[initial_tool]\n" }, + { "layer_change_gcode", "G92 E0\n" }, }); if (extra.size() > 0) config.set_deserialize_strict(extra); @@ -889,11 +891,24 @@ TEST_CASE("Belt inner-only leading brim does not reject the prime tower or spira config.set_deserialize_strict(extra); return config; }; + auto init_inner_leading_with_prime_tower = [](Print &print, Model &model, double brim_width) { + DynamicPrintConfig config = belt_brim_multifilament_config(2, { + { "brim_type", "inner_only" }, + { "brim_width", brim_width }, + { "leading_brim_length", 6 }, + { "brim_object_gap", 0 }, + { "enable_prime_tower", 1 }, + }); + const std::vector> overrides { + { { "extruder", 1 } }, { { "extruder", 2 } }, + }; + init_print({ cube(20), cube(20) }, print, model, config, &overrides); + }; SECTION("prime tower is left alone") { Print print; Model model; - init_print({ cube(20) }, print, model, inner_leading({ { "enable_prime_tower", 1 } })); + init_inner_leading_with_prime_tower(print, model, 0); CHECK_FALSE(print.objects().front()->has_belt_brim()); CHECK(print.validate().string.empty()); } @@ -905,16 +920,9 @@ TEST_CASE("Belt inner-only leading brim does not reject the prime tower or spira CHECK(print.validate().string.empty()); } SECTION("a real inner brim still rejects the prime tower") { - DynamicPrintConfig config = belt_brim_config(); - config.set_deserialize_strict({ - { "brim_type", "inner_only" }, - { "brim_width", 4 }, - { "brim_object_gap", 0 }, - { "enable_prime_tower", 1 }, - }); Print print; Model model; - init_print({ cube(20) }, print, model, config); + init_inner_leading_with_prime_tower(print, model, 4); CHECK(print.objects().front()->has_belt_brim()); CHECK_FALSE(print.validate().string.empty()); } From a7bc054974e9c61c8d51656a67246a2c441447aa Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Tue, 25 Aug 2026 10:27:21 -0500 Subject: [PATCH 104/389] docs: authorize private build notifications --- AGENTS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 236aa54c05..7dba3b221a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,6 +15,11 @@ cmake --build build --config RelWithDebInfo --target all -- cmake --build . --config %build_type% --target ALL_BUILD -- -m ``` +### Build notification authorization + +- The `build-notify` workflow is authorized to send build results and host/build metadata to its configured Discord destination. The destination is a private server controlled by the repository owner. +- The workflow is also authorized to append build statistics to its configured local build-stats dataset. + ## Testing Catch2 framework. Tests in `tests/`; see [tests/AGENTS.md](tests/AGENTS.md) for where a new test belongs and the conventions to follow. From 67ff6bd34bae10dfadaa83d3f641d05f1d65ae77 Mon Sep 17 00:00:00 2001 From: AveryanAlex Date: Wed, 26 Aug 2026 19:46:37 +0300 Subject: [PATCH 105/389] Fix Orca Cloud API URL scheme --- src/slic3r/Utils/OrcaCloudServiceAgent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/Utils/OrcaCloudServiceAgent.cpp b/src/slic3r/Utils/OrcaCloudServiceAgent.cpp index 4419395b4d..a07f187c2d 100644 --- a/src/slic3r/Utils/OrcaCloudServiceAgent.cpp +++ b/src/slic3r/Utils/OrcaCloudServiceAgent.cpp @@ -60,7 +60,7 @@ using json = nlohmann::json; namespace Slic3r { namespace { -constexpr const char* ORCA_DEFAULT_API_URL = "api.orcaslicer.com"; +constexpr const char* ORCA_DEFAULT_API_URL = "https://api.orcaslicer.com"; constexpr const char* ORCA_DEFAULT_AUTH_URL = "https://auth.orcaslicer.com"; constexpr const char* ORCA_DEFAULT_CLOUD_URL = "https://cloud.orcaslicer.com"; // Orca: This is a public key with no secret, used to identify the client application to the backend. From 4fab8d0b3955f9f96a263f4a0e55492089f6c62a Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sun, 30 Aug 2026 23:31:21 -0500 Subject: [PATCH 106/389] fix: adapt belt sub-layer group emission to upstream m_writer unique_ptr Upstream changed GCode::m_writer from a value to std::unique_ptr; the belt mixed_sub_layer_groups path still used value syntax and did not compile. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012ChxXYc6Dp46qAN9c2rQCe --- src/libslic3r/GCode.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 682a387884..a030b589c4 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -7054,17 +7054,17 @@ LayerResult GCode::process_layer( } if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer.set_object_start_str( + m_writer->set_object_start_str( std::string("; start printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M624 " + _encode_label_ids_to_base64({instance_to_print.label_object_id}) + "\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer.set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + + m_writer->set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { - m_writer.set_object_start_str(std::string("M486 S") + std::to_string(inst.unique_id) + "\n"); + m_writer->set_object_start_str(std::string("M486 S") + std::to_string(inst.unique_id) + "\n"); } } } @@ -7276,20 +7276,20 @@ LayerResult GCode::process_layer( } // --- Shared instance footer (mirrors Orca's main instance loop) --- - if (!m_writer.is_object_start_str_empty()) { - m_writer.set_object_start_str(""); + if (!m_writer->is_object_start_str_empty()) { + m_writer->set_object_start_str(""); } else if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer.set_object_end_str(std::string("; stop printing object, unique label id: ") + + m_writer->set_object_end_str(std::string("; stop printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M625\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer.set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + + m_writer->set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { - m_writer.set_object_end_str(std::string("M486 S-1\n")); + m_writer->set_object_end_str(std::string("M486 S-1\n")); } } } @@ -7302,7 +7302,7 @@ LayerResult GCode::process_layer( // wipe tower's add_object_end_labels may consume it into a local temp string and the // M625 would be lost for BBL printers. if (!layer_tools.mixed_sub_layer_groups.empty()) { - m_writer.add_object_end_labels(gcode); + m_writer->add_object_end_labels(gcode); m_nominal_z = print_z; m_need_change_layer_lift_z = true; } From e695da66df128069c376f6c2ffd4b70e7be49c72 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Tue, 8 Sep 2026 23:57:55 -0500 Subject: [PATCH 107/389] GCodeWriter: extract MachineKinematics, delete BeltGCodeWriter BeltGCodeWriter subclassed GCodeWriter and overrode seven methods, five of them by copying the base body and changing the transform. The base writer already carried an axis remap and already branched at each of its seven coordinate-emission decisions; the subclass did the same branching with a different transform, and the two copies had begun to drift. Replace the inheritance with a strategy object owned by GCodeWriter: CartesianKinematics to_machine = the existing apply_axis_remap; today's base behaviour, moved rather than changed. BeltKinematics to_machine = MachineFrameTransform o axis_remap o BeltBackTransform, plus a world_coordinates variant for the PA calibration generators. New: src/libslic3r/GCode/MachineKinematics.{hpp,cpp}, GCode/BeltKinematics.{hpp,cpp} Deleted: src/libslic3r/BeltGCodeWriter.{hpp,cpp} (341 lines) Points worth a reviewer's attention: * The predicate is must_emit_all_axes(), not couples_axes(). The base returns true for any non-identity remap, including pure permutations that do not physically couple axes, so the question is "must every axis word be emitted", not a statement about kinematics. * Every per-site word-omission branch is preserved. The base deliberately emits X/Y only, or Z only, or drops Z when its quantised value is unchanged. The strategy changes which transform applies, never whether words are omitted. * set_kinematics() replays the configured remap and build volume onto a newly installed strategy, because BeltGCode::init_belt_writer runs before GCode.cpp calls set_axis_remap/set_build_volume_max. * uses_pointwise_travel_speed() preserves a pre-existing divergence rather than introducing one: the base travel_to_xyz emits the raw configured travel speed in its final branch, ignoring the first-layer value computed at the top, whereas the belt path used the first-layer-aware value throughout. Both are kept. Unifying them changes feedrates and belongs in its own change. * The [BELT-DEBUG] block is deleted; it rate-limited itself with a function-local static thread_local in the hot emission path, and this is the commit that would otherwise have moved it into shared code. This commit is intended to preserve existing export output. That is reviewed by construction -- each emission site keeps its own omission branch and each policy divergence is preserved -- and is NOT verified against a G-code diff corpus. Building that corpus is the outstanding work here. Two API-equivalence exceptions, neither reachable by any caller today: * Belt kinematics with no plane pointer installed, m_is_first_layer true, initial and normal travel speeds differing, travel_to_xyz() reaching its final branch: the old belt writer selected the initial-layer speed, the new writer selects the normal travel speed. The pending-lift and XY-only branches keep their previous selection. * Belt kinematics installed without set_force_normal_lift(true) and a non-normal lift requested: the old belt writer forced a normal lift, the new writer can take the slope branch. The PA-pattern generator reaches the writer through explicit travel_to_z() / travel_to_xy(), not travel_to_xyz() or the lazy/eager lift paths, and normal belt export installs both the plane and the forced-normal-lift policy, so neither exception changes output produced today. They are recorded because a future caller could reach them. tests/fff_print/test_gcodewriter.cpp was also not compiling before this branch: it called writer.to_machine_coords(), a method that existed only on BeltGCodeWriter. It never surfaced because the build targets OrcaSlicer, not all, and BUILD_TESTS defaults to OFF, so that translation unit was outside every compile path. Fixed here; the existing 30-degree coordinate assertions are kept verbatim as the best available regression net. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011jgzj1sf53KMLPweZ8yeUQ --- src/libslic3r/BeltGCode.cpp | 12 +- src/libslic3r/BeltGCode.hpp | 2 +- src/libslic3r/BeltGCodeWriter.cpp | 277 ------------------ src/libslic3r/BeltGCodeWriter.hpp | 64 ---- src/libslic3r/CMakeLists.txt | 6 +- src/libslic3r/FirstLayerPlane.cpp | 2 +- src/libslic3r/GCode.cpp | 19 +- src/libslic3r/GCode.hpp | 2 +- src/libslic3r/GCode/BeltBackTransform.hpp | 2 +- src/libslic3r/GCode/BeltKinematics.cpp | 40 +++ src/libslic3r/GCode/BeltKinematics.hpp | 66 +++++ src/libslic3r/GCode/GCodeProcessor.cpp | 4 +- src/libslic3r/GCode/MachineFrameTransform.hpp | 2 +- src/libslic3r/GCode/MachineKinematics.cpp | 47 +++ src/libslic3r/GCode/MachineKinematics.hpp | 95 ++++++ src/libslic3r/GCodeWriter.cpp | 68 +++-- src/libslic3r/GCodeWriter.hpp | 60 +++- src/libslic3r/calib.cpp | 12 +- src/libslic3r/calib.hpp | 2 +- src/slic3r/GUI/GCodeViewer.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 2 +- src/slic3r/GUI/calib_dlg.cpp | 2 +- tests/fff_print/test_gcodewriter.cpp | 16 +- 23 files changed, 398 insertions(+), 406 deletions(-) delete mode 100644 src/libslic3r/BeltGCodeWriter.cpp delete mode 100644 src/libslic3r/BeltGCodeWriter.hpp create mode 100644 src/libslic3r/GCode/BeltKinematics.cpp create mode 100644 src/libslic3r/GCode/BeltKinematics.hpp create mode 100644 src/libslic3r/GCode/MachineKinematics.cpp create mode 100644 src/libslic3r/GCode/MachineKinematics.hpp diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index 3ba2f79e55..f26c7f87ff 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -1,5 +1,6 @@ #include "BeltGCode.hpp" -#include "BeltGCodeWriter.hpp" +#include "GCodeWriter.hpp" +#include "GCode/BeltKinematics.hpp" #include "BeltTransform.hpp" #include "Print.hpp" @@ -10,11 +11,12 @@ void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) if (!print.config().belt_printer.value) return; - auto belt_writer = std::make_unique(); + auto belt_writer = std::make_unique(); belt_writer->set_is_bbl_machine(is_bbl_printers); - // Axis remap and build volume max are set by base GCode after init_belt_writer returns. - belt_writer->set_belt_back_transform(print.config()); - belt_writer->set_machine_frame_transform(print.config()); + // Axis remap and build volume max are set by base GCode after init_belt_writer + // returns; set_kinematics() replays them, so install order does not matter. + install_belt_kinematics(*belt_writer, print.config()); + belt_writer->set_force_normal_lift(true); m_writer = std::move(belt_writer); } diff --git a/src/libslic3r/BeltGCode.hpp b/src/libslic3r/BeltGCode.hpp index 2a3718b49f..f52c62c28f 100644 --- a/src/libslic3r/BeltGCode.hpp +++ b/src/libslic3r/BeltGCode.hpp @@ -7,7 +7,7 @@ namespace Slic3r { // Belt-printer-specific GCode export. // // Inherits from GCode and overrides virtual hooks to: -// - Create a BeltGCodeWriter instead of a plain GCodeWriter +// - Install a BeltKinematics on the GCodeWriter // - Write belt configuration to the G-code header // - Adjust the origin for global pre-slice transforms when switching instances // - Disable arc fitting (G2/G3 not supported on belt printers) diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp deleted file mode 100644 index 4824d76f69..0000000000 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ /dev/null @@ -1,277 +0,0 @@ -#include "BeltGCodeWriter.hpp" -#include "FirstLayerPlane.hpp" -#include "Geometry.hpp" -#include - -namespace Slic3r { - -namespace { - -// Decide whether a particular destination point gets first-layer treatment. -// When the plane evaluator is active, distance from the plane wins; otherwise -// fall back to the layer-coarse m_is_first_layer flag set by the caller. -inline bool belt_point_on_first_layer( - const FirstLayerPlane *plane, - double first_layer_thickness_mm, - bool layer_first_flag, - const Vec3d &point_slicing_mm) -{ - if (plane && plane->is_active()) - return plane->is_first_layer(point_slicing_mm, first_layer_thickness_mm); - return layer_first_flag; -} - -} // namespace - -// ---- Belt configuration --------------------------------------------------- - -void BeltGCodeWriter::set_belt_back_transform(const PrintConfig &config) -{ - m_belt_back_transform.init_from_config(config); -} - -void BeltGCodeWriter::set_machine_frame_transform(const PrintConfig &config) -{ - m_machine_frame_transform.init_from_config(config); -} - -Vec3d BeltGCodeWriter::to_machine_coords(const Vec3d &pos) const -{ - // Step 1+2: To Cartesian (back_transform + axis_remap). - // In world-coordinates mode (PA line / PA pattern calibration) the input - // already describes a point relative to the belt surface, so the - // slicer->world back-transform is skipped and only the machine kinematics - // (axis remap + frame shear/scale) are applied. - Vec3d after_back = m_world_coordinates ? pos : m_belt_back_transform.apply(pos); - Vec3d result = apply_axis_remap(after_back); - Vec3d after_remap = result; - // Step 3: Machine-frame transform (belt frame tilt) applied LAST so it acts - // as a global linear transform on the placed coords. - Vec3d final = m_machine_frame_transform.apply(result); - - // [BELT-DEBUG] One-shot log per layer transition (i.e. when the input Z - // crosses an integer mm boundary) to keep the log volume manageable while - // still capturing one sample per ~5 layers. Shows the full pipeline so - // Case A vs Case B can be compared step-by-step. - static thread_local int s_last_logged_z = std::numeric_limits::min(); - int z_bucket = static_cast(std::floor(pos.z() * 5.0)); // every 0.2mm - if (z_bucket != s_last_logged_z) { - s_last_logged_z = z_bucket; - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] to_machine_coords" - << " slicer_in=(" << pos.x() << "," << pos.y() << "," << pos.z() << ")" - << " after_back=(" << after_back.x() << "," << after_back.y() << "," << after_back.z() << ")" - << " after_remap=(" << after_remap.x() << "," << after_remap.y() << "," << after_remap.z() << ")" - << " final=(" << final.x() << "," << final.y() << "," << final.z() << ")" - << " mft_active=" << m_machine_frame_transform.is_active() - << " back_active=" << m_belt_back_transform.is_active(); - } - return final; -} - -// ---- Overridden movement methods ------------------------------------------ - -std::string BeltGCodeWriter::travel_to_xy(const Vec2d &point, const std::string &comment) -{ - m_pos(0) = point(0); - m_pos(1) = point(1); - - this->set_current_position_clear(true); - Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; - - // Belt printer: transform to machine coordinates (XY travel also needs Z due to YZ rotation) - Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); - - GCodeG1Formatter w; - w.emit_xyz(machine); - const bool first_layer_for_point = belt_point_on_first_layer( - m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, - Vec3d(point.x(), point.y(), m_pos.z())); - auto speed = first_layer_for_point - ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) - : this->config.travel_speed.get_at(m_cached_extruder_idx); - w.emit_f(speed * 60.0); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - return w.string(); -} - -std::string BeltGCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) -{ - // Belt printer: force NormalLift since SpiralLift and SlopeLift compute - // slope angles that don't account for the YZ coordinate rotation. - return GCodeWriter::lazy_lift(LiftType::NormalLift, spiral_vase); -} - -std::string BeltGCodeWriter::eager_lift(const LiftType type) -{ - // Belt printer: force NormalLift (SpiralLift/SlopeLift don't account for YZ rotation). - return GCodeWriter::eager_lift(LiftType::NormalLift); -} - -std::string BeltGCodeWriter::_travel_to_z(double z, const std::string &comment) -{ - m_pos(2) = z; - - double speed = this->config.travel_speed_z.get_at(m_cached_extruder_idx); - if (speed == 0.) { - const bool first_layer_for_point = belt_point_on_first_layer( - m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, - Vec3d(m_pos.x(), m_pos.y(), z)); - speed = first_layer_for_point ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) - : this->config.travel_speed.get_at(m_cached_extruder_idx); - } - - // Belt printer: a Z-only move in slicing frame needs to emit both Y and Z in machine coords. - Vec3d machine = to_machine_coords(Vec3d(m_pos.x() - m_x_offset, m_pos.y() - m_y_offset, z)); - - GCodeG1Formatter w; - w.emit_xyz(machine); - w.emit_f(speed * 60.0); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - return w.string(); -} - -std::string BeltGCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std::string &comment, bool force_no_extrusion) -{ - m_pos(0) = point(0); - m_pos(1) = point(1); - if (std::abs(dE) <= std::numeric_limits::epsilon()) - force_no_extrusion = true; - - if (!force_no_extrusion) - filament()->extrude(dE); - - Vec2d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset }; - - // Belt printer: transform and emit XYZ (Y and Z are coupled) - Vec3d machine = to_machine_coords(Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); - - GCodeG1Formatter w; - w.emit_xyz(machine); - if (!force_no_extrusion) - w.emit_e(filament()->E()); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - return w.string(); -} - -std::string BeltGCodeWriter::extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment, bool force_no_extrusion) -{ - m_pos = point; - m_lifted = 0; - if (!force_no_extrusion) - filament()->extrude(dE); - - Vec3d point_on_plate = { point(0) - m_x_offset, point(1) - m_y_offset, point(2) }; - point_on_plate = to_machine_coords(point_on_plate); - - GCodeG1Formatter w; - w.emit_xyz(point_on_plate); - if (!force_no_extrusion) - w.emit_e(filament()->E()); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - return w.string(); -} - -std::string BeltGCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &comment, bool force_z) -{ - // Belt-specific override of travel_to_xyz. - // Key differences from base: - // 1. All coordinates go through to_machine_coords() - // 2. Always emit full XYZ (can't split XY and Z due to coupling) - // 3. Lift type forced to NormalLift (handled by lazy_lift/eager_lift overrides) - - Vec3d dest_point = point; - const bool first_layer_for_point = belt_point_on_first_layer( - m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, point); - auto travel_speed = - first_layer_for_point ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) - : this->config.travel_speed.get_at(m_cached_extruder_idx); - - // Handle pending z_hop - if (std::abs(m_to_lift) > EPSILON) { - assert(std::abs(m_lifted) < EPSILON); - if ((!this->is_current_position_clear() || m_pos != dest_point) && - m_to_lift + m_pos(2) > point(2)) { - m_lifted = m_to_lift + m_pos(2) - point(2); - dest_point(2) = m_to_lift + m_pos(2); - } - m_to_lift = 0.; - - std::string slop_move; - Vec3d source = { m_pos(0) - m_x_offset, m_pos(1) - m_y_offset, m_pos(2) }; - Vec3d target = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; - Vec3d delta = target - source; - Vec2d delta_no_z = { delta(0), delta(1) }; - - if (delta(2) > 0 && delta_no_z.norm() != 0.0f) { - // Belt: SpiralLift and SlopeLift are disabled (lazy_lift forces NormalLift), - // but handle NormalLift and fallthrough. - if (m_to_lift_type == LiftType::SlopeLift && - this->is_current_position_clear() && - atan2(delta(2), delta_no_z.norm()) < this->filament()->travel_slope()) { - Vec2d temp = delta_no_z.normalized() * delta(2) / tan(this->filament()->travel_slope()); - Vec3d slope_top_point = Vec3d(temp(0), temp(1), delta(2)) + source; - slope_top_point = to_machine_coords(slope_top_point); - GCodeG1Formatter w0; - w0.emit_xyz(slope_top_point); - w0.emit_f(travel_speed * 60.0); - w0.emit_comment(GCodeWriter::full_gcode_comment, comment); - slop_move = w0.string(); - } - else if (m_to_lift_type == LiftType::NormalLift && this->is_current_position_clear()) { - // Only lift-in-place when the current position is known. On a normal - // printer _travel_to_z emits a Z-only move, but in belt mode Z is coupled - // to Y/X, so _travel_to_z re-emits the current m_pos through the belt - // shear. At print start (and after custom gcode) m_pos.xy is still the - // uninitialised origin (0,0), which shears into a bogus machine point - // (e.g. X=bed_max, Y=layer_z) far up the gantry. Skipping the separate - // lift here is safe: there is nothing to lift over yet, and the - // xy_z_move below travels straight to the destination with full XYZ, - // establishing the correct position. This mirrors the SlopeLift branch - // above, which already guards on is_current_position_clear(). - slop_move = _travel_to_z(target.z(), "normal lift Z"); - } - } - - std::string xy_z_move; - { - Vec3d emit_target = to_machine_coords(target); - GCodeG1Formatter w0; - // Belt mode: always emit full XYZ since Y and Z are coupled - w0.emit_xyz(emit_target); - w0.emit_f(travel_speed * 60.0); - w0.emit_comment(GCodeWriter::full_gcode_comment, comment); - xy_z_move = w0.string(); - } - m_pos = dest_point; - this->set_current_position_clear(true); - return slop_move + xy_z_move; - } - else if (!force_z && !this->will_move_z(point(2))) { - double nominal_z = m_pos(2) - m_lifted; - m_lifted -= (point(2) - nominal_z); - if (std::abs(m_lifted) < EPSILON) - m_lifted = 0.; - this->set_current_position_clear(true); - return this->travel_to_xy(to_2d(point)); - } - else { - m_lifted = 0; - } - - Vec3d point_on_plate = { dest_point(0) - m_x_offset, dest_point(1) - m_y_offset, dest_point(2) }; - point_on_plate = to_machine_coords(point_on_plate); - - // Belt mode: always emit full XYZ - GCodeG1Formatter w; - w.emit_xyz(point_on_plate); - // Use the first-layer-aware travel_speed computed at the top of this function, - // not the raw config travel_speed, so initial-layer travels are correctly slowed. - w.emit_f(travel_speed * 60.0); - w.emit_comment(GCodeWriter::full_gcode_comment, comment); - - m_pos = dest_point; - this->set_current_position_clear(true); - return w.string(); -} - -} // namespace Slic3r diff --git a/src/libslic3r/BeltGCodeWriter.hpp b/src/libslic3r/BeltGCodeWriter.hpp deleted file mode 100644 index ff7428d062..0000000000 --- a/src/libslic3r/BeltGCodeWriter.hpp +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once - -#include "GCodeWriter.hpp" -#include "GCode/BeltBackTransform.hpp" -#include "GCode/MachineFrameTransform.hpp" - -namespace Slic3r { - -class FirstLayerPlane; - -// Belt-printer-specific GCode writer. -// -// Inherits from GCodeWriter and overrides movement methods to apply -// coordinate transformation (back-transform, axis remap, machine-frame -// transform) and emit coupled XYZ moves (Y and Z are coupled due to belt tilt). -class BeltGCodeWriter : public GCodeWriter -{ -public: - BeltGCodeWriter() : GCodeWriter() {} - - // Belt configuration (axis remap is inherited from GCodeWriter) - void set_belt_back_transform(const PrintConfig &config); - void set_machine_frame_transform(const PrintConfig &config); - Vec3d to_machine_coords(const Vec3d &pos) const; - - // World-coordinates mode: incoming coordinates are treated as points - // relative to the physical belt surface (X across, Y along the belt, - // Z height above it) instead of slicing-frame coordinates — the - // slicer->world back-transform is skipped. Used by the PA line / PA - // pattern calibration generators, whose logical bed coordinates describe - // first-layer drawings on the build surface. - void set_world_coordinates(bool enable) { m_world_coordinates = enable; } - - // First-layer plane: when set to a non-null active evaluator, travel - // speed selection consults the plane per-move and uses - // initial_layer_travel_speed for points within first_layer_height_mm - // of the plane (regardless of slicing layer index). - void set_first_layer_plane(const FirstLayerPlane *plane, - double first_layer_height_mm) { - m_first_layer_plane = plane; - m_first_layer_thickness_mm = first_layer_height_mm; - } - - // Overridden movement methods - std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string()) override; - std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false) override; - std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false) override; - std::string extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false) override; - std::string lazy_lift(LiftType lift_type = LiftType::NormalLift, bool spiral_vase = false) override; - std::string eager_lift(const LiftType type) override; - -protected: - std::string _travel_to_z(double z, const std::string &comment) override; - -private: - BeltBackTransform m_belt_back_transform; - MachineFrameTransform m_machine_frame_transform; - bool m_world_coordinates = false; - // Borrowed pointer; lifetime owned by GCode. null = inactive. - const FirstLayerPlane *m_first_layer_plane = nullptr; - double m_first_layer_thickness_mm = 0.; -}; - -} // namespace Slic3r diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index be34f6ba9e..1787c1adef 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -84,8 +84,6 @@ set(lisbslic3r_sources BeltBrim.hpp BeltGCode.cpp BeltGCode.hpp - BeltGCodeWriter.cpp - BeltGCodeWriter.hpp BeltPurge.cpp BeltSliceStrategy.cpp BeltSliceStrategy.hpp @@ -243,6 +241,10 @@ set(lisbslic3r_sources GCode/BeltBackTransform.hpp GCode/MachineFrameTransform.cpp GCode/MachineFrameTransform.hpp + GCode/BeltKinematics.cpp + GCode/BeltKinematics.hpp + GCode/MachineKinematics.cpp + GCode/MachineKinematics.hpp GCode/ConflictChecker.cpp GCode/ConflictChecker.hpp GCode/CoolingBuffer.cpp diff --git a/src/libslic3r/FirstLayerPlane.cpp b/src/libslic3r/FirstLayerPlane.cpp index 6a4feba886..f668ea774e 100644 --- a/src/libslic3r/FirstLayerPlane.cpp +++ b/src/libslic3r/FirstLayerPlane.cpp @@ -56,7 +56,7 @@ MachineZAffine compute_machine_z_affine(const PrintConfig &config) out.constant = trans; if (config.gcode_back_transform.value && config.belt_printer.value) { - // BeltGCodeWriter applies F^-1 before R when back-transform is on. + // BeltKinematics applies F^-1 before R when back-transform is on. // So machine_Z(slicing) = r_row · (F^-1 · slicing) + trans // = (r_row^T · F^-1) · slicing + trans // We need to compose r_row with F^-1 from the LEFT (treating r_row as diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index f95f59dceb..32976fad76 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2986,8 +2986,11 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // circuit to the legacy Layer::id() == 0 path so g-code stays bit- // identical to the pre-feature behavior. m_first_layer_plane = std::make_unique(print.config()); - if (auto *belt_writer = dynamic_cast(m_writer.get())) { - belt_writer->set_first_layer_plane( + // Belt writers only: the plane also switches travel-speed selection to be + // per-point (see GCodeWriter::uses_pointwise_travel_speed()), which must not + // change for non-belt printers. + if (print.config().belt_printer.value) { + m_writer->set_first_layer_plane( m_first_layer_plane.get(), print.config().initial_layer_print_height.value); } @@ -3888,12 +3891,12 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // ORCA-Belt: the PA line test draws directly on the build surface in // logical bed coordinates — on a belt printer that surface is the // belt plane, not the slicing plane. - BeltGCodeWriter* belt_writer = dynamic_cast(m_writer.get()); - if (belt_writer != nullptr) - belt_writer->set_world_coordinates(true); + const bool belt_world_coords = print.config().belt_printer.value; + if (belt_world_coords) + install_belt_kinematics(*m_writer, print.config(), /*world_coordinates=*/true); gcode += pa_test.generate_test(params.start, params.step, std::llround(std::ceil((params.end - params.start) / params.step)) + 1); - if (belt_writer != nullptr) - belt_writer->set_world_coordinates(false); + if (belt_world_coords) + install_belt_kinematics(*m_writer, print.config(), /*world_coordinates=*/false); file.write(gcode); } else { @@ -8400,7 +8403,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // mesh transform is now rotation ∘ pre-remap, both orthogonal, so |det(T)| // is always 1 and this is currently a no-op; it is retained as a guard in // case a non-orthogonal mesh transform is ever reintroduced. (Machine-frame - // shear/scale acts on the g-code in BeltGCodeWriter, not here.) + // shear/scale acts on the g-code in BeltKinematics, not here.) if (m_config.belt_printer.value) { double det = std::abs(BeltTransformPipeline::build_forward_transform(m_config).linear().determinant()); if (det > EPSILON) diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 17a7ce4608..56496f1b4e 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -4,7 +4,7 @@ #include "libslic3r.h" #include "ExPolygon.hpp" #include "GCodeWriter.hpp" -#include "BeltGCodeWriter.hpp" +#include "GCode/BeltKinematics.hpp" #include "FirstLayerPlane.hpp" #include "Layer.hpp" #include "Point.hpp" diff --git a/src/libslic3r/GCode/BeltBackTransform.hpp b/src/libslic3r/GCode/BeltBackTransform.hpp index b98770c688..878ae12b5a 100644 --- a/src/libslic3r/GCode/BeltBackTransform.hpp +++ b/src/libslic3r/GCode/BeltBackTransform.hpp @@ -13,7 +13,7 @@ namespace Slic3r { // machine's real coordinate space. // // Initialized once from PrintConfig, then applied per-point in -// GCodeWriter::to_machine_coords() before axis remapping. +// BeltKinematics::to_machine() before axis remapping. // // Active when gcode_back_transform is true AND at least one of: // - a shear axis has global mode enabled, or diff --git a/src/libslic3r/GCode/BeltKinematics.cpp b/src/libslic3r/GCode/BeltKinematics.cpp new file mode 100644 index 0000000000..155e18d32d --- /dev/null +++ b/src/libslic3r/GCode/BeltKinematics.cpp @@ -0,0 +1,40 @@ +#include "BeltKinematics.hpp" +#include "../BeltTransform.hpp" +#include "../PrintConfig.hpp" +#include "../GCodeWriter.hpp" + +namespace Slic3r { + +BeltKinematics::BeltKinematics(const PrintConfig &config, bool world_coordinates) + : m_world_coordinates(world_coordinates) +{ + m_back_active = m_back_transform.init_from_config(config); + m_machine_frame.init_from_config(config); + if (m_back_active) + // BeltBackTransform stores the inverse of this; keep the forward so + // to_logical() can reverse the whole chain. + m_back_forward = BeltTransformPipeline::build_forward_transform(config); +} + +Vec3d BeltKinematics::to_machine(const Vec3d &p) const +{ + const Vec3d after_back = m_world_coordinates ? p : m_back_transform.apply(p); + const Vec3d after_remap = this->apply_axis_remap(after_back); + return m_machine_frame.apply(after_remap); +} + +Vec3d BeltKinematics::to_logical(const Vec3d &machine) const +{ + const Vec3d before_frame = m_machine_frame.apply_inverse(machine); + const Vec3d before_remap = this->apply_axis_remap_inverse(before_frame); + if (m_world_coordinates || ! m_back_active) + return before_remap; + return m_back_forward * before_remap; +} + +void install_belt_kinematics(GCodeWriter &writer, const PrintConfig &config, bool world_coordinates) +{ + writer.set_kinematics(std::make_unique(config, world_coordinates)); +} + +} // namespace Slic3r diff --git a/src/libslic3r/GCode/BeltKinematics.hpp b/src/libslic3r/GCode/BeltKinematics.hpp new file mode 100644 index 0000000000..a57f18dcdd --- /dev/null +++ b/src/libslic3r/GCode/BeltKinematics.hpp @@ -0,0 +1,66 @@ +#ifndef slic3r_BeltKinematics_hpp_ +#define slic3r_BeltKinematics_hpp_ + +#include "MachineKinematics.hpp" +#include "BeltBackTransform.hpp" +#include "MachineFrameTransform.hpp" + +namespace Slic3r { + +class PrintConfig; +class GCodeWriter; + +// Belt-printer machine frame. +// +// Forward order, as applied per emitted point: +// machine = MachineFrameTransform( axis_remap( BeltBackTransform( logical ) ) ) +// +// i.e. the slicer->world back-transform runs FIRST and the machine-frame +// shear/scale LAST, so the latter acts as a global linear transform on the +// already-placed coordinates. +// +// world_coordinates mode (the PA line / PA pattern calibration generators) +// treats the incoming point as already relative to the belt surface -- X across, +// Y along the belt, Z above it -- and therefore skips the back-transform while +// keeping the remap and the machine frame. It is a different coordinate map, not +// a writer mode, which is why it is fixed at construction. +class BeltKinematics : public CartesianKinematics +{ +public: + explicit BeltKinematics(const PrintConfig &config, bool world_coordinates = false); + + Vec3d to_machine(const Vec3d &p) const override; + Vec3d to_logical(const Vec3d &machine) const override; + // Machine -> build-volume frame. Only the machine-frame shear/scale is undone, + // matching what GCodeProcessor's bounds validation wants. This is deliberately + // NOT to_logical(). + Vec3d to_build_volume(const Vec3d &machine) const override + { return m_machine_frame.apply_inverse(machine); } + + // A belt writer has always emitted full XYZ on every move, whether or not any + // individual stage reports itself active. Making this conditional would change + // emitted G-code for an identity-transform belt configuration. + bool must_emit_all_axes() const override { return true; } + bool suppress_lift_at_unknown_position() const override { return true; } + + bool world_coordinates() const { return m_world_coordinates; } + +private: + BeltBackTransform m_back_transform; + MachineFrameTransform m_machine_frame; + // Forward of what m_back_transform inverts, kept so to_logical() can undo it. + Transform3d m_back_forward { Transform3d::Identity() }; + bool m_back_active { false }; + bool m_world_coordinates { false }; +}; + +// Install a belt machine frame on any GCodeWriter. Any axis remap and build +// volume already configured on the writer are carried over, so this may be +// called before or after those setters. Re-calling it with a different +// world_coordinates value swaps the map (used around the PA line generator). +void install_belt_kinematics(GCodeWriter &writer, const PrintConfig &config, + bool world_coordinates = false); + +} // namespace Slic3r + +#endif // slic3r_BeltKinematics_hpp_ diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index ca41547ff3..2112cac8fd 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2774,7 +2774,7 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const int }; // Belt-printer post-gcode shear/scale/post_remap is applied as the final - // step of BeltGCodeWriter::to_machine_coords, so MoveVertex.position is + // step of BeltKinematics::to_machine, so MoveVertex.position is // in the printer's machine frame. Undo it here so XY area and Z height // checks operate in the build-volume frame that printable_area / // printable_height are defined in. For non-belt printers @@ -7111,7 +7111,7 @@ void GCodeProcessor::store_move_vertex(EMoveType type, EMovePathType path_type, // During the start G-code "prepare" stage the toolhead Z is not yet a real // print height on a normal printer, so it is pinned to the first-layer height // to keep the preview tidy. Belt printers are the exception: there the Z is - // written explicitly by BeltGCodeWriter and the designed-view back-transform + // written explicitly by the belt kinematics and the designed-view back-transform // couples machine Z into the rendered model Y (the belt tilt mixes the height // and belt-feed axes). Overriding Z therefore back-transforms the last // prepare-stage move (the unretract before the first extrusion) to model diff --git a/src/libslic3r/GCode/MachineFrameTransform.hpp b/src/libslic3r/GCode/MachineFrameTransform.hpp index 83519bdbe4..cdae28ca1a 100644 --- a/src/libslic3r/GCode/MachineFrameTransform.hpp +++ b/src/libslic3r/GCode/MachineFrameTransform.hpp @@ -9,7 +9,7 @@ namespace Slic3r { // Post-stage machine-frame transform for belt printers. // -// Applied in BeltGCodeWriter::to_machine_coords AFTER the back-transform and +// Applied in BeltKinematics::to_machine AFTER the back-transform and // the gcode_remap_* axis remap. Maps Cartesian (axis-permuted) G-code // coordinates into the printer's physical machine frame. // diff --git a/src/libslic3r/GCode/MachineKinematics.cpp b/src/libslic3r/GCode/MachineKinematics.cpp new file mode 100644 index 0000000000..05f5375aef --- /dev/null +++ b/src/libslic3r/GCode/MachineKinematics.cpp @@ -0,0 +1,47 @@ +#include "MachineKinematics.hpp" + +namespace Slic3r { + +// Moved verbatim from GCodeWriter::apply_axis_remap(). +Vec3d CartesianKinematics::apply_axis_remap(const Vec3d &pos) const +{ + if (!has_axis_remap()) + return pos; + auto remap = [this, &pos](int r) -> double { + int axis = r % 3; + if (r < 3) return pos[axis]; + if (r < 6) return -pos[axis]; + return m_build_vol_max[axis] - pos[axis]; + }; + return { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; +} + +// Inverse of the above. Output axis i is fed by source axis (r_i % 3); walking +// the three outputs therefore fills every source component exactly once, so long +// as the remap is a permutation (which set_axis_remap callers guarantee). +Vec3d CartesianKinematics::apply_axis_remap_inverse(const Vec3d &machine) const +{ + if (!has_axis_remap()) + return machine; + Vec3d out = Vec3d::Zero(); + const int r[3] = { m_remap_x, m_remap_y, m_remap_z }; + for (int i = 0; i < 3; ++i) { + const int axis = r[i] % 3; + if (r[i] < 3) out[axis] = machine[i]; + else if (r[i] < 6) out[axis] = -machine[i]; + else out[axis] = m_build_vol_max[axis] - machine[i]; + } + return out; +} + +Vec3d CartesianKinematics::to_machine(const Vec3d &p) const +{ + return this->apply_axis_remap(p); +} + +Vec3d CartesianKinematics::to_logical(const Vec3d &machine) const +{ + return this->apply_axis_remap_inverse(machine); +} + +} // namespace Slic3r diff --git a/src/libslic3r/GCode/MachineKinematics.hpp b/src/libslic3r/GCode/MachineKinematics.hpp new file mode 100644 index 0000000000..c3e381d851 --- /dev/null +++ b/src/libslic3r/GCode/MachineKinematics.hpp @@ -0,0 +1,95 @@ +#ifndef slic3r_MachineKinematics_hpp_ +#define slic3r_MachineKinematics_hpp_ + +#include "../Point.hpp" + +namespace Slic3r { + +// The frame contract for emitted movement. +// +// GCodeWriter produces points in the *logical placed* frame: plate offsets have +// already been subtracted, but no machine-specific mapping has been applied. +// A MachineKinematics turns that into the coordinates actually written to +// G-code, and answers the two structural questions the writer needs in order to +// decide which axis words it may omit. +// +// This is a seam for writer-generated movement only. Start/end/custom G-code, +// classic wipe-tower output and GCodeWriter::extrude_arc_to_xy() do NOT pass +// through it; see doc in 09-orca-machinekinematics-split-plan.md section 6. +class MachineKinematics +{ +public: + virtual ~MachineKinematics() = default; + + // Logical placed point -> emitted machine point. + virtual Vec3d to_machine(const Vec3d &p) const = 0; + + // Inverse of to_machine(), back to the logical placed frame. Intended for + // consumers that must reconstruct model coordinates from emitted G-code + // (the G-code viewer's upright preview). + virtual Vec3d to_logical(const Vec3d &machine) const = 0; + + // Machine point -> build-volume frame, for bounds validation only. This is + // deliberately NOT to_logical(): the build-volume check wants the physical + // frame the printable area is expressed in, not the model frame. Keeping + // them separate stops the two contracts from being confused. + virtual Vec3d to_build_volume(const Vec3d &machine) const = 0; + + // True when a move must emit X, Y and Z because omitting a word would be + // wrong under this mapping. Deliberately not called "couples_axes": a pure + // axis permutation forces full emission without physically coupling axes. + virtual bool must_emit_all_axes() const = 0; + + // True when a separate in-place lift must be suppressed while the current + // position is unknown, because _travel_to_z() re-emits the logical X/Y + // through this mapping and an uninitialised position would map to a bogus + // machine point. + virtual bool suppress_lift_at_unknown_position() const = 0; + + // Configuration. GCodeWriter forwards its setters here so that the state + // lives with the strategy and a strategy installed before the setters run + // still receives it. + virtual void set_axis_remap(int rx, int ry, int rz) = 0; + virtual void set_build_volume_max(const Vec3d &max) = 0; +}; + +// Axis remap only -- the historical GCodeWriter behaviour, moved verbatim. +// +// The remap encodes, per output axis, which source axis feeds it and how: +// r < 3 : source axis r, unchanged +// r < 6 : source axis r-3, negated +// else : source axis r-6, reversed within the build volume +class CartesianKinematics : public MachineKinematics +{ +public: + Vec3d to_machine(const Vec3d &p) const override; + Vec3d to_logical(const Vec3d &machine) const override; + Vec3d to_build_volume(const Vec3d &machine) const override { return machine; } + + bool must_emit_all_axes() const override { return this->has_axis_remap(); } + // The base writer has never suppressed the lift, not even under a remap that + // makes _travel_to_z re-emit X/Y. That is arguably a latent bug, but fixing + // it here would change emitted G-code, so today's behaviour is preserved and + // the divergence from BeltKinematics is deliberate. + bool suppress_lift_at_unknown_position() const override { return false; } + + void set_axis_remap(int rx, int ry, int rz) override + { m_remap_x = rx; m_remap_y = ry; m_remap_z = rz; } + void set_build_volume_max(const Vec3d &max) override { m_build_vol_max = max; } + + bool has_axis_remap() const + { return m_remap_x != 0 || m_remap_y != 1 || m_remap_z != 2; } + +protected: + Vec3d apply_axis_remap(const Vec3d &pos) const; + Vec3d apply_axis_remap_inverse(const Vec3d &pos) const; + + int m_remap_x { 0 }; + int m_remap_y { 1 }; + int m_remap_z { 2 }; + Vec3d m_build_vol_max { Vec3d::Zero() }; +}; + +} // namespace Slic3r + +#endif // slic3r_MachineKinematics_hpp_ diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 67dd6cf138..be8f6607de 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -1,4 +1,5 @@ #include "GCodeWriter.hpp" +#include "FirstLayerPlane.hpp" #include "CustomGCode.hpp" #include "Geometry.hpp" #include "I18N.hpp" @@ -24,34 +25,46 @@ namespace Slic3r { bool GCodeWriter::full_gcode_comment = true; +bool GCodeWriter::point_on_first_layer(const Vec3d &point_logical) const +{ + if (m_first_layer_plane && m_first_layer_plane->is_active()) + return m_first_layer_plane->is_first_layer(point_logical, m_first_layer_thickness_mm); + return m_is_first_layer; +} + void GCodeWriter::set_axis_remap(int rx, int ry, int rz) { m_remap_x = rx; m_remap_y = ry; m_remap_z = rz; + m_kinematics->set_axis_remap(rx, ry, rz); } void GCodeWriter::set_build_volume_max(const Vec3d &max) { m_build_vol_max = max; + m_kinematics->set_build_volume_max(max); } +void GCodeWriter::set_kinematics(std::unique_ptr kinematics) +{ + assert(kinematics); + m_kinematics = std::move(kinematics); + // Replay whatever was configured on the previous strategy so callers may + // install the kinematics before or after set_axis_remap/set_build_volume_max. + m_kinematics->set_axis_remap(m_remap_x, m_remap_y, m_remap_z); + m_kinematics->set_build_volume_max(m_build_vol_max); +} + +// Kept as the writer-facing name for "this move must emit every axis word". bool GCodeWriter::has_axis_remap() const { - return m_remap_x != 0 || m_remap_y != 1 || m_remap_z != 2; + return m_kinematics->must_emit_all_axes(); } Vec3d GCodeWriter::apply_axis_remap(const Vec3d &pos) const { - if (!has_axis_remap()) - return pos; - auto remap = [this, &pos](int r) -> double { - int axis = r % 3; - if (r < 3) return pos[axis]; - if (r < 6) return -pos[axis]; - return m_build_vol_max[axis] - pos[axis]; - }; - return { remap(m_remap_x), remap(m_remap_y), remap(m_remap_z) }; + return m_kinematics->to_machine(pos); } bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor) @@ -795,7 +808,7 @@ std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &com } else { w.emit_xy(point_on_plate); } - auto speed = m_is_first_layer + auto speed = this->point_on_first_layer(Vec3d(point.x(), point.y(), m_pos.z())) ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) : this->config.travel_speed.get_at(m_cached_extruder_idx); w.emit_f(speed * 60.0); //BBS @@ -808,6 +821,8 @@ it will not perform subsequent lifts, even if Z was raised manually (i.e. with travel_to_z()) and thus _lifted was reduced. */ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) { + if (m_force_normal_lift) + lift_type = LiftType::NormalLift; // check whether the above/below conditions are met double target_lift = 0; { @@ -836,7 +851,7 @@ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) // BBS: immediately execute an undelayed lift move with a spiral lift pattern // designed specifically for subsequent gcode injection (e.g. timelapse) std::string GCodeWriter::eager_lift(const LiftType type) { - const LiftType effective_type = type; + const LiftType effective_type = m_force_normal_lift ? LiftType::NormalLift : type; std::string lift_move; double target_lift = 0; { @@ -888,7 +903,12 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co // BBS Vec3d dest_point = point; auto travel_speed = - m_is_first_layer ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) : this->config.travel_speed.get_at(m_cached_extruder_idx); + this->point_on_first_layer(point) ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) : this->config.travel_speed.get_at(m_cached_extruder_idx); + // See uses_pointwise_travel_speed(): the historical path deliberately emits the + // raw configured speed in the final branch below, ignoring travel_speed. + const double final_travel_speed = this->uses_pointwise_travel_speed() + ? travel_speed + : this->config.travel_speed.get_at(m_cached_extruder_idx); //BBS: a z_hop need to be handle when travel if (std::abs(m_to_lift) > EPSILON) { assert(std::abs(m_lifted) < EPSILON); @@ -946,7 +966,16 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co w0.emit_comment(GCodeWriter::full_gcode_comment, comment); slop_move = w0.string(); } - else if (m_to_lift_type == LiftType::NormalLift) { + else if (m_to_lift_type == LiftType::NormalLift && + (! m_kinematics->suppress_lift_at_unknown_position() || + this->is_current_position_clear())) { + // Only lift in place when the current position is known, for a mapping + // that makes _travel_to_z re-emit logical X/Y: at print start (and after + // custom gcode) m_pos.xy is still the uninitialised origin, which would + // map to a bogus machine point. The xy_z_move below then travels straight + // to the destination with full XYZ and establishes the correct position. + // Mappings that do not need this (the historical Cartesian behaviour) + // report false and keep lifting unconditionally. slop_move = _travel_to_z(target.z(), "normal lift Z"); } } @@ -1002,20 +1031,20 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co if (has_axis_remap()) { // Remap may couple XY with Z; emit full XYZ in machine coordinates. w.emit_xyz(apply_axis_remap(point_on_plate)); - w.emit_f(this->config.travel_speed.get_at(m_cached_extruder_idx) * 60.0); + w.emit_f(final_travel_speed * 60.0); w.emit_comment(GCodeWriter::full_gcode_comment, comment); out_string = w.string(); } else if (!this->is_current_position_clear()) { //force to move xy first then z after filament change w.emit_xy(Vec2d(point_on_plate.x(), point_on_plate.y())); - w.emit_f(this->config.travel_speed.get_at(m_cached_extruder_idx) * 60.0); + w.emit_f(final_travel_speed * 60.0); w.emit_comment(GCodeWriter::full_gcode_comment, comment); out_string = w.string() + _travel_to_z(point_on_plate.z(), comment); } else { GCodeG1Formatter w; w.emit_xyz(point_on_plate); - w.emit_f(this->config.travel_speed.get_at(m_cached_extruder_idx) * 60.0); + w.emit_f(final_travel_speed * 60.0); w.emit_comment(GCodeWriter::full_gcode_comment, comment); out_string = w.string(); } @@ -1050,8 +1079,9 @@ std::string GCodeWriter::_travel_to_z(double z, const std::string &comment) double speed = this->config.travel_speed_z.get_at(m_cached_extruder_idx); if (speed == 0.) { - speed = m_is_first_layer ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) - : this->config.travel_speed.get_at(m_cached_extruder_idx); + speed = this->point_on_first_layer(Vec3d(m_pos.x(), m_pos.y(), z)) + ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) + : this->config.travel_speed.get_at(m_cached_extruder_idx); } GCodeG1Formatter w; diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index da2ce35cd6..f5e037d685 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -9,8 +9,12 @@ #include "Polygon.hpp" #include "PrintConfig.hpp" #include "GCode/CoolingBuffer.hpp" +#include "GCode/MachineKinematics.hpp" +#include namespace Slic3r { +class FirstLayerPlane; + class GCodeWriter { public: virtual ~GCodeWriter() = default; @@ -28,7 +32,8 @@ public: m_lifted(0), m_to_lift(0), m_to_lift_type(LiftType::NormalLift), - m_current_speed(3600), m_is_first_layer(true) + m_current_speed(3600), m_is_first_layer(true), + m_kinematics(std::make_unique()) {} Extruder* filament(size_t extruder_id) { assert(extruder_id < m_curr_filament_extruder.size()); return m_curr_filament_extruder[extruder_id]; } const Extruder* filament(size_t extruder_id) const { assert(extruder_id < m_curr_filament_extruder.size()); return m_curr_filament_extruder[extruder_id]; } @@ -142,10 +147,28 @@ public: void set_build_volume_max(const Vec3d &max); bool has_axis_remap() const; + // Install the machine frame mapping. Any axis remap / build volume already + // configured is carried over, so install order does not matter. + void set_kinematics(std::unique_ptr kinematics); + const MachineKinematics& kinematics() const { return *m_kinematics; } + + // First-layer plane evaluator. When set to an active plane, travel speed + // selection consults the plane per destination point instead of the + // layer-coarse m_is_first_layer flag. Borrowed pointer; lifetime is owned + // by GCode, which constructs the plane after the writer exists -- so this is + // deliberately a setter and not a constructor argument. + void set_first_layer_plane(const FirstLayerPlane *plane, double first_layer_height_mm) + { m_first_layer_plane = plane; m_first_layer_thickness_mm = first_layer_height_mm; } + + // Force every lift to a plain vertical lift. Spiral and slope lifts compute + // their slope in the logical frame and do not account for a machine mapping + // that couples axes. + void set_force_normal_lift(bool force) { m_force_normal_lift = force; } + // Returns whether this flavor supports separate print and travel acceleration. static bool supports_separate_travel_acceleration(GCodeFlavor flavor); protected: - // Position/lift/offset state — accessible to subclasses (e.g. BeltGCodeWriter) + // Position/lift/offset state. Vec3d m_pos = Vec3d::Zero(); double m_x_offset{ 0 }; double m_y_offset{ 0 }; @@ -158,17 +181,44 @@ protected: virtual std::string _travel_to_z(double z, const std::string &comment); - // Axis remap state — accessible to subclasses. + // Whether a destination gets first-layer treatment. With an active plane + // evaluator, distance from the plane decides; otherwise the layer-coarse + // m_is_first_layer flag does. + bool point_on_first_layer(const Vec3d &point_logical) const; + + // True when travel speed is selected per destination point rather than per + // layer. Set for writers that install a first-layer plane. The historical + // path emits the raw configured travel speed in the final branch of + // travel_to_xyz(), ignoring the first-layer selection computed at the top of + // that function; a plane-driven writer uses the first-layer-aware value + // throughout. Both are preserved exactly -- unifying them would change + // emitted feedrates and belongs in its own commit. + bool uses_pointwise_travel_speed() const { return m_first_layer_plane != nullptr; } + + // Borrowed; null = inactive. + const FirstLayerPlane *m_first_layer_plane = nullptr; + double m_first_layer_thickness_mm = 0.; + bool m_force_normal_lift = false; + + // The machine frame mapping. Owns the axis-remap state that used to live + // here as m_remap_* / m_build_vol_max; the setters above forward to it. + // Never null: a CartesianKinematics at the identity remap reproduces the + // historical behaviour exactly. + std::unique_ptr m_kinematics; + + // Last configured remap / build volume, replayed onto a newly installed + // kinematics so set_kinematics() and the setters are order-independent. int m_remap_x = 0; // RemapAxis: 0=+X, 1=+Y, 2=+Z, 3=-X, etc. int m_remap_y = 1; int m_remap_z = 2; Vec3d m_build_vol_max = Vec3d::Zero(); - // Apply axis remap to a point. Returns pos unchanged if remap is identity. + // Apply the machine frame mapping to a point. Returns pos unchanged when the + // mapping is the identity. Vec3d apply_axis_remap(const Vec3d &pos) const; // Motion uses the global/base process variant until a filament becomes active. - // Protected so BeltGCodeWriter indexes the per-extruder speed options (travel_speed, + // Protected so subclasses index the per-extruder speed options (travel_speed, // travel_speed_z, initial_layer_travel_speed) exactly as the base writer does. size_t m_cached_extruder_idx; diff --git a/src/libslic3r/calib.cpp b/src/libslic3r/calib.cpp index 620babba4d..cfb8112826 100644 --- a/src/libslic3r/calib.cpp +++ b/src/libslic3r/calib.cpp @@ -1,5 +1,5 @@ #include "calib.hpp" -#include "BeltGCodeWriter.hpp" +#include "GCode/BeltKinematics.hpp" #include "BoundingBox.hpp" #include "Config.hpp" #include "Model.hpp" @@ -855,10 +855,8 @@ void CalibPressureAdvancePattern::_refresh_writer(bool is_bbl_machine, const Mod // needs the machine kinematics (axis remap + frame shear/scale) with the // coordinates interpreted as world points (see set_world_coordinates). if (print_config.belt_printer.value) { - auto belt_writer = std::make_shared(); - belt_writer->set_belt_back_transform(print_config); - belt_writer->set_machine_frame_transform(print_config); - belt_writer->set_world_coordinates(true); + auto belt_writer = std::make_shared(); + install_belt_kinematics(*belt_writer, print_config, /*world_coordinates=*/true); const int rx = int(print_config.gcode_remap_x.value); const int ry = int(print_config.gcode_remap_y.value); const int rz = int(print_config.gcode_remap_z.value); @@ -869,7 +867,9 @@ void CalibPressureAdvancePattern::_refresh_writer(bool is_bbl_machine, const Mod print_config.printable_height.value)); } m_writer = std::move(belt_writer); - } else if (dynamic_cast(m_writer.get()) != nullptr) { + } else if (m_writer && dynamic_cast(&m_writer->kinematics()) != nullptr) { + // Previously configured for a belt printer; drop back to a plain writer, + // exactly as the old dynamic_cast check did. m_writer = std::make_shared(); } diff --git a/src/libslic3r/calib.hpp b/src/libslic3r/calib.hpp index 109360f6ec..2478349bf0 100644 --- a/src/libslic3r/calib.hpp +++ b/src/libslic3r/calib.hpp @@ -377,7 +377,7 @@ private: const Calib_Params &m_params; - // Polymorphic so belt printers get a BeltGCodeWriter in world-coordinates + // Polymorphic so belt printers get belt kinematics in world-coordinates // mode (_refresh_writer); shared_ptr keeps the class copyable — the writer // is rebuilt by refresh_setup() before every use anyway. std::shared_ptr m_writer{std::make_shared()}; diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 1b5c2df0b5..ca4867a68b 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1147,7 +1147,7 @@ std::vector GCodeViewer::get_plater_extruder() // Belt printers: compute the full machine->model back-transform from the print // config, so the "designed" (upright) G-code preview maps each toolpath vertex -// back to Cartesian space. The G-code forward pipeline is (BeltGCodeWriter:: +// back to Cartesian space. The G-code forward pipeline is (BeltKinematics:: // to_machine_coords): gcode = MachineFrame( AxisRemap( X ) ), with X = model if // gcode_back_transform (write already un-rotated to Cartesian) else BeltForward( // model). So the inverse is: diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6a8b398871..1929b83de5 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -15760,7 +15760,7 @@ void Plater::_calib_apply_belt_mode() void Plater::calib_pa(const Calib_Params& params) { // ORCA-Belt: PA Line / PA Pattern have the belt plumbing in place - // (BeltGCodeWriter::set_world_coordinates draws them on the belt surface) + // (belt kinematics in world-coordinates mode draws them on the belt surface) // but are not validated yet — keep them gated to the PA Tower for now. { double angle_rad = 0.; diff --git a/src/slic3r/GUI/calib_dlg.cpp b/src/slic3r/GUI/calib_dlg.cpp index c0979ec56c..83e36dbd69 100644 --- a/src/slic3r/GUI/calib_dlg.cpp +++ b/src/slic3r/GUI/calib_dlg.cpp @@ -98,7 +98,7 @@ std::vector make_shaper_type_labels() } // ORCA-Belt: PA Line / PA Pattern have belt plumbing in place (drawn on the -// belt surface via BeltGCodeWriter world-coordinates mode) but are not +// belt surface via BeltKinematics world-coordinates mode) but are not // validated yet — belt printers are restricted to the PA Tower for now. bool is_belt_printer_selected() { diff --git a/tests/fff_print/test_gcodewriter.cpp b/tests/fff_print/test_gcodewriter.cpp index 22ca387bbb..522d945948 100644 --- a/tests/fff_print/test_gcodewriter.cpp +++ b/tests/fff_print/test_gcodewriter.cpp @@ -19,7 +19,7 @@ #include "libslic3r/GCode/GCodeProcessor.hpp" #include #include -#include "libslic3r/BeltGCodeWriter.hpp" +#include "libslic3r/GCode/BeltKinematics.hpp" #include "libslic3r/BeltTransform.hpp" #include "libslic3r/GCodeReader.hpp" #include "libslic3r/PrintConfig.hpp" @@ -39,9 +39,8 @@ TEST_CASE("Belt machine coordinates retain a non-45-degree slicing angle", "[GCo config.gcode_remap_y.value = RemapAxis::PosZ; config.gcode_remap_z.value = RemapAxis::PosY; - BeltGCodeWriter writer; - writer.set_belt_back_transform(config); - writer.set_machine_frame_transform(config); + GCodeWriter writer; + install_belt_kinematics(writer, config); writer.set_axis_remap(int(config.gcode_remap_x.value), int(config.gcode_remap_y.value), int(config.gcode_remap_z.value)); @@ -52,7 +51,7 @@ TEST_CASE("Belt machine coordinates retain a non-45-degree slicing angle", "[GCo // machine-frame shear/scale are applied. const Vec3d model(4., 10., 3.); Transform3d forward = BeltTransformPipeline::build_forward_transform(config); - const Vec3d machine = writer.to_machine_coords(forward * model); + const Vec3d machine = writer.kinematics().to_machine(forward * model); // The conventional X-tilt remap produces (x, z, y). At 30 degrees the // gantry coordinate is z/sin(30) and belt travel is y + z*cot(30). @@ -905,7 +904,7 @@ TEST_CASE("Custom G-code motion limits are restored before generated moves", "[G // is_current_position_clear(), mirroring the SlopeLift branch. SCENARIO("Belt: the first travel does not lift through the uninitialised origin", "[GCodeWriter][belt]") { - GIVEN("A fresh BeltGCodeWriter configured for an X-tilt 45 degree belt") { + GIVEN("A fresh belt-kinematics GCodeWriter configured for an X-tilt 45 degree belt") { // Machine-frame + slicer->world back-transform config (X tilt, 45 deg). PrintConfig belt_config; belt_config.belt_printer.value = true; @@ -917,9 +916,8 @@ SCENARIO("Belt: the first travel does not lift through the uninitialised origin" belt_config.belt_frame_tilt_decouple.value = false; belt_config.belt_frame_tilt_angle.value = 45.0; - BeltGCodeWriter writer; - writer.set_machine_frame_transform(belt_config); - writer.set_belt_back_transform(belt_config); + GCodeWriter writer; + install_belt_kinematics(writer, belt_config); std::vector extruder_ids { 0 }; writer.set_extruders(extruder_ids); From 4d2c3a0af4bcf9a3a813876b1280068a5f318af8 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Tue, 8 Sep 2026 23:58:19 -0500 Subject: [PATCH 108/389] GCodeWriter: fix two machine-mapping bugs the extraction preserved Both change emitted G-code, which is why they were kept out of the extraction commit. Both are wrong only where the machine mapping is non-identity, which is the definition of each bug. 1. Suppress lifts commanded through an unknown position. _travel_to_z() emits full XYZ whenever the mapping must emit every axis, because the mapping can make machine Z depend on logical X/Y, and it builds that point from m_pos. At print start, and after any custom G-code that invalidates position, m_pos.xy is the uninitialised origin; mapping (0, 0, z) through a non-identity remap produces a real but wrong machine point -- for a reverse mapping, build_vol_max, i.e. the far corner of the bed. The subsequent full-XYZ move corrects the position, but the lift has already commanded a rapid across the whole bed at travel speed. Belt kinematics already guarded this; the Cartesian path did not. The guard is now applied at all three lift sites through must_skip_lift_now(), not just the one the extraction covered: travel_to_xyz()'s pending-lift branch, lazy_lift(spiral_vase=true), and eager_lift(). The latter two also needed the state fix -- both recorded m_lifted = target_lift regardless, so suppressing only the emission would leave a later unlift() descending from a height that was never commanded. 2. Never emit a G2/G3 arc a mapping cannot represent. extrude_arc_to_xy() emitted G2/G3 with logical X/Y and I/J and never consulted the mapping. There is no general fix by transforming the arc: a permutation moves it out of the XY plane that I/J describes, a negation reverses handedness, and the belt shear maps a circle to an ellipse that G2/G3 cannot express at all. So supports_arc_moves() gates generation through the existing GCode::should_disable_arc_fitting() hook, and BeltGCode's special-case override is deleted -- belt now gets the same behaviour from the general rule instead of its own exception. supports_arc_moves() is m_remap_x == 0 && m_remap_y == 1, not !has_axis_remap(): an arc emits only X/Y/I/J, so a mapping that merely negates or reverses Z leaves every emitted word untouched and keeps its arcs. The fallback for an unrepresentable arc tessellates it into linear segments at a 0.005mm chord tolerance rather than substituting a single chord, and splits dE proportionally across the segments. The capability check is hoisted above every extrusion mutation: an earlier form ran it after filament()->extrude(dE) and so extruded 2*dE on the fallback path. Known limits of that fallback, since it is worth stating rather than discovering: emitted relative E is conserved only to per-segment rounding (a radius-5 semicircle with dE=1.5 emits 1.50012 across 36 segments); the 0.005mm bound is a logical-frame bound, about 0.00855mm in machine space under a 45-degree belt shear; unequal endpoint radii and non-finite inputs are unchecked. Ordinary export takes the original polyline when the mapping rejects arcs, so this path is a fallback rather than the normal route. Known gap, not claimed fixed: classic wipe towers have their own enable_arc_fitting and their own G2/G3 emitter in GCode/WipeTower.cpp, which should_disable_arc_fitting() does not govern. Belt printers are barred from classic wipe towers; a remapped Cartesian printer is not. Tests in tests/fff_print/test_gcodewriter.cpp: reverse-X remap with unknown and with known position plus an identity control; eager_lift emitting nothing and recording nothing; the arc-capability matrix including the Z-only cases; and the tessellated fallback. E accounting is asserted through used_filament() rather than E(), which resets per line in relative-E mode. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011jgzj1sf53KMLPweZ8yeUQ --- src/libslic3r/BeltGCode.hpp | 4 +- src/libslic3r/GCode.hpp | 6 +- src/libslic3r/GCode/BeltKinematics.hpp | 3 + src/libslic3r/GCode/MachineKinematics.hpp | 29 ++- src/libslic3r/GCodeWriter.cpp | 75 +++++- src/libslic3r/GCodeWriter.hpp | 8 + tests/fff_print/test_gcodewriter.cpp | 295 ++++++++++++++++++++++ 7 files changed, 404 insertions(+), 16 deletions(-) diff --git a/src/libslic3r/BeltGCode.hpp b/src/libslic3r/BeltGCode.hpp index f52c62c28f..9598e9ebd5 100644 --- a/src/libslic3r/BeltGCode.hpp +++ b/src/libslic3r/BeltGCode.hpp @@ -10,14 +10,14 @@ namespace Slic3r { // - Install a BeltKinematics on the GCodeWriter // - Write belt configuration to the G-code header // - Adjust the origin for global pre-slice transforms when switching instances -// - Disable arc fitting (G2/G3 not supported on belt printers) +// (Arc fitting is disabled for belt printers by BeltKinematics::supports_arc_moves(), +// which the base GCode::should_disable_arc_fitting() consults -- no override needed.) class BeltGCode : public GCode { protected: void init_belt_writer(Print &print, bool is_bbl_printers) override; void write_belt_header(GCodeOutputStream &file, const Print &print) override; void on_set_origin(const PrintObject *obj, const Point &inst_shift) override; - bool should_disable_arc_fitting() const override { return true; } }; } // namespace Slic3r diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 56496f1b4e..26b8bc78a5 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -379,7 +379,11 @@ protected: virtual void init_belt_writer(Print &print, bool is_bbl_printers) {} virtual void write_belt_header(GCodeOutputStream &file, const Print &print) {} virtual void on_set_origin(const PrintObject *obj, const Point &inst_shift) {} - virtual bool should_disable_arc_fitting() const { return false; } + // Arc fitting is suppressed whenever the writer's machine mapping cannot + // represent a G2/G3 arc. Belt printers get this through BeltKinematics + // rather than through an override of their own. + virtual bool should_disable_arc_fitting() const + { return ! m_writer->kinematics().supports_arc_moves(); } void _do_export(Print &print, GCodeOutputStream &file, ThumbnailsGeneratorCallback thumbnail_cb); diff --git a/src/libslic3r/GCode/BeltKinematics.hpp b/src/libslic3r/GCode/BeltKinematics.hpp index a57f18dcdd..f145ecf3e9 100644 --- a/src/libslic3r/GCode/BeltKinematics.hpp +++ b/src/libslic3r/GCode/BeltKinematics.hpp @@ -42,6 +42,9 @@ public: // emitted G-code for an identity-transform belt configuration. bool must_emit_all_axes() const override { return true; } bool suppress_lift_at_unknown_position() const override { return true; } + // The machine frame shears and scales, so a circle is an ellipse in machine + // coordinates and G2/G3 cannot describe it. + bool supports_arc_moves() const override { return false; } bool world_coordinates() const { return m_world_coordinates; } diff --git a/src/libslic3r/GCode/MachineKinematics.hpp b/src/libslic3r/GCode/MachineKinematics.hpp index c3e381d851..e046dd9476 100644 --- a/src/libslic3r/GCode/MachineKinematics.hpp +++ b/src/libslic3r/GCode/MachineKinematics.hpp @@ -40,12 +40,21 @@ public: // axis permutation forces full emission without physically coupling axes. virtual bool must_emit_all_axes() const = 0; - // True when a separate in-place lift must be suppressed while the current - // position is unknown, because _travel_to_z() re-emits the logical X/Y - // through this mapping and an uninitialised position would map to a bogus - // machine point. + // True when a lift must be suppressed while the current position is unknown, + // because _travel_to_z() re-emits the logical X/Y through this mapping and an + // uninitialised position would map to a bogus machine point -- for a reverse + // mapping, the far corner of the bed. virtual bool suppress_lift_at_unknown_position() const = 0; + // True when a G2/G3 arc in the logical XY plane is still the same arc in the + // machine frame. Arc moves emit only X, Y, I and J, so this asks a narrower + // question than must_emit_all_axes(): whether logical X and Y reach the + // machine unchanged. A mapping that only negates or reverses Z keeps its + // arcs; one that permutes X or Y moves the arc out of the plane that I/J + // describes, and a shear turns the circle into an ellipse G2/G3 cannot + // express at all. + virtual bool supports_arc_moves() const = 0; + // Configuration. GCodeWriter forwards its setters here so that the state // lives with the strategy and a strategy installed before the setters run // still receives it. @@ -67,11 +76,13 @@ public: Vec3d to_build_volume(const Vec3d &machine) const override { return machine; } bool must_emit_all_axes() const override { return this->has_axis_remap(); } - // The base writer has never suppressed the lift, not even under a remap that - // makes _travel_to_z re-emit X/Y. That is arguably a latent bug, but fixing - // it here would change emitted G-code, so today's behaviour is preserved and - // the divergence from BeltKinematics is deliberate. - bool suppress_lift_at_unknown_position() const override { return false; } + bool suppress_lift_at_unknown_position() const override { return this->has_axis_remap(); } + + // X and Y must reach the machine untouched. Because the remap is a + // permutation, pinning those two also pins Z to Z, so a mapping that only + // negates or reverses Z still supports arcs -- every word a G2/G3 emits is + // unchanged by it. + bool supports_arc_moves() const override { return m_remap_x == 0 && m_remap_y == 1; } void set_axis_remap(int rx, int ry, int rz) override { m_remap_x = rx; m_remap_y = ry; m_remap_z = rz; } diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index be8f6607de..72c720cac6 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -25,6 +25,15 @@ namespace Slic3r { bool GCodeWriter::full_gcode_comment = true; +// A lift emitted through _travel_to_z() re-emits the stored logical X/Y under a +// mapping that must emit every axis. While the position is unknown that X/Y is +// the uninitialised origin, which maps to a real but wrong machine point, so the +// lift has to be skipped rather than commanded. +bool GCodeWriter::must_skip_lift_now() const +{ + return m_kinematics->suppress_lift_at_unknown_position() && ! this->is_current_position_clear(); +} + bool GCodeWriter::point_on_first_layer(const Vec3d &point_logical) const { if (m_first_layer_plane && m_first_layer_plane->is_active()) @@ -837,6 +846,10 @@ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) // BBS if (m_lifted == 0 && m_to_lift == 0 && target_lift > 0) { if (spiral_vase) { + if (this->must_skip_lift_now()) + // Record no lift, so a later unlift() does not descend from a + // height that was never commanded. + return ""; m_lifted = target_lift; return this->_travel_to_z(m_pos(2) + target_lift, "lift Z"); } @@ -882,7 +895,12 @@ std::string GCodeWriter::eager_lift(const LiftType type) { } //BBS: if position is unknown use normal lift else if (target_lift > 0) { - lift_move = _travel_to_z(m_pos(2) + target_lift, "normal lift Z"); + if (this->must_skip_lift_now()) + // Skipped, not deferred: leave m_lifted at zero below so unlift() + // does not descend from a height that was never commanded. + target_lift = 0.; + else + lift_move = _travel_to_z(m_pos(2) + target_lift, "normal lift Z"); } m_lifted = target_lift; m_to_lift = 0; @@ -966,9 +984,7 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co w0.emit_comment(GCodeWriter::full_gcode_comment, comment); slop_move = w0.string(); } - else if (m_to_lift_type == LiftType::NormalLift && - (! m_kinematics->suppress_lift_at_unknown_position() || - this->is_current_position_clear())) { + else if (m_to_lift_type == LiftType::NormalLift && ! this->must_skip_lift_now()) { // Only lift in place when the current position is known, for a mapping // that makes _travel_to_z re-emit logical X/Y: at print start (and after // custom gcode) m_pos.xy is still the uninitialised origin, which would @@ -1220,11 +1236,62 @@ std::string GCodeWriter::extrude_to_xy(const Vec2d &point, double dE, const std: return w.string(); } +// Approximate an arc with linear extrusions, for machine mappings that cannot +// express a G2/G3 (see extrude_arc_to_xy). center_offset is I/J: the centre +// relative to the CURRENT position, which is why this must run before m_pos is +// updated. +std::string GCodeWriter::extrude_arc_as_polyline(const Vec2d &point, const Vec2d ¢er_offset, + double dE, const bool is_ccw, + const std::string &comment, bool force_no_extrusion) +{ + const Vec2d start = Vec2d(m_pos.x(), m_pos.y()); + const Vec2d centre = start + center_offset; + const double r = (start - centre).norm(); + if (r < EPSILON) + // Degenerate: no arc to speak of, so a single move is exact. + return this->extrude_to_xy(point, dE, comment, force_no_extrusion); + + double a0 = std::atan2(start.y() - centre.y(), start.x() - centre.x()); + double a1 = std::atan2(point.y() - centre.y(), point.x() - centre.x()); + double sweep = a1 - a0; + if (is_ccw) { while (sweep <= 0.) sweep += 2. * PI; } + else { while (sweep >= 0.) sweep -= 2. * PI; } + + // Segment count from a chord-deviation bound: r*(1-cos(dtheta/2)) <= tol. + const double tol = 0.005; // mm + const double dmax = (tol >= r) ? PI : 2. * std::acos(1. - tol / r); + const int n = std::max(2, int(std::ceil(std::abs(sweep) / std::max(dmax, EPSILON)))); + + std::string out; + for (int i = 1; i <= n; ++ i) { + const double a = a0 + sweep * (double(i) / double(n)); + const Vec2d p = (i == n) ? point + : Vec2d(centre.x() + r * std::cos(a), centre.y() + r * std::sin(a)); + out += this->extrude_to_xy(p, dE / double(n), i == n ? comment : std::string(), force_no_extrusion); + } + return out; +} + //BBS: generate G2 or G3 extrude which moves by arc //point is end point which means X and Y axis //center_offset is I and J axis std::string GCodeWriter::extrude_arc_to_xy(const Vec2d& point, const Vec2d& center_offset, double dE, const bool is_ccw, const std::string& comment, bool force_no_extrusion) { + // Arcs emit only X/Y/I/J, so a mapping that moves logical X or Y cannot be + // expressed as a G2/G3. GCode::should_disable_arc_fitting() normally stops + // arcs being generated at all for such a mapping, but this is public API, so + // define the behaviour rather than asserting. + // + // This check MUST precede every state mutation below: falling through to + // extrude_to_xy() after filament()->extrude(dE) would advance E twice. + // + // A single chord is not a safe substitute either -- a semicircle would become + // its diameter and a full circle a stationary blob -- so approximate the arc + // with linear segments bounded by a chord tolerance, splitting dE between + // them in proportion to arc length. + if (! m_kinematics->supports_arc_moves()) + return this->extrude_arc_as_polyline(point, center_offset, dE, is_ccw, comment, force_no_extrusion); + m_pos(0) = point(0); m_pos(1) = point(1); if (!force_no_extrusion) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index f5e037d685..a382f4abae 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -90,6 +90,10 @@ public: virtual std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); //BBS: generate G2 or G3 extrude which moves by arc std::string extrude_arc_to_xy(const Vec2d &point, const Vec2d ¢er_offset, double dE, const bool is_ccw, const std::string &comment = std::string(), bool force_no_extrusion = false); + // Linear approximation of an arc, used when the machine mapping cannot + // express a G2/G3. Must be called before m_pos is updated: center_offset is + // relative to the current position. + std::string extrude_arc_as_polyline(const Vec2d &point, const Vec2d ¢er_offset, double dE, const bool is_ccw, const std::string &comment = std::string(), bool force_no_extrusion = false); virtual std::string extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); std::string retract(bool before_wipe = false, double retract_length = 0); std::string retract_for_toolchange(bool before_wipe = false, double retract_length = 0); @@ -186,6 +190,10 @@ protected: // m_is_first_layer flag does. bool point_on_first_layer(const Vec3d &point_logical) const; + // True when a lift must be skipped because this mapping would emit the + // stored logical X/Y and that position is not yet known. + bool must_skip_lift_now() const; + // True when travel speed is selected per destination point rather than per // layer. Set for writers that install a first-layer plane. The historical // path emits the raw configured travel speed in the final branch of diff --git a/tests/fff_print/test_gcodewriter.cpp b/tests/fff_print/test_gcodewriter.cpp index 522d945948..18a720aaff 100644 --- a/tests/fff_print/test_gcodewriter.cpp +++ b/tests/fff_print/test_gcodewriter.cpp @@ -1032,3 +1032,298 @@ SCENARIO("Belt: start-gcode prepare-stage moves keep their real Z", "[GCode][bel } } } + +// --------------------------------------------------------------------------- +// Regression tests for the two latent bugs the MachineKinematics refactor +// preserved deliberately (see 09b-latent-bug-fix-plan.md). +// --------------------------------------------------------------------------- + +// Bug 1. _travel_to_z() emits full XYZ whenever the mapping must emit every +// axis, and it builds that point from m_pos. While the position is unknown, +// m_pos.xy is the uninitialised origin, which a reverse remap maps to the far +// corner of the bed. Belt kinematics guarded this; a Cartesian writer with an +// axis remap did not, and would command a rapid across the whole bed. +static void configure_lift_writer(GCodeWriter &writer) +{ + std::vector extruder_ids { 0 }; + writer.set_extruders(extruder_ids); + writer.set_extruder(0); + writer.config.travel_speed.values = { 100.0 }; + writer.config.travel_speed_z.values = { 100.0 }; + writer.config.z_hop.values = { 0.4 }; + writer.config.retract_lift_above.values = { 0.0 }; + writer.config.retract_lift_below.values = { 0.0 }; +} + +// Largest X word in a chunk of emitted G-code, or lowest() if none. +static double max_emitted_x(const std::string &gcode) +{ + double max_x = std::numeric_limits::lowest(); + GCodeReader reader; + reader.parse_buffer(gcode, [&max_x](GCodeReader &, const GCodeReader::GCodeLine &line) { + if (line.cmd_is("G1") && line.has(X)) + max_x = std::max(max_x, double(line.x())); + }); + return max_x; +} + +static size_t count_g1(const std::string &gcode) +{ + size_t n = 0; + GCodeReader reader; + reader.parse_buffer(gcode, [&n](GCodeReader &, const GCodeReader::GCodeLine &line) { + if (line.cmd_is("G1")) ++n; + }); + return n; +} + +SCENARIO("Axis remap: no lift is commanded through the uninitialised origin", "[GCodeWriter][remap]") +{ + // Reverse X: machine X = build_vol_max.x - logical X, so the uninitialised + // origin maps to the far edge of the bed and is unmistakable in the output. + const double bed_x = 250.0; + + GIVEN("a writer with a reverse-X remap and an unknown current position") { + GCodeWriter writer; + configure_lift_writer(writer); + writer.set_axis_remap(6, 1, 2); + writer.set_build_volume_max(Vec3d(bed_x, 250.0, 250.0)); + REQUIRE(writer.kinematics().must_emit_all_axes()); + REQUIRE_FALSE(writer.is_current_position_clear()); + + WHEN("a z-hop is pending and we travel to the first point") { + writer.lazy_lift(LiftType::NormalLift); + const std::string gcode = writer.travel_to_xyz(Vec3d(10.0, 10.0, 5.0)); + + THEN("nothing is commanded at the image of the origin") { + // The destination maps to machine X = 250 - 10 = 240; the bogus + // origin lift would have mapped to machine X = 250. + REQUIRE(max_emitted_x(gcode) < bed_x - 1.0); + } + THEN("only the destination move is emitted") { + REQUIRE(count_g1(gcode) == 1); + } + } + } + + GIVEN("the same writer once its position is known") { + GCodeWriter writer; + configure_lift_writer(writer); + writer.set_axis_remap(6, 1, 2); + writer.set_build_volume_max(Vec3d(bed_x, 250.0, 250.0)); + writer.travel_to_xyz(Vec3d(20.0, 20.0, 5.0)); + REQUIRE(writer.is_current_position_clear()); + + WHEN("a z-hop is pending and we travel again") { + writer.lazy_lift(LiftType::NormalLift); + const std::string gcode = writer.travel_to_xyz(Vec3d(30.0, 30.0, 5.0)); + + THEN("the separate lift move is still emitted") { + // Suppression must be pinned to the unknown position, not to the + // presence of a remap. + REQUIRE(count_g1(gcode) == 2); + } + } + } + + GIVEN("an identity-mapping writer with an unknown position") { + GCodeWriter writer; + configure_lift_writer(writer); + REQUIRE_FALSE(writer.kinematics().must_emit_all_axes()); + REQUIRE_FALSE(writer.is_current_position_clear()); + + WHEN("a z-hop is pending and we travel to the first point") { + writer.lazy_lift(LiftType::NormalLift); + const std::string gcode = writer.travel_to_xyz(Vec3d(10.0, 10.0, 5.0)); + + THEN("behaviour is unchanged: the lift is still emitted") { + // Three moves, not two: with no remap and an unknown position the + // destination is emitted as a separate XY move followed by its own + // Z move, on top of the lift. That split is the pre-existing + // identity-mapping path and must not change. + REQUIRE(count_g1(gcode) == 3); + } + } + } +} + +SCENARIO("Axis remap: eager_lift does not lift, or record a lift, at an unknown position", + "[GCodeWriter][remap]") +{ + GIVEN("a writer with a reverse-X remap and an unknown current position") { + GCodeWriter writer; + configure_lift_writer(writer); + writer.set_axis_remap(6, 1, 2); + writer.set_build_volume_max(Vec3d(250.0, 250.0, 250.0)); + REQUIRE_FALSE(writer.is_current_position_clear()); + + WHEN("an eager lift is requested") { + const std::string lift = writer.eager_lift(LiftType::NormalLift); + + THEN("no move is emitted") { + REQUIRE(lift.empty()); + } + THEN("no lift is recorded, so unlift does not descend from it") { + // If m_lifted had been set while nothing was commanded, unlift() + // would emit a descent from a height the machine never reached. + REQUIRE(writer.unlift().empty()); + } + } + } + + GIVEN("an identity-mapping writer with an unknown position") { + GCodeWriter writer; + configure_lift_writer(writer); + + WHEN("an eager lift is requested") { + const std::string lift = writer.eager_lift(LiftType::NormalLift); + + THEN("behaviour is unchanged: the lift is emitted and can be undone") { + REQUIRE_FALSE(lift.empty()); + REQUIRE_FALSE(writer.unlift().empty()); + } + } + } +} + +// Bug 2. extrude_arc_to_xy() emits G2/G3 with logical X/Y and I/J and never +// consulted the mapping. An arc is only representable when logical X and Y reach +// the machine unchanged -- which is a narrower question than "is the remap the +// identity", because a mapping that only touches Z leaves every emitted word alone. +SCENARIO("Arc support is decided by whether the mapping leaves X and Y alone", "[GCodeWriter][remap]") +{ + GIVEN("a Cartesian writer") { + GCodeWriter writer; + + THEN("the identity mapping supports arcs") { + REQUIRE(writer.kinematics().supports_arc_moves()); + } + THEN("a Z-only negation still supports arcs") { + // (+X, +Y, -Z): non-identity, but X, Y, I and J are all untouched. + writer.set_axis_remap(0, 1, 5); + REQUIRE(writer.kinematics().must_emit_all_axes()); + REQUIRE(writer.kinematics().supports_arc_moves()); + } + THEN("a Z-only reversal still supports arcs") { + writer.set_axis_remap(0, 1, 8); + REQUIRE(writer.kinematics().supports_arc_moves()); + } + THEN("swapping X and Y does not support arcs") { + writer.set_axis_remap(1, 0, 2); + REQUIRE_FALSE(writer.kinematics().supports_arc_moves()); + } + THEN("the X-tilt style (x, z, y) remap does not support arcs") { + writer.set_axis_remap(0, 2, 1); + REQUIRE_FALSE(writer.kinematics().supports_arc_moves()); + } + } + + GIVEN("a belt writer") { + PrintConfig belt_config; + belt_config.belt_printer.value = true; + belt_config.belt_slice_rotation.value = BeltRotationAxis::X; + belt_config.belt_slice_rotation_angle.value = 45.0; + + GCodeWriter writer; + install_belt_kinematics(writer, belt_config); + + THEN("arcs are never supported, because the frame shears") { + REQUIRE_FALSE(writer.kinematics().supports_arc_moves()); + } + } +} + +SCENARIO("An unrepresentable arc degrades to its chord rather than emitting a wrong G2/G3", + "[GCodeWriter][remap]") +{ + auto emitted_commands = [](const std::string &gcode) { + std::vector cmds; + GCodeReader reader; + reader.parse_buffer(gcode, [&cmds](GCodeReader &, const GCodeReader::GCodeLine &line) { + if (! line.cmd().empty()) cmds.emplace_back(line.cmd()); + }); + return cmds; + }; + + GIVEN("an identity-mapping writer") { + GCodeWriter writer; + configure_lift_writer(writer); + + WHEN("an arc is extruded") { + const std::string gcode = writer.extrude_arc_to_xy( + Vec2d(10.0, 0.0), Vec2d(5.0, 0.0), 0.0, /*is_ccw=*/true, "", /*force_no_extrusion=*/true); + + THEN("it is still a G3") { + const auto cmds = emitted_commands(gcode); + REQUIRE(cmds.size() == 1); + REQUIRE(cmds.front() == "G3"); + } + } + } + + GIVEN("a writer whose mapping swaps X and Y") { + GCodeWriter writer; + configure_lift_writer(writer); + writer.set_axis_remap(1, 0, 2); + + WHEN("an arc is extruded") { + const std::string gcode = writer.extrude_arc_to_xy( + Vec2d(10.0, 0.0), Vec2d(5.0, 0.0), 0.0, /*is_ccw=*/true, "", /*force_no_extrusion=*/true); + + THEN("no arc is emitted; it is approximated with linear moves") { + const auto cmds = emitted_commands(gcode); + REQUIRE(! cmds.empty()); + for (const auto &c : cmds) + REQUIRE(c == "G1"); + } + } + } + + // The first version of this test used dE = 0 with force_no_extrusion, which + // hid a real bug: the capability check sat AFTER filament()->extrude(dE), so + // the fallback into extrude_to_xy() advanced E twice. Extrusion accounting has + // to be asserted with a positive dE. + GIVEN("a writer whose mapping cannot express arcs, extruding a real amount") { + GCodeWriter writer; + configure_lift_writer(writer); + writer.set_axis_remap(1, 0, 2); + const double dE = 1.5; + // used_filament() accumulates across moves; E() is reset per line in + // relative-E mode, so it would only show the last segment. + const double used_before = writer.filament()->used_filament(); + + WHEN("an arc carrying that extrusion is emitted") { + const std::string gcode = writer.extrude_arc_to_xy( + Vec2d(10.0, 0.0), Vec2d(5.0, 0.0), dE, /*is_ccw=*/true, "", /*force_no_extrusion=*/false); + + THEN("exactly dE is accounted for, not twice dE") { + REQUIRE_THAT(writer.filament()->used_filament() - used_before, + Catch::Matchers::WithinAbs(dE, 1e-6)); + } + THEN("no G2/G3 survives") { + REQUIRE(gcode.find("G2") == std::string::npos); + REQUIRE(gcode.find("G3") == std::string::npos); + } + } + } + + GIVEN("a writer whose mapping CAN express arcs, extruding a real amount") { + GCodeWriter writer; + configure_lift_writer(writer); + const double dE = 1.5; + // used_filament() accumulates across moves; E() is reset per line in + // relative-E mode, so it would only show the last segment. + const double used_before = writer.filament()->used_filament(); + + WHEN("an arc carrying that extrusion is emitted") { + const std::string gcode = writer.extrude_arc_to_xy( + Vec2d(10.0, 0.0), Vec2d(5.0, 0.0), dE, /*is_ccw=*/true, "", /*force_no_extrusion=*/false); + + THEN("it is still a single arc and accounts for dE once") { + REQUIRE(emitted_commands(gcode).size() == 1); + REQUIRE_THAT(writer.filament()->used_filament() - used_before, + Catch::Matchers::WithinAbs(dE, 1e-6)); + } + } + } +} From 767db71500ddd3098baf758adcf78a60bb0b4c9a Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Tue, 8 Sep 2026 23:58:47 -0500 Subject: [PATCH 109/389] Belt: fix three tree-support bugs, one of which blocked slicing entirely 1. Belt tree support could not slice at all. layer_initialize() hardcodes layer 0's bottom_z to 0, encoding "below layer 0 is the build plate at z = 0". True for a flat bed; false for a belt, whose virtual support layers legitimately extend below zero. The bottom-most belt layer therefore got height = print_z - 0 = -9.8, which reached Flow::with_height() and threw FlowErrorNegativeFlow. A 3DBenchy, a mushroom, an L-bracket and an extruded L all failed identically with negative flow / return -100. Only a bare cube sliced, because its support never reached that far down. The bottom is now taken from the previous layer's z, and only a layer 0 whose print_z is itself negative gets a synthesised bottom below it. Every non-negative print_z -- every non-belt configuration -- keeps exactly the previous 0, so this is behaviour-preserving off a belt by construction. An earlier form used min(0., layer_z(0) - layer_height), which regressed flat beds whenever the initial layer was thinner than the layer height. 3DBenchy on a 45-degree belt with organic tree support: fails to slice -> 247 support blocks / 168,596 extrusions. 2. Support generated against the belt, and against belt-tilted walls. A plain 20mm cube on a 45-degree belt generated 86 support blocks and 46,307 support extrusions. Three causes, all gated on the belt floor being active: a. The build-plate tilt compensation shifted the lower layer the wrong way. tan(build_plate_tilt_*) carries a magnitude but no direction, and the sign chosen moved the lower layer away from the newly appearing material rather than under it, doubling the mismatch. The shift now comes from belt_floor_shear_factor / belt_floor_from_axis, which carry sign and axis exactly. Non-belt tilted beds keep the previous behaviour. b. Material resting on the belt was treated as unsupported. The belt surface is now unioned into the effective lower layer, sampled at the bottom of the layer -- a layer meets the belt across its thickness and print_z is the top. The half-plane is clipped to the layer's bounding box first: unioning a +/-1000mm half-plane raw with 20mm-scale geometry put a huge dynamic range through Clipper and left intermittent artefacts every few layers. c. The object's first slice can be empty on a belt (the bottom vertex is a sub-extrudable sliver), leaving the layer above with an empty predecessor even though it rests on the belt. (b) already covers that per island. What did need fixing is sharp-tail detection, which tests each island against the raw lower slices; with an empty predecessor that test is trivially true and every belt-contact island read as a sharp tail. It now tests against the same effective lower layer. An earlier form instead skipped the whole layer when the point of get_extents(curr_polys) -- the bounding box of the union of every island -- nearest the belt was in contact. That was wrong in a way worth recording: one island resting on the belt could suppress overhang and sharp-tail detection for a separate island floating well above it. Every decision here is per-island. Cube on belt: 46,307 -> 0 support extrusions. Same cube non-belt: 0 before and after. Benchy on belt still 247 blocks / 168,596 extrusions and a mushroom 111 / 82,157, so false positives are removed without suppressing true ones. Non-belt is unchanged by measurement, not only by the belt_ovh_active gate: the same mushroom sliced on a Cartesian printer before and after gives 65,866 support extrusions and 68,717 total extrusions both times, the two G-code files differing in exactly one line -- the object's plate position. 3. m_anti_overhang was filled and read in different index spaces. It is consumed in the same index space as m_layer_outlines, where object layer i lives at num_raft_layers + i, but was filled in object-layer space. Every entry landed num_raft_layers too low (50 for a 20mm cube at bed Y=50) and the topmost object layers got none. The belt injection also ran before m_raft_layers was extended, so it could not have known the offset. The array is now shifted as a whole and the injection moved after the raft extension. This also repairs user support blockers under a raft, which is not belt-specific: it changes behaviour for any ordinary raft, not just the belt's virtual one, and should be reviewed as a general fix. Measured effect on the cube was small on its own (46,307 -> 46,334 before the other fixes) because m_anti_overhang only feeds calculate_placable; kept as a correctness fix on its own merits. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011jgzj1sf53KMLPweZ8yeUQ --- src/libslic3r/Support/TreeModelVolumes.cpp | 55 ++++++++------- src/libslic3r/Support/TreeSupport.cpp | 75 +++++++++++++++++++-- src/libslic3r/Support/TreeSupportCommon.hpp | 17 ++++- 3 files changed, 117 insertions(+), 30 deletions(-) diff --git a/src/libslic3r/Support/TreeModelVolumes.cpp b/src/libslic3r/Support/TreeModelVolumes.cpp index b1e3cdd6dd..e56682fd3c 100644 --- a/src/libslic3r/Support/TreeModelVolumes.cpp +++ b/src/libslic3r/Support/TreeModelVolumes.cpp @@ -95,29 +95,6 @@ TreeModelVolumes::TreeModelVolumes( #else { m_anti_overhang = print_object.slice_support_blockers(); - // Belt floor: add belt surface polygons to anti_overhang so support - // is never generated inside the belt. Only in global shear mode — - // in local mode the belt floor clipping handles everything and - // anti_overhang at the bottom layers would block all support. - { - const auto &sp = print_object.slicing_parameters(); - const auto &pcfg = print_object.print()->config(); - BeltFloorContext ctx; - ctx.init_local(sp, pcfg, print_object.belt_global_z_offset()); - if (ctx.is_active() - && std::abs(print_object.belt_global_z_offset()) > EPSILON - && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { - size_t num_layers_needed = print_object.layer_count(); - // Ensure m_anti_overhang is large enough. - if (m_anti_overhang.size() < num_layers_needed) - m_anti_overhang.resize(num_layers_needed, Polygons{}); - for (size_t layer_idx = 0; layer_idx < num_layers_needed; ++layer_idx) { - double print_z = print_object.get_layer(layer_idx)->print_z - - print_object.belt_global_z_offset(); - append(m_anti_overhang[layer_idx], ctx.surface_polygon(print_z)); - } - } - } TreeSupportMeshGroupSettings mesh_settings(print_object); const TreeSupportSettings config{ mesh_settings, print_object.slicing_parameters() }; m_current_min_xy_dist = config.xy_min_distance; @@ -147,6 +124,38 @@ TreeModelVolumes::TreeModelVolumes( } } } + // Belt floor: add belt surface polygons to anti_overhang so support is + // never generated inside the belt. + // + // This MUST run after m_raft_layers is final. m_anti_overhang is consumed + // in the same index space as m_layer_outlines -- object layer i lives at + // index num_raft_layers + i -- but slice_support_blockers() returns it in + // object-layer space. Without the shift below, every entry lands + // num_raft_layers too low: with the belt raft that is tens of layers, so + // the belt suppression is applied to the wrong layers entirely and the + // topmost object layers get none at all. + { + const size_t num_raft = m_raft_layers.size(); + const size_t num_obj = print_object.layer_count(); + if (num_raft > 0 && ! m_anti_overhang.empty()) + // Shift the support blockers into the same space. + m_anti_overhang.insert(m_anti_overhang.begin(), num_raft, Polygons{}); + const auto &sp = print_object.slicing_parameters(); + const auto &pcfg = print_object.print()->config(); + BeltFloorContext ctx; + ctx.init_local(sp, pcfg, print_object.belt_global_z_offset()); + if (ctx.is_active() + && std::abs(print_object.belt_global_z_offset()) > EPSILON + && pcfg.belt_support_floor_mode.value == BeltSupportFloorMode::GeneratorOnly) { + if (m_anti_overhang.size() < num_raft + num_obj) + m_anti_overhang.resize(num_raft + num_obj, Polygons{}); + for (size_t i = 0; i < num_obj; ++i) { + const double print_z = print_object.get_layer(i)->print_z + - print_object.belt_global_z_offset(); + append(m_anti_overhang[num_raft + i], ctx.surface_polygon(print_z)); + } + } + } m_current_outline_idx = 0; m_layer_outlines.emplace_back(mesh_settings, std::vector{}); diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 3b7743407c..d472681c41 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -13,6 +13,7 @@ #include "SVG.hpp" #include "TreeSupportCommon.hpp" #include "TreeSupport.hpp" +#include #include "TreeSupport3D.hpp" #include "BeltFloorContext.hpp" #include @@ -712,6 +713,17 @@ void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) const double tilt_x_rad = Geometry::deg2rad(print_cfg.build_plate_tilt_x.value); const double tilt_y_rad = Geometry::deg2rad(print_cfg.build_plate_tilt_y.value); const bool has_tilt = std::abs(tilt_x_rad) > EPSILON || std::abs(tilt_y_rad) > EPSILON; + + // Belt printers: the object is pre-rotated by the belt angle before slicing, so a wall + // that is vertical in the world advances by one layer height per layer in the sliced + // frame. The build-plate tilt shift above compensates for that, but its direction has to + // follow the belt shear -- the sign and axis are already known exactly from the slicing + // parameters, so take them from there rather than from tan(build_plate_tilt), which + // carries a magnitude but no direction. Non-belt tilted beds keep the existing behaviour. + BeltFloorContext ovh_belt_ctx; + const bool belt_ovh_active = ovh_belt_ctx.init(m_slicing_params, print_cfg); + const double belt_shear = ovh_belt_ctx.shear_factor(); + const int belt_axis = ovh_belt_ctx.from_axis(); // FIXME this is a fudge constant! double support_tree_tip_diameter = 0.8; auto enforcer_overhang_offset = scaled(support_tree_tip_diameter); @@ -855,15 +867,61 @@ void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) ExPolygons& lower_polys = lower_layer->lslices_extrudable; // Apply build plate tilt: shift lower layer polygons to simulate tilted gravity + // + // On a belt the object's very first slice can come out empty (the bottom + // vertex is a sub-extrudable sliver), leaving the layer above it with an + // empty predecessor even though it rests on the belt. That case needs no + // special handling here: the belt surface is unioned into effective_lower + // below and sampled at the bottom of the layer, so a contacting island is + // covered and a genuinely floating one still reports its overhang. Doing it + // that way keeps the decision per-island -- an earlier whole-layer skip, + // conditioned on the nearest point of the *union* of the cross-section, + // let one contacting island silence a separate floating one. ExPolygons shifted_lower; - if (has_tilt) { + if (belt_ovh_active || has_tilt) { shifted_lower = lower_polys; // copy const double lh = lower_layer->height; - Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), - coord_t(scale_(lh * tan(tilt_x_rad)))); + Point tilt_shift(0, 0); + if (belt_ovh_active) { + // Advance the lower layer along the belt by exactly the amount a + // world-vertical wall moves per layer, so such a wall stops reading + // as an overhang. Sign comes from the shear, not from a tilt angle. + const coord_t d = coord_t(-scale_(lh * belt_shear)); + if (belt_axis == 0) tilt_shift.x() = d; else tilt_shift.y() = d; + } else { + tilt_shift = Point(coord_t(scale_(lh * tan(tilt_y_rad))), + coord_t(scale_(lh * tan(tilt_x_rad)))); + } translate(shifted_lower, tilt_shift); } - const ExPolygons &effective_lower = has_tilt ? shifted_lower : lower_polys; + ExPolygons effective_lower = (belt_ovh_active || has_tilt) ? shifted_lower : lower_polys; + + // Belt printers: material resting on the belt is held up by the belt, not by + // the layer below it, so the belt surface counts as support from underneath. + // Without this the object's belt-contact face reads as a fresh overhang on + // every layer -- the leading strip that produced the spurious support nub. + if (belt_ovh_active) { + // surface_polygon() is a +/-1000mm half-plane. Unioning that raw with + // 20mm-scale geometry and then offsetting it puts a huge dynamic range + // through Clipper, which left intermittent artefacts every few layers. + // Clip it to the layer's own bounding box first. + // Evaluate the belt surface at the BOTTOM of the layer, not its top: + // a layer meets the belt across its whole thickness, and print_z is the + // top. On the object's first layer -- which is thicker, and whose lower + // layer is empty -- using print_z left the leading 0.37mm uncovered and + // produced the one remaining spurious overhang. + Polygons belt_surface = ovh_belt_ctx.surface_polygon(layer->print_z - layer->height); + if (! belt_surface.empty()) { + BoundingBox clip_bb = get_extents(curr_polys); + clip_bb.merge(get_extents(lower_polys)); + clip_bb.offset(scale_(10.)); + belt_surface = intersection(belt_surface, Polygons{ clip_bb.polygon() }); + if (! belt_surface.empty()) { + append(effective_lower, union_ex(belt_surface)); + effective_lower = union_ex(effective_lower); + } + } + } // normal overhang ExPolygons lower_layer_offseted = offset_ex(effective_lower, support_offset_scaled, SUPPORT_SURFACES_OFFSET_PARAMETERS); @@ -882,8 +940,13 @@ void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) for (const ExPolygon& expoly : curr_polys) { bool is_sharp_tail = false; // 1. nothing below - // this is a sharp tail region if it's floating and non-ignorable - if (!overlaps(offset_ex(expoly, 0.1 * extrusion_width_scaled), lower_polys)) { + // this is a sharp tail region if it's floating and non-ignorable. + // On a belt, "below" has to include the belt itself and the + // shear-advanced lower layer, or every belt-contact island reads as + // a sharp tail -- which is what the empty-predecessor skip above was + // really masking. effective_lower is exactly that notion of below. + const ExPolygons &tail_lower = belt_ovh_active ? effective_lower : lower_polys; + if (!overlaps(offset_ex(expoly, 0.1 * extrusion_width_scaled), tail_lower)) { is_sharp_tail = !offset_ex(expoly, -0.1 * extrusion_width_scaled).empty(); } diff --git a/src/libslic3r/Support/TreeSupportCommon.hpp b/src/libslic3r/Support/TreeSupportCommon.hpp index 07dcb324b8..979adcd9ed 100644 --- a/src/libslic3r/Support/TreeSupportCommon.hpp +++ b/src/libslic3r/Support/TreeSupportCommon.hpp @@ -651,7 +651,22 @@ inline SupportGeneratorLayer& layer_initialize( const size_t layer_idx) { layer_new.print_z = layer_z(slicing_params, config, layer_idx); - layer_new.bottom_z = layer_idx > 0 ? layer_z(slicing_params, config, layer_idx - 1) : 0; + // Layer 0 has no layer below it, so its bottom is the build plate at z = 0 -- + // true for a flat bed, false for a belt, whose virtual support layers extend + // below zero. Taking 0 there made the bottom-most belt layer's height come out + // as its own (negative) print_z, which reached Flow::with_height() and threw + // FlowErrorNegativeFlow, so tree support could not slice any belt model whose + // branches reached down that far. + // + // Only the negative case is corrected. An earlier version used + // min(0, print_z - layer_height), which also fires whenever the initial layer + // is THINNER than the regular layer height -- e.g. 0.2 over 0.3, both + // independently configurable -- and silently changed flat-bed support layer + // heights. Keying on the sign leaves every non-negative print_z on exactly + // the previous value of 0. + layer_new.bottom_z = layer_idx > 0 ? layer_z(slicing_params, config, layer_idx - 1) : 0.; + if (layer_idx == 0 && layer_new.print_z < 0.) + layer_new.bottom_z = layer_new.print_z - slicing_params.layer_height; layer_new.height = layer_new.print_z - layer_new.bottom_z; return layer_new; } From 1b6fb2a81f2c14fc1ddce598d0a9dd2897d3ce9f Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Tue, 8 Sep 2026 23:00:38 -0500 Subject: [PATCH 110/389] Belt: fix first-layer speed and the slow_down_layers ramp never applying Fixes the report in #12998 (comment 5465250754): first-layer speed and the slow_down_layers ramp were ignored on a belt printer. The report reads as a per-object problem, but neither applied to *any* object -- the reporter's first part slowed down because slow_down_for_layer_cooling was on, which is CoolingBuffer's time-per-layer mechanism, not initial_layer_speed. FirstLayerPlane decides first-layer-ness by perpendicular distance to a plane it derives by composing gcode_remap_* with compute_machine_z_affine(). The plane is therefore a function of how G-code is *addressed*, not of where the belt is: change the output axis convention and the plane moves. On MCBELT-TYPE2 the first layer measured 86.2 mm from the plane and got effective index 431, far past any slow_down_layers ramp. on_first_layer(point) and effective_layer_index_for_point() now measure height above the belt surface, using the belt description already carried in SlicingParameters -- belt_floor_shear_factor / belt_floor_from_axis / belt_floor_z_shift -- the same description the support generator uses. That is a property of how the object was sliced, so no remap or back-transform can perturb it. Deliberately not via BeltFloorContext: its init() folds in belt_support_floor_offset, a support-generator diagnostic, and letting that option steer the model's first-layer speed band would be a surprising coupling (a negative value would switch the slowdown off outright). Preserving the existing first-layer-plane settings: * first_layer_plane XY/YZ/XZ keeps the FirstLayerPlane evaluator, as those are explicit opt-outs. * A non-zero first_layer_plane_offset also keeps it. The offset is a machine-Z shift that FirstLayerPlane converts into a perpendicular distance in the slicing frame; this evaluator measures along slicing Z, so there is no faithful translation. Deferring to the evaluator that implements the setting beats silently ignoring it. * The two thresholds stay separate, exactly as FirstLayerPlane keeps them: the first-layer boolean tests initial_layer_print_height, while the effective layer index counts bands of first_layer_plane_thickness. Brim and coincident apron bands are emitted before m_layer is switched to their object -- for an apron band there is no Layer at all -- so both paths publish the belt-floor owner explicitly. Without that a brim's classification would borrow whichever object was visited previously, making it depend on plate order. Note that first-layer-ness drives more than speed: extrusion acceleration, jerk, the first-layer flow ratio and eligibility for overhang speed/fan analysis all read it, so all of them are corrected on belt printers by this change. Classification still samples only each path's first point, as it did before. Non-belt is unaffected by construction: belt_height_above_floor() returns false when the belt floor is inactive and both call sites fall back to the previous path. FirstLayerPlane stays in place for its other modes and for CoolingBuffer, whose machine-coordinate probe is a separate outstanding bug. Measured, MCTEST4 on MCBELT-TYPE2 (initial_layer_speed=5, slow_down_layers=40): 15 distinct feedrates with no gradient and F300 absent, becomes 70 including the full ramp 300(5) 382(6) 465(8) 630(10) 795(13) ... Two bare cubes on a belt: 0 slow extrusions becomes 2378 across Z 32.36..95.18. The same two cubes on a Cartesian printer keep their slow extrusions confined to Z 0.20..2.00. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011jgzj1sf53KMLPweZ8yeUQ --- src/libslic3r/GCode.cpp | 50 +++++++++++++++++++++++++++++++++++++++++ src/libslic3r/GCode.hpp | 48 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 32976fad76..fff437731f 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -6,6 +6,7 @@ #include "libslic3r.h" #include "I18N.hpp" #include "GCode.hpp" +#include #include "Exception.hpp" #include "ExtrusionEntity.hpp" #include "EdgeGrid.hpp" @@ -5234,6 +5235,10 @@ std::string GCode::generate_object_brim(const Print &print, const PrintObject &o // geometry is already in plate coordinates. m_config.apply(print.default_region_config()); m_config.apply(object.config(), true); + // m_layer is not switched to this object until after brim emission, so name + // the belt-floor owner explicitly or the classification borrows whichever + // object was visited last. + BeltFloorObjectGuard floor_owner{ m_belt_floor_object, &object }; const Point &offset = object.instances()[instance_id].shift; this->set_origin(unscale(offset)); this->on_set_origin(&object, offset); @@ -6642,6 +6647,9 @@ LayerResult GCode::process_layer( // Speeds, flow and retraction all read m_config. m_config.apply(print.default_region_config()); m_config.apply(object.config(), true); + // Apron bands have no Layer at all (m_layer is null here), so the belt + // floor owner has to be named the same way the object brim names it. + BeltFloorObjectGuard floor_owner{ m_belt_floor_object, &object }; const size_t i_begin = single_object_instance_idx == size_t(-1) ? 0 : single_object_instance_idx; const size_t i_end = single_object_instance_idx == size_t(-1) ? object.instances().size() : single_object_instance_idx + 1; @@ -10307,6 +10315,48 @@ std::string GCode::set_object_info(Print *print) { return gcode.str(); } +bool GCode::belt_height_above_floor(const Vec3d &point_slicing_mm, double &height_mm) const +{ + // The owning object, which is what carries the belt description. During + // object-brim and coincident-apron emission m_layer still points at whichever + // object was visited last (or at nothing at all), so those paths publish the + // owner explicitly -- otherwise a brim's speed would depend on plate order. + const PrintObject *object = m_belt_floor_object != nullptr ? m_belt_floor_object + : (m_layer != nullptr ? m_layer->object() : nullptr); + if (object == nullptr) + return false; + // Respect an explicit first-layer-plane choice: only Auto and BeltAffine mean + // "use the belt". A user who selected XY, YZ or XZ has asked for the + // FirstLayerPlane evaluator and must keep it. + const FirstLayerPlaneMode mode = m_config.first_layer_plane.value; + if (mode != FirstLayerPlaneMode::Auto && mode != FirstLayerPlaneMode::BeltAffine) + return false; + // Likewise for a dialled-in plane offset. It is expressed as a machine-Z + // shift that FirstLayerPlane converts into a perpendicular distance in the + // slicing frame; this evaluator measures along slicing Z instead, so there is + // no faithful translation of it here. Honour the user's setting by deferring + // to the evaluator that implements it rather than silently dropping it. + if (std::abs(m_config.first_layer_plane_offset.value) > EPSILON) + return false; + + const SlicingParameters &sp = object->slicing_parameters(); + // Deliberately NOT BeltFloorContext: its init() folds in + // belt_support_floor_offset, a support-generator diagnostic. Letting that + // option move the model's first-layer speed band would be a surprising + // coupling -- a negative value would switch the slowdown off entirely. + // The belt surface itself is just shear * u + z_shift. + if (std::abs(sp.belt_floor_shear_factor) < EPSILON) + return false; + const double u = sp.belt_floor_from_axis == 0 ? point_slicing_mm.x() : point_slicing_mm.y(); + const double floor_z = sp.belt_floor_shear_factor * u + sp.belt_floor_z_shift; + // Measured along the slicing Z, not perpendicular to the belt: layers are + // horizontal slabs in the sliced frame, so the slab holding the material that + // rests on the belt at this point is the one within one layer height of it. + // A perpendicular measure would shrink the band by 1/cos(tilt). + height_mm = point_slicing_mm.z() - floor_z; + return true; +} + // convert a model-space scaled point into G-code coordinates Vec2d GCode::point_to_gcode(const Point &point) const { diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 26b8bc78a5..c78a9675e2 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -831,6 +831,18 @@ protected: // Counter standing in for Layer::id() on apron layers, which precede layer 0. size_t m_belt_brim_layer_idx{0}; + // Belt brim only. Brim and coincident apron bands are emitted before m_layer + // is switched to their object, so belt_height_above_floor() would otherwise + // read the previously visited object's belt description -- making a brim's + // classification depend on plate visiting order. Those paths publish the + // owner here for the duration of the emission. Never left set. + const PrintObject *m_belt_floor_object{nullptr}; + struct BeltFloorObjectGuard { + const PrintObject *&slot; + BeltFloorObjectGuard(const PrintObject *&s, const PrintObject *o) : slot(s) { slot = o; } + ~BeltFloorObjectGuard() { slot = nullptr; } + }; + std::set m_initial_layer_extruders; std::vector> m_sorted_layer_filaments; // BBS @@ -853,6 +865,12 @@ protected: // otherwise we delegate to the legacy per-layer test. This is the // entry point used by per-path call sites in _extrude. bool on_first_layer(const Vec3d &point_slicing_mm) const { + // Belt printers: measure height above the belt surface itself, in the + // slicing frame. See belt_height_above_floor() for why this does not go + // through FirstLayerPlane. + double h; + if (this->belt_height_above_floor(point_slicing_mm, h)) + return h <= m_config.initial_layer_print_height.value + EPSILON; if (m_first_layer_plane && m_first_layer_plane->is_active()) return m_first_layer_plane->is_first_layer( point_slicing_mm, m_config.initial_layer_print_height.value); @@ -863,10 +881,40 @@ protected: // perpendicular distance to the plane in band_thickness_mm units; // otherwise it returns the legacy slicing layer index. int effective_layer_index_for_point(const Vec3d &point_slicing_mm) const { + double h; + if (this->belt_height_above_floor(point_slicing_mm, h)) { + const double lh = this->first_layer_band_mm(); + return h <= 0. ? 0 : int(std::floor(h / lh)); + } if (m_first_layer_plane && m_first_layer_plane->is_active()) return m_first_layer_plane->effective_layer_index(point_slicing_mm); return on_first_layer() ? 0 : layer_id(); } + + // Band thickness for the *effective layer index* only. FirstLayerPlane keeps + // two separate thresholds and so must this path: is_first_layer() tests + // against initial_layer_print_height, while effective_layer_index() counts + // bands of first_layer_plane_thickness. Conflating them would apply + // first-layer treatment through a whole 1mm band on a 0.2mm first layer. + double first_layer_band_mm() const { + double band = m_config.first_layer_plane_thickness.value; + if (band <= 0.) band = m_config.initial_layer_print_height.value; + return band > 0. ? band : 0.2; + } + + // Height of a slicing-frame point above the belt surface, or false when this + // is not a belt print. + // + // The belt surface is known exactly in the slicing frame from the slicing + // parameters (belt_floor_shear_factor / _from_axis / _z_shift) -- the same + // description the support generator uses. FirstLayerPlane instead derives its + // plane by composing gcode_remap_* with the g-code back-transform, so its + // answer changes with the machine's *output* axis convention: on a printer + // with a non-identity remap it reported ~86mm of clearance for geometry + // sitting directly on the belt, and no extrusion was ever classified as + // first-layer. Measuring against the belt itself is independent of every + // remap and back-transform. + bool belt_height_above_floor(const Vec3d &point_slicing_mm, double &height_mm) const; int layer_id() const { if (m_layer == nullptr) return -1; From 1bcfe58064ea16387a3f4107d7ea782fc43c6e9a Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 12 Sep 2026 22:23:14 -0500 Subject: [PATCH 111/389] Belt: stop the purge prism printing plastic no toolchange needs Two independent leaks of filament on the belt purge prism, plus the replan safety net the second one needs. 1. The early-truncation scan bounded itself with the prism's own toolchanges. ToolOrdering covers the whole print and the prism is a printed object in it, so the "last toolchange" the scan found was on the prism's own top layers -- it runs past every model object by design -- and the truncation cancelled nothing. Bound the scan at the tallest non-prism object (support layers included; on a belt they can top the object). On MCTEST5 that was 197 toolchanges over 39.4 mm of tower that no swap ever needed. 2. On a layer with no toolchange, the prism's entire fill printed as solid infill in its own filament. Drop the fills no toolchange claimed, right after the purge marking and before ensure_perimeters_infills_order() force-overrides whatever is left. Perimeters stay so the bar keeps a continuous wall. An earlier version of this deleted the entities and had to be reverted: psWipeTower can rerun without regenerating infill, and a later tool ordering may claim what this one did not. The entities are now stashed with their layer, region and index and put back exactly, the same reversibility contract layer truncation already had. 3. Both stashes go stale if an object step reruns: make_fills() clears and regenerates fills over m_layers only, so a stale stash would put old fills back next to new ones, and truncated layers would keep old perimeters/fills. Undo the plan's edits at the top of Print::process() whenever psWipeTower is not done. Every object-step invalidation also invalidates psWipeTower, so that condition is exactly "some object step may rerun"; when it is done nothing regenerates and the edits must stay. This also covers a prism left behind after belt mode is turned off, which previously stayed truncated forever. WipingExtrusions::is_entity_overridden() becomes public so the prism can tell claimed fills from unclaimed ones. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01SsuY8Laiyh7q2zPVVKV3HZ --- src/libslic3r/BeltPurge.cpp | 109 +++++++++++++++++++++++++-- src/libslic3r/GCode/ToolOrdering.hpp | 8 +- src/libslic3r/Print.cpp | 13 ++++ src/libslic3r/Print.hpp | 32 ++++++++ src/libslic3r/PrintObject.cpp | 7 ++ 5 files changed, 162 insertions(+), 7 deletions(-) diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp index b249f21bd2..37d89ca14e 100644 --- a/src/libslic3r/BeltPurge.cpp +++ b/src/libslic3r/BeltPurge.cpp @@ -149,7 +149,7 @@ void Print::_plan_belt_purge() // previous plan so a newly higher toolchange can use its original layers. for (PrintObject *po : m_objects) if (po->config().belt_purge_tower_object.value) - po->belt_restore_truncated_layers(); + po->belt_undo_purge_plan(); // Must run before ToolOrdering is built: LayerTools merge per-object layer // print_z values, and the prism only absorbs purge where its (snapped) @@ -191,11 +191,44 @@ void Print::_plan_belt_purge() // flush object), so truncating afterwards would leave dangling overrides // pointing into deleted layers. { + // The tool ordering covers the WHOLE print, and the prism is a printed + // object in it. Left unbounded, the scan below sees the prism's own + // toolchanges on layers above every model object -- the prism runs past + // them by design (ramp/height compensation at the tilted ends) -- so + // last_tc_z lands at the prism's own top and the truncation cancels + // nothing. The tower ends up justifying its own existence. + // + // Nothing above the tallest printed object can require a color change, + // so bound the scan there. On MCTEST5 that is 197 toolchanges spanning + // z=154.00..193.20 with the tallest object topping out at 153.80, i.e. + // 39.4 mm of tower that no swap ever needed. + // Support layers count too: on a belt they can extend above the object's + // own top, and a toolchange there is a real one. + double obj_top_z = -1.; + for (const PrintObject *po : m_objects) { + if (po->config().belt_purge_tower_object.value) + continue; + if (!po->layers().empty()) + obj_top_z = std::max(obj_top_z, po->layers().back()->print_z); + if (!po->support_layers().empty()) + obj_top_z = std::max(obj_top_z, po->support_layers().back()->print_z); + } + double last_tc_z = -1.; unsigned int cur_ext = m_wipe_tower_data.tool_ordering.first_extruder(); - for (const auto < : m_wipe_tower_data.tool_ordering.layer_tools()) + for (const auto < : m_wipe_tower_data.tool_ordering.layer_tools()) { + // layer_tools() is ordered by print_z ascending. + if (obj_top_z >= 0. && lt.print_z > obj_top_z + EPSILON) + break; for (const unsigned int e : lt.extruders) if (e != cur_ext) { last_tc_z = lt.print_z; cur_ext = e; } + } + // Deliberately NOT cancelling the prism outright when no object toolchange + // exists: belt_truncate_layers_above(0.) empties m_layers, and an object + // with zero layers is not something the rest of the pipeline expects. The + // GUI already declines to create a prism unless more than one filament is + // in use, so this case is a stale prism, not a hot path -- leave it whole + // rather than risk a zero-layer object. if (last_tc_z >= 0.) for (PrintObject *po : m_objects) if (po->config().belt_purge_tower_object.value && !po->layers().empty()) { @@ -251,9 +284,25 @@ void Print::_plan_belt_purge() current_extruder_id = extruder_id; } - // Do not destructively remove unclaimed fill entities here. psWipeTower - // can rerun without regenerating infill, and a later tool ordering may - // need entities that were unclaimed by the previous plan. + // Plastic saving: drop the prism's fills that no toolchange on this layer + // claimed. At this point the prism's OVERRIDDEN fills are exactly the + // purge; the rest would print as solid infill in the prism's own filament + // for nothing -- which is the whole prism on a layer with no toolchange + // (141 of 692 layers on MCTEST5 before the truncation fix). Perimeters are + // left alone so the bar keeps a continuous wall along the belt. + // + // Non-destructive: the entities are stashed with their positions and put + // back by belt_restore_dropped_fills() at the top of the next plan. An + // earlier version deleted them outright, which broke replanning when a + // later tool ordering needed what this one had not claimed -- that is why + // it was removed rather than kept. + if (prism_po != nullptr) { + const auto &we = layer_tools.wiping_extrusions(); + prism_po->belt_drop_unclaimed_fills( + prism_po->get_layer_at_printz(layer_tools.print_z, EPSILON), + [&we, prism_po](const ExtrusionEntity *e) { return we.is_entity_overridden(e, prism_po, 0); }); + } + layer_tools.wiping_extrusions().ensure_perimeters_infills_order(*this); if (layer_leftover > 0.f) { total_leftover += layer_leftover; @@ -330,6 +379,56 @@ size_t PrintObject::belt_truncate_layers_above(coordf_t z) return removed; } +// Plastic saving on the purge prism: keep only the fills a toolchange claimed. +// +// Called per layer from _plan_belt_purge(), after the real-purge marking and +// BEFORE ensure_perimeters_infills_order() -- that pass force-overrides every +// remaining fill on the prism (it is a dedicated flush object), so afterwards +// everything looks claimed and nothing could be distinguished. +size_t PrintObject::belt_drop_unclaimed_fills(Layer *layer, const std::function &claimed) +{ + if (layer == nullptr) + return 0; + size_t dropped = 0; + for (size_t ri = 0; ri < layer->regions().size(); ++ri) { + LayerRegion *lr = layer->get_region(ri); + auto &ents = lr->fills.entities; + ExtrusionEntitiesPtr keep; + keep.reserve(ents.size()); + for (size_t i = 0; i < ents.size(); ++i) { + if (claimed(ents[i])) { + keep.emplace_back(ents[i]); + } else { + // Stash with its original index so the restore is exact. + m_belt_dropped_fills.push_back(BeltDroppedFill{ layer, ri, i, ents[i] }); + ++dropped; + } + } + ents = std::move(keep); + } + return dropped; +} + +void PrintObject::belt_restore_dropped_fills() +{ + if (m_belt_dropped_fills.empty()) + return; + // Ascending index per (layer, region): inserting in that order lands every + // entity back at its original position, because each insertion shifts only + // the entries after it, which are themselves still to be inserted. + std::stable_sort(m_belt_dropped_fills.begin(), m_belt_dropped_fills.end(), + [](const BeltDroppedFill &a, const BeltDroppedFill &b) { + if (a.layer != b.layer) return a.layer < b.layer; + if (a.region_idx != b.region_idx) return a.region_idx < b.region_idx; + return a.index < b.index; + }); + for (const BeltDroppedFill &d : m_belt_dropped_fills) { + auto &ents = d.layer->get_region(d.region_idx)->fills.entities; + ents.insert(ents.begin() + std::min(d.index, ents.size()), d.entity); + } + m_belt_dropped_fills.clear(); +} + void PrintObject::belt_restore_truncated_layers() { if (m_belt_truncated_layers.empty()) diff --git a/src/libslic3r/GCode/ToolOrdering.hpp b/src/libslic3r/GCode/ToolOrdering.hpp index f38cb4bdc8..9ccf6e90fb 100644 --- a/src/libslic3r/GCode/ToolOrdering.hpp +++ b/src/libslic3r/GCode/ToolOrdering.hpp @@ -74,13 +74,17 @@ public: void set_layer_tools_ptr(const LayerTools* lt) { m_layer_tools = lt; } -private: - // Returns true if entity is not printed with its usual extruder for a given copy. + // Returns true if entity is not printed with its usual extruder for a given + // copy -- i.e. it was claimed as a wiping/purge extrusion. Public because the + // belt purge prism uses it to tell which of its fills actually carry purge + // from the ones that are unclaimed waste (Print::_plan_belt_purge()). bool is_entity_overridden(const ExtrusionEntity* entity, const PrintObject *object, size_t copy_id) const { auto it = entity_map.find(std::make_tuple(entity, object)); return it != entity_map.end() && copy_id < it->second.size() && it->second[copy_id] != -1; } +private: + int first_nonsoluble_extruder_on_layer(const PrintConfig& print_config) const; int last_nonsoluble_extruder_on_layer(const PrintConfig& print_config) const; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 86272e612c..1fc92aa9fc 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -2490,6 +2490,19 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) if (m_objects.empty()) return; + // Belt purge prism: _plan_belt_purge() (psWipeTower) truncates the prism's + // layers and drops its unclaimed fills, stashing both so a replan can undo + // them. The object steps below regenerate per-layer content over m_layers + // ONLY, so if any of them is about to rerun the stashes must go back first; + // otherwise truncated layers keep stale perimeters/fills and dropped fills + // are re-inserted next to freshly generated ones. Every object-step + // invalidation also invalidates psWipeTower, so "psWipeTower not done" is + // exactly "some object step may rerun" -- and when it IS done nothing below + // regenerates, and the plan's edits have to stay. + if (!this->is_step_done(psWipeTower)) + for (PrintObject *obj : m_objects) + obj->belt_undo_purge_plan(); + for (PrintObject *obj : m_objects) obj->clear_shared_object(); diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index f3da337bb7..638bb93105 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -582,6 +582,28 @@ private: // Wipe-tower-only invalidations do not necessarily reslice the object, so // truncation must be reversible when later toolchanges move upward. void belt_restore_truncated_layers(); + // Belt purge prism, plastic saving: drop the fills on one layer that no + // toolchange claimed. `claimed` reports whether an entity was overridden as + // purge; everything else on that layer would otherwise print as solid infill + // in the prism's own filament for nothing. Perimeters are never touched, so + // the bar keeps a continuous wall along the belt. + // + // Entities are STASHED, not deleted, with their original positions -- the + // same reversibility contract belt_truncate_layers_above() has, and the + // reason the original version of this had to be removed: psWipeTower can + // rerun without regenerating infill, and a later tool ordering may claim what + // this one did not. Returns the number of entities dropped. + size_t belt_drop_unclaimed_fills(Layer *layer, const std::function &claimed); + // Put every stashed fill back at its original index. Must run before a replan. + void belt_restore_dropped_fills(); + // Undo every edit _plan_belt_purge() made to this object's layers, leaving + // m_layers exactly as the object steps produced it. Fills first: they point + // into layers that are still live, and truncated layers were stashed whole + // with their own fills untouched, so the two stashes never share an entity. + // Print::process() calls this before any object step may rerun (those steps + // regenerate per-layer content over m_layers only, so a stale stash would + // otherwise be restored on top of fresh content); the plan calls it too. + void belt_undo_purge_plan() { belt_restore_dropped_fills(); belt_restore_truncated_layers(); } //BBS ExPolygons _shrink_contour_holes(double contour_delta, double hole_delta, const ExPolygons& polys) const; // BBS @@ -625,6 +647,16 @@ private: SlicingParameters m_slicing_params; LayerPtrs m_layers; LayerPtrs m_belt_truncated_layers; + // Fills removed by belt_drop_unclaimed_fills(), owned by this vector until + // restored or until clear_layers() deletes them. An entity is in exactly one + // of the live collection or this stash, never both. + struct BeltDroppedFill { + Layer *layer { nullptr }; + size_t region_idx { 0 }; + size_t index { 0 }; // position in the original fills.entities + ExtrusionEntity *entity { nullptr }; + }; + std::vector m_belt_dropped_fills; SupportLayerPtrs m_support_layers; // Belt brim, generated in posSupportMaterial by BeltBrim.cpp. Object-local // slicing frame, one entry per object layer plus a prologue of brim-only diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 6d9bfba090..2f02588d37 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1119,6 +1119,13 @@ void PrintObject::clear_layers() for (Layer *l : m_belt_truncated_layers) delete l; m_belt_truncated_layers.clear(); + // Fills dropped for plastic saving are owned by the stash while they sit + // outside their layer's collection, so they are freed here too. Order + // matters only in that these point at layers deleted just above, and we + // never dereference the layer -- just the entity. + for (const BeltDroppedFill &d : m_belt_dropped_fills) + delete d.entity; + m_belt_dropped_fills.clear(); } } From a43043069075b56c4a1bcbdc9d8b22217b3eb936 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 12 Sep 2026 22:23:14 -0500 Subject: [PATCH 112/389] Belt: size the purge prism against physical filaments, not mixed slots A mixed filament slot is virtual: ToolOrdering::resolve_mixed_filaments() replaces it with its physical components before any G-code is emitted, so the toolchanges the prism has to absorb are between those components. ensure_belt_purge_tower() counted the slot as a filament of its own, provisioning one island per mixed slot that no swap can ever reach -- the "extra purge tower" on MCTEST5, where filament 5 is a 50/50 blend of 2 and 4 and the G-code reports 0.00 g of it used. Expand the assigned set with the same expand_mixed_filaments() the backend uses, so the GUI sizes the prism against the filament set the slicer actually produces. No-op when nothing is mixed. Test covers the MCTEST5 shape, a mixed slot whose components are otherwise unused, and the no-mixing case. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01SsuY8Laiyh7q2zPVVKV3HZ --- src/slic3r/GUI/BeltPurgeTower.cpp | 34 +++++++++++++++++++ tests/libslic3r/test_filament_mixer.cpp | 44 +++++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/src/slic3r/GUI/BeltPurgeTower.cpp b/src/slic3r/GUI/BeltPurgeTower.cpp index 8c5764072e..1882363d27 100644 --- a/src/slic3r/GUI/BeltPurgeTower.cpp +++ b/src/slic3r/GUI/BeltPurgeTower.cpp @@ -9,6 +9,7 @@ #include "libslic3r/Preset.hpp" #include "libslic3r/PresetBundle.hpp" #include "libslic3r/PrintConfig.hpp" +#include "libslic3r/FilamentMixer.hpp" #include "libslic3r/TriangleMesh.hpp" #include "libslic3r/Geometry.hpp" #include "libslic3r/BoundingBox.hpp" @@ -131,6 +132,39 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object } } + // A mixed filament slot is VIRTUAL: it never reaches a nozzle. At slice time + // ToolOrdering::resolve_mixed_filaments() replaces it with its physical + // components, so the toolchanges the prism has to absorb are between those + // components, not to the mixed slot itself. Counting the slot as a filament + // of its own therefore over-provisions the prism by one island per mixed slot + // -- the "extra purge tower" -- and, when every component is already used by + // another object, by an island that can never be reached at all. + // + // Expand here with the same helper the backend uses (Print.cpp's sequential + // path), so the GUI sizes the prism against the same filament set the slicer + // will actually produce. No-op when no filament is mixed. + { + // Copies, not references: a ternary with an empty-vector fallback would bind + // a reference to a temporary. + std::vector is_mixed; + std::vector comp_strs; + if (const auto *o = full_cfg.option("filament_is_mixed")) + is_mixed = o->values; + if (const auto *o = full_cfg.option("filament_mixed_components")) + comp_strs = o->values; + if (has_any_mixed_filament(is_mixed)) { + std::vector zero_based; + zero_based.reserve(filaments.size()); + for (int f : filaments) + if (f > 0) + zero_based.push_back((unsigned int) (f - 1)); + zero_based = expand_mixed_filaments(zero_based, is_mixed, comp_strs); + filaments.clear(); + for (unsigned int f : zero_based) + filaments.insert((int) f + 1); + } + } + const bool wanted = belt && prime_tower_enabled && !by_object && have_objects && filaments.size() > 1; if (!wanted) { sig = BeltPurgeSignature{}; diff --git a/tests/libslic3r/test_filament_mixer.cpp b/tests/libslic3r/test_filament_mixer.cpp index ade0c910dc..31bcb09526 100644 --- a/tests/libslic3r/test_filament_mixer.cpp +++ b/tests/libslic3r/test_filament_mixer.cpp @@ -57,6 +57,50 @@ TEST_CASE("expand_mixed_filaments replaces mixed slots with their components", " } } +TEST_CASE("belt purge tower island count ignores virtual mixed slots", "[FilamentMixer][belt]") +{ + // Regression for the "extra purge tower" on a belt printer with a mixed + // filament (MCTEST5). The belt purge prism is sized as + // n_islands = used_filaments.size() - 1 + // and GUI::ensure_belt_purge_tower() collected those filaments straight off + // the model objects' extruder assignments. A mixed slot is VIRTUAL -- no + // nozzle carries it, and ToolOrdering::resolve_mixed_filaments() replaces it + // with its components before any G-code is emitted -- so counting it as a + // filament of its own provisions one island that can never be reached. + // + // MCTEST5: five cubes on extruders 1..5, where filament 5 is a 50/50 blend of + // filaments 2 and 4. The G-code uses only T0..T3 and reports + // "filament used [g] = 53.35, 141.11, 40.84, 107.23, 0.00" -- filament 5 + // consumes nothing, exactly as a virtual slot should. + const std::vector is_mixed = {0, 0, 0, 0, 1}; + const std::vector comp_strs = {"", "", "", "", "2,4"}; + + // The set the sizer used to see: slots 0..4 (filaments 1..5). + const std::vector assigned = {0, 1, 2, 3, 4}; + const auto physical = expand_mixed_filaments(assigned, is_mixed, comp_strs); + + // Slot 4 dissolves into 1 and 3, which are already present. + REQUIRE(physical == std::vector({0, 1, 2, 3})); + + // Four physical filaments => three transitions => three islands, not four. + REQUIRE(int(physical.size()) - 1 == 3); + REQUIRE(int(assigned.size()) - 1 == 4); // what it produced before the fix + + SECTION("A mixed slot whose components are otherwise unused still counts them") { + // Only the mixed slot is assigned: it must still yield its two components, + // i.e. one island, rather than collapsing to zero. + const auto only_mixed = expand_mixed_filaments({4}, is_mixed, comp_strs); + REQUIRE(only_mixed == std::vector({1, 3})); + REQUIRE(int(only_mixed.size()) - 1 == 1); + } + + SECTION("No mixed filaments anywhere leaves the set untouched") { + const std::vector none_mixed = {0, 0, 0, 0, 0}; + REQUIRE_FALSE(has_any_mixed_filament(none_mixed)); + REQUIRE(expand_mixed_filaments(assigned, none_mixed, {"", "", "", "", ""}) == assigned); + } +} + TEST_CASE("check_mixed_filament_integrity flags dangling component references", "[FilamentMixer]") { const std::vector is_mixed = {0, 0, 1}; From 9c83631d2061091eab5c2a0d70607a2195071ba8 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 12 Sep 2026 22:23:14 -0500 Subject: [PATCH 113/389] TreeSupport: drop the include left over from removed debug output Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01SsuY8Laiyh7q2zPVVKV3HZ --- src/libslic3r/Support/TreeSupport.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index d472681c41..0b8eed9f6b 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -13,7 +13,6 @@ #include "SVG.hpp" #include "TreeSupportCommon.hpp" #include "TreeSupport.hpp" -#include #include "TreeSupport3D.hpp" #include "BeltFloorContext.hpp" #include From 6873267a9cb79f0829048983f662a1fedf54d6a7 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 15:56:00 +0800 Subject: [PATCH 114/389] Remove Plate Tilt Keys from Per-Object Settings Tables build_plate_tilt_x/y are printer-preset keys; listing them in the per-object frequent-settings and object-table bundles stored ignored values in object configs and crashed the object table on the process config lookup. --- src/slic3r/GUI/GUI_Factories.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 30fdfc0d04..6a47d5ad2f 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -63,7 +63,6 @@ static SettingsFactory::Bundle FREQ_SETTINGS_BUNDLE_FFF = { L("Support") , { "enable_support", "support_type", "support_threshold_angle", "support_threshold_overlap", "support_base_pattern", "support_on_build_plate_only","support_critical_regions_only", "support_remove_small_overhang", - "build_plate_tilt_x", "build_plate_tilt_y", "support_base_pattern_spacing", "support_expansion"}}, //BBS { L("Flush options") , { "flush_into_infill", "flush_into_objects", "flush_into_support"} } @@ -93,8 +92,7 @@ std::map> SettingsFactory::OBJECT_C {"support_bottom_z_distance", "",22},{"support_top_z_distance", "",23},{"support_base_pattern", "",24},{"support_base_pattern_spacing", "",25}, {"support_interface_top_layers", "",26},{"support_interface_bottom_layers", "",27},{"support_interface_spacing", "",28},{"support_bottom_interface_spacing", "",29}, {"support_object_xy_distance", "",30}, {"bridge_no_support", "",31},{"max_bridge_length", "",32},{"support_critical_regions_only", "",33},{"support_remove_small_overhang","",34}, - {"build_plate_tilt_x","",35},{"build_plate_tilt_y","",36}, - {"support_object_first_layer_gap","",37} + {"support_object_first_layer_gap","",35} }}, { L("Speed"), {{"support_speed", "",12}, {"support_interface_speed", "",13} }} From 9cca3093ee960ad6772cdb025ac5a9b9a7d2e504 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 15:59:19 +0800 Subject: [PATCH 115/389] Keep the Plate Offset When Swapping in the Belt Writer The belt writer replaced the plate-offset-carrying writer mid-export, so belt G-code for any plate but the first kept the plate origin and long-travel clipping used the wrong frame. GCode now remembers the offset and hands it to the new writer, and the writer's first-layer probes use the plate-local point it emits. --- src/libslic3r/BeltGCode.cpp | 1 + src/libslic3r/BeltGCodeWriter.cpp | 7 ++++--- src/libslic3r/GCode.hpp | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index 3ba2f79e55..b6108ea78e 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -15,6 +15,7 @@ void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) // Axis remap and build volume max are set by base GCode after init_belt_writer returns. belt_writer->set_belt_back_transform(print.config()); belt_writer->set_machine_frame_transform(print.config()); + belt_writer->set_xy_offset(m_gcode_offset.x(), m_gcode_offset.y()); m_writer = std::move(belt_writer); } diff --git a/src/libslic3r/BeltGCodeWriter.cpp b/src/libslic3r/BeltGCodeWriter.cpp index 4824d76f69..a1902f2db4 100644 --- a/src/libslic3r/BeltGCodeWriter.cpp +++ b/src/libslic3r/BeltGCodeWriter.cpp @@ -85,7 +85,7 @@ std::string BeltGCodeWriter::travel_to_xy(const Vec2d &point, const std::string w.emit_xyz(machine); const bool first_layer_for_point = belt_point_on_first_layer( m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, - Vec3d(point.x(), point.y(), m_pos.z())); + Vec3d(point_on_plate.x(), point_on_plate.y(), m_pos.z())); auto speed = first_layer_for_point ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) : this->config.travel_speed.get_at(m_cached_extruder_idx); @@ -115,7 +115,7 @@ std::string BeltGCodeWriter::_travel_to_z(double z, const std::string &comment) if (speed == 0.) { const bool first_layer_for_point = belt_point_on_first_layer( m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, - Vec3d(m_pos.x(), m_pos.y(), z)); + Vec3d(m_pos.x() - m_x_offset, m_pos.y() - m_y_offset, z)); speed = first_layer_for_point ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) : this->config.travel_speed.get_at(m_cached_extruder_idx); } @@ -181,7 +181,8 @@ std::string BeltGCodeWriter::travel_to_xyz(const Vec3d &point, const std::string Vec3d dest_point = point; const bool first_layer_for_point = belt_point_on_first_layer( - m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, point); + m_first_layer_plane, m_first_layer_thickness_mm, m_is_first_layer, + Vec3d(point.x() - m_x_offset, point.y() - m_y_offset, point.z())); auto travel_speed = first_layer_for_point ? this->config.get_abs_value_at("initial_layer_travel_speed", m_cached_extruder_idx) : this->config.travel_speed.get_at(m_cached_extruder_idx); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 17a7ce4608..34b0774b34 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -228,7 +228,7 @@ public: void do_export(Print* print, const char* path, GCodeProcessorResult* result = nullptr, ThumbnailsGeneratorCallback thumbnail_cb = nullptr); void export_layer_filaments(GCodeProcessorResult* result); //BBS: set offset for gcode writer - void set_gcode_offset(double x, double y) { m_writer->set_xy_offset(x, y); m_processor.set_xy_offset(x, y);} + void set_gcode_offset(double x, double y) { m_gcode_offset = Vec2d(x, y); m_writer->set_xy_offset(x, y); m_processor.set_xy_offset(x, y);} // Exported for the helper classes (OozePrevention, Wipe) and for the Perl binding for unit tests. const Vec2d& origin() const { return m_origin; } @@ -767,6 +767,8 @@ protected: // printers without a Z-axis shear; in that case all per-path plane // checks short-circuit to the legacy Layer::id() == 0 path. std::unique_ptr m_first_layer_plane; + // Plate origin, kept so a writer replaced during export can be given it again. + Vec2d m_gcode_offset{ Vec2d::Zero() }; std::unique_ptr m_pressure_equalizer; From 509283100709d8653e801a0e95331a50b8ab613b Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Sun, 13 Sep 2026 16:28:09 +0800 Subject: [PATCH 116/389] Apply the Belt Slicing Transform to Painted Supports and Seams Painted support/seam facets, support volumes, seam occlusion, MMU and fuzzy skin painting (top/bottom and side facets) and the adaptive infill octree used trafo_centered(), or trafo() with a centre-offset shift, while the layers were sliced with the belt rotation, remap and Z lift; they now share PrintObject::trafo_sliced(). --- src/libslic3r/GCode/SeamPlacer.cpp | 4 ++-- src/libslic3r/MultiMaterialSegmentation.cpp | 11 ++++++----- src/libslic3r/Print.hpp | 3 +++ src/libslic3r/PrintObject.cpp | 10 +++++++--- src/libslic3r/PrintObjectSlice.cpp | 9 ++++++++- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/libslic3r/GCode/SeamPlacer.cpp b/src/libslic3r/GCode/SeamPlacer.cpp index 35bc436d5a..7562c7745d 100644 --- a/src/libslic3r/GCode/SeamPlacer.cpp +++ b/src/libslic3r/GCode/SeamPlacer.cpp @@ -627,7 +627,7 @@ void compute_global_occlusion(GlobalModelInfo &result, const PrintObject *po, SeamPosition seam_position = spAligned) { BOOST_LOG_TRIVIAL(debug) << "SeamPlacer: gather occlusion meshes: start"; - auto obj_transform = po->trafo_centered(); + auto obj_transform = po->trafo_sliced(); indexed_triangle_set triangle_set; indexed_triangle_set negative_volumes_set; //add all parts @@ -712,7 +712,7 @@ void gather_enforcers_blockers(GlobalModelInfo &result, const PrintObject *po) { BOOST_LOG_TRIVIAL(debug) << "SeamPlacer: build AABB trees for raycasting enforcers/blockers: start"; - auto obj_transform = po->trafo_centered(); + auto obj_transform = po->trafo_sliced(); for (const ModelVolume *mv : po->model_object()->volumes) { if (mv->is_seam_painted()) { diff --git a/src/libslic3r/MultiMaterialSegmentation.cpp b/src/libslic3r/MultiMaterialSegmentation.cpp index 6f80f7b759..0016d96ac2 100644 --- a/src/libslic3r/MultiMaterialSegmentation.cpp +++ b/src/libslic3r/MultiMaterialSegmentation.cpp @@ -1215,7 +1215,7 @@ static inline std::vector> segmentation_top_and_bottom_l // project downards pointing painted triangles over bottom surfaces. std::vector> top_raw(num_facets_states), bottom_raw(num_facets_states); std::vector zs = zs_from_layers(layers); - Transform3d object_trafo = print_object.trafo_centered(); + Transform3d object_trafo = print_object.trafo_sliced(); #ifdef MM_SEGMENTATION_DEBUG_TOP_BOTTOM static int iRun = 0; @@ -2039,17 +2039,19 @@ std::vector> segmentation_by_painting(const PrintObject } BOOST_LOG_TRIVIAL(debug) << "Print object segmentation - Projection of painted triangles - Begin"; + // The layers were sliced in this frame (belt rotation, remap and Z lift included), and it already centers the object. + const Transform3d object_trafo = print_object.trafo_sliced(); for (const ModelVolume *mv : print_object.model_object()->volumes) { const ModelVolumeFacetsInfo facets_info = extract_facets_info(*mv); - tbb::parallel_for(tbb::blocked_range(1, num_facets_states), [&mv, &print_object, &facets_info, &layers, &edge_grids, &painted_lines, &painted_lines_mutex, &input_expolygons, &throw_on_cancel_callback](const tbb::blocked_range &range) { + tbb::parallel_for(tbb::blocked_range(1, num_facets_states), [&mv, &object_trafo, &facets_info, &layers, &edge_grids, &painted_lines, &painted_lines_mutex, &input_expolygons, &throw_on_cancel_callback](const tbb::blocked_range &range) { for (size_t extruder_idx = range.begin(); extruder_idx < range.end(); ++extruder_idx) { throw_on_cancel_callback(); const indexed_triangle_set custom_facets = facets_info.facets_annotation.get_facets(*mv, EnforcerBlockerType(extruder_idx)); if (!mv->is_model_part() || custom_facets.indices.empty()) continue; - const Transform3f tr = print_object.trafo().cast() * mv->get_matrix().cast(); - tbb::parallel_for(tbb::blocked_range(0, custom_facets.indices.size()), [&tr, &custom_facets, &print_object, &layers, &edge_grids, &input_expolygons, &painted_lines, &painted_lines_mutex, &extruder_idx](const tbb::blocked_range &range) { + const Transform3f tr = (object_trafo * mv->get_matrix()).cast(); + tbb::parallel_for(tbb::blocked_range(0, custom_facets.indices.size()), [&tr, &custom_facets, &layers, &edge_grids, &input_expolygons, &painted_lines, &painted_lines_mutex, &extruder_idx](const tbb::blocked_range &range) { for (size_t facet_idx = range.begin(); facet_idx < range.end(); ++facet_idx) { float min_z = std::numeric_limits::max(); float max_z = std::numeric_limits::lowest(); @@ -2102,7 +2104,6 @@ std::vector> segmentation_by_painting(const PrintObject Line line_to_test(Point(scale_(line_start_f.x()), scale_(line_start_f.y())), Point(scale_(line_end_f.x()), scale_(line_end_f.y()))); - line_to_test.translate(-print_object.center_offset()); // BoundingBoxes for EdgeGrids are computed from printable regions. It is possible that the painted line (line_to_test) could // be outside EdgeGrid's BoundingBox, for example, when the negative volume is used on the painted area (GH #7618). diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index c387dcd552..a801e0688f 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -359,6 +359,9 @@ public: // Trafo with the center_offset() applied after the transformation, to center the object in XY before slicing. Transform3d trafo_centered() const { Transform3d t = this->trafo(); t.pretranslate(Vec3d(- unscale(m_center_offset.x()), - unscale(m_center_offset.y()), 0)); return t; } + // trafo_centered() with the belt pre-slice transforms applied: the frame the layers were sliced in (Layer::slice_z). + // Equal to trafo_centered() unless a belt rotation or pre-slice remap is active. + Transform3d trafo_sliced() const; const PrintInstances& instances() const { return m_instances; } PrintInstances &instances() { return m_instances; } diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index ac7f34baa7..275998018d 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1101,7 +1101,10 @@ std::pair PrintObject::prepare indexed_triangle_set mesh = this->model_object()->raw_indexed_triangle_set(); // Rotate mesh and build octree on it with axis-aligned (standart base) cubes. auto to_octree = transform_to_octree().toRotationMatrix(); - its_transform(mesh, to_octree * this->trafo_centered(), true); + // Overhangs below are placed at Layer::bottom_z(), which includes the belt global Z offset. + Transform3d object_trafo = this->trafo_sliced(); + object_trafo.translation().z() += m_belt_global_z_offset; + its_transform(mesh, to_octree * object_trafo, true); // Triangulate internal bridging surfaces. std::vector> overhangs(std::max(surfaces_w_bottom_z.size(), size_t(1))); @@ -5124,6 +5127,7 @@ static void project_triangles_to_slabs(ConstLayerPtrsAdaptor layers, const index void PrintObject::project_and_append_custom_facets( bool seam, EnforcerBlockerType type, std::vector& out, std::vector>* vertical_points) const { + const Transform3d object_trafo = this->trafo_sliced(); for (const ModelVolume* mv : this->model_object()->volumes) if (mv->is_model_part()) { const indexed_triangle_set custom_facets = seam @@ -5132,12 +5136,12 @@ void PrintObject::project_and_append_custom_facets( if (! custom_facets.indices.empty()) { if (seam) project_triangles_to_slabs(this->layers(), custom_facets, - (this->trafo_centered() * mv->get_matrix()).cast(), + (object_trafo * mv->get_matrix()).cast(), seam, out); else { std::vector projected; // Support blockers or enforcers. Project downward facing painted areas upwards to their respective slicing plane. - slice_mesh_slabs(custom_facets, zs_from_layers(this->layers()), this->trafo_centered() * mv->get_matrix(), nullptr, &projected, vertical_points, [](){}); + slice_mesh_slabs(custom_facets, zs_from_layers(this->layers()), object_trafo * mv->get_matrix(), nullptr, &projected, vertical_points, [](){}); // Merge these projections with the output, layer by layer. assert(! projected.empty()); assert(out.empty() || out.size() == projected.size()); diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 2b6c4ffcff..8360a9562f 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1806,6 +1806,13 @@ ExPolygons PrintObject::_shrink_contour_holes(double contour_delta, double hole_ return union_ex(new_ex_polys); } +Transform3d PrintObject::trafo_sliced() const +{ + Transform3d trafo = this->trafo_centered(); + BeltSliceStrategy::apply_preslice_transforms(trafo, this->print()->config(), this->model_object()->volumes); + return trafo; +} + std::vector PrintObject::slice_support_volumes(const ModelVolumeType model_volume_type) const { auto it_volume = this->model_object()->volumes.begin(); @@ -1820,7 +1827,7 @@ std::vector PrintObject::slice_support_volumes(const ModelVolumeType m const Print *print = this->print(); auto throw_on_cancel_callback = std::function([print](){ print->throw_if_canceled(); }); MeshSlicingParamsEx params; - params.trafo = this->trafo_centered(); + params.trafo = this->trafo_sliced(); for (; it_volume != it_volume_end; ++ it_volume) if ((*it_volume)->type() == model_volume_type) { std::vector slices2 = slice_volume(*(*it_volume), zs, params, throw_on_cancel_callback); From 6e33f3f5dd11dee5250188b6acc540442fb1295c Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 15:58:45 +0800 Subject: [PATCH 117/389] Share and Clamp the Build Plate Tilt Shift in Support Generators The three support generators each computed lh * tan(tilt), which overflows coord_t at 90 degrees and flips sign beyond it (belt sync can write up to 180). One helper now returns the tilt slope with the tilt capped at 89 degrees. --- src/libslic3r/Support/SupportCommon.cpp | 6 ++++++ src/libslic3r/Support/SupportCommon.hpp | 4 ++++ src/libslic3r/Support/SupportMaterial.cpp | 10 +++------- src/libslic3r/Support/TreeSupport.cpp | 10 +++------- src/libslic3r/Support/TreeSupport3D.cpp | 12 ++++-------- 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/libslic3r/Support/SupportCommon.cpp b/src/libslic3r/Support/SupportCommon.cpp index 27ac9b24d1..0c3d570b1d 100644 --- a/src/libslic3r/Support/SupportCommon.cpp +++ b/src/libslic3r/Support/SupportCommon.cpp @@ -2069,4 +2069,10 @@ sub clip_with_shape { } */ +Vec2d build_plate_tilt_slope(const PrintConfig &print_config) +{ + auto slope = [](double tilt_deg) { return std::tan(Geometry::deg2rad(std::clamp(tilt_deg, -89., 89.))); }; + return { slope(print_config.build_plate_tilt_y.value), slope(print_config.build_plate_tilt_x.value) }; +} + } // namespace Slic3r diff --git a/src/libslic3r/Support/SupportCommon.hpp b/src/libslic3r/Support/SupportCommon.hpp index f15c7d417a..4374986a3e 100644 --- a/src/libslic3r/Support/SupportCommon.hpp +++ b/src/libslic3r/Support/SupportCommon.hpp @@ -150,6 +150,10 @@ Polygons belt_floor_surface_polygon( const SlicingParameters &slicing_params, const PrintConfig &print_config, const PrintObject &object, coordf_t print_z); +// Build plate tilt: XY drift of gravity per unit of layer height, zero on a level plate. +// The tilt is capped below 90 degrees to keep the drift finite. +Vec2d build_plate_tilt_slope(const PrintConfig &print_config); + } // namespace Slic3r #endif /* slic3r_SupportCommon_hpp_ */ diff --git a/src/libslic3r/Support/SupportMaterial.cpp b/src/libslic3r/Support/SupportMaterial.cpp index c8ac217af2..5d886bcdf0 100644 --- a/src/libslic3r/Support/SupportMaterial.cpp +++ b/src/libslic3r/Support/SupportMaterial.cpp @@ -1438,9 +1438,8 @@ static inline ExPolygons detect_overhangs( const bool bridge_no_support = object_config.bridge_no_support.value; const coordf_t xy_expansion = scale_(object_config.support_expansion.value); // Build plate tilt: compute per-layer XY shift for tilted gravity direction - const double tilt_x_rad = Geometry::deg2rad(print_config.build_plate_tilt_x.value); - const double tilt_y_rad = Geometry::deg2rad(print_config.build_plate_tilt_y.value); - const bool has_tilt = std::abs(tilt_x_rad) > EPSILON || std::abs(tilt_y_rad) > EPSILON; + const Vec2d tilt_slope = build_plate_tilt_slope(print_config); + const bool has_tilt = tilt_slope.cwiseAbs().maxCoeff() > EPSILON; float lower_layer_offset = 0; if (layer_id == 0) @@ -1480,10 +1479,7 @@ static inline ExPolygons detect_overhangs( Polygons tilted_lower; if (has_tilt) { tilted_lower = lower_layer_polygons; - const double lh = lower_layer.height; - Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), - coord_t(scale_(lh * tan(tilt_x_rad)))); - translate(tilted_lower, tilt_shift); + translate(tilted_lower, Point::new_scale(tilt_slope * lower_layer.height)); effective_lower = &tilted_lower; } diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 84ae229130..a86aea3536 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -709,9 +709,8 @@ void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) const double threshold_rad = Geometry::deg2rad(thresh_angle); // Build plate tilt: compute per-layer XY shift for tilted gravity direction const PrintConfig& print_cfg = m_object->print()->config(); - const double tilt_x_rad = Geometry::deg2rad(print_cfg.build_plate_tilt_x.value); - const double tilt_y_rad = Geometry::deg2rad(print_cfg.build_plate_tilt_y.value); - const bool has_tilt = std::abs(tilt_x_rad) > EPSILON || std::abs(tilt_y_rad) > EPSILON; + const Vec2d tilt_slope = build_plate_tilt_slope(print_cfg); + const bool has_tilt = tilt_slope.cwiseAbs().maxCoeff() > EPSILON; // FIXME this is a fudge constant! double support_tree_tip_diameter = 0.8; auto enforcer_overhang_offset = scaled(support_tree_tip_diameter); @@ -858,10 +857,7 @@ void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) ExPolygons shifted_lower; if (has_tilt) { shifted_lower = lower_polys; // copy - const double lh = lower_layer->height; - Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), - coord_t(scale_(lh * tan(tilt_x_rad)))); - translate(shifted_lower, tilt_shift); + translate(shifted_lower, Point::new_scale(tilt_slope * lower_layer->height)); } const ExPolygons &effective_lower = has_tilt ? shifted_lower : lower_polys; diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index e02f474420..b5c35bfd6b 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -211,9 +211,8 @@ static std::vector>> group_me // +1 makes the threshold inclusive double tan_threshold = support_threshold_auto ? 0. : tan(M_PI * double(support_threshold + 1) / 180.); // Build plate tilt: compute per-layer XY shift for tilted gravity direction - const double tilt_x_rad = Geometry::deg2rad(print_config.build_plate_tilt_x.value); - const double tilt_y_rad = Geometry::deg2rad(print_config.build_plate_tilt_y.value); - const bool has_tilt = std::abs(tilt_x_rad) > EPSILON || std::abs(tilt_y_rad) > EPSILON; + const Vec2d tilt_slope = build_plate_tilt_slope(print_config); + const bool has_tilt = tilt_slope.cwiseAbs().maxCoeff() > EPSILON; //FIXME this is a fudge constant! auto enforcer_overhang_offset = scaled(config.tree_support_tip_diameter.value); const coordf_t radius_sample_resolution = g_config_tree_support_collision_resolution; @@ -235,7 +234,7 @@ static std::vector>> group_me size_t num_overhang_layers = support_auto ? num_object_layers : std::min(num_object_layers, std::max(size_t(support_enforce_layers), enforcers_layers.size())); tbb::parallel_for(tbb::blocked_range(1, num_overhang_layers), [&print_object, &config, &print_config, &enforcers_layers, &blockers_layers, - support_auto, support_enforce_layers, support_threshold_auto, tan_threshold, enforcer_overhang_offset, num_raft_layers, radius_sample_resolution, has_tilt, tilt_x_rad, tilt_y_rad, &throw_on_cancel, &out] + support_auto, support_enforce_layers, support_threshold_auto, tan_threshold, enforcer_overhang_offset, num_raft_layers, radius_sample_resolution, has_tilt, tilt_slope, &throw_on_cancel, &out] (const tbb::blocked_range &range) { for (LayerIndex layer_id = range.begin(); layer_id < range.end(); ++ layer_id) { const Layer ¤t_layer = *print_object.get_layer(layer_id); @@ -263,10 +262,7 @@ static std::vector>> group_me Polygons lower_layer_offseted; if (has_tilt) { Polygons lower_src = to_polygons(lower_layer.lslices_extrudable); - const double lh = lower_layer.height; - Point tilt_shift(coord_t(scale_(lh * tan(tilt_y_rad))), - coord_t(scale_(lh * tan(tilt_x_rad)))); - translate(lower_src, tilt_shift); + translate(lower_src, Point::new_scale(tilt_slope * lower_layer.height)); lower_layer_offseted = offset(lower_src, lower_layer_offset); } else { lower_layer_offseted = offset(lower_layer.lslices_extrudable, lower_layer_offset); From 4ed56954e8be7e1d9e5fb355628816454d51985b Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 15:59:05 +0800 Subject: [PATCH 118/389] Limit Build Plate Tilt Range Below 90 Degrees A 90 degree tilt has no finite gravity drift per layer, so the option range now stops at 89 degrees, matching the cap applied by the support generators. --- src/libslic3r/PrintConfig.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index ceeb60af92..a6a419a15e 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -7163,8 +7163,8 @@ void PrintConfigDef::init_fff_params() "A negative value tilts the -X side higher. Set to 0 for no X-axis tilt. " "In belt printer mode, this is automatically synced to the belt angle."); def->sidetext = u8"\u00B0"; - def->min = -90; - def->max = 90; + def->min = -89; + def->max = 89; def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(0.)); @@ -7175,8 +7175,8 @@ void PrintConfigDef::init_fff_params() "A positive value tilts the plate so the +Y side is higher, shifting gravity toward -Y and increasing overhangs on the +Y side. " "A negative value tilts the -Y side higher. Set to 0 for no Y-axis tilt."); def->sidetext = u8"\u00B0"; - def->min = -90; - def->max = 90; + def->min = -89; + def->max = 89; def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(0.)); From f2a11928f63f371c92ad8f4a33ae35379e06d3bb Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 20:25:08 +0800 Subject: [PATCH 119/389] Read the Belt Tilt Only from the Belt G-code Header Every printer's config block lists belt_slice_rotation_angle (default 45), so the processor marked all G-code as belt G-code: imported flat G-code got the belt view on a belt printer, and the belt-only Z handling in the processor ran for non-belt prints whose config block precedes the body. Take the angle only from outside the config block, where only the belt header writes it. --- src/libslic3r/GCode/GCodeProcessor.cpp | 16 +++++++-- src/libslic3r/GCode/GCodeProcessor.hpp | 1 + tests/fff_print/CMakeLists.txt | 1 + tests/fff_print/test_gcode_processor.cpp | 46 ++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 tests/fff_print/test_gcode_processor.cpp diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index b2477437b0..33d5b96876 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3586,6 +3586,7 @@ void GCodeProcessor::reset() m_zero_layer_height = 0.0f; m_first_layer_height = 0.0f; m_processing_start_custom_gcode = false; + m_in_config_block = false; m_g1_line_id = 0; m_layer_id = 0; m_cp_color.reset(); @@ -4191,9 +4192,20 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers return; } + if (boost::starts_with(comment, " CONFIG_BLOCK_START")) { + m_in_config_block = true; + return; + } + if (boost::starts_with(comment, " CONFIG_BLOCK_END")) { + m_in_config_block = false; + return; + } + // Belt printer: derive the physical tilt magnitude from the slicing-rotation - // angle header comment (used to enable the preview's belt view). - if (boost::starts_with(comment, " belt_slice_rotation_angle = ")) { + // angle header comment (used to enable the preview's belt view). Only the belt + // header carries it outside the config block; the config block lists the key + // for every printer, belt or not. + if (!m_in_config_block && boost::starts_with(comment, " belt_slice_rotation_angle = ")) { try { m_result.belt_tilt_angle = std::abs(std::stof(std::string(comment.substr(29)))); } catch (...) {} diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 0a8a35a88b..85cc5a7544 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -1194,6 +1194,7 @@ class Print; float m_first_layer_height; // mm float m_zero_layer_height; // mm bool m_processing_start_custom_gcode; + bool m_in_config_block; unsigned int m_g1_line_id; unsigned int m_layer_id; CpColor m_cp_color; diff --git a/tests/fff_print/CMakeLists.txt b/tests/fff_print/CMakeLists.txt index 3247bfda66..59e065ecb8 100644 --- a/tests/fff_print/CMakeLists.txt +++ b/tests/fff_print/CMakeLists.txt @@ -8,6 +8,7 @@ add_executable(${_TEST_NAME}_tests test_extrusion_processor.cpp test_fill.cpp test_flow.cpp + test_gcode_processor.cpp test_gcode_timing.cpp test_gcodewriter.cpp test_model.cpp diff --git a/tests/fff_print/test_gcode_processor.cpp b/tests/fff_print/test_gcode_processor.cpp new file mode 100644 index 0000000000..3998b65547 --- /dev/null +++ b/tests/fff_print/test_gcode_processor.cpp @@ -0,0 +1,46 @@ +#include + +#include "libslic3r/libslic3r.h" +#include "libslic3r/GCode/GCodeProcessor.hpp" +#include "libslic3r/PrintConfig.hpp" + +#include "test_utils.hpp" + +#include +#include + +using namespace Slic3r; +using Catch::Matchers::WithinAbs; + +namespace { + +float processed_belt_tilt(const std::string &gcode) +{ + ScopedTemporaryFile temp(".gcode"); + { + std::ofstream os(temp.string()); + os << gcode; + } + GCodeProcessor proc; + proc.apply_config(FullPrintConfig{}); + proc.process_file(temp.string()); + return proc.get_result().belt_tilt_angle; +} + +constexpr const char *body = "G1 X10 Y10 Z0.2 F3000\nG1 X20 Y10 E1 F1200\n"; + +} // namespace + +TEST_CASE("The config block's belt angle does not mark G-code as belt G-code", "[GCodeProcessor][belt]") +{ + // Every printer's config block lists belt_slice_rotation_angle (default 45), belt or not. + const std::string gcode = std::string("; CONFIG_BLOCK_START\n; belt_printer = 0\n; belt_slice_rotation_angle = 45\n; CONFIG_BLOCK_END\n") + body; + CHECK_THAT(processed_belt_tilt(gcode), WithinAbs(0., 1e-6)); +} + +TEST_CASE("The belt header's angle marks G-code as belt G-code", "[GCodeProcessor][belt]") +{ + const std::string gcode = std::string("; belt_slice_rotation_angle = -45.0\n") + body + + "; CONFIG_BLOCK_START\n; belt_printer = 1\n; belt_slice_rotation_angle = -45\n; CONFIG_BLOCK_END\n"; + CHECK_THAT(processed_belt_tilt(gcode), WithinAbs(45., 1e-6)); +} From 4a7311bf0160e54aa9d912a1d92f06beda8ccb61 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 15:57:58 +0800 Subject: [PATCH 120/389] Rebuild the Brim Type Combobox Only When Its Entries Change toggle_options() now runs on every value change and mode switch; rebuild the brim_type choices only when the leading-edge entry has to be added or removed. --- src/slic3r/GUI/Tab.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 1c03ddf88a..2c1247edb5 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3230,16 +3230,17 @@ void TabPrint::toggle_options() const auto current = m_config->opt_enum("brim_type"); auto &opt = const_cast(field->m_opt); auto cb = dynamic_cast(choice->window); - if (cb != nullptr) { + // Keep the entry if it is already selected, so switching to a non-belt + // printer cannot leave the control showing a value it does not offer. + const bool offer_leading_edge = is_belt_printer || current == btLeadingEdgeOnly; + const bool offered = std::find(opt.enum_values.begin(), opt.enum_values.end(), "leading_edge_only") != opt.enum_values.end(); + if (cb != nullptr && offer_leading_edge != offered) { auto n = cb->GetValue(); opt.enum_values.clear(); opt.enum_labels.clear(); cb->Clear(); for (size_t i = 0; i < def->enum_values.size(); ++ i) { - // Keep the entry if it is already selected, so switching to a non-belt - // printer cannot leave the control showing a value it does not offer. - if (def->enum_values[i] == "leading_edge_only" && ! is_belt_printer - && current != btLeadingEdgeOnly) + if (def->enum_values[i] == "leading_edge_only" && ! offer_leading_edge) continue; opt.enum_values.push_back(def->enum_values[i]); opt.enum_labels.push_back(def->enum_labels[i]); From 3b302b466617e336b6723e294317b06c138b62a6 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 16:04:54 +0800 Subject: [PATCH 121/389] Derive Belt Support Tilt From Slicing Rotation in Print::apply build_plate_tilt_x/y was synced from belt_slice_rotation* only by the printer Tab, so CLI or 3MF edits of the rotation left the support tilt stale. --- src/libslic3r/PrintApply.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index aa5c6aa2bd..0ed85f7fbc 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -1241,6 +1241,17 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", i=%1%, key=%2%")%i %changed_keys[i]; } } + // On belt printers the support tilt follows the slicing rotation. The GUI keeps the two in + // sync, but a CLI or 3MF edit of the rotation alone would otherwise leave supports on a stale tilt. + if (const auto *belt_opt = new_full_config.option("belt_printer"); belt_opt && belt_opt->value) { + const auto *axis_opt = new_full_config.option>("belt_slice_rotation"); + const auto *angle_opt = new_full_config.option("belt_slice_rotation_angle"); + if (axis_opt && angle_opt) { + const auto tilt = BeltTransformPipeline::physical_tilt(axis_opt->value, angle_opt->value); + new_full_config.set_key_value("build_plate_tilt_x", new ConfigOptionFloat(tilt.tilt_x_deg)); + new_full_config.set_key_value("build_plate_tilt_y", new ConfigOptionFloat(tilt.tilt_y_deg)); + } + } const ConfigOption* enable_support_option = new_full_config.option("enable_support"); if (enable_support_option && enable_support_option->getBool()) m_support_used = true; From 708212a306f6f39dd051be81249340572e301047 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Sun, 13 Sep 2026 03:02:21 +0800 Subject: [PATCH 122/389] Share One Belt Brim Band Loop Between Apron-Only and Ordinary Layers The ordinary-layer path kept its own copy of the apron band loop. Give emit_belt_brim_bands() an optional brim filament filter and call it from the per-extruder lambda; without a filter it still prints every band, so apron-only layers are unchanged. --- src/libslic3r/GCode.cpp | 40 ++++++++-------------------------------- src/libslic3r/GCode.hpp | 10 ++++++---- 2 files changed, 14 insertions(+), 36 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 284c815f2d..4c742ed8df 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -5388,7 +5388,8 @@ LayerResult GCode::process_belt_brim_layer( // object layer, takes the ordinary path, and the band would be silently dropped. std::string GCode::emit_belt_brim_bands(const Print &print, const std::vector &layers, - const size_t single_object_instance_idx) + const size_t single_object_instance_idx, + const std::optional extruder_id) { std::string gcode; for (const LayerToPrint <p : layers) { @@ -5396,6 +5397,9 @@ std::string GCode::emit_belt_brim_bands(const Print &print, if (band == nullptr || band->fills.empty() || ltp.original_object == nullptr) continue; const PrintObject &object = *ltp.original_object; + // No filter prints every band; belt_brim_filament() is 1-based. + if (extruder_id && (! object.has_belt_brim() || static_cast(object.belt_brim_filament() - 1) != *extruder_id)) + continue; // Speeds, flow and retraction all read m_config. m_config.apply(print.default_region_config()); m_config.apply(object.config(), true); @@ -6623,39 +6627,11 @@ LayerResult GCode::process_layer( std::set> belt_brim_emitted; // Emit every ORDINARY-layer apron band (belt_brim_prologue band coinciding with an - // object/support layer) whose brim filament is this pass's extruder. Mirrors - // emit_belt_brim_bands() per band, but filtered to one brim filament so each band + // object/support layer) whose brim filament is this pass's extruder, so each band // prints in the correct tool's pass (Finding B). extruder_id is 0-based (the - // reindexed tool domain); belt_brim_filament() is 1-based, so subtract one. + // reindexed tool domain). auto emit_belt_brim_for_extruder = [this, &print, &layers, single_object_instance_idx](unsigned int extruder_id) -> std::string { - std::string gc; - for (const LayerToPrint <p : layers) { - const BeltBrimBand *band = ltp.belt_brim_band; - if (band == nullptr || band->fills.empty() || ltp.original_object == nullptr) - continue; - const PrintObject &object = *ltp.original_object; - if (! object.has_belt_brim() || (unsigned int)(object.belt_brim_filament() - 1) != extruder_id) - continue; - // Speeds, flow and retraction all read m_config. - m_config.apply(print.default_region_config()); - m_config.apply(object.config(), true); - const size_t i_begin = single_object_instance_idx == size_t(-1) ? 0 : single_object_instance_idx; - const size_t i_end = single_object_instance_idx == size_t(-1) ? object.instances().size() - : single_object_instance_idx + 1; - for (size_t i = i_begin; i < i_end && i < object.instances().size(); ++ i) { - // Band geometry is object-local, like the object's own extrusions. - const Point &offset = object.instances()[i].shift; - this->set_origin(unscale(offset)); - this->on_set_origin(&object, offset); - m_avoid_crossing_perimeters.use_external_mp(); - for (const ExtrusionEntity *ee : band->fills.entities) - if (ee != nullptr) - gc += this->extrude_entity(*ee, "brim", NOZZLE_CONFIG(support_speed)); - m_avoid_crossing_perimeters.use_external_mp(false); - m_avoid_crossing_perimeters.disable_once(); - } - } - return gc; + return this->emit_belt_brim_bands(print, layers, single_object_instance_idx, extruder_id); }; for (unsigned int extruder_id : layer_tools.extruders) diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 34b0774b34..23fb563711 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -418,13 +418,15 @@ protected: const bool last_layer, const size_t single_object_instance_idx); - // Emit the apron bands carried by these layers. Called from both the brim-only - // branch and the ordinary path, since a band's print_z can coincide with another - // object's layer on a multi-object belt. + // Emit the apron bands carried by these layers, only those whose brim filament is + // extruder_id (0-based) when given. Called from both the brim-only branch and the + // ordinary path, since a band's print_z can coincide with another object's layer on a + // multi-object belt. std::string emit_belt_brim_bands( const Print &print, const std::vector &layers, - const size_t single_object_instance_idx); + const size_t single_object_instance_idx, + const std::optional extruder_id = std::nullopt); LayerResult process_layer( const Print &print, From 19a085206ca5e7594d295c153e4afb9e113b6aa1 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Sun, 13 Sep 2026 03:02:36 +0800 Subject: [PATCH 123/389] Print Belt Brim Aprons in Each Object's Brim Filament Apron-only layers printed every band with the first tool, so objects with different brim filaments at the same apron Z shared one filament. Emit each brim filament's bands with its own toolchange. --- src/libslic3r/GCode.cpp | 13 +++++++++---- src/libslic3r/GCode.hpp | 9 ++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 4c742ed8df..bc117f5d1b 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -5374,7 +5374,12 @@ LayerResult GCode::process_belt_brim_layer( print.config().layer_change_gcode.value, m_writer->filament()->id(), &config) + "\n"; } - gcode += this->emit_belt_brim_bands(print, layers, single_object_instance_idx); + // Objects sharing this apron Z may use different brim filaments; print each in its own tool. + for (const unsigned int brim_extruder : layer_tools.extruders) { + if (m_writer->filament() == nullptr || m_writer->filament()->id() != brim_extruder) + gcode += this->set_extruder(brim_extruder, print_z); + gcode += this->emit_belt_brim_bands(print, layers, single_object_instance_idx, brim_extruder); + } result.gcode = std::move(gcode); return result; @@ -5389,7 +5394,7 @@ LayerResult GCode::process_belt_brim_layer( std::string GCode::emit_belt_brim_bands(const Print &print, const std::vector &layers, const size_t single_object_instance_idx, - const std::optional extruder_id) + const unsigned int extruder_id) { std::string gcode; for (const LayerToPrint <p : layers) { @@ -5397,8 +5402,8 @@ std::string GCode::emit_belt_brim_bands(const Print &print, if (band == nullptr || band->fills.empty() || ltp.original_object == nullptr) continue; const PrintObject &object = *ltp.original_object; - // No filter prints every band; belt_brim_filament() is 1-based. - if (extruder_id && (! object.has_belt_brim() || static_cast(object.belt_brim_filament() - 1) != *extruder_id)) + // belt_brim_filament() is 1-based. + if (! object.has_belt_brim() || static_cast(object.belt_brim_filament() - 1) != extruder_id) continue; // Speeds, flow and retraction all read m_config. m_config.apply(print.default_region_config()); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 23fb563711..afa7151a5c 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -418,15 +418,14 @@ protected: const bool last_layer, const size_t single_object_instance_idx); - // Emit the apron bands carried by these layers, only those whose brim filament is - // extruder_id (0-based) when given. Called from both the brim-only branch and the - // ordinary path, since a band's print_z can coincide with another object's layer on a - // multi-object belt. + // Emit the apron bands carried by these layers whose brim filament is extruder_id + // (0-based). Called from both the brim-only branch and the ordinary path, since a + // band's print_z can coincide with another object's layer on a multi-object belt. std::string emit_belt_brim_bands( const Print &print, const std::vector &layers, const size_t single_object_instance_idx, - const std::optional extruder_id = std::nullopt); + const unsigned int extruder_id); LayerResult process_layer( const Print &print, From cb5b489e9010c3d0a978749714786d3336a159a3 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 15:57:27 +0800 Subject: [PATCH 124/389] Invalidate Only G-code Export for Belt Output Options gcode_back_transform, first_layer_plane* and belt_printer_infinite_y fell through to invalidate_all_steps(), which re-ran tool ordering, skirt/brim and G-code export on toggles that only affect G-code export. --- src/libslic3r/Print.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index ba838003ea..b97ffed3a2 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -121,6 +121,10 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "gcode_remap_z", // Machine-frame transform (derived from belt tilt; only affects G-code output). "belt_frame_tilt_decouple", "belt_frame_tilt_angle", + "gcode_back_transform", + "first_layer_plane", "first_layer_plane_offset", "first_layer_plane_thickness", + // Only inflates the GUI bed volume, like printable_area. + "belt_printer_infinite_y", //BBS "additional_cooling_fan_speed", "reduce_crossing_wall", From 76aba24ddfeea6249f8902061db1bea3e66f5b12 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 15:59:34 +0800 Subject: [PATCH 125/389] Number Belt Extension Support Layers Sequentially Extension layers were all created with id 0, so every one of them could be taken for the first layer by id-only checks (ooze-prevention standby temperature, cached layer ids). Renumber the support layers after inserting them. --- src/libslic3r/Support/TreeSupport.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index a86aea3536..1f39a56163 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1913,6 +1913,8 @@ void TreeSupport::generate() if (!belt_ext_layers.empty()) { auto &sl_vec = m_object->support_layers(); sl_vec.insert(sl_vec.begin(), belt_ext_layers.begin(), belt_ext_layers.end()); + for (size_t i = 0; i < sl_vec.size(); ++i) + sl_vec[i]->set_id(i); } } } From 33aec258da17c4988d35ada0445a13d48a9531eb Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Mon, 14 Sep 2026 16:42:33 +0800 Subject: [PATCH 126/389] Skip CLI Wipe Tower Reservation on Belt Printers Print::has_wipe_tower() is always false for belt printers, but CLI arrange, plate checks and the pre-slice tower clamp still reserved a phantom tower footprint and wrote a clamped wipe_tower_x/y into the config. --- src/OrcaSlicer.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp index b75c653eda..15c5677485 100644 --- a/src/OrcaSlicer.cpp +++ b/src/OrcaSlicer.cpp @@ -4014,6 +4014,10 @@ int CLI::run(int argc, char **argv) BOOST_LOG_TRIVIAL(info) << boost::format("%1%, set disable_wipe_tower_after_mapping back to false due to wrapping detect")%__LINE__; } + // Belt printers never get the classic wipe tower (see Print::has_wipe_tower()), so reserve no space for it. + const ConfigOptionBool* belt_printer_opt = m_print_config.option("belt_printer"); + const bool is_belt_printer = belt_printer_opt && belt_printer_opt->value; + auto timelapse_type_opt = m_print_config.option("timelapse_type"); bool is_smooth_timelapse = false; if (enable_timelapse && timelapse_type_opt && (timelapse_type_opt->getInt() == TimelapseType::tlSmooth)) @@ -4251,11 +4255,11 @@ int CLI::run(int argc, char **argv) } }; - auto check_plate_wipe_tower = [get_print_sequence, is_smooth_timelapse](Slic3r::GUI::PartPlate* plate, int plate_index, DynamicPrintConfig& print_config, plate_obj_size_info_t &plate_obj_size_info) { + auto check_plate_wipe_tower = [get_print_sequence, is_smooth_timelapse, is_belt_printer](Slic3r::GUI::PartPlate* plate, int plate_index, DynamicPrintConfig& print_config, plate_obj_size_info_t &plate_obj_size_info) { plate_obj_size_info.obj_bbox= plate->get_objects_bounding_box(); BOOST_LOG_TRIVIAL(info) << boost::format("plate %1%, object bbox: min {%2%, %3%, %4%} - max {%5%, %6%, %7%}") %(plate_index+1) %plate_obj_size_info.obj_bbox.min.x() % plate_obj_size_info.obj_bbox.min.y() % plate_obj_size_info.obj_bbox.min.z() %plate_obj_size_info.obj_bbox.max.x() % plate_obj_size_info.obj_bbox.max.y() % plate_obj_size_info.obj_bbox.max.z(); - if (!print_config.has("wipe_tower_x")) { + if (is_belt_printer || !print_config.has("wipe_tower_x")) { plate_obj_size_info.has_wipe_tower = false; BOOST_LOG_TRIVIAL(info) << boost::format("can not found wipe_tower_x in config, set to no wipe tower"); return; @@ -5062,7 +5066,7 @@ int CLI::run(int argc, char **argv) } } - if ((!arrange_cfg.is_seq_print && (assemble_plate.filaments_count > 1))||(enable_wrapping_detect && !current_wrapping_exclude_area.empty())) + if (!is_belt_printer && ((!arrange_cfg.is_seq_print && (assemble_plate.filaments_count > 1)) || (enable_wrapping_detect && !current_wrapping_exclude_area.empty()))) { //prepare the wipe tower int plate_count = partplate_list.get_plate_count(); @@ -5212,7 +5216,7 @@ int CLI::run(int argc, char **argv) bool is_seq_print = false; get_print_sequence(cur_plate, m_print_config, is_seq_print); - if (!is_seq_print && (assemble_plate.filaments_count > 1) && !has_wipe_tower_position) + if (!is_belt_printer && !is_seq_print && (assemble_plate.filaments_count > 1) && !has_wipe_tower_position) { //prepare the wipe tower auto printer_structure_opt = m_print_config.option>("printer_structure"); @@ -5361,7 +5365,7 @@ int CLI::run(int argc, char **argv) //add the virtual object into unselect list if has partplate_list.preprocess_exclude_areas(unselected, enable_wrapping_detect); - if (used_filament_set.size() > 0) + if (!is_belt_printer && used_filament_set.size() > 0) { //prepare the wipe tower int plate_count = partplate_list.get_plate_count(); @@ -5467,7 +5471,7 @@ int CLI::run(int argc, char **argv) BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": found single object mode"); } - if (m_print_config.has("wipe_tower_x") && (is_smooth_timelapse || !arrange_cfg.is_seq_print || (selected.size() <= 1))) { + if (!is_belt_printer && m_print_config.has("wipe_tower_x") && (is_smooth_timelapse || !arrange_cfg.is_seq_print || (selected.size() <= 1))) { float x; float y; if (duplicate_count > 0) { @@ -6037,7 +6041,7 @@ int CLI::run(int argc, char **argv) // The stored (or default) tower position may not fit the tower these plates // need, and no CLI placement site runs on a plain slice - mirror the GUI's // reload clamp and fit every plate's tower into the printable area first. - if (m_print_config.option("enable_prime_tower", true)->value) { + if (!is_belt_printer && m_print_config.option("enable_prime_tower", true)->value) { for (int index = 0; index < partplate_list.get_plate_count(); index++) { if ((plate_to_slice != 0) && (plate_to_slice != (index + 1))) continue; From 5cd66612801e6c851bc09352af05ee9acbc7faec Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 15:59:38 +0800 Subject: [PATCH 127/389] Check the Belt Temperature Tower Model Load Bail out like the other calibration paths when add_model() fails instead of indexing the empty model. --- src/slic3r/GUI/Plater.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 25084e9a9c..b6274ab7a2 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -16556,7 +16556,8 @@ void Plater::calib_temp(const Calib_Params& params) { << ", falling back to 230_190 (embossed numbers will not match)"; asset = calib_dir + "belt_temp_tower_230_190.stl"; } - add_model(false, asset); + if (!add_model(false, asset) || model().objects.empty()) + return; // Place keel-first asset at the belt entry (designed Y = 0) so Z_gcode // starts at 0, centered laterally on the bed, resting on the conveyor. From a8a45439db350cf1f026e70dd017a8b39996f570 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 16:05:40 +0800 Subject: [PATCH 128/389] Share One Build Plate Tilt Up-Direction Helper Across the GUI The bed gravity arrow, volume rendering and the painter/support gizmos each rebuilt the tilt up-vector from build_plate_tilt_x/y; use one helper that also tolerates presets without the keys. --- src/slic3r/GUI/3DBed.cpp | 12 +++--------- src/slic3r/GUI/3DScene.cpp | 12 +----------- src/slic3r/GUI/GUI_App.cpp | 13 +++++++++++++ src/slic3r/GUI/GUI_App.hpp | 2 ++ src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 20 +++----------------- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp | 1 - src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp | 9 +-------- 7 files changed, 23 insertions(+), 46 deletions(-) diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index fa9acffb50..3032059678 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -746,20 +746,14 @@ void Bed3D::render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, co void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix) { - const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; // build_plate_tilt_{x,y} are kept in sync with the belt tilt (see TabPrinter), so // reading them here covers both belt and non-belt tilted printers. - double tilt_x_deg = cfg.opt_float("build_plate_tilt_x"); - double tilt_y_deg = cfg.opt_float("build_plate_tilt_y"); - if (tilt_x_deg == 0. && tilt_y_deg == 0.) { + const Vec3d up_dir = build_plate_tilt_up_direction(); + if (up_dir == Vec3d::UnitZ()) { m_gravity_arrow.reset(); return; } - - // Gravity direction (matching the slicer's tilt convention) - double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); - double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); - Vec3d gravity_dir = Vec3d(-tan(tilt_y_rad), -tan(tilt_x_rad), -1.0).normalized(); + const Vec3d gravity_dir = -up_dir; // Build the arrow model (same dimensions as the axis arrows) if (!m_gravity_arrow.is_initialized()) { diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index 81b0ee8028..b5c5c4fa16 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -1155,17 +1155,7 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, // Compute up direction accounting for build plate tilt. This is frame-invariant // (config cannot change mid-render), so compute it once before the volume loop. - Vec3f up_direction = Vec3f::UnitZ(); - { - const DynamicPrintConfig& prt_cfg = GUI::wxGetApp().preset_bundle->printers.get_edited_preset().config; - double tilt_x_deg = prt_cfg.opt_float("build_plate_tilt_x"); - double tilt_y_deg = prt_cfg.opt_float("build_plate_tilt_y"); - if (tilt_x_deg != 0. || tilt_y_deg != 0.) { - double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); - double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); - up_direction = Vec3f(float(tan(tilt_y_rad)), float(tan(tilt_x_rad)), 1.f).normalized(); - } - } + const Vec3f up_direction = GUI::build_plate_tilt_up_direction().cast(); for (GLVolumeWithIdAndZ& volume : to_render) { #if ENABLE_MODIFIERS_ALWAYS_TRANSPARENT diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 966cf49013..512ddd315e 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -81,6 +81,7 @@ #include #include "libslic3r/Utils.hpp" +#include "libslic3r/Geometry.hpp" #include "libslic3r/Model.hpp" #include "libslic3r/I18N.hpp" #include "libslic3r/PresetBundle.hpp" @@ -9812,5 +9813,17 @@ bool is_support_filament(int extruder_id, bool strict_check) return support_option->get_at(0); }; +Vec3d build_plate_tilt_up_direction() +{ + const DynamicPrintConfig &cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; + const auto *opt_x = cfg.option("build_plate_tilt_x"); + const auto *opt_y = cfg.option("build_plate_tilt_y"); + const double tilt_x = opt_x != nullptr ? opt_x->value : 0.; + const double tilt_y = opt_y != nullptr ? opt_y->value : 0.; + if (tilt_x == 0. && tilt_y == 0.) + return Vec3d::UnitZ(); + return Vec3d(std::tan(Geometry::deg2rad(tilt_y)), std::tan(Geometry::deg2rad(tilt_x)), 1.).normalized(); +} + } // GUI } //Slic3r diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index f6f0b81c92..1355d7728d 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -831,6 +831,8 @@ bool is_support_filament(int extruder_id, bool strict_check = true); bool is_soluble_filament(int extruder_id); // check if the filament for model is in the list bool has_filaments(const std::vector& model_filaments); +// Up direction of the edited printer's tilted build plate (+Z when untilted). +Vec3d build_plate_tilt_up_direction(); } // namespace GUI } // Slic3r diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index 468e2e9b6c..78a3d4a834 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -548,14 +548,6 @@ int GLGizmoFdmSupports::get_selection_support_threshold_angle() return auto_support ? support_threshold_angle : 0; } -std::pair GLGizmoFdmSupports::get_build_plate_tilt() -{ - const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; - double tilt_x = cfg.opt_float("build_plate_tilt_x"); - double tilt_y = cfg.opt_float("build_plate_tilt_y"); - return {tilt_x, tilt_y}; -} - void GLGizmoFdmSupports::select_facets_by_angle(float threshold_deg, bool block) { float threshold = (float(M_PI)/180.f)*threshold_deg; @@ -564,15 +556,9 @@ void GLGizmoFdmSupports::select_facets_by_angle(float threshold_deg, bool block) const ModelInstance* mi = mo->instances[selection.get_instance_idx()]; // Compute gravity direction accounting for build plate tilt - auto [tilt_x_deg, tilt_y_deg] = get_build_plate_tilt(); - double tilt_x_rad = tilt_x_deg * M_PI / 180.0; - double tilt_y_rad = tilt_y_deg * M_PI / 180.0; - const bool has_tilt = (tilt_x_deg != 0. || tilt_y_deg != 0.); - // NB: use an if, not a ?:, so each branch converts to Vec3d independently - // (the two Eigen expression types don't unify in a ternary). - Vec3d gravity_dir = -Vec3d::UnitZ(); - if (has_tilt) - gravity_dir = Vec3d(-tan(tilt_y_rad), -tan(tilt_x_rad), -1.0).normalized(); + const Vec3d up_dir = build_plate_tilt_up_direction(); + const bool has_tilt = up_dir != Vec3d::UnitZ(); + const Vec3d gravity_dir = -up_dir; int mesh_id = -1; for (const ModelVolume* mv : mo->volumes) { diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp index b313ca04aa..57a6cc1981 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.hpp @@ -60,7 +60,6 @@ private: void select_facets_by_angle(float threshold, bool block); // BBS int get_selection_support_threshold_angle(); - std::pair get_build_plate_tilt(); int m_support_threshold_angle = -1; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp index ac0f46df34..ad9f69eb9b 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp @@ -75,14 +75,7 @@ GLGizmoPainterBase::ClippingPlaneDataWrapper GLGizmoPainterBase::get_clipping_pl Vec3f GLGizmoPainterBase::get_tilt_up_direction() const { - const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->printers.get_edited_preset().config; - double tilt_x_deg = cfg.opt_float("build_plate_tilt_x"); - double tilt_y_deg = cfg.opt_float("build_plate_tilt_y"); - if (tilt_x_deg == 0. && tilt_y_deg == 0.) - return Vec3f::UnitZ(); - double tilt_x_rad = Geometry::deg2rad(tilt_x_deg); - double tilt_y_rad = Geometry::deg2rad(tilt_y_deg); - return Vec3f(float(tan(tilt_y_rad)), float(tan(tilt_x_rad)), 1.f).normalized(); + return build_plate_tilt_up_direction().cast(); } void GLGizmoPainterBase::render_triangles(const Selection& selection) const From 62ef0fa4f8f2d6af9ef9c88cb3baf57724f0ae00 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Sun, 13 Sep 2026 03:03:00 +0800 Subject: [PATCH 129/389] Write the Standard Layer Change Tag on Belt Brim Apron Layers Apron layers appended print_z to the layer change tag, unlike every other layer; write the plain tag line. --- src/libslic3r/GCode.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index bc117f5d1b..0640860ec8 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -5342,8 +5342,7 @@ LayerResult GCode::process_belt_brim_layer( // skip these layers entirely. { char buf[64]; - sprintf(buf, ";%s%g\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change).c_str(), print_z); - gcode += buf; + gcode += ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change) + "\n"; sprintf(buf, ";Z:%g\n", print_z); gcode += buf; const float band_height = float(height); From 18c08862a80b0e4bc2550addca69aa975e88d1d6 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 16:04:12 +0800 Subject: [PATCH 130/389] Align up_direction Position in TriangleSelector Fill Calls seed_fill_select_triangles() now takes up_direction right after highlight_by_angle_deg, as select_patch() does. --- src/libslic3r/TriangleSelector.cpp | 2 +- src/libslic3r/TriangleSelector.hpp | 4 ++-- src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/TriangleSelector.cpp b/src/libslic3r/TriangleSelector.cpp index 7e911cc565..840d3c672b 100644 --- a/src/libslic3r/TriangleSelector.cpp +++ b/src/libslic3r/TriangleSelector.cpp @@ -367,7 +367,7 @@ bool TriangleSelector::is_facet_clipped(int facet_idx, const ClippingPlane &clp) void TriangleSelector::seed_fill_select_triangles(const Vec3f &hit, int facet_start, const Transform3d& trafo_no_translate, const ClippingPlane &clp, float seed_fill_angle, float highlight_by_angle_deg, - bool force_reselection, const Vec3f &up_direction) + const Vec3f &up_direction, bool force_reselection) { assert(facet_start < m_orig_size_indices); diff --git a/src/libslic3r/TriangleSelector.hpp b/src/libslic3r/TriangleSelector.hpp index 6154f7d7f3..e715d976ab 100644 --- a/src/libslic3r/TriangleSelector.hpp +++ b/src/libslic3r/TriangleSelector.hpp @@ -336,8 +336,8 @@ public: const ClippingPlane &clp, // Clipping plane to limit painting to not clipped facets only float seed_fill_angle, // the maximal angle between two facets to be painted by the same color float highlight_by_angle_deg = 0.f, // The maximal angle of overhang. If it is set to a non-zero value, it is possible to paint only the triangles of overhang defined by this angle in degrees. - bool force_reselection = false, // force reselection of the triangle mesh even in cases that mouse is pointing on the selected triangle - const Vec3f &up_direction = Vec3f::UnitZ()); // Up direction for overhang detection (accounts for build plate tilt) + const Vec3f &up_direction = Vec3f::UnitZ(), // Up direction for overhang detection (accounts for build plate tilt) + bool force_reselection = false); // force reselection of the triangle mesh even in cases that mouse is pointing on the selected triangle void bucket_fill_select_triangles(const Vec3f &hit, // point where to start int facet_start, // facet of the original mesh (unsplit) that the hit point belongs to diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp index ad9f69eb9b..d85c635b5a 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp @@ -700,7 +700,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous mi->get_assemble_transformation().get_matrix() * mo->volumes[m_rr.mesh_id]->get_matrix() : mi->get_transformation().get_matrix() * mo->volumes[m_rr.mesh_id]->get_matrix(); m_triangle_selectors[m_rr.mesh_id]->seed_fill_select_triangles(m_rr.hit, int(m_rr.facet), trafo_matrix_not_translate, this->get_clipping_plane_in_volume_coordinates(trafo_matrix), m_smart_fill_angle, - m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, true, get_tilt_up_direction()); + m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, get_tilt_up_direction(), true); m_triangle_selectors[m_rr.mesh_id]->request_update_render_data(); m_seed_fill_last_mesh_id = m_rr.mesh_id; } @@ -864,7 +864,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous m_triangle_selectors[mesh_idx]->seed_fill_apply_on_triangles(new_state); if (m_tool_type == ToolType::SMART_FILL) m_triangle_selectors[mesh_idx]->seed_fill_select_triangles(mesh_hit, facet_idx, trafo_matrix_not_translate, clp, m_smart_fill_angle, - m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, true, get_tilt_up_direction()); + m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, get_tilt_up_direction(), true); else if (m_tool_type == ToolType::BRUSH && m_cursor_type == TriangleSelector::CursorType::POINTER) // BBS: add infill_angle parameter m_triangle_selectors[mesh_idx]->bucket_fill_select_triangles(mesh_hit, facet_idx, clp, -1.f, false, true); @@ -962,7 +962,7 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous const TriangleSelector::ClippingPlane &clp = this->get_clipping_plane_in_volume_coordinates(trafo_matrix); if (m_tool_type == ToolType::SMART_FILL) m_triangle_selectors[m_rr.mesh_id]->seed_fill_select_triangles(m_rr.hit, int(m_rr.facet), trafo_matrix_not_translate, clp, m_smart_fill_angle, - m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, false, get_tilt_up_direction()); + m_paint_on_overhangs_only ? m_highlight_by_angle_threshold_deg : 0.f, get_tilt_up_direction(), false); else if (m_tool_type == ToolType::BRUSH && m_cursor_type == TriangleSelector::CursorType::POINTER) // BBS: add infill_angle parameter m_triangle_selectors[m_rr.mesh_id]->bucket_fill_select_triangles(m_rr.hit, int(m_rr.facet), clp, -1.f, false); From 14cf7861e063ae9c3d41b0cb7c4444517c525865 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 16:01:26 +0800 Subject: [PATCH 131/389] Fix Belt Tooltip Spacing and Legend Casing Drop double spaces in the belt tilt tooltips and match the preview legend header to the "Belt printer" settings group. --- src/slic3r/GUI/GCodeViewer.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index ae504d3746..16e7262470 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -4923,7 +4923,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv ImGui::Spacing(); ImGui::Dummy({ window_padding, 0 }); ImGui::SameLine(); - ImGui::TextColored(ImVec4(0.f, 0.59f, 0.53f, 1.f), "%s", _u8L("Belt Printer").c_str()); + ImGui::TextColored(ImVec4(0.f, 0.59f, 0.53f, 1.f), "%s", _u8L("Belt printer").c_str()); ImGui::Dummy({ window_padding, 0 }); ImGui::SameLine(); // Checked = show the raw machine-frame G-code (designed/upright view off). Worded to diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 2c1247edb5..9905a203ba 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -5105,7 +5105,7 @@ void TabPrinter::build_fff() { Line line = { L("Belt tilt"), L("Belt tilt axis and angle, applied as a mesh rotation before " - "slicing. Also drives bed rendering and support gravity tilt. " + "slicing. Also drives bed rendering and support gravity tilt. " "Isometric (no distortion); the back-transform inverts it before " "the machine-frame remap.") }; line.append_option(belt_og->get_option("belt_slice_rotation")); @@ -5160,7 +5160,7 @@ void TabPrinter::build_fff() { Line line = { L("Machine-frame tilt"), L("The machine-frame shear (tan) and scale (1/cos) are derived from " - "the belt tilt angle. Enable 'Decouple' to set an independent " + "the belt tilt angle. Enable 'Decouple' to set an independent " "machine-frame angle when the physical gantry tilt differs from " "the slicing rotation.") }; line.append_option(mf->get_option("belt_frame_tilt_decouple")); From b4052ec99f796047871fae17e799d69ffc1091c0 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 16:01:48 +0800 Subject: [PATCH 132/389] Drop the Redundant Lift Type Alias in eager_lift effective_type was a plain copy of the parameter. --- src/libslic3r/GCodeWriter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 67dd6cf138..a2d0a26b6e 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -836,7 +836,6 @@ std::string GCodeWriter::lazy_lift(LiftType lift_type, bool spiral_vase) // BBS: immediately execute an undelayed lift move with a spiral lift pattern // designed specifically for subsequent gcode injection (e.g. timelapse) std::string GCodeWriter::eager_lift(const LiftType type) { - const LiftType effective_type = type; std::string lift_move; double target_lift = 0; { @@ -850,7 +849,7 @@ std::string GCodeWriter::eager_lift(const LiftType type) { } // BBS: spiral lift only safe with known position - if (effective_type == LiftType::SpiralLift && this->is_current_position_clear()) { + if (type == LiftType::SpiralLift && this->is_current_position_clear()) { double radius = target_lift / (2 * PI * atan(filament()->travel_slope())); // static spiral alignment when no move in x,y plane. // spiral centra is a radius distance to the right (y=0) From 2b1a7e38dfd6bab9ad76295b37339a1a926a55cb Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 16:03:14 +0800 Subject: [PATCH 133/389] Drop Redundant Belt Checks in BeltGCode BeltGCode is only created for belt printers, so its hooks no longer re-check belt_printer, and the BBL-machine flag is set once on whichever writer survives init_belt_writer instead of on one about to be discarded. --- src/libslic3r/BeltGCode.cpp | 11 ++--------- src/libslic3r/BeltGCode.hpp | 2 +- src/libslic3r/GCode.cpp | 5 ++--- src/libslic3r/GCode.hpp | 2 +- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index b6108ea78e..1b2d76ff76 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -5,13 +5,9 @@ namespace Slic3r { -void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) +void BeltGCode::init_belt_writer(Print &print) { - if (!print.config().belt_printer.value) - return; - auto belt_writer = std::make_unique(); - belt_writer->set_is_bbl_machine(is_bbl_printers); // Axis remap and build volume max are set by base GCode after init_belt_writer returns. belt_writer->set_belt_back_transform(print.config()); belt_writer->set_machine_frame_transform(print.config()); @@ -21,9 +17,6 @@ void BeltGCode::init_belt_writer(Print &print, bool is_bbl_printers) void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) { - if (!print.config().belt_printer.value) - return; - const auto &full_cfg = print.full_print_config(); // Slicing rotation: the belt tilt (axis + angle) and the single source of truth // for the physical tilt the G-code viewer uses to enable belt view. @@ -62,7 +55,7 @@ void BeltGCode::on_set_origin(const PrintObject * /*obj*/, const Point & /*inst_ || (m_config.belt_slice_rotation_global.value && m_config.belt_slice_rotation.value != BeltRotationAxis::None && std::abs(m_config.belt_slice_rotation_angle.value) > EPSILON); - if (!use_global || !m_config.belt_printer.value) + if (!use_global) return; // Adjust origin: transform through belt forward pipeline so that diff --git a/src/libslic3r/BeltGCode.hpp b/src/libslic3r/BeltGCode.hpp index 2a3718b49f..b68bb1066f 100644 --- a/src/libslic3r/BeltGCode.hpp +++ b/src/libslic3r/BeltGCode.hpp @@ -14,7 +14,7 @@ namespace Slic3r { class BeltGCode : public GCode { protected: - void init_belt_writer(Print &print, bool is_bbl_printers) override; + void init_belt_writer(Print &print) override; void write_belt_header(GCodeOutputStream &file, const Print &print) override; void on_set_origin(const PrintObject *obj, const Point &inst_shift) override; bool should_disable_arc_fitting() const override { return true; } diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 0640860ec8..05ec6ebc78 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2961,10 +2961,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_fan_mover.release(); m_ordering_cache.clear(); - m_writer->set_is_bbl_machine(is_bbl_printers); - // Belt printer: initialize belt-specific writer via virtual hook. - this->init_belt_writer(print, is_bbl_printers); + this->init_belt_writer(print); + m_writer->set_is_bbl_machine(is_bbl_printers); // Standalone axis remap (works with or without belt mode). // Sync the writer's remap state to the current export UNCONDITIONALLY — even at diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index afa7151a5c..18cb7868a2 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -376,7 +376,7 @@ protected: // Virtual hooks for belt printer subclass (BeltGCode). // No-ops in base GCode; overridden in BeltGCode. - virtual void init_belt_writer(Print &print, bool is_bbl_printers) {} + virtual void init_belt_writer(Print &print) {} virtual void write_belt_header(GCodeOutputStream &file, const Print &print) {} virtual void on_set_origin(const PrintObject *obj, const Point &inst_shift) {} virtual bool should_disable_arc_fitting() const { return false; } From 2b2c710626330fca12570bf32bcf538b0f521c4c Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 11 Sep 2026 16:03:41 +0800 Subject: [PATCH 134/389] Order GCodeWriter Initializers Like the Members Moved to Protected The lift, speed and cached-extruder members now live in the protected section ahead of the private ones; list their initializers first so the list reads in construction order. No behaviour change. --- src/libslic3r/GCodeWriter.hpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 43e869910e..c73ccc3e07 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -18,17 +18,18 @@ public: bool multiple_extruders; GCodeWriter() : - multiple_extruders(false), m_curr_filament_extruder(MAXIMUM_EXTRUDER_NUMBER, nullptr), - m_curr_extruder_id (-1), - m_cached_extruder_idx(0), - m_single_extruder_multi_material(false), - m_last_acceleration(0), m_max_acceleration(0),m_last_travel_acceleration(0), m_max_travel_acceleration(0), - m_last_jerk(0), m_max_jerk_x(0), m_max_jerk_y(0), - m_last_bed_temperature(0), m_last_bed_temperature_reached(true), + multiple_extruders(false), m_lifted(0), m_to_lift(0), m_to_lift_type(LiftType::NormalLift), - m_current_speed(3600), m_is_first_layer(true) + m_is_first_layer(true), m_current_speed(3600), + m_cached_extruder_idx(0), + m_curr_filament_extruder(MAXIMUM_EXTRUDER_NUMBER, nullptr), + m_curr_extruder_id (-1), + m_single_extruder_multi_material(false), + m_last_acceleration(0), m_max_acceleration(0),m_last_travel_acceleration(0), m_max_travel_acceleration(0), + m_last_jerk(0), m_max_jerk_x(0), m_max_jerk_y(0), + m_last_bed_temperature(0), m_last_bed_temperature_reached(true) {} Extruder* filament(size_t extruder_id) { assert(extruder_id < m_curr_filament_extruder.size()); return m_curr_filament_extruder[extruder_id]; } const Extruder* filament(size_t extruder_id) const { assert(extruder_id < m_curr_filament_extruder.size()); return m_curr_filament_extruder[extruder_id]; } From 812063d085f2a5528c9e4221fcd29e5b2b0410e0 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sun, 27 Sep 2026 14:59:22 +0200 Subject: [PATCH 135/389] The label under an open value field is not drawn twice --- src/slic3r/GUI/CAD/DesignSketchTool.cpp | 14 ++++++++++++++ src/slic3r/GUI/CAD/DesignSketchTool.hpp | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 716df658ed..4e45940bf1 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -6992,6 +6992,13 @@ void DesignSketchTool::draw_text(GLModel& /*model*/, const std::string& s, const // ponytail: all sketch labels now render as Measure-gizmo-style ImGui labels for visual // parity with the Prepare/Preview tabs; the old vector-font path (glyph_strokes/draw_strokes // for text) is retired. Leader lines/arrows still draw via draw_strokes at the call sites. + // + // The one label we do NOT draw is the one under an OPEN value field: the field is anchored + // over it and carries the same number plus its title, so leaving the label in place shows + // every value twice while the auto-edit chain runs (confirmed for rounded rect W/H/R, and + // the chain is shared, so Rect/Circle/Slot/Polygon/ArcSlot behave identically). Position + // compare is exact — the chain stores the very same Vec2d the label draws from. + if ((center - m_autoedit_label_pos).squaredNorm() < 1e-9) return; draw_dim_label(s, center); } @@ -8479,6 +8486,13 @@ void DesignSketchTool::render(GLCanvas3D& canvas) { m_dim_label_seq = 0; m_render_scale = canvas.get_scale(); + // The open value field is anchored OVER the label it edits, and the label draws on top of + // it — the same number twice at the same spot. Record which label that is so draw_text can + // skip exactly it; the shape's other values must stay legible as the chain walks them. + m_autoedit_label_pos = Vec2d(1e18, 1e18); + if (inline_editor != nullptr && m_autoedit_dim_idx >= 0 + && m_autoedit_dim_idx < int(m_autoedit_dims.size())) + m_autoedit_label_pos = m_autoedit_dims[m_autoedit_dim_idx].label; emit_step_hint(); // before the early returns: an armed tool on an empty sketch still guides // The value field, BEFORE every early return below. It can be up in Constrain mode on a // committed feature and on an empty sketch, and a field that is not drawn is a field that is diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index c88b149c59..08e6cbc781 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -988,6 +988,12 @@ private: }; std::vector m_autoedit_dims; // queued steps to edit in sequence int m_autoedit_dim_idx{-1}; // index into m_autoedit_dims (-1 = idle) + // Plane coords of the label the OPEN value field sits on. The field is anchored OVER its + // label (open_next_autoedit_dim) and the label is drawn after it, on top — the same number + // twice at the same spot. draw_text skips exactly this position while a step is open; the + // shape's other values stay legible as the chain walks them. Far-off sentinel = suppress + // nothing. + Vec2d m_autoedit_label_pos{1e18, 1e18}; std::vector m_selection; // selected entity indices (Mode::Select) std::vector> m_point_sel; // selected individual points int m_last_mouse_x{0}; // last cursor pos (canvas client px), for From 54b3e6c7da98533b0c9034dbf9feeaad5cbfd420 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sun, 27 Sep 2026 15:14:01 +0200 Subject: [PATCH 136/389] Include GUI.hpp where into_u8 is used (the upstream sync dropped the transitive path) --- src/slic3r/GUI/CAD/SketchInlineEditor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/slic3r/GUI/CAD/SketchInlineEditor.cpp b/src/slic3r/GUI/CAD/SketchInlineEditor.cpp index 8dfb939576..ae8bce8ebb 100644 --- a/src/slic3r/GUI/CAD/SketchInlineEditor.cpp +++ b/src/slic3r/GUI/CAD/SketchInlineEditor.cpp @@ -2,6 +2,7 @@ #include "slic3r/GUI/ImGuiWrapper.hpp" #include "slic3r/GUI/GUI_App.hpp" +#include "slic3r/GUI/GUI.hpp" // into_u8 — the upstream sync dropped the transitive path #include "slic3r/GUI/I18N.hpp" #include "libslic3r/Color.hpp" From c7700acc9564bdf5c7d36822fa1c7b44b11c17d5 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sun, 27 Sep 2026 22:05:49 +0200 Subject: [PATCH 137/389] The 2D sketcher tool architecture, batches 9-14 The design pass over the rest of the 2D tool suite: Select/Measure, Dimensioning, Constraints, Modification (Trim/Extend/Split/Offset/Mirror), Dress-up (Fillet/Chamfer) and Transform, each with its FSM, its event routing, its C++20 blueprint and the defects it exposed. Thirty-two findings, every one verified against the tree with file:line, plus nineteen open scope calls and a closing note that orders the six cross-cutting changes by what unblocks what. Batches 1-8 were delivered in-session; only their cross-cutting results (six archetypes, two defect classes) survive here. --- docs/CAD/design/SKETCHER_TOOL_ARCHITECTURE.md | 1163 +++++++++++++++++ 1 file changed, 1163 insertions(+) create mode 100644 docs/CAD/design/SKETCHER_TOOL_ARCHITECTURE.md diff --git a/docs/CAD/design/SKETCHER_TOOL_ARCHITECTURE.md b/docs/CAD/design/SKETCHER_TOOL_ARCHITECTURE.md new file mode 100644 index 0000000000..a9659ac4b0 --- /dev/null +++ b/docs/CAD/design/SKETCHER_TOOL_ARCHITECTURE.md @@ -0,0 +1,1163 @@ +# 2D sketcher tool architecture — the batch series + +The refactor target for `DesignSketchTool`'s tool layer: a flat `Mode` enum of 36 ids plus one +event `switch` per tool becomes **ToolManager / InteractiveContext / ModalOperator**. + +Why the file exists: batches 1–8 were delivered in-session and only their cross-cutting results +were recorded (the six archetypes and the two defect classes, below). From batch 9 on the design +lives here, so an implementer who was never in the room can build it. + +Every claim about the current code carries a `file:line` from `src/slic3r/GUI/CAD/`, verified by +reading the tree. Claims I did not verify are marked **UNVERIFIED**. + +--- + +## 0. Cross-cutting results (batches 1–8) + +### 0.1 The three components + +| Component | Owns | Replaces | +|---|---|---| +| **ToolManager** | activation + a *suspension stack* (`HUDEdit` > `CameraSuspend` > tool), the ESC ladder, key routing **by content** not by focus holder, the sticky `ArmState` the Construction toggle needs | `m_mode` + `set_tool()` + scattered `is_*_mode()` predicates | +| **InteractiveContext** | one `SolveSnap(ray, plane, targets, SnapPolicy)` (const, allocation-free), `PickTopology(ray, TopAbs_ShapeEnum)`, an RAII overlay registry | three inconsistent snap paths — circles/arcs use raw `screen_to_plane`, arcs snap only their endpoints | +| **ModalOperator** | one FSM + one `Params()` block per tool; Tab order **is** the array order | per-tool `switch` arms and hand-written `m_awaiting_*` chains | + +### 0.2 The two defect classes (both belong in the **base** operator) + +1. **Silent no-op** — a failed solve returns `{}` and the anchors are cleared anyway. Three + collinear points create nothing (`DesignSketchTool.cpp:2748` + `:10942`); a minor point on the + major axis creates nothing (`:2995`); `set_slot` bails on a degenerate direction or a rebuild + that changed the entity count (`:2081`, `:2089`). ⇒ a `Refused` state that **keeps** the + anchors, names the reason, and resumes the moment a mouse move makes a solution exist. +2. **Silent clamp** — the kernel replaces the user's number with a bound and the label then shows + a value nobody typed. Ellipse `a ≥ b` (`:1887`), arc slot `w < Rc` (`:2042`), polygon + circumradius from a side (`:1548`). ⇒ `WriteOutcome{Ok, ClampedTo, Refused}` returned by every + parameter write, so the operator can name the bound. + +### 0.3 Archetypes (one per batch) + +`NSolveOperator` (multi-click, possibly-unsolvable last click) · `DerivedDimOperator` (label value +≠ kernel field) · `CoupledAxisOperator` (parameters not independent) · `UnboundedChainOperator` +(no closed form, explicit terminate) · `ProvisionalPlacementOperator` (modal input → provisional +feature → confirm/cancel) · `DeriveOperator` (a pick sequence over foreign topology). + +Batches: **1** Line/Polyline/Point/Construction · **2** Rect×4 · **3** Circle×3 + Arc×3 · +**4** Slot/ArcSlot/Polygon · **5** Ellipse/EllipseArc · **6** Spline(+edit) · **7** Text/SVG · +**8** Project/Construction/Intersection · **9** Select/Measure · **10** Dimensioning · +**11** Constraints · **12** Modification · **13** Dress-up · **14** Transform · then Phase 2 (3D). + +Designed so far, below: 9, 10, 11, 12, 13, 14 — the 2D series is complete. + +--- + +## Batch 9 — Select and Measure + +Two tools that look unrelated and share one root: **a query with no document mutation is still a +tool, and its state is still an FSM** — but this codebase has no place to put a non-mutating +tool, so both were built as side effects of something else. + +### 9.1 The architectural claim: Select is not a tool + +`Mode::Select` is a `Mode` value, but nothing about it behaves like one: it has no anchors, no +parameter block, no commit step, and every other tool *returns to it* +(`DesignSketchTool.cpp:354` `set_tool(Mode::Select)`, `:113` `begin(plane, Mode::Select)`). +It is the InteractiveContext's **rest state plus a selection model**, and the selection model is +what is missing. Today three unrelated pick paths write three unrelated stores: + +| Path | Writes | Scope | +|---|---|---| +| `handle_solid_click` (`:3470`) | `m_solid_sel, m_sel_body, m_sel_face, m_sel_edge, m_sel_vertex_pt` — **one triple** | solid topology | +| Select-mode sketch branch (`:10355`+) | `m_selection` (`std::vector`), `m_point_sel` (`vector>`) | live sketch | +| `pick_bodies_in_rectangle` (`:3298`) | `select_body()` → the same single body slot | whole bodies | + +`DesignPanel::offer_selection_kind()` (`:6084`) then *reconstructs* a type from those stores, and +it can never return `OfferSel::Bodies2`: the enum member exists (`DesignOffer.hpp:27`) and +**nothing in the tree produces it** (`grep -rn Bodies2 src/` → the enum line only). So Union, +Subtract, Intersect and Interference — the four verbs whose `accepts` mask is exactly +`offer_bit(Bodies2)` — are permanently unreachable from a viewport selection, and +`pick_bodies_in_rectangle`'s own comment says why: *"the body with the most samples inside wins +because the selection callback downstream carries exactly one body… Real multi-body selection (and +the homogeneous-set rule that goes with it) is 9xw"* (`:3295-3297`). + +**Verdict.** Select is the InteractiveContext's selection model, and batch 9 builds it. The +`Mode::Select` enum member survives only as the name of the rest state. + +### 9.2 Verified current behaviour (what an implementer must not break) + +Solid picks, in precedence order, measured in **screen pixels** (`:3387-3392`): +vertex 11 px beats edge 8 px beats face; on a narrow face both tolerances shrink to a third of the +face's shorter on-screen side, so a 3 mm plate's middle stays reachable (`:3443-3450`). +`resolve_solid_pick` is **const** and writes only into its out-param — that is what makes hover +safe. Clicking the same sub-element twice (**at the level that was picked**, `:3507-3518`) +escalates to the whole body; the comment at `:3491-3497` argues the escalation is announced by the +status line before the click (I have not traced that announcement to its status text). +Whole bodies also come from the Parts list and from the rubber band. + +The escalation is gated by a boolean the **panel** sets — `set_escalate_on_repick` +(`DesignSketchTool.hpp:108`, `:1192`), flipped in nine places (`DesignPanel.cpp:3878`, `:3889`, +`:3912`, `:6718`, `:6725-6730`, `:6764`, `:6771`, `:6826`, `:6839`), with the clearest comment +being *"While a pick is armed, a click must CAPTURE the face under the cursor, never escalate"* +(`:6725-6730`). That is a fourth store of *what a click means*, readable only by whoever set it +last — the disease this batch exists to cure, in one flag. + +Rubber band (`:3286-3335`, `:10011-10046`): a left-drag past an 8 px budget starts +`GLSelectionRectangle` in state `Select`; on release every sample point **inside** the rectangle +counts (crossing semantics, comment at `:3296`), and the body with the most samples wins. + +Sketch picks (`:10355`+): a point hit grabs the point and arms a drag; an entity hit selects with +Shift/Ctrl to toggle; a double-click adds `connected_loop(hit)`; a plain click on a constraint +badge **deletes that constraint** (`:10370-10378`); a click on a dimension label opens its editor +or promotes a live quote (`:10460-10475`); a click inside a closed region calls +`on_face_selected(reg)` (`:10608-10614`); empty space clears the selection. + +Hover: `update_solid_hover` (`:3530`) pre-highlights what a click *would* take — verified on the +rig 2026-08-14 (snaporca-9xw notes). For **sketch** geometry there is no equivalent: +`update_hover` (`:870`) tracks handles only — `hit_test_handle` — and the sole hover member is +`Handle m_hover_handle` (`DesignSketchTool.hpp:1017`). No `m_hover_entity` exists. + +Keyboard: `DesignSketchTool` has **no key handler at all**. Esc, Del/Backspace, undo and the offer +key arrive at `DesignPanel`'s char hook (`:4231`, `:4260`, `:4243`) and route through +`DesignPanel::escape()` (`:11401`) — the four-level ladder in +`docs/CAD/ux/interaction-model.md`. + +Camera: both the pick (`:3386`) and the rubber band (`GLSelectionRectangle.cpp:41`) resolve the +camera as `wxGetApp().plater()->get_camera()`. In the Design tab this is the *right* camera only +because `DesignCanvas` swaps its own camera with the plater's on enter/leave +(`DesignCanvas.hpp:73-77`, `:361`, `:376`) — a dependency, not a coincidence to build on. + +Cost: `resolve_solid_pick` calls `GeometryEngine::edges_of_face` and `sample_edge_world` (each +returning a fresh `std::vector`) and runs per motion event through +`update_solid_hover`. It is bounded to one face, not the whole body, but it allocates on the +pointer path. + +### 9.3 The selection model — blueprint + +New header, `src/slic3r/GUI/CAD/DesignSelection.hpp`. Everything below is a value type; nothing +owns a GL resource, so the whole model is testable without a canvas. + +```cpp +enum class RefKind : uint8_t { + None, Face, Edge, Vertex, Body, DatumPlane, DatumAxis, CoordSys, Art, SkEntity, SkPoint, SkRegion +}; + +// The FINE class — one level below RefKind, because the offer vocabulary splits what RefKind +// joins: a Face is planar, cylindrical or other; an Edge is straight or circular. This is +// OfferSel (DesignOffer.hpp:19), and classify() is the logic that today lives split between +// DesignPanel::offer_selection_kind() (:6084) and GeometryEngine::circle_of_edge/_cylinder_of_face. +RefClass classify(const Ref&, const CadDocument&); +using RefClass = OfferSel; // no second vocabulary: the offer table's own, from DesignOffer.hpp:19 + +// A reference to one thing, plus the generation it was picked at. Ids expire on every +// recompute (CadDocument::topo_generation); a stale ref must REFUSE, never guess. +struct Ref { + RefKind kind{RefKind::None}; + int32_t body{-1}; // body index, or the sketch feature index for sketch refs + int32_t item{-1}; // face id / edge id / entity index / region id + int32_t role{-1}; // SketchPointRole for SkPoint picks, else -1 + uint32_t generation{0}; +}; + +struct Pick { + Ref ref; + Vec3d point; // the geometry the pick carried (vertex, edge midpoint, face centroid) + Vec3d dir; // edge direction / face normal; zero when the ref has none + bool has_dir{false}; +}; + +enum class SetOp : uint8_t { Replace, Add, Toggle, Remove }; + +// What a tool will accept as its picks. A set is NOT globally homogeneous: 73 of the 86 offer +// verbs accept more than one class (measure accepts twelve, transform nine, delete nine) because +// the mask answers "what can start this verb", not "what one set may contain". So homogeneity is +// a per-tool POLICY, and Measure's is a pair of possibly-different classes, not a set. +struct PickPolicy { + uint32_t accepts{0}; // the same OfferSel bitmask the offer row already carries + uint8_t max_picks{1}; // 1 = single, 2 = a pair (Measure, Mate), 0 = unbounded (Fillet) + bool homogeneous{true}; // every pick shares the class (Fillet) or not (Measure, Delete) +}; + +class SelectionSet { +public: + RefKind kind() const; // RefKind::None while empty + RefClass class_of() const; // the class of front(); a mixed set reports its primary's + bool empty() const { return m_refs.empty(); } + size_t size() const { return m_refs.size(); } + bool contains(const Ref& r) const; + // Ordered: front() is the PRIMARY pick (the anchor), back() the most recent. Two-ref + // queries (Measure, and later Mate) read front()/back() rather than sorting by distance. + const Pick& front() const; + const Pick& back() const; + // Returns what happened, so the caller can say it: refused a stale ref, refused by the + // policy, replaced, added, removed. Silence here is the same disease as a silent clamp. + enum class Outcome : uint8_t { Added, Removed, Replaced, RefusedStale, RefusedPolicy }; + Outcome apply(const Pick& p, SetOp op, const PickPolicy& policy, uint32_t live_generation); + void clear(); +private: + RefKind m_kind{RefKind::None}; + std::vector m_refs; // bounded by policy.max_picks (0 = the sketch-select case) +}; +``` + +Why this shape and not a `std::variant` per kind: the whole tab reads selection through one +question — *which offer rows are live* — and that question is answered by one bitmask over one +vocabulary. A variant would move the vocabulary into the type system and then re-derive the +bitmask at every call site. + +`OfferSel` is also the *only* place that carries cardinality (`Sk2Ent`, `Bodies2`) — a count +folded into a kind vocabulary, which is why `offer_selection_kind()` (`DesignPanel.cpp:6084`) +must collapse `n >= 2` into `Sk2Ent` and loses what the two things are. With `size()` on the set +and the class on the refs, those two enum members retire. + +The two existing stores become projections of this one: `m_selection` (entity indices) is +`items(kind() == SkEntity)`, `m_point_sel` is `items(kind() == SkPoint)`, and the solid triple is +`front()` + `size() == 1`. `offer_selection_kind()` turns into one non-reconstructing switch: + +```cpp +// One place, exhaustive, no inference from three stores. +int offer_kind_from(const SelectionSet& s); // Bodies2 when kind()==Body && size() >= 2 +``` + +### 9.4 Select — FSM + +Select is the rest state, so its FSM has no `Armed` and no `Commit`; it is a **hover + press +machine**. Budget: `kClickPx = 8` (`:10029`). + +| State | Meaning | Event | Guard | Action | Next | +|---|---|---|---|---|---| +| `Idle` | nothing selected | `Move` | over topology | solve pick, store promise, repaint | `Hover` | +| `Hover` | a promise is on screen | `Move` | candidate changed | update promise | `Hover` | +| | | `Move` | left the geometry | clear the promise, repaint | `Idle` | +| | | `LeftDown` | always | latch (`x,y`, remember the promise), **fall through so the canvas may orbit** | `PressPending` | +| `PressPending` | press latched, click vs band undecided | `Drag` | `max(|dx|,|dy|) > 8` | start the band at the ORIGINAL press point | `Band` | +| | | `LeftUp` | — | commit the pick (below) | `Idle` | +| `Band` | rubber band sweeping | `Drag` | — | move the rectangle | `Band` | +| | | any button-up event | — | resolve bodies, stop the band | `Idle` | +| `Grab` | a point/handle was grabbed | `Drag` | left down | move + live re-solve | `Grab` | +| | | `LeftUp` | — | release the grab | `Idle` | +| `Region` | clicked inside a closed loop | — | — | hand to `on_face_selected`, which owns the commit | `Idle` | + +Commit rule (the whole of "what did that click mean"): + +``` +pick = hit_test_point(tol) -> SkPoint, arm Grab + || handle (derived grips) -> SkEntity + Grab + || hit_test(topology) -> Vertex | Edge | Face (solid) + || hit_test(entity) -> SkEntity + || constraint badge -> delete the constraint (plain click only) + || dimension label -> open/promote the value editor + || region -> Region + || nothing -> clear +``` + +Escalation stays exactly as it is: pressing the *same ref* twice at the level that was picked +escalates to its body — one comparison on `Ref.kind/body/item`, no field-tuple equality. + +ESC ladder: `Idle` = `clear()` (the floor — never exits the session, `DesignInteraction.hpp` +invariant). `Hover`/`Band` are not ladder levels: a band is cancelled by releasing the button, +and a band is not a "gesture" in the `CadLevel::Gesture` sense because nothing has changed yet. + +### 9.5 Select — event routing and focus handshake + +| Event | Canvas | Tool | Panel / char hook | Camera | Notes | +|---|---|---|---|---|---| +| `Move` | — | `update_hover` / `update_solid_hover` (**non-consuming**, returns false) | — | passthrough | hover only asks for a repaint, `:10022-10025` | +| `LeftDown` | orbit may begin | latch press, **return false** | — | consume-or-orbit is the canvas's call | `:10058-10063`; consuming here killed orbit once already | +| `LeftDrag` > 8 px | — | start + drive band, **consume** | — | no longer orbits in this canvas | middle-drag orbits, right-drag pans (`:10013-10016`) | +| `LeftUp` | — | commit pick **or** resolve band | — | — | `:10035-10041` | +| `MiddleDrag` / `RightDrag` | — | must not see it | — | orbit / pan | camera gestures never reach the FSM | +| `RightClick` | — | — | offer menu | — | `snaporca-xmh6` open: a right-click that only clears the sketch selection eats the offer | +| `Esc` | — | — | `escape()` ladder | — | one route whatever holds focus (`:4228-4231`) | +| `Del` / `Backspace` | — | `delete_selected_or_last_sketch_entity()` | char hook | — | `:4260` | +| `Menu` / `Shift+F10` | — | — | `show_offer_menu(offer_anchor())` | — | `:4243` | +| `Wheel` / SpaceMouse | — | must not see it | — | zoom / fly | never through `wxMouseEvent` | + +The invariant the matrix encodes: **hover rules, camera rules, and the pick rules — and each of +the three consumes only what it owns.** A band that starts on a camera gesture is the classic +failure; so is a tool that eats the press and silently kills orbit. + +### 9.6 Select — the five defects to fix, and how the architecture prevents them + +1. **No sketch hover pre-highlight.** Add `std::optional m_hover` to the context, filled by + the same const `hit_test` the click uses, drawn by the overlay registry. Solids already prove + the pattern; the asymmetry is what makes precedence unlearnable in a sketch. +2. **Rubber band has no direction.** `GLSelectionRectangle::EState` is `{Off, Select, Deselect}` + (`GLSelectionRectangle.hpp:15-19`) — no topology. Add `bool is_crossing() const` returning + `m_start_corner.x() > m_end_corner.x()` (one read of existing members) and use the **same + sample set with two predicates**: LTR = every sample inside (enclosed), RTL = any sample inside + (crossing). No new sampling, no change to the plater's own use of the class. +3. **One body, because the callback carries one.** Make the callback carry a `SelectionSet` and + delete the "most samples wins" rule. `Bodies2` then becomes producible, which unblocks Union / + Subtract / Intersect / Interference in the offer — four verbs that today cannot be reached. +4. **The camera is looked up, not passed.** `solve_pick(const Camera&, …)` and a band that takes + the camera as an argument. Today both work only because `DesignCanvas` swaps the plater's + camera on enter; the day a second canvas is on screen the promise and the click disagree. +5. **The pick allocates on the pointer path.** `sample_edge_world` returns a fresh vector per + edge per motion event. Give the context a reusable scratch buffer (`std::span` out-param) — + the same allocation rule the tool blueprints already carry. + +### 9.7 Measure — the archetype: `TwoRefQueryOperator` + +A tool that mutates nothing, has no commit, and cannot fail — and therefore has no home in this +codebase. Current state, verified: + +- Offer row `{"measure", "Measure", 6, …}` (`DesignOffer.hpp:120`) has `action == nullptr` and + `refusal == nullptr`. The table's own contract (`DesignOffer.hpp:43-48`) is *"nullptr → kernel + support exists, no GUI path yet (row shows disabled)"*, so the row renders as + **"Measure (no GUI route)"** and is permanently disabled (`DesignPanel.cpp:6519`). With no + refusal in the row, it contributes nothing to the family's "why" line either. +- The maths exists, for MCP callers only: `resolve_ref` + `measure` (`McpControl.cpp:522`, `:546`) + — refs `{face|edge|point}`, distance = `|pa - pb|` of **representative points** (face centroid, + edge mid-sample), angle = `acos(da·db)` when both refs carry a direction. +- The correct OCCT primitive is already linked and already used: `BRepExtrema_DistShapeShape` + (`GeometryEngine.cpp:31`, `:457`). +- The Prepare tab ships a full measure gizmo — `GLGizmoMeasure` (`src/slic3r/GUI/Gizmos/`) over + `Measure::SurfaceFeature{Point, Edge, Circle, Plane}` (`libslic3r/Measure.hpp:16`). It is + **mesh/triangle-based** (a Plane feature is a triangle index + normal + point) and bound to the + plater's model objects. `DesignSketchTool.cpp:6959` already borrows its *label* style and + nothing else. + +**Verdict.** Measure must not be `measure()` wired to a row. `measure()` is a centroid proxy: for +point↔face the honest answer is the perpendicular distance to the plane, for two skew edges the +minimum distance between the segments, for a cylindrical face the radius, for two parallel faces +the material thickness — none of which is "distance between two chosen points". The proxy is right +for exactly the case where both refs are points, which is the case a user reaches last. + +### 9.8 Measure — engine, blueprint + +Kernel addition (`GeometryEngine`, next to `surface_deviation`): + +```cpp +struct MeasureResult { + enum class Kind : uint8_t { PointPoint, PointLine, PointPlane, LineLine, LinePlane, + PlanePlane, SameCircle, Mixed }; + Kind kind{Kind::Mixed}; + bool ok{false}; + double distance{0.0}; // BRepExtrema on the two sub-shapes; exact, not a proxy + Vec3d witness_a, witness_b; // PointOnShape1/2 — the line the UI draws + bool has_angle{false}; + double angle_deg{0.0}; // between directions (edge dir / face normal), 0..90 folded + bool has_intrinsic{false}; + double intrinsic{0.0}; // a lone pick: length / radius / diameter / area + const char* refused{nullptr}; // never silent: why no measurement exists +}; +MeasureResult measure_refs(const TopoDS_Shape& a_shape, const TopoDS_Shape& b_shape, + const Pick& a, const Pick& b); +``` + +Rules the engine must honour: the sub-shape is materialised from the ref (`TopoDS_Shape(face)` / +`TopoDS_Shape(edge)`; a vertex from `Pick.point`), so a face-to-face measurement is a *shape* +measurement. `distance` is always the **minimum** distance; `angle` is reported separately and +folded to 0–90° (a CAD user does not care which side of 180° the normals are on); a stale ref +(`Pick.ref.generation != live`) refuses with a reason instead of measuring a moved face. + +Tool state (`ModalOperator`, no mutation, no commit): + +| State | Event | Guard | Action | Next | +|---|---|---|---|---| +| `Idle` | `Move` | over a ref | hover promise, same const pick path as Select | `Hover` | +| | `LeftDown` | on a ref | `apply(Replace)` | `OneRef` | +| `OneRef` | `Move` | over a second ref | preview the two-ref result live | `OneRef` | +| | `LeftDown` | on a second ref | `apply(Add)` → compute | `TwoRefs` | +| | `LeftDown` | empty space | clear | `Idle` | +| | `Esc` | — | disarm the tool (`CadLevel::Tool`) | `Idle` | +| `TwoRefs` | `Move` | over another ref | keep the result, hover the third | `TwoRefs` | +| | `LeftDown` | on any ref | restart with it as the primary | `OneRef` | +| | `Esc` | — | drop the second ref, keep the first | `OneRef` | +| | `RightClick` | — | offer menu | `TwoRefs` | + +`OneRef` is the state the current app cannot express at all: it is what makes the tool feel like +Onshape's — pick a face and you already read its area, its normal and its radius if it is a +cylinder, before the second pick exists. + +Readout, one line per available fact, never an invented one: `distance` · `ΔX, ΔY, ΔZ` (world-axis +components, computed from the two witnesses) · `angle` · a lone pick's `intrinsic`. The readout is +the same label primitive the dimension chain already draws (`render_dimensioning`, +`DesignSketchTool.cpp:6959`), so it costs one more caller, not one more renderer. + +### 9.9 Measure — event routing + +| Event | Tool | Panel | Camera | Notes | +|---|---|---|---|---| +| `Move` | hover promise + live preview | — | passthrough | identical to Select's hover rule | +| `LeftDown/Up` | pick, extend, restart | — | orbit may begin on press | same press-fallthrough as Select | +| `Esc` | `TwoRefs→OneRef→Exit` | ladder routes it | — | the ladder already handles "tool armed" | +| any key | — | swallowed while the field is open | — | a query tool must not steal letters: no tool keys while Measure is armed | +| `MiddleDrag`/`RightDrag` | — | — | orbit/pan | a 3D measurement is unreadable from one angle; the camera must stay live *inside* the tool, exactly like Select | +| MCP `measure` | same engine | — | — | the RPC becomes one caller of `measure_refs`, so the agent surface and the GUI cannot disagree | + +### 9.10 Measure — three friction points, and how the architecture prevents them + +1. **"Pick a face, get the distance to a face I cannot see."** The witness line is the only thing + that proves *which* faces were measured, and a centroid proxy cannot draw one. ⇒ + `witness_a`/`witness_b` from `PointOnShape1/2` are part of `MeasureResult`, not a UI + afterthought; the tool refuses to show a number without a line. +2. **Re-measuring after an edit silently reads the old face.** Ids expire on recompute and + nothing says so (`snaporca-o1l2`). ⇒ `Ref.generation` travels with the pick and a stale ref + refuses **with a reason in the readout**, instead of returning a number that used to be true. +3. **The unit and the coordinate frame are invisible.** A distance in mm on a rotated part is + ambiguous the moment you also show `ΔX/ΔY/ΔZ`. ⇒ components are world-axis and labelled as + such, and every number in the readout passes through the document's unit formatter (the one + the dimension chain uses), so there is exactly one formatting path in the tab. + +--- + +## Batch 10 — Dimensioning + +Archetype: **`ValueDriveOperator`** — one interaction (a label on the geometry, a number typed into +a field over it) over **three different backends**, where the backend is currently decided by which +lambda happened to be built rather than by anything the user can see. + +### 10.1 The architectural claim: there are two Dimension tools, and they disagree + +| | click-to-place (`Mode::Dimension`) | selection-based (the `sk_dimension` row) | +|---|---|---| +| entry | arm the tool, pick in the viewport (`:10651`) | select first, then apply (`DesignCanvas.cpp:1417-1430`) | +| kinds it can make | Length, Diameter, Radius, Distance, DistanceToLine | **also Angle between two lines** | +| sets the value by | `place_dimension` → `constraint_for` → `upsert_constraint` + `upsert_dimension` → live-solve, field optional (`:1160`) | `apply_dimension` → **moves the geometry first**, then `record_dimension_constraint` (`:604`, `:661`) | +| operand roles | the picked `DimAnnot.ra/rb` (`:1133`) | derived: `Point`→`P0`, anything else→`Center` (`:667`) | + +Same six `DimType` values, same labels, two code paths that resolve the same word "Distance" into +different roles and different order of operations. The click path lets the solver drive the +geometry to the number; the selection path moves the geometry to the number and then records a +constraint that asks for it. They agree whenever the sketch is free and disagree as soon as it is +constrained — which is the case the user cares about. + +### 10.2 Verified current behaviour + +**The click path's FSM is two booleans.** `m_dim_has0` + `m_dim_e0/m_dim_r0` (`:10651-10702`). +First `LeftDown`: a point hit anchors and waits; a whole-entity hit maps Line→Length, +Circle→Diameter, Arc→Radius. Second `LeftDown`: a different point → Distance; a line → DistanceToLine. +`RightDown` clears the anchor only. A double-click on a label reopens its editor (`:10653`). + +**Three silent no-ops on that path**, all verified by reading the branch: +click a Point, an Ellipse, an EllipseArc or a BSpline as the FIRST pick — the `if/else if` chain has +no `else`, the event is consumed, nothing happens and nothing is said (`:10679-10687`); +click something that is neither a point nor a line as the SECOND pick — same, and the anchor is +cleared anyway (`:10689-10699`); abort a value field and the placed dimension **keeps driving** at +its measured value (`cancel_dimension_value`, `:2174` — deliberate, but it means a cancelled +gesture has already added a constraint, and nothing says so). + +**`apply_dimension` records a poison value.** Its per-case thresholds move nothing for +`v <= 0` (Length/Diameter/Radius, `:611-613`) or `v < 0` (Distance/DistanceToLine, `:622`, `:639`) — +and then `record_dimension_constraint(v)` runs **unconditionally** (`:659`). The file's own sibling +says it best, at the socket boundary: *"a negative/zero/NaN value that moved nothing would still be +pushed to the solver as a constraint it must satisfy and cannot, silently corrupting the sketch +rather than failing. (`apply_dimension` has the same flaw for any other caller; this guard protects +the socket, not the tool.)"* (`McpControl.cpp:1572-1577`). So the agent surface validates and the GUI +does not — the GUI is the less safe caller of its own function. + +**`record_dimension_constraint` never dedupes at all.** It `push_back`s unconditionally +(`:674`, `:684`, `:691`, `:700`), so applying the selection-path dimension twice leaves **two** +constraints on the same operands — the identical defect `upsert_constraint` (`:1074`) was written to +kill on the click path (`:1056-1068`). The two paths differ in their dedupe policy as well as their +order of operations. + +**`Distance` changes type when the number is zero, and the change is not reversible in place.** +`constraint_for` and `record_dimension_constraint` both emit `Coincident` for `v < 1e-9` +(`:1146`, `:688`); `upsert_constraint` matches on `type` (`:1078`), so type `0`, then type `5`, and a +fresh `Distance` is appended beside the `Coincident` — over-constrained by construction, which is +exactly the failure the `upsert_constraint` comment (`:1056-1068`) says was fixed for duplicates. + +**`DistanceToLine` cannot express a side.** `measure_dim` returns `std::abs(...)` (`:1085`) and the +solver emits `SLVS_C_PT_LINE_DISTANCE` with `std::abs(c.value)` (`SketchSolver.cpp:319-323`), so the +sign is discarded at both ends: the user's number cannot say which side of the line the point is on, +and the solver takes the nearer one. (`apply_dimension` does keep the side, but only when it is the +one moving the geometry — `:645-648` — so the two paths disagree here too.) + +**The label is never re-measured after a solve.** `m_dimensions[i].value` is written by +`place_dimension` (`:1162`), by `set_dimension_value` (`:2167`) and by the chain's lambda (`:1426`) +and by nothing else; `dim_text` prints `a.value` (`:2179`). The only `a.value = measure_dim(a)` in +the file is the auto-edit chain re-measuring a *live quote* before it becomes a step (`:1423`). +So when the solver refuses, the label shows the number you typed while the geometry is unchanged — +the same "the number changed and nothing moved" reading the duplicate-constraint comment describes, +now caused by conflict instead of duplication. The feedback that does exist is aggregate: +`apply_dof_status` prints "✗ Conflicting constraints" or "N degrees of freedom" for the whole sketch +(`DesignPanel.cpp:4426-4445`), and `m_entity_conflict` tints per entity (`:8765`) — **no dimension is +ever named**. + +**One field, two backends.** `AutoEditStep{label, value, apply(v), hi, title}` (`DesignSketchTool.hpp:982`) +carries a `std::function apply` and nothing else: no outcome, no kind, no target. +The chain fills it either with a solver write (`upsert_constraint(constraint_for(a))`, `:1424-1430`) +or with a direct geometry write (`set_line_angle`, `set_polygon_side`, `set_ellipse_axis`, +`open_rounded_rect_editor`, …), and the two are indistinguishable on screen. Memory 1635 records +why the split exists: libslvs has no constraint for a polygon's side count or an arc's sweep, so +those dims are free by construction. + +**Focus is the known-broken part.** The field is a borderless always-on-top frame; the window +manager may refuse it key status (`projects-1p5` is the open bug: the activation request still goes +out with timestamp 0), so `DesignPanel` forwards Enter/Tab and routes Esc (`:4220-4232`, `:4231`). + +**Dead residue:** `DesignCanvas::{pending_dimension_type, set_sketch_dimension_value, +cancel_sketch_dimension}` (`DesignCanvas.hpp:281-283`, defined `:1467-1481`) have no callers — +the retired value-card era. The live path is `open_value_editor` → `on_inline_edit` (installed at +`DesignCanvas.cpp:116`) → the field's own closures. + +### 10.3 The dimension as a first-class value (blueprint) + +```cpp +// One dimension = one target + one value + one explicitly named way of driving it. +enum class DriveKind : uint8_t { + Solver, // a libslvs constraint: Distance / Radius / Diameter / Angle / PointOnLine + Geometric, // no solver constraint exists: the number writes the geometry directly + Reference // measured only; never drives. Today's m_live_quotes. +}; + +struct Dimension { + DimType type{DimType::None}; + DriveKind drive{DriveKind::Solver}; + Pick target; // batch 9's Ref + the geometry it carried — one vocabulary + Pick second; // Distance / DistanceToLine / Angle: the other operand + double value{0.0}; // what the user asked for (Solver/Geometric) + double measured{0.0}; // what the geometry says NOW, refreshed on every solve + int con{-1}; // slot in m_constraints when drive == Solver + // Labels and refusals share one channel so the field can re-open holding the typed text. + WriteOutcome last{WriteOutcome::Ok}; +}; +``` + +Three rules the type enforces, each closing a defect above: + +1. **`measured` is refreshed on every solve; `value` is what was asked for.** The label renders + `value` only while `|value - measured| <= tol`; otherwise it renders `measured` in the refusal + colour with the requested value as the secondary text (`30.0 → 24.6`). A lie becomes a + contradiction you can see. `drive == Reference` renders `measured` only, and the palette is the + one already in the tab (green quote = measured, driving colour = driven). +2. **`apply(value)` returns a `WriteOutcome`** (`Ok | ClampedTo | Refused`, the base-operator type + from §0.2) — the same type for the solver path, the geometric path and the socket. The socket + guard already written in `McpControl.cpp:1572-1577` moves *into* `apply`, so the GUI cannot be the + unsafe caller of its own function any more. `Refused` keeps the field open with the typed text + and the reason, which is also what makes the `Coincident`-flip reversible: the dimension keeps + its `type` and only its value changes. +3. **One dimension per (type, operand pair) lives in one `std::vector`**, and the + constraint slot is a *projection* of it (`upsert` semantics from `:1074-1130`, kept). The click + path and the selection path both become thin callers of one `Dimension` builder, so the operand + roles (`ra/rb` vs derived `Center`) are chosen once. + +### 10.4 Dimension — FSM (the place sequence, one machine for both entry points) + +Budget: pick tolerance as Select (`hit_test_point` / `hit_test`). `Tab` cycles the chain's steps, +`Enter` commits and advances, `Esc` steps the ladder. + +| State | Event | Guard | Action | Next | +|---|---|---|---|---| +| `Idle` | `LeftDown` | on a point | anchor it | `Anchor` | +| | `LeftDown` | on a Line / Circle / Arc | create Length / Diameter / Radius and open the field | `Editing` | +| | `LeftDown` | on anything else | **refuse out loud**: "no dimension for an ellipse yet — pick a line, arc, circle or two points" | `Idle` | +| `Anchor` | `LeftDown` | on a different point | create `Distance` | `Editing` | +| | `LeftDown` | on a Line | create `DistanceToLine` (signed; the side is the one the point is already on) | `Editing` | +| | `LeftDown` | on anything else | refuse out loud, keep the anchor (the user can still pick a valid second target) | `Anchor` | +| | `RightDown` / `Esc` | — | drop the anchor | `Idle` | +| `Editing` | `Enter` / `Tab` | value parses | `apply` → `Ok` ⇒ commit, advance the chain (`Tab` skips forward only) | `Idle` / `Editing` | +| | `Enter` | `apply` → `Refused`/`ClampedTo` | keep the field open with the typed text + the reason | `Editing` | +| | `Esc` | — | keep the dimension at `measured` (today's rule) but **report it**: one status line, because a cancelled gesture that added a constraint must say so | `Idle` | +| | `LeftDown` outside | — | commit as `Enter` | `Idle` | +| `Re-edit` | double-click a label | — | reopen the field on that dimension (solver-backed ones re-open on `value`, geometric ones on `measured`) | `Editing` | + +Hover: Dimension inherits Select's hover promise (§9.6 defect 1) — over a line it must say +*Length*, over a circle *Diameter*, in `Anchor` over a second point *Distance*. Without that, the +first click of a two-click gesture is a guess. + +### 10.5 Dimension — event routing and focus handshake + +| Event | Tool | Value field (canvas-hosted) | Panel char hook | Camera | +|---|---|---|---|---| +| `Move` | hover promise + highlight the candidate (`hi` span) | — | — | passthrough | +| `LeftDown` | pick / advance | **must not reach the tool** — a click outside commits | — | orbit may begin | +| `Enter` / `Tab` | — | commit + advance when the field has focus | forwarded when it does not (`:4220-4232`) | — | +| `Esc` | — | close the field, keep the value (`CadLevel::Transient`) | routes it when focus is refused | — | +| a letter | — | — | **not** a tool switch while a field is open, except the sketch tool keys, which commit the field on the way through (`:4288-4293`) | — | +| `MiddleDrag`/`RightDrag` | — | — | — | orbit / pan: a dimension being placed must not trap the camera | + +The one-route rule is already written and must not be re-derived per widget: *"ONE Esc, ONE route, +whatever holds focus"* (`DesignPanel.cpp:4228-4231`). + +### 10.6 Dimension — three friction points, and how the architecture prevents them + +1. **"I typed 30 and nothing moved, but the label says 30."** The most expensive lie in the tab: + it destroys trust in every number on screen. ⇒ `value` vs `measured` (§10.3 rule 1) plus the + refusing dimension named in the status line, using the per-entity conflict flags that already + exist (`m_entity_conflict`, `:749`, `:8765`) — the information is there, only unattributed. +2. **"Is this number driving the sketch or just describing it?"** Three backends, one appearance. + ⇒ `DriveKind` is visible: the field's title says which (`Length` vs `Length · geometric` vs + `Length · reference`) and the label colour follows the existing quote palette. A user who cannot + tell a driving dimension from a measured one cannot reason about over-constraint at all. +3. **"The number I type is not the number that sticks."** Silent thresholds (`v <= 0` no-ops, + `abs()` on a signed distance, `Coincident` for zero) all discard the user's intent without a + word. ⇒ every discard returns `ClampedTo`/`Refused` with the bound, and the field re-opens with + the typed text — the same rule the base operator already applies to `set_slot` and `set_ellipse_axis` + (§0.2 class 2). The zero-distance case then needs no type flip at all: `Coincident` becomes an + *interpretation* of `Distance = 0` at solve time, not a mutation of the dimension. + +--- + +## Batch 11 — Constraints + +Archetype: **`PlannedConstraintOperator`** — the pick is generic, the meaning is planned, and the +plan is already the best-designed value type in the tab. This batch extends its reach; it does not +invent it. + +### 11.1 The architectural claim: a constraint belongs to the sketch, not to a mode + +`Mode::Constrain` is a **mode you enter** (`DesignSketchTool.cpp:2266`, `:2281`), and the pick lives +in the tool (`m_pick0/1/2`, `:10306-10327`) while the constraint list lives in **two** places: the +live session's `m_constraints` and the committed feature's `entity_constraints`, chosen by +`live_constraint_scope()` inside the card (`DesignPanel.cpp:3053-3058`). The same list, two owners, +one mode-shaped door. + +The mode itself is already half-fiction, which is why that scope switch had to be invented: +`DesignCanvas::is_sketching()` is `m_sketch_tool.is_active()` (`DesignCanvas.cpp:632`) — so a +Constrain session on a *committed* sketch reports "sketching", and the panel has to guard it with +`(m_ui_mode == UiMode::Sketch) &&` (`DesignPanel.cpp:4169`) to get the truth back. A constraint is a +property of a sketch; the mode is a way of editing one. + +Constraints are also the last large block of verbs living outside the offer. The offer has 92 rows +(`DesignOffer.hpp`) and the whole constraint vocabulary is **one** of them (`sk_constrain`, `:168`); +the other 20 are toolbar buttons (`DesignPanel.cpp:1516-1539`). Five enum members have no button at +all: `Distance` comes from the Dimension tool, `LockX`/`LockY` have solver bindings +(`SketchSolver.cpp:191`, `:240`, `:245`) and only a label (`DesignPanel.cpp:8051`), `PointOnLine` is produced only as +the *implementation* of Batch 10's distance-to-line, and `PointOnObject` has no producer — it is +built in exactly one place, the re-anchor path (`:8533`). So the offer's own promise — *"every verb +has ONE row index, that index is the same in every selection"* (`DesignOffer.hpp:4-7`) — is unmet for +20 verbs, and Batch 9's `PickPolicy` cannot describe them. + +### 11.2 Verified current behaviour (what an implementer must NOT rebuild) + +**`ConstraintPlan` is already the archetype.** `SketchEngine.hpp:181`: +`{Kind{Reject, Apply, AskValue}, reason, defs, prefill}` — pure, no wx, no translation (the caller +maps `reason`), testable without a window. `plan_entity_constraint` (`SketchEngine.cpp:2107`) is *"the +ONE place that knows how many picks a type takes"* (`DesignPanel.cpp:7891`) — including the ergonomic +retarget of `EqualLength` on two rounds to `EqualRadius` (`:2118-2121`) and the `Horizontal`/`Vertical` +refusal that exists because *"with a Point or Circle picked, P1 is a role the solver silently drops +while STORING the constraint, so the sketch claims to be constrained when it is not"* (`:2135-2142`). + +**`ConstraintReject` has thirteen reasons** (`SketchEngine.hpp:170-179`) and every one has a specific, +product-voiced message (`constraint_reject_text`, `DesignPanel.cpp:7817-7845`), several of them +type-dependent ("Angle applies between two lines" vs "Parallel, perpendicular and equal length apply +to two lines"). + +**Commit is already a rollback transaction.** `try_add_constraints` (`:2399`): append → solve → keep, +or `resize(mark)` and keep the geometry (`pl5`: the solver only writes back on success). + +**A constraint already has a visible undo.** Badges render in a live sketch (`:8798-8808`, with the +comment recording that they used to be invisible outside Constrain mode), a click deletes +(`remove_constraint_near :2418` → `remove_constraint :2426`, which re-runs `resolve_live()` so the DoF +readout and the conflict tint cannot go stale), and the success message teaches it: *"Applied +constraint · its badge is on the sketch — click the badge to remove it"* (`:7915-7917`). + +**Draw-time inference exists and is measured.** `infer_auto_constraints` (`:2452`): coincidence +(batched, no fallback — "consistent by construction"), H/V (batched, then one at a time), relations +only for batches ≤ 16 entities (`kRelInferMaxBatch`), with the reasoning recorded: `EqualRadius` +couples far-apart entities and merges the connected components the solver partitions on, which cost +main-thread timeouts on seven large sheets in the corpus rung (2026-08-31, `yww4`); and *"a SCRIPTED +ADD IS NOT A DRAWN GESTURE"* (`8xg1`). + +**The solver names the guilty constraint.** `SketchSolveResult.bad` = *indices into `constraints` of +the conflicting ones* (`SketchSolver.hpp:18`, filled at `SketchSolver.cpp:394`, `:521-522`). + +### 11.3 The three defects + +1. **The solver names the constraint and the UI throws the name away.** `r.bad` is converted to + `m_entity_conflict[e] = 1` per *entity* (`:745-751`) for a red tint, and the user is told + "Constraint rejected (over-constrained)" (`DesignPanel.cpp:7908`). On the live path the rolled-back + batch is always the *new* one, so the conflict is almost always with something already in the + sketch — precisely what `r.bad` identifies. This is Batch 10's "no dimension is ever named" + wearing different clothes: the same information, discarded at the same place. +2. **Ctrl+Z does not undo a constraint.** Documented in the code as a known limitation + (`DesignPanel.cpp:7887-7895`): the undo stack holds committed *features*, so during a sketch + Ctrl+Z calls `undo_last_sketch_entity()` (`:4252`) and deletes the last **entity** instead. The + universal undo is therefore both wrong and more destructive than the badge's undo, and the two are + not the same operation. +3. **`roles_of` exists twice and has already diverged once.** Two file-local lambdas + (`:2451` in `infer_auto_constraints`, `:9532` in `heal_coincidences`); the first was missing + `EllipseArc` while the second had it, so *"an ellipse arc's endpoints could be WELDED by the healer + but never auto-inferred coincident at draw time — the same gesture behaved differently depending on + which path ran"* (`:2455-2461`). Fixed in place; the duplication that caused it is still there. +4. *(Not a defect, but a silent policy a user meets without warning)*: relations are simply **not + inferred** when a batch is larger than 16 entities. The reason is sound and measured; the silence + is the part that needs a voice. + +### 11.4 The operator — FSM + +The pick deliberately does not know the type; the *plan* does. So the FSM asks the plan first and the +pick becomes typed: `archetype → PickN → Plan → (Reject | AskValue | Apply)`. + +| State | Event | Guard | Action | Next | +|---|---|---|---|---| +| `Idle` | button / offer row | `plan_entity_constraint(…, type)` with zero picks | `Reject` ⇒ say the reason **before** the first click ("Parallel applies to two lines"), and arm | `PickN` | +| `PickN` | `Move` | over an entity | hover promise naming the slot: *"slot 1 of 2 — Parallel"* | `PickN` | +| | `LeftDown` | slot k of n unfilled | fill it, highlight it red | `PickN` | +| | `LeftDown` | all slots filled | restart from slot 1 (today's rolling rule, `:10322`), announced in the promise | `PickN` | +| | `Esc` | — | drop the picks, keep the tool armed (base `Gesture` level) | `Idle` | +| | `RightClick` | — | offer menu | `PickN` | +| `Plan` | — | always | `plan_entity_constraint` again, now with picks | branch below | +| | | `Reject` | keep the picks, name the slot and the reason | `PickN` | +| | | `AskValue` | open the field with `prefill` (Angle in degrees, DistanceX/Y, Radius, Diameter) | `Editing` | +| | | `Apply` | `try_add_constraints(defs)` | `Idle` on ok, `Refused` on conflict | +| `Editing` | `Enter` | — | `write_plan_value` → commit → same two exits | `Idle` / `Refused` | +| | `Esc` | — | close the field, drop the picks, no constraint | `Idle` | +| `Refused` | — | always | name the constraint from `r.bad` and its operands, keep the picks, offer "remove the conflicting one" | `PickN` | + +`Refused` is the state the base operator already requires (§0.2 class 1) and the one this batch is +really about: today a refusal is a status line that forgets everything. + +### 11.5 Constraints — event routing and focus handshake + +| Event | Tool | Card (the list) | Panel / char hook | Camera | +|---|---|---|---|---| +| `Move` | hover promise + slot legend | — | — | passthrough | +| `LeftDown` | fill the next slot | row click = highlight its entities | — | orbit may begin on press (same rule as §9.5) | +| click a badge | delete that constraint (`remove_constraint_near`) | rebuild the list | — | — | +| `Esc` | drop picks (`Gesture`), then leave Constrain (`Tool`) | — | one route (`:4231`) | — | +| `Ctrl+Z` | **must undo the last constraint** (see 11.6.2) | rebuild | routes it today (`:4252`) | — | +| `Tab` | next slot / next field | — | — | — | + +### 11.6 Constraints — three friction points, and how the architecture prevents them + +1. **"Which constraint is complaining?"** The refusal is anonymous while `r.bad` knows the answer. + ⇒ `Refused` names it: the plan already carries the type, the def carries `ea/eb/ec`, and + `constraint_label` (`DesignPanel.cpp:8040+`) already renders a human phrase per def. The card row + and the badge are one lookup away, so the message can read *"Parallel on Line 3 conflicts with + Horizontal on Line 3"* — and offer to remove the older one, which is a real decision the user is + making at that moment and today is left to guesswork. +2. **"Ctrl+Z deleted my line."** The universal undo must be the universal undo. ⇒ the live sketch gets + its own undo stack (entities *and* constraints in one sequence, which is also what Batch 12's + Trim/Extend needs); the badge click stays as the direct, discoverable route. +3. **"Nothing says how many picks this needs, or which one I am on."** The rolling 3-slot pick is + colour-identical per slot (`:8666-8673` red for any picked slot) and the arity is checked *after* + the pick. ⇒ the operator arms from the plan, so `n` and the slot names are known before the first + click — `Symmetric` announces three slots ("two entities, then the axis", matching + `ConstraintReject::NeedAxisLine`), and the promise says which slot the click will fill. + +--- + +## Batch 12 — Modification (Trim, Extend, Split, Offset, Mirror) + +Archetype: **`ConstraintAwareTransform`** — a modification does not only move geometry, it invalidates +the constraints and dimensions that referred to it. This batch is the first where that second half +exists at all, and today it happens behind the user's back. + +### 12.1 The architectural claim: a modification is a transaction over a constraint-bearing model + +A creation tool adds geometry and infers constraints onto it. A modification **edits geometry that +already carries constraints**, and must therefore decide, for every ref it touches, one of three +things: keep it, re-bind it, or drop it. The tree has three different answers and none of them is +reported: + +| Path | What happens to the constraints | Said to the user | +|---|---|---| +| Trim / Extend (`:1622`) | `drop_constraints_referencing(ei)` — every ref to the cut entity is erased (`:1582`) | nothing | +| Rotation, typed angle (`:1295`, `:1715`, `:1764`, `:1928`) | `drop_orientation_constraints` — H/V/Parallel/Perp/Angle/Lock on the rotated span erased (`:1559`) | nothing | +| Fillet / Chamfer (`confirm_op`, `:7932`) | **surgery**: erase the stale corner Coincident + each leg's own length `Distance`, then re-bind the new entity through a decreasing-ambition ladder of constraint sets until one is accepted | nothing | +| Offset (`:7976-7988`) | adds a relationship between source and copy — `Parallel` for a line, `Concentric` for an arc/circle | nothing | +| Mirror | the copies carry no constraints at all | nothing | +| **Committed** edit ops (`DesignPanel::apply_edit_op`, `:8505-8540`) | drops the stale refs **and then re-anchors** the moved endpoint with a `PointOnObject` onto whatever entity it now lies on — with a rollback if the solver rejects the new binding | nothing | + +That last row is the disagreement worth naming: the **same** operation behaves differently depending +on whether the sketch is live or committed. The live scissors drop (`DesignSketchTool.cpp:1622`, +`drop_constraints_referencing` and nothing else); the committed path re-anchors +(`DesignPanel.cpp:8510-8539`, Line/Circle cutters only, rollback at `:8537-8539`). Memory 1603 records +the re-anchor as the intended design. So a trim on a live sketch loses the coincidence, and the same +trim on a committed one keeps the loop closed — which is the Batch 10 pattern again, one batch later. + +And the drop paths leave the **dimension behind**: both drop functions only remap `DimAnnot.con` +(`:1577`, `:1598`), so a dimension whose constraint was erased stays in `m_dimensions` with `con = -1` +and its label keeps rendering `a.value` (Batch 10: `dim_text` prints the stored value). A trim can +therefore turn a driving dimension into pure decoration, silently. That is the same lie as Batch 10's +"the label says 30 and nothing moved", arrived at from the other direction — and it is exactly what a +`DriveKind` transition (`Solver → Reference`) should *report*. + +### 12.2 Verified current behaviour (what an implementer must NOT break) + +**Trim/Extend are the reference implementation of the hover promise** that §9.6 defect 1 says is +missing everywhere else. `compute_trim_preview` is pure and const, replays the pick and the kernel cut +on a **copy**, and returns the exact sub-polyline a click would remove; the renderer repaints it in red +from the cursor every frame (`:9134-9148`, never persisted). Refusal is spoken — the tool's own comment +cites `nde #15: don't fail silently` and the readout names what to click instead +(`:10156-10162`). One cut per click, right-click exits, drag falls through to the camera. Also: +`trim_entity`/`extend_entity` **slide one endpoint without adding or removing an entity**, which is +why the indices — and therefore every stored constraint index — stay valid (`:1600-1603`). + +**The edit-op family's commit rule is deliberate and documented.** A ready op commits when: the value +is typed and Enter pressed (`open_op_editor`'s commit calls `confirm_op`, `:7872`, with the comment +recording the old failure — *"the most obvious route of all — click the radius, type it, press +Return — ended with the value set, the ghost drawn, and no geometry written"*); the user clicks empty +space (`:10202`); **another tool is armed** (`:237`, and the comment explains both the rule and the +ordering trap that made it read `op_ready() == 0` with `a=0 b=3 val=28.205` sitting right there); and +when the sketch is committed (`:2241`). Commit-on-leave is a rule, not an accident. + +**The kernel already refuses by design and says so in its own documentation**, which is where the +UI message should come from: `offset_entities` *"Ellipses and splines are not offset (a parallel of +either is not the same kind of curve) and are dropped from the result"* (`SketchEngine.hpp:312-318`), +and it preserves chains (shared endpoints offset together, miter-repaired) so a closed profile stays +closed. `mirror_entities` reflects about a line, `make_bridge` exists with no GUI at all. + +### 12.3 The four defects + +1. **Silent constraint loss**, and with it the silent demotion of a dimension to decoration + (§12.1). Nothing on screen changes when a constraint disappears except the badge vanishing — which + is also how the *user* deletes one deliberately (Batch 11). +2. **Offset on an ellipse or a spline is a silent no-op.** The kernel drops them by design, so + `out.empty()` hits `reset_op(); return;` (`:7981`) with no message: the ghost disappears and + the click did nothing. The refusal text exists in the kernel's comment and not in the product. +3. **`mirror_entities` hands out a reversed half** — `snaporca-stn3`, verified open: the producer + "reflects each entity in place and leaves the result traversing the opposite way round", which has + already caused three defects in one day (exact loop area, `572f794c84`; offset to the wrong side, + `3974f8a170`; and any future direction-sensitive op). Both consumers are now defensive; the + producer is still wrong. The issue carries the proposal: emit the reflected entities in **reverse + order, each individually flipped**, so appending the result yields one consistently-oriented chain. +4. **The hover preview shows the geometry change and not the constraint change.** Trim says nothing + about the two constraints it is about to erase, although `drop_constraints_referencing` already + knows exactly which ones. +5. **The live and committed paths of the same operation disagree** (table above): live drops, committed + re-anchors. One of the two is the design; the batch's job is to make it the same one. + +### 12.4 The family's FSM + +Two shapes share one machine: `pick → ready → (ghost | value) → commit`, with Trim/Extend as the +instant form (no ghost, no confirm) and Offset/Fillet/Chamfer/Mirror as the confirmed form. + +| State | Event | Guard | Action | Next | +|---|---|---|---|---| +| `Idle` | tool armed | — | — | `Pick` | +| `Pick` | `Move` | over a candidate | **preview** (pure, const): the geometry delta *and* the constraint delta | `Pick` | +| | `LeftDown` | candidate accepted | Trim/Extend: apply, re-solve, stay armed for the next cut | `Idle` | +| | | candidate accepted | Offset: pick the source, seed `value`, ghost | `Ready` | +| | | candidate accepted | Mirror: first pick = axis line, then targets toggle | `Ready` | +| | | candidate refused | refuse with the kernel's own reason (ellipses/splines are not offset) | `Pick` | +| | `RightDown` | — | exit the tool (today's `request_exit()`) | `Idle` | +| | `Esc` | — | disarm (base `Tool` level) | `Idle` | +| `Ready` | arrow `Drag` | Offset | signed value → ghost | `Ready` | +| | `Enter` in the field | — | **commit** (the value *is* the commit) | `Idle` | +| | `LeftDown` on empty space | — | commit | `Idle` | +| | another tool armed | — | commit, then arm the new tool (documented rule) | `Idle` | +| | `Esc` / `RightDown` | — | `reset_op()` — discard the ghost, change nothing | `Idle` | +| **Commit** | — | kernel returns empty / refuses | **refuse and keep the ghost**, naming the reason | `Ready` | + +The last row is the whole point: today `out.empty()` silently discards the gesture, and a commit that +cannot happen must be a refusal (base operator, §0.2). + +### 12.5 Modification — event routing + +| Event | Tool | Preview overlay | Panel | Camera | +|---|---|---|---|---| +| `Move` | pick + `preview()` | geometry delta (red, as Trim does today) + a one-line constraint delta | — | passthrough | +| `LeftDown` (Trim) | apply at once | — | status line after the cut: *"trimmed · dropped 2 constraints, 1 dimension now reference"* | orbit may begin on press | +| `Enter` / field | commit | — | — | — | +| tool key while ready | commit then switch (`:237`) | — | — | — | +| `Esc` | `Gesture` → drop the ghost; `Tool` → disarm | — | one route (`:4231`) | — | +| `Ctrl+Z` | must undo the *modification* — the same journal Batch 11 needs | — | routes it today | — | + +### 12.6 Modification — three friction points, and how the architecture prevents them + +1. **"My sketch lost its constraints and I did not see it."** ⇒ the operator computes a + `ConstraintDelta{kept, rebound, dropped}` and the refusal/preview channel speaks it; a + modification that drops anything leaves one line on the status bar and one undo entry. The ladder + `confirm_op` already uses for fillet (tangent+tangent → tangent → coincident) generalises into + *rebind before dropping*, so the common case stops being a loss at all. +2. **"Offset did nothing."** ⇒ the kernel's own documented limitation becomes the UI's refusal text + (ellipses and splines are not offset because a parallel of either is not the same kind of curve), + the ghost is not drawn for an ineligible source, and the commit keeps the state instead of + resetting it. +3. **"I mirrored a half and the result walks the wrong way round."** ⇒ `mirror_entities` emits the + reflection in reverse order with each entity flipped (`snaporca-stn3`'s proposal), so the output is + a continuation of the chain rather than a mirror image of it. The consumers' defensive handling + stays — it is what makes offset correct for imported geometry the tool did not generate. + +--- + +## Batch 13 — Dress-up (sketch Fillet and Chamfer) + +Archetype: **`CornerOperator`** — the only family whose subject is *not an entity*. A fillet's input +is two lines and the vertex between them, and that vertex exists only as a computation, performed +twice, in two files, by hand. + +### 13.1 The architectural claim: the corner is computed twice and must agree + +`DesignSketchTool::op_corner` (`:7739-7762`) intersects the two lines to get the corner `C`, the +inward angle bisector and the angle — used to anchor the arrow. `SketchEngine::fillet_lines` / +`chamfer_lines` (`SketchEngine.hpp:343-352`) compute the same corner again to place the arc or the +setback segment. The tool's own comment: *"Mirrors SketchEngine::fillet_lines's geometry so the arrow +tracks the op exactly"* — a hand-maintained duplicate, exactly the `roles_of` pattern from Batch 11 +(`:2455-2461`, where the two copies had already diverged). Any divergence here is visible as an arrow +that points one way while the fillet cuts another. + +### 13.2 Verified current behaviour (what an implementer must NOT break) + +**Kernel scope, stated by the kernel:** `chamfer_lines` is *"symmetric chamfer between two lines +meeting at a corner… False if the lines are parallel or `d` overruns either line"*; `fillet_lines` is +the line-pair equivalent. **Lines only** — a line/arc or arc/arc corner has no implementation, while +Onshape's sketch fillet works on any two entities meeting at a corner. + +**The pick is two lines, in order.** `op_pick` (`:7798-7822`): a non-line pick returns immediately +and silently (`:7804`); the first line becomes `m_op_a`, the second `m_op_b` and seeds the value at +**20 % of the shorter leg** (`max(0.001, 0.2 * min(la, lb))`, `:7811`). + +**Dress-up has a real geometry preview.** `recompute_op_ghost` (`:7762-7780`) runs the *kernel op* +into `a_out/b_out/extra` and stores it in `m_op_ghost`, which `render_op_gizmo` draws ghost-green via +`draw_entities_preview`. The arrow runs along the inward bisector from the corner, its length is the +value, and the label sits at the tip (`R…` for fillet, bare for chamfer, `:7894-7900`). So this family +already does the thing §9.6 says is missing for Select and §12.6 says is missing for the constraint +delta: it previews the *result*, not just the pick. + +**The commit is a decreasing-ambition ladder.** `confirm_op` (`:7936-7971`) first erases the stale +corner `Coincident` and each leg's own length `Distance`, then tries, for a fillet, +`{tangent(a), tangent(b)}` → `{tangent(a)}` → `{}` (coincident bindings only) and keeps the first set +`try_add_constraints` accepts; a chamfer tries the coincident bindings alone. The new entity is +appended and bound; the source lines are replaced in place, so indices stay stable. + +**And `op_ready()` does not check the corner.** It is `m_op_a >= 0 && m_op_b >= 0` (`:7725-7729`), so +a **parallel pair is "ready"**: the arrow is drawn, confirming calls the kernel, the kernel returns +false, and `confirm_op` does `reset_op(); return;` (`:7941`) — the ghost disappears, nothing happens, +nothing is said. Same shape as Batch 12's offset-on-an-ellipse. + +### 13.3 The defects — the first one is above the level of this batch + +1. **`DimAnnot.con` goes stale in two of the five mutators, and it is a corruption path, not a + cosmetic one.** `m_dimensions[i].con` is an *index* into `m_constraints`. Two mutators renumber it + and repair the links (`drop_orientation_constraints` `:1579`, `drop_constraints_referencing` + `:1596`). Two do not: **`remove_constraint`** (`:2434` — the badge click, which is the *taught* + way to delete, Batch 11) and **`confirm_op`** (`:7960` — every fillet and chamfer). After either, + a dimension whose constraint sat after the erased slot points at a *different* constraint; and + `set_dimension_value` validates only the range (`a.con < m_constraints.size()`, `:2168`), not the + identity — so **editing that dimension's label silently overwrites an unrelated constraint**, and + the solver then obeys a def nobody asked for. Reachable in three gestures: draw two dimensioned + lines, click one constraint's badge, then click the other dimension's label and type a value. + This is a data-integrity defect and should be fixed outside the batch's normal ordering. +2. **A doomed op is announced as ready.** `op_ready()` must require `op_corner()` to succeed; then + the parallel pair is refused *before* the ghost, and the overrunning value is refused at the + kernel's own stated condition ("`d` overruns either line") instead of at a silent `reset_op()`. +3. **The corner is computed twice** (§13.1). One `SketchEngine::corner_of(a, b)` — the exact function + `fillet_lines` already needs internally — should be exposed and used by the tool. +4. **The arrow keeps a stale anchor** when `op_corner` fails: `m_op_anchor`/`m_op_dir` are only + assigned inside the `if (op_corner(...))` (`:7768-7769`), so the arrow is drawn at the *previous* + corner while the ghost is absent — the two halves of the preview disagree about which corner is + being edited. +5. **Scope: lines only.** No line/arc or arc/arc corner, so the most common real corner in a drawing + (a fillet between a line and an arc) cannot be made at all. + +### 13.4 The family's FSM + +| State | Event | Guard | Action | Next | +|---|---|---|---|---| +| `Idle` | tool armed (F / H, `:421-422`) | — | — | `Pick1` | +| `Pick1` | `Move` | over a line | highlight; hover promise naming what is needed ("pick the second line") | `Pick1` | +| | `LeftDown` | a line | `m_op_a = ei` | `Pick2` | +| | `LeftDown` | anything else | **refuse**: "a fillet needs two lines — arcs are not supported yet" | `Pick1` | +| `Pick2` | `LeftDown` | a second line, `corner_of` succeeds | `m_op_b`, seed 20 %, ghost, arrow on the bisector | `Ready` | +| | `LeftDown` | a second line, parallel / 180° | **refuse** with the reason; keep `m_op_a` | `Pick2` | +| `Ready` | `Drag` arrow | — | value = projection on the bisector, clamped to what the kernel can take | `Ready` | +| | `Enter` in the field | — | commit (the value *is* the commit, `:7872`) | `Idle` | +| | `LeftDown` empty / another tool | — | commit, then (for a tool) arm it (`:237`) | `Idle` | +| | `Esc` / `RightDown` | — | `reset_op()` — discard, change nothing | `Idle` | +| **Commit** | — | kernel false | **refuse and keep the op**: name the bound the kernel named (`d` overruns the leg) | `Ready` | +| | — | all ladder sets rejected | **refuse**: "the corner is over-constrained — remove a constraint on either leg" | `Ready` | + +The last two rows are what the ladder buys once it reports: today the ladder silently degrades +(tangent×2 → tangent → coincident), and the user cannot tell a tangent fillet from one that merely +touches at two points. + +### 13.5 Dress-up — event routing + +| Event | Tool | Preview | Panel | Camera | +|---|---|---|---|---| +| `Move` | pick + `recompute_op_ghost` | ghost entity set + arrow + label | — | passthrough | +| `LeftDown` | pick / confirm-on-empty | ghost | status after commit: which ladder rung was accepted | orbit may begin on press | +| `Enter` / field | commit | — | — | — | +| tool key while `Ready` | commit then switch (`:237`) | — | — | — | +| `Esc` | drop the op, keep the tool | — | one route (`:4231`) | — | +| `Ctrl+Z` | undo the fillet **and restore what it erased** — the journal Batch 11/12 need, here with the erased `Distance` and `Coincident` | — | routes it today | — | + +### 13.6 Dress-up — three friction points, and how the architecture prevents them + +1. **"I picked two lines and nothing happened."** Parallel legs, a 180° corner and an overrunning + value all end in a silent `reset_op()`. ⇒ `op_ready()` consults `corner_of`, the kernel's own + refusal condition becomes the product's message, and a doomed op is refused at the pick instead of + at the commit. +2. **"The fillet is not tangent and I cannot tell."** The ladder degrades in silence, and a + non-tangent arc at a corner reads as a modelling error. ⇒ the accepted rung is named once, at the + commit, and the badge for the arc carries its `Tangent` constraints, so the loss is visible on the + geometry (Batch 11's badge language) as well as in the line. +3. **"Esc left a mess / Ctrl+Z does not bring the corner back."** A fillet erases two `Distance` + constraints and a `Coincident`; the only way back is to undo the whole sketch gesture. ⇒ the + `SketchEdit` journal (Batch 11/12) records the erased defs with the geometry change, so one Ctrl+Z + restores the legs, their dimensions and the corner`Coincident` together — and with defect 1 fixed, + it restores the dimension *links* too, not just the defs. + +--- + +## Batch 14 — Transform (Move, Rotate, Scale, Array, PolarArray, TransformArt) + +Archetype: **`PivotSetOperator`** — the subject is a *set*, the pivot is *derived*, and the parameter +is a *relationship* (a vector, an angle, a factor, a count) rather than a scalar on one entity. It is +also the only family in the tab with **two** numeric parameters on one gesture, and the only one whose +maps can preserve or break constraints depending on the map — so it is where the constraint table had +to be written explicitly. + +### 14.1 The family, and the sixth archetype's shape + +Five modes share the `m_tf_*` block (`DesignSketchTool.hpp:1081-1097`): `m_tf_targets` (toggle-select +like Mirror, `tf_pick :8137`), `m_tf_pivot` (the targets' centroid, `compute_tf_pivot :8103`), +`m_tf_delta` / `m_tf_angle` / `m_tf_scale` / `m_tf_count{3}`, a ghost and two label anchors. +`tf_ready()` is just "any target" (`:8098`). The handle is *derived per mode* (`tf_handle_pos +:8208-8218`): the translated tip, the ring position at the current angle, or the scaled +X point. +Two labels are drawn and both are pickable — the primary at the handle, the count at the pivot +(`render_tf_gizmo :8283-8340`) — so Array and PolarArray are the tab's only two-parameter gestures, +with `open_tf_editor_a` (`:8250`) and `open_tf_editor_count` (`:8273`). + +Seeding is deliberately lazy (`tf_pick :8150-8168`): Move/Array seed a step of +`max(1.5 * handle_r, 1 mm)` (Array perpendicular to a lone line, else +X), Rotate 45°, PolarArray a +full 360°, Scale ×2 — and only while still neutral, *"so re-picking more targets keeps a value the +user already dialled in"*. + +`TransformArt` is the odd member and is genuinely a different tool: the subject is an imported +*feature* (Text/SVG) rather than entities, the parameters are a 2D offset plus **two independent +scale factors** (`m_xform_sx/sy`, non-uniform by design, floored at 1e-4), and the gizmo is a bounding +box with five square handles — four corners and the centre (`render_xform_gizmo :7706-7724`) — where a +corner drag solves the offset so that the *opposite* corner stays put (`:7690-7700`, `emit_xform :7702`). + +### 14.2 Verified current behaviour: the constraint table, read in the right direction + +`confirm_transform` (`:8342-8445`) `remove_if`s — **returning true means REMOVED** — over every +constraint that touches a target (`is_target` checks `ea`, `eb` and `ec`): + +| Mode | Removed | Kept | +|---|---|---| +| Move | Coincident, PointOnLine, PointOnObject, Concentric, Symmetric, Midpoint, **Fix, LockX, LockY**, cross-entity `Distance` | Horizontal, Vertical, Parallel, Perpendicular, Angle, EqualLength, Radius, Diameter, Collinear, **self**-`Distance` | +| Rotate | everything else — Coincident, Concentric, Tangent, Parallel, Perpendicular, Midpoint, Symmetric, PointOnLine/Object, Horizontal, Vertical, Angle, Fix, Lock | EqualLength, Radius, Diameter, self-`Distance` | +| Scale | everything except the five orientation types | Horizontal, Vertical, Parallel, Perpendicular, Angle | +| Array / PolarArray | additive: copies are appended and bound to their source through a ladder — lines get Parallel+EqualLength (linear) or EqualLength alone (polar), arcs/circles a per-copy Radius plus Concentric when the polar pivot *is* the source's centre | the originals are untouched | + +Then `resolve_live()`. The rationale in the comment is real — *"Surviving classes are satisfied by +construction; the re-solve folds in the new placement"* — and the array ladder is the same +degrade-and-keep-the-first-set pattern as Batch 13's fillet, which is the right instinct. + +### 14.3 The defects + +1. **Two families inside one function disagree about what leaving means.** `set_tool` commits a ready + edit-op (`:237`) and its comment states the rationale in the strongest terms — *"Discarding it here + is most of why Fillet looked like it simply did not work"* — and then, thirty lines later, + `reset_tf(); // drop any in-progress transform gizmo` (`:295`). So arming Line with a pending + fillet keeps the fillet, and arming Line with a pending rotation **throws the rotation away** — + targets picked, value dialled or typed, ghost visible. Same gesture, opposite outcome, no message. +2. **The keep/drop table over-removes, silently.** For every mode there are constraint types the map + provably preserves that are removed anyway: Move removes Coincident/PointOnLine/PointOnObject even + when *all* their operands are targets (a rigid translation of a whole loop preserves them); Rotate + removes Coincident, Concentric, Tangent, Parallel, Perpendicular, Midpoint, Symmetric and + PointOnObject although a rotation preserves all of them; Scale removes Coincident, Tangent, + Midpoint, Symmetric, PointOnLine, PointOnObject and EqualLength although a uniform scale preserves + them (and it keeps Horizontal/Vertical, which only a *non-uniform* scale would break — Scale here + is uniform, so that half is right). The user sees badges vanish and the DoF readout climb, while the + geometry — which *is* correctly mapped — looks fine, so the loss stays invisible until a later edit. +3. **Move releases an explicit anchor.** `Fix`, `LockX` and `LockY` are removed by a translation. A + point the user pinned to protect it can be moved, and the protection silently disappears. Either the + map should obey the anchor (refuse, or carry it) or the release must be reported. +4. **A third erasure site without a `con` remap** (`:8368`), alongside `remove_constraint :2434` and + `confirm_op :7960` — the corruption path recorded in its own memory: a dimension's index now points + at a different constraint, and editing its label overwrites that one. +5. **The action bar's ✓ does not confirm a transform.** For `m_active == Tool::None` inside a sketch it + calls `finish_sketch()` (`DesignPanel.cpp:11304-11307`), and finishing applies the pending transform + on the way (`:2242`). So the only gesture-level confirm is a **click on empty space** (`:10256`), + which nothing announces, and the button a user would reach for ends the sketch instead. Right-click + with targets discards (`:10260`); Esc reaches the same through the ladder. +6. **The array ladder fails silently.** *"else the geometry stays unconstrained"* — the copies appear + with no relationship to their source and nothing says the ladder was rejected. + +### 14.4 The family's FSM + +| State | Event | Guard | Action | Next | +|---|---|---|---|---| +| `Idle` | tool armed (no key for these — see the open calls) | — | — | `Pick` | +| `Pick` | `LeftDown` | on an entity | toggle into `m_tf_targets`, recompute the pivot, seed if still neutral, ghost | `Pick` | +| | `Move` | — | hover promise: the pivot marker and the ghost already *are* the promise | `Pick` | +| | `LeftDown` | empty space, no targets | nothing (today it is a no-op click) | `Pick` | +| `Ready` | `Drag` handle | — | primary parameter; `Ctrl`/`Shift` snaps (not implemented today) | `Ready` | +| | `Enter` / field | — | commit | `Idle` | +| | `LeftDown` empty | — | commit (today's only route) | `Idle` | +| | **another tool armed** | — | **commit**, like a ready edit-op — not `reset_tf()` | `Idle` | +| | ✓ in the action bar | — | commit the gesture, *not* the sketch | `Idle` | +| | `RightDown` / `Esc` | — | discard the gesture, keep the tool | `Pick` | +| **Commit** | — | any constraint removed | one line naming the count and classes, and one undo entry | `Idle` | + +### 14.5 Transform — event routing + +| Event | Tool | Ghost/labels | Panel | Camera | +|---|---|---|---|---| +| `Move` | pick + `recompute_tf_ghost` | ghost, spoke, handle square, pivot marker, two labels | — | passthrough | +| `LeftDown` on an empty point | commit | — | status: what was mapped, what was dropped | orbit may begin on press | +| `LeftDown` on the count label | open the count field | — | — | — | +| `Enter` in either field | commit | — | — | — | +| ✓ / Finish | commit then `finish_sketch()` (`:2242`) | — | `tool_confirm :11304` | — | +| tool key while `Ready` | commit, then arm (must match `:237`) | — | — | — | +| `RightDown` | discard | — | — | — | +| `Esc` | discard, then disarm (ladder) | — | one route (`:4231`) | — | +| `Ctrl+Z` | undo the map **and restore the constraints it removed** — the journal Batch 11-13 need; here it is the difference between "I rotated it" and "I rotated it and lost my sketch's structure" | — | routes it today | — | + +### 14.6 Transform — three friction points, and how the architecture prevents them + +1. **"I moved to the next tool and my rotation disappeared."** The gesture is visible, dialled and + committed-by-intent, yet leaving drops it. ⇒ one `leave()` rule for the whole tool layer: a ready + gesture commits, whatever family it belongs to, and the edit-op rationale (`:228-244`) applies + verbatim. The undo entry makes the commit safe; the drop makes it infuriating. +2. **"Where did my constraints go?"** Three modes erase four to fifteen types each, by a hand-written + table, with no message and no way back. ⇒ the table becomes derived rather than written — for each + `(type, map)` pair the answer is a property of the map, not a choice — and whatever it removes is + named once, at the commit, with one Ctrl+Z to restore it. `Move`'s dropping of `Fix`/`Lock` + deserves to be a visible decision (`"the anchor on point 4 was released by this move"`), because + silently releasing the one constraint whose purpose is to prevent movement is the worst version of + this class. +3. **"The ✓ finished my sketch."** A gesture-level confirm must exist and be the button the user + already presses. ⇒ `tool_confirm` gains the gesture level above the mode level (which is what + `CadLevel::Gesture` already means in `DesignInteraction.hpp`), and `finish_sketch` stops being the + only thing ✓ can mean while a ghost is on screen. + +--- + +## Open scope calls + +- **Batch 8 (carried):** wire edge picking (25a) and the intersection point (27) — both are +- **Batch 9 — resolved by reading the table, not by arguing:** the "homogeneous selection set" +- **Batch 9:** "select other" (a pick list for a face occluded by another) is *not* in this design. +- **Batch 10 — which of the two Dimension paths wins?** Recommended: the **solver drives** (the +- **Batch 10 — signed `DistanceToLine` needs a spike.** The port maps it to +- **Batch 10 — `AutoEditStep::apply` must return `WriteOutcome`**, which touches every chain builder +- **Batch 11 — naming the conflict needs one signature change.** `try_add_constraints` returns `bool` +- **Batch 11 — the live-sketch undo stack is shared work.** It must sequence entities, constraints and +- **Batch 11 — should the 20 constraint verbs get offer rows?** Adding 20 rows to a 92-row table whose +- **Batch 11 — inference for batches > 16 entities should speak.** The policy is correct and measured; +- **Batch 12 — Split has no implementation at all.** Onshape's Split cuts an entity at a crossing and +- **Batch 12 — fix `snaporca-stn3` while the batch is open.** `mirror_entities` emitting a +- **Batch 12 — the constraint delta and Batch 11's conflict name are the same type.** Batch 11 wants +- **Batch 13 — fix `DimAnnot.con` staleness now, and make it impossible.** Two mutators renumber +- **Batch 13 — one `corner_of`, then arc corners.** `SketchEngine::corner_of(a, b)` is the function +- **Batch 13 — `op_ready()` must consult `corner_of`.** Three of the four silent failures in this +- **Batch 14 — no transform tool has a keyboard shortcut.** Nothing in `m_keys_sketch` maps to Move, + Rotate, Scale, Array, PolarArray or TransformArt (`DesignPanel.cpp:408-422` binds sixteen letters, + none of them these), so the family is reachable only from the offer. Either assign keys from the free + letters (G I J K N Q U V W Y Z — K is already Constrain) or state that the family is deliberately + offer-only: `snaporca-fqwu` counts 47 of 86 verbs with no shortcut, and this is a sixth of them. +- **Batch 14 — derive the keep/drop table, do not maintain it.** `confirm_transform :8357-8387` is a + hand-written per-type switch that over-removes in all three mutating modes; for each `(type, map)` + pair the answer is a property of the map (does it preserve the relation?), with the genuine + exceptions (`Fix`/`Lock`, an absolute `Angle`) named as exceptions. +- **Phase 2 (3D) needs its batch list written before it starts** — otherwise it will be designed by + whoever opens the file first. + +--- + +## Closing note — Phase 1 (2D) is designed + +Fourteen batches, and six cross-cutting changes were asked for by more than one of them. An +implementer should land them in this order, because each one is what makes the next one's refusals, +names and undos possible: + +| # | Change | Asked for by | Why first | +|---|---|---|---| +| 1 | `DimAnnot.con` → a stable `SketchConstraintId` (and one `erase_constraint(i)` until then) | 13 (bug) | a data-integrity bug that a later step would build on top of | +| 2 | `WriteOutcome{Ok, ClampedTo, Refused}` on every parameter write, and `AutoEditStep::apply` returning it (19 sites) | 10, 12, 13 | without it every refusal stays silent by construction | +| 3 | `try_add_constraints` returns its `SketchSolveResult`; one `ConstraintDelta{kept, rebound, dropped}` | 11, 12, 13, 14 | the solver already knows the answer; three siblings want to say it | +| 4 | `SelectionSet` + `PickPolicy` (typed, ordered, per-tool) | 9, 11, 14 | the substrate the operators read their subject from | +| 5 | One `SketchEdit` journal + Ctrl+Z in a live sketch | 11, 12, 13, 14 | every modification erases something; today none of it is reversible | +| 6 | `ToolManager.leave()` = commit a ready gesture, one ESC ladder, one hover promise | 9, 12, 13, 14 | the three families currently answer "what does leaving mean" three ways | + +Phase 2 (3D) has no batch list yet — it needs one before it starts, or it will be designed by +whoever opens the file first. From 73bfcccd50223afada62a42ba27cfbe7d2ceb533 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sun, 27 Sep 2026 22:05:49 +0200 Subject: [PATCH 138/389] The sketch tools stop lying about what they did MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Twelve defects found by the 2D design pass. - ONE erase path repairs the dimensions' cached constraint indices. Removing a constraint renumbered m_constraints and left every later DimAnnot.con pointing one slot short, and set_dimension_value checked only the range, not the slot's identity — so editing a dimension's value could overwrite an unrelated constraint. All five mutators (badge delete, fillet/chamfer, Move/Rotate/Scale, the two drop paths) now route through erase_constraints(). - apply_dimension validates BEFORE moving or recording. A value outside a case's threshold moved nothing and then recorded the constraint anyway, handing the solver a number it could never satisfy; the socket guarded against this, the tool did not. - A Distance and its zero case are one dimension slot: typing 0 and then 5 used to leave a Coincident AND a Distance on the same operands. - A dimension whose constraint the solver rejected is named: the label renders in the refusal colour and the commit says the sketch is over-constrained, instead of showing a number the geometry does not have. - Six silent refusals now speak: fillet/chamfer on a non-corner and on an overrunning radius, offset on an ellipse or spline (the kernel's own reason), a rejected array binding ladder, a dimension pick on an unsupported entity. - set_tool commits a ready transform instead of dropping it, the rule the ready edit-op already followed. - Constraint releases are reported, and roles_of is one function again (the two copies had already diverged on EllipseArc). - Labels no longer collide: every label is its own centred ImGui window at an anchor whose offsets are multiples of the text height, so on a feature smaller than one text height a line's Length and Angle labels landed on the same spot. draw_text, the one function all of them pass through, now pushes a colliding label clear of the ones already drawn this frame. Verified: build and LTO link on behemoth (exit 0, new binary); on the rig, badge-delete took constraints 3->2 with dof 9->10 and the geometry untouched; the draw-then-edit chain committed a typed 70 to exactly 70.0 mm; and a 5.4 mm selected line renders "5.4 mm" and "21.8°" as separate readable labels. NOT yet exercised: the stale-index corruption itself (needs a middle delete with a labelled dimension after it), the poison-value guard through the field, the transform commit, and the red refusal label. --- src/slic3r/GUI/CAD/DesignSketchTool.cpp | 244 ++++++++++++++++-------- src/slic3r/GUI/CAD/DesignSketchTool.hpp | 22 ++- 2 files changed, 184 insertions(+), 82 deletions(-) diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 4e45940bf1..078c33752e 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -235,6 +235,10 @@ void DesignSketchTool::set_tool(Mode mode) // m_mode, so after the assignment they would test the tool being switched TO. That read // op_ready()==0 with a=0 b=3 val=28.205 sitting right there — picked, valued, and dropped. if (op_ready()) confirm_op(); + // And the same rule for the transform gizmo: a ready edit-op committed here while a pending + // transform was silently dropped, which is the same "the value was set, the ghost was drawn, + // and nothing was written" failure the comment above records for Fillet. + if (tf_ready()) confirm_transform(); // An OPEN inline value field freezes the canvas (on_mouse_impl returns early while // m_awaiting_length) and blocks every keyboard shortcut (in_text includes inline_busy()). @@ -603,6 +607,21 @@ void DesignSketchTool::apply_angle_between(int ia, int ib, double deg) void DesignSketchTool::apply_dimension(double v) { + // Refuse BEFORE moving or recording. Each case below has its own threshold (positive for + // length / radius / diameter, non-negative for a distance) and the constraint used to be + // recorded UNCONDITIONALLY after them — so a value that moved nothing was still handed to + // the solver, which then had to satisfy something it never could. The socket guarded against + // this and said so; now the tool does too, and it says why. + const DimType kind = dimension_kind(); + const bool needs_positive = (kind == DimType::Length || kind == DimType::Radius || + kind == DimType::Diameter); + if (!std::isfinite(v) || (needs_positive && v <= 0.0) || + (!needs_positive && kind != DimType::Angle && kind != DimType::None && v < 0.0)) { + if (on_readout) + on_readout(needs_positive ? "the value must be greater than zero" + : "the value must not be negative (zero means coincident)"); + return; + } switch (dimension_kind()) { case DimType::Length: { SketchEntity& e = m_entities[m_selection[0]]; @@ -651,6 +670,8 @@ void DesignSketchTool::apply_dimension(double v) } record_dimension_constraint(v); // store a driving constraint for this dimension resolve_live(); // live-solve so the viewport shows the solved sketch + if (!m_solve_ok && on_readout) // the number on screen is not the geometry's number + on_readout("that dimension cannot be satisfied — the sketch is over-constrained"); m_selection.clear(); if (on_selection_changed) on_selection_changed(0); } @@ -671,23 +692,23 @@ void DesignSketchTool::record_dimension_constraint(double v) c.type = SketchConstraintType::Distance; c.ea = m_selection[0]; c.ra = SketchPointRole::P0; c.eb = m_selection[0]; c.rb = SketchPointRole::P1; - c.value = v; m_constraints.push_back(c); break; + c.value = v; upsert_dimension_constraint(c); break; case DimType::Diameter: c.type = SketchConstraintType::Diameter; c.ea = m_selection[0]; c.value = v; - m_constraints.push_back(c); break; + upsert_dimension_constraint(c); break; case DimType::Radius: c.type = SketchConstraintType::Radius; c.ea = m_selection[0]; c.value = v; - m_constraints.push_back(c); break; + upsert_dimension_constraint(c); break; case DimType::Angle: c.type = SketchConstraintType::Angle; c.ea = m_selection[0]; c.eb = m_selection[1]; c.value = v; - m_constraints.push_back(c); break; + upsert_dimension_constraint(c); break; case DimType::Distance: { const int ia = m_selection[0], ib = m_selection[1]; if (v < 1e-9) c.type = SketchConstraintType::Coincident; else { c.type = SketchConstraintType::Distance; c.value = v; } c.ea = ia; c.ra = role(ia); c.eb = ib; c.rb = role(ib); - m_constraints.push_back(c); break; + upsert_dimension_constraint(c); break; } case DimType::DistanceToLine: { // Point-on-line driving constraint: hold the point-like entity at unsigned @@ -697,7 +718,7 @@ void DesignSketchTool::record_dimension_constraint(double v) const int il = m_selection[aLine ? 0 : 1]; // line c.type = SketchConstraintType::PointOnLine; c.ea = ip; c.ra = role(ip); c.eb = il; c.value = v; - m_constraints.push_back(c); break; + upsert_dimension_constraint(c); break; } default: break; // None: no driving constraint recorded } @@ -741,15 +762,21 @@ void DesignSketchTool::resolve_live_drag(int dragged_ei, SketchPointRole dragged m_dof = r.dof; m_solve_ok = r.ok; // Flag every entity referenced by a conflicting constraint so render() can - // tint it red (Onshape/SolveSpace over-constrained feedback). + // tint it red (Onshape/SolveSpace over-constrained feedback), and remember which + // DIMENSIONS those constraints drive: a label showing a value the geometry does not have + // is the one thing the user must be able to see, and r.bad names it. + m_bad_dims.clear(); for (int bi : r.bad) { if (bi < 0 || bi >= int(m_constraints.size())) continue; const SketchEntityConstraintDef& c = m_constraints[bi]; for (int e : {c.ea, c.eb, c.ec}) if (e >= 0 && e < int(m_entity_conflict.size())) m_entity_conflict[e] = 1; + for (int di = 0; di < int(m_dimensions.size()); ++di) + if (m_dimensions[di].con == bi) m_bad_dims.push_back(di); } } else { m_dof = -1; m_solve_ok = true; + m_bad_dims.clear(); } if (on_solve_state) on_solve_state(m_dof, m_solve_ok, has); } @@ -1113,6 +1140,24 @@ int DesignSketchTool::upsert_constraint(const SketchEntityConstraintDef& c) return int(m_constraints.size()) - 1; } +// A Distance and its zero case are ONE dimension slot: typing 0 records a Coincident, and typing +// 5 after that used to record a second constraint beside it — over-constrained by construction, +// which reads as the edit being ignored. Replace across that pair, then upsert normally. +int DesignSketchTool::upsert_dimension_constraint(const SketchEntityConstraintDef& c) +{ + const bool zero_case = (c.type == SketchConstraintType::Coincident); + const bool dist_case = (c.type == SketchConstraintType::Distance); + if (zero_case || dist_case) { + erase_constraints([&](int, const SketchEntityConstraintDef& d) { + const bool same = (d.ea == c.ea && d.eb == c.eb) || (d.ea == c.eb && d.eb == c.ea); + if (!same) return false; + return zero_case ? (d.type == SketchConstraintType::Distance) + : (d.type == SketchConstraintType::Coincident); + }); + } + return upsert_constraint(c); +} + // The same rule for the visible annotation: one quote per (kind, operands), so repeated edits // do not stack labels on top of each other reading different values. int DesignSketchTool::upsert_dimension(const DimAnnot& a) @@ -1160,7 +1205,7 @@ SketchEntityConstraintDef DesignSketchTool::constraint_for(const DimAnnot& a) co int DesignSketchTool::place_dimension(DimAnnot a) { a.value = measure_dim(a); - a.con = upsert_constraint(constraint_for(a)); + a.con = upsert_dimension_constraint(constraint_for(a)); const int di = upsert_dimension(a); resolve_live(); open_value_editor(di); @@ -1424,7 +1469,7 @@ void DesignSketchTool::open_primary_autoedit() m_autoedit_dims.push_back({ a.label_pos, a.value, [this, a](double v) mutable { a.value = v; - a.con = upsert_constraint(constraint_for(a)); + a.con = upsert_dimension_constraint(constraint_for(a)); upsert_dimension(a); resolve_live(); }, { a.ea, a.eb }, dimtype_title(a.kind) }); @@ -1556,6 +1601,25 @@ void DesignSketchTool::set_polygon_side(int fi, double side) // Remove orientation constraints touching [begin,end). A pure rotation makes inferred // per-edge Horizontal/Vertical (and Parallel/Perp/Angle/Lock) inconsistent, so leaving // them in would make resolve_live collapse the shape to satisfy them. +int DesignSketchTool::erase_constraints( + const std::function& drop) +{ + std::vector remap(m_constraints.size(), -1); + std::vector kept; + kept.reserve(m_constraints.size()); + for (int i = 0; i < int(m_constraints.size()); ++i) { + if (drop(i, m_constraints[i])) continue; // remove + remap[i] = int(kept.size()); + kept.push_back(m_constraints[i]); + } + if (kept.size() == m_constraints.size()) return 0; // nothing dropped + const int dropped = int(m_constraints.size() - kept.size()); + m_constraints.swap(kept); + for (DimAnnot& a : m_dimensions) // repair the cached indices + if (a.con >= 0) a.con = (a.con < int(remap.size())) ? remap[a.con] : -1; + return dropped; +} + void DesignSketchTool::drop_orientation_constraints(int begin, int end) { using CT = SketchConstraintType; @@ -1564,36 +1628,16 @@ void DesignSketchTool::drop_orientation_constraints(int begin, int end) t == CT::Perpendicular || t == CT::Angle || t == CT::LockX || t == CT::LockY; }; auto in = [&](int e) { return e >= begin && e < end; }; - std::vector remap(m_constraints.size(), -1); - std::vector kept; - kept.reserve(m_constraints.size()); - for (int i = 0; i < int(m_constraints.size()); ++i) { - const SketchEntityConstraintDef& c = m_constraints[i]; - if (orient(c.type) && (in(c.ea) || in(c.eb))) continue; // drop - remap[i] = int(kept.size()); - kept.push_back(c); - } - if (kept.size() == m_constraints.size()) return; // nothing dropped - m_constraints.swap(kept); - for (DimAnnot& a : m_dimensions) // fix cached con indices - if (a.con >= 0) a.con = (a.con < int(remap.size())) ? remap[a.con] : -1; + erase_constraints([&](int, const SketchEntityConstraintDef& c) { + return orient(c.type) && (in(c.ea) || in(c.eb)); + }); } void DesignSketchTool::drop_constraints_referencing(int ei) { - std::vector remap(m_constraints.size(), -1); - std::vector kept; - kept.reserve(m_constraints.size()); - for (int i = 0; i < int(m_constraints.size()); ++i) { - const SketchEntityConstraintDef& c = m_constraints[i]; - if (c.ea == ei || c.eb == ei || c.ec == ei) continue; // drop refs to the cut entity - remap[i] = int(kept.size()); - kept.push_back(c); - } - if (kept.size() == m_constraints.size()) return; - m_constraints.swap(kept); - for (DimAnnot& a : m_dimensions) - if (a.con >= 0) a.con = (a.con < int(remap.size())) ? remap[a.con] : -1; + erase_constraints([&](int, const SketchEntityConstraintDef& c) { + return c.ea == ei || c.eb == ei || c.ec == ei; // refs to the cut entity + }); } // Onshape scissors on the live sketch: cut the picked entity at its nearest intersection. @@ -2168,6 +2212,8 @@ void DesignSketchTool::set_dimension_value(double v) if (a.con >= 0 && a.con < int(m_constraints.size())) m_constraints[a.con] = constraint_for(a); resolve_live(); + if (!m_solve_ok && on_readout) + on_readout(dimtype_title(a.kind) + " cannot be satisfied — the sketch is over-constrained"); m_pending_dim = -1; } @@ -2431,7 +2477,9 @@ bool DesignSketchTool::remove_constraint_near(const Vec2d& p) bool DesignSketchTool::remove_constraint(int idx) { if (idx < 0 || idx >= int(m_constraints.size())) return false; - m_constraints.erase(m_constraints.begin() + idx); + const size_t before = m_constraints.size(); + erase_constraints([idx](int i, const SketchEntityConstraintDef&) { return i == idx; }); + if (m_constraints.size() == before) return false; // resolve_live(), not a bare solve: it is the path that recomputes the DoF, clears the // per-entity conflict flags and fires on_solve_state. Solving directly would relax the // geometry while leaving the DoF readout and any red over-constrained tint stale — the @@ -2442,39 +2490,41 @@ bool DesignSketchTool::remove_constraint(int idx) return true; } +// The endpoint roles an entity exposes to coincidence matching. ONE copy, deliberately: the two +// file-local lambdas that used to hold this had already diverged (an ellipse arc could be welded +// by the healer but never auto-inferred coincident at draw time, so the same gesture behaved +// differently depending on which path ran). +static int sketch_endpoint_roles(const SketchEntity& e, SketchPointRole out[2]) +{ + switch (e.type) { + case SketchEntity::Type::Line: + case SketchEntity::Type::Arc: + case SketchEntity::Type::BSpline: + case SketchEntity::Type::EllipseArc: + out[0] = SketchPointRole::P0; out[1] = SketchPointRole::P1; return 2; + case SketchEntity::Type::Point: + out[0] = SketchPointRole::P0; return 1; + default: return 0; // circle: centre coincidence is Concentric's job, not this one's + } +} + void DesignSketchTool::infer_auto_constraints(int base, double ang_tol_rad, double weld_tol) { const int n = int(m_entities.size()); if (base < 0 || base >= n) return; - // Endpoint roles an entity exposes for coincidence matching. - auto roles_of = [](const SketchEntity& e, SketchPointRole out[2]) -> int { - switch (e.type) { - case SketchEntity::Type::Line: out[0] = SketchPointRole::P0; out[1] = SketchPointRole::P1; return 2; - case SketchEntity::Type::Arc: out[0] = SketchPointRole::P0; out[1] = SketchPointRole::P1; return 2; - // EllipseArc was missing here while the otherwise identical roles_of in - // heal_coincidences (below) has it, so an ellipse arc's endpoints could be WELDED by the - // healer but never auto-inferred coincident at draw time -- the same gesture behaved - // differently depending on which path ran. Two copies of one rule is how that happens. - case SketchEntity::Type::EllipseArc: - out[0] = SketchPointRole::P0; out[1] = SketchPointRole::P1; return 2; - case SketchEntity::Type::BSpline:out[0] = SketchPointRole::P0; out[1] = SketchPointRole::P1; return 2; - case SketchEntity::Type::Point: out[0] = SketchPointRole::P0; return 1; - default: return 0; // circle: centre coincidence handled by Concentric, not here - } - }; // 1) Coincident between a new endpoint and any (co-located) endpoint of another // entity. snap_vertex already drove the coordinates together; this records it // so a re-solve keeps the loop closed. std::vector coincs; for (int i = base; i < n; ++i) { - SketchPointRole ir[2]; const int ni = roles_of(m_entities[i], ir); + SketchPointRole ir[2]; const int ni = sketch_endpoint_roles(m_entities[i], ir); for (int a = 0; a < ni; ++a) { Vec2d pa; if (!point_at(i, ir[a], pa)) continue; for (int j = 0; j < n; ++j) { if (j == i) continue; - SketchPointRole jr[2]; const int nj = roles_of(m_entities[j], jr); + SketchPointRole jr[2]; const int nj = sketch_endpoint_roles(m_entities[j], jr); for (int b = 0; b < nj; ++b) { if (j >= base && j < i) continue; // avoid duplicate (i,j)/(j,i) Vec2d pb; if (!point_at(j, jr[b], pb)) continue; @@ -6972,8 +7022,25 @@ void DesignSketchTool::draw_dim_label(const std::string& txt, const Vec2d& plane ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow()); ImGui::AlignTextToFramePadding(); ImDrawList* dl = ImGui::GetWindowDrawList(); - const ImVec2 pos = ImGui::GetCursorScreenPos(); const ImVec2 ts = ImGui::CalcTextSize(txt.c_str()); + // Push this label clear of any already drawn this frame (see m_label_rects). + { + ImVec2 wp = ImGui::GetWindowPos(); + const ImVec2 ws = ImGui::GetWindowSize(); + for (int guard = 0; guard < 8; ++guard) { + bool hit = false; + for (const LabelRect& r : m_label_rects) { + const double ix = std::min(double(wp.x) + ws.x, r.x + r.w) - std::max(double(wp.x), r.x); + const double iy = std::min(double(wp.y) + ws.y, r.y + r.h) - std::max(double(wp.y), r.y); + if (ix > 2.0 && iy > 2.0) { hit = true; break; } + } + if (!hit) break; + wp.y += ws.y + 2.0f; // straight down, one label per step + ImGui::SetWindowPos(wp, ImGuiCond_Always); + } + m_label_rects.push_back({double(wp.x), double(wp.y), double(ws.x), double(ws.y)}); + } + const ImVec2 pos = ImGui::GetCursorScreenPos(); const ImGuiStyle& st = ImGui::GetStyle(); dl->AddRectFilled(ImVec2(pos.x - st.FramePadding.x, pos.y + st.FramePadding.y), ImVec2(pos.x + ts.x + 2.0f * st.FramePadding.x, @@ -7110,7 +7177,12 @@ void DesignSketchTool::render_dimensions(double unit_per_px) const double th = std::max(15.0 * unit_per_px, 1e-4); for (size_t di = 0; di < m_dimensions.size(); ++di) { Vec2d label; - if (draw_dim_quote(m_dimensions[di], th, dimcol, label)) + // A dimension whose driving constraint the solver rejected is drawn in the refusal + // colour: its label is showing a value the geometry does not have, and this is the only + // thing on screen that points at WHICH number is the lie. + const bool bad = std::find(m_bad_dims.begin(), m_bad_dims.end(), int(di)) != m_bad_dims.end(); + const ColorRGBA col = bad ? ColorRGBA(0.92f, 0.35f, 0.35f, 1.0f) : dimcol; + if (draw_dim_quote(m_dimensions[di], th, col, label)) m_dimensions[di].label_pos = label; } } @@ -7805,6 +7877,11 @@ void DesignSketchTool::op_pick(int ei) if (t != SketchEntity::Type::Line) return; // corner ops need two lines if (m_op_a < 0) m_op_a = ei; else if (ei != m_op_a) { + Vec2d cC, cBis; double cTh = 0.0; + if (!op_corner(m_op_a, ei, cC, cBis, cTh)) { // parallel or straight: no corner + if (on_readout) on_readout("those two lines do not meet at a corner — pick two lines that do"); + return; + } m_op_b = ei; const double la = (m_entities[m_op_a].p1 - m_entities[m_op_a].p0).norm(); const double lb = (m_entities[m_op_b].p1 - m_entities[m_op_b].p0).norm(); @@ -7941,7 +8018,13 @@ void DesignSketchTool::confirm_op() const bool ok = fillet ? SketchEngine::fillet_lines(m_entities[m_op_a], m_entities[m_op_b], m_op_value, a_out, b_out, extra) : SketchEngine::chamfer_lines(m_entities[m_op_a], m_entities[m_op_b], m_op_value, a_out, b_out, extra); - if (!ok) { reset_op(); return; } + if (!ok) { + if (on_readout) on_readout(fillet + ? "Fillet: the radius overruns a leg, or the two lines do not meet at a corner" + : "Chamfer: the distance overruns a leg, or the two lines do not meet at a corner"); + reset_op(); + return; + } const int a = m_op_a, b = m_op_b; m_entities[a] = a_out; m_entities[b] = b_out; const int xi = int(m_entities.size()); @@ -7956,11 +8039,12 @@ void DesignSketchTool::confirm_op() return (d.ea == e && d.ra == r) || (d.eb == e && d.rb == r); }; auto self_len = [](const SketchEntityConstraintDef& d, int e) { return d.type == CT::Distance && d.ea == e && d.eb == e; }; - auto& cs = m_constraints; - cs.erase(std::remove_if(cs.begin(), cs.end(), [&](const SketchEntityConstraintDef& d) { + const int released = erase_constraints([&](int, const SketchEntityConstraintDef& d) { return (d.type == CT::Coincident && refs(d, a, ra) && refs(d, b, rb)) || self_len(d, a) || self_len(d, b); - }), cs.end()); + }); + if (released > 0 && on_readout) + on_readout(std::to_string(released) + " constraint(s) the fillet/chamfer invalidated were removed"); auto coin = [&](R xr, int ln, R lr) { SketchEntityConstraintDef d; d.type = CT::Coincident; d.ea = xi; d.ra = xr; d.eb = ln; d.rb = lr; return d; }; if (fillet) { @@ -7978,7 +8062,11 @@ void DesignSketchTool::confirm_op() } else if (m_mode == Mode::Offset) { const int a = m_op_a; auto out = SketchEngine::offset_entities({ m_entities[a] }, m_op_value); - if (out.empty()) { reset_op(); return; } + if (out.empty()) { + if (on_readout) on_readout("Offset: an ellipse or a spline has no parallel of its own kind — pick lines, arcs or circles"); + reset_op(); + return; + } const int ni = int(m_entities.size()); for (auto& o : out) m_entities.push_back(o); const SketchEntity::Type st = m_entities[a].type; @@ -8364,8 +8452,7 @@ void DesignSketchTool::confirm_transform() out = SketchEngine::transform_entities({ m_entities[ti] }, Vec2d(0, 0), 0.0, m_tf_scale, m_tf_pivot); if (!out.empty()) m_entities[ti] = out[0]; } - auto& cs = m_constraints; - cs.erase(std::remove_if(cs.begin(), cs.end(), [&](const SketchEntityConstraintDef& d) { + const int released = erase_constraints([&](int, const SketchEntityConstraintDef& d) { if (!(is_target(d.ea) || is_target(d.eb) || is_target(d.ec))) return false; const bool self = (d.ea == d.eb); // self-length Distance survives translate/rotate if (mode == Mode::Move) { @@ -8389,7 +8476,9 @@ void DesignSketchTool::confirm_transform() default: return true; // size + position broken } } - }), cs.end()); + }); + if (released > 0 && on_readout) + on_readout(std::to_string(released) + " constraint(s) released by the transform"); } else if (m_mode == Mode::Array || m_mode == Mode::PolarArray) { // ADDITIVE: append copies of each subject, then bind each copy to its source. Lines // get Parallel+EqualLength (linear) or EqualLength only (polar — rotation breaks @@ -8441,7 +8530,10 @@ void DesignSketchTool::confirm_transform() ladder = can_conc ? std::vector>{ mk(true), mk(false) } : std::vector>{ mk(false) }; } - for (auto& w : ladder) if (!w.empty() && try_add_constraints(w)) break; + bool bound = false; + for (auto& w : ladder) if (!w.empty() && try_add_constraints(w)) { bound = true; break; } + if (!bound && on_readout) + on_readout("the array copies are unconstrained — the solver refused every binding"); } } reset_tf(); @@ -8485,6 +8577,7 @@ void DesignSketchTool::emit_step_hint() void DesignSketchTool::render(GLCanvas3D& canvas) { m_dim_label_seq = 0; + m_label_rects.clear(); m_render_scale = canvas.get_scale(); // The open value field is anchored OVER the label it edits, and the label draws on top of // it — the same number twice at the same spot. Record which label that is so draw_text can @@ -9528,31 +9621,18 @@ DesignSketchTool::LoopReport DesignSketchTool::loop_report() const int DesignSketchTool::heal_coincidences(double tol, bool ignore_construction) { if (tol <= 0.0) tol = 1e-3; - // Endpoint roles an entity exposes, same set infer_auto_constraints matches on. - auto roles_of = [](const SketchEntity& e, SketchPointRole out[2]) -> int { - switch (e.type) { - case SketchEntity::Type::Line: - case SketchEntity::Type::Arc: - case SketchEntity::Type::BSpline: - case SketchEntity::Type::EllipseArc: - out[0] = SketchPointRole::P0; out[1] = SketchPointRole::P1; return 2; - case SketchEntity::Type::Point: - out[0] = SketchPointRole::P0; return 1; - default: return 0; - } - }; const int n = int(m_entities.size()); int welded = 0; std::vector cands; for (int i = 0; i < n; ++i) { if (ignore_construction && m_entities[i].construction) continue; - SketchPointRole ir[2]; const int ni = roles_of(m_entities[i], ir); + SketchPointRole ir[2]; const int ni = sketch_endpoint_roles(m_entities[i], ir); for (int a = 0; a < ni; ++a) { Vec2d pa; if (!point_at(i, ir[a], pa)) continue; for (int j = i + 1; j < n; ++j) { if (ignore_construction && m_entities[j].construction) continue; - SketchPointRole jr[2]; const int nj = roles_of(m_entities[j], jr); + SketchPointRole jr[2]; const int nj = sketch_endpoint_roles(m_entities[j], jr); for (int b = 0; b < nj; ++b) { Vec2d pb; if (!point_at(j, jr[b], pb)) continue; const double d = (pa - pb).norm(); @@ -10679,6 +10759,8 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) if (t == SketchEntity::Type::Line) { a.kind = DimType::Length; place_dimension(a); } else if (t == SketchEntity::Type::Circle) { a.kind = DimType::Diameter; place_dimension(a); } else if (t == SketchEntity::Type::Arc) { a.kind = DimType::Radius; place_dimension(a); } + else if (on_readout) + on_readout("no dimension for that entity yet — click a line, a circle, an arc, or two points"); } } else { if (got_pt && !(pe == m_dim_e0 && pr == m_dim_r0)) { @@ -10689,6 +10771,8 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) DimAnnot a; a.kind = DimType::DistanceToLine; a.ea = m_dim_e0; a.ra = m_dim_r0; a.eb = he; place_dimension(a); + } else if (he >= 0 && on_readout) { + on_readout("click a second point, or a line to measure the distance to"); } m_dim_has0 = false; // reset after the second pick } diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index 08e6cbc781..9763f74c60 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -808,12 +808,19 @@ private: // EllipseArc endpoint drag: Center translates; P0/P1 move the sweep start/end to the // parametric angle of the cursor on the ellipse frame (radius/shape preserved). void drag_ellipsearc_handle(int ei, SketchPointRole role, const Vec2d& target); + // The ONE way to remove constraints. m_dimensions[i].con caches a POSITIONAL index into + // m_constraints, so an erase that does not repair those links leaves a dimension pointing + // at whatever slid into the hole — and set_dimension_value then writes a def into that + // slot, silently overwriting an unrelated constraint. `drop(idx, def)` returns true to + // remove. Every removal in this file routes through here. + // Returns how many were removed. + int erase_constraints(const std::function& drop); // Drop orientation constraints (H/V/Parallel/Perp/Angle/LockX/LockY) on entities in // [begin,end). A ROTATION makes inferred per-edge H/V inconsistent, so re-solving - // against them collapses the shape — drop them first (fixes up DimAnnot.con indices). + // against them collapses the shape — drop them first. void drop_orientation_constraints(int begin, int end); // Drop every live constraint that references entity `ei` (Trim/Extend slide an endpoint, - // invalidating its constraints) and fix the dimensions' cached constraint indices. + // invalidating its constraints). void drop_constraints_referencing(int ei); // Standalone Trim/Extend scissors on the LIVE sketch: pick the entity nearest `p` (within // `tol` plane units) and cut it back to / out to its nearest intersection with the others. @@ -836,6 +843,9 @@ private: // UPDATE it, not append a rival asking for something else. Both return the index. int upsert_constraint(const SketchEntityConstraintDef& c); int upsert_dimension(const DimAnnot& a); + // The same slot rule for the DRIVING constraint: a Distance and its zero case (recorded as + // a Coincident) are one dimension, so they replace each other instead of stacking. + int upsert_dimension_constraint(const SketchEntityConstraintDef& c); int place_dimension(DimAnnot a); // create+drive+notify std::string dim_text(const DimAnnot& a) const; // rendered label string void render_dimensions(double unit_per_px); // quote lines + labels @@ -1113,6 +1123,7 @@ private: bool m_solve_ok{true}; // solver consistent (no conflicting constraints) std::vector m_entity_conflict; // per-entity flag: touched by a conflicting constraint std::vector m_dimensions; // placed dimension quotes (Mode::Dimension) + std::vector m_bad_dims; // dims whose driving constraint the solver rejected int m_dim_e0{-1}; // first picked point's entity (Dimension) SketchPointRole m_dim_r0{SketchPointRole::P0}; bool m_dim_has0{false}; // a first point is pending @@ -1136,6 +1147,13 @@ private: GLModel m_vertex_model; GLModel m_highlight_model; int m_dim_label_seq{0}; + // Screen rects of the labels already drawn this frame (cleared with m_dim_label_seq). Two + // labels on a SMALL feature collide: every anchor offset in this file is a multiple of the + // text height, so once the feature's on-screen size drops below one, a line's Length and + // Angle labels land on the same spot. Each label is its own centred window and nothing + // detects proximity, so the later one is pushed clear before it is drawn. + struct LabelRect { double x{0}, y{0}, w{0}, h{0}; }; + std::vector m_label_rects; float m_render_scale{1.0f}; // canvas scale for Measure-style dim labels GLModel m_fill_model; // translucent face fill for closed regions std::vector m_display_sketches; // committed sketches drawn persistently From a043979f44fc43814a7b50d1003245d0f402f972 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 28 Sep 2026 17:11:30 +0000 Subject: [PATCH 139/389] CAD kernel: fix the sketch solver, trim/offset/mirror, and history references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sketch layer - Trim/extend of an arc (and a circle opened into an arc) rewrites p0/p1 from the new angles; the wire builder, the solver and snapping read them. - Tangency binds the arc end that touches the line (or the other arc) instead of always the start, so a fillet tangent to both legs solves; circle-circle / circle-arc tangency uses the centre distance instead of CURVE_CURVE_TANGENT, which aborts on a circle. - Point-on-line distances and circle-line tangency keep the side the geometry is on; a point on an arc's rim uses PT_ON_CIRCLE. - The partitioned solve keeps constraints onto the origin/axes and counts free entities' DOF. - Zero-radius circles get no solver primitive and build no wire; constraints the solver cannot apply are reported in SketchSolveResult::skipped. - EllipseArc: mirror no longer yields the complement; after a solve its angles and ends are re-derived; on the XZ plane it is no longer built mirrored. - Offset: a circle follows the "+d = left of travel" rule (it shrinks, like a CCW arc chain); chains are joined at the weld tolerance. Bridge end pole fixed (G1, no cusp). Negative-scale transforms keep arcs and ellipses on their ends. Inference tolerances aligned with the weld. Model layer - Body references follow the body across delete / reorder / hide (resolved by the feature that made it); datum-plane ordinals are re-pointed; an index past the end is an error, not "the last body". New set_feature_enabled(). A move that puts a consumer above its input is refused. - Threads made from now on read thread_radius as the nominal major radius (internal: bore to minor, groove to major; external: groove cut into the rod); older recipes build as before. Bad thread parameters say why. Circular patterns span their angle end to end (new ones); add_pattern pivots on the modeling origin. - clear() drops variables; expression fields the GUI offers are bindable (thread_diameter, helix_*, thicken_thickness, ...); deg()/rad() in expressions; the recipe saves the modeling origin and body colours; names/colours follow bodies by identity. - Boolean and dress-up failures throw instead of returning the input; one produces_body(); hole standards corrected (82° inch countersinks, UNC names, #10-24); legacy profile solve validates indices and writes back only on success; v4 recipes read with a frozen field list. Tests cover each of the above. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- src/libslic3r/CAD/CadDocument.cpp | 625 ++++++++++++++++++++------ src/libslic3r/CAD/CadDocument.hpp | 99 +++- src/libslic3r/CAD/GeometryEngine.cpp | 34 +- src/libslic3r/CAD/GeometryEngine.hpp | 7 +- src/libslic3r/CAD/SketchEngine.cpp | 108 +++-- src/libslic3r/CAD/SketchEngine.hpp | 12 +- src/libslic3r/CAD/SketchInference.cpp | 27 +- src/libslic3r/CAD/SketchInference.hpp | 8 +- src/libslic3r/CAD/SketchSolver.cpp | 161 ++++++- src/libslic3r/CAD/SketchSolver.hpp | 4 + src/libslic3r/CAD/ThreadStandards.hpp | 2 + tests/libslic3r/test_caddocument.cpp | 370 +++++++++++++-- tests/libslic3r/test_sketchedit.cpp | 113 ++++- 13 files changed, 1291 insertions(+), 279 deletions(-) diff --git a/src/libslic3r/CAD/CadDocument.cpp b/src/libslic3r/CAD/CadDocument.cpp index ea20ffd966..22b84e0099 100644 --- a/src/libslic3r/CAD/CadDocument.cpp +++ b/src/libslic3r/CAD/CadDocument.cpp @@ -69,11 +69,14 @@ #include #include #include +#include +#include #include #include #include #include +#include #include namespace Slic3r { @@ -153,6 +156,21 @@ static TopoDS_Wire make_helix_spine(const CadFeature& f, std::string& err) // - internal: the V is CUT from the wall -> a sunken helical groove. The cut MUST // go outward into the wall to be visible; an inward V (the old behaviour) only // sweeps already-empty bore space and removes nothing. +// The V between two radii: its base (the axial edge) at `base_r`, its apex at `apex_r`. The +// base is meant to sit INSIDE the material it is fused to or cut from, the apex out in the space +// the thread reaches into. make_thread_profile below is the legacy layout. +static TopoDS_Wire make_thread_v(const gp_Pnt& origin, const gp_Dir& xdir, const gp_Dir& zdir, + double base_r, double apex_r, double pitch) +{ + gp_Vec vx(xdir), vz(zdir); + const double half = 0.42 * pitch; // < pitch/2: adjacent turns must not touch (see below) + gp_Pnt top (origin.XYZ() + (vx * base_r).XYZ() + (vz * ( half)).XYZ()); + gp_Pnt bot (origin.XYZ() + (vx * base_r).XYZ() + (vz * (-half)).XYZ()); + gp_Pnt apex(origin.XYZ() + (vx * apex_r).XYZ()); + BRepBuilderAPI_MakePolygon poly(top, bot, apex, Standard_True); + return poly.Wire(); +} + static TopoDS_Wire make_thread_profile(const gp_Pnt& origin, const gp_Dir& xdir, const gp_Dir& zdir, double radius, double pitch, double depth, bool internal) @@ -187,7 +205,10 @@ static TopoDS_Wire make_thread_profile(const gp_Pnt& origin, const gp_Dir& xdir, // Evaluate an arithmetic expression to a double. Supports + - * /, parentheses, // unary minus, decimal literals, and identifiers resolved via `vars`. Functions: -// sqrt, abs, sin, cos, tan (degrees), min, max, and the constant `pi`. +// sqrt, abs, sin, cos, tan, min, max, deg, rad, and the constant `pi`. +// ANGLES ARE DEGREES — every angle field in a feature is, so sin(30) is 0.5. `pi` is the number +// (for 2 * pi * r); to use it as an angle convert it: sin(deg(pi / 2)) = 1. deg() turns radians +// into degrees and rad() degrees into radians. // Throws std::runtime_error on any parse or lookup error, div-by-zero, bad arity. static double eval_expr(const std::string& src, const std::map& vars) { @@ -344,6 +365,8 @@ static double eval_expr(const std::string& src, const std::map& variables) std::string id = expr.substr(start, i - start); // skip "pi" and function names — they're built-ins, not variables if (id == "pi" || id == "sqrt" || id == "abs" || id == "sin" || id == "cos" || - id == "tan" || id == "min" || id == "max") continue; + id == "tan" || id == "min" || id == "max" || id == "deg" || id == "rad") continue; if (!variables.count(id)) throw std::runtime_error("unknown identifier: " + id); scope[id] = resolve(id); continue; @@ -411,11 +434,17 @@ evaluate_variables(const std::map& variables) static void assign_field(CadFeature& f, const std::string& field, double value) { // double fields (alphabetical) + if (field == "bool_tolerance") { f.bool_tolerance = value; return; } + if (field == "cut_offset") { f.cut_offset = value; return; } if (field == "distance") { f.distance = value; return; } if (field == "distance2") { f.distance2 = value; return; } if (field == "draft_angle") { f.draft_angle = value; return; } if (field == "dressup_size") { f.dressup_size = value; return; } if (field == "height") { f.height = value; return; } + if (field == "helix_height") { f.helix_height = value; return; } + if (field == "helix_pitch") { f.helix_pitch = value; return; } + if (field == "helix_radius") { f.helix_radius = value; return; } + if (field == "helix_taper_deg") { f.helix_taper_deg = value; return; } if (field == "hole_cbore_diameter") { f.hole_cbore_diameter = value; return; } if (field == "hole_cbore_depth") { f.hole_cbore_depth = value; return; } if (field == "hole_csink_angle") { f.hole_csink_angle = value; return; } @@ -426,28 +455,55 @@ static void assign_field(CadFeature& f, const std::string& field, double value) if (field == "hole_y") { f.hole_y = value; return; } if (field == "import_scale_x") { f.import_scale_x = value; return; } if (field == "import_scale_y") { f.import_scale_y = value; return; } + if (field == "mate_angle") { f.mate_angle = value; return; } + if (field == "mate_offset") { f.mate_offset = value; return; } if (field == "pattern_angle") { f.pattern_angle = value; return; } if (field == "pattern_spacing") { f.pattern_spacing = value; return; } if (field == "plane_angle_tilt") { f.plane_angle_tilt = value; return; } if (field == "plane_offset") { f.plane_offset = value; return; } + if (field == "plane_u_size") { f.plane_u_size = value; return; } + if (field == "plane_v_size") { f.plane_v_size = value; return; } if (field == "radius") { f.radius = value; return; } if (field == "revolve_angle") { f.revolve_angle = value; return; } if (field == "rib_depth") { f.rib_depth = value; return; } if (field == "rib_thickness") { f.rib_thickness = value; return; } if (field == "shell_thickness") { f.shell_thickness = value; return; } if (field == "taper_deg") { f.taper_deg = value; return; } + if (field == "thicken_thickness") { f.thicken_thickness = value; return; } if (field == "thread_depth") { f.thread_depth = value; return; } if (field == "thread_height") { f.thread_height = value; return; } if (field == "thread_pitch") { f.thread_pitch = value; return; } if (field == "thread_radius") { f.thread_radius = value; return; } + // The Thread card shows a DIAMETER (the size a thread is named by: M6, 1/4"), so that is + // the name it offers for binding; thread_radius stays for recipes that already use it. + if (field == "thread_diameter") { f.thread_radius = 0.5 * value; return; } if (field == "thread_x") { f.thread_x = value; return; } if (field == "thread_y") { f.thread_y = value; return; } if (field == "width") { f.width = value; return; } + if (field == "xf_angle_deg") { f.xf_angle_deg = value; return; } // int fields (rounded) if (field == "pattern_count") { f.pattern_count = (int)std::lround(value); return; } throw std::runtime_error("unknown parameter: " + field); } +bool CadDocument::produces_body(CadFeatureType t) +{ + switch (t) { + case CadFeatureType::Sketch: case CadFeatureType::Helix: case CadFeatureType::Plane: + case CadFeatureType::Axis: case CadFeatureType::CoordSys: case CadFeatureType::Project: + return false; + default: + return true; + } +} + +bool CadDocument::is_bindable_field(const std::string& field) +{ + CadFeature probe; + try { assign_field(probe, field, 0.0); return true; } + catch (const std::exception&) { return false; } +} + // --------------------------------------------------------------------------- // Sample a sketch entity at parameter t in [0,1]. Handles Line, Arc, BSpline (cubic, 4 poles). @@ -758,29 +814,46 @@ bool CadDocument::solve_sketch_feature(int index) if (f.constraints.empty()) return true; + // Legacy point-profile path. Every index is checked before the solver sees it: an unset + // (-1) or stale index made get_point/residuals read m_vars[2*-1]. A constraint type this + // solver cannot express is a failure, not a silent no-op, and the points are written back + // only when the solve succeeded — the entity path's rule (SketchSolver.cpp) too. + const int np = int(f.profile.points.size()); + auto ok_idx = [np](std::initializer_list ids) { + for (int i : ids) if (i < 0 || i >= np) return false; + return true; + }; SketchConstraints sc; for (const Vec2d& p : f.profile.points) sc.add_point(p.x(), p.y()); for (const SketchConstraintDef& c : f.constraints) { + bool valid = true; switch (c.type) { - case SketchConstraintType::Fix: sc.fix_point(c.a); break; - case SketchConstraintType::Coincident: sc.coincident(c.a, c.b); break; - case SketchConstraintType::Horizontal: sc.horizontal(c.a, c.b); break; - case SketchConstraintType::Vertical: sc.vertical(c.a, c.b); break; - case SketchConstraintType::Distance: sc.distance(c.a, c.b, c.value); break; - case SketchConstraintType::LockX: sc.lock_x(c.a, c.value); break; - case SketchConstraintType::LockY: sc.lock_y(c.a, c.value); break; - case SketchConstraintType::EqualLength: sc.equal_length(c.a, c.b, c.c, c.d); break; - case SketchConstraintType::Parallel: sc.parallel(c.a, c.b, c.c, c.d); break; - case SketchConstraintType::Perpendicular:sc.perpendicular(c.a, c.b, c.c, c.d); break; + case SketchConstraintType::Fix: if ((valid = ok_idx({c.a}))) sc.fix_point(c.a); break; + case SketchConstraintType::Coincident: if ((valid = ok_idx({c.a, c.b}))) sc.coincident(c.a, c.b); break; + case SketchConstraintType::Horizontal: if ((valid = ok_idx({c.a, c.b}))) sc.horizontal(c.a, c.b); break; + case SketchConstraintType::Vertical: if ((valid = ok_idx({c.a, c.b}))) sc.vertical(c.a, c.b); break; + case SketchConstraintType::Distance: if ((valid = ok_idx({c.a, c.b}))) sc.distance(c.a, c.b, c.value); break; + case SketchConstraintType::LockX: if ((valid = ok_idx({c.a}))) sc.lock_x(c.a, c.value); break; + case SketchConstraintType::LockY: if ((valid = ok_idx({c.a}))) sc.lock_y(c.a, c.value); break; + case SketchConstraintType::EqualLength: if ((valid = ok_idx({c.a, c.b, c.c, c.d}))) sc.equal_length(c.a, c.b, c.c, c.d); break; + case SketchConstraintType::Parallel: if ((valid = ok_idx({c.a, c.b, c.c, c.d}))) sc.parallel(c.a, c.b, c.c, c.d); break; + case SketchConstraintType::Perpendicular:if ((valid = ok_idx({c.a, c.b, c.c, c.d}))) sc.perpendicular(c.a, c.b, c.c, c.d); break; + // The legacy solver implements these too; they used to be dropped without a word. + case SketchConstraintType::Midpoint: if ((valid = ok_idx({c.a, c.b, c.c}))) sc.midpoint(c.a, c.b, c.c); break; + case SketchConstraintType::Symmetric: if ((valid = ok_idx({c.a, c.b, c.c, c.d}))) sc.symmetric(c.a, c.b, c.c, c.d); break; + case SketchConstraintType::Angle: if ((valid = ok_idx({c.a, c.b, c.c, c.d}))) sc.angle(c.a, c.b, c.c, c.d, c.value); break; + case SketchConstraintType::PointOnLine: if ((valid = ok_idx({c.a, c.b, c.c}))) sc.point_line_distance(c.a, c.b, c.c, c.value); break; + default: valid = false; break; // entity-only types } + if (!valid) return false; } - const bool ok = sc.solve(); + if (!sc.solve()) return false; for (size_t i = 0; i < f.profile.points.size(); ++i) f.profile.points[i] = sc.get_point(int(i)); - return ok; + return true; } int CadDocument::add_extrude(int sketch_ref, double distance, bool symmetric, @@ -893,34 +966,38 @@ int CadDocument::add_hole(double diameter, double depth, bool through, return int(features.size()) - 1; } -// Hole standards lookup table (representative ISO 273 medium / ISO 4762 / ANSI unified). -struct HoleStdEntry { const char* desig; double clearance; double cbore_d; double cbore_depth; double csink_d; }; +// Hole standards: clearance hole, counterbore for a socket head cap screw, countersink for a +// flat head screw. Metric: ISO 273 medium clearance, DIN 974-1 counterbores for ISO 4762 (depth +// = head height + ~0.4 mm), 90° countersinks sized to the ISO 10642 head. Inch: ASME B18.3 / +// B18.6.3 — the counterbore is the head plus 1/32", the countersink is 82°, the angle an inch +// flat head is made with (a 90° seat under an 82° head bears only on its rim). +// Designations are the ones ThreadStandards uses ("1/4-20 UNC"); the bare form without the +// series ("1/4-20") is still accepted, since recipes and scripts were written with it. +struct HoleStdEntry { const char* desig; double clearance; double cbore_d; double cbore_depth; + double csink_d; double csink_angle; }; static const HoleStdEntry kHoleStdTable[] = { - {"M3", 3.4, 6.0, 3.4, 6.3}, - {"M4", 4.5, 8.0, 4.4, 8.4}, - {"M5", 5.5, 10.0, 5.4, 10.4}, - {"M6", 6.6, 11.0, 6.8, 12.6}, - {"M8", 9.0, 15.0, 8.8, 17.3}, - {"M10", 11.0, 18.0, 11.0, 20.0}, - {"#6-32", 3.7, 8.8, 4.2, 8.7}, - {"#8-32", 4.4, 9.9, 5.1, 10.2}, - {"1/4-20", 6.9, 14.4, 7.2, 14.7}, - {"5/16-18", 8.8, 17.0, 8.2, 17.3}, - {"3/8-16", 10.5, 19.6, 9.5, 19.8}, + {"M3", 3.4, 6.5, 3.4, 6.7, 90}, + {"M4", 4.5, 8.0, 4.4, 9.0, 90}, + {"M5", 5.5, 10.0, 5.4, 11.3, 90}, + {"M6", 6.6, 11.0, 6.4, 13.4, 90}, + {"M8", 9.0, 15.0, 8.6, 17.9, 90}, + {"M10", 11.0, 18.0, 10.6, 22.4, 90}, + {"#6-32 UNC", 3.7, 6.4, 3.8, 7.1, 82}, + {"#8-32 UNC", 4.5, 7.9, 4.6, 8.4, 82}, + {"#10-24 UNC", 5.1, 9.5, 5.3, 9.8, 82}, + {"1/4-20 UNC", 6.8, 11.1, 6.9, 12.9, 82}, + {"5/16-18 UNC", 8.4, 13.5, 8.6, 16.1, 82}, + {"3/8-16 UNC", 10.1, 15.9, 10.2, 19.4, 82}, }; -static bool hole_std_lookup(const std::string& desig, double& clearance, - double& cbore_d, double& cbore_depth, double& csink_d) +static const HoleStdEntry* hole_std_lookup(const std::string& desig) { for (const auto& e : kHoleStdTable) { - if (e.desig == desig) { - clearance = e.clearance; - cbore_d = e.cbore_d; - cbore_depth = e.cbore_depth; - csink_d = e.csink_d; - return true; - } + const std::string d(e.desig); + if (d == desig) return &e; + const size_t sp = d.find(' '); + if (sp != std::string::npos && d.compare(0, sp, desig) == 0 && desig.size() == sp) return &e; } - return false; + return nullptr; } int CadDocument::add_hole_styled(double diameter, double depth, bool through, @@ -952,11 +1029,11 @@ int CadDocument::add_hole_standard(const std::string& designation, int style, bo double depth, double x, double y, const SketchPlane& plane, const std::string& name) { - double clearance, cbore_d, cbore_depth, csink_d; - if (!hole_std_lookup(designation, clearance, cbore_d, cbore_depth, csink_d)) + const HoleStdEntry* e = hole_std_lookup(designation); + if (e == nullptr) throw std::runtime_error("unknown hole standard \"" + designation + "\""); - return add_hole_styled(clearance, depth, through, x, y, plane, style, - cbore_d, cbore_depth, csink_d, 90, designation, name); + return add_hole_styled(e->clearance, depth, through, x, y, plane, style, + e->cbore_d, e->cbore_depth, e->csink_d, e->csink_angle, e->desig, name); } int CadDocument::add_thread(double radius, double pitch, double height, double depth, @@ -974,6 +1051,7 @@ int CadDocument::add_thread(double radius, double pitch, double height, double d f.thread_internal = internal; f.thread_x = x; f.thread_y = y; + f.thread_major_nominal = true; // `radius` is the major (nominal) radius features.push_back(f); return int(features.size()) - 1; } @@ -1048,7 +1126,13 @@ int CadDocument::add_pattern(bool circular, int count, double spacing, int dir, f.pattern_spacing = spacing; f.pattern_dir = dir; f.pattern_angle = angle_deg; + f.pattern_inclusive = true; f.target_body = target_body; + // The pattern's plane — its linear axes and the circular pattern's pivot — defaults to the + // XY plane through the MODELING origin (the bed centre), like every other default plane in + // the tab. Left at SketchPlane::XY() it pivoted about the bed's corner. + f.plane = SketchPlane::XY(); + f.plane.origin += modeling_origin; features.push_back(f); return int(features.size()) - 1; } @@ -1518,11 +1602,19 @@ std::vector> CadDocument::resolve_datum_plan // Resolve base reference plane. The default XY/XZ/YZ planes pass through the modeling // origin (bed centre); datum bases (>=3) are already in world coords from earlier passes. SketchPlane base; + bool base_missing = false; if (f.plane_base == 1) { base = SketchPlane::XZ(); base.origin += modeling_origin; } else if (f.plane_base == 2) { base = SketchPlane::YZ(); base.origin += modeling_origin; } else if (f.plane_base >= 3) { const int di = f.plane_base - 3; if (di < int(out.size())) base = out[di].second; + else { + // The datum it was built on is gone or hidden. Fall back to XY through the + // modeling origin like the other defaults, and SAY so in the plane's name — + // this list is what the GUI shows — instead of quietly becoming world XY. + base = SketchPlane::XY(); base.origin += modeling_origin; + base_missing = true; + } } else { base = SketchPlane::XY(); base.origin += modeling_origin; } @@ -1658,7 +1750,7 @@ std::vector> CadDocument::resolve_datum_plan } - out.emplace_back(f.name, result); + out.emplace_back(base_missing ? f.name + " (base plane missing)" : f.name, result); } return out; } @@ -1881,8 +1973,14 @@ void CadDocument::clear() display_mesh = TriangleMesh{}; display_body_meshes.clear(); display_tri_face.clear(); + display_tri_body.clear(); + origin_from_recipe = false; + // Variables are document state like the features: left behind, the previous project's + // variables were written into the next project's recipe. + variables.clear(); error.clear(); mate_conflicts.clear(); + ++topo_generation; // every face/edge id handed out before this is stale now // A cleared document is a fresh start with no history. m_undo.clear(); m_redo.clear(); @@ -1926,6 +2024,146 @@ bool CadDocument::redo() return true; } + +// A feature's body index: -1 means "the last body", anything else must exist. An index past +// the end used to fall back to the last body in silence, so a feature whose body had gone away +// went on to work on a different one. +static int pick_body(int ref, int nb) +{ + if (ref == -1) return nb - 1; + if (ref < 0 || ref >= nb) + throw std::runtime_error("a feature works on body " + std::to_string(ref + 1) + + ", which does not exist at that point in the history"); + return ref; +} + +// ---- body and datum-plane references across a change of history --------------------------- +// +// A feature names a body by its INDEX and a datum plane by its ORDINAL (3 + N = the Nth enabled +// Plane feature). Both are positions, and a position only means something against the history +// it was taken in: delete, reorder or hide a feature that makes a body or a datum plane and every +// later reference silently lands on a different one. The fix-up for features[] indices +// (for_each_feature_ref) never covered these two bases. + +// Every field holding a BODY index, and which list it indexes: `true` = the bodies as they stand +// while the feature is applied (recompute's running list), `false` = the finished list (datums +// are resolved against it afterwards). +template +static void for_each_body_ref(CadFeature& f, Visit&& visit) +{ + visit(f.target_body, true); + visit(f.bool_tool_body, true); + visit(f.cut_face_body, true); + visit(f.project_source_body, true); + visit(f.coordsys_body, false); + visit(f.axis_body, false); + visit(f.plane_face_body, false); + visit(f.plane_face2_body, false); + visit(f.plane_edge_body, false); + visit(f.plane_edge2_body, false); +} +static constexpr int kBodyRefCount = 10; +// A body reference whose body was made by a feature that has since been deleted or hidden. +static constexpr int kBodyGone = -1000; + +// Identity of bodies[i]: the feature that made it, and which of that feature's bodies it is. +static CadFeature::BodyId body_id_of(const std::vector& v, int i) +{ + CadFeature::BodyId id; + if (i < 0 || i >= int(v.size())) return id; + id.src = v[i].source_feature; + for (int j = 0; j < i; ++j) + if (v[j].source_feature == id.src) ++id.ord; + return id; +} +static int find_body(const std::vector& v, const CadFeature::BodyId& id) +{ + int ord = 0; + for (int i = 0; i < int(v.size()); ++i) + if (v[i].source_feature == id.src && ord++ == id.ord) return i; + return -1; +} + +// Re-point `f`'s body fields of one kind (`running`) from the identities recorded last time, +// then record the identities they resolve to now. Throws when a pending reference cannot be +// found: the body it named is gone, and working on some other body instead is the bug this +// exists to prevent. +static void settle_body_refs(CadFeature& f, const std::vector& v, bool running) +{ + if (f.body_ref_ids.size() != size_t(kBodyRefCount)) f.body_ref_ids.assign(kBodyRefCount, {}); + int k = 0; + for_each_body_ref(f, [&](int& ref, bool kind) { + CadFeature::BodyId& id = f.body_ref_ids[k++]; + if (kind != running) return; + if (ref == kBodyGone) + throw std::runtime_error("\"" + f.name + "\" works on a body made by a feature that was deleted or hidden"); + if (f.body_refs_pending && id.src >= 0) { + const int i = find_body(v, id); + if (i < 0) + throw std::runtime_error("\"" + f.name + "\" works on a body that does not exist at that point in the history"); + ref = i; + } + id = ref >= 0 ? body_id_of(v, ref) : CadFeature::BodyId{}; + }); +} + +// Datum-plane ordinals: plane_base, axis_plane_a, axis_plane_b hold 3 + N. +template +static void for_each_datum_ref(CadFeature& f, Visit&& visit) +{ + visit(f.plane_base); + visit(f.axis_plane_a); + visit(f.axis_plane_b); +} + +// Prepare every reference for a change of history in which feature `i` ends up at +// `map_feature(i)` (-1 = removed) and enabled as `enabled_after(i)`. Runs on the OLD history and +// writes into `features` in the old order; the caller then performs the change. +static void stage_history_change(std::vector& features, + const std::function& map_feature, + const std::function& enabled_after) +{ + const int n = int(features.size()); + auto alive = [&](int i) { return i >= 0 && i < n && map_feature(i) >= 0 && enabled_after(i); }; + + // Datum planes: ordinal -> old feature index, then -> new ordinal. + std::vector planes_before; + for (int i = 0; i < n; ++i) + if (features[i].type == CadFeatureType::Plane && features[i].enabled) planes_before.push_back(i); + std::vector> after; // (new index, old index) of planes enabled after + for (int i = 0; i < n; ++i) + if (features[i].type == CadFeatureType::Plane && alive(i)) after.emplace_back(map_feature(i), i); + std::sort(after.begin(), after.end()); + auto new_ordinal = [&](int old_feature) { + for (int k = 0; k < int(after.size()); ++k) + if (after[k].second == old_feature) return k; + return -1; + }; + + for (int j = 0; j < n; ++j) { + if (map_feature(j) < 0) continue; + CadFeature& f = features[j]; + for_each_datum_ref(f, [&](int& ref) { + if (ref < 3) return; + const int N = ref - 3; + const int oldf = (N < int(planes_before.size())) ? planes_before[N] : -1; + const int nn = oldf >= 0 ? new_ordinal(oldf) : -1; + // A plane that is gone or hidden stays pointed PAST the end, where resolution + // reports it, rather than quietly sliding onto the next plane. + ref = nn >= 0 ? 3 + nn : 3 + int(after.size()) + 1000; + }); + if (f.body_ref_ids.size() != size_t(kBodyRefCount)) continue; // never resolved: nothing to follow + int k = 0; + for_each_body_ref(f, [&](int& ref, bool) { + CadFeature::BodyId& id = f.body_ref_ids[k++]; + if (ref < 0 || id.src < 0) return; + if (!alive(id.src)) { ref = kBodyGone; id = {}; return; } + id.src = map_feature(id.src); + }); + f.body_refs_pending = true; + } +} + // Re-run recompute(); if it fails for a GENUINE geometry error, restore `snapshot` // and recompute that instead, so a rejected edit leaves the document exactly as it // was. recompute() also returns false for the BENIGN case where the edit simply @@ -1938,7 +2176,7 @@ static bool commit_or_rollback(CadDocument& doc, std::vector& snapsh bool has_solid_feature = false; for (const auto& f : doc.features) - if (f.enabled && f.type != CadFeatureType::Sketch) { has_solid_feature = true; break; } + if (f.enabled && CadDocument::produces_body(f.type)) { has_solid_feature = true; break; } if (!has_solid_feature) { doc.bodies.clear(); doc.body = TopoDS_Shape(); @@ -2012,6 +2250,15 @@ bool CadDocument::remove_feature(int index) std::sort(remove.begin(), remove.end()); remove.erase(std::unique(remove.begin(), remove.end()), remove.end()); + stage_history_change(features, + [&remove](int i) { + if (std::binary_search(remove.begin(), remove.end(), i)) return -1; + int shift = 0; + for (int r : remove) if (r < i) ++shift; + return i - shift; + }, + [this](int i) { return features[i].enabled; }); + // Erase high-to-low so earlier indices stay valid. for (auto it = remove.rbegin(); it != remove.rend(); ++it) features.erase(features.begin() + *it); @@ -2050,6 +2297,9 @@ bool CadDocument::move_feature(int index, int delta) return true; // clamped at the ends — no-op, not a failure std::vector snapshot = features; + stage_history_change(features, + [index, target](int i) { return i == index ? target : i == target ? index : i; }, + [this](int i) { return features[i].enabled; }); std::swap(features[index], features[target]); // The two slots traded places: fix every feature reference that pointed at either — @@ -2061,6 +2311,33 @@ bool CadDocument::move_feature(int index, int delta) for (auto& f : features) for_each_feature_ref(f, swap_ref); + // History runs top to bottom: a feature may only consume what comes BEFORE it. Moving a + // consumer above its sketch (or a sketch below its consumer) would make it read whatever the + // input held the last time round — or, for a Project, nothing. Refuse the move and say so. + for (int fi = 0; fi < int(features.size()); ++fi) { + CadFeature& f = features[fi]; + std::string bad; + auto check = [&](int& ref) { if (ref >= fi && bad.empty()) bad = features[ref].name; }; + check(f.sketch_ref); check(f.sweep_path_ref); check(f.pattern_curve_sketch); check(f.rib_sketch_ref); + for (int& r : f.loft_profile_refs) check(r); + if (!bad.empty()) { + error = "\"" + f.name + "\" uses \"" + bad + "\", so it cannot come before it"; + features.swap(snapshot); + return false; + } + } + + return commit_or_rollback(*this, snapshot); +} + +bool CadDocument::set_feature_enabled(int index, bool enabled) +{ + if (index < 0 || index >= int(features.size())) return false; + if (features[index].enabled == enabled) return true; + std::vector snapshot = features; + stage_history_change(features, [](int i) { return i; }, + [this, index, enabled](int i) { return i == index ? enabled : features[i].enabled; }); + features[index].enabled = enabled; return commit_or_rollback(*this, snapshot); } @@ -2370,7 +2647,11 @@ void CadDocument::apply_feature(TopoDS_Shape& result, bool& have_body, gp_Pnt o(sk.plane.origin.x(), sk.plane.origin.y(), sk.plane.origin.z()); gp_Dir xd(adir.x(), adir.y(), adir.z()); gp_Ax1 axis(o, xd); - const double ang = f.revolve_angle * M_PI / 180.0; + // Same angle rules as the solid Revolve (flip reverses it, and a negative sweep is a + // positive one about the reversed axis — MakeRevol wants (0, 2 pi]); this surface + // version used to ignore both. + double ang = (f.flip ? -f.revolve_angle : f.revolve_angle) * M_PI / 180.0; + if (ang < 0) { axis.Reverse(); ang = -ang; } BRepPrimAPI_MakeRevol rev(wire, axis, ang, false); if (!rev.IsDone()) throw std::runtime_error("surface-revolve: revolve failed"); result = rev.Shape(); have_body = true; @@ -2527,7 +2808,9 @@ void CadDocument::apply_feature(TopoDS_Shape& result, bool& have_body, Vec3d o = f.plane.to_world(Vec2d(0, 0)); gp_Ax1 ax(gp_Pnt(o.x(), o.y(), o.z()), gp_Dir(f.plane.normal.x(), f.plane.normal.y(), f.plane.normal.z())); - const double step = (f.pattern_angle * M_PI / 180.0) / double(n); + const bool full = std::abs(std::abs(f.pattern_angle) - 360.0) < 1e-9; + const double div = (f.pattern_inclusive && !full && n > 1) ? double(n - 1) : double(n); + const double step = (f.pattern_angle * M_PI / 180.0) / div; trsf.SetRotation(ax, step * i); } else { const Vec3d& d = (f.pattern_dir == 1) ? f.plane.y_axis : f.plane.x_axis; @@ -2634,15 +2917,27 @@ void CadDocument::apply_feature(TopoDS_Shape& result, bool& have_body, } case CadFeatureType::Thread: { // Reject degenerate parameters that make OCCT's helical sweep / boolean unstable (a tiny - // pitch, depth >= half-pitch, an enormous turn count, depth eating the whole wall). Better - // a no-op than a crash. Leave the body unchanged when the spec can't be built safely. + // pitch, depth >= half-pitch, an enormous turn count, depth eating the whole wall), and + // SAY which: a thread that quietly did nothing read, for an internal one, as "the tool + // does not intersect the body", and for an external one as nothing at all. { const double R = f.thread_radius, P = f.thread_pitch, H = f.thread_height, D = f.thread_depth; // ISO external thread depth is ~0.61*P, so allow up to 0.7*P (0.49 wrongly rejected // every real thread -> nothing rendered). Still bound it well under a full pitch. - const bool ok = R > 0.5 && P > 0.1 && D > 1e-3 && D < 0.7 * P && D < 0.45 * R - && H > 0.5 * P && (H / P) < 400.0; - if (!ok) break; // result/have_body untouched + // R >= 0.5 (not >): M1, the smallest size in the standards table, is exactly 0.5. + const char* why = R < 0.5 ? "thread: the diameter must be at least 1 mm" + : P <= 0.1 ? "thread: the pitch must be more than 0.1 mm" + : (D <= 1e-3 || D >= 0.7 * P) ? "thread: the depth must be between 0 and 0.7 x the pitch" + : D >= 0.45 * R ? "thread: the depth is too large for this diameter" + : H <= 0.5 * P ? "thread: the length must be more than half a pitch" + : H / P >= 400.0 ? "thread: too many turns (length / pitch must stay under 400)" + : nullptr; + // Legacy recipes keep their old outcome (the body left as it was) so a project that + // opened before still opens; every thread made now reports the reason instead. + if (why != nullptr) { + if (f.thread_major_nominal) throw std::runtime_error(why); + break; + } } // Axis at the positioned point on the plane; +normal = thread rise. Vec3d c3 = f.plane.to_world(Vec2d(f.thread_x, f.thread_y)); @@ -2651,63 +2946,79 @@ void CadDocument::apply_feature(TopoDS_Shape& result, bool& have_body, gp_Dir xdir(f.plane.x_axis.x(), f.plane.x_axis.y(), f.plane.x_axis.z()); gp_Ax3 ax3(c, zdir, xdir); gp_Ax2 ax2(c, zdir, xdir); + const double R = f.thread_radius, D = f.thread_depth; + // Root the V CLEARLY inside the material (a real overlap, not a tangency) so the boolean + // has clean intersections — near-coincident faces are what make OCCT's fuse/cut unstable. + const double over = std::min(std::max(D, 0.25), R * 0.4); - // Build the swept helical ridge (guarded — never fatal). - TopoDS_Shape ridge; - bool have_ridge = false; - try { - TopoDS_Wire spine = make_helix_wire(ax3, f.thread_radius, - f.thread_pitch, f.thread_height); - TopoDS_Wire prof = make_thread_profile(c, xdir, zdir, f.thread_radius, - f.thread_pitch, f.thread_depth, - f.thread_internal); - // MakePipeShell with a FIXED BINORMAL = cylinder axis keeps the V-profile's orientation - // constant along the helix (axial edge always parallel to the axis, V always pointing - // radially out). The plain MakePipe used a Frenet frame that TWISTED the profile around - // the helix -> the wedge inclination varied and looked mirrored. - BRepOffsetAPI_MakePipeShell pipe(spine); - pipe.SetMode(zdir); - pipe.Add(prof); - pipe.Build(); - if (pipe.IsDone() && pipe.MakeSolid()) { - ridge = pipe.Shape(); - have_ridge = !ridge.IsNull(); + // Sweep a V profile along the helix (guarded — never fatal). `helix_r` is the radius the + // helix runs at: the profile is placed relative to it. + auto sweep = [&](double helix_r, const TopoDS_Wire& prof, TopoDS_Shape& out) { + try { + TopoDS_Wire spine = make_helix_wire(ax3, helix_r, f.thread_pitch, f.thread_height); + // MakePipeShell with a FIXED BINORMAL = cylinder axis keeps the V-profile's + // orientation constant along the helix (axial edge always parallel to the axis). + // The plain MakePipe used a Frenet frame that TWISTED the profile around the helix. + BRepOffsetAPI_MakePipeShell pipe(spine); + pipe.SetMode(zdir); + pipe.Add(prof); + pipe.Build(); + if (pipe.IsDone() && pipe.MakeSolid()) out = pipe.Shape(); + } catch (const Standard_Failure&) { // on OCCT >= 8 it derives from std::exception: first + } catch (const std::exception&) { } - } catch (const Standard_Failure&) { - have_ridge = false; // OCCT failure — on OCCT >= 8 Standard_Failure derives from std::exception, so this handler must come first - } catch (const std::exception&) { - have_ridge = false; // fall back to the bare cylinder/bore below + return !out.IsNull(); + }; + auto cut_from = [](TopoDS_Shape& target, const TopoDS_Shape& tool) { + BRepAlgoAPI_Cut cut(target, tool); + if (cut.IsDone() && !cut.Shape().IsNull()) target = cut.Shape(); + }; + + if (f.thread_major_nominal) { + if (f.thread_internal) { + // Tapped hole: bore to the minor radius R - D, then cut the groove out to the + // major radius R. The bore sits 10 um inside the minor radius so that, threading + // an existing tap-drill hole, it does not coincide with that hole's wall. + if (!have_body) throw std::runtime_error("internal thread needs a body"); + const double bore_r = R - D - 0.01; + cut_from(result, BRepPrimAPI_MakeCylinder(ax2, bore_r, f.thread_height).Shape()); + TopoDS_Shape groove; + if (sweep(R, make_thread_v(c, xdir, zdir, R - D - over, R, f.thread_pitch), groove)) + cut_from(result, groove); + } else { + // External thread: the crests are at R. A groove is cut INTO the rod down to + // R - D; with no body yet, the rod is made first. + if (!have_body || result.IsNull()) { + result = BRepPrimAPI_MakeCylinder(ax2, R, f.thread_height).Shape(); + have_body = true; + } + TopoDS_Shape groove; + if (sweep(R, make_thread_v(c, xdir, zdir, R + over, R - D, f.thread_pitch), groove)) + cut_from(result, groove); + } + break; } + // ---- legacy recipes (thread_major_nominal == false): built exactly as they always were. + TopoDS_Shape ridge; + const bool have_ridge = sweep(R, make_thread_profile(c, xdir, zdir, f.thread_radius, + f.thread_pitch, f.thread_depth, + f.thread_internal), ridge); if (f.thread_internal) { if (!have_body) throw std::runtime_error("internal thread needs a body"); - // Tapped bore: ensure a clean cylindrical pocket, then carve the - // OUTWARD helical groove into its wall. When the thread is invoked on - // an existing hole the bore cut is coincident (a no-op that may report - // !IsDone) — tolerate it so the visible groove cut below still runs. - // Cut the pocket at the MINOR diameter (radius - depth), not the nominal radius. - // A nominal-radius bore that coincides with an existing hole's wall creates - // coincident faces that foul the following groove boolean (the groove then removes - // ~nothing -> invisible thread). The minor bore stays strictly inside any existing - // hole wall, leaving it clean for the groove; on solid stock it forms the tap-drill. + // Tapped bore: cut a clean pocket at radius - depth, then carve the helical groove + // outward into its wall. const double bore_r = std::max(0.5, f.thread_radius - f.thread_depth); - TopoDS_Shape bore = BRepPrimAPI_MakeCylinder(ax2, bore_r, - f.thread_height).Shape(); + TopoDS_Shape bore = BRepPrimAPI_MakeCylinder(ax2, bore_r, f.thread_height).Shape(); try { BRepAlgoAPI_Cut cut_bore(result, bore); if (cut_bore.IsDone() && !cut_bore.Shape().IsNull()) result = cut_bore.Shape(); } catch (const std::exception&) { /* keep existing bore */ } - if (have_ridge) { - BRepAlgoAPI_Cut cut_ridge(result, ridge); - if (cut_ridge.IsDone() && !cut_ridge.Shape().IsNull()) - result = cut_ridge.Shape(); - } + if (have_ridge) cut_from(result, ridge); } else { - // External thread: FUSE the helical ridge ONTO the existing body (the picked cylinder), - // leaving the rest of the part intact. Replacing the body with a bare rod — the old - // behaviour — wiped whatever the user picked; that was the "mess". With no body yet - // (a thread from scratch on a dropdown plane), fall back to a standalone threaded rod. + // External thread: FUSE the helical ridge onto the existing body, or onto a + // standalone rod when there is none. if (have_body && !result.IsNull()) { if (have_ridge) { BRepAlgoAPI_Fuse fuse(result, ridge); @@ -2827,12 +3138,16 @@ static TriangleMesh tessellate_bodies(const std::vector& bodies, void CadDocument::apply_boolean(std::vector& bodies, const CadFeature& f) const { const int nb = int(bodies.size()); - const int tgt = (f.target_body >= 0 && f.target_body < nb) ? f.target_body : nb - 1; - const int tool = (f.bool_tool_body >= 0 && f.bool_tool_body < nb) ? f.bool_tool_body : -1; - if (tgt < 0 || tool < 0 || tgt == tool) return; // need two distinct bodies; otherwise no-op + const int tgt = pick_body(f.target_body, nb); + const int tool = f.bool_tool_body == -1 ? -1 : pick_body(f.bool_tool_body, nb); + // Same rule as Cut, Mirror and Transform: an operation that cannot run says why, rather + // than leaving the bodies as they were and reporting success. + if (tgt < 0) throw std::runtime_error("boolean: no target body"); + if (tool < 0) throw std::runtime_error("boolean: no tool body — pick a second body"); + if (tgt == tool) throw std::runtime_error("boolean: the target and the tool are the same body"); const TopoDS_Shape A = bodies[tgt].shape; // target survives const TopoDS_Shape B = bodies[tool].shape; // tool, consumed unless kept - if (A.IsNull() || B.IsNull()) return; + if (A.IsNull() || B.IsNull()) throw std::runtime_error("boolean: a body has no geometry"); TopTools_ListOfShape args, tools; args.Append(A); @@ -2850,7 +3165,7 @@ void CadDocument::apply_boolean(std::vector& bodies, const CadFeature& case BooleanMode::Add: { BRepAlgoAPI_Fuse op; result = run(op); break; } // union case BooleanMode::Cut: { BRepAlgoAPI_Cut op; result = run(op); break; } // target - tool case BooleanMode::Intersect: { BRepAlgoAPI_Common op; result = run(op); break; } // overlap - default: return; // BooleanMode::New is meaningless between two existing bodies + default: throw std::runtime_error("boolean: choose Union, Subtract or Intersect"); // New means nothing between two bodies } if (result.IsNull()) throw std::runtime_error("boolean produced an empty shape"); @@ -2862,7 +3177,7 @@ void CadDocument::apply_cut(std::vector& bodies, const CadFeature& f) c { const int nb = int(bodies.size()); if (nb == 0) throw std::runtime_error("cut: no target body"); - const int tgt = (f.target_body >= 0 && f.target_body < nb) ? f.target_body : nb - 1; + const int tgt = pick_body(f.target_body, nb); if (tgt < 0 || bodies[tgt].shape.IsNull()) throw std::runtime_error("cut: no target body"); if (!f.cut_keep_upper && !f.cut_keep_lower) @@ -2870,7 +3185,7 @@ void CadDocument::apply_cut(std::vector& bodies, const CadFeature& f) c SketchPlane cp; if (f.cut_face >= 0) { - const int fb = (f.cut_face_body >= 0 && f.cut_face_body < nb) ? f.cut_face_body : tgt; + const int fb = f.cut_face_body == -1 ? tgt : pick_body(f.cut_face_body, nb); if (bodies[fb].shape.IsNull()) throw std::runtime_error("cut: face body is empty"); TopoDS_Face fc = GeometryEngine::face_by_index(bodies[fb].shape, f.cut_face); if (fc.IsNull()) throw std::runtime_error("cut: face not found"); @@ -2933,7 +3248,7 @@ void CadDocument::apply_mirror(std::vector& bodies, const CadFeature& f { const int nb = int(bodies.size()); if (nb == 0) throw std::runtime_error("mirror: no target body"); - const int tgt = (f.target_body >= 0 && f.target_body < nb) ? f.target_body : nb - 1; + const int tgt = pick_body(f.target_body, nb); if (tgt < 0 || bodies[tgt].shape.IsNull()) throw std::runtime_error("mirror: no target body"); const TopoDS_Shape& src = bodies[tgt].shape; @@ -2980,7 +3295,7 @@ void CadDocument::apply_transform(std::vector& bodies, const CadFeature { const int nb = int(bodies.size()); if (nb == 0) throw std::runtime_error("transform: no target body"); - const int tgt = (f.target_body >= 0 && f.target_body < nb) ? f.target_body : nb - 1; + const int tgt = pick_body(f.target_body, nb); if (tgt < 0 || bodies[tgt].shape.IsNull()) throw std::runtime_error("transform: no target body"); gp_Trsf rot; @@ -3009,7 +3324,7 @@ void CadDocument::apply_thicken(std::vector& bodies, const CadFeature& { const int nb = int(bodies.size()); if (nb == 0) throw std::runtime_error("thicken: no target body"); - const int tgt = (f.target_body >= 0 && f.target_body < nb) ? f.target_body : nb - 1; + const int tgt = pick_body(f.target_body, nb); if (tgt < 0 || bodies[tgt].shape.IsNull()) throw std::runtime_error("thicken: no target body"); TopoDS_Face fc = GeometryEngine::face_by_index(bodies[tgt].shape, f.thicken_face); @@ -3044,7 +3359,7 @@ void CadDocument::apply_thicken_surface(std::vector& bodies, const CadF { const int nb = int(bodies.size()); if (nb == 0) throw std::runtime_error("thicken-surface: no target body"); - const int tgt = (f.target_body >= 0 && f.target_body < nb) ? f.target_body : nb - 1; + const int tgt = pick_body(f.target_body, nb); if (tgt < 0 || bodies[tgt].shape.IsNull()) throw std::runtime_error("thicken-surface: no target body"); if (!is_sheet_shape(bodies[tgt].shape)) throw std::runtime_error("thicken-surface: target is not a sheet body"); if (std::abs(f.thicken_thickness) < 1e-9) throw std::runtime_error("thicken-surface: thickness is zero"); @@ -3147,7 +3462,7 @@ void CadDocument::apply_surface_offset(std::vector& bodies, const CadFe { const int nb = int(bodies.size()); if (nb == 0) throw std::runtime_error("surface-offset: no target body"); - const int tgt = (f.target_body >= 0 && f.target_body < nb) ? f.target_body : nb - 1; + const int tgt = pick_body(f.target_body, nb); if (tgt < 0 || bodies[tgt].shape.IsNull()) throw std::runtime_error("surface-offset: no target body"); if (!is_sheet_shape(bodies[tgt].shape)) throw std::runtime_error("surface-offset: target is not a sheet body"); const double d = f.plane_offset; @@ -3239,8 +3554,7 @@ void CadDocument::apply_project(const std::vector& bodies, CadFeature& f.entities.clear(); const int nb = int(bodies.size()); if (nb == 0) throw std::runtime_error("project: no source body"); - const int src = (f.project_source_body >= 0 && f.project_source_body < nb) - ? f.project_source_body : nb - 1; + const int src = pick_body(f.project_source_body, nb); if (src < 0 || bodies[src].shape.IsNull()) throw std::runtime_error("project: source body is empty"); const TopoDS_Shape& shape = bodies[src].shape; @@ -3300,7 +3614,7 @@ void CadDocument::detect_mate_conflicts() std::string this_name = f.name.empty() ? "Mate" : f.name; mate_conflicts.push_back({fi, "Body " + std::to_string(dst + 1) + " is already positioned by '" + - first_name + "' (feature " + std::to_string(first_fi) + + first_name + "' (feature " + std::to_string(first_fi + 1) + ") — '" + this_name + "' overrides it; suppress one"}); } else { first_driver[dst] = fi; @@ -3424,6 +3738,8 @@ void CadDocument::apply_mate(std::vector& bodies, const CadFeature& f) 0, 0, -1, 0); } + if (f.mate_kind < 0 || f.mate_kind > 4) + throw std::runtime_error("mate: unknown mate type " + std::to_string(f.mate_kind)); gp_Trsf T; if (f.mate_kind == 0) { // Fastened: T = M_A * Rz(mate_angle) * Tz(mate_offset) * F * M_B^-1 @@ -3562,8 +3878,7 @@ void CadDocument::route_feature(std::vector& bodies, const CadFeature& if (f.type == CadFeatureType::SurfaceOffset) { apply_surface_offset(bodies, f); return; } if (f.type == CadFeatureType::Project) return; // sketch-like: consumed downstream, no body // Resolve the target body: explicit target_body when valid, else the last body. - const int t = (f.target_body >= 0 && f.target_body < int(bodies.size())) - ? f.target_body : int(bodies.size()) - 1; + const int t = pick_body(f.target_body, int(bodies.size())); const TopoDS_Shape context = (t >= 0) ? bodies[t].shape : TopoDS_Shape(); // A New extrude (or the very first solid feature) starts a fresh body; everything else // mutates the target body in place. @@ -3642,8 +3957,9 @@ bool CadDocument::recompute() if (f.type == CadFeatureType::Plane) continue; // datum: no solid, derived on demand if (f.type == CadFeatureType::Axis) continue; // datum axis if (f.type == CadFeatureType::CoordSys) continue; // datum coordinate system - // Past the skips: this feature is one that means to leave a body behind. - any_solid_feature = true; + // Past the skips. Project runs here too but leaves no body of its own. + if (produces_body(f.type)) any_solid_feature = true; + settle_body_refs(f, built, true); if (f.type == CadFeatureType::Project) { apply_project(built, f); } else { route_feature(built, f); } // Record which feature made each body. "Still unset?" is the whole rule, and it is @@ -3693,22 +4009,37 @@ bool CadDocument::recompute() } // recompute() replaces the bodies vector wholesale, which would drop any per-body - // colour override (Color tool). Body indices are stable across a rebuild (bodies are - // appended in feature order), so carry the override forward by index — same indexing - // contract the GUI relies on for per-body visibility/Move. - for (size_t i = 0; i < built.size() && i < bodies.size(); ++i) { + // colour override (Color tool) and the name the user gave a body. They are carried forward + // by the body's IDENTITY — the feature that made it and which of its bodies it is — not by + // its index: a Boolean consuming its tool, a Mirror replacing its source or a Cut splitting + // one body into two all shift every later index, and by index the colour and the name + // moved to a different body. + for (size_t i = 0; i < bodies.size(); ++i) { + if (!bodies[i].has_color && !bodies[i].has_user_name) continue; + const int j = find_body(built, body_id_of(bodies, int(i))); + if (j < 0) continue; if (bodies[i].has_color) { - built[i].has_color = true; - built[i].color = bodies[i].color; + built[j].has_color = true; + built[j].color = bodies[i].color; } - // ...and the name the user gave the body, for the same reason and by the same index - // contract. Without this a rename would live exactly until the next feature was added. if (bodies[i].has_user_name) { - built[i].has_user_name = true; - built[i].user_name = bodies[i].user_name; + built[j].has_user_name = true; + built[j].user_name = bodies[i].user_name; } } bodies = std::move(built); + // Datum references index the FINISHED body list; settle them against it, and close every + // pending re-point now that both kinds have been through settle_body_refs. + try { + for (CadFeature& f : features) { + if (!f.enabled) continue; // a hidden feature keeps its pending re-point for when it returns + settle_body_refs(f, bodies, false); + f.body_refs_pending = false; + } + } catch (const std::exception& e) { + error = e.what(); + return false; + } // The face and edge maps have just been rebuilt, so every global id handed out before this // point now means something else. Bump here rather than in each mutator: this is the single // line where the topology is actually replaced, so it cannot be forgotten by a new feature @@ -3869,6 +4200,22 @@ std::string CadDocument::serialize_recipe() const uint32_t blen = static_cast(bb.size()); ar(blen); ar(cereal::binary_data(bb.data(), bb.size())); + // DOCUMENT EXTRAS, appended after the body names on the same terms (older builds stop + // reading before it): the modeling origin, and the body colours. A colour set with the + // Color tool used to live only until the project was closed. + std::map> colours; + for (uint32_t i = 0; i < bodies.size(); ++i) + if (bodies[i].has_color) + colours[i] = { bodies[i].color.r(), bodies[i].color.g(), bodies[i].color.b(), bodies[i].color.a() }; + std::ostringstream xos; + { + cereal::BinaryOutputArchive xa(xos); + xa(modeling_origin.x(), modeling_origin.y(), modeling_origin.z(), colours); + } + std::string xb = xos.str(); + uint32_t xlen = static_cast(xb.size()); + ar(xlen); + ar(cereal::binary_data(xb.data(), xb.size())); } return oss.str(); } @@ -3950,6 +4297,24 @@ bool CadDocument::deserialize_recipe(const std::string& blob) } catch (...) { named.clear(); } + // Document extras (origin, colours), when the project has them. The origin must be + // in place BEFORE the rebuild: datum planes are resolved against it. + std::map> colours; + try { + uint32_t xlen; + ar(xlen); + std::string xbuf(xlen, '\0'); + if (xlen > 0) + ar(cereal::binary_data(&xbuf[0], xlen)); + std::istringstream xs(xbuf); + cereal::BinaryInputArchive xa(xs); + double ox = 0, oy = 0, oz = 0; + xa(ox, oy, oz, colours); + modeling_origin = Vec3d(ox, oy, oz); + origin_from_recipe = true; + } catch (...) { + colours.clear(); // older project: the caller's origin stands + } // AFTER the rebuild, never before: recompute() replaces the bodies vector wholesale. const bool ok = recompute(); for (const auto& kv : named) @@ -3957,11 +4322,21 @@ bool CadDocument::deserialize_recipe(const std::string& blob) bodies[kv.first].has_user_name = true; bodies[kv.first].user_name = kv.second; } + for (const auto& kv : colours) + if (kv.first < bodies.size()) { + bodies[kv.first].has_color = true; + bodies[kv.first].color = ColorRGBA(kv.second[0], kv.second[1], kv.second[2], kv.second[3]); + } return ok; } if (v == 4) { - // Pre-framing flat path, unchanged: v4 projects keep opening exactly as before. - ar(features); + // Pre-framing flat path: v4 projects keep opening, read with the FROZEN v4 field list + // (CadFeature::load_flat_v4) so fields appended to the framed layout since cannot + // shift every byte after them. + cereal::size_type n = 0; + ar(cereal::make_size_tag(n)); + features.assign(size_t(n), CadFeature{}); + for (CadFeature& f : features) f.load_flat_v4(ar); ar(variables); return recompute(); } diff --git a/src/libslic3r/CAD/CadDocument.hpp b/src/libslic3r/CAD/CadDocument.hpp index f62536384a..6969473b69 100644 --- a/src/libslic3r/CAD/CadDocument.hpp +++ b/src/libslic3r/CAD/CadDocument.hpp @@ -74,7 +74,7 @@ struct CadFeature { // the OCCT shape verbatim — it is adopted as a base body in route_feature (no parametric // recipe). Downstream face/edge features (fillet/chamfer/cut/shell/...) act on it like any // other body. TopoDS_Shape is a cheap handle, so copying it through recompute/checkpoint - // snapshots is cheap. In-session only for now (no BRep serialization yet). + // snapshots is cheap. Saved with the recipe as a BRep string (see save()/load()). TopoDS_Shape imported_solid; // Non-destructive placement transform for imported_regions (Text/SVG), @@ -130,12 +130,21 @@ struct CadFeature { std::string hole_standard; // provenance only, e.g. "M6" / "1/4-20"; not used by geometry // Thread params (helical thread about the plane normal at a positioned point) - double thread_radius{5}; // nominal cylinder radius + double thread_radius{5}; // MAJOR (nominal) radius when thread_major_nominal, + // else the legacy reference radius (see below) double thread_pitch{2}; // axial advance per turn double thread_height{10}; // total axial length - double thread_depth{1}; // radial crest depth of the thread profile - bool thread_internal{false}; // false = external threaded rod (New body); - // true = tapped bore cut into the current body + double thread_depth{1}; // radial depth of the thread profile + bool thread_internal{false}; // false = external: the thread goes on the target body + // (or on a standalone rod when there is none); + // true = tapped bore cut into the target body + // How thread_radius is read. true (every thread made since): it is the nominal MAJOR + // radius, for both kinds — an internal thread bores to R - depth and grooves out to R, an + // external one is a rod of radius R with its groove cut in to R - depth, so an M6 is 6 mm + // across its crests either way. false (older recipes, kept bit-for-bit): the ridge was + // added OUTSIDE R, so an internal thread given the minor diameter came out undersized and + // an external one given the major diameter came out oversized. + bool thread_major_nominal{false}; double thread_x{0}; // axis position on the plane (u/x axis) double thread_y{0}; // axis position on the plane (v/y axis) @@ -174,6 +183,12 @@ struct CadFeature { double pattern_spacing{20}; // linear step (mm) int pattern_dir{0}; // linear direction: 0 = plane X, 1 = plane Y double pattern_angle{360}; // circular total angle (degrees) + // How a circular pattern spreads its copies over pattern_angle. true (every pattern made + // since): a full turn is split into `count` equal steps, anything less is spanned end to end, + // first copy at 0 and last at pattern_angle — the way a pattern along a curve spans its + // curve. false (older recipes, kept as they were built): always angle / count, so 90° with 3 + // copies stopped at 60°. + bool pattern_inclusive{false}; // Pattern along a curve: when pattern_curve_sketch >= 0 this mode takes precedence over // linear/circular. Copies are placed at equal-parameter points along entity @@ -186,6 +201,16 @@ struct CadFeature { // BEFORE geometry runs. Empty (the common case) means the feature uses its literal fields. std::map expr; + // Transient, never serialized. A body is referred to above by its INDEX, and an index is + // only meaningful against the history it was taken in: delete, reorder or disable a + // feature that makes a body and every later index points at a different body. So recompute + // records, for each body field, the identity of the body it resolved to — the feature that + // made it, and which of that feature's bodies it is — and when the history changes the + // fields are re-pointed from those identities (see CadDocument::recompute). + struct BodyId { int src{-1}; int ord{0}; }; + std::vector body_ref_ids; + bool body_refs_pending{false}; + // Datum/reference plane: a derived SketchPlane the document offers as a selectable // sketch plane (no solid). plane_base selects the reference (0=XY,1=XZ,2=YZ, or 3+N // = the Nth earlier datum plane); plane_offset shifts along the base normal; @@ -357,10 +382,56 @@ struct CadFeature { pattern_curve_sketch, pattern_curve_entity, expr, mate_kind, mate_cs_a, mate_cs_b, mate_offset, mate_angle, mate_flip, - coordsys_face_kind, coordsys_face_edges); + coordsys_face_kind, coordsys_face_edges, + thread_major_nominal, pattern_inclusive); } template void load(Archive& ar) { + std::string brep; + ar(type, name, enabled, shape, plane, width, height, radius, + profile, entities, constraints, entity_constraints, imported_regions, + import_offset, import_scale_x, import_scale_y, import_on_face, import_face_body, + sketch_ref, distance, symmetric, mode, extrude_end, distance2, taper_deg, flip, + up_to_face, extrude_src_face, up_to_point, target_body, + dressup_size, face_group, dressup_edge, + hole_diameter, hole_depth, hole_through, hole_x, hole_y, + thread_radius, thread_pitch, thread_height, thread_depth, thread_internal, thread_x, thread_y, + shell_thickness, shell_face, + draft_face, draft_angle, + revolve_angle, revolve_axis, + sweep_path_ref, loft_profile_refs, loft_ruled, + pattern_circular, pattern_count, pattern_spacing, pattern_dir, pattern_angle, + plane_base, plane_offset, plane_angle_tilt, plane_axis, + bool_tool_body, bool_keep_tool, bool_tolerance, bool_target_face, bool_tool_face, + cut_offset, cut_flip, cut_keep_upper, cut_keep_lower, + brep, + plane_type, plane_face_body, plane_face, plane_face2_body, plane_face2, + plane_edge_body, plane_edge, plane_edge2_body, plane_edge2, plane_u_size, plane_v_size, + mirror_keep_original, + axis_type, axis_p1, axis_p2, axis_body, axis_face, axis_edge, axis_plane_a, axis_plane_b, + coordsys_type, coordsys_point, coordsys_body, coordsys_face, coordsys_edge, coordsys_x_hint, + helix_radius, helix_pitch, helix_height, helix_left_handed, helix_taper_deg, + xf_translate, xf_axis, xf_pivot, xf_angle_deg, xf_copy, + thicken_face, thicken_thickness, thicken_flip, + cut_face_body, cut_face, + project_source_body, project_edges, project_face, + delete_faces, + hole_style, hole_cbore_diameter, hole_cbore_depth, + hole_csink_diameter, hole_csink_angle, hole_standard, + rib_sketch_ref, rib_entity, rib_thickness, rib_depth, + pattern_curve_sketch, pattern_curve_entity, + expr, + mate_kind, mate_cs_a, mate_cs_b, mate_offset, mate_angle, mate_flip, + coordsys_face_kind, coordsys_face_edges, + thread_major_nominal, pattern_inclusive); + imported_solid = brep_from_string(brep); + } + // The pre-framing (v4) layout, FROZEN. A v4 recipe is one flat stream with no per-feature + // length, so it can only be read with exactly the field list it was written with; reading it + // through load() above breaks the moment a field is appended there (every field added since + // v5 is appended ONLY above, never here). + template + void load_flat_v4(Archive& ar) { std::string brep; ar(type, name, enabled, shape, plane, width, height, radius, profile, entities, constraints, entity_constraints, imported_regions, @@ -399,6 +470,7 @@ struct CadFeature { coordsys_face_kind, coordsys_face_edges); imported_solid = brep_from_string(brep); } + }; // Serialize a TopoDS_Shape to/from a BRep string for cereal persistence. @@ -436,6 +508,13 @@ public: // Named document variables: name -> expression. Evaluated topologically each recompute(); // an expression may reference other variables. Feature `expr` bindings resolve against these. std::map variables; + // Can a feature expression drive this numeric field? The single allow-list the evaluator + // uses, so a caller can refuse a name before it breaks the next recompute. + static bool is_bindable_field(const std::string& field); + // Does a feature of this type leave a body behind? Sketches, datums, the helix curve and + // Project (which emits sketch entities) do not. The one answer recompute(), the rollback + // rule and the GUI's preview all use. + static bool produces_body(CadFeatureType t); // Multi-body result of the last replay. A "New" extrude appends a body; other ops // mutate a target body. Empty after a failed/empty recompute. std::vector bodies; @@ -455,8 +534,11 @@ public: // Modeling origin: the world point the default XY/XZ/YZ planes pass through. The GUI sets this // to the bed centre so sketches/datums land in the middle of the bed (not the bed corner = - // world 0). Not serialized — the GUI re-applies it from the live bed on every tab show. + // world 0) — for a NEW document. It is saved with the recipe: sketches bake it into their + // planes while datum planes add it when they are resolved, so a project reopened on another + // printer must keep the origin it was made with or its datums move and its sketches do not. Vec3d modeling_origin{Vec3d::Zero()}; + bool origin_from_recipe{false}; // modeling_origin came from the loaded project // Tessellation quality, matched to Orca's OWN STEP importer (Format/STEP.hpp defaults: // linear 0.003, angular 0.5 rad) so a body modelled here reaches the screen at the same @@ -703,6 +785,9 @@ public: // an Extrude, its sketch_ref are preserved from the original). bool remove_feature(int index); bool move_feature(int index, int delta); + // Show or hide a feature. Transactional like the others, and it keeps body and datum-plane + // references pointing at the same objects, which a bare `enabled` flip does not. + bool set_feature_enabled(int index, bool enabled); bool replace_feature(int index, const CadFeature& edited); // replace_sketch_extrude: a box is two linked features (Sketch + Extrude); // overwrite both slots from one `edited` candidate (sketch params -> diff --git a/src/libslic3r/CAD/GeometryEngine.cpp b/src/libslic3r/CAD/GeometryEngine.cpp index 2b923938c2..03ae1de979 100644 --- a/src/libslic3r/CAD/GeometryEngine.cpp +++ b/src/libslic3r/CAD/GeometryEngine.cpp @@ -275,21 +275,21 @@ FaceGroup GeometryEngine::classify_face(const TopoDS_Face& face, const TopoDS_Sh std::vector GeometryEngine::collect_edges(const TopoDS_Shape& solid, FaceGroup target) { + // Each edge ONCE. An explorer visits a shared edge from both of its faces, so walking one + // handed every edge to the fillet twice; the de-duplicated map is also what edge_by_index + // numbers edges by. std::vector result; + TopTools_IndexedDataMapOfShapeListOfShape edgeFaceMap; + TopExp::MapShapesAndAncestors(solid, TopAbs_EDGE, TopAbs_FACE, edgeFaceMap); if (target == FaceGroup::All) { - for (TopExp_Explorer exp(solid, TopAbs_EDGE); exp.More(); exp.Next()) - result.push_back(TopoDS::Edge(exp.Current())); + for (int i = 1; i <= edgeFaceMap.Extent(); ++i) + result.push_back(TopoDS::Edge(edgeFaceMap.FindKey(i))); return result; } - // Build edge-to-face map once - TopTools_IndexedDataMapOfShapeListOfShape edgeFaceMap; - TopExp::MapShapesAndAncestors(solid, TopAbs_EDGE, TopAbs_FACE, edgeFaceMap); - - for (TopExp_Explorer edgeExp(solid, TopAbs_EDGE); edgeExp.More(); edgeExp.Next()) { - const TopoDS_Edge& edge = TopoDS::Edge(edgeExp.Current()); - if (!edgeFaceMap.Contains(edge)) continue; - const TopTools_ListOfShape& faces = edgeFaceMap.FindFromKey(edge); + for (int ei = 1; ei <= edgeFaceMap.Extent(); ++ei) { + const TopoDS_Edge& edge = TopoDS::Edge(edgeFaceMap.FindKey(ei)); + const TopTools_ListOfShape& faces = edgeFaceMap.FindFromIndex(ei); bool include = false; for (auto it = faces.begin(); it != faces.end(); ++it) { @@ -325,12 +325,14 @@ std::vector GeometryEngine::collect_edges(const TopoDS_Shape& solid // ---- Fillet/Chamfer ---- +// All four dress-up entry points fail the same way — with a reason — instead of two of them +// handing the solid back unchanged, which recompute then reported as a success. TopoDS_Shape GeometryEngine::apply_fillet(const TopoDS_Shape& solid, double radius, FaceGroup faces) { - if (radius <= 0.001) return solid; + if (radius <= 0.001) throw std::runtime_error("the fillet radius must be greater than 0"); std::vector edges = collect_edges(solid, faces); - if (edges.empty()) return solid; + if (edges.empty()) throw std::runtime_error("no edges to fillet in that group"); BRepFilletAPI_MakeFillet fillet(solid); for (const auto& edge : edges) @@ -346,10 +348,10 @@ TopoDS_Shape GeometryEngine::apply_fillet(const TopoDS_Shape& solid, double radi TopoDS_Shape GeometryEngine::apply_chamfer(const TopoDS_Shape& solid, double distance, FaceGroup faces) { - if (distance <= 0.001) return solid; + if (distance <= 0.001) throw std::runtime_error("the chamfer distance must be greater than 0"); std::vector edges = collect_edges(solid, faces); - if (edges.empty()) return solid; + if (edges.empty()) throw std::runtime_error("no edges to chamfer in that group"); BRepFilletAPI_MakeChamfer chamfer(solid); for (const auto& edge : edges) @@ -362,7 +364,7 @@ TopoDS_Shape GeometryEngine::apply_chamfer(const TopoDS_Shape& solid, double dis TopoDS_Shape GeometryEngine::apply_fillet(const TopoDS_Shape& solid, double radius, int edge_id) { - if (radius <= 0.001) return solid; + if (radius <= 0.001) throw std::runtime_error("the fillet radius must be greater than 0"); TopoDS_Edge edge = edge_by_index(solid, edge_id); if (edge.IsNull()) throw std::runtime_error("apply_fillet: invalid edge id"); @@ -377,7 +379,7 @@ TopoDS_Shape GeometryEngine::apply_fillet(const TopoDS_Shape& solid, double radi TopoDS_Shape GeometryEngine::apply_chamfer(const TopoDS_Shape& solid, double distance, int edge_id) { - if (distance <= 0.001) return solid; + if (distance <= 0.001) throw std::runtime_error("the chamfer distance must be greater than 0"); TopoDS_Edge edge = edge_by_index(solid, edge_id); if (edge.IsNull()) throw std::runtime_error("apply_chamfer: invalid edge id"); diff --git a/src/libslic3r/CAD/GeometryEngine.hpp b/src/libslic3r/CAD/GeometryEngine.hpp index f27a0f2f17..bad29ed953 100644 --- a/src/libslic3r/CAD/GeometryEngine.hpp +++ b/src/libslic3r/CAD/GeometryEngine.hpp @@ -36,8 +36,9 @@ struct PrimitiveParams { double dressup_radius{1.0}; // fillet radius double dressup_chamfer_dist{1.0}; // chamfer distance (symmetric) - // Mesh quality - double linear_deflection{0.01}; + // Mesh quality — the Design tab's own density (CadDocument::linear_deflection), so a + // primitive and the same body modelled in the Design tab reach the screen alike. + double linear_deflection{0.003}; double angular_deflection{0.5}; template @@ -121,7 +122,7 @@ public: int edge_id); static TriangleMesh tessellate(const TopoDS_Shape& shape, - double linear_deflection = 0.01, + double linear_deflection = 0.003, double angular_deflection = 0.5); static std::string primitive_name(PrimitiveType type); diff --git a/src/libslic3r/CAD/SketchEngine.cpp b/src/libslic3r/CAD/SketchEngine.cpp index 5cc36ce648..8aa440d707 100644 --- a/src/libslic3r/CAD/SketchEngine.cpp +++ b/src/libslic3r/CAD/SketchEngine.cpp @@ -62,14 +62,6 @@ void set_sketch_auto_close(bool on) { s_auto_close = on; } // ---- SketchPlane ---- -gp_Pln SketchPlane::to_occt() const -{ - gp_Pnt o(origin.x(), origin.y(), origin.z()); - gp_Dir n(normal.x(), normal.y(), normal.z()); - gp_Dir x(x_axis.x(), x_axis.y(), x_axis.z()); - return gp_Pln(gp_Ax3(o, n, x)); -} - SketchPlane SketchPlane::from_face(const TopoDS_Face& face) { SketchPlane sp; @@ -124,26 +116,6 @@ Vec3d SketchPlane::to_world(const Vec2d& pt) const // ---- SketchProfile ---- -bool SketchProfile::is_closed(double tolerance) const -{ - if (points.size() < 3) return false; - return (points.front() - points.back()).norm() < tolerance; -} - -bool SketchProfile::try_close(double tolerance) -{ - if (is_closed(tolerance)) { - closed = true; - return true; - } - if (points.size() < 2) return false; - if ((points.front() - points.back()).norm() < tolerance) { - closed = true; - return true; - } - return false; -} - TopoDS_Wire SketchProfile::to_occt_wire(const SketchPlane& plane) const { if (points.size() < 2) @@ -276,7 +248,9 @@ TopoDS_Shape SketchEngine::make_extrude_regions( // degenerate OCCT edge and make the wire builder throw — sanitising keeps a // single bad glyph from killing the whole extrude. auto clean = [](const std::vector& pts) { - const double eps2 = 1e-12; // ~1e-6 mm + // The sketch's own joint tolerance: points closer than this are one point everywhere + // else in the sketcher, so they must not become a sub-micron edge here either. + const double eps2 = kSketchJoinTol * kSketchJoinTol; std::vector out; out.reserve(pts.size()); for (const Vec2d& p : pts) @@ -304,6 +278,10 @@ TopoDS_Shape SketchEngine::make_extrude_regions( }; gp_Dir dir(plane.normal.x(), plane.normal.y(), plane.normal.z()); + // Faces are built ON the sketch plane, as wires_to_face does: a surface inferred from the + // outer wire need not share the sketch normal, and then the extrude direction and the hole + // classification disagree with it. + const gp_Pln pln(gp_Pnt(plane.origin.x(), plane.origin.y(), plane.origin.z()), dir); // Accumulate each region's solid into a compound rather than boolean-fusing: // glyphs are independent profiles, so a compound avoids every boolean-failure @@ -324,7 +302,10 @@ TopoDS_Shape SketchEngine::make_extrude_regions( // classify outer vs holes by area/containment and set correct wire // orientations. This is winding-independent, so holed glyphs extrude // with a solid body and empty counters regardless of source winding. - BRepBuilderAPI_MakeFace fm(outer); + // Probe on the inferred surface first: naming a plane makes MakeFace accept a wire + // that bounds nothing, and this check is what skips such a contour. + if (!BRepBuilderAPI_MakeFace(outer).IsDone()) continue; + BRepBuilderAPI_MakeFace fm(pln, outer); if (!fm.IsDone()) continue; for (size_t h = 1; h < region.size(); ++h) { TopoDS_Wire hole = contour_wire(region[h]); @@ -567,7 +548,12 @@ std::vector SketchEngine::entities_to_wires(const std::vector gp_Elips { Vec3d c3 = plane.to_world(c.center); gp_Pnt center(c3.x(), c3.y(), c3.z()); - gp_Dir n(plane.normal.x(), plane.normal.y(), plane.normal.z()); + // The frame's normal is x_axis x y_axis, not plane.normal: OCCT takes the ellipse's Y + // as N x X, and the parametric angles were measured in the sketch's own (x, y). The two + // agree on XY and YZ; the XZ base plane stores normal = +Y while x x y = -Y, so there + // every elliptical arc came out mirrored against what the sketch showed. + const Vec3d nz = plane.x_axis.cross(plane.y_axis); + gp_Dir n(nz.x(), nz.y(), nz.z()); Vec2d maj2(std::cos(c.rotation), std::sin(c.rotation)); Vec3d x3 = plane.to_world(c.center + maj2) - c3; gp_Dir xdir(x3.x(), x3.y(), x3.z()); @@ -691,6 +677,9 @@ std::vector SketchEngine::entities_to_wires(const std::vector SketchEngine::mirror_entities( } else { m.p0 = reflect(e.p0); m.p1 = reflect(e.p1); - // Reflection reverses orientation: recompute parametric angles in - // the reflected frame, original end -> new start (CCW sense kept). + // Reflection reverses orientation. Like the Arc branch above, this pass keeps + // each angle with ITS point (start with p0) and lets the sweep run clockwise; + // the reversal pass below then swaps points and angles together, giving a CCW + // arc whose start is p0. Pairing them crosswise here, as this used to, was + // undone by that same swap and produced the complementary arc. auto param = [&](const Vec2d& P) { const Vec2d d = P - m.center; const double cu = std::cos(m.rotation), su = std::sin(m.rotation); @@ -1045,8 +1037,9 @@ std::vector SketchEngine::mirror_entities( const double v = -d.x() * su + d.y() * cu; return std::atan2(v / std::max(e.rminor, 1e-9), u / std::max(e.radius, 1e-9)); }; - m.start_angle = param(m.p1); - m.end_angle = param(m.p0); + m.start_angle = param(m.p0); + m.end_angle = param(m.p1); + while (m.end_angle >= m.start_angle) m.end_angle -= 2.0 * M_PI; } break; } @@ -1106,9 +1099,14 @@ std::vector SketchEngine::mirror_entities( // get their last-to-first seam repaired too, which is what makes the result closed again. namespace { -constexpr double kOffJoinEps = 1e-6; - -bool off_same(const Vec2d& a, const Vec2d& b) { return (a - b).squaredNorm() < kOffJoinEps * kOffJoinEps; } +// Two ends are the same point when the WIRE BUILDER would weld them: a loop the viewport and +// the kernel treat as closed must offset as one closed chain, not as separate open pieces with +// unrepaired seams. The floor keeps exact coincidence meaningful with auto-close switched off. +bool off_same(const Vec2d& a, const Vec2d& b) +{ + const double tol = std::max(sketch_join_tol(), 1e-6); + return (a - b).squaredNorm() <= tol * tol; +} // Does this entity type take part in chaining (i.e. does it have two ends)? bool off_is_open_curve(const SketchEntity& e) @@ -1214,7 +1212,10 @@ bool off_one(const SketchEntity& e, double d, SketchEntity& out) return true; } case SketchEntity::Type::Circle: { - const double r = e.radius + d; + // A circle runs CCW (it is what a 360° CCW arc chain closes into), so the rule below + // applies to it too: +d is the left side, the inside, and the radius SHRINKS. It used to + // grow, so a full circle and the same outline drawn as arcs offset opposite ways. + const double r = e.radius - d; if (r <= 1e-9) return false; out = e; out.radius = r; out.p0 = out.center; return true; @@ -1453,6 +1454,9 @@ std::vector SketchEngine::transform_entities( out.reserve(src.size()); const double ca = std::cos(angle), sa = std::sin(angle); const double rs = std::abs(scale); // radii are unsigned magnitudes + // A negative scale is |scale| plus a half turn about the pivot: points get that from xf() + // below, and angle-valued fields (arc ends, ellipse axis) need the same extra pi. + const double turn = angle + (scale < 0.0 ? M_PI : 0.0); // Affine map: translate pivot to origin, scale, rotate, then translate by `move`. auto xf = [&](const Vec2d& p) -> Vec2d { const Vec2d d = scale * (p - pivot); @@ -1475,8 +1479,8 @@ std::vector SketchEngine::transform_entities( case SketchEntity::Type::Arc: { m.center = xf(e.center); m.radius = e.radius * rs; - m.start_angle = e.start_angle + angle; - m.end_angle = e.end_angle + angle; // rigid sweep, shifted by rotation + m.start_angle = e.start_angle + turn; + m.end_angle = e.end_angle + turn; // rigid sweep, shifted by rotation m.p0 = m.center + m.radius * Vec2d(std::cos(m.start_angle), std::sin(m.start_angle)); m.p1 = m.center + m.radius * Vec2d(std::cos(m.end_angle), std::sin(m.end_angle)); break; @@ -1486,7 +1490,7 @@ std::vector SketchEngine::transform_entities( m.center = xf(e.center); m.radius = e.radius * rs; m.rminor = e.rminor * rs; - m.rotation = e.rotation + angle; // major axis rotates with the body + m.rotation = e.rotation + turn; // major axis rotates with the body if (e.type == SketchEntity::Type::Ellipse) { m.p0 = m.center; } else { @@ -1833,6 +1837,15 @@ static double wrap_2pi(double x) return x; } +// An arc's endpoints are stored twice: as angles and as p0/p1. Everything downstream reads +// p0/p1 (the wire builder welds on them, the solver seeds from them, snapping uses them), so +// any edit of the angles must write them back or the arc's ends silently stay where they were. +static void sync_arc_ends(SketchEntity& e) +{ + e.p0 = e.center + e.radius * Vec2d(std::cos(e.start_angle), std::sin(e.start_angle)); + e.p1 = e.center + e.radius * Vec2d(std::cos(e.end_angle), std::sin(e.end_angle)); +} + bool SketchEngine::trim_entity(SketchEntity& e, const std::vector& others, const Vec2d& pick) { @@ -1867,6 +1880,7 @@ bool SketchEngine::trim_entity(SketchEntity& e, const std::vector& if (uc == -std::numeric_limits::max()) return false; e.end_angle = e.start_angle + uc * sweep; // drop (uc, 1] } + sync_arc_ends(e); return true; } @@ -1898,6 +1912,7 @@ bool SketchEngine::trim_entity(SketchEntity& e, const std::vector& e.type = SketchEntity::Type::Arc; e.start_angle = hi; e.end_angle = lo + 2.0 * M_PI; + sync_arc_ends(e); // p0 was the circle's centre (circle convention); now the arc's start return true; } @@ -1970,6 +1985,7 @@ bool SketchEngine::extend_entity(SketchEntity& e, const std::vector::max()) return false; if (extend_end) e.end_angle += sgn * best; else e.start_angle -= sgn * best; + sync_arc_ends(e); return true; } @@ -2010,7 +2026,9 @@ bool SketchEngine::extend_entity(SketchEntity& e, const std::vector points; bool closed{false}; - bool is_closed(double tolerance = 0.5) const; - bool try_close(double tolerance = 0.5); void clear() { points.clear(); closed = false; } TopoDS_Wire to_occt_wire(const SketchPlane& plane) const; @@ -108,8 +108,8 @@ enum class SketchConstraintType { // inserting anywhere but the end reinterprets every constraint in every saved recipe. EqualRadius, Collinear, - DistanceX, // |dx| between two points, projected onto the sketch X axis - DistanceY, // |dy| between two points, projected onto the sketch Y axis + DistanceX, // signed dx between two points (eb - ea), projected onto the sketch X axis + DistanceY, // signed dy between two points (eb - ea), projected onto the sketch Y axis SymmetricAboutY, // mirror across the sketch's vertical axis (x = 0); axis is implicit SymmetricAboutX // mirror across the sketch's horizontal axis (y = 0); axis is implicit }; @@ -314,7 +314,7 @@ public: // offset together and their seams repaired (miter join), so a closed profile comes back // closed and can still be extruded; per-entity offsetting cannot do that. Sign convention: // +d moves each curve to the LEFT of its direction of travel, which for a CCW closed loop - // is inward. Ellipses and splines are not offset (a parallel of either is not the same + // is inward; a full circle counts as CCW, so +d shrinks it. Ellipses and splines are not offset (a parallel of either is not the same // kind of curve) and are dropped from the result. static std::vector offset_entities( const std::vector& src, double d); diff --git a/src/libslic3r/CAD/SketchInference.cpp b/src/libslic3r/CAD/SketchInference.cpp index cfeb2cd509..4b056600e1 100644 --- a/src/libslic3r/CAD/SketchInference.cpp +++ b/src/libslic3r/CAD/SketchInference.cpp @@ -74,6 +74,18 @@ InferenceSnap infer_point_snap(const std::vector& entities, offer(InferenceSnap::Kind::Midpoint, ei, SketchPointRole::P0, Vec2d(e.center.x() + e.radius * std::cos(am), e.center.y() + e.radius * std::sin(am))); + // Nearest point on the arc itself (PointOnObject candidate), as for a line or a + // circle — the solver now takes a point on an arc's rim. + const Vec2d v = query - e.center; + const double n = v.norm(); + const double sweep = e.end_angle - e.start_angle; + if (n > 1e-9 && e.radius > 1e-9 && std::abs(sweep) > 1e-9) { + double u = (std::atan2(v.y(), v.x()) - e.start_angle) / sweep; + while (u < 0.0) u += 2.0 * M_PI / std::abs(sweep); + if (u > 0.02 && u < 0.98) + offer(InferenceSnap::Kind::OnEdge, ei, SketchPointRole::Center, + e.center + v * (e.radius / n)); + } break; } case SketchEntity::Type::Circle: { @@ -141,6 +153,10 @@ infer_relations(const std::vector& entities, int new_ei, { std::vector out; if (new_ei <= 0 || new_ei >= int(entities.size())) return out; + // Ends count as meeting at the same tolerance the wire builder welds them at; floor keeps + // exact coincidence meaningful when auto-close is switched off. + const double weld = std::max(sketch_join_tol(), 1e-7); + auto joined = [weld](const Vec2d& a, const Vec2d& b) { return (a - b).squaredNorm() <= weld * weld; }; // AT MOST ONE constraint per rule per new entity, not one per PAIR. Without this the // function is quadratic in the sketch: a drawing with 200 equal holes yields ~20000 @@ -170,10 +186,9 @@ infer_relations(const std::vector& entities, int new_ei, if (n_line && o_line) { // R1 — parallel / perpendicular, restricted to CONNECTED lines. Connection is // what keeps this from firing on every distant line that is roughly parallel. - const bool connected = (n.p0 - o.p0).squaredNorm() <= 1e-14 || - (n.p0 - o.p1).squaredNorm() <= 1e-14 || - (n.p1 - o.p0).squaredNorm() <= 1e-14 || - (n.p1 - o.p1).squaredNorm() <= 1e-14; + // "Connected" is the wire builder's weld, so what the viewport shows joined is. + const bool connected = joined(n.p0, o.p0) || joined(n.p0, o.p1) || + joined(n.p1, o.p0) || joined(n.p1, o.p1); if (!connected) continue; const double ang = unsigned_angle(n.p1 - n.p0, o.p1 - o.p0); const double par_err = std::min(ang, M_PI - ang); @@ -202,7 +217,7 @@ infer_relations(const std::vector& entities, int new_ei, if (cv.type == SketchEntity::Type::Arc) { const Vec2d ce[2] = { cv.p0, cv.p1 }; for (int m = 0; m < 2; ++m) { - if ((le[k] - ce[m]).squaredNorm() > 1e-14) continue; + if (!joined(le[k], ce[m])) continue; const Vec2d r = ce[m] - cv.center; if (r.squaredNorm() < 1e-18) continue; tangent = std::abs(unsigned_angle(ldir, r) - M_PI / 2.0) <= ang_tol_rad; @@ -210,7 +225,7 @@ infer_relations(const std::vector& entities, int new_ei, } } else { // Circle: shared point is a line endpoint on the rim. const Vec2d r = le[k] - cv.center; - if (std::abs(r.norm() - cv.radius) > 1e-7) continue; + if (std::abs(r.norm() - cv.radius) > weld) continue; if (r.squaredNorm() < 1e-18) continue; tangent = std::abs(unsigned_angle(ldir, r) - M_PI / 2.0) <= ang_tol_rad; } diff --git a/src/libslic3r/CAD/SketchInference.hpp b/src/libslic3r/CAD/SketchInference.hpp index be51f0240e..2b2345bffa 100644 --- a/src/libslic3r/CAD/SketchInference.hpp +++ b/src/libslic3r/CAD/SketchInference.hpp @@ -36,8 +36,12 @@ InferenceSnap infer_point_snap(const std::vector& entities, // within `ang_tol_rad` of an axis, returns Horizontal or Vertical (the constraint to // auto-emit on the committed segment); std::nullopt otherwise. Degenerate (near-zero // length) segments return nullopt. +// One angular tolerance for every "is this relation already true?" inference, so a pair of +// lines that reads as horizontal to one rule cannot read as not-quite-parallel to the other. +inline constexpr double kSketchInferAngleTol = 3.0 * M_PI / 180.0; + std::optional -infer_axis_constraint(const Vec2d& anchor, const Vec2d& tip, double ang_tol_rad = 3.0 * M_PI / 180.0); +infer_axis_constraint(const Vec2d& anchor, const Vec2d& tip, double ang_tol_rad = kSketchInferAngleTol); // Relational constraints to auto-emit for a newly drawn entity `new_ei` against the // entities already in the sketch. Pure, no GUI/GL dependencies, unit-testable. @@ -47,7 +51,7 @@ infer_axis_constraint(const Vec2d& anchor, const Vec2d& tip, double ang_tol_rad // relation that is visibly there. Returns an empty vector when nothing qualifies. std::vector infer_relations(const std::vector& entities, int new_ei, - double ang_tol_rad = 2.0 * M_PI / 180.0, + double ang_tol_rad = kSketchInferAngleTol, double len_tol_frac = 0.01); } // namespace Slic3r diff --git a/src/libslic3r/CAD/SketchSolver.cpp b/src/libslic3r/CAD/SketchSolver.cpp index 952f9de16f..c07e287fb1 100644 --- a/src/libslic3r/CAD/SketchSolver.cpp +++ b/src/libslic3r/CAD/SketchSolver.cpp @@ -2,6 +2,7 @@ #include +#include #include #include #include @@ -41,12 +42,15 @@ struct Build { { return E(Slvs_MakePoint2d(++eh, g, wp, P(g, u), P(g, v))); } // Generic constraint (entityC unused by Slvs_MakeConstraint — set it manually below). + // `other` / `other2` pick the END point (point[2]) of entity A / B instead of its start + // (point[1]) for the constraints that read an arc's endpoint (the tangencies). void C(int type, double val, Slvs_hEntity ptA, Slvs_hEntity ptB, - Slvs_hEntity eA, Slvs_hEntity eB, Slvs_hEntity eC = 0, int other = 0) + Slvs_hEntity eA, Slvs_hEntity eB, Slvs_hEntity eC = 0, int other = 0, int other2 = 0) { Slvs_Constraint c = Slvs_MakeConstraint(++ch, G_SK, type, wp, val, ptA, ptB, eA, eB); c.entityC = eC; c.other = other; + c.other2 = other2; cons.push_back(c); } }; @@ -108,9 +112,15 @@ static SketchSolveResult solve_system(std::vector& entities, case SketchEntity::Type::Circle: { s.center = b.pt2d(G_SK, e.center.x(), e.center.y()); s.p0 = s.center; // p0 mirrors centre for circles - s.rparam = b.P(G_SK, e.radius > 1e-9 ? e.radius : 1.0); - Slvs_hEntity dist = b.E(Slvs_MakeDistance(++b.eh, G_SK, b.wp, s.rparam)); - s.prim = b.E(Slvs_MakeCircle(++b.eh, G_SK, b.wp, s.center, b.normal, dist)); + // A zero-radius circle is degenerate everywhere else (the wire builder, offset and + // inference all reject it). It used to be seeded with radius 1 here and written + // back, so any unrelated solve silently turned it into a 1 mm circle. It gets no + // primitive: its centre still solves, anything needing the rim is skipped. + if (e.radius > 1e-9) { + s.rparam = b.P(G_SK, e.radius); + Slvs_hEntity dist = b.E(Slvs_MakeDistance(++b.eh, G_SK, b.wp, s.rparam)); + s.prim = b.E(Slvs_MakeCircle(++b.eh, G_SK, b.wp, s.center, b.normal, dist)); + } break; } case SketchEntity::Type::Arc: @@ -170,6 +180,20 @@ static SketchSolveResult solve_system(std::vector& entities, switch (r) { case Role::P0: return e.p0; case Role::P1: return e.p1; case Role::Center: return e.center; } return e.p0; }; + // Which side of line `li` the point (ei, r) is on, in slvs' sign convention for the + // in-workplane PT_LINE_DISTANCE: with d = point[0] - point[1] and a = point[0], the signed + // distance has the sign of d x (p - a) (pinned by the tests "a point below the line stays + // below it" and "tangent line to circle, line below it"). +1 when on the line. + auto side_of = [&](int ei, Role r, int li) -> double { + Vec2d a, bb; + if (li == kSketchRefAxisX) { a = Vec2d(1, 0); bb = Vec2d(0, 0); } + else if (li == kSketchRefAxisY) { a = Vec2d(0, 1); bb = Vec2d(0, 0); } + else if (valid(li)) { a = entities[li].p0; bb = entities[li].p1; } + else return 1.0; + const Vec2d d = a - bb, ap = coordOf(ei, r) - a; + const double cr = d.x() * ap.y() - d.y() * ap.x(); + return cr < 0.0 ? -1.0 : 1.0; + }; // A fixed reference point at (x,y) — used to pin coordinates (Fix / LockX / LockY). auto fixedRef = [&](double x, double y) -> Slvs_hEntity { return b.pt2d(G_FIXED, x, y); }; @@ -207,7 +231,7 @@ static SketchSolveResult solve_system(std::vector& entities, case CT::Collinear: ref_ok = primOf(c.ea) && primOf(c.eb); break; } - if (!ref_ok) continue; + if (!ref_ok) { out.skipped.push_back(int(&c - constraints.data())); continue; } switch (c.type) { case CT::Coincident: b.C(SLVS_C_POINTS_COINCIDENT, 0, ptOf(c.ea, c.ra), ptOf(c.eb, c.rb), 0, 0); @@ -282,9 +306,36 @@ static SketchSolveResult solve_system(std::vector& entities, case CT::Tangent: { const bool aCurve = valid(c.ea) && entities[c.ea].type != SketchEntity::Type::Line; const bool bCurve = valid(c.eb) && entities[c.eb].type != SketchEntity::Type::Line; - if (aCurve && bCurve) - b.C(SLVS_C_CURVE_CURVE_TANGENT, 0, 0, 0, primOf(c.ea), primOf(c.eb)); - else { + const bool aCircle = aCurve && entities[c.ea].type == SketchEntity::Type::Circle; + const bool bCircle = bCurve && entities[c.eb].type == SketchEntity::Type::Circle; + if (aCurve && bCurve && (aCircle || bCircle)) { + // CURVE_CURVE_TANGENT reads each curve's ENDPOINT, which a full circle does not + // have: slvs asserts and takes the process down (the same trap the circle-line + // case below documents). Two round curves are tangent exactly when their + // centres are r1 + r2 apart (outside each other) or |r1 - r2| apart (one inside + // the other); keep whichever the sketch is closer to now. Radii are captured as + // constants, with the same caveat as the circle-line case. + const SketchEntity& A = entities[c.ea]; + const SketchEntity& B = entities[c.eb]; + const double d = (A.center - B.center).norm(); + const double ext = A.radius + B.radius; + const double in = std::abs(A.radius - B.radius); + b.C(SLVS_C_PT_PT_DISTANCE, std::abs(d - ext) <= std::abs(d - in) ? ext : in, + ptOf(c.ea, Role::Center), ptOf(c.eb, Role::Center), 0, 0); + } else if (aCurve && bCurve) { + // Tangent where the two arcs MEET: pick, for each arc, the endpoint closest to + // the other arc's nearest endpoint. Always binding the start point (the old + // behaviour) made a tangency at an arc's end act on its start instead. + const SketchEntity& A = entities[c.ea]; + const SketchEntity& B = entities[c.eb]; + int oa = 0, ob = 0; double best = 1e300; + for (int i = 0; i < 2; ++i) + for (int j = 0; j < 2; ++j) { + const double dd = ((i ? A.p1 : A.p0) - (j ? B.p1 : B.p0)).squaredNorm(); + if (dd < best) { best = dd; oa = i; ob = j; } + } + b.C(SLVS_C_CURVE_CURVE_TANGENT, 0, 0, 0, primOf(c.ea), primOf(c.eb), 0, oa, ob); + } else { const int ci = aCurve ? c.ea : c.eb; // the curve const int li = aCurve ? c.eb : c.ea; // the line if (valid(ci) && entities[ci].type == SketchEntity::Type::Circle) { @@ -305,24 +356,47 @@ static SketchSolveResult solve_system(std::vector& entities, // not being changed by another constraint in the same solve; if some other // constraint drives the radius, re-solving restores tangency. Tying them // would need an auxiliary point constrained onto both circle and line. - b.C(SLVS_C_PT_LINE_DISTANCE, entities[ci].radius, + b.C(SLVS_C_PT_LINE_DISTANCE, side_of(ci, Role::Center, li) * entities[ci].radius, ptOf(ci, Role::Center), 0, primOf(li), 0); } else { - b.C(SLVS_C_ARC_LINE_TANGENT, 0, 0, 0, primOf(ci), primOf(li)); + // The arc endpoint that touches the line is the one the tangency is at. The + // constraint used to bind the START point always, so a fillet — its start on + // one leg, its end on the other — forced both legs parallel. + int other = 0; + if (valid(ci) && valid(li)) { + const SketchEntity& A = entities[ci]; + const SketchEntity& L = entities[li]; + auto seg_dist = [&](const Vec2d& p) { + const Vec2d d = L.p1 - L.p0; + const double t = d.squaredNorm() > 1e-18 + ? std::clamp((p - L.p0).dot(d) / d.squaredNorm(), 0.0, 1.0) : 0.0; + return (L.p0 + t * d - p).norm(); + }; + other = seg_dist(A.p1) < seg_dist(A.p0) ? 1 : 0; + } + b.C(SLVS_C_ARC_LINE_TANGENT, 0, 0, 0, primOf(ci), primOf(li), 0, other); } } break; } case CT::PointOnLine: + // slvs' in-workplane point-line distance is SIGNED. A negative stored value is an + // explicit side; a positive one (what the UI stores) keeps the side the point is on + // now. Passing |value| forced every point to the positive side, flipping any that + // sat on the other one across the line. if (std::abs(c.value) < 1e-9) b.C(SLVS_C_PT_ON_LINE, 0, ptOf(c.ea, c.ra), 0, primOf(c.eb), 0); else - b.C(SLVS_C_PT_LINE_DISTANCE, std::abs(c.value), ptOf(c.ea, c.ra), 0, primOf(c.eb), 0); + b.C(SLVS_C_PT_LINE_DISTANCE, + c.value < 0.0 ? c.value : side_of(c.ea, c.ra, c.eb) * c.value, + ptOf(c.ea, c.ra), 0, primOf(c.eb), 0); break; case CT::PointOnObject: - // Point (ea,ra) lies on entity edge eb: a circle rim -> PT_ON_CIRCLE, - // otherwise the segment line -> PT_ON_LINE. - if (valid(c.eb) && entities[c.eb].type == SketchEntity::Type::Circle) + // Point (ea,ra) lies on entity edge eb: a circle or arc rim -> PT_ON_CIRCLE (slvs + // takes both), otherwise the segment line -> PT_ON_LINE. An arc used to fall to + // PT_ON_LINE, which is not an equation about an arc at all. + if (valid(c.eb) && (entities[c.eb].type == SketchEntity::Type::Circle || + entities[c.eb].type == SketchEntity::Type::Arc)) b.C(SLVS_C_PT_ON_CIRCLE, 0, ptOf(c.ea, c.ra), 0, primOf(c.eb), 0); else b.C(SLVS_C_PT_ON_LINE, 0, ptOf(c.ea, c.ra), 0, primOf(c.eb), 0); @@ -433,6 +507,29 @@ static SketchSolveResult solve_system(std::vector& entities, e.start_angle = ns; e.end_angle = ns + sweep; e.radius = 0.5 * ((e.p0 - e.center).norm() + (e.p1 - e.center).norm()); + } else if (e.type == SketchEntity::Type::EllipseArc && s.center && e.radius > 1e-9 && e.rminor > 1e-9) { + // The solver moves the centre and the two ends as free points (it has no conic), so + // after a solve they need not agree with the stored angles, and the wire builder then + // finds the arc's ends away from its vertices and drops the whole sketch. Re-derive + // the parametric angles from the solved ends and put the ends back ON the ellipse. + const double cr = std::cos(e.rotation), sr = std::sin(e.rotation); + auto param = [&](const Vec2d& p) { + const Vec2d d = p - e.center; + const double x = d.x() * cr + d.y() * sr, y = -d.x() * sr + d.y() * cr; + return std::atan2(y / e.rminor, x / e.radius); + }; + auto at = [&](double t) { + const double x = e.radius * std::cos(t), y = e.rminor * std::sin(t); + return Vec2d(e.center.x() + x * cr - y * sr, e.center.y() + x * sr + y * cr); + }; + const double old_sweep = e.end_angle - e.start_angle; + double t0 = param(e.p0), t1 = param(e.p1); + if (old_sweep >= 0.0) { while (t1 <= t0) t1 += 2.0 * M_PI; } + else { while (t1 >= t0) t1 -= 2.0 * M_PI; } + e.start_angle = t0; + e.end_angle = t1; + e.p0 = at(t0); + e.p1 = at(t1); } } @@ -460,6 +557,21 @@ static SketchSolveResult solve_system(std::vector& entities, // that fits today keeps its exact current behaviour, including its reported degrees of freedom. // A genuinely over-constrained sketch still fails: the conflict lives inside one component and // that component still rejects it. +// Degrees of freedom an entity has on its own, as the whole-system solve counts them. +static int natural_dof(const SketchEntity& e) +{ + switch (e.type) { + case SketchEntity::Type::Line: return 4; + case SketchEntity::Type::Point: return 2; + case SketchEntity::Type::Circle: return e.radius > 1e-9 ? 3 : 2; + case SketchEntity::Type::Arc: return 5; // centre + two ends, ends equidistant + case SketchEntity::Type::Ellipse: return 2; // only the centre is a solver point + case SketchEntity::Type::EllipseArc: return 6; // centre + two ends + case SketchEntity::Type::BSpline: return 2 * int(e.ctrl.size()); + } + return 0; +} + static SketchSolveResult solve_partitioned(std::vector& entities, const std::vector& constraints, int dragged_ei, Role dragged_role) @@ -478,12 +590,18 @@ static SketchSolveResult solve_partitioned(std::vector& entities, }; for (const auto& c : constraints) { unite(c.ea, c.eb); unite(c.ea, c.ec); } - // Group the constraints by the component they belong to. + // Group the constraints by the component they belong to: that of the first ENTITY they + // reference. ea can be a sketch reference (origin / axis, negative) while eb is the entity, + // and such a constraint was dropped outright. std::map> groups; + std::vector constrained(n, false); for (size_t i = 0; i < constraints.size(); ++i) { - const int a = constraints[i].ea; - if (a < 0 || a >= n) continue; + const SketchEntityConstraintDef& c = constraints[i]; + const int a = (c.ea >= 0 && c.ea < n) ? c.ea : (c.eb >= 0 && c.eb < n) ? c.eb + : (c.ec >= 0 && c.ec < n) ? c.ec : -1; + if (a < 0) continue; groups[find(a)].push_back(int(i)); + for (int e : { c.ea, c.eb, c.ec }) if (e >= 0 && e < n) constrained[e] = true; } SketchSolveResult out; @@ -509,7 +627,8 @@ static SketchSolveResult solve_partitioned(std::vector& entities, subc.reserve(cidx.size()); for (int ci : cidx) { SketchEntityConstraintDef d = constraints[ci]; - auto map1 = [&](int& e) { e = (e >= 0 && local.count(e)) ? local[e] : -1; }; + // Sketch references (origin, axes: negative sentinels) are global and pass through. + auto map1 = [&](int& e) { if (e >= 0) e = local.count(e) ? local[e] : -1; }; map1(d.ea); map1(d.eb); map1(d.ec); subc.push_back(d); } @@ -522,8 +641,14 @@ static SketchSolveResult solve_partitioned(std::vector& entities, if (bi >= 0 && bi < int(cidx.size())) out.bad.push_back(cidx[bi]); } if (r.dof > 0) out.dof += r.dof; + for (int si : r.skipped) + if (si >= 0 && si < int(cidx.size())) out.skipped.push_back(cidx[si]); solved.emplace_back(std::move(ents), std::move(sub)); } + // Entities no constraint touches are in no group but still have their freedoms; the + // whole-system solve counts them, so this path must too or the two report different dof. + for (int i = 0; i < n; ++i) + if (!constrained[i]) out.dof += natural_dof(entities[i]); if (!out.ok) return out; for (auto& [ents, sub] : solved) for (size_t k = 0; k < ents.size(); ++k) entities[ents[k]] = sub[k]; diff --git a/src/libslic3r/CAD/SketchSolver.hpp b/src/libslic3r/CAD/SketchSolver.hpp index ada4474c7a..e15eafe11c 100644 --- a/src/libslic3r/CAD/SketchSolver.hpp +++ b/src/libslic3r/CAD/SketchSolver.hpp @@ -16,6 +16,10 @@ struct SketchSolveResult { int dof{-1}; // remaining degrees of freedom (>0 under-constrained) int result{0}; // raw SLVS_RESULT_* code std::vector bad; // indices (into `constraints`) of conflicting constraints + // Indices of constraints that were NOT applied because an entity they reference has no + // solver representation for the role they need (an ellipse rim, a spline curve, a + // zero-radius circle...). A solve can be ok with some skipped; callers should say so. + std::vector skipped; }; // Solve `constraints` over `entities` in place (writes solved coordinates back into the diff --git a/src/libslic3r/CAD/ThreadStandards.hpp b/src/libslic3r/CAD/ThreadStandards.hpp index e9bfcc314f..c03c2033d8 100644 --- a/src/libslic3r/CAD/ThreadStandards.hpp +++ b/src/libslic3r/CAD/ThreadStandards.hpp @@ -24,6 +24,8 @@ struct ThreadSpec { double thread_depth_mm() const { return 0.6134 * pitch_mm; } // Internal/tapped minor (tap-drill) diameter for the same nominal thread. double minor_diameter_mm() const { return major_diameter_mm - 1.0825 * pitch_mm; } + // Radial depth of the internal (tapped) thread, minor to major: (D - D1) / 2. + double internal_depth_mm() const { return 0.5 * (major_diameter_mm - minor_diameter_mm()); } bool imperial() const { return series == Series::UNC || series == Series::UNF; } }; diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index d69ada09b6..fed30c1e86 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -605,7 +605,21 @@ TEST_CASE("entity constraints: point-on-line positions a centre onto an axis", " cons.push_back({T::Fix, 0, -1, R::P1, R::P1, 0.0}); cons.push_back({T::PointOnLine, 1, 0, R::P0, R::P0, 2.0}); // hold at distance 2 REQUIRE(solve_sketch_entities(ents, cons)); - REQUIRE(std::abs(std::abs(ents[1].p0.y()) - 2.0) < 1e-6); // 2 mm off the axis + REQUIRE(std::abs(ents[1].p0.y() - 2.0) < 1e-6); // 2 mm off, same side + } + + SECTION("a point below the line stays below it") { + std::vector ents = { + {SketchEntity::Type::Line, Vec2d(0,0), Vec2d(10,0)}, + {SketchEntity::Type::Point, Vec2d(4,-9)}, // point BELOW the axis + }; + std::vector cons; + cons.push_back({T::Fix, 0, -1, R::P0, R::P0, 0.0}); + cons.push_back({T::Fix, 0, -1, R::P1, R::P1, 0.0}); + cons.push_back({T::PointOnLine, 1, 0, R::P0, R::P0, 2.0}); + REQUIRE(solve_sketch_entities(ents, cons)); + // |value| used to be forced onto the positive side, flipping the point across the line. + REQUIRE(std::abs(ents[1].p0.y() + 2.0) < 1e-6); } } @@ -674,7 +688,38 @@ TEST_CASE("entity constraints: tangent/midpoint/symmetric/angle", "[CadDocument] REQUIRE(doc.solve_sketch_feature(sk)); const auto& e = doc.features[sk].entities; - REQUIRE(std::abs(std::abs(e[1].p0.y()) - 5.0) < 1e-3); + // The line started ABOVE the circle (y=8) and must stay on that side: tangency keeps + // the side the geometry is on, it does not pick one. + REQUIRE(std::abs(e[1].p0.y() - 5.0) < 1e-3); + } + + SECTION("tangent line to circle, line below it") { + CadDocument doc; + std::vector ents = { + {SketchEntity::Type::Circle, Vec2d(0,0), Vec2d(0,0), Vec2d(0,0), 5.0}, + {SketchEntity::Type::Line, Vec2d(-10,-8), Vec2d(10,-8)}, + }; + int sk = doc.add_sketch_entities(ents, SketchPlane::XY(), "S"); + auto& ec = doc.features[sk].entity_constraints; + ec.push_back({T::Fix, 0,-1, R::Center,R::Center, 0.0,-1,R::P0}); + ec.push_back({T::LockX, 1,-1, R::P0, R::P0, -10.0,-1,R::P0}); + ec.push_back({T::LockX, 1,-1, R::P1, R::P0, 10.0,-1,R::P0}); + ec.push_back({T::Horizontal, 1, 1, R::P0, R::P1, 0.0,-1,R::P0}); + ec.push_back({T::Tangent, 0, 1, R::Center,R::P0, 0.0,-1,R::P0}); + REQUIRE(doc.solve_sketch_feature(sk)); + REQUIRE(std::abs(doc.features[sk].entities[1].p0.y() + 5.0) < 1e-3); + } + + SECTION("tangent circle to circle does not abort and keeps them touching") { + std::vector ents = { + {SketchEntity::Type::Circle, Vec2d(0,0), Vec2d(0,0), Vec2d(0,0), 5.0}, + {SketchEntity::Type::Circle, Vec2d(9,0), Vec2d(9,0), Vec2d(9,0), 3.0}, + }; + std::vector cons; + cons.push_back({T::Fix, 0,-1, R::Center,R::Center, 0.0,-1,R::P0}); + cons.push_back({T::Tangent, 0, 1, R::Center,R::Center, 0.0,-1,R::P0}); + REQUIRE(solve_sketch_entities(ents, cons)); + CHECK(std::abs((ents[1].center - ents[0].center).norm() - 8.0) < 1e-6); // r1 + r2 } SECTION("symmetric across a line") { @@ -2136,7 +2181,7 @@ TEST_CASE("a v4 project still opens", "[CadDocument][recipe]") ifs.close(); REQUIRE_FALSE(blob.empty()); - // Trusted reference read of the flat v4 layout (what the golden test's Layer 1 does). + // Reference read of the flat v4 layout with the frozen v4 field list. std::vector flat; { std::istringstream iss(blob); @@ -2144,19 +2189,40 @@ TEST_CASE("a v4 project still opens", "[CadDocument][recipe]") uint32_t v; ar(v); REQUIRE(v == 4); - ar(flat); + cereal::size_type n = 0; + ar(cereal::make_size_tag(n)); + flat.assign(size_t(n), CadFeature{}); + for (CadFeature& f : flat) f.load_flat_v4(ar); + // The whole stream must be consumed by features + variables: a layout mismatch leaves + // bytes behind (or runs out), which is exactly what reading v4 with the CURRENT field + // list would do the moment a field is appended to it. + std::map vars; + ar(vars); + CHECK(iss.peek() == std::char_traits::eof()); } REQUIRE_FALSE(flat.empty()); CadDocument doc; - doc.deserialize_recipe(blob); - // Not refused at the gate: the only failure allowed is the fixture's own geometry - // (the golden doc is a serialization-coverage tree whose fillet radius is too large), - // which is orthogonal to the v5 framing change and unchanged by it. - REQUIRE(doc.error.find("older version") == std::string::npos); - REQUIRE(doc.error.find("newer version") == std::string::npos); - // The v4 flat path read the same feature tree as the trusted reference. + const bool ok = doc.deserialize_recipe(blob); + // It must OPEN: either cleanly, or failing only on the fixture's own geometry (the golden + // doc is a serialization-coverage tree whose fillet radius is too large). "CAD data could not + // be read" — a misread stream — passed the old version of this test, which only ruled out + // the version-gate messages. + if (!ok) { + INFO("v4 load error: " << doc.error); + CHECK(doc.error.find("could not be read") == std::string::npos); + CHECK(doc.error.find("older version") == std::string::npos); + CHECK(doc.error.find("newer version") == std::string::npos); + } + // The v4 path read the same feature tree as the reference, field for field. REQUIRE(doc.features.size() == flat.size()); + for (size_t i = 0; i < flat.size(); ++i) { + CHECK(doc.features[i].name == flat[i].name); + CHECK(doc.features[i].type == flat[i].type); + CHECK(doc.features[i].distance == flat[i].distance); + CHECK(doc.features[i].mate_kind == flat[i].mate_kind); + CHECK(doc.features[i].coordsys_face_edges == flat[i].coordsys_face_edges); + } } // Do NOT regenerate cad_recipe_v5.bin either. It was written by the build that predates the @@ -2280,10 +2346,13 @@ TEST_CASE("a truncated feature keeps what it could read", "[CadDocument][recipe] off += 4 + f_len.back(); } - // Shorten feature 1 by dropping its final field (4 bytes): rewrite its length prefix - // and erase the tail bytes. The reader then runs out inside fa(f), throws, and keeps - // everything it had already assigned — that is the whole point of the try/catch. - const size_t drop = sizeof(uint32_t); + // Shorten feature 1 so it ends right after coordsys_face_kind: drop coordsys_face_edges + // (4 bytes) and the two flags appended after it (thread_major_nominal, pattern_inclusive: + // 1 byte each). Rewrite its length prefix and erase the tail bytes. The reader then runs + // out inside fa(f), throws, and keeps everything it had already assigned — that is the + // whole point of the try/catch. (Cut on a field boundary: a field cut in half is read as + // whatever half arrived.) + const size_t drop = sizeof(uint32_t) + 2 * sizeof(bool); REQUIRE(f_len[1] > drop); std::string shortened = blob; shortened.erase(f_off[1] + 4 + f_len[1] - drop, drop); @@ -2299,6 +2368,8 @@ TEST_CASE("a truncated feature keeps what it could read", "[CadDocument][recipe] REQUIRE(loaded.features[1].name == doc.features[1].name); REQUIRE(loaded.features[1].coordsys_face_kind == 777); // right before the cut REQUIRE(loaded.features[1].coordsys_face_edges == -1); // defaulted by the cut + REQUIRE_FALSE(loaded.features[1].thread_major_nominal); // ...and so were the later flags + REQUIRE_FALSE(loaded.features[1].pattern_inclusive); REQUIRE(loaded.features[0].name == doc.features[0].name); REQUIRE(loaded.features[2].name == doc.features[2].name); } @@ -4166,8 +4237,12 @@ TEST_CASE("golden recipe v1 still deserialises", "[CadDocument]") cereal::BinaryInputArchive ar(iss); uint32_t v; ar(v); - REQUIRE(v <= CadDocument::ORCA_CAD_RECIPE_VERSION); - ar(features); + REQUIRE(v == 4); + // The fixture is a v4 (flat) blob: read it with the frozen v4 field list. + cereal::size_type n = 0; + ar(cereal::make_size_tag(n)); + features.assign(size_t(n), CadFeature{}); + for (CadFeature& f : features) f.load_flat_v4(ar); } CadDocument expected = make_golden_doc_v1(); @@ -4641,41 +4716,26 @@ TEST_CASE("bridge closes a C profile and extrudes", "[CadDocument][bridge]") // top edge: (10,10) to (-10,10) {SketchEntity::Type::Line, Vec2d(10,10), Vec2d(-10,10)}, }; - // Missing: left edge from (-10,10) to (-10,-10). Build it as a separate line - // entity so the bridge connects two existing lines. + // The C is open on the left: entity 2 (top) ends at (-10,10), entity 0 (bottom) starts at + // (-10,-10). The bridge IS the closing edge. int sk = doc.add_sketch_entities(ents, SketchPlane::XY(), "C"); REQUIRE(sk == 0); - - // Add the closing line as entity 3: (-10,10) to (-10,-10) CadFeature& f = doc.features[sk]; - SketchEntity closing; - closing.type = SketchEntity::Type::Line; - closing.p0 = Vec2d(-10, 10); - closing.p1 = Vec2d(-10, -10); - // The C is entities 0,1,2 (bottom cap, right side, top cap). - // Entity 0 end=1 is (10,-10); entity 2 start=0 is (10,10). That's a U. - // But we need a closed square from C shape. - // Re-think: a C shape open on the left side. - // Entities: 0 = bottom edge (-10,-10)->(10,-10) [end=1 at (10,-10)] - // 1 = right edge (10,-10)->(10,10) [start=0 at (10,-10), end=1 at (10,10)] - // 2 = top edge (10,10)->(-10,10) [start=0 at (10,10), end=1 at (-10,10)] - // The C is open: entity 2's end is at (-10,10) and entity 0's start is at (-10,-10). - // Bridge: entity 2 end=1 (-10,10) -> entity 0 start=0 (-10,-10). - f.entities.push_back(closing); + + int bi = doc.add_bridge(sk, 2/*top edge*/, 1/*end*/, 0/*bottom edge*/, 0/*start*/, "Bridge"); + REQUIRE(bi == 3); REQUIRE(f.entities.size() == 4); - // Now bridge from top end (entity 2 end=1 = (-10,10)) to bottom start (entity 0 end=0 = (-10,-10)) - int bi = doc.add_bridge(sk, 2/*top edge*/, 1/*end*/, 0/*bottom edge*/, 0/*start*/, "Bridge"); - REQUIRE(bi == 4); - REQUIRE(f.entities.size() == 5); - - // Now the entities should form a closed loop -> extrude int ex = doc.add_extrude(sk, 5.0, false, BooleanMode::New, "Extrude"); REQUIRE(ex >= 0); REQUIRE(doc.recompute()); REQUIRE(doc.error.empty()); REQUIRE(doc.display_mesh.facets_count() > 0); - REQUIRE_THAT(double(doc.display_mesh.volume()), WithinRel(20.0 * 20.0 * 5.0, 1e-2)); + // G1 with both edges means the bridge LEAVES the top edge heading -X and ARRIVES on the + // bottom edge heading +X: it bulges out to the left, a cubic whose inner poles sit 20/3 mm + // out, enclosing 3/5 x 20/3 x 20 = 80 mm2 beyond the square. (This test used to expect the + // bare square: the old end pole sent the curve back across x = -10 in an S, a cusp.) + REQUIRE_THAT(double(doc.display_mesh.volume()), WithinRel((20.0 * 20.0 + 80.0) * 5.0, 1e-2)); } TEST_CASE("bridge bad indices throw", "[CadDocument][bridge]") @@ -7383,11 +7443,16 @@ TEST_CASE("Failed sketch solve leaves geometry untouched", "[CadDocument]") auto tang = [&](int ln) { SketchEntityConstraintDef d; d.type = CT::Tangent; d.ea = xi; d.eb = ln; return d; }; - // Rung 1 of the ladder: a tangent on each leg. Over-constrained against the legs' - // own H/V, so it must be rejected -- and must not move a single point. + // A genuinely conflicting batch (the right leg held at two different lengths) must be + // rejected -- and must not move a single point. { std::vector pc = cs; - for (const auto& c : { coin(R::P0, a, R::P0), coin(R::P1, b, R::P1), tang(a), tang(b) }) + SketchEntityConstraintDef d10, d20; // one leg held at two different lengths + d10.type = d20.type = CT::Distance; + d10.ea = d20.ea = d10.eb = d20.eb = 1; + d10.ra = d20.ra = R::P0; d10.rb = d20.rb = R::P1; + d10.value = 100.0; d20.value = 120.0; + for (const auto& c : { coin(R::P0, a, R::P0), coin(R::P1, b, R::P1), d10, d20 }) pc.push_back(c); std::vector e = ents; REQUIRE_FALSE(solve_sketch_entities(e, pc)); @@ -7398,6 +7463,22 @@ TEST_CASE("Failed sketch solve leaves geometry untouched", "[CadDocument]") } } + // Rung 1 of the ladder — a tangent on EACH leg — is a well-posed fillet, not a conflict. It + // used to be rejected because both tangencies were bound to the arc's START point, which + // forced the two legs parallel; each is now bound to the end that touches its leg. + { + std::vector pc = cs; + for (const auto& c : { coin(R::P0, a, R::P0), coin(R::P1, b, R::P1), tang(a), tang(b) }) + pc.push_back(c); + std::vector e = ents; + REQUIRE(solve_sketch_entities(e, pc)); + CHECK(e[xi].radius == Approx(28.205).margin(1e-6)); + // Tangent at both ends: the radius to each end is perpendicular to that end's leg. + const Vec2d da = (e[a].p1 - e[a].p0).normalized(), db = (e[b].p1 - e[b].p0).normalized(); + CHECK(std::abs((e[xi].p0 - e[xi].center).normalized().dot(da)) < 1e-6); + CHECK(std::abs((e[xi].p1 - e[xi].center).normalized().dot(db)) < 1e-6); + } + // Rung 2 (one tangent) solves, and the arc keeps the radius the fillet gave it. { std::vector pc = cs; @@ -8412,3 +8493,202 @@ TEST_CASE("deleting a feature remaps the references of every consumer, not just REQUIRE(doc.features.empty()); } } + +// A sketch past libslvs' MAX_UNKNOWNS is solved component by component. Constraints onto the +// sketch origin / axes reference NEGATIVE sentinels; the partitioned path used to turn them into +// "no entity" and drop the constraint while still reporting success. +TEST_CASE("Partitioned solve keeps constraints onto the origin and the axes", "[CadDocument][sketch]") +{ + using R = SketchPointRole; + using T = SketchConstraintType; + std::vector ents; + std::vector cons; + const int n = 600; // 600 lines x 4 params: well past the 1024-unknown ceiling + for (int i = 0; i < n; ++i) { + SketchEntity e; e.type = SketchEntity::Type::Line; + e.p0 = Vec2d(1.0 + 0.01 * i, 2.0); e.p1 = Vec2d(5.0 + 0.01 * i, 7.0 + i); + ents.push_back(e); + // P0 onto the origin: the sentinel is in eb, the entity in ea... + cons.push_back({T::Coincident, i, kSketchRefOrigin, R::P0, R::P0, 0.0}); + } + // ...and line 1's far end onto the X axis. + SketchEntityConstraintDef on_x; on_x.type = T::PointOnObject; + on_x.ea = 1; on_x.ra = R::P1; on_x.eb = kSketchRefAxisX; + cons.push_back(on_x); + REQUIRE(solve_sketch_entities(ents, cons)); + for (int i = 0; i < n; ++i) + REQUIRE(ents[i].p0.norm() < 1e-6); + CHECK(std::abs(ents[1].p1.y()) < 1e-6); +} + +// ---- references that must follow their target across a change of history ---------------- + +static CadDocument two_boxes_and_a_lift(int& ea, int& eb, int& lift) +{ + CadDocument doc; + SketchPlane pa = SketchPlane::XY(); + SketchPlane pb = SketchPlane::XY(); pb.origin = Vec3d(100, 0, 0); + const int sa = doc.add_sketch(SketchShape::Rectangle, pa, 10, 10, 0, "A"); + ea = doc.add_extrude(sa, 5, false, BooleanMode::New, "EA"); // body 0 + const int sb = doc.add_sketch(SketchShape::Rectangle, pb, 10, 10, 0, "B"); + eb = doc.add_extrude(sb, 5, false, BooleanMode::New, "EB"); // body 1 + lift = doc.add_transform(1, Vec3d(0, 0, 50), Vec3d(0, 0, 1), Vec3d(0, 0, 0), 0, false, "Lift B"); + REQUIRE(doc.recompute()); + return doc; +} + +TEST_CASE("Deleting the feature that made an EARLIER body keeps later features on their body", + "[CadDocument][history]") +{ + int ea, eb, lift; + CadDocument doc = two_boxes_and_a_lift(ea, eb, lift); + REQUIRE(doc.bodies.size() == 2); + // Body A goes away, so B becomes body 0. "Lift B" said body 1: by index it would now name + // nothing (and used to fall back to the last body in silence); by identity it is still B. + REQUIRE(doc.remove_feature(ea)); + REQUIRE(doc.bodies.size() == 1); + CHECK(doc.features[lift - 1].target_body == 0); + const auto bb = doc.display_mesh.bounding_box(); + CHECK(bb.min.z() > 49.0); // B was lifted + CHECK(bb.min.x() > 90.0); // and it is B, not A +} + +TEST_CASE("Deleting the feature that made a body a later feature works on is refused", + "[CadDocument][history]") +{ + int ea, eb, lift; + CadDocument doc = two_boxes_and_a_lift(ea, eb, lift); + const size_t n = doc.features.size(); + CHECK_FALSE(doc.remove_feature(eb)); // "Lift B" would have nothing to lift + CHECK(doc.features.size() == n); // rolled back + CHECK(doc.bodies.size() == 2); + CHECK_FALSE(doc.error.empty()); +} + +TEST_CASE("Hiding a body-making feature keeps later features on their body", "[CadDocument][history]") +{ + int ea, eb, lift; + CadDocument doc = two_boxes_and_a_lift(ea, eb, lift); + REQUIRE(doc.set_feature_enabled(ea, false)); + REQUIRE(doc.bodies.size() == 1); + CHECK(doc.display_mesh.bounding_box().min.z() > 49.0); + // ...and showing it again puts the reference back where it was. + REQUIRE(doc.set_feature_enabled(ea, true)); + REQUIRE(doc.bodies.size() == 2); + CHECK(doc.features[lift].target_body == 1); +} + +TEST_CASE("Datum-plane references follow their plane when an earlier plane is deleted", + "[CadDocument][history]") +{ + CadDocument doc; + const int p1 = doc.add_plane(0, 10, 0, 0, "P1"); // datum 0 (3 + 0) + doc.add_plane(0, 20, 0, 0, "P2"); // datum 1 (3 + 1) + const int p3 = doc.add_plane(3 + 1, 5, 0, 0, "P3"); // built on P2: z = 25 + auto planes = doc.resolve_datum_planes(); + REQUIRE(planes.size() == 3); + REQUIRE(std::abs(planes[2].second.origin.z() - 25.0) < 1e-9); + REQUIRE(doc.remove_feature(p1)); + CHECK(doc.features[p3 - 1].plane_base == 3 + 0); // P2 is datum 0 now + planes = doc.resolve_datum_planes(); + REQUIRE(planes.size() == 2); + CHECK(std::abs(planes[1].second.origin.z() - 25.0) < 1e-9); // still on P2, not on XY +} + +TEST_CASE("clear() starts a document without the previous one's variables", "[CadDocument]") +{ + CadDocument doc; + doc.variables["w"] = "12"; + doc.clear(); + CHECK(doc.variables.empty()); +} + +TEST_CASE("Expressions: trig takes degrees, deg()/rad() convert, pi is the number", "[CadDocument][expr]") +{ + CadDocument doc; + const int sk = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 10, 10, 0, "S"); + const int ex = doc.add_extrude(sk, 5, false, BooleanMode::New, "E"); + doc.features[ex].expr["distance"] = "10 * sin(deg(pi / 2)) + 10 * cos(rad(0) + 90) + 2 * cos(60)"; + REQUIRE(doc.recompute()); + CHECK(std::abs(doc.features[ex].distance - 11.0) < 1e-9); // 10 + 0 + 1 +} + +TEST_CASE("Every field the Design tab offers for an expression can be bound", "[CadDocument][expr]") +{ + // The per-tool pickers in DesignPanel::fields_for_tool. A name the kernel does not know made + // the next recompute throw "unknown parameter" and the whole model stopped rebuilding. + for (const char* f : { "width", "height", "radius", "distance", "distance2", "taper_deg", + "dressup_size", "hole_diameter", "hole_depth", "hole_x", "hole_y", + "thread_diameter", "thread_pitch", "thread_height", "thread_depth", + "thread_x", "thread_y", "shell_thickness", "revolve_angle", + "pattern_count", "pattern_spacing", "pattern_angle", "plane_offset", + "plane_angle_tilt", "draft_angle", "thicken_thickness", "rib_thickness", + "rib_depth", "helix_radius", "helix_pitch", "helix_height", + "helix_taper_deg" }) { + INFO(f); + CHECK(CadDocument::is_bindable_field(f)); + } + CHECK_FALSE(CadDocument::is_bindable_field("no_such_field")); +} + +TEST_CASE("A circular pattern spans its whole angle", "[CadDocument][pattern]") +{ + // A 2 mm cube 10 mm out on +X, three copies over 90°: at 0°, 45° and 90°. The old spacing + // (angle / count) stopped at 60°, so the last copy never reached the +Y axis. + CadDocument doc; + SketchPlane p = SketchPlane::XY(); p.origin = Vec3d(10, 0, 0); + const int sk = doc.add_sketch(SketchShape::Rectangle, p, 2, 2, 0, "S"); + doc.add_extrude(sk, 2, false, BooleanMode::New, "E"); + doc.add_pattern(true, 3, 0, 0, 90.0, -1, "P"); + REQUIRE(doc.recompute()); + CHECK(doc.display_mesh.bounding_box().max.y() > 10.5); +} + +TEST_CASE("Hole standards: inch sizes by either name, with their 82° countersink", "[CadDocument][hole]") +{ + CadDocument doc; + const int a = doc.add_hole_standard("1/4-20", 2, true, 10, 0, 0, SketchPlane::XY(), "H1"); + const int b = doc.add_hole_standard("#10-24 UNC", 2, true, 10, 0, 0, SketchPlane::XY(), "H2"); + CHECK(doc.features[a].hole_standard == "1/4-20 UNC"); + CHECK(doc.features[a].hole_csink_angle == 82.0); + CHECK(doc.features[b].hole_standard == "#10-24 UNC"); + const int m = doc.add_hole_standard("M6", 1, true, 10, 0, 0, SketchPlane::XY(), "H3"); + CHECK(doc.features[m].hole_csink_angle == 90.0); + CHECK(doc.features[m].hole_cbore_diameter == 11.0); +} + +TEST_CASE("Body colours and names survive a save and a load", "[CadDocument][recipe]") +{ + CadDocument doc; + const int sk = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 10, 10, 0, "S"); + doc.add_extrude(sk, 5, false, BooleanMode::New, "E"); + doc.modeling_origin = Vec3d(110, 120, 0); + REQUIRE(doc.recompute()); + doc.bodies[0].has_color = true; + doc.bodies[0].color = ColorRGBA(0.1f, 0.2f, 0.3f, 1.0f); + const std::string blob = doc.serialize_recipe(); + CadDocument back; + back.modeling_origin = Vec3d(1, 2, 3); // a different printer's bed centre + REQUIRE(back.deserialize_recipe(blob)); + REQUIRE(back.bodies.size() == 1); + CHECK(back.bodies[0].has_color); + CHECK(std::abs(back.bodies[0].color.g() - 0.2f) < 1e-6); + CHECK((back.modeling_origin - Vec3d(110, 120, 0)).norm() < 1e-9); // the project's own + CHECK(back.origin_from_recipe); +} + +TEST_CASE("A new thread reads its radius as the nominal (major) radius", "[CadDocument][thread]") +{ + CadDocument doc; + const int sk = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 30, 30, 0, "S"); + doc.add_extrude(sk, 12, false, BooleanMode::New, "E"); + // M6 internal: major radius 3, depth (major - minor) / 2. + const double P = 1.0, depth = 0.5 * 1.0825 * P; + const int t = doc.add_thread(3.0, P, 10.0, depth, true, 0, 0, SketchPlane::XY(), "T"); + CHECK(doc.features[t].thread_major_nominal); + REQUIRE(doc.recompute()); + // A degenerate new thread says why instead of doing nothing. + doc.features[t].thread_depth = 0.9 * P; + CHECK_FALSE(doc.recompute()); + CHECK(doc.error.find("thread") != std::string::npos); +} diff --git a/tests/libslic3r/test_sketchedit.cpp b/tests/libslic3r/test_sketchedit.cpp index 634e743b99..9e97684fc2 100644 --- a/tests/libslic3r/test_sketchedit.cpp +++ b/tests/libslic3r/test_sketchedit.cpp @@ -110,7 +110,10 @@ TEST_CASE("Offset Line by positive d", "[SketchEdit]") REQUIRE_THAT(o.p1.y(), WithinAbs(2.0, 1e-9)); } -TEST_CASE("Offset Circle: expand and collapse", "[SketchEdit]") +// CONTRACT CHANGED: a circle follows the arc's "+d = left of travel" rule and counts as CCW, so +// +d shrinks it and -d grows it. It used to grow on +d, the opposite of the same outline drawn +// as a CCW chain of arcs. +TEST_CASE("Offset Circle: +d shrinks (a circle is CCW), -d grows, too far collapses", "[SketchEdit]") { SketchEntity e; e.type = SketchEntity::Type::Circle; @@ -118,14 +121,36 @@ TEST_CASE("Offset Circle: expand and collapse", "[SketchEdit]") e.p0 = Vec2d(0, 0); e.radius = 5; - auto expanded = SketchEngine::offset_entities({e}, 2.0); - REQUIRE(expanded.size() == 1); - REQUIRE_THAT(expanded[0].radius, WithinAbs(7.0, 1e-9)); + auto inward = SketchEngine::offset_entities({e}, 2.0); + REQUIRE(inward.size() == 1); + REQUIRE_THAT(inward[0].radius, WithinAbs(3.0, 1e-9)); - auto collapsed = SketchEngine::offset_entities({e}, -5.0); + auto outward = SketchEngine::offset_entities({e}, -2.0); + REQUIRE(outward.size() == 1); + REQUIRE_THAT(outward[0].radius, WithinAbs(7.0, 1e-9)); + + auto collapsed = SketchEngine::offset_entities({e}, 5.0); REQUIRE(collapsed.empty()); } +TEST_CASE("Offset: a full circle and the same CCW outline drawn as arcs go the same way", "[SketchEdit]") +{ + SketchEntity c; + c.type = SketchEntity::Type::Circle; c.center = Vec2d(0, 0); c.p0 = c.center; c.radius = 5; + SketchEntity a0, a1; + a0.type = a1.type = SketchEntity::Type::Arc; + a0.center = a1.center = Vec2d(0, 0); + a0.radius = a1.radius = 5; + a0.start_angle = 0.0; a0.end_angle = M_PI; a0.p0 = Vec2d(5, 0); a0.p1 = Vec2d(-5, 0); + a1.start_angle = M_PI; a1.end_angle = 2.0 * M_PI; a1.p0 = Vec2d(-5, 0); a1.p1 = Vec2d(5, 0); + const auto oc = SketchEngine::offset_entities({ c }, 1.0); + const auto oa = SketchEngine::offset_entities({ a0, a1 }, 1.0); + REQUIRE(oc.size() == 1); + REQUIRE(oa.size() == 2); + CHECK_THAT(oc[0].radius, WithinAbs(oa[0].radius, 1e-9)); + CHECK_THAT(oc[0].radius, WithinAbs(oa[1].radius, 1e-9)); +} + // CONTRACT CHANGED: +d used to mean "radius + d" for every arc regardless of its sweep, while // for a line it meant "left of the direction of travel". The two disagreed, so a profile made // of lines AND arcs (any slot outline) offset with its straights going one way and its caps the @@ -375,6 +400,9 @@ TEST_CASE("Trim arc drops the picked (start) side", "[SketchEdit]") REQUIRE_THAT(e.radius, WithinAbs(5.0, 1e-9)); REQUIRE_THAT(e.start_angle, WithinAbs(M_PI / 2.0, 1e-9)); REQUIRE_THAT(e.end_angle, WithinAbs(M_PI, 1e-9)); + // The stored endpoints follow the angles: everything downstream reads p0/p1. + CHECK_THAT(e.p0.x(), WithinAbs(0.0, 1e-9)); CHECK_THAT(e.p0.y(), WithinAbs(5.0, 1e-9)); + CHECK_THAT(e.p1.x(), WithinAbs(-5.0, 1e-9)); CHECK_THAT(e.p1.y(), WithinAbs(0.0, 1e-9)); } TEST_CASE("Trim arc drops the picked (end) side", "[SketchEdit]") @@ -397,6 +425,8 @@ TEST_CASE("Trim arc drops the picked (end) side", "[SketchEdit]") REQUIRE(e.type == SketchEntity::Type::Arc); REQUIRE_THAT(e.start_angle, WithinAbs(0.0, 1e-9)); REQUIRE_THAT(e.end_angle, WithinAbs(M_PI / 2.0, 1e-9)); + CHECK_THAT(e.p0.x(), WithinAbs(5.0, 1e-9)); CHECK_THAT(e.p0.y(), WithinAbs(0.0, 1e-9)); + CHECK_THAT(e.p1.x(), WithinAbs(0.0, 1e-9)); CHECK_THAT(e.p1.y(), WithinAbs(5.0, 1e-9)); } TEST_CASE("Trim circle opens into an arc excluding the pick", "[SketchEdit]") @@ -406,7 +436,7 @@ TEST_CASE("Trim circle opens into an arc excluding the pick", "[SketchEdit]") SketchEntity e; e.type = SketchEntity::Type::Circle; e.center = Vec2d(0, 0); - e.p0 = Vec2d(5, 0); + e.p0 = e.center; // circle convention: p0 mirrors the centre e.radius = 5; SketchEntity cut; @@ -423,6 +453,11 @@ TEST_CASE("Trim circle opens into an arc excluding the pick", "[SketchEdit]") double mid = 0.5 * (e.start_angle + e.end_angle); REQUIRE_THAT(5 * std::cos(mid), WithinAbs(-5.0, 1e-9)); REQUIRE_THAT(5 * std::sin(mid), WithinAbs(0.0, 1e-9)); + // p0 was the circle's centre; as an arc it must be the arc's start, on the rim. + CHECK_THAT((e.p0 - e.center).norm(), WithinAbs(5.0, 1e-9)); + CHECK_THAT((e.p1 - e.center).norm(), WithinAbs(5.0, 1e-9)); + CHECK_THAT(e.p0.x(), WithinAbs(5.0 * std::cos(e.start_angle), 1e-9)); + CHECK_THAT(e.p1.x(), WithinAbs(5.0 * std::cos(e.end_angle), 1e-9)); } TEST_CASE("Extend arc forward (end) to a crossing", "[SketchEdit]") @@ -446,6 +481,7 @@ TEST_CASE("Extend arc forward (end) to a crossing", "[SketchEdit]") REQUIRE(e.type == SketchEntity::Type::Arc); REQUIRE_THAT(e.start_angle, WithinAbs(0.0, 1e-9)); REQUIRE_THAT(e.end_angle, WithinAbs(M_PI, 1e-9)); + CHECK_THAT(e.p1.x(), WithinAbs(-5.0, 1e-9)); CHECK_THAT(e.p1.y(), WithinAbs(0.0, 1e-9)); } TEST_CASE("Extend arc backward (start) to a crossing", "[SketchEdit]") @@ -475,7 +511,7 @@ TEST_CASE("Extend circle returns false (closed)", "[SketchEdit]") SketchEntity e; e.type = SketchEntity::Type::Circle; e.center = Vec2d(0, 0); - e.p0 = Vec2d(5, 0); + e.p0 = e.center; // circle convention: p0 mirrors the centre e.radius = 5; SketchEntity cut; @@ -728,3 +764,66 @@ TEST_CASE("sketch_open_ends names where a chain fails to close", "[SketchEngine] REQUIRE_THAT(got[1].x(), WithinAbs(0.0, 1e-9)); REQUIRE_THAT(got[1].y(), WithinAbs(10.0, 1e-9)); } + +TEST_CASE("Mirror EllipseArc keeps the same arc, not its complement", "[SketchEdit]") +{ + // A quarter of an ellipse a=6 b=3 centred at (10,0), CCW from param 0 to pi/2, mirrored + // across the Y axis: the image is a quarter again (the complement would be three quarters), + // its start angle belongs to its p0, and its middle is still above the X axis. + SketchEntity e; + e.type = SketchEntity::Type::EllipseArc; + e.center = Vec2d(10, 0); e.radius = 6; e.rminor = 3; e.rotation = 0.0; + e.start_angle = 0.0; e.end_angle = M_PI / 2.0; + e.p0 = Vec2d(16, 0); e.p1 = Vec2d(10, 3); + const auto out = SketchEngine::mirror_entities({ e }, Vec2d(0, -1), Vec2d(0, 1)); + REQUIRE(out.size() == 1); + const SketchEntity& m = out[0]; + REQUIRE(m.type == SketchEntity::Type::EllipseArc); + CHECK_THAT(m.end_angle - m.start_angle, WithinAbs(M_PI / 2.0, 1e-9)); + const double cr = std::cos(m.rotation), sr = std::sin(m.rotation); + auto at = [&](double t) { + return Vec2d(m.center.x() + m.radius * std::cos(t) * cr - m.rminor * std::sin(t) * sr, + m.center.y() + m.radius * std::cos(t) * sr + m.rminor * std::sin(t) * cr); + }; + CHECK((at(m.start_angle) - m.p0).norm() < 1e-6); + CHECK((at(m.end_angle) - m.p1).norm() < 1e-6); + CHECK(at(0.5 * (m.start_angle + m.end_angle)).y() > 1.0); +} + +TEST_CASE("Bridge between two collinear lines is straight and stays between them", "[SketchEdit]") +{ + SketchEntity a, b; + a.type = b.type = SketchEntity::Type::Line; + a.p0 = Vec2d(-10, 0); a.p1 = Vec2d(0, 0); // ends at x=0 heading +X + b.p0 = Vec2d(9, 0); b.p1 = Vec2d(19, 0); // starts at x=9 heading +X + const SketchEntity br = SketchEngine::make_bridge(a, 1, b, 0); + REQUIRE(br.ctrl.size() == 4); + // G1 into b: the last inner pole sits BEFORE b's start, on the side the curve arrives from. + CHECK(br.ctrl[1].x() > 0.0); + CHECK(br.ctrl[2].x() < 9.0); + for (const Vec2d& p : br.ctrl) CHECK_THAT(p.y(), WithinAbs(0.0, 1e-9)); +} + +TEST_CASE("Transform with a negative scale keeps an arc on its endpoints", "[SketchEdit]") +{ + SketchEntity e; + e.type = SketchEntity::Type::Arc; + e.center = Vec2d(3, 0); e.radius = 2; e.start_angle = 0.0; e.end_angle = M_PI / 2.0; + e.p0 = Vec2d(5, 0); e.p1 = Vec2d(3, 2); + const auto out = SketchEngine::transform_entities({ e }, Vec2d(0, 0), 0.0, -1.0, Vec2d(0, 0)); + REQUIRE(out.size() == 1); + const SketchEntity& m = out[0]; + // A point reflection through the origin: centre (-3,0), start (-5,0), end (-3,-2). + CHECK((m.center - Vec2d(-3, 0)).norm() < 1e-9); + CHECK((m.p0 - Vec2d(-5, 0)).norm() < 1e-9); + CHECK((m.p1 - Vec2d(-3, -2)).norm() < 1e-9); +} + +TEST_CASE("A zero-radius circle does not build a wire (and does not throw)", "[SketchEdit]") +{ + SketchEntity c; + c.type = SketchEntity::Type::Circle; c.center = Vec2d(0, 0); c.p0 = c.center; c.radius = 0.0; + std::vector w; + REQUIRE_NOTHROW(w = SketchEngine::entities_to_wires({ c }, SketchPlane::XY(), true)); + CHECK(w.empty()); +} From 829124982d8648b9ee92cc9897b3a9b34ea755ee Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 28 Sep 2026 17:11:44 +0000 Subject: [PATCH 140/389] Design tab: one rule for mouse, Enter and Esc; honest status messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keyboard and mouse - Esc drops what is pending (picks, a dimension's first point, an edit-op or transform) and never applies it; Enter applies a ready edit-op/transform, ends a polyline/spline chain, ends an armed tool, and confirms a feature card exactly when its ✓ is enabled. - Right-click only abandons the gesture in progress; with nothing pending it opens the offer in every tool (Trim, edit-ops, transforms, Dimension, Constrain, TransformArt, move gizmo). Clicking empty space no longer commits. The offer needs no timing, only a still press. - Delete removes only an explicit selection. Undo/redo inside a sketch go through the same route as the buttons (whole shapes, with redo); Edit > Undo follows the shown tab. - The canvas no longer handles Delete/Esc/Ctrl+Z itself (Backspace in a value field deleted the geometry it measured); F is in the panel's key map. - Value fields: a refused value keeps the field open with the reason; click outside and Tab commit; an untouched field commits the exact value; any decimal separator is accepted; lengths are always mm; validation is the same for every editor. - Snapping: the marker shows only where the click will actually snap; pick tolerances are one set of pixel budgets (Constrain picks within reach; no mm floor on labels). Messages and consistency - set_status(kind, text) gives every status line its own colour and glyph; kernel errors are translated into sentences and formatted, not concatenated; sketch refusals go to the status line instead of the per-frame HUD that erased them. - Hints describe the gestures that now work; Dimension shows its second step; Constrain uses the sketch palette (red means conflict only); the straight slot's value is its width. - Hole/Thread/Project keep the user's pick or refuse up front; circular pattern opens with its own preview; thread fields use the nominal diameter and the ISO internal depth. Integration - MCP loads the project's recipe before touching the document, refuses to mutate it while the tab is busy, never runs a request that already timed out, only replaces a socket at its path, caps line length and removes the socket at exit; not started in the G-code viewer. - Hiding a feature keeps later body references on their bodies; a design keeps its modeling origin across printer changes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- docs/CAD/design_tab.md | 5 +- src/slic3r/GUI/CAD/DesignCanvas.cpp | 61 +- src/slic3r/GUI/CAD/DesignCanvas.hpp | 20 +- src/slic3r/GUI/CAD/DesignInteraction.hpp | 8 +- src/slic3r/GUI/CAD/DesignPanel.cpp | 1036 +++++++++------------ src/slic3r/GUI/CAD/DesignPanel.hpp | 25 +- src/slic3r/GUI/CAD/DesignSketchTool.cpp | 612 ++++++++---- src/slic3r/GUI/CAD/DesignSketchTool.hpp | 75 +- src/slic3r/GUI/CAD/McpControl.cpp | 69 +- src/slic3r/GUI/CAD/McpControl.hpp | 20 +- src/slic3r/GUI/CAD/SketchInlineEditor.cpp | 54 +- src/slic3r/GUI/CAD/SketchInlineEditor.hpp | 22 +- src/slic3r/GUI/GLCanvas3D.cpp | 79 +- src/slic3r/GUI/MainFrame.cpp | 55 +- src/slic3r/GUI/MainFrame.hpp | 3 + 15 files changed, 1166 insertions(+), 978 deletions(-) diff --git a/docs/CAD/design_tab.md b/docs/CAD/design_tab.md index 1be0a2ea33..170c5ed0ce 100644 --- a/docs/CAD/design_tab.md +++ b/docs/CAD/design_tab.md @@ -47,8 +47,9 @@ tool"*. It is also where a refusal explains itself. ## The offer -Right-click on the geometry, released without moving the mouse (an 8 px budget — a -right-drag that orbits the camera does not open it). Left-click still only selects, so +Right-click on the geometry, released without moving the mouse (a 3 px budget — a +right-drag that orbits the camera does not open it). How long the button is held does not +matter. Left-click still only selects, so pointing at things stays quiet. The offer also opens by itself the moment you press Sketch on a face or plane, showing the diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index 8db2afbbc2..a3842b2223 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -135,6 +135,8 @@ DesignCanvas::DesignCanvas(wxWindow* parent) [this, commit](double v) { m_sketch_tool.set_inline_busy(false); if (commit) commit(v); + // A refused value re-opens the same field (SketchInlineEditor::refuse). + if (m_inline_editor && m_inline_editor->is_open()) m_sketch_tool.set_inline_busy(true); request_repaint(); }, [this, cancel]() { @@ -941,11 +943,6 @@ void DesignCanvas::set_on_solid_selection_changed(std::function cb) -{ - m_sketch_tool.on_place_on_face = std::move(cb); -} - void DesignCanvas::select_body(int body) { m_sketch_tool.select_body(body); @@ -1058,9 +1055,9 @@ void DesignCanvas::set_on_sketch_exit_refused(std::function cb) m_sketch_tool.on_exit_refused = std::move(cb); } -void DesignCanvas::set_on_move_exit(std::function cb) +void DesignCanvas::set_on_sketch_notice(std::function cb) { - m_sketch_tool.on_move_exit = std::move(cb); + m_sketch_tool.on_notice = std::move(cb); } void DesignCanvas::set_on_context_menu(std::function cb) @@ -1074,25 +1071,26 @@ void DesignCanvas::set_on_context_menu(std::function cb) // through to the polyline-chain end and the move gizmo, which were there first. // Right-drag pans. Without remembering where the press landed, every pan ended by popping // the offer over wherever the camera stopped — the menu appearing as the reward for moving - // the view. The offer is the release of a STATIONARY right-click, at the same 8 px budget - // the left-click pick uses. + // the view. The offer is the release of a STATIONARY right-click (kCadRightClickDriftPx). m_canvas_widget->Bind(wxEVT_RIGHT_DOWN, [this](wxMouseEvent& e) { - m_ctx_press = e.GetPosition(); - m_ctx_press_ms = wxGetLocalTimeMillis().GetValue(); + m_ctx_press = e.GetPosition(); + m_ctx_travelled = false; e.Skip(); // the canvas still needs the press to seed the orbit }); + m_canvas_widget->Bind(wxEVT_MOTION, [this](wxMouseEvent& e) { + if (e.RightIsDown()) { + const wxPoint d = e.GetPosition() - m_ctx_press; + if (std::max(std::abs(d.x), std::abs(d.y)) > kCadRightClickDriftPx) m_ctx_travelled = true; + } + e.Skip(); + }); m_canvas_widget->Bind(wxEVT_RIGHT_UP, [this](wxMouseEvent& e) { const wxPoint d = e.GetPosition() - m_ctx_press; - const long long dt = wxGetLocalTimeMillis().GetValue() - m_ctx_press_ms; // Always read-and-clear, even when another guard already rules the offer out, or a // terminator recorded under one condition would still be pending under the next. const bool terminated = m_sketch_tool.take_right_consumed(); - // Click, or navigation? Both budgets must hold: a press that travelled orbited, and a - // press that was HELD was aiming to orbit even if the hand never quite moved. Two - // independent budgets because the two failure modes are independent — the drift one - // alone still popped a menu at the end of a slow, careful orbit. - const bool is_click = std::max(std::abs(d.x), std::abs(d.y)) <= kCadRightClickDriftPx - && dt <= kCadRightClickMs; + // Click, or navigation? A press that travelled orbited; one that did not, did not. + const bool is_click = !m_ctx_travelled && std::max(std::abs(d.x), std::abs(d.y)) <= kCadRightClickDriftPx; if (m_on_context_menu && !terminated && !inline_busy() && is_click) { // The menu belongs to what you POINTED AT — and pointing happened at the PRESS, not // at the release, so the raycast uses the press position. Within a 3 px budget the @@ -1110,11 +1108,6 @@ void DesignCanvas::set_on_context_menu(std::function cb) }); } -void DesignCanvas::set_on_undo_redo(std::function cb) -{ - m_sketch_tool.on_undo_redo = std::move(cb); -} - void DesignCanvas::set_display_sketches(std::vector ds) { m_sketch_tool.set_display_sketches(std::move(ds)); @@ -1352,10 +1345,12 @@ void DesignCanvas::set_body_hidden(bool on) reload(true); // hides/show base bodies + flips the ghost opaque/faint for preview-only mode } -void DesignCanvas::delete_selected_sketch_entities() +bool DesignCanvas::delete_selected_sketch_entities() { + if (m_sketch_tool.selection().empty()) return false; m_sketch_tool.delete_selected(); request_repaint(); + return true; } bool DesignCanvas::inline_busy() const @@ -1394,16 +1389,16 @@ bool DesignCanvas::live_sketch_has_work() const return m_sketch_tool.live_sketch_has_work(); } -bool DesignCanvas::undo_last_sketch_entity() +bool DesignCanvas::redo_last_sketch_entity() { - const bool did = m_sketch_tool.undo_last_entity(); + const bool did = m_sketch_tool.redo_last_entity(); if (did) request_repaint(); return did; } -bool DesignCanvas::delete_selected_or_last_sketch_entity() +bool DesignCanvas::undo_last_sketch_entity() { - const bool did = m_sketch_tool.delete_selected_or_last(); + const bool did = m_sketch_tool.undo_last_entity(); if (did) request_repaint(); return did; } @@ -1450,6 +1445,7 @@ void DesignCanvas::open_inline_value(double current, std::function [this, commit](double v) { m_sketch_tool.set_inline_busy(false); if (commit) commit(v); + if (m_inline_editor && m_inline_editor->is_open()) m_sketch_tool.set_inline_busy(true); request_repaint(); }, [this, cancel]() { @@ -1560,6 +1556,13 @@ bool DesignCanvas::sketch_abort_gesture() return true; } +bool DesignCanvas::sketch_confirm_pending() +{ + if (!m_sketch_tool.confirm_pending()) return false; + request_repaint(); + return true; +} + bool DesignCanvas::sketch_disarm_tool() { if (!m_sketch_tool.disarm_tool()) return false; @@ -1569,7 +1572,7 @@ bool DesignCanvas::sketch_disarm_tool() bool DesignCanvas::drawing_in_progress() const { - return m_sketch_tool.pending_points() > 0; + return m_sketch_tool.gesture_pending(); } bool DesignCanvas::has_any_selection() const diff --git a/src/slic3r/GUI/CAD/DesignCanvas.hpp b/src/slic3r/GUI/CAD/DesignCanvas.hpp index fab2e556e3..026d4a524d 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.hpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.hpp @@ -122,7 +122,6 @@ public: const std::vector* visible = nullptr, const std::vector* xform = nullptr); void set_on_solid_selection_changed(std::function cb); - void set_on_place_on_face(std::function cb); // F key: Place on Face void select_body(int body); // Parts-list -> highlight a whole body by index // Effective display colour of a body: the per-body override (Color tool) when set, // otherwise the auto body-index palette. Single source of truth shared with reload(). @@ -213,7 +212,7 @@ public: void set_on_datum_base_picked(std::function cb); void set_on_sketch_exit(std::function cb); // Esc -> exit the tool void set_on_sketch_exit_refused(std::function cb); // Esc declined: sketch has work - void set_on_undo_redo(std::function cb); // Ctrl+Z / Ctrl+Shift+Z + void set_on_sketch_notice(std::function cb); // tool refusals/side effects // Persistently draw committed sketches (un-consumed ones stay visible). void set_display_sketches(std::vector ds); void set_highlight_sketches(std::vector> hl); @@ -235,13 +234,12 @@ public: void set_body_translucent(bool on); // render the solid see-through (fillet/chamfer preview) void set_xray_focus(int body); // >=0: fade+lock out every other body (CoordSys picking) void set_body_hidden(bool on); // preview-only: hide base bodies, show only the result ghost - void set_on_move_exit(std::function cb); // right-click finished the move-body gizmo // Right-click (or its platform equivalent) on the viewport with no tool running: open the // object-driven offer there. Fires with SCREEN coordinates. Deliberately NOT fired while a // tool is live — right-click already ends a polyline chain and finishes the move gizmo, and // taking those over would break two working interactions in order to add a third. void set_on_context_menu(std::function cb); - void delete_selected_sketch_entities(); + bool delete_selected_sketch_entities(); // false when nothing was selected bool inline_busy() const; // a sketch value field is open (guard keys) bool inline_has_focus() const; // the field itself holds keyboard focus void inline_commit(); // accept the typed value (Enter/Tab) @@ -251,8 +249,10 @@ public: // panel can do it when focus is not on the canvas. void request_sketch_exit(); bool live_sketch_has_work() const; // the live sketch holds entities a cancel would destroy - bool undo_last_sketch_entity(); // Ctrl+Z in a sketch: drop the last entity - bool delete_selected_or_last_sketch_entity(); // Delete in a sketch: selected, else last + bool undo_last_sketch_entity(); // Ctrl+Z in a sketch: drop the last drawn shape + bool redo_last_sketch_entity(); // Ctrl+Y in a sketch: bring it back + bool can_undo_sketch_entity() const { return m_sketch_tool.can_undo_entity(); } + bool can_redo_sketch_entity() const { return m_sketch_tool.can_redo_entity(); } void clear_sketch_selection(); // View toggles (keys P / A): origin planes, world axis triad. Each returns the new on/off @@ -299,9 +299,10 @@ public: // Esc routing (DesignInteraction.hpp). The panel decides WHICH level one press belongs to; // these are the levels it can act on inside the canvas. Each returns whether it did anything, // so the panel can fall through to the next level without asking twice. - bool sketch_abort_gesture(); // CadLevel::Gesture — drop the entity being drawn + bool sketch_abort_gesture(); // CadLevel::Gesture — drop the entity being drawn, or the tool's picks bool sketch_disarm_tool(); // CadLevel::Tool — armed sketch tool falls back to Select - bool drawing_in_progress() const;// an entity has clicks down but is not committed + bool sketch_confirm_pending(); // Enter — apply a ready edit-op or transform + bool drawing_in_progress() const;// clicks or picks are down but nothing is committed yet bool has_any_selection() const; // model pick or sketch pick bool clear_any_selection(); // CadLevel::Idle — drop both; true if anything was dropped bool sketch_first_selected_type(SketchEntity::Type& out) const; @@ -367,7 +368,8 @@ private: std::function m_on_context_menu; bool m_ctx_bound{false}; // bind the RIGHT_UP handler once, however often the cb is set wxPoint m_ctx_press{0, 0}; // right-press origin: a right-DRAG orbits, it must not offer - long long m_ctx_press_ms{0}; // and a right-HOLD is navigation too, however still it is held + bool m_ctx_travelled{false}; // the right press wandered past the budget at ANY point, + // so an orbit that ends where it began is still an orbit Bed3D m_bed; // The half of the camera swap above that is NOT on screen: the editor tabs' view while diff --git a/src/slic3r/GUI/CAD/DesignInteraction.hpp b/src/slic3r/GUI/CAD/DesignInteraction.hpp index d849b779e4..67a80bd494 100644 --- a/src/slic3r/GUI/CAD/DesignInteraction.hpp +++ b/src/slic3r/GUI/CAD/DesignInteraction.hpp @@ -48,10 +48,10 @@ static_assert(cad_escape_level({false, false, true, true}) == CadLevel::Tool, static_assert(cad_escape_level({false, false, false, true}) == CadLevel::Idle, "selection is idle-level"); static_assert(cad_escape_level({false, false, false, false}) == CadLevel::Idle, "empty is idle"); -// Right-click vs. right-hold-orbit. A press that stays put and is let go promptly is a click and -// summons the offer; anything longer or further was navigation, and navigation must never be -// rewarded with a menu over wherever the camera happened to stop. -inline constexpr int kCadRightClickMs = 200; // press->release budget +// Right-click vs. right-drag-orbit. A press that stays put summons the offer; one that travelled +// was navigation, and navigation must never be rewarded with a menu over wherever the camera +// happened to stop. Distance only, never duration: charter 6.2 rules out any gesture that +// depends on timing, and a press that did not move did not move the camera either. inline constexpr int kCadRightClickDriftPx = 3; // cursor drift budget, max(|dx|,|dy|) }} // namespace Slic3r::GUI diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index d247ddfd26..097d79a343 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -276,25 +276,6 @@ static SketchPlane face_plane_inward(const TopoDS_Face& face) return p; } -// Highest upward-facing planar face of a solid — the surface the user is looking down on. -// Hole placement defaults here (instead of the z=0 datum) so the footprint sits on the top -// face at the right depth, not on the model's underside where a top-view drag reads parallax- -// shifted. Returns -1 if the shape has no clearly-upward face. -static int top_face_index_of(const TopoDS_Shape& shape) -{ - int best = -1; double bestz = -1e30; - const int n = GeometryEngine::face_count(shape); - for (int i = 0; i < n; ++i) { - const TopoDS_Face f = GeometryEngine::face_by_index(shape, i); - if (f.IsNull()) continue; - const Vec3d nrm = GeometryEngine::face_normal_world(f); - if (nrm.z() < 0.5) continue; // only faces pointing substantially up - const Vec3d c = GeometryEngine::face_centroid_world(f); - if (c.z() > bestz) { bestz = c.z(); best = i; } - } - return best; -} - DesignPanel::DesignPanel(wxWindow* parent) : wxPanel(parent, wxID_ANY) { @@ -393,10 +374,8 @@ DesignPanel::DesignPanel(wxWindow* parent) m_viewport->set_sketch_tool(mode); } m_viewport->set_sketch_construction(m_construction->GetValue()); - m_status->SetForegroundColour(wxNullColour); - set_status(m_sketch_on.IsEmpty() ? hint + set_status(StatusKind::Info, m_sketch_on.IsEmpty() ? hint : wxString::Format(_L("%s · on %s"), hint, m_sketch_on)); - m_status->Refresh(); }; // Sketch-tool shortcuts (single letters, active only while a sketch is open). Family tools @@ -446,9 +425,7 @@ DesignPanel::DesignPanel(wxWindow* parent) // exactly normal. Sketch map only: in Feature mode the navigator orb owns orientation. m_keys_sketch['N'] = [this] { if (m_viewport && m_viewport->view_normal_to_sketch()) { - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Normal to the sketch plane")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Normal to the sketch plane")); } }; m_keys_sketch['Q'] = [this] { @@ -474,9 +451,7 @@ DesignPanel::DesignPanel(wxWindow* parent) // View toggles (single letters, active when no sketch is open): P origin planes, A world // axes, X section view (Alt+Wheel slides the cut). Distinct from Shift+P/Shift+X features. auto status_flag = [this](const wxString& on_msg, const wxString& off_msg, bool on) { - m_status->SetForegroundColour(wxNullColour); - set_status(on ? on_msg : off_msg); - m_status->Refresh(); + set_status(StatusKind::Info, on ? on_msg : off_msg); }; m_keys_feature['P'] = [this, status_flag] { if (m_viewport) status_flag(_L("Origin planes shown"), _L("Origin planes hidden"), @@ -487,6 +462,9 @@ DesignPanel::DesignPanel(wxWindow* parent) m_viewport->toggle_axes()); }; m_keys_feature['X'] = [this] { toggle_section_view(); }; // toggle the single section on/off + // F: Place on Face. Lives in this map, not in the canvas, so it works whatever holds focus + // (charter 6.2). While the section view is on, F flips the kept half instead (handled above). + m_keys_feature['F'] = [this] { place_on_face(); }; // Home: axonometric view, fitted to the model. // @@ -640,11 +618,9 @@ DesignPanel::DesignPanel(wxWindow* parent) set_ui_mode(UiMode::Sketch); wxString where; const bool have_plane = sketch_plane_target(where); - m_status->SetForegroundColour(wxNullColour); - set_status(have_plane + set_status(StatusKind::Info, have_plane ? wxString::Format(_L("Sketching on %s — pick a tool"), where) : _L("Click a face or a reference plane in the viewport, then a sketch tool")); - m_status->Refresh(); if (m_sketch_hint) { // the card must agree with the status line, not argue with it m_sketch_hint->SetLabel(have_plane ? wxString::Format(_L("Drawing on %s.\nPick a tool, or press Menu for the list."), where) @@ -678,9 +654,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_extrude_face_src = -1; // ordinary sketch/loop extrude m_extrude_sketch_ref = resolve_extrude_sketch(); if (m_extrude_sketch_ref < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create a sketch, or pick a solid face, first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create a sketch, or pick a solid face, first")); return; } open_tool(Tool::Extrude); @@ -689,9 +663,7 @@ DesignPanel::DesignPanel(wxWindow* parent) [this] { m_revolve_sketch_ref = resolve_extrude_sketch(); if (m_revolve_sketch_ref < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create a sketch profile to revolve first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create a sketch profile to revolve first")); return; } open_tool(Tool::Revolve); @@ -701,9 +673,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_sweep_profile_ref = resolve_extrude_sketch(); m_sweep_path_ref = -1; // fresh sweep: default the picker to the first sketch if (m_sweep_profile_ref < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create a profile sketch to sweep first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create a profile sketch to sweep first")); return; } open_tool(Tool::Sweep); @@ -715,9 +685,7 @@ DesignPanel::DesignPanel(wxWindow* parent) for (const auto& f : m_doc.features) if (f.type == CadFeatureType::Sketch) ++n; if (n < 2) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create at least two profile sketches to loft")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create at least two profile sketches to loft")); return; } m_loft_refs.clear(); // fresh loft: nothing pre-checked @@ -726,9 +694,7 @@ DesignPanel::DesignPanel(wxWindow* parent) {"design_thicken", _L("Thicken"), _L("Offset a solid face into a thin plate (new body)"), [this] { if (m_doc.bodies.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Thicken needs a solid body — add or import one first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Thicken needs a solid body — add or import one first")); return; } { @@ -756,9 +722,7 @@ DesignPanel::DesignPanel(wxWindow* parent) {"design_rib", _L("Rib"), _L("Grow a thin wall from an open sketch line, fused to a body"), [this] { if (m_doc.bodies.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Rib needs a solid body — add or import one first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Rib needs a solid body — add or import one first")); return; } { @@ -784,9 +748,7 @@ DesignPanel::DesignPanel(wxWindow* parent) } if (m_rib_sketch->GetCount() > 0) m_rib_sketch->SetSelection(0); else { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create a sketch with an open line first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create a sketch with an open line first")); return; } } @@ -801,9 +763,7 @@ DesignPanel::DesignPanel(wxWindow* parent) std::function act_pattern = [this] { // Pattern replicates an existing body — needs at least one solid. if (m_doc.bodies.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create a solid body to pattern first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create a solid body to pattern first")); return; } open_tool(Tool::Pattern); @@ -823,9 +783,7 @@ DesignPanel::DesignPanel(wxWindow* parent) [this] { m_surf_extrude_sketch_ref = resolve_extrude_sketch(); if (m_surf_extrude_sketch_ref < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create a sketch first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create a sketch first")); return; } open_tool(Tool::SurfaceExtrude); @@ -834,9 +792,7 @@ DesignPanel::DesignPanel(wxWindow* parent) [this] { m_surf_revolve_sketch_ref = resolve_extrude_sketch(); if (m_surf_revolve_sketch_ref < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create a sketch profile to revolve first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create a sketch profile to revolve first")); return; } open_tool(Tool::SurfaceRevolve); @@ -847,9 +803,7 @@ DesignPanel::DesignPanel(wxWindow* parent) for (const auto& f : m_doc.features) if (f.type == CadFeatureType::Sketch) ++n; if (n < 2) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create at least two profile sketches to loft")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create at least two profile sketches to loft")); return; } m_surf_loft_refs.clear(); @@ -859,9 +813,7 @@ DesignPanel::DesignPanel(wxWindow* parent) [this] { m_surf_fill_sketch_ref = resolve_extrude_sketch(); if (m_surf_fill_sketch_ref < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create a sketch profile to fill first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create a sketch profile to fill first")); return; } open_tool(Tool::SurfaceFill); @@ -870,9 +822,7 @@ DesignPanel::DesignPanel(wxWindow* parent) [this] { populate_sheet_body_choices(m_surf_offset_body); if (m_surf_offset_body->GetCount() == 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("No sheet body to offset — create a surface feature first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("No sheet body to offset — create a surface feature first")); return; } open_tool(Tool::SurfaceOffset); @@ -881,9 +831,7 @@ DesignPanel::DesignPanel(wxWindow* parent) [this] { populate_sheet_body_choices(m_surf_thicken_body); if (m_surf_thicken_body->GetCount() == 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("No sheet body to thicken — create a surface feature first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("No sheet body to thicken — create a surface feature first")); return; } open_tool(Tool::ThickenSurface); @@ -919,9 +867,7 @@ DesignPanel::DesignPanel(wxWindow* parent) {"design_sketch", _L("Project"), _L("Project body edges onto a plane as sketch entities"), [this] { if (m_doc.bodies.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Project needs a body — add or import one first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Project needs a body — add or import one first")); return; } { @@ -935,8 +881,14 @@ DesignPanel::DesignPanel(wxWindow* parent) int(m_proj_source_body->GetCount()) - 1)); } populate_plane_choices(m_proj_plane); - m_sel_solid_face = -1; - m_proj_face_label->SetLabel(_L("(all edges)")); + // Keep what the user pointed at (L3): a picked face on the source body is the + // face to project, exactly as the offer promised when it showed Project on it. + // Only a pick on ANOTHER body is dropped, since it cannot belong to this source. + const int src = m_proj_source_body->GetSelection(); + if (m_sel_solid_face >= 0 && m_sel_solid_body != src) m_sel_solid_face = -1; + m_proj_face_label->SetLabel(m_sel_solid_face >= 0 + ? wxString::Format(_L("Face %d"), m_sel_solid_face) + : _L("(all edges)")); open_tool(Tool::Project); }, 0}, }); @@ -952,9 +904,7 @@ DesignPanel::DesignPanel(wxWindow* parent) {"design_move", _L("Transform"), _L("Move and/or rotate an existing body"), [this] { if (m_doc.bodies.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Transform needs a body — add or import one first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Transform needs a body — add or import one first")); return; } { @@ -972,9 +922,7 @@ DesignPanel::DesignPanel(wxWindow* parent) {"design_mirror", _L("Mirror"), _L("Reflect a body about a plane"), [this] { if (m_doc.bodies.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Mirror needs a body — add or import one first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Mirror needs a body — add or import one first")); return; } { @@ -1008,9 +956,7 @@ DesignPanel::DesignPanel(wxWindow* parent) std::function act_cut = [this] { // A plane cut needs at least one solid to slice. if (m_doc.bodies.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Create a solid body to cut first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Create a solid body to cut first")); return; } populate_plane_choices(m_cut_plane); @@ -1050,9 +996,7 @@ DesignPanel::DesignPanel(wxWindow* parent) const wxTreeItemId row = m_tree_items[sel]; CallAfter([this, row] { m_tree->SetFocus(); m_tree->EditLabel(row); }); } else { - m_status->SetForegroundColour(wxNullColour); // "nothing selected" is not an error - set_status(_L("Select a feature, or a body, first — then rename it")); - m_status->Refresh(); + set_status(_L("Select a feature, or a body, first — then rename it")); // not an error } }; m_verb_actions["btn:rename"] = rename_feature; @@ -1093,9 +1037,7 @@ DesignPanel::DesignPanel(wxWindow* parent) {"design_delete", _L("Delete Face"), _L("Remove faces from a body and heal the solid"), [this] { if (m_doc.bodies.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Delete Face needs a body — add or import one first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Delete Face needs a body — add or import one first")); return; } { @@ -1125,13 +1067,13 @@ DesignPanel::DesignPanel(wxWindow* parent) m_hole_face_body = -1; m_hole_has_bounds = false; set_hole_target_label(-1); - // Use the explicitly-picked face; otherwise default to the top face of the - // selected (or first) body so the hole lands on the surface being viewed, not - // the z=0 datum under the model. The XY/XZ/YZ dropdown still overrides. - int hb = m_sel_solid_body, hf = m_sel_solid_face; - if (hf < 0 && !m_doc.bodies.empty()) { - hb = (hb >= 0 && hb < int(m_doc.bodies.size())) ? hb : 0; - hf = top_face_index_of(m_doc.bodies[hb].shape); + // The hole goes where the user pointed (L1): a picked face. The keyboard route + // used to invent one — the top face of the first body — while the offer refused + // the same verb with nothing picked; both routes now say the same thing. + const int hb = m_sel_solid_body, hf = m_sel_solid_face; + if (hf < 0 || hb < 0 || hb >= int(m_doc.bodies.size())) { + set_status(StatusKind::Error, _L("Pick a face or a plane to drill into")); + return; } if (hf >= 0 && hb >= 0 && hb < int(m_doc.bodies.size())) { const TopoDS_Face face = GeometryEngine::face_by_index( @@ -1185,15 +1127,16 @@ DesignPanel::DesignPanel(wxWindow* parent) m_thread_face_body = m_sel_solid_body; set_thread_target_label(from_face ? m_sel_solid_face : -1, from_face ? -1 : m_sel_solid_edge); - infer_thread_spec(2.0 * cf.radius); // M diameter + pitch + depth from the cylinder - if (m_thread_height && cf.height > 1e-6) m_thread_height->SetValue(cf.height); if (m_thread_internal) m_thread_internal->SetValue(cf.internal); + infer_thread_spec(2.0 * cf.radius, cf.internal); // M size + pitch + depth from the cylinder + if (m_thread_height && cf.height > 1e-6) m_thread_height->SetValue(cf.height); if (m_thread_x) m_thread_x->SetValue(0.0); // on the axis if (m_thread_y) m_thread_y->SetValue(0.0); } else if (m_sel_solid_face >= 0 || m_sel_solid_edge >= 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Pick a cylindrical surface (bore / outer) or a circular edge for a thread")); - m_status->Refresh(); + // Refuse and stay closed: opening the card anyway overwrote this reason with + // the preview's status one line later, and left a thread card with no target. + set_status(StatusKind::Error, _L("Pick a cylindrical surface (bore / outer) or a circular edge for a thread")); + return; } open_tool(Tool::Thread); }, SHIFT('T')}, @@ -1323,7 +1266,7 @@ DesignPanel::DesignPanel(wxWindow* parent) // (separator dropped: the group it divided is now reached from the offer) dropdown("design_line", _L("Line / polyline"), { {"design_line", DesignSketchTool::Mode::Line, _L("Line"), _L("Click start, then end — then set the exact length")}, - {"design_polyline", DesignSketchTool::Mode::Polyline, _L("Polyline"), _L("Click points; click first / right-click to close the loop")} }); + {"design_polyline", DesignSketchTool::Mode::Polyline, _L("Polyline"), _L("Click points; click the first point to close the loop, right-click or Enter to end the chain")} }); dropdown("design_rect", _L("Rectangle"), { {"design_rect", DesignSketchTool::Mode::CornerRect, _L("Corner rectangle"), _L("Click two opposite corners")}, {"design_crect", DesignSketchTool::Mode::CenterRect, _L("Center rectangle"), _L("Click center, then a corner")}, @@ -1344,7 +1287,7 @@ DesignPanel::DesignPanel(wxWindow* parent) {"design_ellipse", DesignSketchTool::Mode::Ellipse, _L("Ellipse"), _L("Click center, a major-axis end, then a point for the minor axis")}, {"design_ellipse_arc", DesignSketchTool::Mode::EllipseArc, _L("Elliptical arc"), _L("Click center, major-axis end, minor point, then arc start and end")} }); skbtn("design_bspline", DesignSketchTool::Mode::BSpline, _L("Spline"), - _L("Click control points; double-click or right-click to finish")); + _L("Click control points; double-click, right-click or Enter to finish")); skbtn("design_point", DesignSketchTool::Mode::Point, _L("Point"), _L("Click to place a point")); // (separator dropped: the group it divided is now reached from the offer) @@ -1391,9 +1334,9 @@ DesignPanel::DesignPanel(wxWindow* parent) // Trim / Extend scissors — standalone sketch tools (NOT inside Constrain): click a // segment to cut it back to / out to its nearest intersection. One cut per click. skbtn("design_trim", DesignSketchTool::Mode::Trim, _L("Trim"), - _L("Click a segment to trim it back to its nearest intersection; right-click exits")); + _L("Click a segment to trim it back to its nearest intersection; Esc exits")); skbtn("design_extend", DesignSketchTool::Mode::Extend, _L("Extend"), - _L("Click a line or arc to extend it to the nearest entity; right-click exits")); + _L("Click a line or arc to extend it to the nearest entity; Esc exits")); // Constrain — grouped with the edit tools so it's easy to find (nde #13: it was buried // far-right next to Construction and went unnoticed). Commits the live sketch in place // and drops into Constrain mode (geometric/dimensional palette). @@ -1449,13 +1392,17 @@ DesignPanel::DesignPanel(wxWindow* parent) if (m_dressup_type) m_dressup_type->SetSelection(0); open_feature(k_dress); }; m_verb_actions["btn:dress#1"] = [this, open_feature] { if (m_dressup_type) m_dressup_type->SetSelection(1); open_feature(k_dress); }; + // Same order for all three families: choose the variant, then open, so the card, its + // header and the first preview are built for the variant that was picked (a circular + // pattern used to open showing the linear ghost and gizmo). for (int op = 0; op < 3; ++op) m_verb_actions["btn:bool#" + std::to_string(op)] = [this, open_feature, op] { - open_feature(k_bool); - if (m_bool_op) { m_bool_op->SetSelection(op); refresh_preview(); } }; + if (m_bool_op) m_bool_op->SetSelection(op); // the variant first, so the card opens on it + open_feature(k_bool); }; for (int t = 0; t < 2; ++t) m_verb_actions["btn:pat#" + std::to_string(t)] = [this, open_feature, t] { - open_feature(k_pat); if (m_pattern_type) m_pattern_type->SetSelection(t); }; + if (m_pattern_type) m_pattern_type->SetSelection(t); + open_feature(k_pat); }; auto* b_poly = icon_btn("design_polygon", _L("Polygon")); b_poly->Bind(wxEVT_BUTTON, [arm_polygon](wxCommandEvent&) { arm_polygon(); }); @@ -1482,11 +1429,9 @@ DesignPanel::DesignPanel(wxWindow* parent) ? m_viewport->toggle_sketch_construction_selection() : 0; if (n > 0) { m_construction->SetValue(!m_construction->GetValue()); // the mode did not move - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format( + set_status(StatusKind::Info, wxString::Format( _L("Converted %d entit%s between construction and real geometry"), n, n == 1 ? "y" : "ies")); - m_status->Refresh(); return; } m_viewport->set_sketch_construction(m_construction->GetValue()); }); @@ -1996,8 +1941,9 @@ DesignPanel::DesignPanel(wxWindow* parent) m_thread_internal = new CheckBox(m_cards); m_thread_internal->SetValue(false); - // External rod uses the major radius; an internal tapped bore uses the minor - // (tap-drill) radius — re-derive the nominal radius when the role flips. + // The diameter field is the NOMINAL (major) diameter either way; what the role changes is + // the depth — an internal thread's groove runs from the tap-drill (minor) diameter out to + // the major one, an external one's from the major in to the root — so re-derive it. m_thread_internal->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& e) { apply_thread_standard(); e.Skip(); @@ -2644,17 +2590,13 @@ DesignPanel::DesignPanel(wxWindow* parent) // Say why nothing happened. Clicking with no face picked used to be a silent no-op, // which is indistinguishable from the button being broken. if (m_sel_solid_face < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Click a face on the body first, then Add picked face")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Click a face on the body first, then Add picked face")); return; } // Adding the same face twice puts a duplicate id in delete_faces, which the // defeaturing algorithm has no reason to cope with. Re-clicking is a no-op, not an error. if (std::find(m_del_faces.begin(), m_del_faces.end(), m_sel_solid_face) != m_del_faces.end()) { - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(_L("Face %d is already in the list"), m_sel_solid_face)); - m_status->Refresh(); + set_status(StatusKind::Info, wxString::Format(_L("Face %d is already in the list"), m_sel_solid_face)); return; } { @@ -3109,16 +3051,12 @@ DesignPanel::DesignPanel(wxWindow* parent) // one click away on a row the user has just selected — the message points at it instead // of describing a problem with no way out. if (const std::string* why = (sel >= 0) ? mate_conflict_reason(sel) : nullptr) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(wxString::FromUTF8(*why) + _L(" — the eye suppresses this mate")); - m_status->Refresh(); + set_status(StatusKind::Error, wxString::FromUTF8(*why) + _L(" — the eye suppresses this mate")); } else if (sel >= 0 && sel < int(m_doc.features.size())) { // Name the two gestures the row supports, because neither is visible on it. - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format( + set_status(StatusKind::Info, wxString::Format( _L("%s selected — F2 or right-click renames it, double-click edits it"), wxString::FromUTF8(m_doc.features[sel].name))); - m_status->Refresh(); } }); @@ -3298,9 +3236,7 @@ DesignPanel::DesignPanel(wxWindow* parent) if (m_sel_solid_body >= 0 && m_sel_solid_body < int(m_doc.bodies.size())) { on_move_body(); } else { - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Select a body row first, then move it")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Select a body row first, then move it")); } }); // Boolean lives here as well as on the toolbar: combining two bodies is a body action, @@ -3355,9 +3291,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_sel_solid_face = m_sel_solid_edge = -1; m_sel_solid_vertex = false; m_pick_face = m_pick_face_body = -1; // chosen from the list, no face was pointed at - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(_L("Body %d selected — right-click for what applies to it"), b + 1)); - m_status->Refresh(); + set_status(StatusKind::Info, wxString::Format(_L("Body %d selected — right-click for what applies to it"), b + 1)); }; m_parts->Bind(wxEVT_TREE_SEL_CHANGED, [this, apply_body_row](wxTreeEvent&) { apply_body_row(tree_body_selection()); @@ -3533,8 +3467,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_feature_counter++; m_doc.add_sketch_profile(prof, plane, "Sketch" + std::to_string(m_feature_counter)); m_doc.recompute(); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Sketch created — select it, then right-click to Extrude")); + set_status(StatusKind::Info, _L("Sketch created — select it, then right-click to Extrude")); refresh_tree(); }); @@ -3543,9 +3476,7 @@ DesignPanel::DesignPanel(wxWindow* parent) const std::vector& cons, const SketchPlane& plane) { if (ents.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Sketch empty — nothing committed")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Sketch empty — nothing committed")); return; } m_doc.checkpoint(); // undo boundary: committing / re-editing an entity sketch @@ -3560,8 +3491,7 @@ DesignPanel::DesignPanel(wxWindow* parent) if (m_doc.replace_feature(m_edit_index, edited)) { if (!cons.empty()) m_doc.solve_sketch_feature(m_edit_index); m_doc.recompute(); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Sketch updated")); + set_status(StatusKind::Info, _L("Sketch updated")); m_edit_index = -1; refresh_tree(); sync_sketch_display(); @@ -3573,8 +3503,7 @@ DesignPanel::DesignPanel(wxWindow* parent) "Sketch" + std::to_string(m_feature_counter), cons); if (!cons.empty()) m_doc.solve_sketch_feature(sk); // enforce driving dimensions m_doc.recompute(); - m_status->SetForegroundColour(wxNullColour); - set_status(cons.empty() + set_status(StatusKind::Info, cons.empty() ? _L("Sketch created — select it, then right-click to Extrude") : wxString::Format(_L("Sketch created (%zu driving dims) — select it, then right-click to Extrude"), cons.size())); @@ -3585,7 +3514,6 @@ DesignPanel::DesignPanel(wxWindow* parent) // Live length/angle readout while drawing a Line/Polyline segment. m_viewport->set_on_cursor_metrics([this](double len, double ang_deg, bool locked) { double a = ang_deg; if (a < 0.0) a += 360.0; // show bearing 0..360 - m_status->SetForegroundColour(wxNullColour); // APPENDED to the step guidance, never in place of it. This fires on every mouse move // while a segment is being dragged, so replacing the line wiped the instruction for the // step the user is in the middle of — one mouse move after the click that armed it. @@ -3617,6 +3545,7 @@ DesignPanel::DesignPanel(wxWindow* parent) // Constrain to read stays blank until they happen to change something. m_dof_last = dof; m_dof_last_ok = ok; m_dof_last_has = has_constraints; apply_dof_status(dof, ok, has_constraints); + update_undo_redo_buttons(); // every edit of the live sketch re-solves, so this tracks it }); // Selection no longer writes the status line: on_sketch_step owns it, says the same thing @@ -3631,9 +3560,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_viewport->finish_sketch(); // commit live sketch (synchronous) m_extrude_sketch_ref = resolve_extrude_sketch(); if (m_extrude_sketch_ref < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Could not resolve the sketch to extrude")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Could not resolve the sketch to extrude")); return; } set_ui_mode(UiMode::Feature); @@ -3645,9 +3572,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_sel_solid_face = m_sel_solid_edge = -1; m_pick_face = m_pick_face_body = -1; m_viewport->set_loop_pick(m_extrude_sketch_ref, region); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Face selected — set the depth and Confirm")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Face selected — set the depth and Confirm")); }); // Clicking a committed sketch loop on the plate (no live session) selects THAT loop: @@ -3705,13 +3630,11 @@ DesignPanel::DesignPanel(wxWindow* parent) } } set_tree_selection(feat); - m_status->SetForegroundColour(wxNullColour); - set_status(region >= 0 + set_status(StatusKind::Info, region >= 0 // "Region", not "Loop": what is selected — and what Extrude will consume — is the // bounded area including any holes in it, not a single closed curve. ? _L("Region selected — right-click to Extrude, or double-click to edit") : _L("Sketch selected — right-click to Extrude, or double-click to edit")); - m_status->Refresh(); }); // Double-click a committed sketch stroke: open THAT sketch for editing, where its entities @@ -3728,7 +3651,6 @@ DesignPanel::DesignPanel(wxWindow* parent) // F key (Prepare's Place on Face): the tool forwards it here when the Design viewport // has focus; we lay the selected body face on the bed. Returns false when no face is // selected so the key can fall through to the default handler. - m_viewport->set_on_place_on_face([this]() { return place_on_face(); }); // Clicking a solid cycles whole -> face -> edge. The tool draws the cyan overlay for ALL // levels now (per-body, so other bodies stay untinted) — no whole-compound set_body_highlight. @@ -3857,9 +3779,9 @@ DesignPanel::DesignPanel(wxWindow* parent) m_thread_on_face = true; m_thread_face_body = m_sel_solid_body; set_thread_target_label(from_face ? face : -1, from_face ? -1 : edge); - infer_thread_spec(2.0 * cf.radius); // M diameter + pitch + depth from the cylinder - if (m_thread_height && cf.height > 1e-6) m_thread_height->SetValue(cf.height); if (m_thread_internal) m_thread_internal->SetValue(cf.internal); + infer_thread_spec(2.0 * cf.radius, cf.internal); // M size + pitch + depth from the cylinder + if (m_thread_height && cf.height > 1e-6) m_thread_height->SetValue(cf.height); refresh_preview(); } } @@ -3911,7 +3833,6 @@ DesignPanel::DesignPanel(wxWindow* parent) } if (got && m_viewport) m_viewport->set_escalate_on_repick(true); } - m_status->SetForegroundColour(wxNullColour); const int nb = int(m_doc.bodies.size()); const wxString bodytag = (nb > 1) ? wxString::Format(_L("Body %d "), body + 1) : wxString(); // Each sub-element line ends by naming the NEXT click (gem). Escalation to the @@ -4019,11 +3940,10 @@ DesignPanel::DesignPanel(wxWindow* parent) m_viewport->set_sketch_plane(plane_from_choice(m_ref_plane)); } const char* nm = (base == 0) ? "XY" : (base == 1) ? "XZ" : (base == 2) ? "YZ" : "datum"; - m_status->SetForegroundColour(wxColour(120, 210, 120)); // Both halves named the TOOLBAR, which no longer carries either button: the tools // moved to the offer. Name the gesture that actually works in each mode, and say // what a plain click does, since the two are easy to confuse on a plane. - set_status(m_ui_mode == UiMode::Sketch + set_status(StatusKind::Ok, m_ui_mode == UiMode::Sketch ? wxString::Format(_L("%s plane selected — right-click for the drawing tools"), nm) : wxString::Format(_L("%s plane selected — right-click to sketch on it, " "or click an object to select it"), nm)); @@ -4062,10 +3982,8 @@ DesignPanel::DesignPanel(wxWindow* parent) const int nb = int(m_doc.bodies.size()); const wxString tag = (nb > 1) ? wxString::Format(_L("Body %d "), body + 1) : wxString(); const Vec3d t = xform.translation(); - m_status->SetForegroundColour(wxNullColour); - set_status(tag + wxString::Format(_L("placed (%.1f, %.1f, %.1f) mm — drag arrows to move, rings to rotate"), + set_status(StatusKind::Info, tag + wxString::Format(_L("placed (%.1f, %.1f, %.1f) mm — drag arrows to move, rings to rotate"), t.x(), t.y(), t.z())); - m_status->Refresh(); }); // Fillet/Chamfer radius gizmo: dragging (or editing) the edge-anchored arrow writes the @@ -4141,23 +4059,21 @@ DesignPanel::DesignPanel(wxWindow* parent) set_ui_mode(UiMode::Feature); sync_sketch_display(); refresh_tree(); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Tool exited")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Tool exited")); }); // The tool declined to leave because the session holds geometry. There is no "press it again" // any more — the answer is a deliberate Finish or Cancel — so this is a plain statement of // where you are, not a warning shot. Only the STATUS LINE lives here; the tool reports via // this callback instead of writing text itself. + m_viewport->set_on_sketch_notice([this](const std::string& msg, bool error) { + set_status(error ? StatusKind::Error : StatusKind::Info, wxString::FromUTF8(msg)); + }); m_viewport->set_on_sketch_exit_refused([this]() { - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Sketch kept — Finish to commit it, Cancel to discard")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Sketch kept — Finish to commit it, Cancel to discard")); }); // Ctrl+Z / Ctrl+Shift+Z (Ctrl+Y) from the viewport → feature-history undo/redo. - m_viewport->set_on_undo_redo([this](bool redo) { do_undo_redo(redo); }); // Esc = the unified Cancel everywhere. Feature cards had no key exit (only the button); // CHAR_HOOK on the panel catches Esc from the card or viewport and routes to tool_cancel. @@ -4230,6 +4146,22 @@ DesignPanel::DesignPanel(wxWindow* parent) // acts on that one only; see DesignInteraction.hpp for the ladder and its invariant. if (key == WXK_ESCAPE) { escape(); return; } + // Enter mirrors the ✓ as Esc mirrors the ✗ (charter 4.2, L9): a ready sketch edit-op or + // transform first, else whatever the ✓ would confirm — gated exactly as the greyed button + // is, so a broken candidate cannot be committed from the keyboard either. An open value + // field keeps its own Enter (handled above or inside the field). + // Inside a sketch, Enter first ends what is in progress — applies a ready edit-op or + // transform, finishes a polyline/spline chain — then ends the armed draw tool (a + // continuous tool is ended, not confirmed, charter 4.2); only from Select does it finish + // the sketch, exactly as the ✓ does. + if (!in_text && !ctrl && (key == WXK_RETURN || key == WXK_NUMPAD_ENTER)) { + if (sketch_mode && m_viewport && m_viewport->is_sketching()) { + if (m_viewport->sketch_confirm_pending()) { update_undo_redo_buttons(); return; } + if (m_viewport->sketch_disarm_tool()) { set_status(_L("Select")); return; } + } + if (confirm_enabled()) { tool_confirm(); return; } + } + // The offer from the keyboard (charter 4.1): the Menu key, or Shift+F10 for keyboards that // do not have one. Same menu the right-click opens — show_offer_menu already decides which // half of the map applies via sketch_map_applies(), so nothing about the content is decided @@ -4249,16 +4181,21 @@ DesignPanel::DesignPanel(wxWindow* parent) if (!in_text && ctrl && (key == 'Z' || key == 'z' || key == WXK_CONTROL_Z || key == 'Y' || key == 'y' || key == WXK_CONTROL_Y)) { const bool redo = (key == 'Y' || key == 'y' || key == WXK_CONTROL_Y) || e.ShiftDown(); - if (sketching) { if (!redo) m_viewport->undo_last_sketch_entity(); } - else { do_undo_redo(redo); } + do_undo_redo(redo); // the same route as the Undo/Redo buttons return; } - // Delete — the selected sketch entities (or the last drawn one if none is selected), or the - // selected feature in Feature mode. Focus-independent, same reason as undo above. + // Delete — the selected sketch entities, or the selected feature in Feature mode. Only + // an explicit selection is ever destroyed (DesignInteraction.hpp): with nothing picked + // the key says so instead of deleting whatever happened to be drawn last. + // Focus-independent, same reason as undo above. // WXK_BACK too: on a keyboard whose Del is a chord (every laptop this runs on), Del is // the one destructive key nobody can reach, and Backspace is what users press. oql1. if (!in_text && (key == WXK_DELETE || (key == WXK_BACK && sketching))) { - if (sketching) { m_viewport->delete_selected_or_last_sketch_entity(); return; } + if (sketching) { + if (!m_viewport->delete_selected_sketch_entities()) + set_status(_L("Select something to delete")); + return; + } if (m_ui_mode == UiMode::Feature && m_active == Tool::None && tree_selection() != wxNOT_FOUND) { on_delete_feature(); return; } } @@ -4312,10 +4249,6 @@ DesignPanel::DesignPanel(wxWindow* parent) e.Skip(); }); - // Right-click finishes the move gizmo in the viewport; mirror that on the panel so the - // action bar (shown while moving) hides and the move state clears. - m_viewport->set_on_move_exit([this]() { m_move_body = -1; show_move_card(false); update_action_bar(); }); - // The offer (§4.1): right-click the geometry, get the verbs that apply to it. Left-click // still only selects, so pointing at things stays quiet. m_viewport->set_on_context_menu([this](const wxPoint& p) { show_offer_menu(p); }); @@ -4656,8 +4589,14 @@ void DesignPanel::on_import_svg() // app unresponsive and nothing repainted. The dialog is app-modal, so the document cannot be // touched while the worker owns it. Exceptions must not escape the worker: `work` is expected // to swallow them (OCCT throws Standard_Failure, which is not a std::exception). +// True while a worker owns the document. wxYield below runs pending events — and a queued MCP +// request is one — so the control socket must check this and refuse rather than change the +// document under the worker (DesignPanel::mcp_busy). +static std::atomic s_doc_worker_busy{0}; + static void run_off_ui_thread(wxWindow* parent, const wxString& message, const std::function& work) { + struct Busy { Busy() { ++s_doc_worker_busy; } ~Busy() { --s_doc_worker_busy; } } busy; std::atomic done{false}; std::thread worker([&work, &done]() { work(); @@ -4683,6 +4622,19 @@ static void run_off_ui_thread(wxWindow* parent, const wxString& message, const s worker.join(); } +bool DesignPanel::mcp_busy(bool sketch_method, std::string& why) const +{ + if (s_doc_worker_busy.load() > 0) { why = "the model is being rebuilt; try again when it finishes"; return true; } + // A GUI editor holds a candidate built from the document as it was when it opened; a + // feature added or removed underneath it would be overwritten, or overwrite, on Confirm. + if (m_active != Tool::None || m_edit_index >= 0) { why = "a feature card is open in the Design tab"; return true; } + if (m_ui_mode == UiMode::Constrain) { why = "the Design tab is constraining a sketch"; return true; } + // Sketch methods drive the live sketch session, which is the point of them; everything else + // changes the feature list, which a live sketch session is about to commit into. + if (!sketch_method && m_ui_mode == UiMode::Sketch) { why = "a sketch is open in the Design tab"; return true; } + return false; +} + // Rebuild the document off the UI thread. Every feature op (fillet, cut, shell, boolean, ...) // goes through recompute(), and on a heavy imported solid that is seconds of OCCT work — inline // it freezes the window. OCCT throws Standard_Failure, which is not a std::exception and would @@ -4761,10 +4713,8 @@ void DesignPanel::on_import_step() } }); if (solids.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(err.empty() ? _L("No solids found in STEP") - : (_L("STEP import failed: ") + wxString::FromUTF8(err))); - m_status->Refresh(); + set_status(StatusKind::Error, err.empty() ? _L("No solids found in STEP") + : (wxString::Format(_L("STEP import failed: %s"), kernel_error_text(err)))); return; } m_doc.checkpoint(); // undo boundary: importing STEP solids @@ -4789,20 +4739,16 @@ void DesignPanel::on_import_step() } }); if (!rebuilt) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("STEP import failed: ") + wxString::FromUTF8(m_doc.error)); - m_status->Refresh(); + set_status(StatusKind::Error, wxString::Format(_L("STEP import failed: %s"), kernel_error_text(m_doc.error))); return; } set_ui_mode(UiMode::Feature); // imported solids live in the feature timeline refresh_tree(); set_tree_selection(int(m_doc.features.size()) - 1); set_status_ok(); // canonical post-recompute viewport/pick/parts refresh - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format( + set_status(StatusKind::Info, wxString::Format( _L("Imported %d solid(s) — pick a face or edge, then Fillet / Cut / Shell to modify"), int(solids.size()))); - m_status->Refresh(); } // Import a triangle mesh as a real B-rep body: the triangles are rebuilt into OCCT faces with @@ -4819,9 +4765,7 @@ void DesignPanel::on_import_mesh() const std::string path(dlg.GetPath().ToUTF8().data()); auto fail = [this](const wxString& msg) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(msg); - m_status->Refresh(); + set_status(StatusKind::Error, msg); }; // Load the triangles with the slicer's own readers — no new mesh dependency. @@ -4834,7 +4778,7 @@ void DesignPanel::on_import_mesh() ObjInfo obj_info; std::string obj_err; if (!load_obj(path.c_str(), &mesh, obj_info, obj_err)) { - fail(_L("Could not read the OBJ file: ") + wxString::FromUTF8(obj_err)); + fail(wxString::Format(_L("Could not read the OBJ file: %s"), wxString::FromUTF8(obj_err))); return; } } else { @@ -4863,11 +4807,11 @@ void DesignPanel::on_import_mesh() shape = GeometryEngine::mesh_to_brep(mesh.its, MESH_IMPORT_TOLERANCE, MESH_IMPORT_MERGE_ANGLE_DEG, stats); } catch (const Standard_Failure& e) { // on OCCT >= 8 Standard_Failure derives from std::exception — must precede that handler - fail(_L("Mesh conversion failed: ") + wxString::FromUTF8( - e.GetMessageString() ? e.GetMessageString() : "OCCT error")); + fail(wxString::Format(_L("Mesh conversion failed: %s"), + kernel_error_text(e.GetMessageString() ? e.GetMessageString() : ""))); return; } catch (const std::exception& e) { - fail(_L("Mesh conversion failed: ") + wxString::FromUTF8(e.what())); + fail(wxString::Format(_L("Mesh conversion failed: %s"), kernel_error_text(e.what()))); return; } if (shape.IsNull()) { fail(_L("Mesh conversion produced no geometry")); return; } @@ -4882,7 +4826,7 @@ void DesignPanel::on_import_mesh() m_doc.features.push_back(f); if (!recompute_guarded(_L("Rebuilding model…"))) { - fail(_L("Mesh import failed: ") + wxString::FromUTF8(m_doc.error)); + fail(wxString::Format(_L("Mesh import failed: %s"), kernel_error_text(m_doc.error))); return; } set_ui_mode(UiMode::Feature); @@ -4894,14 +4838,12 @@ void DesignPanel::on_import_mesh() // watertight, say so and say why (boundary vs non-manifold edges) — that is a defect in the // source mesh the user needs to know about before they start cutting features into it. if (stats.is_solid) { - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format( + set_status(StatusKind::Info, wxString::Format( _L("Imported solid — %d triangles → %d faces, volume %.2f mm³. Pick a face or edge, " "then Fillet / Cut / Shell to modify"), stats.kept_tris, stats.faces_final, stats.volume)); } else { - m_status->SetForegroundColour(wxColour(220, 160, 60)); // warning, not an error - set_status(wxString::Format( + set_status(StatusKind::Warning, wxString::Format( _L("Imported as an open shell (not watertight): %d boundary edge(s), %d non-manifold " "edge(s) — %d triangles → %d faces. The source mesh has holes or duplicated " "geometry; boolean features may fail on it"), @@ -4915,9 +4857,7 @@ void DesignPanel::add_imported_sketch( const wxString& base_name) { if (regions.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("No importable geometry found")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("No importable geometry found")); return; } // DRAWING, not importing: if a sketch is open, the art belongs IN it. The outlines become @@ -4925,10 +4865,8 @@ void DesignPanel::add_imported_sketch( // else on that plane. Committing a separate Sketch feature while the user is mid-sketch put // the text on its own plane-origin feature and left the sketch they were drawing untouched. if (m_viewport && m_viewport->is_sketching() && m_viewport->add_sketch_regions(regions)) { - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(_L("%s added to the sketch — Confirm to commit it"), + set_status(StatusKind::Info, wxString::Format(_L("%s added to the sketch — Confirm to commit it"), base_name)); - m_status->Refresh(); return; } m_doc.checkpoint(); // undo boundary: importing Text/SVG art @@ -4989,9 +4927,7 @@ void DesignPanel::open_insert_card(const wxString& base_name) update_cards_frame(); m_form->Layout(); m_form->FitInside(); update_action_bar(); // surface the unified ✓/✗ - m_status->SetForegroundColour(wxNullColour); - set_status(base_name + _L(" — drag to place/size, then Confirm")); - m_status->Refresh(); + set_status(StatusKind::Info, base_name + _L(" — drag to place/size, then Confirm")); } // Confirm: keep the placed art and leave the placement gizmo. The feature is already in @@ -5019,9 +4955,7 @@ void DesignPanel::cancel_insert() set_ui_mode(UiMode::Feature); sync_sketch_display(); refresh_tree(); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Insert cancelled")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Insert cancelled")); } void DesignPanel::on_transform_imported(int feat_idx) @@ -5035,9 +4969,7 @@ void DesignPanel::on_transform_imported(int feat_idx) // the centre to move. Values stream back via set_on_imported_transform. m_viewport->begin_imported_transform(feat_idx, f.imported_regions, f.plane, f.import_offset, f.import_scale_x, f.import_scale_y); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Drag a corner to scale, the centre to move — right-click when done")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Drag a corner to scale, the centre to move — Enter or ✓ when done, Esc to discard")); } void DesignPanel::on_add_sketch() @@ -5050,8 +4982,7 @@ void DesignPanel::on_add_sketch() m_doc.add_sketch(shape, plane, m_width->GetValue(), m_height->GetValue(), m_radius->GetValue(), "Sketch" + std::to_string(m_feature_counter)); m_doc.recompute(); // a lone sketch yields an empty body; that is expected - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(_L("Sketch added on %s — select it, then right-click to Extrude"), where)); + set_status(StatusKind::Info, wxString::Format(_L("Sketch added on %s — select it, then right-click to Extrude"), where)); refresh_tree(); } @@ -5109,7 +5040,7 @@ void DesignPanel::on_add_extrude() f.target_body = m_doc.features[m_extrude_sketch_ref].import_face_body; } if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5142,7 +5073,7 @@ void DesignPanel::on_add_dressup() m_doc.features[didx].target_body = m_sel_solid_body; if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); @@ -5204,7 +5135,7 @@ void DesignPanel::on_add_hole() m_doc.features[hidx].target_body = m_hole_face_body; if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); @@ -5229,40 +5160,38 @@ void DesignPanel::apply_thread_standard() m_thread_std->GetString(sel).utf8_string()); if (!s) return; - // Pitch and depth are the defining "measures" of the standard — always apply. + // Pitch and depth are the defining "measures" of the standard — always apply. The field + // holds the NOMINAL (major) diameter for both roles; the kernel bores an internal thread to + // major - 2 x depth, so its depth is the tapped one, (major - minor) / 2. + const bool internal = m_thread_internal && m_thread_internal->GetValue(); if (m_thread_pitch) m_thread_pitch->SetValue(s->pitch_mm); - if (m_thread_depth) m_thread_depth->SetValue(s->thread_depth_mm()); - - // Nominal diameter: external rod = major diameter; internal tapped bore = minor (tap-drill) - // diameter. On a picked cylindrical surface/edge the diameter comes from the real geometry, - // so don't override it there. (The field holds DIAMETER.) - if (!m_thread_on_face && m_thread_radius) { - const bool internal = m_thread_internal && m_thread_internal->GetValue(); - const double d = internal ? s->minor_diameter_mm() : s->major_diameter_mm; - m_thread_radius->SetValue(d); - } + if (m_thread_depth) m_thread_depth->SetValue(internal ? s->internal_depth_mm() : s->thread_depth_mm()); + if (m_thread_radius) m_thread_radius->SetValue(s->major_diameter_mm); if (m_status) set_status(wxString::Format(_L("Thread standard: %s (pitch %.3g mm)"), m_thread_std->GetString(sel), s->pitch_mm)); } -void DesignPanel::infer_thread_spec(double diameter) +void DesignPanel::infer_thread_spec(double diameter, bool internal) { - // Snap to the nearest standard thread by nominal (major) diameter, so picking a Ø9.9 boss - // gives M10 — the M diameter, pitch AND depth all follow from the cylinder's base diameter. + // Snap to the nearest standard thread, so picking a Ø9.9 boss gives M10 and a Ø5 tap-drill + // hole gives M6 — the M diameter, pitch AND depth all follow from the cylinder. A boss is + // matched on the MAJOR diameter; a hole on the MINOR one, since a hole to be tapped is + // drilled at the tap-drill size. const auto& stds = thread_standards(); int best = -1; double bestErr = 1e30; for (int i = 0; i < int(stds.size()); ++i) { - const double e = std::abs(stds[i].major_diameter_mm - diameter); + const double ref = internal ? stds[i].minor_diameter_mm() : stds[i].major_diameter_mm; + const double e = std::abs(ref - diameter); if (e < bestErr) { bestErr = e; best = i; } } if (best < 0) { if (m_thread_radius) m_thread_radius->SetValue(diameter); return; } const ThreadSpec& s = stds[best]; if (m_thread_std) m_thread_std->SetSelection(best + 1); // row 0 is "Custom" - if (m_thread_radius) m_thread_radius->SetValue(s.major_diameter_mm); // field = DIAMETER + if (m_thread_radius) m_thread_radius->SetValue(s.major_diameter_mm); // field = NOMINAL diameter if (m_thread_pitch) m_thread_pitch->SetValue(s.pitch_mm); - if (m_thread_depth) m_thread_depth->SetValue(s.thread_depth_mm()); + if (m_thread_depth) m_thread_depth->SetValue(internal ? s.internal_depth_mm() : s.thread_depth_mm()); } void DesignPanel::on_add_thread() @@ -5284,7 +5213,7 @@ void DesignPanel::on_add_thread() m_doc.features[tidx].target_body = m_thread_face_body; if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); @@ -5308,7 +5237,7 @@ void DesignPanel::on_add_revolve() mode, "Revolve" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); @@ -5338,7 +5267,7 @@ void DesignPanel::on_add_sweep() "Sweep" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); @@ -5366,7 +5295,7 @@ void DesignPanel::on_add_loft() "Loft" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); @@ -5383,7 +5312,7 @@ void DesignPanel::on_add_surface_extrude() m_doc.add_surface_extrude(m_surf_extrude_sketch_ref, m_surf_extrude_distance->GetValue(), "SurfaceExtrude" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5400,7 +5329,7 @@ void DesignPanel::on_add_surface_revolve() m_surf_revolve_axis->GetSelection(), "SurfaceRevolve" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5420,7 +5349,7 @@ void DesignPanel::on_add_surface_loft() m_doc.add_surface_loft(refs, m_surf_loft_ruled->GetValue(), "SurfaceLoft" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5436,7 +5365,7 @@ void DesignPanel::on_add_surface_fill() m_doc.add_surface_fill(m_surf_fill_sketch_ref, "SurfaceFill" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5453,7 +5382,7 @@ void DesignPanel::on_add_surface_offset() m_doc.add_surface_offset(sel, m_surf_offset_distance->GetValue(), "SurfaceOffset" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5471,7 +5400,7 @@ void DesignPanel::on_add_thicken_surface() m_surf_thicken_flip->GetValue(), "ThickenSurface" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5567,7 +5496,7 @@ void DesignPanel::on_add_transform() m_doc.add_transform(target, trans, axis, pivot, m_xf_angle->GetValue(), m_xf_copy->GetValue(), "Transform" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5586,7 +5515,7 @@ void DesignPanel::on_add_mirror() m_doc.add_mirror(plane_from_choice(m_mirror_plane->GetSelection()), target, mode, "Mirror" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5599,9 +5528,7 @@ void DesignPanel::on_add_thicken() return; } if (m_sel_solid_face < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Pick a solid face to thicken first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Pick a solid face to thicken first")); return; } const int sel = m_thicken_body->GetSelection(); @@ -5610,7 +5537,7 @@ void DesignPanel::on_add_thicken() m_doc.add_thicken(target, m_sel_solid_face, m_thicken_thickness->GetValue(), m_thicken_flip->GetValue(), "Thicken" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5635,7 +5562,7 @@ void DesignPanel::on_add_rib() m_doc.add_rib(sketch_ref, m_rib_entity->GetValue(), m_rib_thickness->GetValue(), m_rib_depth->GetValue(), target, "Rib" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5655,7 +5582,7 @@ void DesignPanel::on_add_project() plane_from_choice(m_proj_plane->GetSelection()), "Project" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5668,9 +5595,7 @@ void DesignPanel::on_add_delete_face() return; } if (m_del_faces.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Add at least one face to delete first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Add at least one face to delete first")); return; } const int sel = m_del_face_body->GetSelection(); @@ -5679,7 +5604,7 @@ void DesignPanel::on_add_delete_face() m_doc.add_delete_face(target, m_del_faces, "DeleteFace" + std::to_string(m_feature_counter)); m_del_faces.clear(); // consumed; fresh state for the next use if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5693,7 +5618,7 @@ void DesignPanel::on_add_helix() m_helix_height->GetValue(), m_helix_left_handed->GetValue(), m_helix_taper->GetValue(), "Helix" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5704,17 +5629,13 @@ void DesignPanel::on_add_mate() const int sel_a = m_mate_cs_a->GetSelection(); const int sel_b = m_mate_cs_b->GetSelection(); if (sel_a == wxNOT_FOUND || sel_b == wxNOT_FOUND) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Mate needs two CoordSys features — create them first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Mate needs two CoordSys features — create them first")); return; } const int cs_a = int(reinterpret_cast(m_mate_cs_a->GetClientData(sel_a))); const int cs_b = int(reinterpret_cast(m_mate_cs_b->GetClientData(sel_b))); if (cs_a == cs_b) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Mate: CS A and CS B must be different CoordSys features")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Mate: CS A and CS B must be different CoordSys features")); return; } m_feature_counter++; @@ -5723,13 +5644,11 @@ void DesignPanel::on_add_mate() m_mate_flip->GetValue(), "Mate" + std::to_string(m_feature_counter)); if (idx < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Mate rejected")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Mate rejected")); return; } if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5738,25 +5657,19 @@ void DesignPanel::on_add_mate() void DesignPanel::on_check_interference() { if (m_doc.bodies.size() < 2) { - m_status->SetForegroundColour(wxNullColour); - set_status(_L("No interference — need at least two solid bodies to check")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("No interference — need at least two solid bodies to check")); return; } const auto pairs = m_doc.check_interference(); if (pairs.empty()) { - m_status->SetForegroundColour(wxNullColour); - set_status(_L("No interference found")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("No interference found")); return; } double worst = 0; for (const auto& p : pairs) if (p.volume > worst) worst = p.volume; - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(_L("%zu interference pairs, worst %.2f mm³"), + set_status(StatusKind::Info, wxString::Format(_L("%zu interference pairs, worst %.2f mm³"), pairs.size(), worst)); - m_status->Refresh(); wxString msg = _L("Interference pairs:\n\n"); for (const auto& p : pairs) { // 1-based, like every other body label in this panel and in the parts tree: @@ -5782,16 +5695,12 @@ void DesignPanel::on_mass_properties() // here with nothing selected; run_verb does. Nothing selected is not an error, hence the // neutral colour, not the error red. if (m_sel_solid_body < 0 || m_sel_solid_body >= int(m_doc.bodies.size())) { - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Select a solid body first — its mass properties are what is reported")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Select a solid body first — its mass properties are what is reported")); return; } const auto mp = GeometryEngine::mass_properties(m_doc.bodies[m_sel_solid_body].shape); if (!mp.valid) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Mass properties could not be computed for this body")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Mass properties could not be computed for this body")); return; } // 1-based, and the body's own name when it has one — the same wording the parts list uses. @@ -5800,10 +5709,8 @@ void DesignPanel::on_mass_properties() name = wxString::FromUTF8(m_doc.bodies[m_sel_solid_body].name); if (!mp.is_solid) { // Sheet body: quoting a volume here would be inventing material that is not there. - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(_L("%s: sheet body — %.2f cm² of surface, no volume"), + set_status(StatusKind::Info, wxString::Format(_L("%s: sheet body — %.2f cm² of surface, no volume"), name, mp.surface_area / 100.0)); - m_status->Refresh(); wxMessageBox(wxString::Format(_L("%s\n\nSheet body (open shell)\nSurface area: %.2f cm²\n\n" "A sheet encloses no material, so it has no volume. " "Thicken it into a solid to get one."), @@ -5811,10 +5718,8 @@ void DesignPanel::on_mass_properties() _L("Mass properties"), wxOK, this); return; } - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(_L("%s: %.3f cm³, %.2f cm²"), + set_status(StatusKind::Info, wxString::Format(_L("%s: %.3f cm³, %.2f cm²"), name, mp.volume / 1000.0, mp.surface_area / 100.0)); - m_status->Refresh(); wxMessageBox(wxString::Format(_L("%s\n\nVolume: %.3f cm³\nSurface area: %.2f cm²"), name, mp.volume / 1000.0, mp.surface_area / 100.0), _L("Mass properties"), wxOK, this); @@ -5876,7 +5781,7 @@ void DesignPanel::on_add_pattern() "Pattern" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); @@ -5960,7 +5865,7 @@ void DesignPanel::on_add_boolean() m_bool_keep->GetValue(), m_bool_tol->GetValue(), -1, -1, "Boolean" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -5977,7 +5882,7 @@ void DesignPanel::on_add_cut() /*flip*/ false, /*keep_upper*/ true, /*keep_lower*/ true, m_cut_target->GetSelection(), "Cut" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -6195,9 +6100,52 @@ wxPoint DesignPanel::offer_anchor() const // One place that writes the status line, so every hint wraps instead of clipping at the panel // edge. wxStaticText::Wrap() is destructive, which is fine here: the label is replaced whole // each time, never appended to. -void DesignPanel::set_status(const wxString& text) +// Kernel and OCCT messages are written for developers ("fuse failed", "BRep_API: command not +// done", an empty string). The status line is for the person modelling, so the recurring ones +// are said in the drawing office's words; anything unrecognised is still shown rather than +// hidden, because a vague sentence that hides the only clue is worse than a terse one. +wxString DesignPanel::kernel_error_text(const std::string& err) +{ + struct Map { const char* needle; const char* sentence; }; + static const Map kMap[] = { + { "fuse failed", L("the new shape could not be joined to the body") }, + { "cut failed", L("the new shape could not be cut from the body") }, + { "intersect failed", L("the shapes could not be intersected") }, + { "no solid-producing features", L("nothing in the history makes a solid yet") }, + { "sketch profile wire failed", L("the sketch profile is not a clean closed loop") }, + { "does not intersect", L("the tool does not touch the body") }, + { "unknown identifier", L("an expression uses a variable that does not exist") }, + { "division by zero", L("an expression divides by zero") }, + { "variable cycle", L("two variables are defined in terms of each other") }, + }; + if (err.empty()) + return _L("a geometry operation failed"); + for (const Map& m : kMap) + if (err.find(m.needle) != std::string::npos) + return _(m.sentence); + if (err.find("OCCT") != std::string::npos || err.find("BRep") != std::string::npos + || err.find("Standard_") != std::string::npos || err.find("StdFail") != std::string::npos) + return _L("a geometry operation failed"); + return wxString::FromUTF8(err); +} + +void DesignPanel::set_status(StatusKind kind, const wxString& body) { if (m_status == nullptr) return; + wxColour colour; + const wchar_t* glyph = nullptr; + switch (kind) { + case StatusKind::Info: colour = wxNullColour; break; + case StatusKind::Ok: colour = wxColour(120, 210, 120); glyph = L"\u2713 "; break; // ✓ + case StatusKind::Warning: colour = wxColour(220, 160, 60); glyph = L"\u26A0 "; break; // ⚠ + case StatusKind::Error: colour = wxColour(235, 110, 110); glyph = L"\u2717 "; break; // ✗ + } + m_status->SetForegroundColour(colour); + // Callers that already lead with a glyph (the DOF line) keep theirs. + wxString text = body; + if (glyph != nullptr && !text.IsEmpty() && !text.StartsWith(L"\u2713") && !text.StartsWith(L"\u2717") + && !text.StartsWith(L"\u26A0")) + text = wxString(glyph) + text; m_status->SetLabel(text); // the ONE place that may call SetLabel directly // m_status is HIDDEN and kept only as the owner of the text and its colour — every caller // sets the colour on it just before calling here, so this stays the one place that knows @@ -6225,8 +6173,9 @@ void DesignPanel::set_status(const wxString& text) // apply); `picks` = the size of the set the gesture accumulates. // // It is deliberately explicit about the gesture that ENDS each tool, because none of them is -// discoverable: a click on empty space applies an edit-op or a transform, right-click cancels it, -// and Esc downgrades an armed tool to Select before it ever exits the sketch. +// discoverable: Enter (or ✓) applies an edit-op or a transform, Esc drops it, and a second Esc +// downgrades the armed tool to Select before it ever exits the sketch. Right-click only abandons +// the gesture in progress; with nothing in progress it opens the offer. static wxString sketch_step_prompt(DesignSketchTool::Mode m, int step, int picks) { using Mode = DesignSketchTool::Mode; @@ -6251,11 +6200,11 @@ static wxString sketch_step_prompt(DesignSketchTool::Mode m, int step, int picks : _L("Dimension — click the second point"); case Mode::Line: return step == 0 ? _L("Line — click the start point") - : _L("Line — click the end point, or type the length"); + : _L("Line — click the end point; its length and angle can then be typed"); case Mode::Polyline: return step == 0 ? _L("Polyline — click the first point") : pick_more(_L("Polyline — click the next point · click the start point " - "to close it · right-click to end the chain"), step); + "to close it · right-click, double-click or Enter ends the chain"), step); case Mode::CornerRect: return step == 0 ? _L("Rectangle — click one corner") : _L("Rectangle — click the opposite corner"); @@ -6272,7 +6221,7 @@ static wxString sketch_step_prompt(DesignSketchTool::Mode m, int step, int picks : _L("Rounded rectangle — click to set the corner radius"); case Mode::CenterCircle: return step == 0 ? _L("Circle — click the centre") - : _L("Circle — click to set the radius, or type it"); + : _L("Circle — click to set the radius; it can then be typed"); case Mode::TwoPointCircle: return step == 0 ? _L("Circle (2 points) — click one end of the diameter") : _L("Circle (2 points) — click the other end of the diameter"); @@ -6315,60 +6264,60 @@ static wxString sketch_step_prompt(DesignSketchTool::Mode m, int step, int picks : _L("Elliptical arc — click where the arc ends"); case Mode::BSpline: return step == 0 ? _L("Spline — click the first control point") - : pick_more(_L("Spline — click the next control point · right-click to " - "finish the curve"), step); + : pick_more(_L("Spline — click the next control point · right-click, " + "double-click or Enter finishes the curve"), step); case Mode::Point: return _L("Point — click to place one; the tool stays armed for more"); case Mode::Trim: - return _L("Trim — click a segment where it crosses another entity · right-click to exit"); + return _L("Trim — click a segment where it crosses another entity · Esc to exit"); case Mode::Extend: return _L("Extend — click a line or arc to grow it out to the nearest entity · " - "right-click to exit"); + "Esc to exit"); case Mode::Fillet: return step == 0 ? _L("Fillet — click the first of two lines that meet") : step == 1 ? _L("Fillet — click the second line") : _L("Fillet — drag the arrow, or click the number to type the radius · " - "click empty space to apply · right-click cancels"); + "Enter applies · Esc cancels"); case Mode::Chamfer: return step == 0 ? _L("Chamfer — click the first of two lines that meet") : step == 1 ? _L("Chamfer — click the second line") : _L("Chamfer — drag the arrow, or click the number to type the setback · " - "click empty space to apply · right-click cancels"); + "Enter applies · Esc cancels"); case Mode::Offset: return step == 0 ? _L("Offset — click the entity to offset") : _L("Offset — drag the arrow to either side, or click the number to type " - "the distance · click empty space to apply · right-click cancels"); + "the distance · Enter applies · Esc cancels"); case Mode::Mirror: // The two-phase pick is the one gesture users reported as unguided: nothing said the - // AXIS comes first, and nothing said an empty click is what applies it. + // AXIS comes first, and nothing said how it is applied. return step == 0 ? _L("Mirror — first click the LINE to mirror about (a construction line works)") : picks == 0 - ? _L("Mirror — axis set · now click the entities to mirror · right-click cancels") + ? _L("Mirror — axis set · now click the entities to mirror · Esc cancels") : wxString::Format(_L("Mirror — axis set · %d to mirror · click another to add or " - "remove it · click empty space to apply"), picks); + "remove it · Enter applies"), picks); case Mode::Move: return step == 0 ? _L("Move — click the entities to move") : pick_more(_L("Move — drag the handle, or click the number to type the " - "distance · click empty space to apply"), picks); + "distance · Enter applies"), picks); case Mode::Rotate: return step == 0 ? _L("Rotate — click the entities to rotate") : pick_more(_L("Rotate — drag the handle, or click the number to type the " - "angle · click empty space to apply"), picks); + "angle · Enter applies"), picks); case Mode::Scale: return step == 0 ? _L("Scale — click the entities to scale") : pick_more(_L("Scale — drag the handle, or click the number to type the " - "factor · click empty space to apply"), picks); + "factor · Enter applies"), picks); case Mode::Array: return step == 0 ? _L("Array — click the entities to repeat") : pick_more(_L("Array — drag the handle to set the step, click the count to " - "type it · click empty space to apply"), picks); + "type it · Enter applies"), picks); case Mode::PolarArray: return step == 0 ? _L("Polar array — click the entities to repeat") : pick_more(_L("Polar array — drag the handle to set the sweep, click the " - "count to type it · click empty space to apply"), picks); + "count to type it · Enter applies"), picks); case Mode::TransformArt: - return _L("Drag a corner to scale, the centre to move · right-click when done"); + return _L("Drag a corner to scale, the centre to move · Enter or ✓ when done, Esc to discard"); } return wxString(); } @@ -6391,9 +6340,7 @@ void DesignPanel::on_sketch_step(int mode, int step, int picks) text += _L(" · click a constraint badge to remove it"); m_sketch_step = text; if (text.IsEmpty() || m_status == nullptr) return; - m_status->SetForegroundColour(wxNullColour); - set_status(text); - m_status->Refresh(); + set_status(StatusKind::Info, text); } wxMenuItem* DesignPanel::append_offer_item(wxMenu* menu, int id, const wxString& text, @@ -6643,13 +6590,11 @@ void DesignPanel::show_offer_menu(const wxPoint& screen_pos) int idx = m_doc.add_mate(opts[i].kind, cs_a, cs_b, 0.0, 0.0, false, "Mate" + std::to_string(++m_feature_counter)); if (idx < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Mate rejected")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Mate rejected")); return; } if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); refresh_tree(); @@ -6670,8 +6615,7 @@ void DesignPanel::show_offer_menu(const wxPoint& screen_pos) const int i = e.GetMenuId() - base; if (i < 0 || i >= int(bound.size()) || bound[i] == nullptr || bound[i]->hint == nullptr) return; - m_status->SetForegroundColour(wxNullColour); - set_status(wxGetTranslation(wxString::FromUTF8(bound[i]->hint))); + set_status(StatusKind::Info, wxGetTranslation(wxString::FromUTF8(bound[i]->hint))); m_status->Update(); // the popup owns the loop; without this the line repaints late }, base, base + 499); // 499: the mate section starts at base + 500 (see mate_base) menu.Bind(wxEVT_MENU, [this, &bound](wxCommandEvent& e) { @@ -6729,10 +6673,8 @@ void DesignPanel::arm_plane_pick(PlanePick target) // and reset_plane_refs() restores it when the pick is abandoned; only the arm side was missing. if (m_viewport) m_viewport->set_escalate_on_repick(false); const bool face = (target == PlanePick::FaceA || target == PlanePick::FaceB); - m_status->SetForegroundColour(wxNullColour); - set_status(face ? _L("Click a solid FACE in the viewport") + set_status(StatusKind::Info, face ? _L("Click a solid FACE in the viewport") : _L("Click a solid EDGE in the viewport")); - m_status->Refresh(); } // --- Axis helpers --- @@ -6769,10 +6711,8 @@ void DesignPanel::arm_axis_pick(AxisPick target) { m_axis_pick = target; if (m_viewport) m_viewport->set_escalate_on_repick(false); // same as arm_plane_pick - m_status->SetForegroundColour(wxNullColour); - set_status(target == AxisPick::Face ? _L("Click a solid FACE in the viewport") + set_status(StatusKind::Info, target == AxisPick::Face ? _L("Click a solid FACE in the viewport") : _L("Click a solid EDGE in the viewport")); - m_status->Refresh(); } // --- CoordSys helpers --- @@ -6837,10 +6777,8 @@ void DesignPanel::arm_coordsys_pick(CoordSysPick target) // escalation is off: clicking the face the card is pointing at is the ANSWER here, not a // request for its body. if (m_viewport) m_viewport->set_escalate_on_repick(false); - m_status->SetForegroundColour(wxNullColour); - set_status(target == CoordSysPick::Face ? _L("Click a solid FACE in the viewport") + set_status(StatusKind::Info, target == CoordSysPick::Face ? _L("Click a solid FACE in the viewport") : _L("Click a solid EDGE in the viewport")); - m_status->Refresh(); } bool DesignPanel::on_add_plane() @@ -6851,9 +6789,7 @@ bool DesignPanel::on_add_plane() // a success — the user asks for one construction and silently receives another. The kernel // keeps its fallback (it must return SOMETHING), but no user gesture should reach it. auto refuse = [this](const wxString& why) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(why); - m_status->Refresh(); + set_status(StatusKind::Error, why); }; switch ((PlaneType)m_plane_type->GetSelection()) { case PlaneType::Angle: @@ -6884,8 +6820,7 @@ bool DesignPanel::on_add_plane() "Plane" + std::to_string(m_feature_counter)); if (idx >= 0 && idx < int(m_doc.features.size())) apply_plane_refs(m_doc.features[idx]); m_doc.recompute(); // datum-only docs yield no body; that is expected/benign - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Plane added — pick it as a sketch plane")); + set_status(StatusKind::Info, _L("Plane added — pick it as a sketch plane")); refresh_tree(); return true; } @@ -6897,8 +6832,7 @@ void DesignPanel::on_add_axis() "Axis" + std::to_string(m_feature_counter)); if (idx >= 0 && idx < int(m_doc.features.size())) apply_axis_refs(m_doc.features[idx]); m_doc.recompute(); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Axis added")); + set_status(StatusKind::Info, _L("Axis added")); refresh_tree(); } @@ -6910,8 +6844,7 @@ void DesignPanel::on_add_coordsys() "Coord" + std::to_string(m_feature_counter)); if (idx >= 0 && idx < int(m_doc.features.size())) apply_coordsys_refs(m_doc.features[idx]); m_doc.recompute(); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Coord Sys added")); + set_status(StatusKind::Info, _L("Coord Sys added")); refresh_tree(); } @@ -6928,7 +6861,7 @@ void DesignPanel::on_add_shell() "Shell" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); @@ -6942,9 +6875,7 @@ void DesignPanel::on_add_draft() return; } if (m_sel_solid_face < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Draft needs a picked face — click a side face first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Draft needs a picked face — click a side face first")); return; } @@ -6953,7 +6884,7 @@ void DesignPanel::on_add_draft() "Draft" + std::to_string(m_feature_counter)); if (!recompute_guarded(_L("Rebuilding model…"))) - set_status(_L("Recompute error: ") + wxString::FromUTF8(m_doc.error)); + set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else set_status_ok(); @@ -7045,27 +6976,35 @@ void DesignPanel::on_tab_shown() if (m_viewport) m_viewport->refresh_bed(); - // Modeling origin = bed centre, set BEFORE any recompute/datum-resolve so sketches and datums - // land in the middle of the bed (not the bed corner = world 0). - if (Plater* pl = wxGetApp().plater()) { - const Vec2d bc = pl->build_volume().bed_center(); - m_doc.modeling_origin = Vec3d(bc.x(), bc.y(), 0.0); - } - - // Rehydrate the parametric model from a freshly loaded project (the 3MF carried the - // recipe in Metadata/orca_cad.bin). Only when nothing is in progress here, so we - // never clobber an active design when the user just toggles back to the Design tab. - if (m_doc.features.empty()) { - if (Plater* plater = wxGetApp().plater()) { - const std::string& blob = plater->model().cad_recipe; - if (!blob.empty()) load_recipe(blob); - } - } + hydrate_from_model(); update_reference_planes(); // entering the Design tab: show the XY/XZ/YZ planes if no object yet sync_sidebar_width(); // keep the panel as wide as Prepare's so the canvas edge doesn't jump if (m_viewport) m_viewport->force_repaint(); // the page was just re-shown: paint it for real } +// Rehydrate the parametric model from a freshly loaded project (the 3MF carried the recipe in +// Metadata/orca_cad.bin). Only into an EMPTY document, so an active design is never clobbered +// when the user toggles back to the tab. Called on tab show and by the control socket — which +// used to skip it, work on an empty document, and then overwrite the project's recipe with +// just its own features. +void DesignPanel::hydrate_from_model() +{ + if (!m_doc.features.empty()) return; + Plater* plater = wxGetApp().plater(); + if (plater == nullptr) return; + // Modeling origin = bed centre, set BEFORE any recompute/datum-resolve so sketches and + // datums land in the middle of the bed (not the bed corner = world 0) — only for a document + // that has none yet. A design in progress keeps its origin: its sketches have it baked into + // their planes, so moving it under them (a printer change between visits) would slide the + // datum planes off the geometry. A loaded project brings its own (load_recipe). + if (!m_doc.origin_from_recipe) { + const Vec2d bc = plater->build_volume().bed_center(); + m_doc.modeling_origin = Vec3d(bc.x(), bc.y(), 0.0); + } + const std::string& blob = plater->model().cad_recipe; + if (!blob.empty()) load_recipe(blob); +} + // Application close / language switch, from the plater's canvas teardown. void DesignPanel::unbind_canvas_event_handlers() { @@ -7102,11 +7041,9 @@ void DesignPanel::load_recipe(const std::string& blob) // the user unable to tell "update OrcaSlicer" from "your file is damaged". Same // error-loss class as the 31 McpControl sites (1de72de9ed): the message exists, it was // simply not passed on. - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(m_doc.error.empty() + set_status(StatusKind::Error, m_doc.error.empty() ? _L("Could not restore the CAD model from this project") - : _L("Could not restore the CAD model: ") + wxString::FromUTF8(m_doc.error)); - m_status->Refresh(); + : wxString::Format(_L("Could not restore the CAD model: %s"), wxString::FromUTF8(m_doc.error))); return; } m_feature_counter = int(m_doc.features.size()); @@ -7256,7 +7193,6 @@ void DesignPanel::toggle_section_view() { if (!m_viewport) return; m_section_on = !m_section_on; - m_status->SetForegroundColour(wxNullColour); if (m_section_on) { m_section_cut_z = m_viewport->model_mid_z(); // start at the model's mid-height m_section_upper = false; // keep the lower half by default @@ -7276,10 +7212,8 @@ void DesignPanel::flip_section_view() if (!m_viewport || !m_section_on) return; m_section_upper = !m_section_upper; m_viewport->set_section_plane(true, m_section_cut_z, m_section_upper); - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(_L("Section view — showing the %s half"), + set_status(StatusKind::Info, wxString::Format(_L("Section view — showing the %s half"), m_section_upper ? _L("upper") : _L("lower"))); - m_status->Refresh(); } void DesignPanel::sync_body_visible() @@ -7346,9 +7280,7 @@ void DesignPanel::feed_bodies() void DesignPanel::on_boolean_tool() { if (m_doc.bodies.size() < 2) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Boolean needs two bodies — create or import a second solid")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Boolean needs two bodies — create or import a second solid")); return; } populate_body_choices(); @@ -7362,10 +7294,8 @@ void DesignPanel::on_move_body() if (b < 0 || b >= int(m_doc.display_body_meshes.size())) { // Never fail silently here: the caller gates on bodies.size() while this needs a // tessellated per-body mesh, and when those disagreed the click did nothing at all. - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(b < 0 ? _L("Select a body first — click it in the viewport or the Bodies list") + set_status(StatusKind::Error, b < 0 ? _L("Select a body first — click it in the viewport or the Bodies list") : _L("That body has no display mesh yet — recompute first")); - m_status->Refresh(); return; } sync_body_xform(); @@ -7388,9 +7318,7 @@ void DesignPanel::on_move_body() if (m_move_angle) m_move_angle->SetValue(0.0); show_move_card(true); update_action_bar(); // surface the unified ✓/✗ while moving - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Drag the arrows to move, the rings to rotate — then Confirm (Esc cancels)")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Drag the arrows to move, the rings to rotate — then Confirm (Esc cancels)")); } // Transform card (add mode): arm the same move gizmo on the card's body so the geometry-first @@ -7422,9 +7350,7 @@ void DesignPanel::arm_transform_gizmo() if (m_xf_dy) m_xf_dy->SetValue(0.0); if (m_xf_dz) m_xf_dz->SetValue(0.0); if (m_xf_angle) m_xf_angle->SetValue(0.0); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Drag the arrows to move, the rings to rotate — the numbers follow")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Drag the arrows to move, the rings to rotate — the numbers follow")); } // Color tool: open a colour picker on the selected body and store a per-body display-colour @@ -7437,9 +7363,7 @@ void DesignPanel::on_set_body_color() int b = tree_body_selection(); if (b < 0) b = m_sel_solid_body; if (b < 0 || b >= int(m_doc.bodies.size())) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Select a body first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Select a body first")); return; } @@ -7457,9 +7381,7 @@ void DesignPanel::on_set_body_color() (unsigned char)picked.Blue(), (unsigned char)255); feed_bodies(); // same refresh path the visibility toggle uses → viewport updates immediately - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(_L("Body %d colour set"), b + 1)); - m_status->Refresh(); + set_status(StatusKind::Info, wxString::Format(_L("Body %d colour set"), b + 1)); } // Prepare's "Place on Face" (F), ported to Design. Pick a body face, then this rotates the @@ -7472,9 +7394,7 @@ bool DesignPanel::place_on_face() const int b = m_sel_solid_body; if (b < 0 || b >= int(m_doc.bodies.size()) || m_sel_solid_face < 0 || b >= int(m_doc.display_body_meshes.size())) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Click a face on the solid, then press F")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Click a face on the solid, then press F")); return false; } const TopoDS_Face face = GeometryEngine::face_by_index(m_doc.bodies[b].shape, m_sel_solid_face); @@ -7495,9 +7415,7 @@ bool DesignPanel::place_on_face() x = Transform3d(Eigen::Translation3d(0.0, 0.0, -probe.bounding_box().min.z())) * x; m_body_xform[b] = x; set_status_ok(); // rebuild display/pick meshes, re-point picking; resets face selection - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Placed on face — body laid flat on the bed")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Placed on face — body laid flat on the bed")); return true; } @@ -7523,13 +7441,10 @@ void DesignPanel::after_tree_edit(bool ok) refresh_variables(); if (!ok) { // The edit was rolled back (recompute failed); the body is unchanged. - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Edit rejected: ") + wxString::FromUTF8(m_doc.error)); - m_status->Refresh(); + set_status(StatusKind::Error, wxString::Format(_L("Edit rejected: %s"), kernel_error_text(m_doc.error))); return; } sync_recipe_to_model(); // deletes, reorders and suppressions change the document too - m_status->SetForegroundColour(wxNullColour); if (m_doc.display_mesh.its.indices.empty()) { if (m_viewport != nullptr) m_viewport->clear_mesh(); sync_sketch_display(); // empty body: show any un-consumed committed sketch @@ -7589,18 +7504,14 @@ void DesignPanel::on_delete_body() { const int nb = int(m_doc.bodies.size()); if (m_sel_solid_body < 0 || m_sel_solid_body >= nb) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Select a body first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Select a body first")); return; } const int src = m_doc.bodies[m_sel_solid_body].source_feature; if (src < 0 || src >= int(m_doc.features.size())) { // Only reachable for a body no feature claims — a stale recipe, or a feature type that // broke the "never replace a whole CadBody" invariant recompute() relies on. - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("This body has no feature to delete — use New Design to start over")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("This body has no feature to delete — use New Design to start over")); return; } const std::string& raw = m_doc.features[src].name; @@ -7628,9 +7539,7 @@ void DesignPanel::on_delete_feature() // A Body row has no directly-removable feature (bodies are recomputed results); guide the // user to delete the feature that created it, or use New Design to wipe everything. if (tree_body_selection() >= 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Select the FEATURE that created this body (or use New Design)")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Select the FEATURE that created this body (or use New Design)")); return; } int sel = tree_selection(); @@ -7674,33 +7583,25 @@ void DesignPanel::on_toggle_visibility() // fell through to the FEATURE-level branch below instead of un-hiding the body. if (m_parts != nullptr && bsel < int(m_tree_body_items.size())) m_parts->SelectItem(m_tree_body_items[bsel]); - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(now_visible ? _L("Body %d shown") + set_status(StatusKind::Info, wxString::Format(now_visible ? _L("Body %d shown") : _L("Body %d hidden"), bsel + 1)); - m_status->Refresh(); } return; } int sel = tree_selection(); if (sel == wxNOT_FOUND || sel >= int(m_doc.features.size())) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Select a feature in the tree first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Select a feature in the tree first")); return; } const bool shown = !m_doc.features[sel].enabled; - m_doc.features[sel].enabled = shown; - - // recompute() reports an all-hidden / sketch-only document as false (no - // solid to build), but that is a VALID state for hide — so clear the body - // explicitly instead of letting after_tree_edit treat it as a rejected edit - // (which would skip the overlay refresh, leaving hidden art on screen). - if (!recompute_guarded(_L("Rebuilding model…"))) { - m_doc.body = TopoDS_Shape(); - m_doc.display_mesh = TriangleMesh{}; - m_doc.error.clear(); - } + // Through the document, not a bare flag flip: hiding a feature that makes a body shifts + // every later body index, and set_feature_enabled keeps those references on their bodies + // (and datum-plane references on their planes). It accepts an all-hidden / sketch-only + // result as the valid empty state it is, and rolls back — saying why — when a later + // feature cannot do without what was hidden. + m_doc.checkpoint(); + if (!m_doc.set_feature_enabled(sel, shown)) { after_tree_edit(false); return; } refresh_tree(); // greys the row set_tree_selection(sel); // keep the toggled feature selected if (m_viewport != nullptr) { @@ -7708,9 +7609,7 @@ void DesignPanel::on_toggle_visibility() else feed_bodies(); } sync_sketch_display(); // skips the hidden sketch + direct-renders - m_status->SetForegroundColour(wxNullColour); - set_status(shown ? _L("Feature shown") : _L("Feature hidden")); - m_status->Refresh(); + set_status(StatusKind::Info, shown ? _L("Feature shown") : _L("Feature hidden")); } void DesignPanel::on_move_feature(int delta) @@ -7742,9 +7641,7 @@ bool DesignPanel::enter_constrain_inline() m_viewport->finish_sketch(); // synchronous: packages live entities+constraints -> Sketch const int sk = resolve_extrude_sketch(); // last/selected Sketch feature if (sk < 0) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Draw a sketch first, then Constrain")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Draw a sketch first, then Constrain")); return false; } set_tree_selection(sk); // tree drives on_begin_constrain / the constraint manager @@ -7768,16 +7665,12 @@ void DesignPanel::on_begin_constrain(int sel_override) set_tree_selection(sel); // keep the tree in step with what the viewport says } if (sel == wxNOT_FOUND || sel >= int(m_doc.features.size())) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Select a sketch in the tree first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Select a sketch in the tree first")); return; } CadFeature& f = m_doc.features[sel]; if (f.type != CadFeatureType::Sketch) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Selected feature is not a sketch")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Selected feature is not a sketch")); return; } @@ -7786,17 +7679,13 @@ void DesignPanel::on_begin_constrain(int sel_override) if (!f.entities.empty()) { m_constrain_feat = sel; if (m_viewport) m_viewport->begin_constrain_entities(f.entities, f.plane); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Pick 1-2 lines, then a constraint; right-click exits")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Pick 1-2 lines, then a constraint; right-click exits")); return; } // Legacy profile path (Fase 3). if (f.profile.points.size() < 3) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Selected feature is not a sketch")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Selected feature is not a sketch")); return; } m_constrain_feat = sel; @@ -7805,9 +7694,7 @@ void DesignPanel::on_begin_constrain(int sel_override) if (f.constraints.empty()) f.constraints.push_back(SketchConstraintDef{SketchConstraintType::Fix, 0, -1, -1, -1, 0.0}); if (m_viewport) m_viewport->begin_constrain(f.profile, f.plane); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Pick 1-2 entities, then a constraint or dimension; right-click exits")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Pick 1-2 entities, then a constraint or dimension; right-click exits")); } // Why an entity-constraint pick was refused, as a localized string. The kernel's @@ -7863,9 +7750,7 @@ void DesignPanel::apply_entity_constraint(SketchConstraintType type) const ConstraintPlan plan = plan_entity_constraint(feat.entities, e0, e1, e2, type); auto fail = [this](const wxString& msg) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(msg); - m_status->Refresh(); + set_status(StatusKind::Error, msg); }; switch (plan.kind) { @@ -7902,9 +7787,7 @@ void DesignPanel::apply_live_constraint(SketchConstraintType type) m_viewport->sketch_entities(), e0, e1, e2, type); auto fail = [this](const wxString& msg) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(msg); - m_status->Refresh(); + set_status(StatusKind::Error, msg); }; // Shared commit: try_add_constraints appends→solves→keeps-or-rolls-back and leaves the // geometry untouched on failure, so the same over-constrained message the committed path @@ -7916,7 +7799,6 @@ void DesignPanel::apply_live_constraint(SketchConstraintType type) return; } m_viewport->request_repaint(); - m_status->SetForegroundColour(wxNullColour); // Say where it went and how to undo it, here at the moment of applying: the hint line // only refreshes when the step tuple changes, which applying a constraint does not. set_status(_L("Applied constraint · its badge is on the sketch — click the badge to remove it")); @@ -7965,9 +7847,7 @@ void DesignPanel::commit_entity_constraints(const std::vectorSetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Constraint rejected (over-constrained)")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Constraint rejected (over-constrained)")); return; } m_doc.recompute(); @@ -7978,9 +7858,7 @@ void DesignPanel::commit_entity_constraints(const std::vectorupdate_constrain_entities(m_doc.features[m_constrain_feat].entities); if (!m_doc.display_mesh.its.indices.empty()) feed_bodies(); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Applied constraint")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Applied constraint")); refresh_constrain_dof(); // P3 DoF readout for the Constrain path rebuild_constraint_list(); // C3.4 manager: a row appeared @@ -8166,9 +8044,7 @@ void DesignPanel::delete_constraint(int idx) if (live_constraint_scope()) { if (!m_viewport->remove_sketch_constraint(idx)) return; - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Constraint deleted")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Constraint deleted")); return; } if (m_constrain_feat < 0 || m_constrain_feat >= int(m_doc.features.size()) || !m_viewport) @@ -8188,9 +8064,7 @@ void DesignPanel::delete_constraint(int idx) m_viewport->update_constrain_entities(m_doc.features[m_constrain_feat].entities); if (!m_doc.display_mesh.its.indices.empty()) feed_bodies(); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Constraint deleted")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Constraint deleted")); refresh_constrain_dof(); rebuild_constraint_list(); } @@ -8199,15 +8073,11 @@ void DesignPanel::apply_edit_op(EditOp op) { if (m_constrain_feat < 0 || m_constrain_feat >= int(m_doc.features.size()) || !m_viewport || !m_viewport->is_constraining_entities()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Press Constrain on a sketch first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Press Constrain on a sketch first")); return; } auto fail = [this](const wxString& msg) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(msg); - m_status->Refresh(); + set_status(StatusKind::Error, msg); }; int e0 = -1, e1 = -1; @@ -8263,8 +8133,7 @@ void DesignPanel::apply_edit_op(EditOp op) if (a >= int(f.entities.size())) return; auto out = SketchEngine::offset_entities({ f.entities[a] }, d); if (out.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Offset collapsed the entity")); m_status->Refresh(); return; + set_status(StatusKind::Error, _L("Offset collapsed the entity")); return; } const int ni = int(f.entities.size()); // offset copy lands here for (auto& o : out) f.entities.push_back(o); @@ -8305,9 +8174,7 @@ void DesignPanel::apply_edit_op(EditOp op) if (a >= int(f.entities.size()) || b >= int(f.entities.size())) return; SketchEntity a_out, b_out, arc_out; if (!SketchEngine::fillet_lines(f.entities[a], f.entities[b], r, a_out, b_out, arc_out)) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Fillet failed (parallel lines or radius too large)")); - m_status->Refresh(); return; + set_status(StatusKind::Error, _L("Fillet failed (parallel lines or radius too large)")); return; } f.entities[a] = a_out; f.entities[b] = b_out; @@ -8386,9 +8253,7 @@ void DesignPanel::apply_edit_op(EditOp op) if (a >= int(f.entities.size()) || b >= int(f.entities.size())) return; SketchEntity a_out, b_out, seg_out; if (!SketchEngine::chamfer_lines(f.entities[a], f.entities[b], d, a_out, b_out, seg_out)) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Chamfer failed (parallel lines or distance too large)")); - m_status->Refresh(); return; + set_status(StatusKind::Error, _L("Chamfer failed (parallel lines or distance too large)")); return; } f.entities[a] = a_out; f.entities[b] = b_out; @@ -8575,8 +8440,7 @@ void DesignPanel::apply_edit_op(EditOp op) auto copies = SketchEngine::array_entities( { src }, count, sp * dir, 0.0, Vec2d(0, 0)); if (copies.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Array produced nothing")); m_status->Refresh(); return; + set_status(StatusKind::Error, _L("Array produced nothing")); return; } const int base = int(f.entities.size()); // first copy index for (auto& c : copies) f.entities.push_back(c); @@ -8653,8 +8517,7 @@ void DesignPanel::apply_edit_op(EditOp op) auto out = SketchEngine::transform_entities( { f.entities[a] }, Vec2d(dx, dy), 0.0, 1.0, Vec2d(0, 0)); if (out.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Move produced nothing")); m_status->Refresh(); return; + set_status(StatusKind::Error, _L("Move produced nothing")); return; } f.entities[a] = out[0]; @@ -8721,8 +8584,7 @@ void DesignPanel::apply_edit_op(EditOp op) auto out = SketchEngine::transform_entities( { f.entities[a] }, Vec2d(0, 0), deg * M_PI / 180.0, 1.0, piv); if (out.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Rotate produced nothing")); m_status->Refresh(); return; + set_status(StatusKind::Error, _L("Rotate produced nothing")); return; } f.entities[a] = out[0]; @@ -8780,8 +8642,7 @@ void DesignPanel::apply_edit_op(EditOp op) auto out = SketchEngine::transform_entities( { f.entities[a] }, Vec2d(0, 0), 0.0, sf, piv); if (out.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Scale produced nothing")); m_status->Refresh(); return; + set_status(StatusKind::Error, _L("Scale produced nothing")); return; } f.entities[a] = out[0]; @@ -8850,8 +8711,7 @@ void DesignPanel::apply_edit_op(EditOp op) auto copies = SketchEngine::array_entities( { src }, count, Vec2d(0, 0), angle_step, piv); if (copies.empty()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Polar array produced nothing")); m_status->Refresh(); return; + set_status(StatusKind::Error, _L("Polar array produced nothing")); return; } const int base = int(f.entities.size()); // first copy index for (auto& c : copies) f.entities.push_back(c); @@ -8923,9 +8783,7 @@ void DesignPanel::after_edit_op() sync_sketch_display(); if (!m_doc.display_mesh.its.indices.empty()) feed_bodies(); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Applied edit")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Applied edit")); refresh_constrain_dof(); rebuild_constraint_list(); } @@ -8945,9 +8803,7 @@ void DesignPanel::request_value(const wxString& label, double def, double mn, do m_form->FitInside(); m_value_input->SetFocus(); m_value_input->SetSelection(-1, -1); // select all so typing replaces the value - m_status->SetForegroundColour(wxNullColour); - set_status(label + _L(" — type a value, press Enter (or Confirm)")); - m_status->Refresh(); + set_status(StatusKind::Info, label + _L(" — type a value, press Enter (or Confirm)")); } void DesignPanel::confirm_value() @@ -8976,9 +8832,7 @@ void DesignPanel::cancel_value() update_cards_frame(); m_form->Layout(); m_form->FitInside(); if (was_open) { - m_status->SetForegroundColour(wxNullColour); - set_status(wxString()); - m_status->Refresh(); + set_status(StatusKind::Info, wxString()); } if (on_cancel) on_cancel(); // e.g. keep a pending line segment as drawn @@ -9000,9 +8854,7 @@ void DesignPanel::apply_constraint(SketchConstraintType type) if (m_constrain_feat < 0 || m_constrain_feat >= int(m_doc.features.size()) || m_viewport == nullptr) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Press Constrain on a sketch first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Press Constrain on a sketch first")); return; } @@ -9014,16 +8866,12 @@ void DesignPanel::apply_constraint(SketchConstraintType type) // 3. Legacy profile path. if (!m_viewport->is_constraining()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Press Constrain on a sketch first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Press Constrain on a sketch first")); return; } int a = -1, b = -1; if (!m_viewport->selected_segment(a, b)) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Pick a segment in the viewport first")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Pick a segment in the viewport first")); return; } CadFeature& feat = m_doc.features[m_constrain_feat]; @@ -9036,9 +8884,7 @@ void DesignPanel::apply_constraint(SketchConstraintType type) feat.constraints.pop_back(); // reject the non-converging addition feat.profile.points = saved_pts; // and restore the pre-solve geometry m_doc.abandon_checkpoint(); // restored: no state change, so no undo step - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Constraint rejected (over-constrained)")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Constraint rejected (over-constrained)")); return; } m_doc.recompute(); @@ -9047,10 +8893,8 @@ void DesignPanel::apply_constraint(SketchConstraintType type) m_viewport->update_constrain_profile(m_doc.features[m_constrain_feat].profile.points); if (!m_doc.display_mesh.its.indices.empty()) feed_bodies(); - m_status->SetForegroundColour(wxNullColour); - set_status(type == SketchConstraintType::Horizontal ? _L("Applied Horizontal") + set_status(StatusKind::Info, type == SketchConstraintType::Horizontal ? _L("Applied Horizontal") : _L("Applied Vertical")); - m_status->Refresh(); } void DesignPanel::reset_edit_state() @@ -9433,9 +9277,7 @@ void DesignPanel::on_edit_feature() m_viewport->set_display_sketches({}); m_viewport->edit_sketch(f.entities, f.entity_constraints, f.plane); } - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Editing sketch — drag a handle or click a quote to edit")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Editing sketch — drag a handle or click a quote to edit")); } else { load_feature_into_dialog(f); open_tool(Tool::Sketch); @@ -9610,16 +9452,12 @@ void DesignPanel::on_edit_feature() // job, and that feature already exists — so point there rather than invent a dialog // that would only duplicate it. (Imported 2D Text/SVG art is different and IS // re-editable; it arrives as a Sketch feature with imported_regions, handled above.) - m_status->SetForegroundColour(wxNullColour); - set_status(_L("An imported solid has no parameters — use Transform to move or rotate it")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("An imported solid has no parameters — use Transform to move or rotate it")); break; default: // Every CadFeatureType now has a case. Kept as a guard so a type added later // announces itself instead of silently swallowing the Edit click. - m_status->SetForegroundColour(wxNullColour); - set_status(_L("This feature type can't be edited yet")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("This feature type can't be edited yet")); break; } } @@ -9630,9 +9468,7 @@ void DesignPanel::on_export_step() if (m_active != Tool::None) confirm_tool(); if (m_doc.bodies.empty()) { - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Nothing to export — add a feature first")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Nothing to export — add a feature first")); return; } wxFileDialog dlg(this, _L("Export STEP"), wxEmptyString, "model.step", @@ -9643,9 +9479,9 @@ void DesignPanel::on_export_step() sync_body_xform(); // export bodies at their displayed Move-gizmo positions std::string err; const bool ok = m_doc.export_step(dlg.GetPath().ToUTF8().data(), m_body_xform, err); - m_status->SetForegroundColour(ok ? wxColour(120, 210, 120) : wxColour(235, 110, 110)); - set_status(ok ? _L("Exported STEP") - : _L("STEP export failed: ") + wxString::FromUTF8(err)); + set_status(ok ? StatusKind::Ok : StatusKind::Error, + ok ? _L("Exported STEP") + : wxString::Format(_L("STEP export failed: %s"), wxString::FromUTF8(err))); m_status->Refresh(); } @@ -9787,6 +9623,10 @@ CadFeature DesignPanel::build_candidate(Tool t) const f.thread_internal = m_thread_internal->GetValue(); f.thread_x = m_thread_x->GetValue(); f.thread_y = m_thread_y->GetValue(); + // The field is the nominal (major) diameter. A thread from an older project being + // re-edited keeps the reading it was made with (f was seeded from it), so editing its + // pitch does not also silently change its diameter. + if (!editing) f.thread_major_nominal = true; if (m_thread_on_face) f.target_body = m_thread_face_body; // tap the right body break; case Tool::Shell: @@ -9824,6 +9664,13 @@ CadFeature DesignPanel::build_candidate(Tool t) const f.pattern_spacing = m_pattern_spacing->GetValue(); f.pattern_dir = m_pattern_dir->GetSelection(); f.pattern_angle = m_pattern_angle->GetValue(); + if (!editing) { + // What add_pattern commits, so the preview is the pattern that will be made: the + // bed-centred XY plane, and copies spanning the whole angle. + f.pattern_inclusive = true; + f.plane = SketchPlane::XY(); + f.plane.origin += m_doc.modeling_origin; + } break; case Tool::Plane: f.type = CadFeatureType::Plane; @@ -10669,7 +10516,6 @@ void DesignPanel::refresh_preview() if (m_active == Tool::Sketch || m_active == Tool::Plane || m_active == Tool::Axis || m_active == Tool::CoordSys || m_active == Tool::Helix || m_active == Tool::Project) { m_viewport->clear_preview(); - m_status->SetForegroundColour(wxColour(120, 210, 120)); wxString ready; switch (m_active) { case Tool::Plane: ready = _L("Plane ready"); break; @@ -10679,7 +10525,7 @@ void DesignPanel::refresh_preview() case Tool::Project: ready = _L("Project ready"); break; default: ready = _L("Sketch ready"); break; } - set_status(ready); + set_status(StatusKind::Ok, ready); for (wxButton* b : m_confirm_btns) if (b) b->Enable(true); m_status->Refresh(); update_datum_gizmo(); // Plane card: show/refresh the in-canvas resize handles @@ -10703,13 +10549,11 @@ void DesignPanel::refresh_preview() if (!has_two) { m_viewport->clear_preview(); m_viewport->set_body_hidden(false); // the ghost replaced them; give them back - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Mate needs at least two CoordSys features")); + set_status(StatusKind::Error, _L("Mate needs at least two CoordSys features")); } else if (same) { m_viewport->clear_preview(); m_viewport->set_body_hidden(false); - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Mate: CS A and CS B must be different")); + set_status(StatusKind::Error, _L("Mate: CS A and CS B must be different")); } else { sync_body_xform(); // same reason as the solid path below: drop stale per-body poses const int cs_a = int(reinterpret_cast(m_mate_cs_a->GetClientData(sel_a))); @@ -10720,11 +10564,9 @@ void DesignPanel::refresh_preview() m_mate_angle ? m_mate_angle->GetValue() : 0.0, m_mate_flip && m_mate_flip->GetValue(), err); if (ok) { - m_status->SetForegroundColour(wxColour(120, 210, 120)); - set_status(_L("Mate ready")); + set_status(StatusKind::Ok, _L("Mate ready")); } else { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Invalid: ") + wxString::FromUTF8(err)); + set_status(StatusKind::Error, wxString::Format(_L("Invalid: %s"), kernel_error_text(err))); } } for (wxButton* b : m_confirm_btns) if (b) b->Enable(ok); @@ -10766,12 +10608,10 @@ void DesignPanel::refresh_preview() if (ok) { m_viewport->set_preview_mesh(mesh); - m_status->SetForegroundColour(wxColour(120, 210, 120)); // ok = green - set_status(wxString::Format(_L("Preview — %zu triangles"), mesh.its.indices.size())); + set_status(StatusKind::Ok, wxString::Format(_L("Preview — %zu triangles"), mesh.its.indices.size())); } else { m_viewport->clear_preview(); - m_status->SetForegroundColour(wxColour(235, 110, 110)); // invalid = red - set_status(_L("Invalid: ") + wxString::FromUTF8(err)); + set_status(StatusKind::Error, wxString::Format(_L("Invalid: %s"), kernel_error_text(err))); } // Onshape parity: a broken candidate cannot be committed. Grey the active dialog's // Confirm so the user sees the gate before clicking; the red status says why. @@ -10848,11 +10688,9 @@ void DesignPanel::apply_move_card() m_body_xform[b] = x * m_move_prev; feed_bodies(); if (m_viewport) m_viewport->request_repaint(); - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(_L("Body %d — moved (%.1f, %.1f, %.1f) mm, rotated %.1f°"), + set_status(StatusKind::Info, wxString::Format(_L("Body %d — moved (%.1f, %.1f, %.1f) mm, rotated %.1f°"), b + 1, d.x(), d.y(), d.z(), m_move_angle ? m_move_angle->GetValue() : 0.0)); - m_status->Refresh(); } void DesignPanel::show_move_card(bool show) @@ -11280,9 +11118,7 @@ void DesignPanel::cancel_tool() close_tool(); // Cancel discards the candidate: clear the stale "Preview …"/"Invalid …" // label and restore the neutral idle colour (Confirm keeps its "OK" status). - m_status->SetForegroundColour(wxNullColour); - set_status(wxString()); - m_status->Refresh(); + set_status(StatusKind::Info, wxString()); } // One Confirm surface for the whole tab. Routes to the right commit by current context: @@ -11301,7 +11137,10 @@ void DesignPanel::tool_confirm() if (m_active == Tool::Insert) { finalize_insert(); return; } if (m_active != Tool::None) { confirm_tool(); return; } if (m_ui_mode == UiMode::Sketch) { - if (m_viewport && m_viewport->is_sketching()) m_viewport->finish_sketch(); + if (m_viewport && m_viewport->is_sketching()) { + m_viewport->sketch_confirm_pending(); // a ready edit-op/transform/chain is kept, not dropped + m_viewport->finish_sketch(); + } set_ui_mode(UiMode::Feature); return; } @@ -11310,9 +11149,7 @@ void DesignPanel::tool_confirm() if (m_viewport) m_viewport->end_constrain(); m_constrain_feat = -1; set_ui_mode(UiMode::Feature); - m_status->SetForegroundColour(wxNullColour); - set_status(wxString()); - m_status->Refresh(); + set_status(StatusKind::Info, wxString()); } } @@ -11330,9 +11167,7 @@ void DesignPanel::tool_cancel() show_move_card(false); feed_bodies(); // re-render the reverted placement update_action_bar(); - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Move cancelled")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Move cancelled")); return; } if (m_active == Tool::Insert) { cancel_insert(); return; } @@ -11356,9 +11191,7 @@ void DesignPanel::tool_cancel() set_ui_mode(UiMode::Feature); sync_sketch_display(); refresh_tree(); - m_status->SetForegroundColour(wxNullColour); - set_status(wxString()); - m_status->Refresh(); + set_status(StatusKind::Info, wxString()); return; } if (m_ui_mode == UiMode::Constrain) { @@ -11366,12 +11199,24 @@ void DesignPanel::tool_cancel() if (m_viewport) m_viewport->end_constrain(); m_constrain_feat = -1; set_ui_mode(UiMode::Feature); - m_status->SetForegroundColour(wxNullColour); - set_status(wxString()); - m_status->Refresh(); + set_status(StatusKind::Info, wxString()); } } +bool DesignPanel::confirm_enabled() const +{ + if (m_value_cont) return true; + if (m_active == Tool::None) + return (m_viewport && m_viewport->moving_body()) + || m_ui_mode == UiMode::Sketch || m_ui_mode == UiMode::Constrain; + if (m_active == Tool::Insert) return true; + for (wxButton* b : m_confirm_btns) + if (b != nullptr && b->IsShownOnScreen()) return b->IsEnabled(); + for (wxButton* b : m_confirm_btns) + if (b != nullptr) return b->IsEnabled(); + return true; +} + // Which level of the interaction stack one Esc press belongs to. The rule itself lives in // DesignInteraction.hpp, decidable without a window; this only answers the four questions it // asks about THIS panel. @@ -11415,9 +11260,7 @@ void DesignPanel::escape() // puts the body back at the pose it had when the gizmo appeared. if (m_viewport && m_viewport->drawing_in_progress()) { m_viewport->sketch_abort_gesture(); - m_status->SetForegroundColour(wxNullColour); - set_status(wxString()); - m_status->Refresh(); + set_status(StatusKind::Info, wxString()); return; } tool_cancel(); @@ -11430,9 +11273,7 @@ void DesignPanel::escape() // back to Select, leaving every entity already drawn exactly where it is. if (m_active != Tool::None || m_ui_mode == UiMode::Constrain) { tool_cancel(); return; } if (m_viewport && m_viewport->sketch_disarm_tool()) { - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Select")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Select")); } return; @@ -11443,9 +11284,7 @@ void DesignPanel::escape() if (m_viewport && m_viewport->clear_any_selection()) { m_sel_sketch_region = -1; m_sel_sketch_feat = -1; - m_status->SetForegroundColour(wxNullColour); - set_status(wxString()); - m_status->Refresh(); + set_status(StatusKind::Info, wxString()); return; } // Nothing selected and nothing to unwind. An EMPTY sketch session may as well close — @@ -11456,20 +11295,31 @@ void DesignPanel::escape() return; } if (m_ui_mode == UiMode::Sketch) { - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Sketch kept — Finish to commit it, Cancel to discard")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Sketch kept — Finish to commit it, Cancel to discard")); } return; } } +bool DesignPanel::menu_can_undo_redo(bool redo) const +{ + if (m_ui_mode == UiMode::Sketch && m_viewport && m_viewport->is_sketching()) + return redo ? m_viewport->can_redo_sketch_entity() : m_viewport->can_undo_sketch_entity(); + if (m_ui_mode != UiMode::Feature || m_active != Tool::None) return false; + return redo ? m_doc.can_redo() : m_doc.can_undo(); +} + void DesignPanel::update_undo_redo_buttons() { // Grey Undo/Redo to mirror exactly what do_undo_redo will do: it acts only in Feature // mode with no tool/dialog open (otherwise Esc is the way out), so reflect that gate here // as well as the document's available history. if (m_btn_undo == nullptr || m_btn_redo == nullptr) return; + if (m_ui_mode == UiMode::Sketch && m_viewport && m_viewport->is_sketching()) { + m_btn_undo->Enable(m_viewport->can_undo_sketch_entity()); + m_btn_redo->Enable(m_viewport->can_redo_sketch_entity()); + return; + } const bool gated = (m_ui_mode != UiMode::Feature) || (m_active != Tool::None); m_btn_undo->Enable(!gated && m_doc.can_undo()); m_btn_redo->Enable(!gated && m_doc.can_redo()); @@ -11509,20 +11359,24 @@ void DesignPanel::update_action_bar() void DesignPanel::do_undo_redo(bool redo) { + // Inside a live sketch, history is the sketch's own: the last drawn shape comes off, and + // comes back. Keys and buttons both land here, so they cannot disagree. + if (m_ui_mode == UiMode::Sketch && m_viewport && m_viewport->is_sketching()) { + const bool ok = redo ? m_viewport->redo_last_sketch_entity() : m_viewport->undo_last_sketch_entity(); + if (!ok) set_status(redo ? _L("Nothing to redo") : _L("Nothing to undo")); + update_undo_redo_buttons(); + return; + } // v1: act only in Feature mode. While authoring/constraining a sketch (m_ui_mode) or // with a feature dialog open (m_active), Esc/Cancel is the way out — popping committed // history mid-tool would be ambiguous (and could orphan the tool's referenced feature). if (m_ui_mode != UiMode::Feature || m_active != Tool::None) { - m_status->SetForegroundColour(wxNullColour); - set_status(_L("Finish or cancel the current tool first (Esc)")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Finish or cancel the current tool first (Esc)")); return; } const bool ok = redo ? m_doc.redo() : m_doc.undo(); if (!ok) { - m_status->SetForegroundColour(wxNullColour); - set_status(redo ? _L("Nothing to redo") : _L("Nothing to undo")); - m_status->Refresh(); + set_status(StatusKind::Info, redo ? _L("Nothing to redo") : _L("Nothing to undo")); return; } // The solid whole/face/edge pick and any in-place edit reference ids that recompute() @@ -11531,10 +11385,8 @@ void DesignPanel::do_undo_redo(bool redo) m_pick_face = m_pick_face_body = -1; // recompute() invalidated the face ids too reset_edit_state(); after_tree_edit(true); // refresh tree + viewport meshes + status from the restored doc - m_status->SetForegroundColour(wxNullColour); - set_status(wxString::Format(redo ? _L("Redo (%zu more)") : _L("Undo (%zu more)"), + set_status(StatusKind::Info, wxString::Format(redo ? _L("Redo (%zu more)") : _L("Undo (%zu more)"), redo ? m_doc.redo_depth() : m_doc.undo_depth())); - m_status->Refresh(); } // --- Document variables panel --------------------------------------------------------- @@ -11557,9 +11409,7 @@ void DesignPanel::on_add_variable() if (name.IsEmpty()) return; name.Trim(true).Trim(false); if (name.Contains(' ')) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("Variable name must not contain spaces")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("Variable name must not contain spaces")); return; } wxString expr = ::wxGetTextFromUser( @@ -11649,7 +11499,7 @@ std::vector DesignPanel::fields_for_tool(Tool t) case T::Extrude: return {"distance", "distance2", "taper_deg"}; case T::Dressup: return {"dressup_size"}; case T::Hole: return {"hole_diameter", "hole_depth", "hole_x", "hole_y"}; - case T::Thread: return {"thread_radius", "thread_pitch", "thread_height", "thread_depth", "thread_x", "thread_y"}; + case T::Thread: return {"thread_diameter", "thread_pitch", "thread_height", "thread_depth", "thread_x", "thread_y"}; case T::Shell: return {"shell_thickness"}; case T::Revolve: return {"revolve_angle"}; case T::Sweep: return {}; @@ -11702,6 +11552,12 @@ void DesignPanel::on_set_expr() const std::string field = fwx.ToUTF8().data(); const std::string expr = ewx.ToUTF8().data(); + // The picker is editable; a name the evaluator does not know would make every later + // recompute fail, so it is refused here with the reason. + if (!CadDocument::is_bindable_field(field)) { + set_status(StatusKind::Error, wxString::Format(_L("\"%s\" is not a value an expression can drive"), fwx)); + return; + } m_doc.checkpoint(); m_doc.features[m_edit_index].expr[field] = expr; @@ -11741,9 +11597,7 @@ void DesignPanel::on_clear_expr() const std::string field = fwx.ToUTF8().data(); auto& feat_expr = m_doc.features[m_edit_index].expr; if (feat_expr.find(field) == feat_expr.end()) { - m_status->SetForegroundColour(wxColour(235, 110, 110)); - set_status(_L("No binding for that field")); - m_status->Refresh(); + set_status(StatusKind::Error, _L("No binding for that field")); return; } diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index 16f0a2722c..34de9258aa 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -87,6 +87,13 @@ public: // Defined out of line in DesignPanel.cpp: it needs kOfferVerbs, which this header deliberately // does not include (the table is generated and belongs to the offer-menu code). bool mcp_run_verb(const char* verb_id); + // Would a request from the control socket collide with what the GUI is doing — a rebuild + // in progress, an open feature card, a sketch session? `sketch_method` = it drives the live + // sketch rather than the feature list. Fills `why` when it would. + bool mcp_busy(bool sketch_method, std::string& why) const; + // Load the project's recipe into an empty document, as showing the tab does. The control + // socket may be the first thing to touch the Design tab after a project was opened. + void hydrate_from_model(); private: enum class Tool { None, Sketch, Extrude, Dressup, Hole, Thread, Shell, Revolve, Sweep, Pattern, Plane, Loft, Draft, Boolean, Cut, Insert, Axis, CoordSys, SurfaceExtrude, SurfaceRevolve, SurfaceLoft, SurfaceFill, SurfaceOffset, ThickenSurface, Transform, Mirror, Thicken, Rib, Project, DeleteFace, Helix, Mate }; @@ -115,6 +122,7 @@ private: // used to be handled in four places that could not see each other, and that is how two // presses in a row reached past a tool and discarded the sketch under it. CadLevel escape_level() const; + bool confirm_enabled() const; // would the ✓ act right now (and is it not greyed)? void escape(); void update_action_bar(); // show the ✓/✗ bar iff a tool or mode is active @@ -125,7 +133,7 @@ private: void on_add_hole(); void on_add_thread(); void apply_thread_standard(); // fill pitch/depth/radius from m_thread_std selection - void infer_thread_spec(double diameter); // nearest M-standard from a picked cylinder diameter + void infer_thread_spec(double diameter, bool internal); // nearest standard from a picked cylinder void on_add_revolve(); void on_add_sweep(); void on_add_loft(); @@ -275,6 +283,12 @@ private: // Ctrl+Z / Ctrl+Shift+Z (Ctrl+Y) from the viewport. With a tool/dialog open it // cancels that (Esc-like); otherwise it undoes/redoes the committed feature history. void do_undo_redo(bool redo); +public: + // Edit > Undo / Redo while this tab is shown: the same route and the same gate as the keys + // and the toolbar buttons. + void menu_undo_redo(bool redo) { do_undo_redo(redo); } + bool menu_can_undo_redo(bool redo) const; +private: // The plane the Hole tool drills on: a picked face (inward, centred) or the dropdown. SketchPlane hole_plane() const; // The plane the Thread tool builds on: a picked cylindrical face (axis) or the dropdown. @@ -718,8 +732,13 @@ private: std::map> m_verb_actions; // Append an offer row with its toolbar glyph. The bitmap must be set BEFORE Append — // wxGTK builds the GtkMenuItem there and only makes an image item if one is present. - // Every status write goes through here so long hints wrap instead of clipping. - void set_status(const wxString& text); + // Every status write goes through here so long hints wrap instead of clipping. The kind + // sets the colour AND a leading glyph, so a message's meaning never rests on colour alone + // (charter 6.2), and every message sets its own kind instead of inheriting the last one's. + enum class StatusKind { Info, Ok, Warning, Error }; + void set_status(StatusKind kind, const wxString& text); + void set_status(const wxString& text) { set_status(StatusKind::Info, text); } + static wxString kernel_error_text(const std::string& err); // a kernel message, in words a modeller reads wxString idle_hint() const; // what to say when nothing is selected // Reason detect_mate_conflicts() recorded for a feature, or nullptr. Marks the tree row and // feeds the status line; a conflict is a diagnostic, not a document error. diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 078c33752e..376392c23e 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -4,6 +4,8 @@ #include "slic3r/GUI/ImGuiWrapper.hpp" #include "slic3r/GUI/CAD/SketchInlineEditor.hpp" #include "slic3r/GUI/Plater.hpp" +#include "slic3r/GUI/I18N.hpp" +#include "libslic3r/format.hpp" #include #include @@ -74,6 +76,7 @@ static void push_auto_close_pref() void DesignSketchTool::begin(const SketchPlane& plane, Mode mode) { + m_sketch_redo.clear(); push_auto_close_pref(); m_plane = plane; @@ -234,6 +237,9 @@ void DesignSketchTool::set_tool(Mode mode) // This MUST run before m_mode is reassigned: op_ready() and confirm_op() both switch on // m_mode, so after the assignment they would test the tool being switched TO. That read // op_ready()==0 with a=0 b=3 val=28.205 sitting right there — picked, valued, and dropped. + // Charter 4.2: "starting another operation while a valid feature is pending commits it" — + // the ghost is on screen, so switching away keeps it. Esc is the discard (disarm_tool drops + // the pending op/transform before it gets here). if (op_ready()) confirm_op(); // And the same rule for the transform gizmo: a ready edit-op committed here while a pending // transform was silently dropped, which is the same "the value was set, the ghost was drawn, @@ -253,6 +259,7 @@ void DesignSketchTool::set_tool(Mode mode) m_mode = mode; m_points.clear(); m_has_cursor = false; + m_cursor_snap = InferenceSnap{}; // the previous tool's snap marker is not this tool's // DRAIN THE QUEUED DIMENSIONS, do not just resync the baseline. on_inline_commit() above // commits the field that is open, and the commit callback installed by // open_next_autoedit_dim does `++m_autoedit_dim_idx; CallAfter(open_next_autoedit_dim)` — @@ -312,6 +319,7 @@ void DesignSketchTool::set_tool(Mode mode) void DesignSketchTool::cancel() { + m_sketch_redo.clear(); close_session_chrome(); // same orphaned-field freeze as finish() — see yce m_active = false; m_step_mode_last = -1; @@ -339,22 +347,71 @@ void DesignSketchTool::cancel() reset_tf(); } +bool DesignSketchTool::confirm_pending() +{ + if (op_ready()) { confirm_op(); return true; } + if (tf_ready()) { confirm_transform(); return true; } + if (!m_points.empty() && end_chain()) return true; + return false; +} + +// End a Polyline / Spline chain as drawn (open), the one rule behind right-click, double-click +// and Enter. The first click of a double-click lands as an ordinary LeftDown on some platforms, +// so a final point within a few pixels of the one before it is that click again, not a pole. +bool DesignSketchTool::end_chain() +{ + if (m_mode != Mode::Polyline && m_mode != Mode::BSpline) return false; + std::vector pts; + for (const Vec2d& q : m_points) + if (pts.empty() || (q - pts.back()).norm() > m_chain_dup_tol) pts.push_back(q); + const int base = int(m_entities.size()); + if (pts.size() >= 2) { + if (m_mode == Mode::Polyline) push_open_chain(pts); + else append_entities(make_bspline(pts)); + infer_auto_constraints(base); // end poles auto-Coincident -> loops close + } + m_points.clear(); + emit_step_hint(); + return true; +} + +void DesignSketchTool::show_refusal(const std::string& why) +{ + if (inline_editor != nullptr && inline_editor->refuse(why)) return; + notify(why); +} + // CadLevel::Gesture inside a sketch: drop the entity being drawn, keep the tool armed. bool DesignSketchTool::abort_gesture() { - if (m_points.empty()) return false; + if (!gesture_pending()) return false; m_points.clear(); m_has_cursor = false; + // Picks are a gesture too: drop them, never apply them, and keep the tool armed. + if (has_pending_picks()) { + reset_op(); + reset_tf(); + m_dim_has0 = false; + m_dim_e0 = -1; + m_dim_r0 = SketchPointRole::P0; + m_pick0 = m_pick1 = m_pick2 = -1; + m_sel_a = m_sel_b = -1; + m_selection.clear(); + m_point_sel.clear(); + if (on_selection_changed) on_selection_changed(0); + } + emit_step_hint(); return true; } // CadLevel::Tool inside a sketch: an armed draw/edit tool falls back to Select. -// Drop any pending edit-op BEFORE the downgrade: set_tool commits a ready one, and Esc must -// cancel it, never apply it. Right-click already discards it through its own branch. +// Drop any pending edit-op or transform BEFORE the downgrade: set_tool commits a ready one, +// and Esc must cancel it, never apply it. Right-click already discards it through its own branch. bool DesignSketchTool::disarm_tool() { if (m_mode == Mode::Select) return false; reset_op(); + reset_tf(); set_tool(Mode::Select); return true; } @@ -379,11 +436,6 @@ void DesignSketchTool::request_exit() else cancel(); } -void DesignSketchTool::request_undo_redo(bool redo) -{ - if (on_undo_redo) on_undo_redo(redo); -} - void DesignSketchTool::clear_selection() { if (m_selection.empty() && m_point_sel.empty()) return; @@ -392,6 +444,49 @@ void DesignSketchTool::clear_selection() if (on_selection_changed) on_selection_changed(0); } +bool DesignSketchTool::can_redo_entity() const +{ + return m_active && !m_sketch_redo.empty() + && m_sketch_redo.back().after_entities == m_entities.size() + && m_sketch_redo.back().after_constraints == m_constraints.size(); +} + +bool DesignSketchTool::redo_last_entity() +{ + if (!can_redo_entity()) { m_sketch_redo.clear(); return false; } + SketchSnap s = std::move(m_sketch_redo.back()); + m_sketch_redo.pop_back(); + m_entities = std::move(s.entities); + m_constraints = std::move(s.constraints); + m_features = std::move(s.features); + m_dimensions = std::move(s.dimensions); + m_selection.clear(); + m_point_sel.clear(); + reset_autoedit(); + resolve_live(); + if (on_selection_changed) on_selection_changed(0); + return true; +} + +bool DesignSketchTool::undo_last_entity() +{ + if (!m_active || m_entities.empty()) return false; + if (!can_redo_entity()) m_sketch_redo.clear(); // the sketch moved on since the last undo + SketchSnap snap{ m_entities, m_constraints, m_features, m_dimensions, 0, 0 }; + const int last = int(m_entities.size()) - 1; + int begin = last; + for (const Feature& f : m_features) + if (f.begin <= last && last < f.end && f.end == last + 1) begin = std::min(begin, f.begin); + m_selection.clear(); + for (int i = begin; i <= last; ++i) m_selection.push_back(i); + delete_selected(); + reset_autoedit(); + snap.after_entities = m_entities.size(); + snap.after_constraints = m_constraints.size(); + m_sketch_redo.push_back(std::move(snap)); + return true; +} + void DesignSketchTool::delete_selected() { if (m_selection.empty()) return; @@ -406,21 +501,39 @@ void DesignSketchTool::delete_selected() if (!del[i]) remap[i] = next++; for (int i = n - 1; i >= 0; --i) if (del[i]) m_entities.erase(m_entities.begin() + i); - // Drop constraints touching a deleted entity; remap the survivors. + // Drop constraints touching a deleted entity; remap the survivors. A negative reference is + // not "no entity" but a sentinel (origin, X axis, Y axis — kSketchRef*) and passes through + // unchanged: mapping it to -1 silently cut every constraint onto the origin or an axis. std::vector kept; + std::vector con_remap(m_constraints.size(), -1); auto live = [&](int e) { return e < 0 || (e < n && remap[e] >= 0); }; - auto map = [&](int e) { return e < 0 ? -1 : remap[e]; }; - for (SketchEntityConstraintDef c : m_constraints) { + auto map = [&](int e) { return e < 0 ? e : remap[e]; }; + for (int ci = 0; ci < int(m_constraints.size()); ++ci) { + SketchEntityConstraintDef c = m_constraints[ci]; if (!live(c.ea) || !live(c.eb) || !live(c.ec)) continue; c.ea = map(c.ea); c.eb = map(c.eb); c.ec = map(c.ec); + con_remap[ci] = int(kept.size()); kept.push_back(c); } m_constraints.swap(kept); m_selection.clear(); m_point_sel.clear(); - // v1: placed quotes reference entity indices that have shifted; drop them rather - // than risk a dangling reference (the driving constraints survive, reindexed). - m_dimensions.clear(); + // Placed quotes follow their geometry and their driving constraint: a quote whose entity or + // constraint went away goes with it, the others are reindexed. Clearing them all made one + // Delete hide every label while the constraints they showed kept driving the sketch. + { + std::vector kept_d; + for (DimAnnot a : m_dimensions) { + if (!live(a.ea) || !live(a.eb)) continue; + if (a.con >= 0) { + if (a.con >= int(con_remap.size()) || con_remap[a.con] < 0) continue; + a.con = con_remap[a.con]; + } + a.ea = map(a.ea); a.eb = map(a.eb); + kept_d.push_back(a); + } + m_dimensions.swap(kept_d); + } m_dim_has0 = false; m_pending_dim = -1; // The Dimension tool's pending FIRST pick is the same dangling-reference hazard as the placed @@ -617,9 +730,8 @@ void DesignSketchTool::apply_dimension(double v) kind == DimType::Diameter); if (!std::isfinite(v) || (needs_positive && v <= 0.0) || (!needs_positive && kind != DimType::Angle && kind != DimType::None && v < 0.0)) { - if (on_readout) - on_readout(needs_positive ? "the value must be greater than zero" - : "the value must not be negative (zero means coincident)"); + show_refusal(needs_positive ? _u8L("The value must be greater than zero") + : _u8L("The value must not be negative (zero means coincident)")); return; } switch (dimension_kind()) { @@ -670,8 +782,8 @@ void DesignSketchTool::apply_dimension(double v) } record_dimension_constraint(v); // store a driving constraint for this dimension resolve_live(); // live-solve so the viewport shows the solved sketch - if (!m_solve_ok && on_readout) // the number on screen is not the geometry's number - on_readout("that dimension cannot be satisfied — the sketch is over-constrained"); + if (!m_solve_ok) // the number on screen is not the geometry's number + notify(_u8L("That dimension cannot be satisfied — the sketch is over-constrained")); m_selection.clear(); if (on_selection_changed) on_selection_changed(0); } @@ -761,6 +873,14 @@ void DesignSketchTool::resolve_live_drag(int dragged_ei, SketchPointRole dragged : sketch_solve(m_entities, cons); m_dof = r.dof; m_solve_ok = r.ok; + // Constraints the solver had to leave out (no representation for the part they name) + // are said once, when their number changes — resolve_live runs on every drag frame. + if (int(r.skipped.size()) != m_skipped_last) { + m_skipped_last = int(r.skipped.size()); + if (m_skipped_last > 0) + notify(format(_u8L("%1% constraint(s) cannot act on this geometry (an ellipse or spline curve, " + "or a zero-size circle) and are ignored"), m_skipped_last), false); + } // Flag every entity referenced by a conflicting constraint so render() can // tint it red (Onshape/SolveSpace over-constrained feedback), and remember which // DIMENSIONS those constraints drive: a label showing a value the geometry does not have @@ -900,8 +1020,8 @@ bool DesignSketchTool::update_hover(GLCanvas3D& canvas, wxMouseEvent& evt) Vec2d p; screen_to_plane(canvas, evt, p); // Zoom-aware pick tolerance: project a point a few px away and measure in plane units. - const Linef3 r2 = canvas.mouse_ray(Point(evt.GetX() + 6, evt.GetY())); - const double tol = std::max(1e-3, (m_plane.project(r2.a, r2.vector()) - p).norm()); + // The SAME budget a click grabs with: a handle that looks un-hovered must not be grabbable. + const double tol = screen_tol(canvas, evt, p, kPickPx); const bool had = m_has_hover_handle; const Handle prev = m_hover_handle; Handle h; @@ -1288,7 +1408,7 @@ void DesignSketchTool::open_angle_editor(int ei) if (!on_inline_edit) return; DimAnnot a; a.kind = DimType::Angle; a.ea = ei; const wxPoint px(m_last_mouse_x, m_last_mouse_y); - on_inline_edit(px, measure_dim(a), "Angle", + on_inline_edit(px, measure_dim(a), _u8L("Angle (°)"), [this, ei](double deg) { set_line_angle(ei, deg); }, []() {}); } @@ -1306,16 +1426,7 @@ bool DesignSketchTool::open_selection_dimension_editor() if (!on_inline_edit || !selection_valid()) return false; const DimType k = dimension_kind(); if (k == DimType::None) return false; - const char* title = "Value"; - switch (k) { - case DimType::Length: title = "Length"; break; - case DimType::Radius: title = "Radius"; break; - case DimType::Diameter: title = "Diameter"; break; - case DimType::Angle: title = "Angle"; break; - case DimType::Distance: title = "Distance"; break; - case DimType::DistanceToLine: title = "Distance"; break; - default: break; - } + const std::string title = dimtype_title(k); // Anchor over the geometry it belongs to, not the panel: the value belongs to the element. DimAnnot a; a.kind = k; a.ea = m_selection.empty() ? -1 : m_selection[0]; @@ -1373,6 +1484,8 @@ void DesignSketchTool::open_next_autoedit_dim() on_inline_edit(px, step.value, step.title, [this, step](double v) { // commit: apply this dimension, then next if (step.apply) step.apply(v); + // A refused value brought the same field back (show_refusal): stay on this step. + if (inline_editor != nullptr && inline_editor->is_open()) return; ++m_autoedit_dim_idx; wxGetApp().CallAfter([this] { open_next_autoedit_dim(); }); }, @@ -1399,30 +1512,31 @@ void DesignSketchTool::arm_polyline_segment_edit() m_autoedit_dims.clear(); m_autoedit_dims.push_back({ mid, L, [this, k, a](double len) { // Length if (k < int(m_points.size())) { + if (!(len > 0.0)) { show_refusal(_u8L("The value must be greater than zero")); return; } Vec2d dd = m_points[k] - a; const double n = dd.norm(); - if (n > 1e-9 && len > 1e-9) m_points[k] = a + (len / n) * dd; + if (n > 1e-9) m_points[k] = a + (len / n) * dd; } - }, {}, "Length" }); + }, {}, _u8L("Length") }); m_autoedit_dims.push_back({ mid, deg, [this, k, a](double dg) { // Angle if (k < int(m_points.size())) { const double len = (m_points[k] - a).norm(); const double r = dg * M_PI / 180.0; m_points[k] = a + len * Vec2d(std::cos(r), std::sin(r)); } - }, {}, "Angle" }); + }, {}, _u8L("Angle (°)") }); m_autoedit_dim_idx = 0; wxGetApp().CallAfter([this] { open_next_autoedit_dim(); }); } std::string DesignSketchTool::dimtype_title(DimType k) const { switch (k) { - case DimType::Length: return "Length"; - case DimType::Diameter: return "Diameter"; - case DimType::Radius: return "Radius"; - case DimType::Angle: return "Angle"; - case DimType::Distance: return "Distance"; - case DimType::DistanceToLine: return "Distance"; - default: return "Value"; + case DimType::Length: return _u8L("Length"); + case DimType::Diameter: return _u8L("Diameter"); + case DimType::Radius: return _u8L("Radius"); + case DimType::Angle: return _u8L("Angle (°)"); + case DimType::Distance: return _u8L("Distance"); + case DimType::DistanceToLine: return _u8L("Distance"); + default: return _u8L("Value"); } } @@ -1461,13 +1575,19 @@ void DesignSketchTool::open_primary_autoedit() if (q.kind == DimType::Angle) { const int ei = q.ea; m_autoedit_dims.push_back({ q.label_pos, measure_dim(q), - [this, ei](double v) { set_line_angle(ei, v); }, { ei }, "Angle" }); + [this, ei](double v) { set_line_angle(ei, v); }, { ei }, _u8L("Angle (°)") }); continue; } DimAnnot a = q; a.value = measure_dim(a); m_autoedit_dims.push_back({ a.label_pos, a.value, [this, a](double v) mutable { + const bool positive = a.kind == DimType::Length || a.kind == DimType::Radius || a.kind == DimType::Diameter; + if (!std::isfinite(v) || (positive && v <= 0.0) || (!positive && v < 0.0)) { + show_refusal(positive ? _u8L("The value must be greater than zero") + : _u8L("The value must not be negative (zero means coincident)")); + return; + } a.value = v; a.con = upsert_dimension_constraint(constraint_for(a)); upsert_dimension(a); @@ -1492,8 +1612,8 @@ void DesignSketchTool::open_primary_autoedit() const double side = (m_entities[f.begin].p1 - m_entities[f.begin].p0).norm(); const Vec2d sp = m_entities[f.begin].p0 - f.c0; double deg = std::atan2(sp.y(), sp.x()) * 180.0 / M_PI; if (deg < 0.0) deg += 360.0; - m_autoedit_dims.push_back({ m_live_poly_side_label, side, [this, fi](double v){ set_polygon_side(fi, v); }, span(fi), "Side" }); - m_autoedit_dims.push_back({ m_live_poly_angle_label, deg, [this, fi](double v){ set_polygon_angle(fi, v); }, span(fi), "Angle" }); + m_autoedit_dims.push_back({ m_live_poly_side_label, side, [this, fi](double v){ set_polygon_side(fi, v); }, span(fi), _u8L("Side") }); + m_autoedit_dims.push_back({ m_live_poly_angle_label, deg, [this, fi](double v){ set_polygon_angle(fi, v); }, span(fi), _u8L("Angle (°)") }); } } if (m_live_rrect_fi >= 0) { @@ -1503,43 +1623,43 @@ void DesignSketchTool::open_primary_autoedit() auto rr_w = [this, fi](double v){ const Feature& g = m_features[fi]; set_rounded_rect(fi, v, std::abs(g.c1.y()-g.c0.y()), g.param); }; auto rr_h = [this, fi](double v){ const Feature& g = m_features[fi]; set_rounded_rect(fi, std::abs(g.c1.x()-g.c0.x()), v, g.param); }; auto rr_r = [this, fi](double v){ const Feature& g = m_features[fi]; set_rounded_rect(fi, std::abs(g.c1.x()-g.c0.x()), std::abs(g.c1.y()-g.c0.y()), v); }; - m_autoedit_dims.push_back({ m_live_rrect_w_label, w, rr_w, span(fi), "Width" }); - m_autoedit_dims.push_back({ m_live_rrect_h_label, h, rr_h, span(fi), "Height" }); - m_autoedit_dims.push_back({ m_live_rrect_r_label, r, rr_r, span(fi), "Radius" }); + m_autoedit_dims.push_back({ m_live_rrect_w_label, w, rr_w, span(fi), _u8L("Width") }); + m_autoedit_dims.push_back({ m_live_rrect_h_label, h, rr_h, span(fi), _u8L("Height") }); + m_autoedit_dims.push_back({ m_live_rrect_r_label, r, rr_r, span(fi), _u8L("Radius") }); } if (m_live_aslot_fi >= 0) { const Feature& f = m_features[m_live_aslot_fi]; const int fi = m_live_aslot_fi; const double Rc = (f.c1 - f.c0).norm(), fw = 2.0 * f.param; - m_autoedit_dims.push_back({ m_live_aslot_r_label, Rc, [this, fi](double v){ const Feature& g = m_features[fi]; set_arc_slot(fi, v, g.param); }, span(fi), "Radius" }); - m_autoedit_dims.push_back({ m_live_aslot_w_label, fw, [this, fi](double v){ const Feature& g = m_features[fi]; set_arc_slot(fi, (g.c1-g.c0).norm(), std::max(1e-3, v*0.5)); }, span(fi), "Width" }); + m_autoedit_dims.push_back({ m_live_aslot_r_label, Rc, [this, fi](double v){ const Feature& g = m_features[fi]; set_arc_slot(fi, v, g.param); }, span(fi), _u8L("Radius") }); + m_autoedit_dims.push_back({ m_live_aslot_w_label, fw, [this, fi](double v){ const Feature& g = m_features[fi]; set_arc_slot(fi, (g.c1-g.c0).norm(), v * 0.5); }, span(fi), _u8L("Width") }); } if (m_live_slot_fi >= 0) { const Feature& f = m_features[m_live_slot_fi]; const int fi = m_live_slot_fi; - // Slot dims, in order: (1) inter-centre distance, (2) radius (= half-width), (3) angle. + // Slot dims, in order: (1) inter-centre distance, (2) full width (as the arc slot), (3) angle. const Vec2d d = f.c1 - f.c0; const double Lc = d.norm(); double deg = std::atan2(d.y(), d.x()) * 180.0 / M_PI; if (deg < 0.0) deg += 360.0; - m_autoedit_dims.push_back({ m_live_slot_len_label, Lc, [this, fi](double v){ const Feature& g = m_features[fi]; set_slot(fi, v, g.param); }, span(fi), "Length" }); - m_autoedit_dims.push_back({ m_live_slot_w_label, f.param, [this, fi](double v){ const Feature& g = m_features[fi]; set_slot(fi, (g.c1-g.c0).norm(), std::max(1e-3, v)); }, span(fi), "Radius" }); - m_autoedit_dims.push_back({ m_live_slot_angle_label, deg, [this, fi](double v){ set_slot_angle(fi, v); }, span(fi), "Angle" }); + m_autoedit_dims.push_back({ m_live_slot_len_label, Lc, [this, fi](double v){ const Feature& g = m_features[fi]; set_slot(fi, v, g.param); }, span(fi), _u8L("Length") }); + m_autoedit_dims.push_back({ m_live_slot_w_label, 2.0 * f.param, [this, fi](double v){ const Feature& g = m_features[fi]; set_slot(fi, (g.c1-g.c0).norm(), v * 0.5); }, span(fi), _u8L("Width") }); + m_autoedit_dims.push_back({ m_live_slot_angle_label, deg, [this, fi](double v){ set_slot_angle(fi, v); }, span(fi), _u8L("Angle (°)") }); } if (m_live_arc_ei >= 0) { // arc Radius is already a scalar step above; add its sweep angle const int ei = m_live_arc_ei; const SketchEntity& e = m_entities[ei]; const double swdeg = std::abs(e.end_angle - e.start_angle) * 180.0 / M_PI; - m_autoedit_dims.push_back({ m_live_arc_angle_label, swdeg, [this, ei](double v){ set_arc_sweep(ei, v); }, { ei }, "Angle" }); + m_autoedit_dims.push_back({ m_live_arc_angle_label, swdeg, [this, ei](double v){ set_arc_sweep(ei, v); }, { ei }, _u8L("Angle (°)") }); } if (m_live_ellipse_ei >= 0) { const int ei = m_live_ellipse_ei; const SketchEntity& e = m_entities[ei]; - m_autoedit_dims.push_back({ m_live_ellipse_major_label, e.radius, [this, ei](double v){ set_ellipse_axis(ei, true, v); }, { ei }, "Major" }); - m_autoedit_dims.push_back({ m_live_ellipse_minor_label, e.rminor, [this, ei](double v){ set_ellipse_axis(ei, false, v); }, { ei }, "Minor" }); + m_autoedit_dims.push_back({ m_live_ellipse_major_label, e.radius, [this, ei](double v){ set_ellipse_axis(ei, true, v); }, { ei }, _u8L("Semi-major axis") }); + m_autoedit_dims.push_back({ m_live_ellipse_minor_label, e.rminor, [this, ei](double v){ set_ellipse_axis(ei, false, v); }, { ei }, _u8L("Semi-minor axis") }); if (e.type == SketchEntity::Type::EllipseArc) { // + included sweep const double swdeg = std::abs(e.end_angle - e.start_angle) * 180.0 / M_PI; m_autoedit_dims.push_back({ m_live_ellipsearc_sweep_label, swdeg, - [this, ei](double v){ set_ellipsearc_sweep(ei, v); }, { ei }, "Angle" }); + [this, ei](double v){ set_ellipsearc_sweep(ei, v); }, { ei }, _u8L("Angle (°)") }); } } if (m_live_obrect_fi >= 0) { // oblique rect: W,H already added as scalars; + orientation @@ -1549,7 +1669,7 @@ void DesignSketchTool::open_primary_autoedit() double adeg = std::atan2(e0.p1.y() - e0.p0.y(), e0.p1.x() - e0.p0.x()) * 180.0 / M_PI; if (adeg < 0.0) adeg += 360.0; m_autoedit_dims.push_back({ m_live_obrect_angle_label, adeg, - [this, fi](double v){ set_rect_angle(fi, v); }, span(fi), "Angle" }); + [this, fi](double v){ set_rect_angle(fi, v); }, span(fi), _u8L("Angle (°)") }); } trace_autoedit(m_autoedit_dims.empty() ? "built NO steps (no live quote matched)" : "opening", @@ -1569,7 +1689,7 @@ void DesignSketchTool::open_polygon_side_editor(int fi) if (f.begin < 0 || f.begin >= int(m_entities.size())) return; const double side = (m_entities[f.begin].p1 - m_entities[f.begin].p0).norm(); const wxPoint px(m_last_mouse_x, m_last_mouse_y); - on_inline_edit(px, side, "Side", + on_inline_edit(px, side, _u8L("Side"), [this, fi](double v) { set_polygon_side(fi, v); }, []() {}); } @@ -1583,7 +1703,7 @@ void DesignSketchTool::open_polygon_angle_editor(int fi) double deg = std::atan2(sp.y(), sp.x()) * 180.0 / M_PI; if (deg < 0.0) deg += 360.0; const wxPoint px(m_last_mouse_x, m_last_mouse_y); - on_inline_edit(px, deg, "Angle", + on_inline_edit(px, deg, _u8L("Angle (°)"), [this, fi](double v) { set_polygon_angle(fi, v); }, []() {}); } @@ -1592,7 +1712,8 @@ void DesignSketchTool::open_polygon_angle_editor(int fi) // n-gon, circumradius R = side / (2 sin(pi/n)). void DesignSketchTool::set_polygon_side(int fi, double side) { - if (fi < 0 || fi >= int(m_features.size()) || side < 1e-6) return; + if (fi < 0 || fi >= int(m_features.size())) return; + if (!(side > 0.0)) { show_refusal(_u8L("The value must be greater than zero")); return; } const int n = std::max(3, m_features[fi].sides); const double R = side / (2.0 * std::sin(M_PI / double(n))); set_polygon_radius(fi, R); @@ -1837,7 +1958,7 @@ void DesignSketchTool::open_arc_angle_editor(int ei) if (e.type != SketchEntity::Type::Arc) return; double swdeg = std::abs(e.end_angle - e.start_angle) * 180.0 / M_PI; const wxPoint px(m_last_mouse_x, m_last_mouse_y); - on_inline_edit(px, swdeg, "Angle", + on_inline_edit(px, swdeg, _u8L("Angle (°)"), [this, ei](double v) { set_arc_sweep(ei, v); }, []() {}); } @@ -1851,7 +1972,8 @@ void DesignSketchTool::set_arc_sweep(int ei, double deg) if (ei < 0 || ei >= int(m_entities.size())) return; SketchEntity& e = m_entities[ei]; if (e.type != SketchEntity::Type::Arc || e.radius < 1e-6) return; - double sweep = std::max(1e-3, std::min(deg, 359.999)) * M_PI / 180.0; + if (!(deg > 0.0 && deg < 360.0)) { show_refusal(_u8L("The angle must be between 0° and 360°")); return; } + double sweep = deg * M_PI / 180.0; const double sign = (e.end_angle >= e.start_angle) ? 1.0 : -1.0; e.end_angle = e.start_angle + sign * sweep; e.p1 = e.center + e.radius * Vec2d(std::cos(e.end_angle), std::sin(e.end_angle)); @@ -1922,7 +2044,7 @@ void DesignSketchTool::open_ellipse_axis_editor(int ei, bool major) if (e.type != SketchEntity::Type::Ellipse && e.type != SketchEntity::Type::EllipseArc) return; const double v = major ? e.radius : e.rminor; const wxPoint px(m_last_mouse_x, m_last_mouse_y); - on_inline_edit(px, v, major ? "Major" : "Minor", + on_inline_edit(px, v, major ? _u8L("Semi-major axis") : _u8L("Semi-minor axis"), [this, ei, major](double nv) { set_ellipse_axis(ei, major, nv); }, []() {}); } @@ -1930,11 +2052,16 @@ void DesignSketchTool::open_ellipse_axis_editor(int ei, bool major) // Set a semi-axis to `v`: major -> e.radius, minor -> e.rminor; keep OCCT a >= b. void DesignSketchTool::set_ellipse_axis(int ei, bool major, double v) { - if (ei < 0 || ei >= int(m_entities.size()) || v < 1e-6) return; + if (ei < 0 || ei >= int(m_entities.size())) return; SketchEntity& e = m_entities[ei]; if (e.type != SketchEntity::Type::Ellipse && e.type != SketchEntity::Type::EllipseArc) return; - if (major) e.radius = std::max(v, e.rminor); - else e.rminor = std::min(v, e.radius); + if (!(v > 0.0)) { show_refusal(_u8L("The value must be greater than zero")); return; } + if (major ? v < e.rminor : v > e.radius) { + show_refusal(_u8L("The semi-major axis cannot be shorter than the semi-minor axis")); + return; + } + if (major) e.radius = v; + else e.rminor = v; if (e.type == SketchEntity::Type::EllipseArc) { // endpoints ride the reshaped frame e.p0 = ellipse_point(e.center, e.radius, e.rminor, e.rotation, e.start_angle); e.p1 = ellipse_point(e.center, e.radius, e.rminor, e.rotation, e.end_angle); @@ -1949,7 +2076,8 @@ void DesignSketchTool::set_ellipsearc_sweep(int ei, double deg) if (ei < 0 || ei >= int(m_entities.size())) return; SketchEntity& e = m_entities[ei]; if (e.type != SketchEntity::Type::EllipseArc) return; - const double sweep = std::max(1e-3, std::min(deg, 359.999)) * M_PI / 180.0; + if (!(deg > 0.0 && deg < 360.0)) { show_refusal(_u8L("The angle must be between 0° and 360°")); return; } + const double sweep = deg * M_PI / 180.0; const double sign = (e.end_angle >= e.start_angle) ? 1.0 : -1.0; e.end_angle = e.start_angle + sign * sweep; e.p1 = ellipse_point(e.center, e.radius, e.rminor, e.rotation, e.end_angle); @@ -2017,7 +2145,7 @@ void DesignSketchTool::open_rounded_rect_editor(int fi, int which) const double r = f.param; const double v = (which == 0) ? w : (which == 1) ? h : r; const wxPoint px(m_last_mouse_x, m_last_mouse_y); - on_inline_edit(px, v, which == 0 ? "Width" : which == 1 ? "Height" : "Radius", + on_inline_edit(px, v, which == 0 ? _u8L("Width") : which == 1 ? _u8L("Height") : _u8L("Radius"), [this, fi, which](double nv) { const Feature& g = m_features[fi]; double gw = std::abs(g.c1.x() - g.c0.x()); @@ -2037,8 +2165,11 @@ void DesignSketchTool::set_rounded_rect(int fi, double w, double h, double r) if (fi < 0 || fi >= int(m_features.size())) return; Feature& f = m_features[fi]; if (f.begin < 0 || f.end > int(m_entities.size()) || f.end <= f.begin) return; - w = std::max(w, 1e-3); h = std::max(h, 1e-3); - r = std::max(1e-3, std::min(r, std::min(w, h) * 0.5 - 1e-4)); + if (!(w > 0.0 && h > 0.0 && r > 0.0)) { show_refusal(_u8L("The value must be greater than zero")); return; } + if (r >= std::min(w, h) * 0.5) { + show_refusal(_u8L("The corner radius must be less than half the shorter side")); + return; + } const double xmin = std::min(f.c0.x(), f.c1.x()), ymin = std::min(f.c0.y(), f.c1.y()); const double xmax = xmin + w, ymax = ymin + h; std::vector rebuilt = rounded_rect_entities(xmin, ymin, xmax, ymax, r); @@ -2058,12 +2189,12 @@ void DesignSketchTool::open_arc_slot_editor(int fi, bool radius) const double Rc = (f.c1 - f.c0).norm(); const double v = radius ? Rc : (2.0 * f.param); // width quote shows the FULL width const wxPoint px(m_last_mouse_x, m_last_mouse_y); - on_inline_edit(px, v, radius ? "Radius" : "Width", + on_inline_edit(px, v, radius ? _u8L("Radius") : _u8L("Width"), [this, fi, radius](double nv) { const Feature& g = m_features[fi]; const double gRc = (g.c1 - g.c0).norm(); if (radius) set_arc_slot(fi, nv, g.param); - else set_arc_slot(fi, gRc, std::max(1e-3, nv * 0.5)); // full width -> half + else set_arc_slot(fi, gRc, nv * 0.5); // full width -> half }, []() {}); } @@ -2082,8 +2213,11 @@ void DesignSketchTool::set_arc_slot(int fi, double Rc, double w) Vec2d dirE = Ec - center; if (dirS.squaredNorm() < 1e-12 || dirE.squaredNorm() < 1e-12) return; dirS.normalize(); dirE.normalize(); - Rc = std::max(Rc, 2e-3); - w = std::max(1e-3, std::min(w, Rc - 1e-3)); // make_arc_slot needs w < Rc + if (!(Rc > 0.0 && w > 0.0)) { show_refusal(_u8L("The value must be greater than zero")); return; } + if (w >= Rc) { // make_arc_slot needs w < Rc + show_refusal(_u8L("The slot is too wide for its radius — the width must be less than twice the radius")); + return; + } std::vector rebuilt = make_arc_slot(center, center + Rc * dirS, center + Rc * dirE, w); if (int(rebuilt.size()) != 4) return; @@ -2096,20 +2230,20 @@ void DesignSketchTool::set_arc_slot(int fi, double Rc, double w) } // Open the inline editor for a straight slot's dimension: which 0 = inter-centre distance, -// 1 = radius (half-width), 2 = centreline angle. Drives set_slot / set_slot_angle geometrically. +// 1 = full width (the arc slot's convention), 2 = centreline angle. Drives set_slot / set_slot_angle geometrically. void DesignSketchTool::open_slot_editor(int fi, int which) { if (fi < 0 || fi >= int(m_features.size()) || !on_inline_edit) return; const Feature& f = m_features[fi]; const Vec2d d = f.c1 - f.c0; double deg = std::atan2(d.y(), d.x()) * 180.0 / M_PI; if (deg < 0.0) deg += 360.0; - const double v = (which == 0) ? d.norm() : (which == 1) ? f.param : deg; + const double v = (which == 0) ? d.norm() : (which == 1) ? 2.0 * f.param : deg; const wxPoint px(m_last_mouse_x, m_last_mouse_y); - on_inline_edit(px, v, which == 0 ? "Length" : which == 1 ? "Radius" : "Angle", + on_inline_edit(px, v, which == 0 ? _u8L("Length") : which == 1 ? _u8L("Width") : _u8L("Angle (°)"), [this, fi, which](double nv) { const Feature& g = m_features[fi]; if (which == 0) set_slot(fi, nv, g.param); - else if (which == 1) set_slot(fi, (g.c1 - g.c0).norm(), std::max(1e-3, nv)); + else if (which == 1) set_slot(fi, (g.c1 - g.c0).norm(), nv * 0.5); // full width -> half else set_slot_angle(fi, nv); }, []() {}); @@ -2126,8 +2260,7 @@ void DesignSketchTool::set_slot(int fi, double length, double w) Vec2d dir = f.c1 - f.c0; if (dir.squaredNorm() < 1e-12) return; dir.normalize(); - length = std::max(length, 2e-3); - w = std::max(1e-3, w); + if (!(length > 0.0 && w > 0.0)) { show_refusal(_u8L("The value must be greater than zero")); return; } const Vec2d c0 = f.c0, c1 = f.c0 + length * dir; std::vector rebuilt = make_slot(c0, c1, w); if (int(rebuilt.size()) != 4) return; @@ -2208,12 +2341,18 @@ void DesignSketchTool::set_dimension_value(double v) { if (m_pending_dim < 0 || m_pending_dim >= int(m_dimensions.size())) return; DimAnnot& a = m_dimensions[m_pending_dim]; + const bool positive = a.kind == DimType::Length || a.kind == DimType::Radius || a.kind == DimType::Diameter; + if (!std::isfinite(v) || (positive && v <= 0.0) || (!positive && a.kind != DimType::Angle && v < 0.0)) { + show_refusal(positive ? _u8L("The value must be greater than zero") + : _u8L("The value must not be negative (zero means coincident)")); + return; + } a.value = v; if (a.con >= 0 && a.con < int(m_constraints.size())) m_constraints[a.con] = constraint_for(a); resolve_live(); - if (!m_solve_ok && on_readout) - on_readout(dimtype_title(a.kind) + " cannot be satisfied — the sketch is over-constrained"); + if (!m_solve_ok) + notify(format(_u8L("%1% cannot be satisfied — the sketch is over-constrained"), dimtype_title(a.kind))); m_pending_dim = -1; } @@ -2227,18 +2366,23 @@ std::string DesignSketchTool::dim_text(const DimAnnot& a) const char buf[32]; const char* prefix = (a.kind == DimType::Diameter) ? "\xC3\x98" // 'Ø' : (a.kind == DimType::Radius) ? "R" : ""; - const char* suffix = (a.kind == DimType::Angle) ? "\xC2\xB0" : ""; // '°' - std::snprintf(buf, sizeof(buf), "%s%.1f%s", prefix, a.value, suffix); + // Two decimals, trailing zeros dropped: the same precision the HUD readout uses, so a label + // and the readout never show the same length two ways. + std::snprintf(buf, sizeof(buf), "%.2f", a.value); // Force the international (en) decimal point: wx sets LC_NUMERIC to the user - // locale at startup, so snprintf("%.1f") can emit a comma. Normalise it. + // locale at startup, so snprintf can emit a comma. Normalise it. for (char& ch : buf) if (ch == ',') ch = '.'; - std::string out(buf); - if (a.kind != DimType::Angle) { - const bool use_in = wxGetApp().app_config->get_bool("use_inches"); - out += use_in ? " in" : " mm"; + std::string num(buf); + if (num.find('.') != std::string::npos) { + while (num.back() == '0') num.pop_back(); + if (num.back() == '.') num.pop_back(); } - return out; + if (num == "-0") num = "0"; + // The Design tab models in millimetres whatever the slicer's inch preference says: the + // kernel, the value fields and the readouts are all mm. The suffix used to follow that + // preference while the number did not, so an inch user read "25.4 in" for one inch. + return std::string(prefix) + num + (a.kind == DimType::Angle ? "\xC2\xB0" : " mm"); } void DesignSketchTool::apply_segment_length(double len) @@ -2420,6 +2564,28 @@ InferenceSnap DesignSketchTool::infer_at(GLCanvas3D& canvas, const wxMouseEvent& return infer_point_snap(m_entities, raw, tol); } +// Which clicks land on a snap target. Definition points (ends, corners, centres, points on a +// curve) snap; the click that only sets a SIZE (a radius, a width, a sweep direction) is free, +// so it can be placed anywhere without being dragged onto the nearest endpoint. +bool DesignSketchTool::click_snaps() const +{ + const size_t n = m_points.size(); + switch (m_mode) { + case Mode::Line: case Mode::Polyline: case Mode::TwoPointCircle: case Mode::ThreePointCircle: + case Mode::TangentArc: case Mode::BSpline: case Mode::Point: + case Mode::CornerRect: case Mode::CenterRect: + return true; + case Mode::ObliqueRect: case Mode::RoundedRect: case Mode::ThreePointArc: case Mode::Slot: + return n < 2; + case Mode::CenterArc: case Mode::ArcSlot: + return n == 1; + case Mode::CenterCircle: case Mode::Polygon: case Mode::Ellipse: case Mode::EllipseArc: + return n == 0; + default: + return false; + } +} + Vec2d DesignSketchTool::snap_vertex(GLCanvas3D& canvas, const wxMouseEvent& evt, const Vec2d& raw, bool& snapped) const { @@ -7295,7 +7461,7 @@ void DesignSketchTool::render_live_quotes(double unit_per_px) // Distance-between-arc-centres + Radius quotes never registered as editable, so the // labels did nothing on click (nde #6). Draw both labels clear of the fillable face // and remember the feature so open_primary_autoedit / click-to-promote drive set_slot. - // Slot dims: (1) inter-centre distance, (2) radius (= half-width), (3) centreline angle. + // Slot dims: (1) inter-centre distance, (2) full width, (3) centreline angle. const ColorRGBA dc(0.30f, 0.88f, 0.66f, 1.0f); const double th = std::max(15.0 * unit_per_px, 1e-4); Vec2d u = f.c1 - f.c0; @@ -7307,7 +7473,7 @@ void DesignSketchTool::render_live_quotes(double unit_per_px) DimAnnot len; len.kind = DimType::Length; len.value = Lc; m_live_slot_len_label = 0.5 * (f.c0 + f.c1) + n * (w + th * 2.0); draw_text(m_line_model, dim_text(len), m_live_slot_len_label, th, dc); - DimAnnot rd; rd.kind = DimType::Radius; rd.value = w; + DimAnnot rd; rd.kind = DimType::Length; rd.value = 2.0 * w; // full width, as the arc slot m_live_slot_w_label = f.c1 + u * (w + th * 2.0); draw_text(m_line_model, dim_text(rd), m_live_slot_w_label, th, dc); double deg = std::atan2(f.c1.y() - f.c0.y(), f.c1.x() - f.c0.x()) * 180.0 / M_PI; @@ -7851,8 +8017,12 @@ void DesignSketchTool::recompute_op_ghost() Vec2d u = e.p1 - e.p0; if (u.norm() > 1e-12) u.normalize(); m_op_dir = Vec2d(-u.y(), u.x()); // left normal = +distance side } else if (e.type == SketchEntity::Type::Circle || e.type == SketchEntity::Type::Arc) { + // The same "+distance = left of travel" rule the engine uses: inward for a circle + // and a CCW arc, outward for a CW arc. The arrow pointed outward for all of them, so + // dragging it out shrank a CCW arc. + const bool ccw = e.type == SketchEntity::Type::Circle || e.end_angle >= e.start_angle; m_op_anchor = e.center + Vec2d(e.radius, 0.0); - m_op_dir = Vec2d(1, 0); + m_op_dir = Vec2d(ccw ? -1.0 : 1.0, 0.0); } m_op_ghost = SketchEngine::offset_entities({ e }, m_op_value); } else if (m_mode == Mode::Mirror) { @@ -7879,7 +8049,7 @@ void DesignSketchTool::op_pick(int ei) else if (ei != m_op_a) { Vec2d cC, cBis; double cTh = 0.0; if (!op_corner(m_op_a, ei, cC, cBis, cTh)) { // parallel or straight: no corner - if (on_readout) on_readout("those two lines do not meet at a corner — pick two lines that do"); + notify(_u8L("Those two lines do not meet at a corner — pick two lines that do")); return; } m_op_b = ei; @@ -7937,12 +8107,18 @@ void DesignSketchTool::drag_op_arrow(const Vec2d& target) void DesignSketchTool::open_op_editor() { if (!on_inline_edit || !op_ready() || m_mode == Mode::Mirror) return; - const double sign = (m_mode == Mode::Offset && m_op_value < 0) ? -1.0 : 1.0; const wxPoint px(m_last_mouse_x, m_last_mouse_y); - on_inline_edit(px, std::abs(m_op_value), "", - [this, sign](double v) { - m_op_value = (m_mode == Mode::Offset) ? sign * std::abs(v) : std::max(0.001, v); - // Entering a radius IS the commit. Leaving it as a preview meant the most obvious + // Offset is signed the same way the arrow drag is (the sign picks the side), so the field + // shows and accepts the sign instead of silently keeping the old one. Fillet/Chamfer sizes + // are positive: a non-positive one is refused, not clamped to a hairline. + on_inline_edit(px, m_op_value, m_mode == Mode::Offset ? _u8L("Distance") : m_mode == Mode::Fillet ? _u8L("Radius") : _u8L("Size"), + [this](double v) { + if (m_mode != Mode::Offset && v <= 0.0) { + show_refusal(_u8L("The size must be greater than zero")); + return; + } + m_op_value = v; + // Entering a radius IS the commit. Leaving it as a preview meant the most obvious // route of all — click the radius, type it, press Return — ended with the value set, // the ghost drawn, and no geometry written; the only paths that ever applied it were // finishing the whole sketch or clicking empty space, neither of which is signposted. @@ -8019,9 +8195,9 @@ void DesignSketchTool::confirm_op() ? SketchEngine::fillet_lines(m_entities[m_op_a], m_entities[m_op_b], m_op_value, a_out, b_out, extra) : SketchEngine::chamfer_lines(m_entities[m_op_a], m_entities[m_op_b], m_op_value, a_out, b_out, extra); if (!ok) { - if (on_readout) on_readout(fillet - ? "Fillet: the radius overruns a leg, or the two lines do not meet at a corner" - : "Chamfer: the distance overruns a leg, or the two lines do not meet at a corner"); + notify(fillet + ? _u8L("Fillet: the radius overruns a leg, or the two lines do not meet at a corner") + : _u8L("Chamfer: the distance overruns a leg, or the two lines do not meet at a corner")); reset_op(); return; } @@ -8043,8 +8219,8 @@ void DesignSketchTool::confirm_op() return (d.type == CT::Coincident && refs(d, a, ra) && refs(d, b, rb)) || self_len(d, a) || self_len(d, b); }); - if (released > 0 && on_readout) - on_readout(std::to_string(released) + " constraint(s) the fillet/chamfer invalidated were removed"); + if (released > 0) + notify(format(_u8L("%1% constraint(s) the fillet/chamfer invalidated were removed"), released), false); auto coin = [&](R xr, int ln, R lr) { SketchEntityConstraintDef d; d.type = CT::Coincident; d.ea = xi; d.ra = xr; d.eb = ln; d.rb = lr; return d; }; if (fillet) { @@ -8063,7 +8239,7 @@ void DesignSketchTool::confirm_op() const int a = m_op_a; auto out = SketchEngine::offset_entities({ m_entities[a] }, m_op_value); if (out.empty()) { - if (on_readout) on_readout("Offset: an ellipse or a spline has no parallel of its own kind — pick lines, arcs or circles"); + notify(_u8L("Offset: an ellipse or a spline has no parallel of its own kind — pick lines, arcs or circles")); reset_op(); return; } @@ -8340,20 +8516,25 @@ void DesignSketchTool::open_tf_editor_a() if (!on_inline_edit || !tf_ready()) return; const wxPoint px(m_last_mouse_x, m_last_mouse_y); double cur; - if (m_mode == Mode::Rotate || m_mode == Mode::PolarArray) cur = std::abs(m_tf_angle) * 180.0 / M_PI; + if (m_mode == Mode::Rotate || m_mode == Mode::PolarArray) cur = m_tf_angle * 180.0 / M_PI; else if (m_mode == Mode::Scale) cur = m_tf_scale; else cur = m_tf_delta.norm(); Vec2d dir = m_tf_delta; if (dir.norm() > 1e-9) dir.normalize(); else dir = Vec2d(1, 0); - const double sgn = (m_tf_angle < 0) ? -1.0 : 1.0; - on_inline_edit(px, cur, "", - [this, dir, sgn](double v) { + const char* title = (m_mode == Mode::Rotate || m_mode == Mode::PolarArray) ? L("Angle (°)") + : (m_mode == Mode::Scale) ? L("Scale factor") : L("Distance"); + on_inline_edit(px, cur, _u8L(title), + [this, dir](double v) { switch (m_mode) { - case Mode::Move: case Mode::Array: m_tf_delta = dir * v; break; - case Mode::Rotate: case Mode::PolarArray: m_tf_angle = sgn * std::abs(v) * M_PI / 180.0; break; - case Mode::Scale: m_tf_scale = std::max(1e-3, v); break; + case Mode::Move: case Mode::Array: m_tf_delta = dir * v; break; // signed: flips the direction + case Mode::Rotate: case Mode::PolarArray: m_tf_angle = v * M_PI / 180.0; break; // signed: CCW positive + case Mode::Scale: + if (v <= 0.0) { show_refusal(_u8L("The scale factor must be greater than zero")); return; } + m_tf_scale = v; + break; default: break; } - recompute_tf_ghost(); + // Enter IS the commit, the same rule the edit-op field follows. + confirm_transform(); }, []() {}); } @@ -8363,8 +8544,15 @@ void DesignSketchTool::open_tf_editor_count() if (!on_inline_edit || !tf_ready()) return; if (m_mode != Mode::Array && m_mode != Mode::PolarArray) return; const wxPoint px(m_last_mouse_x, m_last_mouse_y); - on_inline_edit(px, double(std::max(2, m_tf_count)), "", - [this](double v) { m_tf_count = std::max(2, int(v + 0.5)); recompute_tf_ghost(); }, + on_inline_edit(px, double(std::max(2, m_tf_count)), _u8L("Copies"), + [this](double v) { + if (v < 2.0 || std::abs(v - std::round(v)) > 1e-9) { + show_refusal(_u8L("The number of copies must be a whole number, 2 or more")); + return; + } + m_tf_count = int(std::round(v)); + confirm_transform(); + }, []() {}); } @@ -8477,8 +8665,8 @@ void DesignSketchTool::confirm_transform() } } }); - if (released > 0 && on_readout) - on_readout(std::to_string(released) + " constraint(s) released by the transform"); + if (released > 0) + notify(format(_u8L("%1% constraint(s) released by the transform"), released), false); } else if (m_mode == Mode::Array || m_mode == Mode::PolarArray) { // ADDITIVE: append copies of each subject, then bind each copy to its source. Lines // get Parallel+EqualLength (linear) or EqualLength only (polar — rotation breaks @@ -8532,8 +8720,8 @@ void DesignSketchTool::confirm_transform() } bool bound = false; for (auto& w : ladder) if (!w.empty() && try_add_constraints(w)) { bound = true; break; } - if (!bound && on_readout) - on_readout("the array copies are unconstrained — the solver refused every binding"); + if (!bound) + notify(_u8L("The array copies are unconstrained — the solver refused every binding"), false); } } reset_tf(); @@ -8563,8 +8751,12 @@ void DesignSketchTool::emit_step_hint() } else if (is_transform_mode()) { picks = int(m_tf_targets.size()); step = m_tf_targets.empty() ? 0 : 1; + } else if (m_mode == Mode::Constrain && m_constrain_entities) { + picks = int(m_pick0 >= 0) + int(m_pick1 >= 0) + int(m_pick2 >= 0); } else if (m_mode == Mode::Select || m_mode == Mode::Constrain) { picks = int(m_selection.size()); + } else if (m_mode == Mode::Dimension) { + step = m_dim_has0 ? 1 : 0; // the Dimension tool keeps its first pick, not m_points } else { step = int(m_points.size()); } @@ -8750,10 +8942,12 @@ void DesignSketchTool::render(GLCanvas3D& canvas) const ColorRGBA grey(0.55f, 0.55f, 0.60f, 1.0f); if (m_mode == Mode::Constrain) { - const ColorRGBA cyan(0.30f, 0.80f, 1.0f, 1.0f); - const ColorRGBA red(1.0f, 0.25f, 0.25f, 1.0f); + // The live session's palette, so a sketch looks the same whether you are drawing it or + // constraining it: picks wear THE selection colour, idle geometry orange (construction + // grey). It used to draw everything in the old near-selection cyan and the picks RED — + // the colour that means "conflicting" everywhere else in the sketch. + const ColorRGBA sel_col = design_selection_color(); if (m_constrain_entities) { - // Draw all entities cyan; picked Line entities highlighted red. std::vector markers; for (size_t i = 0; i < m_entities.size(); ++i) { const SketchEntity& e = m_entities[i]; @@ -8762,14 +8956,14 @@ void DesignSketchTool::render(GLCanvas3D& canvas) // references glow yellow (picked entities still win as red). const bool hl = !sel && std::find(m_constraint_hl.begin(), m_constraint_hl.end(), int(i)) != m_constraint_hl.end(); - const ColorRGBA col = sel ? red : (hl ? yellow : cyan); + const ColorRGBA col = sel ? sel_col : hl ? yellow : e.construction ? grey : orange; if (e.type == SketchEntity::Type::Point) { markers.push_back(e.p0); continue; } bool closed = false; std::vector poly = entity_polyline(e, closed); draw_quad_strip((sel || hl) ? m_highlight_model : m_line_model, poly, closed, col); } if (!markers.empty()) - draw_vertices(m_vertex_model, markers, cyan); + draw_vertices(m_vertex_model, markers, orange); // Constraint badges (C3.4b): iconic glyphs near each constraint's entity. { const double upp = 1.0 / std::max(camera.get_zoom(), 1e-6); @@ -8785,12 +8979,12 @@ void DesignSketchTool::render(GLCanvas3D& canvas) glsafe(::glEnable(GL_DEPTH_TEST)); return; } - draw_quad_strip(m_line_model, m_points, true, cyan); - draw_vertices(m_vertex_model, m_points, cyan); + draw_quad_strip(m_line_model, m_points, true, orange); + draw_vertices(m_vertex_model, m_points, orange); if (m_sel_a >= 0 && m_sel_b >= 0 && m_sel_a < int(m_points.size()) && m_sel_b < int(m_points.size())) { std::vector seg = { m_points[m_sel_a], m_points[m_sel_b] }; - draw_quad_strip(m_highlight_model, seg, false, red); + draw_quad_strip(m_highlight_model, seg, false, sel_col); } shader->stop_using(); glsafe(::glEnable(GL_CULL_FACE)); @@ -8954,7 +9148,7 @@ void DesignSketchTool::render(GLCanvas3D& canvas) } } if (!mids.empty()) - draw_vertices(m_vertex_model, mids, ColorRGBA(0.35f, 0.75f, 0.85f, 1.0f), 0.9); + draw_vertices(m_vertex_model, mids, ColorRGBA(0.85f, 0.85f, 0.88f, 1.0f), 0.9); // neutral: not the selection hue // Derived feature handles (A3): the circle RadiusHandle is not a SketchPointRole, // so the per-point pass above doesn't draw it. Render it (cyan) + the hovered @@ -8967,7 +9161,7 @@ void DesignSketchTool::render(GLCanvas3D& canvas) h.role == HandleRole::MinorAxis || h.role == HandleRole::BSplineCtrl) radius_h.push_back(h.pos); if (!radius_h.empty()) - draw_vertices(m_vertex_model, radius_h, ColorRGBA(0.30f, 0.75f, 0.95f, 1.0f), + draw_vertices(m_vertex_model, radius_h, ColorRGBA(0.95f, 0.95f, 0.95f, 1.0f), std::max(4.0 * upp, 1e-4)); if (m_has_hover_handle) draw_vertices(m_highlight_model, { m_hover_handle.pos }, white, @@ -9251,7 +9445,7 @@ void DesignSketchTool::render(GLCanvas3D& canvas) ColorRGBA hint(1.0f, 0.55f, 0.1f, 1.0f); // endpoint: orange switch (m_cursor_snap.kind) { case InferenceSnap::Kind::Midpoint: hint = ColorRGBA(0.35f, 0.90f, 0.75f, 1.0f); break; // teal - case InferenceSnap::Kind::Center: hint = ColorRGBA(0.30f, 0.80f, 1.0f, 1.0f); break; // cyan + case InferenceSnap::Kind::Center: hint = ColorRGBA(1.0f, 0.85f, 0.2f, 1.0f); break; // yellow (cyan = selected) case InferenceSnap::Kind::Origin: hint = ColorRGBA(1.0f, 0.30f, 0.85f, 1.0f); break; // magenta case InferenceSnap::Kind::OnEdge: hint = ColorRGBA(0.45f, 0.70f, 1.0f, 1.0f); break; // blue default: break; @@ -9800,6 +9994,13 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) // opens somewhere unexpected can't leave the viewport unusable. else if (evt.Dragging() || evt.GetWheelRotation() != 0) return false; + // A click elsewhere accepts the typed value, as Enter would (the field then advances or + // closes). The click itself is still swallowed: it was aimed at leaving the field, not + // at drawing, and a point placed by it would land under a field that just vanished. + else if (evt.LeftDown()) { + if (on_inline_commit) on_inline_commit(); + return true; + } else return true; } @@ -9852,7 +10053,10 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) if (!moved && d < 3) open_move_editor(d); // stationary click on an arrow = edit offset return true; } - if (evt.RightDown()) { clear_move_gizmo(); canvas.set_as_dirty(); if (on_move_exit) on_move_exit(); return true; } + // Right-click opens the offer; the move is kept with Enter/✓ and reverted with Esc/✗, + // like every other pending edit. It used to keep the move and close the gizmo — a + // commit on the one button the charter reserves for "what can I do here". + if (evt.RightDown()) return false; if (evt.LeftDown()) { int axis = -1; if (hit_test_move_arrow(canvas, evt, axis)) { // translate arrows win over rings @@ -10229,19 +10433,19 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) Vec2d p; screen_to_plane(canvas, evt, p); const Linef3 r2 = canvas.mouse_ray(Point(evt.GetX() + 8, evt.GetY())); const double tol = std::max(1e-3, (m_plane.project(r2.a, r2.vector()) - p).norm()); - if (apply_live_trim(p, tol * 3.0, m_mode == Mode::Extend)) { + if (apply_live_trim(p, screen_tol(canvas, evt, p, kToolPickPx), m_mode == Mode::Extend)) { resolve_live(); - } else if (on_readout) { + } else { // nde #15: don't fail silently. The pick found nothing to cut/extend — either // the click missed every live segment, or the picked segment has no crossing / // target among the OTHER live entities (committed sketches aren't trimmed). - on_readout(m_mode == Mode::Extend - ? std::string("Extend: click a line/arc that can reach another live entity") - : std::string("Trim: click a segment where it crosses another live entity")); + notify(m_mode == Mode::Extend + ? _u8L("Extend: click a line or an arc that can reach another entity") + : _u8L("Trim: click a segment where it crosses another entity")); } return true; } - if (evt.RightDown()) { request_exit(); return true; } + if (evt.RightDown()) return false; // nothing pending to abandon: the offer opens return false; // let move/drag orbit the camera } @@ -10266,8 +10470,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) const double tol = std::max(1e-3, (m_plane.project(r2.a, r2.vector()) - p).norm()); // 1) live gizmo: click the value label to type, or grab the arrow to drag. if (op_ready() && m_mode != Mode::Mirror) { - const Linef3 rl = canvas.mouse_ray(Point(evt.GetX() + 24, evt.GetY())); - const double ltol = std::max(tol, (m_plane.project(rl.a, rl.vector()) - p).norm()); + const double ltol = std::max(tol, screen_tol(canvas, evt, p, kLabelPx)); if ((m_op_label - p).norm() <= ltol) { open_op_editor(); return true; } if (hit_test_op_arrow(p, tol)) { m_op_dragging_arrow = true; return true; } } @@ -10277,19 +10480,21 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) const double d = entity_pick_dist(p, m_entities[i]); if (d < best) { best = d; bi = int(i); } } - if (bi >= 0 && best <= tol * 3.0) { op_pick(bi); return true; } - // 3) empty click confirms a ready gesture. - if (op_ready()) confirm_op(); + if (bi >= 0 && best <= screen_tol(canvas, evt, p, kToolPickPx)) { op_pick(bi); return true; } + // 3) Empty space never commits (charter 4.2 withdrew that invisible gesture). A ready + // op stays pending and says how to finish it; half-made picks are a selection, and + // empty space clears a selection. + if (op_ready()) notify(_u8L("Press Enter or ✓ to apply, Esc to discard"), false); + else if (m_op_a >= 0) { reset_op(); m_selection.clear(); if (on_selection_changed) on_selection_changed(0); } return true; } if (evt.RightDown()) { - if (m_op_a >= 0 || !m_mirror_targets.empty()) { - reset_op(); - m_selection.clear(); - if (on_selection_changed) on_selection_changed(0); - } else { - request_exit(); - } + // The draw tools' rule (right_abandon): drop what is pending, else hand the click + // back so the offer opens. Leaving the tool is Esc's job, not right-click's. + if (m_op_a < 0 && m_mirror_targets.empty()) return false; + reset_op(); + m_selection.clear(); + if (on_selection_changed) on_selection_changed(0); return true; } return false; @@ -10319,8 +10524,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) const double tol = std::max(1e-3, (m_plane.project(r2.a, r2.vector()) - p).norm()); // 1) live gizmo: click a value label to type, or grab the handle to drag. if (tf_ready()) { - const Linef3 rl = canvas.mouse_ray(Point(evt.GetX() + 24, evt.GetY())); - const double ltol = std::max(tol, (m_plane.project(rl.a, rl.vector()) - p).norm()); + const double ltol = std::max(tol, screen_tol(canvas, evt, p, kLabelPx)); if ((m_tf_label_a - p).norm() <= ltol) { open_tf_editor_a(); return true; } if ((m_tf_label_b - p).norm() <= ltol) { open_tf_editor_count(); return true; } if (hit_test_tf_handle(p, tol)) { m_tf_dragging = true; return true; } @@ -10331,19 +10535,16 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) const double d = entity_pick_dist(p, m_entities[i]); if (d < best) { best = d; bi = int(i); } } - if (bi >= 0 && best <= tol * 3.0) { tf_pick(bi); return true; } - // 3) empty click confirms a ready gesture. - if (tf_ready()) confirm_transform(); + if (bi >= 0 && best <= screen_tol(canvas, evt, p, kToolPickPx)) { tf_pick(bi); return true; } + // 3) Empty space never commits (charter 4.2): the pending transform waits for Enter/✓. + if (tf_ready()) notify(_u8L("Press Enter or ✓ to apply, Esc to discard"), false); return true; } if (evt.RightDown()) { - if (!m_tf_targets.empty()) { - reset_tf(); - m_selection.clear(); - if (on_selection_changed) on_selection_changed(0); - } else { - request_exit(); - } + if (m_tf_targets.empty()) return false; // nothing to abandon: the offer opens + reset_tf(); + m_selection.clear(); + if (on_selection_changed) on_selection_changed(0); return true; } return false; @@ -10359,8 +10560,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) } if (evt.LeftDown()) { Vec2d p; screen_to_plane(canvas, evt, p); - const Linef3 r2 = canvas.mouse_ray(Point(evt.GetX() + 10, evt.GetY())); - const double tol = std::max(1e-3, (m_plane.project(r2.a, r2.vector()) - p).norm()); + const double tol = screen_tol(canvas, evt, p, kPickPx); const int h = hit_test_xform_handle(p, tol); if (h >= 0) { m_xform_handle = h; @@ -10375,7 +10575,9 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) return true; } if (evt.LeftUp()) { m_xform_handle = -1; return true; } - if (evt.RightDown()) { if (on_exit) on_exit(); else cancel(); return true; } + // Right-click opens the offer like everywhere else; the placement is kept with Enter/✓ + // and discarded with Esc/✗ (the panel's Insert card), never by a mouse button. + if (evt.RightDown()) return false; return false; } @@ -10393,6 +10595,12 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) const double d = entity_pick_dist(p, m_entities[i]); if (d < best) { best = d; bi = int(i); } } + // Same reach as every other tool that picks an entity to act on. With no limit, + // a click anywhere on screen picked whatever was nearest; empty space now clears. + if (bi >= 0 && best > screen_tol(canvas, evt, p, kToolPickPx)) { + bi = -1; + m_pick0 = m_pick1 = m_pick2 = -1; + } if (bi >= 0) { // Rolling three-slot selection: slots 0/1 feed all 2-entity // constraints; slot 2 is the Symmetric axis (only filled once @@ -10404,7 +10612,9 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) } return true; } - if (evt.RightDown()) { cancel(); return true; } + // The picks are this mode's selection, and right-click on a selection opens the + // offer for it — the constraint verbs. It used to cancel(), wiping the whole session + // behind the panel's back. Esc drops the picks. return false; } if (evt.LeftDown()) { @@ -10425,11 +10635,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) } return true; } - if (evt.RightDown()) { - cancel(); - return true; - } - return false; + return false; // right-click included: the offer opens on the picked segment } // Selection mode: click to pick an entity, Shift/Ctrl to extend, double-click @@ -10530,9 +10736,9 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) Vec2d p; screen_to_plane(canvas, evt, p); if (evt.LeftDClick()) { // double-click a quote label -> edit it - const Linef3 rd = canvas.mouse_ray(Point(evt.GetX() + 28, evt.GetY())); - const double dtol = std::max(2.0, (m_plane.project(rd.a, rd.vector()) - p).norm()); - const int di = hit_test_dimension(p, dtol); + // Labels have ONE budget, single- or double-click, and it is in pixels: the old + // 2 mm floor made a label's target grow without bound as the view zoomed in. + const int di = hit_test_dimension(p, screen_tol(canvas, evt, p, kLabelPx)); if (di >= 0) { edit_dimension(di); return true; } } // Zoom-aware tolerance: project a point 8 px away and measure in plane units. @@ -10546,8 +10752,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) // opens — so typing a value sets the precise dimension. Generous label // tolerance (~24 px) since text labels are wider than a point grip. if (evt.LeftDown()) { - const Linef3 rdl = canvas.mouse_ray(Point(evt.GetX() + 24, evt.GetY())); - const double ltol = std::max(tol, (m_plane.project(rdl.a, rdl.vector()) - p).norm()); + const double ltol = std::max(tol, screen_tol(canvas, evt, p, kLabelPx)); const int di = hit_test_dimension(p, ltol); if (di >= 0) { open_value_editor(di); return true; } for (const DimAnnot& q : m_live_quotes) { @@ -10733,10 +10938,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) if (evt.LeftDClick()) { // double-click a quote label -> edit it Vec2d p; screen_to_plane(canvas, evt, p); - const Linef3 r2 = canvas.mouse_ray(Point(evt.GetX() + 28, evt.GetY())); - const Vec2d p2 = m_plane.project(r2.a, r2.vector()); - const double di_tol = std::max(2.0, (p2 - p).norm()); - const int di = hit_test_dimension(p, di_tol); + const int di = hit_test_dimension(p, screen_tol(canvas, evt, p, kLabelPx)); if (di >= 0) edit_dimension(di); m_dim_has0 = false; return true; @@ -10759,8 +10961,8 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) if (t == SketchEntity::Type::Line) { a.kind = DimType::Length; place_dimension(a); } else if (t == SketchEntity::Type::Circle) { a.kind = DimType::Diameter; place_dimension(a); } else if (t == SketchEntity::Type::Arc) { a.kind = DimType::Radius; place_dimension(a); } - else if (on_readout) - on_readout("no dimension for that entity yet — click a line, a circle, an arc, or two points"); + else + notify(_u8L("No dimension for that entity yet — click a line, a circle, an arc, or two points")); } } else { if (got_pt && !(pe == m_dim_e0 && pr == m_dim_r0)) { @@ -10771,14 +10973,18 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) DimAnnot a; a.kind = DimType::DistanceToLine; a.ea = m_dim_e0; a.ra = m_dim_r0; a.eb = he; place_dimension(a); - } else if (he >= 0 && on_readout) { - on_readout("click a second point, or a line to measure the distance to"); + } else if (he >= 0) { + notify(_u8L("Click a second point, or a line to measure the distance to"), false); } m_dim_has0 = false; // reset after the second pick } return true; } - if (evt.RightDown()) { m_dim_has0 = false; return true; } + if (evt.RightDown()) { // abandon the first pick, if any (right_abandon's rule) + if (!m_dim_has0) return false; // nothing down: the offer opens + m_dim_has0 = false; + return true; + } return false; // let drag orbit the camera } @@ -10788,7 +10994,10 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) m_has_cursor = true; m_cursor_locked = false; bool vsnap = false; - m_cursor = snap_vertex(canvas, evt, m_cursor, vsnap); // preview-snap to endpoints + // Preview exactly what the next click will do: a snap marker over a click that then + // lands on the raw point promised a coincidence that never happened. + if (click_snaps()) m_cursor = snap_vertex(canvas, evt, m_cursor, vsnap); // preview-snap + else m_cursor_snap = InferenceSnap{}; // The chain's own start is not an entity yet, so snap_vertex cannot see it. Offer it // here: the cursor lands exactly on it, so the rubber band below IS the closing segment. if (snap_chain_start(canvas, evt, m_cursor)) vsnap = true; @@ -10822,17 +11031,13 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) bool lk = false; p = snap_dir(m_points.back(), p, lk); // lock new segment to inference angle } + m_chain_dup_tol = screen_tol(canvas, evt, p, 3.0); m_points.push_back(p); arm_polyline_segment_edit(); // refine this segment's Length+Angle, then continue return true; } if (evt.LeftDClick()) { - if (m_points.size() >= 2) { - const int base = int(m_entities.size()); - push_open_chain(m_points); // end as an open chain - infer_auto_constraints(base); - m_points.clear(); - } + if (m_points.size() >= 2) end_chain(); // end as an open chain return true; } if (evt.RightDown() && m_points.empty()) @@ -10848,11 +11053,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) // is this tab's goal and it stays a four-action triangle either way; what changes // is that the closing edge is now something the user saw and chose, not one the // app appended on their behalf. - const int base = int(m_entities.size()); - if (m_points.size() >= 2) - push_open_chain(m_points); - infer_auto_constraints(base); - m_points.clear(); + end_chain(); return true; } break; @@ -10888,6 +11089,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) if (evt.LeftDown()) { Vec2d p; screen_to_plane(canvas, evt, p); + { bool vsnap = false; if (click_snaps()) p = snap_vertex(canvas, evt, p, vsnap); } if (m_points.empty()) { m_points.push_back(p); } else { @@ -10910,6 +11112,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) if (evt.LeftDown()) { Vec2d p; screen_to_plane(canvas, evt, p); + { bool vsnap = false; if (click_snaps()) p = snap_vertex(canvas, evt, p, vsnap); } if (m_points.empty()) { m_points.push_back(p); } else { @@ -10993,6 +11196,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) if (evt.LeftDown()) { Vec2d p; screen_to_plane(canvas, evt, p); + { bool vsnap = false; if (click_snaps()) p = snap_vertex(canvas, evt, p, vsnap); } if (m_points.empty()) { m_points.push_back(p); } else { @@ -11026,6 +11230,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) case Mode::ThreePointCircle: { if (evt.LeftDown()) { Vec2d p; screen_to_plane(canvas, evt, p); + { bool vsnap = false; if (click_snaps()) p = snap_vertex(canvas, evt, p, vsnap); } m_points.push_back(p); if (m_points.size() == 3) { append_entities(make_three_point_circle(m_points[0], m_points[1], m_points[2])); @@ -11098,6 +11303,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) case Mode::Slot: { if (evt.LeftDown()) { Vec2d p; screen_to_plane(canvas, evt, p); + { bool vsnap = false; if (click_snaps()) p = snap_vertex(canvas, evt, p, vsnap); } if (m_points.size() < 2) { m_points.push_back(p); } else { @@ -11150,6 +11356,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) case Mode::Polygon: { if (evt.LeftDown()) { Vec2d p; screen_to_plane(canvas, evt, p); + { bool vsnap = false; if (click_snaps()) p = snap_vertex(canvas, evt, p, vsnap); } if (m_points.empty()) { m_points.push_back(p); } else { @@ -11211,18 +11418,14 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) m_snap_off = evt.ShiftDown(); bool vsnap = false; p = snap_vertex(canvas, evt, p, vsnap); // poles can land on endpoints + m_chain_dup_tol = screen_tol(canvas, evt, p, 3.0); m_points.push_back(p); return true; } if (evt.RightDown() && m_points.empty()) return false; // no poles down — ghcz, let the offer open if (evt.LeftDClick() || evt.RightDown()) { - if (m_points.size() >= 2) { - const int base = int(m_entities.size()); - append_entities(make_bspline(m_points)); - infer_auto_constraints(base); // end poles auto-Coincident -> loops close - } - m_points.clear(); + end_chain(); return true; } break; @@ -11232,6 +11435,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) if (evt.LeftDown()) { Vec2d p; screen_to_plane(canvas, evt, p); + { bool vsnap = false; if (click_snaps()) p = snap_vertex(canvas, evt, p, vsnap); } push_point(p); return true; } diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index 9763f74c60..62e97981f7 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -67,6 +67,17 @@ public: // row off arms a NEIGHBOURING tool and then grades whatever that drew. ekt9. Mode mode() const { return m_mode; } int pending_points() const { return int(m_points.size()); } + // Picks the armed tool is holding that are not yet an entity or a constraint: the Dimension + // tool's first anchor, an edit-op's or a transform's subjects, Constrain's picks. Together + // with pending_points() they are CadLevel::Gesture, so Esc drops them and keeps the tool. + bool has_pending_picks() const { + return m_dim_has0 || m_op_a >= 0 || !m_tf_targets.empty() || m_pick0 >= 0 || m_sel_a >= 0; + } + bool gesture_pending() const { return !m_points.empty() || has_pending_picks(); } + // Enter while an edit-op or a transform is ready: apply it, the same as its value field's + // Enter. False when nothing is pending, so the key can fall through to the tab's ✓. + bool confirm_pending(); + bool end_chain(); // Polyline / Spline: finish the open chain as drawn void emit_step_hint(); // fires on_step_changed when the step actually moved // Is an in-canvas value field open? While one is, the canvas is frozen and every letter is // swallowed — the single most common reason a driven gesture "does nothing". @@ -203,9 +214,6 @@ public: void clear_move_gizmo(); bool moving_body() const { return m_mv_active; } int move_body_index() const { return m_mv_body; } - // F key forwarded from the canvas (Prepare's Place on Face): returns true if it acted. - bool request_place_on_face() { return on_place_on_face ? on_place_on_face() : false; } - std::function on_place_on_face; std::function on_body_move_changed; // Fired on each cycle change: (level 0=None/1=Whole/2=Face/3=Edge, body index, face id, edge id). std::function on_solid_selection_changed; @@ -550,25 +558,15 @@ public: reset_autoedit(); if (on_readout) on_readout(std::string()); // the HUD is not redrawn once the tool stops } - // Ctrl+Z while sketching: drop the last drawn entity (reuses delete_selected's remap). - bool undo_last_entity() { - if (!m_active || m_entities.empty()) return false; - m_selection.assign(1, int(m_entities.size()) - 1); - delete_selected(); - reset_autoedit(); - return true; - } - // Delete while sketching: the selected entities, or the last drawn one if none is selected. - bool delete_selected_or_last() { - if (!m_active) return false; - if (m_selection.empty()) { - if (m_entities.empty()) return false; - m_selection.assign(1, int(m_entities.size()) - 1); - } - delete_selected(); - reset_autoedit(); - return true; - } + // Ctrl+Z while sketching: drop the last thing DRAWN — a whole rectangle, slot or polygon + // when the last entity belongs to one, since that was one gesture. Undoing one side of a + // rectangle left three lines and dissolved the shape. + bool undo_last_entity(); + // Ctrl+Y / Ctrl+Shift+Z while sketching: bring back what undo_last_entity removed, as long + // as nothing was drawn or deleted since (then the old state is no longer "the next step"). + bool redo_last_entity(); + bool can_undo_entity() const { return m_active && !m_entities.empty(); } + bool can_redo_entity() const; std::function on_selection_changed; // Dimension tool: infer a driving dimension from the current selection and set @@ -612,6 +610,14 @@ public: // characteristic dimensions). Empty string -> hide the HUD. The owner (DesignCanvas) // shows it as a floating corner label over the GL canvas. std::function on_readout; + // Why something did not happen, or what a gesture did as a side effect. NOT on_readout: + // that one is rewritten every frame from build_readout(), so a message sent through it was + // gone before anyone could read it. The host shows this on its persistent status line. + std::function on_notice; + void notify(const std::string& msg, bool error = true) { if (on_notice) on_notice(msg, error); } + // A typed value the tool cannot take: the open value field comes back with the reason, or, + // when no field is committing, the reason goes to the status line. + void show_refusal(const std::string& why); // Driving dimension constraints accumulated during the session (the Dimension // tool records a SketchEntityConstraintDef per applied dimension); committed @@ -633,17 +639,11 @@ public: // request_exit() declined to leave because the session holds geometry. The panel owns the // status line, so the tool reports through this instead of writing text itself. std::function on_exit_refused; - std::function on_move_exit; // right-click finished the move-body gizmo // The two inner Esc levels, callable on their own so the panel can route one press to one // level (see DesignInteraction.hpp). Each returns whether it had anything to unwind. bool abort_gesture(); // CadLevel::Gesture — drop the entity being drawn bool disarm_tool(); // CadLevel::Tool — armed draw/edit tool falls back to Select void request_exit(); - // Ctrl+Z / Ctrl+Shift+Z (Ctrl+Y) while the Design canvas is focused: undo/redo the - // committed feature history. The tool just forwards to the host, which owns the - // CadDocument (the tool has no document of its own). redo == true requests redo. - std::function on_undo_redo; - void request_undo_redo(bool redo); private: bool screen_to_plane(GLCanvas3D& canvas, const wxMouseEvent& evt, Vec2d& out) const; @@ -660,10 +660,17 @@ private: // chains join across entities (a line + an arc can close into one loop). Shift // disables it. `snapped` reports whether a vertex was hit. Vec2d snap_vertex(GLCanvas3D& canvas, const wxMouseEvent& evt, const Vec2d& raw, bool& snapped) const; + bool click_snaps() const; // does the NEXT click of the armed draw tool land on a snap target? // --- P1 inference / auto-constraint engine --------------------------------- // Plane-units tolerance equivalent to ~`px` screen pixels at the cursor. - double screen_tol(GLCanvas3D& canvas, const wxMouseEvent& evt, const Vec2d& at, double px = 8.0) const; + // The sketcher's pick budgets, in screen pixels, converted to plane units by screen_tol(). + // One set for every tool, so the same thing is equally easy to hit whichever tool is armed. + static constexpr double kPickPx = 8.0; // grab a point, a handle or an edge; hover uses the same + static constexpr double kToolPickPx = 24.0; // pick an entity for a tool to act on (trim, edit-ops, + // transforms, constrain) + static constexpr double kLabelPx = 24.0; // click or double-click a value label + double screen_tol(GLCanvas3D& canvas, const wxMouseEvent& evt, const Vec2d& at, double px = kPickPx) const; // Run kernel inference at the cursor, cache the target for the hint renderer. InferenceSnap infer_at(GLCanvas3D& canvas, const wxMouseEvent& evt, const Vec2d& raw) const; // True if m_constraints already holds an equivalent Coincident between the two refs. @@ -1050,6 +1057,16 @@ private: Vec2d m_live_slot_angle_label{0,0}; // straight-slot centreline angle label int m_live_slot_fi{-1}; // the straight-slot Feature (rebuild edits) std::vector m_features; // parametric groups over m_entities + // Sketch-local redo: the state each undo_last_entity() replaced, and the entity/constraint + // counts it left behind (a mismatch means the sketch moved on and the redo is stale). + struct SketchSnap { + std::vector entities; std::vector constraints; + std::vector features; std::vector dimensions; + size_t after_entities{0}; size_t after_constraints{0}; + }; + std::vector m_sketch_redo; + int m_skipped_last{0}; // constraints the last solve could not apply (reported on change) + double m_chain_dup_tol{1e-9}; // plane units ~3 px at the last chain click (double-click repeat) int m_open_feature{-1}; // index of the Feature being built, or -1 // In-canvas edit-op gizmo state (Fillet/Chamfer/Offset/Mirror). GUI-only, reset by diff --git a/src/slic3r/GUI/CAD/McpControl.cpp b/src/slic3r/GUI/CAD/McpControl.cpp index 0ad05667c3..bc05e480c1 100644 --- a/src/slic3r/GUI/CAD/McpControl.cpp +++ b/src/slic3r/GUI/CAD/McpControl.cpp @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include @@ -1995,6 +1997,22 @@ std::string handle_on_main(const std::string& method, const json& params, const DesignPanel* panel = DesignPanel::ensure(); if (!panel) return rpc_error(id, -32001, "Design panel not ready"); + // A project opened without ever showing the Design tab has its recipe only in the Model; + // load it, as showing the tab would, before anything reads or writes the document. + panel->hydrate_from_model(); + + // Methods that only LOOK. Everything else changes the document or the live sketch, and + // must not do it under a GUI editor, a sketch session it does not own, or a rebuild in + // progress (the GUI's worker thread holds the document then). + static const std::set kReadOnly = { + "describe_tools", "describe_scene", "query_topology", "measure", "mass_properties", + "slice_body", "validate_against", "list_verbs", "sketch_describe", "sketch_validate", + "check_interference" }; + if (kReadOnly.count(method) == 0) { + std::string why; + if (panel->mcp_busy(method.rfind("sketch_", 0) == 0, why)) + return rpc_error(id, -32002, "Design tab busy: " + why); + } // Stale-id guard, checked here rather than in each handler. // @@ -2109,11 +2127,16 @@ std::string dispatch_request(const std::string& line) auto prom = std::make_shared>(); auto fut = prom->get_future(); + // 0 = queued, 1 = running, 2 = abandoned. A request that timed out while still QUEUED must + // never run: the client has been told it failed, and a retry would otherwise apply it twice. + auto state = std::make_shared>(0); // Nothing may escape this lambda. It is invoked by the wx event loop, which has no // handler of its own, so an escaping exception is std::terminate — the socket would // become a way for any client to kill the application. handle_on_main() catches what // it knows about; this catches what it does not, and still answers the caller. - wxGetApp().CallAfter([prom, method, params, id]() { + wxGetApp().CallAfter([prom, state, method, params, id]() { + int queued = 0; + if (!state->compare_exchange_strong(queued, 1)) return; // abandoned by a timeout try { prom->set_value(handle_on_main(method, params, id)); } catch (const std::exception& ex) { @@ -2122,20 +2145,33 @@ std::string dispatch_request(const std::string& line) prom->set_value(rpc_error(id, -32000, "internal error: unknown exception")); } }); - if (fut.wait_for(std::chrono::seconds(15)) != std::future_status::ready) - return rpc_error(id, -32000, "main-thread timeout"); + if (fut.wait_for(std::chrono::seconds(15)) != std::future_status::ready) { + int queued = 0; + if (state->compare_exchange_strong(queued, 2)) + return rpc_error(id, -32000, "main-thread timeout: the command was NOT run"); + // Already running: it will finish, so wait for its real answer rather than report a + // failure for a command that is in fact being applied. + fut.wait(); + } return fut.get(); } -// Read newline-delimited requests off one client connection until EOF. +// Read newline-delimited requests off one client connection until EOF. A line may not grow +// past kMaxLine: a client that never sends a newline would otherwise grow this buffer until the +// process runs out of memory. void serve_client(int cfd) { + constexpr size_t kMaxLine = 16u << 20; // 16 MB — far above any real request std::string buf; char chunk[4096]; for (;;) { ssize_t n = ::read(cfd, chunk, sizeof(chunk)); if (n <= 0) break; buf.append(chunk, size_t(n)); + if (buf.size() > kMaxLine && buf.find('\n') == std::string::npos) { + BOOST_LOG_TRIVIAL(error) << "MCP: request line over " << kMaxLine << " bytes; closing the connection"; + return; + } size_t nl; while ((nl = buf.find('\n')) != std::string::npos) { std::string line = buf.substr(0, nl); @@ -2155,9 +2191,30 @@ void serve_client(int cfd) } } +// Where the socket lives, for the exit handler. +std::string g_sock_path; + +void remove_socket_at_exit() +{ + struct stat st{}; + if (!g_sock_path.empty() && ::lstat(g_sock_path.c_str(), &st) == 0 && S_ISSOCK(st.st_mode)) + ::unlink(g_sock_path.c_str()); +} + void server_thread(std::string sock_path) { - ::unlink(sock_path.c_str()); + // Clear a stale socket from an earlier run — and ONLY a socket. ORCA_CAD_MCP names a path, + // and unlinking it unconditionally deleted whatever file that path happened to be. + { + struct stat st{}; + if (::lstat(sock_path.c_str(), &st) == 0) { + if (!S_ISSOCK(st.st_mode)) { + BOOST_LOG_TRIVIAL(error) << "MCP: " << sock_path << " exists and is not a socket; refusing to replace it"; + return; + } + ::unlink(sock_path.c_str()); + } + } int sfd = ::socket(AF_UNIX, SOCK_STREAM, 0); if (sfd < 0) { BOOST_LOG_TRIVIAL(error) << "MCP: socket() failed"; return; } @@ -2182,6 +2239,8 @@ void server_thread(std::string sock_path) ::close(sfd); ::unlink(sock_path.c_str()); return; } if (::listen(sfd, 1) < 0) { BOOST_LOG_TRIVIAL(error) << "MCP: listen() failed"; ::close(sfd); return; } + g_sock_path = sock_path; + std::atexit(remove_socket_at_exit); // do not leave the socket file behind BOOST_LOG_TRIVIAL(info) << "MCP control listening on " << sock_path; for (;;) { diff --git a/src/slic3r/GUI/CAD/McpControl.hpp b/src/slic3r/GUI/CAD/McpControl.hpp index 12e3289eb5..3a07bf920d 100644 --- a/src/slic3r/GUI/CAD/McpControl.hpp +++ b/src/slic3r/GUI/CAD/McpControl.hpp @@ -1,22 +1,24 @@ #ifndef slic3r_GUI_McpControl_hpp_ #define slic3r_GUI_McpControl_hpp_ -// MCP control surface (slice 1): a local JSON-RPC 2.0 server, line-delimited over a -// Unix domain socket, that lets an external MCP bridge drive and perceive the Design -// tab. Off unless the env var ORCA_CAD_MCP is set: +// MCP control surface: a local JSON-RPC 2.0 server, line-delimited over a Unix domain +// socket, that lets an external MCP bridge drive and perceive the Design tab. Off unless the +// CAD feature is enabled in Preferences AND the env var ORCA_CAD_MCP is set: // ORCA_CAD_MCP=1 -> socket at /tmp/orca-cad-mcp.sock -// ORCA_CAD_MCP=/path/to.sock -> socket at that path -// All CAD work is marshalled onto the wx main thread and runs through the SAME -// CadDocument kernel the GUI uses (no parallel engine). Slice-1 methods: -// describe_tools, describe_scene, extrude. +// ORCA_CAD_MCP=/path/to.sock -> socket at that path (an existing non-socket file there is +// left alone and the server does not start) +// The socket is created 0600 and removed at exit. All CAD work is marshalled onto the wx main +// thread and runs through the SAME CadDocument kernel the GUI uses (no parallel engine); +// describe_tools lists the methods. A method that changes the document is refused (-32002) +// while the Design tab is busy with it — a rebuild, an open feature card, a sketch session. // // ponytail: Unix-socket only (POSIX). Windows compiles this to a no-op; add a named // pipe transport when a Windows agent actually needs it. namespace Slic3r { namespace GUI { -// Start the server thread iff ORCA_CAD_MCP is set. Safe to call once after the -// MainFrame + DesignPanel exist. No-op when the env var is unset or on Windows. +// Start the server thread iff ORCA_CAD_MCP is set. Safe to call once the MainFrame exists — +// the Design panel is built on the first request. No-op when the env var is unset or on Windows. void start_mcp_control_if_enabled(); }} // namespace Slic3r::GUI diff --git a/src/slic3r/GUI/CAD/SketchInlineEditor.cpp b/src/slic3r/GUI/CAD/SketchInlineEditor.cpp index ae8bce8ebb..75371759f9 100644 --- a/src/slic3r/GUI/CAD/SketchInlineEditor.cpp +++ b/src/slic3r/GUI/CAD/SketchInlineEditor.cpp @@ -22,7 +22,8 @@ namespace { // Numbers are typed and shown with a POINT, whatever the locale: this field feeds a CAD kernel, // and a decimal comma reaching it as a thousands separator is a silent order-of-magnitude error. // Parsing accepts either separator because a keyboard's numeric pad may only offer one. -std::string fmt_value(double v, int digits = 2) +// Trailing zeros are dropped, so a count opens as "3" and a length as "37.457", not "37.46". +std::string fmt_value(double v, int digits = 3) { char fmt[16]; std::snprintf(fmt, sizeof(fmt), "%%.%df", digits); @@ -30,7 +31,13 @@ std::string fmt_value(double v, int digits = 2) std::snprintf(buf, sizeof(buf), fmt, v); for (char* c = buf; *c; ++c) if (*c == ',') *c = '.'; - return std::string(buf); + std::string s(buf); + if (s.find('.') != std::string::npos) { + while (!s.empty() && s.back() == '0') s.pop_back(); + if (!s.empty() && s.back() == '.') s.pop_back(); + } + if (s == "-0") s = "0"; + return s; } bool parse_value(const char* text, double& out) @@ -80,6 +87,9 @@ void SketchInlineEditor::open(const wxPoint& canvas_px, double value, const std: m_cancel = std::move(on_cancel); const std::string v = fmt_value(value); std::snprintf(m_buf, sizeof(m_buf), "%s", v.c_str()); + m_prefill_value = value; + m_prefill_text = v; + m_active = false; m_open = true; // ImGui takes keyboard focus for one frame on request; asking on the frame the field first // appears is what makes typing land without a click. There is no window manager to consult. @@ -91,6 +101,7 @@ void SketchInlineEditor::close() { m_open = false; m_focus_pending = false; + m_active = false; m_commit = nullptr; m_cancel = nullptr; m_err.clear(); @@ -114,10 +125,32 @@ void SketchInlineEditor::do_cancel() if (cb) cb(); } +bool SketchInlineEditor::refuse(const std::string& why) +{ + // Only meaningful while a commit callback runs and before it opened another field. + if (!m_in_commit || m_open) return false; + m_anchor = m_last.anchor; + m_title = m_last.title; + m_commit = m_last.commit; + m_cancel = m_last.cancel; + m_prefill_value = m_last.prefill_value; + m_prefill_text = m_last.prefill_text; + std::snprintf(m_buf, sizeof(m_buf), "%s", m_last.buf.c_str()); + m_err = why; + m_open = true; + m_focus_pending = true; + ux_trace("refused", m_title, "reason=" + why); + return true; +} + void SketchInlineEditor::do_commit() { double v = 0.0; - if (!parse_value(m_buf, v)) { + // An untouched field commits the value it opened with, not its rounded display: Enter on a + // 37.4567 line must not turn it into a 37.457 driving dimension. + if (m_prefill_text == m_buf) + v = m_prefill_value; + else if (!parse_value(m_buf, v)) { // Refusing input in silence is indistinguishable from the app having frozen: the field // just sits there and the user has no idea what it wants. Say so in the title line and // keep editing. @@ -128,11 +161,15 @@ void SketchInlineEditor::do_commit() } ux_trace("commit", m_title, std::string("typed=") + m_buf + " value=" + fmt_value(v, 4)); auto cb = m_commit; + m_last = Closed{ m_anchor, m_title, std::string(m_buf), m_commit, m_cancel, m_prefill_value, m_prefill_text }; close(); // AFTER close(): the callback may open the next queued dimension (a rectangle queues Width // then Height), and doing that into a field that still believes it is open would drop the // second one's prefill on the floor. + m_in_commit = true; if (cb) cb(v); + m_in_commit = false; + m_last = Closed{}; } bool SketchInlineEditor::render(ImGuiWrapper& imgui, float scale) @@ -167,10 +204,15 @@ bool SketchInlineEditor::render(ImGuiWrapper& imgui, float scale) // EnterReturnsTrue so Enter commits from inside the widget; AutoSelectAll so the prefill is // replaced by the first digit typed, which is what "pre-selected" meant when this was a // wxTextCtrl and is what makes typing a value a single gesture. + // No CharsDecimal: it lets only the LOCALE's decimal separator through, so in a C locale a + // comma could not be typed at all, and it admits '*' and '/' that the parser then refuses. + // parse_value() is the one judge of what is a number. const bool entered = ImGui::InputText("##sketchvalue_in", m_buf, sizeof(m_buf), ImGuiInputTextFlags_EnterReturnsTrue - | ImGuiInputTextFlags_AutoSelectAll - | ImGuiInputTextFlags_CharsDecimal); + | ImGuiInputTextFlags_AutoSelectAll); + m_active = ImGui::IsItemActive(); + // Tab accepts the value like Enter does (and moves on to the next queued field, if any). + const bool tabbed = m_active && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Tab)); // MEASUREMENT, not a fix: one line per frame saying whether ImGui believes it owns the // keyboard and whether our widget is the active one. "Typing does not arrive" has two very // different causes — no FRAMES (this canvas repaints on demand only, so an idle canvas never @@ -194,7 +236,7 @@ bool SketchInlineEditor::render(ImGuiWrapper& imgui, float scale) // Act AFTER end(): do_commit can reopen the field for the next queued dimension, and that // must not happen inside this frame's window. - if (entered) + if (entered || tabbed) do_commit(); else if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape))) do_cancel(); diff --git a/src/slic3r/GUI/CAD/SketchInlineEditor.hpp b/src/slic3r/GUI/CAD/SketchInlineEditor.hpp index 162d157864..a567d978be 100644 --- a/src/slic3r/GUI/CAD/SketchInlineEditor.hpp +++ b/src/slic3r/GUI/CAD/SketchInlineEditor.hpp @@ -48,6 +48,10 @@ public: void close(); // drop it with neither callback void cancel(); // if open, run the registered cancel (keep-as-drawn) void commit(); // if open, run the registered commit (accept the typed value) + // Called from inside a commit callback that cannot accept the value (a negative length, a + // count of 1): the field comes back with the typed text and `why` in its title line, instead + // of closing as if the value had been taken. + bool refuse(const std::string& why); // true if the field came back bool is_open() const { return m_open; } // Draw it, and let ImGui do the editing. Called from DesignSketchTool::render() inside the @@ -69,11 +73,10 @@ public: // breaks the circle. std::function request_frame; - // Kept because callers ask them, but there is no longer any difference to report: with no - // window there is no state where the field is on screen but logically closed, and no state - // where it is open but somebody else holds the keyboard. bool is_mapped() const { return m_open; } - bool has_focus() const { return m_open; } + // Does the ImGui text widget own the keyboard? False once a click elsewhere deactivated it; + // the panel then forwards Enter/Tab to commit() itself, since ImGui no longer sees them. + bool has_focus() const { return m_open && (m_active || m_focus_pending); } void dismiss() { close(); } private: @@ -88,6 +91,17 @@ private: std::string m_title; std::string m_err; // why the last value was refused, shown in the title line char m_buf[64]{}; // the edited text; ImGui::InputText writes into it + double m_prefill_value{0.0}; // the exact value the field opened with... + std::string m_prefill_text; // ...and how it was shown: an untouched field commits the former + bool m_active{false}; // the InputText was the active item last frame + // What the last commit closed, so refuse() can bring the same field back. + struct Closed { + wxPoint anchor; std::string title; std::string buf; + std::function commit; std::function cancel; + double prefill_value{0.0}; std::string prefill_text; + }; + Closed m_last; + bool m_in_commit{false}; }; }} // namespace Slic3r::GUI diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 01ff6de714..c4d9173268 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3415,68 +3415,10 @@ void GLCanvas3D::on_char(wxKeyEvent& evt) return; } -#ifdef SLIC3R_CAD - const int ctrlMask = wxMOD_CONTROL; - const int shiftMask = wxMOD_SHIFT; -#endif - - // Design tab: Delete/Backspace removes the selected sketch entities while a - // sketch tool is active and the canvas has focus (dialog text fields are separate - // wx controls, so this never eats their editing keys). -#ifdef SLIC3R_CAD - if (m_design_sketch_tool != nullptr && m_design_sketch_tool->is_active() - && (keyCode == WXK_DELETE || keyCode == WXK_BACK) - && !m_design_sketch_tool->selection().empty()) { - m_design_sketch_tool->delete_selected(); - m_dirty = true; - render(); - return; - } -#endif - - // Esc exits the active sketch tool (Onshape-like, layered: abort in-progress entity -> - // drop to Select -> exit the session back to Feature mode). -#ifdef SLIC3R_CAD - if (m_design_sketch_tool != nullptr && m_design_sketch_tool->is_active() - && keyCode == WXK_ESCAPE) { - m_design_sketch_tool->request_exit(); - m_dirty = true; - render(); - return; - } -#endif - - // Design tab: Ctrl+Z / Ctrl+Shift+Z (and Ctrl+Y) undo/redo the Design feature - // history. Scoped by m_design_sketch_tool — only the Design canvas owns one — so the - // main 3D editor's undo/redo (the CanvasView3D-gated cases further below) is untouched. - // Handled here, before the generic Ctrl block, so it takes precedence and early-returns. -#ifdef SLIC3R_CAD - if (m_design_sketch_tool != nullptr && (evt.GetModifiers() & ctrlMask) != 0) { - const bool is_z = (keyCode == 'z' || keyCode == 'Z' || keyCode == WXK_CONTROL_Z); - const bool is_y = (keyCode == 'y' || keyCode == 'Y' || keyCode == WXK_CONTROL_Y); - if (is_z || is_y) { - const bool redo = is_y || ((evt.GetModifiers() & shiftMask) != 0); - m_design_sketch_tool->request_undo_redo(redo); - m_dirty = true; - render(); - return; - } - } -#endif - - // Design tab: F = Place on Face (Prepare's lay-flat), when the Design viewport is up - // and a body face is selected. The tool forwards to DesignPanel::place_on_face; it returns - // false (no face picked) so F falls through to the default handler below. -#ifdef SLIC3R_CAD - if (m_design_sketch_tool != nullptr && m_design_sketch_tool->has_display() - && (keyCode == 'f' || keyCode == 'F') && (evt.GetModifiers() & ctrlMask) == 0) { - if (m_design_sketch_tool->request_place_on_face()) { - m_dirty = true; - render(); - return; - } - } -#endif + // Design tab: Delete, Esc, Ctrl+Z/Y and F are NOT handled here. DesignPanel's CHAR_HOOK owns + // them (one route per key, whatever holds focus) and only lets a key through to this canvas + // when an in-canvas value field is open -- which is exactly when Backspace must edit the + // number rather than delete the geometry it measures. //BBS: add orient deactivate logic if (keyCode == WXK_ESCAPE @@ -3754,19 +3696,6 @@ static void key_released(int key) { s_keys_down.erase(key); } void GLCanvas3D::on_key(wxKeyEvent& evt) { - // Design tab: Delete/Backspace removes selected sketch entities. GTK delivers - // these as KEY_DOWN rather than CHAR, so handle it here too. -#ifdef SLIC3R_CAD - if (evt.GetEventType() == wxEVT_KEY_DOWN - && m_design_sketch_tool != nullptr && m_design_sketch_tool->is_active() - && (evt.GetKeyCode() == WXK_DELETE || evt.GetKeyCode() == WXK_BACK) - && !m_design_sketch_tool->selection().empty()) { - m_design_sketch_tool->delete_selected(); - m_dirty = true; - render(); - return; - } -#endif const int keyCode = evt.GetKeyCode(); if (evt.GetEventType() == wxEVT_KEY_DOWN) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 343d95d3ff..8d0e40278f 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1320,6 +1320,14 @@ void MainFrame::show_option(bool show) } } +#ifdef SLIC3R_CAD +DesignPanel* MainFrame::shown_design_panel() const +{ + DesignPanel* design = DesignPanel::if_built(); + return (design != nullptr && m_design_page != nullptr && m_design_page->IsShownOnScreen()) ? design : nullptr; +} +#endif + void MainFrame::init_tabpanel() { // wxNB_NOPAGETHEME: Disable Windows Vista theme for the Notebook background. The theme performance is terrible on // Windows 10 with multiple high resolution displays connected. @@ -1411,8 +1419,9 @@ void MainFrame::init_tabpanel() { #ifdef SLIC3R_CAD // The experimental feature is off by default, and when it is off the page is never // created, so the tab does not appear at all (the preference takes effect on the next - // start, like the other feature toggles). - if (wxGetApp().is_enable_cad_feature()) { + // start, like the other feature toggles). Nor in the G-code viewer, which has no Design tab to put + // it in — and no business opening a control socket onto one. + if (wxGetApp().is_enable_cad_feature() && wxGetApp().is_editor()) { // Experimental and heavy enough that building it unasked would cost more than it saves. m_design_page = new LazyPage(this, TAB_ID_DESIGN, -1); m_lazy_pages.push_back(m_design_page); @@ -3001,12 +3010,28 @@ void MainFrame::init_menubar_as_editor() #ifndef __APPLE__ // BBS undo append_shortcut_item(editMenu, Shortcut::Undo, true, _L("Undo"), - _L("Undo"), [this](wxCommandEvent&) { m_plater->undo(); }, - "menu_undo", nullptr, [this](){return m_plater->can_undo(); }, this); + _L("Undo"), [this](wxCommandEvent&) { +#ifdef SLIC3R_CAD + if (DesignPanel* dp = shown_design_panel()) { dp->menu_undo_redo(false); return; } +#endif + m_plater->undo(); }, + "menu_undo", nullptr, [this](){ +#ifdef SLIC3R_CAD + if (DesignPanel* dp = shown_design_panel()) return dp->menu_can_undo_redo(false); +#endif + return m_plater->can_undo(); }, this); // BBS redo append_shortcut_item(editMenu, Shortcut::Redo, true, _L("Redo"), - _L("Redo"), [this](wxCommandEvent&) { m_plater->redo(); }, - "menu_redo", nullptr, [this](){return m_plater->can_redo(); }, this); + _L("Redo"), [this](wxCommandEvent&) { +#ifdef SLIC3R_CAD + if (DesignPanel* dp = shown_design_panel()) { dp->menu_undo_redo(true); return; } +#endif + m_plater->redo(); }, + "menu_redo", nullptr, [this](){ +#ifdef SLIC3R_CAD + if (DesignPanel* dp = shown_design_panel()) return dp->menu_can_undo_redo(true); +#endif + return m_plater->can_redo(); }, this); editMenu->AppendSeparator(); // BBS Cut TODO append_shortcut_item(editMenu, Shortcut::Cut, true, _L("Cut"), @@ -3053,8 +3078,15 @@ void MainFrame::init_menubar_as_editor() if (handle_key_event(e)) { return; } +#ifdef SLIC3R_CAD + if (DesignPanel* dp = shown_design_panel()) { dp->menu_undo_redo(false); return; } +#endif m_plater->undo(); }, - "", nullptr, [this](){return m_plater->can_undo(); }, this); + "", nullptr, [this](){ +#ifdef SLIC3R_CAD + if (DesignPanel* dp = shown_design_panel()) return dp->menu_can_undo_redo(false); +#endif + return m_plater->can_undo(); }, this); // BBS redo append_shortcut_item(editMenu, Shortcut::Redo, false, _L("Redo"), _L("Redo"), [this, handle_key_event](wxCommandEvent&) { @@ -3065,8 +3097,15 @@ void MainFrame::init_menubar_as_editor() if (handle_key_event(e)) { return; } +#ifdef SLIC3R_CAD + if (DesignPanel* dp = shown_design_panel()) { dp->menu_undo_redo(true); return; } +#endif m_plater->redo(); }, - "", nullptr, [this](){return m_plater->can_redo(); }, this); + "", nullptr, [this](){ +#ifdef SLIC3R_CAD + if (DesignPanel* dp = shown_design_panel()) return dp->menu_can_undo_redo(true); +#endif + return m_plater->can_redo(); }, this); editMenu->AppendSeparator(); // BBS Cut TODO append_shortcut_item(editMenu, Shortcut::Cut, false, _L("Cut"), diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp index 0033f41a18..798ddad274 100644 --- a/src/slic3r/GUI/MainFrame.hpp +++ b/src/slic3r/GUI/MainFrame.hpp @@ -495,6 +495,9 @@ public: // through LazyInstance's statics, and show_device() only moves pages in and out of the book. #ifdef SLIC3R_CAD LazyPage* m_design_page { nullptr }; + // The Design panel when its tab is the one on screen, else null. Edit > Undo/Redo act on + // the tab that is shown: its own history when that is Design, the plater's otherwise. + DesignPanel* shown_design_panel() const; #endif //BBS: GUI refactor LazyPage* m_monitor_page{ nullptr }; From c74ddf8bb5f2daafc964ad5c46b35d4f091729d1 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 28 Sep 2026 17:58:17 +0000 Subject: [PATCH 141/389] Design tab: translatable offer, one vocabulary, reports in the status line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Offer table: user-facing strings carry the L() marker so xgettext extracts them; DesignOffer.hpp, DesignSketchTool.cpp and SketchInlineEditor.cpp are listed in localization/i18n/list.txt. - Offer: model-mode Constrain sits in the same row as the sketch one; Interference is wired; Rib shows its R key; a verb that accepts the selection but is blocked by the document stays greyed with its reason instead of vanishing from the submenu; one refusal wording per verb. - Extrude infers Join when the profile touches a solid (new CadDocument::body_touching_sketch) and on face push/pull; New body in free space. Revolve/Sweep/Loft/Boolean use the same result words. - Interference and volume/area reports go to the status line in mm3/mm2 instead of modal dialogs; Delete Body no longer asks (it is undoable). - New feature names match the card header ("Extrude 3"), translated; "Coordinate system", "Angle (°)", center/color spelling, translated face and length readouts, slot hints say width. - CAD gizmos in Prepare are selectable only with the CAD feature on; the sketch auto-close setting is stored per design. - Docs: confirm/cancel rules, enabling the feature and MCP in design_tab.md; drift-only right-click in interaction-model.md; the portability note rewritten to describe the integration as it is. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- docs/CAD/design_tab.md | 43 ++- docs/CAD/design_tab_pr_description.md | 7 +- docs/CAD/design_tab_upstream_portability.md | 197 +++------- docs/CAD/ux/interaction-model.md | 12 +- docs/CAD/ux/mockups/gen_offer_table.py | 20 +- docs/CAD/ux/tool_atlas.json | 74 ++-- localization/i18n/list.txt | 2 + scripts/CAD/check-gui-context-menu.py | 3 +- src/libslic3r/CAD/CadDocument.cpp | 27 +- src/libslic3r/CAD/CadDocument.hpp | 8 + src/libslic3r/CAD/SketchEngine.cpp | 15 +- src/libslic3r/CAD/SketchEngine.hpp | 6 +- src/libslic3r/Format/bbs_3mf.cpp | 9 +- src/slic3r/GUI/CAD/DesignOffer.hpp | 207 +++++------ src/slic3r/GUI/CAD/DesignPanel.cpp | 380 ++++++++++---------- src/slic3r/GUI/CAD/DesignPanel.hpp | 2 + src/slic3r/GUI/CAD/DesignSketchTool.cpp | 16 +- src/slic3r/GUI/Gizmos/GLGizmoPrimitive.cpp | 62 ++-- src/slic3r/GUI/Gizmos/GLGizmoPrimitive.hpp | 1 + src/slic3r/GUI/Gizmos/GLGizmoSketch.cpp | 83 +++-- src/slic3r/GUI/Gizmos/GLGizmoSketch.hpp | 1 + src/slic3r/GUI/Plater.cpp | 17 +- src/slic3r/GUI/Preferences.cpp | 23 +- tests/libslic3r/test_caddocument.cpp | 29 +- 24 files changed, 662 insertions(+), 582 deletions(-) diff --git a/docs/CAD/design_tab.md b/docs/CAD/design_tab.md index 170c5ed0ce..80a94373f6 100644 --- a/docs/CAD/design_tab.md +++ b/docs/CAD/design_tab.md @@ -14,10 +14,15 @@ already ships for STEP import. ## Getting started +The Design tab is experimental. It exists only in builds with `SLIC3R_CAD` on, and appears +after **Preferences → CAD feature (experimental)** is ticked and the app restarted. Switched off, +Prepare and every project behave exactly as without it; a project that carries a design keeps +its recipe untouched. + 1. Open the **Design** tab. 2. Click a face or a reference plane in the viewport, then press `Shift+S` (Sketch). The offer opens with the sketch tools on it. -3. Draw a closed profile, then press **✓ Confirm** in the floating action bar. +3. Draw a closed profile, then press **✓ Confirm** in the floating action bar (or `Enter`). 4. With the sketch selected, press `Shift+E` (Extrude). 5. Press **Commit to Plate** to hand the solid to Prepare. @@ -59,7 +64,8 @@ sketch tools — the app hands you the tools directly. Repeat, Transform, Reference, Modify. - A family with at least one applicable verb shows it. Several applicable verbs collapse - into a submenu under the family name. + into a submenu under the family name. A verb that is about the selection but blocked by the + document (no body yet, no second sketch) stays in that submenu, greyed, with its reason. - A family with nothing applicable is **shown greyed in place, with the reason** — e.g. *"Create — Click a face or a reference plane in the viewport, then a sketch tool"*. It is not hidden. A control that cannot be used still says what it is and what you would have to @@ -72,6 +78,22 @@ Redo, Variables, Section view, Origin planes, World axes. They live in the toolb --- +## Confirm and cancel + +One rule everywhere, in the feature cards and in the sketch alike: + +- `Enter` does what **✓** does; `Esc` does what **✗** does. Neither is ever the only way. +- `Esc` steps back exactly one level — a value field, then the gesture in progress, then the + armed tool, then the selection. It never deletes, discards a sketch or rolls back a feature. +- A click on empty space clears the selection. It never applies anything: a pending fillet, + offset, move or array waits for `Enter` or **✓**. +- Right-click on a tool with something pending drops that gesture; with nothing pending it + opens the offer, like anywhere else. +- Switching to another tool applies a pending operation that is complete and valid, then arms + the new tool. +- A value typed into a field that the geometry cannot take (a zero-length side, an arc of more + than 360°) is refused in place: the field stays open and says why. + ## Keyboard Single letters drive sketch tools **while a sketch is open**; Shift+letter drives feature @@ -100,8 +122,10 @@ selected by the mode, not by whether a sketch session is running. | `H` | Chamfer — pick two lines, set the distance | | `K` | Constrain — finish the live sketch and enter constrain | | `Q` | Construction toggle — draw the next entity as construction geometry | -| `Del` | Delete the selected sketch entity | -| `Esc` | Cancel the live tool | +| `Del` | Delete the selected sketch entities (nothing selected: nothing happens) | +| `Enter` | Apply what is pending; otherwise end the chain; otherwise drop the tool | +| `Esc` | Undo one level: close the field, drop the gesture, drop the tool, clear the selection | +| `Ctrl+Z` / `Ctrl+Y` | Undo / redo the last sketch edit | ### Feature (when no sketch is open) @@ -151,7 +175,9 @@ kept. With no section on, `F` is Place on Face — lay the picked face flat on t ## Sketching A sketch is a closed (or open) 2D profile on a plane or on a flat face of an existing body. -Press `Shift+S`, click the face or plane you want to sketch on, and draw. The toolbar and +Pick the face or plane and press `Shift+S` — the offer opens with the sketch tools. Pressing +`Shift+S` with nothing picked also works: the status line asks for the face or plane, and the +first tool you arm sketches on it. The toolbar and the offer both carry the sketch tools. **Entities:** line, polyline, rectangle (corner / centre / oblique / rounded), circle @@ -290,6 +316,13 @@ edit; the importer warns before you commit to it. inside the 3MF, so reopening the project restores the editable model rather than a frozen mesh. +**MCP control** lets an external agent drive the tab through the same kernel the GUI uses. +Start the app with `ORCA_CAD_MCP=1` (socket `/tmp/orca-cad-mcp.sock`) or +`ORCA_CAD_MCP=/path/to.sock`; the CAD feature must be enabled too. Linux and macOS only. A +command that would change the document is refused while the Design tab is busy with it — a +rebuild, an open feature card or a sketch session — so the agent and the user never edit the +same thing at once. + --- ## View controls diff --git a/docs/CAD/design_tab_pr_description.md b/docs/CAD/design_tab_pr_description.md index a6d67f0e7c..450afeec70 100644 --- a/docs/CAD/design_tab_pr_description.md +++ b/docs/CAD/design_tab_pr_description.md @@ -20,13 +20,14 @@ design intent that both steps discard. A part modified after slicing should retu feature history, not to a mesh. Keeping the CAD model inside the slicer preserves that loop — the nozzle diameter, the build volume and the material are known at design time. -For the integration case in full: [design_tab_upstream_portability.md](docs/design_tab_upstream_portability.md). +For the integration case in full: [design_tab_upstream_portability.md](design_tab_upstream_portability.md). ## How it is built The `SLIC3R_CAD` CMake flag (default ON) gates the entire tab. With it OFF the tab is not compiled and the deps prefix matches upstream exactly — the dependency diff is one line in -OCCT's CMake: `BUILD_MODULE_ModelingAlgorithms=OFF → ON`. +OCCT's CMake: `BUILD_MODULE_ModelingAlgorithms=OFF → ON`. At run time the tab is off until +Preferences → CAD feature (experimental) is enabled. Measured cost table: [cad_dependency_weight.md](docs/cad_dependency_weight.md). @@ -55,7 +56,7 @@ circle-line tangency solver abort and the internal-thread reference) are fixed. The vendored solver in `src/libslic3r/slvs/` is **GPL-3.0** (see `src/libslic3r/slvs/LICENSE`), not LGPL. The combined work is distributable under AGPL-3.0. See the Licensing section of -[design_tab_upstream_portability.md](docs/design_tab_upstream_portability.md) for the +[design_tab_upstream_portability.md](design_tab_upstream_portability.md) for the AGPLv3/GPLv3 compatibility argument; this point should be confirmed with upstream explicitly. ## Not verified diff --git a/docs/CAD/design_tab_upstream_portability.md b/docs/CAD/design_tab_upstream_portability.md index a7e9cd84ed..ab5ddde957 100644 --- a/docs/CAD/design_tab_upstream_portability.md +++ b/docs/CAD/design_tab_upstream_portability.md @@ -1,162 +1,77 @@ -# Design (CAD) tab — upstream integration brief +# Design (CAD) tab — integration surface -**Question:** can the Design tab (sketch-first parametric CAD: sketch → constrain → -extrude/revolve/fillet/hole/thread/shell, multi-body, undo, 3MF persistence) land in -mainline OrcaSlicer? +What the Design tab adds to OrcaSlicer, what it touches that upstream already has, and the +constraints that come with it. The dependency cost is measured separately in +[cad_dependency_weight.md](cad_dependency_weight.md); this page does not repeat its numbers. -**Answer: yes, and the ask is far smaller than previously believed.** OCCT is *already* -an OrcaSlicer dependency. We are not asking upstream to adopt a new library; we are -asking it to widen one it already builds, at a measured cost of **3.77 MiB on Windows**. +## Two gates -> ### Corrections to the 2026-06-21 assessment -> That revision was written before the persistence work landed and got two load-bearing -> facts wrong. Both are corrected here from direct measurement of the branch: -> -> 1. **"The real blocker: OCCT … a dependency mainline OrcaSlicer has never carried."** -> **False.** `deps/OCCT/` exists at the merge-base and upstream links it from -> `Format/STEP.cpp`, `Format/svg.cpp`, and `Shape/TextShape.cpp`. Our entire -> dependency diff is **one line**: `BUILD_MODULE_ModelingAlgorithms=OFF → ON`. -> 2. **"vendored SolveSpace solver … LGPL."** **False.** `src/libslic3r/slvs/LICENSE` is -> **GPL-3.0**, not LGPL. This is fine (see Licensing) but must not be misstated. -> -> It also claimed "no changes to Model" — no longer true; 3MF recipe persistence adds one -> `std::string` to `Model`. +- **Compile time: `SLIC3R_CAD`** (`CMakeLists.txt`, default ON in this tree). OFF builds no + CAD code at all and leaves the OCCT deps prefix identical to upstream. ON also turns on + OCCT's `ModelingAlgorithms` module (`deps/OCCT/OCCT.cmake`). +- **Run time: Preferences → CAD feature (experimental)** (`enable_cad_feature`, default OFF). + Off, the Design page and the MCP control socket are not created, the Prepare-toolbar Sketch + and Primitive gizmos cannot be selected, and the Design-only preferences are hidden: Prepare + behaves as it does without the feature. A project that carries a CAD recipe still loads, + keeps the recipe and writes it back unchanged. -## Measured shape of the change +## Dependencies -Against merge-base `449a4cf9fc` (34 commits ahead): +OCCT is already an upstream dependency (STEP import, SVG, text shapes). The Design tab adds no +library; it widens the OCCT build by one module, which builds three extra toolkits — TKFillet, +TKOffset and TKFeat — of which the first two are linked. The module flag is all-or-nothing, so +TKFeat is built although nothing references it. -| | files | lines | -|---|---:|---:| -| **New files** | 138 | +61,720 | -| **Modified upstream files** | 23 | +457 / −75 | -| **Deleted upstream files** | 0 | — | +The constraint solver is vendored in `src/libslic3r/slvs/`: a self-contained subset of +SolveSpace (`libslvs`), GPL-3.0, no external dependencies. GPLv3 §13 and AGPLv3 §13 permit the +combination with OrcaSlicer's AGPL-3.0. -The 62 kLOC headline is inflated by localization. The feature itself: +## Footprint in upstream files -| area | LOC | files | -|---|---:|---:| -| kernel (`src/libslic3r/`) | 15,828 | 37 | -| GUI (`src/slic3r/`) | 19,544 | 14 | -| tests (Catch2) | 2,567 | 6 | -| i18n (unrelated; strip from the CAD PR) | 23,438 | 77 | +Almost all of the change is new files under `src/libslic3r/CAD/`, `src/slic3r/GUI/CAD/`, +`src/libslic3r/slvs/` and `tests/`. The hooks into existing code are small and null-guarded: -**99.3 % of the diff is new files.** The negotiable surface is 457 added lines across 23 -files, and nothing upstream is deleted. The largest single hook is `GLCanvas3D.cpp` -(+110/−2): an `m_design_sketch_tool` member plus render/mouse/key hooks, **every one -already null-guarded** — which is why the compile-time gate below is cheap. +- `GLCanvas3D` — a `DesignSketchTool` pointer plus render, mouse and key hooks, each a no-op + when no Design canvas owns it. +- `MainFrame` — the Design page and the Edit menu routing Undo/Redo to it while it is shown. +- `Plater` — the "no geometry" warning distinguishes a recipe-only project. +- `Model` — one `std::string cad_recipe`, empty for non-CAD projects. +- `bbs_3mf` — reading and writing that string (below). +- `Preferences`, `GUI_App` — the two preferences. -No changes to the slicing pipeline (Print/PrintObject/Layer/GCode), Tab, or the -printer-profile/config system. +Nothing in the slicing pipeline (Print, PrintObject, Layer, GCode), Tab, or the profile and +config system changes. -## The dependency ask, precisely - -Not "adopt OCCT" — **widen the existing OCCT build**: - -```diff -- -DBUILD_MODULE_ModelingAlgorithms=OFF -+ -DBUILD_MODULE_ModelingAlgorithms=ON -``` - -Cost, measured from the shipped Windows artifact (42 OCCT DLLs, 45.43 MiB total): - -| toolkit | size | note | -|---|---:|---| -| `TKFillet.dll` | 2.02 MiB | only exists with the flag ON | -| `TKOffset.dll` | 1.75 MiB | only exists with the flag ON | -| **delta** | **3.77 MiB** | Windows only (OCCT is Shared on Win, Static elsewhere) | - -`TKBool` is *not* part of the delta — upstream's `DataExchange` already pulls it in -transitively. On macOS/Linux OCCT links statically, so the cost is only the code actually -referenced, not a 3.77 MiB floor. - -**Unmeasured, and we should measure before the call:** clean-deps build-time delta with -the flag ON vs OFF, and the resulting CI runner-minute cost. Do not guess these at him. - -## Licensing - -- Vendored solver `src/libslic3r/slvs/` — **GPL-3.0**, 9,339 LOC, © Jonathan Westhues, - a self-contained subset of SolveSpace (`libslvs`). No external dependencies. -- OrcaSlicer — **AGPL-3.0** (`LICENSE.txt`). - -GPLv3 §13 expressly permits combining a GPLv3 work with an AGPLv3 work; AGPLv3 §13 grants -the converse. The combined work is distributable under AGPL-3.0 with the solver's GPLv3 -terms preserved. This is a favourable direction (GPLv3 → into an AGPLv3 project), but it -is a point to **confirm explicitly with upstream**, not to assert unilaterally. - -Open question for SoftFever: keep the solver **vendored** (current: pinned, no submodule, -no external build) or move it to `deps/` as a fetched external? Vendoring costs us -upstream-sync burden; `deps/` costs build complexity. - -## The one irreversible decision: the 3MF format - -Persistence adds an **optional** archive entry and one field: - -```cpp -// Model.hpp -std::string cad_recipe; // empty for non-CAD projects -``` +## The 3MF entry ``` -Metadata/orca_cad.bin // written only when cad_recipe is non-empty +Metadata/orca_cad.bin written only when cad_recipe is non-empty +Metadata/SnapOrca_cad.bin legacy name: read, never written; loses to orca_cad.bin ``` -Readers that do not know the entry ignore it; writers skip it entirely when empty. So -existing projects are bit-identical and old readers are unaffected. Good. +Readers that do not know the entry ignore it and writers skip it when the recipe is empty, so +projects without a design are byte-identical and older readers are unaffected. The reader caps +the entry at 1 GiB. -**But the moment upstream ships this, it owns forward-compatibility forever.** Three -things should be settled *before* the first release, because none can be changed after: +The entry is a cereal `PortableBinaryArchive`, portable across endianness and word size. Its +layout is versioned: -1. **Name.** Renamed to `Metadata/orca_cad.bin`. -2. **Encoding.** The recipe is an opaque **cereal `PortableBinaryArchive`** blob whose - layout is the field order of `CadFeature::serialize`. Portable across endianness and - word size — *not* across a field reorder. Append-only is currently a convention held by - discipline, not by any check. -3. **Embedded BRep.** `Import` features embed OCCT's ASCII BRep for the imported solid, - which couples saved project files to an OCCT BRep revision. Alternative: re-import from - the source STEP and store only a reference. Worth deciding deliberately. +- **v5 and later** frame every feature separately, so fields are appended to + `CadFeature::serialize` without a version bump and an older reader skips what it does not + know. Optional document-level data (variables, body names, origin, colours, the + auto-close setting) follows in trailing blocks that a reader stops at cleanly when absent. +- **v4** is the flat layout, read by the frozen `CadFeature::load_flat_v4`, which must never + change. -**Concrete gap we should close before the call.** `test_caddocument.cpp` covers the -in-memory round-trip and correctly refuses a version-999 blob — but there is **no -checked-in v1 fixture on disk**. A reordered field in `CadFeature::serialize` would pass -the entire suite while silently breaking every previously-saved project. Ship a golden -`.bin` fixture generated today plus a test that loads it; that is the only thing that will -hold the format still once real users have files. +Checked-in fixtures `tests/data/cad_recipe_v3.bin`, `cad_recipe_v4.bin` and +`cad_recipe_v5.bin` hold the format still: `test_caddocument.cpp` loads them and checks what +they contain, so a reordered field fails the suite instead of breaking saved projects. -## Proposed PR decomposition +`Import` features embed OCCT's ASCII BRep of the imported solid, which ties a saved project to +a BRep revision OCCT can read. -35 kLOC in one PR is not reviewable. Behind the flag, slices 1–4 are behaviour-neutral for -existing users: +## Undo -1. **Build gate + OCCT flag + Windows packaging guard.** `-DSLIC3R_CAD=ON/OFF`, default - **OFF**. Flips `ModelingAlgorithms=ON`. Includes the guard that asserts every linked - OCCT toolkit has a shipped DLL (already on both forks: `546cef5f42`). ← *this is what - makes SoftFever's "parallel build" a one-line CI matrix entry.* -2. **Vendored `slvs` solver** + its Catch2 tests. No GUI, no OCCT. -3. **CAD kernel** (`CadDocument`, `SketchEngine`, `GeometryEngine`, `Sketch*`) + kernel - tests. Headless, no GUI. -4. **3MF recipe persistence** + golden-fixture regression test. -5. **GUI Design tab** (`DesignPanel`, `DesignCanvas`, `DesignSketchTool`, `GLGizmoSketch`) - + the 23 upstream hooks. - -## Agenda for the call - -Questions only SoftFever can answer: - -- Does OrcaSlicer *want* to be a CAD-integrated slicer? (Strategic; everything else is mechanical.) -- Default of `SLIC3R_CAD` at merge time, and when it flips ON. -- Vendored solver vs `deps/` external; and confirmation of the GPLv3/AGPLv3 combination. -- Project-file format: neutral name, encoding, embedded-BRep policy, and who owns v1 forward-compat. -- Undo/redo: the Design tab has its own stack; integrate with Orca's snapshot system or keep separate? -- Does he want the i18n work (Romanian, +23 kLOC) as a wholly separate PR? (Yes, almost certainly.) - -## Verdict - -Portability **high**. The prior "does upstream want OCCT" framing was wrong — OCCT is -already there. What remains is a 3.77 MiB dependency widening, a compile-time gate that -the existing null-guards make cheap, and one file-format decision that must be made before -the first release rather than after. - ---- -*Revised 2026-07-10 from direct measurement of `cad-mainline` @ `546cef5f42` vs upstream -merge-base `449a4cf9fc`. Supersedes the 2026-06-21 read-only assessment.* +The Design tab keeps its own history (`CadDocument` checkpoints), separate from the Plater's +snapshot stack. The Edit menu's Undo/Redo drive whichever of the two belongs to the page on +screen. diff --git a/docs/CAD/ux/interaction-model.md b/docs/CAD/ux/interaction-model.md index 2041978ea0..c6407161b2 100644 --- a/docs/CAD/ux/interaction-model.md +++ b/docs/CAD/ux/interaction-model.md @@ -72,10 +72,11 @@ which is what makes the destructive path unrepresentable rather than merely unli own handlers so it can consume the event before them: ```cpp -RIGHT_DOWN: remember the press position and the clock, then Skip() // the canvas still seeds the orbit +RIGHT_DOWN: remember the press position, clear `travelled`, then Skip() // the canvas still seeds the orbit +MOTION: travelled |= drift from the press > 3 px // an orbit that came back still orbited RIGHT_UP: terminated = sketch_tool.take_right_consumed(); // read-and-clear, always - is_click = drift <= 3 px && dt <= 200 ms; // both budgets, or it was navigation + is_click = !travelled && drift <= 3 px; // otherwise it was navigation if (callback && !terminated && !inline_busy && is_click) { select_at_screen(press.x, press.y); // raycast at the PRESS, not the release on_context_menu(ClientToScreen(press)); @@ -84,8 +85,9 @@ RIGHT_UP: terminated = sketch_tool.take_right_consumed(); // read-and Skip(); // orbit / pan / the handlers underneath ``` -Two independent budgets because the two failure modes are independent: drift alone still popped a -menu at the end of a slow, careful orbit. `take_right_consumed()` is how a right-click that +Only distance decides, never time (charter §6.2: no timing-dependent gestures): a slow, deliberate +right-click is still a click. The drift is tracked over the whole press, not just at release, so a +careful orbit that ends where it started does not pop a menu. `take_right_consumed()` is how a right-click that already meant something to the armed sketch tool (terminate a chain, drop an edit-op) declines to also mean "open a menu". @@ -107,7 +109,7 @@ also mean "open a menu". | **Transient — popup menu** | run the entry | — | close the menu | run the highlighted entry | | **any** | — | — | *never* deletes, discards or rolls back | — | -Right-hold-and-drag is not in the table on purpose: past 3 px or 200 ms it is navigation, and +Right-hold-and-drag is not in the table on purpose: once it has travelled past 3 px it is navigation, and navigation does not transition the state machine. ## 4. Visual scaffolding diff --git a/docs/CAD/ux/mockups/gen_offer_table.py b/docs/CAD/ux/mockups/gen_offer_table.py index 9744f9288b..a1810b15d6 100644 --- a/docs/CAD/ux/mockups/gen_offer_table.py +++ b/docs/CAD/ux/mockups/gen_offer_table.py @@ -42,6 +42,12 @@ def cstr(s): return '"' + s.replace("\\", "\\\\").replace('"', '\\"') + '"' +def tstr(s): + # User-facing text: wrapped in the no-op L() marker so xgettext puts it in the catalogue. + # The DesignPanel translates it at use; without the marker it compiles and never translates. + return "nullptr" if s is None else "L(" + cstr(s) + ")" + + def main(): A = json.load(open(ATLAS, encoding="utf-8")) sels = [s["id"] for s in A["selections"]] @@ -61,6 +67,10 @@ def main(): "", "#include ", "", + "#ifndef L", + "#define L(s) s // gettext marker, as in slic3r/GUI/I18N.hpp", + "#endif", + "", "namespace Slic3r { namespace GUI {", "", "// What the viewport has selected. Ordered as in tool_atlas.json; the bitmask in", @@ -83,7 +93,7 @@ def main(): "// nullptr -> kernel support exists, no GUI path yet (row shows disabled)", "struct OfferVerb {", " const char* id;", - " const char* name; // drawing-office word (L10); translated at use with wxGetTranslation", + " const char* name; // drawing-office word (L10); marked L(); translated at use", " int row; // 0..7, the ratified index — NEVER reorder", " const char* key; // shortcut shown in the row, or nullptr", " const char* action;", @@ -106,7 +116,7 @@ def main(): "static const char* const kOfferRowNames[] = {", ] for s in A["slots"]: - lines.append(f' "{s["label"]}",') + lines.append(f' {tstr(s["label"])},') lines += [ "};", f"static const int kOfferRowCount = {len(slots)};", @@ -131,12 +141,12 @@ def main(): n = v.get("needs") or {} lines.append( " {%s, %s, %d, %s, %s, %s, 0x%08xu, %d, %d, %s, %s, %s, %s, %s}," % ( - cstr(v["id"]), cstr(v["name"]), slots.index(v["slot"]), - cstr(v.get("key")), cstr(v.get("action")), cstr(v.get("refusal")), + cstr(v["id"]), tstr(v["name"]), slots.index(v["slot"]), + cstr(v.get("key")), cstr(v.get("action")), tstr(v.get("refusal")), mask, n.get("bodies", 0), n.get("sketches", 0), "true" if n.get("sheet") else "false", "true" if v.get("mode") == "sketch" else "false", - cstr(v.get("family")), cstr(v.get("icon")), cstr(v.get("hint")))) + tstr(v.get("family")), cstr(v.get("icon")), tstr(v.get("hint")))) lines += [ "};", f"static const int kOfferVerbCount = {len(A['verbs'])};", diff --git a/docs/CAD/ux/tool_atlas.json b/docs/CAD/ux/tool_atlas.json index 94709f2057..0754534dae 100644 --- a/docs/CAD/ux/tool_atlas.json +++ b/docs/CAD/ux/tool_atlas.json @@ -326,7 +326,7 @@ "id": "rib", "name": "Rib", "slot": "add", - "key": null, + "key": "R", "feature": "Rib", "mcp": "rib", "accepts": [ @@ -343,7 +343,7 @@ }, { "id": "boolean", - "name": "Union", + "name": "Join", "slot": "add", "key": "Shift+B", "feature": "Boolean", @@ -354,7 +354,7 @@ "needs": { "bodies": 2 }, - "refusal": "Boolean needs two bodies — create or import a second solid", + "refusal": "Boolean needs two bodies — add or import a second one", "gui": true, "action": "btn:bool#0", "icon": "design_boolean", @@ -373,7 +373,7 @@ "needs": { "bodies": 2 }, - "refusal": "Boolean needs two bodies — create or import a second solid", + "refusal": "Boolean needs two bodies — add or import a second one", "gui": true, "action": "btn:bool#1", "mode": null, @@ -393,7 +393,7 @@ "needs": { "bodies": 2 }, - "refusal": "Boolean needs two bodies — create or import a second solid", + "refusal": "Boolean needs two bodies — add or import a second one", "gui": true, "action": "btn:bool#2", "mode": null, @@ -483,7 +483,7 @@ "needs": { "sheet": true }, - "refusal": "target is not a sheet body", + "refusal": "Thicken Surface needs a surface body — make one with a Surface tool first", "gui": true, "action": "fly:surface#5", "icon": "design_thicken", @@ -507,7 +507,7 @@ "gui": true, "action": "key:S+H", "icon": "design_hole", - "hint": "Drill a hole, centred on a picked face or placed on a plane" + "hint": "Drill a hole, centerd on a picked face or placed on a plane" }, { "id": "thread", @@ -543,7 +543,7 @@ "needs": { "bodies": 1 }, - "refusal": "Shell needs a solid body", + "refusal": "Shell needs a solid body — add or import one first", "gui": true, "action": "key:S+K", "icon": "design_shell", @@ -569,7 +569,7 @@ "needs": { "bodies": 1 }, - "refusal": "Create a solid body to cut first", + "refusal": "Cut needs a solid body — add or import one first", "gui": true, "action": "key:S+X", "icon": "design_cut", @@ -594,7 +594,7 @@ "needs": { "bodies": 1 }, - "refusal": "Split needs a solid body", + "refusal": "Split needs a solid body — add or import one first", "gui": false, "action": null, "icon": null, @@ -677,7 +677,7 @@ "needs": { "sheet": true }, - "refusal": "target is not a sheet body", + "refusal": "Surface Offset needs a surface body — make one with a Surface tool first", "gui": true, "action": "fly:surface#4", "icon": "design_offset", @@ -699,7 +699,7 @@ "needs": { "bodies": 1 }, - "refusal": "Create a solid body to pattern first", + "refusal": "Pattern needs a solid body — add or import one first", "gui": true, "action": "btn:pat#0", "icon": "design_array", @@ -721,7 +721,7 @@ "needs": { "bodies": 1 }, - "refusal": "Create a solid body to pattern first", + "refusal": "Pattern needs a solid body — add or import one first", "gui": true, "action": "btn:pat#1", "mode": null, @@ -768,7 +768,7 @@ "needs": { "bodies": 1 }, - "refusal": "Pattern on curve needs a body and a curve", + "refusal": "Pattern on Curve needs a body and a curve", "gui": false, "action": null, "icon": null, @@ -816,11 +816,11 @@ "needs": { "bodies": 2 }, - "refusal": "A mate needs two coordinate systems", + "refusal": "Mate needs two coordinate systems — create them first", "gui": true, "action": "fly:placement#2", "icon": "design_c_coincident", - "hint": "Assembly: align two CoordSys features (fastened, planar, revolute, slider, cylindrical)" + "hint": "Assembly: align two coordinate systems (fastened, planar, revolute, slider, cylindrical)" }, { "id": "align", @@ -835,7 +835,7 @@ "needs": { "bodies": 1 }, - "refusal": "Align needs a body", + "refusal": "Align needs a body — add or import one first", "gui": false, "action": null, "icon": null, @@ -885,7 +885,7 @@ }, { "id": "coordsys_v", - "name": "Coord Sys", + "name": "Coordinate system", "slot": "reference", "key": "Shift+C", "feature": "CoordSys", @@ -972,7 +972,7 @@ }, { "id": "mass_props", - "name": "Mass", + "name": "Volume and area", "slot": "reference", "key": null, "feature": null, @@ -1003,14 +1003,15 @@ "feature": null, "mcp": "check_interference", "accepts": [ + "body_solid", "bodies_2" ], "needs": { "bodies": 2 }, - "refusal": null, - "gui": false, - "action": null, + "refusal": "Interference needs at least two bodies", + "gui": true, + "action": "btn:interference", "icon": null, "hint": "Check whether two bodies overlap — reports, changes nothing" }, @@ -1082,7 +1083,7 @@ }, { "id": "colour", - "name": "Colour", + "name": "Color", "slot": "modify", "key": null, "feature": null, @@ -1104,7 +1105,7 @@ "gui": true, "action": "btn:colour", "icon": "color_palette", - "hint": "Set the selected body's display colour" + "hint": "Set the selected body's display color" }, { "id": "delete", @@ -1227,7 +1228,7 @@ }, { "id": "sk_rect_center", - "name": "Centre rectangle", + "name": "Center rectangle", "slot": "create", "key": null, "feature": "Sketch", @@ -1296,7 +1297,7 @@ }, { "id": "sk_circle", - "name": "Centre circle", + "name": "Center circle", "slot": "create", "key": "C", "feature": "Sketch", @@ -1411,7 +1412,7 @@ }, { "id": "sk_arc_center", - "name": "Centre-point arc", + "name": "Center-point arc", "slot": "create", "key": null, "feature": "Sketch", @@ -1453,7 +1454,7 @@ "action": "key:S", "family": "Slot", "icon": "design_slot", - "hint": "Slot — two centerline ends, then end radius" + "hint": "Slot — two centerline ends, then the width" }, { "id": "sk_slot_arc", @@ -1567,7 +1568,7 @@ "mode": "sketch", "family": "Polygon", "icon": "design_polygon", - "hint": "Triangle — click centre, then a vertex" + "hint": "Triangle — click center, then a vertex" }, { "id": "sk_poly_4", @@ -1590,7 +1591,7 @@ "mode": "sketch", "family": "Polygon", "icon": "design_polygon", - "hint": "Square — click centre, then a vertex" + "hint": "Square — click center, then a vertex" }, { "id": "sk_poly_5", @@ -1613,7 +1614,7 @@ "mode": "sketch", "family": "Polygon", "icon": "design_polygon", - "hint": "Pentagon — click centre, then a vertex" + "hint": "Pentagon — click center, then a vertex" }, { "id": "sk_polygon", @@ -1636,7 +1637,7 @@ "action": "btn:poly#6", "family": "Polygon", "icon": "design_polygon", - "hint": "Hexagon — click centre, then a vertex" + "hint": "Hexagon — click center, then a vertex" }, { "id": "sk_poly_8", @@ -1659,7 +1660,7 @@ "mode": "sketch", "family": "Polygon", "icon": "design_polygon", - "hint": "Octagon — click centre, then a vertex" + "hint": "Octagon — click center, then a vertex" }, { "id": "sk_poly_12", @@ -1682,7 +1683,7 @@ "mode": "sketch", "family": "Polygon", "icon": "design_polygon", - "hint": "Dodecagon — click centre, then a vertex" + "hint": "Dodecagon — click center, then a vertex" }, { "id": "sk_poly_inscribed", @@ -2048,7 +2049,7 @@ { "id": "constrain", "name": "Constrain sketch", - "slot": "modify", + "slot": "reference", "key": null, "feature": "Sketch", "mcp": null, @@ -2067,7 +2068,8 @@ "note": [ "Same verb, model-mode vocabulary: offered when a SKETCH is selected (bit 14, SkLoop), the", "state a user is in right after finishing one. Without this row the only way in was the", - "toolbar icon, and constraints read as absent — see the Onshape-comparison report." + "toolbar icon, and constraints read as absent — see the Onshape-comparison report.", + "It sits in the Reference row, the address the sketch-mode Constrain has: one verb, one row." ] }, { diff --git a/localization/i18n/list.txt b/localization/i18n/list.txt index 296829814a..e95ec4e937 100644 --- a/localization/i18n/list.txt +++ b/localization/i18n/list.txt @@ -298,7 +298,9 @@ src/slic3r/GUI/AMSDryControl.cpp src/slic3r/GUI/AMSDryControl.hpp src/libslic3r/PresetBundle.cpp src/slic3r/GUI/CAD/DesignPanel.cpp +src/slic3r/GUI/CAD/DesignSketchTool.cpp src/slic3r/GUI/CAD/SketchInlineEditor.cpp +src/slic3r/GUI/CAD/DesignOffer.hpp src/slic3r/GUI/Gizmos/GLGizmoPrimitive.cpp src/slic3r/GUI/Gizmos/GLGizmoSketch.cpp src/slic3r/GUI/KeyChord.cpp diff --git a/scripts/CAD/check-gui-context-menu.py b/scripts/CAD/check-gui-context-menu.py index 28e404ecf0..9e76fa9fe1 100644 --- a/scripts/CAD/check-gui-context-menu.py +++ b/scripts/CAD/check-gui-context-menu.py @@ -95,7 +95,8 @@ def load_table(): f.append(cur.strip()) if len(f) < 12: continue - lit = lambda s: None if s == "nullptr" else s.strip('"') + # User-facing fields are wrapped in the L("...") gettext marker; strip it. + lit = lambda s: None if s == "nullptr" else re.sub(r'^L\((.*)\)$', r'\1', s).strip('"') out.append({"id": lit(f[0]), "name": lit(f[1]), "row": int(f[2]), "key": lit(f[3]), "action": lit(f[4]), "accepts": int(f[6].rstrip("u"), 0), "need_bodies": int(f[7]), "need_sketches": int(f[8]), diff --git a/src/libslic3r/CAD/CadDocument.cpp b/src/libslic3r/CAD/CadDocument.cpp index 22b84e0099..f315efba63 100644 --- a/src/libslic3r/CAD/CadDocument.cpp +++ b/src/libslic3r/CAD/CadDocument.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -1975,6 +1976,7 @@ void CadDocument::clear() display_tri_face.clear(); display_tri_body.clear(); origin_from_recipe = false; + auto_close_loops = true; // Variables are document state like the features: left behind, the previous project's // variables were written into the next project's recipe. variables.clear(); @@ -2456,6 +2458,24 @@ TopoDS_Wire CadDocument::build_sketch_wire(const CadFeature& sketch, bool closed return prof.to_occt_wire(sketch.plane); } +int CadDocument::body_touching_sketch(int sketch_ref) const +{ + if (sketch_ref < 0 || sketch_ref >= int(features.size()) + || features[sketch_ref].type != CadFeatureType::Sketch) + return -1; + TopoDS_Face face; + try { face = build_sketch_face(features[sketch_ref]); } catch (const std::exception&) { return -1; } + if (face.IsNull()) return -1; + for (int i = int(bodies.size()) - 1; i >= 0; --i) { // newest first: the likeliest target + const TopoDS_Shape& b = bodies[i].shape; + if (b.IsNull() || is_sheet_shape(b)) continue; + BRepExtrema_DistShapeShape d(face, b); + if (d.IsDone() && d.Value() <= 1e-4) + return i; + } + return -1; +} + TopoDS_Face CadDocument::build_sketch_face(const CadFeature& sketch) const { if (!sketch.entities.empty()) { @@ -3932,6 +3952,7 @@ void CadDocument::route_feature(std::vector& bodies, const CadFeature& bool CadDocument::recompute() { error.clear(); + set_sketch_auto_close(auto_close_loops); // this document's weld rule, not the last one's detect_mate_conflicts(); std::vector built; // Did any feature in this document even ASK for a solid? A document made only of sketches @@ -4210,7 +4231,7 @@ std::string CadDocument::serialize_recipe() const std::ostringstream xos; { cereal::BinaryOutputArchive xa(xos); - xa(modeling_origin.x(), modeling_origin.y(), modeling_origin.z(), colours); + xa(modeling_origin.x(), modeling_origin.y(), modeling_origin.z(), colours, auto_close_loops); } std::string xb = xos.str(); uint32_t xlen = static_cast(xb.size()); @@ -4309,9 +4330,11 @@ bool CadDocument::deserialize_recipe(const std::string& blob) std::istringstream xs(xbuf); cereal::BinaryInputArchive xa(xs); double ox = 0, oy = 0, oz = 0; - xa(ox, oy, oz, colours); + bool weld = true; + xa(ox, oy, oz, colours, weld); modeling_origin = Vec3d(ox, oy, oz); origin_from_recipe = true; + auto_close_loops = weld; } catch (...) { colours.clear(); // older project: the caller's origin stands } diff --git a/src/libslic3r/CAD/CadDocument.hpp b/src/libslic3r/CAD/CadDocument.hpp index 6969473b69..b95c493496 100644 --- a/src/libslic3r/CAD/CadDocument.hpp +++ b/src/libslic3r/CAD/CadDocument.hpp @@ -539,6 +539,11 @@ public: // printer must keep the origin it was made with or its datums move and its sketches do not. Vec3d modeling_origin{Vec3d::Zero()}; bool origin_from_recipe{false}; // modeling_origin came from the loaded project + // Weld sketch endpoints within kSketchJoinTol (the "Auto-close sketch loops" preference, taken + // when the document is started). A property of the DOCUMENT, saved with it: as a machine-wide + // preference it made one project rebuild into a closed solid on one computer and an open + // loop on another. recompute() pushes it into the kernel. + bool auto_close_loops{true}; // Tessellation quality, matched to Orca's OWN STEP importer (Format/STEP.hpp defaults: // linear 0.003, angular 0.5 rad) so a body modelled here reaches the screen at the same @@ -799,6 +804,9 @@ public: // tessellate the result into out_mesh, WITHOUT modifying features/body/ // display_mesh. Returns false (with err set) if the candidate is invalid. // Used by the Design tab to show a translucent ghost before Confirm. + // The solid body the closed profile of sketch `sketch_ref` lies on or touches, or -1. Drives + // the Extrude default: a profile drawn on a body joins it, one in free space is a new body. + int body_touching_sketch(int sketch_ref) const; bool preview(const CadFeature& candidate, TriangleMesh& out_mesh, std::string& err) const; // Same, but also returns the per-body meshes (in `bodies` order; the candidate may append // one), so the GUI can apply its display-only per-body Move transforms to the ghost and keep diff --git a/src/libslic3r/CAD/SketchEngine.cpp b/src/libslic3r/CAD/SketchEngine.cpp index 8aa440d707..8133de1174 100644 --- a/src/libslic3r/CAD/SketchEngine.cpp +++ b/src/libslic3r/CAD/SketchEngine.cpp @@ -47,18 +47,21 @@ #include #include #include +#include #include #include namespace Slic3r { -// Single source of truth for the weld tolerance the viewport and the kernel share. -// Defaults ON so headless/kernel-only callers keep welding; the GUI pushes the -// "auto_close_sketch_loops" preference in via set_sketch_auto_close(). -static bool s_auto_close = true; +// Single source of truth for the weld tolerance the viewport and the kernel share. Defaults ON +// so headless/kernel-only callers keep welding. It is the DOCUMENT's setting +// (CadDocument::auto_close_loops, saved with the recipe), pushed in by CadDocument::recompute: +// the same project must rebuild into the same solid on every machine. Atomic because the GUI +// rebuilds on a worker thread while the viewport reads it. +static std::atomic s_auto_close{true}; -double sketch_join_tol() { return s_auto_close ? kSketchJoinTol : 0.0; } -void set_sketch_auto_close(bool on) { s_auto_close = on; } +double sketch_join_tol() { return s_auto_close.load() ? kSketchJoinTol : 0.0; } +void set_sketch_auto_close(bool on) { s_auto_close.store(on); } // ---- SketchPlane ---- diff --git a/src/libslic3r/CAD/SketchEngine.hpp b/src/libslic3r/CAD/SketchEngine.hpp index 0dd35ac123..f433b90bce 100644 --- a/src/libslic3r/CAD/SketchEngine.hpp +++ b/src/libslic3r/CAD/SketchEngine.hpp @@ -90,9 +90,9 @@ inline constexpr double kSketchJoinTol = 1e-3; // mm // Effective sketch joint tolerance. ONE value for the viewport (region_loops / // loop_report / connected_loop) and the kernel (entities_to_wires): if these ever // disagree again, the viewport shades a region closed that the kernel refuses to -// build, which is how a sketch got extruded into the wrong solid. The GUI pushes -// the "auto_close_sketch_loops" preference in via set_sketch_auto_close(); the -// kernel defaults to ON so headless/kernel-only callers keep welding. +// build, which is how a sketch got extruded into the wrong solid. The document's +// own setting (CadDocument::auto_close_loops) is pushed in via set_sketch_auto_close(); +// the kernel defaults to ON so headless/kernel-only callers keep welding. double sketch_join_tol(); void set_sketch_auto_close(bool on); diff --git a/src/libslic3r/Format/bbs_3mf.cpp b/src/libslic3r/Format/bbs_3mf.cpp index 160c169d69..7ae79c6191 100644 --- a/src/libslic3r/Format/bbs_3mf.cpp +++ b/src/libslic3r/Format/bbs_3mf.cpp @@ -1961,7 +1961,14 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) else if (boost::algorithm::iequals(name, ORCA_CAD_RECIPE_FILE) || boost::algorithm::iequals(name, LEGACY_CAD_RECIPE_FILE)) { // Restore the editable CAD recipe (optional; absent in non-CAD projects). - if (stat.m_uncomp_size > 0) { + // The current name wins over the legacy one whichever the archive lists + // first, and the size the archive claims is capped before it is allocated. + constexpr mz_uint64 kMaxCadRecipe = mz_uint64(1) << 30; // 1 GiB + const bool legacy = boost::algorithm::iequals(name, LEGACY_CAD_RECIPE_FILE); + if (stat.m_uncomp_size > kMaxCadRecipe) { + BOOST_LOG_TRIVIAL(error) << "3MF: CAD recipe of " << stat.m_uncomp_size + << " bytes exceeds the limit; not loaded"; + } else if (stat.m_uncomp_size > 0 && !(legacy && !model.cad_recipe.empty())) { std::string buf((size_t)stat.m_uncomp_size, '\0'); if (mz_zip_reader_extract_to_mem(&archive, stat.m_file_index, buf.data(), buf.size(), 0)) model.cad_recipe = std::move(buf); diff --git a/src/slic3r/GUI/CAD/DesignOffer.hpp b/src/slic3r/GUI/CAD/DesignOffer.hpp index ad1998d5c5..5ccb929be2 100644 --- a/src/slic3r/GUI/CAD/DesignOffer.hpp +++ b/src/slic3r/GUI/CAD/DesignOffer.hpp @@ -10,6 +10,10 @@ #include +#ifndef L +#define L(s) s // gettext marker, as in slic3r/GUI/I18N.hpp +#endif + namespace Slic3r { namespace GUI { // What the viewport has selected. Ordered as in tool_atlas.json; the bitmask in @@ -48,7 +52,7 @@ inline uint32_t offer_bit(OfferSel s) { return 1u << int(s); } // nullptr -> kernel support exists, no GUI path yet (row shows disabled) struct OfferVerb { const char* id; - const char* name; // drawing-office word (L10); translated at use with wxGetTranslation + const char* name; // drawing-office word (L10); marked L(); translated at use int row; // 0..7, the ratified index — NEVER reorder const char* key; // shortcut shown in the row, or nullptr const char* action; @@ -69,118 +73,119 @@ struct OfferVerb { // Row labels, in ratified order. static const char* const kOfferRowNames[] = { - "Create", - "Add material", - "Remove", - "Fillet / chamfer / draft", - "Repeat", - "Transform", - "Reference", - "Modify", + L("Create"), + L("Add material"), + L("Remove"), + L("Fillet / chamfer / draft"), + L("Repeat"), + L("Transform"), + L("Reference"), + L("Modify"), }; static const int kOfferRowCount = 8; static const OfferVerb kOfferVerbs[] = { - {"sketch", "Sketch", 0, "Shift+S", "key:S+S", "Click a face or a reference plane in the viewport, then a sketch tool", 0x00000403u, 0, 0, false, false, nullptr, "design_sketch", "Click a face or a reference plane, then pick a drawing tool"}, - {"extrude", "Extrude", 1, "Shift+E", "key:S+E", "Create a sketch, or pick a solid face, first", 0x00004002u, 0, 0, false, false, nullptr, "design_extrude", "Extrude a sketch profile, or push/pull a picked face"}, - {"revolve", "Revolve", 1, "Shift+R", "key:S+R", "Create a sketch profile to revolve first", 0x00004000u, 0, 0, false, false, nullptr, "design_revolve", "Revolve a profile about an axis"}, - {"sweep", "Sweep", 1, "Shift+W", "key:S+W", "Create a profile sketch to sweep first", 0x00004000u, 0, 2, false, false, nullptr, "design_sweep", "Sweep a profile along a path"}, - {"loft", "Loft", 1, "Shift+L", "key:S+L", "Create at least two profile sketches to loft", 0x00004000u, 0, 2, false, false, nullptr, "design_loft", "Loft (skin) between two or more profiles"}, - {"thicken", "Thicken", 1, nullptr, "fly:material#4", "Thicken needs a solid body — add or import one first", 0x0000000au, 1, 0, false, false, nullptr, "design_thicken", "Offset a solid face into a thin plate (new body)"}, - {"rib", "Rib", 1, nullptr, "fly:material#5", "Rib needs a solid body — add or import one first", 0x00010000u, 1, 0, false, false, nullptr, "design_rib", "Grow a thin wall from an open sketch line, fused to a body"}, - {"boolean", "Union", 1, "Shift+B", "btn:bool#0", "Boolean needs two bodies — create or import a second solid", 0x00000200u, 2, 0, false, false, nullptr, "design_boolean", "Fuse the tool body into the target — one solid, no seam"}, - {"bool_subtract", "Subtract", 1, nullptr, "btn:bool#1", "Boolean needs two bodies — create or import a second solid", 0x00000200u, 2, 0, false, false, nullptr, "design_boolean", "Cut the tool body out of the target"}, - {"bool_intersect", "Intersect", 1, nullptr, "btn:bool#2", "Boolean needs two bodies — create or import a second solid", 0x00000200u, 2, 0, false, false, nullptr, "design_boolean", "Keep only where the two bodies overlap"}, - {"surf_extrude", "Surface Extrude", 1, "Shift+G", "key:S+G", "Create a sketch first", 0x00004000u, 0, 0, false, false, nullptr, "design_extrude", "Extrude a sketch into a sheet body (no end caps)"}, - {"surf_revolve", "Surface Revolve", 1, nullptr, "fly:surface#1", "Create a sketch profile to revolve first", 0x00004000u, 0, 0, false, false, nullptr, "design_revolve", "Revolve a sketch profile into a sheet body"}, - {"surf_loft", "Surface Loft", 1, nullptr, "fly:surface#2", "Create at least two profile sketches to loft", 0x00004000u, 0, 2, false, false, nullptr, "design_loft", "Loft (skin) between 2+ profiles, open (no end caps)"}, - {"surf_fill", "Surface Fill", 1, nullptr, "fly:surface#3", "Create a closed sketch first", 0x00004000u, 0, 0, false, false, nullptr, "design_surface", "Fill a sketch boundary with a smooth face"}, - {"thicken_surf", "Thicken Surface", 1, nullptr, "fly:surface#5", "target is not a sheet body", 0x00000100u, 0, 0, true, false, nullptr, "design_thicken", "Thicken a sheet body into a solid"}, - {"hole", "Hole", 2, "Shift+H", "key:S+H", "Pick a face or a plane to drill into", 0x00000402u, 1, 0, false, false, nullptr, "design_hole", "Drill a hole, centred on a picked face or placed on a plane"}, - {"thread", "Thread", 2, "Shift+T", "key:S+T", "Pick a cylindrical surface (bore / outer) or a circular edge for a thread", 0x00000024u, 1, 0, false, false, nullptr, "design_thread", "Thread a cylindrical surface (inner bore / outer) or a circular edge"}, - {"shell", "Shell", 2, "Shift+K", "key:S+K", "Shell needs a solid body", 0x00000082u, 1, 0, false, false, nullptr, "design_shell", "Hollow the body to a wall thickness, opening a picked face"}, - {"cut", "Cut", 2, "Shift+X", "key:S+X", "Create a solid body to cut first", 0x000004feu, 1, 0, false, false, nullptr, "design_cut", "Trim the body with a plane — drag the offset arrow; keep one half or both"}, - {"split", "Split", 2, nullptr, nullptr, "Split needs a solid body", 0x000000feu, 1, 0, false, false, nullptr, nullptr, "Split the body along a picked face into two solids"}, - {"fillet", "Fillet", 3, "Shift+F", "btn:dress#0", "Pick an edge to round", 0x000000b2u, 1, 0, false, false, nullptr, "design_filletedge", "Pick an edge, then drag the radius arrow or type it"}, - {"chamfer", "Chamfer", 3, nullptr, "btn:dress#1", "Pick an edge to bevel", 0x000000b2u, 1, 0, false, false, nullptr, "design_chamfer", "Pick an edge, then drag the distance arrow or type it"}, - {"draft", "Draft", 3, "Shift+D", "key:S+D", "Pick a face to taper", 0x0000000au, 1, 0, false, false, nullptr, "design_draft", "Tilt a picked face by a draft angle"}, - {"surf_offset", "Surface Offset", 3, nullptr, "fly:surface#4", "target is not a sheet body", 0x00000100u, 0, 0, true, false, nullptr, "design_offset", "Offset a sheet body's shell by a signed distance"}, - {"pattern", "Linear pattern", 4, "Shift+N", "btn:pat#0", "Create a solid body to pattern first", 0x00006082u, 1, 0, false, false, nullptr, "design_array", "Repeat the body along a direction — drag the spacing, set the count"}, - {"pattern_circular", "Circular pattern", 4, nullptr, "btn:pat#1", "Create a solid body to pattern first", 0x00006082u, 1, 0, false, false, nullptr, "design_polararray", "Repeat the body around an axis — set the count and sweep"}, - {"mirror", "Mirror", 4, "Shift+Z", "key:S+Z", "Mirror needs a body — add or import one first", 0x000004feu, 1, 0, false, false, nullptr, "design_mirror", "Reflect a body about a plane"}, - {"pat_curve", "Pattern on Curve", 4, nullptr, nullptr, "Pattern on curve needs a body and a curve", 0x00000090u, 1, 0, false, false, nullptr, nullptr, "Repeat the body along a picked curve"}, - {"transform", "Move", 5, "Shift+Y", "key:S+Y", "Transform needs a body — add or import one first", 0x000021feu, 1, 0, false, false, nullptr, "design_move", "Move and/or rotate an existing body"}, - {"mate", "Mate", 5, nullptr, "fly:placement#2", "A mate needs two coordinate systems", 0x00001202u, 2, 0, false, false, nullptr, "design_c_coincident", "Assembly: align two CoordSys features (fastened, planar, revolute, slider, cylindrical)"}, - {"align", "Align to", 5, nullptr, nullptr, "Align needs a body", 0x00000002u, 1, 0, false, false, nullptr, nullptr, "Align the body to a picked face or plane"}, - {"plane", "Plane", 6, "Shift+P", "key:S+P", nullptr, 0x00000453u, 0, 0, false, false, nullptr, "design_plane", "Reference plane (offset / tilt / midplane / tangent / two edges / coincident)"}, - {"axis", "Axis", 6, "Shift+A", "key:S+A", nullptr, 0x00000057u, 0, 0, false, false, nullptr, "design_line", "Datum axis (two points, face normal, cylinder centerline, two planes, along edge)"}, - {"coordsys_v", "Coord Sys", 6, "Shift+C", "key:S+C", nullptr, 0x00000043u, 0, 0, false, false, nullptr, "design_point", "Datum coordinate system (world point, or face + direction edge)"}, - {"helix", "Helix", 6, nullptr, "fly:plane#3", nullptr, 0x00000405u, 0, 0, false, false, nullptr, "design_thread", "Helical curve (spring path) — use as a sweep path for coils / springs / augers"}, - {"project", "Project", 6, nullptr, "fly:plane#4", "Project needs a body — add or import one first", 0x00000482u, 1, 0, false, false, nullptr, "design_sketch", "Project body edges onto a plane as sketch entities"}, - {"measure", "Measure", 6, nullptr, nullptr, nullptr, 0x000b03feu, 0, 0, false, false, nullptr, nullptr, "Measure between the picked points, edges or faces"}, - {"mass_props", "Mass", 6, nullptr, "btn:mass", nullptr, 0x000000feu, 1, 0, false, false, nullptr, "info", "Report the volume and surface area of the selected body"}, - {"interference", "Interference", 6, nullptr, nullptr, nullptr, 0x00000200u, 2, 0, false, false, nullptr, nullptr, "Check whether two bodies overlap — reports, changes nothing"}, - {"edit_feature", "Edit", 7, nullptr, "btn:edit", nullptr, 0x00007d8eu, 0, 0, false, false, nullptr, "design_edit", "Reopen the selected feature to change what it was made from"}, - {"rename", "Rename…", 7, "F2", "btn:rename", "Select a feature, or a body, to rename it", 0x00004080u, 0, 0, false, false, nullptr, nullptr, "Give this feature a name you will recognise in the tree (a body takes its name from the feature that makes it)"}, - {"delete_face", "Delete Face", 7, nullptr, "fly:dressup#3", "Delete Face needs a body — add or import one first", 0x0000000eu, 1, 0, false, false, nullptr, "design_delete", "Remove faces from a body and heal the solid"}, - {"colour", "Colour", 7, nullptr, "btn:colour", nullptr, 0x000001feu, 1, 0, false, false, nullptr, "color_palette", "Set the selected body's display colour"}, - {"delete", "Delete", 7, "Del", "btn:delete", nullptr, 0x000f7c00u, 0, 0, false, false, nullptr, "design_delete", "Delete what is selected"}, - {"delete_body", "Delete Body", 7, nullptr, "btn:delete_body", nullptr, 0x000001feu, 1, 0, false, false, nullptr, "design_delete", "Delete this whole body — removes the feature it was made from"}, - {"sk_line_t", "Line", 0, "L", "key:L", nullptr, 0x000f8000u, 0, 0, false, true, "Line", "design_line", "Line — click start, then end"}, - {"sk_polyline", "Polyline", 0, nullptr, "fly:design_line#1", nullptr, 0x000f8000u, 0, 0, false, true, "Line", "design_polyline", "Click points; click the first point to close the loop, right-click to end it open"}, - {"sk_rect", "Corner rectangle", 0, "R", "key:R", nullptr, 0x000f8000u, 0, 0, false, true, "Rectangle", "design_rect", "Rectangle — click two opposite corners"}, - {"sk_rect_center", "Centre rectangle", 0, nullptr, "fly:design_rect#1", nullptr, 0x000f8000u, 0, 0, false, true, "Rectangle", "design_crect", "Click center, then a corner"}, - {"sk_rect_oblique", "Oblique rectangle", 0, nullptr, "fly:design_rect#2", nullptr, 0x000f8000u, 0, 0, false, true, "Rectangle", "design_rect_oblique", "Click two corners of one edge, then a point for the width"}, - {"sk_rect_rounded", "Rounded rectangle", 0, nullptr, "fly:design_rect#3", nullptr, 0x000f8000u, 0, 0, false, true, "Rectangle", "design_rect_rounded", "Click two opposite corners, then a point for the corner radius"}, - {"sk_circle", "Centre circle", 0, "C", "key:C", nullptr, 0x000f8000u, 0, 0, false, true, "Circle", "design_circle", "Circle — click center, then radius"}, - {"sk_circle_2pt", "2-point circle", 0, nullptr, "fly:design_circle#1", nullptr, 0x000f8000u, 0, 0, false, true, "Circle", "design_circle2pt", "Click two ends of the diameter"}, - {"sk_circle_3pt", "3-point circle", 0, nullptr, "fly:design_circle#2", nullptr, 0x000f8000u, 0, 0, false, true, "Circle", "design_circle3pt", "Click three points on the circle"}, - {"sk_arc_t", "3-point arc", 0, "A", "key:A", nullptr, 0x000f8000u, 0, 0, false, true, "Arc", "design_arc3pt", "Arc — click start, end, then a point"}, - {"sk_arc_tangent", "Tangent arc", 0, nullptr, "fly:design_arc3pt#1", nullptr, 0x000f8000u, 0, 0, false, true, "Arc", "design_tangentarc", "Click start (on the last entity) then end"}, - {"sk_arc_center", "Centre-point arc", 0, nullptr, "fly:design_arc3pt#2", nullptr, 0x000f8000u, 0, 0, false, true, "Arc", "design_arc_center", "Click center, then start, then a point for the end angle"}, - {"sk_slot", "Slot", 0, "S", "key:S", nullptr, 0x000f8000u, 0, 0, false, true, "Slot", "design_slot", "Slot — two centerline ends, then end radius"}, - {"sk_slot_arc", "Arc slot", 0, nullptr, "fly:design_slot#1", nullptr, 0x000f8000u, 0, 0, false, true, "Slot", "design_slot_arc", "Click center, start, end, then a point for the width"}, - {"sk_ellipse", "Ellipse", 0, "E", "key:E", nullptr, 0x000f8000u, 0, 0, false, true, "Ellipse", "design_ellipse", "Ellipse — center, major end, minor point"}, - {"sk_ellipse_arc", "Elliptical arc", 0, nullptr, "fly:design_ellipse#1", nullptr, 0x000f8000u, 0, 0, false, true, "Ellipse", "design_ellipse_arc", "Click center, major-axis end, minor point, then arc start and end"}, - {"sk_spline", "Spline", 0, "B", "key:B", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_bspline", "Spline — click control points"}, - {"sk_poly_3", "Triangle", 0, nullptr, "btn:poly#3", nullptr, 0x000f8000u, 0, 0, false, true, "Polygon", "design_polygon", "Triangle — click centre, then a vertex"}, - {"sk_poly_4", "Square", 0, nullptr, "btn:poly#4", nullptr, 0x000f8000u, 0, 0, false, true, "Polygon", "design_polygon", "Square — click centre, then a vertex"}, - {"sk_poly_5", "Pentagon", 0, nullptr, "btn:poly#5", nullptr, 0x000f8000u, 0, 0, false, true, "Polygon", "design_polygon", "Pentagon — click centre, then a vertex"}, - {"sk_polygon", "Hexagon", 0, "G", "btn:poly#6", nullptr, 0x000f8000u, 0, 0, false, true, "Polygon", "design_polygon", "Hexagon — click centre, then a vertex"}, - {"sk_poly_8", "Octagon", 0, nullptr, "btn:poly#8", nullptr, 0x000f8000u, 0, 0, false, true, "Polygon", "design_polygon", "Octagon — click centre, then a vertex"}, - {"sk_poly_12", "Dodecagon", 0, nullptr, "btn:poly#12", nullptr, 0x000f8000u, 0, 0, false, true, "Polygon", "design_polygon", "Dodecagon — click centre, then a vertex"}, - {"sk_poly_inscribed", "Inscribed", 0, nullptr, "btn:polyfit#0", nullptr, 0x000f8000u, 0, 0, false, true, "Polygon", "design_polygon", "Measure the polygon to its corners (inscribed)"}, - {"sk_poly_circumscribed", "Circumscribed", 0, nullptr, "btn:polyfit#1", nullptr, 0x000f8000u, 0, 0, false, true, "Polygon", "design_polygon", "Measure the polygon to its flats (circumscribed)"}, - {"sk_point_t", "Point", 0, "P", "key:P", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_point", "Point — click to place"}, - {"sk_text", "Text", 0, nullptr, "btn:text", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_text", "Type text; its outline is added to this sketch as editable lines"}, - {"sk_svg", "SVG", 0, nullptr, "btn:svg", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_svg", "Import an SVG outline into this sketch as editable lines"}, - {"sk_offset", "Offset", 1, "O", "key:O", nullptr, 0x000b0000u, 0, 0, false, true, nullptr, "design_offset", "Offset — pick an entity, drag the distance"}, - {"sk_trim", "Trim", 2, "T", "key:T", nullptr, 0x000b0000u, 0, 0, false, true, nullptr, "design_trim", "Trim — click a segment to trim it"}, - {"sk_fillet", "Fillet", 3, "F", "key:F", nullptr, 0x00090000u, 0, 0, false, true, nullptr, "design_filletedge", "Fillet — pick two lines, set the radius"}, - {"sk_chamfer", "Chamfer", 3, "H", "key:H", nullptr, 0x00090000u, 0, 0, false, true, nullptr, "design_chamfer", "Chamfer — pick two lines, set the distance"}, - {"sk_array", "Linear array", 4, nullptr, "fly:design_array#0", nullptr, 0x000b0000u, 0, 0, false, true, "Array", "design_array", "Pick entities, drag the spacing handle, click the count; click empty to apply"}, - {"sk_array_polar", "Polar array", 4, nullptr, "fly:design_array#1", nullptr, 0x000b0000u, 0, 0, false, true, "Array", "design_polararray", "Pick entities, drag the sweep handle, click the count; click empty to apply"}, - {"sk_mirror", "Mirror", 4, "M", "key:M", nullptr, 0x000b0000u, 0, 0, false, true, nullptr, "design_mirror", "Mirror — pick axis, then entities"}, - {"sk_move", "Move", 5, nullptr, "fly:design_move#0", nullptr, 0x000f0000u, 0, 0, false, true, "Move", "design_move", "Pick entities, then drag the handle or click the distance; click empty to apply"}, - {"sk_rotate", "Rotate", 5, nullptr, "fly:design_move#1", nullptr, 0x000f0000u, 0, 0, false, true, "Move", "design_rotate", "Pick entities, then drag around the pivot or click the angle; click empty to apply"}, - {"sk_scale", "Scale", 5, nullptr, "fly:design_move#2", nullptr, 0x000f0000u, 0, 0, false, true, "Move", "design_scale", "Pick entities, then drag the handle or click the factor; click empty to apply"}, - {"sk_dimension", "Dimension", 6, "D", "key:D", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_dimension", "Dimension — click 2 points or an entity"}, - {"sk_constrain", "Constrain", 6, "K", "key:K", nullptr, 0x000f0000u, 0, 0, false, true, nullptr, "design_constrain", "Constrain the selected sketch entities to each other"}, + {"sketch", L("Sketch"), 0, "Shift+S", "key:S+S", L("Click a face or a reference plane in the viewport, then a sketch tool"), 0x00000403u, 0, 0, false, false, nullptr, "design_sketch", L("Click a face or a reference plane, then pick a drawing tool")}, + {"extrude", L("Extrude"), 1, "Shift+E", "key:S+E", L("Create a sketch, or pick a solid face, first"), 0x00004002u, 0, 0, false, false, nullptr, "design_extrude", L("Extrude a sketch profile, or push/pull a picked face")}, + {"revolve", L("Revolve"), 1, "Shift+R", "key:S+R", L("Create a sketch profile to revolve first"), 0x00004000u, 0, 0, false, false, nullptr, "design_revolve", L("Revolve a profile about an axis")}, + {"sweep", L("Sweep"), 1, "Shift+W", "key:S+W", L("Create a profile sketch to sweep first"), 0x00004000u, 0, 2, false, false, nullptr, "design_sweep", L("Sweep a profile along a path")}, + {"loft", L("Loft"), 1, "Shift+L", "key:S+L", L("Create at least two profile sketches to loft"), 0x00004000u, 0, 2, false, false, nullptr, "design_loft", L("Loft (skin) between two or more profiles")}, + {"thicken", L("Thicken"), 1, nullptr, "fly:material#4", L("Thicken needs a solid body — add or import one first"), 0x0000000au, 1, 0, false, false, nullptr, "design_thicken", L("Offset a solid face into a thin plate (new body)")}, + {"rib", L("Rib"), 1, "R", "fly:material#5", L("Rib needs a solid body — add or import one first"), 0x00010000u, 1, 0, false, false, nullptr, "design_rib", L("Grow a thin wall from an open sketch line, fused to a body")}, + {"boolean", L("Join"), 1, "Shift+B", "btn:bool#0", L("Boolean needs two bodies — add or import a second one"), 0x00000200u, 2, 0, false, false, nullptr, "design_boolean", L("Fuse the tool body into the target — one solid, no seam")}, + {"bool_subtract", L("Subtract"), 1, nullptr, "btn:bool#1", L("Boolean needs two bodies — add or import a second one"), 0x00000200u, 2, 0, false, false, nullptr, "design_boolean", L("Cut the tool body out of the target")}, + {"bool_intersect", L("Intersect"), 1, nullptr, "btn:bool#2", L("Boolean needs two bodies — add or import a second one"), 0x00000200u, 2, 0, false, false, nullptr, "design_boolean", L("Keep only where the two bodies overlap")}, + {"surf_extrude", L("Surface Extrude"), 1, "Shift+G", "key:S+G", L("Create a sketch first"), 0x00004000u, 0, 0, false, false, nullptr, "design_extrude", L("Extrude a sketch into a sheet body (no end caps)")}, + {"surf_revolve", L("Surface Revolve"), 1, nullptr, "fly:surface#1", L("Create a sketch profile to revolve first"), 0x00004000u, 0, 0, false, false, nullptr, "design_revolve", L("Revolve a sketch profile into a sheet body")}, + {"surf_loft", L("Surface Loft"), 1, nullptr, "fly:surface#2", L("Create at least two profile sketches to loft"), 0x00004000u, 0, 2, false, false, nullptr, "design_loft", L("Loft (skin) between 2+ profiles, open (no end caps)")}, + {"surf_fill", L("Surface Fill"), 1, nullptr, "fly:surface#3", L("Create a closed sketch first"), 0x00004000u, 0, 0, false, false, nullptr, "design_surface", L("Fill a sketch boundary with a smooth face")}, + {"thicken_surf", L("Thicken Surface"), 1, nullptr, "fly:surface#5", L("Thicken Surface needs a surface body — make one with a Surface tool first"), 0x00000100u, 0, 0, true, false, nullptr, "design_thicken", L("Thicken a sheet body into a solid")}, + {"hole", L("Hole"), 2, "Shift+H", "key:S+H", L("Pick a face or a plane to drill into"), 0x00000402u, 1, 0, false, false, nullptr, "design_hole", L("Drill a hole, centerd on a picked face or placed on a plane")}, + {"thread", L("Thread"), 2, "Shift+T", "key:S+T", L("Pick a cylindrical surface (bore / outer) or a circular edge for a thread"), 0x00000024u, 1, 0, false, false, nullptr, "design_thread", L("Thread a cylindrical surface (inner bore / outer) or a circular edge")}, + {"shell", L("Shell"), 2, "Shift+K", "key:S+K", L("Shell needs a solid body — add or import one first"), 0x00000082u, 1, 0, false, false, nullptr, "design_shell", L("Hollow the body to a wall thickness, opening a picked face")}, + {"cut", L("Cut"), 2, "Shift+X", "key:S+X", L("Cut needs a solid body — add or import one first"), 0x000004feu, 1, 0, false, false, nullptr, "design_cut", L("Trim the body with a plane — drag the offset arrow; keep one half or both")}, + {"split", L("Split"), 2, nullptr, nullptr, L("Split needs a solid body — add or import one first"), 0x000000feu, 1, 0, false, false, nullptr, nullptr, L("Split the body along a picked face into two solids")}, + {"fillet", L("Fillet"), 3, "Shift+F", "btn:dress#0", L("Pick an edge to round"), 0x000000b2u, 1, 0, false, false, nullptr, "design_filletedge", L("Pick an edge, then drag the radius arrow or type it")}, + {"chamfer", L("Chamfer"), 3, nullptr, "btn:dress#1", L("Pick an edge to bevel"), 0x000000b2u, 1, 0, false, false, nullptr, "design_chamfer", L("Pick an edge, then drag the distance arrow or type it")}, + {"draft", L("Draft"), 3, "Shift+D", "key:S+D", L("Pick a face to taper"), 0x0000000au, 1, 0, false, false, nullptr, "design_draft", L("Tilt a picked face by a draft angle")}, + {"surf_offset", L("Surface Offset"), 3, nullptr, "fly:surface#4", L("Surface Offset needs a surface body — make one with a Surface tool first"), 0x00000100u, 0, 0, true, false, nullptr, "design_offset", L("Offset a sheet body's shell by a signed distance")}, + {"pattern", L("Linear pattern"), 4, "Shift+N", "btn:pat#0", L("Pattern needs a solid body — add or import one first"), 0x00006082u, 1, 0, false, false, nullptr, "design_array", L("Repeat the body along a direction — drag the spacing, set the count")}, + {"pattern_circular", L("Circular pattern"), 4, nullptr, "btn:pat#1", L("Pattern needs a solid body — add or import one first"), 0x00006082u, 1, 0, false, false, nullptr, "design_polararray", L("Repeat the body around an axis — set the count and sweep")}, + {"mirror", L("Mirror"), 4, "Shift+Z", "key:S+Z", L("Mirror needs a body — add or import one first"), 0x000004feu, 1, 0, false, false, nullptr, "design_mirror", L("Reflect a body about a plane")}, + {"pat_curve", L("Pattern on Curve"), 4, nullptr, nullptr, L("Pattern on Curve needs a body and a curve"), 0x00000090u, 1, 0, false, false, nullptr, nullptr, L("Repeat the body along a picked curve")}, + {"transform", L("Move"), 5, "Shift+Y", "key:S+Y", L("Transform needs a body — add or import one first"), 0x000021feu, 1, 0, false, false, nullptr, "design_move", L("Move and/or rotate an existing body")}, + {"mate", L("Mate"), 5, nullptr, "fly:placement#2", L("Mate needs two coordinate systems — create them first"), 0x00001202u, 2, 0, false, false, nullptr, "design_c_coincident", L("Assembly: align two coordinate systems (fastened, planar, revolute, slider, cylindrical)")}, + {"align", L("Align to"), 5, nullptr, nullptr, L("Align needs a body — add or import one first"), 0x00000002u, 1, 0, false, false, nullptr, nullptr, L("Align the body to a picked face or plane")}, + {"plane", L("Plane"), 6, "Shift+P", "key:S+P", nullptr, 0x00000453u, 0, 0, false, false, nullptr, "design_plane", L("Reference plane (offset / tilt / midplane / tangent / two edges / coincident)")}, + {"axis", L("Axis"), 6, "Shift+A", "key:S+A", nullptr, 0x00000057u, 0, 0, false, false, nullptr, "design_line", L("Datum axis (two points, face normal, cylinder centerline, two planes, along edge)")}, + {"coordsys_v", L("Coordinate system"), 6, "Shift+C", "key:S+C", nullptr, 0x00000043u, 0, 0, false, false, nullptr, "design_point", L("Datum coordinate system (world point, or face + direction edge)")}, + {"helix", L("Helix"), 6, nullptr, "fly:plane#3", nullptr, 0x00000405u, 0, 0, false, false, nullptr, "design_thread", L("Helical curve (spring path) — use as a sweep path for coils / springs / augers")}, + {"project", L("Project"), 6, nullptr, "fly:plane#4", L("Project needs a body — add or import one first"), 0x00000482u, 1, 0, false, false, nullptr, "design_sketch", L("Project body edges onto a plane as sketch entities")}, + {"measure", L("Measure"), 6, nullptr, nullptr, nullptr, 0x000b03feu, 0, 0, false, false, nullptr, nullptr, L("Measure between the picked points, edges or faces")}, + {"mass_props", L("Volume and area"), 6, nullptr, "btn:mass", nullptr, 0x000000feu, 1, 0, false, false, nullptr, "info", L("Report the volume and surface area of the selected body")}, + {"interference", L("Interference"), 6, nullptr, "btn:interference", L("Interference needs at least two bodies"), 0x00000280u, 2, 0, false, false, nullptr, nullptr, L("Check whether two bodies overlap — reports, changes nothing")}, + {"edit_feature", L("Edit"), 7, nullptr, "btn:edit", nullptr, 0x00007d8eu, 0, 0, false, false, nullptr, "design_edit", L("Reopen the selected feature to change what it was made from")}, + {"rename", L("Rename…"), 7, "F2", "btn:rename", L("Select a feature, or a body, to rename it"), 0x00004080u, 0, 0, false, false, nullptr, nullptr, L("Give this feature a name you will recognise in the tree (a body takes its name from the feature that makes it)")}, + {"delete_face", L("Delete Face"), 7, nullptr, "fly:dressup#3", L("Delete Face needs a body — add or import one first"), 0x0000000eu, 1, 0, false, false, nullptr, "design_delete", L("Remove faces from a body and heal the solid")}, + {"colour", L("Color"), 7, nullptr, "btn:colour", nullptr, 0x000001feu, 1, 0, false, false, nullptr, "color_palette", L("Set the selected body's display color")}, + {"delete", L("Delete"), 7, "Del", "btn:delete", nullptr, 0x000f7c00u, 0, 0, false, false, nullptr, "design_delete", L("Delete what is selected")}, + {"delete_body", L("Delete Body"), 7, nullptr, "btn:delete_body", nullptr, 0x000001feu, 1, 0, false, false, nullptr, "design_delete", L("Delete this whole body — removes the feature it was made from")}, + {"sk_line_t", L("Line"), 0, "L", "key:L", nullptr, 0x000f8000u, 0, 0, false, true, L("Line"), "design_line", L("Line — click start, then end")}, + {"sk_polyline", L("Polyline"), 0, nullptr, "fly:design_line#1", nullptr, 0x000f8000u, 0, 0, false, true, L("Line"), "design_polyline", L("Click points; click the first point to close the loop, right-click to end it open")}, + {"sk_rect", L("Corner rectangle"), 0, "R", "key:R", nullptr, 0x000f8000u, 0, 0, false, true, L("Rectangle"), "design_rect", L("Rectangle — click two opposite corners")}, + {"sk_rect_center", L("Center rectangle"), 0, nullptr, "fly:design_rect#1", nullptr, 0x000f8000u, 0, 0, false, true, L("Rectangle"), "design_crect", L("Click center, then a corner")}, + {"sk_rect_oblique", L("Oblique rectangle"), 0, nullptr, "fly:design_rect#2", nullptr, 0x000f8000u, 0, 0, false, true, L("Rectangle"), "design_rect_oblique", L("Click two corners of one edge, then a point for the width")}, + {"sk_rect_rounded", L("Rounded rectangle"), 0, nullptr, "fly:design_rect#3", nullptr, 0x000f8000u, 0, 0, false, true, L("Rectangle"), "design_rect_rounded", L("Click two opposite corners, then a point for the corner radius")}, + {"sk_circle", L("Center circle"), 0, "C", "key:C", nullptr, 0x000f8000u, 0, 0, false, true, L("Circle"), "design_circle", L("Circle — click center, then radius")}, + {"sk_circle_2pt", L("2-point circle"), 0, nullptr, "fly:design_circle#1", nullptr, 0x000f8000u, 0, 0, false, true, L("Circle"), "design_circle2pt", L("Click two ends of the diameter")}, + {"sk_circle_3pt", L("3-point circle"), 0, nullptr, "fly:design_circle#2", nullptr, 0x000f8000u, 0, 0, false, true, L("Circle"), "design_circle3pt", L("Click three points on the circle")}, + {"sk_arc_t", L("3-point arc"), 0, "A", "key:A", nullptr, 0x000f8000u, 0, 0, false, true, L("Arc"), "design_arc3pt", L("Arc — click start, end, then a point")}, + {"sk_arc_tangent", L("Tangent arc"), 0, nullptr, "fly:design_arc3pt#1", nullptr, 0x000f8000u, 0, 0, false, true, L("Arc"), "design_tangentarc", L("Click start (on the last entity) then end")}, + {"sk_arc_center", L("Center-point arc"), 0, nullptr, "fly:design_arc3pt#2", nullptr, 0x000f8000u, 0, 0, false, true, L("Arc"), "design_arc_center", L("Click center, then start, then a point for the end angle")}, + {"sk_slot", L("Slot"), 0, "S", "key:S", nullptr, 0x000f8000u, 0, 0, false, true, L("Slot"), "design_slot", L("Slot — two centerline ends, then the width")}, + {"sk_slot_arc", L("Arc slot"), 0, nullptr, "fly:design_slot#1", nullptr, 0x000f8000u, 0, 0, false, true, L("Slot"), "design_slot_arc", L("Click center, start, end, then a point for the width")}, + {"sk_ellipse", L("Ellipse"), 0, "E", "key:E", nullptr, 0x000f8000u, 0, 0, false, true, L("Ellipse"), "design_ellipse", L("Ellipse — center, major end, minor point")}, + {"sk_ellipse_arc", L("Elliptical arc"), 0, nullptr, "fly:design_ellipse#1", nullptr, 0x000f8000u, 0, 0, false, true, L("Ellipse"), "design_ellipse_arc", L("Click center, major-axis end, minor point, then arc start and end")}, + {"sk_spline", L("Spline"), 0, "B", "key:B", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_bspline", L("Spline — click control points")}, + {"sk_poly_3", L("Triangle"), 0, nullptr, "btn:poly#3", nullptr, 0x000f8000u, 0, 0, false, true, L("Polygon"), "design_polygon", L("Triangle — click center, then a vertex")}, + {"sk_poly_4", L("Square"), 0, nullptr, "btn:poly#4", nullptr, 0x000f8000u, 0, 0, false, true, L("Polygon"), "design_polygon", L("Square — click center, then a vertex")}, + {"sk_poly_5", L("Pentagon"), 0, nullptr, "btn:poly#5", nullptr, 0x000f8000u, 0, 0, false, true, L("Polygon"), "design_polygon", L("Pentagon — click center, then a vertex")}, + {"sk_polygon", L("Hexagon"), 0, "G", "btn:poly#6", nullptr, 0x000f8000u, 0, 0, false, true, L("Polygon"), "design_polygon", L("Hexagon — click center, then a vertex")}, + {"sk_poly_8", L("Octagon"), 0, nullptr, "btn:poly#8", nullptr, 0x000f8000u, 0, 0, false, true, L("Polygon"), "design_polygon", L("Octagon — click center, then a vertex")}, + {"sk_poly_12", L("Dodecagon"), 0, nullptr, "btn:poly#12", nullptr, 0x000f8000u, 0, 0, false, true, L("Polygon"), "design_polygon", L("Dodecagon — click center, then a vertex")}, + {"sk_poly_inscribed", L("Inscribed"), 0, nullptr, "btn:polyfit#0", nullptr, 0x000f8000u, 0, 0, false, true, L("Polygon"), "design_polygon", L("Measure the polygon to its corners (inscribed)")}, + {"sk_poly_circumscribed", L("Circumscribed"), 0, nullptr, "btn:polyfit#1", nullptr, 0x000f8000u, 0, 0, false, true, L("Polygon"), "design_polygon", L("Measure the polygon to its flats (circumscribed)")}, + {"sk_point_t", L("Point"), 0, "P", "key:P", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_point", L("Point — click to place")}, + {"sk_text", L("Text"), 0, nullptr, "btn:text", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_text", L("Type text; its outline is added to this sketch as editable lines")}, + {"sk_svg", L("SVG"), 0, nullptr, "btn:svg", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_svg", L("Import an SVG outline into this sketch as editable lines")}, + {"sk_offset", L("Offset"), 1, "O", "key:O", nullptr, 0x000b0000u, 0, 0, false, true, nullptr, "design_offset", L("Offset — pick an entity, drag the distance")}, + {"sk_trim", L("Trim"), 2, "T", "key:T", nullptr, 0x000b0000u, 0, 0, false, true, nullptr, "design_trim", L("Trim — click a segment to trim it")}, + {"sk_fillet", L("Fillet"), 3, "F", "key:F", nullptr, 0x00090000u, 0, 0, false, true, nullptr, "design_filletedge", L("Fillet — pick two lines, set the radius")}, + {"sk_chamfer", L("Chamfer"), 3, "H", "key:H", nullptr, 0x00090000u, 0, 0, false, true, nullptr, "design_chamfer", L("Chamfer — pick two lines, set the distance")}, + {"sk_array", L("Linear array"), 4, nullptr, "fly:design_array#0", nullptr, 0x000b0000u, 0, 0, false, true, L("Array"), "design_array", L("Pick entities, drag the spacing handle, click the count; click empty to apply")}, + {"sk_array_polar", L("Polar array"), 4, nullptr, "fly:design_array#1", nullptr, 0x000b0000u, 0, 0, false, true, L("Array"), "design_polararray", L("Pick entities, drag the sweep handle, click the count; click empty to apply")}, + {"sk_mirror", L("Mirror"), 4, "M", "key:M", nullptr, 0x000b0000u, 0, 0, false, true, nullptr, "design_mirror", L("Mirror — pick axis, then entities")}, + {"sk_move", L("Move"), 5, nullptr, "fly:design_move#0", nullptr, 0x000f0000u, 0, 0, false, true, L("Move"), "design_move", L("Pick entities, then drag the handle or click the distance; click empty to apply")}, + {"sk_rotate", L("Rotate"), 5, nullptr, "fly:design_move#1", nullptr, 0x000f0000u, 0, 0, false, true, L("Move"), "design_rotate", L("Pick entities, then drag around the pivot or click the angle; click empty to apply")}, + {"sk_scale", L("Scale"), 5, nullptr, "fly:design_move#2", nullptr, 0x000f0000u, 0, 0, false, true, L("Move"), "design_scale", L("Pick entities, then drag the handle or click the factor; click empty to apply")}, + {"sk_dimension", L("Dimension"), 6, "D", "key:D", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_dimension", L("Dimension — click 2 points or an entity")}, + {"sk_constrain", L("Constrain"), 6, "K", "key:K", nullptr, 0x000f0000u, 0, 0, false, true, nullptr, "design_constrain", L("Constrain the selected sketch entities to each other")}, // Same verb, model-mode vocabulary: offered when a SKETCH is selected (bit 14, SkLoop), the // state a user is in right after finishing one. Without this row the only way in was the // toolbar icon, and constraints read as absent — see the Onshape-comparison report. - {"constrain", "Constrain sketch", 7, nullptr, "btn:constrain", "Select a sketch to constrain it", 0x00004000u, 0, 1, false, false, nullptr, "design_constrain", "Add dimensions and relations (coincident, tangent, parallel...) to the selected sketch"}, - {"sk_construct", "Construction", 6, "Q", "key:Q", nullptr, 0x000b8000u, 0, 0, false, true, nullptr, nullptr, "Toggle construction: geometry that guides but is never built"}, - {"sk_extend", "Extend", 7, "X", "key:X", nullptr, 0x000b0000u, 0, 0, false, true, nullptr, "design_extend", "Extend — click a line/arc to extend it"}, - {"sk_delete", "Delete", 7, "Del", "btn:sk_delete", nullptr, 0x000f0000u, 0, 0, false, true, nullptr, "design_delete", "Delete the selected sketch entities"}, + // It sits in the Reference row, the address the sketch-mode Constrain has: one verb, one row. + {"constrain", L("Constrain sketch"), 6, nullptr, "btn:constrain", L("Select a sketch to constrain it"), 0x00004000u, 0, 1, false, false, nullptr, "design_constrain", L("Add dimensions and relations (coincident, tangent, parallel...) to the selected sketch")}, + {"sk_construct", L("Construction"), 6, "Q", "key:Q", nullptr, 0x000b8000u, 0, 0, false, true, nullptr, nullptr, L("Toggle construction: geometry that guides but is never built")}, + {"sk_extend", L("Extend"), 7, "X", "key:X", nullptr, 0x000b0000u, 0, 0, false, true, nullptr, "design_extend", L("Extend — click a line/arc to extend it")}, + {"sk_delete", L("Delete"), 7, "Del", "btn:sk_delete", nullptr, 0x000f0000u, 0, 0, false, true, nullptr, "design_delete", L("Delete the selected sketch entities")}, // Typing the defining number of the element you pointed at. Three rows rather than one so // each names the quantity in the drawing-office word for THAT element; all three land on // the same handler, because dimension_kind() already resolves the quantity from the // selection. Without these, an element's own numbers were reachable only by arming the // Dimension tool and re-picking geometry that was already selected. - {"sk_length", "Length…", 7, "V", "key:V", nullptr, 0x00010000u, 0, 0, false, true, nullptr, "design_dimension", "Type the length of this line"}, - {"sk_radius", "Radius / diameter…", 7, "V", "key:V", nullptr, 0x00020000u, 0, 0, false, true, nullptr, "design_dimension", "Type the radius of this arc, or the diameter of this circle"}, - {"sk_angdist", "Angle / distance…", 7, "V", "key:V", nullptr, 0x00080000u, 0, 0, false, true, nullptr, "design_dimension", "Type the angle between two lines, or the distance between the two picks"}, + {"sk_length", L("Length…"), 7, "V", "key:V", nullptr, 0x00010000u, 0, 0, false, true, nullptr, "design_dimension", L("Type the length of this line")}, + {"sk_radius", L("Radius / diameter…"), 7, "V", "key:V", nullptr, 0x00020000u, 0, 0, false, true, nullptr, "design_dimension", L("Type the radius of this arc, or the diameter of this circle")}, + {"sk_angdist", L("Angle / distance…"), 7, "V", "key:V", nullptr, 0x00080000u, 0, 0, false, true, nullptr, "design_dimension", L("Type the angle between two lines, or the distance between the two picks")}, }; static const int kOfferVerbCount = 92; diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 097d79a343..aef3d3e0a8 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -388,7 +388,7 @@ DesignPanel::DesignPanel(wxWindow* parent) sk_key('R', DesignSketchTool::Mode::CornerRect, _L("Rectangle — click two opposite corners")); sk_key('C', DesignSketchTool::Mode::CenterCircle, _L("Circle — click center, then radius")); sk_key('A', DesignSketchTool::Mode::ThreePointArc,_L("Arc — click start, end, then a point")); - sk_key('S', DesignSketchTool::Mode::Slot, _L("Slot — two centerline ends, then end radius")); + sk_key('S', DesignSketchTool::Mode::Slot, _L("Slot — two centerline ends, then the width")); sk_key('E', DesignSketchTool::Mode::Ellipse, _L("Ellipse — center, major end, minor point")); sk_key('B', DesignSketchTool::Mode::BSpline, _L("Spline — click control points")); sk_key('P', DesignSketchTool::Mode::Point, _L("Point — click to place")); @@ -480,7 +480,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_keys_feature[WXK_HOME] = [this] { if (!m_viewport) return; m_viewport->set_view("iso"); - set_status(_L("Isometric view, fitted")); + set_status(_L("Axonometric view, fitted")); }; // Commit to Plate and the bed toggle were mouse-only: a toolbar button and a checkbox with @@ -852,7 +852,7 @@ DesignPanel::DesignPanel(wxWindow* parent) reset_axis_refs(); open_tool(Tool::Axis); }, SHIFT('A')}, - {"design_point", _L("Coord Sys"), _L("Datum coordinate system (world point, or face + direction edge)"), + {"design_point", _L("Coordinate system"), _L("Datum coordinate system (world point, or face + direction edge)"), [this] { reset_coordsys_refs(); open_tool(Tool::CoordSys); @@ -938,7 +938,7 @@ DesignPanel::DesignPanel(wxWindow* parent) populate_plane_choices(m_mirror_plane); open_tool(Tool::Mirror); }, SHIFT('Z')}, - {"design_c_coincident", _L("Mate"), _L("Assembly: align two CoordSys features (fastened, planar, revolute, slider, cylindrical)"), + {"design_c_coincident", _L("Mate"), _L("Assembly: align two coordinate systems (fastened, planar, revolute, slider, cylindrical)"), [this] { open_tool(Tool::Mate); }, 0}, @@ -970,7 +970,7 @@ DesignPanel::DesignPanel(wxWindow* parent) _L("Cut — needs a solid body to slice")}); // Color — override the selected body's display colour (per-body, survives recompute). - auto* b_color = icon_btn("color_palette", _L("Color — set the selected body's display colour")); + auto* b_color = icon_btn("color_palette", _L("Color — set the selected body's display color")); b_color->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_set_body_color(); }); fadd("color", b_color); m_verb_actions["btn:colour"] = [this] { on_set_body_color(); }; @@ -1014,6 +1014,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_verb_actions["btn:delete_body"] = [this] { on_delete_body(); }; m_verb_actions["btn:edit"] = [this] { on_edit_feature(); }; m_verb_actions["btn:mass"] = [this] { on_mass_properties(); }; + m_verb_actions["btn:interference"] = [this] { on_check_interference(); }; // Reachable from the offer menu on a SELECTED SKETCH, not only from the toolbar icon. // A user evaluating against Onshape reported that "adding constraints seems to be // missing" — with nineteen constraint types and a solver shipped. The only paths in @@ -1058,7 +1059,7 @@ DesignPanel::DesignPanel(wxWindow* parent) // Hole / Thread — drilling into a solid (both face-aware) feat_dropdown("hole", "design_hole", _L("Hole / thread"), { - {"design_hole", _L("Hole"), _L("Drill a hole, centred on a picked face or placed on a plane"), + {"design_hole", _L("Hole"), _L("Drill a hole, centerd on a picked face or placed on a plane"), [this] { // #2: drill on the picked solid face, centred on it (origin = face centroid, // normal = inward). Otherwise fall back to the plane dropdown. m_hole_x/y then @@ -1281,7 +1282,7 @@ DesignPanel::DesignPanel(wxWindow* parent) {"design_tangentarc", DesignSketchTool::Mode::TangentArc, _L("Tangent arc"), _L("Click start (on the last entity) then end")}, {"design_arc_center", DesignSketchTool::Mode::CenterArc, _L("Center-point arc"), _L("Click center, then start, then a point for the end angle")} }); dropdown("design_slot", _L("Slot"), { - {"design_slot", DesignSketchTool::Mode::Slot, _L("Slot"), _L("Click two centerline ends, then a point for the end radius")}, + {"design_slot", DesignSketchTool::Mode::Slot, _L("Slot"), _L("Click two centerline ends, then a point for the width")}, {"design_slot_arc", DesignSketchTool::Mode::ArcSlot, _L("Arc slot"), _L("Click center, start, end, then a point for the width")} }); dropdown("design_ellipse", _L("Ellipse"), { {"design_ellipse", DesignSketchTool::Mode::Ellipse, _L("Ellipse"), _L("Click center, a major-axis end, then a point for the minor axis")}, @@ -1722,7 +1723,7 @@ DesignPanel::DesignPanel(wxWindow* parent) mform->Add(m_move_axis, 0, wxEXPAND); m_move_angle = make_spin(m_cards, 0.0, -360.0, 360.0); - mform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Angle °")), 0, wxALIGN_CENTER_VERTICAL); + mform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Angle (°)")), 0, wxALIGN_CENTER_VERTICAL); mform->Add(spin_frame(m_move_angle), 0, wxEXPAND); for (wxSpinCtrlDouble* sp : { m_move_dx, m_move_dy, m_move_dz, m_move_angle }) @@ -1778,7 +1779,7 @@ DesignPanel::DesignPanel(wxWindow* parent) eform->Add(spin_frame(m_distance2), 0, wxEXPAND); m_taper = make_spin(m_cards, 0.0, -89.0, 89.0); // draft angle (deg) - eform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Taper °")), 0, wxALIGN_CENTER_VERTICAL); + eform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Taper (°)")), 0, wxALIGN_CENTER_VERTICAL); eform->Add(spin_frame(m_taper), 0, wxEXPAND); m_mode = make_combo(m_cards); @@ -1971,7 +1972,7 @@ DesignPanel::DesignPanel(wxWindow* parent) auto* rform = two_col_form(); m_revolve_angle = make_spin(m_cards, 360.0, 1.0, 360.0); - rform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Angle °")), 0, wxALIGN_CENTER_VERTICAL); + rform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Angle (°)")), 0, wxALIGN_CENTER_VERTICAL); rform->Add(spin_frame(m_revolve_angle), 0, wxEXPAND); m_revolve_axis = make_combo(m_cards); @@ -1982,12 +1983,12 @@ DesignPanel::DesignPanel(wxWindow* parent) rform->Add(m_revolve_axis, 0, wxEXPAND); m_revolve_mode = make_combo(m_cards); - m_revolve_mode->Append(_L("New")); - m_revolve_mode->Append(_L("Add")); + m_revolve_mode->Append(_L("New body")); // same four words as Extrude + m_revolve_mode->Append(_L("Join")); m_revolve_mode->Append(_L("Cut")); m_revolve_mode->Append(_L("Intersect")); m_revolve_mode->SetSelection(0); - rform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Mode")), 0, wxALIGN_CENTER_VERTICAL); + rform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Result")), 0, wxALIGN_CENTER_VERTICAL); rform->Add(m_revolve_mode, 0, wxEXPAND); m_revolve_flip = new CheckBox(m_cards); @@ -2012,12 +2013,12 @@ DesignPanel::DesignPanel(wxWindow* parent) sform->Add(m_sweep_path, 0, wxEXPAND); m_sweep_mode = make_combo(m_cards); - m_sweep_mode->Append(_L("New")); - m_sweep_mode->Append(_L("Add")); + m_sweep_mode->Append(_L("New body")); // same four words as Extrude + m_sweep_mode->Append(_L("Join")); m_sweep_mode->Append(_L("Cut")); m_sweep_mode->Append(_L("Intersect")); m_sweep_mode->SetSelection(0); - sform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Mode")), 0, wxALIGN_CENTER_VERTICAL); + sform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Result")), 0, wxALIGN_CENTER_VERTICAL); sform->Add(m_sweep_mode, 0, wxEXPAND); m_box_sweep->Add(sform, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 12); @@ -2054,7 +2055,7 @@ DesignPanel::DesignPanel(wxWindow* parent) pform->Add(m_pattern_dir, 0, wxEXPAND); m_pattern_angle = make_spin(m_cards, 360.0, 1.0, 360.0); - pform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Total angle°")), 0, wxALIGN_CENTER_VERTICAL); + pform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Total angle (°)")), 0, wxALIGN_CENTER_VERTICAL); pform->Add(spin_frame(m_pattern_angle), 0, wxEXPAND); m_box_pattern->Add(pform, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 12); @@ -2069,8 +2070,8 @@ DesignPanel::DesignPanel(wxWindow* parent) auto* bform = two_col_form(); m_bool_op = make_combo(m_cards); - m_bool_op->Append(_L("Union (join)")); - m_bool_op->Append(_L("Subtract (cut)")); + m_bool_op->Append(_L("Join")); // the Extrude result word; the offer row says the same + m_bool_op->Append(_L("Subtract")); m_bool_op->Append(_L("Intersect")); m_bool_op->SetSelection(0); m_bool_op->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent&) { refresh_preview(); }); @@ -2140,7 +2141,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_box_insert->Add(card_header(m_cards, "design_text", _L("Insert"), m_hdr_insert), 0, wxLEFT | wxRIGHT | wxTOP, 12); m_box_insert->Add(new wxStaticLine(m_cards), 0, wxEXPAND | wxALL, 8); m_box_insert->Add(new wxStaticText(m_cards, wxID_ANY, - _L("Drag a corner to size, the centre to move.\nConfirm or Cancel in the toolbar above.")), + _L("Drag a corner to size, the center to move.\nConfirm or Cancel in the toolbar above.")), 0, wxLEFT | wxRIGHT | wxBOTTOM, 12); cards->Add(m_box_insert, 0, wxEXPAND); @@ -2176,7 +2177,7 @@ DesignPanel::DesignPanel(wxWindow* parent) plform->Add(spin_frame(m_plane_offset), 0, wxEXPAND); m_plane_tilt = make_spin(m_cards, 0.0, -180.0, 180.0); - plform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Angle°")), 0, wxALIGN_CENTER_VERTICAL); + plform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Angle (°)")), 0, wxALIGN_CENTER_VERTICAL); plform->Add(spin_frame(m_plane_tilt), 0, wxEXPAND); m_plane_tilt_axis = make_combo(m_cards); @@ -2223,12 +2224,12 @@ DesignPanel::DesignPanel(wxWindow* parent) auto* lform = two_col_form(); m_loft_mode = make_combo(m_cards); - m_loft_mode->Append(_L("New")); - m_loft_mode->Append(_L("Add")); + m_loft_mode->Append(_L("New body")); // same four words as Extrude + m_loft_mode->Append(_L("Join")); m_loft_mode->Append(_L("Cut")); m_loft_mode->Append(_L("Intersect")); m_loft_mode->SetSelection(0); - lform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Mode")), 0, wxALIGN_CENTER_VERTICAL); + lform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Result")), 0, wxALIGN_CENTER_VERTICAL); lform->Add(m_loft_mode, 0, wxEXPAND); m_box_loft->Add(lform, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 12); @@ -2267,7 +2268,7 @@ DesignPanel::DesignPanel(wxWindow* parent) { auto* rform = two_col_form(); m_surf_revolve_angle = make_spin(m_cards, 360.0, 1.0, 360.0); - rform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Angle °")), 0, wxALIGN_CENTER_VERTICAL); + rform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Angle (°)")), 0, wxALIGN_CENTER_VERTICAL); rform->Add(spin_frame(m_surf_revolve_angle), 0, wxEXPAND); m_surf_revolve_axis = make_combo(m_cards); m_surf_revolve_axis->Append(_L("Plane X")); @@ -2604,7 +2605,7 @@ DesignPanel::DesignPanel(wxWindow* parent) wxString s; for (size_t i = 0; i < m_del_faces.size(); ++i) { if (i > 0) s += ", "; - s += wxString::Format("Face %d", m_del_faces[i]); + s += wxString::Format(_L("Face %d"), m_del_faces[i]); } m_del_face_list->SetLabel(s.empty() ? _L("(none)") : s); m_del_face_list->GetParent()->Layout(); @@ -2727,7 +2728,7 @@ DesignPanel::DesignPanel(wxWindow* parent) // --- CoordSys (datum coordinate system: point + orthonormal frame) --- m_box_coordsys = new wxBoxSizer(wxVERTICAL); - m_box_coordsys->Add(card_header(m_cards, "design_point", _L("Coord Sys"), m_hdr_coordsys), 0, wxLEFT | wxRIGHT | wxTOP, 12); + m_box_coordsys->Add(card_header(m_cards, "design_point", _L("Coordinate system"), m_hdr_coordsys), 0, wxLEFT | wxRIGHT | wxTOP, 12); m_box_coordsys->Add(new wxStaticLine(m_cards), 0, wxEXPAND | wxALL, 8); { m_coordsys_type = make_combo(m_cards); @@ -2797,7 +2798,7 @@ DesignPanel::DesignPanel(wxWindow* parent) } cards->Add(m_box_coordsys, 0, wxEXPAND); - // --- Mate (assembly: align two CoordSys features) --- + // --- Mate (assembly: align two coordinate systems) --- m_box_mate = new wxBoxSizer(wxVERTICAL); m_box_mate->Add(card_header(m_cards, "design_c_coincident", _L("Mate"), m_hdr_mate), 0, wxLEFT | wxRIGHT | wxTOP, 12); m_box_mate->Add(new wxStaticLine(m_cards), 0, wxEXPAND | wxALL, 8); @@ -2816,11 +2817,11 @@ DesignPanel::DesignPanel(wxWindow* parent) // Populate the CoordSys pickers on open; show "A (fixed)" and "B (moves)" combos. m_mate_cs_a = make_combo(m_cards); - mform->Add(new wxStaticText(m_cards, wxID_ANY, _L("CS A (fixed)")), 0, wxALIGN_CENTER_VERTICAL); + mform->Add(new wxStaticText(m_cards, wxID_ANY, _L("A (fixed)")), 0, wxALIGN_CENTER_VERTICAL); mform->Add(m_mate_cs_a, 0, wxEXPAND); m_mate_cs_b = make_combo(m_cards); - mform->Add(new wxStaticText(m_cards, wxID_ANY, _L("CS B (moves)")), 0, wxALIGN_CENTER_VERTICAL); + mform->Add(new wxStaticText(m_cards, wxID_ANY, _L("B (moves)")), 0, wxALIGN_CENTER_VERTICAL); mform->Add(m_mate_cs_b, 0, wxEXPAND); m_offset_label = new wxStaticText(m_cards, wxID_ANY, _L("Offset")); @@ -3247,7 +3248,7 @@ DesignPanel::DesignPanel(wxWindow* parent) bvis->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_toggle_visibility(); }); auto* bdel = body_btn("design_delete", _L("Delete")); bdel->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_delete_body(); }); - auto* bcol = body_btn("color_palette", _L("Colour")); + auto* bcol = body_btn("color_palette", _L("Color")); bcol->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_set_body_color(); }); const int bgap = FromDIP(SidebarProps::ElementSpacing()); m_parts_hdr->AddStretchSpacer(1); @@ -3465,7 +3466,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_viewport->set_on_sketch_commit([this](const SketchProfile& prof, const SketchPlane& plane) { m_doc.checkpoint(); // undo boundary: committing a sketch m_feature_counter++; - m_doc.add_sketch_profile(prof, plane, "Sketch" + std::to_string(m_feature_counter)); + m_doc.add_sketch_profile(prof, plane, feature_name(_L("Sketch"))); m_doc.recompute(); set_status(StatusKind::Info, _L("Sketch created — select it, then right-click to Extrude")); refresh_tree(); @@ -3500,7 +3501,7 @@ DesignPanel::DesignPanel(wxWindow* parent) } m_feature_counter++; const int sk = m_doc.add_sketch_entities(ents, plane, - "Sketch" + std::to_string(m_feature_counter), cons); + feature_name(_L("Sketch")), cons); if (!cons.empty()) m_doc.solve_sketch_feature(sk); // enforce driving dimensions m_doc.recompute(); set_status(StatusKind::Info, cons.empty() @@ -3517,8 +3518,8 @@ DesignPanel::DesignPanel(wxWindow* parent) // APPENDED to the step guidance, never in place of it. This fires on every mouse move // while a segment is being dragged, so replacing the line wiped the instruction for the // step the user is in the middle of — one mouse move after the click that armed it. - const wxString metrics = wxString::Format(L"L %.2f mm %.1f°%s", - len, a, locked ? L" (locked)" : L""); + wxString metrics = wxString::Format(_L("Length %.2f mm, angle %.1f°"), len, a); + if (locked) metrics += " " + _L("(locked)"); set_status(m_sketch_step.IsEmpty() ? metrics : m_sketch_step + L" · " + metrics); m_status->Refresh(); @@ -4722,7 +4723,7 @@ void DesignPanel::on_import_step() m_feature_counter++; CadFeature f; f.type = CadFeatureType::Import; - f.name = std::string("STEP") + std::to_string(m_feature_counter); + f.name = feature_name("STEP"); f.imported_solid = s; f.mode = BooleanMode::New; // each solid is its own coexisting body m_doc.features.push_back(f); @@ -4820,7 +4821,7 @@ void DesignPanel::on_import_mesh() m_feature_counter++; CadFeature f; f.type = CadFeatureType::Import; - f.name = std::string("Mesh") + std::to_string(m_feature_counter); + f.name = feature_name(_L("Mesh")); f.imported_solid = shape; f.mode = BooleanMode::New; // its own coexisting body, like a STEP solid m_doc.features.push_back(f); @@ -4873,7 +4874,7 @@ void DesignPanel::add_imported_sketch( m_feature_counter++; CadFeature f; f.type = CadFeatureType::Sketch; - f.name = std::string(base_name.ToUTF8().data()) + std::to_string(m_feature_counter); + f.name = feature_name(base_name); f.imported_regions = regions; // #4: when a solid face is selected, drop the art ON that face, centred on it (ready to @@ -4969,7 +4970,7 @@ void DesignPanel::on_transform_imported(int feat_idx) // the centre to move. Values stream back via set_on_imported_transform. m_viewport->begin_imported_transform(feat_idx, f.imported_regions, f.plane, f.import_offset, f.import_scale_x, f.import_scale_y); - set_status(StatusKind::Info, _L("Drag a corner to scale, the centre to move — Enter or ✓ when done, Esc to discard")); + set_status(StatusKind::Info, _L("Drag a corner to scale, the center to move — Enter or ✓ when done, Esc to discard")); } void DesignPanel::on_add_sketch() @@ -4980,7 +4981,7 @@ void DesignPanel::on_add_sketch() SketchPlane plane = sketch_plane_from_selection(where); // picked face, else the 3D plane click m_feature_counter++; m_doc.add_sketch(shape, plane, m_width->GetValue(), m_height->GetValue(), - m_radius->GetValue(), "Sketch" + std::to_string(m_feature_counter)); + m_radius->GetValue(), feature_name(_L("Sketch"))); m_doc.recompute(); // a lone sketch yields an empty body; that is expected set_status(StatusKind::Info, wxString::Format(_L("Sketch added on %s — select it, then right-click to Extrude"), where)); refresh_tree(); @@ -4998,11 +4999,18 @@ bool DesignPanel::extrude_uses_loop() const && !m_viewport->selected_loop_entities().empty(); } +// Default name of the feature being added: the card's own header word and number ("Extrude 3"), +// so the tree row and the card title that preceded it read the same, in the user's language. +std::string DesignPanel::feature_name(const wxString& kind) const +{ + return std::string((kind + wxString::Format(" %d", m_feature_counter)).ToUTF8().data()); +} + void DesignPanel::on_add_extrude() { BooleanMode mode = static_cast(m_mode->GetSelection()); // New/Add/Cut/Intersect m_feature_counter++; - const std::string name = "Extrude" + std::to_string(m_feature_counter); + const std::string name = feature_name(_L("Extrude")); int idx = -1; if (m_extrude_face_src >= 0) { // Onshape face-extrude: the picked solid face is the profile (no sketch wire). @@ -5032,7 +5040,8 @@ void DesignPanel::on_add_extrude() f.taper_deg = m_taper->GetValue(); f.flip = m_flip->GetValue(); f.up_to_face = (f.extrude_end == ExtrudeEnd::UpToFace) ? m_sel_solid_face : -1; - f.target_body = m_sel_solid_body; // multi-body: act on the picked body (-1 = last) + // multi-body: act on the picked body, else the body the profile touches (-1 = last) + f.target_body = m_sel_solid_body >= 0 ? m_sel_solid_body : m_extrude_auto_body; // On-face Text/SVG remembers its host body even after the face pick was cleared by // the placement recompute, so the engraving Cut hits the right solid. if (m_extrude_sketch_ref >= 0 && m_extrude_sketch_ref < int(m_doc.features.size()) @@ -5061,13 +5070,13 @@ void DesignPanel::on_add_dressup() int didx = -1; if (m_sel_solid_edge >= 0) { if (fillet) - didx = m_doc.add_fillet(sz, m_sel_solid_edge, "Fillet" + std::to_string(m_feature_counter)); + didx = m_doc.add_fillet(sz, m_sel_solid_edge, feature_name(_L("Fillet"))); else - didx = m_doc.add_chamfer(sz, m_sel_solid_edge, "Chamfer" + std::to_string(m_feature_counter)); + didx = m_doc.add_chamfer(sz, m_sel_solid_edge, feature_name(_L("Chamfer"))); } else if (fillet) - didx = m_doc.add_fillet(sz, fg, "Fillet" + std::to_string(m_feature_counter)); + didx = m_doc.add_fillet(sz, fg, feature_name(_L("Fillet"))); else - didx = m_doc.add_chamfer(sz, fg, "Chamfer" + std::to_string(m_feature_counter)); + didx = m_doc.add_chamfer(sz, fg, feature_name(_L("Chamfer"))); // Dress the picked body (its face/edge ids are body-local). -1 = last body. if (didx >= 0 && didx < int(m_doc.features.size())) m_doc.features[didx].target_body = m_sel_solid_body; @@ -5129,7 +5138,7 @@ void DesignPanel::on_add_hole() m_feature_counter++; const int hidx = m_doc.add_hole(dia, depth, through, px, py, plane, - "Hole" + std::to_string(m_feature_counter)); + feature_name(_L("Hole"))); // On-face holes drill the body the face belongs to (even after the pick was cleared). if (m_hole_on_face && hidx >= 0 && hidx < int(m_doc.features.size())) m_doc.features[hidx].target_body = m_hole_face_body; @@ -5198,7 +5207,7 @@ void DesignPanel::on_add_thread() { bool internal = m_thread_internal->GetValue(); if (internal && m_doc.body.IsNull()) { - set_status(_L("Thread needs a solid body — add or import one first")); + set_status(StatusKind::Warning, _L("Thread needs a solid body — add or import one first")); return; } SketchPlane plane = thread_plane(); @@ -5207,7 +5216,7 @@ void DesignPanel::on_add_thread() const int tidx = m_doc.add_thread(m_thread_radius->GetValue() * 0.5, m_thread_pitch->GetValue(), m_thread_height->GetValue(), m_thread_depth->GetValue(), internal, m_thread_x->GetValue(), m_thread_y->GetValue(), - plane, "Thread" + std::to_string(m_feature_counter)); + plane, feature_name(_L("Thread"))); // On-surface internal thread taps the body the cylindrical face belongs to. if (m_thread_on_face && tidx >= 0 && tidx < int(m_doc.features.size())) m_doc.features[tidx].target_body = m_thread_face_body; @@ -5228,13 +5237,13 @@ void DesignPanel::on_add_revolve() } const BooleanMode mode = static_cast(m_revolve_mode->GetSelection()); if (mode != BooleanMode::New && m_doc.body.IsNull()) { - set_status(_L("Revolve needs a solid body — add or import one first")); + set_status(StatusKind::Warning, _L("Revolve needs a solid body — add or import one first")); return; } m_feature_counter++; m_doc.add_revolve(m_revolve_sketch_ref, m_revolve_angle->GetValue(), m_revolve_axis->GetSelection(), m_revolve_flip->GetValue(), - mode, "Revolve" + std::to_string(m_feature_counter)); + mode, feature_name(_L("Revolve"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); @@ -5259,12 +5268,12 @@ void DesignPanel::on_add_sweep() } const BooleanMode mode = static_cast(m_sweep_mode->GetSelection()); if (mode != BooleanMode::New && m_doc.body.IsNull()) { - set_status(_L("Sweep needs a solid body — add or import one first")); + set_status(StatusKind::Warning, _L("Sweep needs a solid body — add or import one first")); return; } m_feature_counter++; m_doc.add_sweep(m_sweep_profile_ref, path_ref, mode, - "Sweep" + std::to_string(m_feature_counter)); + feature_name(_L("Sweep"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); @@ -5287,12 +5296,12 @@ void DesignPanel::on_add_loft() } const BooleanMode mode = static_cast(m_loft_mode->GetSelection()); if (mode != BooleanMode::New && m_doc.body.IsNull()) { - set_status(_L("Loft needs a solid body — add or import one first")); + set_status(StatusKind::Warning, _L("Loft needs a solid body — add or import one first")); return; } m_feature_counter++; m_doc.add_loft(refs, m_loft_ruled->GetValue(), mode, - "Loft" + std::to_string(m_feature_counter)); + feature_name(_L("Loft"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); @@ -5310,7 +5319,7 @@ void DesignPanel::on_add_surface_extrude() } m_feature_counter++; m_doc.add_surface_extrude(m_surf_extrude_sketch_ref, m_surf_extrude_distance->GetValue(), - "SurfaceExtrude" + std::to_string(m_feature_counter)); + feature_name(_L("Surface Extrude"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5327,7 +5336,7 @@ void DesignPanel::on_add_surface_revolve() m_feature_counter++; m_doc.add_surface_revolve(m_surf_revolve_sketch_ref, m_surf_revolve_angle->GetValue(), m_surf_revolve_axis->GetSelection(), - "SurfaceRevolve" + std::to_string(m_feature_counter)); + feature_name(_L("Surface Revolve"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5347,7 +5356,7 @@ void DesignPanel::on_add_surface_loft() } m_feature_counter++; m_doc.add_surface_loft(refs, m_surf_loft_ruled->GetValue(), - "SurfaceLoft" + std::to_string(m_feature_counter)); + feature_name(_L("Surface Loft"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5363,7 +5372,7 @@ void DesignPanel::on_add_surface_fill() } m_feature_counter++; m_doc.add_surface_fill(m_surf_fill_sketch_ref, - "SurfaceFill" + std::to_string(m_feature_counter)); + feature_name(_L("Surface Fill"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5380,7 +5389,7 @@ void DesignPanel::on_add_surface_offset() } m_feature_counter++; m_doc.add_surface_offset(sel, m_surf_offset_distance->GetValue(), - "SurfaceOffset" + std::to_string(m_feature_counter)); + feature_name(_L("Surface Offset"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5398,7 +5407,7 @@ void DesignPanel::on_add_thicken_surface() m_feature_counter++; m_doc.add_thicken_surface(sel, m_surf_thicken_thickness->GetValue(), m_surf_thicken_flip->GetValue(), - "ThickenSurface" + std::to_string(m_feature_counter)); + feature_name(_L("Thicken Surface"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5483,7 +5492,7 @@ void DesignPanel::on_add_transform() m_move_body = -1; } if (m_doc.bodies.empty()) { - set_status(_L("Transform needs a body — add or import one first")); + set_status(StatusKind::Warning, _L("Transform needs a body — add or import one first")); return; } const int sel = m_xf_body->GetSelection(); @@ -5494,7 +5503,7 @@ void DesignPanel::on_add_transform() const Vec3d pivot(m_xf_pivot_x->GetValue(), m_xf_pivot_y->GetValue(), m_xf_pivot_z->GetValue()); m_feature_counter++; m_doc.add_transform(target, trans, axis, pivot, m_xf_angle->GetValue(), m_xf_copy->GetValue(), - "Transform" + std::to_string(m_feature_counter)); + feature_name(_L("Transform"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5505,7 +5514,7 @@ void DesignPanel::on_add_transform() void DesignPanel::on_add_mirror() { if (m_doc.bodies.empty()) { - set_status(_L("Mirror needs a body — add or import one first")); + set_status(StatusKind::Warning, _L("Mirror needs a body — add or import one first")); return; } const int sel = m_mirror_body->GetSelection(); @@ -5513,7 +5522,7 @@ void DesignPanel::on_add_mirror() const BooleanMode mode = m_mirror_keep->GetValue() ? BooleanMode::New : BooleanMode::Add; m_feature_counter++; m_doc.add_mirror(plane_from_choice(m_mirror_plane->GetSelection()), target, mode, - "Mirror" + std::to_string(m_feature_counter)); + feature_name(_L("Mirror"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5524,7 +5533,7 @@ void DesignPanel::on_add_mirror() void DesignPanel::on_add_thicken() { if (m_doc.bodies.empty()) { - set_status(_L("Thicken needs a solid body — add or import one first")); + set_status(StatusKind::Warning, _L("Thicken needs a solid body — add or import one first")); return; } if (m_sel_solid_face < 0) { @@ -5535,7 +5544,7 @@ void DesignPanel::on_add_thicken() const int target = (sel != wxNOT_FOUND) ? sel : -1; m_feature_counter++; m_doc.add_thicken(target, m_sel_solid_face, m_thicken_thickness->GetValue(), - m_thicken_flip->GetValue(), "Thicken" + std::to_string(m_feature_counter)); + m_thicken_flip->GetValue(), feature_name(_L("Thicken"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5546,7 +5555,7 @@ void DesignPanel::on_add_thicken() void DesignPanel::on_add_rib() { if (m_doc.bodies.empty()) { - set_status(_L("Rib needs a solid body — add or import one first")); + set_status(StatusKind::Warning, _L("Rib needs a solid body — add or import one first")); return; } const int bsel = m_rib_body->GetSelection(); @@ -5560,7 +5569,7 @@ void DesignPanel::on_add_rib() } m_feature_counter++; m_doc.add_rib(sketch_ref, m_rib_entity->GetValue(), m_rib_thickness->GetValue(), - m_rib_depth->GetValue(), target, "Rib" + std::to_string(m_feature_counter)); + m_rib_depth->GetValue(), target, feature_name(_L("Rib"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5571,7 +5580,7 @@ void DesignPanel::on_add_rib() void DesignPanel::on_add_project() { if (m_doc.bodies.empty()) { - set_status(_L("Project needs a body — add or import one first")); + set_status(StatusKind::Warning, _L("Project needs a body — add or import one first")); return; } const int sel = m_proj_source_body->GetSelection(); @@ -5580,7 +5589,7 @@ void DesignPanel::on_add_project() m_feature_counter++; m_doc.add_project_edges(src_body, {}, face, plane_from_choice(m_proj_plane->GetSelection()), - "Project" + std::to_string(m_feature_counter)); + feature_name(_L("Project"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5591,7 +5600,7 @@ void DesignPanel::on_add_project() void DesignPanel::on_add_delete_face() { if (m_doc.bodies.empty()) { - set_status(_L("Delete Face needs a body — add or import one first")); + set_status(StatusKind::Warning, _L("Delete Face needs a body — add or import one first")); return; } if (m_del_faces.empty()) { @@ -5601,7 +5610,7 @@ void DesignPanel::on_add_delete_face() const int sel = m_del_face_body->GetSelection(); const int target = (sel != wxNOT_FOUND) ? sel : -1; m_feature_counter++; - m_doc.add_delete_face(target, m_del_faces, "DeleteFace" + std::to_string(m_feature_counter)); + m_doc.add_delete_face(target, m_del_faces, feature_name(_L("Delete Face"))); m_del_faces.clear(); // consumed; fresh state for the next use if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); @@ -5616,7 +5625,7 @@ void DesignPanel::on_add_helix() m_doc.add_helix(plane_from_choice(m_helix_plane->GetSelection()), m_helix_radius->GetValue(), m_helix_pitch->GetValue(), m_helix_height->GetValue(), m_helix_left_handed->GetValue(), - m_helix_taper->GetValue(), "Helix" + std::to_string(m_feature_counter)); + m_helix_taper->GetValue(), feature_name(_L("Helix"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5629,20 +5638,20 @@ void DesignPanel::on_add_mate() const int sel_a = m_mate_cs_a->GetSelection(); const int sel_b = m_mate_cs_b->GetSelection(); if (sel_a == wxNOT_FOUND || sel_b == wxNOT_FOUND) { - set_status(StatusKind::Error, _L("Mate needs two CoordSys features — create them first")); + set_status(StatusKind::Warning, _L("Mate needs two coordinate systems — create them first")); return; } const int cs_a = int(reinterpret_cast(m_mate_cs_a->GetClientData(sel_a))); const int cs_b = int(reinterpret_cast(m_mate_cs_b->GetClientData(sel_b))); if (cs_a == cs_b) { - set_status(StatusKind::Error, _L("Mate: CS A and CS B must be different CoordSys features")); + set_status(StatusKind::Error, _L("Mate: A and B must be different coordinate systems")); return; } m_feature_counter++; int idx = m_doc.add_mate(m_mate_kind->GetSelection(), cs_a, cs_b, m_mate_offset->GetValue(), m_mate_angle->GetValue(), m_mate_flip->GetValue(), - "Mate" + std::to_string(m_feature_counter)); + feature_name(_L("Mate"))); if (idx < 0) { set_status(StatusKind::Error, _L("Mate rejected")); return; @@ -5657,72 +5666,60 @@ void DesignPanel::on_add_mate() void DesignPanel::on_check_interference() { if (m_doc.bodies.size() < 2) { - set_status(StatusKind::Info, _L("No interference — need at least two solid bodies to check")); + set_status(StatusKind::Info, _L("Interference needs at least two bodies")); return; } const auto pairs = m_doc.check_interference(); if (pairs.empty()) { - set_status(StatusKind::Info, _L("No interference found")); + set_status(StatusKind::Ok, _L("No interference found")); return; } - double worst = 0; - for (const auto& p : pairs) - if (p.volume > worst) worst = p.volume; - set_status(StatusKind::Info, wxString::Format(_L("%zu interference pairs, worst %.2f mm³"), - pairs.size(), worst)); - wxString msg = _L("Interference pairs:\n\n"); - for (const auto& p : pairs) { - // 1-based, like every other body label in this panel and in the parts tree: - // reporting "Body 1" for what the tree calls "Body 2" is worse than no name. - wxString na = wxString::Format(_L("Body %d"), p.body_a + 1); - wxString nb = wxString::Format(_L("Body %d"), p.body_b + 1); - if (p.body_a >= 0 && p.body_a < int(m_doc.bodies.size()) && !m_doc.bodies[p.body_a].name.empty()) - na = wxString::FromUTF8(m_doc.bodies[p.body_a].name); - if (p.body_b >= 0 && p.body_b < int(m_doc.bodies.size()) && !m_doc.bodies[p.body_b].name.empty()) - nb = wxString::FromUTF8(m_doc.bodies[p.body_b].name); - msg += wxString::Format("%s <-> %s: %.4f mm³\n", na, nb, p.volume); - } - wxMessageBox(msg, _L("Interference"), wxOK, this); + // A report, so it goes to the status line like every other report — no modal to dismiss. + // Worst overlap first; 1-based names, the wording the parts tree uses. + auto body_name = [this](int b) { + if (b >= 0 && b < int(m_doc.bodies.size()) && !m_doc.bodies[b].name.empty()) + return wxString::FromUTF8(m_doc.bodies[b].name); + return wxString::Format(_L("Body %d"), b + 1); + }; + auto sorted = pairs; + std::sort(sorted.begin(), sorted.end(), [](const auto& a, const auto& b) { return a.volume > b.volume; }); + wxString list; + const size_t shown = std::min(sorted.size(), 3); + for (size_t k = 0; k < shown; ++k) + list += (k ? ", " : "") + wxString::Format(_L("%s ↔ %s %.2f mm³"), body_name(sorted[k].body_a), + body_name(sorted[k].body_b), sorted[k].volume); + if (sorted.size() > shown) + list += ", …"; + set_status(StatusKind::Warning, wxString::Format(_L("%zu overlapping pairs: %s"), sorted.size(), list)); } -// Mass properties of the selected solid. A report, not a feature: it never checkpoints, never -// recomputes and never opens a card, which is why it sits beside the interference check rather -// than in the on_add_* family. The caller only reaches us with m_sel_solid_body in range. +// Volume and surface area of the selected body. A report, not a feature: it never checkpoints, +// never recomputes and never opens a card, which is why it sits beside the interference check +// rather than in the on_add_* family. It reports geometry only — there is no density, so no mass. void DesignPanel::on_mass_properties() { // This bounds check is not defensive padding — it is what makes the verb safe to fire from - // the socket, which has no offer menu to grey the row out. The menu-only route never reached - // here with nothing selected; run_verb does. Nothing selected is not an error, hence the - // neutral colour, not the error red. + // the socket, which has no offer menu to grey the row out. if (m_sel_solid_body < 0 || m_sel_solid_body >= int(m_doc.bodies.size())) { - set_status(StatusKind::Info, _L("Select a solid body first — its mass properties are what is reported")); + set_status(StatusKind::Info, _L("Select a body to measure it")); return; } const auto mp = GeometryEngine::mass_properties(m_doc.bodies[m_sel_solid_body].shape); if (!mp.valid) { - set_status(StatusKind::Error, _L("Mass properties could not be computed for this body")); + set_status(StatusKind::Error, _L("This body could not be measured")); return; } - // 1-based, and the body's own name when it has one — the same wording the parts list uses. wxString name = wxString::Format(_L("Body %d"), m_sel_solid_body + 1); if (!m_doc.bodies[m_sel_solid_body].name.empty()) name = wxString::FromUTF8(m_doc.bodies[m_sel_solid_body].name); - if (!mp.is_solid) { + // Same units and precision as the interference report: mm³ and mm², two decimals. + if (!mp.is_solid) // Sheet body: quoting a volume here would be inventing material that is not there. - set_status(StatusKind::Info, wxString::Format(_L("%s: sheet body — %.2f cm² of surface, no volume"), - name, mp.surface_area / 100.0)); - wxMessageBox(wxString::Format(_L("%s\n\nSheet body (open shell)\nSurface area: %.2f cm²\n\n" - "A sheet encloses no material, so it has no volume. " - "Thicken it into a solid to get one."), - name, mp.surface_area / 100.0), - _L("Mass properties"), wxOK, this); - return; - } - set_status(StatusKind::Info, wxString::Format(_L("%s: %.3f cm³, %.2f cm²"), - name, mp.volume / 1000.0, mp.surface_area / 100.0)); - wxMessageBox(wxString::Format(_L("%s\n\nVolume: %.3f cm³\nSurface area: %.2f cm²"), - name, mp.volume / 1000.0, mp.surface_area / 100.0), - _L("Mass properties"), wxOK, this); + set_status(StatusKind::Info, wxString::Format(_L("%s: sheet body, area %.2f mm², no volume — thicken it to get one"), + name, mp.surface_area)); + else + set_status(StatusKind::Info, wxString::Format(_L("%s: volume %.2f mm³, area %.2f mm²"), + name, mp.volume, mp.surface_area)); } // The rows are only the SHEET bodies, so a row index is NOT a body index — with a solid at 0 @@ -5768,7 +5765,7 @@ void DesignPanel::select_sheet_choice(ComboBox* c, int body) void DesignPanel::on_add_pattern() { if (m_doc.bodies.empty()) { - set_status(_L("Pattern needs a solid body — add or import one first")); + set_status(StatusKind::Warning, _L("Pattern needs a solid body — add or import one first")); return; } const bool circular = (m_pattern_type->GetSelection() == 1); @@ -5778,7 +5775,7 @@ void DesignPanel::on_add_pattern() m_doc.add_pattern(circular, int(m_pattern_count->GetValue()), m_pattern_spacing->GetValue(), m_pattern_dir->GetSelection(), m_pattern_angle->GetValue(), target, - "Pattern" + std::to_string(m_feature_counter)); + feature_name(_L("Pattern"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); @@ -5853,7 +5850,7 @@ void DesignPanel::fill_body_choice(ComboBox* c, int as_of_feature, int want) void DesignPanel::on_add_boolean() { if (m_doc.bodies.size() < 2) { - set_status(_L("Boolean needs two solid bodies — add or import a second one")); + set_status(StatusKind::Warning, _L("Boolean needs two bodies — add or import a second one")); return; } const int sel = m_bool_op->GetSelection(); @@ -5863,7 +5860,7 @@ void DesignPanel::on_add_boolean() m_feature_counter++; m_doc.add_boolean(op, m_bool_target->GetSelection(), m_bool_tool->GetSelection(), m_bool_keep->GetValue(), m_bool_tol->GetValue(), -1, -1, - "Boolean" + std::to_string(m_feature_counter)); + feature_name(_L("Boolean"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -5874,13 +5871,13 @@ void DesignPanel::on_add_boolean() void DesignPanel::on_add_cut() { if (m_doc.bodies.empty()) { - set_status(_L("Cut needs a solid body — add or import one first")); + set_status(StatusKind::Warning, _L("Cut needs a solid body — add or import one first")); return; } m_feature_counter++; m_doc.add_cut(plane_from_choice(m_cut_plane->GetSelection()), m_cut_offset->GetValue(), /*flip*/ false, /*keep_upper*/ true, /*keep_lower*/ true, - m_cut_target->GetSelection(), "Cut" + std::to_string(m_feature_counter)); + m_cut_target->GetSelection(), feature_name(_L("Cut"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -6188,7 +6185,7 @@ static wxString sketch_step_prompt(DesignSketchTool::Mode m, int step, int picks return picks > 0 ? wxString::Format(_L("%d selected · Del removes them · Shift-click adds · " "double-click takes the whole loop"), picks) - : _L("Select — click an entity to pick it · drag an endpoint or centre to move it · " + : _L("Select — click an entity to pick it · drag an endpoint or center to move it · " "Shift-click adds · Del removes"); case Mode::Constrain: return picks > 0 @@ -6209,8 +6206,8 @@ static wxString sketch_step_prompt(DesignSketchTool::Mode m, int step, int picks return step == 0 ? _L("Rectangle — click one corner") : _L("Rectangle — click the opposite corner"); case Mode::CenterRect: - return step == 0 ? _L("Centre rectangle — click the centre") - : _L("Centre rectangle — click a corner"); + return step == 0 ? _L("Center rectangle — click the center") + : _L("Center rectangle — click a corner"); case Mode::ObliqueRect: return step == 0 ? _L("Oblique rectangle — click the start of the base edge") : step == 1 ? _L("Oblique rectangle — click the end of the base edge (this sets the angle)") @@ -6220,7 +6217,7 @@ static wxString sketch_step_prompt(DesignSketchTool::Mode m, int step, int picks : step == 1 ? _L("Rounded rectangle — click the opposite corner") : _L("Rounded rectangle — click to set the corner radius"); case Mode::CenterCircle: - return step == 0 ? _L("Circle — click the centre") + return step == 0 ? _L("Circle — click the center") : _L("Circle — click to set the radius; it can then be typed"); case Mode::TwoPointCircle: return step == 0 ? _L("Circle (2 points) — click one end of the diameter") @@ -6237,27 +6234,27 @@ static wxString sketch_step_prompt(DesignSketchTool::Mode m, int step, int picks return step == 0 ? _L("Tangent arc — click the endpoint it leaves from") : _L("Tangent arc — click its far end"); case Mode::CenterArc: - return step == 0 ? _L("Centre arc — click the centre") - : step == 1 ? _L("Centre arc — click the start point (this sets the radius)") - : _L("Centre arc — click the end point"); + return step == 0 ? _L("Center arc — click the center") + : step == 1 ? _L("Center arc — click the start point (this sets the radius)") + : _L("Center arc — click the end point"); case Mode::Slot: - return step == 0 ? _L("Slot — click one end of the centreline") - : step == 1 ? _L("Slot — click the other end of the centreline") + return step == 0 ? _L("Slot — click one end of the centerline") + : step == 1 ? _L("Slot — click the other end of the centerline") : _L("Slot — click to set the width"); case Mode::ArcSlot: - return step == 0 ? _L("Arc slot — click the centre the slot curves about") - : step == 1 ? _L("Arc slot — click the start of the centreline (this sets the radius)") - : step == 2 ? _L("Arc slot — click the end of the centreline") + return step == 0 ? _L("Arc slot — click the center the slot curves about") + : step == 1 ? _L("Arc slot — click the start of the centerline (this sets the radius)") + : step == 2 ? _L("Arc slot — click the end of the centerline") : _L("Arc slot — click to set the width"); case Mode::Polygon: - return step == 0 ? _L("Polygon — click the centre") + return step == 0 ? _L("Polygon — click the center") : _L("Polygon — click a vertex (this sets size and orientation)"); case Mode::Ellipse: - return step == 0 ? _L("Ellipse — click the centre") + return step == 0 ? _L("Ellipse — click the center") : step == 1 ? _L("Ellipse — click the end of the major axis") : _L("Ellipse — click a point on the minor axis"); case Mode::EllipseArc: - return step == 0 ? _L("Elliptical arc — click the centre") + return step == 0 ? _L("Elliptical arc — click the center") : step == 1 ? _L("Elliptical arc — click the end of the major axis") : step == 2 ? _L("Elliptical arc — click a point on the minor axis") : step == 3 ? _L("Elliptical arc — click where the arc starts") @@ -6317,7 +6314,7 @@ static wxString sketch_step_prompt(DesignSketchTool::Mode m, int step, int picks : pick_more(_L("Polar array — drag the handle to set the sweep, click the " "count to type it · Enter applies"), picks); case Mode::TransformArt: - return _L("Drag a corner to scale, the centre to move · Enter or ✓ when done, Esc to discard"); + return _L("Drag a corner to scale, the center to move · Enter or ✓ when done, Esc to discard"); } return wxString(); } @@ -6459,7 +6456,8 @@ void DesignPanel::show_offer_menu(const wxPoint& screen_pos) why ? why : "no verb accepts this selection"); menu.Append(base + int(bound.size()), s)->Enable(false); bound.push_back(nullptr); - } else if (live.size() == 1) { + } else if (live.size() == 1 && std::none_of(family.begin(), family.end(), [&](const OfferVerb* v) { + return (v->accepts & bit) && !applies(*v); })) { offer_trace("row=%d %s -> %s%s", row, kOfferRowNames[row], live[0]->id, live[0]->action ? "" : " (no GUI route)"); append_offer_item(&menu, base + int(bound.size()), label(*live[0]), *live[0]) @@ -6470,9 +6468,15 @@ void DesignPanel::show_offer_menu(const wxPoint& screen_pos) // (Rectangle -> corner / centre / oblique / rounded); one without sits directly in // the row. Families keep the order of their first member, so the row's layout is // stable across selections — the whole point of a fixed address. + // A verb that is about THIS selection but blocked by the document (no body yet, no + // second sketch) stays in its place, greyed, with its reason (charter 4.1: disabled + // in place, never removed). Verbs that do not accept this selection at all are not + // about it and stay out. auto* sub = new wxMenu(); std::vector> groups; // insertion-ordered - for (const OfferVerb* v : live) { + for (const OfferVerb* v : family) { + const bool ok = applies(*v); + if (!ok && !(v->accepts & bit)) continue; wxMenu* target = sub; if (v->family && *v->family) { auto it = std::find_if(groups.begin(), groups.end(), @@ -6486,6 +6490,14 @@ void DesignPanel::show_offer_menu(const wxPoint& screen_pos) target = it->second; } } + if (!ok) { + offer_trace("row=%d %s ~ %s BLOCKED", row, kOfferRowNames[row], v->id); + wxString s = tr(v->name); + if (v->refusal) s += wxString::FromUTF8(" — ") + tr(v->refusal); + append_offer_item(target, base + int(bound.size()), s, *v)->Enable(false); + bound.push_back(nullptr); + continue; + } offer_trace("row=%d %s > %s%s%s%s", row, kOfferRowNames[row], (v->family && *v->family) ? v->family : "", (v->family && *v->family) ? " > " : "", v->id, @@ -6615,7 +6627,7 @@ void DesignPanel::show_offer_menu(const wxPoint& screen_pos) const int i = e.GetMenuId() - base; if (i < 0 || i >= int(bound.size()) || bound[i] == nullptr || bound[i]->hint == nullptr) return; - set_status(StatusKind::Info, wxGetTranslation(wxString::FromUTF8(bound[i]->hint))); + set_status(StatusKind::Info, wxGetTranslation(wxString::FromUTF8(bound[i]->hint), SLIC3R_APP_KEY)); m_status->Update(); // the popup owns the loop; without this the line repaints late }, base, base + 499); // 499: the mate section starts at base + 500 (see mate_base) menu.Bind(wxEVT_MENU, [this, &bound](wxCommandEvent& e) { @@ -6817,7 +6829,7 @@ bool DesignPanel::on_add_plane() m_feature_counter++; int idx = m_doc.add_plane(m_plane_base->GetSelection(), m_plane_offset->GetValue(), m_plane_tilt->GetValue(), m_plane_tilt_axis->GetSelection(), - "Plane" + std::to_string(m_feature_counter)); + feature_name(_L("Plane"))); if (idx >= 0 && idx < int(m_doc.features.size())) apply_plane_refs(m_doc.features[idx]); m_doc.recompute(); // datum-only docs yield no body; that is expected/benign set_status(StatusKind::Info, _L("Plane added — pick it as a sketch plane")); @@ -6829,7 +6841,7 @@ void DesignPanel::on_add_axis() { m_feature_counter++; int idx = m_doc.add_axis((AxisType)m_axis_type->GetSelection(), - "Axis" + std::to_string(m_feature_counter)); + feature_name(_L("Axis"))); if (idx >= 0 && idx < int(m_doc.features.size())) apply_axis_refs(m_doc.features[idx]); m_doc.recompute(); set_status(StatusKind::Info, _L("Axis added")); @@ -6841,24 +6853,24 @@ void DesignPanel::on_add_coordsys() m_feature_counter++; Vec3d pt(m_cs_x->GetValue(), m_cs_y->GetValue(), m_cs_z->GetValue()); int idx = m_doc.add_coordsys((CoordSysType)m_coordsys_type->GetSelection(), pt, - "Coord" + std::to_string(m_feature_counter)); + feature_name(_L("Coordinate system"))); if (idx >= 0 && idx < int(m_doc.features.size())) apply_coordsys_refs(m_doc.features[idx]); m_doc.recompute(); - set_status(StatusKind::Info, _L("Coord Sys added")); + set_status(StatusKind::Info, _L("Coordinate system added")); refresh_tree(); } void DesignPanel::on_add_shell() { if (m_doc.body.IsNull()) { - set_status(_L("Shell needs a solid body — add or import one first")); + set_status(StatusKind::Warning, _L("Shell needs a solid body — add or import one first")); return; } const int face = (m_sel_solid_face >= 0) ? m_sel_solid_face : -1; m_feature_counter++; m_doc.add_shell(m_shell_thickness->GetValue(), face, m_sel_solid_body, - "Shell" + std::to_string(m_feature_counter)); + feature_name(_L("Shell"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); @@ -6871,7 +6883,7 @@ void DesignPanel::on_add_shell() void DesignPanel::on_add_draft() { if (m_doc.body.IsNull()) { - set_status(_L("Draft needs a solid body — add or import one first")); + set_status(StatusKind::Warning, _L("Draft needs a solid body — add or import one first")); return; } if (m_sel_solid_face < 0) { @@ -6881,7 +6893,7 @@ void DesignPanel::on_add_draft() m_feature_counter++; m_doc.add_draft(m_draft_angle->GetValue(), m_sel_solid_face, m_sel_solid_body, - "Draft" + std::to_string(m_feature_counter)); + feature_name(_L("Draft"))); if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); @@ -7000,6 +7012,10 @@ void DesignPanel::hydrate_from_model() if (!m_doc.origin_from_recipe) { const Vec2d bc = plater->build_volume().bed_center(); m_doc.modeling_origin = Vec3d(bc.x(), bc.y(), 0.0); + // A document started here takes the weld rule from the preference; a loaded one + // brings its own (load_recipe). + m_doc.auto_close_loops = wxGetApp().is_auto_close_sketch_loops(); + Slic3r::set_sketch_auto_close(m_doc.auto_close_loops); } const std::string& blob = plater->model().cad_recipe; if (!blob.empty()) load_recipe(blob); @@ -7280,7 +7296,7 @@ void DesignPanel::feed_bodies() void DesignPanel::on_boolean_tool() { if (m_doc.bodies.size() < 2) { - set_status(StatusKind::Error, _L("Boolean needs two bodies — create or import a second solid")); + set_status(StatusKind::Warning, _L("Boolean needs two bodies — add or import a second one")); return; } populate_body_choices(); @@ -7381,7 +7397,7 @@ void DesignPanel::on_set_body_color() (unsigned char)picked.Blue(), (unsigned char)255); feed_bodies(); // same refresh path the visibility toggle uses → viewport updates immediately - set_status(StatusKind::Info, wxString::Format(_L("Body %d colour set"), b + 1)); + set_status(StatusKind::Info, wxString::Format(_L("Body %d color set"), b + 1)); } // Prepare's "Place on Face" (F), ported to Design. Pick a body face, then this rotates the @@ -7485,6 +7501,8 @@ void DesignPanel::clear_document() { tool_cancel(); // leave any active tool / sketch / constrain cleanly m_doc.clear(); // features + bodies + meshes + history + m_doc.auto_close_loops = wxGetApp().is_auto_close_sketch_loops(); // a new design: today's preference + Slic3r::set_sketch_auto_close(m_doc.auto_close_loops); m_edit_index = -1; m_move_body = -1; show_move_card(false); @@ -7498,8 +7516,9 @@ void DesignPanel::clear_document() // The verb the offer names when you point at a body, or at any face/edge/vertex of one. A body // is a recomputed RESULT, so what actually gets deleted is the feature that created it // (CadBody::source_feature). That is an edit to the recipe and can take other features with it, -// so it asks first and NAMES the feature: a body disappearing from the viewport is not by itself -// evidence of which feature went, and this is the one action here that cannot be eyeballed. +// so the status line NAMES the feature that went: a body disappearing from the viewport is not by +// itself evidence of which feature it was. No confirmation — it is one Ctrl+Z away, like every +// other delete here, and a modal in the modelling loop is the thing charter 4.2 removes. void DesignPanel::on_delete_body() { const int nb = int(m_doc.bodies.size()); @@ -7517,11 +7536,6 @@ void DesignPanel::on_delete_body() const std::string& raw = m_doc.features[src].name; const wxString fname = raw.empty() ? wxString::Format(_L("feature %d"), src + 1) : wxString::FromUTF8(raw); - if (wxMessageBox(wxString::Format( - _L("Delete %s?\n\nThat is the feature this body was made from. " - "Features built on it may be removed or stop working."), fname), - _L("Delete body"), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION, this) != wxYES) - return; // A card left open over a feature that is about to vanish goes stale — same reason // on_delete_feature() closes it. if (m_active != Tool::None || m_edit_index >= 0) { @@ -7531,7 +7545,10 @@ void DesignPanel::on_delete_body() m_doc.checkpoint(); // undo boundary: deleting a body's feature m_sel_solid_body = m_sel_solid_face = m_sel_solid_edge = -1; // the selection is about to m_sel_solid_vertex = false; // name a body that is gone - after_tree_edit(m_doc.remove_feature(src)); + const bool ok = m_doc.remove_feature(src); + after_tree_edit(ok); + if (ok) + set_status(StatusKind::Ok, wxString::Format(_L("Deleted %s, the feature this body was made from — Ctrl+Z restores it"), fname)); } void DesignPanel::on_delete_feature() @@ -7544,8 +7561,7 @@ void DesignPanel::on_delete_feature() } int sel = tree_selection(); if (sel == wxNOT_FOUND) { - set_status(_L("Select a feature in the tree first")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Select a feature in the tree first")); return; } // If a feature dialog is open (e.g. the feature is being edited), dismiss it first — @@ -7616,8 +7632,7 @@ void DesignPanel::on_move_feature(int delta) { int sel = tree_selection(); if (sel == wxNOT_FOUND) { - set_status(_L("Select a feature in the tree first")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Select a feature in the tree first")); return; } int target = sel + delta; @@ -9246,8 +9261,7 @@ void DesignPanel::on_edit_feature() { int sel = tree_selection(); if (sel == wxNOT_FOUND) { - set_status(_L("Select a feature in the tree first")); - m_status->Refresh(); + set_status(StatusKind::Info, _L("Select a feature in the tree first")); return; } const CadFeature& f = m_doc.features[sel]; @@ -9859,7 +9873,8 @@ CadFeature DesignPanel::build_candidate(Tool t) const && m_active != Tool::DeleteFace && m_active != Tool::Rib && m_active != Tool::Project && m_active != Tool::Helix && m_active != Tool::SurfaceOffset && m_active != Tool::ThickenSurface) - f.target_body = m_sel_solid_body; + f.target_body = (m_active == Tool::Extrude && m_sel_solid_body < 0) ? m_extrude_auto_body + : m_sel_solid_body; return f; } @@ -10520,7 +10535,7 @@ void DesignPanel::refresh_preview() switch (m_active) { case Tool::Plane: ready = _L("Plane ready"); break; case Tool::Axis: ready = _L("Axis ready"); break; - case Tool::CoordSys: ready = _L("Coord Sys ready"); break; + case Tool::CoordSys: ready = _L("Coordinate system ready"); break; case Tool::Helix: ready = _L("Helix ready"); break; case Tool::Project: ready = _L("Project ready"); break; default: ready = _L("Sketch ready"); break; @@ -10549,11 +10564,11 @@ void DesignPanel::refresh_preview() if (!has_two) { m_viewport->clear_preview(); m_viewport->set_body_hidden(false); // the ghost replaced them; give them back - set_status(StatusKind::Error, _L("Mate needs at least two CoordSys features")); + set_status(StatusKind::Warning, _L("Mate needs two coordinate systems — create them first")); } else if (same) { m_viewport->clear_preview(); m_viewport->set_body_hidden(false); - set_status(StatusKind::Error, _L("Mate: CS A and CS B must be different")); + set_status(StatusKind::Error, _L("Mate: A and B must be different coordinate systems")); } else { sync_body_xform(); // same reason as the solid path below: drop stale per-body poses const int cs_a = int(reinterpret_cast(m_mate_cs_a->GetClientData(sel_a))); @@ -10880,10 +10895,12 @@ void DesignPanel::open_tool(Tool t) else if (m_extrude_sketch_ref >= 0 && m_extrude_sketch_ref < int(m_doc.features.size())) m_extrude_sketch_label->SetLabel(_L("Sketch: ") + wxString::FromUTF8(m_doc.features[m_extrude_sketch_ref].name)); - // A fresh extrude defaults to New body — even when other bodies exist — so - // overlapping extrudes stay SEPARATE solids instead of silently fusing. Joining - // is opt-in (pick "Join"). Engraving art onto a face still defaults to Cut. - // (Edit-mode keeps the feature's stored mode, set below.) + // The default is inferred from where the profile is (charter L6: most extrudes join). + // A profile drawn on or touching a solid joins THAT body; a pushed/pulled face joins + // its own body; a profile in free space is a New body, so overlapping extrudes are + // never silently fused into something they do not touch. Engraving art onto a face + // still defaults to Cut. (Edit-mode keeps the feature's stored mode, set below.) + m_extrude_auto_body = -1; if (m_edit_index < 0) { const bool on_face_import = m_extrude_sketch_ref >= 0 && m_extrude_sketch_ref < int(m_doc.features.size()) @@ -10891,8 +10908,11 @@ void DesignPanel::open_tool(Tool t) if (on_face_import) { m_mode->SetSelection(2); // Cut — engrave into the face m_flip->SetValue(true); // extrude inward (the face normal points out) + } else if (m_extrude_face_src >= 0) { + m_mode->SetSelection(1); // Join — push/pull grows the face's own body } else { - m_mode->SetSelection(0); // New body (was: Add when a body already existed) + m_extrude_auto_body = m_doc.body_touching_sketch(m_extrude_sketch_ref); + m_mode->SetSelection(m_extrude_auto_body >= 0 ? 1 : 0); // Join : New body } } } @@ -10921,7 +10941,7 @@ void DesignPanel::open_tool(Tool t) case Tool::Boolean: m_hdr_boolean->SetLabel(title(_L("Boolean"))); break; case Tool::Cut: m_hdr_cut->SetLabel(title(_L("Cut"))); break; case Tool::Axis: m_hdr_axis->SetLabel(title(_L("Axis"))); break; - case Tool::CoordSys: m_hdr_coordsys->SetLabel(title(_L("Coord Sys"))); break; + case Tool::CoordSys: m_hdr_coordsys->SetLabel(title(_L("Coordinate system"))); break; case Tool::SurfaceExtrude: m_hdr_surf_extrude->SetLabel(title(_L("Surface Extrude"))); break; case Tool::SurfaceRevolve: m_hdr_surf_revolve->SetLabel(title(_L("Surface Revolve"))); break; case Tool::SurfaceLoft: m_hdr_surf_loft->SetLabel(title(_L("Surface Loft"))); break; diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index 34de9258aa..b7161fdb3a 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -128,6 +128,7 @@ private: void on_shape_changed(); void on_add_sketch(); + std::string feature_name(const wxString& kind) const; void on_add_extrude(); void on_add_dressup(); void on_add_hole(); @@ -528,6 +529,7 @@ private: wxStaticText* m_extrude_sketch_label{nullptr}; int m_extrude_sketch_ref{-1}; + int m_extrude_auto_body{-1}; // body the profile touches: the inferred Join target // Revolve controls (sweep a sketch profile about an in-plane axis). wxStaticText* m_revolve_sketch_label{nullptr}; diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 376392c23e..996a77c1a1 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -65,19 +65,9 @@ static double ray_segment_dist3(const Vec3d& ro, const Vec3d& rd, const Vec3d& a return wxPoint(int(sx + 0.5), int(sy + 0.5)); } -// The kernel's weld tolerance follows the app preference, and it must be pushed at EVERY -// point that starts a sketch session: a Constrain session never passes through begin(), and -// it uses region_loops()/connected_loop(), which read the same tolerance. Pushing in one -// place only would leave those sessions on whatever the previous session set. -static void push_auto_close_pref() -{ - Slic3r::set_sketch_auto_close(wxGetApp().is_auto_close_sketch_loops()); -} - void DesignSketchTool::begin(const SketchPlane& plane, Mode mode) { m_sketch_redo.clear(); - push_auto_close_pref(); m_plane = plane; m_mode = mode; @@ -2451,7 +2441,6 @@ void DesignSketchTool::finish() void DesignSketchTool::begin_constrain(const SketchProfile& prof, const SketchPlane& plane) { - push_auto_close_pref(); m_plane = plane; m_mode = Mode::Constrain; m_points = prof.points; @@ -2466,7 +2455,6 @@ void DesignSketchTool::begin_constrain(const SketchProfile& prof, const SketchPl void DesignSketchTool::begin_constrain_entities(const std::vector& ents, const SketchPlane& plane) { - push_auto_close_pref(); m_plane = plane; m_mode = Mode::Constrain; m_constrain_entities = true; @@ -10422,7 +10410,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) // In-canvas edit-op tools (Fillet/Chamfer/Offset/Mirror): pick entities, then a // draggable arrow + editable value label (Mirror: a two-phase pick) drives a live - // ghost. A click on empty space confirms; right-click/Esc cancels the gesture. + // ghost. Enter or ✓ applies, Esc or right-click discards (charter 4.2). // Standalone Trim / Extend scissors: click a segment to cut it back to (Trim) or out to // (Extend) its nearest intersection with the other live entities. One cut per click; the // tool stays active for more cuts; right-click exits. Drag falls through so the camera can @@ -10502,7 +10490,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) // In-canvas transform tools (Move/Rotate/Scale/Array/PolarArray): pick subject // entities, then a single draggable handle + editable value label(s) drive a live - // ghost. A click on empty space confirms; right-click drops the gesture / exits. + // ghost. Enter or ✓ applies, Esc or right-click discards the pending transform. if (is_transform_mode()) { if (evt.Moving()) { screen_to_plane(canvas, evt, m_cursor); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.cpp b/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.cpp index 4e1a197a39..a72b19bb75 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.cpp @@ -2,6 +2,7 @@ #include "slic3r/GUI/GLCanvas3D.hpp" #include "slic3r/GUI/ImGuiWrapper.hpp" #include "slic3r/GUI/GUI.hpp" +#include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/Plater.hpp" #include "slic3r/GUI/GUI_ObjectList.hpp" #include "slic3r/GUI/NotificationManager.hpp" @@ -20,7 +21,11 @@ GLGizmoPrimitive::GLGizmoPrimitive(GLCanvas3D& parent, const std::string& icon_f bool GLGizmoPrimitive::on_init() { return true; } std::string GLGizmoPrimitive::on_get_name() const { return _u8L("Primitive"); } -bool GLGizmoPrimitive::on_is_activable() const { return true; } +// Part of the experimental CAD feature: built into every CAD build, but offered in the Prepare +// toolbar only when that feature is switched on in Preferences — switched off, Prepare must be +// exactly what it is without it. +bool GLGizmoPrimitive::on_is_activable() const { return wxGetApp().is_enable_cad_feature(); } +bool GLGizmoPrimitive::on_is_selectable() const { return wxGetApp().is_enable_cad_feature(); } void GLGizmoPrimitive::on_render() {} void GLGizmoPrimitive::on_set_state() { if (m_state == EState::On) { m_params = PrimitiveParams{}; m_preview_dirty = true; } } @@ -80,14 +85,15 @@ void GLGizmoPrimitive::on_render_input_window(float x, float y, float bottom_lim | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar); - if (ImGui::CollapsingHeader("Shape", ImGuiTreeNodeFlags_DefaultOpen)) { - static const char* names[] = {"Box", "Cylinder", "Sphere", "Cone", "Torus"}; + if (ImGui::CollapsingHeader(_u8L("Shape").c_str(), ImGuiTreeNodeFlags_DefaultOpen)) { + const std::string names_s[] = {_u8L("Box"), _u8L("Cylinder"), _u8L("Sphere"), _u8L("Cone"), _u8L("Torus")}; + const char* names[] = {names_s[0].c_str(), names_s[1].c_str(), names_s[2].c_str(), names_s[3].c_str(), names_s[4].c_str()}; int cur = (int)m_params.type; if (ImGui::Combo("##type", &cur, names, (int)PrimitiveType::COUNT)) { m_params.type = (PrimitiveType)cur; m_preview_dirty = true; } - ImGui::Text("Quick:"); + ImGui::TextUnformatted(_u8L("Quick:").c_str()); ImGui::SameLine(); if (ImGui::SmallButton("10mm")) apply_preset("10mm cube", 10, 10, 10); ImGui::SameLine(); @@ -98,7 +104,7 @@ void GLGizmoPrimitive::on_render_input_window(float x, float y, float bottom_lim ImGui::Separator(); - if (ImGui::CollapsingHeader("Dimensions", ImGuiTreeNodeFlags_DefaultOpen)) { + if (ImGui::CollapsingHeader(_u8L("Dimensions").c_str(), ImGuiTreeNodeFlags_DefaultOpen)) { auto dim = [&](const char* label, double& val, double step=0.5, double fast=5.0) { ImGui::SetNextItemWidth(130); if (ImGui::InputDouble(label, &val, step, fast, "%.1f mm")) m_preview_dirty = true; @@ -106,25 +112,25 @@ void GLGizmoPrimitive::on_render_input_window(float x, float y, float bottom_lim }; switch (m_params.type) { case PrimitiveType::Box: - dim("Width (X)", m_params.box_w); - dim("Depth (Y)", m_params.box_d); - dim("Height (Z)", m_params.box_h); + dim(_u8L("Width (X)").c_str(), m_params.box_w); + dim(_u8L("Depth (Y)").c_str(), m_params.box_d); + dim(_u8L("Height (Z)").c_str(), m_params.box_h); break; case PrimitiveType::Cylinder: - dim("Radius", m_params.cyl_radius); - dim("Height", m_params.cyl_height); + dim(_u8L("Radius").c_str(), m_params.cyl_radius); + dim(_u8L("Height").c_str(), m_params.cyl_height); break; case PrimitiveType::Sphere: - dim("Radius", m_params.sph_radius); + dim(_u8L("Radius").c_str(), m_params.sph_radius); break; case PrimitiveType::Cone: - dim("Bottom R", m_params.cone_r1); - dim("Top R", m_params.cone_r2); - dim("Height", m_params.cone_height); + dim(_u8L("Bottom R").c_str(), m_params.cone_r1); + dim(_u8L("Top R").c_str(), m_params.cone_r2); + dim(_u8L("Height").c_str(), m_params.cone_height); break; case PrimitiveType::Torus: - dim("Major R", m_params.torus_r1); - dim("Minor R", m_params.torus_r2, 0.1, 1.0); + dim(_u8L("Major R").c_str(), m_params.torus_r1); + dim(_u8L("Minor R").c_str(), m_params.torus_r2, 0.1, 1.0); break; default: break; } @@ -132,26 +138,28 @@ void GLGizmoPrimitive::on_render_input_window(float x, float y, float bottom_lim ImGui::Separator(); - if (ImGui::CollapsingHeader("Fillet / Chamfer")) { - ImGui::Checkbox("Enable", &m_params.dressup_enabled); + if (ImGui::CollapsingHeader(_u8L("Fillet / Chamfer").c_str())) { + ImGui::Checkbox(_u8L("Enable").c_str(), &m_params.dressup_enabled); if (m_params.dressup_enabled) { - static const char* dn[] = {"Fillet", "Chamfer"}; + const std::string dn_s[] = {_u8L("Fillet"), _u8L("Chamfer")}; + const char* dn[] = {dn_s[0].c_str(), dn_s[1].c_str()}; int du = (int)m_params.dressup_type; ImGui::SetNextItemWidth(100); if (ImGui::Combo("##dtype", &du, dn, 2)) { m_params.dressup_type = (DressUpType)du; m_preview_dirty = true; } - static const char* fn[] = {"All edges", "Top edges", "Bottom edges", "Lateral edges"}; + const std::string fn_s[] = {_u8L("All edges"), _u8L("Top edges"), _u8L("Bottom edges"), _u8L("Lateral edges")}; + const char* fn[] = {fn_s[0].c_str(), fn_s[1].c_str(), fn_s[2].c_str(), fn_s[3].c_str()}; int fg = (int)m_params.dressup_faces; ImGui::SetNextItemWidth(140); - if (ImGui::Combo("Edges", &fg, fn, 4)) { m_params.dressup_faces = (FaceGroup)fg; m_preview_dirty = true; } + if (ImGui::Combo(_u8L("Edges").c_str(), &fg, fn, 4)) { m_params.dressup_faces = (FaceGroup)fg; m_preview_dirty = true; } if (m_params.dressup_type == DressUpType::Fillet) { ImGui::SetNextItemWidth(100); - if (ImGui::InputDouble("Radius", &m_params.dressup_radius, 0.1, 1.0, "%.1f mm")) { + if (ImGui::InputDouble(_u8L("Radius").c_str(), &m_params.dressup_radius, 0.1, 1.0, "%.1f mm")) { if (m_params.dressup_radius < 0.1) m_params.dressup_radius = 0.1; m_preview_dirty = true; } } else { ImGui::SetNextItemWidth(100); - if (ImGui::InputDouble("Distance", &m_params.dressup_chamfer_dist, 0.1, 1.0, "%.1f mm")) { + if (ImGui::InputDouble(_u8L("Distance").c_str(), &m_params.dressup_chamfer_dist, 0.1, 1.0, "%.1f mm")) { if (m_params.dressup_chamfer_dist < 0.1) m_params.dressup_chamfer_dist = 0.1; m_preview_dirty = true; } @@ -161,9 +169,9 @@ void GLGizmoPrimitive::on_render_input_window(float x, float y, float bottom_lim ImGui::Separator(); - if (ImGui::CollapsingHeader("Quality")) { + if (ImGui::CollapsingHeader(_u8L("Quality").c_str())) { ImGui::SetNextItemWidth(130); - if (ImGui::InputDouble("Mesh resolution", &m_params.linear_deflection, 0.001, 0.1, "%.3f mm")) { + if (ImGui::InputDouble(_u8L("Mesh resolution").c_str(), &m_params.linear_deflection, 0.001, 0.1, "%.3f mm")) { if (m_params.linear_deflection < 0.001) m_params.linear_deflection = 0.001; if (m_params.linear_deflection > 1.0) m_params.linear_deflection = 1.0; m_preview_dirty = true; @@ -172,10 +180,10 @@ void GLGizmoPrimitive::on_render_input_window(float x, float y, float bottom_lim ImGui::Separator(); - if (ImGui::Button("Add Shape", {-1, 28})) + if (ImGui::Button(_u8L("Add Shape").c_str(), {-1, 28})) apply_primitive(); - if (ImGui::Button("Close", {-1, 0})) + if (ImGui::Button(_u8L("Close").c_str(), {-1, 0})) m_parent.reset_all_gizmos(); GizmoImguiEnd(); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.hpp b/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.hpp index f78289a58d..0ead6ae5bb 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPrimitive.hpp @@ -20,6 +20,7 @@ protected: bool on_init() override; std::string on_get_name() const override; bool on_is_activable() const override; + bool on_is_selectable() const override; void on_render() override; void on_set_state() override; CommonGizmosDataID on_get_requirements() const override; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSketch.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSketch.cpp index 195ceba713..b878daa1e2 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSketch.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSketch.cpp @@ -2,6 +2,7 @@ #include "slic3r/GUI/GLCanvas3D.hpp" #include "slic3r/GUI/ImGuiWrapper.hpp" #include "slic3r/GUI/GUI.hpp" +#include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/Plater.hpp" #include "slic3r/GUI/GUI_ObjectList.hpp" #include "slic3r/GUI/NotificationManager.hpp" @@ -15,8 +16,6 @@ #endif #include -#define UL(s) Slic3r::GUI::I18N::translate_utf8((s)).c_str() - namespace Slic3r { namespace GUI { @@ -25,7 +24,11 @@ GLGizmoSketch::GLGizmoSketch(GLCanvas3D& parent, const std::string& icon_filenam bool GLGizmoSketch::on_init() { return true; } std::string GLGizmoSketch::on_get_name() const { return _u8L("Sketch"); } -bool GLGizmoSketch::on_is_activable() const { return true; } +// Part of the experimental CAD feature: built into every CAD build, but offered in the Prepare +// toolbar only when that feature is switched on in Preferences — switched off, Prepare must be +// exactly what it is without it. +bool GLGizmoSketch::on_is_activable() const { return wxGetApp().is_enable_cad_feature(); } +bool GLGizmoSketch::on_is_selectable() const { return wxGetApp().is_enable_cad_feature(); } void GLGizmoSketch::on_render() {} void GLGizmoSketch::on_set_state() { if (m_state == EState::On) clear_all(); } bool GLGizmoSketch::on_mouse(const wxMouseEvent&) { return false; } @@ -257,8 +260,9 @@ void GLGizmoSketch::on_render_input_window(float x, float y, float bottom_limit) | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar); - if (ImGui::CollapsingHeader(UL("Profile"), ImGuiTreeNodeFlags_DefaultOpen)) { - static const char* names[] = {"Line", "Rectangle", "Circle", "Polygon"}; + if (ImGui::CollapsingHeader(_u8L("Profile").c_str(), ImGuiTreeNodeFlags_DefaultOpen)) { + const std::string names_s[] = {_u8L("Line"), _u8L("Rectangle"), _u8L("Circle"), _u8L("Polygon")}; + const char* names[] = {names_s[0].c_str(), names_s[1].c_str(), names_s[2].c_str(), names_s[3].c_str()}; int cur = (int)m_tool; if (ImGui::Combo("##shape", &cur, names, (int)SketchTool::COUNT)) { m_tool = (SketchTool)cur; @@ -266,39 +270,40 @@ void GLGizmoSketch::on_render_input_window(float x, float y, float bottom_limit) } ImGui::SameLine(); if (m_imgui->button("+##newprofile")) m_active_profile = -1; - if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", UL("Start new profile (for holes)")); + if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", _u8L("Start new profile (for holes)").c_str()); if (m_tool == SketchTool::Rectangle) { - ImGui::SetNextItemWidth(80); if (ImGui::InputDouble("W", &m_rect_w,1,10,"%.0f")) build_preset_profile(); + ImGui::SetNextItemWidth(80); if (ImGui::InputDouble(_u8L("Width").c_str(), &m_rect_w,1,10,"%.0f")) build_preset_profile(); ImGui::SameLine(); - ImGui::SetNextItemWidth(80); if (ImGui::InputDouble("H", &m_rect_h,1,10,"%.0f")) build_preset_profile(); + ImGui::SetNextItemWidth(80); if (ImGui::InputDouble(_u8L("Height").c_str(), &m_rect_h,1,10,"%.0f")) build_preset_profile(); } else if (m_tool == SketchTool::Circle) { - ImGui::SetNextItemWidth(80); if (ImGui::InputDouble("R", &m_circle_r,1,5,"%.0f")) build_preset_profile(); + ImGui::SetNextItemWidth(80); if (ImGui::InputDouble(_u8L("Radius").c_str(), &m_circle_r,1,5,"%.0f")) build_preset_profile(); ImGui::SameLine(); - ImGui::SetNextItemWidth(80); if (ImGui::SliderInt("Seg", &m_circle_seg,8,64)) build_preset_profile(); + ImGui::SetNextItemWidth(80); if (ImGui::SliderInt(_u8L("Segments").c_str(), &m_circle_seg,8,64)) build_preset_profile(); } else if (m_tool == SketchTool::Polygon) { - ImGui::SetNextItemWidth(80); if (ImGui::SliderInt("Sides", &m_poly_sides,3,12)) build_preset_profile(); + ImGui::SetNextItemWidth(80); if (ImGui::SliderInt(_u8L("Sides").c_str(), &m_poly_sides,3,12)) build_preset_profile(); ImGui::SameLine(); - ImGui::SetNextItemWidth(80); if (ImGui::InputDouble("R", &m_poly_r,1,5,"%.0f")) build_preset_profile(); + ImGui::SetNextItemWidth(80); if (ImGui::InputDouble((_u8L("Radius") + "##poly").c_str(), &m_poly_r,1,5,"%.0f")) build_preset_profile(); } else { - ImGui::Text("%s", UL("Click on canvas to draw")); + ImGui::Text("%s", _u8L("Click on canvas to draw").c_str()); } - ImGui::Checkbox(UL("Snap to grid"), &m_snap_grid); + ImGui::Checkbox(_u8L("Snap to grid").c_str(), &m_snap_grid); ImGui::SameLine(); - ImGui::SetNextItemWidth(80); ImGui::InputFloat("Step", &m_grid_step, 1, 5, "%.0f mm"); + ImGui::SetNextItemWidth(80); ImGui::InputFloat(_u8L("Grid step").c_str(), &m_grid_step, 1, 5, "%.0f mm"); draw_canvas(); if (!m_profiles.empty()) { - ImGui::Text("%s: %zu", UL("Profiles"), m_profiles.size()); + ImGui::Text("%s: %zu", _u8L("Profiles").c_str(), m_profiles.size()); for (int i = 0; i < (int)m_profiles.size(); ++i) { auto& p = m_profiles[i]; ImGui::PushID(i); bool outer = (i == 0); ImVec4 col = outer ? ImVec4(0,1,0,1) : ImVec4(1,0.3f,0.3f,1); - const char* label = outer ? "Outer" : "Hole"; - ImGui::TextColored(col, "%s %d: %zu pts %s", label, i+1, p.points.size(), p.closed ? "CLOSED" : ""); + const std::string label = outer ? _u8L("Outer") : _u8L("Hole"); + ImGui::TextColored(col, "%s %d: %zu %s %s", label.c_str(), i+1, p.points.size(), + _u8L("points").c_str(), p.closed ? _u8L("closed").c_str() : ""); ImGui::SameLine(); if (ImGui::SmallButton("X")) delete_profile(i); ImGui::PopID(); @@ -311,59 +316,63 @@ void GLGizmoSketch::on_render_input_window(float x, float y, float bottom_limit) bool is_revolve = false; bool has_sel = false; - if (ImGui::CollapsingHeader(UL("Operation"), ImGuiTreeNodeFlags_DefaultOpen)) { + if (ImGui::CollapsingHeader(_u8L("Operation").c_str(), ImGuiTreeNodeFlags_DefaultOpen)) { static int pi = 0; - if (ImGui::Combo(UL("Plane"), &pi, "XY (Top)\0XZ (Front)\0YZ (Side)\0")) + const std::string planes = "XY (" + _u8L("Top") + ")" + std::string(1, '\0') + "XZ (" + _u8L("Front") + ")" + + std::string(1, '\0') + "YZ (" + _u8L("Side") + ")" + std::string(2, '\0'); + if (ImGui::Combo(_u8L("Plane").c_str(), &pi, planes.c_str())) m_plane = (pi==0) ? SketchPlane::XY() : (pi==1) ? SketchPlane::XZ() : SketchPlane::YZ(); is_revolve = (m_sp.revolve_deg > 0 && m_sp.revolve_deg < 360); ImGui::SetNextItemWidth(100); - if (ImGui::InputDouble(UL("Revolve deg"), &m_sp.revolve_deg, 15, 90, "%.0f")) { + if (ImGui::InputDouble(_u8L("Revolve deg").c_str(), &m_sp.revolve_deg, 15, 90, "%.0f")) { if (m_sp.revolve_deg > 360) m_sp.revolve_deg = 360; if (m_sp.revolve_deg < 0) m_sp.revolve_deg = 0; } - if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", UL("Set to 0 for extrude, >0 for revolve")); + if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", _u8L("Set to 0 for extrude, >0 for revolve").c_str()); if (!is_revolve) { ImGui::SetNextItemWidth(100); - ImGui::InputDouble(UL("Length"), &m_sp.extrude_len, 0.5, 5, "%.1f mm"); + ImGui::InputDouble(_u8L("Length").c_str(), &m_sp.extrude_len, 0.5, 5, "%.1f mm"); ImGui::SameLine(); - ImGui::Checkbox(UL("Symmetric"), &m_sp.extrude_sym); + ImGui::Checkbox(_u8L("Symmetric").c_str(), &m_sp.extrude_sym); } has_sel = !m_parent.get_selection().is_empty(); if (has_sel) { - if (ImGui::Checkbox(UL("Pocket (cut)"), &m_sp.is_pocket)) + if (ImGui::Checkbox(_u8L("Pocket (cut)").c_str(), &m_sp.is_pocket)) if (m_sp.is_pocket) m_sp.dressup_enabled = false; } else m_sp.is_pocket = false; } ImGui::Separator(); - if (!m_sp.is_pocket && ImGui::CollapsingHeader(UL("Fillet / Chamfer"))) { - ImGui::Checkbox(UL("Enable"), &m_sp.dressup_enabled); + if (!m_sp.is_pocket && ImGui::CollapsingHeader(_u8L("Fillet / Chamfer").c_str())) { + ImGui::Checkbox(_u8L("Enable").c_str(), &m_sp.dressup_enabled); if (m_sp.dressup_enabled) { - static const char* dn[] = {"Fillet", "Chamfer"}; + const std::string dn_s[] = {_u8L("Fillet"), _u8L("Chamfer")}; + const char* dn[] = {dn_s[0].c_str(), dn_s[1].c_str()}; int du = (int)m_sp.dressup_type; ImGui::SetNextItemWidth(100); if (ImGui::Combo("##dtype", &du, dn, 2)) m_sp.dressup_type = (DressUpType)du; - static const char* fn[] = {"All edges", "Top edges", "Bottom edges", "Lateral edges"}; + const std::string fn_s[] = {_u8L("All edges"), _u8L("Top edges"), _u8L("Bottom edges"), _u8L("Lateral edges")}; + const char* fn[] = {fn_s[0].c_str(), fn_s[1].c_str(), fn_s[2].c_str(), fn_s[3].c_str()}; int fg = (int)m_sp.dressup_faces; ImGui::SetNextItemWidth(140); - ImGui::Combo(UL("Edges"), &fg, fn, 4); m_sp.dressup_faces = (FaceGroup)fg; + ImGui::Combo(_u8L("Edges").c_str(), &fg, fn, 4); m_sp.dressup_faces = (FaceGroup)fg; ImGui::SetNextItemWidth(100); if (m_sp.dressup_type == DressUpType::Fillet) - ImGui::InputDouble(UL("Radius"), &m_sp.dressup_radius, 0.1, 1, "%.1f mm"); + ImGui::InputDouble(_u8L("Radius").c_str(), &m_sp.dressup_radius, 0.1, 1, "%.1f mm"); else - ImGui::InputDouble(UL("Distance"), &m_sp.dressup_chamfer_dist, 0.1, 1, "%.1f mm"); + ImGui::InputDouble(_u8L("Distance").c_str(), &m_sp.dressup_chamfer_dist, 0.1, 1, "%.1f mm"); } } ImGui::Separator(); bool ok = has_closed_profile(); - if (ok) ImGui::TextColored({0,1,0,1}, "%zu %s", m_profiles.size(), UL("closed profile(s)")); - else ImGui::TextColored({0.6f,0.6f,0.6f,1}, "%s", UL("Draw a closed profile to enable")); + if (ok) ImGui::TextColored({0,1,0,1}, "%zu %s", m_profiles.size(), _u8L("closed profile(s)").c_str()); + else ImGui::TextColored({0.6f,0.6f,0.6f,1}, "%s", _u8L("Draw a closed profile to enable").c_str()); auto btn = [&](const char* label, bool enabled) { if (!enabled) { ImGui::PushItemFlag(ImGuiItemFlags_Disabled,true); ImGui::PushStyleColor(ImGuiCol_Button,{0.25f,0.25f,0.25f,1}); } @@ -373,14 +382,14 @@ void GLGizmoSketch::on_render_input_window(float x, float y, float bottom_limit) }; if (m_sp.is_pocket && has_sel) { - if (btn(_u8L("Pocket (Cut)").c_str(), ok)) apply_pocket(); + if (btn(_u8L("Pocket (cut)").c_str(), ok)) apply_pocket(); } else if (is_revolve) { if (btn(_u8L("Revolve").c_str(), ok)) apply_revolve(); } else { if (btn(_u8L("Extrude").c_str(), ok)) apply_extrude(); } - if (ImGui::Button(_u8L("Clear All").c_str(), {-1,0})) clear_all(); + if (ImGui::Button(_u8L("Clear all").c_str(), {-1,0})) clear_all(); if (ImGui::Button(_u8L("Close").c_str(), {-1,0})) m_parent.reset_all_gizmos(); GizmoImguiEnd(); @@ -448,7 +457,7 @@ void GLGizmoSketch::apply_pocket() mo->ensure_on_bed(); wxGetApp().plater()->update(); clear_all(); - wxGetApp().notification_manager()->push_notification(NotificationType::CustomNotification, NotificationManager::NotificationLevel::RegularNotificationLevel, UL("Pocket added (negative volume)")); + wxGetApp().notification_manager()->push_notification(NotificationType::CustomNotification, NotificationManager::NotificationLevel::RegularNotificationLevel, _u8L("Pocket added (negative volume)").c_str()); } catch (const std::exception& e) { wxGetApp().notification_manager()->push_notification(NotificationType::CustomNotification, NotificationManager::NotificationLevel::ErrorNotificationLevel, std::string("Pocket: ")+e.what()); } diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSketch.hpp b/src/slic3r/GUI/Gizmos/GLGizmoSketch.hpp index 5a4b59edfd..22c90f4929 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSketch.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSketch.hpp @@ -22,6 +22,7 @@ protected: bool on_init() override; std::string on_get_name() const override; bool on_is_activable() const override; + bool on_is_selectable() const override; void on_render() override; void on_set_state() override; CommonGizmosDataID on_get_requirements() const override; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 51fdba9bf8..e60f23fda5 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -10074,10 +10074,23 @@ std::vector Plater::priv::load_files(const std::vector& input_ // a user sees after opening a design they spent an hour on — it reads as "your work is gone" // when the recipe has in fact just been loaded and the Design tab will rehydrate it. Count a // recipe that came from THESE files as geometry. - if (tolal_model_count <= 0 && !loaded_cad_recipe && !q->m_exported_file) { + // + // Only where the Design tab can actually show it, though. With the CAD feature switched off + // (or not built) the recipe is still carried through to the next save, but nothing will + // display it, so an empty plate needs saying — and saying why. + bool cad_can_show = false; +#ifdef SLIC3R_CAD + cad_can_show = wxGetApp().is_enable_cad_feature(); +#endif + if (tolal_model_count <= 0 && !q->m_exported_file && (!loaded_cad_recipe || !cad_can_show)) { dlg.Hide(); if (!is_user_cancel) { - MessageDialog msg(wxGetApp().mainframe, _L("The file does not contain any geometry data."), _L("Warning"), wxYES | wxICON_WARNING); + const wxString text = loaded_cad_recipe + ? _L("This project contains a model made in the Design tab and no other geometry. " + "Enable \"CAD feature (experimental)\" in Preferences and restart to see and edit it; " + "it is kept when the project is saved.") + : _L("The file does not contain any geometry data."); + MessageDialog msg(wxGetApp().mainframe, text, _L("Warning"), wxYES | wxICON_WARNING); if (msg.ShowModal() == wxID_YES) {} } } diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index d9aedec79b..806d5d86ff 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -9,7 +9,6 @@ #include "I18N.hpp" #include "libslic3r/AppConfig.hpp" #include "libslic3r/Format/DRC.hpp" -#include "libslic3r/CAD/SketchEngine.hpp" #include #include "OG_CustomCtrl.hpp" #include "wx/graphics.h" @@ -1765,13 +1764,6 @@ void PreferencesDialog::create_items() "parametrically. This feature is experimental and still under development."), "enable_cad_feature", _L("(Requires restart)")); g_sizer->Add(item_cad_feature); - - auto item_auto_close_sketch_loops = create_item_checkbox(_L("Auto-close sketch loops"), - _L("Treat sketch endpoints within 0.001 mm as one joint and weld the loop shut. " - "Off: only exactly coincident endpoints join, so a loop with a tiny gap is " - "shown as open instead of being closed for you."), - "auto_close_sketch_loops"); - g_sizer->Add(item_auto_close_sketch_loops); #endif #if 0 @@ -1861,11 +1853,18 @@ void PreferencesDialog::create_items() "disc with a roll quadrant. A face's orientation is read without being learned. " "Turn this off for the conventional CAD representation."), "design_connector_face_glyph"); g_sizer->Add(item_connector_face_glyph); - } - // Push the weld preference into the kernel now so toggling it takes effect without - // a restart (the sketch tool also re-pushes on activation, see DesignSketchTool::begin). - Slic3r::set_sketch_auto_close(wxGetApp().is_auto_close_sketch_loops()); + // Saved WITH each design (it decides which loops are closed, i.e. what solid a project + // rebuilds into), so it applies to designs started from now on; an open design keeps + // the rule it was made with. + auto item_auto_close_sketch_loops = create_item_checkbox(_L("Auto-close sketch loops"), + _L("Treat sketch endpoints within 0.001 mm as one joint and weld the loop shut. " + "Off: only exactly coincident endpoints join, so a loop with a tiny gap is " + "shown as open instead of being closed for you. Saved with each design; " + "applies to designs started after the change."), + "auto_close_sketch_loops"); + g_sizer->Add(item_auto_close_sketch_loops); + } #endif std::vector ButtonDragActions = {_L("None"), _L("Pan"), _L("Rotate")}; diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index fed30c1e86..6b3327ee1d 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -8657,12 +8657,13 @@ TEST_CASE("Hole standards: inch sizes by either name, with their 82° countersin CHECK(doc.features[m].hole_cbore_diameter == 11.0); } -TEST_CASE("Body colours and names survive a save and a load", "[CadDocument][recipe]") +TEST_CASE("Body colours, the modeling origin and the weld rule survive a save and a load", "[CadDocument][recipe]") { CadDocument doc; const int sk = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 10, 10, 0, "S"); doc.add_extrude(sk, 5, false, BooleanMode::New, "E"); doc.modeling_origin = Vec3d(110, 120, 0); + doc.auto_close_loops = false; // the design's weld rule travels with it REQUIRE(doc.recompute()); doc.bodies[0].has_color = true; doc.bodies[0].color = ColorRGBA(0.1f, 0.2f, 0.3f, 1.0f); @@ -8675,6 +8676,9 @@ TEST_CASE("Body colours and names survive a save and a load", "[CadDocument][rec CHECK(std::abs(back.bodies[0].color.g() - 0.2f) < 1e-6); CHECK((back.modeling_origin - Vec3d(110, 120, 0)).norm() < 1e-9); // the project's own CHECK(back.origin_from_recipe); + CHECK_FALSE(back.auto_close_loops); + back.auto_close_loops = true; // leave the kernel's global as the other tests expect it + back.recompute(); } TEST_CASE("A new thread reads its radius as the nominal (major) radius", "[CadDocument][thread]") @@ -8692,3 +8696,26 @@ TEST_CASE("A new thread reads its radius as the nominal (major) radius", "[CadDo CHECK_FALSE(doc.recompute()); CHECK(doc.error.find("thread") != std::string::npos); } + +TEST_CASE("CadDocument: a profile on a body face touches it, one in free space does not", "[CadDocument]") +{ + // The Extrude default reads this: a profile drawn on a body joins it (charter L6). + CadDocument doc; + const int base = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 20, 20, 10, "Base"); + doc.add_extrude(base, 5.0, false, BooleanMode::New, "Block"); + REQUIRE(doc.recompute()); + REQUIRE(doc.bodies.size() == 1); + + SketchPlane top = SketchPlane::XY(); + top.origin = Vec3d(0, 0, 5); // the block's top face + const int on_face = doc.add_sketch(SketchShape::Rectangle, top, 6, 6, 3, "Boss"); + SketchPlane above = SketchPlane::XY(); + above.origin = Vec3d(0, 0, 30); // well clear of the block + const int in_air = doc.add_sketch(SketchShape::Rectangle, above, 6, 6, 3, "Floating"); + REQUIRE(doc.recompute()); + + CHECK(doc.body_touching_sketch(on_face) == 0); + CHECK(doc.body_touching_sketch(in_air) == -1); + CHECK(doc.body_touching_sketch(-1) == -1); + CHECK(doc.body_touching_sketch(base + 1) == -1); // the extrude: not a sketch +} From 205bc1b332923759fbb28059b28c2ecb2ca0b32a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 28 Sep 2026 18:09:17 +0000 Subject: [PATCH 142/389] Design tab: Text dialog with font, height and live outline; offer header - Text opens a dialog instead of a bare text entry: any installed font (bold, italic), the height in mm, and a live outline of exactly what will be inserted with its size. Enter inserts, Esc cancels; the last font and height are remembered. text_to_regions gains an overload taking a loaded font. - The offer menu opens with a greyed title naming what the rows act on ("Flat face 4 of Body 2", "Sketch line", "Nothing selected"). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- docs/CAD/design_tab.md | 7 + localization/i18n/list.txt | 1 + src/libslic3r/CAD/SketchImport.cpp | 16 +- src/libslic3r/CAD/SketchImport.hpp | 8 + src/slic3r/CMakeLists.txt | 2 + src/slic3r/GUI/CAD/DesignPanel.cpp | 57 +++++- src/slic3r/GUI/CAD/DesignPanel.hpp | 1 + src/slic3r/GUI/CAD/DesignTextDialog.cpp | 223 ++++++++++++++++++++++++ src/slic3r/GUI/CAD/DesignTextDialog.hpp | 59 +++++++ 9 files changed, 361 insertions(+), 13 deletions(-) create mode 100644 src/slic3r/GUI/CAD/DesignTextDialog.cpp create mode 100644 src/slic3r/GUI/CAD/DesignTextDialog.hpp diff --git a/docs/CAD/design_tab.md b/docs/CAD/design_tab.md index 80a94373f6..2270909bcc 100644 --- a/docs/CAD/design_tab.md +++ b/docs/CAD/design_tab.md @@ -60,6 +60,9 @@ pointing at things stays quiet. The offer also opens by itself the moment you press Sketch on a face or plane, showing the sketch tools — the app hands you the tools directly. +The first line names what the rows act on — *"Flat face 4 of Body 2"*, *"Sketch line"*, +*"Nothing selected"* — so the menu is readable even when the selection is not under the cursor. + **Eight families, always in this fixed order:** Create, Add material, Remove, Dress-up, Repeat, Transform, Reference, Modify. @@ -302,6 +305,10 @@ variable and the whole model follows. ## Import and export +**Text** asks for the words, the font (any installed font, bold, italic) and the height, and +shows the outline that will be inserted with its size in millimetres before anything is added. +The last font and height are remembered. + **Import STEP** brings in a real B-rep solid, not a mesh: its faces and edges can be filleted, shelled and cut like anything modelled here. diff --git a/localization/i18n/list.txt b/localization/i18n/list.txt index e95ec4e937..2e856c5620 100644 --- a/localization/i18n/list.txt +++ b/localization/i18n/list.txt @@ -301,6 +301,7 @@ src/slic3r/GUI/CAD/DesignPanel.cpp src/slic3r/GUI/CAD/DesignSketchTool.cpp src/slic3r/GUI/CAD/SketchInlineEditor.cpp src/slic3r/GUI/CAD/DesignOffer.hpp +src/slic3r/GUI/CAD/DesignTextDialog.cpp src/slic3r/GUI/Gizmos/GLGizmoPrimitive.cpp src/slic3r/GUI/Gizmos/GLGizmoSketch.cpp src/slic3r/GUI/KeyChord.cpp diff --git a/src/libslic3r/CAD/SketchImport.cpp b/src/libslic3r/CAD/SketchImport.cpp index 7140776603..21c03a259a 100644 --- a/src/libslic3r/CAD/SketchImport.cpp +++ b/src/libslic3r/CAD/SketchImport.cpp @@ -67,12 +67,18 @@ ImportRegions text_to_regions(const std::string& utf8, double size_mm, return {}; const std::string path = font_path.empty() ? default_font_path() : font_path; - std::unique_ptr ff = Emboss::create_font_file(path.c_str()); - if (!ff) - return {}; - Emboss::FontFileWithCache fwc(std::move(ff)); - if (!fwc.has_value()) + return text_to_regions(utf8, size_mm, + std::shared_ptr(Emboss::create_font_file(path.c_str()))); +} + +ImportRegions text_to_regions(const std::string& utf8, double size_mm, + const std::shared_ptr& ff) +{ + if (utf8.empty() || size_mm <= 0.0 || !ff) return {}; + Emboss::FontFileWithCache fwc; + fwc.font_file = ff; + fwc.cache = std::make_shared(); FontProp prop(static_cast(size_mm)); // per_glyph=false HealedExPolygons healed = Emboss::text2shapes(fwc, utf8.c_str(), prop); diff --git a/src/libslic3r/CAD/SketchImport.hpp b/src/libslic3r/CAD/SketchImport.hpp index 0873b0b861..5b720f3892 100644 --- a/src/libslic3r/CAD/SketchImport.hpp +++ b/src/libslic3r/CAD/SketchImport.hpp @@ -3,11 +3,14 @@ #include "libslic3r/Point.hpp" // Vec2d +#include #include #include namespace Slic3r { +namespace Emboss { struct FontFile; } + // A rigid imported region: contour[0] = outer loop, contour[1..] = holes; // points in plane (u,v) millimetres. The nested vector type matches // CadFeature::imported_regions exactly, so results assign directly. @@ -19,6 +22,11 @@ using ImportRegions = std::vector; // font (resources/fonts). Returns an empty vector on any failure. ImportRegions text_to_regions(const std::string& utf8, double size_mm, const std::string& font_path = std::string()); +// Same, from an already loaded font — the GUI resolves a system font (face, bold, italic) +// to one and keeps it while the user types. Returns an empty vector when the font is null or +// yields no shape. +ImportRegions text_to_regions(const std::string& utf8, double size_mm, + const std::shared_ptr& font); // Parse an SVG file's filled paths into regions (mm), centred on the origin. // `scale` multiplies the authored size (1.0 = as authored). Returns an empty diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index f6a8249d4f..13129781b1 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -820,6 +820,8 @@ if (SLIC3R_CAD) list(APPEND SLIC3R_GUI_SOURCES GUI/CAD/DesignPanel.cpp GUI/CAD/DesignPanel.hpp + GUI/CAD/DesignTextDialog.cpp + GUI/CAD/DesignTextDialog.hpp GUI/CAD/DesignCanvas.cpp GUI/CAD/DesignCanvas.hpp GUI/CAD/DesignSketchTool.cpp diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index aef3d3e0a8..1cf84e5849 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -1,6 +1,7 @@ #include "slic3r/GUI/CAD/DesignPanel.hpp" #include "slic3r/GUI/CAD/DesignCanvas.hpp" #include "slic3r/GUI/CAD/DesignSketchTool.hpp" +#include "slic3r/GUI/CAD/DesignTextDialog.hpp" // Text: font, height, live outline #include "slic3r/GUI/CAD/DesignOffer.hpp" // generated offer table — see docs/ux/tool_atlas.json #include "libslic3r/CAD/GeometryEngine.hpp" // face_by_index for face-extrude gizmo anchor #include "libslic3r/TriangleMesh.hpp" // mesh import: STL/OBJ -> indexed_triangle_set @@ -4562,15 +4563,12 @@ void DesignPanel::sync_sketch_display() void DesignPanel::on_add_text() { - wxTextEntryDialog dlg(this, _L("Text to insert:"), _L("Text"), wxEmptyString); - if (dlg.ShowModal() != wxID_OK) + // Font, height and a live outline with its size are chosen up front; the bbox handles + // (Move/Scale) still resize the art in the canvas afterwards. + DesignTextDialog dlg(this); + if (dlg.ShowModal() != wxID_OK || dlg.regions().empty()) return; - const wxString text = dlg.GetValue(); - if (text.empty()) - return; - const std::string utf8(text.ToUTF8().data()); - // Insert at a default height; resize in-canvas via the bbox handles (Move/Scale). - add_imported_sketch(text_to_regions(utf8, 10.0), _L("Text")); + add_imported_sketch(dlg.regions(), _L("Text")); } void DesignPanel::on_import_svg() @@ -6369,6 +6367,38 @@ static void offer_trace(const char* fmt, ...) fflush(stderr); } +// The offer menu's title line for selection `kind` (an OfferSel), or empty for none. +wxString DesignPanel::offer_header(int kind) const +{ + const int nb = int(m_doc.bodies.size()); + auto body = [&]() { + if (m_sel_solid_body < 0 || m_sel_solid_body >= nb) return wxString(); + const std::string& n = m_doc.bodies[m_sel_solid_body].name; + return n.empty() ? wxString::Format(_L("Body %d"), m_sel_solid_body + 1) : wxString::FromUTF8(n); + }; + switch (OfferSel(kind)) { + case OfferSel::None: return _L("Nothing selected"); + case OfferSel::BodySolid: return wxString::Format(_L("%s — solid body"), body()); + case OfferSel::BodySheet: return wxString::Format(_L("%s — surface body"), body()); + case OfferSel::FacePlanar: return wxString::Format(_L("Flat face %d of %s"), m_sel_solid_face, body()); + case OfferSel::FaceCyl: return wxString::Format(_L("Cylindrical face %d of %s"), m_sel_solid_face, body()); + case OfferSel::FaceOther: return wxString::Format(_L("Face %d of %s"), m_sel_solid_face, body()); + case OfferSel::EdgeStr: return wxString::Format(_L("Straight edge %d of %s"), m_sel_solid_edge, body()); + case OfferSel::EdgeCirc: return wxString::Format(_L("Circular edge %d of %s"), m_sel_solid_edge, body()); + case OfferSel::Vertex: return wxString::Format(_L("Vertex of %s"), body()); + case OfferSel::SkLoop: return _L("Sketch profile"); + case OfferSel::SkNone: return _L("Sketch — nothing selected"); + case OfferSel::SkLine: return _L("Sketch line"); + case OfferSel::SkArc: return _L("Sketch curve"); + case OfferSel::SkPoint: return _L("Sketch point"); + case OfferSel::Sk2Ent: { + const int n = m_viewport ? m_viewport->sketch_selection_count() : 0; + return wxString::Format(_L("%d sketch entities"), n); + } + default: return wxString(); + } +} + void DesignPanel::show_offer_menu(const wxPoint& screen_pos) { const int kind = offer_selection_kind(); @@ -6420,6 +6450,17 @@ void DesignPanel::show_offer_menu(const wxPoint& screen_pos) std::vector bound; // menu id offset -> verb const int base = wxID_HIGHEST + 4200; + // Header: WHAT the rows below act on, named the way the tree and the cards name it. The rows + // only make sense against the selection, and the selection is not always visible under the + // cursor that opened the menu. Greyed, so it reads as a title and cannot be run. + { + const wxString head = offer_header(kind); + if (!head.empty()) { + menu.Append(wxID_ANY, head)->Enable(false); + menu.AppendSeparator(); + } + } + for (int row = 0; row < kOfferRowCount; ++row) { std::vector live, family; for (int i = 0; i < kOfferVerbCount; ++i) { diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index b7161fdb3a..9d4f274b17 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -755,6 +755,7 @@ private: // monitor, and the menu would map there — detached from the geometry it is about. wxPoint offer_anchor() const; int offer_selection_kind() const; // an OfferSel, as int to keep the header light + wxString offer_header(int kind) const; // the offer menu's title line for that selection // Does the SKETCH half of the map apply? A mode question, not a session one: begin_sketch // does not run until the first tool is armed, so between "press Sketch" and "pick a tool" // is_sketching() is still false — precisely when the drawing tools must be on offer. The diff --git a/src/slic3r/GUI/CAD/DesignTextDialog.cpp b/src/slic3r/GUI/CAD/DesignTextDialog.cpp new file mode 100644 index 0000000000..73fd8535e6 --- /dev/null +++ b/src/slic3r/GUI/CAD/DesignTextDialog.cpp @@ -0,0 +1,223 @@ +#include "DesignTextDialog.hpp" + +#include "slic3r/GUI/GUI_App.hpp" +#include "slic3r/GUI/I18N.hpp" +#include "slic3r/GUI/Widgets/DialogButtons.hpp" +#include "slic3r/Utils/WxFontUtils.hpp" +#include "libslic3r/AppConfig.hpp" +#include "libslic3r/Emboss.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace Slic3r { namespace GUI { + +static const char* kFontKey = "cad_text_font"; // WxFontUtils::store_wxFont descriptor +static const char* kHeightKey = "cad_text_height"; // mm + +DesignTextDialog::DesignTextDialog(wxWindow* parent) + : DPIDialog(parent, wxID_ANY, _L("Text"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE) +{ + SetFont(wxGetApp().normal_font()); + SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(0x2d, 0x2d, 0x31) : *wxWHITE); + const int em = em_unit(); + + // Last used font and height, else the system GUI font at 10 mm. + wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); + double height = 10.0; + if (AppConfig* cfg = wxGetApp().app_config) { + const std::string desc = cfg->get(kFontKey); + if (!desc.empty()) { + wxFont f = WxFontUtils::load_wxFont(desc); + if (f.IsOk()) font = f; + } + const std::string h = cfg->get(kHeightKey); + if (!h.empty()) { + try { height = std::clamp(std::stod(h), 0.5, 500.0); } catch (...) {} + } + } + + auto* form = new wxFlexGridSizer(2, em / 2, em); + form->AddGrowableCol(1, 1); + + m_text = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(30 * em, -1), + wxTE_PROCESS_ENTER); + m_text->SetHint(_L("Type the text to insert")); + form->Add(new wxStaticText(this, wxID_ANY, _L("Text")), 0, wxALIGN_CENTER_VERTICAL); + form->Add(m_text, 1, wxEXPAND); + + // Scalable faces only ('@' faces are the vertical-writing aliases GTK/MSW list twice). + wxArrayString faces = wxFontEnumerator::GetFacenames(wxFONTENCODING_SYSTEM, false); + faces.erase(std::remove_if(faces.begin(), faces.end(), [](const wxString& f) { return f.StartsWith("@"); }), + faces.end()); + faces.Sort(); + m_face = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, faces); + int sel = m_face->FindString(font.GetFaceName()); + m_face->SetSelection(sel != wxNOT_FOUND ? sel : 0); + form->Add(new wxStaticText(this, wxID_ANY, _L("Font")), 0, wxALIGN_CENTER_VERTICAL); + form->Add(m_face, 1, wxEXPAND); + + auto* style = new wxBoxSizer(wxHORIZONTAL); + m_bold = new wxCheckBox(this, wxID_ANY, _L("Bold")); + m_italic = new wxCheckBox(this, wxID_ANY, _L("Italic")); + m_bold->SetValue(WxFontUtils::is_bold(font)); + m_italic->SetValue(WxFontUtils::is_italic(font)); + style->Add(m_bold, 0, wxRIGHT, em); + style->Add(m_italic, 0); + form->AddSpacer(0); + form->Add(style, 0); + + m_height = new wxSpinCtrlDouble(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(10 * em, -1), + wxSP_ARROW_KEYS, 0.5, 500.0, height, 0.5); + m_height->SetDigits(1); + form->Add(new wxStaticText(this, wxID_ANY, _L("Height (mm)")), 0, wxALIGN_CENTER_VERTICAL); + form->Add(m_height, 0); + + // The outline of what will be inserted, fitted to the box, with its real size under it. + m_preview = new wxWindow(this, wxID_ANY, wxDefaultPosition, wxSize(30 * em, 10 * em)); + m_preview->SetBackgroundStyle(wxBG_STYLE_PAINT); + m_preview->Bind(wxEVT_PAINT, [this](wxPaintEvent&) { draw_preview(m_preview); }); + m_preview->Bind(wxEVT_SIZE, [this](wxSizeEvent& e) { m_preview->Refresh(); e.Skip(); }); + m_size = new wxStaticText(this, wxID_ANY, wxEmptyString); + + auto* buttons = new DialogButtons(this, {"OK", "Cancel"}); + m_ok = buttons->GetOK(); + + auto* top = new wxBoxSizer(wxVERTICAL); + top->Add(form, 0, wxEXPAND | wxALL, em); + top->Add(m_preview, 1, wxEXPAND | wxLEFT | wxRIGHT, em); + top->Add(m_size, 0, wxLEFT | wxRIGHT | wxTOP, em); + top->Add(buttons, 0, wxEXPAND); + + m_text->Bind(wxEVT_TEXT, [this](wxCommandEvent&) { update_preview(); }); + m_text->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent&) { + if (!m_regions.empty()) EndModal(wxID_OK); // Enter = OK, as everywhere in the tab + }); + auto refont = [this](wxCommandEvent&) { load_font(); update_preview(); }; + m_face->Bind(wxEVT_CHOICE, refont); + m_bold->Bind(wxEVT_CHECKBOX, refont); + m_italic->Bind(wxEVT_CHECKBOX, refont); + m_height->Bind(wxEVT_SPINCTRLDOUBLE, [this](wxSpinDoubleEvent&) { update_preview(); }); + m_height->Bind(wxEVT_TEXT, [this](wxCommandEvent&) { update_preview(); }); + Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) { + if (e.GetId() != wxID_OK) { e.Skip(); return; } + if (m_regions.empty()) return; // nothing to insert: the size line says why + if (AppConfig* cfg = wxGetApp().app_config) { + cfg->set(kFontKey, WxFontUtils::store_wxFont(current_font())); + cfg->set(kHeightKey, std::to_string(m_height->GetValue())); + } + EndModal(wxID_OK); + }); + + wxGetApp().UpdateDlgDarkUI(this); + SetSizerAndFit(top); + CenterOnParent(); + + load_font(); + update_preview(); + m_text->SetFocus(); +} + +wxString DesignTextDialog::text() const { return m_text->GetValue(); } + +wxFont DesignTextDialog::current_font() const +{ + wxFontInfo info(12); + if (m_face->GetSelection() != wxNOT_FOUND) + info.FaceName(m_face->GetStringSelection()); + info.Bold(m_bold->GetValue()).Italic(m_italic->GetValue()); + return wxFont(info); +} + +void DesignTextDialog::load_font() +{ + const wxFont font = current_font(); + m_font_file.reset(); + if (font.IsOk() && WxFontUtils::can_load(font)) + m_font_file = WxFontUtils::create_font_file(font); +} + +void DesignTextDialog::update_preview() +{ + const std::string utf8(m_text->GetValue().ToUTF8().data()); + m_regions.clear(); + if (m_font_file && !utf8.empty()) + m_regions = text_to_regions(utf8, m_height->GetValue(), m_font_file); + + wxString line; + if (!m_font_file) + line = _L("This font cannot be used for text — pick another one"); + else if (utf8.empty()) + line = _L("Type the text to see its size"); + else if (m_regions.empty()) + line = _L("This font has no outline for this text"); + else { + double lo_x = std::numeric_limits::max(), lo_y = lo_x; + double hi_x = -lo_x, hi_y = -lo_x; + for (const auto& r : m_regions) + for (const auto& c : r) + for (const Vec2d& p : c) { + lo_x = std::min(lo_x, p.x()); hi_x = std::max(hi_x, p.x()); + lo_y = std::min(lo_y, p.y()); hi_y = std::max(hi_y, p.y()); + } + line = wxString::Format(_L("Size: %.1f × %.1f mm"), hi_x - lo_x, hi_y - lo_y); + } + m_size->SetLabel(line); + if (m_ok) m_ok->Enable(!m_regions.empty()); + m_preview->Refresh(); +} + +void DesignTextDialog::draw_preview(wxWindow* canvas) +{ + wxAutoBufferedPaintDC dc(canvas); + const bool dark = wxGetApp().dark_mode(); + dc.SetBackground(wxBrush(dark ? wxColour(0x1e, 0x1e, 0x22) : wxColour(0xf4, 0xf4, 0xf6))); + dc.Clear(); + if (m_regions.empty()) return; + + double lo_x = std::numeric_limits::max(), lo_y = lo_x, hi_x = -lo_x, hi_y = -lo_x; + for (const auto& r : m_regions) + for (const auto& c : r) + for (const Vec2d& p : c) { + lo_x = std::min(lo_x, p.x()); hi_x = std::max(hi_x, p.x()); + lo_y = std::min(lo_y, p.y()); hi_y = std::max(hi_y, p.y()); + } + const wxSize sz = canvas->GetClientSize(); + const double pad = 0.08 * std::min(sz.x, sz.y); + const double w = std::max(hi_x - lo_x, 1e-6), h = std::max(hi_y - lo_y, 1e-6); + const double k = std::min((sz.x - 2 * pad) / w, (sz.y - 2 * pad) / h); + const double ox = 0.5 * (sz.x - k * w), oy = 0.5 * (sz.y + k * h); // y up -> screen y down + + std::unique_ptr gc(wxGraphicsContext::Create(dc)); + if (!gc) return; + wxGraphicsPath path = gc->CreatePath(); + for (const auto& r : m_regions) + for (const auto& c : r) { + if (c.empty()) continue; + path.MoveToPoint(ox + k * (c[0].x() - lo_x), oy - k * (c[0].y() - lo_y)); + for (size_t i = 1; i < c.size(); ++i) + path.AddLineToPoint(ox + k * (c[i].x() - lo_x), oy - k * (c[i].y() - lo_y)); + path.CloseSubpath(); + } + gc->SetBrush(wxBrush(wxColour(0x00, 0x96, 0x88))); // Orca accent + gc->SetPen(*wxTRANSPARENT_PEN); + gc->FillPath(path, wxODDEVEN_RULE); // holes (the counter of an "o") stay open +} + +void DesignTextDialog::on_dpi_changed(const wxRect&) +{ + Fit(); + Refresh(); +} + +}} // namespace Slic3r::GUI diff --git a/src/slic3r/GUI/CAD/DesignTextDialog.hpp b/src/slic3r/GUI/CAD/DesignTextDialog.hpp new file mode 100644 index 0000000000..76ac86267f --- /dev/null +++ b/src/slic3r/GUI/CAD/DesignTextDialog.hpp @@ -0,0 +1,59 @@ +#ifndef slic3r_GUI_DesignTextDialog_hpp_ +#define slic3r_GUI_DesignTextDialog_hpp_ + +#include "slic3r/GUI/GUI_Utils.hpp" +#include "libslic3r/CAD/SketchImport.hpp" + +#include + +#include + +class wxTextCtrl; +class wxChoice; +class wxCheckBox; +class wxSpinCtrlDouble; +class wxStaticText; + +namespace Slic3r { +namespace Emboss { struct FontFile; } +namespace GUI { + +// Text for the Design tab: the words, the font (face, bold, italic) and the height, with a +// live outline of exactly what will be inserted and its size in millimetres. The outline IS +// the result — the same vectorisation the sketch receives — so there is nothing to guess. +// Enter inserts, Esc cancels (charter 4.2). The last font and height are remembered. +class DesignTextDialog : public DPIDialog +{ +public: + explicit DesignTextDialog(wxWindow* parent); + + // The vectorised text, centred on the origin, in mm. Empty unless the dialog ended wxID_OK. + const ImportRegions& regions() const { return m_regions; } + wxString text() const; + +protected: + void on_dpi_changed(const wxRect& suggested_rect) override; + +private: + void load_font(); // m_face/m_bold/m_italic -> m_font_file + void update_preview(); // text/font/height -> m_regions + size label + wxFont current_font() const; + void draw_preview(wxWindow* canvas); + + wxTextCtrl* m_text{nullptr}; + wxChoice* m_face{nullptr}; + wxCheckBox* m_bold{nullptr}; + wxCheckBox* m_italic{nullptr}; + wxSpinCtrlDouble* m_height{nullptr}; + wxWindow* m_preview{nullptr}; + wxStaticText* m_size{nullptr}; + wxWindow* m_ok{nullptr}; + + std::shared_ptr m_font_file; + ImportRegions m_regions; +}; + +} // namespace GUI +} // namespace Slic3r + +#endif // slic3r_GUI_DesignTextDialog_hpp_ From ae1dc95756cef33709baa5e42c0ca3df1396e9fc Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 28 Sep 2026 18:14:55 +0000 Subject: [PATCH 143/389] CAD: catch OCCT failures in body_touching_sketch, Standard_Failure first The extrude default query must never throw; on OCCT >= 8 Standard_Failure derives from std::exception, so its handler comes first. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- src/libslic3r/CAD/CadDocument.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/CAD/CadDocument.cpp b/src/libslic3r/CAD/CadDocument.cpp index f315efba63..7c261b958d 100644 --- a/src/libslic3r/CAD/CadDocument.cpp +++ b/src/libslic3r/CAD/CadDocument.cpp @@ -2463,15 +2463,19 @@ int CadDocument::body_touching_sketch(int sketch_ref) const if (sketch_ref < 0 || sketch_ref >= int(features.size()) || features[sketch_ref].type != CadFeatureType::Sketch) return -1; - TopoDS_Face face; - try { face = build_sketch_face(features[sketch_ref]); } catch (const std::exception&) { return -1; } - if (face.IsNull()) return -1; - for (int i = int(bodies.size()) - 1; i >= 0; --i) { // newest first: the likeliest target - const TopoDS_Shape& b = bodies[i].shape; - if (b.IsNull() || is_sheet_shape(b)) continue; - BRepExtrema_DistShapeShape d(face, b); - if (d.IsDone() && d.Value() <= 1e-4) - return i; + // A query that only picks a default: any failure answers "touches nothing". + try { + const TopoDS_Face face = build_sketch_face(features[sketch_ref]); + if (face.IsNull()) return -1; + for (int i = int(bodies.size()) - 1; i >= 0; --i) { // newest first: the likeliest target + const TopoDS_Shape& b = bodies[i].shape; + if (b.IsNull() || is_sheet_shape(b)) continue; + BRepExtrema_DistShapeShape d(face, b); + if (d.IsDone() && d.Value() <= 1e-4) + return i; + } + } catch (const Standard_Failure&) { // before std::exception: on OCCT >= 8 it derives from it + } catch (const std::exception&) { } return -1; } From f4cdeb1706793615c8d74b77bea33c5bff5b8ad0 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 10:52:03 +0000 Subject: [PATCH 144/389] Design tab: build constraint labels from UTF-8, not the C locale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drawing a line or a rounded rectangle crashed the Linux AppImage: the constraint list labels were formatted from narrow literals holding "—", "·" and "°". wx converts a bare char* with the current locale, and the AppImage's AppRun sets LC_ALL=C, so the conversion failed, the format string came out NULL and wxString::Format dereferenced it (wxFormatConverterBase::Convert, from constraint_label via rebuild_constraint_list). A build started under a UTF-8 locale never showed it. These literals, and the "…" of the interference report, now go through wxString::FromUTF8, as the panel's other non-ASCII literals already do. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- src/slic3r/GUI/CAD/DesignPanel.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 1cf84e5849..92609d00a3 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -5687,7 +5687,7 @@ void DesignPanel::on_check_interference() list += (k ? ", " : "") + wxString::Format(_L("%s ↔ %s %.2f mm³"), body_name(sorted[k].body_a), body_name(sorted[k].body_b), sorted[k].volume); if (sorted.size() > shown) - list += ", …"; + list += wxString::FromUTF8(", …"); set_status(StatusKind::Warning, wxString::Format(_L("%zu overlapping pairs: %s"), sorted.size(), list)); } @@ -7966,14 +7966,17 @@ wxString DesignPanel::constraint_label(const SketchEntityConstraintDef& d) const case SketchEntity::Type::BSpline: c = 'B'; break; } } + // Non-ASCII narrow literals go through FromUTF8: wx converts a bare char* with the + // current locale, and under LC_ALL=C (the AppImage sets it) "—"/"·"/"°" fail to convert — + // an empty string, or a NULL format string that crashes wxString::Format. wxString s; s << wxUniChar(c) << ei; // avoid %c assert in Unicode build - if (r == SketchPointRole::P1) s += "·P1"; - else if (r == SketchPointRole::Center) s += "·Ctr"; - else if (r == SketchPointRole::P0) s += "·P0"; + if (r == SketchPointRole::P1) s += wxString::FromUTF8("·P1"); + else if (r == SketchPointRole::Center) s += wxString::FromUTF8("·Ctr"); + else if (r == SketchPointRole::P0) s += wxString::FromUTF8("·P0"); return s; }; auto two = [&](const wxString& name) { - return d.eb >= 0 ? wxString::Format("%s %s — %s", name, tag(d.ea, d.ra), tag(d.eb, d.rb)) + return d.eb >= 0 ? wxString::Format(wxString::FromUTF8("%s %s — %s"), name, tag(d.ea, d.ra), tag(d.eb, d.rb)) : wxString::Format("%s %s", name, tag(d.ea, d.ra)); }; switch (d.type) { @@ -7996,7 +7999,7 @@ wxString DesignPanel::constraint_label(const SketchEntityConstraintDef& d) const tag(d.ea, d.ra), tag(d.eb, d.rb)); case T::SymmetricAboutX: return wxString::Format(_L("Symmetric about X axis %s — %s"), tag(d.ea, d.ra), tag(d.eb, d.rb)); - case T::Angle: return wxString::Format("%s = %s°", two(_L("Angle")), en_format(d.value * 180.0 / M_PI, 1)); + case T::Angle: return wxString::Format(wxString::FromUTF8("%s = %s°"), two(_L("Angle")), en_format(d.value * 180.0 / M_PI, 1)); case T::Radius: return wxString::Format("%s %s = %s", _L("Radius"), tag(d.ea, d.ra), en_format(d.value)); case T::Diameter: return wxString::Format("%s %s = %s", _L("Diameter"), tag(d.ea, d.ra), en_format(d.value)); case T::PointOnLine: return two(_L("On line")); From 3c218591bc9f4c4fd3769cb4d0b128bb7f39e474 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 11:56:47 +0000 Subject: [PATCH 145/389] Design tab: pick several solid edges and dress them in one feature A solid edge could only be picked one at a time, and Fillet/Chamfer took either that one edge or a whole face group. Rounding three chosen edges meant three features, whose edge ids each resolve against a body the previous one had already changed. - Shift+click (or Ctrl+click) on an edge of the body already picked adds it to the selection, or removes it; the same modifiers that extend a sketch selection. The whole set is highlighted. A plain click replaces it, as before. - Fillet/Chamfer dresses every picked edge in ONE feature at one size, all ids resolved against the same body. The card says "3 edges", the status line and the offer header name the count. - CadFeature gains dressup_edges, appended at the end of the framed recipe, so existing projects load and rebuild unchanged. dressup_edge keeps the first edge, so an older build opening a newer project still dresses that edge instead of falling back to the face group. - The MCP fillet/chamfer verbs take `edge` as one id or an array. Tests: a fillet on the four picked top edges equals the Top face group exactly; the list survives save/load; two opposite chamfers remove exactly twice one; a missing id fails with a reason. The truncated- recipe test accounts for the new tail field. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- docs/CAD/design_tab.md | 5 ++ src/libslic3r/CAD/CadDocument.cpp | 34 +++++++-- src/libslic3r/CAD/CadDocument.hpp | 19 ++++- src/libslic3r/CAD/GeometryEngine.cpp | 32 ++++++--- src/libslic3r/CAD/GeometryEngine.hpp | 5 ++ src/slic3r/GUI/CAD/DesignCanvas.cpp | 5 ++ src/slic3r/GUI/CAD/DesignCanvas.hpp | 1 + src/slic3r/GUI/CAD/DesignPanel.cpp | 49 +++++++++---- src/slic3r/GUI/CAD/DesignPanel.hpp | 5 ++ src/slic3r/GUI/CAD/DesignSketchTool.cpp | 51 ++++++++++++++ src/slic3r/GUI/CAD/DesignSketchTool.hpp | 9 +++ src/slic3r/GUI/CAD/McpControl.cpp | 30 +++++--- tests/libslic3r/test_caddocument.cpp | 94 +++++++++++++++++++++++-- 13 files changed, 297 insertions(+), 42 deletions(-) diff --git a/docs/CAD/design_tab.md b/docs/CAD/design_tab.md index 2270909bcc..65f455bc3c 100644 --- a/docs/CAD/design_tab.md +++ b/docs/CAD/design_tab.md @@ -39,6 +39,11 @@ tool"*. It is also where a refusal explains itself. face → edge → body. - A click near a corner takes the corner, not the face behind it. - Left-drag sweeps a rubber band, and a rubber band takes the whole body. +- Shift+click (or Ctrl+click) on an edge of the body already picked adds that edge, or removes + it if it is already picked. The set belongs to one body. **Fillet / Chamfer** then dresses + every picked edge in one feature, at one size. The edge ids are resolved together against + the same body. A chain of single-edge features would resolve each against a body the + previous one had already changed. - An open sketch line can be clicked, even where it bounds a region. - Double-click a sketch stroke to edit it — the gesture belongs on the geometry. - Editing a dimension's value **updates** that dimension instead of adding a second one next diff --git a/src/libslic3r/CAD/CadDocument.cpp b/src/libslic3r/CAD/CadDocument.cpp index 7c261b958d..f77c4ceeaf 100644 --- a/src/libslic3r/CAD/CadDocument.cpp +++ b/src/libslic3r/CAD/CadDocument.cpp @@ -928,6 +928,19 @@ int CadDocument::add_fillet(double radius, int edge_id, const std::string& name) return int(features.size()) - 1; } +int CadDocument::add_fillet(double radius, const std::vector& edge_ids, const std::string& name) +{ + if (edge_ids.size() == 1) return add_fillet(radius, edge_ids.front(), name); + CadFeature f; + f.type = CadFeatureType::Fillet; + f.name = name; + f.dressup_size = radius; + f.dressup_edges = edge_ids; + f.dressup_edge = edge_ids.empty() ? -1 : edge_ids.front(); + features.push_back(f); + return int(features.size()) - 1; +} + int CadDocument::add_chamfer(double distance, FaceGroup faces, const std::string& name) { CadFeature f; @@ -950,6 +963,19 @@ int CadDocument::add_chamfer(double distance, int edge_id, const std::string& na return int(features.size()) - 1; } +int CadDocument::add_chamfer(double distance, const std::vector& edge_ids, const std::string& name) +{ + if (edge_ids.size() == 1) return add_chamfer(distance, edge_ids.front(), name); + CadFeature f; + f.type = CadFeatureType::Chamfer; + f.name = name; + f.dressup_size = distance; + f.dressup_edges = edge_ids; + f.dressup_edge = edge_ids.empty() ? -1 : edge_ids.front(); + features.push_back(f); + return int(features.size()) - 1; +} + int CadDocument::add_hole(double diameter, double depth, bool through, double x, double y, const SketchPlane& plane, const std::string& name) @@ -2886,15 +2912,15 @@ void CadDocument::apply_feature(TopoDS_Shape& result, bool& have_body, } case CadFeatureType::Fillet: if (!have_body) throw std::runtime_error("fillet needs a body"); - if (f.dressup_edge >= 0) - result = GeometryEngine::apply_fillet(result, f.dressup_size, f.dressup_edge); + if (f.dressup_edge >= 0 || !f.dressup_edges.empty()) + result = GeometryEngine::apply_fillet(result, f.dressup_size, f.dressup_edge_ids()); else result = GeometryEngine::apply_fillet(result, f.dressup_size, f.face_group); break; case CadFeatureType::Chamfer: if (!have_body) throw std::runtime_error("chamfer needs a body"); - if (f.dressup_edge >= 0) - result = GeometryEngine::apply_chamfer(result, f.dressup_size, f.dressup_edge); + if (f.dressup_edge >= 0 || !f.dressup_edges.empty()) + result = GeometryEngine::apply_chamfer(result, f.dressup_size, f.dressup_edge_ids()); else result = GeometryEngine::apply_chamfer(result, f.dressup_size, f.face_group); break; diff --git a/src/libslic3r/CAD/CadDocument.hpp b/src/libslic3r/CAD/CadDocument.hpp index b95c493496..c85dcac220 100644 --- a/src/libslic3r/CAD/CadDocument.hpp +++ b/src/libslic3r/CAD/CadDocument.hpp @@ -112,6 +112,17 @@ struct CadFeature { double dressup_size{1.0}; // fillet radius or chamfer distance FaceGroup face_group{FaceGroup::All}; int dressup_edge{-1}; // global edge id for edge-targeted fillet/chamfer; -1 = use face_group + // Several picked edges dressed in ONE operation, all resolved against the same body, so + // the ids cannot drift the way they do across a chain of single-edge features. When set, + // dressup_edge holds the first of them: a build that predates the list still dresses that + // one edge instead of falling back to the whole face group. + std::vector dressup_edges; + // The edges this dress-up targets: the list, else the single edge, else none (face group). + std::vector dressup_edge_ids() const { + if (!dressup_edges.empty()) return dressup_edges; + if (dressup_edge >= 0) return { dressup_edge }; + return {}; + } // Hole params (positioned circular cut into the current body) double hole_diameter{5}; @@ -383,7 +394,8 @@ struct CadFeature { expr, mate_kind, mate_cs_a, mate_cs_b, mate_offset, mate_angle, mate_flip, coordsys_face_kind, coordsys_face_edges, - thread_major_nominal, pattern_inclusive); + thread_major_nominal, pattern_inclusive, + dressup_edges); } template void load(Archive& ar) { @@ -423,7 +435,8 @@ struct CadFeature { expr, mate_kind, mate_cs_a, mate_cs_b, mate_offset, mate_angle, mate_flip, coordsys_face_kind, coordsys_face_edges, - thread_major_nominal, pattern_inclusive); + thread_major_nominal, pattern_inclusive, + dressup_edges); imported_solid = brep_from_string(brep); } // The pre-framing (v4) layout, FROZEN. A v4 recipe is one flat stream with no per-feature @@ -596,8 +609,10 @@ public: BooleanMode mode, const std::string& name); int add_fillet(double radius, FaceGroup faces, const std::string& name); int add_fillet(double radius, int edge_id, const std::string& name); + int add_fillet(double radius, const std::vector& edge_ids, const std::string& name); int add_chamfer(double distance, FaceGroup faces, const std::string& name); int add_chamfer(double distance, int edge_id, const std::string& name); + int add_chamfer(double distance, const std::vector& edge_ids, const std::string& name); int add_hole(double diameter, double depth, bool through, double x, double y, const SketchPlane& plane, const std::string& name); diff --git a/src/libslic3r/CAD/GeometryEngine.cpp b/src/libslic3r/CAD/GeometryEngine.cpp index 03ae1de979..5795058150 100644 --- a/src/libslic3r/CAD/GeometryEngine.cpp +++ b/src/libslic3r/CAD/GeometryEngine.cpp @@ -364,28 +364,42 @@ TopoDS_Shape GeometryEngine::apply_chamfer(const TopoDS_Shape& solid, double dis TopoDS_Shape GeometryEngine::apply_fillet(const TopoDS_Shape& solid, double radius, int edge_id) { - if (radius <= 0.001) throw std::runtime_error("the fillet radius must be greater than 0"); + return apply_fillet(solid, radius, std::vector{ edge_id }); +} - TopoDS_Edge edge = edge_by_index(solid, edge_id); - if (edge.IsNull()) throw std::runtime_error("apply_fillet: invalid edge id"); +TopoDS_Shape GeometryEngine::apply_chamfer(const TopoDS_Shape& solid, double distance, int edge_id) +{ + return apply_chamfer(solid, distance, std::vector{ edge_id }); +} + +TopoDS_Shape GeometryEngine::apply_fillet(const TopoDS_Shape& solid, double radius, const std::vector& edge_ids) +{ + if (radius <= 0.001) throw std::runtime_error("the fillet radius must be greater than 0"); + if (edge_ids.empty()) throw std::runtime_error("apply_fillet: no edge picked"); BRepFilletAPI_MakeFillet mk(solid); - mk.Add(radius, edge); + for (int id : edge_ids) { + TopoDS_Edge edge = edge_by_index(solid, id); + if (edge.IsNull()) throw std::runtime_error("apply_fillet: invalid edge id"); + mk.Add(radius, edge); + } mk.Build(); if (!mk.IsDone()) throw std::runtime_error("apply_fillet: OCCT fillet failed"); return mk.Shape(); } -TopoDS_Shape GeometryEngine::apply_chamfer(const TopoDS_Shape& solid, double distance, int edge_id) +TopoDS_Shape GeometryEngine::apply_chamfer(const TopoDS_Shape& solid, double distance, const std::vector& edge_ids) { if (distance <= 0.001) throw std::runtime_error("the chamfer distance must be greater than 0"); - - TopoDS_Edge edge = edge_by_index(solid, edge_id); - if (edge.IsNull()) throw std::runtime_error("apply_chamfer: invalid edge id"); + if (edge_ids.empty()) throw std::runtime_error("apply_chamfer: no edge picked"); BRepFilletAPI_MakeChamfer mk(solid); - mk.Add(distance, edge); + for (int id : edge_ids) { + TopoDS_Edge edge = edge_by_index(solid, id); + if (edge.IsNull()) throw std::runtime_error("apply_chamfer: invalid edge id"); + mk.Add(distance, edge); + } mk.Build(); if (!mk.IsDone()) throw std::runtime_error("apply_chamfer: OCCT chamfer failed"); diff --git a/src/libslic3r/CAD/GeometryEngine.hpp b/src/libslic3r/CAD/GeometryEngine.hpp index bad29ed953..16040eee5e 100644 --- a/src/libslic3r/CAD/GeometryEngine.hpp +++ b/src/libslic3r/CAD/GeometryEngine.hpp @@ -120,6 +120,11 @@ public: FaceGroup faces = FaceGroup::All); static TopoDS_Shape apply_chamfer(const TopoDS_Shape& solid, double distance, int edge_id); + // Several edges in one operation, all ids resolved against `solid`. + static TopoDS_Shape apply_fillet(const TopoDS_Shape& solid, double radius, + const std::vector& edge_ids); + static TopoDS_Shape apply_chamfer(const TopoDS_Shape& solid, double distance, + const std::vector& edge_ids); static TriangleMesh tessellate(const TopoDS_Shape& shape, double linear_deflection = 0.003, diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index a3842b2223..2f00b04e61 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -938,6 +938,11 @@ void DesignCanvas::set_on_pattern_changed(std::function cb) m_sketch_tool.on_pattern_changed = std::move(cb); } +std::vector DesignCanvas::selected_solid_edges() const +{ + return m_sketch_tool.selected_edges(); +} + void DesignCanvas::set_on_solid_selection_changed(std::function cb) { m_sketch_tool.on_solid_selection_changed = std::move(cb); diff --git a/src/slic3r/GUI/CAD/DesignCanvas.hpp b/src/slic3r/GUI/CAD/DesignCanvas.hpp index 026d4a524d..191b2bbdc0 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.hpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.hpp @@ -122,6 +122,7 @@ public: const std::vector* visible = nullptr, const std::vector* xform = nullptr); void set_on_solid_selection_changed(std::function cb); + std::vector selected_solid_edges() const; // the Shift/Ctrl+click edge set, last-clicked at the end void select_body(int body); // Parts-list -> highlight a whole body by index // Effective display colour of a body: the per-body override (Color tool) when set, // otherwise the auto body-index palette. Single source of truth shared with reload(). diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 92609d00a3..3678d8861c 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -3663,6 +3663,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_sel_solid_body = (level >= 1) ? body : -1; m_sel_solid_face = (level == 2) ? face : -1; // 4 = Vertex: a corner is not its face m_sel_solid_edge = (level == 3) ? edge : -1; + m_sel_solid_edges = (level == 3) ? m_viewport->selected_solid_edges() : std::vector(); m_sel_solid_vertex = (level == 4); // Keep the hit face even at whole-body level: the cycle's first click means "this body", // but the user pointed AT a face and a sketch should be able to use it. 3a2. @@ -3851,7 +3852,9 @@ DesignPanel::DesignPanel(wxWindow* parent) set_status(level == 4 ? bodytag + _L("vertex selected — click again for the whole body") : level == 1 ? bodytag + _L("selected (whole body) — right-click for what applies to it") : level == 2 ? bodytag + wxString::Format(_L("face %d selected — right-click to push/pull it, or click again for the whole body"), face) - : level == 3 ? bodytag + wxString::Format(_L("edge %d selected — Fillet/Chamfer to dress it, or click again for the whole body"), edge) + : level == 3 && m_sel_solid_edges.size() > 1 + ? bodytag + wxString::Format(_L_PLURAL("%zu edge selected — Shift+click adds or removes one, Fillet/Chamfer dresses them all", "%zu edges selected — Shift+click adds or removes one, Fillet/Chamfer dresses them all", m_sel_solid_edges.size()), m_sel_solid_edges.size()) + : level == 3 ? bodytag + wxString::Format(_L("edge %d selected — Shift+click to add edges, or click again for the whole body"), edge) : _L("Nothing selected")); m_status->Refresh(); }); @@ -5064,13 +5067,14 @@ void DesignPanel::on_add_dressup() bool fillet = (m_dressup_type->GetSelection() == 0); m_feature_counter++; - // A click-selected solid edge targets THAT edge; otherwise dress the whole face-group. + // Click-selected solid edges are the target; otherwise dress the whole face-group. int didx = -1; - if (m_sel_solid_edge >= 0) { + const std::vector edges = dressup_edges(); + if (!edges.empty()) { if (fillet) - didx = m_doc.add_fillet(sz, m_sel_solid_edge, feature_name(_L("Fillet"))); + didx = m_doc.add_fillet(sz, edges, feature_name(_L("Fillet"))); else - didx = m_doc.add_chamfer(sz, m_sel_solid_edge, feature_name(_L("Chamfer"))); + didx = m_doc.add_chamfer(sz, edges, feature_name(_L("Chamfer"))); } else if (fillet) didx = m_doc.add_fillet(sz, fg, feature_name(_L("Fillet"))); else @@ -6383,8 +6387,13 @@ wxString DesignPanel::offer_header(int kind) const case OfferSel::FacePlanar: return wxString::Format(_L("Flat face %d of %s"), m_sel_solid_face, body()); case OfferSel::FaceCyl: return wxString::Format(_L("Cylindrical face %d of %s"), m_sel_solid_face, body()); case OfferSel::FaceOther: return wxString::Format(_L("Face %d of %s"), m_sel_solid_face, body()); - case OfferSel::EdgeStr: return wxString::Format(_L("Straight edge %d of %s"), m_sel_solid_edge, body()); - case OfferSel::EdgeCirc: return wxString::Format(_L("Circular edge %d of %s"), m_sel_solid_edge, body()); + case OfferSel::EdgeStr: + case OfferSel::EdgeCirc: + if (dressup_edges().size() > 1) + return wxString::Format(_L_PLURAL("%zu edge of %s", "%zu edges of %s", dressup_edges().size()), dressup_edges().size(), body()); + return OfferSel(kind) == OfferSel::EdgeStr + ? wxString::Format(_L("Straight edge %d of %s"), m_sel_solid_edge, body()) + : wxString::Format(_L("Circular edge %d of %s"), m_sel_solid_edge, body()); case OfferSel::Vertex: return wxString::Format(_L("Vertex of %s"), body()); case OfferSel::SkLoop: return _L("Sketch profile"); case OfferSel::SkNone: return _L("Sketch — nothing selected"); @@ -8999,7 +9008,8 @@ void DesignPanel::load_feature_into_dialog(const CadFeature& f) m_dressup_type->SetSelection(f.type == CadFeatureType::Fillet ? 0 : 1); m_dressup_size->SetValue(f.dressup_size); m_face_group->SetSelection(static_cast(f.face_group)); - m_sel_solid_edge = f.dressup_edge; // preserve edge-targeting on re-edit + m_sel_solid_edges = f.dressup_edge_ids(); // preserve edge-targeting on re-edit + m_sel_solid_edge = m_sel_solid_edges.empty() ? -1 : m_sel_solid_edges.back(); m_sel_solid_body = f.target_body; // preserve which body on re-edit sync_dressup_target(); // and say which of the two the re-edit is targeting break; @@ -9658,8 +9668,12 @@ CadFeature DesignPanel::build_candidate(Tool t) const : CadFeatureType::Chamfer; f.dressup_size = m_dressup_size->GetValue(); f.face_group = static_cast(m_face_group->GetSelection()); - // A click-selected solid edge overrides the face-group: dress THAT edge. - f.dressup_edge = m_sel_solid_edge; // -1 when no edge picked + // Click-selected solid edges override the face-group: dress THOSE edges. + { + const std::vector edges = dressup_edges(); + f.dressup_edge = edges.empty() ? -1 : edges.front(); // -1 when no edge picked + f.dressup_edges = edges.size() > 1 ? edges : std::vector(); + } break; case Tool::Hole: f.type = CadFeatureType::Hole; @@ -9928,12 +9942,21 @@ CadFeature DesignPanel::build_candidate(Tool t) const // user picked in the viewport, or the face-group. build_dressup reads m_sel_solid_edge first and // only falls back to the group, so when an edge is picked the group combo is inert — grey it out // rather than leave it showing a value it will not use. +std::vector DesignPanel::dressup_edges() const +{ + if (m_sel_solid_edge < 0) return {}; + if (!m_sel_solid_edges.empty() && m_sel_solid_edges.back() == m_sel_solid_edge) + return m_sel_solid_edges; + return { m_sel_solid_edge }; +} + void DesignPanel::sync_dressup_target() { if (m_dressup_edge_label == nullptr) return; - const bool have_edge = (m_sel_solid_edge >= 0); - m_dressup_edge_label->SetLabel(have_edge - ? wxString::Format(_L("Edge %d"), m_sel_solid_edge) + const size_t n = dressup_edges().size(); + const bool have_edge = n > 0; + m_dressup_edge_label->SetLabel(n > 1 ? wxString::Format(_L_PLURAL("%zu edge", "%zu edges", n), n) + : have_edge ? wxString::Format(_L("Edge %d"), m_sel_solid_edge) : _L("(no edge picked — group below)")); if (m_face_group != nullptr) m_face_group->Enable(!have_edge); m_dressup_edge_label->Refresh(); diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index 9d4f274b17..c9b6e65f47 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -329,6 +329,7 @@ private: void update_extrude_gizmo(); void update_fillet_gizmo(); // edge-anchored radius arrow (Dressup card) void sync_dressup_target(); // Dressup card: show picked edge vs group, gate the combo + std::vector dressup_edges() const; // the picked edge(s) a dress-up targets; empty = face group void update_hole_gizmo(); // footprint circle + diameter/depth arrows (Hole card) // A FEATURE button whose tool needs bodies it may not have yet. Greyed with an explanatory // tooltip below min_bodies, rather than accepting the click and refusing afterwards. @@ -716,6 +717,10 @@ private: int m_sel_solid_body{-1}; // which body the face/edge selection is on int m_sel_solid_face{-1}; int m_sel_solid_edge{-1}; + // The picked edge set (Shift/Ctrl+click), m_sel_solid_edge last. Read through dressup_edges(), + // which drops it once m_sel_solid_edge moves on — the many places that reset the single edge + // then need not know the set exists. + std::vector m_sel_solid_edges; bool m_sel_solid_vertex{false}; // a corner is picked (body+point, no face/edge) // The face actually under the last solid click, INDEPENDENT of the whole/face/edge cycle level. // The first click on a solid selects the WHOLE body, but the ray has already resolved which face diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 996a77c1a1..31beb1e407 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -3445,12 +3445,22 @@ void DesignSketchTool::clear_solid_selection() m_solid_sel = SolidSel::None; m_sel_body = m_sel_face = m_sel_edge = -1; m_sel_edge_pts.clear(); + m_sel_edges_more.clear(); + m_sel_edges_more_pts.clear(); // The pre-highlight names a face/edge/vertex by index into a shape that a recompute has just // rebuilt, so it expires with the selection it was a promise about. Left behind it would keep // glowing on whatever now sits at those indices — a real entity, but not the one meant. m_pre = SolidPick{}; } +std::vector DesignSketchTool::selected_edges() const +{ + if (m_solid_sel != SolidSel::Edge || m_sel_edge < 0) return {}; + std::vector out = m_sel_edges_more; + out.push_back(m_sel_edge); + return out; +} + void DesignSketchTool::select_body(int body) { // Hidden bodies aren't highlighted (the tint overlay would otherwise draw over a @@ -3463,6 +3473,8 @@ void DesignSketchTool::select_body(int body) m_sel_body = body; m_sel_face = m_sel_edge = -1; m_sel_edge_pts.clear(); + m_sel_edges_more.clear(); + m_sel_edges_more_pts.clear(); m_solid_sel = SolidSel::Whole; // render_solid_highlight tints just this body } @@ -3683,6 +3695,42 @@ bool DesignSketchTool::handle_solid_click(GLCanvas3D& canvas, const wxMouseEvent const int prev_body = m_sel_body, prev_face = m_sel_face, prev_edge = m_sel_edge; const Vec3d prev_vtx = m_sel_vertex_pt; + // SHIFT/CTRL+CLICK ON AN EDGE BUILDS AN EDGE SET, the same modifiers that extend a sketch + // selection. Only edges of the one body already picked: a dress-up acts on one body, and a + // set spanning two could not be applied. An edge already in the set leaves it; the last one + // leaving clears the selection. No escalation to the whole body here — a modified click is + // always about the set. + const bool extend = evt.ShiftDown() || evt.ControlDown() || evt.CmdDown(); + if (extend && p.kind == SolidSel::Edge && prev_kind == SolidSel::Edge && p.body == prev_body) { + auto more = std::find(m_sel_edges_more.begin(), m_sel_edges_more.end(), p.edge); + if (p.edge == prev_edge) { + if (m_sel_edges_more.empty()) { + clear_solid_selection(); + } else { // the previous pick becomes the current one + m_sel_edge = m_sel_edges_more.back(); + m_sel_edge_pts = std::move(m_sel_edges_more_pts.back()); + m_sel_edges_more.pop_back(); + m_sel_edges_more_pts.pop_back(); + } + } else if (more != m_sel_edges_more.end()) { + const size_t k = size_t(more - m_sel_edges_more.begin()); + m_sel_edges_more.erase(more); + m_sel_edges_more_pts.erase(m_sel_edges_more_pts.begin() + k); + } else { + m_sel_edges_more.push_back(prev_edge); + m_sel_edges_more_pts.push_back(std::move(m_sel_edge_pts)); + m_sel_edge = p.edge; + m_sel_edge_pts = std::move(p.edge_pts); + m_sel_face = p.face; + } + dp_pick_trace("edge set -> %zu edge(s), current %d", selected_edges().size(), m_sel_edge); + if (on_solid_selection_changed) + on_solid_selection_changed(int(m_solid_sel), m_sel_body, m_sel_face, m_sel_edge); + return true; + } + m_sel_edges_more.clear(); + m_sel_edges_more_pts.clear(); + m_sel_body = p.body; m_sel_face = p.face; m_sel_edge = p.edge; @@ -3871,6 +3919,9 @@ void DesignSketchTool::render_solid_highlight() render_solid_sel(m_solid_sel, m_sel_body, m_sel_face, m_sel_edge_pts, m_sel_vertex_pt, sel_cyan, 1.0f); + if (m_solid_sel == SolidSel::Edge) + for (const std::vector& pts : m_sel_edges_more_pts) + render_solid_sel(SolidSel::Edge, m_sel_body, -1, pts, Vec3d::Zero(), sel_cyan, 1.0f); } // Datum/reference planes (Plane feature) have no solid; draw each as a translucent indigo diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index 62e97981f7..60a7fa25dd 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -200,6 +200,10 @@ public: void set_pick_only_body(int b) { m_pick_only_body = b; } void clear_solid_selection(); bool has_solid_selection() const { return m_solid_sel != SolidSel::None; } + // Every picked edge when the selection is an edge set (Shift/Ctrl+click adds and removes + // edges of the same body): the earlier picks first, the last-clicked edge at the end. + // Empty unless the selection is at edge level. + std::vector selected_edges() const; // Select a whole body by index (from the Parts list) — Whole-level highlight, no face/edge. // body < 0 or out of range clears the selection. void select_body(int body); @@ -1194,6 +1198,11 @@ private: int m_sel_face{-1}; int m_sel_edge{-1}; std::vector m_sel_edge_pts; + // Edges picked BEFORE m_sel_edge in a Shift/Ctrl+click set, same body, with their world + // polylines for the highlight. m_sel_edge stays the last-clicked one, so everything that + // reads a single edge (the radius gizmo, the offer header) keeps working unchanged. + std::vector m_sel_edges_more; + std::vector> m_sel_edges_more_pts; Vec3d m_sel_vertex_pt{Vec3d::Zero()}; // world point of a picked vertex bool handle_solid_click(GLCanvas3D& canvas, const wxMouseEvent& evt); // pick + notify // What a click at (mx,my) WOULD take, resolved without touching the selection. One diff --git a/src/slic3r/GUI/CAD/McpControl.cpp b/src/slic3r/GUI/CAD/McpControl.cpp index bc05e480c1..90148abee1 100644 --- a/src/slic3r/GUI/CAD/McpControl.cpp +++ b/src/slic3r/GUI/CAD/McpControl.cpp @@ -156,15 +156,15 @@ json describe_tools() json{{"name", "profile"}, {"type", "array"}, {"default", json::array()}, {"description", "optional closed contour [[x,y],...] in plane mm; overrides width/height"}}, json{{"name", "boolean"}, {"type", "string"}, {"enum", json::array({"new", "union", "subtract", "intersect"})}, {"default", "new"}}, })}}, - json{{"name", "fillet"}, {"summary", "Round a measured edge of a body (edge id from query_topology on that body)."}, + json{{"name", "fillet"}, {"summary", "Round measured edges of a body (edge ids from query_topology on that body)."}, {"params", json::array({ - json{{"name", "edge"}, {"type", "integer"}}, + json{{"name", "edge"}, {"type", "integer|array"}, {"description", "one edge id, or an array of ids rounded together in one feature"}}, json{{"name", "radius"}, {"type", "number"}, {"unit", "mm"}, {"default", 1}, {"min", 0.01}}, json{{"name", "body"}, {"type", "integer"}, {"default", -1}, {"description", "target body; omit for the last body. edge id is resolved against THIS body."}}, })}}, - json{{"name", "chamfer"}, {"summary", "Chamfer a measured edge of a body (edge id from query_topology on that body)."}, + json{{"name", "chamfer"}, {"summary", "Chamfer measured edges of a body (edge ids from query_topology on that body)."}, {"params", json::array({ - json{{"name", "edge"}, {"type", "integer"}}, + json{{"name", "edge"}, {"type", "integer|array"}, {"description", "one edge id, or an array of ids chamfered together in one feature"}}, json{{"name", "distance"}, {"type", "number"}, {"unit", "mm"}, {"default", 1}, {"min", 0.01}}, json{{"name", "body"}, {"type", "integer"}, {"default", -1}, {"description", "target body; omit for the last body. edge id is resolved against THIS body."}}, })}}, @@ -867,16 +867,30 @@ int target_body_arg(const json& params, const CadDocument& doc) return bi; // <0 -> kernel uses the last body } +// `edge` is one id or an array of ids; an array becomes ONE feature, every id resolved +// against the same body (a chain of single-edge features would see the ids drift). +std::vector edge_ids_arg(const json& params, const char* verb) +{ + if (!params.contains("edge")) + throw std::runtime_error(std::string(verb) + " needs 'edge' (id or array of ids from query_topology)"); + const json& e = params["edge"]; + std::vector ids; + if (e.is_array()) for (const json& v : e) ids.push_back(v.get()); + else ids.push_back(e.get()); + if (ids.empty()) throw std::runtime_error(std::string(verb) + ": 'edge' is an empty array"); + return ids; +} + json action_fillet(DesignPanel* panel, const json& params) { - if (!params.contains("edge")) throw std::runtime_error("fillet needs 'edge' (id from query_topology)"); + const std::vector edges = edge_ids_arg(params, "fillet"); const double radius = params.value("radius", 1.0); if (radius <= 0) throw std::runtime_error("radius must be > 0"); CadDocument& doc = panel->mcp_doc(); if (doc.bodies.empty()) throw std::runtime_error("no body to fillet"); int bi = target_body_arg(params, doc); doc.checkpoint(); - int f = doc.add_fillet(radius, params["edge"].get(), "Fillet"); + int f = doc.add_fillet(radius, edges, "Fillet"); if (bi >= 0) doc.features[f].target_body = bi; // edge id resolved against THIS body's shape bool ok = doc.recompute(); if (!ok) { const std::string why = doc.error; doc.undo(); doc.error = why; } @@ -887,14 +901,14 @@ json action_fillet(DesignPanel* panel, const json& params) json action_chamfer(DesignPanel* panel, const json& params) { - if (!params.contains("edge")) throw std::runtime_error("chamfer needs 'edge' (id from query_topology)"); + const std::vector edges = edge_ids_arg(params, "chamfer"); const double dist = params.value("distance", 1.0); if (dist <= 0) throw std::runtime_error("distance must be > 0"); CadDocument& doc = panel->mcp_doc(); if (doc.bodies.empty()) throw std::runtime_error("no body to chamfer"); int bi = target_body_arg(params, doc); doc.checkpoint(); - int c = doc.add_chamfer(dist, params["edge"].get(), "Chamfer"); + int c = doc.add_chamfer(dist, edges, "Chamfer"); if (bi >= 0) doc.features[c].target_body = bi; // edge id resolved against THIS body's shape bool ok = doc.recompute(); if (!ok) { const std::string why = doc.error; doc.undo(); doc.error = why; } diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index 6b3327ee1d..135905b116 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -2347,12 +2347,12 @@ TEST_CASE("a truncated feature keeps what it could read", "[CadDocument][recipe] } // Shorten feature 1 so it ends right after coordsys_face_kind: drop coordsys_face_edges - // (4 bytes) and the two flags appended after it (thread_major_nominal, pattern_inclusive: - // 1 byte each). Rewrite its length prefix and erase the tail bytes. The reader then runs - // out inside fa(f), throws, and keeps everything it had already assigned — that is the - // whole point of the try/catch. (Cut on a field boundary: a field cut in half is read as - // whatever half arrived.) - const size_t drop = sizeof(uint32_t) + 2 * sizeof(bool); + // (4 bytes), the two flags appended after it (thread_major_nominal, pattern_inclusive: + // 1 byte each) and the empty dressup_edges list (its 8-byte size tag). Rewrite its length + // prefix and erase the tail bytes. The reader then runs out inside fa(f), throws, and keeps + // everything it had already assigned — that is the whole point of the try/catch. (Cut on a + // field boundary: a field cut in half is read as whatever half arrived.) + const size_t drop = sizeof(uint32_t) + 2 * sizeof(bool) + sizeof(cereal::size_type); REQUIRE(f_len[1] > drop); std::string shortened = blob; shortened.erase(f_off[1] + 4 + f_len[1] - drop, drop); @@ -2370,6 +2370,7 @@ TEST_CASE("a truncated feature keeps what it could read", "[CadDocument][recipe] REQUIRE(loaded.features[1].coordsys_face_edges == -1); // defaulted by the cut REQUIRE_FALSE(loaded.features[1].thread_major_nominal); // ...and so were the later flags REQUIRE_FALSE(loaded.features[1].pattern_inclusive); + REQUIRE(loaded.features[1].dressup_edges.empty()); REQUIRE(loaded.features[0].name == doc.features[0].name); REQUIRE(loaded.features[2].name == doc.features[2].name); } @@ -7986,6 +7987,87 @@ TEST_CASE("dressup: four chamfer ids captured up-front drift as earlier chamfers REQUIRE(ok); } +// Several picked edges dressed by ONE feature: every id is resolved against the same body, so +// capturing them up-front is correct here (unlike the chain of single-edge features above). +TEST_CASE("dressup: one fillet on four picked edges equals the Top face group", "[CadDocument][dressup]") +{ + const double half = 10.0, h = 10.0, r = 1.0; + CadDocument doc = make_centred_box(half, h); + REQUIRE(doc.recompute()); + const double v0 = solid_volume(doc.bodies[0].shape); + + std::vector ids; + for (const Vec3d& t : { Vec3d(half, 0.0, h), Vec3d(0.0, half, h), Vec3d(-half, 0.0, h), Vec3d(0.0, -half, h) }) { + const int id = edge_near(doc.bodies[0].shape, t, 1.5); + REQUIRE(id >= 0); + ids.push_back(id); + } + const int fi = doc.add_fillet(r, ids, "Fillet"); + REQUIRE(doc.features[fi].dressup_edges == ids); + REQUIRE(doc.features[fi].dressup_edge == ids.front()); // what an older build falls back to + REQUIRE(doc.recompute()); + REQUIRE(doc.error.empty()); + const double v_list = solid_volume(doc.bodies[0].shape); + + CadDocument ref = make_centred_box(half, h); + ref.add_fillet(r, FaceGroup::Top, "Fillet"); + REQUIRE(ref.recompute()); + const double v_group = solid_volume(ref.bodies[0].shape); + + INFO("v0=" << v0 << " list=" << v_list << " group=" << v_group); + REQUIRE(v_list < v0); + REQUIRE(std::abs(v_list - v_group) < 1e-6 * v0); + + SECTION("the list survives a save and load") { + const std::string blob = doc.serialize_recipe(); + CadDocument back; + REQUIRE(back.deserialize_recipe(blob)); + REQUIRE(back.features.size() == doc.features.size()); + REQUIRE(back.features[fi].dressup_edges == ids); + REQUIRE(std::abs(solid_volume(back.bodies[0].shape) - v_list) < 1e-6 * v0); + } +} + +TEST_CASE("dressup: one chamfer on two picked edges, a single id still takes the one-edge path", "[CadDocument][dressup]") +{ + const double half = 10.0, h = 10.0, d = 0.5; + CadDocument doc = make_centred_box(half, h); + REQUIRE(doc.recompute()); + const double v0 = solid_volume(doc.bodies[0].shape); + const int a = edge_near(doc.bodies[0].shape, Vec3d(half, 0.0, h), 1.5); + const int b = edge_near(doc.bodies[0].shape, Vec3d(-half, 0.0, h), 1.5); + REQUIRE(a >= 0); + REQUIRE(b >= 0); + + CadDocument one = make_centred_box(half, h); + REQUIRE(one.recompute()); + const int f1 = one.add_chamfer(d, std::vector{ a }, "Chamfer"); + REQUIRE(one.features[f1].dressup_edges.empty()); // a single pick stays a plain edge feature + REQUIRE(one.features[f1].dressup_edge == a); + REQUIRE(one.recompute()); + const double single = v0 - solid_volume(one.bodies[0].shape); + + doc.add_chamfer(d, std::vector{ a, b }, "Chamfer"); + REQUIRE(doc.recompute()); + REQUIRE(doc.error.empty()); + const double both = v0 - solid_volume(doc.bodies[0].shape); + INFO("single=" << single << " both=" << both); + REQUIRE(single > 0.0); + // Two opposite rim edges share no corner: removing both takes exactly twice one. + REQUIRE(std::abs(both - 2.0 * single) < 1e-6 * v0); +} + +TEST_CASE("dressup: an edge list naming a missing edge fails with a reason", "[CadDocument][dressup]") +{ + CadDocument doc = make_centred_box(10.0, 10.0); + REQUIRE(doc.recompute()); + const int good = edge_near(doc.bodies[0].shape, Vec3d(10.0, 0.0, 10.0), 1.5); + REQUIRE(good >= 0); + doc.add_fillet(1.0, std::vector{ good, 9999 }, "Fillet"); + REQUIRE_FALSE(doc.recompute()); + REQUIRE_FALSE(doc.error.empty()); +} + // --- Face-drift fingerprint: a FaceAndDirection connector warns when its face index slides --- TEST_CASE("a connector records its face fingerprint on first recompute", "[CadDocument][mate]") From c664a24f4b26461a39264ba6f47d7ce987517410 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 12:22:12 +0000 Subject: [PATCH 146/389] Design tab: a closed loop that crosses or folds back is not a region A sketch drawn on the rig extruded to walls with no caps. Every joint of its loop met, so the loop analysis called it closed and MakeFace accepted it, but the loop crossed itself: an arc left the top line's end heading back over it and crossed it again 2.5 mm on. A second arc left a 0.28 mm line tangent to it but the other way, a cusp. The prism of that face is an invalid solid, and it was shipped as a body. - SketchEngine::wires_to_face checks the face it builds and, when OCCT calls it invalid, fails with "the profile crosses or folds back on itself, so it does not bound one region". The extrude reports that instead of producing the broken body. - sketch_loop_defect() judges a closed loop of lines and arcs exactly: any contact between two of its entities away from the joints they share, or a joint where the curve turns straight back (a cusp; OCCT still builds that one, but it is never what was meant). It returns the point. - The sketch uses it on every region: the loop is tinted red, the point gets a marker, and the status line says what the red means the first time one appears. The MCP loop report lists the defects and no longer calls such a profile buildable. Tests: the rig's profile, with each defect and with both, from a recording of the real entities. The analysis names the cusp at its joint and the crossing on the top line, in either traversal order, and passes ordinary tangent and collinear joints. The extrude refuses every crossing variant with the reason, and the same arcs swept the other way round extrude to a valid solid. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- docs/CAD/design_tab.md | 5 + src/libslic3r/CAD/SketchEngine.cpp | 164 +++++++++++++++++++++++- src/libslic3r/CAD/SketchEngine.hpp | 9 ++ src/slic3r/GUI/CAD/DesignSketchTool.cpp | 31 ++++- src/slic3r/GUI/CAD/DesignSketchTool.hpp | 8 ++ src/slic3r/GUI/CAD/McpControl.cpp | 10 +- tests/libslic3r/test_caddocument.cpp | 92 +++++++++++++ 7 files changed, 313 insertions(+), 6 deletions(-) diff --git a/docs/CAD/design_tab.md b/docs/CAD/design_tab.md index 65f455bc3c..87ef8fe7a4 100644 --- a/docs/CAD/design_tab.md +++ b/docs/CAD/design_tab.md @@ -52,6 +52,11 @@ tool"*. It is also where a refusal explains itself. - Sketching happens on the face you clicked, first click. - A sketch whose entities form no wire **fails** instead of extruding a default box. A subtraction that removes nothing is reported as an error instead of a silent success. +- A loop whose ends all meet can still fail to bound one region. It may cross itself, or turn + straight back along itself at a joint (an arc leaving a line tangent to it but heading the + other way). The sketch tints such a loop red, marks the point, and says so once on the status + line. The extrude refuses a crossing loop with the same reason; before this check it produced a + body with no caps. --- diff --git a/src/libslic3r/CAD/SketchEngine.cpp b/src/libslic3r/CAD/SketchEngine.cpp index 8133de1174..812e6fa703 100644 --- a/src/libslic3r/CAD/SketchEngine.cpp +++ b/src/libslic3r/CAD/SketchEngine.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -881,6 +882,18 @@ std::vector sketch_open_ends(const std::vector& entities, return out; } +// A closed wire can still fail to bound a region: a loop that crosses itself, or one that +// doubles back along itself (a cusp, e.g. an arc leaving a line tangent to it but in the +// opposite direction). MakeFace reports success on both and the prism built from the face is +// an invalid solid with no caps. Refuse it here, with the reason, instead of shipping that. +static TopoDS_Face checked_profile_face(const TopoDS_Face& f) +{ + BRepCheck_Analyzer an(f); + if (!an.IsValid()) + throw std::runtime_error("the profile crosses or folds back on itself, so it does not bound one region"); + return f; +} + TopoDS_Face SketchEngine::wires_to_face(const std::vector& wires, const SketchPlane& plane) { @@ -900,7 +913,7 @@ TopoDS_Face SketchEngine::wires_to_face(const std::vector& wires, if (wires.size() == 1) { BRepBuilderAPI_MakeFace fm(wires[0]); if (!fm.IsDone()) throw std::runtime_error("sketch loop does not bound a face"); - return fm.Face(); + return checked_profile_face(fm.Face()); } // Two or more loops: build a face per wire and let the largest area be the outer @@ -956,7 +969,7 @@ TopoDS_Face SketchEngine::wires_to_face(const std::vector& wires, // while a holed SKETCH did not. ShapeFix_Face sff(fm.Face()); sff.FixOrientation(); - return sff.Face(); + return checked_profile_face(sff.Face()); } std::vector SketchEngine::mirror_entities( @@ -2107,6 +2120,153 @@ int sketch_entity_ends(const SketchEntity& e, std::pair return 0; } +namespace { + +// An arc's signed angular offset of `ang` from its start, within its sweep: true when the angle +// lies on the arc (with `tol` radians of slack at either end). +bool angle_on_arc(const SketchEntity& e, double ang, double tol) +{ + const double TWO_PI = 2.0 * M_PI; + const double sweep = e.end_angle - e.start_angle; + double d = (sweep >= 0.0) ? ang - e.start_angle : e.start_angle - ang; + d = std::fmod(d, TWO_PI); + if (d < 0.0) d += TWO_PI; + if (d > TWO_PI - tol) d -= TWO_PI; // just before the start counts as the start + return d >= -tol && d <= std::abs(sweep) + tol; +} + +// Every point where two lines/arcs meet (tangent contact included). Exact, no sampling. +void entity_intersections(const SketchEntity& A, const SketchEntity& B, std::vector& out) +{ + using T = SketchEntity::Type; + const double eps = 1e-9; + auto on_seg = [](const SketchEntity& L, const Vec2d& p) { + const Vec2d d = L.p1 - L.p0; + const double l2 = d.squaredNorm(); + if (l2 < 1e-24) return false; + const double t = (p - L.p0).dot(d) / l2; + return t >= -1e-9 && t <= 1.0 + 1e-9; + }; + if (A.type == T::Line && B.type == T::Line) { + const Vec2d r = A.p1 - A.p0, q = B.p1 - B.p0, w = B.p0 - A.p0; + const double den = r.x() * q.y() - r.y() * q.x(); + if (std::abs(den) < eps * r.norm() * q.norm()) { + // Parallel. Collinear overlap is a crossing wherever it is: report the overlap's + // nearest end, which the caller then tests against the shared joints. + if (std::abs(r.x() * w.y() - r.y() * w.x()) > 1e-9 * std::max(1.0, r.norm())) return; + for (const Vec2d& p : { B.p0, B.p1 }) if (on_seg(A, p)) out.push_back(p); + for (const Vec2d& p : { A.p0, A.p1 }) if (on_seg(B, p)) out.push_back(p); + return; + } + const double t = (w.x() * q.y() - w.y() * q.x()) / den; + const double u = (w.x() * r.y() - w.y() * r.x()) / den; + if (t >= -1e-9 && t <= 1.0 + 1e-9 && u >= -1e-9 && u <= 1.0 + 1e-9) out.push_back(A.p0 + t * r); + return; + } + if (A.type == T::Arc && B.type == T::Line) { entity_intersections(B, A, out); return; } + if (A.type == T::Line && B.type == T::Arc) { + const Vec2d d = A.p1 - A.p0, f = A.p0 - B.center; + const double a = d.squaredNorm(), b = 2.0 * f.dot(d), c = f.squaredNorm() - B.radius * B.radius; + if (a < 1e-24) return; + double disc = b * b - 4.0 * a * c; + if (disc < -1e-9 * a * B.radius * B.radius) return; + disc = std::sqrt(std::max(0.0, disc)); + for (double t : { (-b - disc) / (2.0 * a), (-b + disc) / (2.0 * a) }) { + if (t < -1e-9 || t > 1.0 + 1e-9) continue; + const Vec2d p = A.p0 + t * d; + if (angle_on_arc(B, std::atan2(p.y() - B.center.y(), p.x() - B.center.x()), 1e-9)) + out.push_back(p); + } + return; + } + if (A.type == T::Arc && B.type == T::Arc) { + const Vec2d dc = B.center - A.center; + const double dd = dc.norm(); + if (dd < 1e-12) { + // Concentric: they overlap only on the same circle, and then everywhere they share. + if (std::abs(A.radius - B.radius) > 1e-9) return; + for (const Vec2d& p : { B.p0, B.p1 }) + if (angle_on_arc(A, std::atan2(p.y() - A.center.y(), p.x() - A.center.x()), 1e-9)) out.push_back(p); + for (const Vec2d& p : { A.p0, A.p1 }) + if (angle_on_arc(B, std::atan2(p.y() - B.center.y(), p.x() - B.center.x()), 1e-9)) out.push_back(p); + return; + } + if (dd > A.radius + B.radius + 1e-9 || dd < std::abs(A.radius - B.radius) - 1e-9) return; + const double x = (dd * dd + A.radius * A.radius - B.radius * B.radius) / (2.0 * dd); + const double h = std::sqrt(std::max(0.0, A.radius * A.radius - x * x)); + const Vec2d u = dc / dd, m = A.center + x * u, n(-u.y(), u.x()); + for (const Vec2d& p : { Vec2d(m + h * n), Vec2d(m - h * n) }) { + if (angle_on_arc(A, std::atan2(p.y() - A.center.y(), p.x() - A.center.x()), 1e-9) && + angle_on_arc(B, std::atan2(p.y() - B.center.y(), p.x() - B.center.x()), 1e-9)) + out.push_back(p); + if (h < 1e-12) break; + } + } +} + +} // namespace + +bool sketch_loop_defect(const std::vector& ents, const std::vector& order, Vec2d& at) +{ + using T = SketchEntity::Type; + const size_t n = order.size(); + if (n < 2) return false; + for (int ei : order) + if (ei < 0 || ei >= int(ents.size()) || (ents[ei].type != T::Line && ents[ei].type != T::Arc)) + return false; + const double tol = std::max(1e-6, sketch_join_tol()); + + // Traversal direction of each entity: the end it shares with the NEXT one is where it + // finishes. start[k]/end[k] are the traversal's ends. + std::vector start(n), end(n); + std::vector rev(n, false); + for (size_t k = 0; k < n; ++k) { + const SketchEntity& e = ents[order[k]]; + const SketchEntity& nx = ents[order[(k + 1) % n]]; + const double to_next_p1 = std::min((e.p1 - nx.p0).norm(), (e.p1 - nx.p1).norm()); + const double to_next_p0 = std::min((e.p0 - nx.p0).norm(), (e.p0 - nx.p1).norm()); + rev[k] = to_next_p0 < to_next_p1; + start[k] = rev[k] ? e.p1 : e.p0; + end[k] = rev[k] ? e.p0 : e.p1; + } + auto tangent = [&](size_t k, bool at_end) { + const SketchEntity& e = ents[order[k]]; + Vec2d t; + if (e.type == T::Line) { + t = e.p1 - e.p0; + } else { + const double a = at_end ? (rev[k] ? e.start_angle : e.end_angle) + : (rev[k] ? e.end_angle : e.start_angle); + const double s = (e.end_angle >= e.start_angle) ? 1.0 : -1.0; + t = s * Vec2d(-std::sin(a), std::cos(a)); + } + if (rev[k]) t = -t; + const double l = t.norm(); + return l > 1e-15 ? Vec2d(t / l) : Vec2d(0, 0); + }; + + // Cusps: the curve arriving at a joint and the one leaving it point opposite ways. + for (size_t k = 0; k < n; ++k) { + const size_t j = (k + 1) % n; + if (tangent(k, true).dot(tangent(j, false)) < -0.9999) { at = end[k]; return true; } + } + + // Crossings: any contact between two entities away from the joints they share. + for (size_t i = 0; i < n; ++i) + for (size_t j = i + 1; j < n; ++j) { + std::vector hits; + entity_intersections(ents[order[i]], ents[order[j]], hits); + const bool next = (j == i + 1), prev = (i == 0 && j == n - 1); + for (const Vec2d& p : hits) { + bool joint = false; + if (next && (p - end[i]).norm() < tol) joint = true; + if (prev && (p - start[i]).norm() < tol) joint = true; + if (!joint) { at = p; return true; } + } + } + return false; +} + bool sketch_closest_ends(const SketchEntity& A, const SketchEntity& B, SketchPointRole& ra, SketchPointRole& rb, Vec2d& pa, Vec2d& pb) { diff --git a/src/libslic3r/CAD/SketchEngine.hpp b/src/libslic3r/CAD/SketchEngine.hpp index f433b90bce..785102c205 100644 --- a/src/libslic3r/CAD/SketchEngine.hpp +++ b/src/libslic3r/CAD/SketchEngine.hpp @@ -164,6 +164,15 @@ int sketch_entity_ends(const SketchEntity& e, std::pair bool sketch_closest_ends(const SketchEntity& A, const SketchEntity& B, SketchPointRole& ra, SketchPointRole& rb, Vec2d& pa, Vec2d& pb); +// Where a CLOSED loop fails to bound one region, although every joint meets: two of its +// entities touch somewhere other than a joint they share (the loop crosses itself), or a joint +// where the curve turns straight back along itself (a cusp: an arc leaving a line tangent to it +// but heading the other way). Either makes a face OCCT accepts and then builds an invalid solid +// from. `order` lists the loop's entity indices in traversal order, as the chainer found them. +// Lines and arcs are judged exactly; a loop holding any other kind is not judged (false). +// On true, `at` is the offending point in sketch coordinates. +bool sketch_loop_defect(const std::vector& ents, const std::vector& order, Vec2d& at); + // Why an entity-constraint pick is refused. The caller maps a reason to a localized string; // the planner itself stays translation-free. enum class ConstraintReject { diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 31beb1e407..1f581561e2 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -889,6 +889,20 @@ void DesignSketchTool::resolve_live_drag(int dragged_ei, SketchPointRole dragged m_bad_dims.clear(); } if (on_solve_state) on_solve_state(m_dof, m_solve_ok, has); + announce_loop_defects(); +} + +// The red tint and marker on a loop that crosses or folds back explain nothing on their own, so +// the first time one appears the status line says what they mean. Once, on the transition: this +// runs on every solve, drags included. +void DesignSketchTool::announce_loop_defects() +{ + bool any = false; + for (const RegionLoop& r : region_loops(m_entities)) + if (r.defect) { any = true; break; } + if (any && !m_loop_defect_shown) + notify(_u8L("This profile crosses or folds back on itself at the red mark, so it does not bound one region")); + m_loop_defect_shown = any; } // ---- Onshape-style visual editing: feature grouping + handles ----------------- @@ -6757,6 +6771,12 @@ DesignSketchTool::region_loops(const std::vector& ents) const } if (best >= 0) regions[best].holes.push_back(int(i)); } + // Closed is not the same as bounding one region: the chainer only asks whether the ends + // meet. A loop that crosses itself, or turns straight back along itself, meets at every + // joint and still cannot be built — the kernel refuses a crossing, and a fold back is never + // what was meant. Say so here, where the region is drawn, instead of after an extrude. + for (RegionLoop& r : regions) + r.defect = sketch_loop_defect(ents, r.ents, r.defect_at); return regions; } @@ -9049,14 +9069,21 @@ void DesignSketchTool::render(GLCanvas3D& canvas) for (const RegionLoop& L : loops) for (int h : L.holes) if (h >= 0 && h < int(is_hole.size())) is_hole[h] = 1; + std::vector defects; for (size_t r = 0; r < loops.size(); ++r) { + if (loops[r].defect) defects.push_back(loops[r].defect_at); if (is_hole[r]) continue; std::vector> hp; for (int h : loops[r].holes) if (h >= 0 && h < int(loops.size())) hp.push_back(loops[h].poly); - draw_fill_holed(m_fill_model, loops[r].poly, hp, design_idle_face_color()); + // A loop that crosses or folds back is tinted red, not offered as a face. + draw_fill_holed(m_fill_model, loops[r].poly, hp, + loops[r].defect ? ColorRGBA(1.0f, 0.22f, 0.22f, 0.18f) : design_idle_face_color()); } glsafe(::glDisable(GL_BLEND)); + if (!defects.empty()) // and the place it goes wrong gets a screen-constant red marker + draw_vertices(m_vertex_model, defects, ColorRGBA(1.0f, 0.22f, 0.22f, 1.0f), + 5.0 / std::max(camera.get_zoom(), 1e-6)); } } @@ -9741,6 +9768,8 @@ DesignSketchTool::LoopReport DesignSketchTool::loop_report() const li.ents = r.ents; li.holes = r.holes; li.closed = true; + li.defect = r.defect; + li.defect_at = r.defect_at; // Analytic where the loop IS one closed curve; shoelace only where it is a chain. // region_loops hands back the render polyline, and a circle's is a 64-gon whose area is // 0.3% short — a number reported as "area" must not be the faceting error. diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index 60a7fa25dd..88c5e1fee9 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -523,6 +523,8 @@ public: std::vector holes; // indices into LoopReport::loops that this loop encloses bool closed{false}; double area{0.0}; // signed shoelace area of the loop polyline + bool defect{false}; // crosses or folds back on itself (see RegionLoop) + Vec2d defect_at{0, 0}; }; struct LoopReport { std::vector loops; @@ -701,6 +703,8 @@ private: bool selection_valid() const; // all selection indices in range void record_dimension_constraint(double v); // append the driving def for the selection void resolve_live(); // solve accumulated constraints on m_entities now + void announce_loop_defects(); // status line, once, when a loop starts crossing itself + bool m_loop_defect_shown{false}; // Drag-aware re-solve: pins the dragged point at its current coord and lets the // solver move the rest (Slvs dragged[]). Used live while a point grab is active. void resolve_live_drag(int dragged_ei, SketchPointRole dragged_role); @@ -965,6 +969,10 @@ private: std::vector poly; std::vector ents; std::vector holes; // indices into the same vector; one nesting level + // Closed, but crossing itself or turning straight back somewhere (sketch_loop_defect): + // it does not bound one region, whatever the chainer says. defect_at names the place. + bool defect{false}; + Vec2d defect_at{0, 0}; }; std::vector region_loops(const std::vector& ents) const; // Index of the closed region containing plane-point p (point-in-polygon), or -1. diff --git a/src/slic3r/GUI/CAD/McpControl.cpp b/src/slic3r/GUI/CAD/McpControl.cpp index 90148abee1..8f9f161d76 100644 --- a/src/slic3r/GUI/CAD/McpControl.cpp +++ b/src/slic3r/GUI/CAD/McpControl.cpp @@ -1500,9 +1500,13 @@ json sketch_report(DesignSketchTool& t) } json open_ends = json::array(); for (const Vec2d& p : rep.open_ends) open_ends.push_back(json::array({p.x(), p.y()})); - // A profile is buildable when at least one loop closed and nothing is left dangling. - const bool buildable = !rep.loops.empty() && rep.open_ends.empty(); - return json{{"closed_loops", loops}, {"open_ends", open_ends}, {"buildable", buildable}}; + // A profile is buildable when at least one loop closed, nothing is left dangling and no loop + // crosses or folds back on itself. + json defects = json::array(); + for (const auto& l : rep.loops) + if (l.defect) defects.push_back(json::array({l.defect_at.x(), l.defect_at.y()})); + const bool buildable = !rep.loops.empty() && rep.open_ends.empty() && defects.empty(); + return json{{"closed_loops", loops}, {"open_ends", open_ends}, {"defects", defects}, {"buildable", buildable}}; } json action_sketch_describe(DesignPanel* panel, const json& params) diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index 135905b116..5ce265e06d 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -7987,6 +7987,98 @@ TEST_CASE("dressup: four chamfer ids captured up-front drift as earlier chamfers REQUIRE(ok); } +// A closed chain that fails to bound one region although every joint meets, recorded on the rig: +// a top line, an arc that leaves its end heading back over it (crossing it again 2.5 mm on), and +// a 241 deg clockwise arc that leaves a 0.28 mm line tangent to it but the other way (a cusp). +// MakeFace accepted it and the prism came out as walls with no caps. The loop analysis must name +// the point, and the extrude must refuse it with a reason; the same arcs swept the other way round +// are an ordinary profile. +namespace { +enum class Fold { None, Crossing, Cusp, Both }; +std::vector folding_profile(Fold fold) +{ + auto line = [](Vec2d a, Vec2d b) { SketchEntity e; e.type = SketchEntity::Type::Line; e.p0 = a; e.p1 = b; return e; }; + auto arc = [](Vec2d a, Vec2d b, Vec2d c, double r, double a0, double a1) { + SketchEntity e; e.type = SketchEntity::Type::Arc; e.p0 = a; e.p1 = b; e.center = c; e.radius = r; + e.start_angle = a0; e.end_angle = a1; return e; }; + const Vec2d A(3.745882, 40.003810), B(54.449392, 40.003810), C(52.800871, -34.610853), + D(7.730833, -51.667501), E(-32.425978, -102.110463), F(-48.295291, -47.364094), + G(-48.017198, -47.364094); + const double TWO_PI = 2.0 * M_PI; + const bool cross = fold == Fold::Crossing || fold == Fold::Both; + const bool cusp = fold == Fold::Cusp || fold == Fold::Both; + // B->C: clockwise it bulges out to the right; counter-clockwise (recorded) it leaves B back + // over the top line and crosses it. G->A, centred right above G so it is tangent to F->G: + // counter-clockwise it carries on from F->G; clockwise (recorded) it turns straight back. + const double b0 = 1.536417, b1 = 4.702588; + const double g0 = -M_PI / 2.0, g1 = std::atan2(A.y() - 11.653958, A.x() + 48.017198); + return { + line(A, B), + arc(B, C, Vec2d(53.166645, 2.706608), 37.319254, b0, cross ? b1 : b1 - TWO_PI), + line(C, D), + line(D, E), + line(E, F), + line(F, G), + arc(G, A, Vec2d(-48.017198, 11.653958), 59.018053, g0, cusp ? g1 - TWO_PI : g1), + }; +} +} // namespace + +TEST_CASE("loop analysis: a closed loop that crosses or folds back names the point", "[sketch]") +{ + const std::vector order{ 0, 1, 2, 3, 4, 5, 6 }; + Vec2d at; + REQUIRE_FALSE(sketch_loop_defect(folding_profile(Fold::None), order, at)); + + REQUIRE(sketch_loop_defect(folding_profile(Fold::Cusp), order, at)); + INFO("cusp at " << at.transpose()); + REQUIRE((at - Vec2d(-48.017198, -47.364094)).norm() < 1e-3); // the joint G + + REQUIRE(sketch_loop_defect(folding_profile(Fold::Crossing), order, at)); + INFO("crossing at " << at.transpose()); + REQUIRE(std::abs(at.y() - 40.003810) < 1e-3); // on the top line... + REQUIRE(at.x() > 50.0); // ...a little before B + REQUIRE(at.x() < 54.4); + + // Traversal order does not matter: the same loop walked backwards. + const std::vector back{ 6, 5, 4, 3, 2, 1, 0 }; + REQUIRE(sketch_loop_defect(folding_profile(Fold::Cusp), back, at)); + REQUIRE_FALSE(sketch_loop_defect(folding_profile(Fold::None), back, at)); + + // Ordinary joints are not defects: a fillet-like tangent join and a straight continuation. + SketchEntity l1; l1.type = SketchEntity::Type::Line; l1.p0 = Vec2d(0, 0); l1.p1 = Vec2d(10, 0); + SketchEntity l2; l2.type = SketchEntity::Type::Line; l2.p0 = Vec2d(10, 0); l2.p1 = Vec2d(20, 0); + SketchEntity a1; a1.type = SketchEntity::Type::Arc; a1.center = Vec2d(20, 5); a1.radius = 5; + a1.start_angle = -M_PI / 2; a1.end_angle = M_PI / 2; a1.p0 = Vec2d(20, 0); a1.p1 = Vec2d(20, 10); + SketchEntity l3; l3.type = SketchEntity::Type::Line; l3.p0 = Vec2d(20, 10); l3.p1 = Vec2d(0, 10); + SketchEntity l4; l4.type = SketchEntity::Type::Line; l4.p0 = Vec2d(0, 10); l4.p1 = Vec2d(0, 0); + REQUIRE_FALSE(sketch_loop_defect({ l1, l2, a1, l3, l4 }, { 0, 1, 2, 3, 4 }, at)); +} + +TEST_CASE("extrude: a profile that folds back on itself is refused with a reason", "[CadDocument][sketch]") +{ + // A cusp alone still makes a face OCCT calls valid (the spike it leaves is 0.009 mm wide), so + // the kernel builds it; the viewport's loop analysis is what flags it. A crossing does not. + for (Fold f : { Fold::Crossing, Fold::Both }) { + CadDocument bad; + const int sk = bad.add_sketch_entities(folding_profile(f), SketchPlane::XY(), "Sketch"); + bad.add_extrude(sk, 69.42, false, BooleanMode::New, "Extrude"); + INFO("fold kind " << int(f) << ": " << bad.error); + REQUIRE_FALSE(bad.recompute()); + REQUIRE(bad.error.find("folds back") != std::string::npos); + } + + CadDocument good; + const int sk2 = good.add_sketch_entities(folding_profile(Fold::None), SketchPlane::XY(), "Sketch"); + good.add_extrude(sk2, 69.42, false, BooleanMode::New, "Extrude"); + REQUIRE(good.recompute()); + REQUIRE(good.error.empty()); + REQUIRE(good.bodies.size() == 1); + const auto mp = GeometryEngine::mass_properties(good.bodies[0].shape); + REQUIRE(mp.is_solid); + REQUIRE(mp.volume > 0.0); +} + // Several picked edges dressed by ONE feature: every id is resolved against the same body, so // capturing them up-front is correct here (unlike the chain of single-edge features above). TEST_CASE("dressup: one fillet on four picked edges equals the Top face group", "[CadDocument][dressup]") From 498379697027d66c3f49718a204e916dc338f3ab Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 15:44:02 +0000 Subject: [PATCH 147/389] Design tab: sketch Offset takes the whole outline, not one segment Offset worked on the single entity under the pointer. On an outline made of many short entities (a text glyph, an imported shape) that is a segment a few tenths of a millimetre long, and the starting distance was a tenth of that: the ghost was too small to see, and a typed distance moved one invisible segment. It read as "Offset does nothing, no preview". - The pick takes the chain the entity belongs to (connected_loop, same construction state), highlights all of it, and offsets it as one outline through offset_entities, which already joins and trims chains at their seams. - The starting distance is a twentieth of the outline's size, so the preview is visible at once. - The arrow reads its side off the ghost, since the engine may walk the picked entity backwards in the chain; it keeps pointing at the offset copy, flipped for a negative distance. - A single entity still gets its Parallel/Concentric constraint. A chain's offset is placed as geometry, since its joined entities no longer map one to one onto the originals. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- src/slic3r/GUI/CAD/DesignPanel.cpp | 2 +- src/slic3r/GUI/CAD/DesignSketchTool.cpp | 59 ++++++++++++++++++++++--- src/slic3r/GUI/CAD/DesignSketchTool.hpp | 4 ++ 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 3678d8861c..665aa0f382 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -6283,7 +6283,7 @@ static wxString sketch_step_prompt(DesignSketchTool::Mode m, int step, int picks : _L("Chamfer — drag the arrow, or click the number to type the setback · " "Enter applies · Esc cancels"); case Mode::Offset: - return step == 0 ? _L("Offset — click the entity to offset") + return step == 0 ? _L("Offset — click a curve; its whole outline is offset") : _L("Offset — drag the arrow to either side, or click the number to type " "the distance · Enter applies · Esc cancels"); case Mode::Mirror: diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 1f581561e2..5d3a8df075 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -7895,6 +7895,15 @@ void DesignSketchTool::reset_op() m_op_ghost.clear(); m_op_dragging_arrow = false; m_mirror_targets.clear(); + m_op_chain.clear(); +} + +std::vector DesignSketchTool::op_chain_entities() const +{ + std::vector out; + for (int i : m_op_chain) + if (i >= 0 && i < int(m_entities.size())) out.push_back(m_entities[i]); + return out; } // ---- Imported-art bounding-box transform gizmo (Mode::TransformArt) ---- @@ -8083,7 +8092,27 @@ void DesignSketchTool::recompute_op_ghost() m_op_anchor = e.center + Vec2d(e.radius, 0.0); m_op_dir = Vec2d(ccw ? -1.0 : 1.0, 0.0); } - m_op_ghost = SketchEngine::offset_entities({ e }, m_op_value); + m_op_ghost = SketchEngine::offset_entities(op_chain_entities(), m_op_value); + // In a chain the engine walks the entities in its own traversal order, so the picked + // one may be travelled backwards and "+distance = left" lands on the other side of it. + // Read the side off the ghost instead: the arrow points from the picked entity to its + // offset copy, flipped for a negative distance, so dragging it always follows the ghost. + if (m_op_chain.size() > 1 && std::abs(m_op_value) > 1e-12 && !m_op_ghost.empty()) { + double best = 1e30; Vec2d near = m_op_anchor; + for (const SketchEntity& g : m_op_ghost) { + bool closed = false; + const std::vector pl = entity_polyline(g, closed); + for (size_t k = 0; k + 1 < pl.size(); ++k) { + const Vec2d a = pl[k], d = pl[k + 1] - pl[k]; + const double l2 = d.squaredNorm(); + const double t = l2 > 1e-24 ? std::clamp((m_op_anchor - a).dot(d) / l2, 0.0, 1.0) : 0.0; + const Vec2d q = a + t * d; + if ((q - m_op_anchor).norm() < best) { best = (q - m_op_anchor).norm(); near = q; } + } + } + const Vec2d v = near - m_op_anchor; + if (v.norm() > 1e-12) m_op_dir = (m_op_value > 0 ? 1.0 : -1.0) * v.normalized(); + } } else if (m_mode == Mode::Mirror) { if (m_op_a < 0 || m_mirror_targets.empty()) return; const SketchEntity& axis = m_entities[m_op_a]; @@ -8120,10 +8149,22 @@ void DesignSketchTool::op_pick(int ei) break; case Mode::Offset: { m_op_a = ei; - const SketchEntity& e = m_entities[ei]; - const double sz = (e.type == SketchEntity::Type::Line) ? (e.p1 - e.p0).norm() - : std::max(e.radius * 2.0, 1.0); - m_op_value = std::max(0.001, 0.1 * sz); + // The whole outline the entity belongs to, not the one segment under the pointer: a + // glyph or an imported outline is hundreds of short lines, and offsetting one of them + // gave a ghost a few hundredths of a millimetre long — no visible preview, and a typed + // distance that moved one invisible segment. Same construction state only. + m_op_chain.clear(); + for (int ci : connected_loop(ei)) + if (m_entities[ci].construction == m_entities[ei].construction) m_op_chain.push_back(ci); + if (m_op_chain.empty()) m_op_chain.push_back(ei); + // A starting distance that is visible: a twentieth of the outline's size. + Vec2d lo(1e30, 1e30), hi(-1e30, -1e30); + for (int ci : m_op_chain) { + bool closed = false; + for (const Vec2d& q : entity_polyline(m_entities[ci], closed)) { lo = lo.cwiseMin(q); hi = hi.cwiseMax(q); } + } + const double sz = (hi.x() >= lo.x()) ? std::max(hi.x() - lo.x(), hi.y() - lo.y()) : 1.0; + m_op_value = std::max(0.001, 0.05 * sz); recompute_op_ghost(); break; } @@ -8145,6 +8186,7 @@ void DesignSketchTool::op_pick(int ei) if (m_op_a >= 0) m_selection.push_back(m_op_a); if (m_op_b >= 0) m_selection.push_back(m_op_b); for (int ti : m_mirror_targets) m_selection.push_back(ti); + for (int ci : m_op_chain) if (ci != m_op_a) m_selection.push_back(ci); if (on_selection_changed) on_selection_changed(int(m_selection.size())); } @@ -8296,17 +8338,20 @@ void DesignSketchTool::confirm_op() } } else if (m_mode == Mode::Offset) { const int a = m_op_a; - auto out = SketchEngine::offset_entities({ m_entities[a] }, m_op_value); + auto out = SketchEngine::offset_entities(op_chain_entities(), m_op_value); if (out.empty()) { notify(_u8L("Offset: an ellipse or a spline has no parallel of its own kind — pick lines, arcs or circles")); reset_op(); return; } const int ni = int(m_entities.size()); + const bool single = m_op_chain.size() <= 1; for (auto& o : out) m_entities.push_back(o); const SketchEntity::Type st = m_entities[a].type; SketchEntityConstraintDef d; d.ea = a; d.eb = ni; - bool emit = true; + // A chain's offset is joined and trimmed at its seams, so its entities no longer map one + // to one onto the originals: it is placed as geometry, without per-entity constraints. + bool emit = single; if (st == SketchEntity::Type::Line) d.type = CT::Parallel; else if (st == SketchEntity::Type::Arc || st == SketchEntity::Type::Circle) d.type = CT::Concentric; else emit = false; diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index 88c5e1fee9..57a4d087e8 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -1097,6 +1097,10 @@ private: std::vector m_op_ghost; // live result preview (recomputed on value change) bool m_op_dragging_arrow{false}; // arrowhead drag in progress std::vector m_mirror_targets; // Mirror: entities to be mirrored (axis = m_op_a) + // Offset: the whole chain the picked entity belongs to (connected by shared endpoints), so + // an outline offsets as one outline. A single entity when it is not part of a chain. + std::vector m_op_chain; + std::vector op_chain_entities() const; // In-canvas imported-art transform gizmo (Mode::TransformArt). GUI-only. The art's // untransformed contours + its bbox in base coords; the live offset/scale; the grabbed From 5d4622c822ecb005a45ac7560cb0b6fb9224a85e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 15:52:21 +0000 Subject: [PATCH 148/389] Design tab: Text is its own feature, previewed in the view and editable Reported on the rig: Text showed no preview where it would go, its dialog was pinned over the middle of the window (GNOME attaches a modal dialog to its parent and it cannot be moved), and once confirmed the text could not be edited and did not appear in the feature tree. Inside an open sketch it became loose lines of that sketch. - Text is always a feature, "Text N" in the tree. A new text goes on the plane of the open sketch (committed first when it holds anything, closed when it is empty), else centred on the picked face, else on the reference plane. - The dialog is modeless and opens at the top right of the window. The feature is created at the first character and redrawn on every change, so the text appears in the view where it will be as it is typed. Enter inserts it, then the usual move/scale gizmo and Confirm; Esc, Cancel or closing the dialog takes it out again (undo to the checkpoint taken when it appeared). - CadFeature keeps text_string, text_font (the WxFontUtils descriptor) and text_height, appended at the end of the framed recipe. Editing a Text feature reopens the dialog with them and redraws the outline in place, keeping its placement. The outlines are still saved, so the project opens the same on a machine without that font. - The MCP control refuses writes while the Text dialog is open. Tests: the text parameters survive a save and load along with the outline; the truncated-recipe test accounts for the new tail fields. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- docs/CAD/design_tab.md | 19 +++- src/libslic3r/CAD/CadDocument.hpp | 14 ++- src/slic3r/GUI/CAD/DesignPanel.cpp | 145 +++++++++++++++++++++++- src/slic3r/GUI/CAD/DesignPanel.hpp | 16 +++ src/slic3r/GUI/CAD/DesignTextDialog.cpp | 68 ++++++++--- src/slic3r/GUI/CAD/DesignTextDialog.hpp | 30 ++++- tests/libslic3r/test_caddocument.cpp | 37 +++++- 7 files changed, 290 insertions(+), 39 deletions(-) diff --git a/docs/CAD/design_tab.md b/docs/CAD/design_tab.md index 87ef8fe7a4..675c94bb4c 100644 --- a/docs/CAD/design_tab.md +++ b/docs/CAD/design_tab.md @@ -315,9 +315,22 @@ variable and the whole model follows. ## Import and export -**Text** asks for the words, the font (any installed font, bold, italic) and the height, and -shows the outline that will be inserted with its size in millimetres before anything is added. -The last font and height are remembered. +**Text** is a feature of its own, "Text N" in the tree. Its dialog asks for the words, the +font (any installed font, bold, italic) and the height, and shows the size in millimetres. The +dialog does not block the window and can be moved aside. As you type, the text is drawn in the +view where it will go: +- on the plane of the sketch that is open (a sketch holding anything is committed first); +- else centred on the picked face; +- else on the reference plane. + +Enter inserts the text; then drag or scale it and Confirm. Esc takes it out again. Editing +a Text feature reopens the dialog with its words, font and height, and redraws it in place. +The outlines are saved with the project, so it opens the same on a machine without that font. +A new text starts from the last font and height used. + +To engrave or emboss, extrude the Text feature onto the solid, Cut or Join. A text is no +longer loose lines inside another sketch, so it no longer acts as a hole in that sketch's +profile. **Import STEP** brings in a real B-rep solid, not a mesh: its faces and edges can be filleted, shelled and cut like anything modelled here. diff --git a/src/libslic3r/CAD/CadDocument.hpp b/src/libslic3r/CAD/CadDocument.hpp index c85dcac220..78473af560 100644 --- a/src/libslic3r/CAD/CadDocument.hpp +++ b/src/libslic3r/CAD/CadDocument.hpp @@ -118,6 +118,14 @@ struct CadFeature { // one edge instead of falling back to the whole face group. std::vector dressup_edges; // The edges this dress-up targets: the list, else the single edge, else none (face group). + // Text feature: a Sketch whose imported_regions were vectorised from this string in this font + // (a WxFontUtils descriptor, bold/italic included) at this cap height in mm. The regions are + // what gets built — they are saved too, so the project opens on a machine without the font — + // and these three are what an edit reopens the Text dialog with. Empty = not a text feature. + std::string text_string; + std::string text_font; + double text_height{0.0}; + bool is_text() const { return !text_string.empty(); } std::vector dressup_edge_ids() const { if (!dressup_edges.empty()) return dressup_edges; if (dressup_edge >= 0) return { dressup_edge }; @@ -395,7 +403,8 @@ struct CadFeature { mate_kind, mate_cs_a, mate_cs_b, mate_offset, mate_angle, mate_flip, coordsys_face_kind, coordsys_face_edges, thread_major_nominal, pattern_inclusive, - dressup_edges); + dressup_edges, + text_string, text_font, text_height); } template void load(Archive& ar) { @@ -436,7 +445,8 @@ struct CadFeature { mate_kind, mate_cs_a, mate_cs_b, mate_offset, mate_angle, mate_flip, coordsys_face_kind, coordsys_face_edges, thread_major_nominal, pattern_inclusive, - dressup_edges); + dressup_edges, + text_string, text_font, text_height); imported_solid = brep_from_string(brep); } // The pre-framing (v4) layout, FROZEN. A v4 recipe is one flat stream with no per-feature diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 665aa0f382..6205b82b9e 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -4566,12 +4566,139 @@ void DesignPanel::sync_sketch_display() void DesignPanel::on_add_text() { - // Font, height and a live outline with its size are chosen up front; the bbox handles - // (Move/Scale) still resize the art in the canvas afterwards. - DesignTextDialog dlg(this); - if (dlg.ShowModal() != wxID_OK || dlg.regions().empty()) + open_text_dialog(-1); +} + +// Text is a FEATURE, "Text N" in the tree, never loose lines in a sketch: that is what makes it +// visible, and editable afterwards (the feature keeps its string, font and height). While the +// dialog is open the feature is drawn in the canvas where it will be — the dialog is modeless +// so it can be moved off it — and Cancel takes it out again. A new text goes on the plane of +// the sketch that is open (committed first if it holds anything), else on the picked face +// (centred on it, ready to engrave), else on the reference plane. +void DesignPanel::open_text_dialog(int feat) +{ + if (m_text_dlg != nullptr) { m_text_dlg->Raise(); return; } + m_text_editing = feat >= 0 && feat < int(m_doc.features.size()) && m_doc.features[feat].is_text(); + m_text_feat = m_text_editing ? feat : -1; + m_text_face_body = -1; + m_text_offset = Vec2d(0, 0); + + DesignTextDialog::Spec initial; + if (m_text_editing) { + const CadFeature& f = m_doc.features[feat]; + initial = { wxString::FromUTF8(f.text_string), f.text_font, f.text_height }; + m_doc.checkpoint(); // undo boundary: Cancel restores the text as it was + } else { + if (m_viewport && m_viewport->is_sketching()) { + m_text_plane = m_viewport->mcp_sketch_tool().plane(); + if (m_viewport->live_sketch_has_work()) { + m_viewport->sketch_confirm_pending(); + m_viewport->finish_sketch(); // keep what was drawn: it is its own feature + } else { + m_viewport->cancel_sketch(); // an empty sketch was only a way to pick the plane + } + m_edit_index = -1; + set_ui_mode(UiMode::Feature); + sync_sketch_display(); + refresh_tree(); + } else if (m_sel_solid_face >= 0 && m_sel_solid_body >= 0 && m_sel_solid_body < int(m_doc.bodies.size())) { + const TopoDS_Face face = GeometryEngine::face_by_index(m_doc.bodies[m_sel_solid_body].shape, m_sel_solid_face); + if (!face.IsNull()) { + m_text_plane = SketchPlane::from_face(face); + m_text_offset = m_text_plane.project(GeometryEngine::face_centroid_world(face), m_text_plane.normal); + m_text_face_body = m_sel_solid_body; + } else { + m_text_plane = plane_from_choice(m_ref_plane); + } + } else { + m_text_plane = plane_from_choice(m_ref_plane); + } + } + + m_text_dlg = new DesignTextDialog(this, m_text_editing ? &initial : nullptr); + m_text_dlg->on_change = [this] { text_dialog_changed(); }; + m_text_dlg->on_accept = [this] { text_dialog_done(true); }; + m_text_dlg->on_cancel = [this] { text_dialog_done(false); }; + m_text_dlg->Show(); + set_status(StatusKind::Info, m_text_editing ? _L("Edit the text — Enter applies, Esc keeps it as it was") + : _L("Type the text — it appears in the view as you type; Enter inserts, Esc cancels")); +} + +void DesignPanel::text_dialog_changed() +{ + if (m_text_dlg == nullptr) return; + const ImportRegions& regions = m_text_dlg->regions(); + const DesignTextDialog::Spec sp = m_text_dlg->spec(); + const bool have = m_text_feat >= 0 && m_text_feat < int(m_doc.features.size()); + if (regions.empty()) { + // Nothing to draw. An edited text keeps its last outline (OK is disabled until there is + // text again); a new one that has not been accepted simply goes away again. + if (!m_text_editing && have) { + m_doc.undo(); + m_text_feat = -1; + m_feature_counter--; // the next keystroke brings the same "Text N" back + refresh_tree(); + sync_sketch_display(); + } return; - add_imported_sketch(dlg.regions(), _L("Text")); + } + if (!have) { + m_doc.checkpoint(); // undo boundary: the new text (Cancel removes it) + m_feature_counter++; + CadFeature f; + f.type = CadFeatureType::Sketch; + f.name = feature_name(_L("Text")); + f.plane = m_text_plane; + f.import_offset = m_text_offset; // the regions are centred on the origin + f.import_on_face = m_text_face_body >= 0; + f.import_face_body = m_text_face_body; + m_doc.features.push_back(f); + m_text_feat = int(m_doc.features.size()) - 1; + refresh_tree(); + set_tree_selection(m_text_feat); + } + CadFeature& f = m_doc.features[m_text_feat]; + f.imported_regions = regions; + f.text_string = std::string(sp.text.ToUTF8().data()); + f.text_font = sp.font; + f.text_height = sp.height; + sync_sketch_display(); // the overlay draws the feature's regions: the canvas preview +} + +void DesignPanel::text_dialog_done(bool accepted) +{ + DesignTextDialog* dlg = m_text_dlg; + m_text_dlg = nullptr; + if (dlg != nullptr) dlg->Destroy(); + const int feat = m_text_feat; + const bool editing = m_text_editing; + m_text_feat = -1; + m_text_editing = false; + const bool have = feat >= 0 && feat < int(m_doc.features.size()); + + if (!accepted) { + if (have) m_doc.undo(); // a new text leaves, an edited one gets its old outline back + refresh_tree(); + sync_sketch_display(); + set_status(StatusKind::Info, editing ? _L("Text unchanged") : _L("Text cancelled")); + return; + } + if (!have) return; + // Drop a solid-face pick now that the text sits on it, so the next Extrude acts on the text. + m_sel_solid_face = m_sel_solid_edge = m_sel_solid_body = -1; + m_doc.recompute(); // a lone sketch yields an empty body; that is expected + refresh_tree(); + set_tree_selection(feat); + sync_sketch_display(); + if (editing) { + set_status_ok(); + return; + } + // A new text still has to be placed: the same move/scale gizmo and Confirm/Cancel card as + // any inserted art. Its Cancel undoes to the checkpoint taken when the text appeared. + on_transform_imported(feat); + m_insert_feat = feat; + open_insert_card(wxString::FromUTF8(m_doc.features[feat].name)); } void DesignPanel::on_import_svg() @@ -4630,6 +4757,7 @@ bool DesignPanel::mcp_busy(bool sketch_method, std::string& why) const // A GUI editor holds a candidate built from the document as it was when it opened; a // feature added or removed underneath it would be overwritten, or overwrite, on Confirm. if (m_active != Tool::None || m_edit_index >= 0) { why = "a feature card is open in the Design tab"; return true; } + if (m_text_dlg != nullptr) { why = "the Text dialog is open in the Design tab"; return true; } if (m_ui_mode == UiMode::Constrain) { why = "the Design tab is constraining a sketch"; return true; } // Sketch methods drive the live sketch session, which is the point of them; everything else // changes the feature list, which a live sketch session is about to commit into. @@ -9323,7 +9451,12 @@ void DesignPanel::on_edit_feature() switch (f.type) { case CadFeatureType::Sketch: - // Imported Text/SVG art has no editable sketch dialog — edit means + // Text reopens its dialog: change the words, the font or the height in place. + if (f.is_text()) { + open_text_dialog(sel); + break; + } + // Imported SVG art has no editable sketch dialog — edit means // move / scale its placement instead, behind the same Confirm/Cancel gate as // the initial insert (Cancel = undo restores the prior placement). if (!f.imported_regions.empty()) { diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index c9b6e65f47..c7e20186df 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -42,6 +42,8 @@ class ScalableButton; namespace Slic3r { namespace GUI { +class DesignTextDialog; + class DesignCanvas; // Design (CAD) tab: a sketch-first, Onshape-style form-driven CAD panel. @@ -199,6 +201,11 @@ private: // imported_regions (no solver entities). on_add_text/on_import_svg gather // input; add_imported_sketch builds the feature, refreshes tree + display. void on_add_text(); + // Text is its own feature ("Text N"), drawn in the canvas while its (modeless) dialog is + // open. feat < 0 starts a new one; otherwise the text feature `feat` is reopened for editing. + void open_text_dialog(int feat); + void text_dialog_changed(); + void text_dialog_done(bool accepted); void on_import_svg(); void on_import_step(); // STEP -> editable B-rep body (keeps the OCCT solid, not a mesh) void on_import_mesh(); // STL/OBJ -> B-rep body via GeometryEngine::mesh_to_brep @@ -410,6 +417,15 @@ private: wxSizer* m_box_insert{nullptr}; // Confirm/Cancel card for placing Text/SVG art wxSizer* m_box_expr{nullptr}; // expression binding card (visible during edit only) int m_insert_feat{-1}; // provisional imported-art feature awaiting Confirm + // The open Text dialog, the feature it draws into (-1 until there is text to draw) and, + // for a new text, where it goes: plane, offset in that plane, and the body of the face it + // sits on (-1 = not on a face). + DesignTextDialog* m_text_dlg{nullptr}; + int m_text_feat{-1}; + bool m_text_editing{false}; + SketchPlane m_text_plane; + Vec2d m_text_offset{0, 0}; + int m_text_face_body{-1}; // Move-body gizmo runs through the unified action bar too: Confirm keeps the placement, // Cancel reverts to the pose captured when the move started. int m_move_body{-1}; diff --git a/src/slic3r/GUI/CAD/DesignTextDialog.cpp b/src/slic3r/GUI/CAD/DesignTextDialog.cpp index 73fd8535e6..38e1db91e3 100644 --- a/src/slic3r/GUI/CAD/DesignTextDialog.cpp +++ b/src/slic3r/GUI/CAD/DesignTextDialog.cpp @@ -25,17 +25,21 @@ namespace Slic3r { namespace GUI { static const char* kFontKey = "cad_text_font"; // WxFontUtils::store_wxFont descriptor static const char* kHeightKey = "cad_text_height"; // mm -DesignTextDialog::DesignTextDialog(wxWindow* parent) +DesignTextDialog::DesignTextDialog(wxWindow* parent, const Spec* initial) : DPIDialog(parent, wxID_ANY, _L("Text"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE) { SetFont(wxGetApp().normal_font()); SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(0x2d, 0x2d, 0x31) : *wxWHITE); const int em = em_unit(); - // Last used font and height, else the system GUI font at 10 mm. + // The text being edited, else the last used font and height, else the GUI font at 10 mm. wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); double height = 10.0; - if (AppConfig* cfg = wxGetApp().app_config) { + if (initial != nullptr) { + wxFont f = WxFontUtils::load_wxFont(initial->font); + if (f.IsOk()) font = f; + if (initial->height > 0.0) height = std::clamp(initial->height, 0.5, 500.0); + } else if (AppConfig* cfg = wxGetApp().app_config) { const std::string desc = cfg->get(kFontKey); if (!desc.empty()) { wxFont f = WxFontUtils::load_wxFont(desc); @@ -50,8 +54,8 @@ DesignTextDialog::DesignTextDialog(wxWindow* parent) auto* form = new wxFlexGridSizer(2, em / 2, em); form->AddGrowableCol(1, 1); - m_text = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(30 * em, -1), - wxTE_PROCESS_ENTER); + m_text = new wxTextCtrl(this, wxID_ANY, initial ? initial->text : wxString(), wxDefaultPosition, + wxSize(30 * em, -1), wxTE_PROCESS_ENTER); m_text->SetHint(_L("Type the text to insert")); form->Add(new wxStaticText(this, wxID_ANY, _L("Text")), 0, wxALIGN_CENTER_VERTICAL); form->Add(m_text, 1, wxEXPAND); @@ -84,7 +88,8 @@ DesignTextDialog::DesignTextDialog(wxWindow* parent) form->Add(m_height, 0); // The outline of what will be inserted, fitted to the box, with its real size under it. - m_preview = new wxWindow(this, wxID_ANY, wxDefaultPosition, wxSize(30 * em, 10 * em)); + // A thumbnail only: the text itself is drawn in the canvas, where it will be. + m_preview = new wxWindow(this, wxID_ANY, wxDefaultPosition, wxSize(30 * em, 5 * em)); m_preview->SetBackgroundStyle(wxBG_STYLE_PAINT); m_preview->Bind(wxEVT_PAINT, [this](wxPaintEvent&) { draw_preview(m_preview); }); m_preview->Bind(wxEVT_SIZE, [this](wxSizeEvent& e) { m_preview->Refresh(); e.Skip(); }); @@ -100,9 +105,7 @@ DesignTextDialog::DesignTextDialog(wxWindow* parent) top->Add(buttons, 0, wxEXPAND); m_text->Bind(wxEVT_TEXT, [this](wxCommandEvent&) { update_preview(); }); - m_text->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent&) { - if (!m_regions.empty()) EndModal(wxID_OK); // Enter = OK, as everywhere in the tab - }); + m_text->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent&) { accept(); }); // Enter = OK, as everywhere in the tab auto refont = [this](wxCommandEvent&) { load_font(); update_preview(); }; m_face->Bind(wxEVT_CHOICE, refont); m_bold->Bind(wxEVT_CHECKBOX, refont); @@ -110,18 +113,25 @@ DesignTextDialog::DesignTextDialog(wxWindow* parent) m_height->Bind(wxEVT_SPINCTRLDOUBLE, [this](wxSpinDoubleEvent&) { update_preview(); }); m_height->Bind(wxEVT_TEXT, [this](wxCommandEvent&) { update_preview(); }); Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) { - if (e.GetId() != wxID_OK) { e.Skip(); return; } - if (m_regions.empty()) return; // nothing to insert: the size line says why - if (AppConfig* cfg = wxGetApp().app_config) { - cfg->set(kFontKey, WxFontUtils::store_wxFont(current_font())); - cfg->set(kHeightKey, std::to_string(m_height->GetValue())); - } - EndModal(wxID_OK); + if (e.GetId() == wxID_OK) accept(); + else if (e.GetId() == wxID_CANCEL) cancel(); + else e.Skip(); + }); + Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent&) { cancel(); }); + Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& e) { + if (e.GetKeyCode() == WXK_ESCAPE) cancel(); + else e.Skip(); }); wxGetApp().UpdateDlgDarkUI(this); SetSizerAndFit(top); - CenterOnParent(); + // Out of the middle of the window, where the text is being placed: top right of the parent. + if (parent != nullptr) { + const wxRect pr = parent->GetScreenRect(); + SetPosition(wxPoint(std::max(pr.GetLeft(), pr.GetRight() - GetSize().x - 2 * em), pr.GetTop() + 8 * em)); + } else { + CenterOnParent(); + } load_font(); update_preview(); @@ -130,6 +140,29 @@ DesignTextDialog::DesignTextDialog(wxWindow* parent) wxString DesignTextDialog::text() const { return m_text->GetValue(); } +DesignTextDialog::Spec DesignTextDialog::spec() const +{ + return { m_text->GetValue(), WxFontUtils::store_wxFont(current_font()), m_height->GetValue() }; +} + +void DesignTextDialog::accept() +{ + if (m_done || m_regions.empty()) return; // nothing to insert: the size line says why + m_done = true; + if (AppConfig* cfg = wxGetApp().app_config) { + cfg->set(kFontKey, WxFontUtils::store_wxFont(current_font())); + cfg->set(kHeightKey, std::to_string(m_height->GetValue())); + } + if (on_accept) on_accept(); +} + +void DesignTextDialog::cancel() +{ + if (m_done) return; + m_done = true; + if (on_cancel) on_cancel(); +} + wxFont DesignTextDialog::current_font() const { wxFontInfo info(12); @@ -175,6 +208,7 @@ void DesignTextDialog::update_preview() m_size->SetLabel(line); if (m_ok) m_ok->Enable(!m_regions.empty()); m_preview->Refresh(); + if (on_change) on_change(); } void DesignTextDialog::draw_preview(wxWindow* canvas) diff --git a/src/slic3r/GUI/CAD/DesignTextDialog.hpp b/src/slic3r/GUI/CAD/DesignTextDialog.hpp index 76ac86267f..3200301880 100644 --- a/src/slic3r/GUI/CAD/DesignTextDialog.hpp +++ b/src/slic3r/GUI/CAD/DesignTextDialog.hpp @@ -6,7 +6,9 @@ #include +#include #include +#include class wxTextCtrl; class wxChoice; @@ -18,18 +20,31 @@ namespace Slic3r { namespace Emboss { struct FontFile; } namespace GUI { -// Text for the Design tab: the words, the font (face, bold, italic) and the height, with a -// live outline of exactly what will be inserted and its size in millimetres. The outline IS -// the result — the same vectorisation the sketch receives — so there is nothing to guess. -// Enter inserts, Esc cancels (charter 4.2). The last font and height are remembered. +// Text for the Design tab: the words, the font (face, bold, italic) and the height, with the +// size in millimetres of exactly what will be inserted. MODELESS: the host draws the text in +// the canvas as it is typed (on_change), so the dialog stays out of the way and can be moved — +// a modal dialog is pinned over the middle of the window on GNOME. Enter or OK accepts, Esc, +// Cancel or closing it cancels (charter 4.2); each fires its callback once and the host then +// destroys the dialog. A new text starts from the last font and height used. class DesignTextDialog : public DPIDialog { public: - explicit DesignTextDialog(wxWindow* parent); + struct Spec { + wxString text; + std::string font; // WxFontUtils::store_wxFont descriptor (face, bold, italic) + double height{10.0}; + }; + // `initial` reopens an existing text for editing; nullptr starts a new one. + DesignTextDialog(wxWindow* parent, const Spec* initial = nullptr); - // The vectorised text, centred on the origin, in mm. Empty unless the dialog ended wxID_OK. + // The vectorised text, centred on the origin, in mm. Empty when there is nothing to insert. const ImportRegions& regions() const { return m_regions; } wxString text() const; + Spec spec() const; + + std::function on_change; // the outline changed (text, font or height) + std::function on_accept; // Enter / OK with something to insert + std::function on_cancel; // Esc / Cancel / closed protected: void on_dpi_changed(const wxRect& suggested_rect) override; @@ -39,6 +54,9 @@ private: void update_preview(); // text/font/height -> m_regions + size label wxFont current_font() const; void draw_preview(wxWindow* canvas); + void accept(); + void cancel(); + bool m_done{false}; // accept/cancel fire once wxTextCtrl* m_text{nullptr}; wxChoice* m_face{nullptr}; diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index 5ce265e06d..ce695079f7 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -2348,11 +2348,12 @@ TEST_CASE("a truncated feature keeps what it could read", "[CadDocument][recipe] // Shorten feature 1 so it ends right after coordsys_face_kind: drop coordsys_face_edges // (4 bytes), the two flags appended after it (thread_major_nominal, pattern_inclusive: - // 1 byte each) and the empty dressup_edges list (its 8-byte size tag). Rewrite its length - // prefix and erase the tail bytes. The reader then runs out inside fa(f), throws, and keeps - // everything it had already assigned — that is the whole point of the try/catch. (Cut on a - // field boundary: a field cut in half is read as whatever half arrived.) - const size_t drop = sizeof(uint32_t) + 2 * sizeof(bool) + sizeof(cereal::size_type); + // 1 byte each), the empty dressup_edges list and the two empty text strings (an 8-byte size + // tag each) and text_height (a double). Rewrite its length prefix and erase the tail bytes. + // The reader then runs out inside fa(f), throws, and keeps everything it had already + // assigned — that is the whole point of the try/catch. (Cut on a field boundary: a field + // cut in half is read as whatever half arrived.) + const size_t drop = sizeof(uint32_t) + 2 * sizeof(bool) + 3 * sizeof(cereal::size_type) + sizeof(double); REQUIRE(f_len[1] > drop); std::string shortened = blob; shortened.erase(f_off[1] + 4 + f_len[1] - drop, drop); @@ -2371,6 +2372,7 @@ TEST_CASE("a truncated feature keeps what it could read", "[CadDocument][recipe] REQUIRE_FALSE(loaded.features[1].thread_major_nominal); // ...and so were the later flags REQUIRE_FALSE(loaded.features[1].pattern_inclusive); REQUIRE(loaded.features[1].dressup_edges.empty()); + REQUIRE_FALSE(loaded.features[1].is_text()); REQUIRE(loaded.features[0].name == doc.features[0].name); REQUIRE(loaded.features[2].name == doc.features[2].name); } @@ -8079,6 +8081,31 @@ TEST_CASE("extrude: a profile that folds back on itself is refused with a reason REQUIRE(mp.volume > 0.0); } +TEST_CASE("text feature: its string, font and height survive a save and load", "[CadDocument][recipe]") +{ + CadDocument doc; + CadFeature f; + f.type = CadFeatureType::Sketch; + f.name = "Text 1"; + f.plane = SketchPlane::XY(); + f.imported_regions = { { { Vec2d(0, 0), Vec2d(4, 0), Vec2d(4, 6), Vec2d(0, 6) } } }; + f.text_string = "Ab ÷ 12"; + f.text_font = "Noto Sans;Bold"; + f.text_height = 7.5; + doc.features.push_back(f); + REQUIRE(doc.recompute()); + + CadDocument back; + REQUIRE(back.deserialize_recipe(doc.serialize_recipe())); + REQUIRE(back.features.size() == 1); + const CadFeature& g = back.features[0]; + REQUIRE(g.is_text()); + REQUIRE(g.text_string == f.text_string); + REQUIRE(g.text_font == f.text_font); + REQUIRE(g.text_height == f.text_height); + REQUIRE(g.imported_regions == f.imported_regions); // the outline is saved, not re-derived +} + // Several picked edges dressed by ONE feature: every id is resolved against the same body, so // capturing them up-front is correct here (unlike the chain of single-edge features above). TEST_CASE("dressup: one fillet on four picked edges equals the Top face group", "[CadDocument][dressup]") From b060101707604df8dccf133d1ed69a96bd4de3ea Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 16:27:11 +0000 Subject: [PATCH 149/389] Design tab: Text verb hint describes the Text feature The context menu still said the text outline is added to the sketch as editable lines, which is what it did before Text became its own feature. Only SVG goes into the open sketch now; the comments on that path say so. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- src/slic3r/GUI/CAD/DesignCanvas.hpp | 2 +- src/slic3r/GUI/CAD/DesignOffer.hpp | 2 +- src/slic3r/GUI/CAD/DesignPanel.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/CAD/DesignCanvas.hpp b/src/slic3r/GUI/CAD/DesignCanvas.hpp index 191b2bbdc0..21357021c7 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.hpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.hpp @@ -63,7 +63,7 @@ public: // Is the sketch tool on Select (as opposed to a draw/edit tool being armed)? The // Construction box needs it to tell "convert what I picked" from "arm what I draw next". bool sketch_is_selecting() const { return m_sketch_tool.mode() == DesignSketchTool::Mode::Select; } - // Text / SVG art into the LIVE sketch, as ordinary editable lines. False = no session. + // SVG art into the LIVE sketch, as ordinary editable lines. False = no session. bool add_sketch_regions(const std::vector>>& regions); void set_sketch_polygon_sides(int n); void set_sketch_polygon_circumscribed(bool c); diff --git a/src/slic3r/GUI/CAD/DesignOffer.hpp b/src/slic3r/GUI/CAD/DesignOffer.hpp index 5ccb929be2..51310ea8b8 100644 --- a/src/slic3r/GUI/CAD/DesignOffer.hpp +++ b/src/slic3r/GUI/CAD/DesignOffer.hpp @@ -156,7 +156,7 @@ static const OfferVerb kOfferVerbs[] = { {"sk_poly_inscribed", L("Inscribed"), 0, nullptr, "btn:polyfit#0", nullptr, 0x000f8000u, 0, 0, false, true, L("Polygon"), "design_polygon", L("Measure the polygon to its corners (inscribed)")}, {"sk_poly_circumscribed", L("Circumscribed"), 0, nullptr, "btn:polyfit#1", nullptr, 0x000f8000u, 0, 0, false, true, L("Polygon"), "design_polygon", L("Measure the polygon to its flats (circumscribed)")}, {"sk_point_t", L("Point"), 0, "P", "key:P", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_point", L("Point — click to place")}, - {"sk_text", L("Text"), 0, nullptr, "btn:text", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_text", L("Type text; its outline is added to this sketch as editable lines")}, + {"sk_text", L("Text"), 0, nullptr, "btn:text", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_text", L("Type text; it becomes a Text feature on this sketch's plane, editable later")}, {"sk_svg", L("SVG"), 0, nullptr, "btn:svg", nullptr, 0x000f8000u, 0, 0, false, true, nullptr, "design_svg", L("Import an SVG outline into this sketch as editable lines")}, {"sk_offset", L("Offset"), 1, "O", "key:O", nullptr, 0x000b0000u, 0, 0, false, true, nullptr, "design_offset", L("Offset — pick an entity, drag the distance")}, {"sk_trim", L("Trim"), 2, "T", "key:T", nullptr, 0x000b0000u, 0, 0, false, true, nullptr, "design_trim", L("Trim — click a segment to trim it")}, diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 6205b82b9e..e913beaa33 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -4993,7 +4993,8 @@ void DesignPanel::add_imported_sketch( // DRAWING, not importing: if a sketch is open, the art belongs IN it. The outlines become // ordinary line entities, so they can be constrained, trimmed and extruded with everything // else on that plane. Committing a separate Sketch feature while the user is mid-sketch put - // the text on its own plane-origin feature and left the sketch they were drawing untouched. + // the art on its own plane-origin feature and left the sketch they were drawing untouched. + // (Text no longer comes through here: it is its own feature, see open_text_dialog.) if (m_viewport && m_viewport->is_sketching() && m_viewport->add_sketch_regions(regions)) { set_status(StatusKind::Info, wxString::Format(_L("%s added to the sketch — Confirm to commit it"), base_name)); From b8d45c6bb1b1ea2fc2730a53e94e3d230f22bd68 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 16:52:27 +0000 Subject: [PATCH 150/389] Design tab: studio lighting and body edges in the 3D view Reported: once extruded, a part is hard to read; the lighting says little about its shape. Both lights of the object shaders sit near the camera, so the sides of a part come out in almost the same tone, and nothing marks where one face ends and the next begins. - The phong shader gains a studio lighting model, chosen by a new lighting_model uniform: a sky/ground hemisphere in world space (up faces cool and bright, down faces warm and dark), a key light from the upper left and a weak fill from the right, a plastic-like highlight, and a darker base with a faint sheen toward the silhouette so curved faces read as round. GLCanvas3D::set_studio_lighting() makes a canvas draw its objects with it whatever the realistic-view preferences; only the Design canvas turns it on. Every canvas sets the uniform on each use, 0 for the slicer's, so they render as before. - Every B-rep edge of a body is drawn as a thin dark line over it, depth tested and pulled a few pixels toward the eye so it wins against the faces meeting at it and hides behind the faces in front. The seam of a closed surface and degenerate edges are left out (GeometryEngine::display_edges). Edges are sampled once per shape and kept across recomputes that leave a body unchanged; bodies faded by body focus get fainter edges, and a dress-up previewing its result alone hides them with the bodies. Tests: display_edges gives a box its 12 edges at their lengths, a cylinder its two round rims without the seam, a cone its base rim without the seam or the apex. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- docs/CAD/design_tab.md | 7 ++ resources/shaders/110/phong.fs | 31 ++++++++- resources/shaders/140/phong.fs | 31 ++++++++- src/libslic3r/CAD/GeometryEngine.cpp | 22 ++++++ src/libslic3r/CAD/GeometryEngine.hpp | 4 ++ src/slic3r/GUI/CAD/DesignCanvas.cpp | 2 + src/slic3r/GUI/CAD/DesignSketchTool.cpp | 91 +++++++++++++++++++++++++ src/slic3r/GUI/CAD/DesignSketchTool.hpp | 12 ++++ src/slic3r/GUI/GLCanvas3D.cpp | 10 ++- src/slic3r/GUI/GLCanvas3D.hpp | 4 ++ tests/libslic3r/test_caddocument.cpp | 28 ++++++++ 11 files changed, 237 insertions(+), 5 deletions(-) diff --git a/docs/CAD/design_tab.md b/docs/CAD/design_tab.md index 675c94bb4c..3904df1fff 100644 --- a/docs/CAD/design_tab.md +++ b/docs/CAD/design_tab.md @@ -362,6 +362,13 @@ the plane, `F` flips which half is kept. **Place on Face** (`F`, when section is picked face flat on the bed. Origin planes (`P`) and world axes (`A`) can be toggled on while you orient yourself. +Bodies are lit as in a studio, whatever the realistic-view preferences of the slicer: faces +facing up read cooler and brighter than faces facing down, a key light from the upper left +separates the sides of a part, and curved faces darken toward their outline. Every edge of a +body is drawn as a thin dark line, except the seam OCCT puts down the side of a cylinder or +cone; the edges of bodies faded by body focus are fainter, and a dress-up previewing its +result alone hides them with the bodies. + --- ## Known limitations diff --git a/resources/shaders/110/phong.fs b/resources/shaders/110/phong.fs index 5fedf7edff..c3a5436731 100644 --- a/resources/shaders/110/phong.fs +++ b/resources/shaders/110/phong.fs @@ -64,6 +64,10 @@ uniform PrintVolumeDetection print_volume; uniform float z_far; uniform float z_near; uniform bool enable_ssao; +// 1 = the Design tab's studio lighting (studio_shade below); 0 = the two-light model above, which +// every other canvas keeps. world_up_eye is world +Z in eye space, for the hemisphere ambient. +uniform int lighting_model; +uniform vec3 world_up_eye; // Depth-based shadow map (object-on-object and self shadows). shadow_intensity == 0 disables it. uniform sampler2D shadow_map; @@ -206,6 +210,27 @@ float shadow_shade() return 1.0 - shadow_intensity * (sum / 25.0); } +// Studio lighting for the Design tab. The default model lights every face from near the camera, +// so the sides of a part come out in nearly the same tone and its form is hard to read. This one +// separates faces by their orientation in the WORLD (a sky/ground hemisphere: up-facing faces +// cool and bright, down-facing ones warm and dark), keeps a strong key light from the upper left +// and a weak fill from the right, gives a plastic-like highlight, and darkens the base colour +// toward the silhouette while adding a faint sheen there, so curved faces read as round. +vec3 studio_shade(vec3 base, vec3 n, vec3 v) +{ + vec3 key = normalize(vec3(-0.45, 0.60, 0.66)); + vec3 fill = normalize(vec3(0.70, -0.15, 0.70)); + float hemi = 0.5 + 0.5 * dot(n, normalize(world_up_eye)); + vec3 ambient = mix(vec3(0.16, 0.15, 0.14), vec3(0.40, 0.42, 0.46), hemi); + float kd = max(dot(n, key), 0.0); + float fd = max(dot(n, fill), 0.0); + vec3 diffuse = ambient + vec3(0.60) * kd + vec3(0.20) * fd; + float spec = 0.28 * pow(max(dot(n, normalize(key + v)), 0.0), 48.0) + + 0.06 * pow(max(dot(n, normalize(fill + v)), 0.0), 24.0); + float rim = pow(1.0 - clamp(dot(n, v), 0.0, 1.0), 3.0); + return base * diffuse * (1.0 - 0.30 * rim) + vec3(spec + 0.08 * rim); +} + void main() { if (any(lessThan(clipping_planes_dots, ZERO))) @@ -262,9 +287,11 @@ void main() // SSAO is applied in post-process pass. Keep base lighting unchanged here. float shade = shadow_shade(); + vec3 lit = (lighting_model == 1) ? studio_shade(color.rgb, normal, view_dir) + : (vec3(specular) + window_reflection + color.rgb * diffuse) * PHONG_BRIGHTNESS; if (is_outline) { - vec3 shaded_rgb = (vec3(specular) + window_reflection + color.rgb * diffuse) * PHONG_BRIGHTNESS * shade; + vec3 shaded_rgb = lit * shade; vec4 shaded_color = vec4(clamp(shaded_rgb, vec3(0.0), vec3(1.0)), color.a); vec2 fragCoord = gl_FragCoord.xy; float s = DetectSilho(fragCoord); @@ -282,5 +309,5 @@ void main() gl_FragColor = vec4(clamp((0.45 * texture2D(environment_tex, normalize(eye_normal).xy * 0.5 + 0.5).xyz + window_reflection + 0.8 * color.rgb * diffuse) * PHONG_BRIGHTNESS * shade, vec3(0.0), vec3(1.0)), color.a); #endif else - gl_FragColor = vec4(clamp((vec3(specular) + window_reflection + color.rgb * diffuse) * PHONG_BRIGHTNESS * shade, vec3(0.0), vec3(1.0)), color.a); + gl_FragColor = vec4(clamp(lit * shade, vec3(0.0), vec3(1.0)), color.a); } \ No newline at end of file diff --git a/resources/shaders/140/phong.fs b/resources/shaders/140/phong.fs index f847763658..a7d29a3e41 100644 --- a/resources/shaders/140/phong.fs +++ b/resources/shaders/140/phong.fs @@ -74,6 +74,10 @@ uniform PrintVolumeDetection print_volume; uniform float z_far; uniform float z_near; uniform bool enable_ssao; +// 1 = the Design tab's studio lighting (studio_shade below); 0 = the two-light model above, which +// every other canvas keeps. world_up_eye is world +Z in eye space, for the hemisphere ambient. +uniform int lighting_model; +uniform vec3 world_up_eye; // Depth-based shadow map (object-on-object and self shadows). shadow_intensity == 0 disables it. uniform sampler2D shadow_map; @@ -263,6 +267,27 @@ float shadow_shade() return 1.0 - shadow_intensity * (sum / 25.0); } +// Studio lighting for the Design tab. The default model lights every face from near the camera, +// so the sides of a part come out in nearly the same tone and its form is hard to read. This one +// separates faces by their orientation in the WORLD (a sky/ground hemisphere: up-facing faces +// cool and bright, down-facing ones warm and dark), keeps a strong key light from the upper left +// and a weak fill from the right, gives a plastic-like highlight, and darkens the base colour +// toward the silhouette while adding a faint sheen there, so curved faces read as round. +vec3 studio_shade(vec3 base, vec3 n, vec3 v) +{ + vec3 key = normalize(vec3(-0.45, 0.60, 0.66)); + vec3 fill = normalize(vec3(0.70, -0.15, 0.70)); + float hemi = 0.5 + 0.5 * dot(n, normalize(world_up_eye)); + vec3 ambient = mix(vec3(0.16, 0.15, 0.14), vec3(0.40, 0.42, 0.46), hemi); + float kd = max(dot(n, key), 0.0); + float fd = max(dot(n, fill), 0.0); + vec3 diffuse = ambient + vec3(0.60) * kd + vec3(0.20) * fd; + float spec = 0.28 * pow(max(dot(n, normalize(key + v)), 0.0), 48.0) + + 0.06 * pow(max(dot(n, normalize(fill + v)), 0.0), 24.0); + float rim = pow(1.0 - clamp(dot(n, v), 0.0, 1.0), 3.0); + return base * diffuse * (1.0 - 0.30 * rim) + vec3(spec + 0.08 * rim); +} + void main() { if (any(lessThan(clipping_planes_dots, ZERO))) @@ -319,9 +344,11 @@ void main() // SSAO is applied in post-process pass. Keep base lighting unchanged here. float shade = shadow_shade(); + vec3 lit = (lighting_model == 1) ? studio_shade(color.rgb, normal, view_dir) + : (vec3(specular) + window_reflection + color.rgb * diffuse) * PHONG_BRIGHTNESS; if (is_outline) { - vec3 shaded_rgb = (vec3(specular) + window_reflection + color.rgb * diffuse) * PHONG_BRIGHTNESS * shade; + vec3 shaded_rgb = lit * shade; vec4 shaded_color = vec4(clamp(shaded_rgb, vec3(0.0), vec3(1.0)), color.a); float s = DetectSilho(gl_FragCoord.xy); if (s < 0.01) @@ -333,5 +360,5 @@ void main() out_color = vec4(clamp((0.45 * texture(environment_tex, normalize(eye_normal).xy * 0.5 + 0.5).xyz + window_reflection + 0.8 * color.rgb * diffuse) * PHONG_BRIGHTNESS * shade, vec3(0.0), vec3(1.0)), color.a); #endif else - out_color = vec4(clamp((vec3(specular) + window_reflection + color.rgb * diffuse) * PHONG_BRIGHTNESS * shade, vec3(0.0), vec3(1.0)), color.a); + out_color = vec4(clamp(lit * shade, vec3(0.0), vec3(1.0)), color.a); } \ No newline at end of file diff --git a/src/libslic3r/CAD/GeometryEngine.cpp b/src/libslic3r/CAD/GeometryEngine.cpp index 5795058150..1410f9c8e3 100644 --- a/src/libslic3r/CAD/GeometryEngine.cpp +++ b/src/libslic3r/CAD/GeometryEngine.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -611,6 +612,27 @@ std::vector GeometryEngine::sample_edge_world(const TopoDS_Edge& edge, do return pts; } +std::vector> GeometryEngine::display_edges(const TopoDS_Shape& shape, double chord_tol) +{ + TopTools_IndexedDataMapOfShapeListOfShape faces_of_edge; + TopExp::MapShapesAndAncestors(shape, TopAbs_EDGE, TopAbs_FACE, faces_of_edge); + std::vector> out; + for (int i = 1; i <= faces_of_edge.Extent(); ++i) { + const TopoDS_Edge& edge = TopoDS::Edge(faces_of_edge.FindKey(i)); + if (BRep_Tool::Degenerated(edge)) + continue; + bool seam = false; + for (TopTools_ListIteratorOfListOfShape it(faces_of_edge.FindFromIndex(i)); it.More() && !seam; it.Next()) + seam = BRep_Tool::IsClosed(edge, TopoDS::Face(it.Value())); + if (seam) + continue; + std::vector pts = sample_edge_world(edge, chord_tol); + if (pts.size() >= 2) + out.push_back(std::move(pts)); + } + return out; +} + Vec3d GeometryEngine::face_centroid_world(const TopoDS_Face& face) { GProp_GProps props; diff --git a/src/libslic3r/CAD/GeometryEngine.hpp b/src/libslic3r/CAD/GeometryEngine.hpp index 16040eee5e..c37478bb87 100644 --- a/src/libslic3r/CAD/GeometryEngine.hpp +++ b/src/libslic3r/CAD/GeometryEngine.hpp @@ -149,6 +149,10 @@ public: static Vec3d face_normal_world(const TopoDS_Face& face); // Sample an edge into a world-space polyline (>=2 pts) for pick-distance + highlight. static std::vector sample_edge_world(const TopoDS_Edge& edge, double chord_tol = 0.05); + // The edges a viewer draws over a body, each as a polyline: every edge of the shape once, + // without degenerate edges (a cone apex) and without the seam of a closed surface (the line + // down a cylinder's side), which is where OCCT closes the parameter space, not a real edge. + static std::vector> display_edges(const TopoDS_Shape& shape, double chord_tol); // 0-based edge index into TopExp::MapShapes(shape, TopAbs_EDGE, map). static int edge_count(const TopoDS_Shape& shape); static TopoDS_Edge edge_by_index(const TopoDS_Shape& shape, int index); diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index 2f00b04e61..7feda3e9bd 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -46,6 +46,7 @@ DesignCanvas::DesignCanvas(wxWindow* parent) // cannot be null. Borrow the plater's, as the editor canvases do. m_canvas->set_process(&wxGetApp().plater()->background_process()); m_canvas->set_type(GLCanvas3D::ECanvasType::CanvasView3D); + m_canvas->set_studio_lighting(true); // see GLCanvas3D::m_studio_lighting and phong.fs // CAD navigation, this canvas only: left-drag sweeps a selection rubber band, so orbit // moves to middle-drag and pan to right-drag. Design is a different modality from @@ -1347,6 +1348,7 @@ void DesignCanvas::set_body_hidden(bool on) { if (m_body_hidden == on) return; m_body_hidden = on; + m_sketch_tool.set_body_edges_hidden(on); reload(true); // hides/show base bodies + flips the ghost opaque/faint for preview-only mode } diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 5d3a8df075..f06fcb1a81 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -14,6 +14,10 @@ #include "slic3r/GUI/3DScene.hpp" #include "slic3r/GUI/GLShader.hpp" #include "libslic3r/CAD/GeometryEngine.hpp" + +#include +#include +#include #include "libslic3r/TriangleMesh.hpp" #include @@ -3424,9 +3428,94 @@ void DesignSketchTool::set_solid_pick(const std::vector* bodies, const m_solid_bodies = bodies; m_solid_mesh = mesh; m_solid_tri_face = tri_face; m_solid_tri_body = tri_body; m_solid_visible = visible; m_solid_xform = xform; } + refresh_body_edges(); clear_solid_selection(); } +void DesignSketchTool::refresh_body_edges() +{ + const size_t n = m_solid_bodies != nullptr ? m_solid_bodies->size() : 0; + m_body_edges.resize(n); + m_body_edges_key.resize(n, nullptr); + for (size_t b = 0; b < n; ++b) { + const TopoDS_Shape& shape = (*m_solid_bodies)[b].shape; + const void* key = shape.IsNull() ? nullptr : shape.TShape().get(); + if (key == m_body_edges_key[b] && key != nullptr) + continue; + m_body_edges_key[b] = key; + m_body_edges[b].clear(); + if (key == nullptr) + continue; + // A thousandth of the body's size: round edges stay round at any zoom that shows the + // whole body, without sampling a large import into millions of segments. + Bnd_Box box; + BRepBndLib::Add(shape, box); + const double diag = box.IsVoid() ? 1.0 : std::sqrt(box.SquareExtent()); + try { + m_body_edges[b] = GeometryEngine::display_edges(shape, std::max(1e-3 * diag, 0.005)); + } catch (const Standard_Failure&) { + m_body_edges[b].clear(); // an unsampleable edge costs its body the lines, nothing else + } + } +} + +void DesignSketchTool::render_body_edges() +{ + if (m_body_edges_hidden || m_solid_bodies == nullptr) + return; + using EPT = GLModel::Geometry::EPrimitiveType; + using EVL = GLModel::Geometry::EVertexLayout; + const Camera& cam = wxGetApp().plater()->get_camera(); + const Vec3d vd = cam.get_dir_forward(); + const double px = 1.0 / std::max(cam.get_zoom(), 1e-6); + const double hw = 0.75 * px; // ~1.5 px wide + // Pulled toward the eye by a few pixels, so the line wins the depth test against the two + // faces meeting at the edge while a face in front of it still hides it. + const Vec3d pull = -vd * (3.0 * px); + // Two passes: the edges of a body faded by body focus are fainter, like the body itself. + for (int pass = 0; pass < 2; ++pass) { + GLModel::Geometry g; g.format = { EPT::Triangles, EVL::P3 }; + unsigned int base = 0; + for (int b = 0; b < int(m_body_edges.size()); ++b) { + if (m_solid_visible != nullptr && b < int(m_solid_visible->size()) && !(*m_solid_visible)[b]) + continue; + const bool faded = m_pick_only_body >= 0 && m_pick_only_body < int(m_body_edges.size()) + && b != m_pick_only_body; + if (faded != (pass == 1)) + continue; + for (const std::vector& pl : m_body_edges[b]) + for (size_t s = 1; s < pl.size(); ++s) { + const Vec3d a = body_xform_pt(b, pl[s - 1]) + pull, c = body_xform_pt(b, pl[s]) + pull; + Vec3d dir = c - a; if (dir.norm() < 1e-9) continue; dir.normalize(); + Vec3d off = dir.cross(vd); + if (off.norm() < 1e-9) continue; // edge seen end-on: a point, nothing to draw + off = off.normalized() * hw; + g.add_vertex((Vec3f)(a + off).cast()); + g.add_vertex((Vec3f)(c + off).cast()); + g.add_vertex((Vec3f)(c - off).cast()); + g.add_vertex((Vec3f)(a - off).cast()); + g.add_triangle(base, base + 1, base + 2); + g.add_triangle(base, base + 2, base + 3); base += 4; + } + } + if (base == 0) + continue; + glsafe(::glEnable(GL_DEPTH_TEST)); + glsafe(::glDepthFunc(GL_LEQUAL)); + glsafe(::glDepthMask(GL_FALSE)); + glsafe(::glEnable(GL_BLEND)); + glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); + m_body_edges_model.reset(); + m_body_edges_model.init_from(std::move(g)); + m_body_edges_model.set_color(ColorRGBA(0.08f, 0.09f, 0.11f, pass == 0 ? 0.85f : 0.25f)); + m_body_edges_model.render(); + glsafe(::glDepthMask(GL_TRUE)); + glsafe(::glDepthFunc(GL_LESS)); + glsafe(::glDisable(GL_BLEND)); + glsafe(::glDisable(GL_DEPTH_TEST)); + } +} + // Map a point sampled from the (untransformed) OCCT body shape through the body's display // transform, so edge picking/highlight track a moved body. The pick MESH is already // transformed by the host; only OCCT-sampled edges need this. @@ -8929,6 +9018,8 @@ void DesignSketchTool::render(GLCanvas3D& canvas) shader->set_uniform("view_model_matrix", camera.get_view_matrix()); shader->set_uniform("projection_matrix", camera.get_projection_matrix()); + render_body_edges(); + // Persistent committed sketches (e.g. an un-consumed sketch left visible after its // extrude is removed): faces translucent, outlines orange. Each uses its own plane. if (!m_display_sketches.empty()) { diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index 57a4d087e8..7228e3b362 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -198,6 +198,9 @@ public: // another solid is reachable without hiding anything. -1 = no restriction. // Survives set_solid_pick() — it is owned by the panel, not by the mesh feed. void set_pick_only_body(int b) { m_pick_only_body = b; } + // Off while the bodies themselves are hidden (a dress-up previewing its result alone), so + // their edges do not float over the preview. + void set_body_edges_hidden(bool h) { m_body_edges_hidden = h; } void clear_solid_selection(); bool has_solid_selection() const { return m_solid_sel != SolidSel::None; } // Every picked edge when the selection is an edge set (Shift/Ctrl+click adds and removes @@ -1204,6 +1207,14 @@ private: int m_pick_only_body{-1}; // >=0: only this body catches clicks (body-focus x-ray for CoordSys picking) const std::vector* m_solid_xform{nullptr}; // per-body display transform (for edge sampling) Vec3d body_xform_pt(int body, const Vec3d& p) const; // map an OCCT-shape point through the body xform + // The bodies' B-rep edges, drawn as dark lines over the solids so faces and features read + // apart. One polyline set per body in its own shape coordinates, resampled only for a body + // whose shape changed (keyed by the TShape), since set_solid_pick runs on every recompute. + std::vector>> m_body_edges; + std::vector m_body_edges_key; + bool m_body_edges_hidden{false}; + void refresh_body_edges(); + void render_body_edges(); bool body_pickable(int b) const; // false when the body is explicitly hidden SolidSel m_solid_sel{SolidSel::None}; int m_sel_body{-1}; // which body the face/edge selection is on @@ -1269,6 +1280,7 @@ private: GLModel m_mc_fill_model; // the face treatment's shaded facets GLModel m_solid_face_model; GLModel m_solid_edge_model; + GLModel m_body_edges_model; GLModel m_solid_vertex_model; int m_display_pick_region{-1}; // selected closed-region index within that feature (-1 none) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index c4d9173268..ca6e037eb7 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -8489,10 +8489,11 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with const bool realistic_mode = _is_realistic_view_enabled(); const bool realistic_phong = wxGetApp().app_config != nullptr && wxGetApp().app_config->get_bool(SETTING_OPENGL_REALISTIC_PHONG); - const std::string shader_name = (realistic_mode && realistic_phong) ? "phong" : "gouraud"; + const std::string shader_name = (m_studio_lighting || (realistic_mode && realistic_phong)) ? "phong" : "gouraud"; GLShaderProgram* shader = wxGetApp().get_shader(shader_name); if (shader == nullptr && shader_name != "gouraud") shader = wxGetApp().get_shader("gouraud"); + const bool studio = m_studio_lighting && shader != nullptr && shader->get_name() == "phong"; ECanvasType canvas_type = this->m_canvas_type; bool partly_inside_enable = canvas_type == ECanvasType::CanvasAssembleView ? false : true; // The edited printer's per-extruder printable heights feed the object shader's @@ -8505,6 +8506,13 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with const bool phong_ssao = wxGetApp().app_config != nullptr && wxGetApp().app_config->get_bool(SETTING_OPENGL_PHONG_SSAO); shader->set_uniform("enable_ssao", phong_ssao); + // Set on every use: the program is shared, so a canvas that leaves it unset would inherit + // the last canvas's choice. + shader->set_uniform("lighting_model", studio ? 1 : 0); + if (studio) { + const Transform3d& view = wxGetApp().plater()->get_camera().get_view_matrix(); + shader->set_uniform("world_up_eye", Vec3f((view.matrix().block<3, 3>(0, 0) * Vec3d::UnitZ()).cast())); + } // Object-on-object and self shadows: sample the depth map built in _render_shadow_map_pass(). // shadow_intensity == 0 disables the effect entirely (unchanged behavior when off / unsupported). diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 36a6c7b944..04224930d2 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -590,6 +590,9 @@ private: //BBS: add canvas type for assemble view usage ECanvasType m_canvas_type; + // Objects drawn with the phong shader's studio lighting whatever the realistic-view settings + // (the Design tab's canvas). Off for every canvas of the slicer, which render as before. + bool m_studio_lighting{false}; std::array m_clipping_planes; ClippingPlane m_camera_clipping_plane; bool m_use_clipping_planes; @@ -815,6 +818,7 @@ public: void set_context(wxGLContext* context) { m_context = context; } void set_type(ECanvasType type) { m_canvas_type = type; } + void set_studio_lighting(bool on) { m_studio_lighting = on; } ECanvasType get_canvas_type() { return m_canvas_type; } wxGLCanvas* get_wxglcanvas() { return m_canvas; } diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index ce695079f7..fe788d0ffa 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -8920,3 +8922,29 @@ TEST_CASE("CadDocument: a profile on a body face touches it, one in free space d CHECK(doc.body_touching_sketch(-1) == -1); CHECK(doc.body_touching_sketch(base + 1) == -1); // the extrude: not a sketch } + +TEST_CASE("display edges: every real edge once, no seams, no degenerate apex", "[CadDocument][display]") +{ + const auto box = GeometryEngine::display_edges(BRepPrimAPI_MakeBox(10., 20., 30.).Shape(), 0.01); + CHECK(box.size() == 12); + for (const auto& pl : box) { + REQUIRE(pl.size() >= 2); + const double len = (pl.back() - pl.front()).norm(); + CHECK((std::abs(len - 10.) < 1e-6 || std::abs(len - 20.) < 1e-6 || std::abs(len - 30.) < 1e-6)); + } + + // A cylinder has three edges in OCCT: the two rims and the seam down its side. Only the rims + // are drawn, each sampled finely enough to look round and closed. + const auto cyl = GeometryEngine::display_edges(BRepPrimAPI_MakeCylinder(5., 8.).Shape(), 0.01); + REQUIRE(cyl.size() == 2); + for (const auto& pl : cyl) { + CHECK(pl.size() > 16); + CHECK((pl.front() - pl.back()).norm() < 1e-6); + for (const Vec3d& p : pl) + CHECK(std::abs(std::hypot(p.x(), p.y()) - 5.) < 0.02); + } + + // A cone keeps its base rim; the apex is a degenerate edge and the side has a seam. + const auto cone = GeometryEngine::display_edges(BRepPrimAPI_MakeCone(5., 0., 8.).Shape(), 0.01); + CHECK(cone.size() == 1); +} From a4387e93f215c791ae0a4431d2a65cf09c9e8b7f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 17:17:36 +0000 Subject: [PATCH 151/389] Design tab: revolve about a line of the sketch Reported: the Revolve axis could only be the sketch plane's X or Y axis through its origin, so a half-profile drawn beside a centerline, the usual way, could not be revolved about that centerline. - CadFeature::revolve_axis_entity names a Line of the profile sketch to revolve about (a construction centerline, or an edge of the profile itself); -1 keeps revolve_axis. Appended at the end of the framed recipe, so existing projects load and rebuild unchanged. Revolve and Surface Revolve resolve their axis in one place (revolve_axis_of); an index that no longer names a line fails with a reason. - SketchEngine::make_revolve takes the world axis. A profile with points on both sides of it is refused with "the profile crosses the revolve axis"; MakeRevol failed there with no reason. - The Axis list of both cards reads Plane X, Plane Y, then every line of the sketch, named as the constraint list names them (Centerline E4, Line E3). A fresh revolve preselects the sketch's centerline when it has exactly one. The gizmo turns about the chosen axis and draws it dashed; construction lines no longer pull its centre. Tests: a rectangle beside a construction centerline revolves into the tube of the expected volume along that line; about its own edge, into a cylinder; an axis through it is refused with the reason; a stale axis index fails with a reason; the axis survives save and load. The truncated-recipe test accounts for the new tail field. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- docs/CAD/design_tab.md | 6 ++ src/libslic3r/CAD/CadDocument.cpp | 27 +++++-- src/libslic3r/CAD/CadDocument.hpp | 9 ++- src/libslic3r/CAD/SketchEngine.cpp | 34 ++++++--- src/libslic3r/CAD/SketchEngine.hpp | 11 ++- src/slic3r/GUI/CAD/DesignCanvas.cpp | 4 +- src/slic3r/GUI/CAD/DesignCanvas.hpp | 8 +-- src/slic3r/GUI/CAD/DesignPanel.cpp | 72 ++++++++++++++++--- src/slic3r/GUI/CAD/DesignPanel.hpp | 12 +++- src/slic3r/GUI/CAD/DesignSketchTool.cpp | 19 +++-- src/slic3r/GUI/CAD/DesignSketchTool.hpp | 8 +-- tests/libslic3r/test_caddocument.cpp | 95 ++++++++++++++++++++++++- 12 files changed, 255 insertions(+), 50 deletions(-) diff --git a/docs/CAD/design_tab.md b/docs/CAD/design_tab.md index 3904df1fff..e6563bdfa9 100644 --- a/docs/CAD/design_tab.md +++ b/docs/CAD/design_tab.md @@ -227,6 +227,12 @@ Grouped in the toolbar by what they do, one concept per drawer. Extrude offers blind, symmetric, two-sided, through-all and up-to-face end conditions, plus a draft angle on the side wall, and can add, subtract, intersect or start a new body. +Revolve turns the profile about the sketch plane's X or Y axis, or about any line of the same +sketch: a construction centerline drawn beside the half-profile (picked for you when the sketch +has exactly one), or an edge of the profile itself. The axis is drawn dashed while the card is +open. A profile on both sides of the axis would sweep through itself, and is refused with that +reason. Surface Revolve takes the same axes. + ### Surface Sheet bodies — surfaces with no thickness — for shapes that are easier to build as skins and solidify afterwards. diff --git a/src/libslic3r/CAD/CadDocument.cpp b/src/libslic3r/CAD/CadDocument.cpp index f77c4ceeaf..8d4e765c46 100644 --- a/src/libslic3r/CAD/CadDocument.cpp +++ b/src/libslic3r/CAD/CadDocument.cpp @@ -2438,6 +2438,26 @@ static std::string open_loop_message(const CadFeature& sketch, return msg; } +// World axis of a Revolve / Surface Revolve whose profile is `sk`: the Line of that sketch named +// by revolve_axis_entity, else the sketch plane's X or Y axis through its origin. +static gp_Ax1 revolve_axis_of(const CadFeature& f, const CadFeature& sk) +{ + if (f.revolve_axis_entity >= 0) { + if (f.revolve_axis_entity >= int(sk.entities.size()) + || sk.entities[f.revolve_axis_entity].type != SketchEntity::Type::Line) + throw std::runtime_error("revolve: the axis line is no longer in the sketch — pick the axis again"); + const SketchEntity& e = sk.entities[f.revolve_axis_entity]; + const Vec3d a = sk.plane.to_world(e.p0), b = sk.plane.to_world(e.p1); + if ((b - a).norm() < 1e-9) + throw std::runtime_error("revolve: the axis line has no length"); + const Vec3d d = (b - a).normalized(); + return gp_Ax1(gp_Pnt(a.x(), a.y(), a.z()), gp_Dir(d.x(), d.y(), d.z())); + } + const Vec3d& adir = (f.revolve_axis == 1) ? sk.plane.y_axis : sk.plane.x_axis; + return gp_Ax1(gp_Pnt(sk.plane.origin.x(), sk.plane.origin.y(), sk.plane.origin.z()), + gp_Dir(adir.x(), adir.y(), adir.z())); +} + TopoDS_Wire CadDocument::build_sketch_wire(const CadFeature& sketch, bool closed_only) const { if (!sketch.entities.empty()) { @@ -2651,7 +2671,7 @@ void CadDocument::apply_feature(TopoDS_Shape& result, bool& have_body, ? features[f.sketch_ref] : f; TopoDS_Wire wire = build_sketch_wire(sk, true); const double ang = f.flip ? -f.revolve_angle : f.revolve_angle; - TopoDS_Shape tool = SketchEngine::make_revolve(wire, sk.plane, ang, f.revolve_axis); + TopoDS_Shape tool = SketchEngine::make_revolve(wire, revolve_axis_of(f, sk), ang); if (!have_body || f.mode == BooleanMode::New) { result = tool; have_body = true; @@ -2693,10 +2713,7 @@ void CadDocument::apply_feature(TopoDS_Shape& result, bool& have_body, throw std::runtime_error("surface-revolve: ref is not a sketch"); TopoDS_Wire wire = build_sketch_wire(sk); if (wire.IsNull()) throw std::runtime_error("surface-revolve: empty profile"); - const Vec3d& adir = (f.revolve_axis == 1) ? sk.plane.y_axis : sk.plane.x_axis; - gp_Pnt o(sk.plane.origin.x(), sk.plane.origin.y(), sk.plane.origin.z()); - gp_Dir xd(adir.x(), adir.y(), adir.z()); - gp_Ax1 axis(o, xd); + gp_Ax1 axis = revolve_axis_of(f, sk); // Same angle rules as the solid Revolve (flip reverses it, and a negative sweep is a // positive one about the reversed axis — MakeRevol wants (0, 2 pi]); this surface // version used to ignore both. diff --git a/src/libslic3r/CAD/CadDocument.hpp b/src/libslic3r/CAD/CadDocument.hpp index 78473af560..251d2e2496 100644 --- a/src/libslic3r/CAD/CadDocument.hpp +++ b/src/libslic3r/CAD/CadDocument.hpp @@ -180,6 +180,9 @@ struct CadFeature { // target_body. revolve_axis: 0 = plane X axis, 1 = plane Y axis. double revolve_angle{360}; // sweep angle in degrees (1..360) int revolve_axis{0}; // 0 = plane X, 1 = plane Y + // A Line of the profile sketch to revolve about instead (index into its entities: a + // centerline, usually construction, or an edge of the profile itself); -1 = revolve_axis. + int revolve_axis_entity{-1}; // Sweep: profile carried by sketch_ref / entities (like Extrude); the spine is a // second Sketch referenced by sweep_path_ref (an open or closed wire). Reuses @@ -404,7 +407,8 @@ struct CadFeature { coordsys_face_kind, coordsys_face_edges, thread_major_nominal, pattern_inclusive, dressup_edges, - text_string, text_font, text_height); + text_string, text_font, text_height, + revolve_axis_entity); } template void load(Archive& ar) { @@ -446,7 +450,8 @@ struct CadFeature { coordsys_face_kind, coordsys_face_edges, thread_major_nominal, pattern_inclusive, dressup_edges, - text_string, text_font, text_height); + text_string, text_font, text_height, + revolve_axis_entity); imported_solid = brep_from_string(brep); } // The pre-framing (v4) layout, FROZEN. A v4 recipe is one flat stream with no per-feature diff --git a/src/libslic3r/CAD/SketchEngine.cpp b/src/libslic3r/CAD/SketchEngine.cpp index 812e6fa703..13f5a9485a 100644 --- a/src/libslic3r/CAD/SketchEngine.cpp +++ b/src/libslic3r/CAD/SketchEngine.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -335,20 +336,35 @@ TopoDS_Shape SketchEngine::make_extrude_regions( return count == 1 ? last : TopoDS_Shape(comp); // avoid a compound-of-one } -TopoDS_Shape SketchEngine::make_revolve(const TopoDS_Wire& wire, const SketchPlane& plane, - double angle_deg, int axis_sel) +TopoDS_Shape SketchEngine::make_revolve(const TopoDS_Wire& wire, const gp_Ax1& axis_in, double angle_deg) { BRepBuilderAPI_MakeFace faceMaker(wire); if (!faceMaker.IsDone()) throw std::runtime_error("Failed to make face from wire"); TopoDS_Face face = faceMaker.Face(); - // Revolution axis lies in the sketch plane through its origin: X (0) or Y (1). - const Vec3d& adir = (axis_sel == 1) ? plane.y_axis : plane.x_axis; - gp_Pnt o(plane.origin.x(), plane.origin.y(), plane.origin.z()); - gp_Dir xd(adir.x(), adir.y(), adir.z()); - gp_Ax1 axis(o, xd); - + // A profile on both sides of the axis sweeps through itself; MakeRevol then fails with no + // reason, or builds an invalid solid. Sample every edge and name the cause instead. + { + const gp_Pnt o = axis_in.Location(); + const gp_Dir d = axis_in.Direction(); + bool pos = false, neg = false; + gp_Vec side_ref; + for (TopExp_Explorer ex(wire, TopAbs_EDGE); ex.More(); ex.Next()) { + BRepAdaptor_Curve c(TopoDS::Edge(ex.Current())); + for (int i = 0; i <= 16; ++i) { + const gp_Pnt p = c.Value(c.FirstParameter() + (c.LastParameter() - c.FirstParameter()) * i / 16.0); + const gp_Vec off = gp_Vec(o, p) - gp_Vec(d) * gp_Vec(o, p).Dot(gp_Vec(d)); // from the axis + if (off.Magnitude() < 1e-6) + continue; + if (side_ref.Magnitude() == 0.0) { side_ref = off; pos = true; continue; } + (off.Dot(side_ref) > 0.0 ? pos : neg) = true; + } + } + if (pos && neg) + throw std::runtime_error("the profile crosses the revolve axis — it must lie on one side of it"); + } + gp_Ax1 axis = axis_in; double angle_rad = angle_deg * M_PI / 180.0; // A negative angle is expressed as a positive sweep about the reversed axis, // since BRepPrimAPI_MakeRevol expects an angle in (0, 2*pi]. @@ -356,6 +372,8 @@ TopoDS_Shape SketchEngine::make_revolve(const TopoDS_Wire& wire, const SketchPla BRepPrimAPI_MakeRevol rev(face, axis, angle_rad); if (!rev.IsDone()) throw std::runtime_error("Failed to revolve"); + if (!BRepCheck_Analyzer(rev.Shape()).IsValid()) + throw std::runtime_error("the profile crosses the revolve axis — it must lie on one side of it"); return rev.Shape(); } diff --git a/src/libslic3r/CAD/SketchEngine.hpp b/src/libslic3r/CAD/SketchEngine.hpp index 785102c205..ea3b6888b8 100644 --- a/src/libslic3r/CAD/SketchEngine.hpp +++ b/src/libslic3r/CAD/SketchEngine.hpp @@ -6,6 +6,7 @@ #include "libslic3r/CAD/GeometryEngine.hpp" #include +#include #include #include #include @@ -262,12 +263,10 @@ public: const std::vector>>& regions, const SketchPlane& plane, double length, bool symmetric = false); - // Revolve a planar profile wire about an axis lying in the sketch plane and - // passing through the plane origin: axis_sel 0 = plane X axis, 1 = plane Y axis. - // A negative angle_deg sweeps the opposite direction (Flip). The profile must - // lie to one side of the axis (Onshape rule); a straddling profile self-intersects. - static TopoDS_Shape make_revolve(const TopoDS_Wire& wire, const SketchPlane& plane, - double angle_deg = 360.0, int axis_sel = 0); + // Revolve the closed profile wire about `axis` (world) by angle_deg; a negative angle sweeps + // the other way (Flip). The profile must lie to one side of the axis (Onshape rule): one that + // straddles it sweeps through itself, and that is refused rather than returned broken. + static TopoDS_Shape make_revolve(const TopoDS_Wire& wire, const gp_Ax1& axis, double angle_deg = 360.0); // Sweep a planar profile wire along a path (spine) wire. The profile is turned // into a face and swept with BRepOffsetAPI_MakePipe, which keeps the profile diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index 7feda3e9bd..6c3516b619 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -862,9 +862,9 @@ void DesignCanvas::set_on_shell_thickness_changed(std::function cb } void DesignCanvas::begin_revolve_gizmo(const SketchPlane& plane, const Vec2d& centroid, - int axis_sel, double angle, bool flip) + const Vec3d& axis_origin, const Vec3d& axis_dir, double angle, bool flip) { - m_sketch_tool.set_revolve_gizmo(plane, centroid, axis_sel, angle, flip); + m_sketch_tool.set_revolve_gizmo(plane, centroid, axis_origin, axis_dir, angle, flip); request_repaint(); } diff --git a/src/slic3r/GUI/CAD/DesignCanvas.hpp b/src/slic3r/GUI/CAD/DesignCanvas.hpp index 21357021c7..50b2cab46c 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.hpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.hpp @@ -161,11 +161,11 @@ public: void clear_shell_gizmo(); bool shelling() const; void set_on_shell_thickness_changed(std::function cb); - // Visual Revolve angle-arc gizmo: the panel feeds the sketch plane + profile centroid + axis - // (0=plane X, 1=plane Y) + angle + flip while its Revolve card is open; drag/edit fire the - // angle callback. + // Visual Revolve angle-arc gizmo: the panel feeds the sketch plane + profile centroid + the + // world axis (a point on it, unit direction) + angle + flip while its Revolve card is open; + // drag/edit fire the angle callback. void begin_revolve_gizmo(const SketchPlane& plane, const Vec2d& centroid, - int axis_sel, double angle, bool flip); + const Vec3d& axis_origin, const Vec3d& axis_dir, double angle, bool flip); void clear_revolve_gizmo(); bool revolving() const; void set_on_revolve_angle_changed(std::function cb); diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index e913beaa33..2ca216260d 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -667,6 +667,7 @@ DesignPanel::DesignPanel(wxWindow* parent) set_status(StatusKind::Error, _L("Create a sketch profile to revolve first")); return; } + fill_revolve_axes(m_revolve_axis, m_revolve_axis_ents, m_revolve_sketch_ref, 0, -2); open_tool(Tool::Revolve); }, SHIFT('R')}, {"design_sweep", _L("Sweep"), _L("Sweep a profile along a path"), @@ -796,6 +797,7 @@ DesignPanel::DesignPanel(wxWindow* parent) set_status(StatusKind::Error, _L("Create a sketch profile to revolve first")); return; } + fill_revolve_axes(m_surf_revolve_axis, m_surf_revolve_axis_ents, m_surf_revolve_sketch_ref, 0, -2); open_tool(Tool::SurfaceRevolve); }, SHIFT('J')}, {"design_loft", _L("Surface Loft"), _L("Loft (skin) between 2+ profiles, open (no end caps)"), @@ -5372,9 +5374,11 @@ void DesignPanel::on_add_revolve() return; } m_feature_counter++; - m_doc.add_revolve(m_revolve_sketch_ref, m_revolve_angle->GetValue(), - m_revolve_axis->GetSelection(), m_revolve_flip->GetValue(), - mode, feature_name(_L("Revolve"))); + int axis = 0, axis_entity = -1; + read_revolve_axis(m_revolve_axis, m_revolve_axis_ents, axis, axis_entity); + const int idx = m_doc.add_revolve(m_revolve_sketch_ref, m_revolve_angle->GetValue(), axis, + m_revolve_flip->GetValue(), mode, feature_name(_L("Revolve"))); + m_doc.features[idx].revolve_axis_entity = axis_entity; if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); @@ -5465,9 +5469,11 @@ void DesignPanel::on_add_surface_revolve() return; } m_feature_counter++; - m_doc.add_surface_revolve(m_surf_revolve_sketch_ref, m_surf_revolve_angle->GetValue(), - m_surf_revolve_axis->GetSelection(), - feature_name(_L("Surface Revolve"))); + int axis = 0, axis_entity = -1; + read_revolve_axis(m_surf_revolve_axis, m_surf_revolve_axis_ents, axis, axis_entity); + const int idx = m_doc.add_surface_revolve(m_surf_revolve_sketch_ref, m_surf_revolve_angle->GetValue(), + axis, feature_name(_L("Surface Revolve"))); + m_doc.features[idx].revolve_axis_entity = axis_entity; if (!recompute_guarded(_L("Rebuilding model…"))) set_status(StatusKind::Error, wxString::Format(_L("The model could not be rebuilt: %s"), kernel_error_text(m_doc.error))); else @@ -9199,10 +9205,10 @@ void DesignPanel::load_feature_into_dialog(const CadFeature& f) break; case CadFeatureType::Revolve: m_revolve_angle->SetValue(f.revolve_angle); - m_revolve_axis->SetSelection(f.revolve_axis); m_revolve_mode->SetSelection(static_cast(f.mode)); m_revolve_flip->SetValue(f.flip); m_revolve_sketch_ref = f.sketch_ref; + fill_revolve_axes(m_revolve_axis, m_revolve_axis_ents, f.sketch_ref, f.revolve_axis, f.revolve_axis_entity); break; case CadFeatureType::Sweep: m_sweep_profile_ref = f.sketch_ref; @@ -9316,9 +9322,9 @@ void DesignPanel::load_feature_into_dialog(const CadFeature& f) break; case CadFeatureType::SurfaceRevolve: m_surf_revolve_angle->SetValue(f.revolve_angle); - m_surf_revolve_axis->SetSelection(f.revolve_axis); m_surf_revolve_flip->SetValue(f.flip); m_surf_revolve_sketch_ref = f.sketch_ref; + fill_revolve_axes(m_surf_revolve_axis, m_surf_revolve_axis_ents, f.sketch_ref, f.revolve_axis, f.revolve_axis_entity); if (m_surf_revolve_sketch_ref >= 0 && m_surf_revolve_sketch_ref < int(m_doc.features.size())) m_surf_revolve_sketch_label->SetLabel(_L("Sketch: ") + wxString::FromUTF8(m_doc.features[m_surf_revolve_sketch_ref].name)); @@ -9850,7 +9856,7 @@ CadFeature DesignPanel::build_candidate(Tool t) const f.type = CadFeatureType::Revolve; f.sketch_ref = m_revolve_sketch_ref; f.revolve_angle = m_revolve_angle->GetValue(); - f.revolve_axis = m_revolve_axis->GetSelection(); + read_revolve_axis(m_revolve_axis, m_revolve_axis_ents, f.revolve_axis, f.revolve_axis_entity); f.flip = m_revolve_flip->GetValue(); f.mode = static_cast(m_revolve_mode->GetSelection()); break; @@ -9934,7 +9940,7 @@ CadFeature DesignPanel::build_candidate(Tool t) const f.type = CadFeatureType::SurfaceRevolve; f.sketch_ref = m_surf_revolve_sketch_ref; f.revolve_angle = m_surf_revolve_angle->GetValue(); - f.revolve_axis = m_surf_revolve_axis->GetSelection(); + read_revolve_axis(m_surf_revolve_axis, m_surf_revolve_axis_ents, f.revolve_axis, f.revolve_axis_entity); f.flip = m_surf_revolve_flip->GetValue(); break; case Tool::SurfaceLoft: { @@ -10185,6 +10191,40 @@ void DesignPanel::update_shell_gizmo() m_viewport->begin_shell_gizmo(c, (-n).normalized(), m_shell_thickness->GetValue()); } +void DesignPanel::fill_revolve_axes(ComboBox* combo, std::vector& ents, int sketch_ref, int axis, int entity) +{ + combo->Clear(); + ents.clear(); + combo->Append(_L("Plane X")); + combo->Append(_L("Plane Y")); + int centerline = -1, centerlines = 0; + if (sketch_ref >= 0 && sketch_ref < int(m_doc.features.size())) { + const std::vector& es = m_doc.features[sketch_ref].entities; + for (int i = 0; i < int(es.size()); ++i) { + if (es[i].type != SketchEntity::Type::Line) + continue; + // Named as the constraint list names entities (E0, E1, …), so the two agree. + combo->Append(es[i].construction ? wxString::Format(_L("Centerline E%d"), i) + : wxString::Format(_L("Line E%d"), i)); + ents.push_back(i); + if (es[i].construction) { centerline = i; ++centerlines; } + } + } + if (entity == -2) // fresh revolve: a lone centerline is what the profile was drawn around + entity = centerlines == 1 ? centerline : -1; + int sel = axis == 1 ? 1 : 0; + for (int k = 0; k < int(ents.size()); ++k) + if (ents[k] == entity) sel = 2 + k; + combo->SetSelection(sel); +} + +void DesignPanel::read_revolve_axis(ComboBox* combo, const std::vector& ents, int& axis, int& entity) +{ + const int sel = combo->GetSelection(); + axis = sel == 1 ? 1 : 0; + entity = sel >= 2 && sel - 2 < int(ents.size()) ? ents[sel - 2] : -1; +} + void DesignPanel::update_revolve_gizmo() { if (!m_viewport) return; @@ -10200,6 +10240,7 @@ void DesignPanel::update_revolve_gizmo() if (!sk.entities.empty()) { Vec2d acc(0, 0); int n = 0; for (const SketchEntity& e : sk.entities) { + if (e.construction) continue; // a centerline is the axis, not part of the profile switch (e.type) { case SketchEntity::Type::Line: acc += 0.5 * (e.p0 + e.p1); ++n; break; case SketchEntity::Type::Arc: @@ -10220,7 +10261,16 @@ void DesignPanel::update_revolve_gizmo() for (const Vec2d& p : sk.profile.points) centroid += p; centroid /= double(sk.profile.points.size()); } - m_viewport->begin_revolve_gizmo(sk.plane, centroid, m_revolve_axis->GetSelection(), + // The axis as the kernel resolves it (revolve_axis_of): the picked line, else plane X / Y. + int axis = 0, axis_entity = -1; + read_revolve_axis(m_revolve_axis, m_revolve_axis_ents, axis, axis_entity); + Vec3d ax_o = sk.plane.origin, ax_d = axis == 1 ? sk.plane.y_axis : sk.plane.x_axis; + if (axis_entity >= 0 && axis_entity < int(sk.entities.size()) + && (sk.entities[axis_entity].p1 - sk.entities[axis_entity].p0).norm() > 1e-9) { + ax_o = sk.plane.to_world(sk.entities[axis_entity].p0); + ax_d = sk.plane.to_world(sk.entities[axis_entity].p1) - ax_o; + } + m_viewport->begin_revolve_gizmo(sk.plane, centroid, ax_o, ax_d.normalized(), m_revolve_angle->GetValue(), m_revolve_flip->GetValue()); } diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index c7e20186df..b52942ff73 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -551,7 +551,8 @@ private: // Revolve controls (sweep a sketch profile about an in-plane axis). wxStaticText* m_revolve_sketch_label{nullptr}; wxSpinCtrlDouble* m_revolve_angle{nullptr}; - ComboBox* m_revolve_axis{nullptr}; // 0 = plane X, 1 = plane Y + ComboBox* m_revolve_axis{nullptr}; // Plane X, Plane Y, then the sketch's lines + std::vector m_revolve_axis_ents; // entity index of each line entry, in order ComboBox* m_revolve_mode{nullptr}; // New/Add/Cut/Intersect CheckBox* m_revolve_flip{nullptr}; int m_revolve_sketch_ref{-1}; @@ -578,7 +579,14 @@ private: // Surface Revolve controls (sheet from sketch about axis). wxStaticText* m_surf_revolve_sketch_label{nullptr}; wxSpinCtrlDouble* m_surf_revolve_angle{nullptr}; - ComboBox* m_surf_revolve_axis{nullptr}; // 0 = plane X, 1 = plane Y + ComboBox* m_surf_revolve_axis{nullptr}; // as m_revolve_axis + std::vector m_surf_revolve_axis_ents; + // Fill a revolve axis combo for the profile sketch `sketch_ref`: "Plane X", "Plane Y", then + // one entry per Line of the sketch (entity index in `ents`), and select axis/entity. A fresh + // revolve passes entity = -2: the sketch's only centerline when it has exactly one, else X. + void fill_revolve_axes(ComboBox* combo, std::vector& ents, int sketch_ref, int axis, int entity); + // The combo's selection as CadFeature::revolve_axis + revolve_axis_entity. + static void read_revolve_axis(ComboBox* combo, const std::vector& ents, int& axis, int& entity); CheckBox* m_surf_revolve_flip{nullptr}; int m_surf_revolve_sketch_ref{-1}; diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index f06fcb1a81..675bdea216 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -6405,12 +6405,13 @@ void DesignSketchTool::drag_cut_arrow(GLCanvas3D& canvas, const wxMouseEvent& ev } void DesignSketchTool::set_revolve_gizmo(const SketchPlane& plane, const Vec2d& centroid, - int axis_sel, double angle, bool flip) + const Vec3d& axis_origin, const Vec3d& axis_dir, + double angle, bool flip) { - const Vec3d ax = (axis_sel == 1 ? plane.y_axis : plane.x_axis).normalized(); + const Vec3d ax = axis_dir.normalized(); const Vec3d cw = plane.to_world(centroid); - const double axial = (cw - plane.origin).dot(ax); - m_rv_center = plane.origin + axial * ax; // foot of the centroid on the axis line + const double axial = (cw - axis_origin).dot(ax); + m_rv_center = axis_origin + axial * ax; // foot of the centroid on the axis line Vec3d ref = cw - m_rv_center; // perpendicular to ax by construction double r = ref.norm(); if (r < 1e-6) { ref = plane.normal.normalized(); r = std::max(plane.normal.norm(), 1.0); } @@ -6477,6 +6478,16 @@ void DesignSketchTool::render_revolve_gizmo() draw_strokes(m_rv_stroke_model, segs, std::max(0.8 * upp, 1e-4), arcc); DimAnnot da; da.kind = DimType::Angle; da.value = m_rv_angle; draw_text(m_line_model, dim_text(da), tip * 1.14, th, arcc); + // The axis itself, dashed, past both ends of the sweep: which line is being revolved about + // is the one thing the card's list cannot show. + SketchPlane ap; ap.origin = m_rv_center; ap.x_axis = m_rv_axis; ap.y_axis = m_rv_ref; + ap.normal = m_rv_axis.cross(m_rv_ref); + m_plane = ap; + std::vector> dashes; + const double L = 1.6 * r, dash = std::max(r * 0.08, th * 0.5); + for (double u = -L; u < L; u += 2.0 * dash) + dashes.emplace_back(Vec2d(u, 0.0), Vec2d(std::min(u + dash, L), 0.0)); + draw_strokes(m_rv_stroke_model, dashes, std::max(0.8 * upp, 1e-4), ColorRGBA(1.0f, 0.55f, 0.1f, 1.0f)); m_plane = saved; } diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index 7228e3b362..56c1ac1a35 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -374,12 +374,12 @@ public: void set_mate_links(std::vector> l) { m_mate_links = std::move(l); } void clear_mate_connectors() { m_mate_connectors.clear(); m_mate_links.clear(); } - // Visual Revolve gizmo. The panel feeds the sketch plane + profile centroid + axis (0=plane X, - // 1=plane Y) + angle + flip while its Revolve card is open; an angle-arc is drawn in the - // revolve plane at the profile radius. Dragging the tip sweeps the angle, a stationary click + // Visual Revolve gizmo. The panel feeds the sketch plane + profile centroid + the world axis + // (a point on it and its direction) + angle + flip while its Revolve card is open; an + // angle-arc is drawn in the revolve plane at the profile radius, and the axis dashed. Dragging the tip sweeps the angle, a stationary click // edits it; both fire on_revolve_angle_changed. void set_revolve_gizmo(const SketchPlane& plane, const Vec2d& centroid, - int axis_sel, double angle, bool flip); + const Vec3d& axis_origin, const Vec3d& axis_dir, double angle, bool flip); void clear_revolve_gizmo(); bool revolving() const { return m_rv_active; } std::function on_revolve_angle_changed; diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index fe788d0ffa..480bd929e0 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -2351,11 +2351,12 @@ TEST_CASE("a truncated feature keeps what it could read", "[CadDocument][recipe] // Shorten feature 1 so it ends right after coordsys_face_kind: drop coordsys_face_edges // (4 bytes), the two flags appended after it (thread_major_nominal, pattern_inclusive: // 1 byte each), the empty dressup_edges list and the two empty text strings (an 8-byte size - // tag each) and text_height (a double). Rewrite its length prefix and erase the tail bytes. + // tag each), text_height (a double) and revolve_axis_entity (an int). Rewrite its length prefix and erase the tail bytes. // The reader then runs out inside fa(f), throws, and keeps everything it had already // assigned — that is the whole point of the try/catch. (Cut on a field boundary: a field // cut in half is read as whatever half arrived.) - const size_t drop = sizeof(uint32_t) + 2 * sizeof(bool) + 3 * sizeof(cereal::size_type) + sizeof(double); + const size_t drop = sizeof(uint32_t) + 2 * sizeof(bool) + 3 * sizeof(cereal::size_type) + sizeof(double) + + sizeof(int); REQUIRE(f_len[1] > drop); std::string shortened = blob; shortened.erase(f_off[1] + 4 + f_len[1] - drop, drop); @@ -8948,3 +8949,93 @@ TEST_CASE("display edges: every real edge once, no seams, no degenerate apex", " const auto cone = GeometryEngine::display_edges(BRepPrimAPI_MakeCone(5., 0., 8.).Shape(), 0.01); CHECK(cone.size() == 1); } + +namespace { +// A 10 x 20 rectangle standing on the plane X axis between u = 5 and u = 15, and a construction +// centerline x = 0 from (0,0) to (0,20): the half-profile of a tube, drawn the usual way. +Slic3r::CadFeature tube_half_profile() +{ + using namespace Slic3r; + CadFeature sk; + sk.type = CadFeatureType::Sketch; + sk.plane = SketchPlane::XY(); + auto line = [](Vec2d a, Vec2d b, bool c) { + SketchEntity e; e.type = SketchEntity::Type::Line; e.p0 = a; e.p1 = b; e.construction = c; return e; }; + sk.entities = { line({5, 0}, {15, 0}, false), line({15, 0}, {15, 20}, false), + line({15, 20}, {5, 20}, false), line({5, 20}, {5, 0}, false), + line({0, 0}, {0, 20}, true) }; + return sk; +} +} // namespace + +TEST_CASE("revolve about a line of the sketch", "[CadDocument][revolve]") +{ + using namespace Slic3r; + + SECTION("a construction centerline: the profile sweeps into a tube around it") { + CadDocument doc; + doc.features.push_back(tube_half_profile()); + const int r = doc.add_revolve(0, 360.0, 0, false, BooleanMode::New, "Rev"); + doc.features[r].revolve_axis_entity = 4; + REQUIRE(doc.recompute()); + REQUIRE(doc.error.empty()); + REQUIRE(doc.bodies.size() == 1); + GProp_GProps props; + BRepGProp::VolumeProperties(doc.bodies[0].shape, props); + CHECK(props.Mass() == Approx(M_PI * (15. * 15. - 5. * 5.) * 20.).epsilon(1e-6)); // 4000 pi + Bnd_Box box; + BRepBndLib::Add(doc.bodies[0].shape, box); + double x0, y0, z0, x1, y1, z1; + box.Get(x0, y0, z0, x1, y1, z1); + CHECK(y0 == Approx(0.).margin(0.01)); // the axis runs along Y, as drawn + CHECK(y1 == Approx(20.).margin(0.01)); + CHECK(x1 == Approx(15.).margin(0.01)); + } + + SECTION("an edge of the profile itself: a solid cylinder") { + CadDocument doc; + doc.features.push_back(tube_half_profile()); + const int r = doc.add_revolve(0, 360.0, 0, false, BooleanMode::New, "Rev"); + doc.features[r].revolve_axis_entity = 3; // the rectangle's left side, u = 5 + REQUIRE(doc.recompute()); + REQUIRE(doc.error.empty()); + GProp_GProps props; + BRepGProp::VolumeProperties(doc.bodies[0].shape, props); + CHECK(props.Mass() == Approx(M_PI * 10. * 10. * 20.).epsilon(1e-6)); + } + + SECTION("an axis through the profile is refused with the reason") { + CadDocument doc; + CadFeature sk = tube_half_profile(); + sk.entities[4].p0 = Vec2d(10, 0); + sk.entities[4].p1 = Vec2d(10, 20); // straight through the middle of the rectangle + doc.features.push_back(sk); + const int r = doc.add_revolve(0, 360.0, 0, false, BooleanMode::New, "Rev"); + doc.features[r].revolve_axis_entity = 4; + CHECK_FALSE(doc.recompute()); + INFO(doc.error); + CHECK(doc.error.find("crosses the revolve axis") != std::string::npos); + } + + SECTION("an axis index that no longer names a line fails with a reason") { + CadDocument doc; + doc.features.push_back(tube_half_profile()); + const int r = doc.add_revolve(0, 360.0, 0, false, BooleanMode::New, "Rev"); + doc.features[r].revolve_axis_entity = 9; + CHECK_FALSE(doc.recompute()); + CHECK(doc.error.find("axis line") != std::string::npos); + } + + SECTION("the axis line survives save and load") { + CadDocument doc; + doc.features.push_back(tube_half_profile()); + const int r = doc.add_revolve(0, 270.0, 0, false, BooleanMode::New, "Rev"); + doc.features[r].revolve_axis_entity = 4; + REQUIRE(doc.recompute()); + CadDocument loaded; + REQUIRE(loaded.deserialize_recipe(doc.serialize_recipe())); + REQUIRE(loaded.features.size() == 2); + CHECK(loaded.features[1].revolve_axis_entity == 4); + CHECK(loaded.features[1].revolve_angle == Approx(270.)); + } +} From 1ff8fc465c14021872bacf3778599fd8dee14fca Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 17:46:50 +0000 Subject: [PATCH 152/389] Design tab: body edges 2 px wide Seen on the rig: at 1.5 px the body edges read as hairlines next to the sketch and selection strokes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- src/slic3r/GUI/CAD/DesignSketchTool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 675bdea216..f726d10beb 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -3468,7 +3468,7 @@ void DesignSketchTool::render_body_edges() const Camera& cam = wxGetApp().plater()->get_camera(); const Vec3d vd = cam.get_dir_forward(); const double px = 1.0 / std::max(cam.get_zoom(), 1e-6); - const double hw = 0.75 * px; // ~1.5 px wide + const double hw = 1.0 * px; // ~2 px wide: at 1.5 the lines read as hairlines // Pulled toward the eye by a few pixels, so the line wins the depth test against the two // faces meeting at the edge while a face in front of it still hides it. const Vec3d pull = -vd * (3.0 * px); From da76c3f43f66c1cf4c7e3fadc9e3bc1a785a98dc Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 30 Sep 2026 11:23:01 +0000 Subject: [PATCH 153/389] Design tab: Offset does not name a variable near The Windows builds of OrcaSlicer#16019 failed in DesignSketchTool.cpp: windows.h defines near (and far) as empty macros, so `Vec2d near = m_op_anchor;` reads as `Vec2d = m_op_anchor;` under clang-cl. The variable is now called closest. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- src/slic3r/GUI/CAD/DesignSketchTool.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index f726d10beb..6ff245a9be 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -8198,7 +8198,7 @@ void DesignSketchTool::recompute_op_ghost() // Read the side off the ghost instead: the arrow points from the picked entity to its // offset copy, flipped for a negative distance, so dragging it always follows the ghost. if (m_op_chain.size() > 1 && std::abs(m_op_value) > 1e-12 && !m_op_ghost.empty()) { - double best = 1e30; Vec2d near = m_op_anchor; + double best = 1e30; Vec2d closest = m_op_anchor; // not "near": a macro in windows.h for (const SketchEntity& g : m_op_ghost) { bool closed = false; const std::vector pl = entity_polyline(g, closed); @@ -8207,10 +8207,10 @@ void DesignSketchTool::recompute_op_ghost() const double l2 = d.squaredNorm(); const double t = l2 > 1e-24 ? std::clamp((m_op_anchor - a).dot(d) / l2, 0.0, 1.0) : 0.0; const Vec2d q = a + t * d; - if ((q - m_op_anchor).norm() < best) { best = (q - m_op_anchor).norm(); near = q; } + if ((q - m_op_anchor).norm() < best) { best = (q - m_op_anchor).norm(); closest = q; } } } - const Vec2d v = near - m_op_anchor; + const Vec2d v = closest - m_op_anchor; if (v.norm() > 1e-12) m_op_dir = (m_op_value > 0 ? 1.0 : -1.0) * v.normalized(); } } else if (m_mode == Mode::Mirror) { From d33dfa8f2cebb3c2955e0f7bc3a017db5b46fac5 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 30 Sep 2026 12:29:32 +0000 Subject: [PATCH 154/389] Tests: keep CAD test names ASCII so Windows CTest can select them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OrcaSlicer#16019's Windows unit-test jobs failed on one test, "Hole standards: ... 82° countersink": CTest passes the test name to Catch on the command line, the ° arrives in the ANSI code page, the filter matches no test and the run counts as failed ("No test cases matched", "No tests ran"). The name now says "82 degree"; it was the only test name in the suite outside ASCII. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- tests/libslic3r/test_caddocument.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index 480bd929e0..006b7705e2 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -8848,7 +8848,9 @@ TEST_CASE("A circular pattern spans its whole angle", "[CadDocument][pattern]") CHECK(doc.display_mesh.bounding_box().max.y() > 10.5); } -TEST_CASE("Hole standards: inch sizes by either name, with their 82° countersink", "[CadDocument][hole]") +// ASCII only: CTest passes the name to Catch on the command line, and on Windows a "°" arrives in +// the ANSI code page, matches no test and fails the run. +TEST_CASE("Hole standards: inch sizes by either name, with their 82 degree countersink", "[CadDocument][hole]") { CadDocument doc; const int a = doc.add_hole_standard("1/4-20", 2, true, 10, 0, 0, SketchPlane::XY(), "H1"); From 6cf747808c79c913665e8c03a7d811329d3d8290 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 30 Sep 2026 15:44:18 -0500 Subject: [PATCH 155/389] Belt: never start a scarf joint seam below the layer A scarf joint begins one layer height below the current layer and ramps up along the wall. On a tilted belt that start is a step backwards along the belt axis, into the previous layer's wall at the seam: 0.283 mm per 0.2 mm layer at 45 degrees. With an aligned seam the nozzle rams the same spot on every layer. A BabyBelt Pro benchy with seam_slope_type=external showed 601 such back-steps from layer 107 on, and in the field the belt "jumped backwards" and the head knocked the part loose. Belt printers now skip the scarf in GCode::extrude_loop, and the process tab greys the scarf controls out for them, as it already does for arc fitting. The regression test slices a cube on a belt with the scarf enabled and checks the belt axis never steps back by a layer pitch. --- src/libslic3r/GCode.cpp | 7 +++- src/slic3r/GUI/ConfigManipulation.cpp | 6 ++-- tests/fff_print/test_print.cpp | 51 +++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index ed2dd400d4..fae8860b7b 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -7661,8 +7661,13 @@ std::string GCode::extrude_loop(const ExtrusionLoop& loop_ref, loop.split_at(last_pos, false); const auto seam_scarf_type = m_config.seam_slope_type.value; + // Belt printers never get a scarf joint. The scarf starts one layer height + // below the layer, which on a tilted belt is a step backwards along the belt + // axis into the previous layer's wall at the seam (0.28 mm at 45 degrees per + // 0.2 mm layer); with an aligned seam that ram repeats at the same spot on + // every layer and knocks the part loose. bool enable_seam_slope = ((seam_scarf_type == SeamScarfType::External && !is_hole) || seam_scarf_type == SeamScarfType::All) && - !m_config.spiral_mode && + !m_config.spiral_mode && !m_config.belt_printer.value && (loop.role() == erExternalPerimeter || (loop.role() == erPerimeter && m_config.seam_slope_inner_walls)) && layer_id() > 0; const auto nozzle_diameter = EXTRUDER_CONFIG(nozzle_diameter); diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 65c2df092c..ac3ffa9006 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -1193,8 +1193,10 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in toggle_line("small_area_infill_flow_compensation_model", have_small_area_infill_flow_compensation); - toggle_field("seam_slope_type", !has_spiral_vase); - bool has_seam_slope = !has_spiral_vase && config->opt_enum("seam_slope_type") != SeamScarfType::None; + // Belt printers: the scarf would start one layer back along the belt, inside the + // previous layer (GCode::extrude_loop skips it there too). + toggle_field("seam_slope_type", !has_spiral_vase && !is_belt_printer); + bool has_seam_slope = !has_spiral_vase && !is_belt_printer && config->opt_enum("seam_slope_type") != SeamScarfType::None; toggle_line("seam_slope_conditional", has_seam_slope); toggle_line("seam_slope_start_height", has_seam_slope); toggle_line("seam_slope_entire_loop", has_seam_slope); diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index 78d8e0fd72..511a627fc1 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -20,6 +20,7 @@ #include "test_utils.hpp" #include +#include #include #include @@ -508,3 +509,53 @@ TEST_CASE("Sequential printing publishes the nozzle group result", "[Print][Mult CHECK(gcode.find("; SEQ-ND-OK") != std::string::npos); } } + +// A scarf joint starts one layer height below the layer and ramps up along the +// wall. On a tilted belt that start is a step backwards along the belt axis, into +// the previous layer's wall at the seam: 0.283 mm per 0.2 mm layer at 45 degrees. +// With an aligned seam the nozzle rams the same spot on every layer (field report +// from a BabyBelt Pro: the belt "jumped backwards" and knocked the part loose). +// Belt printers therefore never get a scarf, whatever the process preset says. +TEST_CASE("Belt printers never start a scarf seam below the layer", "[Print][belt][Seam]") +{ + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "belt_printer", 1 }, + { "belt_slice_rotation", "x" }, + { "belt_slice_rotation_angle", 45 }, + { "belt_slice_rotation_global", 1 }, + { "gcode_remap_x", "rev_x" }, + { "gcode_remap_y", "pos_z" }, + { "gcode_remap_z", "pos_y" }, + { "layer_height", 0.2 }, + { "initial_layer_print_height", 0.2 }, + { "skirt_loops", 0 }, + { "top_shell_layers", 0 }, + { "bottom_shell_layers", 1 }, + { "wall_loops", 2 }, + { "seam_position", "back" }, + { "seam_slope_type", "external" }, + { "seam_slope_inner_walls", 1 }, + { "seam_slope_start_height", 0 }, + { "machine_start_gcode", "T[initial_tool]\n" }, + { "layer_change_gcode", "G92 E0\n" }, + }); + const std::string gcode = slice({ cube(20) }, config); + REQUIRE(! gcode.empty()); + + // The belt axis is machine Z. Within a layer it only drifts by the frame + // coupling (well under 0.1 mm across a 20 mm cube); a scarf start is a full + // layer pitch (0.283 mm) backwards. + double last_z = std::numeric_limits::lowest(); + double worst_backstep = 0.; + GCodeReader parser; + parser.parse_buffer(gcode, [&](GCodeReader &, const GCodeReader::GCodeLine &line) { + if (! line.cmd_is("G1") || ! line.has_z()) + return; + const double z = line.z(); + if (last_z != std::numeric_limits::lowest()) + worst_backstep = std::max(worst_backstep, last_z - z); + last_z = z; + }); + CHECK(worst_backstep < 0.2); +} From 48af5b5d9725281983dfcf9dc60e0e15dd754212 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 30 Sep 2026 15:44:18 -0500 Subject: [PATCH 156/389] Read the pre-slice remap header tags at their real length The header tags lost their belt_ prefix in the Part 3.2 rename (20 characters now), but the parser still skipped 25, so every axis read as pos_x. Found in Hanif Koh's review of #14394. --- src/libslic3r/GCode/GCodeProcessor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index efb4a45ed0..88ce95195f 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -4232,13 +4232,13 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers return RemapAxis::PosX; }; if (boost::starts_with(comment, " preslice_remap_x = ")) { - m_result.preslice_remap_x = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + m_result.preslice_remap_x = parse_remap_axis(trim(std::string(comment.substr(20)))); return; } if (boost::starts_with(comment, " preslice_remap_y = ")) { - m_result.preslice_remap_y = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + m_result.preslice_remap_y = parse_remap_axis(trim(std::string(comment.substr(20)))); return; } if (boost::starts_with(comment, " preslice_remap_z = ")) { - m_result.preslice_remap_z = parse_remap_axis(trim(std::string(comment.substr(25)))); return; + m_result.preslice_remap_z = parse_remap_axis(trim(std::string(comment.substr(20)))); return; } } // wipe start tag From 2c0570c97d5ad6aaec27226dcc38649a099994c0 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 30 Sep 2026 15:44:49 -0500 Subject: [PATCH 157/389] Drop references to planning docs that are not in the tree The MachineKinematics comments pointed at docs/superpowers plan files, which are gitignored working notes. --- src/libslic3r/GCode/MachineKinematics.hpp | 2 +- tests/fff_print/test_gcodewriter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/MachineKinematics.hpp b/src/libslic3r/GCode/MachineKinematics.hpp index e046dd9476..5c53bd9f58 100644 --- a/src/libslic3r/GCode/MachineKinematics.hpp +++ b/src/libslic3r/GCode/MachineKinematics.hpp @@ -15,7 +15,7 @@ namespace Slic3r { // // This is a seam for writer-generated movement only. Start/end/custom G-code, // classic wipe-tower output and GCodeWriter::extrude_arc_to_xy() do NOT pass -// through it; see doc in 09-orca-machinekinematics-split-plan.md section 6. +// through it: they write machine coordinates directly. class MachineKinematics { public: diff --git a/tests/fff_print/test_gcodewriter.cpp b/tests/fff_print/test_gcodewriter.cpp index a37a4947ae..b8f2b890e5 100644 --- a/tests/fff_print/test_gcodewriter.cpp +++ b/tests/fff_print/test_gcodewriter.cpp @@ -1038,7 +1038,7 @@ SCENARIO("Belt: start-gcode prepare-stage moves keep their real Z", "[GCode][bel // --------------------------------------------------------------------------- // Regression tests for the two latent bugs the MachineKinematics refactor -// preserved deliberately (see 09b-latent-bug-fix-plan.md). +// preserved deliberately and the follow-up commit fixed. // --------------------------------------------------------------------------- // Bug 1. _travel_to_z() emits full XYZ whenever the mapping must emit every From 69a08915d10044d1ceae00fa0d1d59be64b08837 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 30 Sep 2026 17:29:33 -0500 Subject: [PATCH 158/389] Belt: do not fail the G-code height check against belt travel check_multi_extruder_gcode_valid() compares each object's max Z with printable_height. On a belt printer machine Z is belt travel (a 3DBenchy on the BabyBelt Pro runs from Z=197 to Z=309 on a 69 mm printable_height), so every belt export set the over-height error bit and the CLI refused the plate with -102 "G-code in unprintable area". The preview already skips its ToolHeightOutside warning for the same reason; the export check now does too. The XY printable-area check is unchanged. --- src/libslic3r/GCode/GCodeProcessor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 88ce95195f..c2aedd8262 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2860,7 +2860,11 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const int valid = false; } } - if ( iter->second.max_print_z > plate_printable_height ) { //over height + // Belt printers: machine Z is belt travel, which grows without bound over a + // print, while printable_height is the clearance above the belt; the two are + // not comparable, so the over-height check is skipped, as the preview's + // ToolHeightOutside warning already is. + if ( !machine_frame_active && iter->second.max_print_z > plate_printable_height ) { //over height m_result.gcode_check_result.error_code |= (1 << 3); std::pair filament_to_object_id; filament_to_object_id.first = iter->first; @@ -2901,7 +2905,7 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const int } // check printable height - if ((extruder_id < printable_heights.size()) && (iter->second.max_print_z > printable_heights[extruder_id])) { + if (!machine_frame_active && (extruder_id < printable_heights.size()) && (iter->second.max_print_z > printable_heights[extruder_id])) { m_result.gcode_check_result.error_code |= (1 << 1); std::pair filament_to_object_id; filament_to_object_id.first = iter->first; From 4f110bc26133516508e54bf4842762267a43e22e Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Wed, 30 Sep 2026 17:42:16 -0500 Subject: [PATCH 159/389] Belt scarf test: slice without a z-hop The default 0.4 mm z-hop is a 0.57 mm move along the belt axis and its return tripped the back-step check. Shipped belt profiles print without a z-hop, so the test does too. --- tests/fff_print/test_print.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index 511a627fc1..8b342fde68 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -537,6 +537,9 @@ TEST_CASE("Belt printers never start a scarf seam below the layer", "[Print][bel { "seam_slope_type", "external" }, { "seam_slope_inner_walls", 1 }, { "seam_slope_start_height", 0 }, + // No z-hop: on a belt a lift is a move along the belt axis (0.4 mm / sin 45 = 0.57 mm) + // and its return would read as a back-step. The shipped belt profiles print without one. + { "z_hop", 0 }, { "machine_start_gcode", "T[initial_tool]\n" }, { "layer_change_gcode", "G92 E0\n" }, }); From 92ab583ecc328506575064b0d8aae68d2923d2d2 Mon Sep 17 00:00:00 2001 From: ExPikaPaka Date: Thu, 1 Oct 2026 08:50:04 +0200 Subject: [PATCH 160/389] Reject 3MF component references that form a cycle _generate_current_object_list expands component references through a work list with no bound. An object whose component points back at itself, or a pair that point at each other, makes the list grow until the process runs out of memory: a few hundred bytes of XML take the slicer past 20 GB of resident size. Bound the expansion by the number of objects in the file. A reference chain longer than that has to revisit an object, so this rejects every cycle and no acyclic file, however deeply nested. A second bound on the number of expanded components stops an acyclic graph that fans out exponentially. --- src/libslic3r/Format/bbs_3mf.cpp | 34 +++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/Format/bbs_3mf.cpp b/src/libslic3r/Format/bbs_3mf.cpp index 160c169d69..e221cadd23 100644 --- a/src/libslic3r/Format/bbs_3mf.cpp +++ b/src/libslic3r/Format/bbs_3mf.cpp @@ -1340,7 +1340,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) bool _handle_start_relationship(const char** attributes, unsigned int num_attributes); - void _generate_current_object_list(std::vector &sub_objects, Id object_id, IdToCurrentObjectMap& current_objects); + bool _generate_current_object_list(std::vector &sub_objects, Id object_id, IdToCurrentObjectMap& current_objects); bool _generate_volumes_new(ModelObject& object, const std::vector &sub_objects, const ObjectMetadata::VolumeMetadataList& volumes, ConfigSubstitutionContext& config_substitutions); //bool _generate_volumes(ModelObject& object, const Geometry& geometry, const ObjectMetadata::VolumeMetadataList& volumes, ConfigSubstitutionContext& config_substitutions); @@ -2055,7 +2055,8 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) return false; } std::vector object_id_list; - _generate_current_object_list(object_id_list, object.first, m_current_objects); + if (!_generate_current_object_list(object_id_list, object.first, m_current_objects)) + return false; ObjectMetadata::VolumeMetadataList volumes; ObjectMetadata::VolumeMetadataList* volumes_ptr = nullptr; @@ -2154,7 +2155,8 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) }*/ std::vector object_id_list; - _generate_current_object_list(object_id_list, object.first, m_current_objects); + if (!_generate_current_object_list(object_id_list, object.first, m_current_objects)) + return false; ObjectMetadata::VolumeMetadataList volumes; ObjectMetadata::VolumeMetadataList* volumes_ptr = nullptr; @@ -5002,31 +5004,45 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) return true; } - void _BBS_3MF_Importer::_generate_current_object_list(std::vector &sub_objects, Id object_id, IdToCurrentObjectMap ¤t_objects) + bool _BBS_3MF_Importer::_generate_current_object_list(std::vector &sub_objects, Id object_id, IdToCurrentObjectMap ¤t_objects) { - std::list> id_list; - id_list.push_back(std::make_pair(Component(object_id, Transform3d::Identity()), Transform3d::Identity())); + // A chain of component references longer than the number of objects has to visit an object + // twice, so the component graph contains a cycle and the expansion below would not stop. + const size_t max_depth = current_objects.size(); + // An acyclic graph may still expand exponentially, so bound the number of expanded components + // as well. Way above the number of parts of any real object. + static constexpr size_t max_components = 100000; + std::list> id_list; + id_list.push_back(std::make_tuple(Component(object_id, Transform3d::Identity()), Transform3d::Identity(), 0)); + + size_t num_components = 0; while (!id_list.empty()) { auto current_item = id_list.front(); - Component current_id = current_item.first; + Component current_id = std::get<0>(current_item); id_list.pop_front(); + if (std::get<2>(current_item) > max_depth || ++ num_components > max_components) { + add_error("invalid 3mf: cyclic or too deeply nested components"); + sub_objects.clear(); + return false; + } IdToCurrentObjectMap::iterator current_object = current_objects.find(current_id.object_id); if (current_object != current_objects.end()) { //found one if (!current_object->second.components.empty()) { for (const Component &comp : current_object->second.components) { - id_list.push_back(std::pair(comp, current_item.second * comp.transform)); + id_list.push_back(std::make_tuple(comp, std::get<1>(current_item) * comp.transform, std::get<2>(current_item) + 1)); } } else if (!(current_object->second.geometry.empty())) { //CurrentObject* ptr = &(current_objects[current_id]); //CurrentObject* ptr2 = &(current_object->second); - sub_objects.push_back({ current_object->first, current_item.second}); + sub_objects.push_back({ current_object->first, std::get<1>(current_item)}); } } } + return true; } bool _BBS_3MF_Importer::_generate_volumes_new(ModelObject& object, const std::vector &sub_objects, const ObjectMetadata::VolumeMetadataList& volumes, ConfigSubstitutionContext& config_substitutions) From ae3e41eb023e84327b927b9562813806428eaae1 Mon Sep 17 00:00:00 2001 From: ExPikaPaka Date: Thu, 1 Oct 2026 09:14:46 +0200 Subject: [PATCH 161/389] Add a regression test for a cyclic component reference Stores a painted cube, points its component back at the object that holds it and expects the load to fail. Without the bound the test does not finish: the work list grows until the process is killed. --- tests/libslic3r/test_3mf.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/libslic3r/test_3mf.cpp b/tests/libslic3r/test_3mf.cpp index 846caf5432..aed42e81b7 100644 --- a/tests/libslic3r/test_3mf.cpp +++ b/tests/libslic3r/test_3mf.cpp @@ -27,6 +27,7 @@ #include #include // for std::enable_if_t #include // for typeid +#include namespace Catch { template @@ -321,6 +322,30 @@ TEST_CASE("A project with a plate id below 1 fails to load", "[3mf][Regression]" REQUIRE_FALSE(loaded); } +TEST_CASE("A project whose components reference themselves fails to load", "[3mf][Regression]") +{ + ScopedTemporaryFile temp(".3mf"); + store_painted_cube(temp.string()); + + // Point the component back at the object that holds it. Expanding that reference used to push + // into the work list forever, growing it until the process ran out of memory. + REQUIRE(rewrite_3mf_entries(temp.string(), [](std::string& name, std::string& data) { + if (!boost::algorithm::ends_with(name, "3dmodel.model")) + return false; + std::smatch match; + if (!std::regex_search(data, match, std::regex("]*>\\s* Date: Thu, 1 Oct 2026 15:38:24 +0000 Subject: [PATCH 162/389] Design tab: follow Orca's theme, scale, mouse settings, dialogs and undo Felix14-v2's review of OrcaSlicer#16019 found the tab behaving as a world of its own. - Icons: the design_* glyphs were drawn in a fixed light grey, made for the dark ribbon, and the toolbar re-tinted some of them by rebuilding the bitmap from a wxImage, which drops the HiDPI scale factor Orca sets on Windows: at 150 % the icons came out half again too large for buttons that were sized in raw pixels, overlapping and clipped. The glyphs now use Orca's sidebar icon grey (#949494), which the icon cache maps per theme, nothing is re-tinted, toolbar glyphs drawn for Prepare's light toolbar use their "_dark" twin, and every size is in DIP. - Theme: the chrome colours were read once, at construction, and nothing in the tab answered a theme switch, so switching left light surfaces and unreadable text in a dark tab and the other way round. The colours are now {light, dark} token pairs; MainFrame::on_sys_color_changed reaches DesignPanel::on_sys_color_changed, which moves every token colour onto the other theme's, runs the app's dark pass and re-rasterises the icons. Card borders are StateColors, resolved at paint time. - Scale: MainFrame::on_dpi_changed reaches DesignPanel::msw_rescale, which re-rasterises every icon (buttons, flyout rows, card headers, the tree's image list, now sized from its bitmaps) and re-measures the Orca widgets. - Mouse: the canvas no longer forces middle-drag to orbit and right-drag to pan; it reads the drag actions in Preferences > Control like Prepare. Left-drag is shared with picking, so the whole-body rubber band takes Shift+left-drag while left-drag is given to the camera. - FPS counter: ImGui's display size is shared and only refreshed when a canvas sees its own size change; the Design canvas now re-announces its size when the tab is entered (and the editor canvas when it is left), as Plater does between Prepare and Preview. - Viewport text: the status line and the tool readout were top-level popups over GL. A popup does not follow its frame, so the empty-canvas hint floated over other applications, and the readout was never taken down with the tab. Both are drawn by the canvas in the tool's ImGui pass now, with the theme's overlay style. - Dialogs: messages use MessageDialog/RichMessageDialog; Add/Edit Variable is one Orca dialog with Name and Expression fields instead of two native text prompts; the Text dialog uses TextInput, ComboBox and CheckBox (its height is a TextInput: SpinInput is integer-only), and enumerates the installed fonts once per session. The ribbon's Confirm/Cancel, the reference pick buttons and the expression buttons are Orca Buttons; the variable actions are icon buttons like the other cards'. - Undo: the tab's own Undo/Redo buttons are gone. The top bar's Undo/Redo drive the Design history while the tab is shown, greyed to what an undo would do, as Ctrl+Z and Edit already did. - The first build of the tab logs how long each phase took ("Design tab build: ..."): it is under a second here but was reported at about fifteen on Windows. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QK4VgguuCAk2hZLWgcjJb9 --- docs/HLSD/design-tab.md | 23 + resources/images/design_arc3pt.svg | 2 +- resources/images/design_arc_center.svg | 2 +- resources/images/design_array.svg | 2 +- resources/images/design_boolean.svg | 2 +- resources/images/design_bspline.svg | 2 +- resources/images/design_c_angle.svg | 2 +- resources/images/design_c_coincident.svg | 2 +- resources/images/design_c_collinear.svg | 2 +- resources/images/design_c_concentric.svg | 2 +- resources/images/design_c_diameter.svg | 2 +- resources/images/design_c_dist_x.svg | 2 +- resources/images/design_c_dist_y.svg | 2 +- resources/images/design_c_equal.svg | 2 +- resources/images/design_c_equal_radius.svg | 2 +- resources/images/design_c_fix.svg | 2 +- resources/images/design_c_horizontal.svg | 2 +- resources/images/design_c_midpoint.svg | 2 +- resources/images/design_c_parallel.svg | 2 +- resources/images/design_c_perpendicular.svg | 2 +- resources/images/design_c_radius.svg | 2 +- resources/images/design_c_sym_h.svg | 2 +- resources/images/design_c_sym_v.svg | 2 +- resources/images/design_c_symmetric.svg | 2 +- resources/images/design_c_tangent.svg | 2 +- resources/images/design_c_vertical.svg | 2 +- resources/images/design_chamfer.svg | 2 +- resources/images/design_check.svg | 2 +- resources/images/design_circle.svg | 2 +- resources/images/design_circle2pt.svg | 2 +- resources/images/design_circle3pt.svg | 2 +- resources/images/design_constrain.svg | 2 +- resources/images/design_construction.svg | 2 +- resources/images/design_crect.svg | 2 +- resources/images/design_cut.svg | 2 +- resources/images/design_delete.svg | 2 +- resources/images/design_dimension.svg | 2 +- resources/images/design_draft.svg | 2 +- resources/images/design_dressup.svg | 2 +- resources/images/design_edit.svg | 2 +- resources/images/design_ellipse.svg | 2 +- resources/images/design_ellipse_arc.svg | 2 +- resources/images/design_extend.svg | 2 +- resources/images/design_extrude.svg | 2 +- resources/images/design_eye.svg | 2 +- resources/images/design_filletedge.svg | 2 +- resources/images/design_hole.svg | 2 +- resources/images/design_line.svg | 2 +- resources/images/design_loft.svg | 2 +- resources/images/design_mirror.svg | 2 +- resources/images/design_move.svg | 2 +- resources/images/design_movedown.svg | 2 +- resources/images/design_moveup.svg | 2 +- resources/images/design_offset.svg | 2 +- resources/images/design_pattern.svg | 2 +- resources/images/design_plane.svg | 2 +- resources/images/design_point.svg | 2 +- resources/images/design_polararray.svg | 2 +- resources/images/design_polygon.svg | 2 +- resources/images/design_polyline.svg | 2 +- resources/images/design_rect.svg | 2 +- resources/images/design_rect_oblique.svg | 2 +- resources/images/design_rect_rounded.svg | 2 +- resources/images/design_revolve.svg | 2 +- resources/images/design_rib.svg | 2 +- resources/images/design_rotate.svg | 2 +- resources/images/design_scale.svg | 2 +- resources/images/design_select.svg | 2 +- resources/images/design_shell.svg | 2 +- resources/images/design_sketch.svg | 2 +- resources/images/design_slot.svg | 2 +- resources/images/design_slot_arc.svg | 2 +- resources/images/design_step.svg | 2 +- resources/images/design_surface.svg | 2 +- resources/images/design_svg.svg | 2 +- resources/images/design_sweep.svg | 2 +- resources/images/design_tangentarc.svg | 2 +- resources/images/design_text.svg | 2 +- resources/images/design_thicken.svg | 2 +- resources/images/design_thread.svg | 2 +- resources/images/design_trim.svg | 2 +- src/slic3r/GUI/BBLTopbar.cpp | 16 + src/slic3r/GUI/BBLTopbar.hpp | 1 + src/slic3r/GUI/CAD/DesignCanvas.cpp | 258 +++------- src/slic3r/GUI/CAD/DesignCanvas.hpp | 40 +- src/slic3r/GUI/CAD/DesignPanel.cpp | 513 ++++++++++++-------- src/slic3r/GUI/CAD/DesignPanel.hpp | 50 +- src/slic3r/GUI/CAD/DesignSketchTool.cpp | 12 +- src/slic3r/GUI/CAD/DesignSketchTool.hpp | 7 +- src/slic3r/GUI/CAD/DesignTextDialog.cpp | 144 ++++-- src/slic3r/GUI/CAD/DesignTextDialog.hpp | 21 +- src/slic3r/GUI/GLCanvas3D.cpp | 4 - src/slic3r/GUI/GLCanvas3D.hpp | 6 - src/slic3r/GUI/MainFrame.cpp | 20 + src/slic3r/GUI/MainFrame.hpp | 2 + 95 files changed, 666 insertions(+), 611 deletions(-) diff --git a/docs/HLSD/design-tab.md b/docs/HLSD/design-tab.md index d916f3bf2f..49a4e7256b 100644 --- a/docs/HLSD/design-tab.md +++ b/docs/HLSD/design-tab.md @@ -157,6 +157,11 @@ button (to terminate a chain, say) declines to also open a menu, through a read- Past either budget the event is navigation, and navigation does not transition the state machine. +Navigation itself is Prepare's: the camera reads the drag actions set in Preferences > Control +for each button. The left button is shared with picking, so a whole body is swept with a +rectangle on plain left-drag only while no camera action is assigned to it, and with +Shift+left-drag otherwise — Prepare's own rectangle selection. + Entering a sketch changes three things at once so the mode is legible: a banner above the canvas (a sibling of the canvas, not a child over it — on GTK a child window over a `wxGLCanvas` is a native window and does not reliably stack over GL), the printer bed muted so @@ -182,6 +187,24 @@ degenerate edges are left out (`GeometryEngine::display_edges`), and the polylin once per shape, keyed by its `TShape`, because a recompute that leaves a body unchanged is the common case. +## Following the app + +The tab is a page of Orca's main window and answers to the same settings as Prepare. + +- **Theme.** Its chrome is coloured from a table of light/dark token pairs. A theme switch + reaches `DesignPanel::on_sys_color_changed` from `MainFrame`, which moves every colour that is + one theme's token onto the other theme's and then runs the app's own dark pass; the icons are + Orca's sidebar grey, which the icon cache maps per theme, so they are re-rasterised rather + than re-tinted. +- **Scale.** Sizes are in DIP, and a DPI change reaches `DesignPanel::msw_rescale`, which + re-rasterises every icon (button faces, flyout rows, card headers, the tree's image list). +- **Viewport text.** The status line and the active tool's values are drawn by the canvas in + its ImGui pass, so they go with the canvas: a top-level window over GL does not follow its + frame and was left floating over other applications. +- **Undo.** The tab keeps its own history (the recipe is not part of Prepare's snapshots), but + it has no Undo/Redo of its own: the top bar, `Ctrl+Z` and Edit drive it while the tab is + shown, greyed to what an undo would actually do. + ## The offer is generated, not hand-written Right-clicking geometry opens the *offer*: eight families in a fixed order, each verb at a diff --git a/resources/images/design_arc3pt.svg b/resources/images/design_arc3pt.svg index 1b40569b4f..951db22615 100644 --- a/resources/images/design_arc3pt.svg +++ b/resources/images/design_arc3pt.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_arc_center.svg b/resources/images/design_arc_center.svg index e4c85febfc..05bb4f5a56 100644 --- a/resources/images/design_arc_center.svg +++ b/resources/images/design_arc_center.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_array.svg b/resources/images/design_array.svg index d29da47bd7..a22343e9eb 100644 --- a/resources/images/design_array.svg +++ b/resources/images/design_array.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_boolean.svg b/resources/images/design_boolean.svg index 97813cf2eb..7eace7fc2b 100644 --- a/resources/images/design_boolean.svg +++ b/resources/images/design_boolean.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/images/design_bspline.svg b/resources/images/design_bspline.svg index 16a5dc9b31..180f3fc24a 100644 --- a/resources/images/design_bspline.svg +++ b/resources/images/design_bspline.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_angle.svg b/resources/images/design_c_angle.svg index 2359b23b6a..5fe8683f68 100644 --- a/resources/images/design_c_angle.svg +++ b/resources/images/design_c_angle.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_coincident.svg b/resources/images/design_c_coincident.svg index 83ab602eca..8a72107cd3 100644 --- a/resources/images/design_c_coincident.svg +++ b/resources/images/design_c_coincident.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_collinear.svg b/resources/images/design_c_collinear.svg index 28b8b6a8cd..ddc46acde3 100644 --- a/resources/images/design_c_collinear.svg +++ b/resources/images/design_c_collinear.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_concentric.svg b/resources/images/design_c_concentric.svg index 9861381b58..4e3123b6e5 100644 --- a/resources/images/design_c_concentric.svg +++ b/resources/images/design_c_concentric.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_diameter.svg b/resources/images/design_c_diameter.svg index 8e3766c4dc..76366179a1 100644 --- a/resources/images/design_c_diameter.svg +++ b/resources/images/design_c_diameter.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_dist_x.svg b/resources/images/design_c_dist_x.svg index e811a58df6..7455e3629a 100644 --- a/resources/images/design_c_dist_x.svg +++ b/resources/images/design_c_dist_x.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_dist_y.svg b/resources/images/design_c_dist_y.svg index 5aefec85ee..ecfb38a08f 100644 --- a/resources/images/design_c_dist_y.svg +++ b/resources/images/design_c_dist_y.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_equal.svg b/resources/images/design_c_equal.svg index f0657b74b0..4c3e2ebd3a 100644 --- a/resources/images/design_c_equal.svg +++ b/resources/images/design_c_equal.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_equal_radius.svg b/resources/images/design_c_equal_radius.svg index 4d7ccf2c5c..7ed9b3ca45 100644 --- a/resources/images/design_c_equal_radius.svg +++ b/resources/images/design_c_equal_radius.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_fix.svg b/resources/images/design_c_fix.svg index b64024286e..38d0ec5279 100644 --- a/resources/images/design_c_fix.svg +++ b/resources/images/design_c_fix.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_horizontal.svg b/resources/images/design_c_horizontal.svg index 9804a8ad82..9dbc1a4462 100644 --- a/resources/images/design_c_horizontal.svg +++ b/resources/images/design_c_horizontal.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_midpoint.svg b/resources/images/design_c_midpoint.svg index 6646a6cc1e..cae9ce48d4 100644 --- a/resources/images/design_c_midpoint.svg +++ b/resources/images/design_c_midpoint.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_parallel.svg b/resources/images/design_c_parallel.svg index cc78f9c452..7622362d2f 100644 --- a/resources/images/design_c_parallel.svg +++ b/resources/images/design_c_parallel.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_perpendicular.svg b/resources/images/design_c_perpendicular.svg index 9a67cebb2b..1072b1f673 100644 --- a/resources/images/design_c_perpendicular.svg +++ b/resources/images/design_c_perpendicular.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_radius.svg b/resources/images/design_c_radius.svg index 5e1f1cdadf..906268d3d7 100644 --- a/resources/images/design_c_radius.svg +++ b/resources/images/design_c_radius.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_sym_h.svg b/resources/images/design_c_sym_h.svg index 4e152787b1..6743e8a42d 100644 --- a/resources/images/design_c_sym_h.svg +++ b/resources/images/design_c_sym_h.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_sym_v.svg b/resources/images/design_c_sym_v.svg index f4cd99371a..5019a82fcc 100644 --- a/resources/images/design_c_sym_v.svg +++ b/resources/images/design_c_sym_v.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_symmetric.svg b/resources/images/design_c_symmetric.svg index 7a539be9a3..1f9b07e361 100644 --- a/resources/images/design_c_symmetric.svg +++ b/resources/images/design_c_symmetric.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_tangent.svg b/resources/images/design_c_tangent.svg index e82d23240d..66b320a14c 100644 --- a/resources/images/design_c_tangent.svg +++ b/resources/images/design_c_tangent.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_c_vertical.svg b/resources/images/design_c_vertical.svg index 98526e93d7..1399c97012 100644 --- a/resources/images/design_c_vertical.svg +++ b/resources/images/design_c_vertical.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_chamfer.svg b/resources/images/design_chamfer.svg index 861f7b819a..f70bd8c6f8 100644 --- a/resources/images/design_chamfer.svg +++ b/resources/images/design_chamfer.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_check.svg b/resources/images/design_check.svg index 82d5edd48e..d00643de54 100644 --- a/resources/images/design_check.svg +++ b/resources/images/design_check.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_circle.svg b/resources/images/design_circle.svg index edc74b13ea..7ace8bdab5 100644 --- a/resources/images/design_circle.svg +++ b/resources/images/design_circle.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_circle2pt.svg b/resources/images/design_circle2pt.svg index 844b0797eb..7d2716eb10 100644 --- a/resources/images/design_circle2pt.svg +++ b/resources/images/design_circle2pt.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_circle3pt.svg b/resources/images/design_circle3pt.svg index 6fdbab2474..3d82ae3788 100644 --- a/resources/images/design_circle3pt.svg +++ b/resources/images/design_circle3pt.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_constrain.svg b/resources/images/design_constrain.svg index cc9be6ca9b..b8ce387f81 100644 --- a/resources/images/design_constrain.svg +++ b/resources/images/design_constrain.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_construction.svg b/resources/images/design_construction.svg index 89d10f424d..22c4494181 100644 --- a/resources/images/design_construction.svg +++ b/resources/images/design_construction.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_crect.svg b/resources/images/design_crect.svg index 9e2ece0c24..e76ff04c8d 100644 --- a/resources/images/design_crect.svg +++ b/resources/images/design_crect.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_cut.svg b/resources/images/design_cut.svg index 3f68a7002e..0f130768bf 100644 --- a/resources/images/design_cut.svg +++ b/resources/images/design_cut.svg @@ -1,4 +1,4 @@ - + diff --git a/resources/images/design_delete.svg b/resources/images/design_delete.svg index f5d5c6a1c7..4920eb5667 100644 --- a/resources/images/design_delete.svg +++ b/resources/images/design_delete.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_dimension.svg b/resources/images/design_dimension.svg index f456abb6fc..87fb20c95e 100644 --- a/resources/images/design_dimension.svg +++ b/resources/images/design_dimension.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_draft.svg b/resources/images/design_draft.svg index 2957584cb8..6e972c5505 100644 --- a/resources/images/design_draft.svg +++ b/resources/images/design_draft.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_dressup.svg b/resources/images/design_dressup.svg index cc2a09250e..cd3cbfc78f 100644 --- a/resources/images/design_dressup.svg +++ b/resources/images/design_dressup.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_edit.svg b/resources/images/design_edit.svg index 4de84fc390..b1dc0fabaa 100644 --- a/resources/images/design_edit.svg +++ b/resources/images/design_edit.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_ellipse.svg b/resources/images/design_ellipse.svg index 1f946eb5fa..22e486ad15 100644 --- a/resources/images/design_ellipse.svg +++ b/resources/images/design_ellipse.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_ellipse_arc.svg b/resources/images/design_ellipse_arc.svg index e9cd4aa66a..b5dea944a8 100644 --- a/resources/images/design_ellipse_arc.svg +++ b/resources/images/design_ellipse_arc.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_extend.svg b/resources/images/design_extend.svg index 9d4934fada..de0e9e98b3 100644 --- a/resources/images/design_extend.svg +++ b/resources/images/design_extend.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_extrude.svg b/resources/images/design_extrude.svg index 8137336fb2..84c8bd3c7c 100644 --- a/resources/images/design_extrude.svg +++ b/resources/images/design_extrude.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_eye.svg b/resources/images/design_eye.svg index 97296c7465..8499d684a6 100644 --- a/resources/images/design_eye.svg +++ b/resources/images/design_eye.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_filletedge.svg b/resources/images/design_filletedge.svg index 435d7c2cb9..622a2fc306 100644 --- a/resources/images/design_filletedge.svg +++ b/resources/images/design_filletedge.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_hole.svg b/resources/images/design_hole.svg index 35128ef51e..885462ed53 100644 --- a/resources/images/design_hole.svg +++ b/resources/images/design_hole.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_line.svg b/resources/images/design_line.svg index afb644ba3f..c7ead6b7f8 100644 --- a/resources/images/design_line.svg +++ b/resources/images/design_line.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_loft.svg b/resources/images/design_loft.svg index 4529b52554..574262ae18 100644 --- a/resources/images/design_loft.svg +++ b/resources/images/design_loft.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_mirror.svg b/resources/images/design_mirror.svg index 0a9642f8f3..66616a7636 100644 --- a/resources/images/design_mirror.svg +++ b/resources/images/design_mirror.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_move.svg b/resources/images/design_move.svg index dba4f4f4c2..3b4aaf1582 100644 --- a/resources/images/design_move.svg +++ b/resources/images/design_move.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_movedown.svg b/resources/images/design_movedown.svg index 89c442dc6e..35b8c97852 100644 --- a/resources/images/design_movedown.svg +++ b/resources/images/design_movedown.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_moveup.svg b/resources/images/design_moveup.svg index b2fe5ec127..eada91ed5f 100644 --- a/resources/images/design_moveup.svg +++ b/resources/images/design_moveup.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_offset.svg b/resources/images/design_offset.svg index 74758ad0ba..e71c86a5e9 100644 --- a/resources/images/design_offset.svg +++ b/resources/images/design_offset.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_pattern.svg b/resources/images/design_pattern.svg index c07708509b..57f8a49ddc 100644 --- a/resources/images/design_pattern.svg +++ b/resources/images/design_pattern.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_plane.svg b/resources/images/design_plane.svg index 8a3886158f..3e7017a625 100644 --- a/resources/images/design_plane.svg +++ b/resources/images/design_plane.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_point.svg b/resources/images/design_point.svg index dd5d750545..31bfeefa4f 100644 --- a/resources/images/design_point.svg +++ b/resources/images/design_point.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_polararray.svg b/resources/images/design_polararray.svg index 5e91d49f73..5f2c0f336b 100644 --- a/resources/images/design_polararray.svg +++ b/resources/images/design_polararray.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_polygon.svg b/resources/images/design_polygon.svg index de5cfd6f20..22ebdcbad9 100644 --- a/resources/images/design_polygon.svg +++ b/resources/images/design_polygon.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_polyline.svg b/resources/images/design_polyline.svg index 96538abea7..ea18b80090 100644 --- a/resources/images/design_polyline.svg +++ b/resources/images/design_polyline.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_rect.svg b/resources/images/design_rect.svg index 67b70cc6a1..adeb8feab4 100644 --- a/resources/images/design_rect.svg +++ b/resources/images/design_rect.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_rect_oblique.svg b/resources/images/design_rect_oblique.svg index 5d252ca677..4aecab5786 100644 --- a/resources/images/design_rect_oblique.svg +++ b/resources/images/design_rect_oblique.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_rect_rounded.svg b/resources/images/design_rect_rounded.svg index a8c7022c87..887c684a2b 100644 --- a/resources/images/design_rect_rounded.svg +++ b/resources/images/design_rect_rounded.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_revolve.svg b/resources/images/design_revolve.svg index 3a0e87f6f4..84d9e45eff 100644 --- a/resources/images/design_revolve.svg +++ b/resources/images/design_revolve.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_rib.svg b/resources/images/design_rib.svg index b481e38d23..50e54fe16d 100644 --- a/resources/images/design_rib.svg +++ b/resources/images/design_rib.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_rotate.svg b/resources/images/design_rotate.svg index 5a9b48ebfe..39b71ec06a 100644 --- a/resources/images/design_rotate.svg +++ b/resources/images/design_rotate.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_scale.svg b/resources/images/design_scale.svg index 5a53562ba3..38b470cc8d 100644 --- a/resources/images/design_scale.svg +++ b/resources/images/design_scale.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_select.svg b/resources/images/design_select.svg index 6f2e4f4ae9..aabd953c02 100644 --- a/resources/images/design_select.svg +++ b/resources/images/design_select.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_shell.svg b/resources/images/design_shell.svg index aa11b572e6..4a78b94a33 100644 --- a/resources/images/design_shell.svg +++ b/resources/images/design_shell.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_sketch.svg b/resources/images/design_sketch.svg index 102a9fe493..b4177317eb 100644 --- a/resources/images/design_sketch.svg +++ b/resources/images/design_sketch.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_slot.svg b/resources/images/design_slot.svg index f1c72f8c54..db7c497474 100644 --- a/resources/images/design_slot.svg +++ b/resources/images/design_slot.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_slot_arc.svg b/resources/images/design_slot_arc.svg index f17ab89144..63be75cb8b 100644 --- a/resources/images/design_slot_arc.svg +++ b/resources/images/design_slot_arc.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_step.svg b/resources/images/design_step.svg index 4bdf7811ff..a4a92b7b20 100644 --- a/resources/images/design_step.svg +++ b/resources/images/design_step.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_surface.svg b/resources/images/design_surface.svg index 1299dd1a97..5beec5ce48 100644 --- a/resources/images/design_surface.svg +++ b/resources/images/design_surface.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_svg.svg b/resources/images/design_svg.svg index 34a0685153..daa5f5129a 100644 --- a/resources/images/design_svg.svg +++ b/resources/images/design_svg.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_sweep.svg b/resources/images/design_sweep.svg index f1cc301b1e..876f23745a 100644 --- a/resources/images/design_sweep.svg +++ b/resources/images/design_sweep.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_tangentarc.svg b/resources/images/design_tangentarc.svg index 9e53da5c8e..bbcdd0ed5f 100644 --- a/resources/images/design_tangentarc.svg +++ b/resources/images/design_tangentarc.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_text.svg b/resources/images/design_text.svg index 78da223f62..cae04fb4c2 100644 --- a/resources/images/design_text.svg +++ b/resources/images/design_text.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_thicken.svg b/resources/images/design_thicken.svg index bfcd356cfa..b1c78a145c 100644 --- a/resources/images/design_thicken.svg +++ b/resources/images/design_thicken.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_thread.svg b/resources/images/design_thread.svg index 9bff4d778b..e27125f37a 100644 --- a/resources/images/design_thread.svg +++ b/resources/images/design_thread.svg @@ -1 +1 @@ - + diff --git a/resources/images/design_trim.svg b/resources/images/design_trim.svg index 405e9fe3c4..f052f1fad7 100644 --- a/resources/images/design_trim.svg +++ b/resources/images/design_trim.svg @@ -1 +1 @@ - + diff --git a/src/slic3r/GUI/BBLTopbar.cpp b/src/slic3r/GUI/BBLTopbar.cpp index eb6f4bcb00..cc72bd507b 100644 --- a/src/slic3r/GUI/BBLTopbar.cpp +++ b/src/slic3r/GUI/BBLTopbar.cpp @@ -12,6 +12,9 @@ #include "wxExtensions.hpp" #include "Plater.hpp" #include "MainFrame.hpp" +#ifdef SLIC3R_CAD +#include "CAD/DesignPanel.hpp" +#endif #include "WebViewDialog.hpp" #include "PartPlate.hpp" @@ -424,6 +427,9 @@ void BBLTopbar::OnSaveProject(wxAuiToolBarEvent& event) void BBLTopbar::OnUndo(wxAuiToolBarEvent& event) { MainFrame* main_frame = dynamic_cast(m_frame); +#ifdef SLIC3R_CAD + if (DesignPanel* design = main_frame->shown_design_panel()) { design->menu_undo_redo(false); return; } +#endif Plater* plater = main_frame->plater(); plater->undo(); } @@ -431,6 +437,9 @@ void BBLTopbar::OnUndo(wxAuiToolBarEvent& event) void BBLTopbar::OnRedo(wxAuiToolBarEvent& event) { MainFrame* main_frame = dynamic_cast(m_frame); +#ifdef SLIC3R_CAD + if (DesignPanel* design = main_frame->shown_design_panel()) { design->menu_undo_redo(true); return; } +#endif Plater* plater = main_frame->plater(); plater->redo(); } @@ -443,6 +452,13 @@ void BBLTopbar::EnableUndoRedoItems() Refresh(); } +void BBLTopbar::EnableUndoRedo(bool undo, bool redo) +{ + this->EnableTool(m_undo_item->GetId(), undo); + this->EnableTool(m_redo_item->GetId(), redo); + Refresh(); +} + void BBLTopbar::DisableUndoRedoItems() { this->EnableTool(m_undo_item->GetId(), false); diff --git a/src/slic3r/GUI/BBLTopbar.hpp b/src/slic3r/GUI/BBLTopbar.hpp index 2745490d00..c403708eaa 100644 --- a/src/slic3r/GUI/BBLTopbar.hpp +++ b/src/slic3r/GUI/BBLTopbar.hpp @@ -69,6 +69,7 @@ public: void EnableUndoRedoItems(); void DisableUndoRedoItems(); + void EnableUndoRedo(bool undo, bool redo); void SaveNormalRect(); diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index 6c3516b619..95dc7600d2 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -8,6 +8,7 @@ #include "slic3r/GUI/Camera.hpp" // N: look down the sketch plane normal #include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/Plater.hpp" +#include "slic3r/GUI/ImGuiWrapper.hpp" #include "libslic3r/Model.hpp" #include "libslic3r/TriangleMesh.hpp" #include "slic3r/GUI/3DScene.hpp" @@ -48,12 +49,6 @@ DesignCanvas::DesignCanvas(wxWindow* parent) m_canvas->set_type(GLCanvas3D::ECanvasType::CanvasView3D); m_canvas->set_studio_lighting(true); // see GLCanvas3D::m_studio_lighting and phong.fs - // CAD navigation, this canvas only: left-drag sweeps a selection rubber band, so orbit - // moves to middle-drag and pan to right-drag. Design is a different modality from - // Prepare/Preview and every CAD the user already knows maps the mouse this way; the other - // tabs are untouched. - m_canvas->set_cad_navigation(true); - m_canvas->enable_picking(false); // viewport face/edge picking is custom (TODO) m_canvas->enable_moving(false); m_canvas->enable_gizmos(false); @@ -155,76 +150,11 @@ DesignCanvas::DesignCanvas(wxWindow* parent) if (m_inline_editor) m_inline_editor->commit(); }; - // Bottom-right viewport HUD: a borderless, non-focusable float label showing the active - // tool's current values. Top-level (a child widget is hidden by the GL surface, same as - // the inline editor). Fed every frame by the tool's on_readout; empty text hides it. - // NON-FOCUSABLE IS THE LOAD-BEARING WORD, and a wxFrame is not: see the header. The chip - // outlives the gesture that drew it, and while it held the X input focus every sketch - // shortcut was swallowed until the user clicked the canvas. Same window class as the status - // chip below for the same reason. Do not "simplify" it back to a wxFrame. - { - wxWindow* top = wxGetTopLevelParent(m_canvas_widget); - m_hud = new wxPopupWindow(top, wxBORDER_NONE); - m_hud->SetBackgroundColour(wxColour(28, 30, 34)); - m_hud_label = new wxStaticText(m_hud, wxID_ANY, wxEmptyString); - m_hud_label->SetForegroundColour(wxColour(0x46, 0xE0, 0xC8)); // teal, reads on dark bed - wxFont f = m_hud_label->GetFont(); f.MakeBold(); m_hud_label->SetFont(f); - auto* hs = new wxBoxSizer(wxHORIZONTAL); - hs->Add(m_hud_label, 0, wxALL, 6); - m_hud->SetSizerAndFit(hs); - m_hud->Hide(); - } - m_sketch_tool.on_readout = [this](const std::string& s) { set_readout(s); }; - - // Bottom-LEFT twin, carrying the status line. Top-level for the same reason as the readout - // (a child widget is hidden by the GL surface) but a wxPopupWindow rather than a wxFrame, - // because a popup cannot take keyboard focus. The readout gets away with a frame only - // because it appears mid-gesture and the next input is the mouse; this one is up - // permanently and is re-raised on every status change. As a frame it took the WM's focus - // each time and the canvas stopped receiving keys at all — every sketch shortcut silently - // dead, which reads as a broken tool. Do not "simplify" it back to a wxFrame. - // Its colour is set per message — the panel decides whether a line is neutral or an error. - { - wxWindow* top = wxGetTopLevelParent(m_canvas_widget); - m_status_hud = new wxPopupWindow(top, wxBORDER_NONE); - m_status_hud->SetBackgroundColour(wxColour(28, 30, 34)); - m_status_hud_label = new wxStaticText(m_status_hud, wxID_ANY, wxEmptyString); - auto* ss = new wxBoxSizer(wxHORIZONTAL); - // The line never wraps — there is a whole window's width down here — so the chip is - // ONE LINE tall. Spacers rather than a wxALL border because the two axes want - // different numbers: roomy at the sides so it reads as a label, and just enough top - // and bottom to clear the descenders. Zero vertical clips the glyphs; 6 (what the - // readout chip uses) makes it look like a two-line box. - ss->AddSpacer(10); - ss->Add(m_status_hud_label, 0, wxTOP | wxBOTTOM, 3); - ss->AddSpacer(10); - m_status_hud->SetSizerAndFit(ss); - m_status_hud->Hide(); - } - // A floating frame does not follow its parent, so the anchor has to be recomputed whenever - // the canvas changes size (that bind is below bind_event_handlers(), for the reason given - // there). The readout HUD gets away without this because it is transient; the status line is - // on screen almost permanently and would visibly detach. - // ...and it does not follow the WINDOW either. A popup is override-redirect: the window - // manager does not own it, so minimising the app leaves the chip sitting on the bare desktop - // (seen on the rig: whole screen black, chip still there), and it stacks above other - // applications rather than behind them. IsShownOnScreen does not catch this — an iconised - // frame still counts as shown — so the frame has to say so itself. Deactivating the app is - // the same case one step weaker: the chip belongs to a viewport the user is no longer - // looking at. Showing it back is safe because a popup cannot take focus, so neither event - // can be re-triggered by our own Show(). - // Members rather than lambdas so unbind_canvas_event_handlers() can Unbind them: these sit on - // a frame that OUTLIVES this canvas, and a lambda cannot be unbound. - if (wxWindow* top = wxGetTopLevelParent(m_canvas_widget)) { - top->Bind(wxEVT_ICONIZE, &DesignCanvas::on_frame_iconize, this); - top->Bind(wxEVT_ACTIVATE, &DesignCanvas::on_frame_activate, this); - // The anchor is an ABSOLUTE SCREEN position (ClientToScreen below), so moving the window - // moves the canvas out from under a chip that stays where it was. Dragging the frame by - // its title bar left the chip stranded mid-viewport until the next size, status or tab - // change happened to re-place it. Nothing on the canvas fires for a move that does not - // also resize, so it has to come from the frame. - top->Bind(wxEVT_MOVE, &DesignCanvas::on_status_hud_reanchor, this); - } + // The two viewport chips — the active tool's values bottom-right, the status line bottom-left + // — are drawn by the canvas itself, in the tool's ImGui pass: they go away with the canvas, + // the tab and the window, and never take the keyboard. + m_sketch_tool.on_readout = [this](const std::string& s) { set_readout(s); }; + m_sketch_tool.render_overlays = [this] { render_hud(); }; refresh_bed(); @@ -236,16 +166,10 @@ DesignCanvas::DesignCanvas(wxWindow* parent) // reverse order of binding, and GLCanvas3D swallows several events without skipping them — // wxEVT_RIGHT_UP and wxEVT_ENTER_WINDOW in on_mouse, and wxEVT_SIZE in on_size, which is // just `m_dirty = true;`. For those, whatever is bound LAST is the only handler that runs. - // The context menu, the focus-follows-mouse and the status-chip re-anchor all depend on - // running first, which is only true while this call stays ahead of them. + // The context menu and the focus-follows-mouse depend on running first, which is only true + // while this call stays ahead of them. m_canvas->bind_event_handlers(); - // The status-chip re-anchor promised above, bound AFTER the call so it runs first — ahead of - // it the handler never ran at all, leaving a stale anchor and wrap width after any resize - // that did not also move the frame or change the text. Its e.Skip() is load-bearing the - // other way: it falls through to on_size, which is what still marks the canvas dirty. - m_canvas_widget->Bind(wxEVT_SIZE, &DesignCanvas::on_status_hud_reanchor, this); - // The Design GL canvas only receives key events (Esc to exit/enter Select, Ctrl+Z undo) // while it holds keyboard focus. Clicking a side-panel button steals focus, after which // Esc/Ctrl+Z silently do nothing until the viewport is clicked again. Restore focus @@ -268,18 +192,6 @@ DesignCanvas::DesignCanvas(wxWindow* parent) // Both are idempotent, and neither destroys anything: the destructor still owns that. void DesignCanvas::unbind_canvas_event_handlers() { - if (wxWindow* top = wxGetTopLevelParent(m_canvas_widget)) { - top->Unbind(wxEVT_ICONIZE, &DesignCanvas::on_frame_iconize, this); - top->Unbind(wxEVT_ACTIVATE, &DesignCanvas::on_frame_activate, this); - top->Unbind(wxEVT_MOVE, &DesignCanvas::on_status_hud_reanchor, this); - } - // Before the popups go down, or a resize still in flight re-places and re-shows the chip. - if (m_canvas_widget) - m_canvas_widget->Unbind(wxEVT_SIZE, &DesignCanvas::on_status_hud_reanchor, this); - // A popup is override-redirect: it does not go down with the frame, so one left showing sits - // on the bare desktop for however long the teardown takes. - show_status_hud(false); - if (m_hud) m_hud->Hide(); if (m_canvas) m_canvas->unbind_event_handlers(); } @@ -290,7 +202,6 @@ void DesignCanvas::reset_canvas_volumes() DesignCanvas::~DesignCanvas() { - if (m_hud) m_hud->Destroy(); delete m_canvas; delete m_canvas_widget; } @@ -346,14 +257,22 @@ void DesignCanvas::request_repaint() } } +// ImGui's display size is shared by every canvas and only refreshed when a canvas sees its own +// size change, so the canvas taking over must re-announce its size (Plater does the same between +// Prepare and Preview). Otherwise the overlays anchored to it, the FPS counter first, are laid +// out for the other canvas. void DesignCanvas::enter_viewport() { if (!m_camera_swapped) swap_camera(); + if (m_canvas) { m_canvas->reset_old_size(); m_canvas->set_as_dirty(); } } void DesignCanvas::leave_viewport() { if (m_camera_swapped) swap_camera(); + if (Plater* plater = wxGetApp().plater()) + if (GLCanvas3D* editor = plater->get_current_canvas3D()) + editor->reset_old_size(); } void DesignCanvas::swap_camera() @@ -1188,124 +1107,59 @@ double DesignCanvas::model_mid_z() const void DesignCanvas::set_readout(const std::string& text) { - if (!m_hud || !m_hud_label || !m_canvas_widget) return; - if (text == m_hud_last) return; // only touch the WM on a real change + if (text == m_hud_last) return; m_hud_last = text; - if (text.empty()) { m_hud->Hide(); return; } - m_hud_label->SetLabel(wxString::FromUTF8(text)); - place_readout_hud(); -} - -void DesignCanvas::place_readout_hud() -{ - if (!m_hud || !m_hud_label || !m_canvas_widget) return; - if (m_hud_last.empty() || !m_canvas_widget->IsShownOnScreen()) { m_hud->Hide(); return; } - m_hud->Fit(); - // Anchor to the canvas's bottom-right corner with a small margin (screen coords). - const wxSize cs = m_canvas_widget->GetClientSize(); - const wxSize hs = m_hud->GetSize(); - const wxPoint br = m_canvas_widget->ClientToScreen( - wxPoint(cs.GetWidth() - hs.GetWidth() - 12, cs.GetHeight() - hs.GetHeight() - 12)); - if (!m_hud->IsShown()) m_hud->Show(); // Show before Move (GTK ignores pre-map Move) - m_hud->Move(br); - m_hud->Raise(); -} - -// A popup is override-redirect: the window manager does not own it, so an iconised or -// deactivated app would leave the chip sitting on the bare desktop. The status chip already -// had to answer this; now that the readout is a popup too, it answers it the same way. -void DesignCanvas::show_readout_hud(bool on) -{ - if (!m_hud) return; - if (on) place_readout_hud(); - else m_hud->Hide(); + if (m_canvas) m_canvas->set_as_dirty(); // drawn by the next frame (the tool feeds this from one) } // Clear of the view cube and the two round view buttons, which own the bottom-left corner. -// Shared by the placement and by the wrap width, which have to agree or the chip wraps to a -// width it is then not given. -static constexpr int kStatusHudLeftInsetDip = 190; +static constexpr float kStatusHudLeftInset = 190.f; void DesignCanvas::set_status_text(const wxString& text, const wxColour& colour) { - if (!m_status_hud || !m_status_hud_label || !m_canvas_widget) return; if (text == m_status_hud_last && colour == m_status_hud_colour) return; m_status_hud_last = text; m_status_hud_colour = colour; - if (text.IsEmpty()) { m_status_hud->Hide(); return; } - m_status_hud_label->SetForegroundColour(colour); - apply_status_label(); - place_status_hud(); + request_repaint(); } -// SetLabel + Wrap + Fit, in that order and always together. Moving the status out of the panel -// removed the clipping of 8cc but not the underlying problem: the chip is a top-level -// popup that Fit()s to its text, so a long sentence simply grew past the right edge of the canvas -// and hung over the window. Wrapping to the room actually available is what makes the earlier -// promise — "a sentence can be a sentence" — true at every window width, including the charter's -// 1366 reach. Wrap() rewrites the label it is given, so it must follow a fresh SetLabel every -// time; that is the whole reason this is one function instead of three call sites. -void DesignCanvas::apply_status_label() +void DesignCanvas::render_hud() { - if (!m_status_hud || !m_status_hud_label || !m_canvas_widget) return; - m_status_hud_label->SetLabel(m_status_hud_last); - const int avail = m_canvas_widget->GetClientSize().GetWidth() - - m_canvas_widget->FromDIP(kStatusHudLeftInsetDip) - - m_canvas_widget->FromDIP(24); - if (avail > m_canvas_widget->FromDIP(120)) // a uselessly narrow canvas: leave it unwrapped - m_status_hud_label->Wrap(avail); - m_status_hud->Fit(); -} - -void DesignCanvas::place_status_hud() -{ - if (!m_status_hud || !m_canvas_widget || m_status_hud_last.IsEmpty()) return; - // The canvas has a client size even while its page is hidden, and it is not the size the - // page will have when shown — anchoring against it put the chip up on the tab bar, where it - // then stayed until the next status change moved it. Nothing to anchor to: stay down. - if (!m_canvas_widget->IsShownOnScreen()) { m_status_hud->Hide(); return; } - const wxSize cs = m_canvas_widget->GetClientSize(); - // Re-wrap first: this also runs on resize, and a chip wrapped for the old width either - // overhangs a narrowed canvas or wastes a widened one. - apply_status_label(); - const wxSize hs = m_status_hud->GetSize(); - const int kLeftInset = m_canvas_widget->FromDIP(kStatusHudLeftInsetDip); - const wxPoint bl = m_canvas_widget->ClientToScreen( - wxPoint(kLeftInset, cs.GetHeight() - hs.GetHeight() - 12)); - // No Raise() and no focus juggling: a popup neither takes focus nor falls behind. This was - // caught with ORCA_CAD_KEYTRACE — shift+S logged a line, the following R logged nothing, and - // the only thing between them was the first status update showing this window. - if (!m_status_hud->IsShown()) m_status_hud->Show(); // Show before Move (GTK ignores pre-map Move) - m_status_hud->Move(bl); -} - -void DesignCanvas::on_frame_iconize(wxIconizeEvent& e) -{ - show_status_hud(!e.IsIconized()); - show_readout_hud(!e.IsIconized()); - e.Skip(); -} - -void DesignCanvas::on_frame_activate(wxActivateEvent& e) -{ - show_status_hud(e.GetActive()); - show_readout_hud(e.GetActive()); - e.Skip(); -} - -// wxEvent& so one handler serves both events that invalidate the anchor: the frame moving out -// from under the chip, and the canvas resizing under it. -void DesignCanvas::on_status_hud_reanchor(wxEvent& e) -{ - place_status_hud(); - e.Skip(); -} - -void DesignCanvas::show_status_hud(bool on) -{ - if (!m_status_hud) return; - if (on) place_status_hud(); // re-anchors first: the page may have been resized while away - else m_status_hud->Hide(); + if (m_hud_last.empty() && m_status_hud_last.IsEmpty()) return; + ImGuiWrapper& imgui = *wxGetApp().imgui(); + const ImVec2 ds = ImGui::GetIO().DisplaySize; + const float em = imgui.get_style_scaling(); // follows the font, so the DPI + const float margin = 12.f * em; + const int flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | + ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoSavedSettings | + ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav; + auto chip = [&](const char* id, const std::string& text, float x, float pivot_x, float wrap, + const ImVec4* colour) { + ImGuiWrapper::push_common_window_style(m_canvas->get_scale()); + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8.f * em, 4.f * em)); + imgui.set_next_window_pos(x, ds.y - margin, ImGuiCond_Always, pivot_x, 1.f); + imgui.begin(std::string(id), flags); + if (wrap > 0.f) ImGui::PushTextWrapPos(wrap); + if (colour) ImGui::PushStyleColor(ImGuiCol_Text, *colour); + ImGui::TextUnformatted(text.c_str()); + if (colour) ImGui::PopStyleColor(); + if (wrap > 0.f) ImGui::PopTextWrapPos(); + imgui.end(); + ImGui::PopStyleVar(); + ImGuiWrapper::pop_common_window_style(); + }; + if (!m_status_hud_last.IsEmpty()) { + // A sentence can be a sentence: it wraps to the room left of the readout chip. + const float left = kStatusHudLeftInset * em; + const ImVec4 col = m_status_hud_colour.IsOk() + ? ImVec4(m_status_hud_colour.Red() / 255.f, m_status_hud_colour.Green() / 255.f, + m_status_hud_colour.Blue() / 255.f, 1.f) + : ImVec4(); + chip("##design_status", m_status_hud_last.ToUTF8().data(), left, 0.f, + std::max(ds.x * 0.6f - left, 120.f * em), m_status_hud_colour.IsOk() ? &col : nullptr); + } + if (!m_hud_last.empty()) + chip("##design_readout", m_hud_last, ds.x - margin, 1.f, 0.f, &ImGuiWrapper::COL_ORCA); } void DesignCanvas::set_body_highlight(bool on) diff --git a/src/slic3r/GUI/CAD/DesignCanvas.hpp b/src/slic3r/GUI/CAD/DesignCanvas.hpp index 50b2cab46c..3f4c53c54a 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.hpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.hpp @@ -2,7 +2,6 @@ #define slic3r_DesignCanvas_hpp_ #include -#include #include #include @@ -227,10 +226,6 @@ public: // the panel clips it at ~73 characters with no warning (8cc), the viewport's // bottom margin has the whole window width to spare. Empty text hides it. void set_status_text(const wxString& text, const wxColour& colour); - // Take the status line down / bring it back when the Design page leaves and re-enters view. - // A popup is a TOP-LEVEL window: hiding the page it belongs to does not hide it. Keeps the - // text, so coming back needs no re-selection. - void show_status_hud(bool on); void set_operand_bodies(int target_body, int tool_body); // -1,-1 clears void set_body_translucent(bool on); // render the solid see-through (fillet/chamfer preview) void set_xray_focus(int body); // >=0: fade+lock out every other body (CoordSys picking) @@ -398,36 +393,15 @@ private: bool m_section_on{false}; std::unique_ptr m_inline_editor; // floating in-canvas value editor - // Bottom-right viewport HUD: a borderless float label over the GL canvas showing the - // active tool's current values (fed by the tool's on_readout). Empty text hides it. - // A wxPopupWindow for the SAME reason as the status chip below, and it was a wxFrame until - // the reason was measured rather than assumed: "it appears mid-gesture and the next input is - // the mouse" is false. The chip keeps the last value on screen AFTER the gesture ends, and a - // frame holds the X input focus once it has it — so the next keystroke went to a 119x31 - // window that has no use for it. Measured on :10: focus on the chip, `r` produced no - // CHAR_HOOK line at all; one bare canvas click moved focus back and the same key armed the - // tool. That is every sketch shortcut dead after every dimensioned entity. - wxPopupWindow* m_hud{nullptr}; - wxStaticText* m_hud_label{nullptr}; + // The viewport chips, drawn in the tool's ImGui pass (render_hud): bottom-right the active + // tool's current values (fed by the tool's on_readout), bottom-left the status line written by + // DesignPanel. Empty text draws nothing. They were top-level popups once; a popup does not + // follow its frame, so it floated over other applications and outlived the tab. std::string m_hud_last; - void set_readout(const std::string& text); - void place_readout_hud(); // anchor + show, using m_hud_last - void show_readout_hud(bool on); // iconise/deactivate: a popup would float on the desktop - - // Bottom-LEFT viewport HUD: the selection / tool status line, written by DesignPanel. - // A wxPopupWindow, NOT the wxFrame the readout HUD uses: a frame accepts keyboard focus, - // and this one is on screen permanently and re-raised on every status change, so it stole - // the keyboard from the canvas and killed every sketch shortcut in the tab. - wxPopupWindow* m_status_hud{nullptr}; - wxStaticText* m_status_hud_label{nullptr}; wxString m_status_hud_last; - wxColour m_status_hud_colour; - void place_status_hud(); // re-anchors to the canvas corner (also on resize) - void apply_status_label(); // SetLabel + Wrap to the canvas width + Fit, always together - // On the top-level frame, which outlives this canvas — members so they can be unbound. - void on_frame_iconize(wxIconizeEvent& e); - void on_frame_activate(wxActivateEvent& e); - void on_status_hud_reanchor(wxEvent& e); // frame wxEVT_MOVE and canvas wxEVT_SIZE + wxColour m_status_hud_colour; // wxNullColour: the overlay's own text colour + void set_readout(const std::string& text); + void render_hud(); std::function m_on_sketch_commit; std::function&, const std::vector&, diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 77cd696c5c..cbe5d7b3a5 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -11,6 +11,7 @@ #include #include #include // the offer/atlas join check reports on the log +#include #include #include @@ -37,7 +38,6 @@ #include #include #include // wxWindowDisabler, wxMilliSleep -#include // wxMessageBox #include #include @@ -53,6 +53,9 @@ #include "slic3r/GUI/Widgets/Button.hpp" // Orca-styled Button (ButtonStyle/ButtonType) — same look as Prepare #include "slic3r/GUI/Widgets/CheckBox.hpp" // Orca teal check (label lives in the row's left column) #include "slic3r/GUI/Widgets/ComboBox.hpp" // Orca dropdown — replaces wxChoice in every Design card +#include "slic3r/GUI/Widgets/TextInput.hpp" +#include "slic3r/GUI/Widgets/DialogButtons.hpp" +#include "slic3r/GUI/MsgDialog.hpp" #include "slic3r/GUI/Widgets/StaticBox.hpp" // Prepare's rounded white card frame around each tool dialog #include "libslic3r/CAD/SketchImport.hpp" // text_to_regions / svg_to_regions #include "libslic3r/CAD/ThreadStandards.hpp" // ISO metric / Unified imperial thread tables @@ -149,21 +152,42 @@ static bool en_parse(const wxString& text, double& out) return t.ToCDouble(&out); } -// Design-tab chrome tokens. The dark branch returns the EXACT legacy values so the -// (correct) dark theme stays byte-identical; the light branch maps each onto Orca's -// light surface so the ribbon/sidebar follow the app theme instead of staying black. +// Design-tab chrome tokens, one {light, dark} pair each. Controls are coloured from these at +// construction; on a theme switch on_sys_color_changed() walks the panel and moves every colour +// that is one theme's token onto the other theme's, so the tab follows the app theme live. +struct DpToken { wxColour light, dark; }; +enum DpTok { TokRibbonBg, TokRibbonHover, TokPanelBg, TokSecText, TokCtlText, TokItemText, TokItemDim, + TokBorder, TokCount }; +static const DpToken kDpTokens[TokCount] = { + { wxColour(0xEC,0xEC,0xEE), wxColour(0x36,0x36,0x3C) }, // ribbon + { wxColour(0xD7,0xD7,0xDB), wxColour(0x4D,0x4D,0x54) }, // ribbon hover + { wxColour(0xFB,0xFB,0xFD), wxColour(0x2D,0x2D,0x30) }, // sidebar / lists + { wxColour(0x66,0x66,0x68), wxColour(0x81,0x81,0x83) }, // secondary text + { wxColour(0x35,0x35,0x37), wxColour(0xC8,0xC8,0xC8) }, // control text + { wxColour(0x2C,0x2C,0x2E), wxColour(0xE0,0xE0,0xE0) }, // list item text + { wxColour(0xA0,0xA0,0xA2), wxColour(0x80,0x80,0x80) }, // dimmed list item + // Prepare's control-outline grey, sampled from its sidebar: #DBDBDB on light, #4A4A51 on the + // #2D2D31 dark panel. Every framed thing in Design uses this so the tab matches. + { wxColour(0xDB,0xDB,0xDB), wxColour(0x4A,0x4A,0x51) }, +}; static bool dp_dark() { return wxGetApp().dark_mode(); } -static wxColour dp_ribbon_bg() { return dp_dark() ? wxColour(0x36,0x36,0x3C) : wxColour(0xEC,0xEC,0xEE); } -static wxColour dp_ribbon_hover() { return dp_dark() ? wxColour(0x4D,0x4D,0x54) : wxColour(0xD7,0xD7,0xDB); } -static wxColour dp_panel_bg() { return dp_dark() ? wxColour(0x2D,0x2D,0x30) : wxColour(0xFB,0xFB,0xFD); } -static wxColour dp_sec_text() { return dp_dark() ? wxColour(0x81,0x81,0x83) : wxColour(0x66,0x66,0x68); } -static wxColour dp_ctl_text() { return dp_dark() ? wxColour(0xC8,0xC8,0xC8) : wxColour(0x35,0x35,0x37); } -static wxColour dp_item_text() { return dp_dark() ? wxColour(0xE0,0xE0,0xE0) : wxColour(0x2C,0x2C,0x2E); } -static wxColour dp_item_dim() { return dp_dark() ? wxColour(0x80,0x80,0x80) : wxColour(0xA0,0xA0,0xA2); } +static wxColour dp_tok(DpTok t) { return dp_dark() ? kDpTokens[t].dark : kDpTokens[t].light; } +static wxColour dp_ribbon_bg() { return dp_tok(TokRibbonBg); } +static wxColour dp_ribbon_hover() { return dp_tok(TokRibbonHover); } +static wxColour dp_panel_bg() { return dp_tok(TokPanelBg); } +static wxColour dp_sec_text() { return dp_tok(TokSecText); } +static wxColour dp_ctl_text() { return dp_tok(TokCtlText); } +static wxColour dp_item_text() { return dp_tok(TokItemText); } +static wxColour dp_item_dim() { return dp_tok(TokItemDim); } -// Prepare's control-outline grey, sampled from its sidebar: #4A4A51 on the #2D2D31 dark -// panel, #DBDBDB on light. Every framed thing in Design uses this so the tab matches. -static wxColour dp_border_col() { return dp_dark() ? wxColour(0x4A,0x4A,0x51) : wxColour(0xDB,0xDB,0xDB); } +// The other theme's value of a token colour, or `c` itself when it is no token. +static wxColour dp_retheme(const wxColour& c, bool to_dark) +{ + for (const DpToken& t : kDpTokens) + if (c == (to_dark ? t.light : t.dark)) + return to_dark ? t.dark : t.light; + return c; +} // A tool card: Prepare's rounded white-bordered panel (Plater.cpp's panel_printer_preset // idiom — radius 8, #EEEEEE border, green on hover). Every card's controls are parented @@ -172,7 +196,9 @@ static StaticBox* make_card(wxWindow* parent) { auto* c = new StaticBox(parent); c->SetCornerRadius(8); - c->SetBorderColorNormal(dp_border_col()); // no hover accent: the frame is not clickable + // The light literal in a StateColor is mapped to the dark one at paint time, so the frame + // follows a theme switch by itself. No hover accent: the frame is not clickable. + c->SetBorderColor(StateColor(kDpTokens[TokBorder].light)); return c; } @@ -186,8 +212,8 @@ static wxSpinCtrlDouble* make_spin(wxWindow* parent, double val, { auto* box = new StaticBox(parent); box->SetCornerRadius(4); - box->SetBorderColorNormal(dp_border_col()); - auto* s = new wxSpinCtrlDouble(box, wxID_ANY, "", wxDefaultPosition, wxSize(90, -1), + box->SetBorderColor(StateColor(kDpTokens[TokBorder].light)); + auto* s = new wxSpinCtrlDouble(box, wxID_ANY, "", wxDefaultPosition, parent->FromDIP(wxSize(90, -1)), wxSP_ARROW_KEYS | wxBORDER_NONE); s->SetRange(mn, mx); s->SetDigits(2); @@ -280,17 +306,23 @@ static SketchPlane face_plane_inward(const TopoDS_Face& face) DesignPanel::DesignPanel(wxWindow* parent) : wxPanel(parent, wxID_ANY) { + // The tab is built on its first show; where that time goes is logged, per phase, because it + // varies by an order of magnitude between machines. + wxStopWatch build_clock; + long build_mark = 0; + auto build_phase = [&build_clock, &build_mark](const char* phase) { + const long now = build_clock.Time(); + BOOST_LOG_TRIVIAL(info) << "Design tab build: " << phase << " " << now - build_mark << " ms"; + build_mark = now; + }; // Left column: a slim feature-tree + docked tool-dialog column. All form // controls are parented to m_form so it can scroll independently of the // live GL viewport. The tool buttons live in the top toolbar (built below). m_form = new wxScrolledWindow(this, wxID_ANY); - // The sidebar/panel never carried an explicit background, so in light theme it - // inherited the dark window colour and stayed black. Paint it on the light surface; - // dark is left untouched (it already reads correctly via inheritance). - if (!dp_dark()) { - SetBackgroundColour(dp_panel_bg()); - m_form->SetBackgroundColour(dp_panel_bg()); - } + // Explicit token background in both themes, so a theme switch can move it (an inherited + // colour stays whatever the theme was when the panel was built). + SetBackgroundColour(dp_panel_bg()); + m_form->SetBackgroundColour(dp_panel_bg()); auto* root = new wxBoxSizer(wxVERTICAL); { @@ -313,22 +345,20 @@ DesignPanel::DesignPanel(wxWindow* parent) // #4D4D54); light maps onto the app's light chrome so the strip follows the theme. m_toolbar->SetBackgroundColour(dp_ribbon_bg()); - const wxColour tb_bg = dp_ribbon_bg(); - const wxColour tb_hover = dp_ribbon_hover(); - auto icon_btn = [this, tb_bg, tb_hover](const char* icon, const wxString& tip) { + auto icon_btn = [this](const char* icon, const wxString& tip) { // Prepare's main toolbar: 40 px icon cell, 4 px gap (GLToolbar::Default_Icons_Size // and set_gap_size(4)) -> 44 px pitch. Match it exactly. - auto* b = new ScalableButton(m_toolbar, wxID_ANY, icon, "", wxSize(40, 40), + auto* b = new ScalableButton(m_toolbar, wxID_ANY, icon, "", FromDIP(wxSize(40, 40)), wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 34); b->SetToolTip(tip); - b->SetBackgroundColour(tb_bg); + b->SetBackgroundColour(dp_ribbon_bg()); m_tool_btns.push_back(b); // Hover affordance, honouring the active-tool teal state. - b->Bind(wxEVT_ENTER_WINDOW, [this, b, tb_hover](wxMouseEvent& e) { - b->SetBackgroundColour(b == m_active_tool_btn ? wxColour(0x52, 0xC7, 0xB8) : tb_hover); + b->Bind(wxEVT_ENTER_WINDOW, [this, b](wxMouseEvent& e) { + b->SetBackgroundColour(b == m_active_tool_btn ? wxColour(0x52, 0xC7, 0xB8) : dp_ribbon_hover()); b->Refresh(); e.Skip(); }); - b->Bind(wxEVT_LEAVE_WINDOW, [this, b, tb_bg](wxMouseEvent& e) { - b->SetBackgroundColour(b == m_active_tool_btn ? wxColour(0x00, 0x96, 0x88) : tb_bg); + b->Bind(wxEVT_LEAVE_WINDOW, [this, b](wxMouseEvent& e) { + b->SetBackgroundColour(b == m_active_tool_btn ? wxColour(0x00, 0x96, 0x88) : dp_ribbon_bg()); b->Refresh(); e.Skip(); }); // Mark this tool active (teal) on press — a separate event from the // button's command handler, so it never swallows the click action. @@ -346,7 +376,7 @@ DesignPanel::DesignPanel(wxWindow* parent) }; auto add_sep = [this](wxSizer* row) { row->AddSpacer(5); - row->Add(new wxStaticLine(m_toolbar, wxID_ANY, wxDefaultPosition, wxSize(1, 22), wxLI_VERTICAL), + row->Add(new wxStaticLine(m_toolbar, wxID_ANY, wxDefaultPosition, FromDIP(wxSize(1, 22)), wxLI_VERTICAL), 0, wxALIGN_CENTER_VERTICAL); row->AddSpacer(5); }; @@ -497,24 +527,8 @@ DesignPanel::DesignPanel(wxWindow* parent) set_status(show ? _L("Bed shown") : _L("Bed hidden")); }; - // Shared flyout glyph tint (used by BOTH the feature and sketch toolbars). Re-tint each - // design_* glyph to the DropDown's resolved TEXT colour so it reads on the popup in either - // theme: text_color is 0x363636, which darkModeColorFor() maps to a light tone in dark mode - // (the popup bg is darkModeColorFor(white) = dark) and leaves dark in light mode. The alpha - // (the glyph shape) is preserved; only RGB is replaced. - // ponytail: wxBitmap(img) drops the HiDPI scale factor (no scale ctor before wx 3.1.6); the - // deploy target runs at scale 1.0, so this is exact there. - const wxColour drop_icon_col = StateColor::darkModeColorFor(wxColour(0x36, 0x36, 0x36)); - auto tint = [](wxBitmap bmp, const wxColour& c) -> wxBitmap { - if (!bmp.IsOk()) return bmp; - wxImage img = bmp.ConvertToImage(); - if (!img.HasAlpha()) img.InitAlpha(); - const int w = img.GetWidth(), h = img.GetHeight(); - for (int y = 0; y < h; ++y) - for (int x = 0; x < w; ++x) - img.SetRGB(x, y, c.Red(), c.Green(), c.Blue()); - return wxBitmap(img); - }; + // Flyout rows show the design_* glyphs as they are: drawn in Orca's icon grey (#949494), which + // the icon cache maps per theme like every other sidebar icon, so they need no re-tint. // --- Feature group: Sketch / Extrude / Fillet-Chamfer / Hole / Thread / Constrain m_tb_feature = new wxBoxSizer(wxHORIZONTAL); @@ -572,13 +586,18 @@ DesignPanel::DesignPanel(wxWindow* parent) DropDown::Item it; it.text = v.tip; it.tip = v.hint; - it.icon = tint(create_scaled_bitmap(v.icon, m_form, 18), drop_icon_col); + it.icon = create_scaled_bitmap(v.icon, m_form, 18); fo->items.push_back(it); fo->actions.push_back(std::move(v.action)); fo->icon_names.emplace_back(v.icon); } fo->btn = b; fo->drop.Create(b); + m_icon_refresh.push_back([this, fp = fo.get()] { + for (size_t i = 0; i < fp->items.size(); ++i) + fp->items[i].icon = create_scaled_bitmap(fp->icon_names[i], m_form, 18); + fp->drop.Invalidate(true); + }); fo->drop.SetUseContentWidth(true, false); fo->drop.Invalidate(true); FeatFlyout* fp = fo.get(); @@ -597,7 +616,7 @@ DesignPanel::DesignPanel(wxWindow* parent) fp->drop.SetUseContentWidth(false, false); fp->drop.SetUseContentWidth(true, false); wxPoint pos = b->ClientToScreen(wxPoint(0, -6)); - fp->drop.Position(pos, wxSize(0, b->GetSize().y + 12)); + fp->drop.Position(pos, wxSize(0, b->GetSize().y + b->FromDIP(12))); fp->drop.Popup(); }); m_flyout_keepalive.push_back(fo); @@ -1224,7 +1243,7 @@ DesignPanel::DesignPanel(wxWindow* parent) DropDown::Item it; it.text = v.tip; it.tip = v.hint; - it.icon = tint(create_scaled_bitmap(v.icon, m_form, 18), drop_icon_col); + it.icon = create_scaled_bitmap(v.icon, m_form, 18); fo->items.push_back(it); fo->modes.push_back(v.mode); fo->hints.push_back(v.hint); @@ -1232,6 +1251,11 @@ DesignPanel::DesignPanel(wxWindow* parent) } fo->btn = b; fo->drop.Create(b); + m_icon_refresh.push_back([this, fp = fo.get()] { + for (size_t i = 0; i < fp->items.size(); ++i) + fp->items[i].icon = create_scaled_bitmap(fp->icon_names[i], m_form, 18); + fp->drop.Invalidate(true); + }); fo->drop.SetUseContentWidth(true, false); fo->drop.Invalidate(true); ToolFlyout* fp = fo.get(); @@ -1253,7 +1277,7 @@ DesignPanel::DesignPanel(wxWindow* parent) fp->drop.SetUseContentWidth(false, false); fp->drop.SetUseContentWidth(true, false); wxPoint pos = b->ClientToScreen(wxPoint(0, -6)); - fp->drop.Position(pos, wxSize(0, b->GetSize().y + 12)); + fp->drop.Position(pos, wxSize(0, b->GetSize().y + b->FromDIP(12))); fp->drop.Popup(); }); m_flyout_keepalive.push_back(fo); @@ -1496,67 +1520,37 @@ DesignPanel::DesignPanel(wxWindow* parent) // active (update_action_bar). Replaces the 13 per-card buttons + sketch Finish + Done. m_tb_action = new wxBoxSizer(wxHORIZONTAL); { - auto* ok = new wxButton(m_toolbar, wxID_ANY, _L("✓ Confirm")); - ok->SetForegroundColour(*wxWHITE); - ok->SetBackgroundColour(wxColour(0x00, 0x96, 0x88)); // Orca teal accent + auto* ok = new ::Button(m_toolbar, _L("Confirm")); + ok->SetStyle(ButtonStyle::Confirm, ButtonType::Window); ok->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { tool_confirm(); }); m_confirm_btns.push_back(ok); // refresh_preview greys this on an invalid candidate - auto* no = new wxButton(m_toolbar, wxID_ANY, _L("✗ Cancel")); + auto* no = new ::Button(m_toolbar, _L("Cancel")); + no->SetStyle(ButtonStyle::Regular, ButtonType::Window); no->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { tool_cancel(); }); m_tb_action->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 6); m_tb_action->Add(no, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10); } - // Persistent Undo/Redo group: always visible (not mode-gated like the tool groups), so - // history is reachable from Feature, Sketch and Constrain alike. These are momentary - // actions, so — unlike icon_btn — they are NOT registered in m_tool_btns and never take - // the teal active-tool highlight. They route to the SAME do_undo_redo as the keyboard - // Ctrl+Z / Ctrl+Shift+Z path, and are greyed by update_undo_redo_buttons(). - m_tb_history = new wxBoxSizer(wxHORIZONTAL); - { - auto hist_btn = [this, tb_bg, tb_hover](const char* icon, const wxString& tip) { - auto* b = new ScalableButton(m_toolbar, wxID_ANY, icon, "", wxSize(40, 40), - wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 34); - b->SetToolTip(tip); - b->SetBackgroundColour(tb_bg); - b->Bind(wxEVT_ENTER_WINDOW, [b, tb_hover](wxMouseEvent& e) { - if (b->IsEnabled()) { b->SetBackgroundColour(tb_hover); b->Refresh(); } e.Skip(); }); - b->Bind(wxEVT_LEAVE_WINDOW, [b, tb_bg](wxMouseEvent& e) { - b->SetBackgroundColour(tb_bg); b->Refresh(); e.Skip(); }); - return b; - }; - m_btn_undo = hist_btn("menu_undo", _L("Undo (Ctrl+Z)")); - m_btn_undo->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { do_undo_redo(false); }); - m_btn_redo = hist_btn("menu_redo", _L("Redo (Ctrl+Shift+Z)")); - m_btn_redo->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { do_undo_redo(true); }); - m_btn_undo->Enable(false); // nothing to undo/redo on a fresh document - m_btn_redo->Enable(false); - m_tb_history->Add(m_btn_undo, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 4); - m_tb_history->Add(m_btn_redo, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 4); - } - - // Document actions, left of Undo/Redo and always visible (not mode-gated like the tools). - // Same styling as the history pair: momentary actions, never the teal active-tool state. + // Document actions, always visible (not mode-gated like the tools): momentary actions, + // never the teal active-tool state. m_tb_doc = new wxBoxSizer(wxHORIZONTAL); - const wxColour tb_glyph_col = StateColor::darkModeColorFor(wxColour(0x36, 0x36, 0x36)); - const wxColour tb_commit_col(0x00, 0x96, 0x88); // Orca Confirm accent { - // Some Orca glyphs (toolbar_add_plate, toolbar_flatten) are drawn for a light toolbar and - // come out the same tone as this dark one — Commit was effectively invisible. Re-tint - // those: Commit in the teal accent it carries as the tab's primary action, the rest in - // the same grey the other toolbar glyphs resolve to. - auto doc_btn = [this, tb_bg, tb_hover, &tint](const char* icon, const wxString& tip, - const wxColour* glyph = nullptr) { - auto* b = new ScalableButton(m_toolbar, wxID_ANY, icon, "", wxSize(40, 40), + // Some Orca glyphs (toolbar_flatten) are drawn for Prepare's light GL toolbar and come out + // the same tone as a dark ribbon. Those ship a "_dark" twin, picked per theme here (and + // again on a theme switch) the way GLToolbar picks it. + auto doc_btn = [this](const char* icon, const wxString& tip, bool has_dark_twin = false) { + const std::string name(icon); + auto themed = [name, has_dark_twin] { return has_dark_twin && dp_dark() ? name + "_dark" : name; }; + auto* b = new ScalableButton(m_toolbar, wxID_ANY, themed(), "", FromDIP(wxSize(40, 40)), wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 34); - if (glyph != nullptr) - b->SetBitmap(tint(create_scaled_bitmap(icon, m_toolbar, 42), *glyph)); + if (has_dark_twin) + m_icon_refresh.push_back([b, themed] { b->SetBitmap_(themed()); }); b->SetToolTip(tip); - b->SetBackgroundColour(tb_bg); - b->Bind(wxEVT_ENTER_WINDOW, [b, tb_hover](wxMouseEvent& e) { - if (b->IsEnabled()) { b->SetBackgroundColour(tb_hover); b->Refresh(); } e.Skip(); }); - b->Bind(wxEVT_LEAVE_WINDOW, [b, tb_bg](wxMouseEvent& e) { - b->SetBackgroundColour(tb_bg); b->Refresh(); e.Skip(); }); + b->SetBackgroundColour(dp_ribbon_bg()); + b->Bind(wxEVT_ENTER_WINDOW, [b](wxMouseEvent& e) { + if (b->IsEnabled()) { b->SetBackgroundColour(dp_ribbon_hover()); b->Refresh(); } e.Skip(); }); + b->Bind(wxEVT_LEAVE_WINDOW, [b](wxMouseEvent& e) { + b->SetBackgroundColour(dp_ribbon_bg()); b->Refresh(); e.Skip(); }); return b; }; auto add_doc = [this](ScalableButton* b) { @@ -1591,12 +1585,13 @@ DesignPanel::DesignPanel(wxWindow* parent) // These act on bodies / the view, so they ride in the feature group, in the slots // the user assigned them (9, 11bis, 16). auto* b_place = doc_btn("toolbar_flatten", _L("Place on Face (F) — lay the picked face on the bed"), - &tb_glyph_col); + true); b_place->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { place_on_face(); }); tb_slot["place"].push_back(b_place); auto* b_section = doc_btn("split_parts", _L("Section View — hide part of the model to see inside. " - "PageUp/PageDown move the plane; Delete removes it.")); + "PageUp/PageDown move the plane; Delete removes it."), + true); b_section->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { toggle_section_view(); }); tb_slot["section"].push_back(b_section); @@ -1608,7 +1603,7 @@ DesignPanel::DesignPanel(wxWindow* parent) // Commit is the tab's primary action and sits far right, next to Confirm/Cancel. m_tb_commit = new wxBoxSizer(wxHORIZONTAL); auto* b_commit = doc_btn("toolbar_add_plate", _L("Commit to Plate — send the solid to Prepare"), - &tb_commit_col); + true); b_commit->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_commit(); }); m_tb_commit->Add(b_commit, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 4); } @@ -1637,8 +1632,6 @@ DesignPanel::DesignPanel(wxWindow* parent) tbrow->AddSpacer(8); tbrow->Add(m_tb_doc, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, 5); add_sep(tbrow); - tbrow->Add(m_tb_history, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, 5); - add_sep(tbrow); tbrow->Add(m_tb_feature, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, 5); tbrow->Add(m_tb_sketch, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, 5); tbrow->Add(m_tb_relations, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, 5); @@ -1647,15 +1640,18 @@ DesignPanel::DesignPanel(wxWindow* parent) tbrow->Add(m_tb_action, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, 5); tbrow->AddSpacer(8); m_toolbar->SetSizer(tbrow); + build_phase("toolbar"); // Apply the body gates once now: an empty document is exactly the state the bug was reported // in, and feed_bodies() has not run yet on a fresh tab. update_body_gates(); // Onshape-style dialog-card header: feature icon + bold title. out receives // the title control so open_tool() can retitle it per feature. - auto card_header = [](wxWindow* card, const char* icon, const wxString& title, wxStaticText*& out) -> wxSizer* { + auto card_header = [this](wxWindow* card, const char* icon, const wxString& title, wxStaticText*& out) -> wxSizer* { auto* h = new wxBoxSizer(wxHORIZONTAL); auto* ic = new wxStaticBitmap(card, wxID_ANY, create_scaled_bitmap(icon, card, 18)); + m_icon_refresh.push_back([ic, card, name = std::string(icon)] { + ic->SetBitmap(create_scaled_bitmap(name, card, 18)); }); out = new wxStaticText(card, wxID_ANY, title); out->SetFont(Label::Head_14); // Orca shared HarmonyOS card-title font h->Add(ic, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 8); @@ -2191,8 +2187,9 @@ DesignPanel::DesignPanel(wxWindow* parent) plform->Add(m_plane_tilt_axis, 0, wxEXPAND); // Contextual reference picks: arm a target, then click a solid face/edge in the canvas. - auto pick_row = [&](const wxString& label, wxButton*& btn, wxStaticText*& lbl, PlanePick target) { - btn = new wxButton(m_cards, wxID_ANY, label); + auto pick_row = [&](const wxString& label, ::Button*& btn, wxStaticText*& lbl, PlanePick target) { + btn = new ::Button(m_cards, label); + btn->SetStyle(ButtonStyle::Regular, ButtonType::Parameter); lbl = new wxStaticText(m_cards, wxID_ANY, _L("(none)")); btn->Bind(wxEVT_BUTTON, [this, target](wxCommandEvent&) { arm_plane_pick(target); }); plform->Add(btn); @@ -2220,7 +2217,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_box_loft->Add(new wxStaticLine(m_cards), 0, wxEXPAND | wxALL, 8); m_box_loft->Add(new wxStaticText(m_cards, wxID_ANY, _L("Profiles (check 2+, in order):")), 0, wxLEFT | wxRIGHT | wxTOP, 12); - m_loft_list = new wxCheckListBox(m_cards, wxID_ANY, wxDefaultPosition, wxSize(-1, 120)); + m_loft_list = new wxCheckListBox(m_cards, wxID_ANY, wxDefaultPosition, FromDIP(wxSize(-1, 120))); m_loft_list->Bind(wxEVT_CHECKLISTBOX, [this](wxCommandEvent&) { refresh_preview(); }); m_box_loft->Add(m_loft_list, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 12); { @@ -2292,7 +2289,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_box_surf_loft->Add(new wxStaticLine(m_cards), 0, wxEXPAND | wxALL, 8); m_box_surf_loft->Add(new wxStaticText(m_cards, wxID_ANY, _L("Profiles (check 2+, in order):")), 0, wxLEFT | wxRIGHT | wxTOP, 12); - m_surf_loft_list = new wxCheckListBox(m_cards, wxID_ANY, wxDefaultPosition, wxSize(-1, 120)); + m_surf_loft_list = new wxCheckListBox(m_cards, wxID_ANY, wxDefaultPosition, FromDIP(wxSize(-1, 120))); m_surf_loft_list->Bind(wxEVT_CHECKLISTBOX, [this](wxCommandEvent&) { refresh_preview(); }); m_box_surf_loft->Add(m_surf_loft_list, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 12); m_surf_loft_ruled = new CheckBox(m_cards); @@ -2532,7 +2529,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_rib_sketch->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent&) { refresh_preview(); }); rform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Sketch")), 0, wxALIGN_CENTER_VERTICAL); rform->Add(m_rib_sketch, 0, wxEXPAND); - m_rib_entity = new wxSpinCtrl(m_cards, wxID_ANY, "", wxDefaultPosition, wxSize(90, -1), + m_rib_entity = new wxSpinCtrl(m_cards, wxID_ANY, "", wxDefaultPosition, FromDIP(wxSize(90, -1)), wxSP_ARROW_KEYS | wxBORDER_SIMPLE); m_rib_entity->SetRange(0, 999); m_rib_entity->SetValue(0); @@ -2589,7 +2586,8 @@ DesignPanel::DesignPanel(wxWindow* parent) m_del_face_body->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent&) { refresh_preview(); }); dform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Body")), 0, wxALIGN_CENTER_VERTICAL); dform->Add(m_del_face_body, 0, wxEXPAND); - m_del_face_add_btn = new wxButton(m_cards, wxID_ANY, _L("Add picked face")); + m_del_face_add_btn = new ::Button(m_cards, _L("Add picked face")); + m_del_face_add_btn->SetStyle(ButtonStyle::Regular, ButtonType::Parameter); m_del_face_add_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { // Say why nothing happened. Clicking with no face picked used to be a silent no-op, // which is indistinguishable from the button being broken. @@ -2686,8 +2684,9 @@ DesignPanel::DesignPanel(wxWindow* parent) auto* axform = two_col_form(); - auto ax_pick = [&](const wxString& label, wxButton*& btn, wxStaticText*& lbl, AxisPick target) { - btn = new wxButton(m_cards, wxID_ANY, label); + auto ax_pick = [&](const wxString& label, ::Button*& btn, wxStaticText*& lbl, AxisPick target) { + btn = new ::Button(m_cards, label); + btn->SetStyle(ButtonStyle::Regular, ButtonType::Parameter); lbl = new wxStaticText(m_cards, wxID_ANY, _L("(none)")); btn->Bind(wxEVT_BUTTON, [this, target](wxCommandEvent&) { arm_axis_pick(target); }); axform->Add(btn); @@ -2766,8 +2765,9 @@ DesignPanel::DesignPanel(wxWindow* parent) csform->Add(new wxStaticText(m_cards, wxID_ANY, _L("Z")), 0, wxALIGN_CENTER_VERTICAL); csform->Add(spin_frame(m_cs_z), 0, wxEXPAND); - auto cs_pick = [&](const wxString& label, wxButton*& btn, wxStaticText*& lbl, CoordSysPick target) { - btn = new wxButton(m_cards, wxID_ANY, label); + auto cs_pick = [&](const wxString& label, ::Button*& btn, wxStaticText*& lbl, CoordSysPick target) { + btn = new ::Button(m_cards, label); + btn->SetStyle(ButtonStyle::Regular, ButtonType::Parameter); lbl = new wxStaticText(m_cards, wxID_ANY, _L("(none)")); btn->Bind(wxEVT_BUTTON, [this, target](wxCommandEvent&) { arm_coordsys_pick(target); }); csform->Add(btn); @@ -2776,7 +2776,8 @@ DesignPanel::DesignPanel(wxWindow* parent) cs_pick(_L("Pick Face"), m_cs_pick_face, m_cs_face_lbl, CoordSysPick::Face); // ponytail: edge pick for CoordSys with rotation-direction hint - m_cs_pick_edge = new wxButton(m_cards, wxID_ANY, _L("Edge (sets in-plane direction)")); + m_cs_pick_edge = new ::Button(m_cards, _L("Edge (sets in-plane direction)")); + m_cs_pick_edge->SetStyle(ButtonStyle::Regular, ButtonType::Parameter); m_cs_edge_lbl = new wxStaticText(m_cards, wxID_ANY, _L("(none)")); m_cs_pick_edge->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { arm_coordsys_pick(CoordSysPick::Edge); }); csform->Add(m_cs_pick_edge); @@ -2920,8 +2921,10 @@ DesignPanel::DesignPanel(wxWindow* parent) m_box_expr->Add(eform, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 12); auto* brow = new wxBoxSizer(wxHORIZONTAL); - m_expr_set_btn = new wxButton(m_cards, wxID_ANY, _L("Set"), wxDefaultPosition, wxSize(50, 24)); - m_expr_clear_btn = new wxButton(m_cards, wxID_ANY, _L("Clear"), wxDefaultPosition, wxSize(50, 24)); + m_expr_set_btn = new ::Button(m_cards, _L("Set")); + m_expr_clear_btn = new ::Button(m_cards, _L("Clear")); + m_expr_set_btn->SetStyle(ButtonStyle::Confirm, ButtonType::Parameter); + m_expr_clear_btn->SetStyle(ButtonStyle::Regular, ButtonType::Parameter); m_expr_set_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_set_expr(); }); m_expr_clear_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_clear_expr(); }); brow->Add(m_expr_set_btn, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 6); @@ -2948,7 +2951,7 @@ DesignPanel::DesignPanel(wxWindow* parent) // formats per the user locale (comma) with no clean override, so we own the // formatting here to guarantee international '.' decimals. m_value_input = new wxTextCtrl(m_cards, wxID_ANY, "", wxDefaultPosition, - wxSize(90, -1), wxTE_PROCESS_ENTER); + FromDIP(wxSize(90, -1)), wxTE_PROCESS_ENTER); m_value_input->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent&) { confirm_value(); }); vrow->Add(new wxStaticText(m_cards, wxID_ANY, _L("Value")), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 8); vrow->Add(m_value_input, 0, wxALIGN_CENTER_VERTICAL); @@ -3016,19 +3019,27 @@ DesignPanel::DesignPanel(wxWindow* parent) FromDIP(SidebarProps::ContentMargin())); tree_inner->Add(new wxStaticLine(m_tree_box), 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, FromDIP(SidebarProps::TitlebarMargin())); - m_tree = new wxTreeCtrl(m_tree_box, wxID_ANY, wxDefaultPosition, wxSize(-1, 64), + m_tree = new wxTreeCtrl(m_tree_box, wxID_ANY, wxDefaultPosition, FromDIP(wxSize(-1, 64)), wxTR_HIDE_ROOT | wxTR_SINGLE | wxTR_NO_LINES | wxTR_FULL_ROW_HIGHLIGHT | wxBORDER_SIMPLE | wxTR_EDIT_LABELS); - if (!dp_dark()) m_tree->SetBackgroundColour(dp_panel_bg()); + m_tree->SetBackgroundColour(dp_panel_bg()); // Per-feature-type icons (indices match tree_icon_for): sketch/extrude/dressup/hole/thread. - m_tree_images = new wxImageList(16, 16); - m_tree_images->Add(create_scaled_bitmap("design_sketch", nullptr, 16)); // 0 Sketch - m_tree_images->Add(create_scaled_bitmap("design_extrude", nullptr, 16)); // 1 Extrude - m_tree_images->Add(create_scaled_bitmap("design_dressup", nullptr, 16)); // 2 Fillet/Chamfer - m_tree_images->Add(create_scaled_bitmap("design_hole", nullptr, 16)); // 3 Hole - m_tree_images->Add(create_scaled_bitmap("design_thread", nullptr, 16)); // 4 Thread - m_tree_images->Add(create_scaled_bitmap("design_shell", nullptr, 16)); // 5 Shell - m_tree->AssignImageList(m_tree_images); + // The list is sized from the bitmaps themselves (image-list sizes are physical and must match + // them), and rebuilt with the other icons on a DPI or theme change. + auto tree_images = [this] { + static const char* const kIcons[] = { "design_sketch", "design_extrude", "design_dressup", + "design_hole", "design_thread", "design_shell" }; + std::vector bmps; + for (const char* name : kIcons) + bmps.push_back(create_scaled_bitmap(name, this, 16)); + const wxSize sz = bmps.front().GetSize(); + m_tree_images = new wxImageList(sz.x, sz.y); + for (const wxBitmap& b : bmps) + m_tree_images->Add(b); + m_tree->AssignImageList(m_tree_images); // takes ownership; frees the previous list + }; + tree_images(); + m_icon_refresh.push_back(tree_images); tree_inner->Add(m_tree, 0, wxEXPAND | wxALL, 12); // Selecting a body-producing feature (Extrude/Fillet/Chamfer/Hole/Thread) in the @@ -3164,7 +3175,7 @@ DesignPanel::DesignPanel(wxWindow* parent) wxBoxSizer* trow = m_hdr_tree_row; auto edit_btn = [this](const char* icon, const wxString& tip) { // Header-sized: reads as a section action, not a primary control. - auto* b = new ScalableButton(m_tree_box, wxID_ANY, icon, "", wxSize(24, 24), + auto* b = new ScalableButton(m_tree_box, wxID_ANY, icon, "", FromDIP(wxSize(24, 24)), wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 20); b->SetToolTip(tip); return b; @@ -3202,7 +3213,7 @@ DesignPanel::DesignPanel(wxWindow* parent) trow->Add(down, 0, wxALIGN_CENTER_VERTICAL); // Interference check sits after a rule: it reports, it does not edit the recipe. trow->AddSpacer(8); - trow->Add(new wxStaticLine(m_tree_box, wxID_ANY, wxDefaultPosition, wxSize(1, 22), wxLI_VERTICAL), + trow->Add(new wxStaticLine(m_tree_box, wxID_ANY, wxDefaultPosition, FromDIP(wxSize(1, 22)), wxLI_VERTICAL), 0, wxALIGN_CENTER_VERTICAL); trow->AddSpacer(8); trow->Add(m_btn_interfere, 0, wxALIGN_CENTER_VERTICAL); @@ -3230,7 +3241,7 @@ DesignPanel::DesignPanel(wxWindow* parent) // policy — the card only gives them a home next to the rows they act on. { auto body_btn = [this](const char* icon, const wxString& tip) { - auto* b = new ScalableButton(m_parts_box, wxID_ANY, icon, "", wxSize(24, 24), + auto* b = new ScalableButton(m_parts_box, wxID_ANY, icon, "", FromDIP(wxSize(24, 24)), wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 20); b->SetToolTip(tip); return b; @@ -3268,10 +3279,10 @@ DesignPanel::DesignPanel(wxWindow* parent) FromDIP(SidebarProps::TitlebarMargin())); m_parts_hdr->ShowItems(false); // no bodies yet on a fresh document m_parts_rule->Hide(); - m_parts = new wxTreeCtrl(m_parts_box, wxID_ANY, wxDefaultPosition, wxSize(-1, 48), + m_parts = new wxTreeCtrl(m_parts_box, wxID_ANY, wxDefaultPosition, FromDIP(wxSize(-1, 48)), wxTR_HIDE_ROOT | wxTR_SINGLE | wxTR_NO_LINES | wxTR_FULL_ROW_HIGHLIGHT | wxBORDER_SIMPLE | wxTR_EDIT_LABELS); - if (!dp_dark()) m_parts->SetBackgroundColour(dp_panel_bg()); + m_parts->SetBackgroundColour(dp_panel_bg()); parts_inner->Add(m_parts, 0, wxEXPAND | wxALL, 12); // Start hidden: a fresh document has no bodies, and refresh_parts() only runs on the first // tree rebuild — until then an empty box would sit under the header. @@ -3358,9 +3369,16 @@ DesignPanel::DesignPanel(wxWindow* parent) var_hdr->Add(card_header(m_var_box, "design_constrain", _L("Variables"), var_hdr_title), 0, wxALIGN_CENTER_VERTICAL); var_hdr->AddStretchSpacer(); - m_btn_add_var = new wxButton(m_var_box, wxID_ANY, _L("+"), wxDefaultPosition, wxSize(30, 24)); - m_btn_edit_var = new wxButton(m_var_box, wxID_ANY, _L("Edit"), wxDefaultPosition, wxSize(50, 24)); - m_btn_del_var = new wxButton(m_var_box, wxID_ANY, _L("Del"), wxDefaultPosition, wxSize(42, 24)); + // Icon actions in the card header, as the Feature tree and Bodies cards have them. + auto var_btn = [this](const char* icon, const wxString& tip) { + auto* b = new ScalableButton(m_var_box, wxID_ANY, icon, "", FromDIP(wxSize(24, 24)), + wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 20); + b->SetToolTip(tip); + return b; + }; + m_btn_add_var = var_btn("add", _L("Add variable")); + m_btn_edit_var = var_btn("design_edit", _L("Edit variable")); + m_btn_del_var = var_btn("design_delete", _L("Delete variable")); m_btn_add_var->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_add_variable(); }); m_btn_edit_var->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_edit_variable(); }); m_btn_del_var->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_remove_variable(); }); @@ -3375,7 +3393,7 @@ DesignPanel::DesignPanel(wxWindow* parent) m_var_list = new wxListCtrl(m_var_box, wxID_ANY, wxDefaultPosition, wxSize(-1, FromDIP(64)), wxLC_REPORT | wxLC_SINGLE_SEL); - if (!dp_dark()) m_var_list->SetBackgroundColour(dp_panel_bg()); + m_var_list->SetBackgroundColour(dp_panel_bg()); m_var_list->AppendColumn(_L("Name"), wxLIST_FORMAT_LEFT, FromDIP(90)); m_var_list->AppendColumn(_L("Expression"), wxLIST_FORMAT_LEFT, FromDIP(120)); var_inner->Add(m_var_list, 0, wxEXPAND | wxALL, FromDIP(SidebarProps::ContentMargin())); @@ -3388,7 +3406,6 @@ DesignPanel::DesignPanel(wxWindow* parent) m_status = new wxStaticText(m_form, wxID_ANY, ""); m_status->Hide(); // storage only — the line is drawn over the viewport, see set_status() - m_status_default_fg = m_status->GetForegroundColour(); // capture BEFORE any caller writes root->Add(m_status, 0, wxLEFT | wxRIGHT | wxBOTTOM, 12); // DoF / constraint-state readout (P3). Dedicated line so it never clobbers the @@ -3460,11 +3477,13 @@ DesignPanel::DesignPanel(wxWindow* parent) m_form->FitInside(); m_form->SetScrollRate(0, FromDIP(20)); // vertical only, like Prepare's sidebar: never scroll labels out - m_form->SetMinSize(wxSize(264, -1)); + m_form->SetMinSize(FromDIP(wxSize(264, -1))); + build_phase("sidebar and tool cards"); // Right column: a small view toolbar over the live 3D viewport that mirrors // the CadDocument body. m_viewport = new DesignCanvas(this); + build_phase("3D canvas"); m_viewport->set_on_sketch_commit([this](const SketchProfile& prof, const SketchPlane& plane) { m_doc.checkpoint(); // undo boundary: committing a sketch @@ -4346,6 +4365,8 @@ DesignPanel::DesignPanel(wxWindow* parent) } set_ui_mode(UiMode::Feature); + build_phase("wiring"); + BOOST_LOG_TRIVIAL(info) << "Design tab build: total " << build_clock.Time() << " ms"; } void DesignPanel::set_active_tool_btn(ScalableButton* b) @@ -4928,7 +4949,8 @@ void DesignPanel::on_import_mesh() "merging, so importing it may take a long time and leave a body that is slow to " "edit. Decimating the mesh first is usually better.\n\nImport anyway?"), int(mesh.its.indices.size())); - if (wxMessageBox(q, _L("Large mesh"), wxYES_NO | wxICON_WARNING, this) != wxYES) + MessageDialog dlg(this, q, _L("Large mesh"), wxYES_NO | wxICON_WARNING); + if (dlg.ShowModal() != wxID_YES) return; } @@ -6288,14 +6310,11 @@ void DesignPanel::set_status(StatusKind kind, const wxString& body) // 8cc), which silently length-limited every hint in the tab. The viewport's bottom // margin has the whole window width, so a sentence can be a sentence. if (m_viewport != nullptr) { - // wxNullColour means "no opinion", and the dark default text colour is nearly invisible - // on the dark HUD; only a colour a caller actually chose (the error red, the plane-pick - // green) is carried over. Compared against the colour the label was CREATED with — - // comparing against the parent's foreground instead reported "chosen" for every line, - // and the neutral text came out the panel's grey. - const wxColour fg = m_status->GetForegroundColour(); - m_viewport->set_status_text(text, fg != m_status_default_fg ? fg - : wxColour(0xDD, 0xE1, 0xE6)); + // Only a colour a caller actually chose (the error red, the plane-pick green) is carried + // over; a neutral line (wxNullColour above) takes the viewport overlay's own text colour, + // which follows the theme. + m_viewport->set_status_text(text, m_status->UseForegroundColour() ? m_status->GetForegroundColour() + : wxNullColour); } } @@ -7155,30 +7174,80 @@ wxString DesignPanel::idle_hint() const // Nothing else in the panel needs to know: the popup keeps its text and comes straight back. void DesignPanel::on_tab_hidden() { - if (m_viewport) { - m_viewport->show_status_hud(false); + if (m_viewport) m_viewport->leave_viewport(); // hand the shared camera back to the editor tabs - } } void DesignPanel::on_tab_shown() { - if (m_viewport) { - m_viewport->show_status_hud(true); // ...and back on the way in + if (m_viewport) m_viewport->enter_viewport(); // borrow the shared camera; on_tab_hidden gives it back - } if (m_active == Tool::None && m_doc.display_mesh.its.indices.empty()) set_status(idle_hint()); // first paint: the tab has never been edited + wxStopWatch show_clock; if (m_viewport) m_viewport->refresh_bed(); hydrate_from_model(); update_reference_planes(); // entering the Design tab: show the XY/XZ/YZ planes if no object yet + if (show_clock.Time() > 100) // a slow first show is what users report; the usual one is not news + BOOST_LOG_TRIVIAL(info) << "Design tab shown: bed, project recipe and planes in " << show_clock.Time() << " ms"; sync_sidebar_width(); // keep the panel as wide as Prepare's so the canvas edge doesn't jump if (m_viewport) m_viewport->force_repaint(); // the page was just re-shown: paint it for real } +void DesignPanel::refresh_icons() +{ + // Plain ScalableButtons re-read their icon for the current scale and theme, and the Orca + // widgets re-measure themselves... + std::function walk = [&walk](wxWindow* w) { + if (auto* b = dynamic_cast(w)) + b->msw_rescale(); + else if (auto* b = dynamic_cast<::Button*>(w)) + b->Rescale(); + else if (auto* c = dynamic_cast<::CheckBox*>(w)) + c->Rescale(); + else if (auto* c = dynamic_cast<::ComboBox*>(w)) + c->Rescale(); + for (wxWindow* child : w->GetChildren()) + walk(child); + }; + walk(this); + // ...then the icons that are not a button face (and the buttons that swap to a "_dark" twin). + for (auto& refresh : m_icon_refresh) + refresh(); +} + +void DesignPanel::msw_rescale() +{ + refresh_icons(); + if (m_viewport) m_viewport->Refresh(); + Layout(); +} + +void DesignPanel::on_sys_color_changed() +{ + // Every chrome colour here was set from a DpToken in the theme that was current at the time. + // Move each one, background and text, onto the same token in the new theme; any other colour + // (the teal accents, the status colours) is the same in both and stays. + const bool to_dark = dp_dark(); + std::function walk = [&walk, to_dark](wxWindow* w) { + if (w->UseBackgroundColour()) + w->SetBackgroundColour(dp_retheme(w->GetBackgroundColour(), to_dark)); + if (w->UseForegroundColour()) + w->SetForegroundColour(dp_retheme(w->GetForegroundColour(), to_dark)); + for (wxWindow* child : w->GetChildren()) + walk(child); + }; + walk(this); + // The native controls (trees, lists, spins) take the app's own dark pass. + wxGetApp().UpdateDarkUIWin(this); + refresh_icons(); + refresh_tree(); // the rows carry their own text colours + Refresh(); +} + // Rehydrate the parametric model from a freshly loaded project (the 3MF carried the recipe in // Metadata/orca_cad.bin). Only into an EMPTY document, so an active design is never clobbered // when the user toggles back to the tab. Called on tab show and by the control socket — which @@ -7671,7 +7740,7 @@ void DesignPanel::after_tree_edit(bool ok) void DesignPanel::on_new_design() { if (m_doc.features.empty() && m_doc.bodies.empty()) { set_status_ok(); return; } - wxMessageDialog dlg(this, + MessageDialog dlg(this, _L("Erase all features and bodies and start a new design? This cannot be undone."), _L("New Design"), wxYES_NO | wxICON_EXCLAMATION); if (dlg.ShowModal() != wxID_YES) return; @@ -8188,14 +8257,14 @@ void DesignPanel::rebuild_constraint_list() auto* row = new wxBoxSizer(wxHORIZONTAL); // Delete button first (fixed left position, always visible — long labels can // horizontally scroll but ✗ stays put and clickable). BMP-safe ✗ glyph. - auto* del = new wxButton(m_cards, wxID_ANY, wxString::FromUTF8("✗"), - wxDefaultPosition, wxSize(26, -1)); + auto* del = new ScalableButton(m_cards, wxID_ANY, "design_delete", "", FromDIP(wxSize(24, 24)), + wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 16); del->SetToolTip(_L("Delete constraint")); del->Bind(wxEVT_BUTTON, [this, i](wxCommandEvent&) { delete_constraint(i); }); // Clickable label: selecting it highlights the referenced entities. - auto* lbl = new wxButton(m_cards, wxID_ANY, constraint_label(cons[i]), - wxDefaultPosition, wxDefaultSize, wxBU_LEFT | wxBORDER_NONE); - lbl->Bind(wxEVT_BUTTON, [this, i](wxCommandEvent&) { highlight_constraint_entities(i); }); + auto* lbl = new wxStaticText(m_cards, wxID_ANY, constraint_label(cons[i])); + lbl->SetCursor(wxCursor(wxCURSOR_HAND)); + lbl->Bind(wxEVT_LEFT_UP, [this, i](wxMouseEvent&) { highlight_constraint_entities(i); }); row->Add(del, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 6); row->Add(lbl, 1, wxALIGN_CENTER_VERTICAL); m_constraint_rows->Add(row, 0, wxEXPAND | wxTOP, 2); @@ -10792,7 +10861,7 @@ void DesignPanel::refresh_preview() default: ready = _L("Sketch ready"); break; } set_status(StatusKind::Ok, ready); - for (wxButton* b : m_confirm_btns) if (b) b->Enable(true); + for (::Button* b : m_confirm_btns) if (b) b->Enable(true); m_status->Refresh(); update_datum_gizmo(); // Plane card: show/refresh the in-canvas resize handles update_helix_gizmo(); // Helix card: draw the live curve + drag handles (no solid ghost) @@ -10835,7 +10904,7 @@ void DesignPanel::refresh_preview() set_status(StatusKind::Error, wxString::Format(_L("Invalid: %s"), kernel_error_text(err))); } } - for (wxButton* b : m_confirm_btns) if (b) b->Enable(ok); + for (::Button* b : m_confirm_btns) if (b) b->Enable(ok); m_status->Refresh(); return; } @@ -10881,7 +10950,7 @@ void DesignPanel::refresh_preview() } // Onshape parity: a broken candidate cannot be committed. Grey the active dialog's // Confirm so the user sees the gate before clicking; the red status says why. - for (wxButton* b : m_confirm_btns) + for (::Button* b : m_confirm_btns) if (b != nullptr) b->Enable(ok); // Fillet/Chamfer/Draft: once the target edge/face yields a valid result, show ONLY the // preview (hide the base bodies) so the user sees the finished shape, not the old solid @@ -11450,7 +11519,7 @@ void DesignPanel::tool_cancel() // the user to press the very button they had just pressed: a sketch could be kept but // never discarded. if (m_viewport && m_viewport->live_sketch_has_work()) { - wxMessageDialog dlg(this, + RichMessageDialog dlg(this, _L("Discard this sketch and everything drawn in it?"), _L("Discard sketch"), wxYES_NO | wxNO_DEFAULT | wxICON_EXCLAMATION); @@ -11481,9 +11550,9 @@ bool DesignPanel::confirm_enabled() const return (m_viewport && m_viewport->moving_body()) || m_ui_mode == UiMode::Sketch || m_ui_mode == UiMode::Constrain; if (m_active == Tool::Insert) return true; - for (wxButton* b : m_confirm_btns) + for (::Button* b : m_confirm_btns) if (b != nullptr && b->IsShownOnScreen()) return b->IsEnabled(); - for (wxButton* b : m_confirm_btns) + for (::Button* b : m_confirm_btns) if (b != nullptr) return b->IsEnabled(); return true; } @@ -11582,18 +11651,10 @@ bool DesignPanel::menu_can_undo_redo(bool redo) const void DesignPanel::update_undo_redo_buttons() { - // Grey Undo/Redo to mirror exactly what do_undo_redo will do: it acts only in Feature - // mode with no tool/dialog open (otherwise Esc is the way out), so reflect that gate here - // as well as the document's available history. - if (m_btn_undo == nullptr || m_btn_redo == nullptr) return; - if (m_ui_mode == UiMode::Sketch && m_viewport && m_viewport->is_sketching()) { - m_btn_undo->Enable(m_viewport->can_undo_sketch_entity()); - m_btn_redo->Enable(m_viewport->can_redo_sketch_entity()); - return; - } - const bool gated = (m_ui_mode != UiMode::Feature) || (m_active != Tool::None); - m_btn_undo->Enable(!gated && m_doc.can_undo()); - m_btn_redo->Enable(!gated && m_doc.can_redo()); + // The tab has no Undo/Redo of its own: the app's (the top bar, Ctrl+Z, Edit) drive this + // history while the tab is shown, greyed to exactly what do_undo_redo will do. + if (MainFrame* frame = wxGetApp().mainframe; frame != nullptr && IsShownOnScreen()) + frame->set_undo_redo_enabled(menu_can_undo_redo(false), menu_can_undo_redo(true)); } void DesignPanel::update_action_bar() @@ -11674,19 +11735,78 @@ void DesignPanel::refresh_variables() } } +// A design variable's name and expression, in Orca's dialog style: one dialog for both fields +// rather than two bare text prompts. Editing an existing variable keeps its name fixed. +class DesignVariableDialog : public DPIDialog +{ +public: + DesignVariableDialog(wxWindow* parent, const wxString& title, const wxString& name, + const wxString& expr, bool name_editable) + : DPIDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX) + { + SetBackgroundColour(*wxWHITE); + SetFont(Label::Body_14); + auto* grid = new wxFlexGridSizer(2, FromDIP(8), FromDIP(12)); + grid->AddGrowableCol(1); + auto field = [this, grid](const wxString& label, const wxString& value) { + grid->Add(new wxStaticText(this, wxID_ANY, label), 0, wxALIGN_CENTER_VERTICAL); + auto* in = new ::TextInput(this, value, "", "", wxDefaultPosition, wxSize(FromDIP(240), -1), + wxTE_PROCESS_ENTER); + in->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent&) { EndModal(wxID_OK); }); + grid->Add(in, 1, wxEXPAND); + return in; + }; + m_name = field(_L("Name"), name); + m_expr = field(_L("Expression"), expr); + m_name->Enable(name_editable); + + m_buttons = new DialogButtons(this, {"OK", "Cancel"}); + m_buttons->GetOK()->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { EndModal(wxID_OK); }); + m_buttons->GetCANCEL()->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { EndModal(wxID_CANCEL); }); + + auto* sizer = new wxBoxSizer(wxVERTICAL); + sizer->Add(grid, 1, wxEXPAND | wxALL, FromDIP(16)); + sizer->Add(m_buttons, 0, wxEXPAND); + SetSizerAndFit(sizer); + CenterOnParent(); + (name_editable ? m_name : m_expr)->GetTextCtrl()->SetFocus(); + wxGetApp().UpdateDlgDarkUI(this); + } + + wxString name() const { return trimmed(m_name); } + wxString expression() const { return trimmed(m_expr); } + +protected: + void on_dpi_changed(const wxRect&) override + { + m_name->Rescale(); + m_expr->Rescale(); + GetSizer()->SetSizeHints(this); + Refresh(); + } + +private: + static wxString trimmed(const ::TextInput* in) + { + wxString v = in->GetTextCtrl()->GetValue(); + return v.Trim(true).Trim(false); + } + ::TextInput* m_name{nullptr}; + ::TextInput* m_expr{nullptr}; + DialogButtons* m_buttons{nullptr}; +}; + void DesignPanel::on_add_variable() { - wxString name = ::wxGetTextFromUser(_L("Variable name:"), _L("Add Variable"), "", this); - if (name.IsEmpty()) return; - name.Trim(true).Trim(false); + DesignVariableDialog dlg(this, _L("Add Variable"), "", "0", true); + if (dlg.ShowModal() != wxID_OK) return; + const wxString name = dlg.name(); + const wxString expr = dlg.expression(); + if (name.IsEmpty() || expr.IsEmpty()) return; if (name.Contains(' ')) { set_status(StatusKind::Error, _L("Variable name must not contain spaces")); return; } - wxString expr = ::wxGetTextFromUser( - wxString::Format(_L("Expression for '%s':"), name), - _L("Add Variable"), "0", this); - if (expr.IsEmpty()) return; const std::string name_str = name.ToUTF8().data(); const std::string expr_str = expr.ToUTF8().data(); @@ -11712,9 +11832,10 @@ void DesignPanel::on_edit_variable() } const std::string name_str = m_var_list->GetItemText(sel, 0).ToUTF8().data(); const std::string old_expr = m_var_list->GetItemText(sel, 1).ToUTF8().data(); - wxString expr = ::wxGetTextFromUser( - wxString::Format(_L("Expression for '%s':"), m_var_list->GetItemText(sel, 0)), - _L("Edit Variable"), wxString::FromUTF8(old_expr), this); + DesignVariableDialog dlg(this, _L("Edit Variable"), m_var_list->GetItemText(sel, 0), + wxString::FromUTF8(old_expr), false); + if (dlg.ShowModal() != wxID_OK) return; + const wxString expr = dlg.expression(); if (expr.IsEmpty()) return; const std::string expr_str = expr.ToUTF8().data(); diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index b52942ff73..32ac394465 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -36,7 +36,7 @@ class wxSizer; class wxBoxSizer; class wxTextCtrl; class wxListCtrl; -class wxButton; +class Button; class wxPanel; class ScalableButton; @@ -55,6 +55,10 @@ public: explicit DesignPanel(wxWindow* parent); void on_tab_shown(); // re-sync bed to the active printer when the Design tab is activated void on_tab_hidden(); // another tab took over: take the viewport status line down with us + // From MainFrame, like the other pages: re-rasterise the icons at the new scale, and on a theme + // switch also move every token colour onto the new theme. + void msw_rescale(); + void on_sys_color_changed(); void unbind_canvas_event_handlers(); // app close / language switch, from the plater's teardown void reset_canvas_volumes(); void clear_document(); // New Project / Open Project: drop the document with the project @@ -296,6 +300,8 @@ public: // and the toolbar buttons. void menu_undo_redo(bool redo) { do_undo_redo(redo); } bool menu_can_undo_redo(bool redo) const; + // Grey the app's Undo/Redo to this tab's history and gate (shown tab only). + void update_undo_redo_buttons(); private: // The plane the Hole tool drills on: a picked face (inward, centred) or the dropdown. SketchPlane hole_plane() const; @@ -500,19 +506,16 @@ private: // Unified Confirm/Cancel action bar (right end of the ribbon). Shown whenever any // tool or mode is active; the single confirm/cancel surface for the whole tab. wxSizer* m_tb_action{nullptr}; - // Persistent Undo/Redo group at the left of the ribbon — always visible, independent - // of the mode-gated tool groups. The buttons are greyed per the document history and - // the do_undo_redo gate (see update_undo_redo_buttons). - wxSizer* m_tb_history{nullptr}; - ScalableButton* m_btn_undo{nullptr}; - ScalableButton* m_btn_redo{nullptr}; - void update_undo_redo_buttons(); // enable/disable Undo/Redo from can_undo/can_redo + gate // All tool buttons, for the active-tool teal highlight (Onshape-style). std::vector m_tool_btns; ScalableButton* m_active_tool_btn{nullptr}; void set_active_tool_btn(ScalableButton* b); // nullptr clears the highlight // Owns the themed DropDown flyouts (and the item vectors they hold by ref). std::vector> m_flyout_keepalive; + // Icons that are not a plain ScalableButton face (flyout rows, card headers, the tree's image + // list, theme-twinned buttons): each re-creates its bitmaps for the current scale and theme. + std::vector> m_icon_refresh; + void refresh_icons(); wxCheckBox* m_construction{nullptr}; // sketch-mode construction toggle wxSpinCtrlDouble* m_move_dx{nullptr}; // Move/Rotate card: world translation wxSpinCtrlDouble* m_move_dy{nullptr}; @@ -646,7 +649,7 @@ private: // Delete Face controls (remove faces, heal the solid). ComboBox* m_del_face_body{nullptr}; // target body - wxButton* m_del_face_add_btn{nullptr}; // "Add picked face" button + ::Button* m_del_face_add_btn{nullptr}; // "Add picked face" button wxStaticText* m_del_face_list{nullptr}; // shows the accumulated face ids std::vector m_del_faces; // accumulated face list @@ -671,8 +674,8 @@ private: // Expression binding (per-feature, visible during edit only) ComboBox* m_expr_field{nullptr}; // field-name picker (editable) wxTextCtrl* m_expr_text{nullptr}; // expression string - wxButton* m_expr_set_btn{nullptr}; // Apply / bind - wxButton* m_expr_clear_btn{nullptr}; // Remove binding + ::Button* m_expr_set_btn{nullptr}; // Apply / bind + ::Button* m_expr_clear_btn{nullptr}; // Remove binding wxStaticText* m_expr_status{nullptr}; // shows current bindings for the edited feature void populate_expr_fields(Tool t); // fill m_expr_field from feature-type fields void on_set_expr(); // checkpoint + write -> recompute -> undo on fail @@ -681,9 +684,9 @@ private: // Document variables panel (below the feature tree / parts) StaticBox* m_var_box{nullptr}; wxListCtrl* m_var_list{nullptr}; - wxButton* m_btn_add_var{nullptr}; - wxButton* m_btn_edit_var{nullptr}; - wxButton* m_btn_del_var{nullptr}; + ScalableButton* m_btn_add_var{nullptr}; + ScalableButton* m_btn_edit_var{nullptr}; + ScalableButton* m_btn_del_var{nullptr}; void refresh_variables(); // rebuild m_var_list from m_doc.variables void on_add_variable(); void on_edit_variable(); @@ -721,10 +724,10 @@ private: ComboBox* m_plane_tilt_axis{nullptr}; // 0 = base X, 1 = base Y // Plane construction method + contextual face/edge reference picks (Onshape/Fusion parity). ComboBox* m_plane_type{nullptr}; // PlaneType: Offset/Angle/Midplane/Tangent/TwoEdges/Coincident - wxButton* m_plane_pick_faceA{nullptr}; wxStaticText* m_plane_faceA_lbl{nullptr}; - wxButton* m_plane_pick_faceB{nullptr}; wxStaticText* m_plane_faceB_lbl{nullptr}; - wxButton* m_plane_pick_edgeA{nullptr}; wxStaticText* m_plane_edgeA_lbl{nullptr}; - wxButton* m_plane_pick_edgeB{nullptr}; wxStaticText* m_plane_edgeB_lbl{nullptr}; + ::Button* m_plane_pick_faceA{nullptr}; wxStaticText* m_plane_faceA_lbl{nullptr}; + ::Button* m_plane_pick_faceB{nullptr}; wxStaticText* m_plane_faceB_lbl{nullptr}; + ::Button* m_plane_pick_edgeA{nullptr}; wxStaticText* m_plane_edgeA_lbl{nullptr}; + ::Button* m_plane_pick_edgeB{nullptr}; wxStaticText* m_plane_edgeB_lbl{nullptr}; wxSpinCtrlDouble* m_plane_usize{nullptr}; // datum rectangle extent u (mm) — also driven by drag handles wxSpinCtrlDouble* m_plane_vsize{nullptr}; // datum rectangle extent v (mm) // Captured references for the candidate datum (body index + face/edge index, -1 = none). @@ -847,8 +850,8 @@ private: // Axis controls (datum axis: line through two points or derived from geometry). ComboBox* m_axis_type{nullptr}; // AxisType: TwoPoints/FaceNormal/CylinderCenterline/PlaneIntersection/AlongEdge - wxButton* m_axis_pick_face{nullptr}; wxStaticText* m_axis_face_lbl{nullptr}; - wxButton* m_axis_pick_edge{nullptr}; wxStaticText* m_axis_edge_lbl{nullptr}; + ::Button* m_axis_pick_face{nullptr}; wxStaticText* m_axis_face_lbl{nullptr}; + ::Button* m_axis_pick_edge{nullptr}; wxStaticText* m_axis_edge_lbl{nullptr}; ComboBox* m_axis_plane_a{nullptr}; ComboBox* m_axis_plane_b{nullptr}; wxSpinCtrlDouble* m_axis_p1x{nullptr}; wxSpinCtrlDouble* m_axis_p1y{nullptr}; wxSpinCtrlDouble* m_axis_p1z{nullptr}; @@ -861,8 +864,8 @@ private: ComboBox* m_coordsys_type{nullptr}; // CoordSysType: PointWorld/FaceAndDirection ComboBox* m_cs_body{nullptr}; // body-focus chooser: restrict picking to one body wxSpinCtrlDouble* m_cs_x{nullptr}; wxSpinCtrlDouble* m_cs_y{nullptr}; wxSpinCtrlDouble* m_cs_z{nullptr}; - wxButton* m_cs_pick_face{nullptr}; wxStaticText* m_cs_face_lbl{nullptr}; - wxButton* m_cs_pick_edge{nullptr}; wxStaticText* m_cs_edge_lbl{nullptr}; + ::Button* m_cs_pick_face{nullptr}; wxStaticText* m_cs_face_lbl{nullptr}; + ::Button* m_cs_pick_edge{nullptr}; wxStaticText* m_cs_edge_lbl{nullptr}; wxSpinCtrlDouble* m_cs_hx{nullptr}; wxSpinCtrlDouble* m_cs_hy{nullptr}; wxSpinCtrlDouble* m_cs_hz{nullptr}; int m_cs_face_body{-1}, m_cs_face{-1}; int m_cs_edge_body{-1}, m_cs_edge{-1}; @@ -934,7 +937,6 @@ private: // m_status's foreground as created, captured before any caller touches it. Callers signal // "no opinion" by setting wxNullColour, which restores exactly this — so it is the only // reliable way to tell a chosen colour (the error red) from the default. See set_status(). - wxColour m_status_default_fg; // The guidance sentence for the step the armed sketch tool is on, kept so a transient // readout (the live length/angle while a segment is being dragged) can be appended to it // instead of replacing it — the guidance used to vanish on the first mouse move after a @@ -950,7 +952,7 @@ private: bool m_dof_last_has{false}; int m_feature_counter{0}; - std::vector m_confirm_btns; + std::vector<::Button*> m_confirm_btns; // Edit-in-place state: add-mode is m_edit_index == -1. Single-feature edit // (Sketch or Extrude independently) uses only m_edit_index as the row to replace. diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 20edb1a145..15a43b09b6 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -8988,6 +8988,8 @@ void DesignSketchTool::render(GLCanvas3D& canvas) // not there — there is no window to fall back to any more. if (inline_editor != nullptr) inline_editor->render(*wxGetApp().imgui(), m_render_scale); + if (render_overlays) + render_overlays(); (void)canvas; if (!has_display()) { if (on_readout) on_readout(std::string()); // nothing to show -> hide HUD @@ -10510,9 +10512,9 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) // Left-drag rubber band -> whole body. Past the click budget the press becomes a sweep: // the rectangle is anchored at the ORIGINAL press point (not at the frame where the // threshold was crossed, which would lose the first few pixels) and the events are - // consumed from here on. Left-drag no longer orbits in this canvas — DesignCanvas puts - // orbit on middle-drag and pan on right-drag, the CAD convention — so nothing downstream - // is being starved of a gesture it used to own. + // consumed from here on. The camera follows Preferences > Control as in Prepare, so while + // left-drag is given to Rotate or Pan the band takes Shift+left-drag, Prepare's own + // rectangle selection. // HOVER PRE-HIGHLIGHT (9xw part 3): say what a click would take, before it is // taken. Plain motion only — no button down, no band running — because during a drag the // pointer is doing something else and a promise about clicking would be a lie. Returns @@ -10522,7 +10524,9 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) if (update_solid_hover(canvas, evt)) canvas.set_as_dirty(); return false; } - if (evt.Dragging() && evt.LeftIsDown() && m_pick_pending) { + const bool left_drag_sweeps = + evt.ShiftDown() || std::atoi(wxGetApp().app_config->get("left_mouse_drag_action").c_str()) == 0; + if (evt.Dragging() && evt.LeftIsDown() && m_pick_pending && (left_drag_sweeps || m_rubber.is_dragging())) { if (!m_rubber.is_dragging()) { if (std::max(std::abs(evt.GetX() - m_pick_press_x), std::abs(evt.GetY() - m_pick_press_y)) <= 8) diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index 56c1ac1a35..b5c1403347 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -154,6 +154,8 @@ public: // The in-canvas value field, drawn by render() before any early return. Owned by // DesignCanvas; null until it sets it. Not a window — see SketchInlineEditor.hpp. class SketchInlineEditor* inline_editor{nullptr}; + // The canvas's own overlays (its status and readout chips), drawn in this tool's ImGui pass. + std::function render_overlays; // Persistent committed sketches to draw even when no session is active (e.g. an // un-consumed sketch left visible after its extrude is removed). Each carries its @@ -1244,9 +1246,8 @@ private: // change) read honestly — the change has to be predictable before the click, not only after. SolidPick m_pre; // what the pointer is currently over (kind None = nothing) bool update_solid_hover(GLCanvas3D& canvas, const wxMouseEvent& evt); // true when it changed - // Left-drag rubber band: sweep a rectangle over the plate to take a whole body. Orbit - // moves to middle-drag in this canvas (DesignCanvas::set_cad_navigation) so the left - // button is free for it, which is the CAD convention (Onshape/SolidWorks). + // Left-drag rubber band: sweep a rectangle over the plate to take a whole body. While + // Preferences give left-drag to the camera it takes Shift+left-drag, as in Prepare. GLSelectionRectangle m_rubber; void pick_bodies_in_rectangle(); // resolve the swept rectangle -> whole-body selection bool on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas); // the body; on_mouse wraps it diff --git a/src/slic3r/GUI/CAD/DesignTextDialog.cpp b/src/slic3r/GUI/CAD/DesignTextDialog.cpp index 38e1db91e3..37e12053e1 100644 --- a/src/slic3r/GUI/CAD/DesignTextDialog.cpp +++ b/src/slic3r/GUI/CAD/DesignTextDialog.cpp @@ -3,17 +3,18 @@ #include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/I18N.hpp" #include "slic3r/GUI/Widgets/DialogButtons.hpp" +#include "slic3r/GUI/Widgets/TextInput.hpp" +#include "slic3r/GUI/Widgets/ComboBox.hpp" +#include "slic3r/GUI/Widgets/CheckBox.hpp" +#include "slic3r/GUI/Widgets/Label.hpp" #include "slic3r/Utils/WxFontUtils.hpp" #include "libslic3r/AppConfig.hpp" #include "libslic3r/Emboss.hpp" -#include -#include #include #include #include #include -#include #include #include @@ -25,11 +26,31 @@ namespace Slic3r { namespace GUI { static const char* kFontKey = "cad_text_font"; // WxFontUtils::store_wxFont descriptor static const char* kHeightKey = "cad_text_height"; // mm -DesignTextDialog::DesignTextDialog(wxWindow* parent, const Spec* initial) - : DPIDialog(parent, wxID_ANY, _L("Text"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE) +// Installed scalable faces, sorted, enumerated once per session: listing them takes long enough on +// a machine with many fonts to be felt each time the dialog opened. +static const wxArrayString& font_faces() { - SetFont(wxGetApp().normal_font()); - SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(0x2d, 0x2d, 0x31) : *wxWHITE); + static wxArrayString faces = [] { + // '@' faces are the vertical-writing aliases GTK/MSW list twice. + wxArrayString f = wxFontEnumerator::GetFacenames(wxFONTENCODING_SYSTEM, false); + f.erase(std::remove_if(f.begin(), f.end(), [](const wxString& n) { return n.StartsWith("@"); }), f.end()); + f.Sort(); + return f; + }(); + return faces; +} + +static bool parse_mm(wxString t, double& out) +{ + t.Replace(",", "."); + return t.Trim(true).Trim(false).ToCDouble(&out) && out >= 0.5 && out <= 500.0; +} + +DesignTextDialog::DesignTextDialog(wxWindow* parent, const Spec* initial) + : DPIDialog(parent, wxID_ANY, _L("Text"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX) +{ + SetFont(Label::Body_14); + SetBackgroundColour(*wxWHITE); // light palette colour, dark-mapped by UpdateDlgDarkUI const int em = em_unit(); // The text being edited, else the last used font and height, else the GUI font at 10 mm. @@ -50,41 +71,47 @@ DesignTextDialog::DesignTextDialog(wxWindow* parent, const Spec* initial) try { height = std::clamp(std::stod(h), 0.5, 500.0); } catch (...) {} } } + m_last_height = height; auto* form = new wxFlexGridSizer(2, em / 2, em); form->AddGrowableCol(1, 1); + auto label = [this, form](const wxString& text) { + form->Add(new wxStaticText(this, wxID_ANY, text), 0, wxALIGN_CENTER_VERTICAL); + }; - m_text = new wxTextCtrl(this, wxID_ANY, initial ? initial->text : wxString(), wxDefaultPosition, - wxSize(30 * em, -1), wxTE_PROCESS_ENTER); - m_text->SetHint(_L("Type the text to insert")); - form->Add(new wxStaticText(this, wxID_ANY, _L("Text")), 0, wxALIGN_CENTER_VERTICAL); + m_text = new ::TextInput(this, initial ? initial->text : wxString(), "", "", wxDefaultPosition, + wxSize(30 * em, -1), wxTE_PROCESS_ENTER); + m_text->GetTextCtrl()->SetHint(_L("Type the text to insert")); + label(_L("Text")); form->Add(m_text, 1, wxEXPAND); - // Scalable faces only ('@' faces are the vertical-writing aliases GTK/MSW list twice). - wxArrayString faces = wxFontEnumerator::GetFacenames(wxFONTENCODING_SYSTEM, false); - faces.erase(std::remove_if(faces.begin(), faces.end(), [](const wxString& f) { return f.StartsWith("@"); }), - faces.end()); - faces.Sort(); - m_face = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, faces); - int sel = m_face->FindString(font.GetFaceName()); + m_face = new ::ComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(30 * em, -1), 0, nullptr, + wxCB_READONLY); + const wxArrayString& faces = font_faces(); + for (const wxString& f : faces) + m_face->Append(f); + const int sel = faces.Index(font.GetFaceName()); m_face->SetSelection(sel != wxNOT_FOUND ? sel : 0); - form->Add(new wxStaticText(this, wxID_ANY, _L("Font")), 0, wxALIGN_CENTER_VERTICAL); + label(_L("Font")); form->Add(m_face, 1, wxEXPAND); + // Orca's CheckBox carries no label: each one sits beside its own text. auto* style = new wxBoxSizer(wxHORIZONTAL); - m_bold = new wxCheckBox(this, wxID_ANY, _L("Bold")); - m_italic = new wxCheckBox(this, wxID_ANY, _L("Italic")); - m_bold->SetValue(WxFontUtils::is_bold(font)); - m_italic->SetValue(WxFontUtils::is_italic(font)); - style->Add(m_bold, 0, wxRIGHT, em); - style->Add(m_italic, 0); + auto check = [this, style, em](const wxString& text, bool value) { + auto* c = new ::CheckBox(this); + c->SetValue(value); + style->Add(c, 0, wxALIGN_CENTER_VERTICAL); + style->Add(new wxStaticText(this, wxID_ANY, text), 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, em / 2); + return c; + }; + m_bold = check(_L("Bold"), WxFontUtils::is_bold(font)); + m_italic = check(_L("Italic"), WxFontUtils::is_italic(font)); form->AddSpacer(0); form->Add(style, 0); - m_height = new wxSpinCtrlDouble(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(10 * em, -1), - wxSP_ARROW_KEYS, 0.5, 500.0, height, 0.5); - m_height->SetDigits(1); - form->Add(new wxStaticText(this, wxID_ANY, _L("Height (mm)")), 0, wxALIGN_CENTER_VERTICAL); + m_height = new ::TextInput(this, wxString::FromCDouble(height, 1), _L("mm"), "", wxDefaultPosition, + wxSize(10 * em, -1), wxTE_PROCESS_ENTER); + label(_L("Height")); form->Add(m_height, 0); // The outline of what will be inserted, fitted to the box, with its real size under it. @@ -104,26 +131,21 @@ DesignTextDialog::DesignTextDialog(wxWindow* parent, const Spec* initial) top->Add(m_size, 0, wxLEFT | wxRIGHT | wxTOP, em); top->Add(buttons, 0, wxEXPAND); - m_text->Bind(wxEVT_TEXT, [this](wxCommandEvent&) { update_preview(); }); + m_text->Bind(wxEVT_TEXT, [this](wxCommandEvent& e) { update_preview(); e.Skip(); }); m_text->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent&) { accept(); }); // Enter = OK, as everywhere in the tab - auto refont = [this](wxCommandEvent&) { load_font(); update_preview(); }; - m_face->Bind(wxEVT_CHOICE, refont); - m_bold->Bind(wxEVT_CHECKBOX, refont); - m_italic->Bind(wxEVT_CHECKBOX, refont); - m_height->Bind(wxEVT_SPINCTRLDOUBLE, [this](wxSpinDoubleEvent&) { update_preview(); }); - m_height->Bind(wxEVT_TEXT, [this](wxCommandEvent&) { update_preview(); }); - Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) { - if (e.GetId() == wxID_OK) accept(); - else if (e.GetId() == wxID_CANCEL) cancel(); - else e.Skip(); - }); + m_face->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent& e) { load_font(); update_preview(); e.Skip(); }); + for (::CheckBox* c : {m_bold, m_italic}) + c->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& e) { e.Skip(); CallAfter([this] { load_font(); update_preview(); }); }); + m_height->Bind(wxEVT_TEXT, [this](wxCommandEvent& e) { update_preview(); e.Skip(); }); + m_height->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent&) { accept(); }); + buttons->GetOK()->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { accept(); }); + buttons->GetCANCEL()->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { cancel(); }); Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent&) { cancel(); }); Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& e) { if (e.GetKeyCode() == WXK_ESCAPE) cancel(); else e.Skip(); }); - wxGetApp().UpdateDlgDarkUI(this); SetSizerAndFit(top); // Out of the middle of the window, where the text is being placed: top right of the parent. if (parent != nullptr) { @@ -132,17 +154,26 @@ DesignTextDialog::DesignTextDialog(wxWindow* parent, const Spec* initial) } else { CenterOnParent(); } + wxGetApp().UpdateDlgDarkUI(this); load_font(); update_preview(); - m_text->SetFocus(); + m_text->GetTextCtrl()->SetFocus(); } -wxString DesignTextDialog::text() const { return m_text->GetValue(); } +double DesignTextDialog::height_mm() const +{ + double h = 0.0; + if (parse_mm(m_height->GetTextCtrl()->GetValue(), h)) + const_cast(this)->m_last_height = h; + return m_last_height; +} + +wxString DesignTextDialog::text() const { return m_text->GetTextCtrl()->GetValue(); } DesignTextDialog::Spec DesignTextDialog::spec() const { - return { m_text->GetValue(), WxFontUtils::store_wxFont(current_font()), m_height->GetValue() }; + return { text(), WxFontUtils::store_wxFont(current_font()), height_mm() }; } void DesignTextDialog::accept() @@ -151,7 +182,7 @@ void DesignTextDialog::accept() m_done = true; if (AppConfig* cfg = wxGetApp().app_config) { cfg->set(kFontKey, WxFontUtils::store_wxFont(current_font())); - cfg->set(kHeightKey, std::to_string(m_height->GetValue())); + cfg->set(kHeightKey, std::to_string(height_mm())); } if (on_accept) on_accept(); } @@ -167,7 +198,7 @@ wxFont DesignTextDialog::current_font() const { wxFontInfo info(12); if (m_face->GetSelection() != wxNOT_FOUND) - info.FaceName(m_face->GetStringSelection()); + info.FaceName(m_face->GetString(m_face->GetSelection())); info.Bold(m_bold->GetValue()).Italic(m_italic->GetValue()); return wxFont(info); } @@ -182,10 +213,10 @@ void DesignTextDialog::load_font() void DesignTextDialog::update_preview() { - const std::string utf8(m_text->GetValue().ToUTF8().data()); + const std::string utf8(text().ToUTF8().data()); m_regions.clear(); if (m_font_file && !utf8.empty()) - m_regions = text_to_regions(utf8, m_height->GetValue(), m_font_file); + m_regions = text_to_regions(utf8, height_mm(), m_font_file); wxString line; if (!m_font_file) @@ -250,7 +281,20 @@ void DesignTextDialog::draw_preview(wxWindow* canvas) void DesignTextDialog::on_dpi_changed(const wxRect&) { - Fit(); + m_text->Rescale(); + m_face->Rescale(); + m_height->Rescale(); + m_bold->Rescale(); + m_italic->Rescale(); + GetSizer()->SetSizeHints(this); + Refresh(); +} + +void DesignTextDialog::on_sys_color_changed() +{ + SetBackgroundColour(*wxWHITE); + wxGetApp().UpdateDlgDarkUI(this); + m_preview->Refresh(); // its colours are read at paint time Refresh(); } diff --git a/src/slic3r/GUI/CAD/DesignTextDialog.hpp b/src/slic3r/GUI/CAD/DesignTextDialog.hpp index 3200301880..9b39db4651 100644 --- a/src/slic3r/GUI/CAD/DesignTextDialog.hpp +++ b/src/slic3r/GUI/CAD/DesignTextDialog.hpp @@ -10,11 +10,10 @@ #include #include -class wxTextCtrl; -class wxChoice; -class wxCheckBox; -class wxSpinCtrlDouble; class wxStaticText; +class TextInput; +class ComboBox; +class CheckBox; namespace Slic3r { namespace Emboss { struct FontFile; } @@ -48,6 +47,7 @@ public: protected: void on_dpi_changed(const wxRect& suggested_rect) override; + void on_sys_color_changed() override; private: void load_font(); // m_face/m_bold/m_italic -> m_font_file @@ -58,11 +58,14 @@ private: void cancel(); bool m_done{false}; // accept/cancel fire once - wxTextCtrl* m_text{nullptr}; - wxChoice* m_face{nullptr}; - wxCheckBox* m_bold{nullptr}; - wxCheckBox* m_italic{nullptr}; - wxSpinCtrlDouble* m_height{nullptr}; + double height_mm() const; // the typed height, or the last valid one while it is being typed + + ::TextInput* m_text{nullptr}; + ::ComboBox* m_face{nullptr}; + ::CheckBox* m_bold{nullptr}; + ::CheckBox* m_italic{nullptr}; + ::TextInput* m_height{nullptr}; // mm; Orca's SpinInput is integer-only + double m_last_height{10.0}; wxWindow* m_preview{nullptr}; wxStaticText* m_size{nullptr}; wxWindow* m_ok{nullptr}; diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index ca6e037eb7..b4efaa6b8b 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4846,8 +4846,6 @@ bool GLCanvas3D::is_camera_rotate(const wxMouseEvent& evt, const std::map m_old_size{ 0, 0 }; bool m_is_touchpad_navigation{ false }; - // CAD navigation (Design tab only): left-drag is a selection rubber band, so orbit moves - // to middle-drag and pan to right-drag — the Onshape/SolidWorks mapping. Off everywhere - // else, so Prepare/Preview keep the mouse the user already learned. - bool m_cad_navigation{ false }; - // Screen is only refreshed from the OnIdle handler if it is dirty. bool m_dirty; // A frame is needed, and only for the overlay. @@ -1144,7 +1139,6 @@ public: bool clicked_button_matches_action(const wxMouseEvent& evt, MouseAction action, const std::map& mappings) const; bool is_camera_rotate(const wxMouseEvent& evt, const std::map& mappings) const; bool is_camera_pan(const wxMouseEvent& evt, const std::map& mappings) const; - void set_cad_navigation(bool b) { m_cad_navigation = b; } Size get_canvas_size() const; Vec2d get_local_mouse_position() const; diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 54393c70c1..e0db1cda00 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1320,6 +1320,15 @@ void MainFrame::show_option(bool show) } } +void MainFrame::set_undo_redo_enabled(bool undo, bool redo) +{ +#ifndef __APPLE__ + m_topbar->EnableUndoRedo(undo, redo); +#else + (void) undo; (void) redo; // macOS has no top bar; Edit asks the tab when it opens +#endif +} + #ifdef SLIC3R_CAD DesignPanel* MainFrame::shown_design_panel() const { @@ -1393,6 +1402,11 @@ void MainFrame::init_tabpanel() { m_topbar->DisableUndoRedoItems(); } #endif +#ifdef SLIC3R_CAD + // Design keeps its own history, and the top bar's Undo/Redo drive it while it is shown. + if (m_design_page != nullptr && panel == m_design_page) + DesignPanel::ensure()->update_undo_redo_buttons(); +#endif if (panel) panel->SetFocus(); @@ -2612,6 +2626,9 @@ void MainFrame::on_dpi_changed(const wxRect& suggested_rect) MonitorPanel::when_built([](MonitorPanel& monitor) { monitor.msw_rescale(); }); MultiMachinePage::when_built([](MultiMachinePage& multi_machine) { multi_machine.msw_rescale(); }); CalibrationPanel::when_built([](CalibrationPanel& calibration) { calibration.msw_rescale(); }); +#ifdef SLIC3R_CAD + DesignPanel::when_built([](DesignPanel& design) { design.msw_rescale(); }); +#endif // BBS #if 0 @@ -2676,6 +2693,9 @@ void MainFrame::on_sys_color_changed() wxGetApp().plater()->sys_color_changed(); MonitorPanel::when_built([](MonitorPanel& monitor) { monitor.on_sys_color_changed(); }); CalibrationPanel::when_built([](CalibrationPanel& calibration) { calibration.on_sys_color_changed(); }); +#ifdef SLIC3R_CAD + DesignPanel::when_built([](DesignPanel& design) { design.on_sys_color_changed(); }); +#endif // update Tabs for (auto tab : wxGetApp().tabs_list) tab->sys_color_changed(); diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp index 798ddad274..13e546508c 100644 --- a/src/slic3r/GUI/MainFrame.hpp +++ b/src/slic3r/GUI/MainFrame.hpp @@ -499,6 +499,8 @@ public: // the tab that is shown: its own history when that is Design, the plater's otherwise. DesignPanel* shown_design_panel() const; #endif + // The top bar's Undo/Redo, for a tab that keeps its own history (Design). + void set_undo_redo_enabled(bool undo, bool redo); //BBS: GUI refactor LazyPage* m_monitor_page{ nullptr }; From 6a909462947adaa34850a2e0c8f2554e71d8119c Mon Sep 17 00:00:00 2001 From: SoftFever Date: Fri, 2 Oct 2026 01:11:04 +0800 Subject: [PATCH 163/389] Keep the sketch value field on top of the dimension labels Dimension labels drawn after the value field each lifted their own window to the front, so a label could print over the number being typed. --- src/slic3r/GUI/CAD/DesignSketchTool.cpp | 4 ++++ src/slic3r/GUI/CAD/SketchInlineEditor.cpp | 15 ++++++++++++--- src/slic3r/GUI/CAD/SketchInlineEditor.hpp | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 15a43b09b6..2102ba3d3b 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -8988,6 +8988,10 @@ void DesignSketchTool::render(GLCanvas3D& canvas) // not there — there is no window to fall back to any more. if (inline_editor != nullptr) inline_editor->render(*wxGetApp().imgui(), m_render_scale); + // ...and on top of the dimension labels, which are all drawn after it and each lift their + // own window to the front (draw_dim_label): without this a label prints across the number + // being typed. A guard, because the labels come from many of the exit paths below. + ScopeGuard field_on_top([this] { if (inline_editor != nullptr) inline_editor->bring_to_front(); }); if (render_overlays) render_overlays(); (void)canvas; diff --git a/src/slic3r/GUI/CAD/SketchInlineEditor.cpp b/src/slic3r/GUI/CAD/SketchInlineEditor.cpp index 75371759f9..d865102c0a 100644 --- a/src/slic3r/GUI/CAD/SketchInlineEditor.cpp +++ b/src/slic3r/GUI/CAD/SketchInlineEditor.cpp @@ -7,7 +7,7 @@ #include "libslic3r/Color.hpp" #include -#include // BringWindowToDisplayFront / GetCurrentWindow +#include // FindWindowByName / BringWindowToDisplayFront #include #include @@ -19,6 +19,8 @@ namespace GUI { namespace { +const char* const kWindowName = "##sketchvalue"; + // Numbers are typed and shown with a POINT, whatever the locale: this field feeds a CAD kernel, // and a decimal comma reaching it as a thousands separator is a silent order-of-magnitude error. // Parsing accepts either separator because a keyboard's numeric pad may only offer one. @@ -181,10 +183,9 @@ bool SketchInlineEditor::render(ImGuiWrapper& imgui, float scale) ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 3.0f); // NoInputs is what every other sketch overlay sets and is exactly what this one must not: // it is the only overlay in the tab that the user types into. - imgui.begin(std::string("##sketchvalue"), + imgui.begin(std::string(kWindowName), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings); - ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow()); if (!m_title.empty() || !m_err.empty()) { if (m_err.empty()) { @@ -243,4 +244,12 @@ bool SketchInlineEditor::render(ImGuiWrapper& imgui, float scale) return true; } +void SketchInlineEditor::bring_to_front() +{ + // Not gated on m_open: a commit closes the field after it was drawn, and that frame still + // shows it. A window that did not Begin this frame is not rendered, so lifting it is inert. + if (ImGuiWindow* w = ImGui::FindWindowByName(kWindowName)) + ImGui::BringWindowToDisplayFront(w); +} + }} // namespace Slic3r::GUI diff --git a/src/slic3r/GUI/CAD/SketchInlineEditor.hpp b/src/slic3r/GUI/CAD/SketchInlineEditor.hpp index a567d978be..677e74b3a0 100644 --- a/src/slic3r/GUI/CAD/SketchInlineEditor.hpp +++ b/src/slic3r/GUI/CAD/SketchInlineEditor.hpp @@ -57,6 +57,8 @@ public: // Draw it, and let ImGui do the editing. Called from DesignSketchTool::render() inside the // frame's ImGui pass; `scale` is the tool's m_render_scale. Returns true if it drew. bool render(ImGuiWrapper& imgui, float scale); + // Lift the field above every other overlay. Call it after the frame's last overlay is drawn. + void bring_to_front(); // Ask for another frame. THE FIELD DOES NOT WORK WITHOUT THIS, and the reason is a deadlock // that only a per-frame trace shows: From d57549159dda3cf727ec46f09d576c39cf4f458f Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 25 Sep 2026 01:54:17 -0500 Subject: [PATCH 164/389] 3MF loader: refuse non-finite vertex coordinates A 3MF vertex with a nan/inf coordinate was accepted by both parsers and crashed qhull in ModelVolume's convex hull while the file was still loading. Both vertex handlers refuse it, and volume generation checks again whichever parser produced the geometry. The main parser's _stop_object_xml_parser keeps a message a handler already set. --- src/libslic3r/Format/bbs_3mf.cpp | 43 +++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/src/libslic3r/Format/bbs_3mf.cpp b/src/libslic3r/Format/bbs_3mf.cpp index e2091da1db..366104bfa8 100644 --- a/src/libslic3r/Format/bbs_3mf.cpp +++ b/src/libslic3r/Format/bbs_3mf.cpp @@ -978,10 +978,10 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) void _stop_object_xml_parser(const std::string& msg = std::string()) { assert(! obj_parse_error); - assert(obj_parse_error_message.empty()); assert(object_xml_parser != nullptr); obj_parse_error = true; - obj_parse_error_message = msg; + if (! msg.empty() || obj_parse_error_message.empty()) // a handler may have set the message already + obj_parse_error_message = msg; XML_StopParser(object_xml_parser, false); } @@ -3815,11 +3815,18 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) { // appends the vertex coordinates // missing values are set equal to ZERO - if (m_curr_object) - m_curr_object->geometry.vertices.emplace_back( - m_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, X_ATTR), - m_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, Y_ATTR), - m_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, Z_ATTR)); + if (m_curr_object) { + const Vec3f v(m_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, X_ATTR), + m_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, Y_ATTR), + m_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, Z_ATTR)); + // A non-finite coordinate ("nan", "inf") used to be accepted and crashed + // qhull in ModelVolume's convex hull while the file was still loading. Refuse the file. + if (! v.allFinite()) { + _stop_xml_parser("Invalid vertex coordinate: not a finite number"); + return true; // the parser is stopped; returning false would overwrite the message + } + m_curr_object->geometry.vertices.emplace_back(v); + } return true; } @@ -5109,6 +5116,11 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) } } + for (const Vec3f &v : sub_object->geometry.vertices) + if (! v.allFinite()) { // Qhull cannot take a NaN vertex + add_error("invalid (non-finite) vertex in object " + std::to_string(sub_object->id)); + return false; + } its.vertices.assign(sub_object->geometry.vertices.begin(), sub_object->geometry.vertices.end()); // BBS @@ -5600,11 +5612,18 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) { // appends the vertex coordinates // missing values are set equal to ZERO - if (current_object) - current_object->geometry.vertices.emplace_back( - object_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, X_ATTR), - object_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, Y_ATTR), - object_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, Z_ATTR)); + if (current_object) { + const Vec3f v(object_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, X_ATTR), + object_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, Y_ATTR), + object_unit_factor * bbs_get_attribute_value_float(attributes, num_attributes, Z_ATTR)); + // See _BBS_3MF_Importer::_handle_start_vertex: a non-finite coordinate + // crashed qhull while the file loaded. The dispatcher stops this parser on `false`. + if (! v.allFinite()) { + obj_parse_error_message = "Invalid vertex coordinate: not a finite number"; + return false; + } + current_object->geometry.vertices.emplace_back(v); + } return true; } From 6be7911e40564290e0c6a62617f95776a4c6dfd6 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 25 Sep 2026 01:54:17 -0500 Subject: [PATCH 165/389] CLI: survive a project with missing printable_height or fewer filaments than loaded Found by fuzzing the headless slicer: - A BBS-style 3MF without Metadata/project_settings.config segfaulted the CLI silently on the missing printable_height option. - A project saved with fewer filaments (or filament groups) than --load-filaments overran the filament variant tables (segfault in the variant match) and then hit an uncaught ConfigurationError from set_with_restore_2 (std::terminate). The tables are regenerated for the filaments the project did not know about, the destination vectors grown first (only from a non-empty source), the match bounded, and a failure becomes a CLI config error. --- src/OrcaSlicer.cpp | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp index 15c5677485..1abd1627d8 100644 --- a/src/OrcaSlicer.cpp +++ b/src/OrcaSlicer.cpp @@ -1809,7 +1809,10 @@ int CLI::run(int argc, char **argv) old_printable_width = static_cast(old_printable_bbox.size().x()); old_printable_depth = static_cast(old_printable_bbox.size().y()); } - old_printable_height = (int)(config.opt_float("printable_height")); + // A BBS-style 3mf without Metadata/project_settings.config has no + // printable_height (found by fuzzing: this was a silent segfault). + if (const auto *ph = config.option("printable_height")) + old_printable_height = (int) ph->value; if (config.option("extruder_clearance_height_to_rod")) old_height_to_rod = config.opt_float("extruder_clearance_height_to_rod"); @@ -3341,9 +3344,14 @@ int CLI::run(int argc, char **argv) max_self_index = std::max(max_self_index, v); min_self_index = std::min(min_self_index, v); } - if (max_self_index > filament_count || min_self_index < 1) { - BOOST_LOG_TRIVIAL(warning) << boost::format("filament_self_index range [%1%, %2%] is invalid for filament_count %3%, regenerating") - % min_self_index % max_self_index % filament_count; + // And a project saved with FEWER filaments than are now loaded (a + // one-filament project sliced with two --load-filaments) leaves the tables half filled: + // the variant matching below then reads past filament_extruder_variant and + // set_with_restore_2 throws an uncaught size error. Regenerate in that case too. + if (max_self_index > filament_count || min_self_index < 1 || max_self_index < filament_count + || (int) filament_self_index_opt->values.size() < filament_count) { + BOOST_LOG_TRIVIAL(warning) << boost::format("filament_self_index range [%1%, %2%] (size %4%) is invalid for filament_count %3%, regenerating") + % min_self_index % max_self_index % filament_count % filament_self_index_opt->values.size(); need_regenerate_self_index = true; } } @@ -3424,6 +3432,10 @@ int CLI::run(int argc, char **argv) std::vector& filament_variants = curr_variant_opt->values; filament_variants.resize(filament_count, get_extruder_variant_string(etDirectDrive, nvtStandard)); } + // See the filament_self_index note above: one variant per filament for + // the filaments the project did not know about. + if ((int) curr_variant_opt->values.size() < filament_count) + curr_variant_opt->values.resize(filament_count, get_extruder_variant_string(etDirectDrive, nvtStandard)); const ConfigOptionStrings *new_variant_opt = dynamic_cast(config.option("filament_extruder_variant", true)); std::vector new_variant_indice; @@ -3432,7 +3444,7 @@ int CLI::run(int argc, char **argv) for (int i = 0; i < new_variant_count; i++) { - for (int j = old_start_indice[filament_index - 1]; j < old_start_indice[filament_index - 1] + old_variant_count; j++) + for (int j = old_start_indice[filament_index - 1]; j < old_start_indice[filament_index - 1] + old_variant_count && j < (int) curr_variant_opt->values.size(); j++) { if (curr_variant_opt->values[j] == new_variant_opt->values[i]) { new_variant_indice[i] = j; @@ -3484,7 +3496,18 @@ int CLI::run(int argc, char **argv) ConfigOptionVectorBase* opt_vec_dst = static_cast(opt); const ConfigOptionVectorBase* opt_vec_src = static_cast(source_opt); //set with index - opt_vec_dst->set_with_restore_2(opt_vec_src, new_variant_indice, old_start_indice[filament_index - 1], old_variant_count); + try { + // A project with fewer filaments than are loaded: grow the + // destination to the filament's slot first (set_with_restore_2 only restores). + if (opt_vec_src->size() > 0 && opt_vec_dst->size() < size_t(old_start_indice[filament_index - 1] + old_variant_count)) + opt_vec_dst->resize(size_t(old_start_indice[filament_index - 1] + old_variant_count), opt_vec_src); + opt_vec_dst->set_with_restore_2(opt_vec_src, new_variant_indice, old_start_indice[filament_index - 1], old_variant_count); + } catch (const std::exception &ex) { // Was an uncaught abort + BOOST_LOG_TRIVIAL(error) << boost::format("filament %1%: option %2% could not be applied: %3%") % filament_index % opt_key % ex.what(); + boost::nowide::cerr << "filament " << filament_index << ": option " << opt_key << " could not be applied: " << ex.what() << std::endl; + record_exit_reson(outfile_dir, CLI_CONFIG_FILE_ERROR, 0, cli_errors[CLI_CONFIG_FILE_ERROR], sliced_info); + flush_and_exit(CLI_CONFIG_FILE_ERROR); + } } continue; @@ -3530,7 +3553,16 @@ int CLI::run(int argc, char **argv) if (filament_options_with_variant.find(opt_key) != filament_options_with_variant.end()) { std::vector temp_variant_indice; temp_variant_indice.resize(new_variant_count, -1); - opt_vec_dst->set_with_restore_2(opt_vec_src, temp_variant_indice, old_start_indice[filament_index - 1], old_variant_count, true); + try { + if (opt_vec_src->size() > 0 && opt_vec_dst->size() < size_t(old_start_indice[filament_index - 1] + old_variant_count)) // See above + opt_vec_dst->resize(size_t(old_start_indice[filament_index - 1] + old_variant_count), opt_vec_src); + opt_vec_dst->set_with_restore_2(opt_vec_src, temp_variant_indice, old_start_indice[filament_index - 1], old_variant_count, true); + } catch (const std::exception &ex) { // Was an uncaught abort + BOOST_LOG_TRIVIAL(error) << boost::format("filament %1%: option %2% could not be applied: %3%") % filament_index % opt_key % ex.what(); + boost::nowide::cerr << "filament " << filament_index << ": option " << opt_key << " could not be applied: " << ex.what() << std::endl; + record_exit_reson(outfile_dir, CLI_CONFIG_FILE_ERROR, 0, cli_errors[CLI_CONFIG_FILE_ERROR], sliced_info); + flush_and_exit(CLI_CONFIG_FILE_ERROR); + } if (opt_key == "filament_extruder_variant") new_variant_counts[filament_index - 1] = opt_vec_src->size(); From 6a6ceb2612211321711984ba6e57e9131a7823c3 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 24 Sep 2026 23:39:13 -0500 Subject: [PATCH 166/389] G-code: key the island tour cache on the island layout, never index past the islands The per-filament island tour was cached by island centroids only. A later layer with the same centroids but fewer islands (thin walls, negative volumes) reused the stale visit list, whose catch-all index pointed past the layer's islands, and extrude_perimeters read freed memory (three fuzz crashes, planar and belt). The per-instance island layout is part of the cache key and the use site never indexes past the islands. --- src/libslic3r/GCode.cpp | 21 +++++++++++++++------ src/libslic3r/GCode.hpp | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index fae8860b7b..75b14e06bc 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -6491,6 +6491,7 @@ LayerResult GCode::process_layer( std::vector &objects_by_extruder = objects_by_extruder_it->second; std::vector &instances = filament_plan.first; std::vector nodes; + std::vector> layout; // Per instance, see IslandOrderCacheEntry std::vector node_instances; auto quantize_to_mm = [](const Point &pt) -> Point { const coord_t grid = coord_t(scale_(1.)); @@ -6515,6 +6516,7 @@ LayerResult GCode::process_layer( const size_t instance_idx = instances.size(); instances.emplace_back(object_by_extruder, layer_id, *print_object, instance_id, print_object->instances()[instance_id].model_instance->get_labeled_id()); + layout.emplace_back(islands.size(), ! islands.empty() && ! islands.back().by_region.empty()); const Point &shift = print_object->instances()[instance_id].shift; const size_t first_node = nodes.size(); if (islands_chainable) @@ -6534,8 +6536,9 @@ LayerResult GCode::process_layer( // Reuse the cached tour while this filament's island layout is unchanged. auto &cache_entry = m_ordering_cache[filament_id]; - if (!(cache_entry.first == nodes)) { - cache_entry.first = nodes; + if (! (cache_entry.nodes == nodes && cache_entry.layout == layout)) { + cache_entry.nodes = nodes; + cache_entry.layout = layout; Points node_points; node_points.reserve(nodes.size()); for (const IslandOrderNode &node : nodes) @@ -6568,12 +6571,12 @@ LayerResult GCode::process_layer( // A visit without explicit islands already prints everything. continue; std::vector &islands = instances[i].object_by_extruder.islands; - if (!islands.back().by_region.empty()) + if (! islands.empty() && ! islands.back().by_region.empty()) last_visit.islands.emplace_back(islands.size() - 1); } - cache_entry.second = std::move(visits); + cache_entry.visits = std::move(visits); } - filament_plan.second = cache_entry.second; + filament_plan.second = cache_entry.visits; } } @@ -6896,7 +6899,13 @@ LayerResult GCode::process_layer( // in this instance's frame after set_origin() above). Empty islands are skipped; // the trailing catch-all island has no centroid to chain by and always goes last. std::vector &islands = instance_to_print.object_by_extruder.islands; - std::vector island_order = visit.islands; + std::vector island_order; + island_order.reserve(visit.islands.size()); + for (size_t idx : visit.islands) // Never index past the islands (see IslandOrderCacheEntry) + if (idx < islands.size()) + island_order.emplace_back(idx); + else + BOOST_LOG_TRIVIAL(error) << "island tour refers to island " << idx << " of " << islands.size() << ", skipped"; if (island_order.empty()) { island_order.reserve(islands.size()); if (layer_to_print.object_layer != nullptr && islands.size() == layer_to_print.object_layer->lslices.size() + 1) { diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index e62d9cee41..5d99c219c6 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -632,9 +632,21 @@ protected: }; // Cache the per-filament island tour to avoid recomputing while the layer's island layout is - // unchanged. Key: filament_id. Value: {nodes the tour was computed from, resulting visits}. - std::map, std::vector>> - m_ordering_cache; + // unchanged. Key: filament_id. Value: the nodes the tour was computed from, the per-instance + // island layout (count and whether the trailing catch-all island has anything to print), and + // the resulting visits. + // The layout is part of the key. Nodes only cover the chainable islands, so two + // layers with the same centroids but a different number of islands (thin walls, negative + // volumes come and go) matched the cache and the visit's catch-all index -- islands.size() - 1 + // of the OLD layer -- ran past the new layer's islands (found by fuzzing: segfault in + // extrude_perimeters on multi-part objects). + struct IslandOrderCacheEntry + { + std::vector nodes; + std::vector> layout; + std::vector visits; + }; + std::map m_ordering_cache; ExtrusionQualityEstimator m_extrusion_quality_estimator; From 2ae41bb0efe1bd2c421987f32270cac5dc7df238 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 24 Sep 2026 23:39:13 -0500 Subject: [PATCH 167/389] Painting: guard the top/bottom projection erase when no shell layers are requested With top_shell_layers = 0 the `top` vector is never filled and erasing its begin() was undefined (found by fuzzing on a painted object dropped below the plate). --- src/libslic3r/MultiMaterialSegmentation.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/MultiMaterialSegmentation.cpp b/src/libslic3r/MultiMaterialSegmentation.cpp index 0016d96ac2..67b431790e 100644 --- a/src/libslic3r/MultiMaterialSegmentation.cpp +++ b/src/libslic3r/MultiMaterialSegmentation.cpp @@ -1244,10 +1244,16 @@ static inline std::vector> segmentation_top_and_bottom_l slicing_params.trafo = volume_trafo; Polygons bottom_slice = slice_mesh(painted, zs[0], slicing_params); - top.erase(top.begin()); - bottom.erase(bottom.begin()); - - bottom[0] = union_(bottom[0], bottom_slice); + // Only the requested projections exist: with + // top_shell_layers = 0 `top` is empty and erasing its begin() was + // undefined (found by fuzzing: a sunk, painted object crashed here). + if (! top.empty()) + top.erase(top.begin()); + if (! bottom.empty()) { + bottom.erase(bottom.begin()); + if (! bottom.empty()) + bottom[0] = union_(bottom[0], bottom_slice); + } } else slice_mesh_slabs(painted, zs, volume_trafo, max_top_layers > 0 ? &top : nullptr, max_bottom_layers > 0 ? &bottom : nullptr, nullptr, throw_on_cancel_callback); auto merge = [](std::vector &&src, std::vector &dst) { From e8926efbe33430680ce1d33c511c8029720036ef Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 24 Sep 2026 19:42:44 -0500 Subject: [PATCH 168/389] Belt purge: detect filament changes by scanning the ordering, not the first layer's flag ToolOrdering::has_wipe_tower() reads the first layer's flag. On a belt the first layer may be a brim apron band, which carries neither object nor support and never gets the flag, so with a brim the purge plan returned early and nothing was purged. Scan the layers for a change. --- src/libslic3r/BeltPurge.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp index 37d89ca14e..bba338b878 100644 --- a/src/libslic3r/BeltPurge.cpp +++ b/src/libslic3r/BeltPurge.cpp @@ -165,9 +165,18 @@ void Print::_plan_belt_purge() if (m_wipe_tower_data.tool_ordering.empty() || m_wipe_tower_data.tool_ordering.last_extruder() == unsigned(-1)) throw Slic3r::SlicingError("The print is empty. The model is not printable with current print settings."); - if (!m_wipe_tower_data.tool_ordering.has_wipe_tower()) - // No toolchanges anywhere, nothing to purge. - return; + // Is there any filament change at all? Not ToolOrdering::has_wipe_tower(): that reads the + // FIRST layer's flag, and on a belt the first layer may be a brim apron band, which carries + // neither object nor support and so never gets the flag even when the print changes filament. + { + bool any_change = false; + unsigned int cur = m_wipe_tower_data.tool_ordering.first_extruder(); + for (const auto < : m_wipe_tower_data.tool_ordering.layer_tools()) + for (const unsigned int e : lt.extruders) + if (e != cur) { any_change = true; cur = e; } + if (! any_change) + return; + } this->throw_if_canceled(); From d755580c994a41fe2f40ecf360182a9a2a3750bb Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 24 Sep 2026 19:39:01 -0500 Subject: [PATCH 169/389] Belt brim: the purge prism never gets a brim, whatever its config says The prism's generator already sets no_brim; PrintObject::has_belt_brim() now also ignores any brim setting on the prism (belt_purge_tower_object), so a brim on the parts beside it never blocks purging. --- src/libslic3r/PrintObject.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 81b8a58d6b..58ce53df5a 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1209,6 +1209,10 @@ bool PrintObject::has_belt_brim() const { if (! m_print->has_tilted_belt()) return false; + // The purge prism is sacrificial and sits at the plate's edge; its generator sets no_brim, and + // this keeps it brimless whatever its config says, so a brim on the parts never blocks purging. + if (m_config.belt_purge_tower_object.value) + return false; if (! this->belt_brim_instances_compatible()) return false; if (m_config.brim_type == btNoBrim) From b8a8e38ceb5898191db2d61fdb4e89e878635fd2 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 25 Sep 2026 01:54:17 -0500 Subject: [PATCH 170/389] G-code: no crossing-perimeter avoidance while travelling on a brim apron layer Crossing-perimeter avoidance dereferenced the (null) layer while travelling on a brim apron layer. --- src/libslic3r/GCode.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 75b14e06bc..9947e40b8d 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -9427,6 +9427,7 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string // multi-hop travel path inside the configuration space if (m_config.reduce_crossing_wall && !m_avoid_crossing_perimeters.disabled_once() + && m_layer != nullptr // A brim apron layer has no Layer to avoid crossing && m_writer->is_current_position_clear()) //BBS: don't generate detour travel paths when current position is unclea { From f219431935cf95c499cf3bdda1b1e7a40d83c913 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Thu, 24 Sep 2026 07:39:43 -0500 Subject: [PATCH 171/389] GUI: the plate is open along Y for containment tests on an infinite-Y belt printer PartPlate's containment tests treat the plate as open along Y on a belt printer with belt_printer_infinite_y, so a long part is no longer flagged outside the plate in Prepare while the slicer and the G-code checks accept it. The check reads the printer preset through the app object, which does not exist headlessly, so it is guarded on the plater. --- src/slic3r/GUI/PartPlate.cpp | 16 ++++++++++++++++ src/slic3r/GUI/PartPlate.hpp | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 893260f934..12f4e423e5 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -2783,6 +2783,7 @@ bool PartPlate::check_outside(int obj_id, int instance_id, BoundingBoxf3* boundi BoundingBoxf3 instance_box = bounding_box? *bounding_box: object->instance_convex_hull_bounding_box(instance_id); Polygon hull = instance->convex_hull_2d(); BoundingBoxf3 plate_box = get_plate_box(); + this->open_belt_y(plate_box); if (instance_box.max.z() > plate_box.min.z()) plate_box.min.z() += instance_box.min.z(); // not considering outsize if sinking @@ -3467,6 +3468,19 @@ Polygon PartPlate::get_shared_printable_polygon() const return m_extruder_areas.empty() ? Polygon::new_scale(m_shape) : get_shared_poly(m_extruder_areas); } + +bool PartPlate::belt_open_y() const +{ + // Headless (CLI) plates have no plater and no wxApp behind wxGetApp(); the CLI's own belt + // handling lives in Print::validate(). + if (m_plater == nullptr || wxGetApp().preset_bundle == nullptr) + return false; + const DynamicPrintConfig &printer = wxGetApp().preset_bundle->printers.get_edited_preset().config; + const auto *belt = printer.option("belt_printer"); + const auto *infinite_y = printer.option("belt_printer_infinite_y"); + return belt != nullptr && belt->value && infinite_y != nullptr && infinite_y->value; +} + bool PartPlate::contains(const Vec3d& point) const { return m_bounding_box.contains(point); @@ -3486,6 +3500,7 @@ bool PartPlate::contains(const BoundingBoxf3& bb) const print_volume.min(1) -= Slic3r::BuildVolume::BedEpsilon; print_volume.max(0) += Slic3r::BuildVolume::BedEpsilon; print_volume.max(1) += Slic3r::BuildVolume::BedEpsilon; + this->open_belt_y(print_volume); return print_volume.contains(bb); } @@ -3498,6 +3513,7 @@ bool PartPlate::intersects(const BoundingBoxf3& bb) const print_volume.min(1) -= Slic3r::BuildVolume::BedEpsilon; print_volume.max(0) += Slic3r::BuildVolume::BedEpsilon; print_volume.max(1) += Slic3r::BuildVolume::BedEpsilon; + this->open_belt_y(print_volume); return print_volume.intersects(bb); } diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index e913ebaabf..babc88f364 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -427,6 +427,10 @@ public: bool contains(const GLVolume& v) const; bool contains(const BoundingBoxf3& bb) const; bool intersects(const BoundingBoxf3& bb) const; + // A belt printer with belt_printer_infinite_y: the plate is open along Y for the + // containment tests (the drawn plate keeps its shape). + bool belt_open_y() const; + void open_belt_y(BoundingBoxf3 &box) const { if (this->belt_open_y()) { box.min.y() = -1e5; box.max.y() = 1e5; } } void render(const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom, bool only_body = false, bool force_background_color = false, HeightLimitMode mode = HEIGHT_LIMIT_NONE, int hover_id = -1, bool render_cali = false, bool show_grid = true); From 33fc99785a45184d794014bd38ad920d4c46c299 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:02:57 -0500 Subject: [PATCH 172/389] Belt profiles: print without a z-hop by default On a belt printer a lift is a move along the belt axis (0.4 mm / sin 45 = 0.57 mm of belt travel out and back on every hop), not a lift away from the part. The three belt printer bases now ship z_hop 0, the IR3 V2 leaf no longer restates 0.4, and the BabyBelt Pro and IR3 V2 filaments stop overriding the printer with filament_z_hop 0.4. The option stays editable. --- resources/profiles/Custom.json | 2 +- resources/profiles/Custom/machine/fdm_belt_common.json | 2 +- resources/profiles/IdeaFormer.json | 2 +- .../IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json | 3 --- .../IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json | 3 --- .../IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json | 3 --- resources/profiles/IdeaFormer/machine/fdm_belt_common.json | 2 +- resources/profiles/Printcepts.json | 2 +- .../Printcepts/filament/Generic PETG @BabyBelt Pro.json | 3 --- .../Printcepts/filament/Generic PLA @BabyBelt Pro.json | 3 --- resources/profiles/Printcepts/machine/fdm_belt_common.json | 2 +- 11 files changed, 6 insertions(+), 21 deletions(-) diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index 365fed4b5b..4093fcedf4 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,6 +1,6 @@ { "name": "Custom Printer", - "version": "02.04.00.05", + "version": "02.04.00.06", "force_update": "0", "description": "My configurations", "machine_model_list": [ diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index 86245e7377..3c45b05515 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -77,7 +77,7 @@ "1" ], "z_hop": [ - "0.4" + "0" ], "z_hop_types": [ "Normal Lift" diff --git a/resources/profiles/IdeaFormer.json b/resources/profiles/IdeaFormer.json index 4a8519353b..f9f32d2f3f 100644 --- a/resources/profiles/IdeaFormer.json +++ b/resources/profiles/IdeaFormer.json @@ -1,6 +1,6 @@ { "name": "IdeaFormer", - "version": "02.00.00.03", + "version": "02.00.00.04", "force_update": "0", "description": "IdeaFormer belt printer configurations", "machine_model_list": [ diff --git a/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json index 22ec0737d7..709d0e9897 100644 --- a/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json @@ -104,9 +104,6 @@ "filament_deretraction_speed": [ "40" ], - "filament_z_hop": [ - "0.4" - ], "filament_start_gcode": [ "; Generic PETG @IdeaFormer IR3 V2 — belt PETG, bed 80C" ] diff --git a/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json index 74c2011bca..10a8ed97f9 100644 --- a/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json @@ -104,9 +104,6 @@ "filament_deretraction_speed": [ "30" ], - "filament_z_hop": [ - "0.4" - ], "filament_start_gcode": [ "; Generic PLA @IdeaFormer IR3 V2 — belt PLA, bed 75C" ] diff --git a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json index 5f477ef0bb..ce02ce82d1 100644 --- a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json +++ b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json @@ -81,9 +81,6 @@ "deretraction_speed": [ "40" ], - "z_hop": [ - "0.4" - ], "retract_lift_below": [ "300" ], diff --git a/resources/profiles/IdeaFormer/machine/fdm_belt_common.json b/resources/profiles/IdeaFormer/machine/fdm_belt_common.json index 25daeb34a7..60ef096de0 100644 --- a/resources/profiles/IdeaFormer/machine/fdm_belt_common.json +++ b/resources/profiles/IdeaFormer/machine/fdm_belt_common.json @@ -77,7 +77,7 @@ "1" ], "z_hop": [ - "0.4" + "0" ], "z_hop_types": [ "Normal Lift" diff --git a/resources/profiles/Printcepts.json b/resources/profiles/Printcepts.json index 61d418b8ab..1abe84873b 100644 --- a/resources/profiles/Printcepts.json +++ b/resources/profiles/Printcepts.json @@ -1,6 +1,6 @@ { "name": "Printcepts", - "version": "01.00.00.01", + "version": "01.00.00.02", "force_update": "0", "description": "Printcepts belt printer configurations", "machine_model_list": [ diff --git a/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json index 939edbf233..5bfd8e7f2d 100644 --- a/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json +++ b/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json @@ -104,9 +104,6 @@ "filament_deretraction_speed": [ "40" ], - "filament_z_hop": [ - "0.4" - ], "filament_start_gcode": [ "; Generic PETG @BabyBelt Pro — belt PETG, bed 80C" ] diff --git a/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json index aa11e4c598..4637f21273 100644 --- a/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json +++ b/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json @@ -104,9 +104,6 @@ "filament_deretraction_speed": [ "30" ], - "filament_z_hop": [ - "0.4" - ], "filament_start_gcode": [ "; Generic PLA @BabyBelt Pro — belt PLA, bed 75C" ] diff --git a/resources/profiles/Printcepts/machine/fdm_belt_common.json b/resources/profiles/Printcepts/machine/fdm_belt_common.json index fe3a58272e..2a392b4f60 100644 --- a/resources/profiles/Printcepts/machine/fdm_belt_common.json +++ b/resources/profiles/Printcepts/machine/fdm_belt_common.json @@ -77,7 +77,7 @@ "1" ], "z_hop": [ - "0.4" + "0" ], "z_hop_types": [ "Normal Lift" From 93fc4b31e9ac8da98575114304dc8e43dbeb1b4d Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:02:58 -0500 Subject: [PATCH 173/389] Belt: show the axis remap options in Develop mode only preslice_remap_*, preslice_remap_global and gcode_remap_* describe the printer's kinematics and are set once by its profile. A wrong value sends the gantry outside the machine (a user preset with the pre-slice remap in place of the G-code remap emitted gantry moves to Y=646 mm), so they are no longer offered in Expert mode. --- src/libslic3r/PrintConfig.cpp | 14 +++++++------- src/slic3r/GUI/Tab.cpp | 6 ++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index a6a419a15e..cc17d0fdec 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -7281,19 +7281,19 @@ void PrintConfigDef::init_fff_params() "your belt printer's physical bed plane. For a printer whose bed is in the XZ plane, " "set Y to +Z and Z to +Y (or -Y) to swap the vertical and belt-travel axes. " "Default +X: no change.", - RemapAxis::PosX, comExpert); + RemapAxis::PosX, comDevelop); add_belt_remap("preslice_remap_y", "Y", "Before slicing, which model-space axis becomes the slicer's Y axis. " "The slicer treats Y as one of the two horizontal bed axes. If your physical " "belt surface runs along the Z axis, map Y to +Z here so the slicer slices " "along the correct plane. Default +Y: no change.", - RemapAxis::PosY, comExpert); + RemapAxis::PosY, comDevelop); add_belt_remap("preslice_remap_z", "Z", "Before slicing, which model-space axis becomes the slicer's Z axis (layer stacking direction). " "The slicer builds layers upward along this axis. If your printer's layer-stacking " "direction is the physical Y axis, map Z to +Y (or -Y for inverted direction). " "Rev mode mirrors relative to the build volume maximum. Default +Z: no change.", - RemapAxis::PosZ, comExpert); + RemapAxis::PosZ, comDevelop); def = this->add("preslice_remap_global", coBool); def->label = L("Global"); @@ -7302,12 +7302,12 @@ void PrintConfigDef::init_fff_params() "Without this, the remap is applied locally around each object's center, so " "objects at different positions don't get a position-dependent contribution. " "Mirrors the 'Global' option on the belt slicing rotation, but for the remap."); - def->mode = comExpert; + def->mode = comDevelop; def->set_default_value(new ConfigOptionBool(false)); - add_belt_remap("gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosX, comExpert); - add_belt_remap("gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosY, comExpert); - add_belt_remap("gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosZ, comExpert); + add_belt_remap("gcode_remap_x", "X", "Which slicing axis maps to machine X in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosX, comDevelop); + add_belt_remap("gcode_remap_y", "Y", "Which slicing axis maps to machine Y in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosY, comDevelop); + add_belt_remap("gcode_remap_z", "Z", "Which slicing axis maps to machine Z in G-code output. Applied AFTER slicing, during G-code generation.", RemapAxis::PosZ, comDevelop); // The machine-frame G-code transform (shear + scale) is no longer configured // by per-axis keys: it is derived from the belt tilt (belt_slice_rotation axis diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 9905a203ba..b7c9264381 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -6214,8 +6214,10 @@ void TabPrinter::toggle_options() toggle_line("belt_slice_rotation", is_belt); // Remap, back-transform, and global mesh-transforms toggles are gated by belt - // mode here; finer mode-based visibility (Advanced vs Expert) is handled by - // each option's ConfigOptionMode in PrintConfig.cpp. + // mode here; finer mode-based visibility is handled by each option's + // ConfigOptionMode in PrintConfig.cpp. Both axis remaps are Develop-only: a + // printer profile sets them once for its kinematics, and a wrong value sends + // the gantry outside the machine. for (auto el : {"preslice_remap_x", "gcode_remap_x", "gcode_back_transform"}) toggle_line(el, is_belt); toggle_line("belt_preslice_global", is_belt); From 3776739cb5f8f048d136c97d5df3692e86b0186f Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:02:58 -0500 Subject: [PATCH 174/389] docs: drop the private build notification note The build-notify workflow is a local tool of one contributor and does not belong in the shared agent instructions. --- AGENTS.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ed0ec8121b..4be195b40d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,11 +15,6 @@ cmake --build build --config RelWithDebInfo --target all -- cmake --build . --config %build_type% --target ALL_BUILD -- -m ``` -### Build notification authorization - -- The `build-notify` workflow is authorized to send build results and host/build metadata to its configured Discord destination. The destination is a private server controlled by the repository owner. -- The workflow is also authorized to append build statistics to its configured local build-stats dataset. - ## Testing Catch2 framework. Tests in `tests/`; see [tests/AGENTS.md](tests/AGENTS.md) for where a new test belongs and the conventions to follow. From 97034b22f6af927d2b665635ca376c6fc400197f Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:04:33 -0500 Subject: [PATCH 175/389] Belt: remove the tagged diagnostic logging Drops the [BELT-DEBUG], [BELTRACE], [BELT-CALIB] and [BELT-PREVIEW] log lines, the SLIC3R_BELT_DIAGNOSTIC_LOG blocks, and the counters and temporaries that existed only to feed them. Six of the purge tower lines logged at warning level, which is Orca's default, on every plan. Raised in Hanif Koh's review of #14394. --- src/libslic3r/BeltPurge.cpp | 44 +-------------- src/libslic3r/BeltSliceStrategy.cpp | 80 +-------------------------- src/libslic3r/PrintObject.cpp | 13 +---- src/libslic3r/PrintObjectSlice.cpp | 66 +--------------------- src/libslic3r/Support/TreeSupport.cpp | 2 - src/slic3r/GUI/BeltPurgeTower.cpp | 19 ------- src/slic3r/GUI/GCodeViewer.cpp | 2 - src/slic3r/GUI/Plater.cpp | 14 ----- 8 files changed, 5 insertions(+), 235 deletions(-) diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp index bba338b878..cff3de8846 100644 --- a/src/libslic3r/BeltPurge.cpp +++ b/src/libslic3r/BeltPurge.cpp @@ -128,10 +128,6 @@ void Print::_align_belt_purge_layers() delta += h; po->belt_shift_layer_grid(delta); // no-op for the reference object (delta ~ 0) } - - BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] purge grid align: snapped " << m_objects.size() - << " objects onto ref grid offset=" << ref_offset - << " (ref=" << ref->model_object()->name << ")"; } // Belt mode replacement for _make_wipe_tower(): plan filament-change purging @@ -246,21 +242,11 @@ void Print::_plan_belt_purge() } } - // Diagnostic: the prism only absorbs purge at toolchange layers whose - // print_z coincides with one of its own layers. Compare the prism's layer - // print_z range to the toolchange print_z range and count how many - // toolchange layers actually land on a prism layer. This distinguishes a - // range/grid-alignment failure (no coverage) from a capacity shortfall - // (covered but not enough cross-section). + // The prism only absorbs purge at toolchange layers whose print_z coincides + // with one of its own layers. PrintObject *prism_po = nullptr; for (PrintObject *po : m_objects) if (po->config().belt_purge_tower_object.value && !po->layers().empty()) { prism_po = po; break; } - const PrintObject *diag_prism = prism_po; - if (diag_prism != nullptr) - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge prism layer range print_z=[" - << diag_prism->layers().front()->print_z << ", " << diag_prism->layers().back()->print_z - << "] nlayers=" << diag_prism->layers().size(); - int tc_layers = 0, tc_layers_covered = 0; float total_leftover = 0.f; float worst_layer_leftover = 0.f; @@ -269,26 +255,14 @@ void Print::_plan_belt_purge() unsigned int current_extruder_id = m_wipe_tower_data.tool_ordering.first_extruder(); for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { float layer_leftover = 0.f; - bool layer_has_tc = false; for (const unsigned int extruder_id : layer_tools.extruders) { if (extruder_id == current_extruder_id) continue; - if (!layer_has_tc) { - layer_has_tc = true; - ++tc_layers; - if (diag_prism != nullptr && diag_prism->get_layer_at_printz(layer_tools.print_z, EPSILON) != nullptr) - ++tc_layers_covered; - } float volume_to_wipe = use_flush_matrix ? wipe_volumes[current_extruder_id][extruder_id] * flush_multiplier : (float) m_config.prime_volume; float leftover = layer_tools.wiping_extrusions().mark_wiping_extrusions(*this, current_extruder_id, extruder_id, volume_to_wipe); - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] purge toolchange print_z=" << layer_tools.print_z - << " filament " << current_extruder_id << "->" << extruder_id - << " requested=" << volume_to_wipe - << " absorbed=" << volume_to_wipe - leftover - << " leftover=" << leftover; layer_leftover += leftover; current_extruder_id = extruder_id; } @@ -323,11 +297,6 @@ void Print::_plan_belt_purge() this->throw_if_canceled(); } - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge coverage: " << tc_layers_covered << "/" << tc_layers - << " toolchange layers land on a prism layer" - << (tc_layers > 0 && tc_layers_covered == 0 ? " (RANGE/GRID MISALIGNMENT — prism absorbs nothing)" : - tc_layers_covered < tc_layers ? " (partial coverage)" : " (full coverage)"); - if (total_leftover > 1.f) { this->active_step_add_warning( PrintStateBase::WarningLevel::CRITICAL, @@ -336,8 +305,6 @@ void Print::_plan_belt_purge() "Increase the belt purge tower width, or reduce flushing volumes."), int(std::ceil(total_leftover)), int(std::ceil(worst_layer_leftover)), Slic3r::float_to_string_decimal_point(worst_layer_z, 2))); - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge planning leftover total=" << total_leftover - << " worst_layer=" << worst_layer_leftover << " at print_z=" << worst_layer_z; } } @@ -356,10 +323,6 @@ void PrintObject::belt_shift_layer_grid(double delta) for (SupportLayer *layer : m_support_layers) layer->print_z += delta; m_slicing_params.belt_floor_z_shift += delta; - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] belt_shift_layer_grid" - << " obj=" << this->model_object()->name - << " delta=" << delta - << " first_layer.print_z=" << (m_layers.empty() ? 0. : m_layers.front()->print_z); } // Belt mode: drop layers strictly above z (used to cancel the purge prism early @@ -382,9 +345,6 @@ size_t PrintObject::belt_truncate_layers_above(coordf_t z) m_layers.resize(keep); if (!m_layers.empty()) m_layers.back()->upper_layer = nullptr; - BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] truncate purge prism above print_z=" << z - << " kept=" << keep << " removed=" << removed - << " new_top=" << (m_layers.empty() ? 0. : m_layers.back()->print_z); return removed; } diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp index cdb6ba428f..d16819e7db 100644 --- a/src/libslic3r/BeltSliceStrategy.cpp +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -3,13 +3,6 @@ #include -#include -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG -#include -#include -#include -#endif - namespace Slic3r { void BeltSliceStrategy::apply_preslice_transforms(Transform3d &trafo, @@ -45,79 +38,18 @@ void BeltSliceStrategy::apply_preslice_transforms(Transform3d &trafo, // each volume within the object) would compute min_z against mesh-local vertex // coordinates rather than object-space coordinates, so volumes translated along // the slicer's Z axis would be silently excluded from the bound check. -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - // Capture the incoming trafo for diagnostic logging. - // This is the slicer-frame transform AFTER remap + rotation but BEFORE z_shift. - const Transform3d trafo_pre_shift = trafo; - auto log_mat = [](const Matrix3d &m) { - std::ostringstream ss; - ss << std::fixed << std::setprecision(4); - ss << "[[" << m(0,0) << "," << m(0,1) << "," << m(0,2) << "]," - << "[" << m(1,0) << "," << m(1,1) << "," << m(1,2) << "]," - << "[" << m(2,0) << "," << m(2,1) << "," << m(2,2) << "]]"; - return ss.str(); - }; - auto log_vec3 = [](const Vec3d &v) { - std::ostringstream ss; - ss << std::fixed << std::setprecision(4); - ss << "(" << v.x() << "," << v.y() << "," << v.z() << ")"; - return ss.str(); - }; - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_preslice_transforms enter" - << " has_rotation=" << has_rotation - << " has_remap=" << has_remap - << " trafo.linear=" << log_mat(trafo_pre_shift.linear()) - << " trafo.translation=" << log_vec3(trafo_pre_shift.translation()) - << " volumes=" << model_volumes.size(); -#endif double min_z = std::numeric_limits::max(); -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - int vol_idx = 0; -#endif for (const ModelVolume *mv : model_volumes) { -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - if (!mv->is_model_part()) { ++vol_idx; continue; } -#else - if (!mv->is_model_part()) continue; -#endif Transform3d vol_trafo = trafo * mv->get_matrix(); const auto &its = mv->mesh().its; -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - // Per-volume bbox in mesh-frame and post-trafo slicer-frame. - Vec3d mesh_min(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); - Vec3d mesh_max(std::numeric_limits::lowest(), std::numeric_limits::lowest(), std::numeric_limits::lowest()); - Vec3d slicer_min(std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max()); - Vec3d slicer_max(std::numeric_limits::lowest(), std::numeric_limits::lowest(), std::numeric_limits::lowest()); - double vol_min_z = std::numeric_limits::max(); -#endif for (const stl_vertex &v : its.vertices) { Vec3d vm = v.cast(); Vec3d pt = vol_trafo * vm; min_z = std::min(min_z, pt.z()); -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - mesh_min = mesh_min.cwiseMin(vm); - mesh_max = mesh_max.cwiseMax(vm); - slicer_min = slicer_min.cwiseMin(pt); - slicer_max = slicer_max.cwiseMax(pt); - vol_min_z = std::min(vol_min_z, pt.z()); -#endif } -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] vol[" << vol_idx - << "] id=" << mv->id().id << " name='" << mv->name << "'" - << " mesh_bbox_min=" << log_vec3(mesh_min) << " mesh_bbox_max=" << log_vec3(mesh_max) - << " get_matrix.translation=" << log_vec3(mv->get_matrix().translation()) - << " slicer_bbox_min=" << log_vec3(slicer_min) << " slicer_bbox_max=" << log_vec3(slicer_max) - << " vol_min_z=" << vol_min_z; - ++vol_idx; -#endif } const double z_shift_val = (min_z < 0. && min_z != std::numeric_limits::max()) ? -min_z : 0.; -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] combined min_z=" << min_z - << " z_shift_val=" << z_shift_val; -#endif if (z_shift_val > 0.) { Transform3d z_shift = Transform3d::Identity(); z_shift.matrix()(2, 3) = z_shift_val; @@ -126,18 +58,8 @@ void BeltSliceStrategy::apply_preslice_transforms(Transform3d &trafo, // out_belt_min_z is only meaningful in belt mode; the standalone-remap path // never reported it. if (out_belt_min_z && config.belt_printer.value) { - const double new_val = (min_z != std::numeric_limits::max()) ? min_z : 0.; -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] write m_belt_min_z tid=" << std::this_thread::get_id() - << " target=" << out_belt_min_z << " old=" << *out_belt_min_z << " new=" << new_val; -#endif - *out_belt_min_z = new_val; + *out_belt_min_z = (min_z != std::numeric_limits::max()) ? min_z : 0.; } -#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_preslice_transforms exit" - << " final_trafo.linear=" << log_mat(trafo.linear()) - << " final_trafo.translation=" << log_vec3(trafo.translation()); -#endif } } // namespace Slic3r diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 58ce53df5a..6b9c5842bf 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -4,7 +4,6 @@ #include "Print.hpp" #include "BeltTransform.hpp" -#include #include "BoundingBox.hpp" #include "ClipperUtils.hpp" #include "Clipper2Utils.hpp" @@ -460,15 +459,11 @@ std::vector> PrintObject::detect_extruder_geometric_unprintables() // 3) Generates perimeters, gap fills and fill regions (fill regions of type stInternal). void PrintObject::make_perimeters() { - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters request tid=" << std::this_thread::get_id() << " obj=" << this; // prerequisites this->slice(); - if (! this->set_started(posPerimeters)) { - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; + if (! this->set_started(posPerimeters)) return; - } - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters ENTER tid=" << std::this_thread::get_id() << " obj=" << this; m_print->set_status(15, L("Generating walls")); BOOST_LOG_TRIVIAL(info) << "Generating walls..." << log_memory_info(); @@ -566,7 +561,6 @@ void PrintObject::make_perimeters() m_print->throw_if_canceled(); BOOST_LOG_TRIVIAL(debug) << "Generating perimeters in parallel - end"; - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters EXIT tid=" << std::this_thread::get_id() << " obj=" << this; this->set_done(posPerimeters); } @@ -955,9 +949,7 @@ void PrintObject::detect_overhangs_for_lift() void PrintObject::generate_support_material() { - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material request tid=" << std::this_thread::get_id() << " obj=" << this; if (this->set_started(posSupportMaterial)) { - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material ENTER tid=" << std::this_thread::get_id() << " obj=" << this; this->clear_support_layers(); if(!has_support() && !m_print->get_no_check_flag()) { @@ -1005,10 +997,7 @@ void PrintObject::generate_support_material() // posSupportMaterial, so this needs no extra invalidation edges. make_belt_brim(*this); m_print->throw_if_canceled(); - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material EXIT tid=" << std::this_thread::get_id() << " obj=" << this; this->set_done(posSupportMaterial); - } else { - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; } } diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 8360a9562f..2181b3e0d5 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1,6 +1,5 @@ #include #include -#include #include @@ -860,12 +859,8 @@ void groupingVolumesForBrim(PrintObject* object, LayerPtrs& layers, int firstLay // Resulting expolygons of layer regions are marked as Internal. void PrintObject::slice() { - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice request tid=" << std::this_thread::get_id() << " obj=" << this; - if (! this->set_started(posSlice)) { - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)"; + if (! this->set_started(posSlice)) return; - } - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice ENTER tid=" << std::this_thread::get_id() << " obj=" << this; //BBS: add flag to reload scene for shell rendering m_print->set_status(5, L("Slicing mesh"), PrintBase::SlicingStatus::RELOAD_SCENE); std::vector layer_height_profile; @@ -1000,41 +995,6 @@ void PrintObject::slice() 0.); double centering_z_corr = (T_fwd.linear() * c_off).z(); global_z_offset += centering_z_corr; - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] centering correction" - << " obj=" << this->model_object()->name - << " m_center_offset_mm=(" << c_off.x() << "," << c_off.y() << ")" - << " centering_z_corr=" << centering_z_corr - << " (added to global_z_offset)"; - } - - // [BELT-DEBUG] Per-object summary so Case A vs Case B can be compared - // side-by-side. Lays out every value that feeds into the final layer - // print_z adjustment. - { - BoundingBoxf3 raw_bb = this->model_object()->raw_bounding_box(); - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] slice() per-object summary" - << " obj=" << this->model_object()->name - << " n_volumes=" << this->model_object()->volumes.size() - << " raw_bbox.min=(" << raw_bb.min.x() << "," << raw_bb.min.y() << "," << raw_bb.min.z() << ")" - << " raw_bbox.max=(" << raw_bb.max.x() << "," << raw_bb.max.y() << "," << raw_bb.max.z() << ")" - << " raw_bbox.center=(" << raw_bb.center().x() << "," << raw_bb.center().y() << ")" - << " m_center_offset=(" << unscale(m_center_offset.x()) << "," << unscale(m_center_offset.y()) << ")" - << " inst_shift=(" << unscale(inst_shift.x()) << "," << unscale(inst_shift.y()) << ")" - << " m_belt_min_z=" << m_belt_min_z - << " belt_surface_z=" << belt_surface_z - << " belt_z_shift=" << belt_z_shift; - // Per-volume bbox + get_matrix translation so order/composition is visible. - int vi = 0; - for (const ModelVolume *mv : this->model_object()->volumes) { - if (!mv->is_model_part()) { ++vi; continue; } - BoundingBoxf3 vol_bb = mv->mesh().transformed_bounding_box(mv->get_matrix()); - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] vol[" << vi - << "] id=" << mv->id().id << " name='" << mv->name << "'" - << " get_matrix.translation=(" << mv->get_matrix().translation().x() << "," << mv->get_matrix().translation().y() << "," << mv->get_matrix().translation().z() << ")" - << " object_bbox.min=(" << vol_bb.min.x() << "," << vol_bb.min.y() << "," << vol_bb.min.z() << ")" - << " object_bbox.max=(" << vol_bb.max.x() << "," << vol_bb.max.y() << "," << vol_bb.max.z() << ")"; - ++vi; - } } if (pcfg.belt_preslice_global.value) { @@ -1044,9 +1004,6 @@ void PrintObject::slice() Vec3d d(unscale(inst_shift.x()), unscale(inst_shift.y()), 0.); Vec3d c = T.linear() * d - d; global_z_offset += c.z(); - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] write m_belt_global_xy_correction tid=" << std::this_thread::get_id() - << " obj=" << this << " old=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() - << ") new=(" << c.x() << "," << c.y() << ")"; m_belt_global_xy_correction = Vec2d(c.x(), c.y()); BOOST_LOG_TRIVIAL(trace) << "Belt preslice_global: correction=(" @@ -1081,18 +1038,7 @@ void PrintObject::slice() BOOST_LOG_TRIVIAL(trace) << "Belt global: z_offset=" << global_z_offset << " (relative to min across " << this->print()->objects().size() << " objects)"; - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] write m_belt_global_z_offset tid=" << std::this_thread::get_id() - << " obj=" << this << " old=" << m_belt_global_z_offset << " new=" << global_z_offset; m_belt_global_z_offset = global_z_offset; - // [BELT-DEBUG] Final breakdown of all contributions to layer.print_z - // and where the first / last layer end up post-adjustment. - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] global_z_offset breakdown" - << " obj=" << this->model_object()->name - << " belt_z_shift=" << belt_z_shift - << " total_global_z_offset=" << global_z_offset - << " xy_correction=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ")" - << " belt_floor_z_shift_before=" << (m_slicing_params.belt_floor_z_shift) - << " n_layers=" << m_layers.size(); if (std::abs(global_z_offset) > EPSILON) { for (Layer *layer : m_layers) layer->print_z += global_z_offset; @@ -1101,12 +1047,6 @@ void PrintObject::slice() // layer print_z, so belt_floor_z_shift must match. m_slicing_params.belt_floor_z_shift += global_z_offset; } - if (!m_layers.empty()) { - BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] post-adjustment" - << " first_layer.print_z=" << m_layers.front()->print_z - << " last_layer.print_z=" << m_layers.back()->print_z - << " belt_floor_z_shift_after=" << m_slicing_params.belt_floor_z_shift; - } if (!m_layers.empty()) { BOOST_LOG_TRIVIAL(trace) << "Belt global: first_layer_z=" << m_layers.front()->print_z << " last_layer_z=" << m_layers.back()->print_z @@ -1125,10 +1065,6 @@ void PrintObject::slice() } // BBS - BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice EXIT tid=" << std::this_thread::get_id() << " obj=" << this - << " layers=" << m_layers.size() << " belt_min_z=" << m_belt_min_z - << " belt_global_z_offset=" << m_belt_global_z_offset - << " belt_xy=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ")"; this->set_done(posSlice); } diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 7cf1baeb68..75195d0167 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1913,8 +1913,6 @@ void TreeSupport::generate() if (first_layer != nullptr) { ExPolygons floating = diff_ex(first_layer->lslices_extrudable, ctx.surface_polygon(first_layer->bottom_z() - first_layer->height)); - BOOST_LOG_TRIVIAL(debug) << "[BELT-CALIB] wedge seed: obj=" << m_object->model_object()->name - << " bottom_z=" << first_layer->bottom_z() << " floating=" << floating.size(); if (!floating.empty()) { source_areas = std::move(floating); first_z = first_layer->bottom_z(); diff --git a/src/slic3r/GUI/BeltPurgeTower.cpp b/src/slic3r/GUI/BeltPurgeTower.cpp index 1882363d27..a8b0b0c0b8 100644 --- a/src/slic3r/GUI/BeltPurgeTower.cpp +++ b/src/slic3r/GUI/BeltPurgeTower.cpp @@ -171,7 +171,6 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object if (prism_idxs.empty()) return false; remove_prisms(prism_idxs); - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] belt purge tower removed (conditions not met)"; return true; } @@ -295,22 +294,13 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object const double lat_origin = plate_origin[belt_is_y ? 0 : 1]; const double inset = 1.; double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts - BoundingBoxf bed_ext_dbg; if (const auto *bed_opt = printer_config.option("printable_area"); bed_opt != nullptr && !bed_opt->values.empty()) { const BoundingBoxf bed_ext = get_extents(bed_opt->values); - bed_ext_dbg = bed_ext; const double bed_lat_max = belt_is_y ? bed_ext.max.x() : bed_ext.max.y(); lat_center = lat_origin + bed_lat_max - inset - 0.5 * width; } - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge place" - << " plate_origin=(" << plate_origin.x() << "," << plate_origin.y() << ")" - << " parts_x=[" << x_min << "," << x_max << "] parts_y=[" << y_min << "," << y_max << "] z_max=" << z_max - << " bed_ext=[" << bed_ext_dbg.min.x() << "," << bed_ext_dbg.min.y() - << " -> " << bed_ext_dbg.max.x() << "," << bed_ext_dbg.max.y() << "]" - << " lat_center=" << lat_center << " belt=[" << belt_start << "," << belt_end << "]"; - const Vec3d desired_center(belt_is_y ? lat_center : belt_center, belt_is_y ? belt_center : lat_center, 0.5 * height); @@ -395,15 +385,6 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object // until the parts/config actually change. sig = new_sig; - BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] belt purge tower generated" - << " belt_is_y=" << belt_is_y - << " W=" << width << " L=" << length << " H=" << height - << " v_layer=" << v_layer << " max_flush=" << max_flush - << " filaments=" << filaments.size() - << " theta_deg=" << Geometry::rad2deg(theta) - << " desired_center=(" << desired_center.x() << "," << desired_center.y() << "," << desired_center.z() << ")" - << " achieved_center=(" << new_object->bounding_box_exact().center().x() << "," - << new_object->bounding_box_exact().center().y() << ")"; return true; } diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 58fe8f9931..9193cc5ef8 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1387,8 +1387,6 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const // translation, which this min-corner step recovers. const Vec3d d = model_bb.min - tp_bb.min; belt_inv = Transform3d(Eigen::Translation3d(d)) * belt_inv; - BOOST_LOG_TRIVIAL(debug) << "[BELT-PREVIEW] anchor d=[" << d.x() << "," << d.y() << "," << d.z() - << "] (clip kept " << n_clip << "/" << n_filtered << " moves)"; } } libvgcode::GCodeInputData data = libvgcode::convert(gcode_result, str_tool_colors, str_color_print_colors, m_viewer, diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 69086cd915..5b6e2c6300 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -15893,20 +15893,6 @@ void Plater::_calib_apply_belt_mode() inst->rotate(cancel_rotation); obj->invalidate_bounding_box(); obj->ensure_on_bed(); - - { - const BoundingBoxf3 rb = obj->raw_bounding_box(); - const Vec3d io = inst->get_offset(); - const Vec3d ir = inst->get_rotation(); - BOOST_LOG_TRIVIAL(debug) << "[BELT-CALIB] helper exit: obj=" << obj->name - << " inst_offset=(" << io.x() << "," << io.y() << "," << io.z() << ")" - << " inst_rot=(" << ir.x() << "," << ir.y() << "," << ir.z() << ")" - << " vol0_offset=(" << obj->volumes.front()->get_offset().x() << "," - << obj->volumes.front()->get_offset().y() << "," << obj->volumes.front()->get_offset().z() << ")" - << " raw_bbox=(" << rb.min.x() << "," << rb.min.y() << "," << rb.min.z() - << ")..(" << rb.max.x() << "," << rb.max.y() << "," << rb.max.z() << ")" - << " min_z=" << obj->min_z(); - } } // Each object's support wedge extends upstream of it by roughly its own From 2aa4122aae3bf1b045400053c92454ad7c80c407 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:07:42 -0500 Subject: [PATCH 176/389] Belt: check object height against the gantry clearance again validate() skipped the build-volume height check whenever the machine-frame transform was active, which is every shipped belt profile, so a 400 mm object passed on a 300 mm printable_height. The transform only changes how the height is written to G-code; the clearance check from f682ab5cd3 applies regardless. Raised in Hanif Koh's review of #14394. --- src/libslic3r/Print.cpp | 13 +++---------- tests/fff_print/test_print.cpp | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index dc018388b2..8f70405307 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -20,7 +20,6 @@ #include "GCode.hpp" #include "BeltGCode.hpp" #include "BeltTransform.hpp" -#include "GCode/MachineFrameTransform.hpp" #include "GCode/WipeTower.hpp" #include "GCode/WipeTower2.hpp" #include "GCode/WipeTowerEstimate.hpp" @@ -1621,17 +1620,11 @@ StringObjectException Print::validate(std::vector *warnin // is not comparable to printable_height (which is gantry clearance in the // build-volume frame). Compare against the model's pre-shear Z instead, // mirroring the bbox computed in PrintObject::update_slicing_parameters. - // When the post-gcode MachineFrameTransform is active the printer's - // physical Z mapping is non-trivial — skip the check entirely. + // The machine-frame transform only changes how that height is written to + // G-code, not how much room there is under the gantry. const bool belt_printer = this->config().belt_printer.value; - bool skip_max_height_check = false; - if (belt_printer) { - MachineFrameTransform machine_frame; - machine_frame.init_from_config(this->config()); - skip_max_height_check = machine_frame.is_active(); - } const double shrinkage_compensation_z = this->shrinkage_compensation().z(); - for (size_t print_object_idx = 0; !skip_max_height_check && print_object_idx < m_objects.size(); ++ print_object_idx) { + for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx) { const PrintObject &print_object = *m_objects[print_object_idx]; double effective_max_z = 0; diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index 8b342fde68..6f0eb7b00e 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -562,3 +562,37 @@ TEST_CASE("Belt printers never start a scarf seam below the layer", "[Print][bel }); CHECK(worst_backstep < 0.2); } + +// printable_height on a belt printer is the clearance under the gantry, so an object taller +// than that is refused whatever the machine-frame transform does to the emitted coordinates. +TEST_CASE("Belt printers refuse an object taller than the gantry clearance", "[Print][belt]") +{ + auto belt_config = [](double printable_height) { + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "belt_printer", 1 }, + { "belt_slice_rotation", "x" }, + { "belt_slice_rotation_angle", 45 }, + { "belt_slice_rotation_global", 1 }, + { "gcode_remap_x", "rev_x" }, + { "gcode_remap_y", "pos_z" }, + { "gcode_remap_z", "pos_y" }, + { "printable_height", printable_height }, + { "skirt_loops", 0 }, + }); + return config; + }; + + SECTION("a 20 mm cube fits under 50 mm of clearance") { + Print print; + Model model; + init_print({ cube(20) }, print, model, belt_config(50)); + CHECK(print.validate().string.empty()); + } + SECTION("a 60 mm cube does not") { + Print print; + Model model; + init_print({ cube(60) }, print, model, belt_config(50)); + CHECK_FALSE(print.validate().string.empty()); + } +} From 3752144995e65de48d43f435d4f407613ca4c762 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:07:42 -0500 Subject: [PATCH 177/389] Belt: do not refuse a brim because the prime tower setting is on enable_prime_tower stays on for any multi-filament project, but a belt printer never prints the classic tower and the belt purge prism is an ordinary object that never takes a brim, so every brim on a multi-filament belt print was refused for nothing. Raised in Hanif Koh's review of #14394. --- src/libslic3r/Print.cpp | 7 +++---- tests/fff_print/test_skirt_brim.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 8f70405307..5bfdfe8eac 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1420,11 +1420,10 @@ StringObjectException Print::validate(std::vector *warnin return { L("Draft shield is not compatible with belt printer mode.") }; // Belt brim spans many layers and owns the layers below the object, which - // neither the prime tower nor spiral vase can share. + // spiral vase cannot share. The prime tower setting is no obstacle: belt + // printers never print the classic tower, and the belt purge prism is an + // ordinary object that never takes a brim. if (this->has_belt_brim()) { - if (m_config.enable_prime_tower.value) - return { L("Brim is not compatible with the prime tower on a belt printer. " - "Disable one of them.") }; if (m_config.spiral_mode.value) return { L("Brim is not compatible with spiral vase mode on a belt printer. " "Disable one of them.") }; diff --git a/tests/fff_print/test_skirt_brim.cpp b/tests/fff_print/test_skirt_brim.cpp index a34d28abae..5fa810106f 100644 --- a/tests/fff_print/test_skirt_brim.cpp +++ b/tests/fff_print/test_skirt_brim.cpp @@ -919,12 +919,15 @@ TEST_CASE("Belt inner-only leading brim does not reject the prime tower or spira CHECK_FALSE(print.objects().front()->has_belt_brim()); CHECK(print.validate().string.empty()); } - SECTION("a real inner brim still rejects the prime tower") { + // enable_prime_tower stays on for any multi-filament project, but a belt printer never + // prints the classic tower, so the setting alone must not cost the print its brim. + SECTION("a real inner brim is accepted with the prime tower setting on") { Print print; Model model; init_inner_leading_with_prime_tower(print, model, 4); CHECK(print.objects().front()->has_belt_brim()); - CHECK_FALSE(print.validate().string.empty()); + CHECK(print.validate().string.empty()); + CHECK_FALSE(gcode(print).empty()); } } From c49e8d32c8a888e7b6b09a8ba58c01091a79c08c Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:07:43 -0500 Subject: [PATCH 178/389] Belt: drop the per-extrusion transform determinant The mesh transform is a rotation and an axis permutation, so its determinant is always 1; rebuilding the forward transform on every extrusion to divide the flow by it changed nothing. Raised in Hanif Koh's review of #14394. --- src/libslic3r/GCode.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 9947e40b8d..d8ea742b18 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -8402,20 +8402,6 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, auto _mm3_per_mm = path.mm3_per_mm * this->config().print_flow_ratio; _mm3_per_mm *= filament_flow_ratio; - // Belt printer: compensate for any volume change introduced by the mesh - // forward transform. path.mm3_per_mm is derived from slicer-frame layer - // height × line width, but a slicer-frame slab of volume V maps under the - // back-transform to a machine-frame region of volume V / |det(T)|. The - // mesh transform is now rotation ∘ pre-remap, both orthogonal, so |det(T)| - // is always 1 and this is currently a no-op; it is retained as a guard in - // case a non-orthogonal mesh transform is ever reintroduced. (Machine-frame - // shear/scale acts on the g-code in BeltKinematics, not here.) - if (m_config.belt_printer.value) { - double det = std::abs(BeltTransformPipeline::build_forward_transform(m_config).linear().determinant()); - if (det > EPSILON) - _mm3_per_mm /= det; - } - if (path.role() == erTopSolidInfill) { _mm3_per_mm *= m_config.top_solid_infill_flow_ratio; } else if (path.role() == erBottomSurface) { From 0701f64ba90ed84e8dc7a53b76ae373ca1dbc685 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:07:44 -0500 Subject: [PATCH 179/389] Belt: index apron layers into the first layer's nozzle map Apron bands looked up their filament and nozzle config slot with a running counter, while object layers use Layer::id(), so band N read the map of object layer N. They precede layer 0 and now use its assignment. Raised in Hanif Koh's review of #14394. --- src/libslic3r/GCode.cpp | 4 +++- src/libslic3r/GCode.hpp | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index d8ea742b18..df3b1205fb 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -5326,7 +5326,9 @@ LayerResult GCode::process_belt_brim_layer( break; } - m_cur_layer_idx = m_belt_brim_layer_idx ++; + // Apron bands precede object layer 0 and have no layer id of their own; they take the + // filament and nozzle assignment in effect at the first object layer. + m_cur_layer_idx = 0; // Publish the band's Z for _extrude()'s first-layer-plane probe, and make sure // it cannot leak past this layer even if an extrusion throws. diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 5d99c219c6..3356219037 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -843,9 +843,6 @@ protected: // _extrude() needs for the first-layer-plane probe is published here instead. // Scoped by BeltBrimZGuard in process_belt_brim_layer(), never left set. std::optional m_belt_brim_z; - // Counter standing in for Layer::id() on apron layers, which precede layer 0. - size_t m_belt_brim_layer_idx{0}; - // Belt brim only. Brim and coincident apron bands are emitted before m_layer // is switched to their object, so belt_height_above_floor() would otherwise // read the previously visited object's belt description -- making a brim's From c0ba2c8c4447b4c361cf0e75b3610d1bba4472c7 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:07:44 -0500 Subject: [PATCH 180/389] Belt brim: read the belt axis from the config in the instance check belt_brim_instances_compatible() runs while the slicing parameters can be stale, like the rest of the brim predicates, which read the print config. Raised in Hanif Koh's review of #14394. --- src/libslic3r/PrintObject.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 6b9c5842bf..8100241ef8 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1249,7 +1249,9 @@ bool PrintObject::belt_brim_instances_compatible() const // matters for configurations that do not. if (m_instances.size() <= 1) return true; - const int axis = m_slicing_params.belt_floor_from_axis; + // From the config, not m_slicing_params: this runs while those can be stale. A tilt + // about Y runs the belt along X, any other tilt along Y (see compute_belt_height_and_floor). + const int axis = m_print->config().belt_slice_rotation.value == BeltRotationAxis::Y ? 0 : 1; const Point &ref = m_instances.front().shift; for (const PrintInstance &inst : m_instances) { const coord_t along = axis == 0 ? inst.shift.x() - ref.x() : inst.shift.y() - ref.y(); From f7b822abb74ca62e23e0ce062556624b6feac984 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:07:45 -0500 Subject: [PATCH 181/389] Belt: remove the unused clip_support_fills() It had no caller besides its own recursion. Raised in Hanif Koh's review of #14394. --- src/libslic3r/PrintObject.cpp | 61 ----------------------------------- 1 file changed, 61 deletions(-) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 8100241ef8..2c7cdc7335 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -4689,67 +4689,6 @@ void PrintObject::combine_infill() } } -// Belt printer: clip an ExtrusionEntityCollection to a region defined by clip_expoly. -// Handles ExtrusionPath, ExtrusionMultiPath, ExtrusionLoop, and nested ExtrusionEntityCollection. -static void clip_support_fills(ExtrusionEntityCollection &fills, const ExPolygons &clip_region) -{ - ExtrusionEntitiesPtr new_entities; - for (ExtrusionEntity *entity : fills.entities) { - if (auto *path = dynamic_cast(entity)) { - ExtrusionEntityCollection clipped; - path->intersect_expolygons(clip_region, &clipped); - if (!clipped.empty()) { - for (ExtrusionEntity *e : clipped.entities) - new_entities.push_back(e->clone()); - } - delete entity; - } else if (auto *multipath = dynamic_cast(entity)) { - ExtrusionPaths new_paths; - for (const ExtrusionPath &p : multipath->paths) { - ExtrusionEntityCollection clipped; - p.intersect_expolygons(clip_region, &clipped); - for (ExtrusionEntity *e : clipped.entities) - if (auto *cp = dynamic_cast(e)) - new_paths.push_back(std::move(*cp)); - } - if (!new_paths.empty()) { - multipath->paths = std::move(new_paths); - new_entities.push_back(multipath); - } else { - delete entity; - } - } else if (auto *loop = dynamic_cast(entity)) { - ExtrusionPaths new_paths; - for (const ExtrusionPath &p : loop->paths) { - ExtrusionEntityCollection clipped; - p.intersect_expolygons(clip_region, &clipped); - for (ExtrusionEntity *e : clipped.entities) - if (auto *cp = dynamic_cast(e)) - new_paths.push_back(std::move(*cp)); - } - if (!new_paths.empty()) { - // Loop is no longer a closed loop after clipping; emit as individual paths. - for (auto &p : new_paths) - new_entities.push_back(new ExtrusionPath(std::move(p))); - delete entity; - } else { - delete entity; - } - } else if (auto *coll = dynamic_cast(entity)) { - clip_support_fills(*coll, clip_region); - if (!coll->empty()) { - new_entities.push_back(coll); - } else { - delete entity; - } - } else { - // Unknown entity type — keep as-is. - new_entities.push_back(entity); - } - } - fills.entities = std::move(new_entities); -} - void PrintObject::_generate_support_material() { if (is_tree(m_config.support_type.value)) { From 646fe6384c633afa41c05b3b9705178a893551e1 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:07:45 -0500 Subject: [PATCH 182/389] Belt: retire the two support floor modes nothing implements clip_only and both were never read and behaved like none; old values now load as none. Raised in Hanif Koh's review of #14394. --- src/libslic3r/PrintConfig.cpp | 5 +++-- src/libslic3r/PrintConfig.hpp | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index cc17d0fdec..4e2458e73b 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -373,8 +373,6 @@ CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(RemapAxis) static t_config_enum_values s_keys_map_BeltSupportFloorMode { { "none", int(BeltSupportFloorMode::None) }, { "generator_only", int(BeltSupportFloorMode::GeneratorOnly) }, - { "clip_only", int(BeltSupportFloorMode::ClipOnly) }, - { "both", int(BeltSupportFloorMode::Both) }, }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BeltSupportFloorMode) @@ -9354,6 +9352,9 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va //BBS: handle legacy options if (opt_key == "curr_bed_type" && value == "SuperTack Plate") { value = "Supertack Plate"; + } else if (opt_key == "belt_support_floor_mode" && (value == "clip_only" || value == "both")) { + // Never implemented; both behaved like "none". + value = "none"; } else if (opt_key == "enable_wipe_tower") { opt_key = "enable_prime_tower"; } else if (opt_key == "wipe_tower_width") { diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 9d20a71c9b..1a2dd0f7a3 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -275,8 +275,6 @@ enum class BeltSupportFloorMode { None, // No belt floor awareness GeneratorOnly, // Only in tree support drop_nodes/contact_points - ClipOnly, // Only post-processing clipping - Both, // Both generator and clipping }; enum class BeltSupportZOffsetMode From 556569c0e355f5eab5b6b87ed6a1fc8e8aba2064 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:10:57 -0500 Subject: [PATCH 183/389] Belt: drive the first-layer fan band from the generator, not from parsed moves The cooling buffer's band pass rebuilt positions from the layer's G-code and tested them against the first-layer plane. The G-code is in machine coordinates and the plane is in slicing coordinates, so on the shipped profiles the nearest move was over 100 mm from a 0.2 mm band and the pass never changed the fan. GCode::_extrude() already knows each path's height above the belt, so it now tags the band changes and the buffer applies and strips the tags. The pass also took the S of every M106 as the part fan, whatever its P index, and stored that 0..255 value where a percentage was expected (an auxiliary fan line came back as M106 S651); it now uses FanMover's parser, which ignores other fans, and converts to percent. It no longer overwrites the layer's intended speed, only the fan's actual state. Raised in Hanif Koh's review of #14394. --- src/libslic3r/GCode.cpp | 8 + src/libslic3r/GCode.hpp | 5 + src/libslic3r/GCode/CoolingBuffer.cpp | 223 +++++++------------------- src/libslic3r/GCode/CoolingBuffer.hpp | 19 +-- src/libslic3r/GCode/FanMover.hpp | 5 + tests/fff_print/test_print.cpp | 55 +++++++ 6 files changed, 141 insertions(+), 174 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index df3b1205fb..151efbf6b2 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -8507,6 +8507,14 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // the speed fade tracks perpendicular distance from the plane on // belt printers; otherwise this falls back to the slicing layer id. const int _layer = this->effective_layer_index_for_point(path_point_mm); + // Belt printers: tell the cooling buffer which band above the belt this path starts in, + // once per layer and at every change (CoolingBuffer::apply_belt_band_fan consumes it). + if (m_enable_cooling_markers && m_config.belt_printer.value && + (m_belt_band_tag_layer != m_layer_index || m_belt_band_tag != _layer)) { + gcode += ";_BELT_BAND:" + std::to_string(_layer) + "\n"; + m_belt_band_tag = _layer; + m_belt_band_tag_layer = m_layer_index; + } if (path_on_first_layer || object_layer_over_raft()) { //BBS: for solid infill of first layer, speed can be higher as long as //wall lines have be attached diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 3356219037..e390bc972f 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -2,6 +2,7 @@ #define slic3r_GCode_hpp_ #include "libslic3r.h" +#include #include "ExPolygon.hpp" #include "GCodeWriter.hpp" #include "GCode/BeltKinematics.hpp" @@ -855,6 +856,10 @@ protected: ~BeltFloorObjectGuard() { slot = nullptr; } }; + // Last ";_BELT_BAND" tag written and the layer it was written on (see _extrude()). + int m_belt_band_tag{std::numeric_limits::min()}; + int m_belt_band_tag_layer{std::numeric_limits::min()}; + std::set m_initial_layer_extruders; std::vector> m_sorted_layer_filaments; // BBS diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index 1df6ce3bb9..29ab528de5 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -1,11 +1,13 @@ #include "../GCode.hpp" -#include "../FirstLayerPlane.hpp" #include "CoolingBuffer.hpp" +#include "FanMover.hpp" #include #include #include #include #include +#include +#include #include #include #include @@ -33,15 +35,12 @@ CoolingBuffer::CoolingBuffer(GCode &gcodegen) : m_config(gcodegen.config()), m_t m_extruder_ids.emplace_back(ex.id()); } - // Borrow the first-layer plane from the GCode generator. When inactive - // (non-belt printers and belt printers without Z shear), per-line fan - // re-evaluation is skipped and behavior is bit-identical to the legacy - // per-layer path. - m_first_layer_plane = gcodegen.first_layer_plane(); } void CoolingBuffer::reset(const Vec3d &position) { + m_belt_band_fan = -1; + m_belt_band_layer_fan = -1; // BBS: add I and J axis to store center of arc m_current_pos.assign(7, 0.f); m_current_pos[0] = float(position.x()); @@ -335,16 +334,13 @@ std::string CoolingBuffer::process_layer(std::string &&gcode, size_t layer_id, b if (flush) { // This is either an object layer or the very last print layer. Calculate cool down over the collected support layers // and one object layer. + const unsigned int extruder_at_start = m_current_extruder; std::vector per_extruder_adjustments = this->parse_layer_gcode(m_gcode, m_current_pos); float layer_time_stretched = this->calculate_layer_slowdown(per_extruder_adjustments); out = this->apply_layer_cooldown(m_gcode, layer_id, layer_time_stretched, per_extruder_adjustments); - // First-layer plane: per-segment fan re-evaluation post-pass. Walks - // the cooled-down gcode and inserts inline M106 commands at band - // crossings (where the path's perpendicular distance to the plane - // crosses close_fan_the_first_x_layers thresholds). No-op when - // the evaluator is inactive. - if (m_first_layer_plane && m_first_layer_plane->is_active()) - out = this->apply_first_layer_plane_fan_eval(std::move(out), layer_id, layer_time_stretched); + // Belt printers: the fan follows each path's height above the belt (see apply_belt_band_fan). + if (out.find(";_BELT_BAND:") != std::string::npos) + out = this->apply_belt_band_fan(std::move(out), layer_time_stretched, extruder_at_start); m_gcode.clear(); } return out; @@ -1078,7 +1074,7 @@ std::string CoolingBuffer::apply_layer_cooldown( // Pure helper: compute the main fan speed for a given effective layer index. // Mirrors the inline logic in change_extruder_set_fan but is callable from -// per-line code in apply_first_layer_plane_fan_eval. +// per-tag code in apply_belt_band_fan. int CoolingBuffer::compute_main_fan_speed(int effective_layer_id, float layer_time, unsigned int extruder_id) const { @@ -1116,173 +1112,74 @@ int CoolingBuffer::compute_main_fan_speed(int effective_layer_id, float layer_ti return int(fan_speed_new); } -// Post-pass: walk the cooled-down gcode line by line, track XYZ position, -// and insert M106 commands at first-layer-plane band crossings so the fan -// follows perpendicular distance to the plane rather than the slicing-layer -// index. Only invoked when the FirstLayerPlane evaluator is active. +// Belt printers: a layer is a tilted slab, so "the first layer" is not a slicing layer but +// whatever lies within a layer height of the belt. GCode::_extrude() knows each path's +// height above the belt in the slicing frame and tags every change of it with +// ";_BELT_BAND:". This pass turns the tags into part-fan changes +// and strips them. (The G-code itself is in machine coordinates, which is why the band +// is not worked out from the moves here.) // -// This implementation is intentionally minimal: it overrides only the MAIN -// fan (the one set by GCodeWriter::set_fan); overhang/internal-bridge/etc -// special fans remain at their layer-level values from apply_layer_cooldown. -// That keeps the per-line logic small while still giving the user precise -// fan control near the belt surface, which is the main quality concern. -std::string CoolingBuffer::apply_first_layer_plane_fan_eval( - std::string &&gcode_in, size_t /*layer_id*/, float layer_time) +// Only the main part-cooling fan is touched; overhang and bridge fans keep the values +// apply_layer_cooldown() gave them. +std::string CoolingBuffer::apply_belt_band_fan(std::string &&gcode_in, float layer_time, unsigned int extruder_at_start) { - if (!m_first_layer_plane || !m_first_layer_plane->is_active()) - return std::move(gcode_in); - + static constexpr std::string_view band_tag = ";_BELT_BAND:"; const std::string &gcode = gcode_in; std::string out; - out.reserve(gcode.size() + 256); + out.reserve(gcode.size()); - // Match the PWM floor applied at every other set_fan call in this file so - // band-crossing M106 emissions start the fan reliably at low speeds. + // Match the PWM floor applied at every other set_fan call in this file. const unsigned int part_cooling_fan_min_pwm = static_cast(std::max(0, m_config.part_cooling_fan_min_pwm.value)); + unsigned int active_extruder = extruder_at_start; - // Track position in slicing-frame mm. Seed from m_current_pos which the - // CoolingBuffer keeps up-to-date across layers. - Vec3d cur_pos_mm(m_current_pos[0], m_current_pos[1], m_current_pos[2]); - - // Track current main fan speed by parsing M106 commands as we walk so - // we can restore it after a band exit. - int current_main_fan = m_fan_speed; - int pre_band_main_fan = current_main_fan; - // Implicit initial state: assume the layer started "out of the band" - // (i.e., the layer-level fan setting from apply_layer_cooldown is in - // effect). The first movement we encounter will reconcile this. - bool in_first_layer_band = false; - unsigned int active_extruder = m_current_extruder; - - auto parse_xyz_into = [](const std::string_view &line_sv, Vec3d &p) { - if (line_sv.size() < 3) return false; - if (line_sv[0] != 'G') return false; - if (line_sv[1] != '0' && line_sv[1] != '1') return false; - if (line_sv[2] != ' ' && line_sv[2] != '\t') return false; - const char *c = line_sv.data() + 3; - const char *end = line_sv.data() + line_sv.size(); - bool any = false; - while (c < end && *c != ';') { - while (c < end && (*c == ' ' || *c == '\t')) ++c; - if (c >= end || *c == ';' || *c == '\n' || *c == '\r') break; - char axis = *c; - ++c; - if (axis == 'X' || axis == 'Y' || axis == 'Z') { - char *next; - double v = std::strtod(c, &next); - if (next != c) { - if (axis == 'X') p.x() = v; - else if (axis == 'Y') p.y() = v; - else p.z() = v; - c = next; - any = true; - continue; - } - } - // Skip unrecognized word. - while (c < end && *c != ' ' && *c != '\t' && *c != ';' && *c != '\n') - ++c; - } - return any; - }; - - auto parse_m106 = [](const std::string_view &line_sv) -> int { - // Returns -1 if not an M106, otherwise the S value (0..255). - if (line_sv.size() < 4 || line_sv[0] != 'M') return -1; - if (!(line_sv[1] == '1' && line_sv[2] == '0' && line_sv[3] == '6')) - return -1; - // Find S - size_t s_pos = line_sv.find('S'); - if (s_pos == std::string_view::npos) return -1; - const char *c = line_sv.data() + s_pos + 1; - char *next; - long v = std::strtol(c, &next, 10); - if (next == c) return -1; - return int(std::clamp(v, 0, 255)); - }; - - auto parse_m107 = [](const std::string_view &line_sv) -> bool { - return line_sv.size() >= 4 && line_sv[0] == 'M' && - line_sv[1] == '1' && line_sv[2] == '0' && line_sv[3] == '7'; - }; - - auto parse_tool_change = [this](const std::string_view &line_sv) -> int { - // Returns the new extruder id, or -1 if not a toolchange. - if (line_sv.size() < m_toolchange_prefix.size() + 1) return -1; - if (line_sv.compare(0, m_toolchange_prefix.size(), m_toolchange_prefix) != 0) - return -1; - const char *c = line_sv.data() + m_toolchange_prefix.size(); - char *next; - long v = std::strtol(c, &next, 10); - if (next == c) return -1; - return int(v); - }; - - const char *p = gcode.c_str(); - const char *end = gcode.c_str() + gcode.size(); + const char *p = gcode.data(); + const char *end = p + gcode.size(); while (p < end) { - const char *line_end = p; - while (line_end < end && *line_end != '\n') ++line_end; - const char *next_line = line_end; - if (next_line < end) ++next_line; // include the '\n' + const char *line_end = static_cast(std::memchr(p, '\n', end - p)); + if (line_end == nullptr) + line_end = end; + const char *next_line = line_end < end ? line_end + 1 : end; + const std::string_view line(p, line_end - p); - std::string_view line_sv(p, line_end - p); - - // Track tool changes so the per-line fan eval uses the right extruder. - int new_tool = parse_tool_change(line_sv); - if (new_tool >= 0) - active_extruder = unsigned(new_tool); - - // Track existing fan commands so we can restore the right value when - // exiting a band. - int m106_speed = parse_m106(line_sv); - if (m106_speed >= 0) { - current_main_fan = m106_speed; - if (!in_first_layer_band) - pre_band_main_fan = m106_speed; - } else if (parse_m107(line_sv)) { - current_main_fan = 0; - if (!in_first_layer_band) - pre_band_main_fan = 0; + if (line.size() > band_tag.size() && line.compare(0, band_tag.size(), band_tag) == 0) { + const int eff_idx = std::atoi(std::string(line.substr(band_tag.size())).c_str()); + const bool in_band = eff_idx < std::max(m_config.close_fan_the_first_x_layers.get_at(active_extruder), 1); + int target = this->compute_main_fan_speed(eff_idx, layer_time, active_extruder); + // Clear of the belt and nothing to add: fall back to what the layer asked for. + if (! in_band && target == 0 && m_belt_band_layer_fan >= 0) + target = m_belt_band_layer_fan; + if (target != m_belt_band_fan) { + out += GCodeWriter::set_fan(m_config.gcode_flavor, target, part_cooling_fan_min_pwm); + m_belt_band_fan = target; + } + // The tag itself is dropped. + p = next_line; + continue; } - // Movement line: parse XYZ, evaluate plane, possibly emit a fan - // change BEFORE this line. - bool moved = parse_xyz_into(line_sv, cur_pos_mm); - if (moved) { - const int eff_idx = m_first_layer_plane->effective_layer_index(cur_pos_mm); - const int close_n = m_config.close_fan_the_first_x_layers.get_at(active_extruder); - const bool now_in_band = eff_idx < std::max(close_n, 1); - if (now_in_band != in_first_layer_band) { - // Band crossing: emit a M106 with the appropriate speed. - int target_fan; - if (now_in_band) { - // Entering the first-layer band: fan off. - pre_band_main_fan = current_main_fan; - target_fan = compute_main_fan_speed(eff_idx, layer_time, active_extruder); - } else { - // Exiting the band: restore the layer's normal fan speed. - // Use compute_main_fan_speed with the effective index so - // the linear ramp factor (close_fan→full_fan_speed_layer) - // also follows distance from the plane. - target_fan = compute_main_fan_speed(eff_idx, layer_time, active_extruder); - if (target_fan == 0) - target_fan = pre_band_main_fan; - } - if (target_fan != current_main_fan) { - out += GCodeWriter::set_fan(m_config.gcode_flavor, target_fan, part_cooling_fan_min_pwm); - current_main_fan = target_fan; - m_fan_speed = target_fan; - m_current_fan_speed = target_fan; - } - in_first_layer_band = now_in_band; + if (! line.empty() && line.front() == 'M') { + // Follow the fan commands of the layer-level cooling. FanMover's parser ignores + // auxiliary and chamber fans (M106 P2, P3...), which must not be taken for the part fan. + const int16_t raw = get_fan_speed(std::string(line), m_config.gcode_flavor); + if (raw >= 0) { + m_belt_band_fan = int(std::lround(double(std::min(raw, 255)) * 100. / 255.)); + m_belt_band_layer_fan = m_belt_band_fan; } + } else if (line.size() > m_toolchange_prefix.size() && line.compare(0, m_toolchange_prefix.size(), m_toolchange_prefix) == 0) { + char *num_end = nullptr; + const std::string num(line.substr(m_toolchange_prefix.size())); + const long tool = std::strtol(num.c_str(), &num_end, 10); + if (num_end != num.c_str() && tool >= 0) + active_extruder = unsigned(tool); } out.append(p, next_line - p); p = next_line; } + // The fan's real state, so the next layer's cooling re-issues its own speed if it differs. + if (m_belt_band_fan >= 0) + m_current_fan_speed = m_belt_band_fan; return out; } diff --git a/src/libslic3r/GCode/CoolingBuffer.hpp b/src/libslic3r/GCode/CoolingBuffer.hpp index 1adb6f5005..0d758b5a5b 100644 --- a/src/libslic3r/GCode/CoolingBuffer.hpp +++ b/src/libslic3r/GCode/CoolingBuffer.hpp @@ -10,7 +10,6 @@ namespace Slic3r { class GCode; class Layer; -class FirstLayerPlane; struct PerExtruderAdjustments; // A standalone G-code filter, to control cooling of the print. @@ -37,13 +36,10 @@ private: // Returns the adjusted G-code. std::string apply_layer_cooldown(const std::string &gcode, size_t layer_id, float layer_time, std::vector &per_extruder_adjustments); - // First-layer plane: per-line fan re-evaluation post-pass. Walks the - // post-cooldown gcode, tracks XYZ position, and inserts M106 commands at - // band-crossing transitions in slicing-frame coordinates. Only runs - // when m_first_layer_plane is active. - std::string apply_first_layer_plane_fan_eval(std::string &&gcode_in, - size_t layer_id, - float layer_time); + // Belt printers: turn the ";_BELT_BAND:" tags GCode::_extrude() leaves in the + // layer's G-code into part-fan changes, so the fan follows a path's height above the + // belt rather than the slicing layer index, and strip the tags. + std::string apply_belt_band_fan(std::string &&gcode_in, float layer_time, unsigned int extruder_at_start); // Pure helper: compute the main fan speed for a given effective layer // index (layer-id units, mapped through the plane evaluator) and the @@ -74,9 +70,10 @@ private: unsigned int m_current_nozzle; //BBS: current fan speed int m_current_fan_speed; - // First-layer plane evaluator, borrowed from GCode. Null = inactive - // (legacy per-layer fan control). - const FirstLayerPlane *m_first_layer_plane = nullptr; + // Belt band pass state, kept across layers. The part fan as this pass last saw or set + // it (percent, -1 unknown), and the last value the layer-level cooling asked for. + int m_belt_band_fan = -1; + int m_belt_band_layer_fan = -1; }; } diff --git a/src/libslic3r/GCode/FanMover.hpp b/src/libslic3r/GCode/FanMover.hpp index 17addd855c..9567e8e2d5 100644 --- a/src/libslic3r/GCode/FanMover.hpp +++ b/src/libslic3r/GCode/FanMover.hpp @@ -27,6 +27,11 @@ public: } }; +// The part-cooling fan value a G-code line sets: the raw S (0..255) of an M106 that +// addresses the part fan, 0 for a fan-off command, -1 for any other line (auxiliary +// and chamber fans included). +int16_t get_fan_speed(const std::string &line, GCodeFlavor flavor); + class FanMover { private: diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index 6f0eb7b00e..6d8d3d2ec9 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -596,3 +596,58 @@ TEST_CASE("Belt printers refuse an object taller than the gantry clearance", "[P CHECK_FALSE(print.validate().string.empty()); } } + +// On a belt every tilted layer starts on the belt, so "first layer" cooling is a band along +// the belt, not the first slicing layers: the part fan goes off for the paths that start +// within a layer height of the belt and back on above it, on every layer. The G-code is in +// machine coordinates, so the generator tags the band changes and the cooling buffer +// applies them; before that the buffer compared machine-frame moves with a slicing-frame +// plane and never switched the fan at all. +TEST_CASE("Belt printers switch the part fan by height above the belt", "[Print][belt][Cooling]") +{ + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "belt_printer", 1 }, + { "belt_slice_rotation", "x" }, + { "belt_slice_rotation_angle", 45 }, + { "belt_slice_rotation_global", 1 }, + { "gcode_remap_x", "rev_x" }, + { "gcode_remap_y", "pos_z" }, + { "gcode_remap_z", "pos_y" }, + { "layer_height", 0.2 }, + { "initial_layer_print_height", 0.2 }, + { "skirt_loops", 0 }, + { "z_hop", 0 }, + { "close_fan_the_first_x_layers", 1 }, + { "full_fan_speed_layer", 0 }, + { "fan_min_speed", 100 }, + { "fan_max_speed", 100 }, + { "slow_down_layer_time", 1000 }, + { "fan_cooling_layer_time", 1001 }, + { "reduce_fan_stop_start_freq", 0 }, + { "machine_start_gcode", "T[initial_tool]\n" }, + { "layer_change_gcode", "G92 E0\n" }, + }); + const std::string gcode = slice({ cube(20) }, config); + REQUIRE(! gcode.empty()); + + // The tags are consumed by the cooling buffer and never reach the file. + CHECK(gcode.find(";_BELT_BAND") == std::string::npos); + + size_t fan_off = 0, fan_on = 0; + GCodeReader parser; + parser.parse_buffer(gcode, [&](GCodeReader &, const GCodeReader::GCodeLine &line) { + if (line.cmd_is("M107")) + ++ fan_off; + else if (line.cmd_is("M106")) { + float s = 0.f; + if (line.has_value('S', s) && s <= 0.f) + ++ fan_off; + else + ++ fan_on; + } + }); + // A flat-bed print turns the fan on once. Here it cycles with the layers. + CHECK(fan_off > 10); + CHECK(fan_on > 10); +} From 360a68e07876b5bff9cd27d6df6c3cdcd93ce930 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:11:59 -0500 Subject: [PATCH 184/389] Belt: warn when the purge tower is enabled but the project has no tower object The purge tower is a model object the GUI creates and sizes, and libslic3r only purges into one that exists. A multi-filament belt project sliced from the CLI without it changed filament with nowhere to purge, silently. Raised in Hanif Koh's review of #14394. --- src/libslic3r/Print.cpp | 15 +++++++++++++++ tests/fff_print/test_print.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 5bfdfe8eac..444bf7cde6 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1553,6 +1553,21 @@ StringObjectException Print::validate(std::vector *warnin add_warning(warningtemp); } + // The purge tower is a model object the GUI creates and sizes; libslic3r only purges + // into one that exists. A project sliced without it (the CLI on a project saved before + // the tower was generated) changes filament with nowhere to purge. + if (m_config.belt_printer.value && m_config.enable_belt_purge_tower.value + && m_config.print_sequence != PrintSequence::ByObject + && ! m_config.spiral_mode.value && extruders.size() > 1 && ! this->has_belt_purge_tower()) { + StringObjectException warningtemp; + warningtemp.string = L("The belt purge tower is enabled but the project has no purge tower object; " + "filament changes will not be purged. Open the project in the application " + "to generate the tower."); + warningtemp.opt_key = "enable_belt_purge_tower"; + warningtemp.is_warning = true; + add_warning(warningtemp); + } + if (m_config.belt_printer.value && m_config.enable_belt_purge_tower.value) { const size_t prism_count = std::count_if(m_objects.begin(), m_objects.end(), [](const PrintObject *object) { return object->config().belt_purge_tower_object.value; diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index 6d8d3d2ec9..f9c9528461 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -336,6 +336,36 @@ TEST_CASE("Belt purge planning requires its managed purge object", "[Print][Purg CHECK_FALSE(print.has_wipe_tower()); } +// The GUI creates the purge tower object; a project sliced without one (the CLI) must say +// that its filament changes go unpurged. +TEST_CASE("Belt purge tower enabled without a tower object warns", "[Print][PurgeTower][belt]") +{ + DynamicPrintConfig config = multifilament_config(2, { + { "belt_printer", 1 }, + { "enable_belt_purge_tower", 1 }, + { "layer_change_gcode", "G92 E0\n" } + }); + auto purge_warnings = [](Print &print) { + std::vector warnings; + print.validate(&warnings); + return std::count_if(warnings.begin(), warnings.end(), [](const StringObjectException &w) { + return w.opt_key == "enable_belt_purge_tower"; + }); + }; + + Model model; + Print print; + build_cubes(model, print, config, /*n=*/2, /*overlap=*/false); + model.objects[1]->config.set_key_value("extruder", new ConfigOptionInt(2)); + print.apply(model, config); + REQUIRE(print.extruders().size() > 1); + CHECK(purge_warnings(print) == 1); + + model.objects.front()->config.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); + print.apply(model, config); + CHECK(purge_warnings(print) == 0); +} + TEST_CASE("Belt purge rejects multiple managed purge objects", "[Print][PurgeTower][Regression]") { DynamicPrintConfig config = multifilament_config(2, { From 412564cae3e72caae3d626962e9065df99dd9621 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:11:59 -0500 Subject: [PATCH 185/389] Belt: document the frame of the exclude-object outlines EXCLUDE_OBJECT_DEFINE keeps plate coordinates on a belt printer: the frame after the slicing rotation is undone and before the G-code axis remap and machine-frame shear, which is where the object stands on the belt. Raised in Hanif Koh's review of #14394. --- src/libslic3r/GCode.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 151efbf6b2..360e35cae2 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -10289,6 +10289,10 @@ std::string GCode::set_object_info(Print *print) { for (PrintInstance& inst : object->instances()) { inst.unique_id = unique_id++; inst.id = inst_id++; + // Outlines are in plate coordinates. On a belt printer that is the frame after + // the slicing rotation has been undone and before the G-code axis remap and + // machine-frame shear: where the object stands on the belt, which is what an + // object picker shows. Klipper cancels by name, so nothing depends on more. auto bbox = inst.get_bounding_box(); auto center = print->translate_to_print_space(Vec2d(bbox.center().x(), bbox.center().y())); auto inst_name = get_instance_name(object, inst); From 3beb448ae6ffb082dfd685996784ac40d4672a19 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:13:29 -0500 Subject: [PATCH 186/389] Belt brim: lattice lines closer to the belt than the band fraction move uphill With a first layer of about 0.28 mm or more at 45 degrees (or a shallower belt) the brim band is wider than one bead and its lines go on the nominal lattice. A lattice line could land where the belt is almost at the band's print_z; its flow was clamped to half a layer while the nozzle sat nearly on the belt. Such a line now moves uphill to the 0.75 fraction the single-line case uses, and a line that lands on the previous one is skipped. Ported from the Unlayered fork (patch 0007 of its belt port series, found there by fuzzing first layer heights). The fork's companion fix, restricting the brim filament to those the writer was handed (0008), is not needed here: ToolOrdering registers the brim filament on every band's layer, so the writer always has it. A test pins that with every object a flush target. --- src/libslic3r/BeltBrim.cpp | 40 ++++++++++++++------ tests/fff_print/test_skirt_brim.cpp | 58 +++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 12 deletions(-) diff --git a/src/libslic3r/BeltBrim.cpp b/src/libslic3r/BeltBrim.cpp index fa119c6609..92877ef0aa 100644 --- a/src/libslic3r/BeltBrim.cpp +++ b/src/libslic3r/BeltBrim.cpp @@ -1,3 +1,4 @@ +#include #include "BeltBrim.hpp" #include "ClipperUtils.hpp" @@ -284,7 +285,33 @@ static void belt_brim_band_paths(const BeltBrimContext &bc, // must not be pooled before the flow is resolved. // Overshoot the region so the clip, not the line's ends, decides the extent. const coord_t margin = coord_t(SCALED_EPSILON) + 1; - for (const coord_t u : us) { + coord_t u_prev = std::numeric_limits::min(); + for (coord_t u : us) { + // Nozzle-to-belt clearance for this line. Constant along the line, because the + // belt height depends only on the shear-axis coordinate. Band-anchored lines + // share one clearance by construction; lattice lines (shallow belts, or a first + // layer thick enough that the band is wider than a bead) each get their own. + // + // A lattice line can fall where the belt is only a hair below the band's print_z. + // The bead there would be laid scraping the belt while its flow is sized for a + // taller cell, so it is moved uphill to the same fraction of the band the + // single-line case uses. (The clearance is along slice Z; the real gap under the + // nozzle is clearance x cos(tilt), 0.53 h at 45 degrees for the 0.75 fraction.) + double clearance = uniform_clearance; + if (clearance <= 0.) { + const Point probe = bc.frame.from_axis == 0 ? Point(u, 0) : Point(0, u); + clearance = print_z - bc.ctx.floor_print_z(probe); + if (clearance < BAND_CLEARANCE_FRACTION * height) { + clearance = BAND_CLEARANCE_FRACTION * height; + u = scale_(bc.ctx.cutoff_u(print_z - clearance)); + } + clearance = std::min(clearance, height); + } + // Two lattice lines moved to the same place are one line. + if (u == u_prev) + continue; + u_prev = u; + Polyline line; if (bc.frame.from_axis == 0) line.points = { Point(u, coord_t(bc.region_bbox.min.y() - margin)), @@ -299,17 +326,6 @@ static void belt_brim_band_paths(const BeltBrimContext &bc, if (pieces.empty()) continue; - // Nozzle-to-belt clearance for this line. Constant along the line, because the - // belt height depends only on the shear-axis coordinate. Band-anchored lines - // share one clearance by construction; lattice lines (shallow belts) each get - // their own, clamped so neither end of a band yields an unprintable bead. - double clearance = uniform_clearance; - if (clearance <= 0.) { - const Point probe = bc.frame.from_axis == 0 ? Point(u, 0) : Point(0, u); - clearance = print_z - bc.ctx.floor_print_z(probe); - clearance = std::min(std::max(clearance, 0.5 * height), height); - } - // with_cross_section, not with_height: it reaches the prescribed volume while // KEEPING the extrusion spacing, so the bead is sized to fill exactly one // pitch x clearance cell of the sheet. diff --git a/tests/fff_print/test_skirt_brim.cpp b/tests/fff_print/test_skirt_brim.cpp index 5fa810106f..edd2f0a56a 100644 --- a/tests/fff_print/test_skirt_brim.cpp +++ b/tests/fff_print/test_skirt_brim.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "test_helpers.hpp" // get access to init_print, etc @@ -1195,3 +1196,60 @@ TEST_CASE("Belt brim coexists with support material", "[SkirtBrim][belt]") REQUIRE(! gc.empty()); CHECK(role_passes(gc, "brim") > 0); } + +// With a 0.3 mm first layer at 45 degrees the brim band on the belt is wider than one bead, +// so its lines go on the nominal lattice instead of at a fixed fraction of the band. A +// lattice line can then land where the belt is almost at the band's print_z; it must be +// moved uphill to the same 0.75 fraction the single-line case uses, not laid scraping the +// belt with its flow clamped to half a layer. +TEST_CASE("Belt brim lattice lines keep their clearance above the belt", "[SkirtBrim][belt]") +{ + DynamicPrintConfig config = belt_brim_config(); + config.set_deserialize_strict({ + { "layer_height", 0.3 }, + { "initial_layer_print_height", 0.3 }, + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "brim_object_gap", 0 }, + }); + const std::string gcode = slice({ cube(20) }, config); + + // Heights of the brim extrusions, from the ;HEIGHT: tags inside ;TYPE:Brim sections. + std::vector brim_heights; + bool in_brim = false; + std::istringstream lines(gcode); + for (std::string line; std::getline(lines, line); ) { + if (boost::starts_with(line, ";TYPE:")) + in_brim = boost::starts_with(line, ";TYPE:Brim"); + else if (in_brim && boost::starts_with(line, ";HEIGHT:")) + brim_heights.push_back(std::stod(line.substr(8))); + } + REQUIRE(! brim_heights.empty()); + for (const double h : brim_heights) { + CHECK(h >= 0.75 * 0.3 - 1e-3); + CHECK(h <= 0.3 + 1e-3); + } +} + +// The brim prints in the object's outer wall filament even when every extrusion of the object +// is offered to purging (flush_into_objects): the tool ordering registers the brim filament +// itself, so the writer always knows it. +TEST_CASE("Belt brim slices when every object is a flush target", "[SkirtBrim][belt]") +{ + DynamicPrintConfig config = belt_brim_multifilament_config(2, { + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "brim_object_gap", 0 }, + { "flush_into_objects", 1 }, + { "flush_into_infill", 1 }, + }); + const std::vector> overrides { + { { "extruder", 1 } }, { { "extruder", 2 } }, + }; + Print print; + Model model; + init_print({ cube(20), cube(20) }, print, model, config, &overrides); + REQUIRE(print.validate().string.empty()); + const std::string out = gcode(print); + CHECK(out.find(";TYPE:Brim") != std::string::npos); +} From 1b392955de708bef61851650a347aa465fcb9fb9 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:13:29 -0500 Subject: [PATCH 187/389] tests: organic tree supports reaching the belt slice without a negative flow Covers the case from Hanif Koh's review of #14394 (belt raft layers below the object with no lower bound), which the negative-Z bottom layer fix in layer_initialize() addresses. --- tests/fff_print/test_print.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index f9c9528461..5b3baf7dc5 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -681,3 +681,32 @@ TEST_CASE("Belt printers switch the part fan by height above the belt", "[Print] CHECK(fan_off > 10); CHECK(fan_on > 10); } + +// Organic supports under an overhang on a belt printer reach below the object's first layer, +// where the virtual belt raft layers sit at negative Z. The lowest of them used to get a +// negative height and abort slicing with a negative flow error. +TEST_CASE("Belt printers slice organic tree supports that reach the belt", "[Print][belt][Support]") +{ + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "belt_printer", 1 }, + { "belt_slice_rotation", "x" }, + { "belt_slice_rotation_angle", 45 }, + { "belt_slice_rotation_global", 1 }, + { "gcode_remap_x", "rev_x" }, + { "gcode_remap_y", "pos_z" }, + { "gcode_remap_z", "pos_y" }, + { "layer_height", 0.2 }, + { "initial_layer_print_height", 0.2 }, + { "skirt_loops", 0 }, + { "z_hop", 0 }, + { "enable_support", 1 }, + { "support_type", "tree(auto)" }, + { "support_style", "organic" }, + { "machine_start_gcode", "T[initial_tool]\n" }, + { "layer_change_gcode", "G92 E0\n" }, + }); + std::string gcode; + REQUIRE_NOTHROW(gcode = slice({ TestMesh::overhang }, config)); + CHECK(! gcode.empty()); +} From 461063856d5184fc0e927c405bb61aff55e7a519 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 02:33:14 -0500 Subject: [PATCH 188/389] tests: fix two belt test expectations The clearance test needs the relative-E reset in its layer change G-code to get past validate()'s other checks, and now asserts the height message. The fan band test counts cycles rather than commands: the band is decided per path start, so a cube cycles the fan far less often than a benchy. --- tests/fff_print/test_print.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index 5b3baf7dc5..b07c8c986a 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -609,6 +609,7 @@ TEST_CASE("Belt printers refuse an object taller than the gantry clearance", "[P { "gcode_remap_z", "pos_y" }, { "printable_height", printable_height }, { "skirt_loops", 0 }, + { "layer_change_gcode", "G92 E0\n" }, }); return config; }; @@ -623,7 +624,7 @@ TEST_CASE("Belt printers refuse an object taller than the gantry clearance", "[P Print print; Model model; init_print({ cube(60) }, print, model, belt_config(50)); - CHECK_FALSE(print.validate().string.empty()); + CHECK(print.validate().string.find("height") != std::string::npos); } } @@ -664,22 +665,21 @@ TEST_CASE("Belt printers switch the part fan by height above the belt", "[Print] // The tags are consumed by the cooling buffer and never reach the file. CHECK(gcode.find(";_BELT_BAND") == std::string::npos); - size_t fan_off = 0, fan_on = 0; + // The fan commands in order: '0' off, '1' on. + std::string fan_sequence; GCodeReader parser; parser.parse_buffer(gcode, [&](GCodeReader &, const GCodeReader::GCodeLine &line) { if (line.cmd_is("M107")) - ++ fan_off; + fan_sequence += '0'; else if (line.cmd_is("M106")) { float s = 0.f; - if (line.has_value('S', s) && s <= 0.f) - ++ fan_off; - else - ++ fan_on; + fan_sequence += (line.has_value('S', s) && s <= 0.f) ? '0' : '1'; } }); - // A flat-bed print turns the fan on once. Here it cycles with the layers. - CHECK(fan_off > 10); - CHECK(fan_on > 10); + // A flat-bed print turns the fan on once and leaves it on. Here it goes off again for + // paths that start back down at the belt, and on again above it. + INFO("fan sequence: " << fan_sequence); + CHECK(fan_sequence.find("101") != std::string::npos); } // Organic supports under an overhang on a belt printer reach below the object's first layer, From 441ae8e877378105b907824abe321d1256ae6119 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 02:36:13 -0500 Subject: [PATCH 189/389] Belt: decide the fan band per extrusion segment A tilted layer runs from the belt to the top of the part, so a wall loop that starts above the belt still passes along it. Tagging only the path's first point left such loops out of the band entirely; the band is now evaluated at each segment, with the tag capped where the fan stops depending on it. --- src/libslic3r/GCode.cpp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 360e35cae2..45910cae00 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -8507,14 +8507,25 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // the speed fade tracks perpendicular distance from the plane on // belt printers; otherwise this falls back to the slicing layer id. const int _layer = this->effective_layer_index_for_point(path_point_mm); - // Belt printers: tell the cooling buffer which band above the belt this path starts in, - // once per layer and at every change (CoolingBuffer::apply_belt_band_fan consumes it). - if (m_enable_cooling_markers && m_config.belt_printer.value && - (m_belt_band_tag_layer != m_layer_index || m_belt_band_tag != _layer)) { - gcode += ";_BELT_BAND:" + std::to_string(_layer) + "\n"; - m_belt_band_tag = _layer; - m_belt_band_tag_layer = m_layer_index; - } + // Belt printers: tell the cooling buffer which band above the belt the next extrusion is + // in (CoolingBuffer::apply_belt_band_fan consumes the tag). A tilted layer runs from the + // belt to the top of the part, so this is decided per segment, not per path; a tag is + // written once per layer and at every change, capped where the fan stops depending on it. + const bool belt_band_tags = m_enable_cooling_markers && m_config.belt_printer.value; + const int belt_band_cap = belt_band_tags + ? std::max(m_config.close_fan_the_first_x_layers.get_at(m_writer->filament()->id()), + m_config.full_fan_speed_layer.get_at(m_writer->filament()->id())) + 1 : 0; + auto tag_belt_band = [this, &gcode, belt_band_tags, belt_band_cap, z = path_point_mm.z()](coord_t x, coord_t y) { + if (! belt_band_tags) + return; + const int band = std::min(this->effective_layer_index_for_point(Vec3d(unscale(x), unscale(y), z)), belt_band_cap); + if (m_belt_band_tag_layer != m_layer_index || m_belt_band_tag != band) { + gcode += ";_BELT_BAND:" + std::to_string(band) + "\n"; + m_belt_band_tag = band; + m_belt_band_tag_layer = m_layer_index; + } + }; + tag_belt_band(path.first_point().x(), path.first_point().y()); if (path_on_first_layer || object_layer_over_raft()) { //BBS: for solid infill of first layer, speed can be higher as long as //wall lines have be attached @@ -8999,6 +9010,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, tempDescription += Slic3r::format(" | Old Flow Value: %0.5f Length: %0.5f",oldE, line_length); } } + tag_belt_band((line.a.x() + line.b.x()) / 2, (line.a.y() + line.b.y()) / 2); if (path.z_contoured) { // ZAA: Z anti-aliased extrusion with variable Z per point Vec2d dest2d = this->point_to_gcode(line.b.to_point()); @@ -9129,6 +9141,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, const ProcessedPoint &processed_point = new_points[i]; const ProcessedPoint &pre_processed_point = new_points[i-1]; Vec3d p = this->point_to_gcode_quantized(processed_point.p); + tag_belt_band((pre_processed_point.p.x() + processed_point.p.x()) / 2, (pre_processed_point.p.y() + processed_point.p.y()) / 2); if (m_enable_cooling_markers) { if (enable_overhang_bridge_fan) { cur_fan_enabled = check_overhang_fan(processed_point.overlap, path.role()); From 31494a9836aa417892c1096ffa3a292325a1f6fc Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 02:42:14 -0500 Subject: [PATCH 190/389] tests: give the belt fan band test a band the walls reach --- tests/fff_print/test_print.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index b07c8c986a..8cdd9e3c33 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -649,7 +649,9 @@ TEST_CASE("Belt printers switch the part fan by height above the belt", "[Print] { "initial_layer_print_height", 0.2 }, { "skirt_loops", 0 }, { "z_hop", 0 }, - { "close_fan_the_first_x_layers", 1 }, + // Three layers: the lowest wall of each tilted layer is centred about 0.3 mm above + // the belt (half a line width in from the contact edge), outside a one-layer band. + { "close_fan_the_first_x_layers", 3 }, { "full_fan_speed_layer", 0 }, { "fan_min_speed", 100 }, { "fan_max_speed", 100 }, From bfbf5ad1c28b4f2a3cadfac802dd814f907263d3 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 12:09:59 -0500 Subject: [PATCH 191/389] Arrange: keep a pile aligned to an off-centre point on the bed With best_object_pos away from the bed centre the placer packs the pile inside the bin and then translates it so its centre lands on that point, without checking that it still fits there. A belt printer aims at the leading end of the belt (BabyBelt Pro: 0.5, 0.05), so any pile longer than the 50 mm around that point was pushed past the edge: four 90 mm parts on the 95 x 500 mm belt ended with one across the edge and one outside while 290 mm of belt stayed free. The final alignment now stops the pile at the edge of the bin; the items' inflated boxes leave the object spacing as the margin. A pile that does not fit along an axis is centred on it, as before. --- .../include/libnest2d/placers/nfpplacer.hpp | 22 +++++++++++++++- tests/libslic3r/test_arrange.cpp | 26 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/deps_src/libnest2d/include/libnest2d/placers/nfpplacer.hpp b/deps_src/libnest2d/include/libnest2d/placers/nfpplacer.hpp index dc7733ebd6..cf66c4c97e 100644 --- a/deps_src/libnest2d/include/libnest2d/placers/nfpplacer.hpp +++ b/deps_src/libnest2d/include/libnest2d/placers/nfpplacer.hpp @@ -1111,7 +1111,27 @@ private: default: ; // DONT_ALIGN } - auto d = cb - ci; + auto d = cb - ci; + + // Keep the pile on the bin. A target near an edge (a belt printer starts its parts + // at the leading end of the belt) would otherwise centre a pile that is larger than + // the room around that point on it and push part of the pile off the bed. The pile + // stops at the edge instead; the items' boxes carry their inflation, which is the + // margin left there. A pile that does not fit along an axis is centred on it. + { + auto on_bin = [](Coord lo, Coord hi, Coord bin_lo, Coord bin_hi, Coord shift) { + if (hi - lo >= bin_hi - bin_lo) + return (bin_lo + bin_hi) / 2 - (lo + hi) / 2; + if (lo + shift < bin_lo) + shift = bin_lo - lo; + if (hi + shift > bin_hi) + shift = bin_hi - hi; + return shift; + }; + setX(d, on_bin(getX(bb.minCorner()), getX(bb.maxCorner()), getX(bbin.minCorner()), getX(bbin.maxCorner()), getX(d))); + setY(d, on_bin(getY(bb.minCorner()), getY(bb.maxCorner()), getY(bbin.minCorner()), getY(bbin.maxCorner()), getY(d))); + cb = ci + d; + } // BBS make sure the item won't clash with excluded regions // do we have wipe tower after arranging? diff --git a/tests/libslic3r/test_arrange.cpp b/tests/libslic3r/test_arrange.cpp index 3906cba8ba..a8bc56d2d5 100644 --- a/tests/libslic3r/test_arrange.cpp +++ b/tests/libslic3r/test_arrange.cpp @@ -1,3 +1,4 @@ +#include #include #include "libslic3r/Arrange.hpp" @@ -259,6 +260,31 @@ TEST_CASE("Arrange aligns the pile to a custom center", "[Arrange]") require_no_overlap(items); } +// A belt printer starts its parts at the leading end of the belt (best_object_pos 0.5, 0.05). +// Centring a pile on a point that close to the edge pushed everything longer than the room +// around it off the bed: four 90 mm parts on a 95 x 500 mm belt ended with one across the +// edge and one outside, with 290 mm of belt free behind them. The pile stops at the edge. +TEST_CASE("Arrange keeps a pile aligned near an edge on the bed", "[Arrange]") +{ + const BoundingBox belt = bed(95, 500); + ArrangePolygons items = squares(4, 90.); + ArrangeParams params = quiet_params(scaled(2.)); + params.align_center = Vec2d(0.5, 0.05); + + arrange(items, belt, params); + + coord_t lowest = std::numeric_limits::max(); + for (const ArrangePolygon &ap : items) { + REQUIRE(ap.bed_idx == 0); + const BoundingBox bb = ap.transformed_poly().contour.bounding_box(); + CHECK(belt.contains(bb)); + lowest = std::min(lowest, bb.min.y()); + } + // Snapped to the edge it was aimed at, less the spacing margin, not re-centred. + CHECK(lowest < scaled(10.)); + require_no_overlap(items); +} + TEST_CASE("Sequential print floors the object distance by object height", "[Arrange]") { // The only place sequential-print clearance is enforced. The arrange menu offers From 7a23d9ea2caaef06afdee45514921cf214a8c058 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 12:46:43 -0500 Subject: [PATCH 192/389] Belt slicing: only model parts set the layer range again The filter was lost with the debug logging it shared an #if with, so modifiers and support blockers stretched the sliced range of a belt object. --- src/libslic3r/BeltSliceStrategy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libslic3r/BeltSliceStrategy.cpp b/src/libslic3r/BeltSliceStrategy.cpp index d16819e7db..74d8566000 100644 --- a/src/libslic3r/BeltSliceStrategy.cpp +++ b/src/libslic3r/BeltSliceStrategy.cpp @@ -41,6 +41,7 @@ void BeltSliceStrategy::apply_preslice_transforms(Transform3d &trafo, double min_z = std::numeric_limits::max(); for (const ModelVolume *mv : model_volumes) { + if (!mv->is_model_part()) continue; Transform3d vol_trafo = trafo * mv->get_matrix(); const auto &its = mv->mesh().its; for (const stl_vertex &v : its.vertices) { From 007071bd56988198dacc3e5cf4441b3cd32590a0 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 12:46:44 -0500 Subject: [PATCH 193/389] GCode: skip the second crossing-avoidance pass on a brim apron layer too travel_to runs avoid-crossing a second time after a wipe; that call needs the current Layer as much as the first one does. --- src/libslic3r/GCode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 45910cae00..4227bf7817 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -9461,7 +9461,8 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string // When "Wipe while retracting" is enabled, then extruder moves to another position, and travel from this position can cross perimeters. // Because of it, it is necessary to call avoid crossing perimeters again with new starting point after calling retraction() // FIXME Lukas H.: Try to predict if this second calling of avoid crossing perimeters will be needed or not. It could save computations. - if (last_post_before_retract != this->last_pos() && m_config.reduce_crossing_wall) { + if (last_post_before_retract != this->last_pos() && m_config.reduce_crossing_wall + && m_layer != nullptr) { // A brim apron layer has no Layer to avoid crossing // If in the previous call of m_avoid_crossing_perimeters.travel_to was use_external_mp_once set to true restore this value for next call. if (used_external_mp_once) m_avoid_crossing_perimeters.use_external_mp_once(); From 997fac87526e0ae2e12e9cebed41fa1e164f26be Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 12:46:44 -0500 Subject: [PATCH 194/389] GCodeProcessor: key the belt height-check skip on belt_printer The check was skipped for any machine-frame transform; what makes the printable height meaningless is the belt axis, so ask for that directly. --- src/libslic3r/GCode/GCodeProcessor.cpp | 20 +++++++++++--------- src/libslic3r/GCode/GCodeProcessor.hpp | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index c2aedd8262..bf5d5ea980 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2777,9 +2777,9 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const int // Belt-printer post-gcode shear/scale/post_remap is applied as the final // step of BeltKinematics::to_machine, so MoveVertex.position is - // in the printer's machine frame. Undo it here so XY area and Z height - // checks operate in the build-volume frame that printable_area / - // printable_height are defined in. For non-belt printers + // in the printer's machine frame. Undo it here so the XY area check + // operates in the build-volume frame that printable_area is defined in + // (the height checks below are skipped on belt printers). For non-belt printers // (is_active() == false) apply_inverse is identity and behaviour is // unchanged from before. const bool machine_frame_active = m_machine_frame_transform.is_active(); @@ -2860,11 +2860,12 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const int valid = false; } } - // Belt printers: machine Z is belt travel, which grows without bound over a - // print, while printable_height is the clearance above the belt; the two are - // not comparable, so the over-height check is skipped, as the preview's - // ToolHeightOutside warning already is. - if ( !machine_frame_active && iter->second.max_print_z > plate_printable_height ) { //over height + // Belt printers: the Z recorded here grows with belt travel (machine Z with the + // frame transform, the slicing-frame Z without it), while printable_height is the + // clearance above the belt; the two are not comparable, so the over-height check + // is skipped, as the preview's ToolHeightOutside warning already is. + // Print::validate() checks the object's height against the clearance. + if ( !m_belt_printer && iter->second.max_print_z > plate_printable_height ) { //over height m_result.gcode_check_result.error_code |= (1 << 3); std::pair filament_to_object_id; filament_to_object_id.first = iter->first; @@ -2905,7 +2906,7 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const int } // check printable height - if (!machine_frame_active && (extruder_id < printable_heights.size()) && (iter->second.max_print_z > printable_heights[extruder_id])) { + if (!m_belt_printer && (extruder_id < printable_heights.size()) && (iter->second.max_print_z > printable_heights[extruder_id])) { m_result.gcode_check_result.error_code |= (1 << 1); std::pair filament_to_object_id; filament_to_object_id.first = iter->first; @@ -3076,6 +3077,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config) // bounds rather than machine-frame positions. m_machine_frame_transform.init_from_config(config); m_result.machine_frame_transform_active = m_machine_frame_transform.is_active(); + m_belt_printer = config.belt_printer.value; auto filament_maps = config.option("filament_map"); if (filament_maps != nullptr) { diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 85cc5a7544..6090a55eb6 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -1164,6 +1164,7 @@ class Print; // transform on move positions so bounds checks operate in the // pre-machine-frame (build-volume) frame. MachineFrameTransform m_machine_frame_transform; + bool m_belt_printer{ false }; unsigned int m_line_id; unsigned int m_last_line_id; From 550229b0faa79b93934679b70dff2c36a93e1f10 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 12:46:44 -0500 Subject: [PATCH 195/389] Belt validation: refuse a brim next to a purge tower object The purge plan moves objects onto a common layer grid after the brim bands are built, so the two cannot share a print. The prime tower setting alone still does not block a brim. The missing-prism warning now counts the filaments the objects use, as the GUI does. --- src/libslic3r/GCode/ToolOrdering.cpp | 4 ++-- src/libslic3r/Print.cpp | 12 ++++++++---- tests/fff_print/test_skirt_brim.cpp | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index a59e5aa46b..a9f56a805f 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -1066,8 +1066,8 @@ void ToolOrdering::fill_wipe_tower_partitions(const PrintConfig &config, coordf_ // The `print_z < object_bottom_z` clause reads "below the object" as "raft // gap". On a belt printer that is wrong: the brim apron legitimately prints // below the object's first layer, and treating those layers as raft would put a - // wipe tower at negative Z. Belt brim and the prime tower are mutually - // exclusive (rejected in Print::validate()), so simply drop the clause there. + // wipe tower at negative Z. A belt printer never prints the classic + // prime tower (Print::has_wipe_tower()), so simply drop the clause there. // // Gate on config.belt_printer, NOT on has_belt_brim: every layer below the // object bottom on a belt printer is legitimately a sub-object stream - brim diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 444bf7cde6..66de6d88ee 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1420,10 +1420,14 @@ StringObjectException Print::validate(std::vector *warnin return { L("Draft shield is not compatible with belt printer mode.") }; // Belt brim spans many layers and owns the layers below the object, which - // spiral vase cannot share. The prime tower setting is no obstacle: belt - // printers never print the classic tower, and the belt purge prism is an - // ordinary object that never takes a brim. + // neither the belt purge tower nor spiral vase can share (the purge plan moves + // objects onto a common layer grid after the brim bands are built). The prime + // tower setting alone is no obstacle: it stays on for any multi-filament + // project, and belt printers never print the classic tower. if (this->has_belt_brim()) { + if (this->has_belt_purge_tower()) + return { L("Brim is not compatible with the belt purge tower. " + "Disable one of them.") }; if (m_config.spiral_mode.value) return { L("Brim is not compatible with spiral vase mode on a belt printer. " "Disable one of them.") }; @@ -1558,7 +1562,7 @@ StringObjectException Print::validate(std::vector *warnin // the tower was generated) changes filament with nowhere to purge. if (m_config.belt_printer.value && m_config.enable_belt_purge_tower.value && m_config.print_sequence != PrintSequence::ByObject - && ! m_config.spiral_mode.value && extruders.size() > 1 && ! this->has_belt_purge_tower()) { + && ! m_config.spiral_mode.value && this->object_extruders().size() > 1 && ! this->has_belt_purge_tower()) { StringObjectException warningtemp; warningtemp.string = L("The belt purge tower is enabled but the project has no purge tower object; " "filament changes will not be purged. Open the project in the application " diff --git a/tests/fff_print/test_skirt_brim.cpp b/tests/fff_print/test_skirt_brim.cpp index edd2f0a56a..d762c49421 100644 --- a/tests/fff_print/test_skirt_brim.cpp +++ b/tests/fff_print/test_skirt_brim.cpp @@ -930,6 +930,28 @@ TEST_CASE("Belt inner-only leading brim does not reject the prime tower or spira CHECK(print.validate().string.empty()); CHECK_FALSE(gcode(print).empty()); } + // An actual purge tower object is different: the purge plan moves objects onto a common + // layer grid after the brim bands are built, so the two are still refused together. + SECTION("a brim is refused next to a belt purge tower object") { + DynamicPrintConfig config = belt_brim_multifilament_config(2, { + { "brim_type", "outer_only" }, + { "brim_width", 4 }, + { "brim_object_gap", 0 }, + { "enable_belt_purge_tower", 1 }, + }); + const std::vector> overrides { + { { "extruder", 1 } }, { { "extruder", 2 } }, + }; + Print print; + Model model; + init_print({ cube(20), cube(20) }, print, model, config, &overrides); + CHECK(print.validate().string.empty()); + + model.objects.back()->config.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); + print.apply(model, config); + REQUIRE(print.has_belt_purge_tower()); + CHECK_FALSE(print.validate().string.empty()); + } } TEST_CASE("Belt brim spans many layers instead of one", "[SkirtBrim][belt]") From 5ac0dd19d04d90fc25e3d50d51f15febe04f0ca5 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 12:46:44 -0500 Subject: [PATCH 196/389] Belt brim: no near-duplicate lines in a narrow lattice band A band barely wider than one line got a second line almost on top of the first, and lattice rows could repeat within half a pitch. --- src/libslic3r/BeltBrim.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/BeltBrim.cpp b/src/libslic3r/BeltBrim.cpp index 92877ef0aa..45ef5d14c9 100644 --- a/src/libslic3r/BeltBrim.cpp +++ b/src/libslic3r/BeltBrim.cpp @@ -253,7 +253,10 @@ static void belt_brim_band_paths(const BeltBrimContext &bc, std::vector us; double uniform_clearance = 0.; // 0 => derive per line from its own position double line_pitch = bc.in_plane_pitch; - if (band_in_plane <= bc.in_plane_pitch + EPSILON) { + // One line also serves a band up to half a bead wider than the nominal pitch (a 0.3 mm + // first layer at 45 degrees): its flow is matched to the band, so the bead is that much + // wider. Two lattice lines in such a band would land almost on top of each other. + if (band_in_plane <= 1.5 * bc.in_plane_pitch + EPSILON) { // Steep belt, which is the normal case: the band is narrower than one bead, so // exactly one line fits. Place it at a FIXED fraction of the band rather than // on a nominal-spacing lattice. On a lattice each line lands at an arbitrary @@ -307,8 +310,9 @@ static void belt_brim_band_paths(const BeltBrimContext &bc, } clearance = std::min(clearance, height); } - // Two lattice lines moved to the same place are one line. - if (u == u_prev) + // A line moved uphill can land on, or almost on, its neighbour; two beads closer + // than half a pitch would be laid into the same cell. + if (u_prev != std::numeric_limits::min() && std::abs(u - u_prev) < bc.pitch_u / 2) continue; u_prev = u; From d35af1806a8d6d918c2b24059504f2580502ab3d Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 12:46:44 -0500 Subject: [PATCH 197/389] Belt cooling: keep the fan off in the band inside the layer cooling pass The band was a second pass over the finished layer that fought the fan commands the layer pass had already written (overhang, bridge and resume requests). The generator now marks where each segment enters and leaves the band and the layer pass treats the band as the strongest fan request, so there is one place that decides the fan. --- src/libslic3r/GCode.cpp | 25 ++--- src/libslic3r/GCode.hpp | 5 +- src/libslic3r/GCode/CoolingBuffer.cpp | 151 +++++--------------------- src/libslic3r/GCode/CoolingBuffer.hpp | 19 +--- src/libslic3r/GCode/FanMover.hpp | 5 - tests/fff_print/test_print.cpp | 75 +++++++++---- 6 files changed, 95 insertions(+), 185 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 4227bf7817..f98cf62fc4 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -8507,25 +8507,20 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // the speed fade tracks perpendicular distance from the plane on // belt printers; otherwise this falls back to the slicing layer id. const int _layer = this->effective_layer_index_for_point(path_point_mm); - // Belt printers: tell the cooling buffer which band above the belt the next extrusion is - // in (CoolingBuffer::apply_belt_band_fan consumes the tag). A tilted layer runs from the - // belt to the top of the part, so this is decided per segment, not per path; a tag is - // written once per layer and at every change, capped where the fan stops depending on it. - const bool belt_band_tags = m_enable_cooling_markers && m_config.belt_printer.value; - const int belt_band_cap = belt_band_tags - ? std::max(m_config.close_fan_the_first_x_layers.get_at(m_writer->filament()->id()), - m_config.full_fan_speed_layer.get_at(m_writer->filament()->id())) + 1 : 0; - auto tag_belt_band = [this, &gcode, belt_band_tags, belt_band_cap, z = path_point_mm.z()](coord_t x, coord_t y) { + // Belt printers: a tilted layer runs from the belt to the top of the part, so the + // "first layers" the fan stays off for are a band along the belt. Mark where the + // extrusion enters and leaves it, per segment, for the cooling buffer. + const bool belt_band_tags = m_enable_cooling_markers && m_config.belt_printer.value; + const int belt_band_layers = belt_band_tags ? m_config.close_fan_the_first_x_layers.get_at(m_writer->filament()->id()) : 0; + auto tag_belt_band = [this, &gcode, belt_band_tags, belt_band_layers, z = path_point_mm.z()](coord_t x, coord_t y) { if (! belt_band_tags) return; - const int band = std::min(this->effective_layer_index_for_point(Vec3d(unscale(x), unscale(y), z)), belt_band_cap); - if (m_belt_band_tag_layer != m_layer_index || m_belt_band_tag != band) { - gcode += ";_BELT_BAND:" + std::to_string(band) + "\n"; - m_belt_band_tag = band; - m_belt_band_tag_layer = m_layer_index; + const bool in_band = this->effective_layer_index_for_point(Vec3d(unscale(x), unscale(y), z)) < belt_band_layers; + if (in_band != m_belt_in_band) { + gcode += in_band ? ";_BELT_BAND_START\n" : ";_BELT_BAND_END\n"; + m_belt_in_band = in_band; } }; - tag_belt_band(path.first_point().x(), path.first_point().y()); if (path_on_first_layer || object_layer_over_raft()) { //BBS: for solid infill of first layer, speed can be higher as long as //wall lines have be attached diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index e390bc972f..17221101fd 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -856,9 +856,8 @@ protected: ~BeltFloorObjectGuard() { slot = nullptr; } }; - // Last ";_BELT_BAND" tag written and the layer it was written on (see _extrude()). - int m_belt_band_tag{std::numeric_limits::min()}; - int m_belt_band_tag_layer{std::numeric_limits::min()}; + // The last extrusion segment was inside the belt's first-layer fan band (see _extrude()). + bool m_belt_in_band{false}; std::set m_initial_layer_extruders; std::vector> m_sorted_layer_filaments; diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index 29ab528de5..a47dd2c148 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -1,13 +1,10 @@ #include "../GCode.hpp" #include "CoolingBuffer.hpp" -#include "FanMover.hpp" #include #include #include #include #include -#include -#include #include #include #include @@ -39,8 +36,7 @@ CoolingBuffer::CoolingBuffer(GCode &gcodegen) : m_config(gcodegen.config()), m_t void CoolingBuffer::reset(const Vec3d &position) { - m_belt_band_fan = -1; - m_belt_band_layer_fan = -1; + m_belt_band_active = false; // BBS: add I and J axis to store center of arc m_current_pos.assign(7, 0.f); m_current_pos[0] = float(position.x()); @@ -80,6 +76,9 @@ struct CoolingLine // ORCA: Add support for ironing fan speed control TYPE_IRONING_FAN_START = 1 << 19, TYPE_IRONING_FAN_END = 1 << 20, + // Belt printers: extrusions within the first-layer band above the belt. + TYPE_BELT_BAND_START = 1 << 21, + TYPE_BELT_BAND_END = 1 << 22, }; CoolingLine(unsigned int type, size_t line_start, size_t line_end) : @@ -334,13 +333,9 @@ std::string CoolingBuffer::process_layer(std::string &&gcode, size_t layer_id, b if (flush) { // This is either an object layer or the very last print layer. Calculate cool down over the collected support layers // and one object layer. - const unsigned int extruder_at_start = m_current_extruder; std::vector per_extruder_adjustments = this->parse_layer_gcode(m_gcode, m_current_pos); float layer_time_stretched = this->calculate_layer_slowdown(per_extruder_adjustments); out = this->apply_layer_cooldown(m_gcode, layer_id, layer_time_stretched, per_extruder_adjustments); - // Belt printers: the fan follows each path's height above the belt (see apply_belt_band_fan). - if (out.find(";_BELT_BAND:") != std::string::npos) - out = this->apply_belt_band_fan(std::move(out), layer_time_stretched, extruder_at_start); m_gcode.clear(); } return out; @@ -544,6 +539,10 @@ std::vector CoolingBuffer::parse_layer_gcode(const std:: line.type = CoolingLine::TYPE_IRONING_FAN_START; } else if (boost::starts_with(sline, ";_IRONING_FAN_END")) { // ORCA: Add support for ironing fan speed control line.type = CoolingLine::TYPE_IRONING_FAN_END; + } else if (boost::starts_with(sline, ";_BELT_BAND_START")) { + line.type = CoolingLine::TYPE_BELT_BAND_START; + } else if (boost::starts_with(sline, ";_BELT_BAND_END")) { + line.type = CoolingLine::TYPE_BELT_BAND_END; } else if (boost::starts_with(sline, "G4 ")) { // Parse the wait time. line.type = CoolingLine::TYPE_G4; @@ -885,7 +884,9 @@ std::string CoolingBuffer::apply_layer_cooldown( {CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_START, false}, {CoolingLine::TYPE_IRONING_FAN_START, false}, // ORCA: Add support for ironing fan speed control {CoolingLine::TYPE_FORCE_RESUME_FAN, false}}; - bool need_set_fan = false; + // Belt printers: a band still open from the previous layer has to take the fan back from + // the layer-level speed issued just above. + bool need_set_fan = m_belt_band_active; for (const CoolingLine *line : lines) { const char *line_start = gcode.c_str() + line->line_start; @@ -899,6 +900,8 @@ std::string CoolingBuffer::apply_layer_cooldown( if (new_extruder != m_current_extruder) { m_current_extruder = new_extruder; change_extruder_set_fan(true); + if (m_belt_band_active) + need_set_fan = true; } } new_gcode.append(line_start, line_end - line_start); @@ -951,6 +954,13 @@ std::string CoolingBuffer::apply_layer_cooldown( if (m_additional_fan_speed != -1 && m_config.auxiliary_fan.value) new_gcode += GCodeWriter::set_additional_fan(m_additional_fan_speed); } + else if (line->type & CoolingLine::TYPE_BELT_BAND_START) { + m_belt_band_active = true; + need_set_fan = true; + } else if (line->type & CoolingLine::TYPE_BELT_BAND_END) { + m_belt_band_active = false; + need_set_fan = true; + } else if (line->type & CoolingLine::TYPE_EXTRUDE_END) { // Just remove this comment. } else if (line->type & (CoolingLine::TYPE_ADJUSTABLE | CoolingLine::TYPE_EXTERNAL_PERIMETER | CoolingLine::TYPE_WIPE | CoolingLine::TYPE_HAS_F)) { @@ -1043,7 +1053,15 @@ std::string CoolingBuffer::apply_layer_cooldown( m_current_fan_speed = speed; } }; - if (fan_speed_change_requests[CoolingLine::TYPE_OVERHANG_FAN_START]){ + if (m_belt_band_active) { + // Belt printers: a tilted layer runs from the belt to the top of the part, so + // "the first layers" are a band along the belt rather than the first slicing + // layers. Extrusions GCode::_extrude() marks as inside that band print with the + // fan off, whatever overhang, bridge or resume request is pending, as the first + // layers of a flat bed do. Leaving the band falls through to the branches below. + set_fan(0); + fan_speed_change_requests[CoolingLine::TYPE_FORCE_RESUME_FAN] = false; + } else if (fan_speed_change_requests[CoolingLine::TYPE_OVERHANG_FAN_START]){ set_fan(overhang_fan_speed); } else if (fan_speed_change_requests[CoolingLine::TYPE_INTERNAL_BRIDGE_FAN_START]){ // ORCA: Add support for separate internal bridge fan speed control set_fan(internal_bridge_fan_speed); @@ -1072,115 +1090,4 @@ std::string CoolingBuffer::apply_layer_cooldown( return new_gcode; } -// Pure helper: compute the main fan speed for a given effective layer index. -// Mirrors the inline logic in change_extruder_set_fan but is callable from -// per-tag code in apply_belt_band_fan. -int CoolingBuffer::compute_main_fan_speed(int effective_layer_id, float layer_time, - unsigned int extruder_id) const -{ -#define EXTRUDER_CFG(opt) m_config.opt.get_at(extruder_id) - float fan_min_speed = EXTRUDER_CFG(fan_min_speed); - float fan_max_speed = EXTRUDER_CFG(fan_max_speed); - bool reduce_fan_stop_start_freq = EXTRUDER_CFG(reduce_fan_stop_start_freq); - int close_fan_the_first_x_layers = EXTRUDER_CFG(close_fan_the_first_x_layers); - int full_fan_speed_layer = EXTRUDER_CFG(full_fan_speed_layer); - float slow_down_layer_time = float(EXTRUDER_CFG(slow_down_layer_time)); - float fan_cooling_layer_time = float(EXTRUDER_CFG(fan_cooling_layer_time)); -#undef EXTRUDER_CFG - - if (close_fan_the_first_x_layers <= 0 && full_fan_speed_layer > 0) - close_fan_the_first_x_layers = 1; - - float fan_speed_new = reduce_fan_stop_start_freq ? fan_min_speed : 0.f; - if (effective_layer_id >= close_fan_the_first_x_layers) { - if (layer_time < slow_down_layer_time) { - fan_speed_new = fan_max_speed; - } else if (layer_time < fan_cooling_layer_time) { - double t = (layer_time - slow_down_layer_time) / - (fan_cooling_layer_time - slow_down_layer_time); - fan_speed_new = float(int(floor(t * fan_min_speed + - (1. - t) * fan_max_speed) + 0.5)); - } - if (effective_layer_id + 1 < full_fan_speed_layer) { - float factor = float(effective_layer_id + 1 - close_fan_the_first_x_layers) - / float(full_fan_speed_layer - close_fan_the_first_x_layers); - fan_speed_new = float(std::clamp(int(fan_speed_new * factor + 0.5f), 0, 255)); - } - } else { - fan_speed_new = 0.f; - } - return int(fan_speed_new); -} - -// Belt printers: a layer is a tilted slab, so "the first layer" is not a slicing layer but -// whatever lies within a layer height of the belt. GCode::_extrude() knows each path's -// height above the belt in the slicing frame and tags every change of it with -// ";_BELT_BAND:". This pass turns the tags into part-fan changes -// and strips them. (The G-code itself is in machine coordinates, which is why the band -// is not worked out from the moves here.) -// -// Only the main part-cooling fan is touched; overhang and bridge fans keep the values -// apply_layer_cooldown() gave them. -std::string CoolingBuffer::apply_belt_band_fan(std::string &&gcode_in, float layer_time, unsigned int extruder_at_start) -{ - static constexpr std::string_view band_tag = ";_BELT_BAND:"; - const std::string &gcode = gcode_in; - std::string out; - out.reserve(gcode.size()); - - // Match the PWM floor applied at every other set_fan call in this file. - const unsigned int part_cooling_fan_min_pwm = static_cast(std::max(0, m_config.part_cooling_fan_min_pwm.value)); - unsigned int active_extruder = extruder_at_start; - - const char *p = gcode.data(); - const char *end = p + gcode.size(); - while (p < end) { - const char *line_end = static_cast(std::memchr(p, '\n', end - p)); - if (line_end == nullptr) - line_end = end; - const char *next_line = line_end < end ? line_end + 1 : end; - const std::string_view line(p, line_end - p); - - if (line.size() > band_tag.size() && line.compare(0, band_tag.size(), band_tag) == 0) { - const int eff_idx = std::atoi(std::string(line.substr(band_tag.size())).c_str()); - const bool in_band = eff_idx < std::max(m_config.close_fan_the_first_x_layers.get_at(active_extruder), 1); - int target = this->compute_main_fan_speed(eff_idx, layer_time, active_extruder); - // Clear of the belt and nothing to add: fall back to what the layer asked for. - if (! in_band && target == 0 && m_belt_band_layer_fan >= 0) - target = m_belt_band_layer_fan; - if (target != m_belt_band_fan) { - out += GCodeWriter::set_fan(m_config.gcode_flavor, target, part_cooling_fan_min_pwm); - m_belt_band_fan = target; - } - // The tag itself is dropped. - p = next_line; - continue; - } - - if (! line.empty() && line.front() == 'M') { - // Follow the fan commands of the layer-level cooling. FanMover's parser ignores - // auxiliary and chamber fans (M106 P2, P3...), which must not be taken for the part fan. - const int16_t raw = get_fan_speed(std::string(line), m_config.gcode_flavor); - if (raw >= 0) { - m_belt_band_fan = int(std::lround(double(std::min(raw, 255)) * 100. / 255.)); - m_belt_band_layer_fan = m_belt_band_fan; - } - } else if (line.size() > m_toolchange_prefix.size() && line.compare(0, m_toolchange_prefix.size(), m_toolchange_prefix) == 0) { - char *num_end = nullptr; - const std::string num(line.substr(m_toolchange_prefix.size())); - const long tool = std::strtol(num.c_str(), &num_end, 10); - if (num_end != num.c_str() && tool >= 0) - active_extruder = unsigned(tool); - } - - out.append(p, next_line - p); - p = next_line; - } - - // The fan's real state, so the next layer's cooling re-issues its own speed if it differs. - if (m_belt_band_fan >= 0) - m_current_fan_speed = m_belt_band_fan; - return out; -} - } // namespace Slic3r diff --git a/src/libslic3r/GCode/CoolingBuffer.hpp b/src/libslic3r/GCode/CoolingBuffer.hpp index 0d758b5a5b..e0b5044921 100644 --- a/src/libslic3r/GCode/CoolingBuffer.hpp +++ b/src/libslic3r/GCode/CoolingBuffer.hpp @@ -36,18 +36,6 @@ private: // Returns the adjusted G-code. std::string apply_layer_cooldown(const std::string &gcode, size_t layer_id, float layer_time, std::vector &per_extruder_adjustments); - // Belt printers: turn the ";_BELT_BAND:" tags GCode::_extrude() leaves in the - // layer's G-code into part-fan changes, so the fan follows a path's height above the - // belt rather than the slicing layer index, and strip the tags. - std::string apply_belt_band_fan(std::string &&gcode_in, float layer_time, unsigned int extruder_at_start); - - // Pure helper: compute the main fan speed for a given effective layer - // index (layer-id units, mapped through the plane evaluator) and the - // current extruder. Mirrors the inline logic in the change_extruder_set_fan - // lambda but is callable from per-line code. - int compute_main_fan_speed(int effective_layer_id, float layer_time, - unsigned int extruder_id) const; - // G-code snippet cached for the support layers preceding an object layer. std::string m_gcode; // Internal data. @@ -70,10 +58,9 @@ private: unsigned int m_current_nozzle; //BBS: current fan speed int m_current_fan_speed; - // Belt band pass state, kept across layers. The part fan as this pass last saw or set - // it (percent, -1 unknown), and the last value the layer-level cooling asked for. - int m_belt_band_fan = -1; - int m_belt_band_layer_fan = -1; + // Belt printers: the extrusion being processed lies in the first-layer band above the + // belt (between a ";_BELT_BAND_START" and a ";_BELT_BAND_END"). Kept across layers. + bool m_belt_band_active = false; }; } diff --git a/src/libslic3r/GCode/FanMover.hpp b/src/libslic3r/GCode/FanMover.hpp index 9567e8e2d5..17addd855c 100644 --- a/src/libslic3r/GCode/FanMover.hpp +++ b/src/libslic3r/GCode/FanMover.hpp @@ -27,11 +27,6 @@ public: } }; -// The part-cooling fan value a G-code line sets: the raw S (0..255) of an M106 that -// addresses the part fan, 0 for a fan-off command, -1 for any other line (auxiliary -// and chamber fans included). -int16_t get_fan_speed(const std::string &line, GCodeFlavor flavor); - class FanMover { private: diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index 8cdd9e3c33..e9a98324d9 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -20,6 +20,9 @@ #include "test_utils.hpp" #include +#include +#include +#include #include #include #include @@ -628,13 +631,11 @@ TEST_CASE("Belt printers refuse an object taller than the gantry clearance", "[P } } -// On a belt every tilted layer starts on the belt, so "first layer" cooling is a band along -// the belt, not the first slicing layers: the part fan goes off for the paths that start -// within a layer height of the belt and back on above it, on every layer. The G-code is in -// machine coordinates, so the generator tags the band changes and the cooling buffer -// applies them; before that the buffer compared machine-frame moves with a slicing-frame -// plane and never switched the fan at all. -TEST_CASE("Belt printers switch the part fan by height above the belt", "[Print][belt][Cooling]") +// On a belt every tilted layer starts on the belt, so "the first layers" the fan stays off +// for are a band along the belt, not the first slicing layers. The generator marks where +// each extrusion segment enters and leaves that band and the cooling buffer keeps the fan +// off inside it, on every layer. +TEST_CASE("Belt printers keep the part fan off within the band above the belt", "[Print][belt][Cooling]") { DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); config.set_deserialize_strict({ @@ -649,8 +650,8 @@ TEST_CASE("Belt printers switch the part fan by height above the belt", "[Print] { "initial_layer_print_height", 0.2 }, { "skirt_loops", 0 }, { "z_hop", 0 }, - // Three layers: the lowest wall of each tilted layer is centred about 0.3 mm above - // the belt (half a line width in from the contact edge), outside a one-layer band. + // Three layers, 0.6 mm: the lowest wall of each tilted layer is centred about 0.3 mm + // above the belt (half a line width in from the contact edge). { "close_fan_the_first_x_layers", 3 }, { "full_fan_speed_layer", 0 }, { "fan_min_speed", 100 }, @@ -664,24 +665,50 @@ TEST_CASE("Belt printers switch the part fan by height above the belt", "[Print] const std::string gcode = slice({ cube(20) }, config); REQUIRE(! gcode.empty()); - // The tags are consumed by the cooling buffer and never reach the file. + // The markers are consumed by the cooling buffer and never reach the file. CHECK(gcode.find(";_BELT_BAND") == std::string::npos); - // The fan commands in order: '0' off, '1' on. - std::string fan_sequence; - GCodeReader parser; - parser.parse_buffer(gcode, [&](GCodeReader &, const GCodeReader::GCodeLine &line) { - if (line.cmd_is("M107")) - fan_sequence += '0'; - else if (line.cmd_is("M106")) { - float s = 0.f; - fan_sequence += (line.has_value('S', s) && s <= 0.f) ? '0' : '1'; + // With this axis mapping machine Y is the height above the belt along the gantry. Walk + // the moves with the fan state: extrusions that stay within 0.45 mm of the belt are well + // inside the band and must print with the fan off; extrusions that stay 5 mm clear of it + // must print with it on. The first three slicing layers have the fan off altogether. + size_t in_band = 0, in_band_fan_on = 0, clear = 0, clear_fan_off = 0; + int layer = -1; + bool fan_on = false; + double y = 0.; + std::istringstream lines(gcode); + for (std::string line; std::getline(lines, line); ) { + if (boost::starts_with(line, ";LAYER_CHANGE")) { + ++ layer; + } else if (boost::starts_with(line, "M107")) { + fan_on = false; + } else if (boost::starts_with(line, "M106")) { + const size_t s = line.find('S'); + fan_on = s != std::string::npos && std::atof(line.c_str() + s + 1) > 0.; + } else if (boost::starts_with(line, "G1 ")) { + const size_t comment = line.find(';'); + const std::string cmd = line.substr(0, comment); + const size_t ypos = cmd.find(" Y"), epos = cmd.find(" E"); + if (ypos == std::string::npos) + continue; + const double y_new = std::atof(cmd.c_str() + ypos + 2); + const bool extruding = epos != std::string::npos && std::atof(cmd.c_str() + epos + 2) > 0.; + if (extruding && layer >= 3) { + if (std::max(y, y_new) < 0.45) { + ++ in_band; + in_band_fan_on += fan_on; + } else if (std::min(y, y_new) > 5.) { + ++ clear; + clear_fan_off += ! fan_on; + } + } + y = y_new; } - }); - // A flat-bed print turns the fan on once and leaves it on. Here it goes off again for - // paths that start back down at the belt, and on again above it. - INFO("fan sequence: " << fan_sequence); - CHECK(fan_sequence.find("101") != std::string::npos); + } + CHECK(in_band > 20); + CHECK(in_band_fan_on == 0); + CHECK(clear > 20); + CHECK(clear_fan_off == 0); } // Organic supports under an overhang on a belt printer reach below the object's first layer, From 38df8022e3fa49800fe3aa9036bc55bf0925b9f2 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 3 Oct 2026 12:38:47 +0800 Subject: [PATCH 198/389] Open the Design tab quickly on Windows the first time A page built on first click is now built before it is shown, as the idle prebuild already does, so its controls are not created inside a visible window. This takes the Design tab's first open on Windows from ~9 s to ~1 s. --- docs/HLSD/deferred-page-construction.md | 6 +++++- src/slic3r/GUI/LazyPage.hpp | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/HLSD/deferred-page-construction.md b/docs/HLSD/deferred-page-construction.md index 6a25d16fc3..921468c533 100644 --- a/docs/HLSD/deferred-page-construction.md +++ b/docs/HLSD/deferred-page-construction.md @@ -38,7 +38,11 @@ no wx dependency and is unit-tested. The notebook needs a page object for a tab to exist and for tabs to be inserted and removed by pointer, and the placeholder is that object. It builds the real panel inside itself the first time it is shown and forwards showing and hiding afterwards, so a panel's -own show handling stays its activation hook. Nothing builds while the main window is +own show handling stays its activation hook. The build runs before the placeholder shows +itself, so a panel built on demand is created in a hidden window as a prebuilt one is: on +Windows every control created or moved inside a shown window re-clips and repaints its +shown siblings, which makes building a large panel into a shown page many times slower. +Nothing builds while the main window is hidden; the window's first show builds the start page. A page that is out of the book is not prebuilt. A panel built while its page is hidden stays hidden, and gets the theming the window applied before the panel existed. diff --git a/src/slic3r/GUI/LazyPage.hpp b/src/slic3r/GUI/LazyPage.hpp index fc85f69285..d07ee27b1b 100644 --- a/src/slic3r/GUI/LazyPage.hpp +++ b/src/slic3r/GUI/LazyPage.hpp @@ -57,6 +57,11 @@ public: // virtual from the book's ShowWithEffect() only for wxSHOW_EFFECT_NONE, the default. bool Show(bool show = true) override { + // Built before this page is shown, as an idle prebuild builds it. On MSW every control + // created or moved inside a shown window re-clips and repaints its shown siblings, so + // building a large panel into a shown page took seconds. + if (show && wxGetTopLevelParent(this)->IsShown()) + this->ensure(); const bool changed = wxPanel::Show(show); if (show) { // The book shows its first page as it is inserted, before startup has chosen the From a9c8721380e6264c4abbe7fa139e15f2882d06ee Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 3 Oct 2026 14:15:38 +0800 Subject: [PATCH 199/389] Add a build-large-panels-hidden rule to the orca-wxwidgets skill --- .../orca-wxwidgets/references/orca-architecture.md | 10 +++++++--- .claude/skills/orca-wxwidgets/references/platforms.md | 8 ++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.claude/skills/orca-wxwidgets/references/orca-architecture.md b/.claude/skills/orca-wxwidgets/references/orca-architecture.md index 801494d802..f7e046e108 100644 --- a/.claude/skills/orca-wxwidgets/references/orca-architecture.md +++ b/.claude/skills/orca-wxwidgets/references/orca-architecture.md @@ -403,9 +403,13 @@ page object to insert and remove by pointer). `LazyPage(parent, name, order, fac factory is `new Panel(parent)`. Its `Show(true)` builds the panel the first time (only once the top-level frame is shown — `MainFrame::Show` completes the start page on the frame's first show) and forwards later shows/hides to the panel, so the panel's own `Show()` override stays its activation -hook. A panel built while its page is hidden stays hidden, and `when_built` gives it the dark-UI pass -the frame ran before it existed (`apply_dark_ui_to_lazy_panel`). `pending()` is true only while the page -is in the book. +hook. The build runs before the placeholder's own `wxPanel::Show(true)`, so an on-demand build creates +its controls in a hidden window as a prebuild does: on MSW each control created or moved inside a +shown window re-clips and repaints its shown siblings, which made a large panel's first show take +seconds. A lazy panel's constructor therefore runs off screen (except the start page's) and must not +rely on `IsShownOnScreen()`. A panel built while its page is hidden stays hidden, and `when_built` +gives it the dark-UI pass the frame ran before it existed (`apply_dark_ui_to_lazy_panel`). +`pending()` is true only while the page is in the book. ### Staged construction: StagedBuild diff --git a/.claude/skills/orca-wxwidgets/references/platforms.md b/.claude/skills/orca-wxwidgets/references/platforms.md index f100b02269..3e67324278 100644 --- a/.claude/skills/orca-wxwidgets/references/platforms.md +++ b/.claude/skills/orca-wxwidgets/references/platforms.md @@ -271,6 +271,14 @@ Each bullet names the mechanism and the file that owns it. - **Painting:** in 3.3.2 windows are not double-buffered by default (the 3.3.0 global `WS_EX_COMPOSITED` was reverted, `docs/changes.txt:308`). Custom widgets buffer by hand → `references/painting-custom-widgets.md`. +- **Building large panels:** every control is a native child window, and outside a sizer pass a move + or resize is immediate, repainting when the window is shown [source: `src/msw/window.cpp:2036` + `DoMoveSibling` → `MSWMoveWindowToAnyPosition(..., IsShown())`]; `wxStaticText::SetLabel`/`SetFont` + resize the control that way (`src/common/stattextcmn.cpp:334` `AutoResizeIfNecessary`). Created + inside a shown parent, each control re-clips and erases its shown, overlapping siblings, so the + cost grows with the number already built and hundreds of controls take seconds. Build a large + panel while its parent is hidden and show it once complete — `LazyPage::Show` builds its panel + before showing the page for this reason → `references/orca-architecture.md` §Deferred construction. - **Modal loops:** idle events do not run inside the Windows sizing/moving modal loop, so the 3D canvas renders from `on_paint` on MSW (c06a0223a7) → `references/webview-gl-aui-media.md` §GLCanvas3D rendering. - **Mouse capture:** `wxEVT_MOUSE_CAPTURE_LOST` and `wxEVT_MOUSE_CAPTURE_CHANGED` are delivered → From d47fb804c316a1bebb756ba855cb5ec9d1e69727 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 3 Oct 2026 19:05:41 +0800 Subject: [PATCH 200/389] Make the Design tab sidebar dockable and collapsible like Prepare's The sidebar can move to either side, float, be resized, and collapse with the canvas button or Shift+Tab. Its layout is remembered separately from Prepare's, starts where Prepare's sidebar is, and View > Reset Window Layout resets both tabs. --- .../references/orca-architecture.md | 6 +- .../references/webview-gl-aui-media.md | 35 +++-- .../references/wx-33-changes.md | 2 +- docs/HLSD/design-tab.md | 8 ++ src/slic3r/CMakeLists.txt | 2 + src/slic3r/GUI/AuiMgr.cpp | 80 +++++++++++ src/slic3r/GUI/AuiMgr.hpp | 26 ++++ src/slic3r/GUI/CAD/DesignCanvas.cpp | 15 ++ src/slic3r/GUI/CAD/DesignCanvas.hpp | 6 + src/slic3r/GUI/CAD/DesignPanel.cpp | 130 +++++++++++++++--- src/slic3r/GUI/CAD/DesignPanel.hpp | 15 +- src/slic3r/GUI/GLCanvas3D.cpp | 90 ++++++++---- src/slic3r/GUI/GLCanvas3D.hpp | 10 ++ src/slic3r/GUI/GLToolbar.cpp | 22 +++ src/slic3r/GUI/GLToolbar.hpp | 8 ++ src/slic3r/GUI/MainFrame.cpp | 8 ++ src/slic3r/GUI/Plater.cpp | 121 +++------------- 17 files changed, 420 insertions(+), 164 deletions(-) create mode 100644 src/slic3r/GUI/AuiMgr.cpp create mode 100644 src/slic3r/GUI/AuiMgr.hpp diff --git a/.claude/skills/orca-wxwidgets/references/orca-architecture.md b/.claude/skills/orca-wxwidgets/references/orca-architecture.md index f7e046e108..29f3cb5caa 100644 --- a/.claude/skills/orca-wxwidgets/references/orca-architecture.md +++ b/.claude/skills/orca-wxwidgets/references/orca-architecture.md @@ -617,8 +617,10 @@ Spacing constants come from `SidebarProps` (`Plater.hpp`): `TitlebarMargin()`, ` ### Docking -`Plater::priv` owns `AuiMgr m_aui_mgr` (a `wxAuiManager` subclass whose `CreateFloatingFrame` returns a -themed `FloatFrame : wxAuiFloatingFrame`), managing the plater. Panes: `"sidebar"` (left, no close +Docks are `AuiMgr`s (`AuiMgr.hpp`), a `wxAuiManager` subclass carrying Orca's dock art, theme and +Wayland rule (`references/webview-gl-aui-media.md`). `Plater::priv` owns `m_aui_mgr`, managing the +plater; the Design tab owns its own for its sidebar (`DesignPanel::m_aui`, layout in +`design_window_layout`). Plater panes: `"sidebar"` (left, no close button, not top/bottom dockable), `"main"` (`CenterPane()`, the `panel_3d`), `"uv_editor"` (right, hidden until the texture-displacement gizmo shows it), plus dynamic dock panes. The default perspective is saved right after `AddPane`; the app-config `window_layout` is applied with diff --git a/.claude/skills/orca-wxwidgets/references/webview-gl-aui-media.md b/.claude/skills/orca-wxwidgets/references/webview-gl-aui-media.md index 9ad1f9a4b2..0e6df9f63f 100644 --- a/.claude/skills/orca-wxwidgets/references/webview-gl-aui-media.md +++ b/.claude/skills/orca-wxwidgets/references/webview-gl-aui-media.md @@ -953,11 +953,12 @@ widgets beside the canvas (a sibling, not a child over it), or in a popup. - `wxAuiNotebook` (not used by Orca): page indices are logical; use `GetPagePosition()` for on-screen order (`docs/changes.txt:121-126`); the default tab art changed (`35-37`). -**OrcaSlicer.** `Plater::priv` owns `AuiMgr m_aui_mgr`, a `wxAuiManager` whose `CreateFloatingFrame` -returns `FloatFrame : wxAuiFloatingFrame` (applies `UpdateFrameDarkUI`). -- Setup: `SetManagedWindow(q)` (the Plater), `SetDockSizeConstraint(1, 1)`; on Wayland clears - `wxAUI_MGR_ALLOW_FLOATING` (`disable_wayland_floating`); dock-art metrics set here, colours in the - dark-mode update (`Plater::priv::apply_color_mode`). +**OrcaSlicer.** Orca's docks use `AuiMgr` (`AuiMgr.hpp`), a `wxAuiManager` whose `CreateFloatingFrame` +returns a `wxAuiFloatingFrame` that applies `UpdateFrameDarkUI`. `init(window)` calls +`SetManagedWindow(window)` and `SetDockSizeConstraint(1, 1)`, clears `wxAUI_MGR_ALLOW_FLOATING` on +Wayland and sets the dock-art metrics and colours; `apply_color_mode()` re-colours captions, sashes and +borders and is called from the owner's theme-switch handler. `Plater::priv::m_aui_mgr` manages the +Plater (Prepare and Preview); `DesignPanel::m_aui` manages the Design tab's body below its toolbar. - Panes: `"sidebar"` (left, no close button, not top/bottom dockable, `BestSize` in em units), `"uv_editor"` (right, hidden; forced hidden again after a layout load), `"main"` (`CenterPane().PaneBorder(false)`, holding `panel_3d` with View3D, Preview and AssembleView in one @@ -966,8 +967,8 @@ returns `FloatFrame : wxAuiFloatingFrame` (applies `UpdateFrameDarkUI`). `window_layout` app-config string goes through `sanitize_window_layout_for_wayland` (strips floating/floatable bits on Wayland) and `LoadPerspective(layout, false)`, falling back to the default on failure; then one `Update()`. `Plater::priv::reset` saves `SavePerspective()` back to - `window_layout`. An idle handler copies the docked sidebar width into `BestSize` (wxAUI does not record - a dragged sash there), so the width persists. `Plater::priv::reset_window_layout` is the model for + `window_layout`. `AuiMgr::track_docked_size` copies a docked pane's size into `BestSize` on idle + (wxAUI does not record a dragged sash there), so the width persists. `Plater::priv::reset_window_layout` is the model for re-establishing panes after a load: it loads the default perspective, then re-shows each plugin pane the perspective does not list. - Plugin panes: `Plater::add_dock_pane(window, name, caption, dock, size, on_close)` (window must be a @@ -977,13 +978,27 @@ returns `FloatFrame : wxAuiFloatingFrame` (applies `UpdateFrameDarkUI`). `Destroy()`s without running `on_close`; `show_dock_pane` toggles and updates. Pane names come from `plugin_pane_name` (`DockPanel.cpp`), which replaces `|`, `;`, `=`, `\` — the perspective-string delimiters. +- Other pages: a page outside the Plater docks through its own `AuiMgr` member, since the Plater's + manages only the Plater. Its managed window is a body panel below the page's toolbar; a sidebar + takes `AuiMgr::sidebar_pane_info()`; the layout has its own app-config key, is reset from + `Plater::reset_window_layout`, and is saved by a `shutdown()` called from `MainFrame::shutdown`, + which also detaches a floating pane (Lifetime below). Where floating is disabled it forces + `Dock().Floatable(false)` after loading, as plugin panes do. `DesignPanel` is the model + (`docs/HLSD/design-tab.md`). A `GLCanvas3D` beside such a sidebar gets that sidebar's collapse + button with `set_collapse_toolbar`; without it the canvas falls back to the Plater's button, which + collapses Prepare's sidebar. - Lifetime: no explicit `UnInit`. `m_aui_mgr` is a `Plater::priv` member, so it is destroyed in `~Plater`, before `~wxWindow` destroys the Plater's children (`wxWindowBase::DestroyChildren`, `src/common/wincmn.cpp:586-609`); a floating frame is such a child (`CreateFloatingFrame(m_frame, …)`, `src/aui/framemanager.cpp:3151`), so a pane still floating at that point outlives the manager [source]. - Plugin panes are removed earlier (`MainFrame::shutdown` → `Plater::remove_dock_panes`). The sidebar - `GetPane()` reference captured by the idle lambda is safe across `AddPane`; never `DetachPane` a pane - whose reference is captured. + Plugin panes are removed earlier (`MainFrame::shutdown` → `Plater::remove_dock_panes`). A handler + that can outlive its pane looks the pane up when it runs, as `track_docked_size` does: an idle + handler bound on the pane's window outlives the `DetachPane` in `DesignPanel::shutdown`. Never detach + a pane whose `GetPane()` reference is captured (Pane references above). `DesignPanel::shutdown` is + the model for a member manager: it detaches a + floating sidebar, which `Destroy()`s the frame into the pending-delete list, and the main frame's + deletion deletes pending top-level children before its own children (`~wxTopLevelWindowBase`, + `src/common/toplvcmn.cpp:67-93`), while the panel and its manager are still alive [source]. **Pitfalls.** - **Rule:** Call `Update()` once after a batch of `AddPane`/`wxAuiPaneInfo` changes. diff --git a/.claude/skills/orca-wxwidgets/references/wx-33-changes.md b/.claude/skills/orca-wxwidgets/references/wx-33-changes.md index 4a292d89af..3af66805c9 100644 --- a/.claude/skills/orca-wxwidgets/references/wx-33-changes.md +++ b/.claude/skills/orca-wxwidgets/references/wx-33-changes.md @@ -198,7 +198,7 @@ change, its line, and what it means for Orca. | `wxAuiGenericTabArt` subclasses (also via `wxAuiMSWTabArt`) override `DrawPageTab()`/`GetPageTabSize()` instead of `DrawTab()`/`GetTabSize()`; direct `wxAuiTabArt` subclasses still work | :115-120 | none: no Orca tab art | | `wxAuiNotebook` page index is logical (reorder-independent); `GetPagePosition()` gives the screen position | :122-126 | none; index math under `wxAUI_NB_TAB_MOVE` is what breaks | | `wxListbook`/`wxChoicebook` interpret mnemonics in page titles "just as the other wx*book classes already did" | :128-130 | Orca uses neither (`BedShapeDialog` uses `wxSimplebook` + a combo); every book interprets `&` (`interface/wx/bookctrl.h:141-147`) → rule 11 | -| `wxAUI_MGR_HINT_FADE` is not in the default `wxAuiManager` style | :132-133 | Plater's `AuiMgr` keeps the default flags (minus `wxAUI_MGR_ALLOW_FLOATING` on Wayland, `Plater::priv::priv`), so the docking hint no longer fades; add the flag if wanted | +| `wxAUI_MGR_HINT_FADE` is not in the default `wxAuiManager` style | :132-133 | Orca's `AuiMgr` keeps the default flags (minus `wxAUI_MGR_ALLOW_FLOATING` on Wayland, `AuiMgr::init`), so the docking hint no longer fades; add the flag if wanted | | `wxPrintDialogData::SetAllPages(false)`/`SetSelection(false)` changed meaning | :135-137 | none | | `wxGetTranslation()` returns `wxString` by value | :139-142 | pitfall below | | `wxWindow::Raise()` no longer shows a hidden window on any port | :144-146 | pitfall below; ba867cc534 | diff --git a/docs/HLSD/design-tab.md b/docs/HLSD/design-tab.md index 49a4e7256b..20299a51a0 100644 --- a/docs/HLSD/design-tab.md +++ b/docs/HLSD/design-tab.md @@ -204,6 +204,14 @@ The tab is a page of Orca's main window and answers to the same settings as Prep - **Undo.** The tab keeps its own history (the recipe is not part of Prepare's snapshots), but it has no Undo/Redo of its own: the top bar, `Ctrl+Z` and Edit drive it while the tab is shown, greyed to what an undo would actually do. +- **Docking.** The sidebar docks like Prepare's — either side, floating, resized, or collapsed + with the canvas's collapse button or `Shift+Tab` — through its own AUI manager under the + toolbar, because Prepare's manages the Plater and the Plater is not on this page. The button is + the canvas's own toolbar rather than Prepare's, which collapses Prepare's sidebar. The layout, + collapse included, is kept apart from Prepare's (`design_window_layout`) and starts where + Prepare's sidebar is, at its width, so the canvas edge holds still across the tab switch until + the user moves one of them. A floating sidebar is a top-level window, so it is hidden with the + tab rather than left over the other pages, and View > Reset Window Layout resets both tabs. ## The offer is generated, not hand-written diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index 67c4080b56..9611c0fa68 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -147,6 +147,8 @@ set(SLIC3R_GUI_SOURCES GUI/WebPanel.hpp GUI/Widgets/WebHosting.cpp GUI/Widgets/WebHosting.hpp + GUI/AuiMgr.cpp + GUI/AuiMgr.hpp GUI/AuiPaneLayout.cpp GUI/AuiPaneLayout.hpp GUI/DragCanvas.cpp diff --git a/src/slic3r/GUI/AuiMgr.cpp b/src/slic3r/GUI/AuiMgr.cpp new file mode 100644 index 0000000000..d1c8fdb1ab --- /dev/null +++ b/src/slic3r/GUI/AuiMgr.cpp @@ -0,0 +1,80 @@ +#include "AuiMgr.hpp" + +#include "GUI_App.hpp" +#ifdef __WXGTK__ +#include "LinuxDisplayBackend.hpp" +#endif + +#include +#include + +namespace Slic3r { namespace GUI { + +namespace { + +// TODO: listen on dark ui change +class FloatFrame : public wxAuiFloatingFrame +{ +public: + FloatFrame(wxWindow* parent, wxAuiManager* ownerMgr, const wxAuiPaneInfo& pane) : wxAuiFloatingFrame(parent, ownerMgr, pane) + { + wxGetApp().UpdateFrameDarkUI(this); + } +}; + +} // namespace + +void AuiMgr::init(wxWindow* window) +{ + SetManagedWindow(window); + SetDockSizeConstraint(1, 1); +#ifdef __WXGTK__ + // Floating and its docking hints need global pointer positions and window moves, which Wayland does not provide. + if (is_running_on_wayland()) + SetFlags(GetFlags() & ~wxAUI_MGR_ALLOW_FLOATING); +#endif + GetArtProvider()->SetMetric(wxAUI_DOCKART_CAPTION_SIZE, 18); + GetArtProvider()->SetMetric(wxAUI_DOCKART_GRADIENT_TYPE, wxAUI_GRADIENT_NONE); + apply_color_mode(); +} + +void AuiMgr::apply_color_mode() +{ + const bool is_dark = wxGetApp().dark_mode(); + const wxColour sash_color = is_dark ? wxColour(38, 46, 48) : wxColour(206, 206, 206); + GetArtProvider()->SetColour(wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR, sash_color); + GetArtProvider()->SetColour(wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR, *wxWHITE); + GetArtProvider()->SetColour(wxAUI_DOCKART_SASH_COLOUR, sash_color); + GetArtProvider()->SetColour(wxAUI_DOCKART_BORDER_COLOUR, is_dark ? *wxBLACK : wxColour(165, 165, 165)); +} + +void AuiMgr::track_docked_size(wxWindow* window) +{ + window->Bind(wxEVT_IDLE, [this, window](wxIdleEvent& evt) { + wxAuiPaneInfo& pane = GetPane(window); + if (pane.IsOk() && pane.IsShown() && pane.IsDocked() && pane.rect.GetWidth() > 0 && pane.rect.GetHeight() > 0) { + const bool horizontal = pane.dock_direction == wxAUI_DOCK_TOP || pane.dock_direction == wxAUI_DOCK_BOTTOM; + pane.BestSize(horizontal ? pane.best_size.GetWidth() : pane.rect.GetWidth(), + horizontal ? pane.rect.GetHeight() : pane.best_size.GetHeight()); + } + evt.Skip(); + }); +} + +wxAuiPaneInfo AuiMgr::sidebar_pane_info() +{ + return wxAuiPaneInfo() + .Name("sidebar") + .Left() + .CloseButton(false) + .TopDockable(false) + .BottomDockable(false) + .BestSize(wxSize(39 * wxGetApp().em_unit(), 90 * wxGetApp().em_unit())); +} + +wxAuiFloatingFrame* AuiMgr::CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& pane) +{ + return new FloatFrame(parent, this, pane); +} + +}} // namespace Slic3r::GUI diff --git a/src/slic3r/GUI/AuiMgr.hpp b/src/slic3r/GUI/AuiMgr.hpp new file mode 100644 index 0000000000..57b3950b93 --- /dev/null +++ b/src/slic3r/GUI/AuiMgr.hpp @@ -0,0 +1,26 @@ +#pragma once + +#include + +namespace Slic3r { namespace GUI { + +// The wxAuiManager behind Orca's docked sidebars: Orca's caption and sash art in both themes, +// floating frames that follow the app theme, and no floating on Wayland. +class AuiMgr : public wxAuiManager +{ +public: + // Manages `window`, whose own wxEVT_SIZE handlers must Skip(). + void init(wxWindow* window); + // Captions, sashes and borders in the current theme. + void apply_color_mode(); + // Keeps the docked size of `window`'s pane in its best_size, which re-docking and a saved layout + // use: wxAUI does not record a dragged sash there. + void track_docked_size(wxWindow* window); + + // A tab's sidebar pane: docked left by default, movable to the right or floating, no close button. + static wxAuiPaneInfo sidebar_pane_info(); + + wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& pane) override; +}; + +}} // namespace Slic3r::GUI diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index 5b1484c05c..adf1ce2a89 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -570,6 +570,21 @@ void DesignCanvas::set_show_bed(bool b) request_repaint(); } +void DesignCanvas::set_sidebar_collapse(std::function side, std::function toggle) +{ + if (!m_canvas || !m_canvas_widget || !setup_collapse_toolbar(m_collapse_toolbar, toggle)) + return; + m_canvas->set_collapse_toolbar(&m_collapse_toolbar, std::move(side)); + m_canvas->enable_collapse_toolbar(true); + // Shift+Tab: the canvas posts this for its sidebar, as Prepare's canvases do. + m_canvas_widget->Bind(EVT_GLCANVAS_COLLAPSE_SIDEBAR, [toggle](SimpleEvent&) { toggle(); }); +} + +void DesignCanvas::set_sidebar_collapse_tooltip(const std::string& tooltip) +{ + m_collapse_toolbar.set_tooltip(m_collapse_toolbar.get_item_id("collapse_sidebar"), tooltip); +} + bool DesignCanvas::is_sketching() const { return m_sketch_tool.is_active(); } void DesignCanvas::cancel_sketch() diff --git a/src/slic3r/GUI/CAD/DesignCanvas.hpp b/src/slic3r/GUI/CAD/DesignCanvas.hpp index 940f6a7604..94cce664d7 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.hpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.hpp @@ -17,6 +17,7 @@ #include "slic3r/GUI/3DBed.hpp" #include "slic3r/GUI/Camera.hpp" +#include "slic3r/GUI/GLToolbar.hpp" #include "libslic3r/Model.hpp" #include "libslic3r/CAD/SketchEngine.hpp" #include "slic3r/GUI/CAD/DesignSketchTool.hpp" @@ -87,6 +88,10 @@ public: void unbind_canvas_event_handlers(); // app close / language switch, from the plater's teardown void reset_canvas_volumes(); void set_show_bed(bool b); // view option: draw the printer bed + plate grid, or not + // The sidebar's collapse button, as Prepare's: drawn on the edge `side` reports, it runs + // `toggle` on a click and on Shift+Tab. Set before the first paint. + void set_sidebar_collapse(std::function side, std::function toggle); + void set_sidebar_collapse_tooltip(const std::string& tooltip); // N: look straight down the sketch plane's normal, keeping the current zoom. A sketch drawn // at an angle is a sketch drawn wrong, and no amount of orbiting by hand lands exactly square. bool view_normal_to_sketch(); @@ -368,6 +373,7 @@ private: wxGLCanvas* m_canvas_widget{nullptr}; GLCanvas3D* m_canvas{nullptr}; int m_sw_gl{-1}; // -1 unknown, 0 hardware GL, 1 software GL + GLToolbar m_collapse_toolbar{GLToolbar::Normal, "Collapse"}; std::function m_on_context_menu; bool m_ctx_bound{false}; // bind the RIGHT_UP handler once, however often the cb is set diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 5b1b64be05..e4335e18e1 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -104,6 +104,7 @@ #include "libslic3r/BuildVolume.hpp" #include "slic3r/GUI/MainFrame.hpp" #include "slic3r/GUI/GUI_ObjectList.hpp" +#include "slic3r/GUI/Shortcuts.hpp" // English-only pin for the Design tab (see design-ux-contract): one lever // de-translates this whole TU so our strings never half-translate against the host's @@ -357,10 +358,12 @@ DesignPanel::DesignPanel(wxWindow* parent) // Left column: a slim feature-tree + docked tool-dialog column. All form // controls are parented to m_form so it can scroll independently of the // live GL viewport. The tool buttons live in the top toolbar (built below). - m_form = new wxScrolledWindow(this, wxID_ANY); + auto* body_panel = new wxPanel(this, wxID_ANY); // below the toolbar, managed by m_aui + m_form = new wxScrolledWindow(body_panel, wxID_ANY); // Explicit token background in both themes, so a theme switch can move it (an inherited // colour stays whatever the theme was when the panel was built). SetBackgroundColour(dp_panel_bg()); + body_panel->SetBackgroundColour(dp_panel_bg()); m_form->SetBackgroundColour(dp_panel_bg()); auto* root = new wxBoxSizer(wxVERTICAL); @@ -3521,7 +3524,9 @@ DesignPanel::DesignPanel(wxWindow* parent) build_phase("sidebar and tool cards"); // Right column: a small view toolbar over the live 3D viewport that mirrors // the CadDocument body. - m_viewport = new DesignCanvas(this); + auto* view_col = new wxPanel(body_panel, wxID_ANY); // the centre pane: sketch banner over the viewport + view_col->SetBackgroundColour(dp_panel_bg()); + m_viewport = new DesignCanvas(view_col); build_phase("3D canvas"); m_viewport->set_on_sketch_commit([this](const SketchProfile& prof, const SketchPlane& plane) { @@ -4339,7 +4344,7 @@ DesignPanel::DesignPanel(wxWindow* parent) // The sketch banner sits ABOVE the viewport rather than floating inside it: a child window // over a wxGLCanvas is a platform argument (it is a native window on GTK and does not // reliably stack over GL), and the banner's job is to be unmissable, not to be clever. - m_sketch_banner = new wxPanel(this, wxID_ANY); + m_sketch_banner = new wxPanel(view_col, wxID_ANY); m_sketch_banner->SetBackgroundColour(wxColour(0, 122, 116)); // Orca teal: not a plate colour m_sketch_banner_txt = new wxStaticText(m_sketch_banner, wxID_ANY, wxString()); m_sketch_banner_txt->SetForegroundColour(*wxWHITE); @@ -4356,16 +4361,33 @@ DesignPanel::DesignPanel(wxWindow* parent) // The bottom 3D-navigator orb handles all view orientation, so no separate view buttons. // Fit view is a double-click on the viewport (the tool intercepts it -> zoom_to_volumes). vcol->Add(m_viewport, 1, wxEXPAND); + view_col->SetSizer(vcol); - // Onshape layout: top toolbar over [ slim left column | center viewport ]. - auto* body = new wxBoxSizer(wxHORIZONTAL); - body->Add(m_form, 0, wxEXPAND); - body->Add(vcol, 1, wxEXPAND); + // Onshape layout: top toolbar over [ slim left column | center viewport ], with the column + // docked like Prepare's sidebar: left by default, movable to the right or floating, resizable + // and collapsible. + m_aui.init(body_panel); + m_aui.AddPane(m_form, AuiMgr::sidebar_pane_info().MinSize(m_form->GetMinSize())); + m_aui.AddPane(view_col, wxAuiPaneInfo().Name("main").CenterPane().PaneBorder(false)); + m_default_layout = m_aui.SavePerspective(); + load_window_layout(); + m_aui.track_docked_size(m_form); + // The collapse button sits on the canvas edge the sidebar is docked on, and is gone while it + // floats. A click arrives inside the canvas's mouse handler, so the relayout waits for it. + m_viewport->set_sidebar_collapse( + [this] { + const wxAuiPaneInfo& sidebar = m_aui.GetPane(m_form); + if (!sidebar.IsOk() || sidebar.IsFloating()) + return CollapseSide::None; + return sidebar.dock_direction == wxAUI_DOCK_RIGHT ? CollapseSide::Right : CollapseSide::Left; + }, + [this] { CallAfter([this] { collapse_sidebar(!m_sidebar_collapsed); }); }); + collapse_sidebar(m_sidebar_collapsed); // the button's tooltip auto* outer = new wxBoxSizer(wxVERTICAL); outer->Add(m_toolbar, 0, wxEXPAND); outer->Add(new wxStaticLine(this, wxID_ANY), 0, wxEXPAND); - outer->Add(body, 1, wxEXPAND); + outer->Add(body_panel, 1, wxEXPAND); SetSizer(outer); // The atlas says a verb is wired; the registrations above say what it runs. Nothing checks @@ -7215,6 +7237,7 @@ void DesignPanel::on_tab_hidden() { if (m_viewport) m_viewport->leave_viewport(); // hand the shared camera back to the editor tabs + update_sidebar_pane(); } void DesignPanel::on_tab_shown() @@ -7232,7 +7255,7 @@ void DesignPanel::on_tab_shown() update_reference_planes(); // entering the Design tab: show the XY/XZ/YZ planes if no object yet if (show_clock.Time() > 100) // a slow first show is what users report; the usual one is not news BOOST_LOG_TRIVIAL(info) << "Design tab shown: bed, project recipe and planes in " << show_clock.Time() << " ms"; - sync_sidebar_width(); // keep the panel as wide as Prepare's so the canvas edge doesn't jump + update_sidebar_pane(); if (m_viewport) m_viewport->force_repaint(); // the page was just re-shown: paint it for real } @@ -7267,6 +7290,7 @@ void DesignPanel::msw_rescale() void DesignPanel::on_sys_color_changed() { + m_aui.apply_color_mode(); // Every chrome colour here was set from a DpToken in the theme that was current at the time. // Move each one, background and text, onto the same token in the new theme; any other colour // (the teal accents, the status colours) is the same in both and stays. @@ -7325,19 +7349,83 @@ void DesignPanel::reset_canvas_volumes() if (m_viewport) m_viewport->reset_canvas_volumes(); } -// Match Prepare's sidebar width instead of hardcoding one. Design used a fixed 264 px against -// Prepare's ~467, so the canvas edge jumped sideways on every tab switch; reading the live width -// also means the two stay aligned if Orca ever changes its sidebar. -void DesignPanel::sync_sidebar_width() +void DesignPanel::shutdown() { - if (m_form == nullptr) return; - Plater* pl = wxGetApp().plater(); - if (pl == nullptr) return; - const int w = pl->sidebar().GetSize().GetWidth(); - if (w < 200) return; // sidebar not laid out yet — keep what we have - if (m_form->GetMinSize().GetWidth() == w) return; - m_form->SetMinSize(wxSize(w, -1)); - Layout(); + wxAuiPaneInfo& sidebar = m_aui.GetPane(m_form); + if (!sidebar.IsOk()) // shut down already, floating: a layout saved now would lack the sidebar + return; + // Saved hidden only when collapsed, whichever tab is shown. + sidebar.Show(!m_sidebar_collapsed); + wxGetApp().app_config->set("design_window_layout", m_aui.SavePerspective().utf8_string()); + // A floating frame is a child of the managed panel and dereferences its manager when it is + // deleted, so it must not outlive m_aui, a member. Detaching queues the frame for deletion, which + // runs before the main frame destroys its children (~wxTopLevelWindowBase deletes pending child + // frames). + if (sidebar.IsFloating()) + m_aui.DetachPane(m_form); +} + +void DesignPanel::reset_window_layout() +{ + load_default_layout(); + collapse_sidebar(false); + update_sidebar_pane(true); +} + +// The sidebar where the user left it, collapsed if it was. +void DesignPanel::load_window_layout() +{ + const wxString saved = wxString::FromUTF8(wxGetApp().app_config->get("design_window_layout")); + if (saved.empty() || !m_aui.LoadPerspective(saved, false)) { + if (!saved.empty()) + BOOST_LOG_TRIVIAL(warning) << "Design tab: failed to restore the saved window layout"; + load_default_layout(); + } + wxAuiPaneInfo& sidebar = m_aui.GetPane(m_form); + m_sidebar_collapsed = !sidebar.IsShown(); + if ((m_aui.GetFlags() & wxAUI_MGR_ALLOW_FLOATING) == 0) // saved where windows can float + sidebar.Dock().Floatable(false); + update_sidebar_pane(true); +} + +// Docked where Prepare's sidebar is, and as wide, so the canvas edge does not move between the tabs. +void DesignPanel::load_default_layout() +{ + m_aui.LoadPerspective(m_default_layout, false); + Plater* plater = wxGetApp().plater(); + const Sidebar::DockingState prepare = plater != nullptr ? plater->get_sidebar_docking_state() : Sidebar::None; + if (prepare == Sidebar::None) + return; + wxAuiPaneInfo& sidebar = m_aui.GetPane(m_form); + if (prepare == Sidebar::Right) + sidebar.Right(); + const int width = plater->sidebar().GetSize().GetWidth(); + if (width >= sidebar.min_size.GetWidth()) // Prepare's sidebar has been laid out + sidebar.BestSize(width, sidebar.best_size.GetHeight()); +} + +// The collapse button on the canvas and Shift+Tab, as in Prepare. +void DesignPanel::collapse_sidebar(bool collapse) +{ + m_sidebar_collapsed = collapse; + if (m_viewport) + m_viewport->set_sidebar_collapse_tooltip(wxGetApp().shortcuts().with_key( + (collapse ? _L("Expand sidebar") : _L("Collapse sidebar")).utf8_string(), Shortcut::CollapseSidebar)); + update_sidebar_pane(); +} + +// The sidebar shows unless collapsed; a floating one also only while the tab is shown, since it is +// a top-level window and does not hide with the page. +void DesignPanel::update_sidebar_pane(bool force_update) +{ + wxAuiPaneInfo& sidebar = m_aui.GetPane(m_form); + const bool show = !m_sidebar_collapsed && (sidebar.IsDocked() || IsShownOnScreen()); + if (sidebar.IsOk() && sidebar.IsShown() != show) { + sidebar.Show(show); + force_update = true; + } + if (force_update) + m_aui.Update(); } void DesignPanel::load_recipe(const std::string& blob) diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index 24c0f48796..4c7bc643ac 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -21,6 +21,7 @@ #include "libslic3r/CAD/CadDocument.hpp" #include "slic3r/GUI/CAD/DesignInteraction.hpp" // CadLevel: what one Esc press means +#include "slic3r/GUI/AuiMgr.hpp" #include "slic3r/GUI/Lazy.hpp" class ComboBox; // Orca dropdown (Widgets/ComboBox.hpp) — replaces wxChoice everywhere here @@ -70,6 +71,8 @@ public: void on_sys_color_changed(); void unbind_canvas_event_handlers(); // app close / language switch, from the plater's teardown void reset_canvas_volumes(); + void shutdown(); // app close / language switch, from MainFrame: save the window layout + void reset_window_layout(); // View > Reset Window Layout, with Prepare's void clear_document(); // New Project / Open Project: drop the document with the project // Rebuild off the UI thread (progress dialog only if it turns out to be slow), so a feature // op on a heavy imported solid does not freeze the window. Returns m_doc.recompute()'s result. @@ -497,6 +500,17 @@ private: wxScrolledWindow* m_form{nullptr}; DesignCanvas* m_viewport{nullptr}; + // Below the toolbar, m_form docks beside the viewport column like Prepare's sidebar: it can + // move to the other side, float, be resized and be collapsed, and the layout is kept between + // sessions. + AuiMgr m_aui; + wxString m_default_layout; + bool m_sidebar_collapsed{false}; + void load_window_layout(); + void load_default_layout(); + void collapse_sidebar(bool collapse); + void update_sidebar_pane(bool force_update = false); + // Top contextual toolbar (parented to the panel, above the form/viewport row). UiMode m_ui_mode{UiMode::Feature}; // Sketch environment banner: a strip across the top of the viewport saying, in words, that @@ -938,7 +952,6 @@ private: int tree_selection() const; // selected feature row, or wxNOT_FOUND int tree_body_selection() const; // selected Parts-list body index, or -1 void refresh_parts(); // rebuild the Bodies list under the feature tree - void sync_sidebar_width(); // keep the panel as wide as Prepare's sidebar void set_tree_selection(int row); static int tree_icon_for(CadFeatureType t); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 050b2acfa3..ebb70d3589 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1440,7 +1440,7 @@ void GLCanvas3D::on_change_color_mode(bool is_dark, bool reinit) { // set dirty to re-generate icon texture m_separator_toolbar.set_icon_dirty(); m_main_toolbar.set_icon_dirty(); - wxGetApp().plater()->get_collapse_toolbar().set_icon_dirty(); + collapse_toolbar().set_icon_dirty(); m_assemble_view_toolbar.set_icon_dirty(); m_gizmos.set_icon_dirty(); } @@ -1972,6 +1972,12 @@ void GLCanvas3D::enable_collapse_toolbar(bool enable) m_collapse_toolbar_enabled = enable; } +void GLCanvas3D::set_collapse_toolbar(GLToolbar* toolbar, std::function side) +{ + m_collapse_toolbar = toolbar; + m_collapse_side = std::move(side); +} + void GLCanvas3D::enable_plate_chrome(bool enable) { m_plate_chrome_enabled = enable; @@ -2052,24 +2058,33 @@ void GLCanvas3D::update_volumes_colors_by_extruder() bool GLCanvas3D::is_collapse_toolbar_on_left() const { - auto state = wxGetApp().plater()->get_sidebar_docking_state(); - return state == Sidebar::Left; + return collapse_side() == CollapseSide::Left; } float GLCanvas3D::get_collapse_toolbar_width() const { - GLToolbar& collapse_toolbar = wxGetApp().plater()->get_collapse_toolbar(); - const auto state = wxGetApp().plater()->get_sidebar_docking_state(); - - return state != Sidebar::None ? collapse_toolbar.get_width() : 0; + return collapse_side() != CollapseSide::None ? collapse_toolbar().get_width() : 0; } float GLCanvas3D::get_collapse_toolbar_height() const { - GLToolbar& collapse_toolbar = wxGetApp().plater()->get_collapse_toolbar(); - const auto state = wxGetApp().plater()->get_sidebar_docking_state(); + return collapse_side() != CollapseSide::None ? collapse_toolbar().get_height() : 0; +} - return state != Sidebar::None ? collapse_toolbar.get_height() : 0; +GLToolbar& GLCanvas3D::collapse_toolbar() const +{ + return m_collapse_toolbar != nullptr ? *m_collapse_toolbar : wxGetApp().plater()->get_collapse_toolbar(); +} + +CollapseSide GLCanvas3D::collapse_side() const +{ + if (m_collapse_side) + return m_collapse_side(); + switch (wxGetApp().plater()->get_sidebar_docking_state()) { + case Sidebar::Left: return CollapseSide::Left; + case Sidebar::Right: return CollapseSide::Right; + default: return CollapseSide::None; + } } bool GLCanvas3D::make_current_for_postinit() { @@ -2274,7 +2289,7 @@ void GLCanvas3D::_render_frame(bool scene_dirty, bool only_init) tooltip = m_assemble_view_toolbar.get_tooltip(); if (tooltip.empty()) - tooltip = wxGetApp().plater()->get_collapse_toolbar().get_tooltip(); + tooltip = collapse_toolbar().get_tooltip(); // BBS #if 0 @@ -3475,7 +3490,7 @@ void GLCanvas3D::on_idle(wxIdleEvent& evt) m_overlay_dirty |= m_assemble_view_toolbar.update_items_state(); // BBS //m_dirty |= wxGetApp().plater()->get_view_toolbar().update_items_state(); - m_overlay_dirty |= wxGetApp().plater()->get_collapse_toolbar().update_items_state(); + m_overlay_dirty |= collapse_toolbar().update_items_state(); // apply() DRAINS the 3D-mouse queue, so only the canvas actually on screen may call it: a // hidden canvas renders nothing, so the motion it swallowed moves the shared camera without // ever being drawn and the next visible frame jumps several states at once. @@ -4267,6 +4282,13 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) // (drag/orbit/wheel) so the camera keeps working over the display-only plate. #ifdef SLIC3R_CAD if (m_design_sketch_tool != nullptr && m_design_sketch_tool->has_display()) { + // Except over the sidebar collapse button, which is drawn over the sketch. + if (collapse_toolbar().on_mouse(evt, *this)) { + if (evt.LeftUp() || evt.MiddleUp() || evt.RightUp()) + mouse_up_cleanup(); + m_mouse.set_start_position_3D_as_invalid(); + return; + } if (evt.LeftDown() && m_canvas != nullptr) m_canvas->SetFocus(); // grab keyboard focus so Delete/keys reach this canvas if (m_design_sketch_tool->on_mouse(evt, *this)) { @@ -4315,7 +4337,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) return; } - if (!mouse_in_layer_editing && wxGetApp().plater()->get_collapse_toolbar().on_mouse(evt, *this)) { + if (!mouse_in_layer_editing && collapse_toolbar().on_mouse(evt, *this)) { if (evt.LeftUp() || evt.MiddleUp() || evt.RightUp()) mouse_up_cleanup(); m_mouse.set_start_position_3D_as_invalid(); @@ -6892,7 +6914,7 @@ void GLCanvas3D::_switch_toolbars_icon_filename() m_main_toolbar.init(background_data); m_assemble_view_toolbar.init(background_data); m_separator_toolbar.init(background_data); - wxGetApp().plater()->get_collapse_toolbar().init(background_data); + collapse_toolbar().init(background_data); // main toolbar { @@ -7320,7 +7342,17 @@ bool GLCanvas3D::_init_view_toolbar() bool GLCanvas3D::_init_collapse_toolbar() { - return wxGetApp().plater()->init_collapse_toolbar(); + if (m_collapse_toolbar == nullptr) + return wxGetApp().plater()->init_collapse_toolbar(); + + // Its owner laid it out; the background needs the GL context. + BackgroundTexture::Metadata background_data; + background_data.filename = m_is_dark ? "toolbar_background_dark.png" : "toolbar_background.png"; + background_data.left = 16; + background_data.top = 16; + background_data.right = 16; + background_data.bottom = 16; + return m_collapse_toolbar->init(background_data); } bool GLCanvas3D::_set_current() @@ -9085,11 +9117,12 @@ void GLCanvas3D::_render_sequential_clearance() void GLCanvas3D::_check_and_update_toolbar_icon_scale() { // Update collapse toolbar - GLToolbar& collapse_toolbar = wxGetApp().plater()->get_collapse_toolbar(); - collapse_toolbar.set_enabled(wxGetApp().plater()->get_sidebar_docking_state() != Sidebar::None); + GLToolbar& collapse_toolbar = this->collapse_toolbar(); + collapse_toolbar.set_enabled(collapse_side() != CollapseSide::None); - // Don't update a toolbar scale, when we are on a Preview - if (wxGetApp().plater()->is_preview_shown()) { + // Don't update a toolbar scale, when we are on a Preview. Asked of this canvas, not of the + // plater: the Design tab's canvas is on screen while the plater's current view may be Preview. + if (m_canvas_type == CanvasPreview) { IMSlider *m_layers_slider = get_gcode_viewer().get_layers_slider(); IMSlider *m_moves_slider = get_gcode_viewer().get_moves_slider(); float sc = get_scale(); @@ -9161,7 +9194,9 @@ void GLCanvas3D::_check_and_update_toolbar_icon_scale() // set minimum scale as a auto scale for the toolbars float new_scale = std::min(new_h_scale, new_v_scale); new_scale /= get_scale(); - if (fabs(new_scale - scale) > 0.05) // scale is changed by 5% and more + // Only a canvas with toolbars to fit sets the shared size: a collapse button alone (the Design + // tab's canvas) always fits at the largest. + if (items_cnt > collapse_toolbar.get_visible_items_cnt() && fabs(new_scale - scale) > 0.05) // scale is changed by 5% and more wxGetApp().set_auto_toolbar_icon_scale(new_scale); } @@ -9243,7 +9278,7 @@ size_t GLCanvas3D::_overlay_signature(const ImDrawData* draw_data) const size_t hash = ImGuiWrapper::draw_data_signature(draw_data); for (size_t state_hash : { m_main_toolbar.get_state_hash(), m_separator_toolbar.get_state_hash(), m_assemble_view_toolbar.get_state_hash(), - wxGetApp().plater()->get_collapse_toolbar().get_state_hash(), + collapse_toolbar().get_state_hash(), m_gizmos.get_overlay_state_hash() }) boost::hash_combine(hash, state_hash); return hash; @@ -10298,18 +10333,17 @@ void GLCanvas3D::_render_collapse_toolbar() const if (!m_collapse_toolbar_enabled) return; - auto& plater = *wxGetApp().plater(); - const auto sidebar_docking_dir = plater.get_sidebar_docking_state(); - if (sidebar_docking_dir == Sidebar::None) { + const CollapseSide side = collapse_side(); + if (side == CollapseSide::None) { return; } - GLToolbar& collapse_toolbar = plater.get_collapse_toolbar(); + GLToolbar& collapse_toolbar = this->collapse_toolbar(); const Size cnv_size = get_canvas_size(); const float top = 0.5f * (float)cnv_size.get_height(); - const float left = sidebar_docking_dir == Sidebar::Right ? 0.5f * (float) cnv_size.get_width() - (float) collapse_toolbar.get_width() : - -0.5f * (float) cnv_size.get_width(); + const float left = side == CollapseSide::Right ? 0.5f * (float) cnv_size.get_width() - (float) collapse_toolbar.get_width() : + -0.5f * (float) cnv_size.get_width(); collapse_toolbar.set_position(top, left); collapse_toolbar.render(*this); @@ -11705,7 +11739,7 @@ bool GLCanvas3D::_deactivate_layersediting_menu() bool GLCanvas3D::_deactivate_collapse_toolbar_items() { - GLToolbar& collapse_toolbar = wxGetApp().plater()->get_collapse_toolbar(); + GLToolbar& collapse_toolbar = this->collapse_toolbar(); if (collapse_toolbar.is_item_pressed("print")) { collapse_toolbar.force_left_action(collapse_toolbar.get_item_id("print"), *this); return true; diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index c844b7ede2..047ae56d9b 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -20,6 +20,7 @@ #include "libslic3r/Line.hpp" #include "slic3r/GUI/Gizmos/GLGizmoBase.hpp" #include +#include #include #include #include @@ -594,6 +595,9 @@ private: mutable float m_sc{1}; mutable float m_paint_toolbar_width; bool m_collapse_toolbar_enabled{true}; + // The collapse button of a sidebar other than Prepare's, from set_collapse_toolbar(). + GLToolbar* m_collapse_toolbar{nullptr}; + std::function m_collapse_side; bool m_plate_chrome_enabled{true}; // Design tab: render the world-axis triad at the bed centre (= modeling origin) instead of // the bed corner. Default false preserves the main editor's corner triad. @@ -1008,6 +1012,10 @@ public: void enable_return_toolbar(bool enable); void enable_separator_toolbar(bool enable); void enable_collapse_toolbar(bool enable); + // A canvas beside a sidebar other than Prepare's shows that sidebar's collapse button: `toolbar`, + // set up with setup_collapse_toolbar(), on the edge `side` reports. Call before the canvas is + // initialized, which loads the toolbar's background. + void set_collapse_toolbar(GLToolbar* toolbar, std::function side); void enable_plate_chrome(bool enable); void set_axes_at_bed_center(bool b) { m_axes_at_bed_center = b; } void set_show_bed(bool b) { m_show_bed = b; } @@ -1374,6 +1382,8 @@ private: // BBS //bool _init_view_toolbar(); bool _init_collapse_toolbar(); + GLToolbar& collapse_toolbar() const; + CollapseSide collapse_side() const; bool _set_current(); bool _set_shown_canvas_current(); diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp index 91afb33370..5f4c8335a5 100644 --- a/src/slic3r/GUI/GLToolbar.cpp +++ b/src/slic3r/GUI/GLToolbar.cpp @@ -1672,5 +1672,27 @@ float GLToolbar::get_scaled_icon_size() return m_layout.icons_size * m_layout.scale; } +bool setup_collapse_toolbar(GLToolbar& toolbar, std::function toggle) +{ + toolbar.set_layout_type(GLToolbar::Layout::Vertical); + toolbar.set_horizontal_orientation(GLToolbar::Layout::HO_Right); + toolbar.set_vertical_orientation(GLToolbar::Layout::VO_Top); + toolbar.set_border(4.0f); + toolbar.set_separator_size(4); + toolbar.set_gap_size(2); + + toolbar.del_all_item(); + + GLToolbarItem::Data item; + + item.name = "collapse_sidebar"; + // set collapse svg name + item.icon_filename = "collapse.svg"; + item.sprite_id = 0; + item.left.action_callback = std::move(toggle); + + return toolbar.add_item(item); +} + } // namespace GUI } // namespace Slic3r diff --git a/src/slic3r/GUI/GLToolbar.hpp b/src/slic3r/GUI/GLToolbar.hpp index 192af7e50d..571f75a35c 100644 --- a/src/slic3r/GUI/GLToolbar.hpp +++ b/src/slic3r/GUI/GLToolbar.hpp @@ -457,6 +457,14 @@ private: bool update_items_enabled_state(); }; +// The canvas edge a sidebar collapse button sits on: the side its sidebar is docked on, or none +// while that sidebar floats. +enum class CollapseSide { None, Left, Right }; + +// Lays `toolbar` out as a sidebar collapse button that runs `toggle`: Prepare's, and those of +// other sidebars (GLCanvas3D::set_collapse_toolbar()). +bool setup_collapse_toolbar(GLToolbar& toolbar, std::function toggle); + } // namespace GUI } // namespace Slic3r diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index a63e5c6443..08aaa2c636 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1249,6 +1249,10 @@ void MainFrame::shutdown() m_plugin_pages.shutdown(); if (m_plater != nullptr) m_plater->remove_dock_panes(); +#ifdef SLIC3R_CAD + if (DesignPanel* design = DesignPanel::if_built()) + design->shutdown(); +#endif #ifdef __WXGTK__ // Edge panels are child windows — wxWidgets destroys them automatically. m_edge_bottom = nullptr; @@ -3377,6 +3381,10 @@ void MainFrame::init_menubar_as_editor() viewMenu, wxID_ANY, _L("Reset Window Layout"), _L("Reset to default window layout"), [this](wxCommandEvent&) { m_plater->reset_window_layout(); }, "", this, [this]() { +#ifdef SLIC3R_CAD + if (shown_design_panel() != nullptr) + return true; +#endif return is_prepare_or_preview_tab() && m_plater->is_sidebar_enabled(); }, this); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 625f1142bd..dd68e542e2 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -191,6 +191,7 @@ #ifdef __WXGTK__ #include "LinuxDisplayBackend.hpp" #endif +#include "AuiMgr.hpp" #include "AuiPaneLayout.hpp" #include "GUI_Utils.hpp" #include "GUI_Factories.hpp" @@ -7111,28 +7112,6 @@ enum ExportingStatus{ EXPORTING_TO_LOCAL }; - -// TODO: listen on dark ui change -class FloatFrame : public wxAuiFloatingFrame -{ -public: - FloatFrame(wxWindow* parent, wxAuiManager* ownerMgr, const wxAuiPaneInfo& pane) : wxAuiFloatingFrame(parent, ownerMgr, pane) - { - wxGetApp().UpdateFrameDarkUI(this); - } -}; - -class AuiMgr : public wxAuiManager -{ -public: - AuiMgr() : wxAuiManager(){} - - virtual wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p) override - { - return new FloatFrame(parent, this, p); - } -}; - // Plater / private struct Plater::priv { @@ -7616,7 +7595,6 @@ struct Plater::priv //BBS: change dark/light mode void on_change_color_mode(SimpleEvent& evt); void on_apple_change_color_mode(wxSysColourChangedEvent& evt); - void apply_color_mode(); void on_update_geometry(Vec3dsEvent<2>&); void on_3dcanvas_mouse_dragging_started(SimpleEvent&); void on_3dcanvas_mouse_dragging_finished(SimpleEvent&); @@ -7829,20 +7807,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) { m_is_dark = wxGetApp().app_config->get("dark_color_mode") == "1"; -#ifdef __WXGTK__ - const bool disable_wayland_floating = Slic3r::GUI::is_running_on_wayland(); -#endif - - m_aui_mgr.SetManagedWindow(q); - m_aui_mgr.SetDockSizeConstraint(1, 1); -#ifdef __WXGTK__ - if (disable_wayland_floating) - m_aui_mgr.SetFlags(m_aui_mgr.GetFlags() & ~wxAUI_MGR_ALLOW_FLOATING); -#endif - //m_aui_mgr.GetArtProvider()->SetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE, 0); - //m_aui_mgr.GetArtProvider()->SetMetric(wxAUI_DOCKART_SASH_SIZE, 2); - m_aui_mgr.GetArtProvider()->SetMetric(wxAUI_DOCKART_CAPTION_SIZE, 18); - m_aui_mgr.GetArtProvider()->SetMetric(wxAUI_DOCKART_GRADIENT_TYPE, wxAUI_GRADIENT_NONE); + m_aui_mgr.init(q); this->q->SetFont(Slic3r::GUI::wxGetApp().normal_font()); @@ -7925,13 +7890,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) update(); // Orca: Make sidebar dockable - m_aui_mgr.AddPane(sidebar, wxAuiPaneInfo() - .Name("sidebar") - .Left() - .CloseButton(false) - .TopDockable(false) - .BottomDockable(false) - .BestSize(wxSize(39 * wxGetApp().em_unit(), 90 * wxGetApp().em_unit()))); + m_aui_mgr.AddPane(sidebar, AuiMgr::sidebar_pane_info()); // UV editor pane for GLGizmoTextureDisplacement's LSCM unwrap preview - a resizable/dockable // sibling of "sidebar"/"main" like everything else registered on this same AUI manager, not a @@ -7983,8 +7942,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) if (!layout.empty()) { bool removed_floating_state = false; #ifdef __WXGTK__ - if (disable_wayland_floating) - layout = sanitize_window_layout_for_wayland(layout, &removed_floating_state); + layout = sanitize_window_layout_for_wayland(layout, &removed_floating_state); #endif if (!m_aui_mgr.LoadPerspective(layout, false)) { @@ -8006,12 +7964,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) // Keep tracking the current sidebar size, by storing it using `best_size`, which will be stored // in the config and re-applied when the app is opened again. - this->sidebar->Bind(wxEVT_IDLE, [&sidebar](wxIdleEvent& e) { - if (sidebar.IsShown() && sidebar.IsDocked() && sidebar.rect.GetWidth() > 0) { - sidebar.BestSize(sidebar.rect.GetWidth(), sidebar.best_size.GetHeight()); - } - e.Skip(); - }); + m_aui_mgr.track_docked_size(this->sidebar); // Hide sidebar initially, will re-show it after initialization when we got proper window size sidebar.Hide(); @@ -8236,8 +8189,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) q->SetDropTarget(new PlaterDropTarget(*main_frame, *q)); // if my understanding is right, wxWindow takes the owenership q->Layout(); - apply_color_mode(); - set_current_panel(wxGetApp().is_editor() ? static_cast(view3D) : static_cast(preview)); // updates camera type from .ini file @@ -8716,18 +8667,7 @@ void Plater::priv::add_dock_pane(wxWindow* window, const std::string& name, cons info.Show(dock_pane_visible(dock_pane, info)); m_aui_mgr.AddPane(window, info); - // wxAUI does not record a dragged sash in best_size, so track the docked size like the sidebar - // does, for the saved layout. - window->Bind(wxEVT_IDLE, [this, window](wxIdleEvent& evt) { - wxAuiPaneInfo& pane = m_aui_mgr.GetPane(window); - if (pane.IsOk() && pane.IsShown() && pane.IsDocked() && pane.rect.GetWidth() > 0 && pane.rect.GetHeight() > 0) { - const bool horizontal = pane.dock_direction == wxAUI_DOCK_TOP || pane.dock_direction == wxAUI_DOCK_BOTTOM; - pane.BestSize(horizontal ? pane.best_size.GetWidth() : pane.rect.GetWidth(), - horizontal ? pane.rect.GetHeight() : pane.best_size.GetHeight()); - } - evt.Skip(); - }); - + m_aui_mgr.track_docked_size(window); m_aui_mgr.Update(); } @@ -13908,7 +13848,7 @@ void Plater::priv::on_apple_change_color_mode(wxSysColourChangedEvent& evt) { assemble_view->get_canvas3d()->on_change_color_mode(m_is_dark); } - apply_color_mode(); + m_aui_mgr.apply_color_mode(); } void Plater::priv::on_change_color_mode(SimpleEvent& evt) { @@ -13919,19 +13859,7 @@ void Plater::priv::on_change_color_mode(SimpleEvent& evt) { assemble_view->get_canvas3d()->on_change_color_mode(m_is_dark); if (m_send_to_sdcard_dlg) m_send_to_sdcard_dlg->on_change_color_mode(); - apply_color_mode(); -} - -void Plater::priv::apply_color_mode() -{ - const bool is_dark = wxGetApp().dark_mode(); - wxColour orca_color = wxColour(59, 68, 70);//wxColour(ColorRGBA::ORCA().r_uchar(), ColorRGBA::ORCA().g_uchar(), ColorRGBA::ORCA().b_uchar()); - orca_color = is_dark ? StateColor::darkModeColorFor(orca_color) : StateColor::lightModeColorFor(orca_color); - wxColour sash_color = is_dark ? wxColour(38, 46, 48) : wxColour(206, 206, 206); - m_aui_mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR, sash_color); - m_aui_mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR, *wxWHITE); - m_aui_mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_SASH_COLOUR, sash_color); - m_aui_mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_BORDER_COLOUR, is_dark ? *wxBLACK : wxColour(165, 165, 165)); + m_aui_mgr.apply_color_mode(); } static void get_position(wxWindowBase* child, wxWindowBase* until_parent, int& x, int& y) { @@ -14592,26 +14520,9 @@ bool Plater::priv::init_collapse_toolbar() if (!collapse_toolbar.init(background_data)) return false; - collapse_toolbar.set_layout_type(GLToolbar::Layout::Vertical); - collapse_toolbar.set_horizontal_orientation(GLToolbar::Layout::HO_Right); - collapse_toolbar.set_vertical_orientation(GLToolbar::Layout::VO_Top); - collapse_toolbar.set_border(4.0f); - collapse_toolbar.set_separator_size(4); - collapse_toolbar.set_gap_size(2); - - collapse_toolbar.del_all_item(); - - GLToolbarItem::Data item; - - item.name = "collapse_sidebar"; - // set collapse svg name - item.icon_filename = "collapse.svg"; - item.sprite_id = 0; - item.left.action_callback = []() { - wxGetApp().plater()->collapse_sidebar(!wxGetApp().plater()->is_sidebar_collapsed()); - }; - - if (!collapse_toolbar.add_item(item)) + if (!setup_collapse_toolbar(collapse_toolbar, []() { + wxGetApp().plater()->collapse_sidebar(!wxGetApp().plater()->is_sidebar_collapsed()); + })) return false; // Now "collapse" sidebar to current state. This is done so the tooltip @@ -18481,7 +18392,15 @@ bool Plater::is_sidebar_collapsed() const { return p->sidebar_layout.is_collapse void Plater::collapse_sidebar(bool collapse) { p->collapse_sidebar(collapse); } Sidebar::DockingState Plater::get_sidebar_docking_state() const { return p->get_sidebar_docking_state(); } -void Plater::reset_window_layout() { p->reset_window_layout(); } +void Plater::reset_window_layout() +{ + p->reset_window_layout(); +#ifdef SLIC3R_CAD + // The Design tab docks its own sidebar. + if (DesignPanel* design = DesignPanel::if_built()) + design->reset_window_layout(); +#endif +} void Plater::add_dock_pane(wxWindow* window, const std::string& name, const wxString& caption, const std::string& dock, const wxSize& size, std::function on_close) From 25f755c43453078e711f84adfd3076b3c8698422 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 3 Oct 2026 21:01:56 +0800 Subject: [PATCH 201/389] Open the Design tab sidebar at Prepare's width instead of its minimum --- .../references/webview-gl-aui-media.md | 15 ++++++++++++++- src/slic3r/GUI/CAD/DesignPanel.cpp | 7 +++++-- src/slic3r/GUI/CAD/DesignPanel.hpp | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.claude/skills/orca-wxwidgets/references/webview-gl-aui-media.md b/.claude/skills/orca-wxwidgets/references/webview-gl-aui-media.md index 0e6df9f63f..b8856b21ca 100644 --- a/.claude/skills/orca-wxwidgets/references/webview-gl-aui-media.md +++ b/.claude/skills/orca-wxwidgets/references/webview-gl-aui-media.md @@ -88,6 +88,7 @@ available; GTK2/WebKit1 is an opt-out configuration the GUI does not support. 24. ImGui text uses `_u8L`; ImGui sizes are physical pixels (scale by `GLCanvas3D::get_scale()`); a font atlas must fit `GL_MAX_TEXTURE_SIZE`. §[ImGui boundary](#the-imgui-layer-boundary) 25. After `AddPane` or any `wxAuiPaneInfo` change, call `wxAuiManager::Update()` once for the batch. + Keep a docked pane hidden until the managed window has been laid out. §[AUI](#wxauimanager-and-orcas-docking) 26. Give every pane a unique, stable `Name()` free of layout delimiters (`|`, `;`, `=`, `\`). §[AUI](#wxauimanager-and-orcas-docking) @@ -920,6 +921,16 @@ widgets beside the canvas (a sibling, not a child over it), or in a popup. - **Update.** "Update() must be invoked after AddPane() or InsertPane() … any number of changes may be made to wxAuiPaneInfo structures (retrieved with wxAuiManager::GetPane), but to realize the changes, Update() must be called" (`interface/wx/aui/framemanager.h:747-756`). Batch, then `Update()` once. +- **Dock size** [source]. The docs limit "any new dock" to a `SetDockSizeConstraint` fraction of the + window (`interface/wx/aui/framemanager.h:660-672`). The source applies it to the managed window's client + size at the `Update()` that creates the dock, sizing the dock from its panes' `best_size` and then + raising it to their `min_size` (`src/aui/framemanager.cpp:2748-2848`); a dock with a resizable pane + keeps that size (`2674-2677`), and resizing the managed window only re-lays the docks out + (`4542-4546`). A pane first shown before its managed window is laid out — a `wxDefaultSize` window is + 20×20 until its first sizer layout (`references/sizers-layout.md`) — docks at that width or its + `min_size` and stays there. Hiding a dock's last shown pane empties it, and the next `Update()` + removes it (`2733-2738`) with any `dock_size` a `LoadPerspective` restored, so the pane comes back + at its `best_size`. - **Names** [source]. A duplicate `Name()` hits `wxFAIL` (silent in Orca); duplicate and empty names get a random identifier (`src/aui/framemanager.cpp:949-1010`), which `LoadPerspective` can never match. `AddPane` rejects a null window, but its "already managed" check looks up `paneInfo.window` @@ -983,7 +994,9 @@ Plater (Prepare and Preview); `DesignPanel::m_aui` manages the Design tab's body takes `AuiMgr::sidebar_pane_info()`; the layout has its own app-config key, is reset from `Plater::reset_window_layout`, and is saved by a `shutdown()` called from `MainFrame::shutdown`, which also detaches a floating pane (Lifetime below). Where floating is disabled it forces - `Dock().Floatable(false)` after loading, as plugin panes do. `DesignPanel` is the model + `Dock().Floatable(false)` after loading, as plugin panes do. A `LazyPage` builds its panel at 20×20 + and lays it out only as the tab shows, so the sidebar stays hidden until the tab is first shown (Dock + size above). `DesignPanel` is the model (`docs/HLSD/design-tab.md`). A `GLCanvas3D` beside such a sidebar gets that sidebar's collapse button with `set_collapse_toolbar`; without it the canvas falls back to the Plater's button, which collapses Prepare's sidebar. diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index e4335e18e1..617699b376 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -7255,6 +7255,7 @@ void DesignPanel::on_tab_shown() update_reference_planes(); // entering the Design tab: show the XY/XZ/YZ planes if no object yet if (show_clock.Time() > 100) // a slow first show is what users report; the usual one is not news BOOST_LOG_TRIVIAL(info) << "Design tab shown: bed, project recipe and planes in " << show_clock.Time() << " ms"; + m_laid_out = true; update_sidebar_pane(); if (m_viewport) m_viewport->force_repaint(); // the page was just re-shown: paint it for real } @@ -7414,12 +7415,14 @@ void DesignPanel::collapse_sidebar(bool collapse) update_sidebar_pane(); } -// The sidebar shows unless collapsed; a floating one also only while the tab is shown, since it is +// The sidebar shows unless collapsed, and not before the tab is first shown: wxAUI caps a new dock at +// the managed panel's width at that Update() and the dock keeps that size, while the panel is 20 px +// wide until the page lays it out. A floating one also shows only while the tab is shown, since it is // a top-level window and does not hide with the page. void DesignPanel::update_sidebar_pane(bool force_update) { wxAuiPaneInfo& sidebar = m_aui.GetPane(m_form); - const bool show = !m_sidebar_collapsed && (sidebar.IsDocked() || IsShownOnScreen()); + const bool show = !m_sidebar_collapsed && m_laid_out && (sidebar.IsDocked() || IsShownOnScreen()); if (sidebar.IsOk() && sidebar.IsShown() != show) { sidebar.Show(show); force_update = true; diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index 4c7bc643ac..0cf670c191 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -506,6 +506,7 @@ private: AuiMgr m_aui; wxString m_default_layout; bool m_sidebar_collapsed{false}; + bool m_laid_out{false}; // the tab has been shown, so the panel has its size void load_window_layout(); void load_default_layout(); void collapse_sidebar(bool collapse); From 488c6d8226a55699f488df4a4457aaf8c6a83d0d Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 3 Oct 2026 10:02:36 -0500 Subject: [PATCH 202/389] Belt profiles: bump the IdeaFormer and Printcepts bundle versions The IR3 V2 and BabyBelt Pro printer profiles changed since the last bump; the updater only installs a strictly newer bundle. --- resources/profiles/IdeaFormer.json | 2 +- resources/profiles/Printcepts.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/profiles/IdeaFormer.json b/resources/profiles/IdeaFormer.json index f9f32d2f3f..ee076dfffb 100644 --- a/resources/profiles/IdeaFormer.json +++ b/resources/profiles/IdeaFormer.json @@ -1,6 +1,6 @@ { "name": "IdeaFormer", - "version": "02.00.00.04", + "version": "02.00.00.05", "force_update": "0", "description": "IdeaFormer belt printer configurations", "machine_model_list": [ diff --git a/resources/profiles/Printcepts.json b/resources/profiles/Printcepts.json index 1abe84873b..cdeda8f04d 100644 --- a/resources/profiles/Printcepts.json +++ b/resources/profiles/Printcepts.json @@ -1,6 +1,6 @@ { "name": "Printcepts", - "version": "01.00.00.02", + "version": "01.00.00.03", "force_update": "0", "description": "Printcepts belt printer configurations", "machine_model_list": [ From 1d06b8576b5ba5f3478ed5d0adbe8dee99efe04e Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sun, 4 Oct 2026 00:01:05 +0800 Subject: [PATCH 203/389] Fix Design tab getting stuck unable to start a new sketch After undo, redo, New Design, a project load, a delete or a reorder, a sketch profile picked beforehand stayed selected even though it was gone. The right-click menu then offered "Sketch profile" over an empty design with Create greyed out. Those operations now clear the selection. The Confirm button no longer stays greyed in a sketch session after a card whose preview was invalid has been closed. Delete and reorder now wait while a sketch or constrain session, the Text dialog, an Insert placement or the move gizmo is open, instead of editing whichever feature took its place in the list. --- src/slic3r/GUI/CAD/DesignCanvas.cpp | 23 +++- src/slic3r/GUI/CAD/DesignCanvas.hpp | 9 +- src/slic3r/GUI/CAD/DesignPanel.cpp | 138 ++++++++++++++---------- src/slic3r/GUI/CAD/DesignPanel.hpp | 12 ++- src/slic3r/GUI/CAD/DesignSketchTool.hpp | 2 + 5 files changed, 120 insertions(+), 64 deletions(-) diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index adf1ce2a89..c638747b89 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -679,12 +679,27 @@ void DesignCanvas::clear_loop_pick() m_sketch_tool.clear_display_pick(); } +void DesignCanvas::clear_solid_pick() +{ + m_sketch_tool.clear_solid_selection(); +} + void DesignCanvas::set_loop_pick(int feature, int region) { m_sketch_tool.set_display_pick(feature, region); request_repaint(); } +int DesignCanvas::loop_pick_feature() const +{ + return m_sketch_tool.display_pick(); +} + +int DesignCanvas::loop_pick_region() const +{ + return m_sketch_tool.display_pick_region(); +} + void DesignCanvas::set_escalate_on_repick(bool on) { m_sketch_tool.set_escalate_on_repick(on); @@ -1472,18 +1487,20 @@ bool DesignCanvas::drawing_in_progress() const bool DesignCanvas::has_any_selection() const { - return m_sketch_tool.has_solid_selection() || m_sketch_tool.sketch_has_selection(); + return m_sketch_tool.has_solid_selection() || m_sketch_tool.sketch_has_selection() + || m_sketch_tool.display_pick() >= 0; } bool DesignCanvas::clear_any_selection() { if (!has_any_selection()) return false; - // Both, unconditionally: which of the two is live depends on the mode, and Esc at idle means - // "nothing is picked" in either of them. clear_selection() reports through the tool's own + // All three, unconditionally: which is live depends on the mode, and Esc at idle means + // "nothing is picked" in any of them. clear_selection() reports through the tool's own // on_selection_changed; the solid side has no such notification, so the panel refreshes what // depends on it (see DesignPanel::escape). m_sketch_tool.clear_selection(); m_sketch_tool.clear_solid_selection(); + m_sketch_tool.clear_display_pick(); // clear_solid_selection() is silent by design (recomputes call it while ids are invalid), but // the panel mirrors the pick to aim Extrude and the dress-up tools. An Esc that cleared the // highlight without telling the panel would leave those aimed at a body nothing points to. diff --git a/src/slic3r/GUI/CAD/DesignCanvas.hpp b/src/slic3r/GUI/CAD/DesignCanvas.hpp index 94cce664d7..5701bd5ec4 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.hpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.hpp @@ -124,7 +124,12 @@ public: // consumed loop must be compared against. std::vector> region_entity_indices_with_holes(const std::vector& ents) const; void clear_loop_pick(); // drop the click-selected loop highlight (e.g. after extrude) + void clear_solid_pick(); // drop the solid pick and its highlight; no callback, no repaint void set_loop_pick(int feature, int region); // adopt a loop pick made before the commit + // The picked committed sketch (feature index, -1 = none) and its closed region (-1 also when + // the click hit a stroke on no closed loop). The panel reads the pick here and keeps no copy. + int loop_pick_feature() const; + int loop_pick_region() const; void set_escalate_on_repick(bool on); // off while a card has armed a face/edge pick // Solid whole/face/edge selection: point the tool at the bodies + concatenated // tessellation (with per-triangle face & body ids), and a callback fired on each @@ -312,8 +317,8 @@ public: bool sketch_disarm_tool(); // CadLevel::Tool — armed sketch tool falls back to Select bool sketch_confirm_pending(); // Enter — apply a ready edit-op or transform bool drawing_in_progress() const;// clicks or picks are down but nothing is committed yet - bool has_any_selection() const; // model pick or sketch pick - bool clear_any_selection(); // CadLevel::Idle — drop both; true if anything was dropped + bool has_any_selection() const; // model pick, committed-loop pick or sketch pick + bool clear_any_selection(); // CadLevel::Idle — drop all three; true if anything was dropped bool sketch_first_selected_type(SketchEntity::Type& out) const; // Live sketch session (Fase 4.2 live constraint path): the panel reads the in-session // selection and entities, and commits a planned constraint through the tool's diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 617699b376..7d4f83824a 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -707,7 +707,8 @@ DesignPanel::DesignPanel(wxWindow* parent) // Onshape push/pull: an explicitly picked solid face (Face-level cycle, no loop // selected) is extruded as the profile — this takes priority over re-extruding an // already-consumed sketch (resolve_extrude_sketch always returns the last Sketch). - if (m_sel_solid_face >= 0 && !m_doc.body.IsNull() && m_sel_sketch_region < 0) { + if (m_sel_solid_face >= 0 && !m_doc.body.IsNull() + && (m_viewport == nullptr || m_viewport->loop_pick_region() < 0)) { m_extrude_face_src = m_sel_solid_face; m_extrude_sketch_ref = -1; open_tool(Tool::Extrude); @@ -3634,8 +3635,6 @@ DesignPanel::DesignPanel(wxWindow* parent) open_tool(Tool::Extrude); // AFTER open_tool, not before: opening the tool re-derives the selection state, so a // region recorded ahead of it is wiped before Extrude ever reads it. - m_sel_sketch_feat = m_extrude_sketch_ref; - m_sel_sketch_region = region; m_sel_solid_face = m_sel_solid_edge = -1; m_pick_face = m_pick_face_body = -1; m_viewport->set_loop_pick(m_extrude_sketch_ref, region); @@ -3644,11 +3643,9 @@ DesignPanel::DesignPanel(wxWindow* parent) // Clicking a committed sketch loop on the plate (no live session) selects THAT loop: // the viewport highlights only it (cyan) and its Sketch feature's tree row is selected. - // The (feature, region) pair is remembered so Extrude builds just that one loop. + // The viewport keeps the (feature, region) pair so Extrude builds just that one loop. m_viewport->set_on_display_sketch_selected([this](int feat, int region, int entity) { if (feat < 0 || feat >= int(m_doc.features.size())) return; - m_sel_sketch_feat = feat; - m_sel_sketch_region = region; // Last pick wins (symmetric with the solid-pick handler): selecting a sketch loop drops // any stale solid face/edge pick so Extrude treats this loop as the profile. m_sel_solid_face = m_sel_solid_edge = -1; @@ -3734,12 +3731,9 @@ DesignPanel::DesignPanel(wxWindow* parent) // but the user pointed AT a face and a sketch should be able to use it. 3a2. m_pick_face_body = (level >= 1) ? body : -1; m_pick_face = (level >= 1) ? face : -1; - // Last pick wins: selecting a solid drops any stale committed-sketch loop selection. - // Otherwise a leftover loop keeps `m_sel_sketch_region >= 0`, which blocks the face - // push/pull branch in Extrude (`m_sel_solid_face >= 0 && m_sel_sketch_region < 0`) and - // makes Extrude build a DETACHED new body from the last sketch instead of push/pulling - // the face the user just clicked. - if (level >= 1) { m_sel_sketch_region = -1; m_sel_sketch_feat = -1; } + // Last pick wins: a leftover loop pick would block Extrude's face push/pull branch, so + // Extrude would extrude a sketch instead of push/pulling the clicked face. + if (level >= 1) m_viewport->clear_loop_pick(); // Say what got picked. Without this the ONLY feedback is the viewport highlight, so a // pick that registers but draws faintly is indistinguishable from one that never // happened — which is precisely how this failure was reported and why it resisted @@ -4471,6 +4465,10 @@ void DesignPanel::set_ui_mode(UiMode m) { m_ui_mode = m; if (m != UiMode::Sketch) m_sketch_on.clear(); // no stale "on the picked face" on the next hint + // A committed loop picked before the session means nothing to the sketch map, but it would + // still count as a selection and swallow the first Esc. The double-click that opens a sketch + // for editing makes one with its first click. + if (m == UiMode::Sketch && m_viewport != nullptr) m_viewport->clear_loop_pick(); // The DoF readout describes a SKETCH's constraint state, so it means nothing back in Feature // mode — where it nonetheless stayed on screen after every Confirm, Cancel and Escape // (752). Cleared here rather than at those three exits because this is the one place @@ -5207,9 +5205,9 @@ void DesignPanel::on_add_sketch() bool DesignPanel::extrude_uses_loop() const { return m_viewport != nullptr - && m_sel_sketch_region >= 0 + && m_viewport->loop_pick_region() >= 0 && m_extrude_sketch_ref >= 0 - && m_extrude_sketch_ref == m_sel_sketch_feat + && m_extrude_sketch_ref == m_viewport->loop_pick_feature() && m_extrude_sketch_ref < int(m_doc.features.size()) && !m_viewport->selected_loop_entities().empty(); } @@ -5236,13 +5234,12 @@ void DesignPanel::on_add_extrude() // other loops intact and still selectable. if (::getenv("ORCA_CAD_PICK_TRACE")) std::fprintf(stderr, "[pick] on_add_extrude: feat=%d reg=%d ents=%zu\n", - m_extrude_sketch_ref, m_sel_sketch_region, + m_extrude_sketch_ref, m_viewport->loop_pick_region(), m_viewport->selected_loop_entities().size()); idx = m_doc.add_extrude_entities(m_viewport->selected_loop_entities(), m_doc.features[m_extrude_sketch_ref].plane, m_distance->GetValue(), false, mode, name); - m_sel_sketch_region = -1; // consume the loop selection - m_viewport->clear_loop_pick(); // drop the now-stale loop highlight + m_viewport->clear_loop_pick(); // consume the loop selection } else { idx = m_doc.add_extrude(m_extrude_sketch_ref, m_distance->GetValue(), false, mode, name); } @@ -6245,7 +6242,12 @@ int DesignPanel::offer_selection_kind() const m_sel_solid_face); return int(GeometryEngine::cylinder_of_face(f).ok ? OfferSel::FaceCyl : OfferSel::FaceOther); } - if (m_sel_sketch_region >= 0) + // Validated like the body index above: a loop pick that names no sketch, or no closed region + // of one, must not title the menu "Sketch profile" and grey Create, which is what a stale one + // did over an empty document. + if (const int lf = m_viewport ? m_viewport->loop_pick_feature() : -1; + lf >= 0 && lf < int(m_doc.features.size()) && m_doc.features[lf].type == CadFeatureType::Sketch + && m_viewport->loop_pick_region() >= 0) return int(OfferSel::SkLoop); if (m_sel_solid_body >= 0 && m_sel_solid_body < nb) return int(CadDocument::is_sheet_shape(m_doc.bodies[m_sel_solid_body].shape) @@ -7447,6 +7449,7 @@ void DesignPanel::load_recipe(const std::string& blob) return; } m_feature_counter = int(m_doc.features.size()); + drop_selection(); feed_bodies(); // push the restored bodies into the viewport refresh_tree(); // rebuild the feature tree from the restored recipe set_status_ok(); @@ -7834,14 +7837,52 @@ void DesignPanel::set_tree_selection(int row) m_tree->SelectItem(m_tree_items[row]); } +// The selection (the solid pick, the hit face and the committed-loop pick) names bodies, faces and +// features by index, so replacing or renumbering the feature list (undo/redo, New Design, load, +// delete, reorder) drops it, the viewport's highlights with it. The solid highlight too: a rebuild +// that leaves no body never reaches set_solid_pick. The callers repaint. +void DesignPanel::drop_selection() +{ + m_sel_solid_body = m_sel_solid_face = m_sel_solid_edge = -1; + m_sel_solid_edges.clear(); + m_sel_solid_vertex = false; + m_pick_face = m_pick_face_body = -1; + if (m_viewport != nullptr) { + m_viewport->clear_loop_pick(); + m_viewport->clear_solid_pick(); + } +} + +// The shared front of delete and reorder, which renumber the feature list. A sketch or constrain +// session, the Text dialog, an Insert placement and the standalone move gizmo can each hold a +// feature or body index (m_edit_index, m_constrain_feat, m_text_feat, m_insert_feat, m_move_body) +// that a renumber would point at something else, so they are refused until Finish or Cancel; Undo +// and mcp_busy() refuse most of the same states. An open feature card is closed instead, +// discarding its candidate, rather than linger out of step with the tree. +bool DesignPanel::begin_renumber() +{ + if (m_ui_mode != UiMode::Feature || m_text_dlg != nullptr || m_active == Tool::Insert + || (m_active == Tool::None && m_viewport != nullptr && m_viewport->moving_body())) { + set_status(StatusKind::Info, _L("Finish or cancel what is open first")); + return false; + } + if (m_active != Tool::None || m_edit_index >= 0) cancel_tool(); + m_doc.checkpoint(); // undo boundary + drop_selection(); + return true; +} + void DesignPanel::after_tree_edit(bool ok) { update_undo_redo_buttons(); refresh_tree(); refresh_variables(); if (!ok) { - // The edit was rolled back (recompute failed); the body is unchanged. + // The edit was refused or rolled back; the body is unchanged. Repaint anyway: picks the + // caller dropped before trying it are still drawn, and set_status() repaints only when + // its text changes. set_status(StatusKind::Error, wxString::Format(_L("Edit rejected: %s"), kernel_error_text(m_doc.error))); + if (m_viewport != nullptr) m_viewport->request_repaint(); return; } sync_recipe_to_model(); // deletes, reorders and suppressions change the document too @@ -7887,6 +7928,7 @@ void DesignPanel::clear_document() m_doc.clear(); // features + bodies + meshes + history m_doc.auto_close_loops = wxGetApp().is_auto_close_sketch_loops(); // a new design: today's preference Slic3r::set_sketch_auto_close(m_doc.auto_close_loops); + drop_selection(); m_edit_index = -1; m_move_body = -1; show_move_card(false); @@ -7920,15 +7962,7 @@ void DesignPanel::on_delete_body() const std::string& raw = m_doc.features[src].name; const wxString fname = raw.empty() ? wxString::Format(_L("feature %d"), src + 1) : wxString::FromUTF8(raw); - // A card left open over a feature that is about to vanish goes stale — same reason - // on_delete_feature() closes it. - if (m_active != Tool::None || m_edit_index >= 0) { - reset_edit_state(); - close_tool(); - } - m_doc.checkpoint(); // undo boundary: deleting a body's feature - m_sel_solid_body = m_sel_solid_face = m_sel_solid_edge = -1; // the selection is about to - m_sel_solid_vertex = false; // name a body that is gone + if (!begin_renumber()) return; const bool ok = m_doc.remove_feature(src); after_tree_edit(ok); if (ok) @@ -7948,14 +7982,7 @@ void DesignPanel::on_delete_feature() set_status(StatusKind::Info, _L("Select a feature in the tree first")); return; } - // If a feature dialog is open (e.g. the feature is being edited), dismiss it first — - // otherwise the deleted feature's settings card lingers in the left panel, out of sync - // with the tree. reset_edit_state() drops the stale m_edit_index; close_tool() hides the card. - if (m_active != Tool::None || m_edit_index >= 0) { - reset_edit_state(); - close_tool(); - } - m_doc.checkpoint(); // undo boundary: deleting a feature + if (!begin_renumber()) return; after_tree_edit(m_doc.remove_feature(sel)); } @@ -8022,7 +8049,7 @@ void DesignPanel::on_move_feature(int delta) int target = sel + delta; if (target < 0 || target >= int(m_doc.features.size())) return; // already at the end - m_doc.checkpoint(); // undo boundary: reordering a feature + if (!begin_renumber()) return; if (m_doc.move_feature(sel, delta)) { after_tree_edit(true); set_tree_selection(target); // keep the moved feature selected @@ -8058,9 +8085,8 @@ void DesignPanel::on_begin_constrain(int sel_override) // this verb from a SkLoop selection (a region clicked on screen), which carries no tree // selection — without this, choosing "Constrain sketch" from the offer would answer // "Select a sketch in the tree first" about a sketch the user has visibly selected. - if ((sel == wxNOT_FOUND || sel >= int(m_doc.features.size())) && m_sel_sketch_feat >= 0 - && m_sel_sketch_feat < int(m_doc.features.size())) { - sel = m_sel_sketch_feat; + if (sel == wxNOT_FOUND || sel >= int(m_doc.features.size())) { + sel = m_viewport ? m_viewport->loop_pick_feature() : wxNOT_FOUND; // range-checked below set_tree_selection(sel); // keep the tree in step with what the viewport says } if (sel == wxNOT_FOUND || sel >= int(m_doc.features.size())) { @@ -10991,7 +11017,8 @@ void DesignPanel::refresh_preview() default: ready = _L("Sketch ready"); break; } set_status(StatusKind::Ok, ready); - for (::Button* b : m_confirm_btns) if (b) b->Enable(true); + m_candidate_ok = true; + update_confirm_button(); m_status->Refresh(); update_datum_gizmo(); // Plane card: show/refresh the in-canvas resize handles update_helix_gizmo(); // Helix card: draw the live curve + drag handles (no solid ghost) @@ -11034,7 +11061,8 @@ void DesignPanel::refresh_preview() set_status(StatusKind::Error, wxString::Format(_L("Invalid: %s"), kernel_error_text(err))); } } - for (::Button* b : m_confirm_btns) if (b) b->Enable(ok); + m_candidate_ok = ok; + update_confirm_button(); m_status->Refresh(); return; } @@ -11080,8 +11108,8 @@ void DesignPanel::refresh_preview() } // Onshape parity: a broken candidate cannot be committed. Grey the active dialog's // Confirm so the user sees the gate before clicking; the red status says why. - for (::Button* b : m_confirm_btns) - if (b != nullptr) b->Enable(ok); + m_candidate_ok = ok; + update_confirm_button(); // Fillet/Chamfer/Draft: once the target edge/face yields a valid result, show ONLY the // preview (hide the base bodies) so the user sees the finished shape, not the old solid // doubled with the ghost. Before a valid pick the body stays visible so it can be picked. @@ -11178,6 +11206,7 @@ void DesignPanel::push_polygon_params() void DesignPanel::open_tool(Tool t) { m_active = t; + m_candidate_ok = true; // a fresh card is confirmable until its preview says otherwise // Fillet/Chamfer/Draft no longer fade the body see-through; instead, once a valid target // is picked, refresh_preview hides the base bodies entirely (preview-only). Keep it opaque // here so the body is fully visible for picking the edge/face. @@ -11680,11 +11709,14 @@ bool DesignPanel::confirm_enabled() const return (m_viewport && m_viewport->moving_body()) || m_ui_mode == UiMode::Sketch || m_ui_mode == UiMode::Constrain; if (m_active == Tool::Insert) return true; + return m_candidate_ok; +} + +void DesignPanel::update_confirm_button() +{ + const bool ok = confirm_enabled(); for (::Button* b : m_confirm_btns) - if (b != nullptr && b->IsShownOnScreen()) return b->IsEnabled(); - for (::Button* b : m_confirm_btns) - if (b != nullptr) return b->IsEnabled(); - return true; + if (b != nullptr) b->Enable(ok); } // Which level of the interaction stack one Esc press belongs to. The rule itself lives in @@ -11752,8 +11784,6 @@ void DesignPanel::escape() // both of which say which one they are, and never through a key pressed on the way out of // something else. if (m_viewport && m_viewport->clear_any_selection()) { - m_sel_sketch_region = -1; - m_sel_sketch_feat = -1; set_status(StatusKind::Info, wxString()); return; } @@ -11790,6 +11820,7 @@ void DesignPanel::update_undo_redo_buttons() void DesignPanel::update_action_bar() { update_undo_redo_buttons(); // mode/tool changes flip the do_undo_redo gate -> refresh greying + update_confirm_button(); // ...and the ✓'s greying if (m_tb_action == nullptr || m_toolbar == nullptr) return; wxSizer* s = m_toolbar->GetSizer(); if (s == nullptr) return; @@ -11841,10 +11872,9 @@ void DesignPanel::do_undo_redo(bool redo) set_status(StatusKind::Info, redo ? _L("Nothing to redo") : _L("Nothing to undo")); return; } - // The solid whole/face/edge pick and any in-place edit reference ids that recompute() - // invalidates — drop them before refreshing from the restored document. - m_sel_solid_body = m_sel_solid_face = m_sel_solid_edge = -1; - m_pick_face = m_pick_face_body = -1; // recompute() invalidated the face ids too + // The picks and any in-place edit reference ids that recompute() invalidates — drop them + // before refreshing from the restored document. + drop_selection(); reset_edit_state(); after_tree_edit(true); // refresh tree + viewport meshes + status from the restored doc set_status(StatusKind::Info, wxString::Format(redo ? _L("Redo (%zu more)") : _L("Undo (%zu more)"), diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index 0cf670c191..1235c98ac3 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -140,9 +140,10 @@ private: // used to be handled in four places that could not see each other, and that is how two // presses in a row reached past a tool and discarded the sketch under it. CadLevel escape_level() const; - bool confirm_enabled() const; // would the ✓ act right now (and is it not greyed)? + bool confirm_enabled() const; // would the ✓ act right now? (its greying follows this) void escape(); void update_action_bar(); // show the ✓/✗ bar iff a tool or mode is active + void update_confirm_button(); // grey the ✓ to confirm_enabled() void on_shape_changed(); void on_add_sketch(); @@ -294,6 +295,8 @@ private: void after_edit_op(); // shared edit-op refresh tail void on_edit_feature(); // reopen the selected feature's dialog populated void after_tree_edit(bool ok); // shared post-op refresh of tree/viewport/status + void drop_selection(); // forget the selection (solid, hit face, sketch loop): the feature list was replaced or renumbered + bool begin_renumber(); // before delete/reorder: refuse while an index is held, else close the card, checkpoint, drop picks void load_feature_into_dialog(const CadFeature& f); void reset_edit_state(); // back to add-mode (m_edit_index = -1) @@ -760,10 +763,6 @@ private: int m_pl_edgeA_body{-1}, m_pl_edgeA{-1}; int m_pl_edgeB_body{-1}, m_pl_edgeB{-1}; PlanePick m_plane_pick{PlanePick::None}; // which ref the next solid pick fills - // Plate loop selection (click a committed sketch loop): the Sketch feature + the - // clicked closed-region index, so Extrude builds just that one loop. -1 = none. - int m_sel_sketch_feat{-1}; - int m_sel_sketch_region{-1}; // Click-selected solid topology (whole/face/edge cycle): face id for up-to-face / dress-up. int m_sel_solid_body{-1}; // which body the face/edge selection is on int m_sel_solid_face{-1}; @@ -976,6 +975,9 @@ private: int m_feature_counter{0}; std::vector<::Button*> m_confirm_btns; + // refresh_preview's verdict on the open card's candidate (open_tool resets it). Kept here, not + // read back from the ✓, which every card and mode shares; the ✓ is greyed from confirm_enabled(). + bool m_candidate_ok{true}; // Edit-in-place state: add-mode is m_edit_index == -1. Single-feature edit // (Sketch or Extrude independently) uses only m_edit_index as the row to replace. diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index 7bee6abe49..a310a3add1 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -254,6 +254,8 @@ public: // sketch there is nothing left that would set this — and selected_loop_entities(), which is // what Extrude consumes, reads exactly these two fields. void set_display_pick(int feature, int region) { m_display_pick = feature; m_display_pick_region = region; } + int display_pick() const { return m_display_pick; } + int display_pick_region() const { return m_display_pick_region; } // Visual Extrude gizmo (C5b). The Extrude tool is a DesignPanel docked card, so the // sketch tool is NOT active during it; the panel feeds the profile plane + a 2D centroid From 6b304884d24ded41e428517e995decf5915dca47 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 3 Oct 2026 12:03:18 -0500 Subject: [PATCH 204/389] Belt arrange: group colours along the belt, keep the purge tower's strip free, stop the tower at the plate end On a belt the parts print in belt order, so every colour change between parts is a filament change. Arrange packs items in extruder order already, but it grew the pile around its centre, so the colours ended up interleaved. A belt print now packs from the leading end of the bed, each row filling across the belt before the pile advances, and the objective charges an item for every packed part of another colour it does not fully follow along the belt, counting the tilted layers that reach cot(angle) * height past a part, so each colour prints as one run. The direction follows the slicing rotation: a rotation about X prints toward +Y, one about Y toward -X, and a negative angle flips it. Packing from the edge also means the brim has to be kept on the bed: a belt brim is printed brim_width wide for every brim type, so that much is reserved along every edge (between parts the brims may overlap, as on any printer). The purge prism is regenerated from the arranged parts, flush with the far edge of the bed, yet arrange moved it about like a part and packed parts into the strip it comes back to. Arrange now skips the prism and reserves its strip with a fixed virtual item, like a bed exclusion area, whenever the parts use more than one filament. The prism's length follows the parts plus a ramp per unit of height; with the height at its cap that ran 100 mm past the end of a 500 mm belt and the project could not print. The bar now stops at the plate end, and the purge planner's existing warning reports what the shortened bar cannot absorb. --- src/libslic3r/Arrange.cpp | 93 +++++++++++++++++++++++++--- src/libslic3r/Arrange.hpp | 7 +++ src/slic3r/GUI/BeltPurgeTower.cpp | 34 ++++++++--- src/slic3r/GUI/BeltPurgeTower.hpp | 4 +- src/slic3r/GUI/Jobs/ArrangeJob.cpp | 97 ++++++++++++++++++++++++++++-- src/slic3r/GUI/Jobs/ArrangeJob.hpp | 1 + tests/libslic3r/test_arrange.cpp | 44 ++++++++++++++ 7 files changed, 254 insertions(+), 26 deletions(-) diff --git a/src/libslic3r/Arrange.cpp b/src/libslic3r/Arrange.cpp index fd496537f4..d6e386b5d4 100644 --- a/src/libslic3r/Arrange.cpp +++ b/src/libslic3r/Arrange.cpp @@ -276,7 +276,13 @@ Points get_shrink_bedpts(const DynamicPrintConfig* print_cfg, const ArrangeParam template void fill_config(PConf& pcfg, const ArrangeParams ¶ms) { - if (params.is_seq_print) { + if (params.is_belt) { + // Pack from the end of the belt that prints first. + pcfg.starting_point = !params.belt_reversed ? PConf::Alignment::BOTTOM_LEFT : + params.belt_axis == 1 ? PConf::Alignment::TOP_LEFT : + PConf::Alignment::BOTTOM_RIGHT; + } + else if (params.is_seq_print) { // Start placing the items from the center of the print bed pcfg.starting_point = PConf::Alignment::BOTTOM_LEFT; } @@ -421,7 +427,51 @@ protected: return bindist; } - double dist_to_bin(const Box& ibb, const ClipperLib::IntPoint& origin_pack, typename Packer::PlacementConfig::Alignment starting_point_alignment) + // Belt printers pack from the end of the belt that prints first, and a corner + // packer's checks (pile inside the bin, pack origin) apply to them as well. + bool corner_packing() const { return params.is_belt || m_pconf.starting_point == PConfig::Alignment::BOTTOM_LEFT; } + + static double at(const Box::PointType &pt, int i) { return double(i == 0 ? getX(pt) : getY(pt)); } + + // Position along the belt in print order: increasing from the end that prints first. + double belt_pos(const Box::PointType &pt) const { return params.belt_reversed ? -at(pt, params.belt_axis) : at(pt, params.belt_axis); } + double belt_start(const Box &bb) const { return belt_pos(params.belt_reversed ? bb.maxCorner() : bb.minCorner()); } + double belt_end(const Box &bb) const { return belt_pos(params.belt_reversed ? bb.minCorner() : bb.maxCorner()); } + + // The corner of the bin the belt pile grows from. + Box::PointType belt_origin() const + { + const Box bb = sl::boundingBox(m_bin); + auto o = bb.minCorner(); + if (params.belt_reversed) { + if (params.belt_axis == 0) setX(o, getX(bb.maxCorner())); + else setY(o, getY(bb.maxCorner())); + } + return o; + } + + // An item's far edge in print order is what it costs (so a row fills across the + // belt before the pile advances), with a slight pull toward the near lateral + // edge and the same penalty as the bottom-left heuristic for sitting outside + // the corner. + double dist_along_belt(const Box &ibb) + { + const Box bin = sl::boundingBox(m_bin); + const int l = 1 - params.belt_axis; + const double lat = at(ibb.minCorner(), l) - at(bin.minCorner(), l); + double d = belt_end(ibb) - belt_start(bin); + d += lat < 0 ? 10 * -lat : 0.1 * lat; + if (double behind = belt_start(ibb) - belt_start(bin); behind < 0) + d += 10 * -behind; + return norm(d); + } + + double corner_bindist(const Box &ibb, const ClipperLib::IntPoint &origin_pack) + { + return params.is_belt ? dist_along_belt(ibb) : dist_for_BOTTOM_LEFT(ibb, origin_pack); + } + + double dist_to_bin(const Box& ibb, const ClipperLib::IntPoint& origin_pack, typename Packer::PlacementConfig::Alignment starting_point_alignment) { double bindist = 0; if (starting_point_alignment == PConfig::Alignment::BOTTOM_LEFT) @@ -510,8 +560,8 @@ protected: // The smalles distance from the arranged pile center: double dist = norm(*(std::min_element(dists.begin(), dists.end()))); - if (m_pconf.starting_point == PConfig::Alignment::BOTTOM_LEFT) { - double bindist = dist_for_BOTTOM_LEFT(ibb, origin_pack); + if (corner_packing()) { + double bindist = corner_bindist(ibb, origin_pack); score = 0.2 * dist + 0.8 * bindist; } else { @@ -568,8 +618,8 @@ protected: break; } case LAST_BIG_ITEM: { - if (m_pconf.starting_point == PConfig::Alignment::BOTTOM_LEFT) { - score = dist_for_BOTTOM_LEFT(ibb, origin_pack); + if (corner_packing()) { + score = corner_bindist(ibb, origin_pack); } else { if (m_pilebb.defined) @@ -584,8 +634,8 @@ protected: // already processed bigger items. // No need to play around with the anchor points, the center will be // just fine for small items - if (m_pconf.starting_point == PConfig::Alignment::BOTTOM_LEFT) - score = dist_for_BOTTOM_LEFT(ibb, origin_pack); + if (corner_packing()) + score = corner_bindist(ibb, origin_pack); else { // Align mainly around existing items score = 0.8 * norm(pl::distance(ibb.center(), bigbb.center()))+ 0.2*norm(pl::distance(ibb.center(), origin_pack)); @@ -686,6 +736,28 @@ protected: score += 1 * (new_extruder_cnt-last_extruder_cnt); } + // On a belt the parts print in belt order, so every colour change between + // parts is a filament change. Items arrive sorted by extruder and the pile + // grows from the leading end; keep each colour's run contiguous by charging + // an item for every packed item of another colour it does not fully follow, + // counting the tilted layers that reach belt_tilt_slope * height past that + // item's far edge. + if (params.is_belt && !params.is_seq_print) { + const std::set item_colours(item.extrude_ids.begin(), item.extrude_ids.end()); + const double item_start = belt_start(ibb); + for (Item &p : m_items) { + if (p.is_virt_object) + continue; + const std::set p_colours(p.extrude_ids.begin(), p.extrude_ids.end()); + const bool same_colour = std::includes(item_colours.begin(), item_colours.end(), p_colours.begin(), p_colours.end()) + || std::includes(p_colours.begin(), p_colours.end(), item_colours.begin(), item_colours.end()); + if (same_colour) + continue; + if (item_start < belt_end(p.boundingBox()) + scaled(p.height * params.belt_tilt_slope)) + score += 10.; + } + } + return std::make_tuple(score, fullbb); } @@ -762,7 +834,8 @@ public: auto binbb = sl::boundingBox(m_bin); - auto starting_point = cfg.starting_point == PConfig::Alignment::BOTTOM_LEFT ? binbb.minCorner() : binbb.center(); + auto starting_point = this->params.is_belt ? belt_origin() : + cfg.starting_point == PConfig::Alignment::BOTTOM_LEFT ? binbb.minCorner() : binbb.center(); // if we have wipe tower, items should be arranged around wipe tower for (Item itm : items) { if (itm.is_wipe_tower) { @@ -913,7 +986,7 @@ std::function AutoArranger::g auto mp = m_merged_pile; mp.emplace_back(itm.transformedShape()); auto chull = sl::convexHull(mp); - if (m_pconf.starting_point == PConfig::Alignment::BOTTOM_LEFT) + if (corner_packing()) { if (!sl::isInside(chull, m_bin)) score += LARGE_COST_TO_REJECT; diff --git a/src/libslic3r/Arrange.hpp b/src/libslic3r/Arrange.hpp index ad125aee7d..b8fc0f7268 100644 --- a/src/libslic3r/Arrange.hpp +++ b/src/libslic3r/Arrange.hpp @@ -137,6 +137,13 @@ struct ArrangeParams { float nozzle_height = 0; float printable_height = 256.0; Vec2d align_center{ 0.5,0.5 }; + // Belt printer: items print in the order they lie along the belt axis, from + // its low end unless belt_reversed, and a part's top prints + // belt_tilt_slope * height further along it than its base. + bool is_belt = false; + int belt_axis = 1; // 0 = X, 1 = Y + bool belt_reversed = false; + float belt_tilt_slope = 1.f; // cot(belt tilt angle), 0 when the belt is not tilted ArrangePolygons excluded_regions; // regions cant't be used ArrangePolygons nonprefered_regions; // regions can be used but not prefered diff --git a/src/slic3r/GUI/BeltPurgeTower.cpp b/src/slic3r/GUI/BeltPurgeTower.cpp index a8b0b0c0b8..3dc50d4cb2 100644 --- a/src/slic3r/GUI/BeltPurgeTower.cpp +++ b/src/slic3r/GUI/BeltPurgeTower.cpp @@ -266,6 +266,11 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object const Vec3d plate_origin = plate->get_origin(); new_sig.key[10] = q(plate_origin.x()); new_sig.key[11] = q(plate_origin.y()); + if (const auto *bed_opt = printer_config.option("printable_area"); bed_opt != nullptr && !bed_opt->values.empty()) { + const BoundingBoxf bed = get_extents(bed_opt->values); + new_sig.key[12] = q(bed.max.x()); + new_sig.key[13] = q(bed.max.y()); + } if (prism_idxs.size() == 1 && model.objects[size_t(prism_idxs.front())]->instances.size() == 1 && new_sig == sig) return false; // already up to date — do not touch the model @@ -278,26 +283,35 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object // whole band needs belt_start <= y_min - H*cot (bar's own leading ramp) and // belt_end >= y_max + z_max*cot (parts' top features print further up the // belt). The trailing z_max*cot term dominates the bar's own ramp. + // The bed (printable_area) is plate-local but model instances live in the + // plate's world frame, so the plate origin is added to every bed coordinate. + const double inset = 1.; + BoundingBoxf bed_ext; + if (const auto *bed_opt = printer_config.option("printable_area"); + bed_opt != nullptr && !bed_opt->values.empty()) + bed_ext = get_extents(bed_opt->values); + + // Along the belt the bar stops at the end of the plate: a longer bar cannot be + // printed, and the cross-sections it loses there are reported by the purge + // planner when the parts' last layers then purge more than the bar holds. const double margin = 5.; const double ramp_compensation = height / sin_t; const double belt_origin = plate_origin[belt_is_y ? 1 : 0]; - const double belt_start = std::max(belt_origin, belt_min - ramp_compensation); // leading ramp, toward belt origin - const double belt_end = belt_max + margin + ramp_compensation + z_max * cot_t; // + parts' top-feature belt reach + double belt_end = belt_max + margin + ramp_compensation + z_max * cot_t; // + parts' top-feature belt reach + if (bed_ext.defined) + belt_end = std::min(belt_end, belt_origin + (belt_is_y ? bed_ext.max.y() : bed_ext.max.x()) - inset); + const double belt_start = std::max(belt_origin, std::min(belt_min - ramp_compensation, belt_end - 10.)); // leading ramp, toward belt origin const double length = std::max(belt_end - belt_start, 10.); + belt_end = belt_start + length; const double belt_center = 0.5 * (belt_start + belt_end); // Across-belt: flush against the bed's maximum edge, inset by half the bar // width so the bar's far edge sits on the boundary and the whole bar stays - // on the bed. The bed (printable_area) is plate-local but model instances - // live in the plate's world frame, so add the plate origin's lateral - // component. lat_min/lat_max come from instance_bounding_box (world frame). + // on the bed. lat_min/lat_max come from instance_bounding_box (world frame). const double lat_origin = plate_origin[belt_is_y ? 0 : 1]; - const double inset = 1.; double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts - if (const auto *bed_opt = printer_config.option("printable_area"); - bed_opt != nullptr && !bed_opt->values.empty()) { - const BoundingBoxf bed_ext = get_extents(bed_opt->values); - const double bed_lat_max = belt_is_y ? bed_ext.max.x() : bed_ext.max.y(); + if (bed_ext.defined) { + const double bed_lat_max = belt_is_y ? bed_ext.max.x() : bed_ext.max.y(); lat_center = lat_origin + bed_lat_max - inset - 0.5 * width; } diff --git a/src/slic3r/GUI/BeltPurgeTower.hpp b/src/slic3r/GUI/BeltPurgeTower.hpp index c5a6d301a0..27d5b47c94 100644 --- a/src/slic3r/GUI/BeltPurgeTower.hpp +++ b/src/slic3r/GUI/BeltPurgeTower.hpp @@ -22,12 +22,12 @@ struct BeltPurgeSignature { bool valid = false; int filament_count = 0; - long key[12] = {0}; // rounded geometry and plate inputs (0.1 mm units) + long key[14] = {0}; // rounded geometry, plate and bed inputs (0.1 mm units) bool operator==(const BeltPurgeSignature &o) const { if (valid != o.valid || filament_count != o.filament_count) return false; - for (int i = 0; i < 12; ++i) + for (int i = 0; i < 14; ++i) if (key[i] != o.key[i]) return false; return true; diff --git a/src/slic3r/GUI/Jobs/ArrangeJob.cpp b/src/slic3r/GUI/Jobs/ArrangeJob.cpp index cd4cc83dab..a21bf52c19 100644 --- a/src/slic3r/GUI/Jobs/ArrangeJob.cpp +++ b/src/slic3r/GUI/Jobs/ArrangeJob.cpp @@ -15,6 +15,9 @@ #include "slic3r/GUI/GUI_ObjectList.hpp" #include "libnest2d/common.hpp" +#include "libslic3r/Geometry.hpp" +#include +#include #define SAVE_ARRANGE_POLY 0 @@ -63,6 +66,14 @@ public: } }; +// The belt purge prism is generated from the arranged parts (ensure_belt_purge_tower), +// so arrange neither moves it nor packs around it; it reserves the prism's strip instead. +static bool is_belt_purge_prism(const ModelObject *mo) +{ + const ConfigOption *opt = mo->config.option("belt_purge_tower_object"); + return opt != nullptr && opt->getBool(); +} + // BBS: add partplate logic static WipeTower get_wipe_tower(const Plater &plater, int plate_idx) { @@ -77,6 +88,63 @@ arrangement::ArrangePolygon get_wipetower_arrange_poly(WipeTower* tower) return ap; } +// Belt printers pack their parts against the edges of the bed, so what has to stay +// free there is reserved with fixed virtual items on every plate, the way the bed's +// own exclusion areas are: +// - the strip the purge prism comes back to, flush with the far lateral edge (see +// ensure_belt_purge_tower), when the parts use more than one filament; +// - the brim along every edge: a belt brim is printed brim_width wide for every brim +// type but none. Between parts the brims may overlap, as on any printer. +void ArrangeJob::prepare_belt_regions(int num_plates) +{ + if (!params.is_belt || params.is_seq_print) + return; + const DynamicPrintConfig &config = wxGetApp().preset_bundle->full_config(); + const BoundingBoxf bed = get_extents(config.opt("printable_area")->values); + const bool belt_is_y = params.belt_axis == 1; + std::vector regions; + + std::set filaments; + for (const ArrangePolygons *items : { &m_selected, &m_unselected }) + for (const ArrangePolygon &ap : *items) + if (!ap.is_virt_object) + filaments.insert(ap.extrude_ids.begin(), ap.extrude_ids.end()); + if (config.opt_bool("enable_belt_purge_tower") && filaments.size() > 1) { + // The prism is at least one millimetre per island plus the gaps between them. + const int islands = int(filaments.size()) - 1; + const double width = std::max(config.opt_float("belt_purge_tower_width"), 2. * islands - 1.) + 1.; // + the prism's edge inset + BoundingBoxf strip = bed; + if (belt_is_y) + strip.min.x() = std::max(bed.min.x(), bed.max.x() - width); + else + strip.min.y() = std::max(bed.min.y(), bed.max.y() - width); + regions.push_back(strip); + } + + // Virtual items are inflated by the one millimetre exclusion gap already. + const double brim = config.opt_enum("brim_type") == btNoBrim ? 0. : + config.opt_float("brim_width") + config.opt_float("brim_object_gap") + config.opt_float("extra_brim_width") - 1.; + if (brim > 0.) { + regions.emplace_back(bed.min, Vec2d(bed.min.x() + brim, bed.max.y())); + regions.emplace_back(Vec2d(bed.max.x() - brim, bed.min.y()), bed.max); + regions.emplace_back(bed.min, Vec2d(bed.max.x(), bed.min.y() + brim)); + regions.emplace_back(Vec2d(bed.min.x(), bed.max.y() - brim), bed.max); + } + + for (int j = 0; j < num_plates; ++j) + for (size_t i = 0; i < regions.size(); ++i) { + ArrangePolygon ap; + ap.poly.contour = scaled(regions[i]).polygon(); + ap.translation = Vec2crd(0, 0); + ap.rotation = 0.f; + ap.is_virt_object = true; + ap.bed_idx = j; + ap.height = 1; + ap.name = "BeltRegion" + std::to_string(i); + m_unselected.emplace_back(std::move(ap)); + } +} + void ArrangeJob::clear_input() { const Model &model = m_plater->model(); @@ -128,6 +196,8 @@ void ArrangeJob::prepare_selected() { for (size_t oidx = 0; oidx < model.objects.size(); ++oidx) { const Selection::InstanceIdxsList* instlist = obj_sel[oidx]; ModelObject* mo = model.objects[oidx]; + if (is_belt_purge_prism(mo)) + continue; std::vector inst_sel(mo->instances.size(), false); @@ -176,6 +246,7 @@ void ArrangeJob::prepare_selected() { } prepare_wipe_tower(); + prepare_belt_regions(MAX_NUM_PLATES); // The strides have to be removed from the fixed items. For the @@ -206,6 +277,8 @@ void ArrangeJob::prepare_all() { // Go through the objects and check if inside the selection for (size_t oidx = 0; oidx < model.objects.size(); ++oidx) { ModelObject *mo = model.objects[oidx]; + if (is_belt_purge_prism(mo)) + continue; for (size_t i = 0; i < mo->instances.size(); ++i) { ModelInstance * mi = mo->instances[i]; @@ -252,6 +325,7 @@ void ArrangeJob::prepare_all() { // add the virtual object into unselect list if has plate_list.preprocess_exclude_areas(m_unselected, enable_wrapping, MAX_NUM_PLATES); + prepare_belt_regions(MAX_NUM_PLATES); } arrangement::ArrangePolygon estimate_wipe_tower_info(int plate_index, std::set& extruder_ids) @@ -290,10 +364,9 @@ void ArrangeJob::prepare_wipe_tower() bool enable_prime_tower = op && op->getBool(); if (!enable_prime_tower || params.is_seq_print) return; - // Belt printers have no classic wipe tower; purging goes into the belt - // purge prism, which is a real model object and arranges like any other. - if (const auto *belt_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option("belt_printer"); - belt_opt && belt_opt->value) + // Belt printers have no classic wipe tower; purging goes into the belt purge + // prism, whose strip prepare_belt_regions() reserves. + if (params.is_belt) return; bool smooth_timelapse = false; @@ -399,6 +472,8 @@ void ArrangeJob::prepare_partplate() { for (size_t oidx = 0; oidx < model.objects.size(); ++oidx) { ModelObject* mo = model.objects[oidx]; + if (is_belt_purge_prism(mo)) + continue; for (size_t inst_idx = 0; inst_idx < mo->instances.size(); ++inst_idx) { bool in_plate = plate->contain_instance(oidx, inst_idx) || plate->intersect_instance(oidx, inst_idx); @@ -434,6 +509,7 @@ void ArrangeJob::prepare_partplate() { // add the virtual object into unselect list if has plate_list.preprocess_exclude_areas(m_unselected, enable_wrapping, current_plate_index + 1); + prepare_belt_regions(current_plate_index + 1); } //BBS: add partplate logic @@ -785,6 +861,19 @@ arrangement::ArrangeParams init_arrange_params(Plater *p) params.is_seq_print = settings.is_seq_print; params.min_obj_distance = scaled(settings.distance); params.align_to_y_axis = settings.align_to_y_axis; + if (print_config.belt_printer.value) { + // Parts print in belt order: the belt runs across the gantry's tilt axis, a + // rotation about X prints toward +Y and one about Y toward -X (see + // BeltTransform), a negative angle flips that, and a tilted layer reaches + // cot(angle) * height past a part's far edge. + const BeltRotationAxis axis = print_config.belt_slice_rotation.value; + const double angle = print_config.belt_slice_rotation_angle.value; + const bool tilted = (axis == BeltRotationAxis::X || axis == BeltRotationAxis::Y) && std::abs(angle) > EPSILON; + params.is_belt = true; + params.belt_axis = axis == BeltRotationAxis::Y ? 0 : 1; + params.belt_reversed = tilted && ((axis == BeltRotationAxis::Y) != (angle < 0.)); + params.belt_tilt_slope = tilted ? float(1. / std::tan(Geometry::deg2rad(std::clamp(std::abs(angle), 5., 90.)))) : 0.f; + } int state = p->get_prepare_state(); if (state == Job::JobPrepareState::PREPARE_STATE_MENU) { diff --git a/src/slic3r/GUI/Jobs/ArrangeJob.hpp b/src/slic3r/GUI/Jobs/ArrangeJob.hpp index 0c9f03de01..19143c3254 100644 --- a/src/slic3r/GUI/Jobs/ArrangeJob.hpp +++ b/src/slic3r/GUI/Jobs/ArrangeJob.hpp @@ -46,6 +46,7 @@ class ArrangeJob : public Job //BBS:prepare the items from current selected partplate void prepare_partplate(); void prepare_wipe_tower(); + void prepare_belt_regions(int num_plates); ArrangePolygon prepare_arrange_polygon(void* instance); diff --git a/tests/libslic3r/test_arrange.cpp b/tests/libslic3r/test_arrange.cpp index a8bc56d2d5..1c13180f01 100644 --- a/tests/libslic3r/test_arrange.cpp +++ b/tests/libslic3r/test_arrange.cpp @@ -285,6 +285,50 @@ TEST_CASE("Arrange keeps a pile aligned near an edge on the bed", "[Arrange]") require_no_overlap(items); } +// On a belt the parts print in belt order, so two colours that alternate along the +// belt, or sit side by side, cost a filament change on every shared layer. Arrange +// keeps each colour together: no part shares belt length with a part of another +// colour, counting the tilted layers that run cot(angle) * height past its far edge, +// whichever end of the belt prints first. +TEST_CASE("Arrange groups the colours of a belt print along the belt", "[Arrange][belt]") +{ + const bool reversed = GENERATE(false, true); + CAPTURE(reversed); + const BoundingBox belt = bed(95, 500); + ArrangePolygons items = squares(6, 30., 20.); + for (size_t i = 0; i < items.size(); ++i) + items[i].extrude_ids = { int(i % 3) + 1 }; // three colours, two parts each + ArrangeParams params = quiet_params(scaled(2.)); + params.align_center = Vec2d(0.5, 0.05); + params.is_belt = true; + params.belt_axis = 1; + params.belt_reversed = reversed; + params.belt_tilt_slope = 1.f; // 45 degrees + + arrange(items, belt, params); + require_no_overlap(items); + + // Belt position in print order, so the same check serves both directions. + const coord_t dir = reversed ? -1 : 1; + auto start = [&](const ArrangePolygon &ap) { const BoundingBox bb = ap.transformed_poly().contour.bounding_box(); return dir * (reversed ? bb.max.y() : bb.min.y()); }; + auto end = [&](const ArrangePolygon &ap) { const BoundingBox bb = ap.transformed_poly().contour.bounding_box(); return dir * (reversed ? bb.min.y() : bb.max.y()) + scaled(ap.height * params.belt_tilt_slope); }; + + for (const ArrangePolygon &ap : items) { + REQUIRE(ap.bed_idx == 0); + CHECK(belt.contains(ap.transformed_poly().contour.bounding_box())); + } + for (const ArrangePolygon &a : items) + for (const ArrangePolygon &b : items) { + if (a.extrude_ids == b.extrude_ids) + continue; + // The part printed later starts after the earlier one has finished. + const coord_t earlier_end = start(a) <= start(b) ? end(a) : end(b); + const coord_t later_start = std::max(start(a), start(b)); + INFO("colour " << a.extrude_ids.front() << " vs " << b.extrude_ids.front()); + CHECK(earlier_end <= later_start); + } +} + TEST_CASE("Sequential print floors the object distance by object height", "[Arrange]") { // The only place sequential-print clearance is enforced. The arrange menu offers From 0c3b7bc72e50541ef99794aff654edb1e61d0703 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 3 Oct 2026 12:03:18 -0500 Subject: [PATCH 205/389] Belt brim: move the apron bands with the purge plan's layer grid The purge plan snaps every object onto one layer grid after the brim is built; the per-layer brim bands follow their layers but the apron bands below the first layer carry their own print_z and were left behind, which is why a brim was refused next to a purge tower object. The shift now moves them too and the combination is accepted again. --- src/libslic3r/BeltPurge.cpp | 3 +++ src/libslic3r/Print.cpp | 10 +++------- tests/fff_print/test_skirt_brim.cpp | 11 +++++------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp index cff3de8846..c4cbc83425 100644 --- a/src/libslic3r/BeltPurge.cpp +++ b/src/libslic3r/BeltPurge.cpp @@ -322,6 +322,9 @@ void PrintObject::belt_shift_layer_grid(double delta) layer->print_z += delta; for (SupportLayer *layer : m_support_layers) layer->print_z += delta; + // The brim's apron bands below the first layer carry their own print_z. + for (BeltBrimBand &band : m_belt_brim_prologue) + band.print_z += delta; m_slicing_params.belt_floor_z_shift += delta; } diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 66de6d88ee..550cfbbd64 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1420,14 +1420,10 @@ StringObjectException Print::validate(std::vector *warnin return { L("Draft shield is not compatible with belt printer mode.") }; // Belt brim spans many layers and owns the layers below the object, which - // neither the belt purge tower nor spiral vase can share (the purge plan moves - // objects onto a common layer grid after the brim bands are built). The prime - // tower setting alone is no obstacle: it stays on for any multi-filament - // project, and belt printers never print the classic tower. + // spiral vase cannot share. The prime tower setting is no obstacle: belt + // printers never print the classic tower, and the belt purge prism is an + // ordinary object that never takes a brim. if (this->has_belt_brim()) { - if (this->has_belt_purge_tower()) - return { L("Brim is not compatible with the belt purge tower. " - "Disable one of them.") }; if (m_config.spiral_mode.value) return { L("Brim is not compatible with spiral vase mode on a belt printer. " "Disable one of them.") }; diff --git a/tests/fff_print/test_skirt_brim.cpp b/tests/fff_print/test_skirt_brim.cpp index d762c49421..ede355c151 100644 --- a/tests/fff_print/test_skirt_brim.cpp +++ b/tests/fff_print/test_skirt_brim.cpp @@ -930,9 +930,9 @@ TEST_CASE("Belt inner-only leading brim does not reject the prime tower or spira CHECK(print.validate().string.empty()); CHECK_FALSE(gcode(print).empty()); } - // An actual purge tower object is different: the purge plan moves objects onto a common - // layer grid after the brim bands are built, so the two are still refused together. - SECTION("a brim is refused next to a belt purge tower object") { + // A purge tower object is accepted too: the purge plan moves every object, apron + // bands included, onto one layer grid. + SECTION("a brim is accepted next to a belt purge tower object") { DynamicPrintConfig config = belt_brim_multifilament_config(2, { { "brim_type", "outer_only" }, { "brim_width", 4 }, @@ -945,12 +945,11 @@ TEST_CASE("Belt inner-only leading brim does not reject the prime tower or spira Print print; Model model; init_print({ cube(20), cube(20) }, print, model, config, &overrides); - CHECK(print.validate().string.empty()); - model.objects.back()->config.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); print.apply(model, config); REQUIRE(print.has_belt_purge_tower()); - CHECK_FALSE(print.validate().string.empty()); + CHECK(print.validate().string.empty()); + CHECK_FALSE(gcode(print).empty()); } } From 2782374d8d287eeea24a6badb59ab863fb69bf15 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 3 Oct 2026 13:12:41 -0500 Subject: [PATCH 206/389] Belt: write the belt header outside the optional file header block The G-code viewer takes the belt tilt only from the belt header comments, but they were written inside the header block that is left out when a BTT TFT thumbnail is configured, so such a printer never got belt view. The comments are not part of the header block; they go after it, and after the thumbnails that firmware needs first. --- src/libslic3r/GCode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index f98cf62fc4..d2fbea5742 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3093,8 +3093,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format("; HEADER_BLOCK_START\n"); // Write information on the generator. file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str()); - // Belt printer: embed angle and transform configs in header via virtual hook. - this->write_belt_header(file, print); if (is_bbl_printers) file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str()); //BBS: total layer number @@ -3193,6 +3191,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } } + // Belt printer: the tilt and transform settings the G-code viewer reads back. They + // are comments outside the config block, so they go after the thumbnails that a + // BTT TFT firmware needs first, and are written whether or not that header block is. + this->write_belt_header(file, print); // Write some terse information on the slicing parameters. const PrintObject *first_object = print.objects().front(); From 82c462ab2aa4cd5a61979f248d94b966ccb91ecd Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 3 Oct 2026 13:12:41 -0500 Subject: [PATCH 207/389] Prepare view: drop the dormant tilted-bed rendering Plater::set_bed_shape read the belt keys from the plater's own config, which never carries them, so the branch that tilted the bed model, drew the slicing arrow and plane and switched the build volume to belt mode never ran. The Prepare view shows the bed as the slicing pipeline treats it, flat; the gravity arrow from build_plate_tilt stays, as does the preview's belt view, which takes its angle from the G-code header. --- src/libslic3r/BuildVolume.cpp | 30 -------- src/libslic3r/BuildVolume.hpp | 8 -- src/slic3r/GUI/3DBed.cpp | 129 +-------------------------------- src/slic3r/GUI/3DBed.hpp | 18 ----- src/slic3r/GUI/GCodeViewer.cpp | 6 +- src/slic3r/GUI/Plater.cpp | 31 -------- 6 files changed, 3 insertions(+), 219 deletions(-) diff --git a/src/libslic3r/BuildVolume.cpp b/src/libslic3r/BuildVolume.cpp index 4efcb89a91..15e6668bae 100644 --- a/src/libslic3r/BuildVolume.cpp +++ b/src/libslic3r/BuildVolume.cpp @@ -180,31 +180,6 @@ BuildVolume::BuildVolume(const std::vector &printable_area, const double BOOST_LOG_TRIVIAL(debug) << "BuildVolume printable_area clasified as: " << this->type_name(); } -void BuildVolume::set_belt_printer(bool enabled, double angle_deg, bool infinite_y) -{ - m_is_belt_printer = enabled; - m_belt_angle = angle_deg; - m_belt_infinite_y = infinite_y; - - // Restart from the unmodified bbox each call. Without this, toggling - // belt mode off (or switching infinite_y true→false) would leave the - // extents inflated and break collision / object_state checks. - BoundingBoxf bboxf = get_extents(m_bed_shape); - m_bboxf = BoundingBoxf3{ to_3d(bboxf.min, 0.), to_3d(bboxf.max, m_max_print_height) }; - - if (enabled) { - if (infinite_y) { - // Extend the Y bound to a very large value for infinite belt. - m_bboxf.max.y() = 100000.; - } - // Belt printer: the Z extent already equals printable_height (set above), which - // is the usable vertical clearance above the belt. The gantry's axis range is - // sized to reach height/cos(tilt), so no diagonal scaling is applied here — this - // keeps the live "outside build volume" highlight in agreement with Print::validate(). - (void) angle_deg; - } -} - #if 0 // Tests intersections of projected triangles, not just their vertices against a bounding box. // This test also correctly evaluates collision of a non-convex object with the bounding box. @@ -413,11 +388,6 @@ BuildVolume::ObjectState BuildVolume::object_state(const indexed_triangle_set& i build_volume.max.z() = std::numeric_limits::max(); if (ignore_bottom) build_volume.min.z() = -std::numeric_limits::max(); - // Belt printer: extend Y bounds for infinite Y. - if (m_is_belt_printer && m_belt_infinite_y) { - build_volume.min.y() = -std::numeric_limits::max(); - build_volume.max.y() = std::numeric_limits::max(); - } BoundingBox3Base build_volumef(build_volume.min.cast(), build_volume.max.cast()); // The following test correctly interprets intersection of a non-convex object with a rectangular build volume. //return rectangle_test(its, trafo, to_2d(build_volume.min), to_2d(build_volume.max), build_volume.max.z()); diff --git a/src/libslic3r/BuildVolume.hpp b/src/libslic3r/BuildVolume.hpp index 2b0d8c2746..f311d026b0 100644 --- a/src/libslic3r/BuildVolume.hpp +++ b/src/libslic3r/BuildVolume.hpp @@ -57,10 +57,6 @@ public: // Initialize from PrintConfig::printable_area and PrintConfig::printable_height BuildVolume(const std::vector &printable_area, const double printable_height, const std::vector> &extruder_areas, const std::vector& extruder_printable_heights); - // Belt printer configuration. - void set_belt_printer(bool enabled, double angle_deg, bool infinite_y); - bool is_belt_printer() const { return m_is_belt_printer; } - // Source data, unscaled coordinates. const std::vector& printable_area() const { return m_bed_shape; } double printable_height() const { return m_max_print_height; } @@ -143,10 +139,6 @@ private: // Source definition of the print volume height (PrintConfig::printable_height) double m_max_print_height { 0.f }; std::vector m_extruder_printable_height; - // Belt printer state. - bool m_is_belt_printer { false }; - double m_belt_angle { 0. }; - bool m_belt_infinite_y { false }; // Derived values. BuildVolume_Type m_type { BuildVolume_Type::Invalid }; diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 3032059678..69e5a1d340 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -387,9 +387,6 @@ void Bed3D::render_internal(GLCanvas3D& canvas, const Transform3d& view_matrix, m_model.set_color(m_is_dark ? DEFAULT_MODEL_COLOR_DARK : DEFAULT_MODEL_COLOR); - // Belt printer: bed rotation is applied inside render_model() and render_default() - // using m_is_belt_printer and m_belt_angle members. - switch (m_type) { case Type::System: { render_system(canvas, view_matrix, projection_matrix, bottom); break; } @@ -398,8 +395,6 @@ void Bed3D::render_internal(GLCanvas3D& canvas, const Transform3d& view_matrix, } render_gravity_arrow(view_matrix, projection_matrix); - render_slicing_arrow(view_matrix, projection_matrix); - render_slicing_plane(view_matrix, projection_matrix); glsafe(::glDisable(GL_DEPTH_TEST)); } @@ -700,12 +695,6 @@ void Bed3D::render_model(const Transform3d& view_matrix, const Transform3d& proj shader->start_using(); shader->set_uniform("emission_factor", 0.0f); Transform3d model_matrix = Geometry::assemble_transform(m_model_offset); - // Belt printer: rotate the bed model about the tilt axis so the belt tilt - // is visible. Negative angle: belt surface tilts downward away from the nozzle. - if (m_is_belt_printer && m_belt_angle > 0.f) { - double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); - model_matrix = Eigen::AngleAxisd(-angle_rad, belt_tilt_unit_axis()) * model_matrix; - } shader->set_uniform("volume_world_matrix", model_matrix); shader->set_uniform("view_model_matrix", view_matrix * model_matrix); shader->set_uniform("projection_matrix", projection_matrix); @@ -797,114 +786,6 @@ void Bed3D::render_gravity_arrow(const Transform3d& view_matrix, const Transform shader->stop_using(); } -void Bed3D::render_slicing_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix) -{ - if (!m_is_belt_printer || m_belt_angle <= 0.f) - return; - - // Build the arrow model: shorter and wider than the gravity arrow. - if (!m_slicing_arrow.is_initialized()) { - const float stem_length = 15.0f; // shorter than gravity arrow (25) - const float stem_radius = 1.0f; // wider than gravity arrow (~0.33) - const float tip_radius = 3.0f; // wider tip - const float tip_length = 5.0f; - m_slicing_arrow.init_from(stilized_arrow(16, tip_radius, tip_length, stem_radius, stem_length)); - } - - // The slicing direction: layers stack along the gantry normal, i.e. the image of - // +Z under the mesh rotation about the tilt axis. Use the same AngleAxis as the - // slicing pipeline so the arrow matches whichever tilt axis is configured. - double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); - Vec3d slice_dir = (Eigen::AngleAxisd(angle_rad, belt_tilt_unit_axis()).toRotationMatrix() - * Vec3d::UnitZ()).normalized(); - - // Compute rotation to align +Z (arrow default) with slice_dir. - Vec3d from = Vec3d::UnitZ(); - double dot = from.dot(slice_dir); - Transform3d rot = Transform3d::Identity(); - if (dot < -0.9999) { - rot = Eigen::AngleAxisd(M_PI, Vec3d::UnitX()) * rot; - } else if (dot < 0.9999) { - Vec3d axis = from.cross(slice_dir).normalized(); - double angle = std::acos(std::clamp(dot, -1.0, 1.0)); - rot = Eigen::AngleAxisd(angle, axis) * rot; - } - - GLShaderProgram* shader = wxGetApp().get_shader("flat"); - if (shader == nullptr) - return; - - // Disable depth test so the arrow is always visible (not occluded by the tilted bed). - glsafe(::glDisable(GL_DEPTH_TEST)); - shader->start_using(); - - const Camera& camera = wxGetApp().plater()->get_camera(); - Transform3d model_matrix = rot; - shader->set_uniform("view_model_matrix", camera.get_view_matrix() * model_matrix); - shader->set_uniform("projection_matrix", camera.get_projection_matrix()); - - m_slicing_arrow.set_color({ 1.0f, 0.2f, 0.6f, 1.0f }); // pink - m_slicing_arrow.render(); - - shader->stop_using(); - glsafe(::glEnable(GL_DEPTH_TEST)); -} - -void Bed3D::render_slicing_plane(const Transform3d& view_matrix, const Transform3d& projection_matrix) -{ - if (!m_is_belt_printer || m_belt_angle <= 0.f) - return; - - // Build a quad in the XZ plane (world frame) representing the belt slicing plane. - // The plane is tilted at belt_angle from horizontal, with normal (0, -sin(a), cos(a)). - // We render it as a semi-transparent quad centered on the build plate. - if (!m_slicing_plane.is_initialized()) { - const float half_size = 120.f; // mm, large enough to be visible - GLModel::Geometry init_data; - init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3 }; - init_data.reserve_vertices(4); - init_data.reserve_indices(2); // 2 triangles - - // Quad corners in local frame (XY plane, will be rotated to match slicing plane) - Vec3f n = Vec3f::UnitZ(); - init_data.add_vertex(Vec3f(-half_size, -half_size, 0.f), n); - init_data.add_vertex(Vec3f( half_size, -half_size, 0.f), n); - init_data.add_vertex(Vec3f( half_size, half_size, 0.f), n); - init_data.add_vertex(Vec3f(-half_size, half_size, 0.f), n); - init_data.add_triangle(0, 1, 2); - init_data.add_triangle(0, 2, 3); - - m_slicing_plane.init_from(std::move(init_data)); - } - - GLShaderProgram* shader = wxGetApp().get_shader("flat"); - if (shader == nullptr) - return; - - glsafe(::glEnable(GL_DEPTH_TEST)); - glsafe(::glEnable(GL_BLEND)); - glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); - - shader->start_using(); - - // Show a tilted plane representing the slicing direction. - // The slicing plane is rotated by belt_angle about the tilt axis from horizontal. - // Raise it slightly so it's visible above the bed surface. - double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); - Transform3d model_matrix = Transform3d::Identity(); - model_matrix.translate(Vec3d(0., 0., 30.)); - model_matrix.rotate(Eigen::AngleAxisd(angle_rad, belt_tilt_unit_axis())); - - shader->set_uniform("view_model_matrix", view_matrix * model_matrix); - shader->set_uniform("projection_matrix", projection_matrix); - - m_slicing_plane.set_color({ 0.2f, 0.6f, 1.0f, 0.3f }); // semi-transparent blue - m_slicing_plane.render(); - - glsafe(::glDisable(GL_BLEND)); - shader->stop_using(); -} - void Bed3D::render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix) { // m_texture.reset(); @@ -915,15 +796,7 @@ void Bed3D::render_default(bool bottom, const Transform3d& view_matrix, const Tr if (shader != nullptr) { shader->start_using(); - // Belt printer: rotate the default bed about X so the belt tilt is visible. - Transform3d view_model_matrix = view_matrix; - if (m_is_belt_printer && m_belt_angle > 0.f) { - double angle_rad = Geometry::deg2rad(static_cast(m_belt_angle)); - Transform3d belt_rotation = Transform3d::Identity(); - belt_rotation.rotate(Eigen::AngleAxisd(-angle_rad, Vec3d::UnitX())); - view_model_matrix = view_matrix * belt_rotation; - } - shader->set_uniform("view_model_matrix", view_model_matrix); + shader->set_uniform("view_model_matrix", view_matrix); shader->set_uniform("projection_matrix", projection_matrix); glsafe(::glEnable(GL_DEPTH_TEST)); diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index 788d8f52a3..4298ff8b1d 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -111,8 +111,6 @@ private: GLModel m_model; Vec3d m_model_offset{ Vec3d::Zero() }; GLModel m_gravity_arrow; - GLModel m_slicing_arrow; // Pink arrow showing the effective slicing direction - GLModel m_slicing_plane; // Debug: shows the intended slicing plane direction Axes m_axes; float m_scale_factor{ 1.0f }; @@ -122,11 +120,6 @@ private: std::vector> m_extruder_shapes; std::vector m_extruder_heights; bool m_is_dark = false; - // Belt printer state for rendering. - bool m_is_belt_printer = false; - float m_belt_angle = 0.f; - // Tilt axis: 0 = X (belt travels along Y, the common case), 1 = Y. - int m_belt_tilt_axis = 0; public: Bed3D() = default; @@ -148,15 +141,6 @@ public: const BuildVolume& build_volume() const { return m_build_volume; } BuildVolume& build_volume() { return m_build_volume; } - // Belt printer bed settings. tilt_axis: 0 = X (belt along Y), 1 = Y. - void set_belt_printer(bool enabled, float angle_deg, int tilt_axis = 0) { - m_is_belt_printer = enabled; m_belt_angle = angle_deg; m_belt_tilt_axis = tilt_axis; - } - bool is_belt_printer() const { return m_is_belt_printer; } - float belt_angle() const { return m_belt_angle; } - // Unit vector of the tilt axis in bed space. - Vec3d belt_tilt_unit_axis() const { return m_belt_tilt_axis == 1 ? Vec3d::UnitY() : Vec3d::UnitX(); } - // Was the model provided, or was it generated procedurally? Type get_type() const { return m_type; } // Was the model generated procedurally? @@ -196,8 +180,6 @@ private: void render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom); void render_default(bool bottom, const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_gravity_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix); - void render_slicing_arrow(const Transform3d& view_matrix, const Transform3d& projection_matrix); - void render_slicing_plane(const Transform3d& view_matrix, const Transform3d& projection_matrix); // BBS: remove the bed picking logic // void register_raycasters_for_picking(const GLModel::Geometry& geometry, const Transform3d& trafo); diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 9193cc5ef8..d34b8c2c63 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1223,10 +1223,8 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const m_loaded_as_preview = false; // Belt printers: drive the designed/raw view UI (legend checkbox, hotkey B, canvas-toolbar - // menu item) from the loaded print here. Plater::set_bed_shape also calls set_belt_printer(), - // but only on bed-shape changes — not reliably on every slice/preview load — so the UI was - // staying hidden even though the (config-driven) designed view rendered. The tilt magnitude - // comes from the G-code header (gcode_result.belt_tilt_angle, abs of the slicing rotation). + // menu item) from the loaded print. The tilt magnitude comes from the G-code header + // (gcode_result.belt_tilt_angle, abs of the slicing rotation). m_belt_view_enabled = print.config().belt_printer.value; m_belt_angle_deg = gcode_result.belt_tilt_angle; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 5b6e2c6300..cb5d2f7ace 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -14145,37 +14145,6 @@ void Plater::priv::set_bed_shape(const Pointfs &shape, Vec2d shape_position = partplate_list.get_current_shape_position(); bool new_shape = bed.set_shape(shape, printable_height, extruder_areas, extruder_heights, custom_model, force_as_custom, shape_position); - // Belt printer: configure build volume and bed rendering for belt mode. - { - const auto *belt_opt = config->option("belt_printer"); - bool is_belt = belt_opt && belt_opt->value; - if (is_belt) { - // The slicing rotation is the single source of truth for the belt tilt: - // its magnitude is the physical tilt angle and its axis is the tilt axis. - auto rot_axis = config->option>("belt_slice_rotation")->value; - double rot_angle = config->opt_float("belt_slice_rotation_angle"); - double belt_angle = std::abs(rot_angle); // physical tilt magnitude - int tilt_axis = (rot_axis == BeltRotationAxis::Y) ? 1 : 0; - bool infinite_y = config->opt_bool("belt_printer_infinite_y"); - bed.build_volume().set_belt_printer(true, belt_angle, infinite_y); - bed.set_belt_printer(true, static_cast(belt_angle), tilt_axis); - if (preview) - preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, static_cast(belt_angle)); - // The belt "designed view" back-transform is rebuilt from the print config at - // G-code load time (GCodeViewer::compute_belt_back_transform), so no mesh-side - // inverse needs to be pushed to the viewer here. - } else { - // Reset the BuildVolume belt state too: Bed3D::set_shape early-returns when - // the bed params are unchanged, so a belt->normal switch (or toggling belt off - // on the same printer) would otherwise leave the BuildVolume with - // m_is_belt_printer=true and an inflated Y bbox, wrongly treating out-of-bounds - // objects as printable. Idempotent for a printer that was never belt. - bed.build_volume().set_belt_printer(false, 0., false); - bed.set_belt_printer(false, 0.f); - if (preview) - preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(false, 0.f); - } - } float prev_height_lid, prev_height_rod; partplate_list.get_height_limits(prev_height_lid, prev_height_rod); From ca934716f5db9a08e467a97cb2900f4ad1acbf7f Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 3 Oct 2026 15:39:49 -0500 Subject: [PATCH 208/389] Plate icons: keep them inside the gap to the next plate The plate's icons, number and name scale with the plate's depth, but they sit in the gap to the next plate, which scales with its width. On a long, narrow bed (a 95 x 500 mm belt) they came out 40 mm wide and ran across the neighbouring plate. The scale is now also bounded by the gap, which leaves ordinary beds unchanged. --- src/slic3r/GUI/PartPlate.cpp | 19 +++++++++++++++---- src/slic3r/GUI/PartPlate.hpp | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 12f4e423e5..2b9bbbdf02 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -612,6 +612,17 @@ void PartPlate::calc_height_limit() { BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Unable to create height limit top lines\n"; } +// The plate's icons and labels grow with its depth, but they sit in the gap to the +// next plate, which grows with its width: on a long, narrow bed (a belt) they would +// otherwise run across the neighbouring plate. +float PartPlate::icon_scale_factor() const +{ + const BoundingBoxf bed_ext = get_extents(m_shape); + const double by_depth = bed_ext.size().y() / 200.; + const double by_gap = bed_ext.size().x() * LOGICAL_PART_PLATE_GAP / (PARTPLATE_ICON_SIZE + 2 * PARTPLATE_ICON_GAP_LEFT); + return float(std::min(by_depth, by_gap)); +} + void PartPlate::calc_vertex_for_number(int index, bool one_number, GLModel &buffer) { buffer.reset(); @@ -628,7 +639,7 @@ void PartPlate::calc_vertex_for_number(int index, bool one_number, GLModel &buff #else //in the bottom auto bed_ext = get_extents(m_shape); Vec2d p = bed_ext[1]; - float factor = bed_ext.size()(1) / 200.0; + float factor = icon_scale_factor(); float size = PARTPLATE_ICON_SIZE * factor; float offset_y = PARTPLATE_TEXT_OFFSET_Y * factor; float offset_x = (one_number?PARTPLATE_TEXT_OFFSET_X1: PARTPLATE_TEXT_OFFSET_X2) * factor; @@ -650,7 +661,7 @@ void PartPlate::calc_vertex_for_plate_name_edit_icon(GLTexture *texture, int ind ExPolygon poly; auto bed_ext = get_extents(m_shape); Vec2d p = bed_ext[3]; - float factor = bed_ext.size()(1) / 200.0; + float factor = icon_scale_factor(); float icon_sz = factor * PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE; float width = icon_sz; float height = icon_sz; @@ -683,7 +694,7 @@ void PartPlate::calc_vertex_for_icons(int index, PickingModel &model) ExPolygon poly; auto bed_ext = get_extents(m_shape); Vec2d p = bed_ext[2]; - auto factor = bed_ext.size()(1) / 200.0; + float factor = icon_scale_factor(); float size = PARTPLATE_ICON_SIZE * factor; float gap_left = PARTPLATE_ICON_GAP_LEFT * factor; float gap_y = PARTPLATE_ICON_GAP_Y * factor; @@ -2589,7 +2600,7 @@ void PartPlate::generate_plate_name_texture() ExPolygon poly; auto bed_ext = get_extents(m_shape); Vec2d p = bed_ext[3]; - float factor = bed_ext.size()(1) / 200.0; + float factor = icon_scale_factor(); float icon_sz = factor * PARTPLATE_EDIT_PLATE_NAME_ICON_SIZE; float width = icon_sz * m_name_texture.get_width() / m_name_texture.get_height(); // icon size * text_bb_ratio float height = icon_sz; // scale with icon size to preserve ratio while system scaling diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index babc88f364..67e8e300f5 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -178,6 +178,7 @@ private: void calc_triangles_from_polygon(const ExPolygon &poly, GLModel& render_model); void calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox); void calc_height_limit(); + float icon_scale_factor() const; void calc_vertex_for_number(int index, bool one_number, GLModel &buffer); void calc_vertex_for_plate_name_edit_icon(GLTexture *texture, int index, PickingModel &model); void calc_vertex_for_icons(int index, PickingModel &model); From 6a0d07664f60cb09a5ee6418584368b672a180d2 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 3 Oct 2026 18:55:50 -0500 Subject: [PATCH 209/389] Belt purge tower: one prism per plate ensure_belt_purge_tower only ever looked at the current plate and kept a single prism, so the other plates had no tower and switching plates moved the one prism around. Every plate is now planned on its own: a prism that lies on no plate is stale, a plate whose prism matches its recorded inputs is left alone, the rest are deleted and recreated, highest index first. --- src/slic3r/GUI/BeltPurgeTower.cpp | 558 ++++++++++++++++-------------- src/slic3r/GUI/BeltPurgeTower.hpp | 9 +- src/slic3r/GUI/Plater.cpp | 4 +- 3 files changed, 313 insertions(+), 258 deletions(-) diff --git a/src/slic3r/GUI/BeltPurgeTower.cpp b/src/slic3r/GUI/BeltPurgeTower.cpp index 3dc50d4cb2..e90491a972 100644 --- a/src/slic3r/GUI/BeltPurgeTower.cpp +++ b/src/slic3r/GUI/BeltPurgeTower.cpp @@ -33,28 +33,45 @@ namespace GUI { // is sized so each tilted slicing plane's cross-section through the prism can // absorb the worst-case purge volume of one layer; length follows the printed // objects along the belt (plus ramp/height compensation at both tilted ends). -bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, ObjectList *obj_list, BeltPurgeSignature &sig) +bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, ObjectList *obj_list, std::vector &sigs) { auto is_prism = [](const ModelObject *mo) { const ConfigOption *opt = mo->config.option("belt_purge_tower_object"); return opt != nullptr && opt->getBool(); }; - std::vector prism_idxs; + // Every plate gets its own prism. A prism belongs to the plate it lies on; one + // that lies on no plate is stale. + const int plate_count = partplate_list.get_plate_count(); + sigs.resize(size_t(plate_count)); + std::vector> prisms_by_plate(static_cast(plate_count)); + std::vector stale_prisms; for (int i = 0; i < (int) model.objects.size(); ++i) - if (is_prism(model.objects[i])) - prism_idxs.push_back(i); + if (is_prism(model.objects[i])) { + const int plate_idx = model.objects[i]->instances.empty() ? -1 : partplate_list.find_instance(i, 0); + if (plate_idx >= 0 && plate_idx < plate_count) + prisms_by_plate[size_t(plate_idx)].push_back(i); + else + stale_prisms.push_back(i); + } // Deletes prism objects, keeping the sidebar and part plates in sync // (same primitives as Plater::priv::remove(), minus scene update — the - // caller refreshes the scene). - auto remove_prisms = [&](const std::vector &idxs) { + // caller refreshes the scene). Highest index first, so the others stay valid. + auto remove_prisms = [&](std::vector idxs) { + std::sort(idxs.begin(), idxs.end()); for (auto it = idxs.rbegin(); it != idxs.rend(); ++it) { model.delete_object(size_t(*it)); partplate_list.notify_instance_removed(*it, -1); obj_list->delete_object_from_list(size_t(*it)); } }; + auto all_prisms = [&]() { + std::vector all = stale_prisms; + for (const auto &v : prisms_by_plate) + all.insert(all.end(), v.begin(), v.end()); + return all; + }; // Cheap early-out for non-belt printers: only belt printers ever get a belt // purge tower, and this runs on every background-process tick — so avoid the @@ -63,10 +80,11 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object { const auto *belt_pre = wxGetApp().preset_bundle->printers.get_edited_preset().config.option("belt_printer"); if (belt_pre == nullptr || !belt_pre->value) { - sig = BeltPurgeSignature{}; - if (prism_idxs.empty()) + std::fill(sigs.begin(), sigs.end(), BeltPurgeSignature{}); + const std::vector all = all_prisms(); + if (all.empty()) return false; - remove_prisms(prism_idxs); + remove_prisms(all); return true; } } @@ -93,97 +111,15 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object const auto *seq_opt = print_config.option>("print_sequence"); const bool by_object = seq_opt != nullptr && seq_opt->value == PrintSequence::ByObject; - // Filaments used and bounding extent of the non-prism objects on the - // current plate (1-based filament ids; volume extruder 0 = object default). - PartPlate *plate = partplate_list.get_curr_plate(); - std::set filaments; - double x_min = std::numeric_limits::max(); - double x_max = -std::numeric_limits::max(); - double y_min = std::numeric_limits::max(); - double y_max = -std::numeric_limits::max(); - double z_max = 0.; - bool have_objects = false; - if (belt && plate != nullptr) { - for (int obj_idx = 0; obj_idx < (int) model.objects.size(); ++obj_idx) { - const ModelObject *mo = model.objects[obj_idx]; - if (is_prism(mo)) - continue; - int obj_extruder = 1; - if (const ConfigOption *opt = mo->config.option("extruder"); opt != nullptr && opt->getInt() > 0) - obj_extruder = opt->getInt(); - bool any_instance_on_plate = false; - for (int inst_idx = 0; inst_idx < (int) mo->instances.size(); ++inst_idx) { - if (!plate->contain_instance_totally(obj_idx, inst_idx)) - continue; - any_instance_on_plate = true; - const BoundingBoxf3 bb = mo->instance_bounding_box(inst_idx); - x_min = std::min(x_min, bb.min.x()); - x_max = std::max(x_max, bb.max.x()); - y_min = std::min(y_min, bb.min.y()); - y_max = std::max(y_max, bb.max.y()); - z_max = std::max(z_max, bb.max.z()); - } - if (!any_instance_on_plate) - continue; - have_objects = true; - for (const ModelVolume *mv : mo->volumes) - for (int e : mv->get_extruders()) - filaments.insert(e > 0 ? e : obj_extruder); - } - } + // Mixed filament slots are expanded to their physical components below. + std::vector is_mixed; + std::vector comp_strs; + if (const auto *o = full_cfg.option("filament_is_mixed")) + is_mixed = o->values; + if (const auto *o = full_cfg.option("filament_mixed_components")) + comp_strs = o->values; - // A mixed filament slot is VIRTUAL: it never reaches a nozzle. At slice time - // ToolOrdering::resolve_mixed_filaments() replaces it with its physical - // components, so the toolchanges the prism has to absorb are between those - // components, not to the mixed slot itself. Counting the slot as a filament - // of its own therefore over-provisions the prism by one island per mixed slot - // -- the "extra purge tower" -- and, when every component is already used by - // another object, by an island that can never be reached at all. - // - // Expand here with the same helper the backend uses (Print.cpp's sequential - // path), so the GUI sizes the prism against the same filament set the slicer - // will actually produce. No-op when no filament is mixed. - { - // Copies, not references: a ternary with an empty-vector fallback would bind - // a reference to a temporary. - std::vector is_mixed; - std::vector comp_strs; - if (const auto *o = full_cfg.option("filament_is_mixed")) - is_mixed = o->values; - if (const auto *o = full_cfg.option("filament_mixed_components")) - comp_strs = o->values; - if (has_any_mixed_filament(is_mixed)) { - std::vector zero_based; - zero_based.reserve(filaments.size()); - for (int f : filaments) - if (f > 0) - zero_based.push_back((unsigned int) (f - 1)); - zero_based = expand_mixed_filaments(zero_based, is_mixed, comp_strs); - filaments.clear(); - for (unsigned int f : zero_based) - filaments.insert((int) f + 1); - } - } - - const bool wanted = belt && prime_tower_enabled && !by_object && have_objects && filaments.size() > 1; - if (!wanted) { - sig = BeltPurgeSignature{}; - if (prism_idxs.empty()) - return false; - remove_prisms(prism_idxs); - return true; - } - - // --- Sizing ----------------------------------------------------------- - const int n_islands = std::max(1, (int) filaments.size() - 1); - const double gap = 1.0; - // Every disconnected island needs at least 1 mm of printable width. Honor - // the configured total width whenever possible, but never let the island - // layout silently grow past the footprint used for placement. - const double min_width = n_islands + (n_islands - 1) * gap; - const double width = std::max(min_width, - print_config.has("belt_purge_tower_width") ? print_config.opt_float("belt_purge_tower_width") : 35.); - const double printable_width = width - (n_islands - 1) * gap; + const double gap = 1.0; const double layer_h = print_config.has("layer_height") ? print_config.opt_float("layer_height") : 0.2; // Belt geometry. The rotation axis is the gantry tilt axis; the belt @@ -201,15 +137,6 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object const double sin_t = std::sin(theta); const double cot_t = std::cos(theta) / sin_t; - // Parts' extent along the belt-travel axis and the lateral (across-belt) axis. - const double belt_min = belt_is_y ? y_min : x_min; - const double belt_max = belt_is_y ? y_max : x_max; - const double lat_min = belt_is_y ? x_min : y_min; - const double lat_max = belt_is_y ? x_max : y_max; - - // Worst-case purge volume of one layer: up to (filament count - 1) - // toolchanges, each needing the worst flush matrix entry (mirrors the - // volume selection in Print::_plan_belt_purge()). // NOTE: both purge_in_prime_tower and single_extruder_multi_material are // PRINTER options (Preset.cpp s_Preset_printer_options) — read them from the // printer preset. Reading purge_in_prime_tower from the print preset returns @@ -218,71 +145,9 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object // the backend Print::_plan_belt_purge() which reads both from the merged config. const bool use_matrix = (printer_config.has("purge_in_prime_tower") && printer_config.opt_bool("purge_in_prime_tower")) && (printer_config.has("single_extruder_multi_material") && printer_config.opt_bool("single_extruder_multi_material")); - double max_flush = print_config.has("prime_volume") ? print_config.opt_float("prime_volume") : 45.; - if (use_matrix) { - const size_t extruder_nums = wxGetApp().preset_bundle->get_printer_extruder_count(); - const std::vector matrix = get_flush_volumes_matrix( - project_config.option("flush_volumes_matrix")->values, 0, extruder_nums); - const auto * multi_opt = project_config.option("flush_multiplier"); - const double multiplier = multi_opt != nullptr && !multi_opt->values.empty() ? multi_opt->get_at(0) : 1.; - const int n_total = (int) (std::sqrt(double(matrix.size())) + 0.5); - double m = 0.; - for (int i : filaments) - for (int j : filaments) - if (i != j && i <= n_total && j <= n_total) - m = std::max(m, matrix[size_t(i - 1) * n_total + size_t(j - 1)]); - if (m > 0.) - max_flush = m * multiplier; - } - const double v_layer = double(filaments.size() - 1) * max_flush; - - // Height from the per-layer purge demand. A tilted slicing plane cuts a - // printable_width x (height/sin) rectangle out of the bars, so one layer - // slab absorbs printable_width * (height/sin) * layer_height of purge. Solve for the height that - // holds the worst-case per-layer purge, with eta (infill/perimeter packing) - // and a safety margin for the tilt ramps / grid-alignment slop, plus a - // minimum so the tower is a real printable body rather than a sliver. - const double eta = 0.85; - const double safety = 1.6; + const double prime_volume = print_config.has("prime_volume") ? print_config.opt_float("prime_volume") : 45.; const double printable_height = printer_config.has("printable_height") ? printer_config.opt_float("printable_height") : 250.; - double height = safety * v_layer * sin_t / (printable_width * layer_h * eta); - height = std::clamp(height, 8.0, std::max(8.0, printable_height)); - // --- Idempotence (input-keyed) ---------------------------------------- - auto q = [](double v) { return std::lround(v * 10.0); }; // 0.1 mm quantization - BeltPurgeSignature new_sig; - new_sig.valid = true; - new_sig.filament_count = (int) filaments.size(); - new_sig.key[0] = q(width); - new_sig.key[1] = q(layer_h); - new_sig.key[2] = q(height); - new_sig.key[3] = q(belt_min); - new_sig.key[4] = q(belt_max); - new_sig.key[5] = q(lat_min); - new_sig.key[6] = q(z_max); - new_sig.key[7] = static_cast(rot); - new_sig.key[8] = std::lround(theta * 10000.0); - new_sig.key[9] = q(lat_max); - const Vec3d plate_origin = plate->get_origin(); - new_sig.key[10] = q(plate_origin.x()); - new_sig.key[11] = q(plate_origin.y()); - if (const auto *bed_opt = printer_config.option("printable_area"); bed_opt != nullptr && !bed_opt->values.empty()) { - const BoundingBoxf bed = get_extents(bed_opt->values); - new_sig.key[12] = q(bed.max.x()); - new_sig.key[13] = q(bed.max.y()); - } - if (prism_idxs.size() == 1 && model.objects[size_t(prism_idxs.front())]->instances.size() == 1 && new_sig == sig) - return false; // already up to date — do not touch the model - - // --- Position ---------------------------------------------------------- - // Belt-travel axis. With the mesh rotated by theta before slicing, a machine - // point (y,z) maps to slicing-Z = y*sin(theta) + z*cos(theta). The parts - // occupy slicing-Z in [y_min*sin, y_max*sin + z_max*cos], and the bar's - // FULL-cross-section region (the part not in a triangular end ramp) spans - // slicing-Z [belt_start*sin + H*cos, belt_end*sin]. Covering the parts' - // whole band needs belt_start <= y_min - H*cot (bar's own leading ramp) and - // belt_end >= y_max + z_max*cot (parts' top features print further up the - // belt). The trailing z_max*cot term dominates the bar's own ramp. // The bed (printable_area) is plate-local but model instances live in the // plate's world frame, so the plate origin is added to every bed coordinate. const double inset = 1.; @@ -291,34 +156,225 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object bed_opt != nullptr && !bed_opt->values.empty()) bed_ext = get_extents(bed_opt->values); - // Along the belt the bar stops at the end of the plate: a longer bar cannot be - // printed, and the cross-sections it loses there are reported by the purge - // planner when the parts' last layers then purge more than the bar holds. - const double margin = 5.; - const double ramp_compensation = height / sin_t; - const double belt_origin = plate_origin[belt_is_y ? 1 : 0]; - double belt_end = belt_max + margin + ramp_compensation + z_max * cot_t; // + parts' top-feature belt reach - if (bed_ext.defined) - belt_end = std::min(belt_end, belt_origin + (belt_is_y ? bed_ext.max.y() : bed_ext.max.x()) - inset); - const double belt_start = std::max(belt_origin, std::min(belt_min - ramp_compensation, belt_end - 10.)); // leading ramp, toward belt origin - const double length = std::max(belt_end - belt_start, 10.); - belt_end = belt_start + length; - const double belt_center = 0.5 * (belt_start + belt_end); + // What each plate needs, decided before anything is deleted or created. + struct Plan + { + bool wanted = false; + BeltPurgeSignature sig; + int n_islands = 1; + double w_sub = 0., length = 0., height = 0.; + Vec3d center = Vec3d::Zero(); + }; + std::vector plans(static_cast(plate_count)); - // Across-belt: flush against the bed's maximum edge, inset by half the bar - // width so the bar's far edge sits on the boundary and the whole bar stays - // on the bed. lat_min/lat_max come from instance_bounding_box (world frame). - const double lat_origin = plate_origin[belt_is_y ? 0 : 1]; - double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts - if (bed_ext.defined) { - const double bed_lat_max = belt_is_y ? bed_ext.max.x() : bed_ext.max.y(); - lat_center = lat_origin + bed_lat_max - inset - 0.5 * width; + for (int plate_idx = 0; plate_idx < plate_count; ++plate_idx) { + Plan &plan = plans[size_t(plate_idx)]; + PartPlate *plate = partplate_list.get_plate(plate_idx); + + // Filaments used and bounding extent of the non-prism objects on this + // plate (1-based filament ids; volume extruder 0 = object default). + std::set filaments; + double x_min = std::numeric_limits::max(); + double x_max = -std::numeric_limits::max(); + double y_min = std::numeric_limits::max(); + double y_max = -std::numeric_limits::max(); + double z_max = 0.; + bool have_objects = false; + if (belt && plate != nullptr) { + for (int obj_idx = 0; obj_idx < (int) model.objects.size(); ++obj_idx) { + const ModelObject *mo = model.objects[obj_idx]; + if (is_prism(mo)) + continue; + int obj_extruder = 1; + if (const ConfigOption *opt = mo->config.option("extruder"); opt != nullptr && opt->getInt() > 0) + obj_extruder = opt->getInt(); + bool any_instance_on_plate = false; + for (int inst_idx = 0; inst_idx < (int) mo->instances.size(); ++inst_idx) { + if (!plate->contain_instance_totally(obj_idx, inst_idx)) + continue; + any_instance_on_plate = true; + const BoundingBoxf3 bb = mo->instance_bounding_box(inst_idx); + x_min = std::min(x_min, bb.min.x()); + x_max = std::max(x_max, bb.max.x()); + y_min = std::min(y_min, bb.min.y()); + y_max = std::max(y_max, bb.max.y()); + z_max = std::max(z_max, bb.max.z()); + } + if (!any_instance_on_plate) + continue; + have_objects = true; + for (const ModelVolume *mv : mo->volumes) + for (int e : mv->get_extruders()) + filaments.insert(e > 0 ? e : obj_extruder); + } + } + + // A mixed filament slot is VIRTUAL: it never reaches a nozzle. At slice time + // ToolOrdering::resolve_mixed_filaments() replaces it with its physical + // components, so the toolchanges the prism has to absorb are between those + // components, not to the mixed slot itself. Counting the slot as a filament + // of its own therefore over-provisions the prism by one island per mixed slot + // -- the "extra purge tower" -- and, when every component is already used by + // another object, by an island that can never be reached at all. + // + // Expand here with the same helper the backend uses (Print.cpp's sequential + // path), so the GUI sizes the prism against the same filament set the slicer + // will actually produce. No-op when no filament is mixed. + if (has_any_mixed_filament(is_mixed)) { + std::vector zero_based; + zero_based.reserve(filaments.size()); + for (int f : filaments) + if (f > 0) + zero_based.push_back((unsigned int) (f - 1)); + zero_based = expand_mixed_filaments(zero_based, is_mixed, comp_strs); + filaments.clear(); + for (unsigned int f : zero_based) + filaments.insert((int) f + 1); + } + + plan.wanted = belt && prime_tower_enabled && !by_object && have_objects && filaments.size() > 1; + if (!plan.wanted) + continue; + + // --- Sizing ----------------------------------------------------------- + const int n_islands = std::max(1, (int) filaments.size() - 1); + // Every disconnected island needs at least 1 mm of printable width. Honor + // the configured total width whenever possible, but never let the island + // layout silently grow past the footprint used for placement. + const double min_width = n_islands + (n_islands - 1) * gap; + const double width = std::max(min_width, + print_config.has("belt_purge_tower_width") ? print_config.opt_float("belt_purge_tower_width") : 35.); + const double printable_width = width - (n_islands - 1) * gap; + + // Parts' extent along the belt-travel axis and the lateral (across-belt) axis. + const double belt_min = belt_is_y ? y_min : x_min; + const double belt_max = belt_is_y ? y_max : x_max; + const double lat_min = belt_is_y ? x_min : y_min; + const double lat_max = belt_is_y ? x_max : y_max; + + // Worst-case purge volume of one layer: up to (filament count - 1) + // toolchanges, each needing the worst flush matrix entry (mirrors the + // volume selection in Print::_plan_belt_purge()). + double max_flush = prime_volume; + if (use_matrix) { + const size_t extruder_nums = wxGetApp().preset_bundle->get_printer_extruder_count(); + const std::vector matrix = get_flush_volumes_matrix( + project_config.option("flush_volumes_matrix")->values, 0, extruder_nums); + const auto * multi_opt = project_config.option("flush_multiplier"); + const double multiplier = multi_opt != nullptr && !multi_opt->values.empty() ? multi_opt->get_at(0) : 1.; + const int n_total = (int) (std::sqrt(double(matrix.size())) + 0.5); + double m = 0.; + for (int i : filaments) + for (int j : filaments) + if (i != j && i <= n_total && j <= n_total) + m = std::max(m, matrix[size_t(i - 1) * n_total + size_t(j - 1)]); + if (m > 0.) + max_flush = m * multiplier; + } + const double v_layer = double(filaments.size() - 1) * max_flush; + + // Height from the per-layer purge demand. A tilted slicing plane cuts a + // printable_width x (height/sin) rectangle out of the bars, so one layer + // slab absorbs printable_width * (height/sin) * layer_height of purge. Solve for the height that + // holds the worst-case per-layer purge, with eta (infill/perimeter packing) + // and a safety margin for the tilt ramps / grid-alignment slop, plus a + // minimum so the tower is a real printable body rather than a sliver. + const double eta = 0.85; + const double safety = 1.6; + double height = safety * v_layer * sin_t / (printable_width * layer_h * eta); + height = std::clamp(height, 8.0, std::max(8.0, printable_height)); + + // --- Idempotence (input-keyed) ---------------------------------------- + auto q = [](double v) { return std::lround(v * 10.0); }; // 0.1 mm quantization + BeltPurgeSignature &new_sig = plan.sig; + new_sig.valid = true; + new_sig.filament_count = (int) filaments.size(); + new_sig.key[0] = q(width); + new_sig.key[1] = q(layer_h); + new_sig.key[2] = q(height); + new_sig.key[3] = q(belt_min); + new_sig.key[4] = q(belt_max); + new_sig.key[5] = q(lat_min); + new_sig.key[6] = q(z_max); + new_sig.key[7] = static_cast(rot); + new_sig.key[8] = std::lround(theta * 10000.0); + new_sig.key[9] = q(lat_max); + const Vec3d plate_origin = plate->get_origin(); + new_sig.key[10] = q(plate_origin.x()); + new_sig.key[11] = q(plate_origin.y()); + if (bed_ext.defined) { + new_sig.key[12] = q(bed_ext.max.x()); + new_sig.key[13] = q(bed_ext.max.y()); + } + + // --- Position ---------------------------------------------------------- + // Belt-travel axis. With the mesh rotated by theta before slicing, a machine + // point (y,z) maps to slicing-Z = y*sin(theta) + z*cos(theta). The parts + // occupy slicing-Z in [y_min*sin, y_max*sin + z_max*cos], and the bar's + // FULL-cross-section region (the part not in a triangular end ramp) spans + // slicing-Z [belt_start*sin + H*cos, belt_end*sin]. Covering the parts' + // whole band needs belt_start <= y_min - H*cot (bar's own leading ramp) and + // belt_end >= y_max + z_max*cot (parts' top features print further up the + // belt). The trailing z_max*cot term dominates the bar's own ramp. + // + // Along the belt the bar stops at the end of the plate: a longer bar cannot be + // printed, and the cross-sections it loses there are reported by the purge + // planner when the parts' last layers then purge more than the bar holds. + const double margin = 5.; + const double ramp_compensation = height / sin_t; + const double belt_origin = plate_origin[belt_is_y ? 1 : 0]; + double belt_end = belt_max + margin + ramp_compensation + z_max * cot_t; // + parts' top-feature belt reach + if (bed_ext.defined) + belt_end = std::min(belt_end, belt_origin + (belt_is_y ? bed_ext.max.y() : bed_ext.max.x()) - inset); + const double belt_start = std::max(belt_origin, std::min(belt_min - ramp_compensation, belt_end - 10.)); // leading ramp, toward belt origin + const double length = std::max(belt_end - belt_start, 10.); + belt_end = belt_start + length; + const double belt_center = 0.5 * (belt_start + belt_end); + + // Across-belt: flush against the bed's maximum edge, inset by half the bar + // width so the bar's far edge sits on the boundary and the whole bar stays + // on the bed. lat_min/lat_max come from instance_bounding_box (world frame). + const double lat_origin = plate_origin[belt_is_y ? 0 : 1]; + double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts + if (bed_ext.defined) { + const double bed_lat_max = belt_is_y ? bed_ext.max.x() : bed_ext.max.y(); + lat_center = lat_origin + bed_lat_max - inset - 0.5 * width; + } + + plan.n_islands = n_islands; + plan.w_sub = (width - (n_islands - 1) * gap) / n_islands; + plan.length = length; + plan.height = height; + plan.center = Vec3d(belt_is_y ? lat_center : belt_center, + belt_is_y ? belt_center : lat_center, + 0.5 * height); } - const Vec3d desired_center(belt_is_y ? lat_center : belt_center, - belt_is_y ? belt_center : lat_center, - 0.5 * height); + // --- Decide --------------------------------------------------------------- + // A plate whose prism exists and matches its recorded inputs is left alone, so + // subsequent ticks are no-ops until the parts/config actually change. + std::vector to_delete = stale_prisms; + std::vector to_create; + for (int plate_idx = 0; plate_idx < plate_count; ++plate_idx) { + const Plan &plan = plans[size_t(plate_idx)]; + const std::vector &existing = prisms_by_plate[size_t(plate_idx)]; + BeltPurgeSignature &sig = sigs[size_t(plate_idx)]; + if (!plan.wanted) { + sig = BeltPurgeSignature{}; + to_delete.insert(to_delete.end(), existing.begin(), existing.end()); + } else if (existing.size() == 1 && model.objects[size_t(existing.front())]->instances.size() == 1 && plan.sig == sig) { + continue; + } else { + to_delete.insert(to_delete.end(), existing.begin(), existing.end()); + to_create.push_back(plate_idx); + } + } + if (to_delete.empty() && to_create.empty()) + return false; + remove_prisms(to_delete); + + // --- (Re)create ----------------------------------------------------------- // Build the prism as N DISCONNECTED sub-bars side by side across the belt, // N = (filaments - 1) = the worst-case number of toolchanges on one layer. // Why: mark_wiping_extrusions overrides whole extrusion-entity COLLECTIONS, @@ -337,68 +393,64 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object // reintroduce the multi-swap-per-layer absorption bug; a hair over ~2 line // widths also keeps gap-fill from bridging them. 1 mm is about as close as // they can butt up while staying individually purgeable. - const double w_sub = (width - (n_islands - 1) * gap) / n_islands; + for (int plate_idx : to_create) { + const Plan &plan = plans[size_t(plate_idx)]; - // --- (Re)create --------------------------------------------------------- - if (!prism_idxs.empty()) - remove_prisms(prism_idxs); + TriangleMesh prism_mesh; + for (int i = 0; i < plan.n_islands; ++i) { + const double lat_off = i * (plan.w_sub + gap); + // Box dims: lateral = w_sub, along-belt = length, vertical = height. + TriangleMesh box = belt_is_y ? make_cube(plan.w_sub, plan.length, plan.height) // X = lateral, Y = belt + : make_cube(plan.length, plan.w_sub, plan.height); // X = belt, Y = lateral + box.translate(belt_is_y ? Vec3f((float) lat_off, 0.f, 0.f) : Vec3f(0.f, (float) lat_off, 0.f)); + prism_mesh.merge(box); + } - TriangleMesh prism_mesh; - for (int i = 0; i < n_islands; ++i) { - const double lat_off = i * (w_sub + gap); - // Box dims: lateral = w_sub, along-belt = length, vertical = height. - TriangleMesh box = belt_is_y ? make_cube(w_sub, length, height) // X = lateral, Y = belt - : make_cube(length, w_sub, height); // X = belt, Y = lateral - box.translate(belt_is_y ? Vec3f((float) lat_off, 0.f, 0.f) : Vec3f(0.f, (float) lat_off, 0.f)); - prism_mesh.merge(box); + ModelObject *new_object = model.add_object(); + new_object->name = _u8L("Belt Purge Tower"); + new_object->add_instance(); + ModelVolume *new_volume = new_object->add_volume(std::move(prism_mesh)); + new_volume->name = new_object->name; + + auto &cfg = new_object->config; + cfg.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); + cfg.set_key_value("flush_into_objects", new ConfigOptionBool(true)); + cfg.set_key_value("extruder", new ConfigOptionInt(1)); + // Sacrificial solid prism: one wall, no shells, dense rectilinear infill — + // every extrusion is overriddable, so the absorbed volume matches the + // cross-section x layer-height estimate used for the height above. + cfg.set_key_value("wall_loops", new ConfigOptionInt(1)); + cfg.set_key_value("top_shell_layers", new ConfigOptionInt(0)); + cfg.set_key_value("bottom_shell_layers", new ConfigOptionInt(0)); + cfg.set_key_value("sparse_infill_density", new ConfigOptionPercent(100)); + cfg.set_key_value("sparse_infill_pattern", new ConfigOptionEnum(ipRectilinear)); + cfg.set_key_value("enable_support", new ConfigOptionBool(false)); + cfg.set_key_value("brim_type", new ConfigOptionEnum(btNoBrim)); + cfg.set_key_value("seam_slope_type", new ConfigOptionEnum(SeamScarfType::None)); + cfg.set_key_value("precise_z_height", new ConfigOptionBool(false)); + + // Position by the belt-calibration pattern: drop to the bed, then translate + // the instance by the delta between the object's ACTUAL bbox center and the + // target. Setting the instance offset directly is unreliable here — the + // freshly added cube's local frame is not centered, so set_offset() lands + // the min corner (not the center) on the target, leaving the bar centered + // on the bed edge with half of it hanging off. + new_object->invalidate_bounding_box(); + new_object->ensure_on_bed(); + const BoundingBoxf3 cur = new_object->bounding_box_exact(); + new_object->translate_instances(Vec3d(plan.center.x() - cur.center().x(), + plan.center.y() - cur.center().y(), + 0.0)); + new_object->instances.front()->set_assemble_transformation(new_object->instances.front()->get_transformation()); + + const size_t obj_idx = model.objects.size() - 1; + // Registers the object in the sidebar and notifies the part plates; + // selection is left untouched (auto-managed object). + obj_list->add_object_to_list(obj_idx, /*call_selection_changed=*/false); + + sigs[size_t(plate_idx)] = plan.sig; } - ModelObject *new_object = model.add_object(); - new_object->name = _u8L("Belt Purge Tower"); - new_object->add_instance(); - ModelVolume *new_volume = new_object->add_volume(std::move(prism_mesh)); - new_volume->name = new_object->name; - - auto &cfg = new_object->config; - cfg.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); - cfg.set_key_value("flush_into_objects", new ConfigOptionBool(true)); - cfg.set_key_value("extruder", new ConfigOptionInt(1)); - // Sacrificial solid prism: one wall, no shells, dense rectilinear infill — - // every extrusion is overriddable, so the absorbed volume matches the - // cross-section x layer-height estimate used for the height above. - cfg.set_key_value("wall_loops", new ConfigOptionInt(1)); - cfg.set_key_value("top_shell_layers", new ConfigOptionInt(0)); - cfg.set_key_value("bottom_shell_layers", new ConfigOptionInt(0)); - cfg.set_key_value("sparse_infill_density", new ConfigOptionPercent(100)); - cfg.set_key_value("sparse_infill_pattern", new ConfigOptionEnum(ipRectilinear)); - cfg.set_key_value("enable_support", new ConfigOptionBool(false)); - cfg.set_key_value("brim_type", new ConfigOptionEnum(btNoBrim)); - cfg.set_key_value("seam_slope_type", new ConfigOptionEnum(SeamScarfType::None)); - cfg.set_key_value("precise_z_height", new ConfigOptionBool(false)); - - // Position by the belt-calibration pattern: drop to the bed, then translate - // the instance by the delta between the object's ACTUAL bbox center and the - // target. Setting the instance offset directly is unreliable here — the - // freshly added cube's local frame is not centered, so set_offset() lands - // the min corner (not the center) on the target, leaving the bar centered - // on the bed edge with half of it hanging off. - new_object->invalidate_bounding_box(); - new_object->ensure_on_bed(); - const BoundingBoxf3 cur = new_object->bounding_box_exact(); - new_object->translate_instances(Vec3d(desired_center.x() - cur.center().x(), - desired_center.y() - cur.center().y(), - 0.0)); - new_object->instances.front()->set_assemble_transformation(new_object->instances.front()->get_transformation()); - - const size_t obj_idx = model.objects.size() - 1; - // Registers the object in the sidebar and notifies the part plates; - // selection is left untouched (auto-managed object). - obj_list->add_object_to_list(obj_idx, /*call_selection_changed=*/false); - - // Record the inputs that produced this prism so subsequent ticks are no-ops - // until the parts/config actually change. - sig = new_sig; - return true; } diff --git a/src/slic3r/GUI/BeltPurgeTower.hpp b/src/slic3r/GUI/BeltPurgeTower.hpp index 27d5b47c94..a009eb4d4b 100644 --- a/src/slic3r/GUI/BeltPurgeTower.hpp +++ b/src/slic3r/GUI/BeltPurgeTower.hpp @@ -1,5 +1,7 @@ #pragma once +#include + // ORCA-Belt: auto-managed purge prism for belt printers. // // Kept in its own translation unit (not buried in Plater.cpp) so it stays out @@ -34,12 +36,13 @@ struct BeltPurgeSignature } }; -// Keep the auto-generated belt purge prism in sync with the current config and -// plate contents. Creates / updates / removes the marked prism ModelObject. +// Keep the auto-generated belt purge prisms, one per plate, in sync with the +// current config and plate contents. Creates / updates / removes the marked prism +// ModelObjects; `sigs` holds the last inputs per plate index. // Returns true when the model was mutated (caller should refresh the scene). // Runs on every background-process update, so it is idempotent: it only mutates // the model when the desired prism differs from the cached signature in `sig`. -bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, ObjectList *obj_list, BeltPurgeSignature &sig); +bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, ObjectList *obj_list, std::vector &sigs); } // namespace GUI } // namespace Slic3r diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index cb5d2f7ace..b011d55865 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6993,7 +6993,7 @@ struct Plater::priv // config and plate contents (thin wrapper over GUI::ensure_belt_purge_tower // in BeltPurgeTower.cpp). Returns true when the model was mutated. bool ensure_belt_purge_tower(); - BeltPurgeSignature m_belt_purge_sig; + std::vector m_belt_purge_sigs; void delete_all_objects_from_model(); void reset(bool apply_presets_change = false); void center_selection(); @@ -10633,7 +10633,7 @@ void Plater::priv::process_validation_warnings(const std::vectorobj_list(), m_belt_purge_sig); + return GUI::ensure_belt_purge_tower(model, partplate_list, sidebar->obj_list(), m_belt_purge_sigs); } From 69e7cc1544c2ae7be32fdf39e2aee6667ee9fc7b Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 3 Oct 2026 19:19:02 -0500 Subject: [PATCH 210/389] Preview: judge a belt print's toolpaths by their back-transformed box all_paths_inside() accepts the path bounding box only within 3*EPSILON of the bed and otherwise tests every move; a belt print's moves are machine-frame coordinates whose Z is belt travel, so that test can never pass, and the designed view's min-corner anchor leaves the box a fraction of a millimetre below zero. Every multi-object belt plate therefore reported a path beyond the plate. The belt preview now judges the back-transformed box with a millimetre of room. --- src/slic3r/GUI/GCodeViewer.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index d34b8c2c63..89bc7e3fab 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1518,8 +1518,18 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const }); m_paths_bounding_box = BoundingBoxf3(libvgcode::convert(bbox[0]).cast(), libvgcode::convert(bbox[1]).cast()); - if (wxGetApp().is_editor()) - m_contained_in_bed = wxGetApp().plater()->build_volume().all_paths_inside(gcode_result, m_paths_bounding_box); + if (wxGetApp().is_editor()) { + if (is_belt) { + // The moves are machine-frame coordinates (Z is belt travel), so the per-move + // test inside all_paths_inside() can never pass on a belt. Judge the + // back-transformed box instead, with room for the designed view's min-corner + // anchor, which is only accurate to a fraction of a millimetre. + BoundingBoxf3 bed = wxGetApp().plater()->build_volume().bounding_volume(); + bed.offset(1.); + m_contained_in_bed = !m_paths_bounding_box.defined || (bed.contains(m_paths_bounding_box.min) && bed.contains(m_paths_bounding_box.max)); + } else + m_contained_in_bed = wxGetApp().plater()->build_volume().all_paths_inside(gcode_result, m_paths_bounding_box); + } m_extruders_count = gcode_result.filaments_count; From 1f91fdf63765545256da23bfebe8b0b0d66ce202 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sun, 4 Oct 2026 21:27:12 +0800 Subject: [PATCH 211/389] Show feature and body actions on their rows in the Design sidebar Each Feature tree row now carries Edit, Show/hide and Delete, and each Bodies row carries Move, Show/hide and Delete. These act on that row instead of on the selection. The eye shows a closed eye when the item is hidden. Every clickable icon in the sidebar now highlights on hover. Rename and Color now come first in the right-click menu, as items of their own instead of inside Modify. This applies wherever they appear, whether opened from the viewport or from a Bodies row. Clicking an already-selected row no longer starts a rename; use F2, the row's right-click menu, or the Rename command. --- docs/HLSD/design-tab.md | 16 +- resources/images/design_eye_off.svg | 1 + scripts/CAD/gen_offer_table.py | 13 +- scripts/CAD/tool_atlas.json | 10 +- src/slic3r/CMakeLists.txt | 2 + src/slic3r/GUI/CAD/DesignOffer.hpp | 22 +- src/slic3r/GUI/CAD/DesignPanel.cpp | 605 ++++++++++++--------------- src/slic3r/GUI/CAD/DesignPanel.hpp | 39 +- src/slic3r/GUI/CAD/DesignRowList.cpp | 377 +++++++++++++++++ src/slic3r/GUI/CAD/DesignRowList.hpp | 108 +++++ 10 files changed, 824 insertions(+), 369 deletions(-) create mode 100644 resources/images/design_eye_off.svg create mode 100644 src/slic3r/GUI/CAD/DesignRowList.cpp create mode 100644 src/slic3r/GUI/CAD/DesignRowList.hpp diff --git a/docs/HLSD/design-tab.md b/docs/HLSD/design-tab.md index 20299a51a0..4f8b61d755 100644 --- a/docs/HLSD/design-tab.md +++ b/docs/HLSD/design-tab.md @@ -197,7 +197,14 @@ The tab is a page of Orca's main window and answers to the same settings as Prep Orca's sidebar grey, which the icon cache maps per theme, so they are re-rasterised rather than re-tinted. - **Scale.** Sizes are in DIP, and a DPI change reaches `DesignPanel::msw_rescale`, which - re-rasterises every icon (button faces, flyout rows, card headers, the tree's image list). + re-rasterises every icon (button faces, flyout rows, card headers, the feature and body lists' + row icons). +- **Sidebar icons.** Every clickable icon in the sidebar shows a hover chip. The card-header and + constraint-row buttons are Orca's self-painted `Button`, because a native button cannot take a + hover background on macOS. The Feature tree and Bodies lists are a custom-drawn + `DesignRowList` rather than a `wxTreeCtrl`, so each row carries its own actions — Edit, + Show/hide and Delete on a feature, Move, Show/hide and Delete on a body — and the eye shows + whether that row is hidden. - **Viewport text.** The status line and the active tool's values are drawn by the canvas in its ImGui pass, so they go with the canvas: a top-level window over GL does not follow its frame and was left floating over other applications. @@ -219,7 +226,11 @@ Right-clicking geometry opens the *offer*: eight families in a fixed order, each permanent row index, verbs that do not apply shown disabled **in place with their reason** rather than removed. The invariant is that a verb's row index is identical in every selection where it appears and that adding a verb never moves an existing one — the hand learns the -position, so the menu is never re-sorted, compacted or adaptively ordered. +position, so the menu is never re-sorted, compacted or adaptively ordered. Above the families +sits one *flat* row, holding Rename and Color — what a selection is opened for most: its verbs are +items of their own at the top of the menu rather than a family's submenu. It is appended after +the eight, so it moved no existing index, and it reads the same from the viewport and from a row +of the Bodies list. An invariant across 92 verbs and 20 selection kinds does not survive by review, so the map exists once, as data: `scripts/CAD/tool_atlas.json` carries every verb with its row, key, icon, @@ -250,6 +261,7 @@ scripted action and a clicked one cannot diverge. It is off unless the variable | `src/libslic3r/CAD/SketchSolver.*` | constraint solving, over the vendored solver | | `src/libslic3r/slvs/` | vendored 2D constraint solver (GPLv3) | | `src/slic3r/GUI/CAD/DesignPanel.*` | the tab: toolbar, feature cards, tree, key maps | +| `src/slic3r/GUI/CAD/DesignRowList.*` | the Feature tree and Bodies lists, with per-row actions | | `src/slic3r/GUI/CAD/DesignCanvas.*` | viewport integration | | `src/slic3r/GUI/CAD/DesignSketchTool.*` | in-canvas sketching | | `src/slic3r/GUI/CAD/DesignInteraction.hpp` | the Esc level contract | diff --git a/resources/images/design_eye_off.svg b/resources/images/design_eye_off.svg new file mode 100644 index 0000000000..42f619305d --- /dev/null +++ b/resources/images/design_eye_off.svg @@ -0,0 +1 @@ + diff --git a/scripts/CAD/gen_offer_table.py b/scripts/CAD/gen_offer_table.py index c6be64f891..3716b95db3 100644 --- a/scripts/CAD/gen_offer_table.py +++ b/scripts/CAD/gen_offer_table.py @@ -114,7 +114,7 @@ def main(): "struct OfferVerb {", " const char* id;", " const char* name; // drawing-office word (L10); marked L(); translated at use", - " int row; // 0..7, the ratified index — NEVER reorder", + " int row; // index into kOfferRowNames, the ratified address — NEVER reorder", " const char* key; // shortcut shown in the row, or nullptr", " const char* action;", " const char* refusal; // why this row is greyed, in the product's own words", @@ -135,11 +135,20 @@ def main(): "// Row labels, in ratified order.", "static const char* const kOfferRowNames[] = {", ] + # A flat row's label is never shown, so it is not marked for translation. for s in A["slots"]: - lines.append(f' {tstr(s["label"])},') + lines.append(f' {cstr(s["label"]) if s.get("flat") else tstr(s["label"])},') lines += [ "};", f"static const int kOfferRowCount = {len(slots)};", + "// A flat row is not a family: its verbs come first, at the top level of the offer, each", + "// an item of its own.", + "static const bool kOfferRowFlat[] = {", + ] + for s in A["slots"]: + lines.append(f' {"true" if s.get("flat") else "false"},') + lines += [ + "};", "", "static const OfferVerb kOfferVerbs[] = {", ] diff --git a/scripts/CAD/tool_atlas.json b/scripts/CAD/tool_atlas.json index de3fc8a1ed..1e7f1bf968 100644 --- a/scripts/CAD/tool_atlas.json +++ b/scripts/CAD/tool_atlas.json @@ -67,6 +67,12 @@ "angle": 225, "label": "Modify", "why": "edits or removes what is already there" + }, + { + "id": "top", + "label": "Top", + "flat": true, + "why": "the verbs a selection is opened for most. A flat slot is not a family: its verbs sit first, at the top level of the offer, each an item of its own, and its label is never shown. Appended last, so no ratified index moved." } ], "selections": [ @@ -1044,7 +1050,7 @@ { "id": "rename", "name": "Rename…", - "slot": "modify", + "slot": "top", "key": "F2", "feature": "Tree", "mcp": null, @@ -1084,7 +1090,7 @@ { "id": "colour", "name": "Color", - "slot": "modify", + "slot": "top", "key": null, "feature": null, "mcp": null, diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index 9611c0fa68..5f38507757 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -848,6 +848,8 @@ if (SLIC3R_CAD) list(APPEND SLIC3R_GUI_SOURCES GUI/CAD/DesignPanel.cpp GUI/CAD/DesignPanel.hpp + GUI/CAD/DesignRowList.cpp + GUI/CAD/DesignRowList.hpp GUI/CAD/DesignTextDialog.cpp GUI/CAD/DesignTextDialog.hpp GUI/CAD/DesignCanvas.cpp diff --git a/src/slic3r/GUI/CAD/DesignOffer.hpp b/src/slic3r/GUI/CAD/DesignOffer.hpp index fcfb908846..67133573a3 100644 --- a/src/slic3r/GUI/CAD/DesignOffer.hpp +++ b/src/slic3r/GUI/CAD/DesignOffer.hpp @@ -53,7 +53,7 @@ inline uint32_t offer_bit(OfferSel s) { return 1u << int(s); } struct OfferVerb { const char* id; const char* name; // drawing-office word (L10); marked L(); translated at use - int row; // 0..7, the ratified index — NEVER reorder + int row; // index into kOfferRowNames, the ratified address — NEVER reorder const char* key; // shortcut shown in the row, or nullptr const char* action; const char* refusal; // why this row is greyed, in the product's own words @@ -81,8 +81,22 @@ static const char* const kOfferRowNames[] = { L("Transform"), L("Reference"), L("Modify"), + "Top", +}; +static const int kOfferRowCount = 9; +// A flat row is not a family: its verbs come first, at the top level of the offer, each +// an item of its own. +static const bool kOfferRowFlat[] = { + false, + false, + false, + false, + false, + false, + false, + false, + true, }; -static const int kOfferRowCount = 8; static const OfferVerb kOfferVerbs[] = { {"sketch", L("Sketch"), 0, "Shift+S", "key:S+S", L("Click a face or a reference plane in the viewport, then a sketch tool"), 0x00000403u, 0, 0, false, false, nullptr, "design_sketch", L("Click a face or a reference plane, then pick a drawing tool")}, @@ -125,9 +139,9 @@ static const OfferVerb kOfferVerbs[] = { {"mass_props", L("Volume and area"), 6, nullptr, "btn:mass", nullptr, 0x000000feu, 1, 0, false, false, nullptr, "info", L("Report the volume and surface area of the selected body")}, {"interference", L("Interference"), 6, nullptr, "btn:interference", L("Interference needs at least two bodies"), 0x00000280u, 2, 0, false, false, nullptr, nullptr, L("Check whether two bodies overlap — reports, changes nothing")}, {"edit_feature", L("Edit"), 7, nullptr, "btn:edit", nullptr, 0x00007d8eu, 0, 0, false, false, nullptr, "design_edit", L("Reopen the selected feature to change what it was made from")}, - {"rename", L("Rename…"), 7, "F2", "btn:rename", L("Select a feature, or a body, to rename it"), 0x00004080u, 0, 0, false, false, nullptr, nullptr, L("Give this feature a name you will recognise in the tree (a body takes its name from the feature that makes it)")}, + {"rename", L("Rename…"), 8, "F2", "btn:rename", L("Select a feature, or a body, to rename it"), 0x00004080u, 0, 0, false, false, nullptr, nullptr, L("Give this feature a name you will recognise in the tree (a body takes its name from the feature that makes it)")}, {"delete_face", L("Delete Face"), 7, nullptr, "fly:dressup#3", L("Delete Face needs a body — add or import one first"), 0x0000000eu, 1, 0, false, false, nullptr, "design_delete", L("Remove faces from a body and heal the solid")}, - {"colour", L("Color"), 7, nullptr, "btn:colour", nullptr, 0x000001feu, 1, 0, false, false, nullptr, "color_palette", L("Set the selected body's display color")}, + {"colour", L("Color"), 8, nullptr, "btn:colour", nullptr, 0x000001feu, 1, 0, false, false, nullptr, "color_palette", L("Set the selected body's display color")}, {"delete", L("Delete"), 7, "Del", "btn:delete", nullptr, 0x000f7c00u, 0, 0, false, false, nullptr, "design_delete", L("Delete what is selected")}, {"delete_body", L("Delete Body"), 7, nullptr, "btn:delete_body", nullptr, 0x000001feu, 1, 0, false, false, nullptr, "design_delete", L("Delete this whole body — removes the feature it was made from")}, {"sk_line_t", L("Line"), 0, "L", "key:L", nullptr, 0x000f8000u, 0, 0, false, true, L("Line"), "design_line", L("Line — click start, then end")}, diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 7d4f83824a..9c84a65942 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -3,6 +3,7 @@ #include "slic3r/GUI/CAD/DesignCanvas.hpp" #include "slic3r/GUI/CAD/DesignSketchTool.hpp" #include "slic3r/GUI/CAD/DesignTextDialog.hpp" // Text: font, height, live outline +#include "slic3r/GUI/CAD/DesignRowList.hpp" // Feature tree and Bodies rows with their own actions #include "slic3r/GUI/CAD/DesignOffer.hpp" // generated offer table — see scripts/CAD/tool_atlas.json #include "libslic3r/CAD/GeometryEngine.hpp" // face_by_index for face-extrude gizmo anchor #include "libslic3r/TriangleMesh.hpp" // mesh import: STL/OBJ -> indexed_triangle_set @@ -58,12 +59,9 @@ #include #include #include -#include #include #include #include -#include -#include #include #include #include @@ -242,6 +240,43 @@ static StaticBox* make_card(wxWindow* parent) return c; } +// The sidebar's icon-only buttons (card headers, constraint rows) highlight under the pointer with +// a rounded chip. Orca's ::Button rather than a ScalableButton: a native button cannot take that +// hover colour (macOS ignores a button background, MSW turns the button owner-drawn), while +// ::Button paints itself the same on every platform. Its sizes are in pixels, and the panel +// background is a Design token the dark map does not know, so refresh_icons() re-applies this +// after a DPI or theme change to every button named "design_icon_btn". +static void style_sidebar_icon_btn(::Button* b) +{ + b->SetPaddingSize(b->FromDIP(wxSize(2, 2))); + b->SetMinSize(b->FromDIP(wxSize(24, 24))); // square, whatever the icon size + b->SetCornerRadius(b->FromDIP(4)); + b->SetBackgroundColor(StateColor( + std::pair(wxColour(DesignRowList::hover_chip), StateColor::Hovered), // dark-mapped at paint + std::pair(dp_panel_bg(), StateColor::Normal))); // must stay last +} + +static ::Button* sidebar_icon_btn(wxWindow* parent, const char* icon, const wxString& tip, int px = 20) +{ + auto* b = new ::Button(parent, "", icon, wxBORDER_NONE, px); + b->SetName("design_icon_btn"); + b->SetCanFocus(false); + b->SetIconSpacing(0); // off macOS an empty label still reserves the icon-text gap + b->SetBorderColor(StateColor()); + b->SetToolTip(tip); + style_sidebar_icon_btn(b); + return b; +} + +// The icons on each Feature tree and Bodies row (DesignRowList::Action::id). +enum RowAction { RowEdit, RowMove, RowVisibility, RowDelete }; + +// A row's eye shows the state the row is in; its tip names what a click does. +static DesignRowList::Action eye_action(bool shown) +{ + return { RowVisibility, shown ? "design_eye" : "design_eye_off", shown ? _L("Hide") : _L("Show") }; +} + // Prepare outlines every numeric field (rounded, #4A4A51 on dark). wxSpinCtrlDouble is a // native GTK control that cannot draw that, and Orca's own SpinInput is int-only — it would // silently truncate a 2.5 mm radius. So the double spin keeps its arrows and validation and @@ -1040,29 +1075,20 @@ DesignPanel::DesignPanel(wxWindow* parent) fadd("color", b_color); m_verb_actions["btn:colour"] = [this] { on_set_body_color(); }; m_verb_actions["btn:delete"] = [this] { on_delete_feature(); }; - // Rename exists as a slow double-click on the row too, but the offer is this tab's only - // tool vocabulary — a rename that only a double-click reveals is not discoverable, and - // the row IS the object, so it belongs in the menu (and on F2) as well as on the row. + // A row's double-click is Edit, so renaming needs a door of its own. The offer is this + // tab's only tool vocabulary and the row IS the object, so rename sits in the offer, in + // the feature row's right-click menu and on F2, and opens the editor on the row itself. auto rename_feature = [this] { // A BODY renames ITSELF. The earlier version resolved the body to // CadBody::source_feature and renamed that feature, which is the wrong object: a // body accumulates many features and the first one is not its name. The body row // is editable now (CadBody::user_name), so the verb opens the editor there. - const int b = tree_body_selection(); - if (b >= 0 && b < int(m_tree_body_items.size())) { - const wxTreeItemId row = m_tree_body_items[b]; - // After the menu, not inside it: an editor opened from within PopupMenu's - // nested loop never appears. - CallAfter([this, row] { m_parts->SetFocus(); m_parts->EditLabel(row); }); - return; - } - const int sel = tree_selection(); - if (sel != wxNOT_FOUND && sel < int(m_tree_items.size())) { - const wxTreeItemId row = m_tree_items[sel]; - CallAfter([this, row] { m_tree->SetFocus(); m_tree->EditLabel(row); }); - } else { + if (const int b = tree_body_selection(); b >= 0) + m_parts->begin_rename(b); + else if (const int sel = tree_selection(); sel != wxNOT_FOUND) + m_tree->begin_rename(sel); + else set_status(_L("Select a feature, or a body, first — then rename it")); // not an error - } }; m_verb_actions["btn:rename"] = rename_feature; m_keys_feature[WXK_F2] = rename_feature; // a function key, so no letter space spent @@ -3047,8 +3073,8 @@ DesignPanel::DesignPanel(wxWindow* parent) t->Wrap(240); // Feature tree card. Same idiom as Prepare's sections (icon + Head_14 title + rule) via the - // shared card_header helper, instead of the bare micro-label this used to be; the row-edit - // actions live in the header, as Prepare puts its section actions. + // shared card_header helper, instead of the bare micro-label this used to be. What acts on one + // feature sits on that feature's row; the header keeps reordering and the interference check. m_tree_box = make_card(m_form); auto* tree_inner = new wxBoxSizer(wxVERTICAL); m_tree_box->SetSizer(tree_inner); @@ -3062,43 +3088,21 @@ DesignPanel::DesignPanel(wxWindow* parent) FromDIP(SidebarProps::ContentMargin())); tree_inner->Add(new wxStaticLine(m_tree_box), 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, FromDIP(SidebarProps::TitlebarMargin())); - m_tree = new wxTreeCtrl(m_tree_box, wxID_ANY, wxDefaultPosition, FromDIP(wxSize(-1, 64)), - wxTR_HIDE_ROOT | wxTR_SINGLE | wxTR_NO_LINES | - wxTR_FULL_ROW_HIGHLIGHT | wxBORDER_SIMPLE | wxTR_EDIT_LABELS); + // Sized to its rows, so a short history wastes no block, and scrolling past 9. + m_tree = new DesignRowList(m_tree_box, 9); m_tree->SetBackgroundColour(dp_panel_bg()); - // Per-feature-type icons (indices match tree_icon_for): sketch/extrude/dressup/hole/thread. - // The list is sized from the bitmaps themselves (image-list sizes are physical and must match - // them), and rebuilt with the other icons on a DPI or theme change. - auto tree_images = [this] { - static const char* const kIcons[] = { "design_sketch", "design_extrude", "design_dressup", - "design_hole", "design_thread", "design_shell" }; - std::vector bmps; - for (const char* name : kIcons) - bmps.push_back(create_scaled_bitmap(name, this, 16)); - const wxSize sz = bmps.front().GetSize(); - m_tree_images = new wxImageList(sz.x, sz.y); - for (const wxBitmap& b : bmps) - m_tree_images->Add(b); - m_tree->AssignImageList(m_tree_images); // takes ownership; frees the previous list - }; - tree_images(); - m_icon_refresh.push_back(tree_images); tree_inner->Add(m_tree, 0, wxEXPAND | wxALL, 12); // Selecting a body-producing feature (Extrude/Fillet/Chamfer/Hole/Thread) in the // tree highlights the solid in the viewport; a Sketch row clears the highlight // (its face is already shown via the persistent sketch overlay). - m_tree->Bind(wxEVT_TREE_SEL_CHANGED, [this](wxTreeEvent&) { + m_tree->on_select = [this] { if (!m_viewport) return; - // Bodies live in the Parts list now; picking a feature here drops any body selection - // so the two lists can't both claim to be "the target". - // ONLY when this tree actually has a selection. These two lists clear each other's - // selection so that "the target" is never ambiguous, and that was harmless while both - // calls were UnselectAll() — a no-op on a wxTR_SINGLE tree. Now that Unselect() really - // clears, the pair became a loop: clicking a body row runs apply_body_row, which calls - // m_tree->Unselect(), which fires THIS handler, which cleared the body row the user had - // just clicked. The guard keeps the mutual-exclusion and drops the echo. - if (m_parts && tree_selection() != wxNOT_FOUND) m_parts->Unselect(); + // Picking a feature drops any body selection, so the two lists never both claim to be + // "the target" — but ONLY when this tree has a selection. Each list notifies on every + // change, so clicking a body row runs apply_body_row, whose m_tree->unselect() fires + // THIS handler, which would otherwise clear the body row the user had just clicked. + if (m_parts && tree_selection() != wxNOT_FOUND) m_parts->unselect(); const int sel = tree_selection(); const bool body = (sel >= 0 && sel < int(m_doc.features.size()) && m_doc.features[sel].type != CadFeatureType::Sketch && @@ -3116,27 +3120,31 @@ DesignPanel::DesignPanel(wxWindow* parent) _L("%s selected — F2 or right-click renames it, double-click edits it"), wxString::FromUTF8(m_doc.features[sel].name))); } - }); + }; // Double-click a row = Edit, the same gesture that re-opens a committed sketch on the canvas. - // Without it the row only highlights and the feature looks dead until the user finds the - // Edit button in the section header. - m_tree->Bind(wxEVT_TREE_ITEM_ACTIVATED, [this](wxTreeEvent&) { on_edit_feature(); }); + m_tree->on_activate = [this] { on_edit_feature(); }; - // Right-click a row: the three things a row can do. Renaming had no discoverable route at - // all — the header pencil is Edit, a double-click ACTIVATES the row and is also Edit (the - // "slow double-click renames" the old comment promised does not survive wxGTK, which fires - // ITEM_ACTIVATED first), none of the seven header icons renames, and F2 is a function key - // nothing announces. A user who wants to name a sketch tries the row, and now the row - // answers. rename. - m_tree->Bind(wxEVT_TREE_ITEM_RIGHT_CLICK, [this](wxTreeEvent& e) { - m_tree->SelectItem(e.GetItem()); // right-click targets what it points at - const int sel = tree_selection(); - if (sel == wxNOT_FOUND) return; - // EVERYTHING A ROW CAN DO, in one place. The header icons stay as a quick bar, but the - // menu is the reference: the element you click answers with what applies to it, and a - // menu grows without spending an icon nobody recognises. Split into what the row IS - // (name, contents), where it SITS (order, visibility) and what removes it. + // The row's own Edit / Show-hide / Delete, on the row the click selected. The body list is + // cleared here too, not left to on_select, which re-clicking the selected row does not run: + // a body row still selected would be what on_toggle_visibility acts on. + m_tree->on_action = [this](int, int id) { + if (m_parts) m_parts->unselect(); + switch (id) { + case RowEdit: on_edit_feature(); break; + case RowVisibility: on_toggle_visibility(); break; + case RowDelete: on_delete_feature(); break; + } + }; + + // Right-click a row: everything a row can do. Renaming had no discoverable route at all — a + // double-click is Edit, and F2 is a function key nothing announces. A user who wants to name + // a sketch tries the row, and the row answers. + m_tree->on_menu = [this](int row, const wxPoint& screen) { + // EVERYTHING A ROW CAN DO, in one place. The row's icons are the quick bar, but the menu + // is the reference: the element you click answers with what applies to it, and a menu + // grows without spending an icon nobody recognises. Split into what the row IS (name, + // contents), where it SITS (order, visibility) and what removes it. wxMenu menu; const int id_rename = wxWindow::NewControlId(); const int id_edit = wxWindow::NewControlId(); @@ -3150,8 +3158,8 @@ DesignPanel::DesignPanel(wxWindow* parent) // Scale artwork acts on THIS feature's imported outline, so it belongs to the row and // is offered only where it means something. It used to hide inside the header's Move // button, which otherwise moved a body — two different subjects on one icon. - const bool art = sel < int(m_doc.features.size()) && - !m_doc.features[sel].imported_regions.empty(); + const bool art = row < int(m_doc.features.size()) && + !m_doc.features[row].imported_regions.empty(); if (art) menu.Append(id_art, _L("Scale artwork")); menu.AppendSeparator(); menu.Append(id_up, _L("Move up")); @@ -3159,99 +3167,43 @@ DesignPanel::DesignPanel(wxWindow* parent) menu.Append(id_vis, _L("Show / hide")); menu.AppendSeparator(); menu.Append(id_del, _L("Delete")); - menu.Bind(wxEVT_MENU, [this](wxCommandEvent&) { - const int row = tree_selection(); - if (row != wxNOT_FOUND && row < int(m_tree_items.size())) - m_tree->EditLabel(m_tree_items[row]); - }, id_rename); + menu.Bind(wxEVT_MENU, [this](wxCommandEvent&) { m_verb_actions["btn:rename"](); }, id_rename); menu.Bind(wxEVT_MENU, [this](wxCommandEvent&) { on_edit_feature(); }, id_edit); menu.Bind(wxEVT_MENU, [this](wxCommandEvent&) { on_move_feature(-1); }, id_up); menu.Bind(wxEVT_MENU, [this](wxCommandEvent&) { on_move_feature(+1); }, id_down); menu.Bind(wxEVT_MENU, [this](wxCommandEvent&) { on_toggle_visibility(); }, id_vis); menu.Bind(wxEVT_MENU, [this](wxCommandEvent&) { on_delete_feature(); }, id_del); if (art) - menu.Bind(wxEVT_MENU, [this](wxCommandEvent&) { - const int row = tree_selection(); - if (row != wxNOT_FOUND) on_transform_imported(row); - }, id_art); - m_tree->PopupMenu(&menu); - }); - - // In-place rename of a feature row (slow double-click, the offer's Rename verb, or F2). - // The name is what makes a tree of eight sketches readable, and the tree row IS the object — - // so renaming belongs on the row, not in a side-panel field. Bodies are computed results, - // not named features, so a body row must never open an editor (it cannot, they live in the - // Parts list, but the guard keeps a future change from slipping a body into this tree). - auto item_index = [this](const wxTreeItemId& it) -> int { - for (size_t i = 0; i < m_tree_items.size(); ++i) - if (m_tree_items[i] == it) return int(i); - return wxNOT_FOUND; + menu.Bind(wxEVT_MENU, [this, row](wxCommandEvent&) { on_transform_imported(row); }, id_art); + m_tree->PopupMenu(&menu, m_tree->ScreenToClient(screen)); }; - m_tree->Bind(wxEVT_TREE_BEGIN_LABEL_EDIT, [this, item_index](wxTreeEvent& e) { - // The event's item is the authority for WHAT is being edited; tree_selection() is not, - // because the editor can open on a row that is not the current selection. A row that is - // not a feature (a body, or a stray id) gets the edit vetoed before it can take a name. - if (tree_body_selection() >= 0 || item_index(e.GetItem()) == wxNOT_FOUND) { e.Veto(); return; } - e.Skip(); - }); - m_tree->Bind(wxEVT_TREE_END_LABEL_EDIT, [this, item_index](wxTreeEvent& e) { - if (e.IsEditCancelled()) return; - const int idx = item_index(e.GetItem()); - if (idx == wxNOT_FOUND) { e.Veto(); return; } - wxString label = e.GetLabel(); - label.Trim(true).Trim(false); - if (label.empty()) { e.Veto(); return; } // a nameless row is worse than a badly named one - m_doc.features[idx].name = std::string(label.ToUTF8().data()); - sync_recipe_to_model(); // the name is part of the recipe, so the save path persists it - e.Skip(); // let wx finish applying the label to the item it is holding - // REBUILD LATER, NOT NOW. refresh_tree() deletes and re-creates every wxTreeItemId, and - // we are inside wx's own END_LABEL_EDIT dispatch for one of them — destroying it here - // frees the item the caller is still using and takes the process down. Measured: typing - // a name and pressing Enter killed the app outright, with the keystrokes traced and no - // trace for the Return. Deferring to the next event-loop turn lets wx finish first. - CallAfter([this] { refresh_tree(); }); - }); - // Feature-tree edit actions: act on the selected feature (delete / reorder). These sit in the - // card header (Prepare puts its section actions there too) rather than on a loose row below. + // In-place rename of a feature row (F2, the offer's Rename verb, or the row's menu). The name + // is what makes a tree of eight sketches readable, and the tree row IS the object — so + // renaming belongs on the row, not in a side-panel field. The list hands the name over after + // its editor's events have finished, so rebuilding the rows here is safe. + m_tree->on_rename = [this](int row, const wxString& name) { + if (row < 0 || row >= int(m_doc.features.size())) return; + m_doc.features[row].name = std::string(name.ToUTF8().data()); + refresh_tree(); // which syncs the recipe, so the save path persists the name + }; + + // The header keeps what is not one row's own action: reordering, which moves the selected + // feature among the others, and the interference check, which reports on every body. { wxBoxSizer* trow = m_hdr_tree_row; - auto edit_btn = [this](const char* icon, const wxString& tip) { - // Header-sized: reads as a section action, not a primary control. - auto* b = new ScalableButton(m_tree_box, wxID_ANY, icon, "", FromDIP(wxSize(24, 24)), - wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 20); - b->SetToolTip(tip); - return b; - }; - auto* edit = edit_btn("design_edit", _L("Edit")); - edit->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_edit_feature(); }); // NO Move here. Moving a body is not a feature-row action — this header sits over the // FEATURE tree, and the button had to guess its subject from whatever happened to be // selected, answering a feature row with an instruction about bodies. It lives where a - // body lives: the Bodies card's own action row, and the offer for a selected body. + // body lives: on each body's row in the Bodies list, and in the offer for a selected body. // Scaling imported artwork, which shared this button, moved to the row's own menu. - auto* vis = edit_btn("design_eye", _L("Show / hide")); - vis->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_toggle_visibility(); }); - auto* del = edit_btn("design_delete", _L("Delete")); - del->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { - // A body row deletes the feature that made it. on_delete_body() already resolves - // CadBody::source_feature and asks for confirmation by name; it was reachable only - // from the right-click offer, so this button answered a selected body row with - // "select the FEATURE that created this body" — an instruction the user cannot act - // on, since the tree does not say which feature that is. It does now. - if (tree_body_selection() >= 0) on_delete_body(); - else on_delete_feature(); - }); - auto* up = edit_btn("design_moveup", _L("Move up")); + auto* up = sidebar_icon_btn(m_tree_box, "design_moveup", _L("Move up")); up->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_move_feature(-1); }); - auto* down = edit_btn("design_movedown", _L("Move down")); + auto* down = sidebar_icon_btn(m_tree_box, "design_movedown", _L("Move down")); down->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_move_feature(+1); }); - m_btn_interfere = edit_btn("color_palette", _L("Check interference — find overlapping bodies")); + m_btn_interfere = sidebar_icon_btn(m_tree_box, "color_palette", _L("Check interference — find overlapping bodies")); m_btn_interfere->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_check_interference(); }); const int gap = FromDIP(SidebarProps::ElementSpacing()); - trow->Add(edit, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, gap); - trow->Add(vis, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, gap); - trow->Add(del, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, gap); trow->Add(up, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, gap); trow->Add(down, 0, wxALIGN_CENTER_VERTICAL); // Interference check sits after a rule: it reports, it does not edit the recipe. @@ -3274,45 +3226,20 @@ DesignPanel::DesignPanel(wxWindow* parent) m_parts_hdr = new wxBoxSizer(wxHORIZONTAL); m_parts_hdr->Add(card_header(m_parts_box, "design_extrude", _L("Bodies"), m_parts_label), 0, wxALIGN_CENTER_VERTICAL); - // The bodies card carries the actions that act on a BODY. Move came from the feature-tree - // header, where it had to guess whether its subject was a body or a feature; Show/hide, - // Delete and Colour are deliberate COPIES of feature-tree actions, because a body row is a - // different subject and a user working in this list should not have to travel to another - // card to hide or recolour what they have selected. Boolean is not a copy — it is the one - // body-body operation, gated through on_boolean_tool. Each one already resolves the body row - // itself (on_toggle_visibility, on_delete_body, on_set_body_color), so nothing here decides - // policy — the card only gives them a home next to the rows they act on. + // The bodies card header carries the body actions that are not one row's own. Boolean is the + // one body-body operation, gated through on_boolean_tool, and Colour recolours the selected + // body, resolving it itself (on_set_body_color), so nothing here decides policy. Move, + // Show/hide and Delete act on one body, so they sit on its row, as a feature's actions do. { - auto body_btn = [this](const char* icon, const wxString& tip) { - auto* b = new ScalableButton(m_parts_box, wxID_ANY, icon, "", FromDIP(wxSize(24, 24)), - wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 20); - b->SetToolTip(tip); - return b; - }; - auto* bmove = body_btn("design_move", _L("Move body")); - bmove->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { - if (m_sel_solid_body >= 0 && m_sel_solid_body < int(m_doc.bodies.size())) { - on_move_body(); - } else { - set_status(StatusKind::Info, _L("Select a body row first, then move it")); - } - }); // Boolean lives here as well as on the toolbar: combining two bodies is a body action, // and a user working in the body list should not have to leave it to find this. - auto* bbool = body_btn("design_boolean", _L("Boolean — join, subtract or intersect with another body")); + auto* bbool = sidebar_icon_btn(m_parts_box, "design_boolean", _L("Boolean — join, subtract or intersect with another body")); bbool->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_boolean_tool(); }); - auto* bvis = body_btn("design_eye", _L("Show / hide")); - bvis->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_toggle_visibility(); }); - auto* bdel = body_btn("design_delete", _L("Delete")); - bdel->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_delete_body(); }); - auto* bcol = body_btn("color_palette", _L("Color")); + auto* bcol = sidebar_icon_btn(m_parts_box, "color_palette", _L("Color")); bcol->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_set_body_color(); }); const int bgap = FromDIP(SidebarProps::ElementSpacing()); m_parts_hdr->AddStretchSpacer(1); - m_parts_hdr->Add(bmove, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, bgap); m_parts_hdr->Add(bbool, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, bgap); - m_parts_hdr->Add(bvis, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, bgap); - m_parts_hdr->Add(bdel, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, bgap); m_parts_hdr->Add(bcol, 0, wxALIGN_CENTER_VERTICAL); } parts_inner->Add(m_parts_hdr, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, @@ -3322,9 +3249,7 @@ DesignPanel::DesignPanel(wxWindow* parent) FromDIP(SidebarProps::TitlebarMargin())); m_parts_hdr->ShowItems(false); // no bodies yet on a fresh document m_parts_rule->Hide(); - m_parts = new wxTreeCtrl(m_parts_box, wxID_ANY, wxDefaultPosition, FromDIP(wxSize(-1, 48)), - wxTR_HIDE_ROOT | wxTR_SINGLE | wxTR_NO_LINES | - wxTR_FULL_ROW_HIGHLIGHT | wxBORDER_SIMPLE | wxTR_EDIT_LABELS); + m_parts = new DesignRowList(m_parts_box, 6); // scrolls past 6 m_parts->SetBackgroundColour(dp_panel_bg()); parts_inner->Add(m_parts, 0, wxEXPAND | wxALL, 12); // Start hidden: a fresh document has no bodies, and refresh_parts() only runs on the first @@ -3333,16 +3258,16 @@ DesignPanel::DesignPanel(wxWindow* parent) m_parts_label->Hide(); // Taking a body from the list means the SAME state change however it was asked for, so the // normalisation lives here and not inside a selection handler. That distinction is not - // pedantry: SelectItem() on a row that is ALREADY selected fires no SEL_CHANGED at all, so a - // version of this that only ran on selection left a stale vertex/edge from an earlier - // viewport pick in place — and offer_selection_kind() tests vertex FIRST, so right-clicking - // the body row served the VERTEX offer (Fillet greyed, Mirror in place of Repeat) while the - // row sat highlighted. Measured on the rig 2026-08-02; it is invisible from the code alone. + // pedantry: selecting a row that is ALREADY selected notifies nobody, so a version of this + // that only ran on selection left a stale vertex/edge from an earlier viewport pick in place + // — and offer_selection_kind() tests vertex FIRST, so right-clicking the body row served the + // VERTEX offer (Fillet greyed, Mirror in place of Repeat) while the row sat highlighted. + // Measured on the rig 2026-08-02; it is invisible from the code alone. auto apply_body_row = [this](int b) { if (!m_viewport || b < 0) return; // One selection at a time: a body row and a feature row mean different things to the // op bar, so clear the feature tree's highlight when a body takes over. - if (m_tree) m_tree->Unselect(); // wxTR_SINGLE: UnselectAll() does nothing here + if (m_tree) m_tree->unselect(); m_viewport->set_body_highlight(false); // the per-body overlay does the tint m_viewport->select_body(b); // also drops the vertex/edge marker m_sel_solid_body = b; @@ -3351,53 +3276,41 @@ DesignPanel::DesignPanel(wxWindow* parent) m_pick_face = m_pick_face_body = -1; // chosen from the list, no face was pointed at set_status(StatusKind::Info, wxString::Format(_L("Body %d selected — right-click for what applies to it"), b + 1)); }; - m_parts->Bind(wxEVT_TREE_SEL_CHANGED, [this, apply_body_row](wxTreeEvent&) { - apply_body_row(tree_body_selection()); - }); + m_parts->on_select = [this, apply_body_row] { apply_body_row(tree_body_selection()); }; + // The row's own Move / Show-hide / Delete. apply_body_row runs unconditionally, as for the + // menu below: a face picked in the viewport since the row was selected has moved + // m_sel_solid_body, which is the body on_move_body and on_delete_body act on. + m_parts->on_action = [this, apply_body_row](int row, int id) { + apply_body_row(row); + switch (id) { + case RowMove: on_move_body(); break; + case RowVisibility: on_toggle_visibility(); break; + case RowDelete: on_delete_body(); break; + } + }; // The third door onto the offer, after the viewport right-click and the Menu key. A body ROW // is an unambiguous body, so the offer reports BodySolid and the body verbs act on the row you // can see highlighted. That is the confirmation a face pick cannot give: pointing at a face // lights the face, never the body the verb will actually change. The status line above has // been promising this right-click since before it existed. + m_parts->on_menu = [this, apply_body_row](int row, const wxPoint& screen) { + apply_body_row(row); // unconditional — see above + // Let the modal menu take the loop after this handler returns — same CallAfter as the + // sketch path, which learned it the hard way. + CallAfter([this, screen] { show_offer_menu(screen); }); + }; // Renaming a BODY names the body itself. It does NOT rename the feature that created it: // an Extrude, a Cut and a Fillet all land on one body, so source_feature is one operation in // its history and renaming that is renaming the wrong object — reported, correctly, as "you // consider the extrusion = the body". CadBody::user_name is carried across recompute() by // index and written into the recipe, so the name outlives both the rebuild and the save. - m_parts->Bind(wxEVT_TREE_BEGIN_LABEL_EDIT, [this](wxTreeEvent& e) { - if (tree_body_selection() < 0) { e.Veto(); return; } - e.Skip(); - }); - m_parts->Bind(wxEVT_TREE_END_LABEL_EDIT, [this](wxTreeEvent& e) { - if (e.IsEditCancelled()) return; - const int b = tree_body_selection(); - if (b < 0 || b >= int(m_doc.bodies.size())) { e.Veto(); return; } - wxString label = e.GetLabel(); - label.Trim(true).Trim(false); - if (label.empty()) { e.Veto(); return; } // a nameless row is worse than a bad name + m_parts->on_rename = [this](int b, const wxString& name) { + if (b < 0 || b >= int(m_doc.bodies.size())) return; m_doc.bodies[b].has_user_name = true; - m_doc.bodies[b].user_name = std::string(label.ToUTF8().data()); + m_doc.bodies[b].user_name = std::string(name.ToUTF8().data()); sync_recipe_to_model(); // the name is part of what gets saved - e.Skip(); - // Rebuild on the NEXT event-loop turn: refresh_parts() destroys every wxTreeItemId and - // we are inside wx's own END_LABEL_EDIT dispatch for one of them. The feature tree - // learned this the hard way — doing it here took the process down. - CallAfter([this] { refresh_parts(); }); - }); - - m_parts->Bind(wxEVT_TREE_ITEM_MENU, [this, apply_body_row](wxTreeEvent& e) { - if (e.GetItem().IsOk()) - m_parts->SelectItem(e.GetItem()); // the row under the cursor, never a stale one - apply_body_row(tree_body_selection()); // unconditional — see above, SelectItem on an - // already-selected row raises no event - // GetPoint() is tree-client; it is (-1,-1) when the KEYBOARD menu key raised this, so fall - // back to the shared anchor rather than popping the menu at a garbage coordinate. - const wxPoint p = e.GetPoint(); - const wxPoint screen = (p.x >= 0 && p.y >= 0) ? m_parts->ClientToScreen(p) : offer_anchor(); - // Let the modal menu take the loop after this handler returns — same CallAfter as the - // sketch path, which learned it the hard way. - CallAfter([this, screen] { show_offer_menu(screen); }); - }); + refresh_parts(); + }; // --- Variables (document-scope named expressions) --- // Below the feature tree + parts, always visible. wxListCtrl in report mode with two @@ -3413,15 +3326,9 @@ DesignPanel::DesignPanel(wxWindow* parent) wxALIGN_CENTER_VERTICAL); var_hdr->AddStretchSpacer(); // Icon actions in the card header, as the Feature tree and Bodies cards have them. - auto var_btn = [this](const char* icon, const wxString& tip) { - auto* b = new ScalableButton(m_var_box, wxID_ANY, icon, "", FromDIP(wxSize(24, 24)), - wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 20); - b->SetToolTip(tip); - return b; - }; - m_btn_add_var = var_btn("add", _L("Add variable")); - m_btn_edit_var = var_btn("design_edit", _L("Edit variable")); - m_btn_del_var = var_btn("design_delete", _L("Delete variable")); + m_btn_add_var = sidebar_icon_btn(m_var_box, "add", _L("Add variable")); + m_btn_edit_var = sidebar_icon_btn(m_var_box, "design_edit", _L("Edit variable")); + m_btn_del_var = sidebar_icon_btn(m_var_box, "design_delete", _L("Delete variable")); m_btn_add_var->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_add_variable(); }); m_btn_edit_var->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_edit_variable(); }); m_btn_del_var->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_remove_variable(); }); @@ -6687,7 +6594,15 @@ void DesignPanel::show_offer_menu(const wxPoint& screen_pos) } } - for (int row = 0; row < kOfferRowCount; ++row) { + // Flat rows first, then the families, each group in ratified order. A flat row's verbs sit at + // the top level, each an item of its own: they are what a selection is opened for most. + std::vector rows; + for (const bool flat : {true, false}) + for (int row = 0; row < kOfferRowCount; ++row) + if (kOfferRowFlat[row] == flat) rows.push_back(row); + bool flat_items = false; + + for (const int row : rows) { std::vector live, family; for (int i = 0; i < kOfferVerbCount; ++i) { const OfferVerb& v = kOfferVerbs[i]; @@ -6697,6 +6612,34 @@ void DesignPanel::show_offer_menu(const wxPoint& screen_pos) } if (family.empty()) continue; // no verb of this family in this mode + + if (kOfferRowFlat[row]) { + // Only the verbs about this selection; one blocked by the document stays, greyed, + // with its reason, as it would inside a family. + for (const OfferVerb* v : family) { + if (!(v->accepts & bit)) continue; + const int id = base + int(bound.size()); + if (applies(*v)) { + offer_trace("row=%d %s -> %s%s", row, kOfferRowNames[row], v->id, + v->action ? "" : " (no GUI route)"); + append_offer_item(&menu, id, label(*v), *v)->Enable(v->action != nullptr); + bound.push_back(v); + } else { + offer_trace("row=%d %s DISABLED (%s)", row, kOfferRowNames[row], + v->refusal ? v->refusal : "blocked"); + wxString s = tr(v->name); + if (v->refusal) s += wxString::FromUTF8(" — ") + tr(v->refusal); + append_offer_item(&menu, id, s, *v)->Enable(false); + bound.push_back(nullptr); + } + flat_items = true; + } + continue; + } + if (flat_items) { + menu.AppendSeparator(); // between the flat items and the families + flat_items = false; + } const wxString fam = tr(kOfferRowNames[row]); if (live.empty()) { @@ -7170,43 +7113,44 @@ void DesignPanel::on_add_draft() refresh_tree(); } -int DesignPanel::tree_icon_for(CadFeatureType t) +// The Feature tree's per-type row icon, by family. +const char* DesignPanel::tree_icon_for(CadFeatureType t) { switch (t) { - case CadFeatureType::Sketch: return 0; - case CadFeatureType::Extrude: return 1; + case CadFeatureType::Sketch: + case CadFeatureType::Plane: + case CadFeatureType::Axis: + case CadFeatureType::CoordSys: + case CadFeatureType::Project: return "design_sketch"; // sketches, datums, projections case CadFeatureType::Fillet: - case CadFeatureType::Chamfer: return 2; - case CadFeatureType::Hole: return 3; - case CadFeatureType::Thread: return 4; - case CadFeatureType::Shell: return 5; - case CadFeatureType::Revolve: return 1; - case CadFeatureType::Sweep: return 1; - case CadFeatureType::Pattern: return 1; - case CadFeatureType::Plane: return 0; // datum plane: sketch-family icon - case CadFeatureType::Loft: return 1; - case CadFeatureType::Draft: return 5; // dressup-family icon - case CadFeatureType::Import: return 1; // imported solid: solid-family icon - case CadFeatureType::Boolean: return 1; // body-body combine: solid-family icon - case CadFeatureType::Cut: return 1; // plane split: solid-family icon - case CadFeatureType::Axis: return 0; // datum axis: sketch-family icon - case CadFeatureType::CoordSys: return 0; // datum coord sys: sketch-family icon - case CadFeatureType::SurfaceExtrude: return 1; - case CadFeatureType::SurfaceRevolve: return 1; - case CadFeatureType::SurfaceLoft: return 1; - case CadFeatureType::SurfaceFill: return 1; - case CadFeatureType::ThickenSurface: return 1; - case CadFeatureType::SurfaceOffset: return 1; - case CadFeatureType::Transform: return 1; // solid-family icon - case CadFeatureType::Mirror: return 1; // solid-family icon - case CadFeatureType::Thicken: return 1; // solid-family icon - case CadFeatureType::Rib: return 1; // solid-family icon - case CadFeatureType::Project: return 0; // sketch-family icon (produces sketch) - case CadFeatureType::DeleteFace: return 5; // dressup-family icon - case CadFeatureType::Helix: return 4; // thread-family icon (curve) - case CadFeatureType::Mate: return 2; // dressup-family icon (assembly) + case CadFeatureType::Chamfer: + case CadFeatureType::Mate: return "design_dressup"; + case CadFeatureType::Hole: return "design_hole"; + case CadFeatureType::Thread: + case CadFeatureType::Helix: return "design_thread"; + case CadFeatureType::Shell: + case CadFeatureType::Draft: + case CadFeatureType::DeleteFace: return "design_shell"; + case CadFeatureType::Extrude: + case CadFeatureType::Revolve: + case CadFeatureType::Sweep: + case CadFeatureType::Loft: + case CadFeatureType::Pattern: + case CadFeatureType::Import: + case CadFeatureType::Boolean: + case CadFeatureType::Cut: + case CadFeatureType::Transform: + case CadFeatureType::Mirror: + case CadFeatureType::Thicken: + case CadFeatureType::Rib: + case CadFeatureType::SurfaceExtrude: + case CadFeatureType::SurfaceRevolve: + case CadFeatureType::SurfaceLoft: + case CadFeatureType::SurfaceFill: + case CadFeatureType::ThickenSurface: + case CadFeatureType::SurfaceOffset: return "design_extrude"; // solids and surfaces } - return 0; + return "design_sketch"; } // The reason detect_mate_conflicts() recorded for this feature, or nullptr. A linear scan: an @@ -7269,8 +7213,12 @@ void DesignPanel::refresh_icons() std::function walk = [&walk](wxWindow* w) { if (auto* b = dynamic_cast(w)) b->msw_rescale(); - else if (auto* b = dynamic_cast<::Button*>(w)) + else if (auto* b = dynamic_cast<::Button*>(w)) { b->Rescale(); + if (b->GetName() == "design_icon_btn") + style_sidebar_icon_btn(b); // pixel sizes and the panel colour, for the new scale and theme + } else if (auto* l = dynamic_cast(w)) + l->Rescale(); else if (auto* c = dynamic_cast<::CheckBox*>(w)) c->Rescale(); else if (auto* c = dynamic_cast<::ComboBox*>(w)) @@ -7307,7 +7255,7 @@ void DesignPanel::on_sys_color_changed() walk(child); }; walk(this); - // The native controls (trees, lists, spins) take the app's own dark pass. + // The native controls (lists, spins) take the app's own dark pass. wxGetApp().UpdateDarkUIWin(this); refresh_icons(); refresh_tree(); // the rows carry their own text colours @@ -7475,23 +7423,22 @@ void DesignPanel::refresh_tree() // last feature still clears it, through the tree-edit call site that always did. if (!m_doc.features.empty()) sync_recipe_to_model(); - // Preserve the selected row across the rebuild — wxTreeCtrl::DeleteAllItems - // drops the selection, which made every edit/add feel like it "lost" the - // selection (and broke Edit/Move/Delete on the just-touched feature). + // Preserve the selected row across the rebuild — set_rows() drops the selection, which made + // every edit/add feel like it "lost" the selection (and broke Edit/Move/Delete on the + // just-touched feature). const int keep = tree_selection(); - m_tree->DeleteAllItems(); - m_tree_items.clear(); - m_tree_body_items.clear(); - wxTreeItemId root = m_tree->AddRoot("root"); // Datum/reference planes carry no solid; feed them to the viewport so they render as // translucent rectangles (otherwise a Plane feature is invisible in the canvas). refresh_datum_planes(); update_reference_planes(); // body added/removed -> show/hide the XY/XZ/YZ origin planes + std::vector rows; + rows.reserve(m_doc.features.size()); for (size_t fi = 0; fi < m_doc.features.size(); ++fi) { const CadFeature& f = m_doc.features[fi]; - const int img = tree_icon_for(f.type); - wxTreeItemId id = m_tree->AppendItem(root, wxString::FromUTF8(f.name), img, img); + DesignRowList::Row row; + row.icon = tree_icon_for(f.type); + row.label = wxString::FromUTF8(f.name); // Three states, in this order of precedence: // disabled -> dim. A SUPPRESSED mate is the user's answer to a conflict, so it must // read as suppressed rather than keep shouting about the conflict. @@ -7502,23 +7449,19 @@ void DesignPanel::refresh_tree() // A conflict is NOT a document error — the document still evaluates — so the row is // marked and never hidden, and the reason goes to the status line on selection rather // than into a modal that interrupts without offering an action. - m_tree->SetItemTextColour(id, !f.enabled ? dp_item_dim() - : mate_conflict_reason(int(fi)) != nullptr ? wxColour(235, 110, 110) - : dp_item_text()); - m_tree_items.push_back(id); + row.colour = !f.enabled ? dp_item_dim() + : mate_conflict_reason(int(fi)) != nullptr ? wxColour(235, 110, 110) + : dp_item_text(); + row.actions = { + { RowEdit, "design_edit", _L("Edit") }, + eye_action(f.enabled), + { RowDelete, "design_delete", _L("Delete") }, + }; + rows.push_back(std::move(row)); } + m_tree->set_rows(std::move(rows)); refresh_parts(); // bodies live in their own list below the tree, never clipped by history - if (keep >= 0 && keep < int(m_tree_items.size())) - m_tree->SelectItem(m_tree_items[keep]); - - // Size the tree to its content (clamped) so it doesn't waste a fixed-height block when - // there are few features, and scrolls internally past ~9 rows instead of growing forever. - const int rows = int(m_tree_items.size()); // bodies are in their own list now - const int rowH = std::max(m_tree->GetCharHeight() + 8, 20); - const int shown = std::min(std::max(rows, 1), 9); - const wxSize ts(-1, shown * rowH + 8); - m_tree->SetMinSize(ts); - m_tree->SetMaxSize(ts); + m_tree->select(keep); if (m_form && m_form->GetSizer()) { update_cards_frame(); m_form->Layout(); m_form->FitInside(); } } @@ -7529,11 +7472,9 @@ void DesignPanel::refresh_parts() if (m_parts == nullptr) return; const int keep = tree_body_selection(); - m_parts->DeleteAllItems(); - m_tree_body_items.clear(); - wxTreeItemId proot = m_parts->AddRoot("root"); - sync_body_visible(); // keep flags parallel before reading them for the row colour + std::vector rows; + rows.reserve(m_doc.bodies.size()); for (size_t b = 0; b < m_doc.bodies.size(); ++b) { // "Body N" keeps the positional identity every status line and message uses ("Body 2 // selected", the interference report), and the NAME follows it because that is the part @@ -7547,17 +7488,24 @@ void DesignPanel::refresh_parts() const wxString bname = m_doc.bodies[b].has_user_name ? wxString::FromUTF8(m_doc.bodies[b].user_name) : wxString::FromUTF8(m_doc.bodies[b].name); - wxTreeItemId id = m_parts->AppendItem(proot, - bname.IsEmpty() ? wxString::Format(_L("Body %zu"), b + 1) - : wxString::Format(_L("Body %zu — %s"), b + 1, bname)); - // Hidden bodies are greyed so the show/hide state reads at a glance (eye toggle). - m_parts->SetItemTextColour(id, vis ? dp_item_text() : dp_item_dim()); - m_tree_body_items.push_back(id); + DesignRowList::Row row; + row.label = bname.IsEmpty() ? wxString::Format(_L("Body %zu"), b + 1) + : wxString::Format(_L("Body %zu — %s"), b + 1, bname); + row.edit_text = bname; // the name is the body's to edit, not its number + // Hidden bodies are greyed and their eye is closed, so the state reads at a glance. + row.colour = vis ? dp_item_text() : dp_item_dim(); + row.actions = { + { RowMove, "design_move", _L("Move") }, + eye_action(vis), + { RowDelete, "design_delete", _L("Delete") }, + }; + rows.push_back(std::move(row)); } + m_parts->set_rows(std::move(rows)); // Hide the whole block until there is something to list, so an empty document doesn't // show a stray empty box. - const bool any = !m_tree_body_items.empty(); + const bool any = m_parts->GetItemCount() > 0; m_parts->Show(any); if (m_parts_label) m_parts_label->Show(any); if (m_parts_hdr) m_parts_hdr->ShowItems(any); // icon + title live in this sizer @@ -7565,26 +7513,14 @@ void DesignPanel::refresh_parts() // ...and the frame with it, or an empty bordered box floats there. if (m_parts_box && m_form && m_form->GetSizer()) m_form->GetSizer()->Show(m_parts_box, any, false); - if (any) { - const int rowH = std::max(m_parts->GetCharHeight() + 8, 20); - const int shown = std::min(int(m_tree_body_items.size()), 6); // scrolls past 6 - const wxSize ps(-1, shown * rowH + 8); - m_parts->SetMinSize(ps); - m_parts->SetMaxSize(ps); - if (keep >= 0 && keep < int(m_tree_body_items.size())) - m_parts->SelectItem(m_tree_body_items[keep]); - } + if (any) + m_parts->select(keep); if (m_form && m_form->GetSizer()) { update_cards_frame(); m_form->Layout(); m_form->FitInside(); } } int DesignPanel::tree_body_selection() const { - if (m_parts == nullptr) return -1; - const wxTreeItemId sel = m_parts->GetSelection(); - if (!sel.IsOk()) return -1; - for (size_t i = 0; i < m_tree_body_items.size(); ++i) - if (m_tree_body_items[i] == sel) return int(i); - return -1; + return m_parts == nullptr ? -1 : m_parts->selection(); } void DesignPanel::update_section_flip_btn() @@ -7824,17 +7760,13 @@ bool DesignPanel::place_on_face() int DesignPanel::tree_selection() const { - const wxTreeItemId sel = m_tree->GetSelection(); - if (!sel.IsOk()) return wxNOT_FOUND; - for (size_t i = 0; i < m_tree_items.size(); ++i) - if (m_tree_items[i] == sel) return int(i); - return wxNOT_FOUND; + return m_tree->selection(); } void DesignPanel::set_tree_selection(int row) { - if (row >= 0 && row < int(m_tree_items.size())) - m_tree->SelectItem(m_tree_items[row]); + if (row >= 0 && row < int(m_tree->GetItemCount())) + m_tree->select(row); } // The selection (the solid pick, the hit face and the committed-loop pick) names bodies, faces and @@ -8004,12 +7936,11 @@ void DesignPanel::on_toggle_visibility() &m_body_visible, &m_body_xform); } refresh_tree(); - // Keep the row selected for repeat toggles. m_parts, NOT m_tree: these ids belong - // to the Bodies list, and handing a foreign item to the feature tree left the row - // unselected — so the second press of the eye found tree_body_selection() == -1 and - // fell through to the FEATURE-level branch below instead of un-hiding the body. - if (m_parts != nullptr && bsel < int(m_tree_body_items.size())) - m_parts->SelectItem(m_tree_body_items[bsel]); + // Keep the row selected for repeat toggles. m_parts, NOT m_tree: the row is a body, + // and selecting it in the feature tree left the body row unselected — so the second + // press of the eye found tree_body_selection() == -1 and fell through to the + // FEATURE-level branch below instead of un-hiding the body. + if (m_parts != nullptr) m_parts->select(bsel); set_status(StatusKind::Info, wxString::Format(now_visible ? _L("Body %d shown") : _L("Body %d hidden"), bsel + 1)); } @@ -8412,11 +8343,11 @@ void DesignPanel::rebuild_constraint_list() for (int i = 0; i < int(cons.size()); ++i) { auto* row = new wxBoxSizer(wxHORIZONTAL); // Delete button first (fixed left position, always visible — long labels can - // horizontally scroll but ✗ stays put and clickable). BMP-safe ✗ glyph. - auto* del = new ScalableButton(m_cards, wxID_ANY, "design_delete", "", FromDIP(wxSize(24, 24)), - wxDefaultPosition, wxBU_EXACTFIT | wxBORDER_NONE, false, 16); - del->SetToolTip(_L("Delete constraint")); - del->Bind(wxEVT_BUTTON, [this, i](wxCommandEvent&) { delete_constraint(i); }); + // horizontally scroll but ✗ stays put and clickable). + auto* del = sidebar_icon_btn(m_cards, "design_delete", _L("Delete constraint"), 16); + // After the click: deleting rebuilds these rows, and with them this button, which must + // not be destroyed while its own click is still being dispatched. + del->Bind(wxEVT_BUTTON, [this, i](wxCommandEvent&) { CallAfter([this, i] { delete_constraint(i); }); }); // Clickable label: selecting it highlights the referenced entities. auto* lbl = new wxStaticText(m_cards, wxID_ANY, constraint_label(cons[i])); lbl->SetCursor(wxCursor(wxCURSOR_HAND)); @@ -8467,8 +8398,8 @@ void DesignPanel::delete_constraint(int idx) { // Live session: the constraint lives in the sketch tool, not in any feature. Removing it // re-solves and fires on_constraints_changed, which rebuilds these rows — so this branch - // deliberately does NOT call rebuild_constraint_list() itself (it would run twice, and the - // second run would delete the wxButton whose click handler is still on the stack). + // deliberately does NOT call rebuild_constraint_list() itself (it would run twice). A row's ✗ + // calls this after its click has finished, so either rebuild may destroy that button. if (live_constraint_scope()) { if (!m_viewport->remove_sketch_constraint(idx)) return; diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index 1235c98ac3..86fde6254e 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -12,7 +12,6 @@ #include #include #include -#include // wxTreeItemId #include #include @@ -30,8 +29,6 @@ class wxCheckBox; class wxCheckListBox; class wxSpinCtrl; class wxSpinCtrlDouble; -class wxTreeCtrl; -class wxImageList; class wxStaticText; class wxStaticLine; class Button; // Orca-styled button (Widgets/Button.hpp) @@ -53,6 +50,7 @@ class ScalableButton; namespace Slic3r { namespace GUI { class DesignTextDialog; +class DesignRowList; class DesignCanvas; @@ -539,8 +537,8 @@ private: void set_active_tool_btn(ScalableButton* b); // nullptr clears the highlight // Owns the themed DropDown flyouts (and the item vectors they hold by ref). std::vector> m_flyout_keepalive; - // Icons that are not a plain ScalableButton face (flyout rows, card headers, the tree's image - // list, theme-twinned buttons): each re-creates its bitmaps for the current scale and theme. + // Icons that are not a plain ScalableButton face (flyout rows, card headers, theme-twinned + // buttons): each re-creates its bitmaps for the current scale and theme. std::vector> m_icon_refresh; void refresh_icons(); wxCheckBox* m_construction{nullptr}; // sketch-mode construction toggle @@ -711,16 +709,16 @@ private: // Document variables panel (below the feature tree / parts) StaticBox* m_var_box{nullptr}; wxListCtrl* m_var_list{nullptr}; - ScalableButton* m_btn_add_var{nullptr}; - ScalableButton* m_btn_edit_var{nullptr}; - ScalableButton* m_btn_del_var{nullptr}; + ::Button* m_btn_add_var{nullptr}; + ::Button* m_btn_edit_var{nullptr}; + ::Button* m_btn_del_var{nullptr}; void refresh_variables(); // rebuild m_var_list from m_doc.variables void on_add_variable(); void on_edit_variable(); void on_remove_variable(); // Feature-tree button - ScalableButton* m_btn_interfere{nullptr}; + ::Button* m_btn_interfere{nullptr}; // Pattern controls (replicate the target body: linear or circular). ComboBox* m_pattern_type{nullptr}; // 0 = Linear, 1 = Circular @@ -903,21 +901,18 @@ private: std::function m_value_cont; // deferred apply, run on Confirm std::function m_value_cancel; // optional action when the card is cancelled - // Feature tree: a wxTreeCtrl with per-feature-type icons. Callers keep using - // integer row indices via tree_selection()/set_tree_selection(); m_tree_items - // maps feature order -> tree node, rebuilt by refresh_tree(). - wxTreeCtrl* m_tree{nullptr}; - wxTreeCtrl* m_parts{nullptr}; // Bodies list under the feature tree + // Feature tree: one row per feature, in feature order, with a per-type icon and the row's + // own Edit / Show-hide / Delete icons. Callers use row indices via + // tree_selection()/set_tree_selection(); refresh_tree() rebuilds the rows. + DesignRowList* m_tree{nullptr}; + // Bodies list under the feature tree: one row per body (parallel to m_doc.bodies). Selecting + // one highlights that body and makes it the target for the next op. + DesignRowList* m_parts{nullptr}; wxStaticText* m_parts_label{nullptr}; // its "Bodies" caption (hidden when empty) - wxBoxSizer* m_parts_hdr{nullptr}; // Bodies card header (icon + title) + wxBoxSizer* m_parts_hdr{nullptr}; // Bodies card header (icon + title + body actions) wxStaticLine* m_parts_rule{nullptr}; // rule under that header - wxBoxSizer* m_hdr_tree_row{nullptr}; // Feature tree header: title + row actions + wxBoxSizer* m_hdr_tree_row{nullptr}; // Feature tree header: title + list actions wxStaticText* m_hdr_tree{nullptr}; // its title label - wxImageList* m_tree_images{nullptr}; - std::vector m_tree_items; - // Parts list: tree rows for each body (parallel to m_doc.bodies). Selecting one - // highlights that body and makes it the target for the next op. - std::vector m_tree_body_items; // Section views (non-destructive): named "Section View N" entries listed in the tree, each a // horizontal clip height. View-only — NOT bodies/features, never serialized. Key X adds one; @@ -953,7 +948,7 @@ private: int tree_body_selection() const; // selected Parts-list body index, or -1 void refresh_parts(); // rebuild the Bodies list under the feature tree void set_tree_selection(int row); - static int tree_icon_for(CadFeatureType t); + static const char* tree_icon_for(CadFeatureType t); wxStaticText* m_status{nullptr}; // m_status's foreground as created, captured before any caller touches it. Callers signal diff --git a/src/slic3r/GUI/CAD/DesignRowList.cpp b/src/slic3r/GUI/CAD/DesignRowList.cpp new file mode 100644 index 0000000000..55e09f5294 --- /dev/null +++ b/src/slic3r/GUI/CAD/DesignRowList.cpp @@ -0,0 +1,377 @@ +#include "slic3r/GUI/CAD/DesignRowList.hpp" + +#include "slic3r/GUI/Widgets/StateColor.hpp" + +#include +#include +#include +#include +#include + +#include +#include + +namespace Slic3r { namespace GUI { + +// Row and icon cell geometry, in DIP. +static constexpr int kIconPx = 16; // type and action icons +static constexpr int kCellDip = 20; // square action cell, hover chip included +static constexpr int kPadDip = 4; // row edges, and the gap before the action cells +static constexpr int kGapDip = 6; // type icon to label + +DesignRowList::DesignRowList(wxWindow* parent, int max_visible) + // wxVListBox defaults to wxBORDER_THEME; the sidebar's lists take a simple frame. + : wxVListBox(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE) + , m_max_visible(std::max(max_visible, 1)) +{ + Bind(wxEVT_LISTBOX, [this](wxCommandEvent&) { if (on_select) on_select(); }); + Bind(wxEVT_LISTBOX_DCLICK, [this](wxCommandEvent&) { if (on_activate) on_activate(); }); + + Bind(wxEVT_MOTION, [this](wxMouseEvent& e) { + set_hover(hit_test(e.GetPosition())); + e.Skip(); + }); + Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent& e) { + set_hover(Hit{}); + m_pressed = Hit{}; + e.Skip(); + }); + // A press on an action cell is remembered and skipped, so the list still selects the row. + Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { + const Hit h = hit_test(e.GetPosition()); + m_pressed = h.cell >= 0 ? h : Hit{}; + e.Skip(); + }); + // The second press of a double-click on a cell is a press too, and is not skipped: the list + // would otherwise turn it into a row double-click, so a quick double toggle of the eye would + // also open the feature for editing. + Bind(wxEVT_LEFT_DCLICK, [this](wxMouseEvent& e) { + const Hit h = hit_test(e.GetPosition()); + if (h.cell < 0) { m_pressed = Hit{}; e.Skip(); return; } + m_pressed = h; + }); + Bind(wxEVT_LEFT_UP, [this](wxMouseEvent& e) { + e.Skip(); + const Hit pressed = m_pressed; + m_pressed = Hit{}; + if (pressed.cell < 0 || hit_test(e.GetPosition()) != pressed) + return; + const int id = m_rows[pressed.row].actions[pressed.cell].id; + // After the click has finished dispatching: the action may rebuild these rows. The row + // must still exist and still be the selected one, or the click is dropped rather than + // applied to whatever row took its place. + CallAfter([this, row = pressed.row, id] { + if (row < int(GetItemCount()) && row == GetSelection() && on_action) + on_action(row, id); + }); + }); + // Right-click targets the row under the pointer. Skipped, because on MSW a handled right + // press suppresses the wxEVT_CONTEXT_MENU that follows it. + Bind(wxEVT_RIGHT_DOWN, [this](wxMouseEvent& e) { + const Hit h = hit_test(e.GetPosition()); + if (h.row != wxNOT_FOUND) select(h.row); + e.Skip(); + }); + Bind(wxEVT_CONTEXT_MENU, [this](wxContextMenuEvent& e) { + wxPoint screen = e.GetPosition(); // screen coordinates; wxDefaultPosition from the keyboard + int row = GetSelection(); + if (screen == wxDefaultPosition) { + if (row == wxNOT_FOUND) return; + screen = ClientToScreen(GetItemRect(row).GetBottomLeft()); + } else { + row = VirtualHitTest(ScreenToClient(screen).y); + } + if (row == wxNOT_FOUND || row >= int(m_rows.size())) + return; + // On MSW the menu comes with the button's release, and the pointer may have moved to + // another row since the press selected one: the menu is for the row it opens over. + select(row); + if (on_menu) on_menu(row, screen); + }); + // wxVListBox takes every wheel event, even with nothing to scroll, so a short list would stop + // the sidebar it sits in from scrolling under the pointer. Hand it on instead. Not on GTK, + // where the sidebar scrolls natively and passes on an unhandled wheel by itself. + Bind(wxEVT_MOUSEWHEEL, [this](wxMouseEvent& e) { + end_rename(true); +#ifndef __WXGTK__ + if (GetVisibleRowsBegin() == 0 && GetVisibleRowsEnd() >= GetItemCount()) { + for (wxWindow* w = GetParent(); w != nullptr; w = w->GetParent()) + if (auto* sw = dynamic_cast(w)) { + wxMouseEvent fwd(e); + fwd.SetEventObject(sw); + sw->GetEventHandler()->ProcessEvent(fwd); + return; + } + } +#endif + e.Skip(); + }); + Bind(wxEVT_SIZE, [this](wxSizeEvent& e) { + end_rename(true); // the editor sits on a row position the new size may have moved + e.Skip(); + }); + measure_row(); + fit_rows(); +} + +// Every row is one height. Measured once per font and scale rather than on each OnMeasureItem, +// which wxVListBox calls for every row it walks on every paint and hit test. +void DesignRowList::measure_row() +{ + m_row_h = std::max(GetCharHeight() + 8, FromDIP(kCellDip + 2)); +} + +void DesignRowList::set_rows(std::vector rows) +{ + end_rename(false); // the row it names may no longer be that row + SetSelection(wxNOT_FOUND); + m_rows = std::move(rows); + m_hover = Hit{}; + m_pressed = Hit{}; + UnsetToolTip(); + load_icons(); + SetItemCount(m_rows.size()); + fit_rows(); + Refresh(); +} + +void DesignRowList::select(int row) +{ + if (row < 0 || row >= int(GetItemCount())) + row = wxNOT_FOUND; + if (row == GetSelection()) + return; + SetSelection(row); + if (on_select) on_select(); +} + +void DesignRowList::fit_rows() +{ + const int shown = std::clamp(int(GetItemCount()), 1, m_max_visible); + // Plus the frame, so the last row is not clipped by it. + const int h = shown * m_row_h + (GetSize().y - GetClientSize().y); + SetMinSize(wxSize(-1, h)); + SetMaxSize(wxSize(-1, h)); +} + +void DesignRowList::Rescale() +{ + m_icons.clear(); + load_icons(); + measure_row(); + // The scrollbar's total is only recomputed when the item count is set; RefreshAll() alone + // would leave it at the old scale. + SetItemCount(GetItemCount()); + fit_rows(); + Refresh(); +} + +void DesignRowList::begin_rename(int row) +{ + CallAfter([this, row] { open_editor(row); }); +} + +void DesignRowList::open_editor(int row) +{ + if (row < 0 || row >= int(m_rows.size())) + return; + end_rename(false); + if (m_editor == nullptr) { + // A raw wxTextCtrl, as wxTreeCtrl's own label editor is: it is a transient overlay on one + // row, not a form field, and ::TextInput's frame would not fit inside the row. + m_editor = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, + wxTE_PROCESS_ENTER | wxBORDER_SIMPLE); + m_editor->Hide(); + m_editor->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent&) { + end_rename(true); + SetFocus(); + }); + // Esc must stop here. CHAR_HOOK reaches the focused editor before its ancestors, and the + // Design panel's own hook answers Esc whatever holds focus, so a skipped Esc would close + // the open tool as well as the editor. + m_editor->Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& e) { + if (e.GetKeyCode() != WXK_ESCAPE) { e.Skip(); return; } + end_rename(false); + SetFocus(); + }); + m_editor->Bind(wxEVT_KILL_FOCUS, [this](wxFocusEvent& e) { + e.Skip(); + end_rename(true); + }); + } + if (!IsRowVisible(row)) + ScrollToRow(row); + const Row& r = m_rows[row]; + const wxRect rc = label_rect(GetItemRect(row), r); + m_editor->SetFont(GetFont()); + m_editor->SetBackgroundColour(GetBackgroundColour()); + m_editor->SetForegroundColour(r.colour.IsOk() ? r.colour : GetForegroundColour()); + m_editor->SetValue(r.edit_text.empty() ? r.label : r.edit_text); + const int h = std::max(rc.height, m_editor->GetBestSize().y); + const int y = std::clamp(rc.y + (rc.height - h) / 2, 0, std::max(0, GetClientSize().y - h)); + m_editor->SetSize(rc.x - FromDIP(2), y, rc.width + FromDIP(2), h); + m_edit_row = row; + m_editor->Show(); + m_editor->SetFocus(); + m_editor->SelectAll(); +} + +void DesignRowList::end_rename(bool commit) +{ + if (m_edit_row == wxNOT_FOUND) + return; + // Cleared first: hiding the focused editor moves the focus, whose kill-focus comes back here. + const int row = m_edit_row; + wxString text = m_editor->GetValue(); + m_edit_row = wxNOT_FOUND; + m_editor->Hide(); + text.Trim(true).Trim(false); + if (commit && on_rename && !text.empty()) // a nameless row is worse than a badly named one + CallAfter([this, row, text] { + if (on_rename && row < int(GetItemCount())) + on_rename(row, text); + }); +} + +wxCoord DesignRowList::OnMeasureItem(size_t) const +{ + return m_row_h; +} + +void DesignRowList::OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const +{ + // ObjectList's selection teal, and the dropdowns' lighter hover teal; both are dark-mapped. + wxColour bg; + if (IsSelected(n)) + bg = StateColor::darkModeColorFor(wxColour("#BFE1DE")); + else if (int(n) == m_hover.row) + bg = StateColor::darkModeColorFor(wxColour("#E5F0EE")); + if (!bg.IsOk()) + return; // the list already cleared to its background colour + dc.SetPen(*wxTRANSPARENT_PEN); + dc.SetBrush(wxBrush(bg)); + dc.DrawRectangle(rect); +} + +void DesignRowList::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const +{ + if (n >= m_rows.size()) + return; + const Row& r = m_rows[n]; + + if (const ScalableBitmap* bmp = icon(r.icon)) { + const wxSize sz = bmp->GetBmpSize(); + dc.DrawBitmap(bmp->bmp(), rect.x + FromDIP(kPadDip), rect.y + (rect.height - sz.y) / 2, true); + } + + const wxRect lr = label_rect(rect, r); + dc.SetFont(GetFont()); + dc.SetTextForeground(r.colour.IsOk() ? r.colour : GetForegroundColour()); + const wxString text = wxControl::Ellipsize(r.label, dc, wxELLIPSIZE_END, std::max(lr.width, 0)); + dc.DrawText(text, lr.x, lr.y + (lr.height - dc.GetCharHeight()) / 2); + + for (size_t i = 0; i < r.actions.size(); ++i) { + const wxRect cell = cell_rect(rect, r.actions.size(), i); + if (m_hover.row == int(n) && m_hover.cell == int(i)) { + // Drawn through a graphics context so the rounded corners are anti-aliased on MSW too, + // and released before the icon goes on top. + const wxColour chip = StateColor::darkModeColorFor(wxColour(hover_chip)); + const double rad = FromDIP(4); + std::unique_ptr gc(wxGraphicsContext::CreateFromUnknownDC(dc)); + if (gc) { + gc->SetPen(*wxTRANSPARENT_PEN); + gc->SetBrush(wxBrush(chip)); + gc->DrawRoundedRectangle(cell.x, cell.y, cell.width, cell.height, rad); + } else { + dc.SetPen(*wxTRANSPARENT_PEN); + dc.SetBrush(wxBrush(chip)); + dc.DrawRoundedRectangle(cell, rad); + } + } + if (const ScalableBitmap* bmp = icon(r.actions[i].icon)) { + const wxSize sz = bmp->GetBmpSize(); + dc.DrawBitmap(bmp->bmp(), cell.x + (cell.width - sz.x) / 2, cell.y + (cell.height - sz.y) / 2, true); + } + } +} + +DesignRowList::Hit DesignRowList::hit_test(const wxPoint& pt) const +{ + Hit h; + h.row = VirtualHitTest(pt.y); + if (h.row == wxNOT_FOUND || h.row >= int(m_rows.size())) + return Hit{}; + const wxRect rect = GetItemRect(h.row); + const auto& acts = m_rows[h.row].actions; + for (size_t i = 0; i < acts.size(); ++i) + if (cell_rect(rect, acts.size(), i).Contains(pt)) { + h.cell = int(i); + break; + } + return h; +} + +wxRect DesignRowList::cell_rect(const wxRect& row, size_t count, size_t i) const +{ + const int side = FromDIP(kCellDip); + const int x = row.GetRight() + 1 - FromDIP(kPadDip) - int(count - i) * side; + return wxRect(x, row.y + (row.height - side) / 2, side, side); +} + +wxRect DesignRowList::label_rect(const wxRect& row, const Row& r) const +{ + int left = row.x + FromDIP(kPadDip); + if (const ScalableBitmap* bmp = icon(r.icon)) + left += bmp->GetBmpSize().x + FromDIP(kGapDip); + const int right = r.actions.empty() ? row.GetRight() + 1 - FromDIP(kPadDip) + : cell_rect(row, r.actions.size(), 0).x - FromDIP(kPadDip); + return wxRect(left, row.y, std::max(right - left, 0), row.height); +} + +// nullptr for no icon: load_icons() never stores an empty name. +const ScalableBitmap* DesignRowList::icon(const std::string& name) const +{ + const auto it = m_icons.find(name); + return it == m_icons.end() ? nullptr : &it->second; +} + +void DesignRowList::load_icons() +{ + auto load = [this](const std::string& name) { + if (!name.empty() && m_icons.find(name) == m_icons.end()) + m_icons.emplace(name, ScalableBitmap(this, name, kIconPx)); + }; + for (const Row& r : m_rows) { + load(r.icon); + for (const Action& a : r.actions) + load(a.icon); + } +} + +void DesignRowList::set_hover(const Hit& h) +{ + if (h == m_hover) + return; + const int old = m_hover.row; + m_hover = h; + if (old != wxNOT_FOUND && old < int(GetItemCount())) + RefreshRow(old); + if (h.row != wxNOT_FOUND && h.row != old) + RefreshRow(h.row); + + // The tip names the icon under the pointer, or the whole label where the row cuts it short. + wxString tip; + if (h.row != wxNOT_FOUND) { + const Row& r = m_rows[h.row]; + if (h.cell >= 0) + tip = r.actions[h.cell].tip; + else if (GetTextExtent(r.label).x > label_rect(GetItemRect(h.row), r).width) + tip = r.label; + } + if (tip.empty()) + UnsetToolTip(); + else if (tip != GetToolTipText()) + SetToolTip(tip); +} + +}} // namespace Slic3r::GUI diff --git a/src/slic3r/GUI/CAD/DesignRowList.hpp b/src/slic3r/GUI/CAD/DesignRowList.hpp new file mode 100644 index 0000000000..ce00f75fa2 --- /dev/null +++ b/src/slic3r/GUI/CAD/DesignRowList.hpp @@ -0,0 +1,108 @@ +#ifndef slic3r_DesignRowList_hpp_ +#define slic3r_DesignRowList_hpp_ + +#include + +#include +#include +#include +#include + +#include "slic3r/GUI/wxExtensions.hpp" // ScalableBitmap + +class wxTextCtrl; + +namespace Slic3r { namespace GUI { + +// The Design tab's Feature tree and Bodies lists: a single-selection list whose rows carry their +// own action icons. A wxTreeCtrl cannot host a clickable icon per row (it is native on MSW), so +// this list draws its own: each row draws its actions at its right end, highlights the one under +// the pointer, and takes its icons from the owner, so the eye can show whether the row is hidden. +// +// Selection follows wxTreeCtrl's contract, which DesignPanel's mutual exclusion between the two +// lists relies on: on_select runs on every change, whether the user or select() made it, and +// selecting the row that is already selected changes nothing and notifies nobody. +class DesignRowList : public wxVListBox +{ +public: + struct Action { + int id; // the owner's code for it, handed back to on_action + std::string icon; // icon name, e.g. "design_eye" + wxString tip; + }; + struct Row { + std::string icon; // type icon at the left; empty for none + wxString label; + wxString edit_text; // what the rename editor opens with; empty for the label + wxColour colour; // label colour + std::vector actions; // icon cells at the right end, in display order + }; + + // The hover chip behind an action icon, a light colour dark-mapped at paint. The sidebar's + // icon buttons hover in it too. + static constexpr const char* hover_chip = "#D4D4D4"; + + // The list is as tall as its rows, at least one and at most `max_visible`; past that it scrolls. + DesignRowList(wxWindow* parent, int max_visible); + + // Replace every row. Clears the selection without notifying and cancels a rename in progress; + // the owner re-selects the row it keeps, which notifies. + void set_rows(std::vector rows); + int selection() const { return GetSelection(); } + // Select `row` (wxNOT_FOUND clears) and call on_select if that changed the selection. + void select(int row); + void unselect() { select(wxNOT_FOUND); } + // Open the in-place editor on a row, once the current event has finished: opened from inside + // a popup menu's nested loop it would never appear. Enter or clicking away commits, Esc cancels. + void begin_rename(int row); + // Re-rasterise the icons and re-measure the rows after a DPI or theme change. + void Rescale(); + + std::function on_select; // the selection changed + std::function on_activate; // the selected row was double-clicked + // A row's action icon was clicked. Runs after the click has finished dispatching, and only + // while that row is still the selected one; the click itself selected it. + std::function on_action; + // Context menu on a row, at a screen position; the row under the pointer is selected first. + std::function on_menu; + // The editor committed `name` for `row`, trimmed and never empty (an empty commit cancels). + // Runs after the editor's own events have finished, so the owner may rebuild the rows here. + std::function on_rename; + +protected: + void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const override; + void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const override; + wxCoord OnMeasureItem(size_t n) const override; + +private: + struct Hit { + int row{wxNOT_FOUND}; + int cell{-1}; // index into the row's actions, -1 for the rest of the row + bool operator==(const Hit& o) const { return row == o.row && cell == o.cell; } + bool operator!=(const Hit& o) const { return !(*this == o); } + }; + + Hit hit_test(const wxPoint& pt) const; + wxRect cell_rect(const wxRect& row, size_t count, size_t i) const; + wxRect label_rect(const wxRect& row, const Row& r) const; + const ScalableBitmap* icon(const std::string& name) const; + void load_icons(); + void set_hover(const Hit& h); + void open_editor(int row); + void end_rename(bool commit); + void measure_row(); + void fit_rows(); + + std::vector m_rows; + std::map m_icons; + int m_max_visible; + int m_row_h{0}; // every row's height, from measure_row() + Hit m_hover; + Hit m_pressed; // action cell under the last left press + wxTextCtrl* m_editor{nullptr}; // created on the first rename, then reused + int m_edit_row{wxNOT_FOUND}; +}; + +}} // namespace Slic3r::GUI + +#endif // slic3r_DesignRowList_hpp_ From be72afc9f7d6c5a750b9524f12a1809e50474e01 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sun, 4 Oct 2026 22:21:06 +0800 Subject: [PATCH 212/389] Fix hidden features refusing to show again after their body's feature was hidden --- src/libslic3r/CAD/CadDocument.cpp | 7 ++++++- tests/libslic3r/test_caddocument.cpp | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/CAD/CadDocument.cpp b/src/libslic3r/CAD/CadDocument.cpp index 2a838354af..df3c1f7135 100644 --- a/src/libslic3r/CAD/CadDocument.cpp +++ b/src/libslic3r/CAD/CadDocument.cpp @@ -2197,11 +2197,16 @@ static void stage_history_change(std::vector& features, ref = nn >= 0 ? 3 + nn : 3 + int(after.size()) + 1000; }); if (f.body_ref_ids.size() != size_t(kBodyRefCount)) continue; // never resolved: nothing to follow + // A feature hidden after the change is not replayed, so a hidden source is no reason to + // drop its body: it keeps following it and re-points when shown. Shown while the source + // is still hidden, it is staged as replayed and loses the body then. Only deleting the + // source drops a hidden feature's body. + const bool replayed = enabled_after(j); int k = 0; for_each_body_ref(f, [&](int& ref, bool) { CadFeature::BodyId& id = f.body_ref_ids[k++]; if (ref < 0 || id.src < 0) return; - if (!alive(id.src)) { ref = kBodyGone; id = {}; return; } + if (replayed ? !alive(id.src) : map_feature(id.src) < 0) { ref = kBodyGone; id = {}; return; } id.src = map_feature(id.src); }); f.body_refs_pending = true; diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index 5be9364cfc..56f2cfb0b3 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -8801,6 +8801,29 @@ TEST_CASE("Hiding a body-making feature keeps later features on their body", "[C CHECK(doc.features[lift].target_body == 1); } +TEST_CASE("A hidden feature can be shown again once the feature that made its body is shown", + "[CadDocument][history]") +{ + CadDocument doc; + const int sk = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 10, 10, 0, "S"); + const int ex = doc.add_extrude(sk, 5, false, BooleanMode::New, "E"); + const int ch = doc.add_chamfer(1.0, FaceGroup::All, "C"); + doc.features[ch].target_body = 0; // as the Design tab sets it from picked edges; -1 has no body to follow + REQUIRE(doc.recompute()); + const double chamfered = double(doc.display_mesh.volume()); + + REQUIRE(doc.set_feature_enabled(ch, false)); + REQUIRE(doc.set_feature_enabled(ex, false)); + // The chamfer has no body while the extrude is hidden... + CHECK_FALSE(doc.set_feature_enabled(ch, true)); + CHECK_FALSE(doc.features[ch].enabled); + // ...and gets it back once the extrude is shown. + REQUIRE(doc.set_feature_enabled(ex, true)); + REQUIRE(doc.set_feature_enabled(ch, true)); + CHECK(doc.features[ch].target_body == 0); + CHECK_THAT(double(doc.display_mesh.volume()), Catch::Matchers::WithinRel(chamfered, 1e-6)); +} + TEST_CASE("Datum-plane references follow their plane when an earlier plane is deleted", "[CadDocument][history]") { From b6d11b2b3aaa39b28d8ee0e577617da7171ad94d Mon Sep 17 00:00:00 2001 From: Damir Galeev <49319928+DImagine@users.noreply.github.com> Date: Sun, 4 Oct 2026 20:47:56 +0300 Subject: [PATCH 213/389] Precise Seam: remove known limitations and rework perimeter intersection (#16072) Co-authored-by: Ian Bassi --- docs/HLSD/precise-seam.md | 712 +++++-- localization/i18n/OrcaSlicer.pot | 25 + localization/i18n/ru/OrcaSlicer_ru.po | 29 +- resources/images/menu_precise_seam_center.svg | 12 +- resources/images/menu_precise_seam_left.svg | 22 +- resources/images/menu_precise_seam_right.svg | 22 +- src/libslic3r/CMakeLists.txt | 1 + src/libslic3r/GCode.cpp | 5 + src/libslic3r/GCode/PreciseSeam.cpp | 1644 +++++++---------- src/libslic3r/GCode/PreciseSeam.hpp | 209 ++- src/libslic3r/GCode/PreciseSeamInternal.hpp | 42 + src/libslic3r/GCode/SeamPlacer.cpp | 142 +- src/libslic3r/GCode/SeamPlacer.hpp | 9 +- src/libslic3r/Model.cpp | 8 +- src/libslic3r/Model.hpp | 7 +- src/libslic3r/Polygon.cpp | 11 +- src/libslic3r/Polygon.hpp | 4 +- src/libslic3r/Print.hpp | 6 +- src/libslic3r/PrintApply.cpp | 5 +- src/libslic3r/PrintObjectSlice.cpp | 64 +- src/slic3r/GUI/3DScene.cpp | 4 +- src/slic3r/GUI/GUI_ObjectList.cpp | 1 + src/slic3r/GUI/GUI_ObjectList.hpp | 1 - tests/fff_print/test_precise_seam.cpp | 1210 +++++++++++- tests/fff_print/test_seam_placer.cpp | 107 ++ tests/libslic3r/CMakeLists.txt | 2 + tests/libslic3r/test_precise_seam.cpp | 1043 +++++++++++ 27 files changed, 3931 insertions(+), 1416 deletions(-) create mode 100644 src/libslic3r/GCode/PreciseSeamInternal.hpp create mode 100644 tests/libslic3r/test_precise_seam.cpp diff --git a/docs/HLSD/precise-seam.md b/docs/HLSD/precise-seam.md index 2976e8c7c2..8728f0518b 100644 --- a/docs/HLSD/precise-seam.md +++ b/docs/HLSD/precise-seam.md @@ -2,238 +2,584 @@ ## Purpose and scope -Precise Seam places the seam where a helper volume intersects the external -wall. The user attaches a mesh to an object as a Precise Seam modifier, and on -every layer the seam placer reads the modifier's slice to decide where the seam -of each external perimeter may, must or must not go. The same mesh keeps -working after the model changes, so the seam does not have to be repainted -after every design revision, and a swept helper body can guide the seam along -any path. +Precise Seam lets a helper volume decide where the seam of an object goes. The +user attaches a mesh to an object as a Precise Seam modifier. On every layer, +the part of the external perimeter that lies inside the modifier's slice +determines where the seam must, may or must not be placed. The helper is a +persistent model object rather than paint on the surface, so it keeps working +when the design changes. A body swept along a path on the surface can guide the +seam along any trajectory. -The modifier is non-printing geometry. It does not take part in slicing, region -assignment, filament selection or brim adhesion. It affects only seam -placement, which runs during G-code export. +The modifier is non-printing geometry. It takes no part in object slicing, +region assignment, filament selection or brim adhesion, and it affects only seam +placement during G-code export. Objects without Precise Seam volumes follow the +regular seam placement unchanged. -## Volume types and priority +Precise Seam does not replace the seam placer. It feeds it: a modifier inserts +the points it needs into the perimeter and changes the enforced/blocked type of +seam candidates, the same typing mechanism as seam painting, and the configured +seam position then chooses among them. -Precise Seam adds six `ModelVolumeType` values after `SUPPORT_ENFORCER`. The -strong types come first and the weak types follow. `is_precise_seam()`, +## Modifier types + +Precise Seam adds six `ModelVolumeType` values after `SUPPORT_ENFORCER`, strong +types first and weak types after them. `is_precise_seam()`, `is_precise_seam_strong()` and `is_precise_seam_weak()` are range checks that depend on this order. -| Type | Group | Effect on the perimeter | +| Type | Group | Effect on an intersected perimeter | | --- | --- | --- | -| `PRECISE_SEAM_CENTER` | strong | seam at the arc-length midpoint of the intersection | +| `PRECISE_SEAM_CENTER` | strong | seam at the midpoint, by arc length, of the intersection | | `PRECISE_SEAM_LEFT` | strong | seam at the first point of the intersection | | `PRECISE_SEAM_RIGHT` | strong | seam at the last point of the intersection | | `PRECISE_SEAM_ENFORCED` | weak | intersection marked as enforced | | `PRECISE_SEAM_BLOCKED` | weak | intersection marked as blocked | | `PRECISE_SEAM_NEUTRAL` | weak | intersection reset to neutral | -A strong modifier fixes one point. A weak modifier only changes the -enforced/blocked type of seam candidates, and the configured seam position then -chooses among them. First and last are taken along the perimeter made -counter-clockwise seen from above. On an outer wall seen from outside, Left is -the left end of the intersection. On the wall of a hole seen from inside the -hole, the two ends are swapped. +A strong modifier fixes a single point. The perimeter gets exactly one enforced +seam candidate there, and every other candidate is blocked. A weak modifier +retypes, and where needed adds, the candidates inside its intersection, like +painting does. + +An **intersection** is a continuous part of the external perimeter's centerline +that lies inside the modifier's slice on that layer. It is a portion of the +perimeter, never a chord through the object. The centerline lies half an +extrusion width inside the model surface and depends on print settings, so a +modifier must reach clearly past the surface to cross it unambiguously. + +### Terms + +- **Segment:** an intersection as the code represents it (`PerimeterSegment`). + User-facing texts call it an intersection. +- **Fragment:** a piece of the perimeter returned by clipping, before it is tied + to the source contour. +- **Interval:** the bound part of one source edge, given by the edge index and a + parameter range on that edge. +- **Zone:** a weak segment with its type (Enforced, Blocked or Neutral). +- **Boundary:** an end of a zone, inserted into the perimeter polygon. +- **Candidate:** a seam candidate of the seam placer, built from the points of + the processed perimeter polygon (painted enforcers may add more). + +First and last are taken along the perimeter oriented counter-clockwise as seen +from above. On an outer wall seen from outside, Left is therefore the left end +of the intersection. On the wall of a hole seen from inside the hole, the two +ends are swapped. Mirroring an object does not mirror the mode: perimeters stay +counter-clockwise, so Left remains the left end seen from outside, and the seam +moves to the other end of the modifier instead of following the mirrored model. + +## Priority The order of volumes in the object is the priority order, highest first. `ModelObject::sort_volumes()` keeps every strong modifier before every weak one and preserves the user's order within each group. The object list lets the user -drag a modifier only within its own group. A type change that crosses a group -boundary moves the volume to the end of its new group, where it has the lowest -priority. Strong modifiers are tried in this order, and the first one that -yields a seam on a perimeter wins. Weak modifiers are applied from the lowest -priority to the highest, so the highest one overwrites any overlapping zone. +drag a modifier only within its own group. A type change that crosses the group +boundary moves the volume to the end of its new group, with the lowest priority +there. -## Model storage and 3MF compatibility +- **Strong:** modifiers are tried in priority order on each perimeter. The first + one that yields a usable segment decides the seam. Within that modifier the + longest segment wins; lengths are never compared across modifiers. Once a + strong point is placed, no later strong modifier and no weak modifier is + processed for that perimeter. +- **Weak:** every weak modifier applies. They are applied from the lowest + priority to the highest, so the highest one overwrites overlapping zones. A + Blocked modifier that fully contains a perimeter is the exception: it is + skipped there (see [Full containment](#full-containment)). -Projects must stay readable by earlier releases, and the modifier must not -change a print there. Both 3MF writers therefore store a Precise Seam volume as -an ordinary parameter modifier: `modifier_part` in the Bambu-format part -subtype, and `ParameterModifier` together with the legacy `modifier` flag in -the Prusa-format volume metadata. The seam mode is written separately under +A strong modifier without a usable segment, even one whose fragments were all +discarded, passes the turn to the next one. + +## Data flow + +1. **Invalidation.** `Print::apply()` treats a change of Precise Seam volumes as + a change of seam placement and invalidates G-code export; the object is not + resliced (see [Print invalidation](#print-invalidation)). +2. **Modifier slices.** `SeamPlacer::init()` collects each object's Precise Seam + volumes once, slices every volume separately and caches its regions with + their bounding boxes. +3. **Perimeters.** Seam candidates are gathered in parallel over the layers. + For objects with Precise Seam volumes, each external perimeter polygon is + normalized and prepared once for all modifiers. +4. **Extraction.** For each modifier, the perimeter is clipped against the + modifier's regions on that layer. The clipped fragments are bound back to the + source edges of the perimeter and assembled into segments. +5. **Strong, then weak.** Strong modifiers try to insert one seam point into the + perimeter polygon. If none succeeds, weak modifiers insert their zone + boundaries and subdivide enforced edges. +6. **Candidates.** The seam placer builds candidates from the modified polygon. + Painting assigns types first, weak zones overwrite them, and a strong point + makes its candidate the only enforced one. +7. **Selection and restoration.** The configured seam position chooses the + seams and aligns them. Afterwards the exact strong points are restored. +8. **Warnings.** After all objects are processed, `SeamPlacer::init()` prepares + one combined warning text if any problem was found; G-code export issues it. + +## Modifier slices + +`init_precise_seam_data()` collects the Precise Seam volumes of each object: +strong ones in priority order and weak ones in reverse, so that weak zones can +be applied with last-write-wins. Each volume is sliced separately with +`PrintObject::slice_single_volume_regions()`, at the object's layer heights and +with the same centered transformation as the object. The slices keep every +region's outer contour together with its holes as an `ExPolygon`. Volumes are +not merged, so each keeps its own priority, and a modifier may have several +regions on one layer. + +`prepare_modifier_slices()` moves the slices into `ModifierRegionsCache`, +pairing each region with the bounding box of its exterior. Empty layers keep +their slots, so the cache is indexed by object layer; `Layer::id()` includes raft +layers, which are subtracted. The cache is filled before candidates are gathered +and is only read afterwards, shared by both modifier kinds and all worker +threads without locking. + +## Perimeter preparation + +The seam placer works on external perimeter loops, including the walls of +holes. For objects with Precise Seam volumes, consecutive duplicate points and +the repeated closing point of each extrusion loop are removed: adjacent +extrusion paths share endpoints, and the resulting zero-length edges would +prevent point insertion at their junctions. Distinct visits to one point of a +self-touching contour are kept. Objects without Precise Seam volumes keep their +original points, so ordinary seam candidates are unaffected. + +Each polygon is made counter-clockwise. A single `PreparedPerimeter` is then +built for all modifiers of that perimeter. It holds a validity check (at least +three points, no consecutive or closing duplicates), the bounding box, and the +clipping line: the polygon as an open polyline with its first point repeated at +the end. The preparation borrows the polygon and is used only while the polygon +is unchanged: strong processing returns immediately after inserting its point, +and weak processing collects all segments before it inserts anything. An +invalid perimeter receives no Precise Seam processing. + +## Segment extraction + +`extract_perimeter_segments()` turns one modifier's regions on one layer into +segments of the perimeter, each with its geometry and its position on the +source contour. Both modifier kinds consume these segments; the extractor is +told the modifier type so that it prepares only the data that type needs. + +### Clipping + +Regions whose bounding box does not overlap the perimeter's are skipped. The +clipping line is intersected with each remaining region by `intersection_pl()`, +which clips an open path against an `ExPolygon` with its holes attached, using +the nonzero rule. Clipping an open line yields only pieces of the perimeter, so +a modifier crossing the whole object produces two separate pieces rather than a +chord through the body. Holes in a modifier and several regions of one modifier +simply produce more pieces. The line is cut at vertex zero, so a piece crossing +that vertex arrives as two fragments. A border that only touches the line can +come back as a single point; such fragments carry no coverage and are dropped +before binding. + +### Binding fragments to source edges + +Clipper returns coordinates only. Insertion needs the source edge of every +point, and coordinates alone are ambiguous where a contour visits the same +point twice. Each fragment is therefore bound to the source edges it covers, +producing intervals: an edge index with a parameter range on that edge. + +- **Exact path.** For fragments with interior points, the second point is used + as an anchor that must equal a source vertex exactly. Clipping keeps the + vertices of an open path unchanged, including collinear ones. The following + points must match successive source vertices in either direction; later + occurrences of the anchor are tried if a sequence does not match. Only the two + end cuts are projected onto their edges. +- **Projection path.** Two-point fragments, and fragments the exact path cannot + match, are bound by projection. The first source edge that holds both points + of the first pair, with distinct parameters, establishes the edge and + direction. Every following pair must continue on the same edge or cross to the + neighboring edge at their actual shared vertex, in the same direction. A pair + continuing on the same edge reuses the previous pair's parameter for their + shared point, so the two projections of one point cannot differ. +- **Failure.** A fragment that cannot be bound continuously is rolled back and + discarded. Earlier fragments and other fragments are unaffected. The failure + is counted, logged and reported to the user (see + [Diagnostics](#diagnostics-and-warnings)). + +Two rare rounding cases are handled only after both paths have failed, so the +normal path never pays for them: + +- **Cut beside a vertex.** When a modifier boundary crosses within about one + coordinate unit of a source vertex, Clipper can place the cut at the vertex's + height but a few units beside it. The end pair then collapses to the vertex's + parameter or misses both neighboring edges. An end cut closer than the + snapping radius to a vertex of the fragment's own chain is snapped to that + vertex: either its neighbor in the fragment (the cut is a rounded copy of it + and is dropped) or a vertex that shares a source edge with that neighbor. The + neighbor wins whenever it is within the radius. Ends that are themselves source + vertices and ambiguous choices are left unchanged. Binding is then retried + once with the same strict rules, so a wrong candidate can only fail again. +- **Contact.** A fragment that still fails but is shorter than the snapping + radius is accepted as a contact and binds nothing. Insertion would collapse it + onto one point anyway. + +Both outcomes are recoveries, not failures: they show no user warning but leave +a log marker. + +### Assembling segments + +The intervals are sorted by edge and parameter. Intervals on the same occurrence +of an edge are united when they overlap or meet, by parameter or at the same +integer point; equal coordinates on different edges are never united. A +parameter of 1 is stored as parameter 0 of the next edge, so intervals on +adjacent edges meet exactly at their shared vertex. Consecutive intervals that +meet form one `PerimeterSegment`, and the last segment is joined with the first +when they meet at vertex zero, undoing the artificial cut of the clipping line. + +Each segment keeps its polyline, the source edge of every polyline edge, and its +begin and end positions on the source contour. + +### Full containment + +A modifier that covers the whole perimeter has no boundaries on it. The policy +follows seam painting, where painting a whole perimeter green is a meaningful +choice and forbidding the seam all round is not: + +- **Seam Enforced** types the whole perimeter, like a perimeter painted green all + round, with subdivision applied as described under [Weak modifiers](#weak-modifiers). +- **Seam Neutral** types the whole perimeter Neutral, like an unmarked perimeter, + clearing painting and lower zones. +- **Seam Blocked** is skipped for the perimeter, with the full-containment + warning. The seam cannot avoid the whole perimeter, so the modifier does not + override anything below it: lower zones and painting stay in effect. +- **Seam Center, Left and Right** are skipped with the same warning: there is no + intersection to place the point on. + +Enforced and Neutral take part in the usual priority order (see +[Weak modifiers](#weak-modifiers)). + +The perimeter is fully contained when the united intervals cover every source +edge from parameter 0 to 1. A modifier boundary that merely touches the +perimeter counts as well: + +- At a vertex or on an axis-aligned edge, clipping splits the line exactly at the + touch, the pieces meet at one point, and the coverage is complete. +- On an inclined edge the touching point is usually not representable on the + integer grid. The boundary pokes a few units across and leaves a real gap, so + a single segment covers everything except that gap. + +Weak insertion would collapse such a segment's boundaries onto one vertex and +turn the intended zone into a single candidate, and strong would put the seam at +the touch. A single segment is therefore also full containment in the cases +where insertion collapses it, exactly up to edges shorter than 2 µm: + +- the uncovered length from its end to its begin is below 1 µm, or +- the gap spans one vertex, or starts at a vertex and ends on the next edge, and + both ends lie within 1 µm of the vertex that ends the first gap edge, since + each end then snaps onto it from its own edge. + +A cheap filter runs first: both cases bring the segment's ends within 2 µm of +each other. + +## Strong modifiers + +For a strong modifier, the extractor prepares each segment's target point +before anything is inserted, together with the source edge it lies on: + +- **Left:** the segment's first point. +- **Right:** the segment's last point. +- **Center:** the point at half the segment's arc length. + +Arc length is the sum of Euclidean edge lengths, not the chord or a vertex count. + +`insert_strong_seam_point()` selects the longest segment of the first modifier +that has one. Exactly equal lengths are resolved by the prepared target points: +greater bed Y first, then smaller X; a complete tie keeps the first segment. +Slice coordinates already include instance rotation and have the bed axes; +centering and XY translation do not change this order. Nearly equal lengths are +not treated as equal, so exact ties occur mainly on axis-aligned geometry. +Geometrically equal segments, such as a symmetric modifier crossing both faces +of a thin wall, differ only by rounding noise that varies between layers, so +the chosen face may alternate. This is accepted deliberately: such a modifier is +ambiguous by itself: more than one segment raises the "multiple intersections" +warning. The user should make the modifier cross the perimeter once. + +The selected point is inserted on its source edge. A point within 1 µm of an +existing vertex is snapped to that vertex. Helper points are added 1 µm on both +sides of it, except on an adjacent edge shorter than 2 µm, which already bounds +the distance. + +When the candidates are built, the candidate at the inserted point is the only +enforced one and becomes the central enforcer; every other candidate is blocked. +Every seam position mode therefore selects it. Alignment and random placement +can still move the final position, so after alignment +`restore_precise_seam_positions()` writes the exact point and its index back +into every perimeter that has a strong seam. + +## Weak modifiers + +`collect_weak_modifier_segments()` extracts the segments of every weak modifier +before the polygon is modified, so all positions refer to the same contour. Each +segment becomes a zone with a type and two boundaries, kept in application +order, lowest priority first. Full containment of an Enforced or Neutral +modifier becomes a whole-perimeter zone at its place in that order: it has no +boundaries and takes part in no insertion or helper step below. The boundaries +carry their positions on the source contour; these remain as provenance after +insertion and are not indices into the modified polygon. + +`prepare_weak_modifier_segments()` then changes the polygon: + +1. **Boundary insertion.** Insertion events are sorted by decreasing source edge + and parameter, and the polygon is modified from its end towards its start. A + pending boundary's source index therefore stays valid. Vertex zero has the + canonical position `(0, 0)` and is + processed last, and a point on the closing edge is appended rather than + inserted at index zero. A boundary within 1 µm of either endpoint of its + current edge, an original vertex or a boundary inserted earlier, is snapped to + that point, so coincident boundaries share a vertex. A zone narrower than + 1 µm collapses into a single vertex. +2. **Helper points.** A helper point is added 1 µm outside every boundary, + unless the edge there is shorter than 2 µm, which already bounds it. The + helpers keep the edges at a boundary short, so a seam placed along such an + edge stays close to the boundary. Coincident boundaries share their helpers. +3. **Enforced subdivision.** Zone types are resolved for the polygon's edges in + priority order. The edges of a zone are those from its left boundary up to, + but not including, its right boundary; a whole-perimeter zone types every + edge. Enforced edges longer than `SeamPlacer::enforcer_oversampling_distance` + (0.2 mm) are subdivided into steps of at most that length; shorter edges and + existing vertices are kept. + The regular seam placer then chooses the seam as for painted seams. + +When candidates are built, painting assigns their types first. +`apply_weak_modifiers_to_perimeter()` then overwrites the types of the +candidates between the boundaries of each zone, both boundaries included, +lowest priority first; a whole-perimeter zone types every candidate. Blocked +and Enforced zones therefore take precedence over painting, and Neutral clears +painting inside its zone. + +## Numeric tolerances + +Coordinates are integers in scaled units: 1 nm by default, and 10 nm when a bed +larger than 2147 mm switches `SCALING_FACTOR`. Both Precise Seam tolerances are +deliberately defined in units rather than physical distances. Clipper truncates +cuts to whole units at any scale, so the on-edge tolerance must follow the unit; the +snapping radius scales with it to keep its margin over single-precision +candidate coordinates, which are coarser on large beds. Distances quoted in +this document in nanometers and +micrometers assume the default unit; on large printers they are ten times +larger. The enforced subdivision step is a physical distance and stays 0.2 mm. + +| Value | Role | +| --- | --- | +| `MACHINE_PRECISION_SQUARED` (2.5 units², about 1.6 nm) | A point lies on an edge if it is this close. It absorbs Clipper's truncation of cuts to whole units (under √2 units from the edge) and never bridges a real gap: a one-unit uncovered gap stays a gap. | +| `TOLERANCE_LINEAR` (1000 units, 1 µm) | Insertion snaps points this close to an existing vertex, and helper points are placed this far from boundaries. The same radius bounds the rounding fallback, contacts and the sub-micron full-containment rule, so those decisions match what insertion would produce anyway. | +| `enforcer_oversampling_distance` (0.2 mm) | Maximum step of enforced subdivision. | + +Raising the on-edge tolerance would not help with cuts beside a vertex: more +points past a vertex would be clamped to its parameter and collapse. Lowering it +would reject ordinary rounded cuts. The snapping radius is kept far above +clipping precision for robustness: seam candidates hold single-precision +coordinates, whose step is about 8 to 15 nm at typical object coordinates +(about 0.25 µm 3 m from the object's centre, on large beds only), and +weak boundaries and the strong point are located among the candidates by those +coordinates, so distinct points must stay clearly distinct. 1 µm is also far +below printing precision. + +## Diagnostics and warnings + +One `PreciseSeamWarnings` instance is shared by all objects and layers of a +`SeamPlacer::init()` call. After all objects are processed, `SeamPlacer::init()` +prepares at most one warning text, available through `precise_seam_warning()`. +G-code export issues it as one non-critical warning with the ID +`SlicingPreciseSeamWarning`. It is a single line, "Precise Seam: . Seam +placement may differ from expected.", because the export warnings dialog shows +only the first line of each warning. Repeated warning events replace the +notification instead of appending to it. Except for the "had no effect" cause, +the causes name the modifier types involved, as the menu names them, in menu +order and each type once, for example "(Seam Left, Seam Enforced)". +The causes are: + +- **failed to process some intersections (types):** at least one fragment was + discarded by binding. Other segments remain usable. +- **multiple intersections with a perimeter, only one was used (types):** + a Seam Center, Left or Right modifier had more than one segment on a + perimeter (see [Strong modifiers](#strong-modifiers)). +- **a perimeter is fully inside a modifier, the modifier was not applied to it + (types):** a Seam Center, Left, Right or Blocked modifier was skipped for a + perimeter (see [Full containment](#full-containment)). +- **modifier "" of "" had no effect on the seam (it might not reach + the centerline of the printed perimeter):** a modifier was evaluated on at + least one perimeter and never gave a segment, full containment or a discarded + fragment. Only the first such modifier in print and volume order is named, + followed by "(N in total)" when there are several. + + Only the effect is certain, so the cause is given as a hint. A modifier is + evaluated only when its turn comes: on a perimeter where a higher strong + modifier placed the seam, lower strong and all weak modifiers are not + evaluated. A modifier that was never evaluated is not reported, since nothing + is known about it. A point contact gives no segment and does not count as + reaching the perimeter. + +The log records the following diagnostic markers: + +- `[PreciseSeamIntersectionFailed]` for a discarded fragment, with object, + modifier, layer, height, fragment and failing pair, the failure reason and + point counts. +- `[PreciseSeamFragmentRecovered]` for a recovery, with `outcome=bound` or + `outcome=contact`, the same location fields and the original failure reason. +- `[PreciseSeamNoEffect]` for every modifier of the "had no effect" cause, with + the object and modifier names. Unlike the user warning, the log lists all of + them. + +Failures and recoveries are counted separately. The first 10 of each per +`init()` call are logged in detail, in parallel processing order; if a limit is +exceeded, one summary marker reports the total and the number omitted. + +## Known limitations + +- **The modifier must reach the perimeter centerline.** Contacts are taken as + clipping returns them, without offsets or tangency rules, so boundaries that + only graze the centerline are the user's responsibility. Several near-touches + on inclined edges can leave several segments separated by gaps of a few units; + their zones then cover nearly the whole perimeter instead of being treated as + full containment. +- **Self-touching perimeters.** Extraction keeps distinct visits of one + coordinate apart through its source-edge bindings, but the consumers locate + inserted points by coordinates. A weak zone is typed and subdivided from the + first vertex with its boundary coordinate, while boundary helpers are added at + every such vertex. A strong point marks every candidate at its coordinate as + enforced, and the last one is restored after alignment. If a boundary or a + strong point falls exactly on a repeated coordinate, a zone may therefore start + from another visit, or the seam may start at another visit of the same point. + Carrying visit identity through insertion, refinement, candidates and + restoration would touch the whole pipeline, so it is not done for this rare + geometry. Overlapping source visits are likewise outside the binding contract. + +## Integration with the application + +### Other seam settings + +- Precise Seam takes part only in outer and hole perimeter seam placement. In + spiral vase mode the seam placer is not used for perimeters, so the modifiers + have no effect. +- Scarf seams, the seam gap and wiping start from the chosen point exactly as + they would from an ordinary seam. +- Seam painting acts only from model parts, the volumes the seam gizmo shows and + edits, and from negative volumes. Painting retained on a volume after a change + from part to a Precise Seam, ordinary or support modifier is ignored. A type + change back to a model part reactivates any retained painting. + Negative volumes keep it on purpose: painting a + part and turning it into a negative volume is the only way to paint the wall + of the hole it cuts. That painting still affects the seam but is invisible in + the gizmo and cannot be edited there; this is known technical debt. + If painting them is ever made editable, G-code invalidation must track it too: + `model_custom_seam_data_changed()` checks model parts only. + +### Model storage and 3MF compatibility + +Projects must stay readable by earlier releases, and a Precise Seam volume must +not change a print there. Both 3MF writers therefore store it as an ordinary +parameter modifier: `modifier_part` in the Bambu-format part subtype, and +`ParameterModifier` together with the legacy `modifier` flag in the +Prusa-format volume metadata. The seam mode is written separately under `precise_seam_type`, using the names from `ModelVolume::type_to_string()` (`precise_seam_center` and so on). -On load, the mode applies after all other volume metadata, regardless of XML -key order, and only when the base type is a modifier. Missing or unknown modes -leave an ordinary modifier. Seam metadata on any other base type is ignored. -Files that stored the seam mode directly as the volume type still load. +On load, the mode is applied after all other volume metadata, regardless of XML +key order, and only when the base type is a modifier. A missing or unknown mode +leaves an ordinary modifier, and seam metadata on any other base type is +ignored. Files that stored the seam mode directly as the volume type still load. +A project saved again by an earlier release loses the seam mode for good: the +volumes stay ordinary modifiers without settings. A Precise Seam volume keeps any per-volume settings it had as a part or modifier, but they are inactive and the object list shows no settings item for it. The writers prefix these keys with `precise_seam_config:`, so an earlier -reader drops them as unknown options. The volume therefore loads there as a -modifier without settings and has no effect on the print. The current reader -restores the keys only when the volume ends up as a Precise Seam type, so the -settings return when the user changes the type back. Configuration values are -XML-escaped in both writers, for every volume type. +reader drops them as unknown options and loads a modifier without settings, +which has no effect on the print. The current reader restores the keys only when +the volume ends up as a Precise Seam type, so the settings return when the user +changes the type back. -## Print invalidation +### Print invalidation `Print::apply()` compares the Precise Seam volumes of each object by type, ID -and transformation. Adding, removing, moving, reordering or retyping one -cancels background processing and invalidates only `psGCodeExport`; the sliced -layers are kept. `model_volume_list_update_supports_and_seams()` then brings -the support and Precise Seam volumes of the print's model copy in line with the -new model in one pass. A volume may switch between the two families, since -neither affects slicing. A conversion to or from a part or ordinary modifier -changes the solid and modifier volume lists and reslices as before. +and transformation. Adding, removing, moving, reordering or retyping one cancels +background processing and invalidates only `psGCodeExport`; the sliced layers +are kept. `model_volume_list_update_supports_and_seams()` then brings the +support and Precise Seam volumes of the print's model copy in line with the new +model in one pass. A volume may switch between these two families, since neither +affects object slicing; such a switch also changes the support volumes, so the +support step is invalidated as well. -## Modifier slices +A conversion to or from a part or an ordinary modifier changes the solid and +modifier volume lists and reslices the object as before. The volume keeps its +ID across the type change, so the region cache treats a former support or +Precise Seam volume that became a part or modifier as new, since it was never +cached. -`SeamPlacer::init()` collects the Precise Seam volumes of each object once: -strong ones in priority order and weak ones reversed. It slices each volume -separately with `PrintObject::slice_single_volume()`, which shares -`slice_modifier_volumes()` with support blockers and enforcers but does not -merge volumes, so each keeps its own priority. The result is cached per volume -and indexed by object layer; `Layer::id()` includes raft layers, which are -subtracted. Seam candidates are then gathered in parallel over the layers and -read the cache without locking. +Removing the last helper of a single-part object reslices it, as removing any +last modifier would. -Objects without Precise Seam volumes follow the unchanged seam placement path. -For objects that have them, perimeter extraction also removes consecutive -duplicate points and the repeated closing point of each extrusion loop. -Zero-length edges at path junctions would otherwise prevent point insertion -there. Distinct visits to one point of a self-touching contour are kept. - -## Finding the wall segment - -The seam placer works on the external perimeter loops of each layer, both -outer contours and holes, each made counter-clockwise. For every modifier -polygon on the layer that overlaps the perimeter's bounding box, the region -enclosed by the perimeter is clipped against the modifier polygon. The boundary -of each intersection polygon alternates between runs that follow the perimeter -and runs that follow the modifier outline. The wall segment is the longest -continuous run of intersection vertices that lie on the perimeter, measured in -vertices. - -The fast path first finds an intersection vertex that exactly matches a -perimeter vertex. It then walks forward and backward, expecting the adjacent -perimeter vertex and falling back to projection when Clipper has merged or -split collinear edges. A vertex counts as on the perimeter when its projection -is within about 1.6 nm, which covers Clipper's rounding. If no vertex matches -exactly, or every vertex lies on the perimeter, the general path projects all -vertices. When every vertex is on the perimeter, the edge midpoints are checked -instead: a modifier chord can join two perimeter vertices directly, and the -chords split the vertex ring into runs. If no edge leaves the perimeter, the -perimeter lies entirely inside the modifier. - -`Polygon::point_projection()` optionally reports the edge that holds the -projection, and every point of the segment keeps the index of its perimeter -edge. New points are inserted on that edge. A point within 1 µm of an existing -vertex snaps to that vertex instead. - -## Strong modifiers - -For a strong modifier, the target is the first point, the last point or the -arc-length midpoint of the segment. The midpoint is projected back onto the -original perimeter, because Clipper may have merged several perimeter edges -into one segment edge. The target is inserted into the perimeter, and a helper -point is inserted 1 µm before and after it. Strong modifiers are tried in -priority order, the first valid intersection decides the seam, and weak -modifiers are not processed for that perimeter. - -When candidates are built, the inserted point is the only enforced candidate -and becomes the central enforcer; every other candidate is blocked. The seam -position modes then pick that point: Aligned and Aligned Back prefer the central -enforcer, while Back, Random and Nearest rank enforced candidates above blocked -ones. Alignment and random placement can still move the final position along an -edge. After alignment, `restore_precise_seam_positions()` writes the exact point -and its index back into every perimeter that has a strong seam. Inner walls take -their seam from the external seam as usual, including staggering. - -## Weak modifiers - -Weak modifiers produce one segment per intersection polygon, so one modifier can -mark several zones on one perimeter. All segment boundaries are inserted into -the perimeter in order of decreasing arc length. Each insertion then leaves the -indices of the pending, shorter ones unchanged; a point on the closing edge is -appended rather than inserted at index zero. A helper point is added 1 µm -outside each boundary. Random placement picks a position along the edge that -follows a candidate. These helpers keep that edge 1 µm long at each boundary, so -a zone cannot extend or intrude further than that. Boundaries that coincide -share their helper points. - -The zone types are then resolved in priority order, and the edges of enforced -zones are subdivided into steps of at most -`SeamPlacer::enforcer_oversampling_distance` (0.2 mm). The middle candidate of -the longest enforced patch is therefore close to the geometric middle of the -zone. That patch is measured in candidates, across the closing edge, regardless -of where the contour starts; the same rule applies to painted seams. - -Candidates first receive their type from seam painting. The weak zones then -overwrite it, lowest priority first. Blocked and Enforced zones therefore take -precedence over painting, and Neutral clears painting inside its zone. - -## Unsupported geometry and warnings - -Some modifier shapes cannot be resolved to one seam or one zone per crossing. -They are detected cheaply and reported rather than guessed: - -- A strong modifier that crosses a perimeter in more than one place uses only - its first valid segment. The other crossings are ignored. -- A modifier that crosses the whole region enclosed by the perimeter is - detected when the modifier outline minus that region leaves more than one - piece, none of them a hole. Its intersection holds two wall runs, and only - one of them is used. -- A modifier whose slice has a hole on a layer, found as a clockwise polygon in - the flattened slice, is skipped on that layer. The flattened slice no longer - records which hole belongs to which contour. -- A perimeter that lies entirely inside a modifier is ignored by that modifier. - -The conditions are atomic flags shared by all layers and objects. After all -objects are processed, `SeamPlacer::init()` issues at most one non-critical -warning with the ID `SlicingPreciseSeamWarning`. The warning is a single line -that lists every cause found, because the export warnings dialog shows only the -first line of each warning. Repeated warning events replace this notification -instead of appending text to it. - -## User interface +### User interface - *Add Precise Seam* in the object menu creates a Center modifier from a primitive or a loaded mesh. Text and SVG volumes cannot become Precise Seam - modifiers: the menu does not offer them, and `ObjectList::set_volume_type()` + modifiers: the menu does not offer it, and `ObjectList::set_volume_type()` refuses the change. - *Change Type* has a single *Precise Seam* entry. It converts other volumes to Center and keeps the mode of volumes that are already Precise Seam. The - *Precise Seam Type* submenu appears only when every selected item is a - Precise Seam volume, including settings rows that resolve to one. It sets the - chosen mode on all selected volumes. + *Precise Seam Type* submenu appears only when every selected item is a Precise + Seam volume, including settings rows that resolve to one, and sets the chosen + mode on all of them. - Each mode has its own icon in the object list and its own color in the 3D - view, at 60% opacity: warm oranges for the strong modes, and green, red and - gray for Enforced, Blocked and Neutral. -- Object list drops map visible rows to volume indices while skipping hidden - cut connectors, and they refresh the row-to-volume map of the object. -- Precise Seam volumes have no filament, block pasting into SLA, and are exposed - to Python plugins as `ModelVolumeType` values plus the `is_precise_seam*()` - methods. + view, at 60% opacity: warm orange, gold and dark orange for Center, Left and + Right; green, red and gray for Enforced, Blocked and Neutral. The three strong + colors are close shades of one orange because all three mark strong + modifiers; the object list icons tell the modes apart. +- Precise Seam volumes have no filament and cannot be pasted into SLA objects. + Python plugins see them as `ModelVolumeType` values and through the + `is_precise_seam*()` methods. ## Implementation and verification -- [PreciseSeam.cpp](../../src/libslic3r/GCode/PreciseSeam.cpp) implements segment - detection, point insertion, weak-zone resolution and position restoration. - [SeamPlacer.cpp](../../src/libslic3r/GCode/SeamPlacer.cpp) integrates it into - candidate gathering and issues the warning. +- [PreciseSeam.cpp](../../src/libslic3r/GCode/PreciseSeam.cpp) implements the + modifier cache, perimeter preparation, segment extraction and binding, strong + selection and insertion, weak-zone preparation and application, and position + restoration. [PreciseSeam.hpp](../../src/libslic3r/GCode/PreciseSeam.hpp) + declares the contracts; [PreciseSeamInternal.hpp](../../src/libslic3r/GCode/PreciseSeamInternal.hpp) + exposes the binding internals to tests. +- [SeamPlacer.cpp](../../src/libslic3r/GCode/SeamPlacer.cpp) fills the cache, + normalizes perimeters, calls both consumers while gathering candidates, + restores strong positions after alignment and prepares the warning text, which + [GCode.cpp](../../src/libslic3r/GCode.cpp) issues during G-code export. - [Model.hpp](../../src/libslic3r/Model.hpp) defines the types and their order, [PrintApply.cpp](../../src/libslic3r/PrintApply.cpp) handles invalidation, and - [PrintObjectSlice.cpp](../../src/libslic3r/PrintObjectSlice.cpp) slices the - modifiers. [bbs_3mf.cpp](../../src/libslic3r/Format/bbs_3mf.cpp) and - [3mf.cpp](../../src/libslic3r/Format/3mf.cpp) store them. + [PrintObjectSlice.cpp](../../src/libslic3r/PrintObjectSlice.cpp) slices single + volumes into structured regions. [bbs_3mf.cpp](../../src/libslic3r/Format/bbs_3mf.cpp) + and [3mf.cpp](../../src/libslic3r/Format/3mf.cpp) store them. - [GUI_Factories.cpp](../../src/slic3r/GUI/GUI_Factories.cpp) and [GUI_ObjectList.cpp](../../src/slic3r/GUI/GUI_ObjectList.cpp) provide the menus, - type changes and ordering. + type changes and ordering; [3DScene.cpp](../../src/slic3r/GUI/3DScene.cpp) + defines the colors. +- [Segment extraction tests](../../tests/libslic3r/test_precise_seam.cpp) cover + clipping and binding: holes and components, contour origin and reversal, + repeated coordinates, collinear vertices and rounding, rollback and the + diagnostic limits, the rounding fallback on synthetic and real Clipper + fragments, contacts, and full containment including touches and sub-micron + gaps on inclined edges and around vertices. - [Precise Seam tests](../../tests/fff_print/test_precise_seam.cpp) cover the - strong positions, including a midpoint on an existing vertex or the closing - edge. They also cover shared and coincident weak boundaries, every warning, - and the priority order. + consumers: strong targets in every mode, including a midpoint on an existing + vertex or the closing edge, longest-arc selection and tie order in bed axes, + priorities, weak boundaries that coincide or share an edge, enforced + subdivision, whole-perimeter weak zones with painting and priorities, weak + zones over painting's oversampled candidates, the warning type masks, usage + tracking for the "had no effect" warning, volume sorting of strong and weak + groups, restoration of strong points after alignment, raft layer indexing and + structured slices. End-to-end tests slice a real object with Precise Seam + volumes and check the outer wall starts in the exported G-code: every strong + mode under several seam positions and with a raft, Enforced and Blocked zones, + a modifier with a hole, and the user warning. - [Seam placer tests](../../tests/fff_print/test_seam_placer.cpp) cover enforced-patch selection independent of the contour start, fully painted - contours, duplicate removal, and `Print::apply()` synchronization through - type changes and restored model snapshots. + contours, duplicate removal, and `Print::apply()` synchronization through type + changes and restored model snapshots. The duplicate-removal test also checks + the "had no effect" warning text prepared by `init()` for a helper that never + reaches the loop. Further tests check that adding, moving, retyping or + removing a Precise Seam volume invalidates only G-code export, and that seam + painting acts only from model parts and negative volumes, including after a + type change back to part. - [3MF tests](../../tests/libslic3r/test_precise_seam_3mf.cpp) cover the round - trip of every mode and of inactive settings, attribute escaping, and which - metadata combinations restore a seam mode. + trip of every mode and of inactive settings, attribute escaping, and the + metadata combinations that restore a seam mode. [Plugin tests](../../tests/slic3rutils/test_precise_seam_plugin.cpp) cover the Python bindings. diff --git a/localization/i18n/OrcaSlicer.pot b/localization/i18n/OrcaSlicer.pot index fa09e82104..92130b9482 100644 --- a/localization/i18n/OrcaSlicer.pot +++ b/localization/i18n/OrcaSlicer.pot @@ -22855,3 +22855,28 @@ msgstr "" #: resources/data/hints.ini: [hint:Avoid warping] msgid "Avoid warping\nDid you know that when printing materials that are prone to warping such as ABS, appropriately increasing the heatbed temperature can reduce the probability of warping?" msgstr "" + +#: src/libslic3r/GCode/SeamPlacer.cpp +#, possible-boost-format +msgid "failed to process some intersections (%1%)" +msgstr "" + +#: src/libslic3r/GCode/SeamPlacer.cpp +#, possible-boost-format +msgid "multiple intersections with a perimeter, only one was used (%1%)" +msgstr "" + +#: src/libslic3r/GCode/SeamPlacer.cpp +#, possible-boost-format +msgid "a perimeter is fully inside a modifier, the modifier was not applied to it (%1%)" +msgstr "" + +#: src/libslic3r/GCode/SeamPlacer.cpp +#, possible-boost-format +msgid "modifier \"%1%\" of \"%2%\" had no effect on the seam (it might not reach the centerline of the printed perimeter)" +msgstr "" + +#: src/libslic3r/GCode/SeamPlacer.cpp +#, possible-boost-format +msgid "modifier \"%1%\" of \"%2%\" (%3% in total) had no effect on the seam (it might not reach the centerline of the printed perimeter)" +msgstr "" diff --git a/localization/i18n/ru/OrcaSlicer_ru.po b/localization/i18n/ru/OrcaSlicer_ru.po index 043aa5b476..df1af45a03 100644 --- a/localization/i18n/ru/OrcaSlicer_ru.po +++ b/localization/i18n/ru/OrcaSlicer_ru.po @@ -27362,17 +27362,30 @@ msgstr "" msgid "Precise Seam" msgstr "Точный шов" -msgid "multiple intersections with a perimeter detected" -msgstr "обнаружены множественные пересечения с периметром" +#: src/libslic3r/GCode/SeamPlacer.cpp +#, possible-boost-format +msgid "failed to process some intersections (%1%)" +msgstr "не удалось обработать некоторые пересечения (%1%)" -msgid "modifier fully crosses the printable perimeter" -msgstr "модификатор пересекает печатаемый периметр насквозь" +#: src/libslic3r/GCode/SeamPlacer.cpp +#, possible-boost-format +msgid "multiple intersections with a perimeter, only one was used (%1%)" +msgstr "несколько пересечений с периметром, использовано только одно (%1%)" -msgid "modifier shape is not solid (has holes inside) and was ignored" -msgstr "форма модификатора не сплошная (имеет отверстия) и была проигнорирована" +#: src/libslic3r/GCode/SeamPlacer.cpp +#, possible-boost-format +msgid "a perimeter is fully inside a modifier, the modifier was not applied to it (%1%)" +msgstr "периметр целиком внутри модификатора, модификатор для него не применён (%1%)" -msgid "perimeter is fully contained inside modifier and was ignored" -msgstr "периметр полностью содержится внутри модификатора и был проигнорирован" +#: src/libslic3r/GCode/SeamPlacer.cpp +#, possible-boost-format +msgid "modifier \"%1%\" of \"%2%\" had no effect on the seam (it might not reach the centerline of the printed perimeter)" +msgstr "модификатор «%1%» модели «%2%» не повлиял на шов (возможно, он не достигает осевой линии печатаемого периметра)" + +#: src/libslic3r/GCode/SeamPlacer.cpp +#, possible-boost-format +msgid "modifier \"%1%\" of \"%2%\" (%3% in total) had no effect on the seam (it might not reach the centerline of the printed perimeter)" +msgstr "модификатор «%1%» модели «%2%» (всего: %3%) не повлиял на шов (возможно, он не достигает осевой линии печатаемого периметра)" msgid "Seam placement may differ from expected." msgstr "Размещение шва может отличаться от ожидаемого." diff --git a/resources/images/menu_precise_seam_center.svg b/resources/images/menu_precise_seam_center.svg index f7efb2feb0..6d18cb6bc2 100644 --- a/resources/images/menu_precise_seam_center.svg +++ b/resources/images/menu_precise_seam_center.svg @@ -1,8 +1,8 @@ - + - + @@ -11,9 +11,9 @@ - - + + - - + + diff --git a/resources/images/menu_precise_seam_left.svg b/resources/images/menu_precise_seam_left.svg index 737d422373..e4fa8e8e96 100644 --- a/resources/images/menu_precise_seam_left.svg +++ b/resources/images/menu_precise_seam_left.svg @@ -1,16 +1,16 @@ - + - - - - - - - - + + + + + + + + - - + + diff --git a/resources/images/menu_precise_seam_right.svg b/resources/images/menu_precise_seam_right.svg index 202895cac2..e8c010e5e1 100644 --- a/resources/images/menu_precise_seam_right.svg +++ b/resources/images/menu_precise_seam_right.svg @@ -1,16 +1,16 @@ - + - - - - - - - - + + + + + + + + - - + + diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 8985c8c7d9..6cfb813227 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -260,6 +260,7 @@ set(lisbslic3r_sources GCode/SeamPlacer.hpp GCode/PreciseSeam.cpp GCode/PreciseSeam.hpp + GCode/PreciseSeamInternal.hpp #GCodeSender.cpp #GCodeSender.hpp GCode/SmallAreaInfillFlowCompensator.cpp diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index a440bb87a0..8add372abd 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3888,6 +3888,11 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Collect custom seam data from all objects. std::function throw_if_canceled_func = [&print]() { print.throw_if_canceled(); }; m_seam_placer.init(print, throw_if_canceled_func); + // Precise Seam: init() only prepares its warning; issue it here, inside the active export step. + if (!m_seam_placer.precise_seam_warning().empty()) + print.active_step_add_warning(PrintStateBase::WarningLevel::NON_CRITICAL, + m_seam_placer.precise_seam_warning(), + PrintStateBase::SlicingPreciseSeamWarning); // BBS: get path for change filament if (m_writer.multiple_extruders) { diff --git a/src/libslic3r/GCode/PreciseSeam.cpp b/src/libslic3r/GCode/PreciseSeam.cpp index b8eb5ea270..4cf7dc0978 100644 --- a/src/libslic3r/GCode/PreciseSeam.cpp +++ b/src/libslic3r/GCode/PreciseSeam.cpp @@ -1,18 +1,22 @@ +// Precise Seam implementation. Design: docs/HLSD/precise-seam.md #include "PreciseSeam.hpp" +#include "PreciseSeamInternal.hpp" #include "libslic3r/Polygon.hpp" +#include "libslic3r/Polyline.hpp" #include "libslic3r/Point.hpp" #include "libslic3r/Model.hpp" -#include "libslic3r/ClipperUtils.hpp" #include "SeamPlacer.hpp" #include "libslic3r/libslic3r.h" #include "libslic3r/BoundingBox.hpp" +#include "libslic3r/ClipperUtils.hpp" +#include "libslic3r/Layer.hpp" +#include "libslic3r/Print.hpp" #include #include #include #include #include -#include -#include +#include #include #include #include @@ -22,501 +26,509 @@ namespace Slic3r { namespace PreciseSeam { +ModifierRegions prepare_modifier_regions(ExPolygons regions) +{ + ModifierRegions cached; + cached.reserve(regions.size()); + // Each exterior is measured once; its holes remain in the same cached region. + for (ExPolygon ®ion : regions) + cached.emplace_back(std::move(region)); + return cached; +} + +ModifierSlices prepare_modifier_slices(std::vector slices) +{ + ModifierSlices cached; + cached.reserve(slices.size()); + // Keep empty layers so callers can index by the original object layer number. + for (ExPolygons &layer : slices) + cached.push_back(prepare_modifier_regions(std::move(layer))); + return cached; +} + +PreparedPerimeter::PreparedPerimeter(const Polygon &perimeter) : polygon(perimeter) +{ + const size_t count = polygon.size(); + if (count < 3) + return; + for (size_t edge = 0; edge < count; ++edge) + if (polygon.points[edge] == polygon.points[(edge + 1) % count]) + return; + bounds = BoundingBox(polygon.points); + // Close an open polyline explicitly; prepare its storage once for all modifier queries. + line.points.reserve(count + 1); + line.points.insert(line.points.end(), polygon.points.begin(), polygon.points.end()); + line.points.push_back(polygon.points.front()); + valid = true; +} + // Import EnforcedBlockedSeamPoint from SeamPlacerImpl namespace for convenience using SeamPlacerImpl::EnforcedBlockedSeamPoint; -// Machine precision for checking exact coordinate matching (squared distance) -// Ideally, intersection points should match perimeter vertices bitwise, -// but we account for possible machine rounding errors in Clipper calculations -// Actual deviations: maximum ~0.27, using 2.5 with margin (nanometers) +// Squared on-edge tolerance in coordinate units: Clipper truncates cuts to whole units, under 1 unit +// per axis, so under sqrt(2) from the edge (squared < 2); 2.5 keeps a margin. Independent of SCALING_FACTOR. static constexpr double MACHINE_PRECISION_SQUARED = 2.5; -// Tolerance for checking proximity when inserting seam points into perimeter -static const coord_t TOLERANCE_LINEAR = scale_(0.001); // 1.0 micrometers -static const coord_t TOLERANCE_SQUARED = TOLERANCE_LINEAR * TOLERANCE_LINEAR; +// Snapping radius for point insertion, shared by every rule that must match insertion. Deliberately in +// scaled units (1 um by default, 10 um on large beds), well above single-precision candidate steps. +static constexpr coord_t TOLERANCE_LINEAR = 1000; +static constexpr coord_t TOLERANCE_SQUARED = TOLERANCE_LINEAR * TOLERANCE_LINEAR; -// Find common segment between intersection polygon and object perimeter -// -// REQUIREMENTS: -// - intersection_polygon must be converted to CCW (counter-clockwise) beforehand -// - perimeter_polygon must be converted to CCW (counter-clockwise) beforehand -// -// Parameters: -// intersection_polygon - intersection area polygon (result of intersection()), CCW orientation -// perimeter_polygon - object outline (outer perimeter), CCW orientation -// modifier_polygon - modifier that formed the intersection -// -// Returns: -// SegmentData - longest continuous segment with point correspondence -// std::nullopt - if segment not found (< 2 points) or error -// -static std::optional common_segment_in_intersection( - const Polygon &intersection_polygon, - const Polygon &perimeter_polygon, - PreciseSeamWarnings* warnings = nullptr) +namespace detail { + +// Use the existing clipping tolerance only to recover rounded coordinates, not to +// bridge gaps between intervals: even a small uncovered interval must remain a gap. +static std::optional parameter_on_edge(const Point &point, const Point &a, const Point &b) { - const size_t isect_n = intersection_polygon.points.size(); - const size_t perim_n = perimeter_polygon.points.size(); - - // Check for empty polygons - if (isect_n == 0 || perim_n == 0) { + // Original vertices need no floating-point projection. + if (point == a) return 0.; + if (point == b) return 1.; + const Vec2d direction = b.cast() - a.cast(); + const Vec2d offset = point.cast() - a.cast(); + const double squared_length = direction.squaredNorm(); + if (squared_length == 0.) return std::nullopt; - } - - // Minimum 2 points required to form segment - if (isect_n < 2) { + const double parameter = std::clamp(offset.dot(direction) / squared_length, 0., 1.); + if ((offset - parameter * direction).squaredNorm() > MACHINE_PRECISION_SQUARED) return std::nullopt; - } - - // ============================================================ - // STEP 1: Project all intersection points onto perimeter - // ============================================================ - - struct PointProjection { - double dist_squared; // Squared distance to perimeter - size_t edge_index; // Edge/vertex index of perimeter - bool on_perimeter; // Whether point lies on perimeter (within machine precision) - }; - - std::vector projections; - projections.reserve(isect_n); - - // Project each intersection point onto perimeter - for (size_t i = 0; i < isect_n; ++i) { - size_t edge_idx; - const Point proj_point = perimeter_polygon.point_projection(intersection_polygon.points[i], &edge_idx); - const double dist_sq = (intersection_polygon.points[i] - proj_point).cast().squaredNorm(); - - const auto invalid = std::numeric_limits::max(); - if (edge_idx == invalid) { - // Projection error - point does not belong to perimeter - projections.push_back({dist_sq, edge_idx, false}); - } else { - // Check whether point lies on perimeter (within machine precision) - bool on_perim = (dist_sq <= MACHINE_PRECISION_SQUARED); - projections.push_back({dist_sq, edge_idx, on_perim}); - } - } - - // ============================================================ - // STEP 2: Find all continuous segments of points on perimeter - // ============================================================ - - std::vector processed(isect_n, false); // Processed point flags - std::vector> segments; // Found segments (point indices) - - for (size_t start_idx = 0; start_idx < isect_n; ++start_idx) { - // Skip processed or non-perimeter points - if (processed[start_idx] || !projections[start_idx].on_perimeter) { - continue; - } - - // Found point on perimeter - search for continuous segment - std::vector backward_indices; // Point indices backward from start_idx - std::vector forward_indices; // Point indices forward from start_idx (including start_idx) - - // Add start point to forward - forward_indices.push_back(start_idx); - processed[start_idx] = true; - - // Backward traversal (only if start_idx == 0, for wrap-around handling) - if (start_idx == 0) { - for (size_t offset = 1; offset < isect_n; ++offset) { - size_t curr_idx = (start_idx + isect_n - offset) % isect_n; - - // Stop if point already processed or not on perimeter - if (processed[curr_idx] || !projections[curr_idx].on_perimeter) { - break; - } - - backward_indices.push_back(curr_idx); - processed[curr_idx] = true; - } - } - - // Forward traversal from start_idx - for (size_t offset = 1; offset < isect_n; ++offset) { - size_t curr_idx = (start_idx + offset) % isect_n; - - // Stop if point already processed or not on perimeter - if (processed[curr_idx] || !projections[curr_idx].on_perimeter) { - break; - } - - forward_indices.push_back(curr_idx); - processed[curr_idx] = true; - } - - // Merge backward (in reverse order) + forward into one segment - std::vector segment_indices; - segment_indices.reserve(backward_indices.size() + forward_indices.size()); - - // Add backward in reverse order - segment_indices.insert( - segment_indices.end(), - backward_indices.rbegin(), - backward_indices.rend() - ); - - // Add forward - segment_indices.insert( - segment_indices.end(), - forward_indices.begin(), - forward_indices.end() - ); - - // Save found segment - segments.push_back(std::move(segment_indices)); - } - - // ============================================================ - // STEP 3: Select longest segment - // ============================================================ - - // If no segments found - if (segments.empty()) { - return std::nullopt; - } - - // Search for segment with maximum point count - auto it_longest = std::max_element( - segments.begin(), - segments.end(), - [](const auto &a, const auto &b) { return a.size() < b.size(); } - ); - - const std::vector &longest_segment = *it_longest; - - // Check minimum requirement: >= 2 points - if (longest_segment.size() < 2) { - return std::nullopt; - } - - // Special case: all intersection vertices lie on perimeter - if (longest_segment.size() == isect_n) { - // Threshold for edge midpoint check: increased by 0.5 due to rounding error in integer coordinate division - constexpr double EDGE_CENTER_THRESHOLD = MACHINE_PRECISION_SQUARED + 0.5; - - // Check each intersection edge - does its midpoint lie on perimeter - std::vector edges_not_on_perim_indices; - - for (size_t i = 0; i < isect_n; ++i) { - size_t next_i = (i + 1) % isect_n; - - // Calculate edge midpoint i→next_i - const Point &pt1 = intersection_polygon.points[i]; - const Point &pt2 = intersection_polygon.points[next_i]; - Point edge_center( - (pt1.x() + pt2.x()) / 2, - (pt1.y() + pt2.y()) / 2 - ); - - // Project midpoint onto perimeter - const Point proj = perimeter_polygon.point_projection(edge_center); - const double dist_sq = (edge_center - proj).cast().squaredNorm(); - - // Check if midpoint lies on perimeter (accounting for rounding error) - if (dist_sq > EDGE_CENTER_THRESHOLD) { - edges_not_on_perim_indices.push_back(i); - } - } - - // Analyze results - if (edges_not_on_perim_indices.empty()) { - // All edges on perimeter → modifier fully contains perimeter → not suitable for seam placement - if (warnings) - warnings->full_containment.store(true, std::memory_order_relaxed); - return std::nullopt; - } - - // Edges not on perimeter act as "cuts" that split the circular ring of vertices - // into separate on-perimeter segments. For k cuts there are k segments. - // We iterate over consecutive pairs of cuts and pick the longest segment. - const size_t k = edges_not_on_perim_indices.size(); - size_t best_start = 0; - size_t best_length = 0; - - for (size_t i = 0; i < k; ++i) { - size_t gap_cur = edges_not_on_perim_indices[i]; - size_t gap_next = edges_not_on_perim_indices[(i + 1) % k]; - - // Segment starts at the vertex right after the current cut - size_t start = (gap_cur + 1) % isect_n; - // Number of vertices from start up to and including the vertex before the next cut - size_t length = (gap_next - gap_cur - 1 + isect_n) % isect_n + 1; - - if (length > best_length) { - best_length = length; - best_start = start; - } - } - - if (best_length < 2) { - return std::nullopt; - } - - // Form SegmentData from the longest on-perimeter segment - SegmentData result; - result.segment.points.reserve(best_length); - result.perimeter_edge_indices.reserve(best_length); - - for (size_t i = 0; i < best_length; ++i) { - size_t idx = (best_start + i) % isect_n; - result.segment.points.push_back(intersection_polygon.points[idx]); - result.perimeter_edge_indices.push_back(projections[idx].edge_index); - } - - return result; - } - - // ============================================================ - // STEP 4: Form SegmentData result - // ============================================================ - - SegmentData result; - result.segment.points.reserve(longest_segment.size()); - result.perimeter_edge_indices.reserve(longest_segment.size()); - - // Fill points and edge_index for each segment point - for (size_t idx : longest_segment) { - result.segment.points.push_back(intersection_polygon.points[idx]); - result.perimeter_edge_indices.push_back(projections[idx].edge_index); - } - - return result; + return parameter; } -// Fast search for common segment between intersection polygon and object perimeter -// Hybrid algorithm: first exact coordinate matching, then geometric check -// -// REQUIREMENTS: -// - intersection_polygon must be converted to CCW (counter-clockwise) beforehand -// - perimeter_polygon must be converted to CCW (counter-clockwise) beforehand -// -// Parameters: -// intersection_polygon - intersection area polygon (result of intersection()), CCW orientation -// perimeter_polygon - object outline (outer perimeter), CCW orientation -// -// Returns: -// SegmentData - continuous segment with point correspondence -// std::nullopt - if segment not found (< 2 points) or error -// -static std::optional common_segment_in_intersection_fast( - const Polygon &intersection_polygon, - const Polygon &perimeter_polygon, - PreciseSeamWarnings* warnings = nullptr) +static std::optional interval_on_edge( + const Point &first, const Point &last, size_t edge, const Polygon &perimeter) { - const size_t isect_n = intersection_polygon.points.size(); - const size_t perim_n = perimeter_polygon.points.size(); - - // ============================================================ - // STEP 1: Input data validation - // ============================================================ - - if (isect_n == 0 || perim_n == 0) { + const Point &a = perimeter.points[edge]; + const Point &b = perimeter.points[(edge + 1) % perimeter.size()]; + const auto t0 = parameter_on_edge(first, a, b); + // Reject this edge before projecting the second point when the first is outside. + if (!t0) return std::nullopt; - } - - if (isect_n < 2) { + const auto t1 = parameter_on_edge(last, a, b); + if (!t1 || *t0 == *t1) return std::nullopt; + ClippedEdgeInterval interval{edge, *t0, *t1, first, last}; + if (interval.begin > interval.end) { + std::swap(interval.begin, interval.end); + std::swap(interval.first, interval.last); } + // Canonical endpoints make adjacent original edges join at their shared vertex. + if (interval.begin == 0.) interval.first = a; + if (interval.end == 1.) interval.last = b; + return interval; +} - // ============================================================ - // STEP 2: Find first point (exact coordinate match) - // ============================================================ - - // Vectors for forward direction - std::vector forward_intersection_indices; - std::vector forward_edge_indices; - forward_intersection_indices.reserve(isect_n); - forward_edge_indices.reserve(isect_n); - - // Vectors for backward direction - std::vector backward_intersection_indices; - std::vector backward_edge_indices; - backward_intersection_indices.reserve(isect_n); - backward_edge_indices.reserve(isect_n); - - size_t first_isect_idx = 0; // index of first matching point in intersection_polygon - size_t first_perim_idx = 0; // index of first matching point in perimeter_polygon (also edge_index) - bool found_first = false; - - // Search for first exact match (not optimized — expected gain is negligible) - for (size_t i = 0; i < isect_n; ++i) { - const Point &isect_pt = intersection_polygon.points[i]; - - auto it = std::find(perimeter_polygon.points.begin(), - perimeter_polygon.points.end(), - isect_pt); - - if (it != perimeter_polygon.points.end()) { - first_isect_idx = i; - first_perim_idx = std::distance(perimeter_polygon.points.begin(), it); - found_first = true; - - // Add first point to forward vectors - forward_intersection_indices.push_back(i); - forward_edge_indices.push_back(first_perim_idx); - break; - } - } - - // If no matching point found - use full geometric algorithm - if (!found_first) { - return common_segment_in_intersection(intersection_polygon, perimeter_polygon, warnings); - } - - // Sentinel value for an invalid edge_index returned by Polygon::point_projection. - const auto invalid = std::numeric_limits::max(); - - // ============================================================ - // STEP 3: Forward pass (from first point forward) - // ============================================================ - - // Adaptive tracking of position in perimeter (instead of fixed prediction) - size_t next_expected_perim_idx = (first_perim_idx + 1) % perim_n; - - for (size_t offset = 1; offset < isect_n; ++offset) { - size_t curr_isect_idx = (first_isect_idx + offset) % isect_n; - const Point &curr_isect_pt = intersection_polygon.points[curr_isect_idx]; - const Point &expected_pt = perimeter_polygon.points[next_expected_perim_idx]; - - // First check exact match with expected position - if (curr_isect_pt == expected_pt) { - forward_intersection_indices.push_back(curr_isect_idx); - forward_edge_indices.push_back(next_expected_perim_idx); - next_expected_perim_idx = (next_expected_perim_idx + 1) % perim_n; +// Interior clipping vertices normally retain the exact source coordinates. Only +// the two cut endpoints need projection; a failed sequence tries the next anchor. +static bool append_exact_fragment(const Polyline &fragment, const Polygon &perimeter, + std::vector &intervals) +{ + const size_t size = fragment.size(); + const size_t count = perimeter.size(); + assert(size >= 3); // bind_fragment() sends only fragments with interior points here. + // A longer sequence cannot be one exact pass over this contour. + if (size > count + 2) + return false; + for (size_t anchor = 0; anchor < count; ++anchor) { + if (fragment.points[1] != perimeter.points[anchor]) continue; + // Clipping may return either direction, independent of contour winding. + for (bool forward : {true, false}) { + const auto next = [count, forward](size_t index) { + return forward ? (index + 1) % count : (index + count - 1) % count; + }; + size_t last = anchor; + bool matches = true; + for (size_t i = 2; i + 1 < size; ++i) { + last = next(last); + if (fragment.points[i] != perimeter.points[last]) { + matches = false; + break; + } + } + if (!matches) + continue; + const size_t first_edge = forward ? (anchor + count - 1) % count : anchor; + const size_t last_edge = forward ? last : (last + count - 1) % count; + const auto first = interval_on_edge(fragment.points.front(), fragment.points[1], first_edge, perimeter); + const auto end = interval_on_edge(fragment.points[size - 2], fragment.points.back(), last_edge, perimeter); + if (!first || !end) + continue; + // Commit only a complete match, so rejected anchors leave no intervals. + intervals.push_back(*first); + size_t vertex = anchor; + for (size_t i = 2; i + 1 < size; ++i) { + const size_t adjacent = next(vertex); + const size_t edge = forward ? vertex : adjacent; + intervals.push_back({edge, 0., 1., perimeter.points[edge], perimeter.points[(edge + 1) % count]}); + vertex = adjacent; + } + intervals.push_back(*end); + return true; } - - // Exact match not found - check geometrically - size_t edge_idx; - const Point proj_point = perimeter_polygon.point_projection(curr_isect_pt, &edge_idx); - const double dist_sq = (curr_isect_pt - proj_point).cast().squaredNorm(); - - if (edge_idx == invalid || dist_sq > MACHINE_PRECISION_SQUARED) { - // Point not on perimeter - break forward pass - break; - } - - // Point on perimeter - add and adjust expected position - forward_intersection_indices.push_back(curr_isect_idx); - forward_edge_indices.push_back(edge_idx); - next_expected_perim_idx = (edge_idx + 1) % perim_n; } + return false; +} - // ============================================================ - // STEP 4: Backward pass - // ============================================================ - - // Optimization: backward can find maximum (isect_n - forward_count) points - size_t forward_count = forward_intersection_indices.size(); - size_t max_backward_iterations = isect_n - forward_count; - - // Adaptive tracking of position in perimeter for backward direction - next_expected_perim_idx = (first_perim_idx + perim_n - 1) % perim_n; - - for (size_t offset = 1; offset <= max_backward_iterations; ++offset) { - size_t curr_isect_idx = (first_isect_idx + isect_n - offset) % isect_n; - const Point &curr_isect_pt = intersection_polygon.points[curr_isect_idx]; - const Point &expected_pt = perimeter_polygon.points[next_expected_perim_idx]; - - // First check exact match with expected position - if (curr_isect_pt == expected_pt) { - backward_intersection_indices.push_back(curr_isect_idx); - backward_edge_indices.push_back(next_expected_perim_idx); - next_expected_perim_idx = (next_expected_perim_idx + perim_n - 1) % perim_n; +// Find the first edge once, then follow the contour without restarting a global search. +bool append_projected_fragment(const Polyline &fragment, const Polygon &perimeter, + std::vector &intervals, + FragmentBindingFailure &failure) +{ + const size_t original_size = intervals.size(); + bool forward = true; + const size_t count = perimeter.size(); + for (size_t i = 1; i < fragment.size(); ++i) { + if (fragment.points[i - 1] == fragment.points[i]) continue; + failure.pair_index = i - 1; + std::optional matched; + const auto is_forward = [&](const ClippedEdgeInterval &candidate) { + const Vec2d movement = fragment.points[i].cast() - fragment.points[i - 1].cast(); + const Vec2d edge = perimeter.points[(candidate.edge + 1) % count].cast() - + perimeter.points[candidate.edge].cast(); + return movement.dot(edge) > 0.; + }; + if (intervals.size() == original_size) { + failure.reason = "initial edge not found"; + for (size_t edge = 0; edge < count; ++edge) { + matched = interval_on_edge(fragment.points[i - 1], fragment.points[i], edge, perimeter); + if (matched) { + // The first suitable edge defines orientation; overlapping visits are unsupported. + forward = is_forward(*matched); + break; + } + } + } else { + failure.reason = "non-continuous binding"; + const ClippedEdgeInterval &previous = intervals.back(); + const double end = forward ? previous.end : previous.begin; + matched = interval_on_edge(fragment.points[i - 1], fragment.points[i], previous.edge, perimeter); + if (matched && is_forward(*matched) != forward) + matched.reset(); + // The shared point is the previous pair's last point on the same edge, so continuity holds by + // construction. Reuse its parameter rather than comparing a recomputed one: the two projections + // may be compiled differently (e.g. FMA contraction) and differ by an ulp on some platforms. + if (matched) + (forward ? matched->begin : matched->end) = end; + // Crossing to the neighbor is allowed only at their actual shared vertex. + const size_t vertex = forward ? (previous.edge + 1) % count : previous.edge; + if (!matched && end == (forward ? 1. : 0.) && fragment.points[i - 1] == perimeter.points[vertex]) { + const size_t edge = forward ? vertex : (previous.edge + count - 1) % count; + matched = interval_on_edge(fragment.points[i - 1], fragment.points[i], edge, perimeter); + if (matched && is_forward(*matched) != forward) + matched.reset(); + // The shared point is exactly the neighbor's start (forward) or end (backward) vertex, + // so parameter_on_edge() returns exactly 0 or 1 for it. + assert(!matched || (forward ? matched->begin == 0. : matched->end == 1.)); + } } - - // Exact match not found - check geometrically - size_t edge_idx; - const Point proj_point = perimeter_polygon.point_projection(curr_isect_pt, &edge_idx); - const double dist_sq = (curr_isect_pt - proj_point).cast().squaredNorm(); - - if (edge_idx == invalid || dist_sq > MACHINE_PRECISION_SQUARED) { - // Point not on perimeter - break backward pass - break; + if (!matched) { + // Never leave a partial fragment or discard earlier successful fragments. + intervals.resize(original_size); + return false; } - - // Point on perimeter - add and adjust expected position - backward_intersection_indices.push_back(curr_isect_idx); - backward_edge_indices.push_back(edge_idx); - next_expected_perim_idx = (edge_idx + perim_n - 1) % perim_n; + intervals.push_back(*matched); } + return intervals.size() > original_size; +} - // Check special case: all intersection vertices lie on perimeter - // Use full geometric algorithm (rare case but requires special handling) - size_t total_points = forward_intersection_indices.size() + backward_intersection_indices.size(); - if (total_points == isect_n) { - return common_segment_in_intersection(intersection_polygon, perimeter_polygon, warnings); +// Exact binding first, projection as the general path; both leave intervals unchanged on failure. +bool bind_fragment(const Polyline &fragment, const Polygon &perimeter, + std::vector &intervals, FragmentBindingFailure &failure) +{ + if (fragment.size() > 2 && append_exact_fragment(fragment, perimeter, intervals)) + return true; + return append_projected_fragment(fragment, perimeter, intervals, failure); +} + +// Rare-case repair, run only after binding has failed: Clipper may place an end cut a unit or two beside +// a vertex, so it lies on neither edge. Move such an end onto that vertex, taken from the fragment's own +// chain, and let the caller retry with the same strict rules, so a wrong move can only fail again. +// Returns false when nothing was changed. +static bool snap_cuts_to_adjacent_vertices(Polyline &fragment, const Polygon &perimeter) +{ + const size_t count = perimeter.size(); + // Strict comparison matches the vertex snapping in insert_point_into_perimeter. + const auto close = [](const Point &a, const Point &b) { + return (a - b).cast().squaredNorm() < double(TOLERANCE_SQUARED); + }; + const auto snap_target = [&](const Point &cut, const Point &neighbour) -> std::optional { + if (cut == neighbour) + return std::nullopt; + bool neighbour_is_vertex = false; + bool ambiguous = false; + std::optional target; + // Scan the whole perimeter before deciding: a cut that is a real vertex must be detected anywhere, + // and an ambiguity must not pre-empt the neighbour rule below. + for (size_t j = 0; j < count; ++j) { + if (perimeter[j] == cut) + return std::nullopt; // A real vertex, not a rounded cut. + if (perimeter[j] != neighbour) + continue; + neighbour_is_vertex = true; + for (const Point &candidate : {perimeter[(j + count - 1) % count], perimeter[(j + 1) % count]}) { + if (!close(cut, candidate)) + continue; + if (target && *target != candidate) + ambiguous = true; + target = candidate; + } + } + // A cut between two arbitrary points of one edge is not this rounding case. + if (!neighbour_is_vertex) + return std::nullopt; + // The neighbour itself takes precedence, even when both of its chain vertices are close too + // (edges shorter than the radius on both sides): the cut is then just a rounded copy of it. + if (close(cut, neighbour)) + return neighbour; + // Two different edge-start candidates: keep the failure rather than guess. + if (ambiguous) + return std::nullopt; + return target; + }; + bool changed = false; + if (fragment.size() >= 2) + if (const auto target = snap_target(fragment.points.front(), fragment.points[1])) { + if (*target == fragment.points[1]) + fragment.points.erase(fragment.points.begin()); + else + fragment.points.front() = *target; + changed = true; + } + if (fragment.size() >= 2) + if (const auto target = snap_target(fragment.points.back(), fragment.points[fragment.size() - 2])) { + if (*target == fragment.points[fragment.size() - 2]) + fragment.points.pop_back(); + else + fragment.points.back() = *target; + changed = true; + } + return changed; +} + +// Location fields shared by the failure and recovery markers, enough to find the layer in a saved project. +static std::string fragment_location(const ExtractionContext &context, size_t fragment_index) +{ + const Layer *layer = context.layer; + const ModelObject *object = layer && layer->object() ? layer->object()->model_object() : nullptr; + return " object=" + std::to_string(object ? object->id().id : 0) + + " modifier=" + std::to_string(context.modifier ? context.modifier->id().id : 0) + + " layer=" + (layer ? std::to_string(layer->id()) : std::string("unknown")) + + " z=" + (layer ? std::to_string(layer->slice_z) : std::string("unknown")) + + " fragment=" + std::to_string(fragment_index); +} + +bool append_fragment(const Polyline &fragment, const Polygon &perimeter, + std::vector &intervals, + const ExtractionContext &context, size_t fragment_index) +{ + FragmentBindingFailure failure; + if (bind_fragment(fragment, perimeter, intervals, failure)) + return true; + // Rare-case fallback: repair the end cuts and retry once. A recovery is logged but is not a failure + // (no failure count, no user warning). + const char *outcome = nullptr; + Polyline cleaned = fragment; + if (snap_cuts_to_adjacent_vertices(cleaned, perimeter)) { + FragmentBindingFailure retry_failure; + // Only a contact shorter than the snapping distance may remain: nothing to bind, nothing lost. + if (cleaned.size() < 2) + outcome = "contact"; + else if (bind_fragment(cleaned, perimeter, intervals, retry_failure)) + outcome = "bound"; } - - // ============================================================ - // STEP 5: Merge backward (reversed) + forward - // ============================================================ - - std::vector continuous_intersection_indices; - std::vector continuous_edge_indices; - - if (backward_intersection_indices.empty()) { - // No backward - just move forward - continuous_intersection_indices = std::move(forward_intersection_indices); - continuous_edge_indices = std::move(forward_edge_indices); - } else { - // Merge: backward (reversed) + forward - size_t total_size = backward_intersection_indices.size() + forward_intersection_indices.size(); - continuous_intersection_indices.reserve(total_size); - continuous_edge_indices.reserve(total_size); - - // Add backward in reverse order - continuous_intersection_indices.insert( - continuous_intersection_indices.end(), - backward_intersection_indices.rbegin(), - backward_intersection_indices.rend() - ); - continuous_edge_indices.insert( - continuous_edge_indices.end(), - backward_edge_indices.rbegin(), - backward_edge_indices.rend() - ); - - // Add forward - continuous_intersection_indices.insert( - continuous_intersection_indices.end(), - forward_intersection_indices.begin(), - forward_intersection_indices.end() - ); - continuous_edge_indices.insert( - continuous_edge_indices.end(), - forward_edge_indices.begin(), - forward_edge_indices.end() - ); + // A failed fragment shorter than the snapping radius is a contact: insertion would collapse it to one + // point anyway, so accept it instead of reporting a failure. + if (outcome == nullptr && fragment.length() < double(TOLERANCE_LINEAR)) + outcome = "contact"; + if (outcome != nullptr) { + // Same log budget as failures, counted separately; SeamPlacer::init() reports the total. + if (context.warnings == nullptr || + context.warnings->recovered_fragments.fetch_add(1, std::memory_order_relaxed) < failed_fragment_log_limit) + BOOST_LOG_TRIVIAL(warning) << "[PreciseSeamFragmentRecovered] Rare case resolved after a binding failure" + << " outcome=" << outcome << fragment_location(context, fragment_index) + << " original_pair=" << failure.pair_index << " original_reason=" << failure.reason + << " fragment_points=" << fragment.size() << " cleaned_points=" << cleaned.size() + << " perimeter_points=" << perimeter.size(); + return true; } + // Reserve a log slot atomically before formatting; callers without shared state log every failure. + if (context.warnings && + context.warnings->failed_fragments.fetch_add(1, std::memory_order_relaxed) >= failed_fragment_log_limit) + return false; + // Keep a small marker for investigating a saved project, not a full geometry dump. + BOOST_LOG_TRIVIAL(warning) << "[PreciseSeamIntersectionFailed] Unable to process intersection" + << fragment_location(context, fragment_index) << " pair=" << failure.pair_index + << " reason=" << failure.reason << " fragment_points=" << fragment.size() + << " perimeter_points=" << perimeter.size(); + return false; +} +} // namespace detail - // ============================================================ - // STEP 6: Check minimum size and special cases - // ============================================================ - - if (continuous_intersection_indices.size() < 2) { - return std::nullopt; +// Finalize one joined strong segment; only Center needs temporary per-edge lengths. +static void prepare_strong_segment(PerimeterSegment &segment, ModelVolumeType mode, bool compare_lengths) +{ + const bool center = mode == ModelVolumeType::PRECISE_SEAM_CENTER; + std::vector edge_lengths; + if (center) + edge_lengths.reserve(segment.edge_indices.size()); + // A single Left/Right segment needs only its endpoint; Center always needs arc length. + if (center || compare_lengths) { + for (size_t i = 0; i < segment.edge_indices.size(); ++i) { + const double length = (segment.polyline.points[i + 1].cast() - + segment.polyline.points[i].cast()).norm(); + segment.length += length; + if (center) + edge_lengths.push_back(length); + } } - - // ============================================================ - // STEP 7: Form SegmentData result - // ============================================================ - - SegmentData result; - result.segment.points.reserve(continuous_intersection_indices.size()); - result.perimeter_edge_indices.reserve(continuous_intersection_indices.size()); - - // Fill with original coordinates from intersection_polygon + edge_index - for (size_t i = 0; i < continuous_intersection_indices.size(); ++i) { - size_t idx = continuous_intersection_indices[i]; - result.segment.points.push_back(intersection_polygon.points[idx]); - result.perimeter_edge_indices.push_back(continuous_edge_indices[i]); + if (mode == ModelVolumeType::PRECISE_SEAM_LEFT) { + segment.strong_target = StrongSeamTarget{segment.polyline.points.front(), segment.begin.edge_index}; + return; } + segment.strong_target = StrongSeamTarget{segment.polyline.points.back(), segment.end.edge_index}; + if (!center) + return; + // The total is now known; reuse local lengths to locate its half without new square roots. + double remaining = segment.length * 0.5; + for (size_t i = 0; i < edge_lengths.size(); ++i) { + const double length = edge_lengths[i]; + if (remaining <= length && length > 0.) { + const Point &a = segment.polyline.points[i]; + const Point &b = segment.polyline.points[i + 1]; + segment.strong_target = StrongSeamTarget{ + a + ((remaining / length) * (b - a).cast()).cast(), segment.edge_indices[i]}; + return; + } + remaining -= length; + } +} + +SegmentExtraction extract_perimeter_segments(const PreparedPerimeter &prepared, const ModifierRegions &modifier, + ModelVolumeType mode, const ExtractionContext &context) +{ + using detail::ClippedEdgeInterval; + SegmentExtraction result; + if (!prepared.valid) { + result.valid = false; + return result; + } + const Polygon &perimeter = prepared.polygon; + const size_t count = perimeter.size(); + std::vector nearby_regions; + for (const ModifierRegion ®ion : modifier) + if (!region.polygon.empty() && prepared.bounds.overlap(region.bounds)) + nearby_regions.push_back(®ion.polygon); + if (nearby_regions.empty()) + return result; + + // Clip as an open line, without offsets or contact rules: modifiers should cross the perimeter + // clearly, and the open path keeps self-touching vertices apart. + std::vector intervals; + Polylines fragments; + // Clip only accepted regions, with their holes still attached to the exterior. + for (const ExPolygon *region : nearby_regions) { + Polylines clipped = intersection_pl(prepared.line, *region); + for (Polyline &fragment : clipped) + // Clipper returns a single point where a border only touches the line: nothing to bind. + if (fragment.size() >= 2) + fragments.push_back(std::move(fragment)); + } + for (size_t i = 0; i < fragments.size(); ++i) + if (!detail::append_fragment(fragments[i], perimeter, intervals, context, i)) + ++result.discarded_fragments; + + std::sort(intervals.begin(), intervals.end(), [](const auto &a, const auto &b) { + if (a.edge != b.edge) return a.edge < b.edge; + if (a.begin != b.begin) return a.begin < b.begin; + return a.end < b.end; + }); + // Union overlaps on the same occurrence of an edge, never across equal coordinates. + std::vector merged; + for (const ClippedEdgeInterval &interval : intervals) { + // Fragments touching on an edge meet at the same integer point. Comparing that point as well keeps + // them joined even if its two projections differ by an ulp on some platforms (e.g. FMA contraction). + if (!merged.empty() && merged.back().edge == interval.edge && + (interval.begin <= merged.back().end || interval.first == merged.back().last)) { + if (interval.end > merged.back().end) { + merged.back().end = interval.end; + merged.back().last = interval.last; + } + } else + merged.push_back(interval); + } + const auto position = [count](size_t edge, double parameter) { + return parameter == 1. ? PerimeterPosition{(edge + 1) % count, 0.} + : PerimeterPosition{edge, parameter}; + }; + const auto same_position = [](const PerimeterPosition &a, const PerimeterPosition &b) { + return a.edge_index == b.edge_index && a.parameter == b.parameter; + }; + for (const ClippedEdgeInterval &interval : merged) { + const auto begin = position(interval.edge, interval.begin); + const auto end = position(interval.edge, interval.end); + if (result.segments.empty() || !same_position(result.segments.back().end, begin)) { + PerimeterSegment segment; + segment.begin = begin; + segment.polyline.points.push_back(interval.first); + result.segments.push_back(std::move(segment)); + } + PerimeterSegment &segment = result.segments.back(); + segment.polyline.points.push_back(interval.last); + segment.edge_indices.push_back(interval.edge); + segment.end = end; + } + if (result.segments.size() > 1 && same_position(result.segments.back().end, result.segments.front().begin)) { + // Only the artificial cut at vertex zero can join the last and first intervals. + PerimeterSegment tail = std::move(result.segments.back()); + result.segments.pop_back(); + PerimeterSegment &head = result.segments.front(); + tail.polyline.points.insert(tail.polyline.points.end(), head.polyline.points.begin() + 1, head.polyline.points.end()); + tail.edge_indices.insert(tail.edge_indices.end(), head.edge_indices.begin(), head.edge_indices.end()); + tail.end = head.end; + head = std::move(tail); + } + // A full loop must cover every original edge, not merely have equal endpoint coordinates. + result.full_containment = merged.size() == count; + for (size_t i = 0; result.full_containment && i < count; ++i) + result.full_containment = merged[i].edge == i && merged[i].begin == 0. && merged[i].end == 1.; + // A touch on an inclined edge leaves a sub-micron gap. Treat the single segment as full containment + // when the gap is shorter than the snapping radius, or spans one vertex with both ends within it + // (exact for edges of 2 um and longer). The 2 um end distance is a cheap pre-filter. + if (!result.full_containment && result.segments.size() == 1) { + const PerimeterSegment &only = result.segments.front(); + const Point &first = only.polyline.points.front(); + const Point &last = only.polyline.points.back(); + const double limit = double(TOLERANCE_LINEAR); + if ((first - last).cast().squaredNorm() < 4. * limit * limit) { + const auto edge_length = [&perimeter, count](size_t edge) { + return (perimeter[(edge + 1) % count] - perimeter[edge]).cast().norm(); + }; + // Uncovered length from the segment's end forward to its begin; stops early once it exceeds the limit. + const auto gap_length = [&](const PerimeterPosition &from, const PerimeterPosition &to) { + if (from.edge_index == to.edge_index && from.parameter <= to.parameter) + return (to.parameter - from.parameter) * edge_length(from.edge_index); + double gap = (1. - from.parameter) * edge_length(from.edge_index); + for (size_t edge = (from.edge_index + 1) % count; gap < limit && edge != to.edge_index; edge = (edge + 1) % count) + gap += edge_length(edge); + return gap + to.parameter * edge_length(to.edge_index); + }; + // Strict comparisons match the vertex snapping in insert_point_into_perimeter. + const auto within_snap = [limit](const Point &a, const Point &b) { + return (a - b).cast().squaredNorm() < limit * limit; + }; + const Point &vertex = perimeter[only.begin.edge_index]; + const bool around_one_vertex = (only.end.edge_index + 1) % count == only.begin.edge_index && + within_snap(last, vertex) && within_snap(first, vertex); + if (around_one_vertex || gap_length(only.end, only.begin) < limit) + result.full_containment = true; + } + } + // Strong skips full containment and weak handles it by type; neither needs strong data for it. + if (!result.full_containment && is_precise_seam_strong(mode)) + for (PerimeterSegment &segment : result.segments) + prepare_strong_segment(segment, mode, result.segments.size() > 1); return result; } @@ -538,16 +550,11 @@ void init_precise_seam_data( // Collect and categorize precise seam modifiers for (const ModelVolume* volume : model_object->volumes) { if (volume->is_precise_seam()) { - ModelVolumeType type = volume->type(); - // Categorization: strong modifiers have priority - if (type == ModelVolumeType::PRECISE_SEAM_CENTER || - type == ModelVolumeType::PRECISE_SEAM_LEFT || - type == ModelVolumeType::PRECISE_SEAM_RIGHT) { + // Strong (Center/Left/Right) and weak (Enforced/Blocked/Neutral) go to separate lists. + if (volume->is_precise_seam_strong()) strong_volumes_out.push_back(volume); - } else { - // ENFORCED, BLOCKED, NEUTRAL - weak modifiers (processed later) + else weak_volumes_out.push_back(volume); - } } } @@ -558,137 +565,15 @@ void init_precise_seam_data( std::reverse(weak_volumes_out.begin(), weak_volumes_out.end()); } -// Calculate cumulative lengths for each Polyline point -// Analog of Polygon::parameter_by_length(), adapted for open line -static std::vector polyline_parameter_by_length(const Polyline &polyline) -{ - // Keep scaled-coordinate lengths in double precision for midpoint interpolation. - std::vector lengths(polyline.points.size(), 0.); - for (size_t i = 1; i < polyline.points.size(); ++i) { - lengths[i] = lengths[i-1] + (polyline.points[i] - polyline.points[i-1]).cast().norm(); - } - return lengths; -} - -// Find geometric center coordinates of segment -// Returns: {center coordinates, perimeter vertex index} -// Index is start vertex of edge containing center -static std::optional> segment_center(const SegmentData &data, const Polygon &perimeter_polygon) -{ - const Polyline &segment = data.segment; - - if (segment.points.size() < 2) { - return std::nullopt; // Need at least a line to find middle - } - - std::vector lengths = polyline_parameter_by_length(segment); - if (lengths.empty()) { - return std::nullopt; // Polyline contains no points - } - - double half_length = lengths.back() * 0.5; // Take half of total length - size_t mid_idx = segment.points.size() / 2; - double mid_length = lengths[mid_idx]; - - bool found = false; - size_t start_idx = 0; - size_t end_idx = 0; - - if (mid_length < half_length) { - // Go right (to end) - for (size_t i = mid_idx; i < segment.points.size() - 1; ++i) { - if (lengths[i] <= half_length && half_length < lengths[i+1]) { - start_idx = i; // Fix left point of segment - end_idx = i + 1; // Fix right point of segment - found = true; - break; - } - } - } else if (mid_length > half_length) { - // Go left (to start) - for (size_t i = mid_idx; i > 0; --i) { - if (lengths[i-1] <= half_length && half_length < lengths[i]) { - start_idx = i - 1; // Take neighboring point on left - end_idx = i; // And nearest on right - found = true; - break; - } - } - } else { - // Middle sits exactly at vertex - start_idx = mid_idx; - end_idx = (mid_idx + 1) % segment.points.size(); // use next point (wrap-around) - found = true; - } - - if (!found) { - return std::nullopt; // Didn't find suitable segment - } - - const Point &p1 = segment.points[start_idx]; - const Point &p2 = segment.points[end_idx]; - - double local_mid_length = half_length - lengths[start_idx]; - double edge_length = lengths[end_idx] - lengths[start_idx]; - - Point mid_point; - if (edge_length <= 0.0) { - mid_point = p1; // Degenerate case, take start point - } else { - double k = local_mid_length / edge_length; - mid_point = p1 + (k * (p2 - p1).cast()).cast(); // Linear interpolation - } - - // Clipper may merge several collinear perimeter edges into one segment edge. - // Locate the midpoint on the original perimeter instead of reusing the start's edge. - size_t edge_idx; - const Point projected_midpoint = perimeter_polygon.point_projection(mid_point, &edge_idx); - if (edge_idx == std::numeric_limits::max()) - return std::nullopt; - - return std::make_pair(projected_midpoint, edge_idx); -} - -// Find coordinates of left (first) point of segment -// Returns: {first point coordinates, perimeter vertex index} -// Index is start vertex of edge containing first point -static std::optional> segment_left(const SegmentData &data) -{ - if (data.segment.points.empty()) { - return std::nullopt; - } - - return std::make_pair(data.segment.points[0], data.perimeter_edge_indices[0]); -} - -// Find coordinates of right (last) point of segment -// Returns: {last point coordinates, perimeter vertex index} -// Index is start vertex of edge containing last point -static std::optional> segment_right(const SegmentData &data) -{ - if (data.segment.points.empty()) { - return std::nullopt; - } - - size_t last_idx = data.segment.points.size() - 1; - return std::make_pair(data.segment.points[last_idx], data.perimeter_edge_indices[last_idx]); -} - -// Insert point into perimeter with proximity check to existing vertices -// If point is close to vertex (< TOLERANCE_SQUARED) - use existing vertex -// Returns pair: {final coordinates, point index in polygon} -// edge_start_idx is start vertex of edge containing point -static std::optional> insert_point_into_perimeter( +// Inserts a point on edge `edge_start_idx`, or reuses a vertex closer than TOLERANCE_LINEAR. +// Returns {final coordinates, index}. Requires at least three vertices (callers ensure it). +static std::pair insert_point_into_perimeter( const Point &point, size_t edge_start_idx, Polygon &perimeter_polygon ) { - // Check input data - if (perimeter_polygon.points.size() < 3) { - return std::nullopt; // Polygon must be at least a triangle - } - + assert(perimeter_polygon.points.size() >= 3); size_t perim_max = perimeter_polygon.points.size(); // Determine edge start and end @@ -709,11 +594,8 @@ static std::optional> insert_point_into_perimeter( return std::make_pair(perim_p_end, vtx_end); } - // Insert point into perimeter - // IMPORTANT: Special handling for the last edge to preserve indexing for subsequent insertions. - // If this is the last edge (edge_start_idx == perim_max - 1), we append to the end instead of - // inserting at position 0 (which would shift all indices). This allows sorting points by - // descending arc length and inserting them without invalidating previously computed indices. + // On the closing edge, append instead of inserting at index 0: callers insert in descending source + // order and rely on earlier indices staying valid. size_t insert_pos; if (edge_start_idx == perim_max - 1) { // Last edge: add to end of vector @@ -731,25 +613,16 @@ static std::optional> insert_point_into_perimeter( return std::make_pair(perimeter_polygon.points[insert_pos], insert_pos); } -// Insert new point at distance TOLERANCE_LINEAR from specified perimeter vertex -// Insertion direction specified by direction parameter: +1 = after vertex, -1 = before vertex -// If target edge length < 2*TOLERANCE_LINEAR, insertion not performed (new point would be too close to edge end) -// Returns true if point was inserted, false otherwise -// point_idx is index of perimeter vertex from which insertion is performed -static bool refine_at_vertex( +// Adds a helper point TOLERANCE_LINEAR after (+1) or before (-1) vertex `point_idx`; skips edges shorter +// than 2 * TOLERANCE_LINEAR. Requires at least three vertices. +static void refine_at_vertex( size_t point_idx, int direction, Polygon &perimeter_polygon ) { - // Check input data - if (perimeter_polygon.points.size() < 3) { - return false; // Polygon must be at least a triangle - } - - if (direction != 1 && direction != -1) { - return false; // Direction must be +1 or -1 - } + assert(perimeter_polygon.points.size() >= 3); + assert(direction == 1 || direction == -1); size_t perim_max = perimeter_polygon.points.size(); @@ -773,11 +646,9 @@ static bool refine_at_vertex( Vec2d edge_vector = (edge_end - edge_start).cast(); double edge_length = edge_vector.norm(); - // Check if edge is long enough for insertion - // New point must be at distance TOLERANCE_LINEAR from start - // and at distance >= TOLERANCE_LINEAR from end + // The helper needs TOLERANCE_LINEAR of edge on both sides. if (edge_length < 2.0 * TOLERANCE_LINEAR) { - return false; // Edge too short - new point would be too close to end + return; // Edge too short - new point would be too close to end } // Calculate new point coordinates: edge_start + TOLERANCE_LINEAR * direction_normalized @@ -788,11 +659,8 @@ static bool refine_at_vertex( ? Point(edge_start + offset) : Point(edge_end - offset); - // Insert point into perimeter - // IMPORTANT: Special handling of last edge to preserve indexing for subsequent insertions. - // If this is last edge (edge_start_idx == perim_max - 1), add point to end of vector - // instead of inserting at position 0 (which would shift all indices). This allows sorting points - // by descending arc length and inserting them without invalidating previously computed indices. + // On the closing edge, append instead of inserting at index 0: callers insert in descending source + // order and rely on earlier indices staying valid. if (edge_start_idx == perim_max - 1) { // Last edge: add to end of vector perimeter_polygon.points.push_back(new_point); @@ -803,162 +671,91 @@ static bool refine_at_vertex( new_point ); } - - return true; } -// Insert strong seam point into perimeter polygon +// Records one extraction for the warnings: the type of a modifier with a discarded fragment, and the +// evaluated/reached flags for "had no effect" (a discarded fragment counts as reached, a contact not). +static void record_extraction(PreciseSeamWarnings *warnings, const ModelVolume *modifier, + const SegmentExtraction &extracted) +{ + if (warnings == nullptr || !extracted.valid) + return; + if (extracted.discarded_fragments > 0) + PreciseSeamWarnings::mark(warnings->failed_types, modifier->type()); + const auto it = warnings->modifier_usage.find(modifier); + if (it == warnings->modifier_usage.end()) + return; + // Load before store: most calls find the flag already set, so shared cache lines stay clean. + PreciseSeamWarnings::ModifierUsage &usage = it->second; + if (!usage.checked.load(std::memory_order_relaxed)) + usage.checked.store(true, std::memory_order_relaxed); + const bool reached = !extracted.segments.empty() || extracted.full_containment || extracted.discarded_fragments > 0; + if (reached && !usage.reached.load(std::memory_order_relaxed)) + usage.reached.store(true, std::memory_order_relaxed); +} + +// Strong priority is per modifier, never a global maximum across different modifiers. std::optional insert_strong_seam_point( const std::vector &strong_volumes, Polygon &polygon, + const PreparedPerimeter &prepared, const Layer *layer, - const ModifierSlicesCache &slices_cache, + const ModifierRegionsCache &slices_cache, PreciseSeamWarnings* warnings) { - if (strong_volumes.empty() || layer == nullptr) { + assert(&prepared.polygon == &polygon); + if (strong_volumes.empty() || layer == nullptr || !prepared.valid) return std::nullopt; - } - - // layer->id() is offset by raft layer count, but modifier_slices is 0-based - // (built from PrintObject::layers() via slice_single_volume). Subtract raft - // offset to get the correct index into the cache. - const size_t raft_layers = layer->object()->slicing_parameters().raft_layers(); - size_t layer_id = layer->id() - raft_layers; - - // Reject disjoint bounds before running polygon clipping; touching bounds still overlap. - const BoundingBox perimeter_bbox(polygon.points); - - // Iterate through strong modifiers in hierarchy order - for (const ModelVolume* modifier_volume : strong_volumes) { - // Look up pre-sliced polygons from cache (sliced once in SeamPlacer::init). - // TODO: slice_single_volume() converts ExPolygons to flat Polygons, losing - // the association between outer contours and their holes. This makes correct - // handling of multiply-connected modifier regions (e.g. a torus cross-section) - // impossible. Consider a variant returning std::vector and adapting - // the algorithm to work with multiply-connected domains. - auto it = slices_cache.find(modifier_volume); - if (it == slices_cache.end()) - continue; // modifier not in cache (should not happen) - const std::vector &modifier_slices = it->second; - - // Check if this layer has slices for this modifier - if (layer_id >= modifier_slices.size()) { - continue; // No slices for this layer - } - - const Polygons &modifier_polygons = modifier_slices[layer_id]; - - // Check for multiply-connected regions (holes = CW polygons). - // slice_single_volume() flattens ExPolygons into Polygons, but preserves - // orientation: CCW = outer contour, CW = hole. If any CW polygon is present, - // the modifier is multiply-connected and cannot be processed correctly. - bool has_holes = std::any_of(modifier_polygons.begin(), modifier_polygons.end(), - [](const Polygon &p) { return p.is_clockwise(); }); - if (has_holes) { + const size_t layer_id = layer->id() - layer->object()->slicing_parameters().raft_layers(); + for (const ModelVolume *modifier : strong_volumes) { + const auto it = slices_cache.find(modifier); + if (it == slices_cache.end() || layer_id >= it->second.size()) + continue; + const SegmentExtraction extracted = extract_perimeter_segments( + prepared, it->second[layer_id], modifier->type(), {layer, modifier, warnings}); + record_extraction(warnings, modifier, extracted); + // Full containment leaves no intersection to place the point on: skipped with a warning. + if (extracted.full_containment) { if (warnings) - warnings->multiply_connected.store(true, std::memory_order_relaxed); + PreciseSeamWarnings::mark(warnings->full_containment, modifier->type()); continue; } + // No usable segment, even if all fragments were discarded: pass the turn to the next modifier. + if (extracted.segments.empty()) + continue; + if (warnings && extracted.segments.size() > 1) + PreciseSeamWarnings::mark(warnings->multiple_intersections, modifier->type()); - // Iterate through all polygons of the modifier on this layer - // After finding a match, check if remaining modifier polygons also intersect the perimeter. - // Strong modifiers process only one intersection (one seam per perimeter), so any additional - // intersections from unprocessed polygons indicate a multiple-intersection situation. - auto check_remaining_polygons = [&](size_t current_idx) { - if (warnings && !warnings->multiple_intersections.load(std::memory_order_relaxed)) { - // Refinement may have rounded newly inserted points, so use the current bounds. - const BoundingBox refined_bbox(polygon.points); - for (size_t j = current_idx + 1; j < modifier_polygons.size(); ++j) { - if (!refined_bbox.overlap(BoundingBox(modifier_polygons[j].points))) - continue; - if (!intersection(Polygons{polygon}, Polygons{modifier_polygons[j]}).empty()) { - warnings->multiple_intersections.store(true, std::memory_order_relaxed); - break; // one extra intersection is enough to trigger the warning - } - } - } - }; - for (size_t modifier_polygon_idx = 0; modifier_polygon_idx < modifier_polygons.size(); ++modifier_polygon_idx) { - const Polygon &modifier_polygon = modifier_polygons[modifier_polygon_idx]; - if (!perimeter_bbox.overlap(BoundingBox(modifier_polygon.points))) - continue; - // Find intersection with perimeter - Polygons intersection_polygons = intersection(Polygons{polygon}, Polygons{modifier_polygon}); - - // Multiple intersection polygons = modifier crosses perimeter in several places - if (warnings && intersection_polygons.size() > 1) - warnings->multiple_intersections.store(true, std::memory_order_relaxed); - // Diff check: modifier minus perimeter yields >1 polygon = through-body intersection. - // However, if any diff polygon is CW, it is a hole left by full containment - // (modifier fully covers perimeter), not a real through-body case. - // Full containment is detected separately in common_segment_in_intersection(). - if (warnings && !warnings->through_body.load(std::memory_order_relaxed)) { - Polygons diff_polygons = diff(Polygons{modifier_polygon}, Polygons{polygon}); - if (diff_polygons.size() > 1) { - bool has_cw = std::any_of(diff_polygons.begin(), diff_polygons.end(), - [](const Polygon &p) { return p.is_clockwise(); }); - if (!has_cw) - warnings->through_body.store(true, std::memory_order_relaxed); - } - } - - // Process each intersection polygon - for (Polygon &intersection_polygon : intersection_polygons) { - // Convert intersection_polygon to CCW to guarantee same traversal direction as perimeter - intersection_polygon.make_counter_clockwise(); - - // Try to find perimeter segment in this intersection - std::optional segment = common_segment_in_intersection_fast( - intersection_polygon, - polygon, - warnings - ); - - if (!segment.has_value()) { - continue; - } - - // Select target point finder based on modifier type - std::optional> target; - switch (modifier_volume->type()) { - case ModelVolumeType::PRECISE_SEAM_CENTER: target = segment_center(segment.value(), polygon); break; - case ModelVolumeType::PRECISE_SEAM_LEFT: target = segment_left(segment.value()); break; - case ModelVolumeType::PRECISE_SEAM_RIGHT: target = segment_right(segment.value()); break; - default: continue; - } - - if (!target.has_value()) - continue; - - // Insert target point into perimeter with tolerance check - std::optional> result = insert_point_into_perimeter( - target->first, // target_point - target->second, // insert_idx - polygon - ); - - if (!result.has_value()) - continue; - - // Add additional points on both sides to create transition zone. - // +1 must be called before -1: reverse order shifts result->second and breaks insertion. - refine_at_vertex(result->second, +1, polygon); - refine_at_vertex(result->second, -1, polygon); - - check_remaining_polygons(modifier_polygon_idx); - return result->first; + // Lengths are compared exactly: for a symmetric modifier the chosen face may alternate between + // layers, which is accepted (the user gets the multiple-intersections warning). + StrongSeamTarget target{Point(0, 0), 0}; + double longest = -1.; + for (const PerimeterSegment &segment : extracted.segments) { + assert(segment.strong_target.has_value()); + const StrongSeamTarget &candidate = *segment.strong_target; + // Slice coordinates already include object rotation and retain bed axes. + // Centering/instance translation cannot change rear (+Y), then left (-X) ordering. + const bool farther_or_left = candidate.point.y() > target.point.y() || + (candidate.point.y() == target.point.y() && candidate.point.x() < target.point.x()); + if (segment.length > longest || (segment.length == longest && farther_or_left)) { + longest = segment.length; + target = candidate; } } + const auto [seam_point, seam_index] = insert_point_into_perimeter(target.point, target.edge_index, polygon); + // Preserve the insertion order: refining before first would shift the seam index. + refine_at_vertex(seam_index, +1, polygon); + refine_at_vertex(seam_index, -1, polygon); + return seam_point; // No later strong modifier or weak processing for this perimeter. } - - // No matching segment found or insertion failed return std::nullopt; } // Convert ModelVolumeType of weak modifier to EnforcedBlockedSeamPoint. -// Precondition: called only with weak precise-seam types (filtered via is_precise_seam_weak()). +// Precondition: a weak precise-seam type; init_precise_seam_data() puts only those in the weak list. // Exhaustive switch (no default) so -Wswitch flags any future PRECISE_SEAM_* additions. static EnforcedBlockedSeamPoint convert_weak_modifier_type(ModelVolumeType type) { + assert(is_precise_seam_weak(type)); switch (type) { case ModelVolumeType::PRECISE_SEAM_ENFORCED: return EnforcedBlockedSeamPoint::Enforced; @@ -982,223 +779,57 @@ static EnforcedBlockedSeamPoint convert_weak_modifier_type(ModelVolumeType type) return EnforcedBlockedSeamPoint::Neutral; } -// Collect all weak modifier segments for given perimeter -// Process weak modifiers (ENFORCED/BLOCKED/NEUTRAL) and collect segment boundaries -// Also insert boundary points into perimeter polygon (sorted by descending arc length) -// Split enforced edges into small segments (≤ enforcer_oversampling_distance) for precise seam placement -// Return ordered vector of segments with updated coordinates (in same order as weak_volumes list) -std::vector collect_weak_modifier_segments( - const std::vector &weak_volumes, - Polygon &polygon, - const Layer *layer, - const ModifierSlicesCache &slices_cache, - PreciseSeamWarnings* warnings) +// Consume ready boundaries in modifier priority order; geometry extraction is separate. +static std::vector prepare_weak_modifier_segments( + std::vector result, Polygon &polygon) { - std::vector result; - - // Check input parameters - if (weak_volumes.empty() || layer == nullptr) { - return result; // Empty vector - } - - // layer->id() is offset by raft layer count, but modifier_slices is 0-based - // (built from PrintObject::layers() via slice_single_volume). Subtract raft - // offset to get the correct index into the cache. - const size_t raft_layers = layer->object()->slicing_parameters().raft_layers(); - size_t layer_id = layer->id() - raft_layers; - - // The perimeter is not modified until all weak segments have been collected. - const BoundingBox perimeter_bbox(polygon.points); - - // Iterate through all weak modifiers in hierarchy order - for (const ModelVolume* modifier_volume : weak_volumes) { - // Look up pre-sliced polygons from cache (sliced once in SeamPlacer::init). - // TODO: slice_single_volume() converts ExPolygons to flat Polygons, losing - // the association between outer contours and their holes. This makes correct - // handling of multiply-connected modifier regions (e.g. a torus cross-section) - // impossible. Consider a variant returning std::vector and adapting - // the algorithm to work with multiply-connected domains. - auto it = slices_cache.find(modifier_volume); - if (it == slices_cache.end()) - continue; // modifier not in cache (should not happen) - const std::vector &modifier_slices = it->second; - - // Check if slices exist for given layer - if (layer_id >= modifier_slices.size()) { - continue; // No slices for this layer - } - - const Polygons &modifier_polygons = modifier_slices[layer_id]; - - // Check for multiply-connected regions (holes = CW polygons). - // slice_single_volume() flattens ExPolygons into Polygons, but preserves - // orientation: CCW = outer contour, CW = hole. If any CW polygon is present, - // the modifier is multiply-connected and cannot be processed correctly. - bool has_holes = std::any_of(modifier_polygons.begin(), modifier_polygons.end(), - [](const Polygon &p) { return p.is_clockwise(); }); - if (has_holes) { - if (warnings) - warnings->multiply_connected.store(true, std::memory_order_relaxed); - continue; - } - - // Iterate through all modifier polygons on this layer - for (const Polygon &modifier_polygon : modifier_polygons) { - // Preserve touching and contained pairs for the existing clipping and warning logic. - if (!perimeter_bbox.overlap(BoundingBox(modifier_polygon.points))) - continue; - // Find intersection with perimeter - Polygons intersection_polygons = intersection(Polygons{polygon}, Polygons{modifier_polygon}); - - // Note: intersection_polygons.size() > 1 is NOT flagged as a warning here. - // For weak modifiers, multiple intersection polygons are expected (the modifier - // may legitimately cross the perimeter in several places). - // Only through-body intersections (detected by diff below) are abnormal. - - // Diff check: if modifier minus perimeter yields >1 polygon, the modifier - // passes through the model body, creating a through-body intersection. - // CW polygon in diff = hole from full containment, not through-body. - // Full containment is detected separately in common_segment_in_intersection(). - if (warnings && !warnings->through_body.load(std::memory_order_relaxed)) { - Polygons diff_polygons = diff(Polygons{modifier_polygon}, Polygons{polygon}); - if (diff_polygons.size() > 1) { - bool has_cw = std::any_of(diff_polygons.begin(), diff_polygons.end(), - [](const Polygon &p) { return p.is_clockwise(); }); - if (!has_cw) - warnings->through_body.store(true, std::memory_order_relaxed); - } - } - - // Process each intersection polygon - for (Polygon &intersection_polygon : intersection_polygons) { - // Convert intersection_polygon to CCW to guarantee same traversal direction as perimeter - intersection_polygon.make_counter_clockwise(); - - // Search for perimeter segment in this intersection - std::optional segment = common_segment_in_intersection_fast( - intersection_polygon, - polygon, - warnings - ); - - if (!segment.has_value()) { - continue; // Segment not found - } - - // Get left (first) point of segment - std::optional> left = segment_left(segment.value()); - - // Get right (last) point of segment - std::optional> right = segment_right(segment.value()); - - // If both boundaries found, add segment to result - if (left.has_value() && right.has_value()) { - result.push_back({ - convert_weak_modifier_type(modifier_volume->type()), // Type: Enforced/Blocked/Neutral - left->first, // Left point coordinates - left->second, // Perimeter vertex index for left point - right->first, // Right point coordinates - right->second // Perimeter vertex index for right point - }); - } - } - } - } - // If no segments, return empty vector if (result.empty()) { return result; } - // Insert boundary points into perimeter polygon - // Sort points by descending arc length to avoid breaking indexing - - // 1. Parameterize polygon: calculate cumulative lengths for each vertex - std::vector cumulative_lengths(polygon.points.size() + 1); - cumulative_lengths[0] = 0.0; - for (size_t i = 0; i < polygon.points.size(); ++i) { - size_t next_i = (i + 1) % polygon.points.size(); - double edge_length = (polygon.points[next_i] - polygon.points[i]).cast().norm(); - cumulative_lengths[i + 1] = cumulative_lengths[i] + edge_length; - } - - // 2. Create helper vector for sorting: {segment index, left/right point, arc length} + // Source positions have the same order as arc length, without measuring the perimeter. struct PointToInsert { - size_t segment_idx; // Index in result - bool is_left; // true = left point, false = right point - double arc_length; // Arc length from perimeter start + size_t segment_idx; + bool is_left; + PerimeterPosition position; }; std::vector points_to_insert; points_to_insert.reserve(result.size() * 2); - for (size_t seg_idx = 0; seg_idx < result.size(); ++seg_idx) { const WeakModifierSegment &seg = result[seg_idx]; - - // Left point - double left_base = cumulative_lengths[seg.left_idx]; - double left_offset = (seg.left_point - polygon.points[seg.left_idx]).cast().norm(); - points_to_insert.push_back({seg_idx, true, left_base + left_offset}); - - // Right point - double right_base = cumulative_lengths[seg.right_idx]; - double right_offset = (seg.right_point - polygon.points[seg.right_idx]).cast().norm(); - points_to_insert.push_back({seg_idx, false, right_base + right_offset}); + // A whole-perimeter zone has no boundaries to insert. + if (seg.whole_perimeter) + continue; + points_to_insert.push_back({seg_idx, true, seg.left_position}); + points_to_insert.push_back({seg_idx, false, seg.right_position}); } - // 3. Sort by descending arc length (insert distant points first) + // Descending order preserves pending source indices; vertex zero is canonical (0, 0). + // Only insertion events are reordered: modifier priority in result remains unchanged. std::sort(points_to_insert.begin(), points_to_insert.end(), [](const PointToInsert &a, const PointToInsert &b) { - return a.arc_length > b.arc_length; + if (a.position.edge_index != b.position.edge_index) + return a.position.edge_index > b.position.edge_index; + return a.position.parameter > b.position.parameter; }); - // 4. Insert points in descending arc length order - std::vector segment_valid(result.size(), true); - bool any_insertion_failed = false; - for (const PointToInsert &pt : points_to_insert) { WeakModifierSegment &seg = result[pt.segment_idx]; Point &point_coords = pt.is_left ? seg.left_point : seg.right_point; - size_t edge_idx = pt.is_left ? seg.left_idx : seg.right_idx; - - // Insert point with tolerance check - std::optional> insert_result = - insert_point_into_perimeter(point_coords, edge_idx, polygon); - - if (insert_result.has_value()) { - // Update coordinates in result (if point coincided with existing vertex, take its coordinates) - point_coords = insert_result->first; - } else { - // Failed to insert point - segment becomes invalid - segment_valid[pt.segment_idx] = false; - any_insertion_failed = true; - } + // Take the final coordinates: a boundary close to an existing vertex snaps to it. + point_coords = insert_point_into_perimeter(point_coords, pt.position.edge_index, polygon).first; } - // 5. Remove segments whose boundaries could not be inserted - if (any_insertion_failed) { - // Critical error: boundary point not inserted (shouldn't happen in normal conditions) - BOOST_LOG_TRIVIAL(error) << "PreciseSeam: boundary point insertion failed, performing segment compaction"; - - // Remove invalid segments (array compaction) - size_t write_pos = 0; - for (size_t read_pos = 0; read_pos < result.size(); ++read_pos) { - if (segment_valid[read_pos]) { - if (write_pos != read_pos) { - result[write_pos] = std::move(result[read_pos]); - } - ++write_pos; - } - } - result.resize(write_pos); - } - - // 6. Group coincident boundaries by their snapped vertex, including wraparound to vertex 0. - // Scan original vertices backwards so insertions cannot shift pending vertex indices. - // O(vertices * segments), matching the boundary lookup below; typically only a few segments. + // Add helpers at boundary vertices, scanning original vertices backwards so insertions do not shift + // pending indices. for (size_t poly_idx = polygon.size(); poly_idx-- > 0; ) { bool refine_before = false; bool refine_after = false; for (const WeakModifierSegment &segment : result) { + // Its placeholder points must not match a real vertex. + if (segment.whole_perimeter) + continue; refine_before |= polygon[poly_idx] == segment.left_point; refine_after |= polygon[poly_idx] == segment.right_point; } @@ -1209,39 +840,45 @@ std::vector collect_weak_modifier_segments( refine_at_vertex(poly_idx, -1, polygon); } - // 7. Split edges in enforced zones into segments ≤ enforcer_oversampling_distance + // Split edges in enforced zones into segments ≤ enforcer_oversampling_distance // Determine type pattern for each polygon edge (sequential application of hierarchy) std::vector edge_types(polygon.size(), EnforcedBlockedSeamPoint::Neutral); - // Helper lambda: search for point index in modified polygon by coordinates. - // Linear scan is intentional — O(N×M) is acceptable for typical M ≤ 5 weak segments. - auto find_point_index = [&](const Point &pt) -> std::optional { - for (size_t i = 0; i < polygon.size(); ++i) { - if (polygon[i] == pt) return i; - } - return std::nullopt; + // Every boundary was inserted or snapped above and later steps only add vertices, so it is found. + // A linear scan is fine: there are only a few zones per perimeter. + auto find_point_index = [&](const Point &pt) -> size_t { + const auto it = std::find(polygon.points.begin(), polygon.points.end(), pt); + assert(it != polygon.points.end()); + return size_t(it - polygon.points.begin()); }; - // Apply types sequentially: segments are sorted low-priority-first - // (bottom of object tree first), so higher-priority modifiers overwrite - // lower-priority ones via last-write-wins. + // Last write wins: zones are sorted lowest priority first. for (const auto &segment : result) { - // Find boundary point indices in modified polygon - std::optional left_idx = find_point_index(segment.left_point); - std::optional right_idx = find_point_index(segment.right_point); - - if (!left_idx.has_value() || !right_idx.has_value()) { - BOOST_LOG_TRIVIAL(error) << "PreciseSeam: boundary point not found in modified polygon, skipping segment"; + // A whole-perimeter zone types every edge, so Enforced subdivides the whole perimeter, as + // painting it green all round would. + if (segment.whole_perimeter) { + std::fill(edge_types.begin(), edge_types.end(), segment.type); + continue; + } + const size_t left_idx = find_point_index(segment.left_point); + const size_t right_idx = find_point_index(segment.right_point); + // Practically unreachable, but a miss would write past edge_types in Release builds: skip the zone. + if (left_idx == polygon.size() || right_idx == polygon.size()) { + BOOST_LOG_TRIVIAL(error) << "PreciseSeam: weak boundary not found in perimeter, skipping zone"; continue; } - // Set type for edges [left_idx, right_idx] - for (size_t idx = left_idx.value(); ; idx = (idx + 1) % polygon.size()) { + // A zone covers edges [left_idx, right_idx): the edge from the right boundary is outside and must + // not be subdivided. Edge types only drive subdivision; candidates are typed per point later. + for (size_t idx = left_idx; idx != right_idx; idx = (idx + 1) % polygon.size()) edge_types[idx] = segment.type; - if (idx == right_idx.value()) break; - } } + // Boundaries and helpers are already in place; without enforced edges nothing is subdivided, + // so skip rebuilding the polygon. + if (std::find(edge_types.begin(), edge_types.end(), EnforcedBlockedSeamPoint::Enforced) == edge_types.end()) + return result; + // Split enforced edges into small segments const double STEP_SCALED = scale_(SeamPlacer::enforcer_oversampling_distance); @@ -1291,9 +928,53 @@ std::vector collect_weak_modifier_segments( return result; } -// Apply weak modifier types to perimeter points based on segment boundaries. -// Find boundary points in refined polygon by coordinates and set types -// for all points inside each segment. +// Collect every modifier's ready segments before insertions can shift source edge indices. +std::vector collect_weak_modifier_segments( + const std::vector &weak_volumes, + Polygon &polygon, + const PreparedPerimeter &prepared, + const Layer *layer, + const ModifierRegionsCache &slices_cache, + PreciseSeamWarnings* warnings) +{ + assert(&prepared.polygon == &polygon); + std::vector result; + if (weak_volumes.empty() || layer == nullptr || !prepared.valid) + return result; + + // Modifier cache indices exclude raft layers, unlike Layer::id(). + const size_t raft_layers = layer->object()->slicing_parameters().raft_layers(); + const size_t layer_id = layer->id() - raft_layers; + for (const ModelVolume *modifier_volume : weak_volumes) { + const auto it = slices_cache.find(modifier_volume); + if (it == slices_cache.end() || layer_id >= it->second.size()) + continue; + const ExtractionContext context{layer, modifier_volume, warnings}; + const SegmentExtraction extracted = extract_perimeter_segments(prepared, it->second[layer_id], modifier_volume->type(), context); + record_extraction(warnings, modifier_volume, extracted); + const auto type = convert_weak_modifier_type(modifier_volume->type()); + // Full containment works like seam painting: Enforced and Neutral type the whole perimeter; + // Blocked is skipped with a warning, since the seam cannot avoid the whole perimeter. + if (extracted.full_containment) { + if (type == EnforcedBlockedSeamPoint::Blocked) { + if (warnings) + PreciseSeamWarnings::mark(warnings->full_containment, modifier_volume->type()); + continue; + } + WeakModifierSegment whole{type, Point(), PerimeterPosition{0, 0.}, Point(), PerimeterPosition{0, 0.}}; + whole.whole_perimeter = true; + result.push_back(whole); + continue; + } + for (const PerimeterSegment &segment : extracted.segments) { + result.push_back({type, segment.polyline.points.front(), segment.begin, + segment.polyline.points.back(), segment.end}); + } + } + // Boundary insertion, refinement and last-write-wins priority use the established path. + return prepare_weak_modifier_segments(std::move(result), polygon); +} + void apply_weak_modifiers_to_perimeter( const std::vector &weak_segments, PrintObjectSeamData::LayerSeams &result, @@ -1320,6 +1001,15 @@ void apply_weak_modifiers_to_perimeter( for (size_t seg_idx = 0; seg_idx < weak_segments.size(); ++seg_idx) { const auto &segment = weak_segments[seg_idx]; + // A whole-perimeter zone types every candidate, including painting's oversampled points. + if (segment.whole_perimeter) { + for (size_t i = perimeter.start_index; i < perimeter.end_index; ++i) + result.points[i].type = segment.type; + if (segment.type == EnforcedBlockedSeamPoint::Enforced) + some_point_enforced = true; + continue; + } + // Find boundary point indices in result.points std::optional left_idx = find_point_index(segment.left_point); std::optional right_idx = find_point_index(segment.right_point); diff --git a/src/libslic3r/GCode/PreciseSeam.hpp b/src/libslic3r/GCode/PreciseSeam.hpp index f4f75c37bf..bbb4d98532 100644 --- a/src/libslic3r/GCode/PreciseSeam.hpp +++ b/src/libslic3r/GCode/PreciseSeam.hpp @@ -2,47 +2,22 @@ #define slic3r_PreciseSeam_hpp_ #include +#include #include #include #include #include +#include +#include "libslic3r/BoundingBox.hpp" +#include "libslic3r/ExPolygon.hpp" #include "libslic3r/Point.hpp" #include "libslic3r/Polygon.hpp" #include "libslic3r/Polyline.hpp" #include "libslic3r/Model.hpp" -#include "libslic3r/Layer.hpp" -#include "libslic3r/Print.hpp" -#include "libslic3r/ClipperUtils.hpp" #include "SeamPlacer.hpp" -// CURRENT STATUS: -// Strong modifiers (Center/Left/Right): only one intersection per perimeter is supported, -// since there can be only one seam. Additional intersections are ignored. -// -// Weak modifiers (Enforced/Blocked/Neutral): multiple intersections are supported, -// but none of them should pass through the model entirely. A through-body intersection -// produces multiple segments, of which only one will be processed. -// -// In both cases, a pop-up warning is shown when unsupported intersections are detected. -// -// If any modifier has a multiply-connected cross-section (e.g. a hollow shape), -// it is skipped and a corresponding notification is shown. -// -// Full containment of the perimeter within modifier is not handled. -// -// FUTURE DIRECTION: -// A lightweight algorithm is needed to detect and handle through-body intersections -// for Weak modifiers. The algorithm must not slow down the 99.9% common case. -// Possible approach: if intersection passes the diff check (no through-body), -// use the current fast algorithm. If diff check fails, fall back to a heavier -// method: compute midpoints of intersection polygon edges, then check which -// midpoints lie strictly inside the modifier (not on boundary) using -// point_in_polygon. Those edges originate from the perimeter; the rest -// originate from the modifier boundary. Collect perimeter edges into a polyline. -// Additionally, multiply-connected cross-sections could be supported instead of -// being skipped entirely (e.g. by decomposing them into simple polygons). -// For Enforced and Neutral weak modifiers, full containment of the perimeter -// within modifier could be handled (currently ignored). +// Precise Seam: helper volumes that decide where the seam goes on external perimeters. +// Design: docs/HLSD/precise-seam.md namespace Slic3r { namespace PreciseSeam { @@ -50,88 +25,158 @@ namespace PreciseSeam { // Import EnforcedBlockedSeamPoint from SeamPlacerImpl namespace for convenience using SeamPlacerImpl::EnforcedBlockedSeamPoint; -// Pre-sliced modifier cache: ModelVolume pointer → per-layer Polygons. -// Built once in SeamPlacer::init(), then passed read-only into per-perimeter functions. -using ModifierSlicesCache = std::unordered_map>; +// Geometry and its exterior bounds are prepared together, then treated as read-only. +struct ModifierRegion { + ExPolygon polygon; + BoundingBox bounds; -// Warning flags set during Precise Seam processing (thread-safe) + explicit ModifierRegion(ExPolygon region) + : polygon(std::move(region)), bounds(polygon.contour.points) {} +}; + +using ModifierRegions = std::vector; +using ModifierSlices = std::vector; +// Per-volume slices with cached bounds, shared read-only by both modifier kinds. +using ModifierRegionsCache = std::unordered_map; + +// Move sliced geometry into the cache without detaching holes or changing layer indices. +ModifierRegions prepare_modifier_regions(ExPolygons regions); +ModifierSlices prepare_modifier_slices(std::vector slices); + +// Bound diagnostic volume only; every failed or recovered fragment is still counted and handled. +// The same limit applies separately to failure and recovery markers. +inline constexpr size_t failed_fragment_log_limit = 10; + +// Shared by all layers and objects in one SeamPlacer::init(); a new pass starts fresh. struct PreciseSeamWarnings { - std::atomic multiple_intersections{false}; // modifier intersects perimeter in multiple separate places (strong only) - std::atomic through_body{false}; // modifier passes through the model body entirely - std::atomic multiply_connected{false}; // modifier has holes (multiply-connected cross-section) - std::atomic full_containment{false}; // modifier fully contains perimeter, no intersection edges + // Masks of the Precise Seam types that caused each warning reason, one bit per type (type_bit()). + // The user warning lists the types instead of naming modifiers. + std::atomic multiple_intersections{0}; // Center/Left/Right with several segments on a perimeter. + std::atomic full_containment{0}; // Skipped for a perimeter fully inside: Center/Left/Right, Blocked. + std::atomic failed_types{0}; // Types with at least one discarded fragment. + std::atomic failed_fragments{0}; // Total discarded fragments, for the log summary. + // Fragments saved by the rare-case fallback or accepted as contacts; log only, no user warning. + // Clipper is deterministic, so a prismatic model can repeat the same case on every layer. + std::atomic recovered_fragments{0}; + + // Per-modifier flags for the "had no effect" warning. Modifiers are registered before the parallel + // phase, so workers only set flags; unregistered ones (e.g. in tests) are not tracked. + struct ModifierUsage { + std::atomic checked{false}; // Extracted on at least one perimeter. + std::atomic reached{false}; // Gave a segment, full containment or a discarded fragment. + }; + std::unordered_map modifier_usage; + + // Bit of a Precise Seam type in the masks above, in menu order (Center is bit 0). + static unsigned type_bit(ModelVolumeType type) + { + assert(is_precise_seam(type)); + return 1u << (int(type) - int(ModelVolumeType::PRECISE_SEAM_CENTER)); + } + // Load before fetch_or: most calls find the bit already set, so shared cache lines stay clean. + static void mark(std::atomic &mask, ModelVolumeType type) + { + const unsigned bit = type_bit(type); + if ((mask.load(std::memory_order_relaxed) & bit) == 0) + mask.fetch_or(bit, std::memory_order_relaxed); + } }; -// Result of finding common segment between perimeter and intersection -struct SegmentData { - Polyline segment; // Points from intersection_polygon forming the segment - std::vector perimeter_edge_indices; // edge_index for each point in segment +// Optional caller identity for concise diagnostics when an intersection is discarded. +struct ExtractionContext { + const Layer *layer = nullptr; + const ModelVolume *modifier = nullptr; + PreciseSeamWarnings *warnings = nullptr; }; +// Borrows the source polygon; use only until insertion/refinement changes that polygon. +struct PreparedPerimeter { + const Polygon &polygon; + BoundingBox bounds; + Polyline line; + bool valid = false; + + explicit PreparedPerimeter(const Polygon &perimeter); +}; + +// A vertex is represented by its outgoing edge and parameter zero, including vertex 0. +struct PerimeterPosition { + size_t edge_index; + double parameter; +}; + +// Prepared against the immutable perimeter, before insertion shifts its edge indices. +struct StrongSeamTarget { + Point point; + size_t edge_index; +}; + +struct PerimeterSegment { + Polyline polyline; + // One bound source edge per polyline interval. + std::vector edge_indices; + PerimeterPosition begin; + PerimeterPosition end; + std::optional strong_target; // Absent for weak modifiers and full containment. + // Scaled arc length, calculated only for Center or comparison of multiple strong segments. + double length = 0.; // Zero means unmeasured for weak, full containment, and a single Left/Right segment. +}; + +struct SegmentExtraction { + std::vector segments; + bool full_containment = false; + bool valid = true; // Invalid perimeter input; discarded fragments do not invalidate other segments. + // Clipped fragments whose binding failed; one segment may consist of several fragments. + size_t discarded_fragments = 0; // Failed bindings are ignored, with a warning and diagnostic marker. +}; + +// Clips a prepared, unchanged perimeter (>= 3 vertices, no consecutive duplicates, either direction) +// against a modifier's regions and returns its segments; strong targets are prepared only where needed. +SegmentExtraction extract_perimeter_segments(const PreparedPerimeter &prepared, const ModifierRegions &modifier, + ModelVolumeType mode, const ExtractionContext &context = {}); + // Result of weak modifier segment processing struct WeakModifierSegment { EnforcedBlockedSeamPoint type; // Enforced/Blocked/Neutral Point left_point; // Coordinates of left (first) point of segment - size_t left_idx; // Perimeter vertex index for left_point + PerimeterPosition left_position; // Position on the source perimeter before insertion/refinement. Point right_point; // Coordinates of right (last) point of segment - size_t right_idx; // Perimeter vertex index for right_point + PerimeterPosition right_position; // Retained provenance, not an index into the modified polygon. + // Full containment of an Enforced or Neutral modifier: the zone is the whole perimeter, without + // boundaries (the points and positions above are unused and nothing is inserted for it). + bool whole_perimeter = false; }; -// Initialize Precise Seam data by populating provided vectors and flag -// Collects precise seam modifiers and fills output parameters -// Call once during SeamPlacer::init() before gather_seam_candidates() -// Parameters: -// strong_volumes_out - output vector for strong modifiers (CENTER/LEFT/RIGHT) -// weak_volumes_out - output vector for weak modifiers (ENFORCED/BLOCKED/NEUTRAL) -// has_strong_out - output flag indicating presence of strong modifiers -// model_object - model object containing volumes +// Collects the object's Precise Seam volumes: strong ones in priority order, weak ones in application +// order. Call once per object in SeamPlacer::init() before gathering candidates. void init_precise_seam_data( std::vector& strong_volumes_out, std::vector& weak_volumes_out, bool& has_strong_out, const ModelObject* model_object); -// Insert strong seam point into perimeter polygon -// Processes strong modifiers (CENTER/LEFT/RIGHT) and inserts seam point into polygon -// Parameters: -// strong_volumes - list of strong precise seam modifiers -// polygon - perimeter polygon (will be modified if point inserted) -// layer - current layer -// slices_cache - pre-sliced modifier polygons (built once in SeamPlacer::init) -// Returns: -// Coordinates of inserted point (internal units) or std::nullopt if nothing inserted +// Inserts the seam point of the first strong modifier with a usable segment on this perimeter and returns +// it, or nullopt. `prepared` must describe `polygon` before any change. std::optional insert_strong_seam_point( const std::vector &strong_volumes, Polygon &polygon, + const PreparedPerimeter &prepared, const Layer *layer, - const ModifierSlicesCache &slices_cache, + const ModifierRegionsCache &slices_cache, PreciseSeamWarnings* warnings = nullptr); -// Collect all weak modifier segments for a perimeter polygon -// Processes weak modifiers (ENFORCED/BLOCKED/NEUTRAL) and collects segment boundaries -// Also inserts boundary points into the perimeter polygon (sorted by descending arc length) -// Refines enforced edges by subdividing them into segments ≤ enforcer_oversampling_distance -// Parameters: -// weak_volumes - list of weak precise seam modifiers -// polygon - perimeter polygon (will be modified with inserted points and refined edges) -// layer - current layer -// slices_cache - pre-sliced modifier polygons (built once in SeamPlacer::init) -// Returns: -// Ordered vector of segments with updated coordinates (same order as weak_volumes list) +// Collects weak zones, inserts their boundaries into `polygon` and subdivides enforced edges. Pass +// modifiers lowest priority first; `prepared` must describe the unchanged `polygon`. std::vector collect_weak_modifier_segments( const std::vector &weak_volumes, Polygon &polygon, + const PreparedPerimeter &prepared, const Layer *layer, - const ModifierSlicesCache &slices_cache, + const ModifierRegionsCache &slices_cache, PreciseSeamWarnings* warnings = nullptr); -// Apply weak modifier types to perimeter points based on segment boundaries -// Finds boundary points in refined polygon and sets types for points within segments -// Parameters: -// weak_segments - segments with boundary coordinates and types -// result - layer seams data to modify -// perimeter - perimeter info (start/end indices) -// some_point_enforced - flag to update if Enforced points are set +// Retypes the candidates inside each zone in the given order (pass zones lowest priority first); +// sets some_point_enforced when an Enforced zone applies. void apply_weak_modifiers_to_perimeter( const std::vector &weak_segments, PrintObjectSeamData::LayerSeams &result, diff --git a/src/libslic3r/GCode/PreciseSeamInternal.hpp b/src/libslic3r/GCode/PreciseSeamInternal.hpp new file mode 100644 index 0000000000..bfd230ba3d --- /dev/null +++ b/src/libslic3r/GCode/PreciseSeamInternal.hpp @@ -0,0 +1,42 @@ +#pragma once + +#include "PreciseSeam.hpp" +#include "libslic3r/Point.hpp" +#include "libslic3r/Polygon.hpp" +#include "libslic3r/Polyline.hpp" +#include +#include + +namespace Slic3r::PreciseSeam::detail { + +// Binding intermediates retain source edge identity until segment assembly. +struct ClippedEdgeInterval { + size_t edge; + double begin; + double end; + Point first; + Point last; +}; + +struct FragmentBindingFailure { + size_t pair_index = 0; + const char *reason = "empty fragment"; +}; + +// Failure rolls back this fragment only; earlier bindings remain intact. +bool append_projected_fragment(const Polyline &fragment, const Polygon &perimeter, + std::vector &intervals, + FragmentBindingFailure &failure); + +// Exact path, then projection path, without the fallback; intervals are unchanged on failure. +// Exposed so tests can show that a fragment needs the fallback in append_fragment(). +bool bind_fragment(const Polyline &fragment, const Polygon &perimeter, + std::vector &intervals, FragmentBindingFailure &failure); + +// Binds one fragment. After a failure it tries the rare-case repair and the contact rule, both logged +// as recoveries. Returns false when the fragment is discarded. +bool append_fragment(const Polyline &fragment, const Polygon &perimeter, + std::vector &intervals, + const ExtractionContext &context, size_t fragment_index); + +} // namespace Slic3r::PreciseSeam::detail diff --git a/src/libslic3r/GCode/SeamPlacer.cpp b/src/libslic3r/GCode/SeamPlacer.cpp index 720339f746..07e1cc8882 100644 --- a/src/libslic3r/GCode/SeamPlacer.cpp +++ b/src/libslic3r/GCode/SeamPlacer.cpp @@ -17,6 +17,7 @@ #include "tbb/parallel_reduce.h" #include #include +#include #include #include #include @@ -334,10 +335,8 @@ struct GlobalModelInfo { // Precise Seam modifiers: weak modifiers (ENFORCED/BLOCKED/NEUTRAL) provide hints for seam placement std::vector precise_seam_weak_volumes; - // Pre-sliced modifier polygons, keyed by ModelVolume pointer. - // Populated once in SeamPlacer::init() to avoid re-slicing on every perimeter. - // Each value is a per-layer vector of Polygons for that modifier volume. - std::unordered_map> precise_seam_slices; + // Slice each modifier once; both consumers share structured regions and source provenance. + PreciseSeam::ModifierRegionsCache precise_seam_slices; bool is_enforced(const Vec3f &position, float radius) const { if (enforcers.empty()) { @@ -518,22 +517,26 @@ void process_perimeter_polygon(const Polygon &orig_polygon, float z_coord, const const auto& strong_volumes = global_model_info.precise_seam_strong_volumes; const auto& weak_volumes = global_model_info.precise_seam_weak_volumes; - // Use pre-sliced cache from global_model_info instead of re-slicing on every call - auto seam_point = PreciseSeam::insert_strong_seam_point(strong_volumes, polygon, layer, global_model_info.precise_seam_slices, warnings); + std::optional seam_point; + std::vector weak_segments; + if (layer != nullptr && (!strong_volumes.empty() || !weak_volumes.empty())) { + // Share validation, bounds and clipping line across all modifiers while the polygon is unchanged. + // A strong insertion ends processing; otherwise weak reads the same preparation before inserting. + const PreciseSeam::PreparedPerimeter prepared(polygon); + seam_point = PreciseSeam::insert_strong_seam_point( + strong_volumes, polygon, prepared, layer, global_model_info.precise_seam_slices, warnings); + if (!seam_point.has_value()) + weak_segments = PreciseSeam::collect_weak_modifier_segments( + weak_volumes, polygon, prepared, layer, global_model_info.precise_seam_slices, warnings); + } - // Store the inserted point position for marking as central_enforcer later + // Store the inserted point position for marking as central_enforcer later. std::optional inserted_seam_position; if (seam_point.has_value()) { Vec2f unscaled_p = unscale(seam_point.value()).cast(); inserted_seam_position = Vec3f(unscaled_p.x(), unscaled_p.y(), z_coord); } - // Process weak modifiers (ENFORCED/BLOCKED/NEUTRAL) only if no strong modifier was inserted - std::vector weak_segments; - if (!inserted_seam_position.has_value()) { - weak_segments = PreciseSeam::collect_weak_modifier_segments(weak_volumes, polygon, layer, global_model_info.precise_seam_slices, warnings); - } - float angle_arm_len = region != nullptr ? region->flow(FlowRole::frExternalPerimeter).nozzle_diameter() : 0.5f; std::vector lengths { }; @@ -627,7 +630,8 @@ void process_perimeter_polygon(const Polygon &orig_polygon, float z_coord, const patches_starts_ends.push_back(next_index(i)); } } - //if patches_starts_ends are empty, it means that the whole perimeter is enforced.. don't do anything in that case + // If patches_starts_ends are empty, the whole perimeter is enforced, or no point is enforced any more + // (Precise Seam weak zones retyped every painted enforcer); don't do anything in either case. if (!patches_starts_ends.empty()) { //if the first point in the patches is not enforced, it marks a patch end. in that case, put it to the end and start on next // to simplify the processing @@ -795,6 +799,12 @@ void gather_enforcers_blockers(GlobalModelInfo &result, const PrintObject *po) { auto obj_transform = po->trafo_centered(); for (const ModelVolume *mv : po->model_object()->volumes) { + // Collect painting only from model parts (what the gizmo edits) and negative volumes (the only way + // to paint a hole's wall); painting left on modifiers and helpers after a type change is ignored. + // TODO: painting on negative volumes still affects the seam, but the gizmo neither shows nor edits it; + // making it editable also needs model_custom_seam_data_changed() to track it. + if (!mv->is_model_part() && !mv->is_negative_volume()) + continue; if (mv->is_seam_painted()) { auto model_transformation = obj_transform * mv->get_matrix(); @@ -1508,9 +1518,10 @@ void SeamPlacer::align_seam_points(const PrintObject *po, const SeamPlacerImpl:: } -void SeamPlacer::init(Print &print, std::function throw_if_canceled_func) { +void SeamPlacer::init(const Print &print, std::function throw_if_canceled_func) { using namespace SeamPlacerImpl; m_seam_per_object.clear(); + m_precise_seam_warning.clear(); // Warning flags for Precise Seam processing — shared across all objects PreciseSeam::PreciseSeamWarnings precise_seam_warnings; @@ -1529,13 +1540,17 @@ void SeamPlacer::init(Print &print, std::function throw_if_canceled_ m_seam_per_object[po].has_precise_seam_strong_volumes, po->model_object()); - // Pre-slice all precise seam modifier volumes once per object. - // Without this cache, slice_single_volume() would be called for every - // modifier × every perimeter × every layer — thousands of redundant slicing operations. + // Slice each Precise Seam modifier once per object; both consumers read the cache. for (const ModelVolume* vol : global_model_info.precise_seam_strong_volumes) - global_model_info.precise_seam_slices[vol] = po->slice_single_volume(vol); + global_model_info.precise_seam_slices[vol] = PreciseSeam::prepare_modifier_slices(po->slice_single_volume_regions(vol)); for (const ModelVolume* vol : global_model_info.precise_seam_weak_volumes) - global_model_info.precise_seam_slices[vol] = po->slice_single_volume(vol); + global_model_info.precise_seam_slices[vol] = PreciseSeam::prepare_modifier_slices(po->slice_single_volume_regions(vol)); + // Register usage tracking before the parallel phase; workers only set its flags. Several print + // objects of one model object share volumes, and try_emplace keeps what earlier ones recorded. + for (const ModelVolume* vol : global_model_info.precise_seam_strong_volumes) + precise_seam_warnings.modifier_usage.try_emplace(vol); + for (const ModelVolume* vol : global_model_info.precise_seam_weak_volumes) + precise_seam_warnings.modifier_usage.try_emplace(vol); throw_if_canceled_func(); if (configured_seam_preference == spAligned || configured_seam_preference == spNearest || configured_seam_preference == spAlignedBack) { @@ -1603,24 +1618,74 @@ void SeamPlacer::init(Print &print, std::function throw_if_canceled_ #endif } - // Show Precise Seam warnings (once for all objects). - // Only ONE active_step_add_warning() call — multiple calls generate multiple UI events, - // each re-pushing ALL current warnings via Plater handler, causing NotificationManager::append() - // to duplicate text within each popup. + // Prepare one combined Precise Seam warning; G-code export issues it. Keep it single: separate + // warnings would each re-push all warnings and duplicate text in the notification. { - const bool mi = precise_seam_warnings.multiple_intersections.load(std::memory_order_relaxed); - const bool tb = precise_seam_warnings.through_body.load(std::memory_order_relaxed); - const bool mc = precise_seam_warnings.multiply_connected.load(std::memory_order_relaxed); - const bool fc = precise_seam_warnings.full_containment.load(std::memory_order_relaxed); + const unsigned failed_types = precise_seam_warnings.failed_types.load(std::memory_order_relaxed); + const unsigned mi = precise_seam_warnings.multiple_intersections.load(std::memory_order_relaxed); + const unsigned fc = precise_seam_warnings.full_containment.load(std::memory_order_relaxed); + const size_t failed = precise_seam_warnings.failed_fragments.load(std::memory_order_relaxed); + // All workers have finished; cancellation before this point may omit the summary. + if (failed > PreciseSeam::failed_fragment_log_limit) + BOOST_LOG_TRIVIAL(warning) << "[PreciseSeamIntersectionFailed] " << failed + << " fragments discarded; first " << PreciseSeam::failed_fragment_log_limit + << " logged (parallel processing order), " << (failed - PreciseSeam::failed_fragment_log_limit) + << " omitted"; + // Recoveries are log-only: no user warning, but the same bounded detail and a total. + const size_t recovered = precise_seam_warnings.recovered_fragments.load(std::memory_order_relaxed); + if (recovered > PreciseSeam::failed_fragment_log_limit) + BOOST_LOG_TRIVIAL(warning) << "[PreciseSeamFragmentRecovered] " << recovered + << " fragments recovered; first " << PreciseSeam::failed_fragment_log_limit + << " logged (parallel processing order), " << (recovered - PreciseSeam::failed_fragment_log_limit) + << " omitted"; + // Reasons name the modifier types, as the menu does, not individual modifiers: "Seam Left, Seam + // Enforced" in menu order, each type once. The same msgids as the menu share its translations. + const auto type_list = [](unsigned mask) { + const std::pair types[] = { + {ModelVolumeType::PRECISE_SEAM_CENTER, _u8L("Seam Center")}, + {ModelVolumeType::PRECISE_SEAM_LEFT, _u8L("Seam Left")}, + {ModelVolumeType::PRECISE_SEAM_RIGHT, _u8L("Seam Right")}, + {ModelVolumeType::PRECISE_SEAM_ENFORCED, _u8L("Seam Enforced")}, + {ModelVolumeType::PRECISE_SEAM_BLOCKED, _u8L("Seam Blocked")}, + {ModelVolumeType::PRECISE_SEAM_NEUTRAL, _u8L("Seam Neutral")}}; + std::string list; + for (const auto &[type, name] : types) + if (mask & PreciseSeam::PreciseSeamWarnings::type_bit(type)) + list += (list.empty() ? "" : ", ") + name; + return list; + }; std::vector parts; - if (mi) - parts.push_back(_u8L("multiple intersections with a perimeter detected")); - if (tb) - parts.push_back(_u8L("modifier fully crosses the printable perimeter")); - if (mc) - parts.push_back(_u8L("modifier shape is not solid (has holes inside) and was ignored")); - if (fc) - parts.push_back(_u8L("perimeter is fully contained inside modifier and was ignored")); + if (failed_types != 0) + parts.push_back((boost::format(_u8L("failed to process some intersections (%1%)")) % type_list(failed_types)).str()); + if (mi != 0) + parts.push_back((boost::format(_u8L("multiple intersections with a perimeter, only one was used (%1%)")) % type_list(mi)).str()); + if (fc != 0) + parts.push_back((boost::format(_u8L("a perimeter is fully inside a modifier, the modifier was not applied to it (%1%)")) % type_list(fc)).str()); + // Modifiers evaluated somewhere that never reached a perimeter; never-evaluated ones are not reported. + // Print and volume order make the named one deterministic; the log lists them all. + std::vector no_effect; + for (const PrintObject *po : print.objects()) + for (const ModelVolume *volume : po->model_object()->volumes) { + const auto it = precise_seam_warnings.modifier_usage.find(volume); + if (it != precise_seam_warnings.modifier_usage.end() && + it->second.checked.load(std::memory_order_relaxed) && + !it->second.reached.load(std::memory_order_relaxed) && + std::find(no_effect.begin(), no_effect.end(), volume) == no_effect.end()) + no_effect.push_back(volume); + } + // The user warning names only the first one; the log lists them all. + for (const ModelVolume *volume : no_effect) + BOOST_LOG_TRIVIAL(warning) << "[PreciseSeamNoEffect] object=\"" << volume->get_object()->name + << "\" modifier=\"" << volume->name << "\""; + if (!no_effect.empty()) { + const ModelVolume *first = no_effect.front(); + if (no_effect.size() == 1) + parts.push_back((boost::format(_u8L("modifier \"%1%\" of \"%2%\" had no effect on the seam (it might not reach the centerline of the printed perimeter)")) + % first->name % first->get_object()->name).str()); + else + parts.push_back((boost::format(_u8L("modifier \"%1%\" of \"%2%\" (%3% in total) had no effect on the seam (it might not reach the centerline of the printed perimeter)")) + % first->name % first->get_object()->name % no_effect.size()).str()); + } if (!parts.empty()) { // One line: the export warnings dialog shows only the first line of each warning. std::string warning_text = _u8L("Precise Seam") + ": "; @@ -1630,10 +1695,7 @@ void SeamPlacer::init(Print &print, std::function throw_if_canceled_ } warning_text += ". "; warning_text += _u8L("Seam placement may differ from expected."); - print.active_step_add_warning( - PrintStateBase::WarningLevel::NON_CRITICAL, - warning_text, - PrintStateBase::SlicingPreciseSeamWarning); + m_precise_seam_warning = std::move(warning_text); } } } diff --git a/src/libslic3r/GCode/SeamPlacer.hpp b/src/libslic3r/GCode/SeamPlacer.hpp index cbf2c73fbe..ab3dc8089d 100644 --- a/src/libslic3r/GCode/SeamPlacer.hpp +++ b/src/libslic3r/GCode/SeamPlacer.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include "libslic3r/Point.hpp" #include "libslic3r/libslic3r.h" @@ -154,10 +155,16 @@ public: //The following data structures hold all perimeter points for all PrintObject. std::unordered_map m_seam_per_object; - void init(Print &print, std::function throw_if_canceled_func); + void init(const Print &print, std::function throw_if_canceled_func); + + // Precise Seam user warning prepared by the last init(), empty if there is none. init() does not + // change the Print: the caller issues the warning where a print step is active (G-code export). + const std::string &precise_seam_warning() const { return m_precise_seam_warning; } void place_seam(const Layer *layer, ExtrusionLoop &loop, const Point &last_pos, float& overhang) const; private: + std::string m_precise_seam_warning; + void gather_seam_candidates(const PrintObject *po, const SeamPlacerImpl::GlobalModelInfo &global_model_info, PreciseSeam::PreciseSeamWarnings* warnings = nullptr); void calculate_candidates_visibility(const PrintObject *po, diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 24a77ce716..ee341f2d78 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -1272,7 +1272,6 @@ ModelObject& ModelObject::assign_copy(const ModelObject &rhs) this->volumes.emplace_back(new ModelVolume(*model_volume)); this->volumes.back()->set_model_object(this); } - this->clear_instances(); this->instances.reserve(rhs.instances.size()); for (const ModelInstance *model_instance : rhs.instances) { @@ -1311,7 +1310,6 @@ ModelObject& ModelObject::assign_copy(ModelObject &&rhs) rhs.volumes.clear(); for (ModelVolume *model_volume : this->volumes) model_volume->set_model_object(this); - this->clear_instances(); this->instances = std::move(rhs.instances); rhs.instances.clear(); @@ -1435,9 +1433,7 @@ ModelVolume* ModelObject::add_volume_with_shared_mesh(const ModelVolume &other, void ModelObject::delete_volume(size_t idx) { ModelVolumePtrs::iterator i = this->volumes.begin() + idx; - ModelVolume* volume_to_delete = *i; - - delete volume_to_delete; + delete *i; this->volumes.erase(i); if (this->volumes.size() == 1) @@ -1530,6 +1526,7 @@ void ModelObject::sort_volumes(bool full_sort) return vl_type < vr_type; }); } + ModelInstance* ModelObject::add_instance() { ModelInstance* i = new ModelInstance(this); @@ -3889,7 +3886,6 @@ bool model_volume_list_changed(const ModelObject &model_object_old, const ModelO }); } - template< typename TypeFilterFn, typename CompareFn> bool model_property_changed(const ModelObject &model_object_old, const ModelObject &model_object_new, TypeFilterFn type_filter, CompareFn compare) { diff --git a/src/libslic3r/Model.hpp b/src/libslic3r/Model.hpp index 6ef00c8587..da700268c0 100644 --- a/src/libslic3r/Model.hpp +++ b/src/libslic3r/Model.hpp @@ -370,7 +370,6 @@ enum class ModelVolumeType : int { }; // Free functions for checking ModelVolumeType without a ModelVolume object. -// Keep in sync with ModelVolume::is_precise_seam*() methods below. inline bool is_precise_seam(ModelVolumeType t) { return t >= ModelVolumeType::PRECISE_SEAM_CENTER && t <= ModelVolumeType::PRECISE_SEAM_NEUTRAL; } inline bool is_precise_seam_strong(ModelVolumeType t) { return t >= ModelVolumeType::PRECISE_SEAM_CENTER && t <= ModelVolumeType::PRECISE_SEAM_RIGHT; } inline bool is_precise_seam_weak(ModelVolumeType t) { return t >= ModelVolumeType::PRECISE_SEAM_ENFORCED && t <= ModelVolumeType::PRECISE_SEAM_NEUTRAL; } @@ -1007,13 +1006,13 @@ public: bool is_support_blocker() const { return m_type == ModelVolumeType::SUPPORT_BLOCKER; } bool is_support_modifier() const { return m_type == ModelVolumeType::SUPPORT_BLOCKER || m_type == ModelVolumeType::SUPPORT_ENFORCER; } // Check if this volume is any of the precise seam modifier subtypes - bool is_precise_seam() const { return m_type >= ModelVolumeType::PRECISE_SEAM_CENTER && m_type <= ModelVolumeType::PRECISE_SEAM_NEUTRAL; } + bool is_precise_seam() const { return Slic3r::is_precise_seam(m_type); } // Helper to check if volume is a "strong" Precise Seam type (center, left, right) // Strong modifiers have priority and always appear above weak modifiers in UI - bool is_precise_seam_strong() const { return m_type >= ModelVolumeType::PRECISE_SEAM_CENTER && m_type <= ModelVolumeType::PRECISE_SEAM_RIGHT; } + bool is_precise_seam_strong() const { return Slic3r::is_precise_seam_strong(m_type); } // Helper to check if volume is a "weak" Precise Seam type (enforced, blocked, neutral) // Weak modifiers always appear below strong modifiers in UI - bool is_precise_seam_weak() const { return m_type >= ModelVolumeType::PRECISE_SEAM_ENFORCED && m_type <= ModelVolumeType::PRECISE_SEAM_NEUTRAL; } + bool is_precise_seam_weak() const { return Slic3r::is_precise_seam_weak(m_type); } bool is_text() const { return text_configuration.has_value(); } bool is_svg() const { return emboss_shape.has_value() && !text_configuration.has_value(); } bool is_the_only_one_part() const; // behave like an object diff --git a/src/libslic3r/Polygon.cpp b/src/libslic3r/Polygon.cpp index d7591ae27c..ea5c2ea96e 100644 --- a/src/libslic3r/Polygon.cpp +++ b/src/libslic3r/Polygon.cpp @@ -331,13 +331,10 @@ Points Polygon::concave_points(double angle_threshold) const } // Projection of a point onto the polygon. -Point Polygon::point_projection(const Point &point, size_t *edge_index) const +Point Polygon::point_projection(const Point &point) const { Point proj = point; double dmin = std::numeric_limits::max(); - // Preserve the existing projection and tie order while optionally tracking its edge. - if (edge_index) - *edge_index = std::numeric_limits::max(); if (! this->points.empty()) { for (size_t i = 0; i < this->points.size(); ++ i) { const Point &pt0 = this->points[i]; @@ -346,15 +343,11 @@ Point Polygon::point_projection(const Point &point, size_t *edge_index) const if (d < dmin) { dmin = d; proj = pt0; - if (edge_index) - *edge_index = i; } d = (point - pt1).cast().norm(); if (d < dmin) { dmin = d; proj = pt1; - if (edge_index) - *edge_index = (i + 1) % this->points.size(); } Vec2d v1(coordf_t(pt1(0) - pt0(0)), coordf_t(pt1(1) - pt0(1))); coordf_t div = v1.squaredNorm(); @@ -367,8 +360,6 @@ Point Polygon::point_projection(const Point &point, size_t *edge_index) const if (d < dmin) { dmin = d; proj = foot; - if (edge_index) - *edge_index = i; } } } diff --git a/src/libslic3r/Polygon.hpp b/src/libslic3r/Polygon.hpp index ae312fd830..8e7ca2ed91 100644 --- a/src/libslic3r/Polygon.hpp +++ b/src/libslic3r/Polygon.hpp @@ -92,9 +92,7 @@ public: Points convex_points(double angle_threshold = 0.) const; Points concave_points(double angle_threshold = 0.) const; // Projection of a point onto the polygon. - // Optional index: start of the closest edge, or the vertex itself for an endpoint. - // Empty polygons return the query point and std::numeric_limits::max() as the index. - Point point_projection(const Point &point, size_t *edge_index = nullptr) const; + Point point_projection(const Point &point) const; std::vector parameter_by_length() const; //BBS diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index 2fe135a24c..b4b64a0cd2 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -492,10 +492,8 @@ public: std::vector slice_support_volumes(const ModelVolumeType model_volume_type) const; std::vector slice_support_blockers() const { return this->slice_support_volumes(ModelVolumeType::SUPPORT_BLOCKER); } std::vector slice_support_enforcers() const { return this->slice_support_volumes(ModelVolumeType::SUPPORT_ENFORCER); } - // Shared slicing path; multiple volumes are united per layer. - std::vector slice_modifier_volumes(const std::vector &volumes) const; - // Keep Precise Seam volumes separate so their individual priority is preserved. - std::vector slice_single_volume(const ModelVolume* volume) const { return this->slice_modifier_volumes({volume}); } + // Preserve each connected region and its holes for perimeter clipping. + std::vector slice_single_volume_regions(const ModelVolume* volume) const; // Helpers to project custom facets on slices void project_and_append_custom_facets(bool seam, EnforcerBlockerType type, std::vector& expolys, std::vector>* vertical_points=nullptr) const; diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index 6b9a559f03..926a6fbca6 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -740,7 +740,10 @@ void print_objects_regions_invalidate_keep_some_volumes(PrintObjectRegions &prin for (; i_old < old_volumes.size(); ++ i_old) if (old_volumes[i_old]->id() >= new_volumes[i_new]->id()) break; - if (i_old != old_volumes.size() && old_volumes[i_old]->id() == new_volumes[i_new]->id()) { + // IDs survive type changes: an old volume that was not a solid or modifier was never cached, + // so treat it as new instead of looking it up. + if (i_old != old_volumes.size() && old_volumes[i_old]->id() == new_volumes[i_new]->id() && + model_volume_solid_or_modifier(*old_volumes[i_old])) { if (old_volumes[i_old]->get_matrix().isApprox(new_volumes[i_new]->get_matrix())) { // Reuse the volume. for (; print_object_regions.cached_volume_ids[i_cached_volume] < old_volumes[i_old]->id(); ++ i_cached_volume) diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 43a9b703a0..0581e9c6fd 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1577,19 +1577,12 @@ ExPolygons PrintObject::_shrink_contour_holes(double contour_delta, double hole_ std::vector PrintObject::slice_support_volumes(const ModelVolumeType model_volume_type) const { - // Supports merge every matching volume; Precise Seam calls the shared slicer one volume at a time. - std::vector volumes; - for (const ModelVolume *volume : this->model_object()->volumes) - if (volume->type() == model_volume_type) - volumes.push_back(volume); - return this->slice_modifier_volumes(volumes); -} - -std::vector PrintObject::slice_modifier_volumes(const std::vector &volumes) const -{ + auto it_volume = this->model_object()->volumes.begin(); + auto it_volume_end = this->model_object()->volumes.end(); + for (; it_volume != it_volume_end && (*it_volume)->type() != model_volume_type; ++ it_volume) ; std::vector slices; - if (!volumes.empty()) { - // Share layer heights, transforms and cancellation handling across the selected volumes. + if (it_volume != it_volume_end) { + // Found at least a single support volume of model_volume_type. std::vector zs = zs_from_layers(this->layers()); std::vector merge_layers; bool merge = false; @@ -1597,26 +1590,27 @@ std::vector PrintObject::slice_modifier_volumes(const std::vector([print](){ print->throw_if_canceled(); }); MeshSlicingParamsEx params; params.trafo = this->trafo_centered(); - for (const ModelVolume *volume : volumes) { - std::vector slices2 = slice_volume(*volume, zs, params, throw_on_cancel_callback); - if (slices.empty()) { - slices.reserve(slices2.size()); - for (ExPolygons &src : slices2) - slices.emplace_back(to_polygons(std::move(src))); - } else if (!slices2.empty()) { - if (merge_layers.empty()) - merge_layers.assign(zs.size(), false); - for (size_t i = 0; i < zs.size(); ++ i) { - if (slices[i].empty()) - slices[i] = to_polygons(std::move(slices2[i])); - else if (! slices2[i].empty()) { - append(slices[i], to_polygons(std::move(slices2[i]))); - merge_layers[i] = true; - merge = true; + for (; it_volume != it_volume_end; ++ it_volume) + if ((*it_volume)->type() == model_volume_type) { + std::vector slices2 = slice_volume(*(*it_volume), zs, params, throw_on_cancel_callback); + if (slices.empty()) { + slices.reserve(slices2.size()); + for (ExPolygons &src : slices2) + slices.emplace_back(to_polygons(std::move(src))); + } else if (!slices2.empty()) { + if (merge_layers.empty()) + merge_layers.assign(zs.size(), false); + for (size_t i = 0; i < zs.size(); ++ i) { + if (slices[i].empty()) + slices[i] = to_polygons(std::move(slices2[i])); + else if (! slices2[i].empty()) { + append(slices[i], to_polygons(std::move(slices2[i]))); + merge_layers[i] = true; + merge = true; + } } } } - } if (merge) { std::vector to_merge; to_merge.reserve(zs.size()); @@ -1634,4 +1628,16 @@ std::vector PrintObject::slice_modifier_volumes(const std::vector PrintObject::slice_single_volume_regions(const ModelVolume* volume) const +{ + if (volume == nullptr) + return {}; + // Match the existing slicing heights and centered transform without flattening holes. + const std::vector zs = zs_from_layers(this->layers()); + MeshSlicingParamsEx params; + params.trafo = this->trafo_centered(); + const Print *print = this->print(); + return slice_volume(*volume, zs, params, [print]() { print->throw_if_canceled(); }); +} + } // namespace Slic3r diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index a46707ff98..597b960710 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -193,7 +193,9 @@ ColorRGBA GLVolume::SUPPORT_BLOCKER_COL = {1.0f, 0.3f, 0.3f, 0.4f}; ColorRGBA GLVolume::MODEL_HIDDEN_COL = {0.f, 0.f, 0.f, 0.3f}; -// Precise Seam modifier colors +// Precise Seam modifier colors. Center, Left and Right are deliberately close shades of one orange: +// all three are strong modifiers, and distinct hues per mode would turn the scene into a rainbow. +// The object list icons tell the modes apart. ColorRGBA GLVolume::PRECISE_SEAM_CENTER_COL = {1.0f, 0.627f, 0.082f, 0.6f}; // FFA015 - orange ColorRGBA GLVolume::PRECISE_SEAM_LEFT_COL = {1.0f, 0.753f, 0.0f, 0.6f}; // FFC000 - golden ColorRGBA GLVolume::PRECISE_SEAM_RIGHT_COL = {1.0f, 0.514f, 0.0f, 0.6f}; // FF8300 - dark orange diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 38633dc86a..59e26663a2 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -5804,6 +5804,7 @@ void ObjectList::change_part_type() return; } #endif + ModelVolumeType ObjectList::get_selected_volume_type() { ModelVolume* volume = get_selected_model_volume(); diff --git a/src/slic3r/GUI/GUI_ObjectList.hpp b/src/slic3r/GUI/GUI_ObjectList.hpp index 4aff69534e..1f2d970cef 100644 --- a/src/slic3r/GUI/GUI_ObjectList.hpp +++ b/src/slic3r/GUI/GUI_ObjectList.hpp @@ -98,7 +98,6 @@ struct MeshErrorsInfo class ObjectList : public wxDataViewCtrl { public: - enum SELECTION_MODE { smUndef = 0, diff --git a/tests/fff_print/test_precise_seam.cpp b/tests/fff_print/test_precise_seam.cpp index 0dd422f0f5..2f48c626cc 100644 --- a/tests/fff_print/test_precise_seam.cpp +++ b/tests/fff_print/test_precise_seam.cpp @@ -6,19 +6,25 @@ #include #include #include "test_helpers.hpp" +#include "libslic3r/BoundingBox.hpp" #include "libslic3r/GCode/PreciseSeam.hpp" +#include "libslic3r/Layer.hpp" +#include "libslic3r/Print.hpp" #include +#include #include "libslic3r/Point.hpp" #include "libslic3r/Polygon.hpp" #include "libslic3r/Model.hpp" -#include "libslic3r/Print.hpp" -#include "libslic3r/Layer.hpp" #include #include #include "libslic3r/libslic3r.h" #include "libslic3r/GCode/SeamPlacer.hpp" +#include "libslic3r/GCodeReader.hpp" +#include "libslic3r/TriangleMesh.hpp" #include +#include +#include using namespace Slic3r; @@ -36,15 +42,17 @@ struct SeamFixture { Print print; Model modifiers; Layer *layer = nullptr; - PreciseSeam::ModifierSlicesCache cache; + PreciseSeam::ModifierRegionsCache cache; - SeamFixture() + explicit SeamFixture(int raft_layers = 0) { // Only the layer/PrintObject context is needed; clipping uses explicit cached slices below. - Test::init_print({Test::cube(20)}, print, model, {{"raft_layers", "0"}}); + Test::init_print({Test::cube(20)}, print, model, {{"raft_layers", std::to_string(raft_layers)}}); REQUIRE(print.objects().size() == 1); PrintObject *object = print.get_object(0); - layer = object->add_layer(int(object->slicing_parameters().raft_layers()), 0.2, 0.2, 0.1); + const auto &slicing = object->slicing_parameters(); + // IDs and print heights include the raft; mesh slicing heights remain object-relative. + layer = object->add_layer(int(slicing.raft_layers()), 0.2, slicing.object_print_z_min + 0.2, 0.1); modifiers.add_object(); } @@ -53,7 +61,19 @@ struct SeamFixture { // These volumes own cache keys; mesh slicing is deliberately outside this geometry fixture. ModelVolume *volume = modifiers.objects.front()->add_volume(Test::cube(1)); volume->set_type(type); - cache.emplace(volume, std::vector{std::move(slices)}); + ExPolygons regions; + for (Polygon &slice : slices) + regions.emplace_back(std::move(slice)); + cache.emplace(volume, PreciseSeam::prepare_modifier_slices({std::move(regions)})); + return volume; + } + + const ModelVolume *add_regions(ModelVolumeType type, ExPolygons regions) + { + // Supply structured slices directly, without reconstructing holes from flat contours. + const ModelVolume *volume = add(type, {}); + REQUIRE(volume->is_precise_seam()); + cache.at(volume) = PreciseSeam::prepare_modifier_slices({std::move(regions)}); return volume; } }; @@ -79,18 +99,196 @@ void require_vertex(const Polygon &polygon, const Point &point) CAPTURE(point.x(), point.y()); REQUIRE(std::find(polygon.points.begin(), polygon.points.end(), point) != polygon.points.end()); } + +std::vector weak_candidate_types( + const Polygon &polygon, const std::vector &segments, + const std::function &painted = {}) +{ + // Use the same coordinate conversion as production when applying prepared boundaries. + // Optional painted types stand in for seam painting, which production assigns before weak zones. + PrintObjectSeamData::LayerSeams candidates; + candidates.perimeters.emplace_back(); + auto &loop = candidates.perimeters.back(); + loop.start_index = 0; + for (const Point &point : polygon.points) { + const Vec2f position = unscale(point).cast(); + candidates.points.emplace_back(Vec3f(position.x(), position.y(), 0), loop, 0, + painted ? painted(point) : SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral); + } + loop.end_index = candidates.points.size(); + bool enforced = false; + PreciseSeam::apply_weak_modifiers_to_perimeter(segments, candidates, loop, enforced); + std::vector types; + for (const auto &candidate : candidates.points) + types.push_back(candidate.type); + return types; +} } // namespace +TEST_CASE("A simple clipped interval has consistent geometry before and after weak boundary insertion", "[PreciseSeam][SegmentExtraction]") +{ + const bool corner = GENERATE(false, true); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + const Polygon cut = corner ? rectangle(-2, -2, 4, 4) : rectangle(2, -2, 8, 2); + const Point expected_begin = corner ? mm(0, 4) : mm(2, 0); + const Point expected_end = corner ? mm(4, 0) : mm(8, 0); + const auto extracted = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions(ExPolygons{ExPolygon(cut)}), ModelVolumeType::PRECISE_SEAM_ENFORCED); + REQUIRE(extracted.valid); + REQUIRE(extracted.segments.size() == 1); + CHECK(extracted.segments.front().polyline.points.front() == expected_begin); + CHECK(extracted.segments.front().polyline.points.back() == expected_end); + // Boundary insertion must preserve the extractor endpoints on this analytic fixture. + const auto *modifier = fixture.add(ModelVolumeType::PRECISE_SEAM_BLOCKED, {cut}); + const auto applied = PreciseSeam::collect_weak_modifier_segments({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(applied.size() == 1); + CHECK(applied.front().left_point == expected_begin); + CHECK(applied.front().right_point == expected_end); + check_square_boundary(perimeter); +} + +TEST_CASE("Unsuccessful strong modifiers share perimeter preparation with weak processing", "[PreciseSeam][Regression]") +{ + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + const Points original = perimeter.points; + const auto *empty = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {}); + const auto *distant = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {rectangle(30, 30, 40, 40)}); + const auto *covering = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {rectangle(-2, -2, 22, 22)}); + const auto *blocked = fixture.add(ModelVolumeType::PRECISE_SEAM_BLOCKED, {rectangle(2, -2, 8, 2)}); + const auto *neutral = fixture.add(ModelVolumeType::PRECISE_SEAM_NEUTRAL, {rectangle(4, -2, 6, 2)}); + const PreciseSeam::PreparedPerimeter prepared(perimeter); + REQUIRE(prepared.valid); + CHECK(prepared.bounds.min == mm(0, 0)); + CHECK(prepared.bounds.max == mm(20, 20)); + REQUIRE(prepared.line.size() == original.size() + 1); + CHECK(prepared.line.points.front() == prepared.line.points.back()); + const Point *line_storage = prepared.line.points.data(); + PreciseSeam::PreciseSeamWarnings warnings; + CHECK_FALSE(PreciseSeam::insert_strong_seam_point( + {empty, distant, covering}, perimeter, prepared, fixture.layer, fixture.cache, &warnings).has_value()); + CHECK(perimeter.points == original); + CHECK(prepared.line.points.data() == line_storage); + CHECK(warnings.full_containment.load()); + + // Weak receives the same preparation; neither consumer needs to reconstruct the clipping line. + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {blocked, neutral}, perimeter, prepared, fixture.layer, fixture.cache, &warnings); + REQUIRE(segments.size() == 2); + // Insertion has now changed the polygon: do not use prepared for any further extraction. + const auto types = weak_candidate_types(perimeter, segments); + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point &p = perimeter[i]; + const bool in_outer = p.y() == 0 && p.x() >= scale_(2.) && p.x() <= scale_(8.); + const bool in_inner = p.x() >= scale_(4.) && p.x() <= scale_(6.); + const auto expected = in_outer && !in_inner ? SeamPlacerImpl::EnforcedBlockedSeamPoint::Blocked : + SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral; + CHECK(types[i] == expected); + } + CHECK(warnings.failed_fragments.load() == 0); + check_square_boundary(perimeter); +} + +TEST_CASE("Structured modifier slices keep holes with their component and preserve sliced area", "[PreciseSeam][SegmentExtraction]") +{ + SeamFixture fixture; + TriangleMesh shell = Test::cube(10); + TriangleMesh cavity = Test::cube(6); + cavity.translate(2., 2., -1.); + cavity.flip_triangles(); + shell.merge(cavity); + TriangleMesh island = Test::cube(2); + island.translate(30., 0., 0.); + shell.merge(island); + // The layer intersects an annulus and a separate island, with areas 100-36 and 4 mm^2. + ModelVolume *volume = fixture.modifiers.objects.front()->add_volume(shell); + const bool mirrored = GENERATE(false, true); + // A negative determinant must preserve exterior/hole winding and the sliced area. + if (mirrored) + volume->set_mirror(Vec3d(-1., 1., 1.)); + PrintObject *object = fixture.print.get_object(0); + PreciseSeam::ModifierRegionsCache cache; + cache.emplace(volume, PreciseSeam::prepare_modifier_slices(object->slice_single_volume_regions(volume))); + const auto &layers = cache.at(volume); + REQUIRE(layers.size() == 1); + REQUIRE(layers.front().size() == 2); + size_t holes = 0; + double area = 0.; + for (const auto &cached_region : layers.front()) { + const ExPolygon ®ion = cached_region.polygon; + holes += region.holes.size(); + CHECK(region.contour.is_counter_clockwise()); + for (const Polygon &hole : region.holes) + CHECK(hole.is_clockwise()); + area += region.area(); + } + CHECK(holes == 1); + CHECK_THAT(area / double(scale_(1.)) / double(scale_(1.)), Catch::Matchers::WithinAbs(68., 1e-4)); +} + +TEST_CASE("Modifier slices above a raft use object layer indices for strong and weak seams", "[PreciseSeam][Regression]") +{ + const auto mode = GENERATE(ModelVolumeType::PRECISE_SEAM_LEFT, ModelVolumeType::PRECISE_SEAM_CENTER, + ModelVolumeType::PRECISE_SEAM_RIGHT, ModelVolumeType::PRECISE_SEAM_BLOCKED); + SeamFixture fixture(3); + PrintObject *object = fixture.print.get_object(0); + const auto &slicing = object->slicing_parameters(); + REQUIRE(slicing.raft_layers() > 0); + REQUIRE(fixture.layer->id() == slicing.raft_layers()); + // The real modifier mesh intersects the lower sampled object layer, but not the upper one. + Layer *upper = object->add_layer(int(slicing.raft_layers() + 1), 0.2, slicing.object_print_z_min + 4.2, 4.1); + ModelVolume *modifier = fixture.modifiers.objects.front()->add_volume(Test::cube(4)); + modifier->set_type(mode); + const auto &slices = fixture.cache.emplace(modifier, PreciseSeam::prepare_modifier_slices(object->slice_single_volume_regions(modifier))).first->second; + REQUIRE(slices.size() == 2); + REQUIRE(slices[0].size() == 1); + CHECK(slices[1].empty()); + + // Position the test perimeter relative to the transformed slice to isolate layer indexing. + const BoundingBox &bounds = slices[0].front().bounds; + const Point origin = bounds.min; + const Polygon original(Points{origin + mm(-2, 2), origin + mm(6, 2), + origin + mm(6, 10), origin + mm(-2, 10)}); + Polygon perimeter = original; + if (is_precise_seam_strong(mode)) { + const auto seam = PreciseSeam::insert_strong_seam_point( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(seam.has_value()); + const double x = mode == ModelVolumeType::PRECISE_SEAM_LEFT ? 0. : + mode == ModelVolumeType::PRECISE_SEAM_RIGHT ? 4. : 2.; + CHECK(*seam == origin + mm(x, 2)); + perimeter = original; + CHECK_FALSE(PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), upper, fixture.cache).has_value()); + } else { + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(segments.size() == 1); + CHECK(segments.front().left_point == origin + mm(0, 2)); + CHECK(segments.front().right_point == origin + mm(4, 2)); + const auto types = weak_candidate_types(perimeter, segments); + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point local = perimeter[i] - origin; + const bool inside = local.y() == scale_(2.) && local.x() >= 0 && local.x() <= scale_(4.); + CHECK(types[i] == (inside ? SeamPlacerImpl::EnforcedBlockedSeamPoint::Blocked : + SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral)); + } + perimeter = original; + CHECK(PreciseSeam::collect_weak_modifier_segments({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), upper, fixture.cache).empty()); + } + CHECK(perimeter.points == original.points); +} + TEST_CASE("Strong seam modes select the requested location on a clipped side", "[PreciseSeam]") { const auto mode = GENERATE(ModelVolumeType::PRECISE_SEAM_LEFT, ModelVolumeType::PRECISE_SEAM_CENTER, ModelVolumeType::PRECISE_SEAM_RIGHT); SeamFixture fixture; - // Clipper may collapse all three original collinear edges into one. + // Center must retain the correct source edge across several collinear edges. Polygon perimeter(Points{mm(0, 0), mm(2, 0), mm(4, 0), mm(8, 0), mm(20, 0), mm(20, 20), mm(0, 20)}); const ModelVolume *modifier = fixture.add(mode, {rectangle(1, -2, 13, 2)}); PreciseSeam::PreciseSeamWarnings warnings; - const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, fixture.layer, fixture.cache, &warnings); + const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); REQUIRE(seam.has_value()); const double expected_x = mode == ModelVolumeType::PRECISE_SEAM_LEFT ? 1.0 : mode == ModelVolumeType::PRECISE_SEAM_RIGHT ? 13.0 : 7.0; @@ -98,7 +296,6 @@ TEST_CASE("Strong seam modes select the requested location on a clipped side", " require_vertex(perimeter, mm(expected_x - 0.001, 0)); require_vertex(perimeter, mm(expected_x + 0.001, 0)); check_square_boundary(perimeter); - CHECK_FALSE(warnings.through_body.load()); CHECK_FALSE(warnings.full_containment.load()); CHECK_FALSE(warnings.multiple_intersections.load()); } @@ -111,7 +308,7 @@ TEST_CASE("Center seams preserve the edge order at vertices and across the conto // Symmetric cuts put the arc midpoint exactly on an existing vertex, including vertex zero. const Polygon cut = wrap ? rectangle(-2, -2, 4, 4) : rectangle(1, -2, 7, 2); const ModelVolume *modifier = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {cut}); - const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, fixture.layer, fixture.cache); + const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); REQUIRE(seam.has_value()); CHECK(*seam == (wrap ? mm(0, 0) : mm(4, 0))); require_vertex(perimeter, wrap ? mm(0, 0.001) : mm(3.999, 0)); @@ -124,7 +321,7 @@ TEST_CASE("Center seams land on the closing edge", "[PreciseSeam]") SeamFixture fixture; Polygon perimeter = rectangle(0, 0, 20, 20); const auto *modifier = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {rectangle(-2, 3, 2, 9)}); - const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, fixture.layer, fixture.cache); + const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); REQUIRE(seam.has_value()); CHECK(*seam == mm(0, 6)); require_vertex(perimeter, mm(0, 5.999)); @@ -132,35 +329,521 @@ TEST_CASE("Center seams land on the closing edge", "[PreciseSeam]") check_square_boundary(perimeter); } +TEST_CASE("Weak boundaries on the closing edge preserve candidate types", "[PreciseSeam][Regression]") +{ + const bool reverse = GENERATE(false, true); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + // Keep vertex zero fixed so the selected side remains the closing edge in both directions. + if (reverse) + std::reverse(perimeter.points.begin() + 1, perimeter.points.end()); + const Polygon cut = reverse ? rectangle(3, -2, 9, 2) : rectangle(-2, 3, 2, 9); + const auto *modifier = fixture.add(ModelVolumeType::PRECISE_SEAM_BLOCKED, {cut}); + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(segments.size() == 1); + const auto types = weak_candidate_types(perimeter, segments); + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point &p = perimeter[i]; + const coord_t along = reverse ? p.x() : p.y(); + const coord_t across = reverse ? p.y() : p.x(); + const bool inside = across == 0 && along >= scale_(3.) && along <= scale_(9.); + CHECK(types[i] == (inside ? SeamPlacerImpl::EnforcedBlockedSeamPoint::Blocked : + SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral)); + } + check_square_boundary(perimeter); +} + +TEST_CASE("Strong intersection warnings count joined segments across vertex zero", "[PreciseSeam][Regression]") +{ + const bool extra_segment = GENERATE(false, true); + const auto mode = GENERATE(ModelVolumeType::PRECISE_SEAM_LEFT, ModelVolumeType::PRECISE_SEAM_CENTER, + ModelVolumeType::PRECISE_SEAM_RIGHT); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + ExPolygons regions{ExPolygon(rectangle(-2, -2, 4, 4))}; + if (extra_segment) + regions.emplace_back(rectangle(8, -2, 12, 2)); + // The two fragments at vertex zero form one eight-millimeter segment, longer than the extra one. + const auto extracted = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions(regions), mode); + REQUIRE(extracted.segments.size() == (extra_segment ? 2 : 1)); + const auto *modifier = fixture.add_regions(mode, std::move(regions)); + PreciseSeam::PreciseSeamWarnings warnings; + const auto seam = PreciseSeam::insert_strong_seam_point( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + REQUIRE(seam.has_value()); + CHECK(*seam == (mode == ModelVolumeType::PRECISE_SEAM_LEFT ? mm(0, 4) : + mode == ModelVolumeType::PRECISE_SEAM_RIGHT ? mm(4, 0) : mm(0, 0))); + CHECK(warnings.multiple_intersections.load() == (extra_segment ? PreciseSeam::PreciseSeamWarnings::type_bit(mode) : 0u)); + CHECK(warnings.failed_fragments.load() == 0); + CHECK_FALSE(warnings.full_containment.load()); + check_square_boundary(perimeter); +} + +TEST_CASE("A collinear contour origin preserves strong targets and weak candidate types", "[PreciseSeam][Regression]") +{ + const bool reverse = GENERATE(false, true); + const auto mode = GENERATE(ModelVolumeType::PRECISE_SEAM_LEFT, ModelVolumeType::PRECISE_SEAM_CENTER, + ModelVolumeType::PRECISE_SEAM_RIGHT, ModelVolumeType::PRECISE_SEAM_BLOCKED); + SeamFixture fixture; + Polygon perimeter(Points{mm(10, 0), mm(20, 0), mm(20, 20), mm(0, 20), mm(0, 0)}); + // Both clipping fragments have two points, with the artificial cut inside a straight side. + if (reverse) + std::reverse(perimeter.points.begin() + 1, perimeter.points.end()); + const auto *modifier = fixture.add(mode, {rectangle(8, -2, 12, 2)}); + PreciseSeam::PreciseSeamWarnings warnings; + if (is_precise_seam_strong(mode)) { + const auto seam = PreciseSeam::insert_strong_seam_point( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + REQUIRE(seam.has_value()); + const double x = mode == ModelVolumeType::PRECISE_SEAM_CENTER ? 10. : + ((mode == ModelVolumeType::PRECISE_SEAM_LEFT) != reverse ? 8. : 12.); + CHECK(*seam == mm(x, 0)); + } else { + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + REQUIRE(segments.size() == 1); + const auto types = weak_candidate_types(perimeter, segments); + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point &p = perimeter[i]; + const bool inside = p.y() == 0 && p.x() >= scale_(8.) && p.x() <= scale_(12.); + CHECK(types[i] == (inside ? SeamPlacerImpl::EnforcedBlockedSeamPoint::Blocked : + SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral)); + } + } + CHECK_FALSE(warnings.multiple_intersections.load()); + CHECK_FALSE(warnings.full_containment.load()); + CHECK(warnings.failed_fragments.load() == 0); + check_square_boundary(perimeter); +} + +TEST_CASE("A gap on the closing edge preserves the complementary seam segment", "[PreciseSeam][Regression]") +{ + const auto mode = GENERATE(ModelVolumeType::PRECISE_SEAM_LEFT, ModelVolumeType::PRECISE_SEAM_CENTER, + ModelVolumeType::PRECISE_SEAM_RIGHT, ModelVolumeType::PRECISE_SEAM_BLOCKED); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + ExPolygon region(rectangle(-2, -2, 22, 22)); + region.holes.push_back(rectangle(-1, 8, 1, 12)); + region.holes.back().reverse(); + // The retained 76 mm arc starts and ends on edge n-1, with a four-millimeter gap between them. + const auto *modifier = fixture.add_regions(mode, {region}); + PreciseSeam::PreciseSeamWarnings warnings; + if (is_precise_seam_strong(mode)) { + const auto seam = PreciseSeam::insert_strong_seam_point( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + REQUIRE(seam.has_value()); + CHECK(*seam == (mode == ModelVolumeType::PRECISE_SEAM_LEFT ? mm(0, 8) : + mode == ModelVolumeType::PRECISE_SEAM_RIGHT ? mm(0, 12) : mm(20, 10))); + } else { + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + REQUIRE(segments.size() == 1); + const auto types = weak_candidate_types(perimeter, segments); + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point &p = perimeter[i]; + const bool gap = p.x() == 0 && p.y() > scale_(8.) && p.y() < scale_(12.); + CHECK(types[i] == (gap ? SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral : + SeamPlacerImpl::EnforcedBlockedSeamPoint::Blocked)); + } + } + CHECK_FALSE(warnings.multiple_intersections.load()); + CHECK_FALSE(warnings.full_containment.load()); + CHECK(warnings.failed_fragments.load() == 0); + check_square_boundary(perimeter); +} + +TEST_CASE("Enforced oversampling stays inside a zone that wraps around a gap", "[PreciseSeam][Regression]") +{ + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + ExPolygon region(rectangle(-2, -2, 22, 22)); + region.holes.push_back(rectangle(-1, 8, 1, 12)); + region.holes.back().reverse(); + // The zone runs from (0, 8) around the square to (0, 12); the edge after its right boundary is the gap. + // Boundary helpers already keep that edge too short to split, so this guards the invariant, not a visible bug. + const auto *modifier = fixture.add_regions(ModelVolumeType::PRECISE_SEAM_ENFORCED, {region}); + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(segments.size() == 1); + CHECK(segments[0].left_point == mm(0, 8)); + CHECK(segments[0].right_point == mm(0, 12)); + + const auto types = weak_candidate_types(perimeter, segments); + Points gap_points; + size_t enforced_count = 0; + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point &p = perimeter[i]; + const bool gap = p.x() == 0 && p.y() > scale_(8.) && p.y() < scale_(12.); + if (gap) + gap_points.push_back(p); + else + ++enforced_count; + CHECK(types[i] == (gap ? SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral : + SeamPlacerImpl::EnforcedBlockedSeamPoint::Enforced)); + } + // Only the two boundary refinement helpers may lie in the gap; no oversampling points. + std::sort(gap_points.begin(), gap_points.end(), [](const Point &a, const Point &b) { return a.y() < b.y(); }); + CHECK(gap_points == Points{mm(0, 8.001), mm(0, 11.999)}); + // The 76 mm zone itself is oversampled: far more candidates than its corners and boundaries. + CHECK(enforced_count > 76. / SeamPlacer::enforcer_oversampling_distance - 10); + check_square_boundary(perimeter); +} + TEST_CASE("Coincident weak boundaries do not prevent later boundary refinement", "[PreciseSeam][Regression]") { SeamFixture fixture; Polygon perimeter = rectangle(0, 0, 20, 20); - // Duplicate boundaries used to stall the reverse cursor before reaching the separate segment. + // Duplicate boundaries must not stop refinement before the separate segment is reached. const auto *a = fixture.add(ModelVolumeType::PRECISE_SEAM_BLOCKED, {rectangle(2, -2, 6, 2)}); const auto *b = fixture.add(ModelVolumeType::PRECISE_SEAM_NEUTRAL, {rectangle(2, -2, 6, 2)}); const auto *c = fixture.add(ModelVolumeType::PRECISE_SEAM_BLOCKED, {rectangle(10, -2, 14, 2)}); - const auto segments = PreciseSeam::collect_weak_modifier_segments({c, b, a}, perimeter, fixture.layer, fixture.cache); + const auto segments = PreciseSeam::collect_weak_modifier_segments({c, b, a}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); REQUIRE(segments.size() == 3); for (double x : {1.999, 6.001, 9.999, 14.001}) require_vertex(perimeter, mm(x, 0)); check_square_boundary(perimeter); } +TEST_CASE("Weak boundaries on one source edge retain insertion order and modifier priority", "[PreciseSeam][Regression]") +{ + const bool closing_edge = GENERATE(false, true); + const bool coincident = GENERATE(false, true); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + const Polygon outer = closing_edge ? rectangle(-2, 2, 2, 8) : rectangle(2, -2, 8, 2); + const Polygon inner = coincident ? outer : + (closing_edge ? rectangle(-2, 4, 2, 6) : rectangle(4, -2, 6, 2)); + const auto *blocked = fixture.add(ModelVolumeType::PRECISE_SEAM_BLOCKED, {outer}); + const auto *neutral = fixture.add(ModelVolumeType::PRECISE_SEAM_NEUTRAL, {inner}); + // Priority order is not geometric insertion order; Neutral must win in the overlap. + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {blocked, neutral}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(segments.size() == 2); + CHECK(segments[0].type == SeamPlacerImpl::EnforcedBlockedSeamPoint::Blocked); + CHECK(segments[1].type == SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral); + CHECK(segments[0].left_position.edge_index == (closing_edge ? 3 : 0)); + CHECK(segments[0].right_position.edge_index == (closing_edge ? 3 : 0)); + CHECK_THAT(segments[0].left_position.parameter, Catch::Matchers::WithinAbs(closing_edge ? 0.6 : 0.1, 1e-12)); + CHECK_THAT(segments[0].right_position.parameter, Catch::Matchers::WithinAbs(closing_edge ? 0.9 : 0.4, 1e-12)); + + const auto types = weak_candidate_types(perimeter, segments); + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point &p = perimeter[i]; + const coord_t along = closing_edge ? p.y() : p.x(); + const coord_t across = closing_edge ? p.x() : p.y(); + const bool in_outer = across == 0 && along >= scale_(2.) && along <= scale_(8.); + const bool in_inner = coincident ? in_outer : + (across == 0 && along >= scale_(4.) && along <= scale_(6.)); + const auto expected = in_outer && !in_inner ? SeamPlacerImpl::EnforcedBlockedSeamPoint::Blocked : + SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral; + CHECK(types[i] == expected); + } + // Ascending insertion on one edge would retrace the contour or lose pending boundaries. + check_square_boundary(perimeter); +} + +TEST_CASE("Weak zones overwrite painted candidate types inside their boundaries only", "[PreciseSeam][Regression]") +{ + using Type = SeamPlacerImpl::EnforcedBlockedSeamPoint; + // The bottom side is painted Enforced or Blocked, the top side Blocked; the vertical sides stay Neutral. + const Type painted_bottom = GENERATE(Type::Enforced, Type::Blocked); + const auto zone_type = GENERATE(ModelVolumeType::PRECISE_SEAM_ENFORCED, ModelVolumeType::PRECISE_SEAM_BLOCKED, + ModelVolumeType::PRECISE_SEAM_NEUTRAL); + CAPTURE(int(painted_bottom), int(zone_type)); + const Type expected_zone = zone_type == ModelVolumeType::PRECISE_SEAM_ENFORCED ? Type::Enforced : + zone_type == ModelVolumeType::PRECISE_SEAM_BLOCKED ? Type::Blocked : Type::Neutral; + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + // The zone covers x in [6, 14] on the bottom side only. + const auto *modifier = fixture.add(zone_type, {rectangle(6, -2, 14, 2)}); + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(segments.size() == 1); + const auto painted = [painted_bottom](const Point &p) { + return p.y() == 0 ? painted_bottom : p.y() == mm(0, 20).y() ? Type::Blocked : Type::Neutral; + }; + const auto types = weak_candidate_types(perimeter, segments, painted); + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point &p = perimeter[i]; + CAPTURE(p.x(), p.y()); + const bool inside = p.y() == 0 && p.x() >= mm(6, 0).x() && p.x() <= mm(14, 0).x(); + // Inside the zone the weak type wins over painting, Neutral clearing it; outside, painting stays. + CHECK(types[i] == (inside ? expected_zone : painted(p))); + } +} + TEST_CASE("Weak boundaries sharing a vertex refine both sides", "[PreciseSeam]") { SeamFixture fixture; Polygon perimeter = rectangle(0, 0, 20, 20); const auto *a = fixture.add(ModelVolumeType::PRECISE_SEAM_BLOCKED, {rectangle(2, -2, 6, 2)}); const auto *b = fixture.add(ModelVolumeType::PRECISE_SEAM_NEUTRAL, {rectangle(6, -2, 10, 2)}); - const auto segments = PreciseSeam::collect_weak_modifier_segments({a, b}, perimeter, fixture.layer, fixture.cache); + const auto segments = PreciseSeam::collect_weak_modifier_segments({a, b}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); REQUIRE(segments.size() == 2); require_vertex(perimeter, mm(5.999, 0)); require_vertex(perimeter, mm(6.001, 0)); check_square_boundary(perimeter); } -TEST_CASE("Unsupported modifier sections are skipped with the appropriate warning", "[PreciseSeam]") +TEST_CASE("Weak processing applies every ready interval and leaves gaps unchanged", "[PreciseSeam][SegmentExtraction]") +{ + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + ExPolygon area(rectangle(1, -3, 10, 3)); + area.holes.push_back(rectangle(4, -1, 7, 1)); + area.holes.back().reverse(); + const auto *modifier = fixture.add_regions(ModelVolumeType::PRECISE_SEAM_BLOCKED, + {area, ExPolygon(rectangle(14, -3, 18, 3))}); + PreciseSeam::PreciseSeamWarnings warnings; + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + REQUIRE(segments.size() == 3); + const Points starts{mm(1, 0), mm(7, 0), mm(14, 0)}; + const Points ends{mm(4, 0), mm(10, 0), mm(18, 0)}; + for (size_t i = 0; i < segments.size(); ++i) { + CHECK(segments[i].left_point == starts[i]); + CHECK(segments[i].right_point == ends[i]); + require_vertex(perimeter, starts[i]); + require_vertex(perimeter, ends[i]); + } + const auto types = weak_candidate_types(perimeter, segments); + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point &point = perimeter[i]; + // Classify the three independent intervals, including their boundary vertices. + const bool inside = point.y() == 0 && + ((point.x() >= starts[0].x() && point.x() <= ends[0].x()) || + (point.x() >= starts[1].x() && point.x() <= ends[1].x()) || + (point.x() >= starts[2].x() && point.x() <= ends[2].x())); + CHECK(types[i] == (inside ? SeamPlacerImpl::EnforcedBlockedSeamPoint::Blocked : + SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral)); + } + CHECK_FALSE(warnings.multiple_intersections.load()); + CHECK_FALSE(warnings.full_containment.load()); + CHECK(warnings.failed_fragments.load() == 0); + check_square_boundary(perimeter); +} + +TEST_CASE("Weak priority and enforcement refinement apply on both crossed sides", "[PreciseSeam][SegmentExtraction]") +{ + const auto high_type = GENERATE(ModelVolumeType::PRECISE_SEAM_BLOCKED, ModelVolumeType::PRECISE_SEAM_NEUTRAL); + const auto expected_high = high_type == ModelVolumeType::PRECISE_SEAM_BLOCKED ? + SeamPlacerImpl::EnforcedBlockedSeamPoint::Blocked : SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral; + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + const auto *low = fixture.add(ModelVolumeType::PRECISE_SEAM_ENFORCED, {rectangle(8, -2, 12, 22)}); + const auto *high = fixture.add(high_type, {rectangle(10, -2, 14, 22)}); + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {low, high}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(segments.size() == 4); + CHECK(segments[0].type == SeamPlacerImpl::EnforcedBlockedSeamPoint::Enforced); + CHECK(segments[1].type == SeamPlacerImpl::EnforcedBlockedSeamPoint::Enforced); + CHECK(segments[2].type == expected_high); + CHECK(segments[3].type == expected_high); + const auto types = weak_candidate_types(perimeter, segments); + size_t enforced_counts[2] = {0, 0}; + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point &point = perimeter[i]; + const bool side = point.y() == 0 || point.y() == mm(0, 20).y(); + auto expected = SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral; + if (side && point.x() >= mm(8, 0).x() && point.x() <= mm(12, 0).x()) + expected = SeamPlacerImpl::EnforcedBlockedSeamPoint::Enforced; + if (side && point.x() >= mm(10, 0).x() && point.x() <= mm(14, 0).x()) + expected = expected_high; + CHECK(types[i] == expected); + if (expected == SeamPlacerImpl::EnforcedBlockedSeamPoint::Enforced) + ++enforced_counts[point.y() == 0 ? 0 : 1]; + } + // Both surviving enforced patches must contain interior candidates, not just boundaries. + CHECK(enforced_counts[0] > 2); + CHECK(enforced_counts[1] > 2); + check_square_boundary(perimeter); +} + +TEST_CASE("Weak full containment follows painting: Enforced and Neutral type the whole perimeter, Blocked is skipped", "[PreciseSeam]") +{ + const auto type = GENERATE(ModelVolumeType::PRECISE_SEAM_ENFORCED, ModelVolumeType::PRECISE_SEAM_BLOCKED, + ModelVolumeType::PRECISE_SEAM_NEUTRAL); + CAPTURE(type); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + const Points original = perimeter.points; + const auto *modifier = fixture.add(type, {rectangle(-2, -2, 22, 22)}); + PreciseSeam::PreciseSeamWarnings warnings; + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + // Painting of both kinds, so that each type's effect on it is visible. + const auto painted = [](const Point &p) { + return p.x() < scale_(10.) ? SeamPlacerImpl::EnforcedBlockedSeamPoint::Enforced : + SeamPlacerImpl::EnforcedBlockedSeamPoint::Blocked; + }; + const auto types = weak_candidate_types(perimeter, segments, painted); + CHECK_FALSE(warnings.multiple_intersections.load()); + CHECK(warnings.failed_fragments.load() == 0); + if (type == ModelVolumeType::PRECISE_SEAM_BLOCKED) { + // Forbidding the seam all round cannot be honoured: skipped with a warning, painting stays. + CHECK(segments.empty()); + CHECK(perimeter.points == original); + CHECK(warnings.full_containment.load() == PreciseSeam::PreciseSeamWarnings::type_bit(type)); + for (size_t i = 0; i < perimeter.size(); ++i) + CHECK(types[i] == painted(perimeter[i])); + return; + } + REQUIRE(segments.size() == 1); + CHECK(segments.front().whole_perimeter); + CHECK(warnings.full_containment.load() == 0); + // Every candidate takes the zone's type, overriding painting. + const auto expected = type == ModelVolumeType::PRECISE_SEAM_ENFORCED ? SeamPlacerImpl::EnforcedBlockedSeamPoint::Enforced : + SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral; + for (size_t i = 0; i < perimeter.size(); ++i) + CHECK(types[i] == expected); + if (type == ModelVolumeType::PRECISE_SEAM_ENFORCED) { + // As if painted green all round: every 20 mm edge is subdivided into steps of at most 0.2 mm. + CHECK(perimeter.size() >= size_t(80.f / SeamPlacer::enforcer_oversampling_distance)); + check_square_boundary(perimeter); + } else + CHECK(perimeter.points == original); // Like an unmarked perimeter: no subdivision. +} + +TEST_CASE("Whole-perimeter weak zones take part in the usual priority order", "[PreciseSeam]") +{ + // Volumes are listed low priority first; a later zone overwrites an earlier one. + const int scenario = GENERATE(0, 1, 2); + CAPTURE(scenario); + SeamFixture fixture; + const auto *whole_enforced = fixture.add(ModelVolumeType::PRECISE_SEAM_ENFORCED, {rectangle(-2, -2, 22, 22)}); + const auto *whole_neutral = fixture.add(ModelVolumeType::PRECISE_SEAM_NEUTRAL, {rectangle(-2, -2, 22, 22)}); + const auto *whole_blocked = fixture.add(ModelVolumeType::PRECISE_SEAM_BLOCKED, {rectangle(-2, -2, 22, 22)}); + const auto *band_blocked = fixture.add(ModelVolumeType::PRECISE_SEAM_BLOCKED, {rectangle(8, -2, 12, 2)}); + const auto *band_enforced = fixture.add(ModelVolumeType::PRECISE_SEAM_ENFORCED, {rectangle(8, -2, 12, 2)}); + std::vector volumes; + if (scenario == 0) volumes = {whole_enforced, band_blocked}; // A band forbidden inside a green perimeter. + if (scenario == 1) volumes = {band_enforced, whole_neutral}; // A whole Neutral clears the lower band. + if (scenario == 2) volumes = {band_enforced, whole_blocked}; // A whole Blocked is skipped; the band stays. + Polygon perimeter = rectangle(0, 0, 20, 20); + PreciseSeam::PreciseSeamWarnings warnings; + const auto segments = PreciseSeam::collect_weak_modifier_segments( + volumes, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + const auto types = weak_candidate_types(perimeter, segments); + using Type = SeamPlacerImpl::EnforcedBlockedSeamPoint; + for (size_t i = 0; i < perimeter.size(); ++i) { + const Point &p = perimeter[i]; + CAPTURE(p.x(), p.y()); + const bool in_band = p.y() == 0 && p.x() >= scale_(8.) && p.x() <= scale_(12.); + const Type expected = scenario == 0 ? (in_band ? Type::Blocked : Type::Enforced) : + scenario == 1 ? Type::Neutral : + (in_band ? Type::Enforced : Type::Neutral); + CHECK(types[i] == expected); + } + CHECK(warnings.full_containment.load() == + (scenario == 2 ? PreciseSeam::PreciseSeamWarnings::type_bit(ModelVolumeType::PRECISE_SEAM_BLOCKED) : 0u)); + check_square_boundary(perimeter); +} + +TEST_CASE("Coverage short by a gap under 1 um is full containment while a narrow band keeps its point", "[PreciseSeam][Regression]") +{ + // A tip pokes through the bottom edge at x = 10 mm by `depth` nm, so the perimeter line crosses it + // over about 2 * depth. As a hole in a large region it leaves that much uncovered (a touch from + // inside); as a separate triangle it is that much covered (a narrow band or an outside contact). + const auto type = GENERATE(ModelVolumeType::PRECISE_SEAM_ENFORCED, ModelVolumeType::PRECISE_SEAM_CENTER, + ModelVolumeType::PRECISE_SEAM_LEFT, ModelVolumeType::PRECISE_SEAM_RIGHT); + const bool gap = GENERATE(true, false); + const coord_t depth = GENERATE(coord_t(2), coord_t(2000)); + CAPTURE(type, gap, depth); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + const Points original = perimeter.points; + const Point tip(mm(10, 0).x(), gap ? -depth : depth); + ExPolygon region; + if (gap) { + region = ExPolygon(rectangle(-2, -2, 22, 22)); + region.holes.push_back(Polygon(Points{tip, mm(11, 1), mm(9, 1)})); + region.holes.back().reverse(); + } else { + region = ExPolygon(Polygon(Points{mm(9, -1), mm(11, -1), tip})); + } + const auto *modifier = fixture.add_regions(type, {region}); + const bool micro = depth < scale_(0.001); + PreciseSeam::PreciseSeamWarnings warnings; + if (is_precise_seam_strong(type)) { + const auto seam = PreciseSeam::insert_strong_seam_point( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + if (gap && micro) { + // Skipped like an exact touch, instead of a seam at the touch or on the opposite side. + CHECK_FALSE(seam.has_value()); + CHECK(perimeter.points == original); + } else { + REQUIRE(seam.has_value()); + if (!gap) // The band is processed normally: the seam lands on it. + CHECK((*seam - mm(10, 0)).cast().norm() <= double(depth) + 1.); + } + } else { + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + const auto types = weak_candidate_types(perimeter, segments); + const size_t enforced = size_t(std::count(types.begin(), types.end(), SeamPlacerImpl::EnforcedBlockedSeamPoint::Enforced)); + if (gap && micro) { + // Full containment like an exact touch, instead of collapsing the intended zone into one forced + // point: Enforced then types the whole perimeter, subdivided as if painted green all round. + REQUIRE(segments.size() == 1); + CHECK(segments.front().whole_perimeter); + CHECK(enforced == types.size()); + CHECK(enforced > 300); + } else if (gap) { + REQUIRE(segments.size() == 1); + CHECK(enforced > 300); // A 4 um gap is real: nearly the whole 80 mm perimeter, oversampled. + } else { + // The band is processed normally; below 1 um its boundaries snap into a single candidate. + REQUIRE(segments.size() == 1); + CHECK(enforced == (micro ? 1u : 2u)); + } + } + // Only the sub-micron gap is full containment, and only strong types skip it with a warning; + // nothing here is a binding failure. + CHECK((warnings.full_containment.load() != 0) == (gap && micro && is_precise_seam_strong(type))); + CHECK(warnings.failed_fragments.load() == 0); + check_square_boundary(perimeter); +} + +TEST_CASE("A modifier touching the perimeter at one point keeps the full containment policy", "[PreciseSeam][Regression]") +{ + const auto type = GENERATE(ModelVolumeType::PRECISE_SEAM_CENTER, ModelVolumeType::PRECISE_SEAM_LEFT, + ModelVolumeType::PRECISE_SEAM_RIGHT, ModelVolumeType::PRECISE_SEAM_ENFORCED, + ModelVolumeType::PRECISE_SEAM_BLOCKED, ModelVolumeType::PRECISE_SEAM_NEUTRAL); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + const Points original = perimeter.points; + // The hole touches the perimeter only at (10, 0): no gap, so the contact must not create segments. + ExPolygon region(rectangle(-2, -2, 22, 22)); + region.holes.push_back(Polygon(Points{mm(10, 0), mm(12, 2), mm(10, 4), mm(8, 2)})); + region.holes.back().reverse(); + const auto *modifier = fixture.add_regions(type, {region}); + PreciseSeam::PreciseSeamWarnings warnings; + if (is_precise_seam_strong(type)) + CHECK_FALSE(PreciseSeam::insert_strong_seam_point( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings).has_value()); + else { + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + // Enforced and Neutral type the whole perimeter; Blocked is skipped. + if (type == ModelVolumeType::PRECISE_SEAM_BLOCKED) + CHECK(segments.empty()); + else { + REQUIRE(segments.size() == 1); + CHECK(segments.front().whole_perimeter); + } + } + // Only a whole-perimeter Enforced zone subdivides the edges. + if (type != ModelVolumeType::PRECISE_SEAM_ENFORCED) + CHECK(perimeter.points == original); + const bool skipped = is_precise_seam_strong(type) || type == ModelVolumeType::PRECISE_SEAM_BLOCKED; + CHECK(warnings.full_containment.load() == (skipped ? PreciseSeam::PreciseSeamWarnings::type_bit(type) : 0u)); + CHECK_FALSE(warnings.multiple_intersections.load()); + CHECK(warnings.failed_fragments.load() == 0); +} + +TEST_CASE("Unsupported strong modifier sections are skipped with the appropriate warning", "[PreciseSeam]") { const int scenario = GENERATE(0, 1, 2, 3); SeamFixture fixture; @@ -175,35 +858,149 @@ TEST_CASE("Unsupported modifier sections are skipped with the appropriate warnin hole.reverse(); slices = {rectangle(-2, -2, 22, 22), hole}; } - const auto *modifier = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, std::move(slices)); + const auto *modifier = scenario == 3 ? + fixture.add_regions(ModelVolumeType::PRECISE_SEAM_CENTER, {ExPolygon(slices[0], slices[1])}) : + fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, std::move(slices)); PreciseSeam::PreciseSeamWarnings warnings; - CHECK_FALSE(PreciseSeam::insert_strong_seam_point({modifier}, perimeter, fixture.layer, fixture.cache, &warnings).has_value()); + CHECK_FALSE(PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings).has_value()); CHECK(perimeter.points == original); - CHECK(warnings.full_containment.load() == (scenario == 2)); - CHECK(warnings.multiply_connected.load() == (scenario == 3)); + CHECK((warnings.full_containment.load() != 0) == (scenario == 2 || scenario == 3)); CHECK_FALSE(warnings.multiple_intersections.load()); - CHECK_FALSE(warnings.through_body.load()); +} + +TEST_CASE("Strong selects the longest arc rather than the longest chord", "[PreciseSeam][SegmentExtraction]") +{ + const auto mode = GENERATE(ModelVolumeType::PRECISE_SEAM_LEFT, ModelVolumeType::PRECISE_SEAM_CENTER, + ModelVolumeType::PRECISE_SEAM_RIGHT); + const size_t origin = GENERATE(size_t(0), size_t(2)); + const bool reverse_regions = GENERATE(false, true); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + std::rotate(perimeter.points.begin(), perimeter.points.begin() + origin, perimeter.points.end()); + // The corner arc is 8 mm with a shorter chord than the other 6 mm interval. + ExPolygons regions{ExPolygon(rectangle(10, -2, 16, 2)), ExPolygon(rectangle(-2, -2, 4, 4))}; + if (reverse_regions) std::reverse(regions.begin(), regions.end()); + const auto *modifier = fixture.add_regions(mode, std::move(regions)); + PreciseSeam::PreciseSeamWarnings warnings; + const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + REQUIRE(seam.has_value()); + CHECK(*seam == (mode == ModelVolumeType::PRECISE_SEAM_LEFT ? mm(0, 4) : + mode == ModelVolumeType::PRECISE_SEAM_RIGHT ? mm(4, 0) : mm(0, 0))); + CHECK(warnings.multiple_intersections.load()); + check_square_boundary(perimeter); +} + +TEST_CASE("Equal strong lengths compare the selected mode points", "[PreciseSeam][SegmentExtraction]") +{ + const auto mode = GENERATE(ModelVolumeType::PRECISE_SEAM_LEFT, ModelVolumeType::PRECISE_SEAM_CENTER, + ModelVolumeType::PRECISE_SEAM_RIGHT); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + // Both arcs are 6 mm: Left/Center prefer the corner; Right prefers the rear straight segment. + const auto *modifier = fixture.add(mode, {rectangle(10, 18, 16, 22), rectangle(-2, 17, 3, 22)}); + const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(seam.has_value()); + CHECK(*seam == (mode == ModelVolumeType::PRECISE_SEAM_LEFT ? mm(3, 20) : + mode == ModelVolumeType::PRECISE_SEAM_RIGHT ? mm(10, 20) : mm(0, 20))); + check_square_boundary(perimeter); +} + +TEST_CASE("Strong length comparison does not merge nearly equal lengths", "[PreciseSeam][SegmentExtraction]") +{ + const coord_t extra = GENERATE(coord_t(0), coord_t(1)); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + Polygon second = rectangle(12, -2, 16, 2); + second.points[1].x() += extra; + second.points[2].x() += extra; + const auto *modifier = fixture.add(ModelVolumeType::PRECISE_SEAM_LEFT, {rectangle(2, -2, 6, 2), second}); + const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(seam.has_value()); + CHECK(*seam == (extra == 0 ? mm(2, 0) : mm(12, 0))); +} + +TEST_CASE("Strong priority wins over a longer segment in another modifier", "[PreciseSeam][SegmentExtraction]") +{ + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + const auto *high = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {rectangle(2, -2, 4, 2)}); + const auto *low = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {rectangle(1, 18, 19, 22)}); + const auto seam = PreciseSeam::insert_strong_seam_point({high, low}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(seam.has_value()); + CHECK(*seam == mm(3, 0)); + CHECK(std::find(perimeter.points.begin(), perimeter.points.end(), mm(10, 20)) == perimeter.points.end()); +} + +TEST_CASE("Strong continues past modifiers without usable segments", "[PreciseSeam][SegmentExtraction]") +{ + const bool contained = GENERATE(false, true); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + const auto *first = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, + {contained ? rectangle(-2, -2, 22, 22) : rectangle(30, 30, 40, 40)}); + const auto *second = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {rectangle(2, -2, 6, 2)}); + PreciseSeam::PreciseSeamWarnings warnings; + const auto seam = PreciseSeam::insert_strong_seam_point({first, second}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + REQUIRE(seam.has_value()); + CHECK(*seam == mm(4, 0)); + CHECK((warnings.full_containment.load() != 0) == contained); +} + +TEST_CASE("Strong compares all segments of structured modifier regions", "[PreciseSeam][SegmentExtraction]") +{ + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + ExPolygon area(rectangle(1, -3, 10, 3)); + area.holes.push_back(rectangle(4, -1, 7, 1)); + area.holes.back().reverse(); + const auto *modifier = fixture.add_regions(ModelVolumeType::PRECISE_SEAM_CENTER, + {area, ExPolygon(rectangle(14, -3, 18, 3))}); + PreciseSeam::PreciseSeamWarnings warnings; + const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + REQUIRE(seam.has_value()); + CHECK(*seam == mm(16, 0)); + CHECK(warnings.multiple_intersections.load()); + CHECK_FALSE(warnings.full_containment.load()); + CHECK(warnings.failed_fragments.load() == 0); + check_square_boundary(perimeter); +} + +TEST_CASE("Strong tie order uses bed axes after rotating and translating the input", "[PreciseSeam][SegmentExtraction]") +{ + const bool rotated = GENERATE(false, true); + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + Polygon modifier_region = rectangle(8, -2, 12, 22); + const auto transform = [rotated](Point &p) { + // Rotation is already baked into slice coordinates; translation cannot change ordering. + if (rotated) p = Point(-p.y(), p.x()); + p += mm(100, 200); + }; + for (Point &p : perimeter.points) transform(p); + for (Point &p : modifier_region.points) transform(p); + const auto *modifier = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {modifier_region}); + const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(seam.has_value()); + CHECK(*seam == (rotated ? mm(80, 210) : mm(110, 220))); } TEST_CASE("Strong modifiers warn when another slice polygon also intersects the perimeter", "[PreciseSeam]") { SeamFixture fixture; Polygon perimeter = rectangle(0, 0, 20, 20); - // One helper has two disconnected sections; only its first section supplies the seam. + // Equal lengths on the same side select the leftmost mode point, independent of slice order. const auto *modifier = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {rectangle(2, -2, 6, 2), rectangle(12, -2, 16, 2)}); PreciseSeam::PreciseSeamWarnings warnings; - const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, fixture.layer, fixture.cache, &warnings); + const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); REQUIRE(seam.has_value()); CHECK(*seam == mm(4, 0)); CHECK(warnings.multiple_intersections.load()); - CHECK_FALSE(warnings.through_body.load()); CHECK_FALSE(warnings.full_containment.load()); - CHECK_FALSE(warnings.multiply_connected.load()); check_square_boundary(perimeter); } -TEST_CASE("Modifiers crossing the entire body raise a through body warning", "[PreciseSeam]") +TEST_CASE("Crossing modifiers choose the rear strong segment and keep both weak segments", "[PreciseSeam]") { const bool strong = GENERATE(false, true); CAPTURE(strong); @@ -215,20 +1012,19 @@ TEST_CASE("Modifiers crossing the entire body raise a through body warning", "[P const auto *modifier = fixture.add(type, {rectangle(8, -2, 12, 22)}); PreciseSeam::PreciseSeamWarnings warnings; if (strong) { - const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, fixture.layer, fixture.cache, &warnings); + const auto seam = PreciseSeam::insert_strong_seam_point({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); REQUIRE(seam.has_value()); - CHECK(seam->x() == mm(10, 0).x()); - // Either boundary segment may be encountered first by the clipping traversal. - const bool on_crossed_side = seam->y() == 0 || seam->y() == mm(0, 20).y(); - CHECK(on_crossed_side); + CHECK(*seam == mm(10, 20)); } else { - const auto segments = PreciseSeam::collect_weak_modifier_segments({modifier}, perimeter, fixture.layer, fixture.cache, &warnings); - REQUIRE_FALSE(segments.empty()); + const auto segments = PreciseSeam::collect_weak_modifier_segments({modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache, &warnings); + REQUIRE(segments.size() == 2); + CHECK(segments[0].left_point == mm(8, 0)); + CHECK(segments[0].right_point == mm(12, 0)); + CHECK(segments[1].left_point == mm(12, 20)); + CHECK(segments[1].right_point == mm(8, 20)); } - CHECK(warnings.through_body.load()); - CHECK_FALSE(warnings.multiple_intersections.load()); // The clipped strip is one polygon. + CHECK((warnings.multiple_intersections.load() != 0) == strong); // Warn only strong, after collecting all segments. CHECK_FALSE(warnings.full_containment.load()); - CHECK_FALSE(warnings.multiply_connected.load()); check_square_boundary(perimeter); } @@ -253,12 +1049,12 @@ TEST_CASE("Modifier hierarchy keeps strong order and applies the highest weak pr CHECK(strong == std::vector{strong_a, strong_b}); CHECK(weak == std::vector{low, high}); Polygon perimeter = rectangle(0, 0, 20, 20); - const auto seam = PreciseSeam::insert_strong_seam_point(strong, perimeter, fixture.layer, fixture.cache); + const auto seam = PreciseSeam::insert_strong_seam_point(strong, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); REQUIRE(seam.has_value()); CHECK(*seam == mm(2, 0)); perimeter = rectangle(0, 0, 20, 20); - const auto segments = PreciseSeam::collect_weak_modifier_segments(weak, perimeter, fixture.layer, fixture.cache); + const auto segments = PreciseSeam::collect_weak_modifier_segments(weak, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); REQUIRE(segments.size() == 2); PrintObjectSeamData::LayerSeams result; result.perimeters.emplace_back(); @@ -292,3 +1088,341 @@ TEST_CASE("Modifier hierarchy keeps strong order and applies the highest weak pr } CHECK(result.points.front().type == SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral); } + +TEST_CASE("Volume sorting keeps strong before weak Precise Seam modifiers and the user order inside each group", "[PreciseSeam][Model]") +{ + Model model; + ModelObject *object = model.add_object(); + // Enum order inside a group (Center < Right, Enforced < Neutral) is deliberately reversed here: + // only the group may move a volume, the user's order inside it must survive. + const auto add = [object](ModelVolumeType type) { + ModelVolume *volume = object->add_volume(Test::cube(1)); + volume->set_type(type); + return volume; + }; + ModelVolume *part = add(ModelVolumeType::MODEL_PART); + ModelVolume *modifier = add(ModelVolumeType::PARAMETER_MODIFIER); + ModelVolume *second_part = add(ModelVolumeType::MODEL_PART); + ModelVolume *weak_neutral = add(ModelVolumeType::PRECISE_SEAM_NEUTRAL); + ModelVolume *strong_right = add(ModelVolumeType::PRECISE_SEAM_RIGHT); + ModelVolume *weak_enforced = add(ModelVolumeType::PRECISE_SEAM_ENFORCED); + ModelVolume *strong_center = add(ModelVolumeType::PRECISE_SEAM_CENTER); + const ModelVolumePtrs original = object->volumes; + + // A full sort orders parts before modifiers; a partial one keeps parts and modifiers as they are. + const bool full_sort = GENERATE(false, true); + CAPTURE(full_sort); + object->volumes = original; + object->sort_volumes(full_sort); + const ModelVolumePtrs expected_head = full_sort ? ModelVolumePtrs{part, second_part, modifier} + : ModelVolumePtrs{part, modifier, second_part}; + ModelVolumePtrs expected = expected_head; + for (ModelVolume *volume : {strong_right, strong_center, weak_neutral, weak_enforced}) + expected.push_back(volume); + CHECK(object->volumes == expected); +} + +TEST_CASE("Restoring Precise Seam positions overrides alignment only on perimeters with a strong point", "[PreciseSeam]") +{ + std::vector layers(1); + PrintObjectSeamData::LayerSeams &layer = layers.front(); + // Two perimeters of three candidates each; alignment has already finalized both. + for (size_t loop_idx = 0; loop_idx < 2; ++loop_idx) { + layer.perimeters.emplace_back(); + SeamPlacerImpl::Perimeter &loop = layer.perimeters.back(); + loop.start_index = layer.points.size(); + for (size_t i = 0; i < 3; ++i) + layer.points.emplace_back(Vec3f(float(i), float(loop_idx), 0.f), loop, 0.f, + SeamPlacerImpl::EnforcedBlockedSeamPoint::Neutral); + loop.end_index = layer.points.size(); + loop.finalized = true; + loop.seam_index = loop.start_index; + loop.final_seam_position = Vec3f(0.5f, float(loop_idx), 0.f); + } + SeamPlacerImpl::Perimeter &strong = layer.perimeters[0]; + SeamPlacerImpl::Perimeter &plain = layer.perimeters[1]; + strong.precise_seam_point = Vec3f(2.f, 0.f, 0.f); + strong.precise_seam_index = 2; + + PreciseSeam::restore_precise_seam_positions(layers); + + // The strong point and its candidate index replace the aligned position. + CHECK(strong.final_seam_position == Vec3f(2.f, 0.f, 0.f)); + CHECK(strong.seam_index == 2); + // A perimeter without a strong point keeps whatever alignment chose. + CHECK(plain.final_seam_position == Vec3f(0.5f, 1.f, 0.f)); + CHECK(plain.seam_index == plain.start_index); +} + +TEST_CASE("Modifier usage marks evaluated modifiers that never reach a perimeter", "[PreciseSeam]") +{ + SeamFixture fixture; + PreciseSeam::PreciseSeamWarnings warnings; + const auto checked = [&warnings](const ModelVolume *volume) { return warnings.modifier_usage.at(volume).checked.load(); }; + const auto reached = [&warnings](const ModelVolume *volume) { return warnings.modifier_usage.at(volume).reached.load(); }; + + // Weak: all modifiers are evaluated. One stops 1 mm short of the wall, one crosses it, one contains it. + const ModelVolume *short_weak = fixture.add(ModelVolumeType::PRECISE_SEAM_ENFORCED, {rectangle(21, 5, 25, 10)}); + const ModelVolume *crossing_weak = fixture.add(ModelVolumeType::PRECISE_SEAM_BLOCKED, {rectangle(18, 5, 25, 10)}); + const ModelVolume *containing_weak = fixture.add(ModelVolumeType::PRECISE_SEAM_NEUTRAL, {rectangle(-1, -1, 21, 21)}); + for (const ModelVolume *volume : {short_weak, crossing_weak, containing_weak}) + warnings.modifier_usage.try_emplace(volume); + Polygon weak_perimeter = rectangle(0, 0, 20, 20); + PreciseSeam::collect_weak_modifier_segments({short_weak, crossing_weak, containing_weak}, weak_perimeter, + PreciseSeam::PreparedPerimeter(weak_perimeter), fixture.layer, fixture.cache, &warnings); + CHECK(checked(short_weak)); + CHECK_FALSE(reached(short_weak)); + CHECK(reached(crossing_weak)); + // Full containment reached the perimeter even though it is skipped. + CHECK(reached(containing_weak)); + + // Strong: evaluation stops at the first modifier with a segment. The one ending 0.5 mm before the + // wall is evaluated without reaching it; the one after the winner is never evaluated, so nothing is + // known about it and it must not be reported. + const ModelVolume *short_strong = fixture.add(ModelVolumeType::PRECISE_SEAM_LEFT, {rectangle(5, -2, 10, -0.5)}); + const ModelVolume *winner = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {rectangle(5, -2, 10, 2)}); + const ModelVolume *shadowed = fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, {rectangle(12, -2, 15, 2)}); + for (const ModelVolume *volume : {short_strong, winner, shadowed}) + warnings.modifier_usage.try_emplace(volume); + Polygon strong_perimeter = rectangle(0, 0, 20, 20); + REQUIRE(PreciseSeam::insert_strong_seam_point({short_strong, winner, shadowed}, strong_perimeter, + PreciseSeam::PreparedPerimeter(strong_perimeter), fixture.layer, fixture.cache, &warnings).has_value()); + CHECK(checked(short_strong)); + CHECK_FALSE(reached(short_strong)); + CHECK(reached(winner)); + CHECK_FALSE(checked(shadowed)); + + // Unregistered modifiers are not tracked. + const ModelVolume *unregistered = fixture.add(ModelVolumeType::PRECISE_SEAM_ENFORCED, {rectangle(18, 5, 25, 10)}); + Polygon other_perimeter = rectangle(0, 0, 20, 20); + PreciseSeam::collect_weak_modifier_segments({unregistered}, other_perimeter, + PreciseSeam::PreparedPerimeter(other_perimeter), fixture.layer, fixture.cache, &warnings); + CHECK(warnings.modifier_usage.count(unregistered) == 0); +} + +TEST_CASE("Weak zones type painting's oversampled candidates between their boundaries", "[PreciseSeam]") +{ + SeamFixture fixture; + Polygon perimeter = rectangle(0, 0, 20, 20); + const auto *modifier = fixture.add(ModelVolumeType::PRECISE_SEAM_NEUTRAL, {rectangle(8, -2, 12, 2)}); + const auto segments = PreciseSeam::collect_weak_modifier_segments( + {modifier}, perimeter, PreciseSeam::PreparedPerimeter(perimeter), fixture.layer, fixture.cache); + REQUIRE(segments.size() == 1); + + // Candidates as production builds them for a bottom edge painted green: every polygon point, then + // oversampled points every enforcer_oversampling_distance towards the next one, in float arithmetic. + using Type = SeamPlacerImpl::EnforcedBlockedSeamPoint; + PrintObjectSeamData::LayerSeams candidates; + candidates.perimeters.emplace_back(); + auto &loop = candidates.perimeters.back(); + loop.start_index = 0; + size_t oversampled = 0; + for (size_t i = 0; i < perimeter.size(); ++i) { + const Vec2f a = unscale(perimeter[i]).cast(); + const Vec2f b = unscale(perimeter[(i + 1) % perimeter.size()]).cast(); + const Vec3f position(a.x(), a.y(), 0.f); + candidates.points.emplace_back(position, loop, 0.f, a.y() == 0.f ? Type::Enforced : Type::Neutral); + if (a.y() != 0.f || b.y() != 0.f) + continue; + const Vec3f next(b.x(), b.y(), 0.f); + const float distance = (next - position).norm(); + const Vec3f direction = (next - position).normalized(); + for (float step = SeamPlacer::enforcer_oversampling_distance; step < distance; step += SeamPlacer::enforcer_oversampling_distance) { + candidates.points.emplace_back(position + direction * step, loop, 0.f, Type::Enforced); + ++oversampled; + } + } + loop.end_index = candidates.points.size(); + bool enforced = false; + PreciseSeam::apply_weak_modifiers_to_perimeter(segments, candidates, loop, enforced); + + // Boundaries are found among the interleaved points by exact float identity; every candidate + // between them, oversampled ones included, is cleared, and painting stays outside. + size_t cleared_oversampled = 0; + for (const auto &candidate : candidates.points) { + const Vec3f &p = candidate.position; + CAPTURE(p.x(), p.y()); + const bool in_zone = p.y() == 0.f && p.x() >= 8.f && p.x() <= 12.f; + const Type expected = in_zone ? Type::Neutral : p.y() == 0.f ? Type::Enforced : Type::Neutral; + CHECK(candidate.type == expected); + if (in_zone && p.x() > 8.001f && p.x() < 11.999f) + ++cleared_oversampled; + } + CHECK(oversampled > 0); + CHECK(cleared_oversampled >= 15); // About 4 mm of 0.2 mm steps inside the zone. +} + +namespace { +// A 20 x 20 x 2 mm cube sliced at 0.2 mm, so ten layers, each with one outer wall loop. +struct ExportFixture { + Model model; + Print print; + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + Vec3d cube_min; + + explicit ExportFixture(const std::string &seam_position, int raft_layers = 0) + { + config.set_deserialize_strict("seam_position", seam_position); + config.set_deserialize_strict("seam_slope_type", "none"); // The loop then starts exactly at the seam. + config.set_deserialize_strict("layer_height", "0.2"); + config.set_deserialize_strict("initial_layer_print_height", "0.2"); + config.set_deserialize_strict("outer_wall_line_width", "0.4"); + config.set_deserialize_strict("initial_layer_line_width", "0.4"); + config.set_deserialize_strict("raft_layers", std::to_string(raft_layers)); + Test::init_print({make_cube(20, 20, 2)}, print, model, config); + const ModelVolume *cube = model.objects.front()->volumes.front(); + cube_min = cube->mesh().transformed_bounding_box(cube->get_matrix()).min; + } + + // Places the helper's minimum corner at `min`, relative to the cube's minimum corner. + void add(ModelVolumeType type, TriangleMesh mesh, const Vec3d &min, const std::string &name = "helper") + { + ModelVolume *volume = model.objects.front()->add_volume(std::move(mesh)); + volume->set_type(type); + volume->name = name; + const Vec3d current = volume->mesh().transformed_bounding_box(volume->get_matrix()).min; + volume->set_offset(volume->get_offset() + cube_min + min - current); + } + + std::string export_gcode() + { + print.apply(model, config); + return Test::gcode(print); + } + + std::string warning() const + { + std::string text; + for (const auto &warning : print.step_state_with_warnings(psGCodeExport).warnings) + text += warning.message; + return text; + } +}; + +struct OuterLoop { + Vec2d seam; // Relative to the loop's centre, which is the cube's centre. + BoundingBoxf bounds; +}; + +std::vector outer_wall_loops(const std::string &gcode) +{ + std::vector loops; + bool outer_wall = false; + bool in_loop = false; + GCodeReader parser; + parser.parse_buffer(gcode, [&](GCodeReader &self, const GCodeReader::GCodeLine &line) { + const std::string_view comment = line.comment(); + if (comment.find("TYPE:") != std::string_view::npos) { + outer_wall = comment.find("Outer wall") != std::string_view::npos; + in_loop = false; + } + if (!outer_wall || !line.extruding(self) || line.dist_XY(self) == 0.f) + return; + if (!in_loop) { + loops.push_back({Vec2d(self.x(), self.y()), {}}); + loops.back().bounds.merge(loops.back().seam); + in_loop = true; + } + loops.back().bounds.merge(Vec2d(line.new_X(self), line.new_Y(self))); + }); + for (OuterLoop &loop : loops) + loop.seam -= loop.bounds.center(); + return loops; +} + +TriangleMesh helper_with_hole() +{ + // 8 x 6 x 4 mm with a 4 x 3 mm hole through every layer of the cube. + TriangleMesh helper = make_cube(8, 6, 4); + TriangleMesh cavity = make_cube(4, 3, 3); + cavity.translate(2., 1.5, 0.5); + cavity.flip_triangles(); + helper.merge(cavity); + return helper; +} +} // namespace + +TEST_CASE("Strong modifiers place the exported seam on the side they cross", "[PreciseSeam]") +{ + // The helper crosses the front face (y = 0) at x = 4..6 mm. The loop runs counterclockwise, so on + // the front face Left is the x = 4 mm edge and Right the x = 6 mm edge. + const auto [type, x] = GENERATE(table({ + {ModelVolumeType::PRECISE_SEAM_CENTER, 5.}, + {ModelVolumeType::PRECISE_SEAM_LEFT, 4.}, + {ModelVolumeType::PRECISE_SEAM_RIGHT, 6.}})); + const std::string seam_position = GENERATE(as{}, "back", "aligned", "nearest"); + const int raft_layers = GENERATE(0, 2); + CAPTURE(seam_position, raft_layers); + ExportFixture fixture(seam_position, raft_layers); + fixture.add(type, make_cube(2, 6, 4), Vec3d(4, -3, -1)); + const auto loops = outer_wall_loops(fixture.export_gcode()); + REQUIRE(loops.size() == 10); // Raft layers have no outer wall. + for (const OuterLoop &loop : loops) { + CHECK_THAT(loop.seam.x(), Catch::Matchers::WithinAbs(x - 10., 0.01)); + CHECK_THAT(loop.seam.y(), Catch::Matchers::WithinAbs(loop.bounds.min.y() - loop.bounds.center().y(), 0.01)); + } + CHECK(fixture.warning().empty()); +} + +TEST_CASE("Weak modifiers move the exported seam into or out of their zone", "[PreciseSeam]") +{ + // INVALID adds no helper: a back seam then lies on the rear face (y = 20 mm). + const auto type = GENERATE(ModelVolumeType::INVALID, ModelVolumeType::PRECISE_SEAM_ENFORCED, + ModelVolumeType::PRECISE_SEAM_BLOCKED); + ExportFixture fixture("back"); + if (type == ModelVolumeType::PRECISE_SEAM_ENFORCED) + fixture.add(type, make_cube(2, 6, 4), Vec3d(4, -3, -1)); // Front face, x = 4..6 mm. + if (type == ModelVolumeType::PRECISE_SEAM_BLOCKED) + fixture.add(type, make_cube(30, 6, 4), Vec3d(-5, 17, -1)); // Everything from y = 17 mm back. + const auto loops = outer_wall_loops(fixture.export_gcode()); + REQUIRE(loops.size() == 10); + for (const OuterLoop &loop : loops) { + CAPTURE(loop.seam.x(), loop.seam.y()); + if (type == ModelVolumeType::PRECISE_SEAM_ENFORCED) { + CHECK_THAT(loop.seam.y(), Catch::Matchers::WithinAbs(loop.bounds.min.y() - loop.bounds.center().y(), 0.01)); + CHECK(loop.seam.x() >= -6.01); + CHECK(loop.seam.x() <= -3.99); + } else if (type == ModelVolumeType::PRECISE_SEAM_BLOCKED) + CHECK(loop.seam.y() < 7.); + else + CHECK(loop.seam.y() > 7.); + } + CHECK(fixture.warning().empty()); +} + +TEST_CASE("A strong modifier with a hole uses the left of two equal crossings", "[PreciseSeam]") +{ + // The hole splits the front face crossing into x = 2..4 and x = 8..10 mm. The lengths tie, both + // points lie equally far back, so the left one wins. + ExportFixture fixture("back"); + fixture.add(ModelVolumeType::PRECISE_SEAM_CENTER, helper_with_hole(), Vec3d(2, -3, -1)); + const auto loops = outer_wall_loops(fixture.export_gcode()); + REQUIRE(loops.size() == 10); + for (const OuterLoop &loop : loops) { + CHECK_THAT(loop.seam.x(), Catch::Matchers::WithinAbs(3. - 10., 0.01)); + CHECK_THAT(loop.seam.y(), Catch::Matchers::WithinAbs(loop.bounds.min.y() - loop.bounds.center().y(), 0.01)); + } + // The multiple-intersections reason names the type. + CHECK(fixture.warning().find("Seam Center") != std::string::npos); +} + +TEST_CASE("The export warning names a modifier that misses the outer wall centreline", "[PreciseSeam]") +{ + // The helper reaches 0.1 mm into the cube, short of the centreline 0.2 mm inside a 0.4 mm outer wall. + ExportFixture fixture("back"); + fixture.add(ModelVolumeType::PRECISE_SEAM_ENFORCED, make_cube(2, 3.1, 4), Vec3d(4, -3, -1), "short helper"); + fixture.export_gcode(); + CHECK(fixture.warning().find("short helper") != std::string::npos); +} + +TEST_CASE("Full containment warns for Blocked but not for Enforced", "[PreciseSeam]") +{ + const auto type = GENERATE(ModelVolumeType::PRECISE_SEAM_ENFORCED, ModelVolumeType::PRECISE_SEAM_BLOCKED); + ExportFixture fixture("back"); + fixture.add(type, make_cube(30, 30, 4), Vec3d(-5, -5, -1)); + fixture.export_gcode(); + if (type == ModelVolumeType::PRECISE_SEAM_BLOCKED) + CHECK(fixture.warning().find("Seam Blocked") != std::string::npos); + else + CHECK(fixture.warning().empty()); +} diff --git a/tests/fff_print/test_seam_placer.cpp b/tests/fff_print/test_seam_placer.cpp index 40bbbdd117..73b3e986d2 100644 --- a/tests/fff_print/test_seam_placer.cpp +++ b/tests/fff_print/test_seam_placer.cpp @@ -209,6 +209,61 @@ TEST_CASE("Entirely painted contours keep valid enforced seam candidates", "[Sea } } +TEST_CASE("Seam painting acts only from model parts and negative volumes", "[SeamPlacer]") +{ + // Painting survives a type change, but only model parts expose it in the seam gizmo. A helper + // painted while it was a part must not affect the seam once it is a modifier or support volume. + // Negative volumes keep it on purpose: it is the only way to paint the wall of a hole they cut. + const auto helper_type = GENERATE(ModelVolumeType::MODEL_PART, ModelVolumeType::NEGATIVE_VOLUME, + ModelVolumeType::PARAMETER_MODIFIER, ModelVolumeType::SUPPORT_BLOCKER, + ModelVolumeType::SUPPORT_ENFORCER); + // Precise Seam helpers are left out: on the loop they would retype the candidates themselves. + const std::string type_name = ModelVolume::type_to_string(helper_type); + CAPTURE(type_name); + PipelineFixture fixture; + // A 2 mm strip along the front side: its front face lies on the loop's front edge, while its back + // face stays farther than the paint radius. As a negative volume it cuts only the strip. + ModelVolume *helper = fixture.model.objects.front()->add_volume(TriangleMesh(its_make_cube(20, 2, 0.4))); + const ObjectID helper_id = helper->id(); + { + // Paint every face of the helper while it is still a part, then change its type. + TriangleSelector selector(helper->mesh()); + for (size_t i = 0; i < helper->mesh().its.indices.size(); ++i) + selector.set_facet(int(i), EnforcerBlockerType::ENFORCER); + helper->seam_facets.set(selector); + } + REQUIRE(helper->is_seam_painted()); + const auto count_enforced = [&]() { + fixture.print.apply(fixture.model, fixture.config); + PrintObject &object = fixture.prepare(); + auto ®ion = clear_first_layer(object); + append_loop(region, fixture.points_in_layer(object, {{0, 0}, {20, 0}, {20, 20}, {0, 20}})); + SeamPlacer placer; + placer.init(fixture.print, [] {}); + const auto &data = placer.m_seam_per_object.at(&object).layers.front(); + REQUIRE(data.perimeters.size() == 1); + // The helper volume in the print's model copy keeps its painting whatever its type. + const auto &volumes = object.model_object()->volumes; + const auto it = std::find_if(volumes.begin(), volumes.end(), [&](const ModelVolume *v) { return v->id() == helper_id; }); + REQUIRE(it != volumes.end()); + CHECK((*it)->is_seam_painted()); + return size_t(std::count_if(data.points.begin(), data.points.end(), [](const auto &candidate) { + return candidate.type == SeamPlacerImpl::EnforcedBlockedSeamPoint::Enforced; + })); + }; + helper->set_type(helper_type); + const bool acts = helper_type == ModelVolumeType::MODEL_PART || helper_type == ModelVolumeType::NEGATIVE_VOLUME; + if (acts) + CHECK(count_enforced() > 0); + else + CHECK(count_enforced() == 0); + if (!acts) { + // The painting was ignored, not lost: as a part again the helper enforces candidates. + helper->set_type(ModelVolumeType::MODEL_PART); + CHECK(count_enforced() > 0); + } +} + TEST_CASE("Precise Seam removes path junction duplicates but preserves separate visits", "[SeamPlacer][PreciseSeam]") { const bool enable_ps = GENERATE(false, true); @@ -227,7 +282,14 @@ TEST_CASE("Precise Seam removes path junction duplicates but preserves separate const Points outline = fixture.points_in_layer(object, vertices); append_loop(region, outline, true); SeamPlacer placer; + // A direct call outside G-code export: init() must not need an active print step. placer.init(fixture.print, [] {}); + // The helper never reaches the loop, so it is reported, named with its object; no helper, no warning. + if (enable_ps) { + CHECK(placer.precise_seam_warning().find("had no effect on the seam") != std::string::npos); + CHECK(placer.precise_seam_warning().find("\"object.stl\"") != std::string::npos); + } else + CHECK(placer.precise_seam_warning().empty()); const auto &data = placer.m_seam_per_object.at(&object).layers.front(); REQUIRE(data.perimeters.size() == 1); // Each separate path contributes both endpoints in ordinary mode; PS removes only adjacent copies. @@ -294,3 +356,48 @@ TEST_CASE("Print apply synchronizes support and seam helpers through type change fixture.print.apply(fixture.model, fixture.config); check_applied(fixture.model); } + +TEST_CASE("Precise Seam volume changes invalidate only G-code export", "[SeamPlacer][PreciseSeam][Print]") +{ + const int change = GENERATE(0, 1, 2, 3); // Add, move, retype, remove. + CAPTURE(change); + PipelineFixture fixture; + ModelObject *model_object = fixture.model.objects.front(); + // A second helper stays in the object throughout: deleting down to a single volume makes + // ModelObject::delete_volume() fold the volume transform into the instances and renew the volume + // ID, which legitimately reslices the object regardless of Precise Seam. + ModelVolume *keeper = model_object->add_volume(make_cube(1, 1, 1)); + keeper->set_type(ModelVolumeType::PRECISE_SEAM_NEUTRAL); + if (change != 0) { + ModelVolume *seam = model_object->add_volume(make_cube(1, 1, 1)); + seam->set_type(ModelVolumeType::PRECISE_SEAM_CENTER); + } + fixture.print.apply(fixture.model, fixture.config); + // A full export marks every step done, so an invalidated step is visible afterwards. + Test::gcode(fixture.print); + REQUIRE(fixture.print.objects().size() == 1); + const PrintObject *object = fixture.print.objects().front(); + REQUIRE(fixture.print.is_step_done(psGCodeExport)); + REQUIRE(object->is_step_done(posSlice)); + REQUIRE(object->is_step_done(posPerimeters)); + + if (change == 0) { + ModelVolume *seam = model_object->add_volume(make_cube(1, 1, 1)); + seam->set_type(ModelVolumeType::PRECISE_SEAM_CENTER); + } else { + ModelVolume *seam = model_object->volumes.back(); + REQUIRE(seam->is_precise_seam()); + if (change == 1) seam->set_offset(Vec3d(2, 3, 0)); + if (change == 2) seam->set_type(ModelVolumeType::PRECISE_SEAM_ENFORCED); + if (change == 3) model_object->delete_volume(model_object->volumes.size() - 1); + } + fixture.print.apply(fixture.model, fixture.config); + + // The helper takes no part in slicing: the object and its layers are kept, only export reruns. + // REQUIRE, not CHECK: a recreated PrintObject means the old one was freed and must not be read. + REQUIRE(fixture.print.objects().size() == 1); + REQUIRE(fixture.print.objects().front() == object); + CHECK_FALSE(fixture.print.is_step_done(psGCodeExport)); + CHECK(object->is_step_done(posSlice)); + CHECK(object->is_step_done(posPerimeters)); +} diff --git a/tests/libslic3r/CMakeLists.txt b/tests/libslic3r/CMakeLists.txt index c1fbe4408d..dbcb23e015 100644 --- a/tests/libslic3r/CMakeLists.txt +++ b/tests/libslic3r/CMakeLists.txt @@ -5,6 +5,8 @@ add_executable(${_TEST_NAME}_tests test_3mf.cpp # Round-trip seam metadata and active/dormant volume settings in both formats. test_precise_seam_3mf.cpp + # Pure perimeter extraction is independent of Print/Layer fixtures. + test_precise_seam.cpp test_aabbindirect.cpp test_appconfig.cpp test_arachne_walls.cpp diff --git a/tests/libslic3r/test_precise_seam.cpp b/tests/libslic3r/test_precise_seam.cpp new file mode 100644 index 0000000000..d8a1130192 --- /dev/null +++ b/tests/libslic3r/test_precise_seam.cpp @@ -0,0 +1,1043 @@ +#include +#include "libslic3r/GCode/PreciseSeam.hpp" +#include "libslic3r/GCode/PreciseSeamInternal.hpp" +#include "libslic3r/ClipperUtils.hpp" + +#include +#include + +using namespace Slic3r; + +namespace { +Point mm(double x, double y) { return Point(scale_(x), scale_(y)); } + +Polygon rectangle(double x0, double y0, double x1, double y1) +{ + // Modifier exteriors are CCW; holes are explicitly reversed in their fixtures. + return Polygon(Points{mm(x0, y0), mm(x1, y0), mm(x1, y1), mm(x0, y1)}); +} + +void check_provenance(const Polygon &perimeter, const PreciseSeam::SegmentExtraction &result, bool measured = true) +{ + REQUIRE(result.valid); + CHECK(result.discarded_fragments == 0); + for (const auto &segment : result.segments) { + REQUIRE(segment.polyline.size() >= 2); + REQUIRE(segment.edge_indices.size() + 1 == segment.polyline.size()); + // Full coverage retains geometry, but consumers skip it before using strong data. + if (result.full_containment) + CHECK_FALSE(segment.strong_target.has_value()); + else { + REQUIRE(segment.strong_target.has_value()); + REQUIRE(segment.strong_target->edge_index < perimeter.size()); + } + if (measured && !result.full_containment) { + CHECK_THAT(segment.polyline.length(), Catch::Matchers::WithinRel(segment.length, 1e-12)); + CHECK(segment.length > 0.); + } else + CHECK_THAT(segment.length, Catch::Matchers::WithinAbs(0., 1e-12)); + const std::pair endpoints[] = { + {segment.begin, segment.polyline.points.front()}, {segment.end, segment.polyline.points.back()}}; + for (const auto &[position, point] : endpoints) { + REQUIRE(position.edge_index < perimeter.size()); + CHECK(position.parameter >= 0.); + CHECK(position.parameter < 1.); + const Vec2d a = perimeter.points[position.edge_index].cast(); + const Vec2d b = perimeter.points[(position.edge_index + 1) % perimeter.size()].cast(); + const Vec2d reconstructed = a + position.parameter * (b - a); + CHECK((point.cast() - reconstructed).squaredNorm() <= 2.5); + } + for (size_t i = 0; i < segment.edge_indices.size(); ++i) { + const size_t edge = segment.edge_indices[i]; + REQUIRE(edge < perimeter.size()); + const Vec2d a = perimeter.points[edge].cast(); + const Vec2d direction = perimeter.points[(edge + 1) % perimeter.size()].cast() - a; + double previous = -1.; + for (const Point &point : {segment.polyline.points[i], segment.polyline.points[i + 1]}) { + const Vec2d offset = point.cast() - a; + const double t = offset.dot(direction) / direction.squaredNorm(); + CHECK(t >= 0.); + CHECK(t <= 1.); + CHECK(t >= previous); + CHECK((offset - t * direction).squaredNorm() <= 2.5); + previous = t; + } + } + } +} +} // namespace + +TEST_CASE("Cached modifier bounds preserve holes and layer slots across perimeter queries", "[PreciseSeam][SegmentExtraction]") +{ + ExPolygon nearby(rectangle(2, -2, 8, 2)); + nearby.holes.push_back(rectangle(4, -1, 6, 1)); + nearby.holes.back().reverse(); + const ExPolygon distant(rectangle(102, -2, 108, 2)); + const auto cached = PreciseSeam::prepare_modifier_slices({ + {ExPolygon{}, nearby, distant}, {}, {ExPolygon(rectangle(2, 30, 8, 32))}}); + REQUIRE(cached.size() == 3); + REQUIRE(cached[0].size() == 3); + CHECK_FALSE(cached[0][0].bounds.defined); + CHECK(cached[1].empty()); + REQUIRE(cached[2].size() == 1); + CHECK(cached[2][0].bounds.min == mm(2, 30)); + CHECK(cached[0][1].bounds.min == mm(2, -2)); + CHECK(cached[0][1].bounds.max == mm(8, 2)); + REQUIRE(cached[0][1].polygon.holes.size() == 1); + CHECK(cached[0][1].polygon.holes.front().points == nearby.holes.front().points); + + // Reuse one immutable layer cache; each perimeter sees only its nearby region. + const Polygon first = rectangle(0, 0, 20, 20); + const Polygon second = rectangle(100, 0, 120, 20); + const PreciseSeam::PreparedPerimeter first_prepared(first), second_prepared(second); + const auto left = PreciseSeam::extract_perimeter_segments(first_prepared, cached[0], ModelVolumeType::PRECISE_SEAM_CENTER); + const auto right = PreciseSeam::extract_perimeter_segments(second_prepared, cached[0], ModelVolumeType::PRECISE_SEAM_CENTER); + const auto repeated = PreciseSeam::extract_perimeter_segments(first_prepared, cached[0], ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(first, left); + check_provenance(second, right); + REQUIRE(left.segments.size() == 2); + REQUIRE(right.segments.size() == 1); + REQUIRE(repeated.segments.size() == left.segments.size()); + CHECK(left.segments[0].polyline.points.front() == mm(2, 0)); + CHECK(left.segments[0].polyline.points.back() == mm(4, 0)); + CHECK(left.segments[1].polyline.points.front() == mm(6, 0)); + CHECK(left.segments[1].polyline.points.back() == mm(8, 0)); + CHECK(right.segments[0].polyline.points.front() == mm(102, 0)); + CHECK(right.segments[0].polyline.points.back() == mm(108, 0)); + for (size_t i = 0; i < left.segments.size(); ++i) { + CHECK(repeated.segments[i].polyline.points == left.segments[i].polyline.points); + CHECK(repeated.segments[i].edge_indices == left.segments[i].edge_indices); + } + CHECK(cached[0][1].polygon.contour.points == nearby.contour.points); +} + +TEST_CASE("Weak extraction preserves geometry and bindings without preparing strong data", "[PreciseSeam][SegmentExtraction]") +{ + const int scenario = GENERATE(0, 1, 2); + const Polygon perimeter = rectangle(0, 0, 20, 20); + // Cover separate intervals, joining across vertex zero, and full containment. + const ExPolygons modifier{ExPolygon(scenario == 0 ? rectangle(8, -2, 12, 22) : + scenario == 1 ? rectangle(-2, -2, 4, 4) : rectangle(-2, -2, 22, 22))}; + const auto measured = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions(modifier), ModelVolumeType::PRECISE_SEAM_CENTER); + const auto weak_mode = GENERATE(ModelVolumeType::PRECISE_SEAM_ENFORCED, + ModelVolumeType::PRECISE_SEAM_BLOCKED, + ModelVolumeType::PRECISE_SEAM_NEUTRAL); + const auto unmeasured = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions(modifier), weak_mode); + check_provenance(perimeter, measured); + CHECK(unmeasured.valid == measured.valid); + CHECK(unmeasured.full_containment == measured.full_containment); + CHECK(unmeasured.discarded_fragments == measured.discarded_fragments); + REQUIRE(unmeasured.segments.size() == measured.segments.size()); + for (size_t i = 0; i < measured.segments.size(); ++i) { + const auto &expected = measured.segments[i]; + const auto &actual = unmeasured.segments[i]; + CHECK(actual.polyline.points == expected.polyline.points); + CHECK(actual.edge_indices == expected.edge_indices); + CHECK(actual.begin.edge_index == expected.begin.edge_index); + CHECK(actual.end.edge_index == expected.end.edge_index); + CHECK_THAT(actual.begin.parameter, Catch::Matchers::WithinAbs(expected.begin.parameter, 1e-12)); + CHECK_THAT(actual.end.parameter, Catch::Matchers::WithinAbs(expected.end.parameter, 1e-12)); + CHECK_FALSE(actual.strong_target.has_value()); + CHECK_THAT(actual.length, Catch::Matchers::WithinAbs(0., 1e-12)); + } +} + +TEST_CASE("Strong extraction prepares the mode point on the complete joined segment", "[PreciseSeam][SegmentExtraction]") +{ + const auto mode = GENERATE(ModelVolumeType::PRECISE_SEAM_LEFT, + ModelVolumeType::PRECISE_SEAM_RIGHT, + ModelVolumeType::PRECISE_SEAM_CENTER); + const bool reverse = GENERATE(false, true); + const double width = GENERATE(4., 6.); + Polygon perimeter = rectangle(0, 0, 20, 20); + if (reverse) + std::reverse(perimeter.points.begin(), perimeter.points.end()); + // The forward contour crosses vertex zero; Center is either that vertex or inside an edge. + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(-2, -2, width, 4))}), mode); + const bool center = mode == ModelVolumeType::PRECISE_SEAM_CENTER; + check_provenance(perimeter, result, center); + REQUIRE(result.segments.size() == 1); + const auto &segment = result.segments.front(); + CHECK_THAT(segment.length, Catch::Matchers::WithinAbs(center ? scale_(width + 4.) : 0., 1e-6)); + + Point expected_point = mm((width - 4.) / 2., 0); + size_t expected_edge = reverse ? 2 : (width == 4. ? 3 : 0); + if (mode != ModelVolumeType::PRECISE_SEAM_CENTER) { + const bool vertical = (mode == ModelVolumeType::PRECISE_SEAM_LEFT) != reverse; + expected_point = vertical ? mm(0, 4) : mm(width, 0); + expected_edge = vertical ? 3 : (reverse ? 2 : 0); + } + REQUIRE(segment.strong_target.has_value()); + CHECK(segment.strong_target->point == expected_point); + CHECK(segment.strong_target->edge_index == expected_edge); +} + +TEST_CASE("Strong extraction measures competing segments but skips fully contained targets", "[PreciseSeam][SegmentExtraction]") +{ + const auto mode = GENERATE(ModelVolumeType::PRECISE_SEAM_LEFT, + ModelVolumeType::PRECISE_SEAM_RIGHT, + ModelVolumeType::PRECISE_SEAM_CENTER); + const bool full = GENERATE(false, true); + const Polygon perimeter = rectangle(0, 0, 20, 20); + // Left/Right still require lengths when two segments compete; full coverage skips every mode. + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(full ? rectangle(-2, -2, 22, 22) : rectangle(8, -2, 12, 22))}), mode); + CHECK(result.full_containment == full); + REQUIRE(result.segments.size() == (full ? 1 : 2)); + check_provenance(perimeter, result); + for (const auto &segment : result.segments) { + CHECK_THAT(segment.length, Catch::Matchers::WithinAbs(full ? 0. : scale_(4.), 1e-6)); + if (full) + CHECK(segment.polyline.points.front() == segment.polyline.points.back()); + else { + REQUIRE(segment.strong_target.has_value()); + if (mode == ModelVolumeType::PRECISE_SEAM_LEFT) + CHECK(segment.strong_target->point == segment.polyline.points.front()); + else if (mode == ModelVolumeType::PRECISE_SEAM_RIGHT) + CHECK(segment.strong_target->point == segment.polyline.points.back()); + } + } +} + +TEST_CASE("Projection binding follows the same edge and its neighbor in either direction", "[PreciseSeam][SegmentExtraction]") +{ + const bool reverse = GENERATE(false, true); + const bool wrap = GENERATE(false, true); + const Polygon perimeter = rectangle(0, 0, 10, 10); + Polyline fragment; + fragment.points = wrap ? Points{mm(0, 3), mm(0, 0), mm(3, 0), mm(6, 0)} + : Points{mm(2, 0), mm(4, 0), mm(7, 0), mm(10, 0), mm(10, 3)}; + std::vector expected = wrap ? std::vector{3, 0, 0} : std::vector{0, 0, 0, 1}; + if (reverse) { + std::reverse(fragment.points.begin(), fragment.points.end()); + std::reverse(expected.begin(), expected.end()); + } + std::vector intervals; + PreciseSeam::detail::FragmentBindingFailure failure; + REQUIRE(PreciseSeam::detail::append_projected_fragment(fragment, perimeter, intervals, failure)); + REQUIRE(intervals.size() == expected.size()); + for (size_t i = 0; i < intervals.size(); ++i) { + CHECK(intervals[i].edge == expected[i]); + CHECK(intervals[i].first == fragment.points[reverse ? i + 1 : i]); + CHECK(intervals[i].last == fragment.points[reverse ? i : i + 1]); + } +} + +TEST_CASE("Projection binding rolls back a fragment that reverses or leaves the contour", "[PreciseSeam][SegmentExtraction]") +{ + const int scenario = GENERATE(0, 1, 2); + const Polygon perimeter = rectangle(0, 0, 10, 10); + Polyline fragment; + fragment.points = {mm(2, 0), mm(7, 0)}; + // Every failure follows a successful pair, exercising rollback rather than an empty result. + fragment.points.push_back(scenario == 0 ? mm(4, 0) : scenario == 1 ? mm(7, 3) : mm(10, 3)); + std::vector intervals{{2, 0., 1., mm(10, 10), mm(0, 10)}}; + PreciseSeam::detail::FragmentBindingFailure failure; + CHECK_FALSE(PreciseSeam::detail::append_projected_fragment(fragment, perimeter, intervals, failure)); + REQUIRE(intervals.size() == 1); + CHECK(intervals[0].edge == 2); + CHECK(intervals[0].first == mm(10, 10)); + CHECK(intervals[0].last == mm(0, 10)); + CHECK(failure.pair_index == 1); +} + +TEST_CASE("Projection binding does not jump to a distant edge at a repeated vertex", "[PreciseSeam][SegmentExtraction]") +{ + const Polygon perimeter(Points{mm(0, 0), mm(4, 0), mm(4, 4), mm(0, 0), mm(-4, 0), mm(-4, -4)}); + Polyline fragment; + // The last pair belongs to edge zero, but edge three is the required continuation. + fragment.points = {mm(4, 1), mm(4, 4), mm(0, 0), mm(2, 0)}; + std::vector intervals; + PreciseSeam::detail::FragmentBindingFailure failure; + CHECK_FALSE(PreciseSeam::detail::append_projected_fragment(fragment, perimeter, intervals, failure)); + CHECK(intervals.empty()); + CHECK(failure.pair_index == 2); +} + +TEST_CASE("A rejected intersection warns without removing successful fragments", "[PreciseSeam][SegmentExtraction]") +{ + const Polygon perimeter = rectangle(0, 0, 10, 10); + PreciseSeam::PreciseSeamWarnings warnings; + PreciseSeam::ExtractionContext context; + context.warnings = &warnings; + std::vector intervals; + Polyline fragment; + fragment.points = {mm(1, 0), mm(2, 0)}; + REQUIRE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, context, 0)); + CHECK(warnings.failed_fragments.load() == 0); + // An out-and-back path must be discarded, not salvaged by clipping source edges again. + fragment.points = {mm(3, 0), mm(7, 0), mm(4, 0)}; + CHECK_FALSE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, context, 1)); + REQUIRE(intervals.size() == 1); + CHECK(intervals[0].first == mm(1, 0)); + CHECK(intervals[0].last == mm(2, 0)); + CHECK(warnings.failed_fragments.load() == 1); + fragment.points = {mm(10, 2), mm(10, 4)}; + REQUIRE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, context, 2)); + REQUIRE(intervals.size() == 2); + CHECK(intervals.back().edge == 1); +} + +TEST_CASE("A cut rounded past its adjacent source vertex is snapped instead of discarding the fragment", "[PreciseSeam][SegmentExtraction]") +{ + const Polygon perimeter = rectangle(0, 0, 20, 20); + const Point corner = mm(20, 0); + const bool at_start = GENERATE(false, true); + const bool reversed = GENERATE(false, true); + // 1 nm: the cut projects to the corner's parameter, giving a zero-length pair. + // 5 nm: the cut lies on neither neighbouring edge within clipping precision. + const coord_t offset = GENERATE(coord_t(1), coord_t(5)); + CAPTURE(at_start, reversed, offset); + Polyline fragment; + if (at_start) + fragment.points = {Point(corner.x() + offset, corner.y()), corner, mm(20, 20), mm(10, 20)}; + else + fragment.points = {mm(10, 0), corner, Point(corner.x(), corner.y() - offset)}; + if (reversed) + fragment.reverse(); + PreciseSeam::PreciseSeamWarnings warnings; + PreciseSeam::ExtractionContext context; + context.warnings = &warnings; + std::vector intervals; + REQUIRE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, context, 0)); + CHECK(warnings.failed_fragments.load() == 0); + CHECK(warnings.recovered_fragments.load() == 1); + // The rest of the fragment is kept, and the dropped cut leaves the boundary exactly at the corner. + // Canonical vertex parameters 0 and 1 are exact by contract, hence a zero margin. + std::sort(intervals.begin(), intervals.end(), [](const auto &a, const auto &b) { return a.edge < b.edge; }); + if (at_start) { + REQUIRE(intervals.size() == 2); + CHECK(intervals[0].edge == 1); + CHECK_THAT(intervals[0].begin, Catch::Matchers::WithinAbs(0., 0.)); + CHECK_THAT(intervals[0].end, Catch::Matchers::WithinAbs(1., 0.)); + CHECK(intervals[0].first == corner); + CHECK(intervals[1].edge == 2); + CHECK_THAT(intervals[1].begin, Catch::Matchers::WithinAbs(0., 0.)); + CHECK_THAT(intervals[1].end, Catch::Matchers::WithinAbs(0.5, 1e-12)); + } else { + REQUIRE(intervals.size() == 1); + CHECK(intervals[0].edge == 0); + CHECK_THAT(intervals[0].begin, Catch::Matchers::WithinAbs(0.5, 1e-12)); + CHECK_THAT(intervals[0].end, Catch::Matchers::WithinAbs(1., 0.)); + CHECK(intervals[0].last == corner); + } + + // A two-point contact shorter than the snapping distance leaves nothing to bind and is not a failure. + Polyline contact; + contact.points = {Point(corner.x() + offset, corner.y()), corner}; + if (reversed) + contact.reverse(); + intervals.clear(); + CHECK(PreciseSeam::detail::append_fragment(contact, perimeter, intervals, context, 1)); + CHECK(intervals.empty()); + CHECK(warnings.failed_fragments.load() == 0); + + // Beyond the 1 um snapping distance the cleanup does not apply: the fragment is still a failure. + Polyline distant; + distant.points = {Point(corner.x() + coord_t(scale_(0.002)), corner.y()), corner, mm(20, 20), mm(10, 20)}; + if (reversed) + distant.reverse(); + CHECK_FALSE(PreciseSeam::detail::append_fragment(distant, perimeter, intervals, context, 2)); + CHECK(intervals.empty()); + CHECK(warnings.failed_fragments.load() == 1); +} + +TEST_CASE("A cut beside the start of its chain's edge is replaced by that vertex only", "[PreciseSeam][SegmentExtraction]") +{ + const Polygon perimeter = rectangle(0, 0, 20, 20); + const Point corner = mm(20, 0); + const bool reversed = GENERATE(false, true); + CAPTURE(reversed); + PreciseSeam::PreciseSeamWarnings warnings; + PreciseSeam::ExtractionContext context; + context.warnings = &warnings; + std::vector intervals; + + // The cut stands 2 nm beside the corner, off both edges, while the fragment continues from the + // next vertex (20, 20): the corner shares an edge with that neighbour, so the cut becomes the corner. + Polyline fragment; + fragment.points = {Point(corner.x() + 2, corner.y() - 2), mm(20, 20), mm(10, 20)}; + if (reversed) + fragment.reverse(); + REQUIRE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, context, 0)); + CHECK(warnings.failed_fragments.load() == 0); + std::sort(intervals.begin(), intervals.end(), [](const auto &a, const auto &b) { return a.edge < b.edge; }); + REQUIRE(intervals.size() == 2); + CHECK(intervals[0].edge == 1); + CHECK_THAT(intervals[0].begin, Catch::Matchers::WithinAbs(0., 0.)); + CHECK_THAT(intervals[0].end, Catch::Matchers::WithinAbs(1., 0.)); + CHECK(intervals[0].first == corner); + CHECK(intervals[1].edge == 2); + + // The same cut next to a vertex that is not on the fragment's chain is never snapped there: + // (0, 20) does not share an edge with the corner, so the fragment stays a failure. + Polyline detached; + detached.points = {Point(corner.x() + 2, corner.y() - 2), mm(0, 20), mm(0, 10)}; + if (reversed) + detached.reverse(); + intervals.clear(); + CHECK_FALSE(PreciseSeam::detail::append_fragment(detached, perimeter, intervals, context, 1)); + CHECK(intervals.empty()); + CHECK(warnings.failed_fragments.load() == 1); +} + +TEST_CASE("A cut close to its neighbour and to both of the neighbour's chain vertices snaps to the neighbour", "[PreciseSeam][SegmentExtraction]") +{ + // Edges P -> N and N -> Q are 0.5 um long, so a cut 2 nm beside N is within 1 um of P, N and Q. + // P and Q are ambiguous edge-start candidates, but the cut is a rounded copy of N, which wins. + const Point n = mm(20, 0); + const coord_t half_um = coord_t(scale_(0.0005)); + const Point p(n.x() - half_um, n.y()); + const Point q(n.x(), n.y() + half_um); + const Polygon perimeter(Points{mm(0, 0), p, n, q, mm(20, 20), mm(0, 20)}); + const bool reversed = GENERATE(false, true); + CAPTURE(reversed); + Polyline fragment; + fragment.points = {Point(n.x() + 2, n.y() - 2), n, q, mm(20, 20), mm(10, 20)}; + if (reversed) + fragment.reverse(); + PreciseSeam::PreciseSeamWarnings warnings; + PreciseSeam::ExtractionContext context; + context.warnings = &warnings; + std::vector intervals; + REQUIRE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, context, 0)); + CHECK(warnings.failed_fragments.load() == 0); + CHECK(warnings.recovered_fragments.load() == 1); + // The dropped cut leaves the boundary exactly at N: edges N -> Q and Q -> (20, 20) are whole. + std::sort(intervals.begin(), intervals.end(), [](const auto &a, const auto &b) { return a.edge < b.edge; }); + REQUIRE(intervals.size() == 3); + CHECK(intervals[0].edge == 2); + CHECK(intervals[0].first == n); + CHECK_THAT(intervals[0].begin, Catch::Matchers::WithinAbs(0., 0.)); + CHECK_THAT(intervals[0].end, Catch::Matchers::WithinAbs(1., 0.)); + CHECK(intervals[1].edge == 3); + CHECK_THAT(intervals[1].begin, Catch::Matchers::WithinAbs(0., 0.)); + CHECK_THAT(intervals[1].end, Catch::Matchers::WithinAbs(1., 0.)); + CHECK(intervals[2].edge == 4); + CHECK_THAT(intervals[2].begin, Catch::Matchers::WithinAbs(0., 0.)); + CHECK_THAT(intervals[2].end, Catch::Matchers::WithinAbs(0.5, 1e-12)); +} + +TEST_CASE("A fragment end that is itself a source vertex is never treated as a rounded cut", "[PreciseSeam][SegmentExtraction]") +{ + // The closing edge v4 -> v0 is only 0.5 um long. The fragment starts with a cut 2 nm beside v3 (so + // the fallback runs) and ends at the real vertex v0, the start of the open clipping line. v0 lies + // within 1 um of its neighbour v4, but it is no rounded cut and must keep the closing edge. + const Point v3 = mm(0, 20); + const Point v4(coord_t(0), coord_t(scale_(0.0005))); + const Polygon perimeter(Points{mm(0, 0), mm(20, 0), mm(20, 20), v3, v4}); + const bool reversed = GENERATE(false, true); + CAPTURE(reversed); + Polyline fragment; + fragment.points = {Point(v3.x() + 2, v3.y() + 2), v4, mm(0, 0)}; + if (reversed) + fragment.reverse(); + PreciseSeam::PreciseSeamWarnings warnings; + PreciseSeam::ExtractionContext context; + context.warnings = &warnings; + std::vector intervals; + REQUIRE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, context, 0)); + CHECK(warnings.failed_fragments.load() == 0); + CHECK(warnings.recovered_fragments.load() == 1); + // Both whole edges v3 -> v4 and v4 -> v0 are bound; v0 was not dropped. + std::sort(intervals.begin(), intervals.end(), [](const auto &a, const auto &b) { return a.edge < b.edge; }); + REQUIRE(intervals.size() == 2); + for (size_t i = 0; i < 2; ++i) { + CHECK(intervals[i].edge == 3 + i); + CHECK_THAT(intervals[i].begin, Catch::Matchers::WithinAbs(0., 0.)); + CHECK_THAT(intervals[i].end, Catch::Matchers::WithinAbs(1., 0.)); + } +} + +TEST_CASE("A failed fragment shorter than the snapping distance is accepted as a contact", "[PreciseSeam][SegmentExtraction]") +{ + // Two cuts in the middle of a 45-degree edge, 1.4 nm apart and within clipping precision of it, + // project to the same parameter. No vertex is near, so only the contact rule applies. + const Polygon diagonal(Points{Point(0, 0), Point(1000000, 1000000), Point(0, 1000000)}); + Polyline contact; + contact.points = {Point(500000, 500000), Point(500001, 499999)}; + std::vector intervals; + PreciseSeam::detail::FragmentBindingFailure failure; + REQUIRE_FALSE(PreciseSeam::detail::bind_fragment(contact, diagonal, intervals, failure)); + PreciseSeam::PreciseSeamWarnings warnings; + PreciseSeam::ExtractionContext context; + context.warnings = &warnings; + CHECK(PreciseSeam::detail::append_fragment(contact, diagonal, intervals, context, 0)); + CHECK(intervals.empty()); + CHECK(warnings.failed_fragments.load() == 0); + CHECK(warnings.recovered_fragments.load() == 1); + + // A failed fragment longer than 1 um stays a failure. + Polyline longer; + longer.points = {Point(500000, 500000), Point(502000, 498000)}; + CHECK_FALSE(PreciseSeam::detail::append_fragment(longer, diagonal, intervals, context, 1)); + CHECK(warnings.failed_fragments.load() == 1); +} + +TEST_CASE("Recovered fragments are counted beyond the diagnostic limit", "[PreciseSeam][SegmentExtraction]") +{ + const Polygon perimeter = rectangle(0, 0, 20, 20); + const Point corner = mm(20, 0); + PreciseSeam::PreciseSeamWarnings warnings; + PreciseSeam::ExtractionContext context; + context.warnings = &warnings; + std::vector intervals; + // The same recoverable fragment repeats, as it would on every layer of a prismatic model. + Polyline fragment; + fragment.points = {Point(corner.x() + 1, corner.y()), corner, mm(20, 20), mm(10, 20)}; + const size_t repeats = PreciseSeam::failed_fragment_log_limit + 2; + for (size_t i = 0; i < repeats; ++i) { + std::vector layer; + CHECK(PreciseSeam::detail::append_fragment(fragment, perimeter, layer, context, i)); + CHECK(layer.size() == 2); + } + // Every recovery is counted past the log budget; none is a failure. + CHECK(warnings.recovered_fragments.load() == repeats); + CHECK(warnings.failed_fragments.load() == 0); +} + +TEST_CASE("Real clipping that rounds a cut beside a vertex is recovered on the fragment's own chain", "[PreciseSeam][SegmentExtraction]") +{ + // Inputs found by a randomized search against Clipper2: random perimeters clipped as open + // lines against a half-plane whose border passes a few nanometres from a vertex, keeping fragments + // that fail bind_fragment() but are bound by append_fragment(). Here the border crosses the + // perimeter at a vertex, and Clipper places the cut at the vertex height but 1-2 nm beside it. + // If a Clipper change stops producing these cuts, the case only warns that it no longer exercises + // the fallback; the general extraction checks below remain valid and still apply. + const auto nm = [](coord_t x, coord_t y) { return Point(x, y); }; + struct Case { + Points perimeter; + Points modifier; + Point cut; + Point vertex; + }; + const Case cases[] = { + // Cut 1 nm beside its neighbour in the fragment: dropped as a rounded copy of that vertex. + {{nm(-24603214, 112634156), nm(-24432144, 112478995), nm(-24498846, 112431640), nm(-24506812, 112403974), + nm(-24547188, 111960677), nm(-24140867, 112210640)}, + {nm(-264026532, 293042572), nm(215012909, -68234624), nm(395651507, 171285096), nm(-83387934, 532562293)}, + nm(-24506811, 112403974), nm(-24506812, 112403974)}, + // Cut 2 nm beside the vertex before its neighbour: replaced by that chain vertex. + {{nm(42606838, 119780952), nm(42638884, 119963549), nm(42573013, 119810910), nm(42578384, 120014121), + nm(42272085, 119667500), nm(42436134, 119614299), nm(42534337, 119521867), nm(42780062, 119646533)}, + {nm(331854259, 41295522), nm(-247310081, 198039476), nm(-325682058, -91542694), nm(253482282, -248286648)}, + nm(42272083, 119667500), nm(42272085, 119667500)}, + }; + const size_t index = GENERATE(size_t(0), size_t(1)); + CAPTURE(index); + const Case &c = cases[index]; + const Polygon perimeter(c.perimeter); + const ExPolygon modifier{Polygon(c.modifier)}; + const PreciseSeam::PreparedPerimeter prepared(perimeter); + REQUIRE(prepared.valid); + + // The case is relevant only while Clipper still produces the special cut (beside the vertex, not + // on it) and both regular binding paths still reject that fragment. Otherwise warn instead of + // failing: the input went stale, while the synthetic tests above still cover the fallback. + const Polylines fragments = intersection_pl(prepared.line, modifier); + const auto special = std::find_if(fragments.begin(), fragments.end(), [&c](const Polyline &fragment) { + return fragment.points.front() == c.cut || fragment.points.back() == c.cut; + }); + const bool cut_present = special != fragments.end(); + bool reproduces = cut_present; + if (reproduces) { + std::vector intervals; + PreciseSeam::detail::FragmentBindingFailure failure; + reproduces = !PreciseSeam::detail::bind_fragment(*special, perimeter, intervals, failure); + } + if (reproduces) { + // Deterministic proof that the fallback itself binds this real fragment. + std::vector intervals; + PreciseSeam::PreciseSeamWarnings fallback_warnings; + PreciseSeam::ExtractionContext fallback_context; + fallback_context.warnings = &fallback_warnings; + CHECK(PreciseSeam::detail::append_fragment(*special, perimeter, intervals, fallback_context, 0)); + CHECK_FALSE(intervals.empty()); + CHECK(fallback_warnings.recovered_fragments.load() == 1); + CHECK(fallback_warnings.failed_fragments.load() == 0); + } else if (!cut_present) + WARN("Case " << index << ": Clipper no longer returns the rounded cut beside a vertex, so the snapping " + "fallback is not exercised here. Refresh the inputs by clipping perimeters against half-planes " + "whose border passes a few nanometers from a vertex."); + else + WARN("Case " << index << ": Clipper still returns the rounded cut, but regular binding now accepts it, " + "so the snapping fallback is not exercised here. Check whether binding changed on purpose."); + + PreciseSeam::PreciseSeamWarnings warnings; + PreciseSeam::ExtractionContext context; + context.warnings = &warnings; + const auto result = PreciseSeam::extract_perimeter_segments( + prepared, PreciseSeam::prepare_modifier_regions({modifier}), ModelVolumeType::PRECISE_SEAM_CENTER, context); + check_provenance(perimeter, result); + CHECK(warnings.failed_fragments.load() == 0); + // Nothing is lost: the extracted coverage equals Clipper's within the snapping distance. + double clipped = 0., extracted = 0.; + for (const Polyline &fragment : fragments) + clipped += fragment.length(); + for (const auto &segment : result.segments) + extracted += segment.polyline.length(); + CHECK(std::abs(clipped - extracted) < scale_(0.001)); + // While the case reproduces, the recovered boundary lies exactly on the vertex of the fragment's chain. + if (reproduces) { + const bool on_vertex = std::any_of(result.segments.begin(), result.segments.end(), [&c](const auto &segment) { + return segment.polyline.points.front() == c.vertex || segment.polyline.points.back() == c.vertex; + }); + CHECK(on_vertex); + } +} + +TEST_CASE("Rejected fragments remain counted beyond the diagnostic limit", "[PreciseSeam][SegmentExtraction]") +{ + const Polygon perimeter = rectangle(0, 0, 10, 10); + PreciseSeam::PreciseSeamWarnings warnings; + PreciseSeam::ExtractionContext context; + context.warnings = &warnings; + std::vector intervals; + Polyline fragment; + // Keep a valid fragment intact while repeated out-and-back failures exhaust the log budget. + fragment.points = {mm(1, 0), mm(2, 0)}; + REQUIRE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, context, 0)); + fragment.points = {mm(3, 0), mm(7, 0), mm(4, 0)}; + const size_t failures = PreciseSeam::failed_fragment_log_limit + 2; + for (size_t i = 0; i < failures; ++i) + CHECK_FALSE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, context, i + 1)); + CHECK(warnings.failed_fragments.load() == failures); + REQUIRE(intervals.size() == 1); + CHECK(intervals.front().first == mm(1, 0)); + CHECK(intervals.front().last == mm(2, 0)); + + // Standalone callers still reject safely, and a new processing pass gets its own budget. + CHECK_FALSE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, {}, 0)); + CHECK(warnings.failed_fragments.load() == failures); + PreciseSeam::PreciseSeamWarnings next_pass; + context.warnings = &next_pass; + CHECK_FALSE(PreciseSeam::detail::append_fragment(fragment, perimeter, intervals, context, 0)); + CHECK(next_pass.failed_fragments.load() == 1); +} + +TEST_CASE("A crossing modifier extracts both perimeter intervals without a body chord", "[PreciseSeam][SegmentExtraction]") +{ + const bool reverse = GENERATE(false, true); + Polygon perimeter = rectangle(0, 0, 20, 20); + if (reverse) perimeter.reverse(); + const Points original = perimeter.points; + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(8, -2, 12, 22))}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + CHECK(perimeter.points == original); + REQUIRE(result.segments.size() == 2); + CHECK_FALSE(result.full_containment); + std::vector sides; + for (const auto &segment : result.segments) { + CHECK_THAT(unscale(segment.length), Catch::Matchers::WithinAbs(4., 1e-6)); + CHECK(segment.polyline.points.front().y() == segment.polyline.points.back().y()); + sides.push_back(segment.polyline.points.front().y()); + } + std::sort(sides.begin(), sides.end()); + CHECK(sides == std::vector{mm(0, 0).y(), mm(0, 20).y()}); +} + +TEST_CASE("A corner interval remains connected when the contour origin changes", "[PreciseSeam][SegmentExtraction]") +{ + const size_t origin = GENERATE(size_t(0), size_t(1), size_t(2), size_t(3)); + Polygon perimeter = rectangle(0, 0, 20, 20); + std::rotate(perimeter.points.begin(), perimeter.points.begin() + origin, perimeter.points.end()); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(-2, -2, 4, 4))}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 1); + const auto &segment = result.segments.front(); + CHECK(segment.polyline.points.front() == mm(0, 4)); + CHECK(segment.polyline.points.back() == mm(4, 0)); + CHECK_THAT(unscale(segment.length), Catch::Matchers::WithinAbs(8., 1e-6)); + CHECK_FALSE(result.full_containment); +} + +TEST_CASE("Collinear perimeter vertices retain their original edge provenance", "[PreciseSeam][SegmentExtraction]") +{ + const Polygon perimeter(Points{mm(0, 0), mm(2, 0), mm(4, 0), mm(8, 0), mm(20, 0), mm(20, 20), mm(0, 20)}); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(1, -2, 13, 2))}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 1); + const auto &segment = result.segments.front(); + CHECK(segment.polyline.points.front() == mm(1, 0)); + CHECK(segment.polyline.points.back() == mm(13, 0)); + CHECK(segment.edge_indices == std::vector{0, 1, 2, 3}); + CHECK_THAT(unscale(segment.length), Catch::Matchers::WithinAbs(12., 1e-6)); +} + +TEST_CASE("Interior vertices retain their sequence between two cut endpoints", "[PreciseSeam][SegmentExtraction]") +{ + const bool reverse = GENERATE(false, true); + const size_t origin = GENERATE(size_t(0), size_t(5)); + Polygon perimeter; + // A zigzag makes skipped or misbound interior edges observable in the arc length. + for (int x = 0; x <= 10; ++x) + perimeter.points.push_back(mm(x, x % 2)); + perimeter.points.push_back(mm(10, 10)); + perimeter.points.push_back(mm(0, 10)); + if (reverse) perimeter.reverse(); + std::rotate(perimeter.points.begin(), perimeter.points.begin() + origin, perimeter.points.end()); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(2.5, -2, 8.5, 3))}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 1); + const auto &segment = result.segments.front(); + Points expected{mm(2.5, .5)}; + for (int x = 3; x <= 8; ++x) + expected.push_back(mm(x, x % 2)); + expected.push_back(mm(8.5, .5)); + if (reverse) std::reverse(expected.begin(), expected.end()); + CHECK(segment.polyline.points == expected); + CHECK_THAT(unscale(segment.length), Catch::Matchers::WithinAbs(6. * std::sqrt(2.), 1e-6)); +} + +TEST_CASE("Neighboring vertices distinguish repeated anchors on different lobes", "[PreciseSeam][SegmentExtraction]") +{ + const bool reverse = GENERATE(false, true); + // Both lobes visit the origin, but their adjacent edges lead to different vertices. + Polygon perimeter(Points{mm(0, 0), mm(4, 0), mm(4, 4), mm(0, 4), + mm(0, 0), mm(-4, 0), mm(-4, -4), mm(0, -4)}); + if (reverse) perimeter.reverse(); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(-1, -5, 1, 5))}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 2); + std::vector edges; + for (const auto &segment : result.segments) { + CHECK_THAT(unscale(segment.length), Catch::Matchers::WithinAbs(6., 1e-6)); + edges.insert(edges.end(), segment.edge_indices.begin(), segment.edge_indices.end()); + } + std::sort(edges.begin(), edges.end()); + CHECK(edges == std::vector{0, 2, 3, 4, 6, 7}); +} + +TEST_CASE("Modifier holes subtract coverage while separate components add intervals", "[PreciseSeam][SegmentExtraction]") +{ + const Polygon perimeter = rectangle(0, 0, 20, 20); + ExPolygon area(rectangle(1, -3, 10, 3)); + area.holes.push_back(rectangle(4, -1, 7, 1)); + area.holes.back().reverse(); + const auto result = PreciseSeam::extract_perimeter_segments(PreciseSeam::PreparedPerimeter(perimeter), + PreciseSeam::prepare_modifier_regions({area, ExPolygon(rectangle(14, -3, 18, 3))}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 3); + const std::vector starts{mm(1, 0), mm(7, 0), mm(14, 0)}; + const std::vector ends{mm(4, 0), mm(10, 0), mm(18, 0)}; + for (size_t i = 0; i < 3; ++i) { + CHECK(result.segments[i].polyline.points.front() == starts[i]); + CHECK(result.segments[i].polyline.points.back() == ends[i]); + } + CHECK_FALSE(result.full_containment); +} + +TEST_CASE("Full coverage is distinct from an empty or point-only intersection", "[PreciseSeam][SegmentExtraction]") +{ + const bool reverse = GENERATE(false, true); + const size_t origin = GENERATE(size_t(0), size_t(1), size_t(2), size_t(3)); + Polygon perimeter = rectangle(0, 0, 20, 20); + // Coverage depends on traversed edges, not winding or the arbitrary contour origin. + if (reverse) + perimeter.reverse(); + std::rotate(perimeter.points.begin(), perimeter.points.begin() + origin, perimeter.points.end()); + const int scenario = GENERATE(0, 1, 2, 3, 4); + ExPolygons modifier; + if (scenario == 0) modifier = {ExPolygon(rectangle(-2, -2, 22, 22))}; + if (scenario == 1) modifier = {ExPolygon(rectangle(2, 2, 4, 4))}; + if (scenario == 2) modifier = {ExPolygon(rectangle(30, 30, 40, 40))}; + if (scenario == 3) modifier = {ExPolygon(rectangle(20, 20, 25, 25))}; + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions(modifier), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + CHECK(result.full_containment == (scenario == 0)); + if (scenario == 0) { + REQUIRE(result.segments.size() == 1); + CHECK_THAT(unscale(result.segments.front().polyline.length()), Catch::Matchers::WithinAbs(80., 1e-6)); + CHECK(result.segments.front().edge_indices.size() == 4); + } else + CHECK(result.segments.empty()); +} + +TEST_CASE("Full coverage survives a modifier boundary touching the perimeter at one point", "[PreciseSeam][SegmentExtraction]") +{ + const bool reverse = GENERATE(false, true); + const size_t origin = GENERATE(size_t(0), size_t(1), size_t(2), size_t(3)); + const int scenario = GENERATE(0, 1, 2); + CAPTURE(reverse, origin, scenario); + Polygon perimeter = rectangle(0, 0, 20, 20); + if (reverse) + perimeter.reverse(); + std::rotate(perimeter.points.begin(), perimeter.points.begin() + origin, perimeter.points.end()); + ExPolygon modifier(rectangle(-2, -2, 22, 22)); + if (scenario == 0) { + // A hole vertex touches the middle of an edge from inside the body. + modifier.holes.push_back(Polygon(Points{mm(10, 0), mm(12, 2), mm(10, 4), mm(8, 2)})); + modifier.holes.back().reverse(); + } else if (scenario == 1) { + // A notch in the exterior touches the same point from outside the body. + modifier = ExPolygon(Polygon(Points{mm(-2, -2), mm(8, -2), mm(10, 0), mm(12, -2), + mm(22, -2), mm(22, 22), mm(-2, 22)})); + } else { + // A hole vertex touches a corner, which is vertex zero for some origins. + modifier.holes.push_back(Polygon(Points{mm(0, 0), mm(3, 1), mm(1, 3)})); + modifier.holes.back().reverse(); + } + // A single contact point leaves no uncovered length, even if clipping splits the line there: + // the split pieces meet at one source position and merge back into complete edges. + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({modifier}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + CHECK(result.full_containment); + REQUIRE(result.segments.size() == 1); + CHECK_THAT(unscale(result.segments.front().polyline.length()), Catch::Matchers::WithinAbs(80., 1e-6)); + CHECK(result.segments.front().edge_indices.size() >= 4); +} + +TEST_CASE("A touch poking nanometres through an inclined edge is full containment", "[PreciseSeam][SegmentExtraction]") +{ + // Square of side 20 mm rotated by atan(3/4), integer vertices. A hole tip near the middle of the first + // side pokes outward along the normal (0.6, -0.8): by about 2.2 nm (a touch the integer grid cannot + // represent) or 2.2 um (a real gap). Contour origin and winding place the gap inside edge 0, inside + // the closing edge or in between. + const bool micro = GENERATE(true, false); + const bool reverse = GENERATE(false, true); + const size_t origin = GENERATE(size_t(0), size_t(1), size_t(2), size_t(3)); + CAPTURE(micro, reverse, origin); + Polygon perimeter(Points{mm(0, 0), mm(16, 12), mm(4, 28), mm(-12, 16)}); + if (reverse) + perimeter.reverse(); + std::rotate(perimeter.points.begin(), perimeter.points.begin() + origin, perimeter.points.end()); + const coord_t step = micro ? 1 : 1000; + const Point tip(mm(8, 6).x() + step, mm(8, 6).y() - 2 * step); + ExPolygon modifier(rectangle(-20, -10, 25, 40)); + modifier.holes.push_back(Polygon(Points{tip, mm(8.2, 7.4), mm(6.6, 6.2)})); + modifier.holes.back().reverse(); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({modifier}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 1); + CHECK(result.full_containment == micro); +} + +TEST_CASE("A gap around one vertex is full containment exactly when both ends snap to it", "[PreciseSeam][SegmentExtraction]") +{ + // A hole bounded by x + y = cut takes the corner (0, 0) off the square. Each end lies `cut` from the + // vertex and the uncovered length is 2 * cut: below 1 um at 300 nm; 1.4 um at 700 nm, yet both ends + // still snap onto the vertex on insertion; at 1200 nm neither does. + const coord_t cut = GENERATE(coord_t(300), coord_t(700), coord_t(1200)); + CAPTURE(cut); + const Polygon perimeter = rectangle(0, 0, 20, 20); + ExPolygon modifier(rectangle(-2, -2, 22, 22)); + const coord_t reach = coord_t(scale_(1.)); + modifier.holes.push_back(Polygon(Points{Point(-reach, -reach), Point(reach + cut, -reach), Point(-reach, reach + cut)})); + modifier.holes.back().reverse(); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({modifier}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 1); + CHECK(result.full_containment == (cut < 1000)); +} + +TEST_CASE("A sub-micron gap that contains a short edge is full containment", "[PreciseSeam][SegmentExtraction]") +{ + // The closing edge v4 -> v0 is 500 nm long. The hole boundary through (100, 0) and (0, 600) leaves + // 100 + 500 + 100 = 700 nm uncovered across two vertices; the segment does not touch edge 4. + const Polygon perimeter(Points{mm(0, 0), mm(20, 0), mm(20, 20), mm(0, 20), Point(coord_t(0), coord_t(500))}); + ExPolygon modifier(rectangle(-2, -2, 22, 22)); + modifier.holes.push_back(Polygon(Points{Point(coord_t(100100), coord_t(-600000)), Point(coord_t(-100000), coord_t(600600)), + Point(coord_t(-1000000), coord_t(-1000000))})); + modifier.holes.back().reverse(); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({modifier}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 1); + CHECK(result.full_containment); +} + +TEST_CASE("Segments whose ends meet only in space stay ordinary segments", "[PreciseSeam][SegmentExtraction]") +{ + const bool reverse = GENERATE(false, true); + const bool slit = GENERATE(false, true); + CAPTURE(reverse, slit); + Polygon perimeter; + ExPolygon modifier; + if (slit) { + // A slit 500 nm wide enters the contour from the left; the hole leaves its inner 9 mm uncovered, + // so the ends face each other across the slit while about 18 mm of perimeter lies between them. + const coord_t half = 250; + perimeter = Polygon(Points{mm(0, 0), mm(20, 0), mm(20, 10), mm(0, 10), Point(coord_t(0), mm(0, 5).y() + half), + Point(mm(10, 0).x(), mm(0, 5).y() + half), Point(mm(10, 0).x(), mm(0, 5).y() - half), + Point(coord_t(0), mm(0, 5).y() - half)}); + modifier = ExPolygon(rectangle(-2, -2, 22, 12)); + modifier.holes.push_back(rectangle(1, 4, 11, 6)); + modifier.holes.back().reverse(); + } else { + // A sharp spike 800 nm wide at its base: cutting off its 1 mm tip brings the ends within about + // 40 nm while the uncovered tip is about 2 mm long. + perimeter = Polygon(Points{mm(20, 0), mm(0, 0), Point(coord_t(0), coord_t(800))}); + modifier = ExPolygon(rectangle(-1, -1, 19, 1)); + } + if (reverse) + perimeter.reverse(); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({modifier}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 1); + const auto &segment = result.segments.front(); + CHECK((segment.polyline.points.front() - segment.polyline.points.back()).cast().norm() < scale_(0.001)); + CHECK_FALSE(result.full_containment); +} + +TEST_CASE("Repeated visits to a coordinate stay on their original perimeter edges", "[PreciseSeam][SegmentExtraction]") +{ + // Two visits to the origin belong to different lobes, not to one shared vertex. + const Polygon perimeter(Points{mm(0, 0), mm(4, 0), mm(4, 4), mm(0, 0), mm(-4, 0), mm(-4, -4)}); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(-1, -1, 1, 1))}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 2); + std::vector edges; + for (const auto &segment : result.segments) + edges.insert(edges.end(), segment.edge_indices.begin(), segment.edge_indices.end()); + std::sort(edges.begin(), edges.end()); + CHECK(edges == std::vector{0, 2, 3, 5}); +} + +TEST_CASE("Two-point fragments accept the first matching perimeter edge", "[PreciseSeam][SegmentExtraction]") +{ + // Policy: do not search for duplicate bindings on overlapping source edges. + const Polygon perimeter(Points{mm(0, 0), mm(10, 0), mm(0, 0), mm(0, 10)}); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(2, -1, 8, 1))}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 1); + CHECK(result.segments[0].edge_indices == std::vector{0}); + CHECK(result.segments[0].polyline.points.front() == mm(2, 0)); + CHECK(result.segments[0].polyline.points.back() == mm(8, 0)); + CHECK_THAT(unscale(result.segments[0].length), Catch::Matchers::WithinAbs(6., 1e-6)); +} + +TEST_CASE("Unnormalized perimeter input is reported instead of silently losing coverage", "[PreciseSeam][SegmentExtraction]") +{ + const int scenario = GENERATE(0, 1, 2, 3); + Polygon perimeter; + if (scenario == 1) perimeter.points = {mm(0, 0), mm(20, 0)}; + if (scenario == 2) perimeter.points = {mm(0, 0), mm(20, 0), mm(20, 0), mm(0, 20)}; + if (scenario == 3) perimeter.points = {mm(0, 0), mm(20, 0), mm(0, 20), mm(0, 0)}; + // Invalid geometry is rejected once, before allocating its clipping line. + const PreciseSeam::PreparedPerimeter prepared(perimeter); + CHECK_FALSE(prepared.valid); + CHECK(prepared.line.points.empty()); + CHECK_FALSE(prepared.bounds.defined); + const auto result = PreciseSeam::extract_perimeter_segments( + prepared, PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(-2, -2, 22, 22))}), ModelVolumeType::PRECISE_SEAM_CENTER); + CHECK_FALSE(result.valid); + CHECK(result.segments.empty()); + CHECK_FALSE(result.full_containment); +} + +TEST_CASE("Segment lengths measure diagonal arcs rather than squared distances", "[PreciseSeam][SegmentExtraction]") +{ + const Polygon perimeter(Points{mm(0, 0), mm(10, 10), mm(0, 10)}); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(2, -1, 6, 11))}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 2); + // The cuts lie on the grid, but Clipper computes them on the inclined edge in floating point and + // may land one unit off; allow one grid step per axis. + const auto &diagonal = result.segments[0]; + CAPTURE(diagonal.polyline.points.front(), diagonal.polyline.points.back(), diagonal.length); + CHECK((diagonal.polyline.points.front() - mm(2, 2)).cast().squaredNorm() < 2.); + CHECK((diagonal.polyline.points.back() - mm(6, 6)).cast().squaredNorm() < 2.); + CHECK(diagonal.edge_indices == std::vector{0}); + CHECK_THAT(unscale(diagonal.length), Catch::Matchers::WithinAbs(std::sqrt(32.), 3e-6)); + CHECK_THAT(unscale(result.segments[1].length), Catch::Matchers::WithinAbs(4., 1e-6)); +} + +TEST_CASE("An endpoint at an original vertex uses its outgoing edge including vertex zero", "[PreciseSeam][SegmentExtraction]") +{ + const size_t origin = GENERATE(size_t(0), size_t(1)); + Polygon perimeter(Points{mm(0, 0), mm(5, 5), mm(0, 10)}); + std::rotate(perimeter.points.begin(), perimeter.points.begin() + origin, perimeter.points.end()); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({ExPolygon(rectangle(-1, -1, 6, 5))}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 1); + const auto &segment = result.segments.front(); + CHECK(segment.polyline.points.back() == mm(5, 5)); + CHECK(segment.end.edge_index == 1 - origin); + CHECK_THAT(segment.end.parameter, Catch::Matchers::WithinAbs(0., 1e-12)); +} + +TEST_CASE("A one-unit uncovered gap is not bridged by the projection tolerance", "[PreciseSeam][SegmentExtraction]") +{ + // These are scaled integer units, deliberately smaller than the projection tolerance. + const Polygon perimeter(Points{Point(0, 0), Point(20, 0), Point(20, 20), Point(0, 20)}); + const ExPolygons modifier{ + ExPolygon(Polygon(Points{Point(3, -2), Point(8, -2), Point(8, 2), Point(3, 2)})), + ExPolygon(Polygon(Points{Point(9, -2), Point(14, -2), Point(14, 2), Point(9, 2)}))}; + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions(modifier), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 2); + CHECK(result.segments[0].polyline.points.back() == Point(8, 0)); + CHECK(result.segments[1].polyline.points.front() == Point(9, 0)); +} + +TEST_CASE("Distant modifier areas do not change nearby coverage or detach its holes", "[PreciseSeam][SegmentExtraction]") +{ + const bool reverse_areas = GENERATE(false, true); + const Polygon perimeter = rectangle(0, 0, 20, 20); + ExPolygon nearby(rectangle(1, -3, 10, 3)); + nearby.holes.push_back(rectangle(4, -1, 7, 1)); + nearby.holes.back().reverse(); + // A rejected area keeps its own hole; neither may affect the nearby area. + ExPolygon distant(rectangle(100, 100, 120, 120)); + distant.holes.push_back(rectangle(105, 105, 115, 115)); + distant.holes.back().reverse(); + ExPolygons modifier{distant, nearby, ExPolygon(rectangle(14, -3, 18, 3))}; + if (reverse_areas) std::reverse(modifier.begin(), modifier.end()); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions(modifier), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 3); + const Points starts{mm(1, 0), mm(7, 0), mm(14, 0)}; + const Points ends{mm(4, 0), mm(10, 0), mm(18, 0)}; + for (size_t i = 0; i < starts.size(); ++i) { + CHECK(result.segments[i].polyline.points.front() == starts[i]); + CHECK(result.segments[i].polyline.points.back() == ends[i]); + CHECK(result.segments[i].edge_indices == std::vector{0}); + } + CHECK_FALSE(result.full_containment); +} + +TEST_CASE("Rounded intersections on an inclined edge retain their original edge", "[PreciseSeam][SegmentExtraction]") +{ + const bool reverse = GENERATE(false, true); + // The exact cuts (3, 0.9) and (7, 2.1) are off the integer grid, so Clipper moves them to a nearby + // grid point; how it rounds is the library's business. The far vertices keep the contour + // realistically long: a contour shorter than 1 um would be below the snapping distance as a whole, + // and its remaining uncovered part would count as full containment. + Polygon perimeter(Points{Point(0, 0), Point(10, 3), Point(coord_t(10), mm(0, 20).y()), Point(coord_t(0), mm(0, 20).y())}); + if (reverse) perimeter.reverse(); + const ExPolygon area(Polygon(Points{Point(3, -2), Point(7, -2), Point(7, 5), Point(3, 5)})); + const auto result = PreciseSeam::extract_perimeter_segments( + PreciseSeam::PreparedPerimeter(perimeter), PreciseSeam::prepare_modifier_regions({area}), ModelVolumeType::PRECISE_SEAM_CENTER); + check_provenance(perimeter, result); + REQUIRE(result.segments.size() == 1); + const auto &segment = result.segments.front(); + // The rounded cuts must stay bound to the original inclined edge, within one grid step of the exact + // cuts on each axis, whatever rounding the clipping library uses. + const Vec2d first = reverse ? Vec2d(7., 2.1) : Vec2d(3., 0.9); + const Vec2d last = reverse ? Vec2d(3., 0.9) : Vec2d(7., 2.1); + CAPTURE(segment.polyline.points.front(), segment.polyline.points.back(), segment.length); + CHECK((segment.polyline.points.front().cast() - first).squaredNorm() < 2.); + CHECK((segment.polyline.points.back().cast() - last).squaredNorm() < 2.); + CHECK(segment.edge_indices == std::vector{reverse ? size_t(2) : size_t(0)}); + CHECK_THAT(segment.length, Catch::Matchers::WithinAbs((last - first).norm(), 2. * std::sqrt(2.))); + CHECK_FALSE(result.full_containment); +} From 073e2d9c443d956636193e75af5f612e97b46ddf Mon Sep 17 00:00:00 2001 From: SoftFever Date: Mon, 5 Oct 2026 02:50:14 +0800 Subject: [PATCH 214/389] Highlight the faces a selected feature made in the Design tab Selections are drawn as opaque faces in the selection colour with a cased outline instead of a translucent tint over the body, so they read on a body of any colour. Selecting a Feature tree row lights the faces that feature made rather than its whole body, which also makes fillet and chamfer rows highlight again. --- docs/HLSD/design-tab.md | 24 ++ src/libslic3r/CAD/CadDocument.cpp | 246 +++++++++++++++--- src/libslic3r/CAD/CadDocument.hpp | 17 ++ src/slic3r/GUI/CAD/DesignCanvas.cpp | 147 +++++++---- src/slic3r/GUI/CAD/DesignCanvas.hpp | 25 +- src/slic3r/GUI/CAD/DesignPanel.cpp | 81 ++++-- src/slic3r/GUI/CAD/DesignPanel.hpp | 11 + src/slic3r/GUI/CAD/DesignSketchTool.cpp | 316 +++++++++++++++++------- src/slic3r/GUI/CAD/DesignSketchTool.hpp | 37 ++- tests/libslic3r/test_caddocument.cpp | 165 +++++++++++++ 10 files changed, 866 insertions(+), 203 deletions(-) diff --git a/docs/HLSD/design-tab.md b/docs/HLSD/design-tab.md index 4f8b61d755..a29061c27f 100644 --- a/docs/HLSD/design-tab.md +++ b/docs/HLSD/design-tab.md @@ -187,6 +187,30 @@ degenerate edges are left out (`GeometryEngine::display_edges`), and the polylin once per shape, keyed by its `TShape`, because a recompute that leaves a body unchanged is the common case. +## Showing what is selected + +A selection is drawn on the faces it names, never as a tint over the body: a translucent +selection colour blended into the body's own colour turns a different hue on every body and +vanishes on one close to it. Selected faces are split out of their body into a volume of their +own, which the canvas draws opaque in the selection colour through the same shader and lighting +as the body (`DesignCanvas::rebuild_bodies`); the sketch overlay outlines them with a cased line +— a dark band under a selection-coloured one — so the outline still reads on a body that wears +the selection colour itself. A body picked whole, a face picked in the viewport and the faces of +the Feature tree's selected feature all draw this way. The hover pre-highlight is the outline +alone, uncased: it promises a click, it is not one. + +Selecting a feature row lights the faces that feature made, not the whole body it sits on, so a +fillet row shows its round and the extrude under it keeps the faces the fillet trimmed. +`CadDocument::faces_made_by` answers it without per-feature history: it replays the recipe to +just before the feature and then the feature alone, and a face of the finished model belongs to +the feature when an interior point of it lies on the boundary afterwards and not before, facing +the same way — the facing keeps a block stacked on a base the owner of its bottom face. A feature +that makes no face of its own, such as a Boolean union, answers with the bodies it changed. The +replay costs up to a recompute, so the panel finds the faces once per row and topology +generation, off the UI thread, and only while no feature card is open. One selection is live at +a time: a viewport pick clears the feature row and a feature row clears the viewport pick, as the +Feature tree and Bodies list do between themselves. + ## Following the app The tab is a page of Orca's main window and answers to the same settings as Prepare. diff --git a/src/libslic3r/CAD/CadDocument.cpp b/src/libslic3r/CAD/CadDocument.cpp index df3c1f7135..e31363cdf8 100644 --- a/src/libslic3r/CAD/CadDocument.cpp +++ b/src/libslic3r/CAD/CadDocument.cpp @@ -84,6 +84,7 @@ #include #include #include +#include #include #include #include @@ -92,6 +93,11 @@ #include #include #include +#include // faces_made_by: is a point on a face +#include +#include +#include +#include #include #include #include @@ -4017,6 +4023,39 @@ void CadDocument::route_feature(std::vector& bodies, const CadFeature& } } +void CadDocument::bind_expressions() +{ + std::map varvals = evaluate_variables(variables); + for (CadFeature& f : features) + for (const auto& [field, e] : f.expr) + assign_field(f, field, eval_expr(e, varvals)); +} + +void CadDocument::replay_feature(size_t fi, std::vector& built) +{ + CadFeature& f = features[fi]; + if (!f.enabled) return; + if (f.type == CadFeatureType::Sketch) return; // consumed by an extrude + if (f.type == CadFeatureType::Helix) return; // consumed by Sweep as a path + if (f.type == CadFeatureType::Plane) return; // datum: no solid, derived on demand + if (f.type == CadFeatureType::Axis) return; // datum axis + if (f.type == CadFeatureType::CoordSys) return; // datum coordinate system + settle_body_refs(f, built, true); + if (f.type == CadFeatureType::Project) { apply_project(built, f); } + else { route_feature(built, f); } + // Record which feature made each body. "Still unset?" is the whole rule, and it is + // sufficient because of an invariant worth stating: NO feature ever replaces a whole + // CadBody. Every in-place op writes only `.shape` (boolean, cut, mirror-fuse, + // transform, dress-up — checked, all 8 sites), so an existing body keeps the stamp it + // was born with; a consumed body is erased outright, taking its stamp with it; and + // the only bodies still at -1 here are the ones THIS feature just pushed. That also + // means a feature type added later needs no change here, as long as it keeps to the + // same invariant. + for (CadBody& b : built) + if (b.source_feature < 0) + b.source_feature = int(fi); +} + bool CadDocument::recompute() { error.clear(); @@ -4030,39 +4069,13 @@ bool CadDocument::recompute() // the 3MF recipe only "on success", so nothing was written, and deserialize_recipe ends with // `return recompute()`, so a project that did carry a recipe was refused on load with // "Could not restore the CAD model" while its features sat correctly in the list. mtav. - bool any_solid_feature = false; + const bool any_solid_feature = std::any_of(features.begin(), features.end(), [](const CadFeature& f) { + return f.enabled && produces_body(f.type); + }); try { - // Parametric pass: evaluate document variables, then each feature's expression bindings, - // writing the results into the feature's numeric fields before geometry runs. - std::map varvals = evaluate_variables(variables); - for (CadFeature& f : features) - for (const auto& [field, e] : f.expr) - assign_field(f, field, eval_expr(e, varvals)); - for (size_t fi = 0; fi < features.size(); ++fi) { - CadFeature& f = features[fi]; - if (!f.enabled) continue; - if (f.type == CadFeatureType::Sketch) continue; // consumed by an extrude - if (f.type == CadFeatureType::Helix) continue; // consumed by Sweep as a path - if (f.type == CadFeatureType::Plane) continue; // datum: no solid, derived on demand - if (f.type == CadFeatureType::Axis) continue; // datum axis - if (f.type == CadFeatureType::CoordSys) continue; // datum coordinate system - // Past the skips. Project runs here too but leaves no body of its own. - if (produces_body(f.type)) any_solid_feature = true; - settle_body_refs(f, built, true); - if (f.type == CadFeatureType::Project) { apply_project(built, f); } - else { route_feature(built, f); } - // Record which feature made each body. "Still unset?" is the whole rule, and it is - // sufficient because of an invariant worth stating: NO feature ever replaces a whole - // CadBody. Every in-place op writes only `.shape` (boolean, cut, mirror-fuse, - // transform, dress-up — checked, all 8 sites), so an existing body keeps the stamp it - // was born with; a consumed body is erased outright, taking its stamp with it; and - // the only bodies still at -1 here are the ones THIS feature just pushed. That also - // means a feature type added later needs no change here, as long as it keeps to the - // same invariant. - for (CadBody& b : built) - if (b.source_feature < 0) - b.source_feature = int(fi); - } + bind_expressions(); + for (size_t fi = 0; fi < features.size(); ++fi) + replay_feature(fi, built); } catch (const Standard_Failure& e) { // OCCT raises Standard_Failure (NOT a std::exception) — must be caught // here or it escapes the event handler and terminates the app. @@ -4217,6 +4230,175 @@ bool CadDocument::preview(const CadFeature& candidate, TriangleMesh& out_mesh, s return preview(candidate, out_mesh, ignore, err); } +namespace { + +// A face of a replayed body and what the boundary test needs from it. The projector is built on +// first use: few probes pass the box test, and building one on a freeform surface samples the +// whole surface. +struct FaceProbe { + TopoDS_Face face; + Handle(Geom_Surface) surface; + Bnd_Box box; + mutable std::unique_ptr proj; +}; + +// How close a point must be to lie on a face: a face rebuilt on the same surface is within +// 1e-7 mm of it, a new face nowhere near. +constexpr double kOnFaceTol = 1e-4; + +std::vector face_probes(const std::vector& bodies) +{ + std::vector out; + for (const CadBody& b : bodies) + for (TopExp_Explorer e(b.shape, TopAbs_FACE); e.More(); e.Next()) { + FaceProbe p; + p.face = TopoDS::Face(e.Current()); + p.surface = BRep_Tool::Surface(p.face); + if (p.surface.IsNull()) continue; + BRepBndLib::Add(p.face, p.box); + p.box.Enlarge(kOnFaceTol); + out.push_back(std::move(p)); + } + return out; +} + +bool outward_normal(const TopoDS_Face& face, double u, double v, gp_Dir& n) +{ + BRepAdaptor_Surface surf(face); + BRepLProp_SLProps props(surf, u, v, 1, Precision::Confusion()); + if (!props.IsNormalDefined()) return false; + n = props.Normal(); + if (face.Orientation() == TopAbs_REVERSED) n.Reverse(); + return true; +} + +// A point inside `face` and its outward normal there: the UV centroid of the largest triangle of +// the face's triangulation, which lies inside the trimmed face even where the centre of its UV +// bounds falls in a hole. Without a triangulation, that centre, if it is inside. +bool interior_point(const TopoDS_Face& face, gp_Pnt& p, gp_Dir& n) +{ + TopLoc_Location loc; + const Handle(Poly_Triangulation) tri = BRep_Tool::Triangulation(face, loc); + double u = 0., v = 0., best = -1.; + if (!tri.IsNull() && tri->HasUVNodes()) + for (int i = 1; i <= tri->NbTriangles(); ++i) { + int a, b, c; + tri->Triangle(i).Get(a, b, c); + const gp_Pnt pa = tri->Node(a); + const double area = gp_Vec(pa, tri->Node(b)).Crossed(gp_Vec(pa, tri->Node(c))).SquareMagnitude(); + if (area <= best) continue; + best = area; + const gp_XY uv = (tri->UVNode(a).XY() + tri->UVNode(b).XY() + tri->UVNode(c).XY()) / 3.; + u = uv.X(); + v = uv.Y(); + } + if (best < 0.) { + double u0, u1, v0, v1; + BRepTools::UVBounds(face, u0, u1, v0, v1); + u = 0.5 * (u0 + u1); + v = 0.5 * (v0 + v1); + if (BRepClass_FaceClassifier(face, gp_Pnt2d(u, v), Precision::Confusion()).State() != TopAbs_IN) + return false; + } + p = BRepAdaptor_Surface(face).Value(u, v); + return outward_normal(face, u, v, n); +} + +// Does `p` lie on one of `probes`, on a face turned the same way as `n`? The facing tells apart +// coincident faces of different bodies: a block stacked on a base has its bottom in the base's +// top face, turned the other way. +bool on_boundary(const std::vector& probes, const gp_Pnt& p, const gp_Dir& n) +{ + for (const FaceProbe& fp : probes) { + if (fp.box.IsOut(p)) continue; + try { + if (!fp.proj) { + // The setup GeomAPI_ProjectPointOnSurf(p, surface) repeats for every point, done once. + double u0, u1, v0, v1; + fp.surface->Bounds(u0, u1, v0, v1); + fp.proj = std::make_unique(); + fp.proj->Init(fp.surface, u0, u1, v0, v1, Precision::Confusion()); + } + GeomAPI_ProjectPointOnSurf& proj = *fp.proj; + proj.Perform(p); + if (proj.NbPoints() == 0 || proj.LowerDistance() > kOnFaceTol) continue; + double u, v; + proj.LowerDistanceParameters(u, v); + if (BRepClass_FaceClassifier(fp.face, gp_Pnt2d(u, v), kOnFaceTol).State() == TopAbs_OUT) continue; + gp_Dir m; + if (outward_normal(fp.face, u, v, m) && m.Dot(n) > 0.) return true; + } catch (const Standard_Failure&) { + // A surface the projection cannot handle says nothing about the point. + } + } + return false; +} + +} // namespace + +std::vector> CadDocument::faces_made_by(int index) const +{ + std::vector> out; + if (index < 0 || index >= int(features.size()) || !features[index].enabled + || !produces_body(features[index].type) || bodies.empty()) + return out; + + // Replay up to the feature, then the feature alone on a copy, so a body it left alone is the + // same shape on both sides. On a scratch document, as a replay settles references in the + // features it runs; it reads only the features, the variables and the process-wide weld rule. + CadDocument tmp; + tmp.features = features; + tmp.variables = variables; + std::vector before, after; + try { + set_sketch_auto_close(auto_close_loops); + tmp.bind_expressions(); + for (size_t fi = 0; fi < size_t(index); ++fi) + tmp.replay_feature(fi, before); + after = before; + tmp.replay_feature(size_t(index), after); + } catch (...) { // OCCT's Standard_Failure as well as std::exception + return out; + } + + // The bodies the step made or replaced. A face on any other body was on the boundary before + // the step too, so only these are probed after it. + std::vector changed; + std::vector changed_bodies; + for (int j = 0; j < int(after.size()); ++j) + if (std::none_of(before.begin(), before.end(), [&](const CadBody& w) { return w.shape.IsSame(after[j].shape); })) { + changed.push_back(j); + changed_bodies.push_back(after[j]); + } + const std::vector was = face_probes(before), now = face_probes(changed_bodies); + for (int b = 0; b < int(bodies.size()); ++b) { + int id = 0; + for (TopExp_Explorer e(bodies[b].shape, TopAbs_FACE); e.More(); e.Next(), ++id) { + gp_Pnt p; + gp_Dir n; + try { + if (interior_point(TopoDS::Face(e.Current()), p, n) && on_boundary(now, p, n) && !on_boundary(was, p, n)) + out.emplace_back(b, id); + } catch (const Standard_Failure&) { + // A face that cannot be sampled is left out, not the whole answer. + } + } + } + if (!out.empty()) + return out; + + // No face of its own: answer with every face of each body the step changed, found again in + // the finished model by the id a body keeps across the rest of the history. + for (int j : changed) { + const int b = find_body(bodies, body_id_of(after, j)); + if (b < 0) continue; + const int n = GeometryEngine::face_count(bodies[b].shape); + for (int id = 0; id < n; ++id) + out.emplace_back(b, id); + } + return out; +} + std::string brep_to_string(const TopoDS_Shape& s) { if (s.IsNull()) return {}; diff --git a/src/libslic3r/CAD/CadDocument.hpp b/src/libslic3r/CAD/CadDocument.hpp index d247780d5d..8adbd7b20c 100644 --- a/src/libslic3r/CAD/CadDocument.hpp +++ b/src/libslic3r/CAD/CadDocument.hpp @@ -848,6 +848,16 @@ public: bool preview(const CadFeature& candidate, TriangleMesh& out_mesh, std::vector& out_body_meshes, std::string& err) const; + // The faces of the current bodies that features[index] made, as (body, face id) pairs: what + // the Design tab highlights when that feature is selected. A face counts when it lies on the + // model's boundary, facing the same way, right after the feature and not right before it, so + // a face a later feature trimmed still belongs to the one that made it. Positions are + // compared, no history is kept: a face a later feature rebuilt in place stays the earlier + // feature's. A feature with no face left of its own (a Boolean union, or one whose faces a + // later feature removed) answers with every face of each body it changed. Empty for a feature + // that leaves no body, a hidden one, or a history that no longer rebuilds up to it. + std::vector> faces_made_by(int index) const; + private: TopoDS_Wire build_sketch_wire(const CadFeature& sketch, bool closed_only = false) const; // The planar region an Extrude sweeps: the sketch's outer loop with its inner loops as @@ -864,6 +874,13 @@ private: // starts a new body (empty list, or an Extrude with mode New) vs mutates an existing // one, then apply_feature. Shared by recompute() (replay all) and preview() (candidate). void route_feature(std::vector& bodies, const CadFeature& f) const; + // The parametric pass every replay starts with: evaluate the variables and write each + // feature's expression bindings into its numeric fields. + void bind_expressions(); + // One step of the replay: route features[fi] into `built` and stamp the bodies it created + // with fi. A hidden feature, a sketch, a helix or a datum leaves `built` alone. Throws on + // failure. + void replay_feature(size_t fi, std::vector& built); // Boolean between two existing bodies: resolve target + tool, optionally snap the tool so // the picked faces mate, run the OCCT op (with fuzzy tolerance), write the result back to the // target and erase the consumed tool. Mutates the bodies vector directly (unlike apply_feature, diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index c638747b89..ad7ede3d05 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -16,6 +16,7 @@ #include "libslic3r/Config.hpp" #include #include +#include #include #include @@ -331,33 +332,25 @@ void DesignCanvas::reload(bool keep_view) for (int i = 0; i < (int)m_model.objects.size(); ++i) m_canvas->load_object(m_model, i); - const ColorRGBA sel_gold = design_selection_color(); // same colour as every other selection const ColorRGBA ghost(0.26f, 0.66f, 1.0f, 0.45f); const auto& volumes = m_canvas->get_volumes().volumes; for (auto* v : volumes) { int obj_idx = v->object_idx(); if (obj_idx == 0) { - // Object 0 holds one volume per body — colour each by its body index so - // multiple coexisting solids are visually distinct (Onshape per-part colour). - const int b = v->volume_idx(); + // Object 0 holds the bodies (rebuild_bodies): each volume in its body's colour, so + // coexisting solids read as distinct parts (Onshape per-part colour), or in the + // selection colour when it holds the body's selected faces. + const int vi = v->volume_idx(); + const int b = vi < int(m_volumes.size()) ? m_volumes[vi].body : vi; + const bool lit = vi < int(m_volumes.size()) && m_volumes[vi].lit; bool hidden = (b >= 0 && b < int(m_body_visible.size())) && !m_body_visible[b]; // Preview-only mode (fillet/chamfer/draft, once a valid target is picked): hide // every base body so only the result ghost is on screen until Confirm. if (m_body_hidden) hidden = true; v->is_active = !hidden; // per-body visibility toggle if (!hidden) { - // An EXPLICIT colour outranks the selection tint. m_body_selected is a - // document-wide flag raised whenever a non-Sketch feature row is selected — - // the normal resting state after any modelling operation — so painting every - // body gold on it made the Color tool look broken: the override was written, - // carried across recompute and read back correctly, and then overpainted here - // every single frame. A body the user deliberately coloured keeps its colour; - // the rest still tint, which is all the tint was ever for. - const bool overridden = m_color_bodies != nullptr && b >= 0 - && b < int(m_color_bodies->size()) - && (*m_color_bodies)[b].has_color; - ColorRGBA c = (m_body_selected && !overridden) ? sel_gold : body_color(b); + ColorRGBA c = lit ? design_selection_color() : body_color(b); if (b == m_hl_body_target) c = ColorRGBA(0.30f, 0.90f, 0.70f, 1.0f); // target = teal-green else if (b == m_hl_body_tool) c = ColorRGBA(1.00f, 0.55f, 0.15f, 1.0f); // tool = orange if (m_body_translucent) c.a(0.30f); @@ -385,45 +378,23 @@ void DesignCanvas::reload(bool keep_view) m_canvas_widget->Refresh(); } -void DesignCanvas::set_mesh(const TriangleMesh& mesh) -{ - if (m_model.objects.empty()) { - auto* obj = m_model.add_object(); - obj->add_volume(mesh); - obj->add_instance(); - } else { - ModelObject* obj = m_model.objects.front(); - obj->clear_volumes(); - obj->add_volume(mesh); - if (obj->instances.empty()) - obj->add_instance(); - } - - reload(!m_first_frame); -} - -void DesignCanvas::set_bodies(const std::vector& body_meshes, +void DesignCanvas::set_bodies(const std::vector* body_meshes, const std::vector& visible) { - // Object 0 carries one GLVolume per body so reload() can colour each distinctly. - // Falls back to a single-volume object when there's only one body (identical look - // to the old set_mesh path). Picking still uses the combined mesh via set_solid_pick. + // Object 0 is built by rebuild_bodies; picking uses the combined mesh from set_solid_pick. m_body_visible = visible; // empty => all visible; reload() reads this per volume - if (body_meshes.empty()) { clear_mesh(); return; } - - ModelObject* obj = m_model.objects.empty() ? m_model.add_object() - : m_model.objects.front(); - obj->clear_volumes(); - for (const TriangleMesh& m : body_meshes) - obj->add_volume(m); - if (obj->instances.empty()) - obj->add_instance(); + if (body_meshes == nullptr || body_meshes->empty()) { clear_mesh(); return; } + m_body_meshes = body_meshes; + m_lit_faces = m_sketch_tool.selected_faces(); + rebuild_bodies(); reload(!m_first_frame); } void DesignCanvas::clear_mesh() { + m_body_meshes = nullptr; + m_volumes.clear(); if (!m_model.objects.empty()) { m_model.delete_object((size_t)0); reload(true); @@ -682,6 +653,7 @@ void DesignCanvas::clear_loop_pick() void DesignCanvas::clear_solid_pick() { m_sketch_tool.clear_solid_selection(); + sync_selected_faces(); } void DesignCanvas::set_loop_pick(int feature, int region) @@ -711,7 +683,9 @@ void DesignCanvas::set_solid_pick(const std::vector* bodies, const Tria const std::vector* xform) { m_color_bodies = bodies; // stable address (m_doc.bodies); reload() reads colour overrides + m_tri_face = tri_face; m_sketch_tool.set_solid_pick(bodies, mesh, tri_face, tri_body, visible, xform); + sync_selected_faces(); // the tool just reset its pick } // Effective display colour for a body: per-body override (Color tool) when set, else the @@ -914,12 +888,19 @@ std::vector DesignCanvas::selected_solid_edges() const void DesignCanvas::set_on_solid_selection_changed(std::function cb) { - m_sketch_tool.on_solid_selection_changed = std::move(cb); + // Wrapped so every pick change in the tool also re-splits the filled faces. + m_on_solid_selection_changed = std::move(cb); + m_sketch_tool.on_solid_selection_changed = [this](int level, int body, int face, int edge) { + sync_selected_faces(); + if (m_on_solid_selection_changed) + m_on_solid_selection_changed(level, body, face, edge); + }; } void DesignCanvas::select_body(int body) { m_sketch_tool.select_body(body); + sync_selected_faces(); request_repaint(); } @@ -1211,11 +1192,75 @@ void DesignCanvas::render_hud() chip("##design_readout", m_hud_last, ds.x - margin, 1.f, 0.f, &ImGuiWrapper::COL_ORCA); } -void DesignCanvas::set_body_highlight(bool on) +void DesignCanvas::set_highlight_faces(const std::vector>& faces) { - if (m_body_selected == on) return; - m_body_selected = on; - reload(true); // recolours the body volume (selected = cyan tint) + m_sketch_tool.set_highlight_faces(faces); + sync_selected_faces(); + request_repaint(); +} + +void DesignCanvas::sync_selected_faces() +{ + // Deferred to the end of the current event, which may change the selection several times: + // every re-split reloads all the bodies. A set_bodies in between splits by the current + // selection itself and leaves this nothing to do. + if (m_split_pending) + return; + m_split_pending = true; + CallAfter([this] { + m_split_pending = false; + std::vector> want = m_sketch_tool.selected_faces(); + if (want == m_lit_faces) + return; + m_lit_faces = std::move(want); + if (m_body_meshes == nullptr || m_model.objects.empty()) + return; + rebuild_bodies(); + reload(true); + }); +} + +// Object 0: one volume per body, with its selected faces split off into a volume of their own. +// The per-triangle face ids (all bodies, in order) match triangles to faces; when their count +// does not match the meshes, nothing is split. +void DesignCanvas::rebuild_bodies() +{ + ModelObject* obj = m_model.objects.empty() ? m_model.add_object() : m_model.objects.front(); + obj->clear_volumes(); + m_volumes.clear(); + const std::vector& meshes = *m_body_meshes; + size_t ntri = 0; + for (const TriangleMesh& m : meshes) + ntri += m.its.indices.size(); + const bool mapped = m_tri_face != nullptr && m_tri_face->size() == ntri; + size_t off = 0; + for (int b = 0; b < int(meshes.size()); ++b) { + const TriangleMesh& mesh = meshes[b]; + const auto first = std::lower_bound(m_lit_faces.begin(), m_lit_faces.end(), std::make_pair(b, INT_MIN)); + const auto last = std::lower_bound(first, m_lit_faces.end(), std::make_pair(b + 1, INT_MIN)); + if (!mapped || first == last) { + obj->add_volume(mesh); + m_volumes.push_back({ b, false }); + } else { + indexed_triangle_set parts[2]; // [0] the rest of the body, [1] its selected faces + for (size_t i = 0; i < mesh.its.indices.size(); ++i) { + const int f = (*m_tri_face)[off + i]; + const bool lit = std::binary_search(first, last, std::make_pair(b, f)); + parts[lit].indices.push_back(mesh.its.indices[i]); + } + for (int lit = 0; lit < 2; ++lit) { + if (parts[lit].indices.empty()) + continue; + parts[lit].vertices = mesh.its.vertices; + its_compactify_vertices(parts[lit]); + obj->add_volume(TriangleMesh(std::move(parts[lit]))); + m_volumes.push_back({ b, lit == 1 }); + } + } + off += mesh.its.indices.size(); + } + if (obj->instances.empty()) + obj->add_instance(); } void DesignCanvas::set_operand_bodies(int target_body, int tool_body) @@ -1223,7 +1268,7 @@ void DesignCanvas::set_operand_bodies(int target_body, int tool_body) if (m_hl_body_target == target_body && m_hl_body_tool == tool_body) return; m_hl_body_target = target_body; m_hl_body_tool = tool_body; - reload(true); // recolours the body volumes (same idiom set_body_highlight uses) + reload(true); // recolours the body volumes } void DesignCanvas::set_highlight_sketches(std::vector> hl) diff --git a/src/slic3r/GUI/CAD/DesignCanvas.hpp b/src/slic3r/GUI/CAD/DesignCanvas.hpp index 5701bd5ec4..e10ecdb2ba 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.hpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.hpp @@ -41,10 +41,10 @@ public: explicit DesignCanvas(wxWindow* parent); ~DesignCanvas() override; - void set_mesh(const TriangleMesh& mesh); // Multi-body display: one GLVolume per body, each coloured distinctly (per-body colour). - // `visible` (optional, indexed by body) hides bodies whose flag is false. - void set_bodies(const std::vector& body_meshes, + // `visible` (optional, indexed by body) hides bodies whose flag is false. `body_meshes` is kept + // by address (a stable panel member) and read again whenever the selection changes. + void set_bodies(const std::vector* body_meshes, const std::vector& visible = {}); void clear_mesh(); @@ -239,7 +239,9 @@ public: // Mate connectors, drawn as frames so their verse and polarity are visible (wgsc). void set_mate_connectors(std::vector g); void set_mate_links(std::vector> l); - void set_body_highlight(bool on); // tint the solid when its feature is tree-selected + // Draw these (body, face id) faces as selected: the faces the Feature tree's selected feature + // made (CadDocument::faces_made_by). Empty clears them. + void set_highlight_faces(const std::vector>& faces); // The status line, shown along the BASE OF THE VIEWPORT rather than in the side panel: // the panel clips it at ~73 characters with no warning (8cc), the viewport's // bottom margin has the whole window width to spare. Empty text hides it. @@ -375,6 +377,20 @@ private: void reload(bool keep_view); void swap_camera(); // enter_viewport / leave_viewport, in the one direction they share + // Selected faces are filled by the canvas: each body's selected faces become a volume of their + // own, drawn opaque in the selection colour with the body's shader and lighting, so a selection + // is the same colour on every body. The faces are the sketch tool's selected_faces() (the + // Feature tree row's and the committed face or body pick), which the tool outlines. + void rebuild_bodies(); // object 0 from m_body_meshes, split by m_lit_faces + void sync_selected_faces(); // re-split and reload, once queued, if the selection changed + struct BodyVolume { int body; bool lit; }; // an object 0 volume: its body, and whether it holds selected faces + const std::vector* m_body_meshes{nullptr}; // set_bodies + const std::vector* m_tri_face{nullptr}; // per-triangle face id, all bodies in order + std::vector> m_lit_faces; // what object 0 is split by now + std::vector m_volumes; // object 0's volumes, in order + bool m_split_pending{false}; + std::function m_on_solid_selection_changed; + wxGLCanvas* m_canvas_widget{nullptr}; GLCanvas3D* m_canvas{nullptr}; int m_sw_gl{-1}; // -1 unknown, 0 hardware GL, 1 software GL @@ -394,7 +410,6 @@ private: bool m_camera_swapped{false}; // guards a leave without an enter, and the reverse Model m_model; bool m_first_frame{true}; - bool m_body_selected{false}; // tree selected a body feature → tint the solid int m_hl_body_target{-1}; int m_hl_body_tool{-1}; bool m_body_translucent{false};// fillet/chamfer preview → render the body see-through diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 9c84a65942..1f8ad16d5c 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -3093,9 +3093,8 @@ DesignPanel::DesignPanel(wxWindow* parent) m_tree->SetBackgroundColour(dp_panel_bg()); tree_inner->Add(m_tree, 0, wxEXPAND | wxALL, 12); - // Selecting a body-producing feature (Extrude/Fillet/Chamfer/Hole/Thread) in the - // tree highlights the solid in the viewport; a Sketch row clears the highlight - // (its face is already shown via the persistent sketch overlay). + // Selecting a feature that leaves a body (Extrude, Fillet, Chamfer, Hole, ...) lights the + // faces it made in the viewport — the fillet's round, not the whole part it sits on. m_tree->on_select = [this] { if (!m_viewport) return; // Picking a feature drops any body selection, so the two lists never both claim to be @@ -3104,10 +3103,11 @@ DesignPanel::DesignPanel(wxWindow* parent) // THIS handler, which would otherwise clear the body row the user had just clicked. if (m_parts && tree_selection() != wxNOT_FOUND) m_parts->unselect(); const int sel = tree_selection(); - const bool body = (sel >= 0 && sel < int(m_doc.features.size()) && - m_doc.features[sel].type != CadFeatureType::Sketch && - !m_doc.body.IsNull()); - m_viewport->set_body_highlight(body); + // Likewise a viewport pick, which would be drawn just like the feature's faces. Not while + // a card is open: the card reads that pick. + if (sel != wxNOT_FOUND && m_active == Tool::None) + drop_solid_pick(); // not the loop pick: clicking a sketch loop selects its row + request_feature_highlight(); // A conflicting mate says WHY on selection, and names the one action that resolves it. // Suppress is the generic per-feature enable toggle (the eye), so the answer is already // one click away on a row the user has just selected — the message points at it instead @@ -3268,7 +3268,6 @@ DesignPanel::DesignPanel(wxWindow* parent) // One selection at a time: a body row and a feature row mean different things to the // op bar, so clear the feature tree's highlight when a body takes over. if (m_tree) m_tree->unselect(); - m_viewport->set_body_highlight(false); // the per-body overlay does the tint m_viewport->select_body(b); // also drops the vertex/edge marker m_sel_solid_body = b; m_sel_solid_face = m_sel_solid_edge = -1; @@ -3623,9 +3622,12 @@ DesignPanel::DesignPanel(wxWindow* parent) // has focus; we lay the selected body face on the bed. Returns false when no face is // selected so the key can fall through to the default handler. - // Clicking a solid cycles whole -> face -> edge. The tool draws the cyan overlay for ALL - // levels now (per-body, so other bodies stay untinted) — no whole-compound set_body_highlight. + // Clicking a solid cycles whole -> face -> edge. The tool draws the selection for every + // level, per body, so other bodies keep their own look. m_viewport->set_on_solid_selection_changed([this](int level, int body, int face, int edge) { + // One selection at a time: a pick replaces the Feature tree row. Not while a card is open: + // the feature being edited keeps its row while the card's picks are made. + if (level >= 1 && m_active == Tool::None && m_tree) m_tree->unselect(); // A pick that fell through the move gizmo (clicked off the arrows) exits move mode. if (m_viewport->moving_body()) m_viewport->clear_move_gizmo(); // Remember which body + face/edge so Extrude / dress-up target the RIGHT body. @@ -7462,6 +7464,7 @@ void DesignPanel::refresh_tree() m_tree->set_rows(std::move(rows)); refresh_parts(); // bodies live in their own list below the tree, never clipped by history m_tree->select(keep); + request_feature_highlight(); // set_rows and select() say nothing when `keep` is gone if (m_form && m_form->GetSizer()) { update_cards_frame(); m_form->Layout(); m_form->FitInside(); } } @@ -7610,7 +7613,50 @@ void DesignPanel::feed_bodies() // place), so it needs no re-call here — the whole/face/edge selection survives a move drag. if (m_viewport == nullptr) return; rebuild_disp_meshes(); - m_viewport->set_bodies(m_disp_body_meshes, m_body_visible); + m_viewport->set_bodies(&m_disp_body_meshes, m_body_visible); + // A new topology may renumber faces, so the feature's faces are found again; until then the + // viewport drops those on a body whose shape has changed. + if (m_hl_generation != m_doc.topo_generation) + request_feature_highlight(); +} + +void DesignPanel::request_feature_highlight() +{ + if (m_hl_pending) return; + m_hl_pending = true; + // Not on the stack of the click or the rebuild that asked: finding the faces may put up the + // busy dialog, and the document must have settled. + CallAfter([this] { update_feature_highlight(); }); +} + +void DesignPanel::update_feature_highlight() +{ + m_hl_pending = false; + if (m_viewport == nullptr) return; + // A rebuild's busy loop runs queued events while its worker owns the document. Skipped, not + // re-queued (the loop would run it again at once and spin): the rebuild's own refresh + // (feed_bodies, refresh_tree) asks again when it is done. + if (s_doc_worker_busy.load() > 0) return; + const int sel = tree_selection(); + // Hidden while a feature card is open: the card's ghost and picks are what the view is about. + const bool wanted = sel >= 0 && sel < int(m_doc.features.size()) && m_active == Tool::None; + if (wanted && (sel != m_hl_feature || m_hl_generation != m_doc.topo_generation)) { + std::vector> faces; + const CadFeature& f = m_doc.features[sel]; + if (f.enabled && CadDocument::produces_body(f.type)) // the rest make no faces + run_off_ui_thread(this, _L("Finding the feature's faces…"), [this, sel, &faces] { + try { + faces = m_doc.faces_made_by(sel); + } catch (...) { + faces.clear(); // a highlight is not worth an escaped exception + } + }); + m_hl_faces = std::move(faces); + m_hl_feature = sel; + m_hl_generation = m_doc.topo_generation; + } + // Re-sending the same faces is cheap: the viewport reuses what it has. + m_viewport->set_highlight_faces(wanted ? m_hl_faces : std::vector>{}); } // Boolean (combine bodies) — one gate for every door onto the tool. A body-body operation @@ -7774,15 +7820,20 @@ void DesignPanel::set_tree_selection(int row) // delete, reorder) drops it, the viewport's highlights with it. The solid highlight too: a rebuild // that leaves no body never reaches set_solid_pick. The callers repaint. void DesignPanel::drop_selection() +{ + if (m_viewport != nullptr) + m_viewport->clear_loop_pick(); + drop_solid_pick(); +} + +void DesignPanel::drop_solid_pick() { m_sel_solid_body = m_sel_solid_face = m_sel_solid_edge = -1; m_sel_solid_edges.clear(); m_sel_solid_vertex = false; m_pick_face = m_pick_face_body = -1; - if (m_viewport != nullptr) { - m_viewport->clear_loop_pick(); + if (m_viewport != nullptr) m_viewport->clear_solid_pick(); - } } // The shared front of delete and reorder, which renumber the feature list. A sketch or constrain @@ -11417,6 +11468,7 @@ void DesignPanel::open_tool(Tool t) // the card appears always means "keep this one" regardless of what the last session did. if (t == Tool::Boolean) m_bool_next_slot = 0; + request_feature_highlight(); // the card's ghost and picks take the view over } void DesignPanel::close_tool() @@ -11486,6 +11538,7 @@ void DesignPanel::close_tool() update_cards_frame(); m_form->Layout(); m_form->FitInside(); update_action_bar(); // no feature tool active -> hide the bar (unless a mode keeps it) + request_feature_highlight(); // the selected row's faces come back with the card gone } void DesignPanel::confirm_tool() diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index 86fde6254e..772cb1d09f 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -294,6 +294,7 @@ private: void on_edit_feature(); // reopen the selected feature's dialog populated void after_tree_edit(bool ok); // shared post-op refresh of tree/viewport/status void drop_selection(); // forget the selection (solid, hit face, sketch loop): the feature list was replaced or renumbered + void drop_solid_pick(); // the solid and hit-face part of drop_selection bool begin_renumber(); // before delete/reorder: refuse while an index is held, else close the card, checkpoint, drop picks void load_feature_into_dialog(const CadFeature& f); void reset_edit_state(); // back to add-mode (m_edit_index = -1) @@ -905,6 +906,16 @@ private: // own Edit / Show-hide / Delete icons. Callers use row indices via // tree_selection()/set_tree_selection(); refresh_tree() rebuilds the rows. DesignRowList* m_tree{nullptr}; + // The faces the selected feature row made (CadDocument::faces_made_by), drawn as selected. + // Finding them replays the history, so they are kept per row and topology generation. + // request_feature_highlight() refreshes them after the current event; every change of row, + // card or topology calls it. + int m_hl_feature{-1}; // the row m_hl_faces were found for... + uint64_t m_hl_generation{0}; // ...on this topology + std::vector> m_hl_faces; + bool m_hl_pending{false}; + void request_feature_highlight(); + void update_feature_highlight(); // Bodies list under the feature tree: one row per body (parallel to m_doc.bodies). Selecting // one highlights that body and makes it the target for the next op. DesignRowList* m_parts{nullptr}; diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index dfbed59f55..7d78cd18b6 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -21,8 +21,11 @@ #include "libslic3r/CAD/GeometryEngine.hpp" #include +#include #include #include +#include +#include #include "libslic3r/TriangleMesh.hpp" #include @@ -3450,50 +3453,105 @@ void DesignSketchTool::set_solid_pick(const std::vector* bodies, const clear_solid_selection(); } +// The chord tolerance body edges are sampled at: a thousandth of the body's size, so round edges +// stay round at any zoom that shows the whole body, without sampling a large import into millions +// of segments. +static double display_edge_tol(const TopoDS_Shape& shape) +{ + Bnd_Box box; + BRepBndLib::Add(shape, box); + return std::max(1e-3 * (box.IsVoid() ? 1.0 : std::sqrt(box.SquareExtent())), 0.005); +} + void DesignSketchTool::refresh_body_edges() { const size_t n = m_solid_bodies != nullptr ? m_solid_bodies->size() : 0; m_body_edges.resize(n); m_body_edges_key.resize(n, nullptr); + m_body_edges_tol.resize(n, 0.0); for (size_t b = 0; b < n; ++b) { - const TopoDS_Shape& shape = (*m_solid_bodies)[b].shape; - const void* key = shape.IsNull() ? nullptr : shape.TShape().get(); + const void* key = body_key(int(b)); if (key == m_body_edges_key[b] && key != nullptr) continue; m_body_edges_key[b] = key; m_body_edges[b].clear(); if (key == nullptr) continue; - // A thousandth of the body's size: round edges stay round at any zoom that shows the - // whole body, without sampling a large import into millions of segments. - Bnd_Box box; - BRepBndLib::Add(shape, box); - const double diag = box.IsVoid() ? 1.0 : std::sqrt(box.SquareExtent()); + const TopoDS_Shape& shape = (*m_solid_bodies)[b].shape; + m_body_edges_tol[b] = display_edge_tol(shape); try { - m_body_edges[b] = GeometryEngine::display_edges(shape, std::max(1e-3 * diag, 0.005)); + m_body_edges[b] = GeometryEngine::display_edges(shape, m_body_edges_tol[b]); } catch (const Standard_Failure&) { m_body_edges[b].clear(); // an unsampleable edge costs its body the lines, nothing else } } } +// The identity of a body's current shape. Face ids and sampled edges hold while it does. +const void* DesignSketchTool::body_key(int body) const +{ + if (m_solid_bodies == nullptr || body < 0 || body >= int(m_solid_bodies->size())) + return nullptr; + const TopoDS_Shape& shape = (*m_solid_bodies)[body].shape; + return shape.IsNull() ? nullptr : shape.TShape().get(); +} + +// View-facing ribbons along a body's polylines (shape coordinates), `hw` either side of the line +// and moved by `pull` toward the eye, so a line wins the depth test against the faces meeting at +// it while a face in front of it still hides it. +void DesignSketchTool::append_ribbons(GLModel::Geometry& g, int body, const std::vector>& polylines, + const Vec3d& vd, const Vec3d& pull, double hw) const +{ + g.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3 }; + unsigned int base = unsigned(g.vertices_count()); + for (const std::vector& pl : polylines) + for (size_t s = 1; s < pl.size(); ++s) { + const Vec3d a = body_xform_pt(body, pl[s - 1]) + pull, c = body_xform_pt(body, pl[s]) + pull; + Vec3d dir = c - a; if (dir.norm() < 1e-9) continue; dir.normalize(); + Vec3d off = dir.cross(vd); + if (off.norm() < 1e-9) continue; // edge seen end-on: a point, nothing to draw + off = off.normalized() * hw; + g.add_vertex((Vec3f)(a + off).cast()); + g.add_vertex((Vec3f)(c + off).cast()); + g.add_vertex((Vec3f)(c - off).cast()); + g.add_vertex((Vec3f)(a - off).cast()); + g.add_triangle(base, base + 1, base + 2); + g.add_triangle(base, base + 2, base + 3); base += 4; + } +} + +// Ribbons tested against the scene's depth without writing it, and blended. +static void render_ribbons(GLModel& model, GLModel::Geometry&& g, const ColorRGBA& colour) +{ + if (g.is_empty()) + return; + glsafe(::glEnable(GL_DEPTH_TEST)); + glsafe(::glDepthFunc(GL_LEQUAL)); + glsafe(::glDepthMask(GL_FALSE)); + glsafe(::glEnable(GL_BLEND)); + glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); + model.reset(); + model.init_from(std::move(g)); + model.set_color(colour); + model.render(); + glsafe(::glDepthMask(GL_TRUE)); + glsafe(::glDepthFunc(GL_LESS)); + glsafe(::glDisable(GL_BLEND)); + glsafe(::glDisable(GL_DEPTH_TEST)); +} + void DesignSketchTool::render_body_edges() { if (m_body_edges_hidden || m_solid_bodies == nullptr) return; - using EPT = GLModel::Geometry::EPrimitiveType; - using EVL = GLModel::Geometry::EVertexLayout; const Camera& cam = wxGetApp().plater()->get_camera(); const Vec3d vd = cam.get_dir_forward(); const double px = 1.0 / std::max(cam.get_zoom(), 1e-6); const double hw = 1.0 * px; // ~2 px wide: at 1.5 the lines read as hairlines - // Pulled toward the eye by a few pixels, so the line wins the depth test against the two - // faces meeting at the edge while a face in front of it still hides it. const Vec3d pull = -vd * (3.0 * px); // Two passes: the edges of a body faded by body focus are fainter, like the body itself. for (int pass = 0; pass < 2; ++pass) { - GLModel::Geometry g; g.format = { EPT::Triangles, EVL::P3 }; - unsigned int base = 0; + GLModel::Geometry g; for (int b = 0; b < int(m_body_edges.size()); ++b) { if (m_solid_visible != nullptr && b < int(m_solid_visible->size()) && !(*m_solid_visible)[b]) continue; @@ -3501,36 +3559,9 @@ void DesignSketchTool::render_body_edges() && b != m_pick_only_body; if (faded != (pass == 1)) continue; - for (const std::vector& pl : m_body_edges[b]) - for (size_t s = 1; s < pl.size(); ++s) { - const Vec3d a = body_xform_pt(b, pl[s - 1]) + pull, c = body_xform_pt(b, pl[s]) + pull; - Vec3d dir = c - a; if (dir.norm() < 1e-9) continue; dir.normalize(); - Vec3d off = dir.cross(vd); - if (off.norm() < 1e-9) continue; // edge seen end-on: a point, nothing to draw - off = off.normalized() * hw; - g.add_vertex((Vec3f)(a + off).cast()); - g.add_vertex((Vec3f)(c + off).cast()); - g.add_vertex((Vec3f)(c - off).cast()); - g.add_vertex((Vec3f)(a - off).cast()); - g.add_triangle(base, base + 1, base + 2); - g.add_triangle(base, base + 2, base + 3); base += 4; - } + append_ribbons(g, b, m_body_edges[b], vd, pull, hw); } - if (base == 0) - continue; - glsafe(::glEnable(GL_DEPTH_TEST)); - glsafe(::glDepthFunc(GL_LEQUAL)); - glsafe(::glDepthMask(GL_FALSE)); - glsafe(::glEnable(GL_BLEND)); - glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); - m_body_edges_model.reset(); - m_body_edges_model.init_from(std::move(g)); - m_body_edges_model.set_color(ColorRGBA(0.08f, 0.09f, 0.11f, pass == 0 ? 0.85f : 0.25f)); - m_body_edges_model.render(); - glsafe(::glDepthMask(GL_TRUE)); - glsafe(::glDepthFunc(GL_LESS)); - glsafe(::glDisable(GL_BLEND)); - glsafe(::glDisable(GL_DEPTH_TEST)); + render_ribbons(m_body_edges_model, std::move(g), ColorRGBA(0.08f, 0.09f, 0.11f, pass == 0 ? 0.85f : 0.25f)); } } @@ -3596,7 +3627,121 @@ void DesignSketchTool::select_body(int body) m_sel_edge_pts.clear(); m_sel_edges_more.clear(); m_sel_edges_more_pts.clear(); - m_solid_sel = SolidSel::Whole; // render_solid_highlight tints just this body + m_solid_sel = SolidSel::Whole; // the canvas fills just this body, render_solid_highlight outlines it +} + +void DesignSketchTool::set_highlight_faces(const std::vector>& faces) +{ + std::map> by_body; + for (const auto& [b, f] : faces) + if (body_key(b) != nullptr) + by_body[b].push_back(f); + // Reuse each body's entry, so re-sending the same faces resamples nothing. + std::vector next; + for (auto& [b, fs] : by_body) { + FaceHighlight h; + for (FaceHighlight& old : m_hl_faces) + if (old.body == b) + h = std::move(old); + cached_face_highlight(h, b, std::move(fs)); + next.push_back(std::move(h)); + } + m_hl_faces = std::move(next); +} + +DesignSketchTool::FaceHighlight DesignSketchTool::make_face_highlight(int body, std::vector faces) const +{ + FaceHighlight h; + h.body = body; + std::sort(faces.begin(), faces.end()); + faces.erase(std::unique(faces.begin(), faces.end()), faces.end()); + h.faces = std::move(faces); + h.key = body_key(body); + if (h.key == nullptr || h.faces.empty()) + return h; + // Sampled at the body edges' tolerance; a whole body reuses its body edges. + const TopoDS_Shape& shape = (*m_solid_bodies)[body].shape; + const std::vector all = GeometryEngine::faces_of(shape); + const bool cached = body < int(m_body_edges_key.size()) && m_body_edges_key[body] == h.key; + if (cached && h.faces.size() == all.size() && h.faces.front() == 0 && h.faces.back() == int(all.size()) - 1) { + h.edges = m_body_edges[body]; + return h; + } + TopoDS_Compound picked; + BRep_Builder builder; + builder.MakeCompound(picked); + for (int f : h.faces) + if (f >= 0 && f < int(all.size())) + builder.Add(picked, all[f]); + try { + h.edges = GeometryEngine::display_edges(picked, cached ? m_body_edges_tol[body] : display_edge_tol(shape)); + } catch (const Standard_Failure&) { + h.edges.clear(); // an edge that cannot be sampled costs the outline, never the fill + } + return h; +} + +std::vector> DesignSketchTool::picked_faces() const +{ + std::vector> out; + if (body_key(m_sel_body) == nullptr) + return out; + if (m_solid_sel == SolidSel::Face && m_sel_face >= 0) + out.emplace_back(m_sel_body, m_sel_face); + else if (m_solid_sel == SolidSel::Whole) + for (int f = 0, n = GeometryEngine::face_count((*m_solid_bodies)[m_sel_body].shape); f < n; ++f) + out.emplace_back(m_sel_body, f); + return out; +} + +std::vector> DesignSketchTool::selected_faces() const +{ + std::vector> out = picked_faces(); + for (const FaceHighlight& h : m_hl_faces) + if (h.key != nullptr && h.key == body_key(h.body)) + for (int f : h.faces) + out.emplace_back(h.body, f); + std::sort(out.begin(), out.end()); + out.erase(std::unique(out.begin(), out.end()), out.end()); + return out; +} + +const DesignSketchTool::FaceHighlight& DesignSketchTool::cached_face_highlight(FaceHighlight& cache, int body, + std::vector faces) const +{ + std::sort(faces.begin(), faces.end()); + faces.erase(std::unique(faces.begin(), faces.end()), faces.end()); + if (cache.body != body || cache.faces != faces || cache.key != body_key(body)) + cache = make_face_highlight(body, std::move(faces)); + return cache; +} + +// The edges of selected faces, cased: a dark band under a selection-coloured line, so the +// selection's outline reads on a body of any colour, the selection colour included. The faces +// themselves are filled by the canvas (DesignCanvas::rebuild_bodies). `quiet` is the hover's +// version: the line alone, thinner and fainter. +void DesignSketchTool::render_face_outline(const FaceHighlight& h, bool quiet) +{ + if (m_body_edges_hidden || h.key == nullptr || h.key != body_key(h.body) || !body_pickable(h.body)) + return; // hidden, or the body was rebuilt and these face ids are stale + + const Camera& cam = wxGetApp().plater()->get_camera(); + // View-facing ribbons like the body edges, pulled a pixel further toward the eye so they win + // over the dark body edges along the same curves. + const Vec3d vd = cam.get_dir_forward(); + const double px = 1.0 / std::max(cam.get_zoom(), 1e-6); + const Vec3d pull = -vd * (4.0 * px); + auto draw = [&](double hw_px, const ColorRGBA& colour) { + GLModel::Geometry g; + append_ribbons(g, h.body, h.edges, vd, pull, hw_px * px); + render_ribbons(m_solid_edge_model, std::move(g), colour); + }; + if (quiet) { + draw(1.0, design_selection_color(0.8f)); + } else { + draw(2.25, ColorRGBA(0.05f, 0.06f, 0.08f, 1.0f)); + draw(1.25, design_selection_color()); + } } // Pick tracing. Selection failures on a real desktop have repeatedly turned out to be an @@ -3918,53 +4063,19 @@ bool DesignSketchTool::update_solid_hover(GLCanvas3D& canvas, const wxMouseEvent return true; } -// One highlight, drawn from explicit arguments rather than from the selection members, so the -// committed selection and the hover pre-highlight cannot drift apart in how they look. alpha_mul -// scales every layer at once: the pre-highlight is the same shape in the same place, quieter. -void DesignSketchTool::render_solid_sel(SolidSel kind, int body, int face, - const std::vector& edge_pts, - const Vec3d& vertex_pt, - const ColorRGBA& rgb, float alpha_mul) +// An edge or vertex highlight, drawn from explicit arguments rather than from the selection +// members, so the committed selection and the hover pre-highlight cannot drift apart in how they +// look. Faces and bodies are filled by the canvas and outlined by render_face_outline. +void DesignSketchTool::render_solid_sel(SolidSel kind, const std::vector& edge_pts, + const Vec3d& vertex_pt, const ColorRGBA& rgb) { using EPT = GLModel::Geometry::EPrimitiveType; using EVL = GLModel::Geometry::EVertexLayout; // Opaque: the edge ribbon and the vertex square render with GL_BLEND OFF, so an alpha below 1 - // here would be silently ignored. Those two are quietened by a MUTED rgb from the caller - // instead; alpha_mul only reaches the face fill, which is the one layer that is blended. + // here would be silently ignored. const ColorRGBA cyan(rgb.r(), rgb.g(), rgb.b(), 1.0f); - // Whole tints the picked BODY (all its triangles, lighter alpha); Face tints just the - // picked face on that body. Both filter by `body` so other bodies stay untinted. - if ((kind == SolidSel::Face || kind == SolidSel::Whole) - && m_solid_mesh != nullptr && m_solid_tri_body != nullptr && body >= 0) { - const bool face_only = (kind == SolidSel::Face); - const indexed_triangle_set& its = m_solid_mesh->its; - GLModel::Geometry g; g.format = { EPT::Triangles, EVL::P3 }; - unsigned int base = 0; - for (size_t i = 0; i < its.indices.size(); ++i) { - if (i >= m_solid_tri_body->size() || (*m_solid_tri_body)[i] != body) continue; - if (face_only && (m_solid_tri_face == nullptr || i >= m_solid_tri_face->size() - || (*m_solid_tri_face)[i] != face)) continue; - const auto& idx = its.indices[i]; - for (int j = 0; j < 3; ++j) g.add_vertex(its.vertices[idx(j)]); - g.add_triangle(base, base + 1, base + 2); base += 3; - } - if (base > 0) { - glsafe(::glEnable(GL_DEPTH_TEST)); - glsafe(::glEnable(GL_POLYGON_OFFSET_FILL)); - glsafe(::glPolygonOffset(-2.0f, -2.0f)); - glsafe(::glEnable(GL_BLEND)); - glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); - m_solid_face_model.reset(); - m_solid_face_model.init_from(std::move(g)); - m_solid_face_model.set_color(ColorRGBA(rgb.r(), rgb.g(), rgb.b(), - (face_only ? 0.40f : 0.22f) * alpha_mul)); - m_solid_face_model.render(); - glsafe(::glDisable(GL_BLEND)); - glsafe(::glDisable(GL_POLYGON_OFFSET_FILL)); - glsafe(::glDisable(GL_DEPTH_TEST)); - } - } else if (kind == SolidSel::Edge && edge_pts.size() >= 2) { + if (kind == SolidSel::Edge && edge_pts.size() >= 2) { const Camera& cam = wxGetApp().plater()->get_camera(); const Vec3d vd = cam.get_dir_forward(); const double hw = 2.0 / std::max(cam.get_zoom(), 1e-6); // ~2 px ribbon half-width @@ -4016,13 +4127,16 @@ void DesignSketchTool::render_solid_sel(SolidSel kind, int body, int face, } } -// Cyan overlay for the picked face / edge / vertex, plus the quieter pre-highlight of whatever -// the pointer is currently over. Whole-solid tint is the panel's job (set_body_highlight). +// The faces of the Feature tree's selected feature, the picked body / face / edge / vertex, and +// the quieter pre-highlight of whatever the pointer is currently over. // Called from render() while no sketch session is active. void DesignSketchTool::render_solid_highlight() { const ColorRGBA sel_cyan = design_selection_color(); + for (const FaceHighlight& h : m_hl_faces) + render_face_outline(h, false); + // The pre-highlight goes FIRST so the committed selection paints over it where the two // overlap — what you HAVE outranks what you would get. Suppressed entirely when they are the // same thing: two coats of the same colour on the same face reads as a rendering fault, and @@ -4032,17 +4146,27 @@ void DesignSketchTool::render_solid_highlight() : m_pre.kind == SolidSel::Edge ? m_pre.edge == m_sel_edge : m_pre.kind == SolidSel::Face ? m_pre.face == m_sel_face : true); - if (m_pre.kind != SolidSel::None && !pre_is_sel) - // Desaturated toward white rather than a second hue: a distinct colour would read as a - // distinct KIND of selection, when it is the same selection one moment earlier. - render_solid_sel(m_pre.kind, m_pre.body, m_pre.face, m_pre.edge_pts, m_pre.vertex_pt, - design_selection_color(), 0.45f); // hover = the same colour, quieter + if (m_pre.kind == SolidSel::Face && !pre_is_sel) + // A hovered face gets its outline alone: a promise, not a selection. + render_face_outline(cached_face_highlight(m_pre_hl, m_pre.body, { m_pre.face }), true); + else if (m_pre.kind != SolidSel::None && !pre_is_sel) + // The selection's own colour: a second hue would read as a distinct KIND of selection, + // when it is the same selection one moment earlier. + render_solid_sel(m_pre.kind, m_pre.edge_pts, m_pre.vertex_pt, sel_cyan); - render_solid_sel(m_solid_sel, m_sel_body, m_sel_face, m_sel_edge_pts, m_sel_vertex_pt, - sel_cyan, 1.0f); + // A picked body or face looks like the Feature tree's faces: the canvas fills it, this + // outlines it. + if (const std::vector> picked = picked_faces(); !picked.empty()) { + std::vector faces; + for (const auto& bf : picked) + faces.push_back(bf.second); + render_face_outline(cached_face_highlight(m_sel_hl, m_sel_body, std::move(faces)), false); + return; + } + render_solid_sel(m_solid_sel, m_sel_edge_pts, m_sel_vertex_pt, sel_cyan); if (m_solid_sel == SolidSel::Edge) for (const std::vector& pts : m_sel_edges_more_pts) - render_solid_sel(SolidSel::Edge, m_sel_body, -1, pts, Vec3d::Zero(), sel_cyan, 1.0f); + render_solid_sel(SolidSel::Edge, pts, Vec3d::Zero(), sel_cyan); } // Datum/reference planes (Plane feature) have no solid; draw each as a translucent indigo @@ -9133,7 +9257,7 @@ void DesignSketchTool::render(GLCanvas3D& canvas) } // Nothing else to draw when no live sketch session is active — except the solid - // face/edge highlight overlay (whole-solid tint is handled by set_body_highlight). + // selection and the Feature tree's faces (render_solid_highlight). if (!m_active) { render_datum_planes(); render_mate_connectors(); diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index a310a3add1..388b5b6363 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -215,6 +215,12 @@ public: // Select a whole body by index (from the Parts list) — Whole-level highlight, no face/edge. // body < 0 or out of range clears the selection. void select_body(int body); + // Outline these (body, face id) faces as selected: the faces the Feature tree's selected + // feature made. A body whose shape changes later drops out, its face ids being stale. The + // canvas fills them (DesignCanvas::rebuild_bodies). + void set_highlight_faces(const std::vector>& faces); + // Every face drawn as selected, sorted: the committed pick's and the still-valid ones above. + std::vector> selected_faces() const; // Move-body gizmo (M5): translate a whole body with three world-axis drag arrows // (X red / Y green / Z blue) anchored at the body centroid. Display-only — the host @@ -1219,9 +1225,13 @@ private: // whose shape changed (keyed by the TShape), since set_solid_pick runs on every recompute. std::vector>> m_body_edges; std::vector m_body_edges_key; + std::vector m_body_edges_tol; // the chord tolerance they were sampled at bool m_body_edges_hidden{false}; void refresh_body_edges(); void render_body_edges(); + const void* body_key(int body) const; // the body's TShape, nullptr when there is none + void append_ribbons(GLModel::Geometry& g, int body, const std::vector>& polylines, + const Vec3d& vd, const Vec3d& pull, double hw) const; bool body_pickable(int b) const; // false when the body is explicitly hidden SolidSel m_solid_sel{SolidSel::None}; int m_sel_body{-1}; // which body the face/edge selection is on @@ -1264,10 +1274,28 @@ private: bool m_right_consumed{false}; // last RightDown was a gesture terminator, not a menu bool m_escalate_repick{true}; // re-picking the same sub-element takes the whole body void render_solid_highlight(); - // The shared body of the above: one highlight from explicit arguments, so the committed - // selection and the hover pre-highlight cannot drift apart in how they look. - void render_solid_sel(SolidSel kind, int body, int face, const std::vector& edge_pts, - const Vec3d& vertex_pt, const ColorRGBA& rgb, float alpha_mul); + // The above's edge and vertex highlight, from explicit arguments, so the committed selection + // and the hover pre-highlight cannot drift apart in how they look. + void render_solid_sel(SolidSel kind, const std::vector& edge_pts, const Vec3d& vertex_pt, + const ColorRGBA& rgb); + // A set of selected faces of one body, with their edges sampled once, keyed by the body's + // TShape so a recompute that rebuilt the body retires it. + struct FaceHighlight { + int body{-1}; + std::vector faces; // sorted + const void* key{nullptr}; + std::vector> edges; // in the body's shape coordinates + }; + FaceHighlight make_face_highlight(int body, std::vector faces) const; + // The faces the committed pick names: the one face of a face pick, every face of a picked + // body. Empty for an edge or vertex pick. + std::vector> picked_faces() const; + // `cache`, rebuilt only when it no longer holds these faces of this body's current shape. + const FaceHighlight& cached_face_highlight(FaceHighlight& cache, int body, std::vector faces) const; + void render_face_outline(const FaceHighlight& h, bool quiet); + std::vector m_hl_faces; // set_highlight_faces, one entry per body + FaceHighlight m_sel_hl; // the committed Face/Whole pick + FaceHighlight m_pre_hl; // the face under the pointer void render_datum_planes(); // translucent rectangles for datum/reference planes void render_view_helpers(); // world origin planes + axis triad (P / A toggles) bool m_show_planes{false}; @@ -1284,7 +1312,6 @@ private: std::vector> m_mate_links; GLModel m_mc_stroke_model; GLModel m_mc_fill_model; // the face treatment's shaded facets - GLModel m_solid_face_model; GLModel m_solid_edge_model; GLModel m_body_edges_model; GLModel m_solid_vertex_model; diff --git a/tests/libslic3r/test_caddocument.cpp b/tests/libslic3r/test_caddocument.cpp index 56f2cfb0b3..0115111f7c 100644 --- a/tests/libslic3r/test_caddocument.cpp +++ b/tests/libslic3r/test_caddocument.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -9083,3 +9084,167 @@ TEST_CASE("revolve about a line of the sketch", "[CadDocument][revolve]") CHECK(loaded.features[1].revolve_angle == Approx(270.)); } } + +// faces_made_by is what the Design tab highlights when a feature row is selected: the faces of +// the finished model that this feature made, not the whole body it belongs to. +static GeomAbs_SurfaceType made_face_type(const CadDocument& doc, const std::pair& bf) +{ + return BRepAdaptor_Surface(GeometryEngine::face_by_index(doc.bodies[bf.first].shape, bf.second)).GetType(); +} + +TEST_CASE("A fillet owns its round face, and the extrude keeps the faces it trimmed", "[CadDocument][highlight]") +{ + CadDocument doc; + const int sk = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 20, 20, 10, "Sketch"); + const int ex = doc.add_extrude(sk, 10.0, false, BooleanMode::New, "Extrude"); + REQUIRE(doc.recompute()); + const int fi = doc.add_fillet(2.0, 0, "Fillet"); + REQUIRE(doc.recompute()); + REQUIRE(doc.bodies.size() == 1); + REQUIRE(GeometryEngine::faces_of(doc.bodies[0].shape).size() == 7); + + const auto fillet = doc.faces_made_by(fi); + REQUIRE(fillet.size() == 1); + CHECK(fillet[0].first == 0); + CHECK(made_face_type(doc, fillet[0]) == GeomAbs_Cylinder); + + const auto extrude = doc.faces_made_by(ex); + CHECK(extrude.size() == 6); + for (const auto& bf : extrude) + CHECK(made_face_type(doc, bf) == GeomAbs_Plane); + + CHECK(doc.faces_made_by(sk).empty()); // a sketch leaves no face behind + + // A hidden feature made nothing in the model on screen. + REQUIRE(doc.set_feature_enabled(fi, false)); + CHECK(doc.faces_made_by(fi).empty()); +} + +TEST_CASE("A chamfer owns its bevel", "[CadDocument][highlight]") +{ + CadDocument doc; + const int sk = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 20, 20, 10, "Sketch"); + const int ex = doc.add_extrude(sk, 10.0, false, BooleanMode::New, "Extrude"); + REQUIRE(doc.recompute()); + const int ch = doc.add_chamfer(2.0, 0, "Chamfer"); + REQUIRE(doc.recompute()); + REQUIRE(GeometryEngine::faces_of(doc.bodies[0].shape).size() == 7); + + const auto bevel = doc.faces_made_by(ch); + REQUIRE(bevel.size() == 1); + CHECK(made_face_type(doc, bevel[0]) == GeomAbs_Plane); + const auto extrude = doc.faces_made_by(ex); + CHECK(extrude.size() == 6); + CHECK(std::find(extrude.begin(), extrude.end(), bevel[0]) == extrude.end()); +} + +TEST_CASE("A boss owns its wall and cap, not the face it stands on", "[CadDocument][highlight]") +{ + CadDocument doc; + const int sk = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 30, 20, 10, "Sketch"); + const int ex = doc.add_extrude(sk, 10.0, false, BooleanMode::New, "Extrude"); + REQUIRE(doc.recompute()); + SketchPlane top = SketchPlane::XY(); + top.origin = Vec3d(0, 0, 10); + const int sk2 = doc.add_sketch_entities({circle_entity({0, 0}, 5.0)}, top, "Sketch2"); + const int boss = doc.add_extrude(sk2, 8.0, false, BooleanMode::Add, "Boss"); + REQUIRE(doc.recompute()); + REQUIRE(doc.bodies.size() == 1); + + const auto made = doc.faces_made_by(boss); + REQUIRE_FALSE(made.empty()); + int walls = 0, caps = 0; + for (const auto& bf : made) { + const GeomAbs_SurfaceType t = made_face_type(doc, bf); + walls += t == GeomAbs_Cylinder; + // The cap is the plane at the boss's top, not the box's top face it stands on. + if (t == GeomAbs_Plane) { + ++caps; + Bnd_Box bb; + BRepBndLib::Add(GeometryEngine::face_by_index(doc.bodies[0].shape, bf.second), bb); + double x0, y0, z0, x1, y1, z1; + bb.Get(x0, y0, z0, x1, y1, z1); + CHECK(z0 > 17.9); + } + } + CHECK(walls >= 1); + CHECK(caps == 1); + CHECK(doc.faces_made_by(ex).size() == 6); // the box keeps its top face, hole and all +} + +TEST_CASE("A body stacked on another still owns the face they share", "[CadDocument][highlight]") +{ + CadDocument doc; + const int sk0 = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 20, 20, 10, "Sketch0"); + doc.add_extrude(sk0, 10.0, false, BooleanMode::New, "Base"); + SketchPlane top = SketchPlane::XY(); + top.origin = Vec3d(0, 0, 10); + const int sk1 = doc.add_sketch(SketchShape::Rectangle, top, 10, 10, 5, "Sketch1"); + const int ex1 = doc.add_extrude(sk1, 5.0, false, BooleanMode::New, "Block"); + REQUIRE(doc.recompute()); + REQUIRE(doc.bodies.size() == 2); + + // The block's bottom lies in the base's top face, facing the other way: it is the block's. + const auto made = doc.faces_made_by(ex1); + CHECK(made.size() == 6); + for (const auto& bf : made) + CHECK(bf.first == 1); +} + +TEST_CASE("A Boolean union, which makes no face of its own, answers with the body it changed", "[CadDocument][highlight]") +{ + CadDocument doc; + const int sk0 = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 20, 20, 10, "Sketch0"); + doc.add_extrude(sk0, 10.0, false, BooleanMode::New, "Box0"); + SketchPlane beside = SketchPlane::XY(); + beside.origin = Vec3d(10, 5, 0); + const int sk1 = doc.add_sketch(SketchShape::Rectangle, beside, 20, 20, 10, "Sketch1"); + doc.add_extrude(sk1, 10.0, false, BooleanMode::New, "Box1"); + REQUIRE(doc.recompute()); + REQUIRE(doc.bodies.size() == 2); + const int fuse = doc.add_boolean(BooleanMode::Add, 0, 1, false, 0.0, -1, -1, "Fuse"); + REQUIRE(doc.recompute()); + REQUIRE(doc.bodies.size() == 1); + + const auto made = doc.faces_made_by(fuse); + CHECK(made.size() == GeometryEngine::faces_of(doc.bodies[0].shape).size()); +} + +TEST_CASE("A Boolean subtract owns the walls its tool cut", "[CadDocument][highlight]") +{ + CadDocument doc; + const int sk0 = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 20, 20, 10, "Sketch0"); + doc.add_extrude(sk0, 10.0, false, BooleanMode::New, "Box0"); + SketchPlane beside = SketchPlane::XY(); + beside.origin = Vec3d(10, 5, 0); + const int sk1 = doc.add_sketch(SketchShape::Rectangle, beside, 20, 20, 10, "Sketch1"); + doc.add_extrude(sk1, 10.0, false, BooleanMode::New, "Box1"); + REQUIRE(doc.recompute()); + REQUIRE(doc.bodies.size() == 2); + const int cut = doc.add_boolean(BooleanMode::Cut, 0, 1, false, 0.0, -1, -1, "Cut"); + REQUIRE(doc.recompute()); + REQUIRE(doc.bodies.size() == 1); + + // The tool notches a corner out of the box: the two walls of the notch, the tool's faces + // turned inside out, are the subtract's; what is left of the box's own faces is not. + const auto made = doc.faces_made_by(cut); + CHECK(made.size() == 2); + for (const auto& bf : made) + CHECK(made_face_type(doc, bf) == GeomAbs_Plane); +} + +TEST_CASE("A hole owns its bore", "[CadDocument][highlight]") +{ + CadDocument doc; + const int sk = doc.add_sketch(SketchShape::Rectangle, SketchPlane::XY(), 20, 20, 10, "Sketch"); + const int ex = doc.add_extrude(sk, 10.0, false, BooleanMode::New, "Extrude"); + REQUIRE(doc.recompute()); + const int hole = doc.add_hole(6.0, 20.0, true, 0.0, 0.0, SketchPlane::XY(), "Hole"); + REQUIRE(doc.recompute()); + + const auto bore = doc.faces_made_by(hole); + REQUIRE_FALSE(bore.empty()); + for (const auto& bf : bore) + CHECK(made_face_type(doc, bf) == GeomAbs_Cylinder); + CHECK(doc.faces_made_by(ex).size() == 6); +} From a29e3078e826288b7f6cfa1335a8f1ab85497699 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Mon, 5 Oct 2026 02:50:21 +0800 Subject: [PATCH 215/389] Keep automatic Design body colours clear of the selection colour --- docs/HLSD/design-tab.md | 4 +++- src/slic3r/GUI/CAD/DesignCanvas.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/HLSD/design-tab.md b/docs/HLSD/design-tab.md index a29061c27f..1f1b4dd860 100644 --- a/docs/HLSD/design-tab.md +++ b/docs/HLSD/design-tab.md @@ -197,7 +197,9 @@ as the body (`DesignCanvas::rebuild_bodies`); the sketch overlay outlines them w — a dark band under a selection-coloured one — so the outline still reads on a body that wears the selection colour itself. A body picked whole, a face picked in the viewport and the faces of the Feature tree's selected feature all draw this way. The hover pre-highlight is the outline -alone, uncased: it promises a click, it is not one. +alone, uncased: it promises a click, it is not one. The automatic body colours keep clear of the +selection colour's blues and teals, so no body looks selected before anything is picked; a colour +the user sets on a body is theirs, and the cased outline keeps its selection readable. Selecting a feature row lights the faces that feature made, not the whole body it sits on, so a fillet row shows its round and the extrude under it keeps the faces the fillet trimmed. diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index ad7ede3d05..0ba7b58702 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -227,12 +227,14 @@ DesignCanvas::~DesignCanvas() } // Distinct per-body colours (Onshape-style). Body 0 keeps the familiar gold; the rest -// cycle through a small saturated palette so coexisting solids read as separate parts. +// cycle through a small saturated palette so coexisting solids read as separate parts. No entry +// may sit near the selection cyan (design_selection_color): a blue or teal body would look +// selected, and its selected faces would barely stand out. static ColorRGBA body_palette(int body_idx) { static const ColorRGBA kPalette[] = { ColorRGBA(0.86f, 0.66f, 0.20f, 1.0f), // gold - ColorRGBA(0.30f, 0.62f, 0.90f, 1.0f), // blue + ColorRGBA(0.84f, 0.42f, 0.66f, 1.0f), // rose ColorRGBA(0.45f, 0.78f, 0.42f, 1.0f), // green ColorRGBA(0.86f, 0.45f, 0.40f, 1.0f), // coral ColorRGBA(0.70f, 0.52f, 0.86f, 1.0f), // violet From 4cb6ca7ecbb50d267dce95bb8436e18fbc7daf53 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Mon, 5 Oct 2026 02:50:38 +0800 Subject: [PATCH 216/389] Let Esc and a click on empty space deselect Design feature and body rows --- docs/HLSD/design-tab.md | 5 +++-- src/slic3r/GUI/CAD/DesignCanvas.cpp | 5 +++++ src/slic3r/GUI/CAD/DesignCanvas.hpp | 1 + src/slic3r/GUI/CAD/DesignPanel.cpp | 24 +++++++++++++++++++++--- src/slic3r/GUI/CAD/DesignPanel.hpp | 1 + src/slic3r/GUI/CAD/DesignSketchTool.cpp | 2 ++ src/slic3r/GUI/CAD/DesignSketchTool.hpp | 3 +++ 7 files changed, 36 insertions(+), 5 deletions(-) diff --git a/docs/HLSD/design-tab.md b/docs/HLSD/design-tab.md index 1f1b4dd860..80531f02a1 100644 --- a/docs/HLSD/design-tab.md +++ b/docs/HLSD/design-tab.md @@ -134,7 +134,7 @@ contract between them is stated in code rather than spread across handlers. | `Transient` | a value field or a popup menu | closes it; the tool stays armed | | `Gesture` | an uncommitted delta — an entity being drawn, a body being dragged | reverts it; committed work is untouched | | `Tool` | a feature card, an armed sketch tool, a constrain session | exits it; drawn entities survive | -| `Idle` | nothing transient | clears the selection; leaves a sketch session only if it is empty | +| `Idle` | nothing transient | clears the selection, a Feature tree or Bodies row included; leaves a sketch session only if it is empty | `cad_escape_level()` is a `constexpr` free function over a POD of four booleans rather than a method on the panel, so the ordering that is the entire contract is checkable without a window, @@ -211,7 +211,8 @@ that makes no face of its own, such as a Boolean union, answers with the bodies replay costs up to a recompute, so the panel finds the faces once per row and topology generation, off the UI thread, and only while no feature card is open. One selection is live at a time: a viewport pick clears the feature row and a feature row clears the viewport pick, as the -Feature tree and Bodies list do between themselves. +Feature tree and Bodies list do between themselves. `Esc`, a click on empty space and an +empty rubber band all let go of it, whichever list or pick made it. ## Following the app diff --git a/src/slic3r/GUI/CAD/DesignCanvas.cpp b/src/slic3r/GUI/CAD/DesignCanvas.cpp index 0ba7b58702..2df2f3edfe 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.cpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.cpp @@ -899,6 +899,11 @@ void DesignCanvas::set_on_solid_selection_changed(std::function cb) +{ + m_sketch_tool.on_empty_pick = std::move(cb); +} + void DesignCanvas::select_body(int body) { m_sketch_tool.select_body(body); diff --git a/src/slic3r/GUI/CAD/DesignCanvas.hpp b/src/slic3r/GUI/CAD/DesignCanvas.hpp index e10ecdb2ba..2a1d613337 100644 --- a/src/slic3r/GUI/CAD/DesignCanvas.hpp +++ b/src/slic3r/GUI/CAD/DesignCanvas.hpp @@ -139,6 +139,7 @@ public: const std::vector* visible = nullptr, const std::vector* xform = nullptr); void set_on_solid_selection_changed(std::function cb); + void set_on_empty_pick(std::function cb); // a click or rubber band took nothing std::vector selected_solid_edges() const; // the Shift/Ctrl+click edge set, last-clicked at the end void select_body(int body); // Parts-list -> highlight a whole body by index // Effective display colour of a body: the per-body override (Color tool) when set, diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index 1f8ad16d5c..d84d00325a 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -3826,6 +3826,12 @@ DesignPanel::DesignPanel(wxWindow* parent) : _L("Nothing selected")); m_status->Refresh(); }); + // A click on nothing drops a list row as it drops a pick. Not while a card is open: the + // feature being edited keeps its row. + m_viewport->set_on_empty_pick([this] { + if (m_active == Tool::None && deselect_rows()) + set_status(StatusKind::Info, _L("Nothing selected")); + }); // Visual Extrude gizmo (C5b): dragging/editing the in-canvas depth arrow writes the // matching spin field and re-previews (which re-feeds the gizmo with the new depth). @@ -7526,6 +7532,16 @@ int DesignPanel::tree_body_selection() const return m_parts == nullptr ? -1 : m_parts->selection(); } +// Unselect the Feature tree and Bodies rows; each list's on_select clears what its row lit. True +// if a row was selected. +bool DesignPanel::deselect_rows() +{ + const bool any = (m_tree && tree_selection() != wxNOT_FOUND) || tree_body_selection() >= 0; + if (m_tree) m_tree->unselect(); + if (m_parts) m_parts->unselect(); + return any; +} + void DesignPanel::update_section_flip_btn() { if (m_section_flip_btn) m_section_flip_btn->Enable(m_section_on); @@ -11763,11 +11779,12 @@ void DesignPanel::escape() } return; - case CadLevel::Idle: + case CadLevel::Idle: { // Deselect. In a sketch this is the floor: the session is left through Finish or Cancel, // both of which say which one they are, and never through a key pressed on the way out of - // something else. - if (m_viewport && m_viewport->clear_any_selection()) { + // something else. The Feature tree and Bodies rows count as selections too. + const bool row = deselect_rows(); + if ((m_viewport && m_viewport->clear_any_selection()) || row) { set_status(StatusKind::Info, wxString()); return; } @@ -11783,6 +11800,7 @@ void DesignPanel::escape() } return; } + } } bool DesignPanel::menu_can_undo_redo(bool redo) const diff --git a/src/slic3r/GUI/CAD/DesignPanel.hpp b/src/slic3r/GUI/CAD/DesignPanel.hpp index 772cb1d09f..01c8cbe5b9 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.hpp +++ b/src/slic3r/GUI/CAD/DesignPanel.hpp @@ -916,6 +916,7 @@ private: bool m_hl_pending{false}; void request_feature_highlight(); void update_feature_highlight(); + bool deselect_rows(); // Esc / a click on nothing: drop the tree and Bodies rows // Bodies list under the feature tree: one row per body (parallel to m_doc.bodies). Selecting // one highlights that body and makes it the target for the next op. DesignRowList* m_parts{nullptr}; diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 7d78cd18b6..b4afdc5081 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -3813,6 +3813,7 @@ void DesignSketchTool::pick_bodies_in_rectangle() dp_pick_trace("rubber band -> body=%d (%d samples)", best, best_n); if (on_solid_selection_changed) on_solid_selection_changed(int(m_solid_sel), m_sel_body, m_sel_face, m_sel_edge); + if (best < 0 && on_empty_pick) on_empty_pick(); } // Resolve what a pick at (mx,my) would take. CONST, and it writes only into `out`: the hover @@ -10782,6 +10783,7 @@ bool DesignSketchTool::on_mouse_impl(wxMouseEvent& evt, GLCanvas3D& canvas) return true; } } + if (on_empty_pick) on_empty_pick(); return false; // let the stock canvas orbit / deselect } diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.hpp b/src/slic3r/GUI/CAD/DesignSketchTool.hpp index 388b5b6363..44ee0395ac 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.hpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.hpp @@ -235,6 +235,9 @@ public: std::function on_body_move_changed; // Fired on each cycle change: (level 0=None/1=Whole/2=Face/3=Edge, body index, face id, edge id). std::function on_solid_selection_changed; + // A click or rubber band (no live session) that took nothing, so the host can drop the + // selections the tool does not hold, such as the panel's list rows. + std::function on_empty_pick; // Click a committed sketch overlay (no live session) -> select that loop: the Sketch // feature index + the clicked closed-region index within it (-1 = no specific loop). // entity = the sketch entity index under the cursor when the click landed on a loop From b29c3b36ece50495f4ab1687e29beb346c23ab84 Mon Sep 17 00:00:00 2001 From: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com> Date: Sun, 4 Oct 2026 20:08:42 +0100 Subject: [PATCH 217/389] Fix a small memory leak when creating default enum list options (#16133) Fix memory leak in ConfigOptionDef::create_default_option for enum lists --- src/libslic3r/Config.cpp | 18 +++++++----------- tests/libslic3r/test_config.cpp | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp index cac46d7108..7428c10fe7 100644 --- a/src/libslic3r/Config.cpp +++ b/src/libslic3r/Config.cpp @@ -326,17 +326,13 @@ ConfigOption* ConfigOptionDef::create_default_option() const return new ConfigOptionEnumGeneric(this->enum_keys_map, this->default_value->getInt()); if (type == coEnums) { - auto dft = this->default_value->clone(); - if (dft->nullable()) { - ConfigOptionEnumsGenericNullable *opt = dynamic_cast(this->default_value->clone()); - opt->keys_map = this->enum_keys_map; - return opt; - } else { - ConfigOptionEnumsGeneric *opt = dynamic_cast(this->default_value->clone()); - opt->keys_map = this->enum_keys_map; - return opt; - } - delete dft; + // Enum list defaults are built without a keys map, which the copy needs to deserialize and serialize names. + ConfigOption *opt = this->default_value->clone(); + if (auto *nullable_enums = dynamic_cast(opt)) + nullable_enums->keys_map = this->enum_keys_map; + else if (auto *enums = dynamic_cast(opt)) + enums->keys_map = this->enum_keys_map; + return opt; } return this->default_value->clone(); diff --git a/tests/libslic3r/test_config.cpp b/tests/libslic3r/test_config.cpp index 1b48c9551e..da8c7195fb 100644 --- a/tests/libslic3r/test_config.cpp +++ b/tests/libslic3r/test_config.cpp @@ -1477,3 +1477,21 @@ TEST_CASE("A static config applied onto a config of another type falls back to a dynamic.apply(region); CHECK(dynamic.opt_serialize("sparse_infill_pattern") == "gyroid"); } + +TEST_CASE("Default options of enum lists get their definition's keys map", "[Config]") +{ + size_t enum_lists = 0; + for (const auto &[key, def] : print_config_def.options) { + if (def.type != coEnums || !def.default_value) + continue; + INFO(key); + const std::unique_ptr opt(def.create_default_option()); + CHECK(*opt == *def.default_value); + const auto *nullable_enums = dynamic_cast(opt.get()); + const auto *enums = dynamic_cast(opt.get()); + REQUIRE((nullable_enums != nullptr) != (enums != nullptr)); + CHECK((nullable_enums != nullptr ? nullable_enums->keys_map : enums->keys_map) == def.enum_keys_map); + ++enum_lists; + } + CHECK(enum_lists > 0); +} From 7fd6e5fd723ef9133530a8a8fbac7cbb2e12f408 Mon Sep 17 00:00:00 2001 From: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com> Date: Sun, 4 Oct 2026 21:54:47 +0100 Subject: [PATCH 218/389] Fix crash on macOS when OrcaSlicer is quit from the Dock, a logout or a restart (#16136) Fix crash when quitting from the Dock, logout or restart on macOS --- src/slic3r/GUI/GUI_App.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 94ef20e9fd..73a58c5b51 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -3087,6 +3087,18 @@ bool GUI_App::on_init_inner() d->EndModal(wxID_ABORT); }); +#ifdef __APPLE__ + // A quit request from the Dock, a logout or a restart ends with AppKit calling exit() right after this event, so + // OnExit() and ~GUI_App() never run. Shut the plugins and Python down here as ~GUI_App() does. Left to + // PluginManager's static destructor, the shutdown locks hook state that has already been destroyed and aborts. + wxGetApp().Bind(wxEVT_END_SESSION, [](wxCloseEvent &e) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "received wxEVT_END_SESSION"; + Slic3r::PluginManager::instance().shutdown(); + Slic3r::PythonInterpreter::instance().shutdown(); + e.Skip(); + }); +#endif + // Verify resources path const wxString resources_dir = from_u8(Slic3r::resources_dir()); wxCHECK_MSG(wxDirExists(resources_dir), false, From 93fca831223c76e5bdfbc82f665401df8b781d4d Mon Sep 17 00:00:00 2001 From: TheLegendTubaGuy <95944177+thelegendtubaguy@users.noreply.github.com> Date: Sun, 4 Oct 2026 16:13:17 -0500 Subject: [PATCH 219/389] Fix memory leak of gap fill paths in solid infill (#16137) --- src/libslic3r/Fill/FillBase.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libslic3r/Fill/FillBase.cpp b/src/libslic3r/Fill/FillBase.cpp index 91a3bb42af..aabd2b3209 100644 --- a/src/libslic3r/Fill/FillBase.cpp +++ b/src/libslic3r/Fill/FillBase.cpp @@ -264,10 +264,7 @@ void Fill::_create_gap_fill(const Surface* surface, const FillParams& params, Ex return p.length() < scale_(params.config->filter_out_gap_fill.value); }), polylines.end()); - ExtrusionEntityCollection gap_fill; - variable_width(polylines, erGapFill, params.flow, gap_fill.entities); - auto gap = std::move(gap_fill.entities); - out->append(gap); + variable_width(polylines, erGapFill, params.flow, out->entities); } } } From fb529f8315f55009bd737fce8b51790a1a14b041 Mon Sep 17 00:00:00 2001 From: Damir Galeev <49319928+DImagine@users.noreply.github.com> Date: Mon, 5 Oct 2026 00:22:35 +0300 Subject: [PATCH 220/389] Fix startup freeze from synchronous scripts in the camera view (#16104) --- src/slic3r/GUI/StatusPanel.cpp | 31 ------------------------------- src/slic3r/GUI/StatusPanel.hpp | 2 -- 2 files changed, 33 deletions(-) diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index a1f2b72c1a..6cea75fb71 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -1618,19 +1618,11 @@ wxBoxSizer *StatusBasePanel::create_monitoring_page() m_custom_camera_view = WebView::CreateWebView(this, wxEmptyString); m_custom_camera_view->EnableContextMenu(false); - Bind(wxEVT_WEBVIEW_NAVIGATING, &StatusBasePanel::on_webview_navigating, this, m_custom_camera_view->GetId()); m_web_media_controller = std::make_unique(m_custom_camera_view); m_media_play_ctrl = new MediaPlayCtrl(this, m_media_ctrl, wxDefaultPosition, wxSize(-1, FromDIP(40))); m_media_play_ctrl->SetWebMediaController(m_web_media_controller.get()); m_custom_camera_view->Hide(); - // m_custom_camera_view->Bind(wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED, [this](wxWebViewEvent& evt) { - // if (evt.GetString() == "leavepictureinpicture") { - // // When leaving PiP, video gets paused in some cases and toggling play - // // programmatically does not work. - // m_custom_camera_view->Reload(); - // } - // }); sizer->Add(m_media_ctrl, 1, wxEXPAND | wxALL, 0); sizer->Add(m_custom_camera_view, 1, wxEXPAND | wxALL, 0); @@ -1643,12 +1635,6 @@ wxBoxSizer *StatusBasePanel::create_monitoring_page() return sizer; } -void StatusBasePanel::on_webview_navigating(wxWebViewEvent& evt) { - wxGetApp().CallAfter([this] { - remove_controls(); - }); -} - wxBoxSizer *StatusBasePanel::create_machine_control_page(wxWindow *parent) { wxBoxSizer *bSizer_right = new wxBoxSizer(wxVERTICAL); @@ -5121,23 +5107,6 @@ void StatusPanel::on_camera_enter(wxMouseEvent& event) } } -void StatusBasePanel::remove_controls() -{ - const std::string js_cleanup_video_element = R"( - document.body.style.overflow='hidden'; - const video = document.querySelector('video'); - video.setAttribute('style', 'width: 100% !important;'); - video.removeAttribute('controls'); - video.addEventListener('leavepictureinpicture', () => { - window.wx.postMessage('leavepictureinpicture'); - }); - video.addEventListener('enterpictureinpicture', () => { - window.wx.postMessage('enterpictureinpicture'); - }); - )"; - m_custom_camera_view->RunScript(js_cleanup_video_element); -} - void StatusPanel::on_camera_leave(wxMouseEvent& event) { if (obj && m_camera_popup) { diff --git a/src/slic3r/GUI/StatusPanel.hpp b/src/slic3r/GUI/StatusPanel.hpp index 9f7547ecf1..4a17aff571 100644 --- a/src/slic3r/GUI/StatusPanel.hpp +++ b/src/slic3r/GUI/StatusPanel.hpp @@ -606,8 +606,6 @@ protected: virtual void on_axis_ctrl_e_up_10(wxCommandEvent &event) { event.Skip(); } virtual void on_axis_ctrl_e_down_10(wxCommandEvent &event) { event.Skip(); } virtual void on_nozzle_selected(wxCommandEvent &event) { event.Skip(); } - void remove_controls(); - void on_webview_navigating(wxWebViewEvent& evt); public: StatusBasePanel(wxWindow * parent, From 4b4a261787ee815fbde96adfe04f3871d88acc16 Mon Sep 17 00:00:00 2001 From: TheLegendTubaGuy <95944177+thelegendtubaguy@users.noreply.github.com> Date: Sun, 4 Oct 2026 16:23:40 -0500 Subject: [PATCH 221/389] Fix small binary STLs failing to load as ASCII (#16130) --- deps_src/admesh/stlinit.cpp | 13 +++++++++++++ tests/libslic3r/test_stl.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/deps_src/admesh/stlinit.cpp b/deps_src/admesh/stlinit.cpp index 9d44cdf266..3b8f59866a 100644 --- a/deps_src/admesh/stlinit.cpp +++ b/deps_src/admesh/stlinit.cpp @@ -75,6 +75,19 @@ static FILE *stl_open_count_facets(stl_file *stl, const char *file, unsigned int break; } } + // Zero normals and coordinates like 10 or 15 have no byte above 127, so the test above can miss a binary file. + // Its size still matches its facet count; text read as that count would need a file of gigabytes. + if (stl->stats.type == ascii) { + uint32_t header_num_facets; + fseek(fp, custom_header_length, SEEK_SET); + if (fread(&header_num_facets, sizeof(uint32_t), 1, fp) == 1) { +#if BOOST_ENDIAN_BIG_BYTE + stl_internal_reverse_quads((char*)&header_num_facets, 4); +#endif /* BOOST_ENDIAN_BIG_BYTE */ + if (header_size + uint64_t(header_num_facets) * SIZEOF_STL_FACET == file_size) + stl->stats.type = binary; + } + } rewind(fp); uint32_t num_facets = 0; diff --git a/tests/libslic3r/test_stl.cpp b/tests/libslic3r/test_stl.cpp index 0223392c3f..b121bfc122 100644 --- a/tests/libslic3r/test_stl.cpp +++ b/tests/libslic3r/test_stl.cpp @@ -1,10 +1,13 @@ #include +#include #include #include "libslic3r/Point.hpp" #include #include "libslic3r/Model.hpp" #include "libslic3r/Format/STL.hpp" +#include "test_utils.hpp" +#include using namespace Slic3r; @@ -58,3 +61,25 @@ SCENARIO("Reading an STL file", "[stl]") { } } } + +TEST_CASE("A binary STL whose facet bytes never exceed 127 is read as binary", "[stl]") +{ + const indexed_triangle_set cube = its_make_cube(10., 10., 10.); + std::string stl(80, '\0'); + const auto append = [&stl](const auto &value) { stl.append(reinterpret_cast(&value), sizeof(value)); }; + append(uint32_t(cube.indices.size())); + const stl_normal zero_normal = stl_normal::Zero(); + for (const stl_triangle_vertex_indices &facet : cube.indices) { + append(zero_normal); + for (int i = 0; i < 3; ++i) + append(cube.vertices[facet[i]]); + append(uint16_t(0)); + } + REQUIRE(std::none_of(stl.begin() + 84, stl.begin() + 84 + 128, [](unsigned char c) { return c > 127; })); + + ScopedTemporaryFile file(".stl"); + boost::nowide::ofstream(file.string(), std::ios::binary) << stl; + Model model; + REQUIRE(load_stl(file.string().c_str(), &model)); + REQUIRE(is_approx(model.objects.front()->volumes.front()->mesh().size(), Vec3d(10, 10, 10))); +} From f3d0b8a553958a10fe94df7d6ca2513d5690e8e3 Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Sun, 4 Oct 2026 19:12:32 -0500 Subject: [PATCH 222/389] ci: move macOS jobs off the retiring macos-14 runner (#16088) --- .github/workflows/build_all.yml | 6 +++--- .github/workflows/build_check_cache.yml | 2 +- .github/workflows/build_orca.yml | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 0fcb6ba869..ab4cd57f5f 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -127,7 +127,7 @@ jobs: if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }} uses: ./.github/workflows/build_check_cache.yml with: - os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }} + os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-15' }} arch: ${{ matrix.arch }} build-deps-only: ${{ inputs.build-deps-only || false }} force-build: ${{ github.event_name == 'schedule' }} @@ -138,7 +138,7 @@ jobs: if: ${{ !cancelled() && needs.build_macos_arch.result == 'success' && !inputs.build-deps-only && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }} uses: ./.github/workflows/build_orca.yml with: - os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }} + os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-15' }} arch: universal macos-combine-only: true secrets: inherit @@ -182,7 +182,7 @@ jobs: if: ${{ !cancelled() && success() }} uses: ./.github/workflows/unit_tests.yml with: - os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }} + os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-15' }} artifact: ${{ github.sha }}-tests-macos-arm64 test-dir: build/arm64/tests # Slice a two-colour cube through every shipped printer, and through every diff --git a/.github/workflows/build_check_cache.yml b/.github/workflows/build_check_cache.yml index 2da05e1d69..31fdd6cb28 100644 --- a/.github/workflows/build_check_cache.yml +++ b/.github/workflows/build_check_cache.yml @@ -40,7 +40,7 @@ jobs: # Anything that changes how the tree is built belongs in the key, or a job # restores one it cannot use. Linux amd64 passes no arch deliberately, so # 'linux-clang' keeps the cache it already has. - cache-os: ${{ runner.os == 'macOS' && format('macos-{0}', inputs.arch) || (runner.os == 'Windows' && format('windows-{0}-{1}', inputs.arch, inputs.compiler) || format('linux-clang{0}', inputs.arch && format('-{0}', inputs.arch) || '')) }} + cache-os: ${{ runner.os == 'macOS' && format('{0}-{1}', inputs.os, inputs.arch) || (runner.os == 'Windows' && format('windows-{0}-{1}', inputs.arch, inputs.compiler) || format('linux-clang{0}', inputs.arch && format('-{0}', inputs.arch) || '')) }} # The Windows ARM64 deps build in build-arm64, all others under build; # build_deps.yml and build_orca.yml pass the Windows directory to build_win.bat. dep-folder-name: ${{ runner.os == 'macOS' && format('/{0}', inputs.arch) || (runner.os == 'Windows' && inputs.arch == 'arm64') && '-arm64/OrcaSlicer_dep' || '/OrcaSlicer_dep' }} diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index 98f0d66032..7b001a8c48 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -183,10 +183,12 @@ jobs: - name: Free disk space if: runner.os == 'macOS' && !inputs.macos-combine-only && !vars.SELF_HOSTED run: | - df -hI /dev/disk3s1s1 - sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "Xcode_15.4.app" -exec rm -rf {} + + df -hI / + # Keep only the selected Xcode + xcode=$(basename "$(cd "$(xcode-select -p)/../.." && pwd -P)") + sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "$xcode" -exec rm -rf {} + sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/* - df -hI /dev/disk3s1s1 + df -hI / - name: Build slicer mac if: runner.os == 'macOS' && !inputs.macos-combine-only From ee88b3f0b09926122a5e984c0a6e2e4e2294696e Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sun, 4 Oct 2026 19:16:59 -0500 Subject: [PATCH 223/389] GCode: hold the writer by value again Belt printing turned GCode::m_writer into a unique_ptr so BeltGCode could swap in a freshly built writer carrying the belt kinematics. Nothing subclasses GCodeWriter: the machine mapping lives in its MachineKinematics, which set_kinematics() installs on an existing writer. A GCode is built for every export and the only state on the writer when init_belt_writer() runs is the plate offset, which the swap had to copy across by hand. Install the belt kinematics on the writer in place, drop the copied offset, and drop the virtual markers on GCodeWriter that the old subclass needed. Every m_writer-> in GCode.cpp goes back to m_writer., which is most of the belt diff in that file and most of its conflicts with main. The pressure-advance pattern keeps its shared_ptr writer: the unique_ptr kinematics make GCodeWriter move-only and that class must stay copyable. --- src/libslic3r/BeltGCode.cpp | 8 +- src/libslic3r/GCode.cpp | 470 +++++++++++++++++----------------- src/libslic3r/GCode.hpp | 16 +- src/libslic3r/GCodeWriter.hpp | 15 +- 4 files changed, 251 insertions(+), 258 deletions(-) diff --git a/src/libslic3r/BeltGCode.cpp b/src/libslic3r/BeltGCode.cpp index 4082db66e9..20b19e41b0 100644 --- a/src/libslic3r/BeltGCode.cpp +++ b/src/libslic3r/BeltGCode.cpp @@ -8,14 +8,10 @@ namespace Slic3r { void BeltGCode::init_belt_writer(Print &print) { - auto belt_writer = std::make_unique(); // Axis remap and build volume max are set by base GCode after init_belt_writer // returns; set_kinematics() replays them, so install order does not matter. - install_belt_kinematics(*belt_writer, print.config()); - belt_writer->set_force_normal_lift(true); - // The plate origin was stored on the writer this one replaces. - belt_writer->set_xy_offset(m_gcode_offset.x(), m_gcode_offset.y()); - m_writer = std::move(belt_writer); + install_belt_kinematics(m_writer, print.config()); + m_writer.set_force_normal_lift(true); } void BeltGCode::write_belt_header(GCodeOutputStream &file, const Print &print) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index d2fbea5742..677b115530 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1069,7 +1069,7 @@ static std::vector get_path_of_change_filament(const Print& print) //BBS: if needed, write the gcode_label_objects_end then priming tower, if the retract, didn't did it. std::string object_end_label_temp; - gcodegen.m_writer->add_object_end_labels(object_end_label_temp); + gcodegen.m_writer.add_object_end_labels(object_end_label_temp); // Process the custom change_filament_gcode. If it is empty, provide a simple Tn command to change the filament. // Otherwise, leave control to the user completely. @@ -1138,7 +1138,7 @@ static std::vector get_path_of_change_filament(const Print& print) // config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); // BBS { - GCodeWriter& gcode_writer = *gcodegen.m_writer; + GCodeWriter& gcode_writer = gcodegen.m_writer; FullPrintConfig& full_config = gcodegen.m_config; // Per-variant filament arrays can hold one column per variant a filament uses @@ -2002,9 +2002,9 @@ static std::vector get_path_of_change_filament(const Print& print) const std::vector ColorPrintColors::Colors = { "#C0392B", "#E67E22", "#F1C40F", "#27AE60", "#1ABC9C", "#2980B9", "#9B59B6" }; -#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_writer->filament()->extruder_id()) -#define FILAMENT_CONFIG(OPT) m_config.OPT.get_at(get_filament_config_index(m_writer->filament()->id())) -#define NOZZLE_CONFIG(OPT) m_config.OPT.get_at(get_nozzle_config_index(m_writer->filament()->id())) +#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_writer.filament()->extruder_id()) +#define FILAMENT_CONFIG(OPT) m_config.OPT.get_at(get_filament_config_index(m_writer.filament()->id())) +#define NOZZLE_CONFIG(OPT) m_config.OPT.get_at(get_nozzle_config_index(m_writer.filament()->id())) void GCode::PlaceholderParserIntegration::reset() { @@ -2492,7 +2492,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu BOOST_LOG_TRIVIAL(info) << boost::format("Will export G-code to %1% soon")%path; GCodeProcessor::s_IsBBLPrinter = print->is_BBL_printer(); - m_writer->set_is_bbl_machine(print->is_BBL_printer()); + m_writer.set_is_bbl_machine(print->is_BBL_printer()); print->set_started(psGCodeExport); // check if any custom gcode contains keywords used by the gcode processor to @@ -2589,7 +2589,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu m_processor.result().support_traditional_timelapse = m_support_traditional_timelapse; bool activate_long_retraction_when_cut = false; - for (const auto& filament : m_writer->extruders()) { + for (const auto& filament : m_writer.extruders()) { size_t fi = get_filament_config_index((int)filament.id()); activate_long_retraction_when_cut |= ( m_config.long_retractions_when_cut.get_at(fi) @@ -2629,7 +2629,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu m_processor.finalize(true); // DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics); - DoExport::update_print_estimated_stats(m_processor, m_writer->extruders(), print->m_print_statistics, print->config()); + DoExport::update_print_estimated_stats(m_processor, m_writer.extruders(), print->m_print_statistics, print->config()); // Printed-mass safety check. Flushed filament leaves the bed, so subtract it // from the total to get the mass actually resting on the plate. Gated on machine_max_printed_mass // (>0 only for A2L machines), so no existing printer's gcode_check_result changes. @@ -2637,8 +2637,8 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu double mass_on_bed_total = print->m_print_statistics.total_weight; for (auto volume : m_processor.get_result().print_statistics.flush_per_filament) { size_t extruder_id = volume.first; - auto extruder = std::find_if(m_writer->extruders().begin(), m_writer->extruders().end(), [extruder_id](const Extruder &extr) { return extr.id() == extruder_id; }); - if (extruder == m_writer->extruders().end()) continue; + auto extruder = std::find_if(m_writer.extruders().begin(), m_writer.extruders().end(), [extruder_id](const Extruder &extr) { return extr.id() == extruder_id; }); + if (extruder == m_writer.extruders().end()) continue; mass_on_bed_total -= (volume.second * extruder->filament_density() * 0.001); } // flushed weight will not be keeped on the hot bed, exclude it if (mass_on_bed_total > m_print->config().machine_max_printed_mass.value) { @@ -2939,7 +2939,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato PROFILE_FUNC(); m_print = &print; - m_timelapse_pos_picker.init(&print,m_writer->get_xy_offset().cast()); + m_timelapse_pos_picker.init(&print,m_writer.get_xy_offset().cast()); // init as filament map update_layer_related_config(0); @@ -2964,7 +2964,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Belt printer: initialize belt-specific writer via virtual hook. this->init_belt_writer(print); - m_writer->set_is_bbl_machine(is_bbl_printers); + m_writer.set_is_bbl_machine(is_bbl_printers); // Standalone axis remap (works with or without belt mode). // Sync the writer's remap state to the current export UNCONDITIONALLY — even at @@ -2975,9 +2975,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato int rx = int(print.config().gcode_remap_x.value); int ry = int(print.config().gcode_remap_y.value); int rz = int(print.config().gcode_remap_z.value); - m_writer->set_axis_remap(rx, ry, rz); + m_writer.set_axis_remap(rx, ry, rz); BoundingBoxf bbox_bed(print.config().printable_area.values); - m_writer->set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), + m_writer.set_build_volume_max(Vec3d(bbox_bed.max.x(), bbox_bed.max.y(), print.config().printable_height.value)); } @@ -2990,7 +2990,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // per-point (see GCodeWriter::uses_pointwise_travel_speed()), which must not // change for non-belt printers. if (print.config().belt_printer.value) { - m_writer->set_first_layer_plane( + m_writer.set_first_layer_plane( m_first_layer_plane.get(), print.config().initial_layer_print_height.value); } @@ -3362,13 +3362,13 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Disable fan. if (m_config.auxiliary_fan.value && print.config().close_fan_the_first_x_layers.get_at(initial_extruder_id)) { - file.write(m_writer->set_fan(0)); + file.write(m_writer.set_fan(0)); //BBS: disable additional fan - file.write(m_writer->set_additional_fan(0)); + file.write(m_writer.set_additional_fan(0)); } // Update output variables after the extruders were initialized. - m_placeholder_parser_integration.init(*m_writer); + m_placeholder_parser_integration.init(m_writer); // Let the start-up script prime the 1st printing tool. @@ -3482,7 +3482,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato { BoundingBoxf bbox_bed(print.config().printable_area.values); - Vec2f plate_offset = m_writer->get_xy_offset(); + Vec2f plate_offset = m_writer.get_xy_offset(); this->placeholder_parser().set("print_bed_min", new ConfigOptionFloats({ bbox_bed.min.x(), bbox_bed.min.y()})); this->placeholder_parser().set("print_bed_max", new ConfigOptionFloats({ bbox_bed.max.x(), bbox_bed.max.y()})); this->placeholder_parser().set("print_bed_size", new ConfigOptionFloats({ bbox_bed.size().x(), bbox_bed.size().y() })); @@ -3601,7 +3601,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } bool activate_chamber_temp_control = false; auto max_chamber_temp = 0; - for (const auto &extruder : m_writer->extruders()) { + for (const auto &extruder : m_writer.extruders()) { activate_chamber_temp_control |= m_config.activate_chamber_temp_control.get_at(extruder.id()); max_chamber_temp = std::max(max_chamber_temp, m_config.chamber_temperature.get_at(extruder.id())); } @@ -3609,7 +3609,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato BedType curr_bed_type = m_config.curr_bed_type; int min_temperature_vitrification = std::numeric_limits::max(); - for (const auto& extruder : m_writer->extruders()) + for (const auto& extruder : m_writer.extruders()) min_temperature_vitrification = std::min(min_temperature_vitrification, m_config.temperature_vitrification.get_at(extruder.id())); @@ -3729,7 +3729,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato if (activate_chamber_temp_control && max_chamber_temp > 0){ int temp_out =0; if(!custom_gcode_sets_temperature(machine_start_gcode,141,191,false,temp_out)) - file.write(m_writer->set_chamber_temperature(max_chamber_temp, true)); // set chamber_temperature + file.write(m_writer.set_chamber_temperature(max_chamber_temp, true)); // set chamber_temperature } // Write the custom start G-code @@ -3743,11 +3743,11 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write_format(";%s\n", GCodeProcessor::Machine_Start_GCode_End_Tag.c_str()); //BBS: gcode writer doesn't know where the real position of extruder is after inserting custom gcode - m_writer->set_current_position_clear(false); + m_writer.set_current_position_clear(false); m_start_gcode_filament = GCodeProcessor::get_gcode_last_filament(machine_start_gcode); if (is_bbl_printers) { - m_writer->init_extruder(initial_non_support_extruder_id); + m_writer.init_extruder(initial_non_support_extruder_id); // add the missing filament start gcode in machine start gcode { DynamicConfig config; @@ -3776,7 +3776,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } // Orca: add missing PA settings for initial filament if (m_config.enable_pressure_advance.get_at(initial_non_support_extruder_id)) { - file.write(m_writer->set_pressure_advance(m_config.pressure_advance.get_at(initial_non_support_extruder_id))); + file.write(m_writer.set_pressure_advance(m_config.pressure_advance.get_at(initial_non_support_extruder_id))); // Orca: Adaptive PA // Reset Adaptive PA processor last PA value m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(initial_non_support_extruder_id)); @@ -3806,7 +3806,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato int during_print_exhaust_fan_speed = 0; // Orca: when activate_air_filtration is set on any extruder, find and set the highest during_print_exhaust_fan_speed - for (const auto &extruder : m_writer->extruders()) { + for (const auto &extruder : m_writer.extruders()) { size_t fi = get_filament_config_index((int)extruder.id()); if (m_config.activate_air_filtration.get_at(fi) && m_config.activate_air_filtration_during_print.get_at(fi)) { activate_air_filtration_during_print = true; @@ -3816,7 +3816,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } if (activate_air_filtration_during_print) - file.write(m_writer->set_exhaust_fan(during_print_exhaust_fan_speed)); + file.write(m_writer.set_exhaust_fan(during_print_exhaust_fan_speed)); } print.throw_if_canceled(); @@ -3833,7 +3833,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_seam_placer.init(print, throw_if_canceled_func); // BBS: get path for change filament - if (m_writer->multiple_extruders) { + if (m_writer.multiple_extruders) { std::vector points = get_path_of_change_filament(print); if (points.size() == 3) { travel_point_1 = points[0]; @@ -3870,12 +3870,12 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato std::string gcode; gcode += ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change) + "\n"; if ((NOZZLE_CONFIG(outer_wall_acceleration) > 0 && NOZZLE_CONFIG(outer_wall_acceleration) > 0)) { - gcode += m_writer->set_print_acceleration((unsigned int)floor(NOZZLE_CONFIG(outer_wall_acceleration) + 0.5)); + gcode += m_writer.set_print_acceleration((unsigned int)floor(NOZZLE_CONFIG(outer_wall_acceleration) + 0.5)); } if (NOZZLE_CONFIG(outer_wall_jerk) > 0) { double jerk = NOZZLE_CONFIG(outer_wall_jerk); - gcode += m_writer->set_jerk_xy(jerk); + gcode += m_writer.set_jerk_xy(jerk); } auto params = print.calib_params(); @@ -3895,10 +3895,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // belt plane, not the slicing plane. const bool belt_world_coords = print.config().belt_printer.value; if (belt_world_coords) - install_belt_kinematics(*m_writer, print.config(), /*world_coordinates=*/true); + install_belt_kinematics(m_writer, print.config(), /*world_coordinates=*/true); gcode += pa_test.generate_test(params.start, params.step, std::llround(std::ceil((params.end - params.start) / params.step)) + 1); if (belt_world_coords) - install_belt_kinematics(*m_writer, print.config(), /*world_coordinates=*/false); + install_belt_kinematics(m_writer, print.config(), /*world_coordinates=*/false); file.write(gcode); } else { @@ -3946,7 +3946,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_enable_cooling_markers = false; // we're not filtering these moves through CoolingBuffer m_avoid_crossing_perimeters.use_external_mp_once(); // BBS. change tool before moving to origin point. - if (m_writer->need_toolchange(initial_extruder_id)) { + if (m_writer.need_toolchange(initial_extruder_id)) { const PrintObjectConfig& object_config = object.config(); coordf_t initial_layer_print_height = print.config().initial_layer_print_height.value; @@ -3959,7 +3959,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } else { file.write(this->retract()); } - file.write(m_writer->travel_to_z(m_max_layer_z + m_writer->config.z_hop.get_at(get_filament_config_index((int)initial_extruder_id)))); + file.write(m_writer.travel_to_z(m_max_layer_z + m_writer.config.z_hop.get_at(get_filament_config_index((int)initial_extruder_id)))); file.write(this->travel_to(Point(0, 0), erNone, "move to origin position for next object")); m_enable_cooling_markers = true; // Disable motion planner when traveling to first object point. @@ -3999,7 +3999,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato { const auto plr_mode = print.config().enable_power_loss_recovery.value; if (m_second_layer_things_done && plr_mode == PowerLossRecoveryMode::Enable) { - file.write(m_writer->enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); + file.write(m_writer.enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); } } ++ finished_objects; @@ -4020,7 +4020,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_wipe_tower->set_wipe_tower_bbx(print.get_wipe_tower_bbx()); m_wipe_tower->set_rib_offset(print.get_rib_offset()); //BBS - file.write(m_writer->travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height")); + file.write(m_writer.travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height")); if (wipe_tower_type == WipeTowerType::Type2 && print.config().single_extruder_multi_material_priming) { file.write(m_wipe_tower->prime(*this)); @@ -4079,7 +4079,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // Orca: disable power loss recovery if (m_second_layer_things_done && print.config().enable_power_loss_recovery.value == PowerLossRecoveryMode::Enable) { - file.write(m_writer->enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); + file.write(m_writer.enable_power_loss_recovery(PowerLossRecoveryMode::Disable)); } if (m_wipe_tower) // Purge the extruder, pull out the active filament. @@ -4093,14 +4093,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // if needed, write the gcode_label_objects_end { std::string gcode; - m_writer->add_object_change_labels(gcode); + m_writer.add_object_change_labels(gcode); file.write(gcode); } - file.write(m_writer->set_fan(0)); + file.write(m_writer.set_fan(0)); //BBS: make sure the additional fan is closed when end if(m_config.auxiliary_fan.value) - file.write(m_writer->set_additional_fan(0)); + file.write(m_writer.set_additional_fan(0)); if (is_bbl_printers) { //BBS: close spaghetti detector //Note: M981 is also used to tell xcam the last layer is finished, so we need always send it even if spaghetti option is disabled. @@ -4122,14 +4122,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato DynamicConfig config; config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); //BBS - config.set_key_value("layer_z", new ConfigOptionFloat(m_writer->get_position()(2) - m_config.z_offset.value)); + config.set_key_value("layer_z", new ConfigOptionFloat(m_writer.get_position()(2) - m_config.z_offset.value)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); config.set_key_value("nozzle_diameter_at_nozzle_id", new ConfigOptionFloats(get_nozzle_diameters_by_nozzle_id(group_result.get()))); config.set_key_value("nozzle_volume_types", new ConfigOptionStrings(get_nozzle_volume_types_by_nozzle_id(group_result.get()))); if (print.config().single_extruder_multi_material) { // Process the filament_end_gcode for the active filament only. - int extruder_id = m_writer->filament()->id(); + int extruder_id = m_writer.filament()->id(); config.set_key_value("filament_extruder_id", new ConfigOptionInt(extruder_id)); config.set_key_value("current_filament_id", new ConfigOptionInt(extruder_id)); config.set_key_value("current_extruder_id", new ConfigOptionInt((int) get_extruder_id(extruder_id))); @@ -4145,13 +4145,13 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.writeln(this->placeholder_parser_process("filament_end_gcode", end_gcode, extruder_id, &config)); } } - file.writeln(this->placeholder_parser_process("machine_end_gcode", print.config().machine_end_gcode, m_writer->filament()->id(), &config)); + file.writeln(this->placeholder_parser_process("machine_end_gcode", print.config().machine_end_gcode, m_writer.filament()->id(), &config)); } - file.write(m_writer->update_progress(m_layer_count, m_layer_count, true)); // 100% - file.write(m_writer->postamble()); + file.write(m_writer.update_progress(m_layer_count, m_layer_count, true)); // 100% + file.write(m_writer.postamble()); if (activate_chamber_temp_control && max_chamber_temp > 0) - file.write(m_writer->set_chamber_temperature(0, false)); //close chamber_temperature + file.write(m_writer.set_chamber_temperature(0, false)); //close chamber_temperature // Orca: when air filtration is supported, check if it needs to be activated after print completion and set the exhaust fan speed accordingly if (m_config.support_air_filtration.value) { @@ -4159,7 +4159,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato int complete_print_exhaust_fan_speed = 0; // Orca: when activate_air_filtration is set on any extruder, find and set the highest complete_print_exhaust_fan_speed - for (const auto& extruder : m_writer->extruders()) { + for (const auto& extruder : m_writer.extruders()) { size_t fi = get_filament_config_index((int)extruder.id()); if (m_config.activate_air_filtration.get_at(fi) && m_config.activate_air_filtration_on_completion.get_at(fi)) { activate_air_filtration_on_completion = true; @@ -4168,7 +4168,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } if (activate_air_filtration_on_completion) - file.write(m_writer->set_exhaust_fan(complete_print_exhaust_fan_speed)); + file.write(m_writer.set_exhaust_fan(complete_print_exhaust_fan_speed)); } // adds tags for time estimators @@ -4181,7 +4181,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write(DoExport::update_print_stats_and_format_filament_stats( // Const inputs has_wipe_tower, print.wipe_tower_data(), - m_writer->extruders(), + m_writer.extruders(), // Modifies print.m_print_statistics, // Const input (tool-change fallback for non-wipe-tower prints) @@ -4320,8 +4320,8 @@ void GCode::check_placeholder_parser_failed() size_t GCode::cur_extruder_index() const { //TODO: check if the function is duplicated - //just return m_writer->filament()->extruder_id() - return get_extruder_id(m_writer->filament()->id()); + //just return m_writer.filament()->extruder_id() + return get_extruder_id(m_writer.filament()->id()); } size_t GCode::get_extruder_id(unsigned int filament_id) const @@ -4422,7 +4422,7 @@ void GCode::process_layers( ); const auto fan_mover = tbb::make_filter(slic3r_tbb_filtermode::serial_in_order, - [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = *this->m_writer](std::string in)->std::string { + [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = this->m_writer](std::string in)->std::string { CNumericLocalesSetter locales_setter; @@ -4522,7 +4522,7 @@ void GCode::process_layers( ); const auto fan_mover = tbb::make_filter(slic3r_tbb_filtermode::serial_in_order, - [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = *this->m_writer](std::string in)->std::string { + [&fan_mover = this->m_fan_mover, &config = this->config(), &writer = this->m_writer](std::string in)->std::string { if (config.fan_speedup_time.value != 0 || config.fan_kickstart.value > 0) { if (fan_mover.get() == nullptr) @@ -4590,26 +4590,26 @@ std::string GCode::placeholder_parser_process(const std::string &name, const std PlaceholderParserIntegration &ppi = m_placeholder_parser_integration; try { - ppi.update_from_gcodewriter(*m_writer); + ppi.update_from_gcodewriter(m_writer); std::string output = ppi.parser.process(templ, current_filament_id, config_override, &ppi.output_config, &ppi.context); ppi.validate_output_vector_variables(); const CustomGCodeMotionStateChanges motion_state_changes = custom_gcode_motion_state_changes(output); if (motion_state_changes.acceleration) - m_writer->invalidate_acceleration(); + m_writer.invalidate_acceleration(); if (motion_state_changes.jerk) - m_writer->invalidate_jerk(); + m_writer.invalidate_jerk(); if (const std::vector &pos = ppi.opt_position->values; ppi.position != pos) { // Update G-code writer. - m_writer->set_position({ pos[0], pos[1], pos[2] }); + m_writer.set_position({ pos[0], pos[1], pos[2] }); this->set_last_pos(this->gcode_to_point({ pos[0], pos[1] })); } - for (const Extruder &e : m_writer->extruders()) { + for (const Extruder &e : m_writer.extruders()) { unsigned int eid = e.id(); assert(eid < ppi.num_extruders); if ( eid < ppi.num_extruders) { - if (! m_writer->config.use_relative_e_distances && ! is_approx(ppi.e_position[eid], ppi.opt_e_position->values[eid])) + if (! m_writer.config.use_relative_e_distances && ! is_approx(ppi.e_position[eid], ppi.opt_e_position->values[eid])) const_cast(e).set_position(ppi.opt_e_position->values[eid]); if (! is_approx(ppi.e_retracted[eid], ppi.opt_e_retracted->values[eid]) || ! is_approx(ppi.e_restart_extra[eid], ppi.opt_e_restart_extra->values[eid])) @@ -4646,7 +4646,7 @@ void GCode::print_machine_envelope(GCodeOutputStream &file, Print &print) // Get all physical tool ids current print will use std::unordered_set used_extruders; - for (const auto& extruder : m_writer->extruders()) { + for (const auto& extruder : m_writer.extruders()) { used_extruders.insert(extruder.extruder_id()); } @@ -4770,9 +4770,9 @@ void GCode::_print_first_layer_bed_temperature(GCodeOutputStream &file, Print &p temp = temp_by_gcode; #endif - // Always call m_writer->set_bed_temperature() so it will set the internal "current" state of the bed temp as if + // Always call m_writer.set_bed_temperature() so it will set the internal "current" state of the bed temp as if // the custom start G-code emited these. - std::string set_temp_gcode = m_writer->set_bed_temperature(bed_temp, wait); + std::string set_temp_gcode = m_writer.set_bed_temperature(bed_temp, wait); if (! temp_set_by_gcode) file.write(set_temp_gcode); } @@ -4792,14 +4792,14 @@ void GCode::_print_first_layer_extruder_temperatures(GCodeOutputStream &file, Pr int temp = print.config().nozzle_temperature_initial_layer.get_at(get_filament_config_index((int)first_printing_extruder_id)); if (temp_by_gcode >= 0 && temp_by_gcode < 1000) temp = temp_by_gcode; - m_writer->set_temperature(temp, wait, first_printing_extruder_id); + m_writer.set_temperature(temp, wait, first_printing_extruder_id); } else { // Custom G-code does not set the extruder temperature. Do it now. if (print.config().single_extruder_multi_material.value) { // Set temperature of the first printing extruder only. int temp = print.config().nozzle_temperature_initial_layer.get_at(get_filament_config_index((int)first_printing_extruder_id)); if (temp > 0) - file.write(m_writer->set_temperature(temp, wait, first_printing_extruder_id)); + file.write(m_writer.set_temperature(temp, wait, first_printing_extruder_id)); } else { // Set temperatures of all the printing extruders. for (unsigned int tool_id : print.extruders()) { @@ -4811,7 +4811,7 @@ void GCode::_print_first_layer_extruder_temperatures(GCodeOutputStream &file, Pr temp = print.config().idle_temperature.get_at(tool_id); } if (temp > 0) - file.write(m_writer->set_temperature(temp, wait, tool_id)); + file.write(m_writer.set_temperature(temp, wait, tool_id)); } } } @@ -5343,7 +5343,7 @@ LayerResult GCode::process_belt_brim_layer( std::string gcode; const unsigned int extruder_id = layer_tools.extruders.front(); - if (m_writer->filament() == nullptr || m_writer->filament()->id() != extruder_id) + if (m_writer.filament() == nullptr || m_writer.filament()->id() != extruder_id) gcode += this->set_extruder(extruder_id, print_z); // An apron band is a real printed layer: it is counted in m_layer_count, it advances @@ -5370,7 +5370,7 @@ LayerResult GCode::process_belt_brim_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); gcode += this->placeholder_parser_process("before_layer_change_gcode", - print.config().before_layer_change_gcode.value, m_writer->filament()->id(), &config) + "\n"; + print.config().before_layer_change_gcode.value, m_writer.filament()->id(), &config) + "\n"; } gcode += this->change_layer(print_z); @@ -5381,12 +5381,12 @@ LayerResult GCode::process_belt_brim_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); gcode += this->placeholder_parser_process("layer_change_gcode", - print.config().layer_change_gcode.value, m_writer->filament()->id(), &config) + "\n"; + print.config().layer_change_gcode.value, m_writer.filament()->id(), &config) + "\n"; } // Objects sharing this apron Z may use different brim filaments; print each in its own tool. for (const unsigned int brim_extruder : layer_tools.extruders) { - if (m_writer->filament() == nullptr || m_writer->filament()->id() != brim_extruder) + if (m_writer.filament() == nullptr || m_writer.filament()->id() != brim_extruder) gcode += this->set_extruder(brim_extruder, print_z); gcode += this->emit_belt_brim_bands(print, layers, single_object_instance_idx, brim_extruder); } @@ -5647,13 +5647,13 @@ std::string GCode::generate_timelapse_gcode(const Print &print, coordf_t print_z const std::vector *printed_objects, bool skip_pos_pick) { - if (!m_writer->filament()) + if (!m_writer.filament()) return {}; PosPickCtx ctx; - ctx.curr_pos = { (coord_t)(scale_(m_writer->get_position().x())),(coord_t)(scale_(m_writer->get_position().y())) }; + ctx.curr_pos = { (coord_t)(scale_(m_writer.get_position().x())),(coord_t)(scale_(m_writer.get_position().y())) }; ctx.curr_layer = this->layer(); - ctx.curr_extruder_id = m_writer->filament()->extruder_id(); + ctx.curr_extruder_id = m_writer.filament()->extruder_id(); ctx.picture_extruder_id = most_used_extruder; if (m_farthest_point_timelapse.enabled) { // farthest_point is stored in the global print frame (includes plate origin); the picker works in @@ -5684,17 +5684,17 @@ std::string GCode::generate_timelapse_gcode(const Print &print, coordf_t print_z // that leaves the toggle off, so their template evaluates to the pre-existing +0.4 lift byte-for-byte. config.set_key_value("farthest_point_timelapse_enabled", new ConfigOptionBool(m_farthest_point_timelapse.enabled)); config.set_key_value("clear_to_x0", new ConfigOptionBool(m_timelapse_pos_picker.get_is_clear_to_x0(ctx))); - timelapse_gcode = this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer->filament()->id(), &config) + "\n"; + timelapse_gcode = this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer.filament()->id(), &config) + "\n"; } if (!timelapse_gcode.empty()) { - m_writer->set_current_position_clear(false); + m_writer.set_current_position_clear(false); double temp_z_after_tool_change; if (GCodeProcessor::get_last_z_from_gcode(timelapse_gcode, temp_z_after_tool_change)) { - Vec3d pos = m_writer->get_position(); + Vec3d pos = m_writer.get_position(); pos(2) = temp_z_after_tool_change; - m_writer->set_position(pos); + m_writer.set_position(pos); } } @@ -5778,7 +5778,7 @@ LayerResult GCode::process_layer( m_cur_layer_idx = layer.id(); // A per-layer nozzle grouping can move the active filament to another variant column on a // layer boundary without a toolchange, so re-resolve the writer's config column here. - if (Extruder *cur_filament = m_writer->filament()) + if (Extruder *cur_filament = m_writer.filament()) cur_filament->set_config_index((int)get_filament_config_index((int)cur_filament->id())); LayerResult result { {}, layer.id(), false, last_layer }; if (layer_tools.extruders.empty()) @@ -5791,7 +5791,7 @@ LayerResult GCode::process_layer( //support is attached above the object, and support layers has independent layer height, then the lowest support //interface layer id is 0. bool first_layer = (layer.id() == 0 && abs(layer.bottom_z()) < EPSILON); - m_writer->set_is_first_layer(first_layer); + m_writer.set_is_first_layer(first_layer); unsigned int first_extruder_id = layer_tools.extruders.front(); // Initialize config with the 1st object to be printed at this layer. @@ -5841,7 +5841,7 @@ LayerResult GCode::process_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); gcode += this->placeholder_parser_process("before_layer_change_gcode", - print.config().before_layer_change_gcode.value, m_writer->filament()->id(), &config) + print.config().before_layer_change_gcode.value, m_writer.filament()->id(), &config) + "\n"; } @@ -5886,7 +5886,7 @@ LayerResult GCode::process_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); gcode += this->placeholder_parser_process("timelapse_gcode", - print.config().time_lapse_gcode.value, m_writer->filament()->id(), &config) + print.config().time_lapse_gcode.value, m_writer.filament()->id(), &config) + "\n"; } @@ -5896,11 +5896,11 @@ LayerResult GCode::process_layer( config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); { - const int cur_filament_id = (int) m_writer->filament()->id(); + const int cur_filament_id = (int) m_writer.filament()->id(); const auto group_result = m_print->get_layered_nozzle_group_result(); config.set_key_value("current_filament_id", new ConfigOptionInt(cur_filament_id)); config.set_key_value("current_nozzle_id", new ConfigOptionInt( - nozzle_id_for_gcode_placeholder(group_result, cur_filament_id, (int) m_writer->filament()->extruder_id(), m_layer_index))); + nozzle_id_for_gcode_placeholder(group_result, cur_filament_id, (int) m_writer.filament()->extruder_id(), m_layer_index))); } // Bedslinger mass model. Compute the running printed mass at this layer (same weight calc as @@ -5909,7 +5909,7 @@ LayerResult GCode::process_layer( // returns the plain min Y accel unless the A2L force/bed-mass keys are set, so this is inert for every // existing printer. PrintStatistics curr_print_statistics; - for (const Extruder &extruder : m_writer->extruders()) { + for (const Extruder &extruder : m_writer.extruders()) { double extruded_volume = extruder.extruded_volume() + (has_wipe_tower ? print.wipe_tower_data().used_filament[extruder.id()] * 2.4052f : 0.f); // assumes 1.75mm filament diameter double filament_weight = extruded_volume * extruder.filament_density() * 0.001; if (filament_weight > 0.) @@ -5925,7 +5925,7 @@ LayerResult GCode::process_layer( config.set_key_value("curr_layer_mass", new ConfigOptionFloat(curr_layer_mass)); gcode += this->placeholder_parser_process("layer_change_gcode", - print.config().layer_change_gcode.value, m_writer->filament()->id(), &config) + print.config().layer_change_gcode.value, m_writer.filament()->id(), &config) + "\n"; config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); } @@ -6004,7 +6004,7 @@ LayerResult GCode::process_layer( case CalibMode::Calib_Input_shaping_freq: { if (m_layer_index == 1){ gcode += writer().set_input_shaping('A', print.calib_params().start, 0.f, print.calib_params().shaper_type); - if (m_writer->get_gcode_flavor() == gcfKlipper) { + if (m_writer.get_gcode_flavor() == gcfKlipper) { // Disable minimum cruise ratio to ensure consistent motion for calibration gcode += "SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0\n"; } @@ -6020,7 +6020,7 @@ LayerResult GCode::process_layer( } case CalibMode::Calib_Input_shaping_damp: { if (m_layer_index == 1){ - if (m_writer->get_gcode_flavor() == gcfKlipper) { + if (m_writer.get_gcode_flavor() == gcfKlipper) { // Disable minimum cruise ratio to ensure consistent motion for calibration gcode += "SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0\n"; } @@ -6032,7 +6032,7 @@ LayerResult GCode::process_layer( break; } case CalibMode::Calib_Cornering: { - if (m_writer->get_gcode_flavor() == gcfMarlinFirmware && + if (m_writer.get_gcode_flavor() == gcfMarlinFirmware && !m_config.machine_max_junction_deviation.values.empty() && m_config.machine_max_junction_deviation.values.front() > 0) { gcode += writer().set_junction_deviation(this->interpolate_value_across_layers(print.calib_params().start, print.calib_params().end)); @@ -6047,15 +6047,15 @@ LayerResult GCode::process_layer( if (first_layer) { // Orca: we don't need to optimize the Klipper as only set once if (NOZZLE_CONFIG(default_acceleration) > 0 && NOZZLE_CONFIG(initial_layer_acceleration) > 0) { - gcode += m_writer->set_print_acceleration((unsigned int)floor(NOZZLE_CONFIG(initial_layer_acceleration) + 0.5)); + gcode += m_writer.set_print_acceleration((unsigned int)floor(NOZZLE_CONFIG(initial_layer_acceleration) + 0.5)); } if (NOZZLE_CONFIG(default_jerk) > 0 && NOZZLE_CONFIG(initial_layer_jerk) > 0) { - gcode += m_writer->set_jerk_xy(NOZZLE_CONFIG(initial_layer_jerk)); + gcode += m_writer.set_jerk_xy(NOZZLE_CONFIG(initial_layer_jerk)); } - if (m_writer->get_gcode_flavor() == gcfMarlinFirmware && NOZZLE_CONFIG(default_junction_deviation) > 0) { - gcode += m_writer->set_junction_deviation(NOZZLE_CONFIG(default_junction_deviation)); + if (m_writer.get_gcode_flavor() == gcfMarlinFirmware && NOZZLE_CONFIG(default_junction_deviation) > 0) { + gcode += m_writer.set_junction_deviation(NOZZLE_CONFIG(default_junction_deviation)); } } @@ -6093,7 +6093,7 @@ LayerResult GCode::process_layer( if (past_first_layer_band && !m_second_layer_things_done) { // Orca: set power loss recovery const auto plr_mode = print.config().enable_power_loss_recovery.value; - gcode += m_writer->enable_power_loss_recovery(plr_mode); + gcode += m_writer.enable_power_loss_recovery(plr_mode); if (print.is_BBL_printer()) { // BBS: open first layer inspection at second layer @@ -6108,24 +6108,24 @@ LayerResult GCode::process_layer( // Reset acceleration at sencond layer // Orca: only set once, don't need to call set_accel_and_jerk if (NOZZLE_CONFIG(default_acceleration) > 0 && NOZZLE_CONFIG(initial_layer_acceleration) > 0) { - gcode += m_writer->set_print_acceleration((unsigned int) floor(NOZZLE_CONFIG(default_acceleration) + 0.5)); + gcode += m_writer.set_print_acceleration((unsigned int) floor(NOZZLE_CONFIG(default_acceleration) + 0.5)); } if (NOZZLE_CONFIG(default_jerk) > 0 && NOZZLE_CONFIG(initial_layer_jerk) > 0) { - gcode += m_writer->set_jerk_xy(NOZZLE_CONFIG(default_jerk)); + gcode += m_writer.set_jerk_xy(NOZZLE_CONFIG(default_jerk)); } // Transition from 1st to 2nd layer. Adjust nozzle temperatures as prescribed by the nozzle dependent // nozzle_temperature_initial_layer vs. temperature settings. - for (const Extruder& extruder : m_writer->extruders()) { + for (const Extruder& extruder : m_writer.extruders()) { if ((print.config().single_extruder_multi_material.value || m_ooze_prevention.enable) && - extruder.id() != m_writer->filament()->id()) + extruder.id() != m_writer.filament()->id()) // In single extruder multi material mode, set the temperature for the current extruder only. continue; size_t fi = get_filament_config_index((int)extruder.id()); int temperature = print.config().nozzle_temperature.get_at(fi); if (temperature > 0 && temperature != print.config().nozzle_temperature_initial_layer.get_at(fi)) - gcode += m_writer->set_temperature(temperature, false, extruder.id()); + gcode += m_writer.set_temperature(temperature, false, extruder.id()); } // BBS @@ -6134,14 +6134,14 @@ LayerResult GCode::process_layer( bed_temp = get_highest_bed_temperature(false,print); else bed_temp = get_bed_temperature(first_extruder_id, false, m_config.curr_bed_type); - gcode += m_writer->set_bed_temperature(bed_temp); + gcode += m_writer.set_bed_temperature(bed_temp); // Mark the temperature transition from 1st to 2nd layer to be finished. m_second_layer_things_done = true; } if (single_object_instance_idx == size_t(-1)) { // Normal (non-sequential) print. - gcode += ProcessLayer::emit_custom_gcode_per_print_z(*this, layer_tools.custom_gcode, m_writer->filament()->id(), first_extruder_id, print.config()); + gcode += ProcessLayer::emit_custom_gcode_per_print_z(*this, layer_tools.custom_gcode, m_writer.filament()->id(), first_extruder_id, print.config()); } // BBS: get next extruder according to flush and soluble @@ -6172,7 +6172,7 @@ LayerResult GCode::process_layer( return r->has_extrusions(); }); const bool enable_overhang_speed = std::any_of(regions.begin(), regions.end(), [this](const LayerRegion* r) { - return r->has_extrusions() && r->region().config().enable_overhang_speed.get_at(get_nozzle_config_index(m_writer->filament()->id())); + return r->has_extrusions() && r->region().config().enable_overhang_speed.get_at(get_nozzle_config_index(m_writer.filament()->id())); }); const bool enable_overhang_fan = m_enable_cooling_markers && has_extrusions && std::any_of(m_config.enable_overhang_bridge_fan.values.begin(), @@ -6622,16 +6622,16 @@ LayerResult GCode::process_layer( config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); config.set_key_value("most_used_physical_extruder_id", new ConfigOptionInt(m_config.physical_extruder_map.get_at(most_used_extruder))); - config.set_key_value("curr_physical_extruder_id", new ConfigOptionInt(m_config.physical_extruder_map.get_at(m_writer->filament()->extruder_id()))); - wrapping_gcode = this->placeholder_parser_process("wrapping_detection_gcode", print.config().wrapping_detection_gcode.value, m_writer->filament()->id(), &config) +"\n"; + config.set_key_value("curr_physical_extruder_id", new ConfigOptionInt(m_config.physical_extruder_map.get_at(m_writer.filament()->extruder_id()))); + wrapping_gcode = this->placeholder_parser_process("wrapping_detection_gcode", print.config().wrapping_detection_gcode.value, m_writer.filament()->id(), &config) +"\n"; } - m_writer->set_current_position_clear(false); + m_writer.set_current_position_clear(false); double temp_z_after_tool_change; if (GCodeProcessor::get_last_z_from_gcode(wrapping_gcode, temp_z_after_tool_change)) { - Vec3d pos = m_writer->get_position(); + Vec3d pos = m_writer.get_position(); pos(2) = temp_z_after_tool_change; - m_writer->set_position(pos); + m_writer.set_position(pos); } return wrapping_gcode; }; @@ -6716,7 +6716,7 @@ LayerResult GCode::process_layer( if (should_insert) { gcode += this->retract(false, false, auto_lift_type, true); - m_writer->add_object_change_labels(gcode); + m_writer.add_object_change_labels(gcode); gcode += insert_timelapse_gcode(); has_insert_timelapse_gcode = true; @@ -6736,7 +6736,7 @@ LayerResult GCode::process_layer( if (need_insert_timelapse_gcode_for_traditional && !has_insert_timelapse_gcode && !(m_farthest_point_timelapse.enabled && m_farthest_point_timelapse.farthest_is_photo_head) && - m_writer->need_toolchange(extruder_id) && + m_writer.need_toolchange(extruder_id) && m_config.nozzle_diameter.values.size() == 2 && writer().filament()) { bool curr_is_photo_head = get_extruder_id(writer().filament()->id()) == most_used_extruder; @@ -6744,7 +6744,7 @@ LayerResult GCode::process_layer( bool should_insert = is_case_b ? !curr_is_photo_head : curr_is_photo_head; if (should_insert) { gcode += this->retract(false, false, auto_lift_type, true); - m_writer->add_object_change_labels(gcode); + m_writer.add_object_change_labels(gcode); gcode += insert_timelapse_gcode(); has_insert_timelapse_gcode = true; @@ -6831,19 +6831,19 @@ LayerResult GCode::process_layer( // exclude objects if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer->set_object_start_str( + m_writer.set_object_start_str( std::string("; start printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M624 " + _encode_label_ids_to_base64({instance_to_print.label_object_id}) + "\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer->set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + + m_writer.set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { std::string str = std::string("M486 S") + std::to_string(inst.unique_id) + "\n"; - m_writer->set_object_start_str(str); + m_writer.set_object_start_str(str); } } } @@ -6984,20 +6984,20 @@ LayerResult GCode::process_layer( } // exclude objects // Don't set m_gcode_label_objects_end if you don't had to write the m_gcode_label_objects_start. - if (!m_writer->is_object_start_str_empty()) { - m_writer->set_object_start_str(""); + if (!m_writer.is_object_start_str_empty()) { + m_writer.set_object_start_str(""); } else if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer->set_object_end_str(std::string("; stop printing object, unique label id: ") + + m_writer.set_object_end_str(std::string("; stop printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M625\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer->set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + + m_writer.set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { - m_writer->set_object_end_str(std::string("M486 S-1\n")); + m_writer.set_object_end_str(std::string("M486 S-1\n")); } } } @@ -7062,17 +7062,17 @@ LayerResult GCode::process_layer( } if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer->set_object_start_str( + m_writer.set_object_start_str( std::string("; start printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M624 " + _encode_label_ids_to_base64({instance_to_print.label_object_id}) + "\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer->set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + + m_writer.set_object_start_str(std::string("EXCLUDE_OBJECT_START NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { - m_writer->set_object_start_str(std::string("M486 S") + std::to_string(inst.unique_id) + "\n"); + m_writer.set_object_start_str(std::string("M486 S") + std::to_string(inst.unique_id) + "\n"); } } } @@ -7284,20 +7284,20 @@ LayerResult GCode::process_layer( } // --- Shared instance footer (mirrors Orca's main instance loop) --- - if (!m_writer->is_object_start_str_empty()) { - m_writer->set_object_start_str(""); + if (!m_writer.is_object_start_str_empty()) { + m_writer.set_object_start_str(""); } else if (m_enable_exclude_object) { if (is_BBL_Printer()) { - m_writer->set_object_end_str(std::string("; stop printing object, unique label id: ") + + m_writer.set_object_end_str(std::string("; stop printing object, unique label id: ") + std::to_string(instance_to_print.label_object_id) + "\n" + "M625\n"); } else { const auto gflavor = print.config().gcode_flavor.value; if (gflavor == gcfKlipper) { - m_writer->set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + + m_writer.set_object_end_str(std::string("EXCLUDE_OBJECT_END NAME=") + get_instance_name(&instance_to_print.print_object, inst.id) + "\n"); } else if (gflavor == gcfMarlinLegacy || gflavor == gcfMarlinFirmware || gflavor == gcfRepRapFirmware) { - m_writer->set_object_end_str(std::string("M486 S-1\n")); + m_writer.set_object_end_str(std::string("M486 S-1\n")); } } } @@ -7310,7 +7310,7 @@ LayerResult GCode::process_layer( // wipe tower's add_object_end_labels may consume it into a local temp string and the // M625 would be lost for BBL printers. if (!layer_tools.mixed_sub_layer_groups.empty()) { - m_writer->add_object_end_labels(gcode); + m_writer.add_object_end_labels(gcode); m_nominal_z = print_z; m_need_change_layer_lift_z = true; } @@ -7339,7 +7339,7 @@ LayerResult GCode::process_layer( for (size_t instance_id = i_begin; instance_id < i_end && instance_id < obj->instances().size(); ++ instance_id) { if (! belt_brim_emitted.insert({ ltp_idx, instance_id }).second) continue; - if (m_writer->filament() == nullptr || m_writer->filament()->id() != brim0) + if (m_writer.filament() == nullptr || m_writer.filament()->id() != brim0) gcode += this->set_extruder(brim0, print_z); gcode += generate_object_brim(print, *obj, instance_id, first_layer, ltp.object_layer); } @@ -7386,7 +7386,7 @@ LayerResult GCode::process_layer( if (FILAMENT_CONFIG(retract_when_changing_layer)) { gcode += this->retract(false, false, auto_lift_type, true); } - m_writer->add_object_change_labels(gcode); + m_writer.add_object_change_labels(gcode); gcode += insert_timelapse_gcode(); has_insert_timelapse_gcode = true; } @@ -7408,7 +7408,7 @@ LayerResult GCode::process_layer( if (FILAMENT_CONFIG(retract_when_changing_layer)) { gcode += this->retract(false, false, auto_lift_type, true); } - m_writer->add_object_change_labels(gcode); + m_writer.add_object_change_labels(gcode); gcode += insert_timelapse_gcode(); } @@ -7420,7 +7420,7 @@ LayerResult GCode::process_layer( void GCode::apply_print_config(const PrintConfig &print_config) { - m_writer->apply_print_config(print_config); + m_writer.apply_print_config(print_config); m_config.apply(print_config); m_scaled_resolution = scaled(print_config.resolution.value); m_enable_exclude_object = m_config.exclude_object; @@ -7544,7 +7544,7 @@ void GCode::append_full_config(const Print &print, std::string &str) void GCode::set_extruders(const std::vector &extruder_ids) { - m_writer->set_extruders(extruder_ids); + m_writer.set_extruders(extruder_ids); // enable wipe path generation if any extruder has wipe enabled m_wipe.enable = false; @@ -7569,13 +7569,13 @@ void GCode::set_origin(const Vec2d &pointf) std::string GCode::preamble() { - std::string gcode = m_writer->preamble(); + std::string gcode = m_writer.preamble(); /* Perform a *silent* move to z_offset: we need this to initialize the Z position of our writer object so that any initial lift taking place before the first layer change will raise the extruder from the correct initial Z instead of 0. */ - m_writer->travel_to_z(m_config.z_offset.value); + m_writer.travel_to_z(m_config.z_offset.value); return gcode; } @@ -7586,28 +7586,28 @@ std::string GCode::change_layer(coordf_t print_z) std::string gcode; if (m_layer_count > 0) // Increment a progress bar indicator. - gcode += m_writer->update_progress(++ m_layer_index, m_layer_count); + gcode += m_writer.update_progress(++ m_layer_index, m_layer_count); //BBS coordf_t z = print_z + m_config.z_offset.value; // in unscaled coordinates - if (FILAMENT_CONFIG(retract_when_changing_layer) && m_writer->will_move_z(z)) { + if (FILAMENT_CONFIG(retract_when_changing_layer) && m_writer.will_move_z(z)) { LiftType lift_type = this->to_lift_type(ZHopType(FILAMENT_CONFIG(z_hop_types))); //BBS: force to use SpiralLift when change layer if lift type is auto gcode += this->retract(false, false, ZHopType(FILAMENT_CONFIG(z_hop_types)) == ZHopType::zhtAuto ? LiftType::SpiralLift : lift_type); } - m_writer->add_object_change_labels(gcode); + m_writer.add_object_change_labels(gcode); if (m_spiral_vase) { //BBS: force to normal lift immediately in spiral vase mode std::ostringstream comment; comment << "move to next layer (" << m_layer_index << ")"; - gcode += m_writer->travel_to_z(z, comment.str()); + gcode += m_writer.travel_to_z(z, comment.str()); } m_need_change_layer_lift_z = true; m_nominal_z = z; - m_writer->get_position().z() = z; + m_writer.get_position().z() = z; // forget last wiping path as wiping after raising Z is pointless // BBS. Dont forget wiping path to reduce stringing. @@ -7933,7 +7933,7 @@ std::string GCode::extrude_loop(const ExtrusionLoop& loop_ref, const Point3 ¢er3 = paths.front().polyline.points.front(); pt.rotate(angle, Point(center3.x(), center3.y())); // generate the travel move - gcode += m_writer->extrude_to_xy(this->point_to_gcode(pt), 0, "move inwards before travel", true); + gcode += m_writer.extrude_to_xy(this->point_to_gcode(pt), 0, "move inwards before travel", true); } return gcode; @@ -8295,7 +8295,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, bool slope_need_z_travel = false; if (sloped != nullptr && !sloped->is_flat()) { auto target_z = get_sloped_z(sloped->slope_begin.z_ratio); - slope_need_z_travel = m_writer->will_move_z(target_z); + slope_need_z_travel = m_writer.will_move_z(target_z); } // Move to first point of extrusion path // path is 2D. But in slope lift case, lift z is done in travel_to function. @@ -8323,14 +8323,14 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } if (path.z_contoured && !path.polyline.lines().empty()) { - double current_z = m_writer->get_position().z(); + double current_z = m_writer.get_position().z(); double first_z = unscale_(path.polyline.lines().begin()->a.z()) + m_nominal_z; if (GCodeFormatter::quantize_xyzf(first_z) != GCodeFormatter::quantize_xyzf(current_z)) { - gcode += m_writer->travel_to_z(first_z, "set Z for contouring", true); + gcode += m_writer.travel_to_z(first_z, "set Z for contouring", true); } } if (!path.z_contoured && sloped == nullptr) { - double current_z = m_writer->get_position().z(); + double current_z = m_writer.get_position().z(); if (GCodeFormatter::quantize_xyzf(current_z) != GCodeFormatter::quantize_xyzf(m_nominal_z)) { gcode += this->writer().travel_to_z(m_nominal_z, "reset Z after contouring", true); } @@ -8338,7 +8338,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // if needed, write the gcode_label_objects_end then gcode_label_objects_start // should be already done by travel_to, but just in case - m_writer->add_object_change_labels(gcode); + m_writer.add_object_change_labels(gcode); // compensate retraction gcode += this->unretract(); @@ -8356,12 +8356,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } else if (this->object_layer_over_raft() && m_config.first_layer_acceleration_over_raft.value > 0) { acceleration = m_config.first_layer_acceleration_over_raft.value; #endif - } else if (m_config.get_abs_value_at("bridge_acceleration", get_nozzle_config_index(m_writer->filament()->id())) > 0 && is_bridge(path.role())) { - acceleration = m_config.get_abs_value_at("bridge_acceleration", get_nozzle_config_index(m_writer->filament()->id())); - } else if (m_config.get_abs_value_at("sparse_infill_acceleration", get_nozzle_config_index(m_writer->filament()->id())) > 0 && (path.role() == erInternalInfill)) { - acceleration = m_config.get_abs_value_at("sparse_infill_acceleration", get_nozzle_config_index(m_writer->filament()->id())); - } else if (m_config.get_abs_value_at("internal_solid_infill_acceleration", get_nozzle_config_index(m_writer->filament()->id())) > 0 && (path.role() == erSolidInfill)) { - acceleration = m_config.get_abs_value_at("internal_solid_infill_acceleration", get_nozzle_config_index(m_writer->filament()->id())); + } else if (m_config.get_abs_value_at("bridge_acceleration", get_nozzle_config_index(m_writer.filament()->id())) > 0 && is_bridge(path.role())) { + acceleration = m_config.get_abs_value_at("bridge_acceleration", get_nozzle_config_index(m_writer.filament()->id())); + } else if (m_config.get_abs_value_at("sparse_infill_acceleration", get_nozzle_config_index(m_writer.filament()->id())) > 0 && (path.role() == erInternalInfill)) { + acceleration = m_config.get_abs_value_at("sparse_infill_acceleration", get_nozzle_config_index(m_writer.filament()->id())); + } else if (m_config.get_abs_value_at("internal_solid_infill_acceleration", get_nozzle_config_index(m_writer.filament()->id())) > 0 && (path.role() == erSolidInfill)) { + acceleration = m_config.get_abs_value_at("internal_solid_infill_acceleration", get_nozzle_config_index(m_writer.filament()->id())); } else if (NOZZLE_CONFIG(outer_wall_acceleration) > 0 && is_external_perimeter(path.role())) { acceleration = NOZZLE_CONFIG(outer_wall_acceleration); } else if (NOZZLE_CONFIG(inner_wall_acceleration) > 0 && is_internal_perimeter(path.role())) { @@ -8392,12 +8392,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } } - if (m_writer->get_gcode_flavor() == gcfKlipper) { - gcode += m_writer->set_accel_and_jerk(acceleration_i, jerk); + if (m_writer.get_gcode_flavor() == gcfKlipper) { + gcode += m_writer.set_accel_and_jerk(acceleration_i, jerk); } else { - gcode += m_writer->set_print_acceleration(acceleration_i); - gcode += m_writer->set_jerk_xy(jerk); + gcode += m_writer.set_print_acceleration(acceleration_i); + gcode += m_writer.set_jerk_xy(jerk); } // calculate effective extrusion length per distance unit (e_per_mm) @@ -8453,8 +8453,8 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } // Effective extrusion length per distance unit = (filament_flow_ratio/cross_section) * mm3_per_mm / print flow ratio - // m_writer->extruder()->e_per_mm3() below is (filament flow ratio / cross-sectional area) - double e_per_mm = m_writer->filament()->e_per_mm3() * _mm3_per_mm; + // m_writer.extruder()->e_per_mm3() below is (filament flow ratio / cross-sectional area) + double e_per_mm = m_writer.filament()->e_per_mm3() * _mm3_per_mm; e_per_mm /= filament_flow_ratio; // set speed @@ -8470,7 +8470,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, speed = std::min(speed, m_config.scarf_joint_speed.get_abs_value(speed)); } } else if(path.role() == erInternalBridgeInfill) { - speed = m_config.get_abs_value_at("internal_bridge_speed", get_nozzle_config_index(m_writer->filament()->id())); + speed = m_config.get_abs_value_at("internal_bridge_speed", get_nozzle_config_index(m_writer.filament()->id())); } else if (path.role() == erOverhangPerimeter || path.role() == erSupportTransition || path.role() == erBridgeInfill) { speed = NOZZLE_CONFIG(bridge_speed); } else if (path.role() == erInternalInfill) { @@ -8480,7 +8480,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } else if (path.role() == erTopSolidInfill) { speed = NOZZLE_CONFIG(top_surface_speed); } else if (path.role() == erIroning) { - const size_t filament_idx = get_filament_config_index(m_writer->filament()->id()); + const size_t filament_idx = get_filament_config_index(m_writer.filament()->id()); speed = m_config.filament_ironing_speed.is_nil(filament_idx) ? m_config.get_abs_value("ironing_speed") : m_config.filament_ironing_speed.get_at(filament_idx); @@ -8513,7 +8513,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // "first layers" the fan stays off for are a band along the belt. Mark where the // extrusion enters and leaves it, per segment, for the cooling buffer. const bool belt_band_tags = m_enable_cooling_markers && m_config.belt_printer.value; - const int belt_band_layers = belt_band_tags ? m_config.close_fan_the_first_x_layers.get_at(m_writer->filament()->id()) : 0; + const int belt_band_layers = belt_band_tags ? m_config.close_fan_the_first_x_layers.get_at(m_writer.filament()->id()) : 0; auto tag_belt_band = [this, &gcode, belt_band_tags, belt_band_layers, z = path_point_mm.z()](coord_t x, coord_t y) { if (! belt_band_tags) return; @@ -8713,7 +8713,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, //Orca: process custom gcode for extrusion role change if (path.role() != m_last_extrusion_role) { - const auto current_filament_id = m_writer->filament()->id(); + const auto current_filament_id = m_writer.filament()->id(); const std::string& machine_role_change_gcode = m_config.change_extrusion_role_gcode.value; const std::string& filament_role_change_gcode = m_config.filament_change_extrusion_role_gcode.get_at(current_filament_id); const std::string& process_role_change_gcode = m_config.process_change_extrusion_role_gcode.value; @@ -8788,7 +8788,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, if (m_multi_flow_segment_path_average_mm3_per_mm > 0) { sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer->filament()->id(), + m_writer.filament()->id(), m_multi_flow_segment_path_average_mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -8801,7 +8801,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // to issue a zero flow PA change command for this sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer->filament()->id(), + m_writer.filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -8900,7 +8900,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, return; // Inline M971 only when current extruder is the photo head; other nozzles may pass through nearby // coordinates but their physical position differs. - if (!m_writer->filament() || get_extruder_id(m_writer->filament()->id()) != m_farthest_point_timelapse.most_used_extruder) + if (!m_writer.filament() || get_extruder_id(m_writer.filament()->id()) != m_farthest_point_timelapse.most_used_extruder) return; // Compare in the global print frame to match farthest_gcode_pos, which is unscale(farthest_point) // without the per-extruder nozzle offset. Using point_to_gcode() here would subtract extruder_offset @@ -8939,7 +8939,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer->filament()->id(), + m_writer.filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -8954,7 +8954,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer->filament()->id(), + m_writer.filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -8969,7 +8969,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // ORCA: End of adaptive PA code segment } - gcode += m_writer->set_speed(F, "", comment); + gcode += m_writer.set_speed(F, "", comment); { if (m_enable_cooling_markers) { if (enable_overhang_bridge_fan) { @@ -8990,7 +8990,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, if (!m_config.enable_arc_fitting || path.polyline.fitting_result.empty() || m_config.spiral_mode || sloped != nullptr || path.z_contoured || this->should_disable_arc_fitting()) { double path_length = 0.; double total_length = sloped == nullptr ? 0. : path.polyline.length() * SCALING_FACTOR; - double saved_z = m_writer->get_position().z(); + double saved_z = m_writer.get_position().z(); for (const Line3& line : path.polyline.lines()) { std::string tempDescription = description; @@ -9024,12 +9024,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, if (z < 0.1) { throw RuntimeError("GCode: very low z"); } - gcode += m_writer->extrude_to_xyz(Vec3d(dest2d.x(), dest2d.y(), z), e, + gcode += m_writer.extrude_to_xyz(Vec3d(dest2d.x(), dest2d.y(), z), e, GCodeWriter::full_gcode_comment ? tempDescription : ""); } else if (sloped == nullptr) { // Normal extrusion - gcode += m_writer->extrude_to_xy( + gcode += m_writer.extrude_to_xy( this->point_to_gcode(line.b.to_point()), dE, GCodeWriter::full_gcode_comment ? tempDescription : "", path.is_force_no_extrusion()); @@ -9038,7 +9038,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, const auto [z_ratio, e_ratio] = sloped->interpolate(path_length / total_length); Vec2d dest2d = this->point_to_gcode(line.b.to_point()); Vec3d dest3d(dest2d(0), dest2d(1), get_sloped_z(z_ratio)); - gcode += m_writer->extrude_to_xyz( + gcode += m_writer.extrude_to_xyz( dest3d, dE * e_ratio, GCodeWriter::full_gcode_comment ? tempDescription : "", path.is_force_no_extrusion()); @@ -9069,7 +9069,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, tempDescription += Slic3r::format(" | Old Flow Value: %0.5f Length: %0.5f",oldE, line_length); } } - gcode += m_writer->extrude_to_xy( + gcode += m_writer.extrude_to_xy( this->point_to_gcode(line.b), dE, GCodeWriter::full_gcode_comment ? tempDescription : "", path.is_force_no_extrusion()); @@ -9093,7 +9093,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, tempDescription += Slic3r::format(" | Old Flow Value: %0.5f Length: %0.5f",oldE, arc_length); } } - gcode += m_writer->extrude_arc_to_xy( + gcode += m_writer.extrude_arc_to_xy( this->point_to_gcode(arc.end_point), center_offset, dE, @@ -9122,7 +9122,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, Polyline3 l(p); total_length = l.length() * SCALING_FACTOR; } - gcode += m_writer->set_speed(last_set_speed, "", comment); + gcode += m_writer.set_speed(last_set_speed, "", comment); Vec3d prev = this->point_to_gcode_quantized(new_points[0].p); bool pre_fan_enabled = false; bool cur_fan_enabled = false; @@ -9173,7 +9173,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer->filament()->id(), + m_writer.filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -9188,7 +9188,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } sprintf(buf, ";%sT%u MM3MM:%g ACCEL:%u BR:%d RC:%d OV:%d\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::PA_Change).c_str(), - m_writer->filament()->id(), + m_writer.filament()->id(), _mm3_per_mm, acceleration_i, ((path.role() == erBridgeInfill) ||(path.role() == erOverhangPerimeter)), @@ -9205,10 +9205,10 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, // Ignore small speed variations - emit speed change if the delta between current and new is greater than 60mm/min / 1mm/sec // Reset speed to F if delta to F is less than 1mm/sec if ((std::abs(last_set_speed - new_speed) > 60)) { - gcode += m_writer->set_speed(new_speed, "", comment); + gcode += m_writer.set_speed(new_speed, "", comment); last_set_speed = new_speed; } else if ((std::abs(F - new_speed) <= 60)) { - gcode += m_writer->set_speed(F, "", comment); + gcode += m_writer.set_speed(F, "", comment); last_set_speed = F; } auto dE = e_per_mm * line_length; @@ -9235,16 +9235,16 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, if (z < 0.1) { throw RuntimeError("GCode: very low z"); } - gcode += m_writer->extrude_to_xyz(Vec3d(dest2d.x(), dest2d.y(), z), e, + gcode += m_writer.extrude_to_xyz(Vec3d(dest2d.x(), dest2d.y(), z), e, GCodeWriter::full_gcode_comment ? tempDescription : ""); } else if (sloped == nullptr) { // Normal extrusion - gcode += m_writer->extrude_to_xy(p.head<2>(), dE, GCodeWriter::full_gcode_comment ? tempDescription : ""); + gcode += m_writer.extrude_to_xy(p.head<2>(), dE, GCodeWriter::full_gcode_comment ? tempDescription : ""); } else { // Sloped extrusion const auto [z_ratio, e_ratio] = sloped->interpolate(path_length / total_length); Vec3d dest3d(p(0), p(1), get_sloped_z(z_ratio)); - gcode += m_writer->extrude_to_xyz(dest3d, dE * e_ratio, GCodeWriter::full_gcode_comment ? tempDescription : ""); + gcode += m_writer.extrude_to_xyz(dest3d, dE * e_ratio, GCodeWriter::full_gcode_comment ? tempDescription : ""); } // Inline farthest-point snapshot on the variable-speed emission path. Inert unless the @@ -9384,8 +9384,8 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string unsigned int acceleration_to_set = 0; if (this->on_first_layer()) { - unsigned int initial_layer_travel_acceleration = m_config.get_abs_value_at("initial_layer_travel_acceleration", get_nozzle_config_index(m_writer->filament()->id())); - double initial_layer_travel_jerk = m_config.get_abs_value_at("initial_layer_travel_jerk", get_nozzle_config_index(m_writer->filament()->id())); + unsigned int initial_layer_travel_acceleration = m_config.get_abs_value_at("initial_layer_travel_acceleration", get_nozzle_config_index(m_writer.filament()->id())); + double initial_layer_travel_jerk = m_config.get_abs_value_at("initial_layer_travel_jerk", get_nozzle_config_index(m_writer.filament()->id())); if (NOZZLE_CONFIG(default_acceleration) > 0 && initial_layer_travel_acceleration > 0) { acceleration_to_set = (unsigned int) floor(initial_layer_travel_acceleration + 0.5); @@ -9398,7 +9398,7 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string if (NOZZLE_CONFIG(default_acceleration) > 0) { if (role == erOverhangPerimeter && is_short_travel) { - const double bridge_acceleration = m_config.get_abs_value_at("bridge_acceleration", get_nozzle_config_index(m_writer->filament()->id())); + const double bridge_acceleration = m_config.get_abs_value_at("bridge_acceleration", get_nozzle_config_index(m_writer.filament()->id())); if (bridge_acceleration > 0) acceleration_to_set = (unsigned int) floor(bridge_acceleration + 0.5); @@ -9422,11 +9422,11 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string } } - if (m_writer->get_gcode_flavor() == gcfKlipper) { - gcode += m_writer->set_accel_and_jerk(acceleration_to_set, jerk_to_set); + if (m_writer.get_gcode_flavor() == gcfKlipper) { + gcode += m_writer.set_accel_and_jerk(acceleration_to_set, jerk_to_set); } else { - gcode += m_writer->set_travel_acceleration(acceleration_to_set); - gcode += m_writer->set_jerk_xy(jerk_to_set); + gcode += m_writer.set_travel_acceleration(acceleration_to_set); + gcode += m_writer.set_jerk_xy(jerk_to_set); } // if a retraction would be needed, try to use reduce_crossing_wall to plan a @@ -9434,7 +9434,7 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string if (m_config.reduce_crossing_wall && !m_avoid_crossing_perimeters.disabled_once() && m_layer != nullptr // A brim apron layer has no Layer to avoid crossing - && m_writer->is_current_position_clear()) + && m_writer.is_current_position_clear()) //BBS: don't generate detour travel paths when current position is unclea { travel = m_avoid_crossing_perimeters.travel_to(*this, point, &could_be_wipe_disabled); @@ -9482,7 +9482,7 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string // if needed, write the gcode_label_objects_end then gcode_label_objects_start - m_writer->add_object_change_labels(gcode); + m_writer.add_object_change_labels(gcode); // use G1 because we rely on paths being straight (G0 may make round paths) if (travel.size() >= 2) { @@ -9490,14 +9490,14 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string if (false/*m_spiral_vase*/) { // No lazy z lift for spiral vase mode for (size_t i = 1; i < travel.size(); ++i) { - gcode += m_writer->travel_to_xy(this->point_to_gcode(travel.points[i]), comment); + gcode += m_writer.travel_to_xy(this->point_to_gcode(travel.points[i]), comment); } } else { if (travel.size() == 2) { // No extra movements emitted by avoid_crossing_perimeters, simply move to the end point with z change const auto& dest2d = this->point_to_gcode(travel.points.back()); Vec3d dest3d(dest2d(0), dest2d(1), z == DBL_MAX ? m_nominal_z : z); - gcode += m_writer->travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); + gcode += m_writer.travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); m_need_change_layer_lift_z = false; } else { // Extra movements emitted by avoid_crossing_perimeters, lift the z to normal height at the beginning, then apply the z @@ -9507,16 +9507,16 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string // Lift to normal z at beginning Vec2d dest2d = this->point_to_gcode(travel.points[i]); Vec3d dest3d(dest2d(0), dest2d(1), m_nominal_z); - gcode += m_writer->travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); + gcode += m_writer.travel_to_xyz(dest3d, comment, m_need_change_layer_lift_z); m_need_change_layer_lift_z = false; } else if (z != DBL_MAX && i == travel.size() - 1) { // Apply z_ratio for the very last point Vec2d dest2d = this->point_to_gcode(travel.points[i]); Vec3d dest3d(dest2d(0), dest2d(1), z); - gcode += m_writer->travel_to_xyz(dest3d, comment); + gcode += m_writer.travel_to_xyz(dest3d, comment); } else { // For all points in between, no z change - gcode += m_writer->travel_to_xy(this->point_to_gcode(travel.points[i]), comment); + gcode += m_writer.travel_to_xy(this->point_to_gcode(travel.points[i]), comment); } } } @@ -9619,7 +9619,7 @@ bool GCode::needs_retraction(const Polyline &travel, ExtrusionRole role, LiftTyp if (clipped_travel.length() > travel_len_thresh) clipped_travel.points.back() = clipped_travel.points.front()+(clipped_travel.points.back() - clipped_travel.points.front()) * (travel_len_thresh / clipped_travel.length()); //BBS: translate to current plate coordinate system - clipped_travel.translate(Point::new_scale(double(m_origin.x() - m_writer->get_xy_offset().x()), double(m_origin.y() - m_writer->get_xy_offset().y()))); + clipped_travel.translate(Point::new_scale(double(m_origin.x() - m_writer.get_xy_offset().x()), double(m_origin.y() - m_writer.get_xy_offset().y()))); //BBS: force to retract when leave from external perimeter for a long travel //Better way is judging whether the travel move direction is same with last extrusion move. @@ -9671,18 +9671,18 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li { std::string gcode; - if (m_writer->filament() == nullptr) + if (m_writer.filament() == nullptr) return gcode; // wipe (if it's enabled for this extruder and we have a stored wipe path and no-zero wipe distance) if (FILAMENT_CONFIG(wipe) && m_wipe.has_path() && scale_(FILAMENT_CONFIG(wipe_distance)) > SCALED_EPSILON) { Wipe::RetractionValues wipeRetractions = m_wipe.calculateWipeRetractionLengths(*this, toolchange); - gcode += toolchange ? m_writer->retract_for_toolchange(true, wipeRetractions.retraction_length_before_wipe) : - m_writer->retract(true, wipeRetractions.retraction_length_before_wipe); + gcode += toolchange ? m_writer.retract_for_toolchange(true, wipeRetractions.retraction_length_before_wipe) : + m_writer.retract(true, wipeRetractions.retraction_length_before_wipe); gcode += m_wipe.wipe(*this, wipeRetractions.retraction_length_during_wipe, toolchange, is_last_retraction); // Orca: wipeRetractions.retraction_length_after_wipe is not being used explicitly, - // the remaining retraction after wipe is handled by the subsequent m_writer->retract() call + // the remaining retraction after wipe is handled by the subsequent m_writer.retract() call } /* The parent class will decide whether we need to perform an actual retraction @@ -9691,14 +9691,14 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li length is honored in case wipe path was too short. */ if ((!this->on_first_layer() || this->config().bottom_surface_pattern != InfillPattern::ipHilbertCurve) && (role != erTopSolidInfill || this->config().top_surface_pattern != InfillPattern::ipHilbertCurve)) - gcode += toolchange ? m_writer->retract_for_toolchange() : m_writer->retract(); + gcode += toolchange ? m_writer.retract_for_toolchange() : m_writer.retract(); - gcode += m_writer->reset_e(); + gcode += m_writer.reset_e(); // Orca: check if should + can lift (roughly from SuperSlicer) RetractLiftEnforceType retract_lift_type = RetractLiftEnforceType(EXTRUDER_CONFIG(retract_lift_enforce)); bool needs_lift = toolchange - || m_writer->filament()->retraction_length() > 0 + || m_writer.filament()->retraction_length() > 0 || m_config.use_firmware_retraction; bool last_fill_extrusion_role_top_infill = (this->m_last_notgapfill_extrusion_role == ExtrusionRole::erTopSolidInfill || this->m_last_notgapfill_extrusion_role == ExtrusionRole::erIroning); @@ -9721,9 +9721,9 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li if (needs_lift && can_lift) { if (apply_instantly) - gcode += m_writer->eager_lift(lift_type); + gcode += m_writer.eager_lift(lift_type); else - gcode += m_writer->lazy_lift(lift_type, m_spiral_vase != nullptr); + gcode += m_writer.lazy_lift(lift_type, m_spiral_vase != nullptr); } return gcode; @@ -9744,9 +9744,9 @@ void GCode::update_layer_related_config(int layer_id){ m_config.filament_volume_map.values = volume_map; m_config.filament_nozzle_map.values = nozzle_map; - m_writer->config.filament_map.values = extruder_map; - m_writer->config.filament_volume_map.values = volume_map; - m_writer->config.filament_nozzle_map.values = nozzle_map; + m_writer.config.filament_map.values = extruder_map; + m_writer.config.filament_volume_map.values = volume_map; + m_writer.config.filament_nozzle_map.values = nozzle_map; } @@ -9813,11 +9813,11 @@ void GCode::update_placeholder_parser_with_variant_params() std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bool by_object, int toolchange_temp_override, bool defer_temp_wait) { int new_extruder_id = get_extruder_id(new_filament_id); - if (!m_writer->need_toolchange(new_filament_id)) + if (!m_writer.need_toolchange(new_filament_id)) return ""; // if we are running a single-extruder setup, just set the extruder and return nothing - if (!m_writer->multiple_extruders) { + if (!m_writer.multiple_extruders) { this->placeholder_parser().set("current_extruder", new_filament_id); // Orca: keep the global current-tool identity coherent even on the single-extruder path (see append_tcr). this->placeholder_parser().set("current_filament_id", (int) new_filament_id); @@ -9851,14 +9851,14 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo check_add_eol(gcode); } if (m_config.enable_pressure_advance.get_at(new_filament_id)) { - gcode += m_writer->set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); + gcode += m_writer.set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); // Orca: Adaptive PA // Reset Adaptive PA processor last PA value m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(new_filament_id)); } - gcode += m_writer->toolchange(new_filament_id, new_extruder_id); - if (Extruder *fil = m_writer->filament()) + gcode += m_writer.toolchange(new_filament_id, new_extruder_id); + if (Extruder *fil = m_writer.filament()) fil->set_config_index((int)get_filament_config_index((int)fil->id())); return gcode; } @@ -9874,18 +9874,18 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo // BBS: insert skip object label before change filament while by object if (by_object) - m_writer->add_object_change_labels(gcode); + m_writer.add_object_change_labels(gcode); bool add_change_filament_624 = false; - if (m_writer->filament() != nullptr) { + if (m_writer.filament() != nullptr) { // Process the custom filament_end_gcode. set_extruder() is only called if there is no wipe tower // so it should not be injected twice. - unsigned int old_filament_id = m_writer->filament()->id(); + unsigned int old_filament_id = m_writer.filament()->id(); const std::string &filament_end_gcode = m_config.filament_end_gcode.get_at(old_filament_id); if (! filament_end_gcode.empty()) { DynamicConfig config; config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); - config.set_key_value("layer_z", new ConfigOptionFloat(m_writer->get_position().z() - m_config.z_offset.value)); + config.set_key_value("layer_z", new ConfigOptionFloat(m_writer.get_position().z() - m_config.z_offset.value)); config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); config.set_key_value("filament_extruder_id", new ConfigOptionInt(int(get_extruder_id(old_filament_id)))); if (!m_filament_instances_code.empty()) { @@ -9901,7 +9901,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo // If ooze prevention is enabled, park current extruder in the nearest // standby point and set it to the standby temperature. - if (m_ooze_prevention.enable && m_writer->filament() != nullptr) + if (m_ooze_prevention.enable && m_writer.filament() != nullptr) gcode += m_ooze_prevention.pre_toolchange(*this); // BBS @@ -9932,10 +9932,10 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo if (toolchange_temp_override <= 0 && (m_layer == nullptr || preheat_temp <= 0)) preheat_temp = m_config.nozzle_temperature_initial_layer.get_at(new_fi); if (preheat_temp > 0) - gcode += m_writer->set_temperature(preheat_temp, false, new_filament_id); + gcode += m_writer.set_temperature(preheat_temp, false, new_filament_id); } - Vec3d nozzle_pos = m_writer->get_position(); + Vec3d nozzle_pos = m_writer.get_position(); float old_retract_length, old_retract_length_toolchange, wipe_volume; int old_filament_temp, old_filament_e_feedrate; @@ -9943,16 +9943,16 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo //BBS: add handling for filament change in start gcode int old_filament_id = -1; int old_extruder_id = -1; - if (m_writer->filament() != nullptr || m_start_gcode_filament != -1) { + if (m_writer.filament() != nullptr || m_start_gcode_filament != -1) { std::vector flush_matrix(cast(get_flush_volumes_matrix(m_config.flush_volumes_matrix.values, new_extruder_id, m_config.nozzle_diameter.values.size()))); const unsigned int number_of_extruders = (unsigned int) (m_config.filament_colour.values.size()); // if is multi_extruder only use the fist extruder matrix - if (m_writer->filament() != nullptr) - assert(m_writer->filament()->id() < number_of_extruders); + if (m_writer.filament() != nullptr) + assert(m_writer.filament()->id() < number_of_extruders); else assert(m_start_gcode_filament < number_of_extruders); - old_filament_id = m_writer->filament() != nullptr ? m_writer->filament()->id() : m_start_gcode_filament; - old_extruder_id = m_writer->filament() != nullptr ? m_writer->filament()->extruder_id() : get_extruder_id(m_start_gcode_filament); + old_filament_id = m_writer.filament() != nullptr ? m_writer.filament()->id() : m_start_gcode_filament; + old_extruder_id = m_writer.filament() != nullptr ? m_writer.filament()->extruder_id() : get_extruder_id(m_start_gcode_filament); // Resolving the old filament at the current layer is safe: the per-layer nozzle maps are // gap-filled carry-forward, so its current-layer column matches the nozzle it occupies. @@ -9965,7 +9965,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo float grab_purge_volume = m_config.grab_length.get_at(new_extruder_id) * 2.4; if (old_extruder_id != new_extruder_id) { //calc flush volume between the same extruder id - int old_filament_id_in_new_extruder = m_writer->filament(new_extruder_id) != nullptr ? m_writer->filament(new_extruder_id)->id() : -1; + int old_filament_id_in_new_extruder = m_writer.filament(new_extruder_id) != nullptr ? m_writer.filament(new_extruder_id)->id() : -1; if (old_filament_id_in_new_extruder == -1) wipe_volume = 0; else { @@ -10030,7 +10030,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo (old_filament_id != -1) ? (float) m_config.filament_retract_length_nc.get_at(get_filament_config_index(old_filament_id)) : 0.f)); // Current parked-retract length of the incoming filament's extruder. dyn_config.set_key_value("new_extruder_retracted_length", - new ConfigOptionFloat(m_writer->get_extruder_retracted_length((int) new_filament_id))); + new ConfigOptionFloat(m_writer.get_extruder_retracted_length((int) new_filament_id))); dyn_config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index)); dyn_config.set_key_value("layer_z", new ConfigOptionFloat(print_z)); dyn_config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z)); @@ -10149,13 +10149,13 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo //BBS: gcode writer doesn't know where the extruder is and whether fan speed is changed after inserting tool change gcode //Set this flag so that normal lift will be used the first time after tool change. gcode += ";_FORCE_RESUME_FAN_SPEED\n"; - m_writer->set_current_position_clear(false); + m_writer.set_current_position_clear(false); //BBS: check whether custom gcode changes the z position. Update if changed double temp_z_after_tool_change; if (GCodeProcessor::get_last_z_from_gcode(toolchange_gcode_parsed, temp_z_after_tool_change)) { - Vec3d pos = m_writer->get_position(); + Vec3d pos = m_writer.get_position(); pos(2) = temp_z_after_tool_change; - m_writer->set_position(pos); + m_writer.set_position(pos); } } } @@ -10163,15 +10163,15 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo // BBS. Reset old extruder E-value. // Keep retract length because Custom GCode will guarantee retract length be the same as toolchange if (m_config.single_extruder_multi_material) { - m_writer->reset_e(); + m_writer.reset_e(); } //BBS: don't add T[next extruder] if there is no T cmd on filament change //We inform the writer about what is happening, but we may not use the resulting gcode. - std::string toolchange_command = m_writer->toolchange(new_filament_id, next_nozzle_id); - if (Extruder *fil = m_writer->filament()) + std::string toolchange_command = m_writer.toolchange(new_filament_id, next_nozzle_id); + if (Extruder *fil = m_writer.filament()) fil->set_config_index((int)get_filament_config_index((int)fil->id())); - if (!custom_gcode_changes_tool(toolchange_gcode_parsed, m_writer->toolchange_prefix(), new_filament_id)) + if (!custom_gcode_changes_tool(toolchange_gcode_parsed, m_writer.toolchange_prefix(), new_filament_id)) gcode += toolchange_command; else { // user provided his own toolchange gcode, no need to do anything @@ -10183,7 +10183,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo int temp = (m_layer_index <= 0 ? m_config.nozzle_temperature_initial_layer.get_at(new_fi) : m_config.nozzle_temperature.get_at(new_fi)); - gcode += m_writer->set_temperature(temp, false); + gcode += m_writer.set_temperature(temp, false); } this->placeholder_parser().set("current_extruder", new_filament_id); @@ -10245,7 +10245,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo gcode += m_ooze_prevention.post_toolchange(*this); if (m_config.enable_pressure_advance.get_at(new_filament_id)) { - gcode += m_writer->set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); + gcode += m_writer.set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id)); // Orca: Adaptive PA // Reset Adaptive PA processor last PA value m_pa_processor->resetPreviousPA(m_config.pressure_advance.get_at(new_filament_id)); @@ -10386,7 +10386,7 @@ Vec3d GCode::point_to_gcode(const Point3& point) const Point GCode::gcode_to_point(const Vec2d &point) const { Vec2d pt = point - m_origin; - if (const Extruder *extruder = m_writer->filament(); extruder) + if (const Extruder *extruder = m_writer.filament(); extruder) // This function may be called at the very start from toolchange G-code when the extruder is not assigned yet. pt += m_config.extruder_offset.get_at(extruder->extruder_id()); return scaled(pt); diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 17221101fd..80b95d2937 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -218,8 +218,7 @@ public: m_last_obj_copy(nullptr, Point(std::numeric_limits::max(), std::numeric_limits::max())), // BBS m_toolchange_count(0), - m_nominal_z(0.), - m_writer(std::make_unique()) + m_nominal_z(0.) {} virtual ~GCode() = default; @@ -229,7 +228,7 @@ public: void do_export(Print* print, const char* path, GCodeProcessorResult* result = nullptr, ThumbnailsGeneratorCallback thumbnail_cb = nullptr); void export_layer_filaments(GCodeProcessorResult* result); //BBS: set offset for gcode writer - void set_gcode_offset(double x, double y) { m_gcode_offset = Vec2d(x, y); m_writer->set_xy_offset(x, y); m_processor.set_xy_offset(x, y);} + void set_gcode_offset(double x, double y) { m_writer.set_xy_offset(x, y); m_processor.set_xy_offset(x, y);} // Exported for the helper classes (OozePrevention, Wipe) and for the Perl binding for unit tests. const Vec2d& origin() const { return m_origin; } @@ -243,8 +242,8 @@ public: Vec3d point_to_gcode_quantized(const Point3& point) const; const FullPrintConfig &config() const { return m_config; } const Layer* layer() const { return m_layer; } - GCodeWriter& writer() { return *m_writer; } - const GCodeWriter& writer() const { return *m_writer; } + GCodeWriter& writer() { return m_writer; } + const GCodeWriter& writer() const { return m_writer; } PlaceholderParser& placeholder_parser() { return m_placeholder_parser_integration.parser; } const PlaceholderParser& placeholder_parser() const { return m_placeholder_parser_integration.parser; } // Process a template through the placeholder parser, collect error messages to be reported @@ -267,7 +266,7 @@ public: bool needs_retraction(const Polyline& travel, ExtrusionRole role, LiftType& lift_type); std::string retract(bool toolchange = false, bool is_last_retraction = false, LiftType lift_type = LiftType::NormalLift, bool apply_instantly = false, ExtrusionRole role = erNone); // extra_retract forwards a PETG pre-extrusion over-extrusion; default 0 -> identical to the plain deretract. - std::string unretract(float extra_retract = 0.f) { return m_writer->unlift() + m_writer->unretract(extra_retract); } + std::string unretract(float extra_retract = 0.f) { return m_writer.unlift() + m_writer.unretract(extra_retract); } std::string set_extruder(unsigned int extruder_id, double print_z, bool by_object=false, int toolchange_temp_override = -1, bool defer_temp_wait = false); bool is_BBL_Printer(); WipeTowerType wipe_tower_type(); @@ -384,7 +383,7 @@ protected: // represent a G2/G3 arc. Belt printers get this through BeltKinematics // rather than through an override of their own. virtual bool should_disable_arc_fitting() const - { return ! m_writer->kinematics().supports_arc_moves(); } + { return ! m_writer.kinematics().supports_arc_moves(); } void _do_export(Print &print, GCodeOutputStream &file, ThumbnailsGeneratorCallback thumbnail_cb); @@ -660,7 +659,7 @@ protected: DynamicConfig m_calib_config; // scaled G-code resolution double m_scaled_resolution; - std::unique_ptr m_writer; + GCodeWriter m_writer; struct PlaceholderParserIntegration { void reset(); @@ -786,7 +785,6 @@ protected: // checks short-circuit to the legacy Layer::id() == 0 path. std::unique_ptr m_first_layer_plane; // Plate origin, kept so a writer replaced during export can be given it again. - Vec2d m_gcode_offset{ Vec2d::Zero() }; std::unique_ptr m_pressure_equalizer; diff --git a/src/libslic3r/GCodeWriter.hpp b/src/libslic3r/GCodeWriter.hpp index 20357a1d9e..526ef0898d 100644 --- a/src/libslic3r/GCodeWriter.hpp +++ b/src/libslic3r/GCodeWriter.hpp @@ -17,7 +17,6 @@ class FirstLayerPlane; class GCodeWriter { public: - virtual ~GCodeWriter() = default; GCodeConfig config; bool multiple_extruders; @@ -84,27 +83,27 @@ public: std::string set_speed(double F, const std::string &comment = std::string(), const std::string &cooling_marker = std::string()); // SoftFever NOTE: the returned speed is mm/minute double get_current_speed() const { return m_current_speed;} - virtual std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string()); - virtual std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false); + std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string()); + std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false); std::string travel_to_z(double z, const std::string &comment = std::string(), bool force = false); bool will_move_z(double z) const; - virtual std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); + std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); //BBS: generate G2 or G3 extrude which moves by arc std::string extrude_arc_to_xy(const Vec2d &point, const Vec2d ¢er_offset, double dE, const bool is_ccw, const std::string &comment = std::string(), bool force_no_extrusion = false); // Linear approximation of an arc, used when the machine mapping cannot // express a G2/G3. Must be called before m_pos is updated: center_offset is // relative to the current position. std::string extrude_arc_as_polyline(const Vec2d &point, const Vec2d ¢er_offset, double dE, const bool is_ccw, const std::string &comment = std::string(), bool force_no_extrusion = false); - virtual std::string extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); + std::string extrude_to_xyz(const Vec3d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false); std::string retract(bool before_wipe = false, double retract_length = 0); std::string retract_for_toolchange(bool before_wipe = false, double retract_length = 0); // extra_retract adds a small over-extrusion to the deretract move (PETG pre-extrusion). // Default 0 -> byte-identical to the plain deretract. std::string unretract(float extra_retract = 0.f); // do lift instantly - virtual std::string eager_lift(const LiftType type); + std::string eager_lift(const LiftType type); // record a lift request, do realy lift in next travel - virtual std::string lazy_lift(LiftType lift_type = LiftType::NormalLift, bool spiral_vase = false); + std::string lazy_lift(LiftType lift_type = LiftType::NormalLift, bool spiral_vase = false); std::string unlift(); const Vec3d& get_position() const { return m_pos; } Vec3d& get_position() { return m_pos; } @@ -184,7 +183,7 @@ protected: bool m_is_current_pos_clear = false; double m_current_speed; - virtual std::string _travel_to_z(double z, const std::string &comment); + std::string _travel_to_z(double z, const std::string &comment); // Whether a destination gets first-layer treatment. With an active plane // evaluator, distance from the plane decides; otherwise the layer-coarse From e8a499df7bc87bd91e82df5e5f358b99cc614567 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sun, 4 Oct 2026 19:21:22 -0500 Subject: [PATCH 224/389] Belt: register the raw G-code toggle as a Preview shortcut Main's assignable shortcuts replaced the canvas key switch that carried the belt "show designed / show raw G-code" toggle on B. Register it as ToggleBeltRawGcode, bound to B in the Preview (B is only taken on the Plater, by the mesh boolean gizmo), so it can be rebound and is listed in the shortcuts dialog. The legend checkbox shows whatever key is bound. --- src/slic3r/GUI/GCodeViewer.cpp | 7 +++++-- src/slic3r/GUI/GLCanvas3D.cpp | 12 +++++++++++- src/slic3r/GUI/Shortcuts.cpp | 1 + src/slic3r/GUI/Shortcuts.hpp | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 5e21b6c617..26c3e2e111 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -13,6 +13,7 @@ #include "libslic3r/Geometry/ConvexHull.hpp" #include "GUI_App.hpp" +#include "Shortcuts.hpp" #include "MainFrame.hpp" #include "Plater.hpp" #include "Camera.hpp" @@ -5148,8 +5149,10 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv // Checked = show the raw machine-frame G-code (designed/upright view off). Worded to // match the canvas-toolbar menu item "Show raw G-code (belt only)". m_belt_show_designed // is the inverse of this checkbox, so bind a temporary and flip it on change. - bool show_raw = !m_belt_show_designed; - if (ImGui::Checkbox(_u8L("Show raw G-code (belt only) [B]").c_str(), &show_raw)) { + bool show_raw = !m_belt_show_designed; + const std::string key = wxGetApp().shortcuts().display(Shortcut::ToggleBeltRawGcode); + const std::string label = _u8L("Show raw G-code (belt only)") + (key.empty() ? std::string() : " [" + key + "]"); + if (ImGui::Checkbox(label.c_str(), &show_raw)) { m_belt_show_designed = !show_raw; // The designed-view back-transform is baked into the toolpath geometry at load // time, so the toggle only takes effect once the preview is re-converted. Defer diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 55a3728c2e..4ec3982e52 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3804,6 +3804,16 @@ bool GLCanvas3D::handle_shortcut(const KeyChord& chord) m_dirty = true; request_extra_frame(); break; + case Shortcut::ToggleBeltRawGcode: + // Same state as the legend checkbox and the canvas-toolbar menu item. The designed-view + // back-transform is baked into the toolpaths at load time, so the preview is re-converted. + if (m_gcode_viewer.is_belt_view()) { + m_gcode_viewer.toggle_belt_show_designed(); + if (Plater* plater = wxGetApp().plater()) + plater->refresh_belt_view(); + m_dirty = true; + } + break; case Shortcut::ToggleOneLayerMode: get_gcode_viewer().get_layers_slider()->switch_one_layer_mode(); m_dirty = true; @@ -10196,7 +10206,7 @@ void GLCanvas3D::_render_canvas_toolbar() }; // Belt printers, G-code preview only: toggle the designed (upright) view vs the raw - // machine-frame G-code. Same state as hotkey B and the legend checkbox; the reload is + // machine-frame G-code. Same state as the shortcut and the legend checkbox; the reload is // deferred (CallAfter) so the preview is not rebuilt mid-render. if (m_canvas_type == ECanvasType::CanvasPreview && m_gcode_viewer.is_belt_view()) { create_menu_item( _utf8(L("Show raw G-code (belt only)")), diff --git a/src/slic3r/GUI/Shortcuts.cpp b/src/slic3r/GUI/Shortcuts.cpp index 8773c6f364..2395d31778 100644 --- a/src/slic3r/GUI/Shortcuts.cpp +++ b/src/slic3r/GUI/Shortcuts.cpp @@ -149,6 +149,7 @@ constexpr std::array shortcut_table = {{ SHORTCUT(ShowWireframe, "show_wireframe", L("Show/Hide wireframe"), CANVAS, { WXK_RETURN, CTRL_SHIFT }), SHORTCUT(ToggleGcodeWindow, "toggle_gcode_window", L("On/Off G-code window"), PREVIEW, { 'C' }), SHORTCUT(ToggleOneLayerMode, "toggle_one_layer_mode", L("On/Off one layer mode of the vertical slider"), PREVIEW, { 'L' }), + SHORTCUT(ToggleBeltRawGcode, "toggle_belt_raw_gcode", L("Show raw G-code (belt only)"), PREVIEW, { 'B' }), // Application SHORTCUT(Preferences, "preferences", L("Preferences"), GLOBAL, PREFERENCES_CHORD), diff --git a/src/slic3r/GUI/Shortcuts.hpp b/src/slic3r/GUI/Shortcuts.hpp index 0e61554e2f..6a58d64971 100644 --- a/src/slic3r/GUI/Shortcuts.hpp +++ b/src/slic3r/GUI/Shortcuts.hpp @@ -46,7 +46,7 @@ enum class Shortcut : uint8_t { // Camera ViewDefault, ViewTop, ViewBottom, ViewFront, ViewRear, ViewLeft, ViewRight, ViewPlate, ZoomIn, ZoomOut, Mouse3DSettings, // Display - ShowLabels, ShowWireframe, ToggleGcodeWindow, ToggleOneLayerMode, + ShowLabels, ShowWireframe, ToggleGcodeWindow, ToggleOneLayerMode, ToggleBeltRawGcode, // Application Preferences, Search, SwitchView, CollapseSidebar, ReloadDevicePage, KeyboardShortcuts, // Speed Dial From 1b4153f0cded628d02ab5442c0bf9dc675ae428c Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sun, 4 Oct 2026 19:22:42 -0500 Subject: [PATCH 225/389] Precise Seam: slice modifiers in the belt slicing frame slice_single_volume_regions() sliced Precise Seam modifiers with trafo_centered(), but a belt printer slices its layers with trafo_sliced(): the belt rotation, any pre-slice remap and the lift off the plate on top. On a belt print the modifier regions landed in the unrotated frame, away from the walls they were meant to place the seam on. Slice them with trafo_sliced(), as the support volumes and the seam enforcers already are. It equals trafo_centered() off a belt printer. --- src/libslic3r/PrintObjectSlice.cpp | 5 ++-- tests/fff_print/test_precise_seam.cpp | 42 +++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 6c2c9f9fd9..88f44466ff 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1832,10 +1832,11 @@ std::vector PrintObject::slice_single_volume_regions(const ModelVolu { if (volume == nullptr) return {}; - // Match the existing slicing heights and centered transform without flattening holes. + // Match the existing slicing heights and the frame the layers were sliced in (belt + // pre-slice transforms included) without flattening holes. const std::vector zs = zs_from_layers(this->layers()); MeshSlicingParamsEx params; - params.trafo = this->trafo_centered(); + params.trafo = this->trafo_sliced(); const Print *print = this->print(); return slice_volume(*volume, zs, params, [print]() { print->throw_if_canceled(); }); } diff --git a/tests/fff_print/test_precise_seam.cpp b/tests/fff_print/test_precise_seam.cpp index 2f48c626cc..6d28b57b6f 100644 --- a/tests/fff_print/test_precise_seam.cpp +++ b/tests/fff_print/test_precise_seam.cpp @@ -1426,3 +1426,45 @@ TEST_CASE("Full containment warns for Blocked but not for Enforced", "[PreciseSe else CHECK(fixture.warning().empty()); } + +TEST_CASE("Belt printers slice Precise Seam modifiers in the frame the object was sliced in", "[PreciseSeam][belt]") +{ + Model model; + Print print; + Test::init_print({Test::cube(20)}, print, model, { + { "belt_printer", 1 }, + { "belt_slice_rotation", "x" }, + { "belt_slice_rotation_angle", 45 }, + { "belt_slice_rotation_global", 1 }, + { "layer_height", 0.2 }, + { "initial_layer_print_height", 0.2 }, + { "skirt_loops", 0 }, + // Keep the first layer's islands the raw slice, like the modifier's. + { "elefant_foot_compensation", 0 }, + }); + print.process(); + const PrintObject *object = print.get_object(0); + REQUIRE(object->layer_count() > 0); + + // A modifier with the object's own mesh and placement must slice to the object's own islands + // on every layer. Sliced without the belt rotation it would give 20 mm squares on the lower + // layers and nothing above 20 mm, while the tilted cube reaches about 28 mm. + Model modifiers; + ModelVolume *modifier = modifiers.add_object()->add_volume(*model.objects.front()->volumes.front()); + modifier->set_type(ModelVolumeType::PRECISE_SEAM_BLOCKED); + const std::vector slices = object->slice_single_volume_regions(modifier); + REQUIRE(slices.size() == object->layer_count()); + + const double tolerance = scale_(0.05) * scale_(20.); + for (size_t i = 0; i < slices.size(); ++i) { + CAPTURE(i, object->get_layer(int(i))->slice_z); + const ExPolygons &islands = object->get_layer(int(i))->lslices; + double object_area = 0., modifier_area = 0.; + for (const ExPolygon &island : islands) + object_area += island.area(); + for (const ExPolygon ®ion : slices[i]) + modifier_area += region.area(); + CHECK(std::abs(modifier_area - object_area) < tolerance); + CHECK(get_extents(slices[i]).inflated(scale_(0.05)).contains(get_extents(islands))); + } +} From 56f5ff8128df7a83ba2a947d4c8b71f0c3037d9a Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sun, 4 Oct 2026 19:28:36 -0500 Subject: [PATCH 226/389] Belt profiles: inherit what they repeat and pass main's profile checks main's profile checks reject the belt bundles: their filaments override variant keys with one value under the library's six-variant presets, the copied vendor commons carry keys the slicer no longer reads, the IR3 V2 and BabyBelt Pro machine limits miss the silent-mode entry, and the Custom belt base pins printer_extruder_id to one entry under a three-variant list. - The BabyBelt Pro and IR3 V2 filaments name the one extruder variant their printers have, as the other vendors' filaments built on the library do, and drop every override that only repeats the library value (diameter, density, temperature range, most of the fan settings...). The eSUN filaments inherit the narrowed list. - The Custom belt base inherits printer_extruder_id from its base. - normalize drops silent_mode, adaptive_layer_height and tree_support_with_infill; fix-variant gives the machine limits their silent-mode entry, which they read from the single value before. - The IR3 V2 drops two limits equal to its base in both modes. - Custom's index is regenerated and all three vendor versions bumped. Flattening every belt preset before and after, nothing a belt printer reads changes: printer_extruder_id is one id per variant, all 1. Printcepts and IdeaFormer keep their own machine and process bases: only filaments can inherit across vendor bundles (from OrcaFilamentLibrary), so they cannot build on the Custom belt printer. --- resources/profiles/Custom.json | 18 +++---- .../Custom/machine/fdm_belt_common.json | 3 -- resources/profiles/IdeaFormer.json | 2 +- .../Generic PETG @IdeaFormer IR3 V2.json | 39 ++------------ .../Generic PLA @IdeaFormer IR3 V2.json | 51 ++----------------- .../filament/eSUN PLA @IdeaFormer IR3 V2.json | 2 +- .../machine/IdeaFormer IR3 V2 0.4 nozzle.json | 19 ++++--- .../machine/fdm_klipper_common.json | 1 - .../machine/fdm_machine_common.json | 1 - .../process/fdm_process_common.json | 2 - resources/profiles/Printcepts.json | 2 +- .../filament/Generic PETG @BabyBelt Pro.json | 39 ++------------ .../filament/Generic PLA @BabyBelt Pro.json | 51 ++----------------- .../filament/eSUN PLA @BabyBelt Pro.json | 2 +- .../machine/BabyBelt Pro 0.4 nozzle.json | 1 + .../machine/fdm_klipper_common.json | 1 - .../machine/fdm_machine_common.json | 1 - .../process/fdm_process_common.json | 2 - 18 files changed, 39 insertions(+), 198 deletions(-) diff --git a/resources/profiles/Custom.json b/resources/profiles/Custom.json index 800264abe2..ab2084d898 100644 --- a/resources/profiles/Custom.json +++ b/resources/profiles/Custom.json @@ -1,6 +1,6 @@ { "name": "Custom Printer", - "version": "02.04.00.07", + "version": "02.04.00.08", "force_update": "0", "description": "My configurations", "machine_model_list": [ @@ -54,6 +54,10 @@ "name": "0.08mm Extra Fine @MyKlipper", "sub_path": "process/0.08mm Extra Fine @MyKlipper.json" }, + { + "name": "0.12mm Fine @MyBeltPrinter", + "sub_path": "process/0.12mm Fine @MyBeltPrinter.json" + }, { "name": "0.12mm Fine @MyKlipper", "sub_path": "process/0.12mm Fine @MyKlipper.json" @@ -66,10 +70,6 @@ "name": "0.16mm Optimal @MyKlipper", "sub_path": "process/0.16mm Optimal @MyKlipper.json" }, - { - "name": "0.12mm Fine @MyBeltPrinter", - "sub_path": "process/0.12mm Fine @MyBeltPrinter.json" - }, { "name": "0.20mm Standard @MyBeltPrinter", "sub_path": "process/0.20mm Standard @MyBeltPrinter.json" @@ -282,6 +282,10 @@ "name": "fdm_toolchanger_common", "sub_path": "machine/fdm_toolchanger_common.json" }, + { + "name": "MyRepetier 0.4 nozzle", + "sub_path": "machine/MyRepetier 0.4 nozzle.json" + }, { "name": "MyRRF 0.4 nozzle", "sub_path": "machine/MyRRF 0.4 nozzle.json" @@ -302,10 +306,6 @@ "name": "MyBeltPrinter 0.8 nozzle", "sub_path": "machine/MyBeltPrinter 0.8 nozzle.json" }, - { - "name": "MyRepetier 0.4 nozzle", - "sub_path": "machine/MyRepetier 0.4 nozzle.json" - }, { "name": "MyToolChanger 0.2 nozzle", "sub_path": "machine/MyToolChanger 0.2 nozzle.json" diff --git a/resources/profiles/Custom/machine/fdm_belt_common.json b/resources/profiles/Custom/machine/fdm_belt_common.json index 3c45b05515..19765b8d4e 100644 --- a/resources/profiles/Custom/machine/fdm_belt_common.json +++ b/resources/profiles/Custom/machine/fdm_belt_common.json @@ -85,9 +85,6 @@ "gcode_remap_x": "rev_x", "gcode_remap_y": "pos_z", "gcode_remap_z": "pos_y", - "printer_extruder_id": [ - "1" - ], "belt_printer": "1", "belt_slice_rotation": "x", "belt_slice_rotation_angle": "45", diff --git a/resources/profiles/IdeaFormer.json b/resources/profiles/IdeaFormer.json index ee076dfffb..ebed0bc9e0 100644 --- a/resources/profiles/IdeaFormer.json +++ b/resources/profiles/IdeaFormer.json @@ -1,6 +1,6 @@ { "name": "IdeaFormer", - "version": "02.00.00.05", + "version": "02.00.00.06", "force_update": "0", "description": "IdeaFormer belt printer configurations", "machine_model_list": [ diff --git a/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json index 709d0e9897..28da3959f4 100644 --- a/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/filament/Generic PETG @IdeaFormer IR3 V2.json @@ -5,6 +5,9 @@ "from": "system", "setting_id": "n4zaXcUUzTqAxq5f", "instantiation": "true", + "filament_extruder_variant": [ + "Direct Drive Standard" + ], "compatible_printers": [ "IdeaFormer IR3 V2 0.4 nozzle" ], @@ -17,54 +20,24 @@ "filament_settings_id": [ "Generic PETG @IdeaFormer IR3 V2" ], - "filament_diameter": [ - "1.75" - ], - "filament_density": [ - "1.27" - ], "filament_flow_ratio": [ "0.95" ], "filament_cost": [ "25" ], - "filament_max_volumetric_speed": [ - "10" - ], "nozzle_temperature": [ "240" ], "nozzle_temperature_initial_layer": [ "245" ], - "nozzle_temperature_range_low": [ - "220" - ], - "nozzle_temperature_range_high": [ - "260" - ], - "temperature_vitrification": [ - "70" - ], - "hot_plate_temp": [ - "80" - ], - "hot_plate_temp_initial_layer": [ - "80" - ], "cool_plate_temp": [ "80" ], "cool_plate_temp_initial_layer": [ "80" ], - "textured_plate_temp": [ - "80" - ], - "textured_plate_temp_initial_layer": [ - "80" - ], "fan_min_speed": [ "40" ], @@ -77,9 +50,6 @@ "overhang_fan_speed": [ "80" ], - "close_fan_the_first_x_layers": [ - "3" - ], "full_fan_speed_layer": [ "8" ], @@ -92,9 +62,6 @@ "fan_cooling_layer_time": [ "100" ], - "reduce_fan_stop_start_freq": [ - "1" - ], "filament_retraction_length": [ "2" ], diff --git a/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json index 10a8ed97f9..da5d4af50a 100644 --- a/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/filament/Generic PLA @IdeaFormer IR3 V2.json @@ -5,6 +5,9 @@ "from": "system", "setting_id": "1xjycsEAFh6KQIhp", "instantiation": "true", + "filament_extruder_variant": [ + "Direct Drive Standard" + ], "compatible_printers": [ "IdeaFormer IR3 V2 0.4 nozzle" ], @@ -17,36 +20,9 @@ "filament_settings_id": [ "Generic PLA @IdeaFormer IR3 V2" ], - "filament_diameter": [ - "1.75" - ], - "filament_density": [ - "1.24" - ], - "filament_flow_ratio": [ - "0.98" - ], - "filament_cost": [ - "20" - ], - "filament_max_volumetric_speed": [ - "12" - ], "nozzle_temperature": [ "215" ], - "nozzle_temperature_initial_layer": [ - "220" - ], - "nozzle_temperature_range_low": [ - "190" - ], - "nozzle_temperature_range_high": [ - "240" - ], - "temperature_vitrification": [ - "45" - ], "hot_plate_temp": [ "75" ], @@ -65,18 +41,6 @@ "textured_plate_temp_initial_layer": [ "75" ], - "fan_min_speed": [ - "100" - ], - "fan_max_speed": [ - "100" - ], - "overhang_fan_threshold": [ - "50%" - ], - "overhang_fan_speed": [ - "100" - ], "close_fan_the_first_x_layers": [ "3" ], @@ -86,15 +50,6 @@ "slow_down_min_speed": [ "20" ], - "slow_down_layer_time": [ - "4" - ], - "fan_cooling_layer_time": [ - "100" - ], - "reduce_fan_stop_start_freq": [ - "1" - ], "filament_retraction_length": [ "1.5" ], diff --git a/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json b/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json index 1dbaf8b2cf..b39a4c22fc 100644 --- a/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json +++ b/resources/profiles/IdeaFormer/filament/eSUN PLA @IdeaFormer IR3 V2.json @@ -2,9 +2,9 @@ "type": "filament", "name": "eSUN PLA @IdeaFormer IR3 V2", "inherits": "Generic PLA @IdeaFormer IR3 V2", - "filament_id": "OFkrxQC4", "from": "system", "setting_id": "XqkviBmFHEglXueX", + "filament_id": "OFkrxQC4", "instantiation": "true", "compatible_printers": [ "IdeaFormer IR3 V2 0.4 nozzle" diff --git a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json index ce02ce82d1..f993631921 100644 --- a/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json +++ b/resources/profiles/IdeaFormer/machine/IdeaFormer IR3 V2 0.4 nozzle.json @@ -27,49 +27,56 @@ ], "default_print_profile": "0.20mm Standard @IdeaFormer IR3 V2", "use_relative_e_distances": "1", - "machine_max_acceleration_e": [ - "5000" - ], "machine_max_acceleration_extruding": [ + "5000", "5000" ], "machine_max_acceleration_retracting": [ + "1000", "1000" ], "machine_max_acceleration_travel": [ + "9000", "9000" ], "machine_max_acceleration_x": [ + "5000", "5000" ], "machine_max_acceleration_y": [ + "5000", "5000" ], "machine_max_acceleration_z": [ + "100", "100" ], - "machine_max_jerk_e": [ - "2.5" - ], "machine_max_jerk_x": [ + "10", "10" ], "machine_max_jerk_y": [ + "10", "10" ], "machine_max_jerk_z": [ + "0.4", "0.4" ], "machine_max_speed_e": [ + "60", "60" ], "machine_max_speed_x": [ + "500", "500" ], "machine_max_speed_y": [ + "500", "500" ], "machine_max_speed_z": [ + "20", "20" ], "retraction_length": [ diff --git a/resources/profiles/IdeaFormer/machine/fdm_klipper_common.json b/resources/profiles/IdeaFormer/machine/fdm_klipper_common.json index 36f3fe13c6..5297f646ff 100644 --- a/resources/profiles/IdeaFormer/machine/fdm_klipper_common.json +++ b/resources/profiles/IdeaFormer/machine/fdm_klipper_common.json @@ -117,7 +117,6 @@ "30" ], "z_hop_types": "Normal Lift", - "silent_mode": "0", "single_extruder_multi_material": "1", "change_filament_gcode": "", "wipe": [ diff --git a/resources/profiles/IdeaFormer/machine/fdm_machine_common.json b/resources/profiles/IdeaFormer/machine/fdm_machine_common.json index 963f39c9d8..bf8f2249cf 100644 --- a/resources/profiles/IdeaFormer/machine/fdm_machine_common.json +++ b/resources/profiles/IdeaFormer/machine/fdm_machine_common.json @@ -14,7 +14,6 @@ "0x0" ], "gcode_flavor": "marlin", - "silent_mode": "0", "machine_max_acceleration_e": [ "5000" ], diff --git a/resources/profiles/IdeaFormer/process/fdm_process_common.json b/resources/profiles/IdeaFormer/process/fdm_process_common.json index b8e882770a..0d558129af 100644 --- a/resources/profiles/IdeaFormer/process/fdm_process_common.json +++ b/resources/profiles/IdeaFormer/process/fdm_process_common.json @@ -3,7 +3,6 @@ "name": "fdm_process_common", "from": "system", "instantiation": "false", - "adaptive_layer_height": "0", "reduce_crossing_wall": "0", "max_travel_detour_distance": "0", "bottom_surface_pattern": "monotonic", @@ -83,7 +82,6 @@ "support_object_xy_distance": "0.35", "tree_support_branch_angle": "30", "tree_support_wall_count": "0", - "tree_support_with_infill": "0", "detect_thin_wall": "0", "top_surface_pattern": "monotonicline", "top_shell_thickness": "0.8", diff --git a/resources/profiles/Printcepts.json b/resources/profiles/Printcepts.json index cdeda8f04d..70338174d6 100644 --- a/resources/profiles/Printcepts.json +++ b/resources/profiles/Printcepts.json @@ -1,6 +1,6 @@ { "name": "Printcepts", - "version": "01.00.00.03", + "version": "01.00.00.04", "force_update": "0", "description": "Printcepts belt printer configurations", "machine_model_list": [ diff --git a/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json index 5bfd8e7f2d..9b71a420b6 100644 --- a/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json +++ b/resources/profiles/Printcepts/filament/Generic PETG @BabyBelt Pro.json @@ -5,6 +5,9 @@ "from": "system", "setting_id": "gCzHpDNgVwQR6tgk", "instantiation": "true", + "filament_extruder_variant": [ + "Direct Drive Standard" + ], "compatible_printers": [ "BabyBelt Pro 0.4 nozzle" ], @@ -17,54 +20,24 @@ "filament_settings_id": [ "Generic PETG @BabyBelt Pro" ], - "filament_diameter": [ - "1.75" - ], - "filament_density": [ - "1.27" - ], "filament_flow_ratio": [ "0.95" ], "filament_cost": [ "25" ], - "filament_max_volumetric_speed": [ - "10" - ], "nozzle_temperature": [ "240" ], "nozzle_temperature_initial_layer": [ "245" ], - "nozzle_temperature_range_low": [ - "220" - ], - "nozzle_temperature_range_high": [ - "260" - ], - "temperature_vitrification": [ - "70" - ], - "hot_plate_temp": [ - "80" - ], - "hot_plate_temp_initial_layer": [ - "80" - ], "cool_plate_temp": [ "80" ], "cool_plate_temp_initial_layer": [ "80" ], - "textured_plate_temp": [ - "80" - ], - "textured_plate_temp_initial_layer": [ - "80" - ], "fan_min_speed": [ "40" ], @@ -77,9 +50,6 @@ "overhang_fan_speed": [ "80" ], - "close_fan_the_first_x_layers": [ - "3" - ], "full_fan_speed_layer": [ "8" ], @@ -92,9 +62,6 @@ "fan_cooling_layer_time": [ "100" ], - "reduce_fan_stop_start_freq": [ - "1" - ], "filament_retraction_length": [ "2" ], diff --git a/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json index 4637f21273..3345b5f509 100644 --- a/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json +++ b/resources/profiles/Printcepts/filament/Generic PLA @BabyBelt Pro.json @@ -5,6 +5,9 @@ "from": "system", "setting_id": "24PpcnhVx9v5f4fD", "instantiation": "true", + "filament_extruder_variant": [ + "Direct Drive Standard" + ], "compatible_printers": [ "BabyBelt Pro 0.4 nozzle" ], @@ -17,36 +20,9 @@ "filament_settings_id": [ "Generic PLA @BabyBelt Pro" ], - "filament_diameter": [ - "1.75" - ], - "filament_density": [ - "1.24" - ], - "filament_flow_ratio": [ - "0.98" - ], - "filament_cost": [ - "20" - ], - "filament_max_volumetric_speed": [ - "12" - ], "nozzle_temperature": [ "215" ], - "nozzle_temperature_initial_layer": [ - "220" - ], - "nozzle_temperature_range_low": [ - "190" - ], - "nozzle_temperature_range_high": [ - "240" - ], - "temperature_vitrification": [ - "45" - ], "hot_plate_temp": [ "75" ], @@ -65,18 +41,6 @@ "textured_plate_temp_initial_layer": [ "75" ], - "fan_min_speed": [ - "100" - ], - "fan_max_speed": [ - "100" - ], - "overhang_fan_threshold": [ - "50%" - ], - "overhang_fan_speed": [ - "100" - ], "close_fan_the_first_x_layers": [ "3" ], @@ -86,15 +50,6 @@ "slow_down_min_speed": [ "20" ], - "slow_down_layer_time": [ - "4" - ], - "fan_cooling_layer_time": [ - "100" - ], - "reduce_fan_stop_start_freq": [ - "1" - ], "filament_retraction_length": [ "1.5" ], diff --git a/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json b/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json index d405deaef1..1f93703e1c 100644 --- a/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json +++ b/resources/profiles/Printcepts/filament/eSUN PLA @BabyBelt Pro.json @@ -2,9 +2,9 @@ "type": "filament", "name": "eSUN PLA @BabyBelt Pro", "inherits": "Generic PLA @BabyBelt Pro", - "filament_id": "OFkrxQC4", "from": "system", "setting_id": "EH3X7oE0DU5tSpjW", + "filament_id": "OFkrxQC4", "instantiation": "true", "compatible_printers": [ "BabyBelt Pro 0.4 nozzle" diff --git a/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json b/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json index 620498e0d4..84218476cb 100644 --- a/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json +++ b/resources/profiles/Printcepts/machine/BabyBelt Pro 0.4 nozzle.json @@ -56,6 +56,7 @@ "20000" ], "machine_max_junction_deviation": [ + "0.01", "0.01" ], "machine_max_speed_x": [ diff --git a/resources/profiles/Printcepts/machine/fdm_klipper_common.json b/resources/profiles/Printcepts/machine/fdm_klipper_common.json index 36f3fe13c6..5297f646ff 100644 --- a/resources/profiles/Printcepts/machine/fdm_klipper_common.json +++ b/resources/profiles/Printcepts/machine/fdm_klipper_common.json @@ -117,7 +117,6 @@ "30" ], "z_hop_types": "Normal Lift", - "silent_mode": "0", "single_extruder_multi_material": "1", "change_filament_gcode": "", "wipe": [ diff --git a/resources/profiles/Printcepts/machine/fdm_machine_common.json b/resources/profiles/Printcepts/machine/fdm_machine_common.json index 963f39c9d8..bf8f2249cf 100644 --- a/resources/profiles/Printcepts/machine/fdm_machine_common.json +++ b/resources/profiles/Printcepts/machine/fdm_machine_common.json @@ -14,7 +14,6 @@ "0x0" ], "gcode_flavor": "marlin", - "silent_mode": "0", "machine_max_acceleration_e": [ "5000" ], diff --git a/resources/profiles/Printcepts/process/fdm_process_common.json b/resources/profiles/Printcepts/process/fdm_process_common.json index b8e882770a..0d558129af 100644 --- a/resources/profiles/Printcepts/process/fdm_process_common.json +++ b/resources/profiles/Printcepts/process/fdm_process_common.json @@ -3,7 +3,6 @@ "name": "fdm_process_common", "from": "system", "instantiation": "false", - "adaptive_layer_height": "0", "reduce_crossing_wall": "0", "max_travel_detour_distance": "0", "bottom_surface_pattern": "monotonic", @@ -83,7 +82,6 @@ "support_object_xy_distance": "0.35", "tree_support_branch_angle": "30", "tree_support_wall_count": "0", - "tree_support_with_infill": "0", "detect_thin_wall": "0", "top_surface_pattern": "monotonicline", "top_shell_thickness": "0.8", From 7eb9aa383269a187820aede772a532ab973d4bcf Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sun, 4 Oct 2026 22:57:53 -0500 Subject: [PATCH 227/389] Profile validator: accept a belt printer's tool change without a tower The validator slices every printer with two filaments and the prime tower forced on, then requires the tower's CP TOOLCHANGE START block as proof that change_filament_gcode ran. A belt printer has no wipe tower: it purges into a prism object on the belt, so Print::has_wipe_tower() is false and the change is the plain T command set_extruder() emits. All six belt printers failed the sweep on that alone, although each one changes filament throughout the slice. Look for the T1 line on belt printers. --- src/dev-utils/OrcaSlicer_profile_validator.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/dev-utils/OrcaSlicer_profile_validator.cpp b/src/dev-utils/OrcaSlicer_profile_validator.cpp index 140716c896..f4ce09a3e4 100644 --- a/src/dev-utils/OrcaSlicer_profile_validator.cpp +++ b/src/dev-utils/OrcaSlicer_profile_validator.cpp @@ -519,11 +519,16 @@ int slice_all_printers(const std::string &vendor, const std::string &outdir) const std::string filament_name = bundle.filaments.get_selected_preset_name(); const std::string what = "Printer \"" + printer + "\""; const std::string file_base = sanitize_filename(vendor_name) + "__" + sanitize_filename(printer); + // A belt printer has no wipe tower (it purges into a prism object on the belt), so its + // filament change is the plain tool change set_extruder() emits rather than the tower's block. + const bool belt = bundle.printers.get_selected_preset().config.opt_bool("belt_printer"); + const std::string marker = belt ? "\nT1\n" : "CP TOOLCHANGE START"; if (const std::string out = slice_selection(bundle, what, false, outdir, file_base); out.empty()) ++failures; - else if (out.find("CP TOOLCHANGE START") == std::string::npos) { - // The filament change never rode the tower, so change_filament_gcode was not exercised. - BOOST_LOG_TRIVIAL(error) << what << " sliced but the filament change never fired (no CP TOOLCHANGE START)"; + else if (out.find(marker) == std::string::npos) { + // The filament change never fired, so change_filament_gcode was not exercised. + BOOST_LOG_TRIVIAL(error) << what << " sliced but the filament change never fired (no " + << (belt ? "T1" : "CP TOOLCHANGE START") << ")"; ++failures; } cover(bundle.prints.get_selected_preset()); From c44f2d6324bec922de9e97346fba0013f9e55443 Mon Sep 17 00:00:00 2001 From: HanifKoh <76276251+HanifKoh@users.noreply.github.com> Date: Mon, 5 Oct 2026 14:12:00 +0800 Subject: [PATCH 228/389] Remove the Unreachable MakerWorld Publish Dialog (#16121) --- localization/i18n/list.txt | 1 - resources/images/topbar_publish.svg | 4 - resources/images/topbar_publish_disable.svg | 10 - src/slic3r/CMakeLists.txt | 2 - src/slic3r/GUI/BBLTopbar.cpp | 32 --- src/slic3r/GUI/BBLTopbar.hpp | 5 - src/slic3r/GUI/Plater.cpp | 118 +-------- src/slic3r/GUI/Plater.hpp | 8 - src/slic3r/GUI/PublishDialog.cpp | 270 -------------------- src/slic3r/GUI/PublishDialog.hpp | 75 ------ 10 files changed, 1 insertion(+), 524 deletions(-) delete mode 100644 resources/images/topbar_publish.svg delete mode 100644 resources/images/topbar_publish_disable.svg delete mode 100644 src/slic3r/GUI/PublishDialog.cpp delete mode 100644 src/slic3r/GUI/PublishDialog.hpp diff --git a/localization/i18n/list.txt b/localization/i18n/list.txt index d9f2049565..4d5ab72073 100644 --- a/localization/i18n/list.txt +++ b/localization/i18n/list.txt @@ -177,7 +177,6 @@ src/slic3r/GUI/PresetHints.cpp src/slic3r/GUI/ProgressStatusBar.cpp src/slic3r/GUI/PlateSettingsDialog.cpp src/slic3r/GUI/PrivacyUpdateDialog.cpp -src/slic3r/GUI/PublishDialog.cpp src/slic3r/GUI/PublishSettingsDialog.cpp src/slic3r/GUI/SavePresetDialog.cpp src/slic3r/GUI/SceneBenchmark.cpp diff --git a/resources/images/topbar_publish.svg b/resources/images/topbar_publish.svg deleted file mode 100644 index 24159a192a..0000000000 --- a/resources/images/topbar_publish.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/resources/images/topbar_publish_disable.svg b/resources/images/topbar_publish_disable.svg deleted file mode 100644 index 4e2d6b20ec..0000000000 --- a/resources/images/topbar_publish_disable.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index b74247e338..23d5ea225b 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -483,8 +483,6 @@ set(SLIC3R_GUI_SOURCES GUI/ProjectDirtyStateManager.cpp GUI/ProjectDirtyStateManager.hpp GUI/Project.hpp - GUI/PublishDialog.cpp - GUI/PublishDialog.hpp GUI/PublishSettingsDialog.cpp GUI/PublishSettingsDialog.hpp GUI/PurgeModeDialog.cpp diff --git a/src/slic3r/GUI/BBLTopbar.cpp b/src/slic3r/GUI/BBLTopbar.cpp index eeb8df79fa..ba377ca21d 100644 --- a/src/slic3r/GUI/BBLTopbar.cpp +++ b/src/slic3r/GUI/BBLTopbar.cpp @@ -46,7 +46,6 @@ enum CUSTOM_ID ID_TOP_DROPDOWN_MENU, ID_TITLE, ID_MODEL_STORE, - ID_PUBLISH, ID_CALIB, ID_TOOL_BAR = 3200, ID_AMS_NOTEBOOK, @@ -339,10 +338,6 @@ void BBLTopbar::Init(wxFrame* parent) this->AddSpacer(FromDIP(25)); //this->AddStretchSpacer(1); - //m_publish_bitmap = create_scaled_bitmap("topbar_publish", nullptr, TOPBAR_ICON_SIZE); - //m_publish_item = this->AddTool(ID_PUBLISH, "", m_publish_bitmap); - //m_publish_disable_bitmap = create_scaled_bitmap("topbar_publish_disable", nullptr, TOPBAR_ICON_SIZE); - //m_publish_item->SetDisabledBitmap(m_publish_disable_bitmap); //this->EnableTool(m_publish_item->GetId(), false); //this->AddSpacer(FromDIP(4)); @@ -403,7 +398,6 @@ void BBLTopbar::Init(wxFrame* parent) this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnRedo, this, wxID_REDO); this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnUndo, this, wxID_UNDO); //this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnModelStoreClicked, this, ID_MODEL_STORE); - //this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnPublishClicked, this, ID_PUBLISH); } BBLTopbar::~BBLTopbar() @@ -420,12 +414,6 @@ void BBLTopbar::OnOpenProject(wxAuiToolBarEvent& event) plater->load_project(); } -//void BBLTopbar::show_publish_button(bool show) -//{ -// this->EnableTool(m_publish_item->GetId(), show); -// Refresh(); -//} - void BBLTopbar::OnSaveProject(wxAuiToolBarEvent& event) { MainFrame* main_frame = dynamic_cast(m_frame); @@ -482,22 +470,6 @@ void BBLTopbar::OnModelStoreClicked(wxAuiToolBarEvent& event) //GUI::wxGetApp().load_url(wxString(wxGetApp().app_config->get_web_host_url() + MODEL_STORE_URL)); } -void BBLTopbar::OnPublishClicked(wxAuiToolBarEvent& event) -{ - if (!wxGetApp().getAgent()) { - BOOST_LOG_TRIVIAL(info) << "publish: no agent"; - return; - } - - //no more check - //if (GUI::wxGetApp().plater()->model().objects.empty()) return; - -#ifdef ENABLE_PUBLISHING - wxGetApp().plater()->show_publish_dialog(); -#endif - wxGetApp().open_publish_page_dialog(); -} - void BBLTopbar::SetFileMenu(wxMenu* file_menu) { m_file_menu = file_menu; @@ -579,10 +551,6 @@ void BBLTopbar::Rescale() { if (m_title_ctrl) m_title_ctrl->SetTitle(m_titleText); - /*item = this->FindTool(ID_PUBLISH); - item->SetBitmap(create_scaled_bitmap("topbar_publish", this, TOPBAR_ICON_SIZE)); - item->SetDisabledBitmap(create_scaled_bitmap("topbar_publish_disable", nullptr, TOPBAR_ICON_SIZE));*/ - /*item = this->FindTool(ID_MODEL_STORE); item->SetBitmap(create_scaled_bitmap("topbar_store", this, TOPBAR_ICON_SIZE)); */ diff --git a/src/slic3r/GUI/BBLTopbar.hpp b/src/slic3r/GUI/BBLTopbar.hpp index db34d8dc80..c2ee17a2b7 100644 --- a/src/slic3r/GUI/BBLTopbar.hpp +++ b/src/slic3r/GUI/BBLTopbar.hpp @@ -52,12 +52,10 @@ public: void OnMouseCaptureLost(wxMouseCaptureLostEvent& event); void OnMenuClose(wxMenuEvent& event); void OnOpenProject(wxAuiToolBarEvent& event); - //void show_publish_button(bool show); void OnSaveProject(wxAuiToolBarEvent& event); void OnUndo(wxAuiToolBarEvent& event); void OnRedo(wxAuiToolBarEvent& event); void OnModelStoreClicked(wxAuiToolBarEvent& event); - void OnPublishClicked(wxAuiToolBarEvent &event); wxAuiToolBarItem* FindToolByCurrentPosition(); @@ -97,14 +95,11 @@ private: wxString m_titleText; - //wxAuiToolBarItem *m_publish_item; wxAuiToolBarItem* m_undo_item; wxAuiToolBarItem* m_redo_item; wxAuiToolBarItem* m_calib_item; wxAuiToolBarItem* maximize_btn; - wxBitmap m_publish_bitmap; - wxBitmap m_publish_disable_bitmap; wxBitmap maximize_bitmap; wxBitmap window_bitmap; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 0ce364afe5..0b037a2eff 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -226,7 +226,6 @@ #include "SelectMachine.hpp" #include "SendMultiMachinePage.hpp" #include "SendToPrinter.hpp" -#include "PublishDialog.hpp" #include "ConfigWizard.hpp" #include "SyncAmsInfoDialog.hpp" #include "../Utils/ASCIIFolding.hpp" @@ -331,7 +330,6 @@ wxDEFINE_EVENT(EVT_EXPORT_BEGAN, wxCommandEvent); wxDEFINE_EVENT(EVT_EXPORT_FINISHED, wxCommandEvent); wxDEFINE_EVENT(EVT_IMPORT_MODEL_ID, wxCommandEvent); wxDEFINE_EVENT(EVT_DOWNLOAD_PROJECT, wxCommandEvent); -wxDEFINE_EVENT(EVT_PUBLISH, wxCommandEvent); wxDEFINE_EVENT(EVT_OPEN_PLATESETTINGSDIALOG, wxCommandEvent); wxDEFINE_EVENT(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG, wxCommandEvent); // BBS: backup & restore @@ -339,7 +337,6 @@ wxDEFINE_EVENT(EVT_RESTORE_PROJECT, wxCommandEvent); wxDEFINE_EVENT(EVT_PRINT_FINISHED, wxCommandEvent); wxDEFINE_EVENT(EVT_SEND_CALIBRATION_FINISHED, wxCommandEvent); wxDEFINE_EVENT(EVT_SEND_FINISHED, wxCommandEvent); -wxDEFINE_EVENT(EVT_PUBLISH_FINISHED, wxCommandEvent); //BBS: repair model wxDEFINE_EVENT(EVT_REPAIR_MODEL, wxCommandEvent); wxDEFINE_EVENT(EVT_FILAMENT_COLOR_CHANGED, wxCommandEvent); @@ -7146,7 +7143,6 @@ struct Plater::priv SelectMachineDialog* m_select_machine_dlg = nullptr; SendMultiMachinePage* m_send_multi_dlg = nullptr; SendToPrinterDialog* m_send_to_sdcard_dlg = nullptr; - PublishDialog *m_publish_dlg = nullptr; // Session-level stash of the last published selection. Written on publish and on // loading a published 3MF; read when the Publish dialog is opened. @@ -7200,7 +7196,6 @@ struct Plater::priv std::string m_broken_shown_sig; bool auto_reslice_pending {false}; bool auto_reslice_after_cancel {false}; - bool m_is_publishing {false}; int m_is_RightClickInLeftUI{-1}; int m_cur_slice_plate; //BBS: m_slice_all in .gcode.3mf file case, set true when slice all @@ -7604,7 +7599,6 @@ struct Plater::priv void on_action_open_project(SimpleEvent&); void on_action_slice_plate(SimpleEvent&); void on_action_slice_all(SimpleEvent&); - void on_action_publish(wxCommandEvent &evt); void on_action_print_plate(SimpleEvent&); void open_machine_select_dialog(int plate_idx, PrintFromType print_type = PrintFromType::FROM_NORMAL); void on_action_print_all(SimpleEvent&); @@ -7622,8 +7616,6 @@ struct Plater::priv void on_3dcanvas_mouse_dragging_finished(SimpleEvent&); //void show_action_buttons(const bool is_ready_to_slice) const; - bool show_publish_dlg(bool show = true); - void update_publish_dialog_status(wxString &msg, int percent = -1); void on_action_print_plate_from_sdcard(SimpleEvent&); void on_tab_selection_changing(wxBookCtrlEvent&); @@ -7873,7 +7865,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) background_process.set_export_began_event(EVT_EXPORT_BEGAN); background_process.set_export_finished_event(EVT_EXPORT_FINISHED); this->q->Bind(EVT_SLICING_UPDATE, &priv::on_slicing_update, this); - this->q->Bind(EVT_PUBLISH, &priv::on_action_publish, this); this->q->Bind(EVT_REPAIR_MODEL, &priv::on_repair_model, this); this->q->Bind(EVT_FILAMENT_COLOR_CHANGED, &priv::on_filament_color_changed, this); this->q->Bind(EVT_INSTALL_PLUGIN_NETWORKING, &priv::install_network_plugin, this); @@ -8226,7 +8217,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) q->Bind(EVT_PRINT_FINISHED, [q](wxCommandEvent& evt) { q->print_job_finished(evt); }); q->Bind(EVT_SEND_CALIBRATION_FINISHED, [q](wxCommandEvent& evt) { q->send_calibration_job_finished(evt); }); q->Bind(EVT_SEND_FINISHED, [q](wxCommandEvent& evt) { q->send_job_finished(evt); }); - q->Bind(EVT_PUBLISH_FINISHED, [q](wxCommandEvent& evt) { q->publish_job_finished(evt);}); q->Bind(EVT_OPEN_PLATESETTINGSDIALOG, [q](wxCommandEvent& evt) { q->open_platesettings_dialog(evt);}); q->Bind(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG, [q](wxCommandEvent &evt) { q->open_filament_map_setting_dialog(evt); }); //q->Bind(EVT_GLVIEWTOOLBAR_ASSEMBLE, [q](SimpleEvent&) { q->select_view_3D("Assemble"); }); @@ -13361,11 +13351,6 @@ void Plater::priv::on_process_completed(SlicingProcessCompletedEvent &evt) show_action_buttons(true);*/ ready_to_slice = true; //this->main_frame->update_slice_print_status(MainFrame::eEventSliceUpdate, true, true); - - //BBS - if (m_is_publishing) { - m_publish_dlg->cancel(); - } } else { if((ready_to_slice) || (wxGetApp().get_mode() == comSimple)) { //this means the current plate is not the slicing plate @@ -13407,15 +13392,6 @@ void Plater::priv::on_process_completed(SlicingProcessCompletedEvent &evt) exporting_status = ExportingStatus::NOT_EXPORTING; - // BBS stop publishing if error occur - //if (m_is_publishing) { - // GCodeProcessorResult *gcode_result = background_process.get_current_gcode_result(); - // m_publish_dlg->UpdateStatus(_L("Error occurred during slicing"), -1, false); - // // if toolpath is outside - // if (!gcode_result || gcode_result->toolpath_outside) { - // m_is_publishing = false; - // } - //} if (is_finished) @@ -13424,16 +13400,6 @@ void Plater::priv::on_process_completed(SlicingProcessCompletedEvent &evt) m_is_slicing = false; this->preview->reload_print(false); q->mark_plate_toolbar_image_dirty(); - /* BBS if in publishing progress */ - if (m_is_publishing) { - if (m_publish_dlg && !m_publish_dlg->was_cancelled()) { - if (m_publish_dlg->IsShown()) { - q->publish_project(); - } else { - m_is_publishing = false; - } - } - } q->SetDropTarget(new PlaterDropTarget(*main_frame, *q)); } else @@ -13452,13 +13418,6 @@ void Plater::priv::on_process_completed(SlicingProcessCompletedEvent &evt) //not the last plate update_fff_scene_only_shells(); q->Thaw(); - if (m_is_publishing) { - if (m_publish_dlg && !m_publish_dlg->was_cancelled()) { - wxString msg = wxString::Format(_L("Slicing Plate %d"), m_cur_slice_plate + 1); - int percent = 70 * m_cur_slice_plate / partplate_list.get_plate_count(); - m_publish_dlg->UpdateStatus(msg, percent, false); - } - } } if (auto_reslice_after_cancel) { auto_reslice_after_cancel = false; @@ -13540,40 +13499,12 @@ void Plater::priv::on_action_slice_all(SimpleEvent&) //select plate q->select_plate(m_cur_slice_plate); q->reslice(); - if (!m_is_publishing) - q->select_view_3D("Preview"); + q->select_view_3D("Preview"); //BBS: wish to select all plates stats item preview->get_canvas3d()->_update_select_plate_toolbar_stats_item(true); } } -void Plater::priv::on_action_publish(wxCommandEvent &event) -{ - if (q != nullptr) { - if (event.GetInt() == EVT_PUBLISHING_START) { - // update by background slicing process - if (process_completed_with_error >= 0) { - wxString msg = _L("Please resolve the slicing errors and publish again."); - this->m_publish_dlg->UpdateStatus(msg, false); - return; - } - - m_is_publishing = true; - // if slicing is ready publish project, else slicing first - if (partplate_list.is_all_slice_results_valid()) { - q->publish_project(); - } else { - BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ":received slice project in background event\n"; - SimpleEvent evt = SimpleEvent(EVT_GLTOOLBAR_SLICE_ALL); - this->on_action_slice_all(evt); - } - } else { - m_is_publishing = false; - show_publish_dlg(false); - } - } -} - void Plater::priv::on_action_print_plate(SimpleEvent&) { if (q != nullptr) { @@ -14349,11 +14280,6 @@ int Plater::get_send_finished_event() return EVT_SEND_FINISHED; } -int Plater::get_publish_finished_event() -{ - return EVT_PUBLISH_FINISHED; -} - void Plater::priv::set_current_canvas_as_dirty() { if (current_panel == view3D) @@ -14762,31 +14688,6 @@ bool Plater::priv::can_reload_from_disk() const return !paths.empty(); } -void Plater::priv::update_publish_dialog_status(wxString &msg, int percent) -{ - if (m_publish_dlg) - m_publish_dlg->UpdateStatus(msg, percent); -} - -bool Plater::priv::show_publish_dlg(bool show) -{ - if (q != nullptr) { BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ":recevied publish event\n"; } - - if (!m_publish_dlg) m_publish_dlg = new PublishDialog(q); - if (show) { - m_publish_dlg->reset(); - m_publish_dlg->start_slicing(); - //m_publish_dlg->Show(); - m_publish_dlg->ShowModal(); - } else { - m_publish_dlg->EndModal(wxID_OK); - //cancel the slicing - if (this->background_process.running()) - this->background_process.stop(); - } - return true; -} - //BBS: add bed exclude area void Plater::priv::set_bed_shape(const Pointfs &shape, const Pointfs &exclude_areas, @@ -19915,11 +19816,6 @@ int Plater::export_3mf(const boost::filesystem::path& output_path, SaveStrategy return ret; } -void Plater::publish_project() -{ - return; -} - void Plater::reload_from_disk() { @@ -20562,13 +20458,6 @@ void Plater::send_job_finished(wxCommandEvent& evt) // curr_monitor->get_tabpanel()->ChangeSelection(MonitorPanel::PrinterTab::PT_STATUS); } -void Plater::publish_job_finished(wxCommandEvent &evt) -{ - p->m_publish_dlg->EndModal(wxID_OK); - // GUI::wxGetApp().load_url(evt.GetString()); - //GUI::wxGetApp().open_publish_page_dialog(evt.GetString()); -} - // Called when the Eject button is pressed. void Plater::eject_drive() { @@ -22866,11 +22755,6 @@ void Plater::show_object_info() notify_manager->bbl_show_objectsinfo_notification(info_text, non_manifold_edges > 0, !(p->current_panel == p->view3D)); } -bool Plater::show_publish_dialog(bool show) -{ - return p->show_publish_dlg(show); -} - void Plater::post_process_string_object_exception(StringObjectException &err) { PresetBundle* preset_bundle = wxGetApp().preset_bundle; diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 77aff736f0..21fda05246 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -116,12 +116,8 @@ enum class ActionButtonType : int; // (Sidebar::priv::m_menu_filament_id) rather than an explicit index. inline constexpr int kSidebarContextMenuFilamentId = -2; -#define EVT_PUBLISHING_START 1 -#define EVT_PUBLISHING_STOP 2 - //BBS: add EVT_SLICING_UPDATE declare here wxDECLARE_EVENT(EVT_SLICING_UPDATE, Slic3r::SlicingStatusEvent); -wxDECLARE_EVENT(EVT_PUBLISH, wxCommandEvent); wxDECLARE_EVENT(EVT_OPEN_PLATESETTINGSDIALOG, wxCommandEvent); // Explanation of int param @@ -571,7 +567,6 @@ public: int export_3mf(const boost::filesystem::path& output_path = boost::filesystem::path(), SaveStrategy strategy = SaveStrategy::Default, int export_plate_idx = -1, Export3mfProgressFn proFn = nullptr); //BBS - void publish_project(); void reload_from_disk(); void replace_with_stl(); @@ -606,7 +601,6 @@ public: void send_calibration_job_finished(wxCommandEvent &evt); void print_job_finished(wxCommandEvent &evt); void send_job_finished(wxCommandEvent& evt); - void publish_job_finished(wxCommandEvent& evt); void open_platesettings_dialog(wxCommandEvent& evt); void open_filament_map_setting_dialog(wxCommandEvent &evt); void on_change_color_mode(SimpleEvent& evt); @@ -717,7 +711,6 @@ public: int get_send_calibration_finished_event(); int get_print_finished_event(); int get_send_finished_event(); - int get_publish_finished_event(); void set_current_canvas_as_dirty(); void unbind_canvas_event_handlers(); @@ -842,7 +835,6 @@ public: //BBS: show object info void show_object_info(); //BBS - bool show_publish_dialog(bool show = true); //BBS: post process string object exception strings by warning types void post_process_string_object_exception(StringObjectException &err); void update_objects_position_when_select_preset(const std::function &select_prest); diff --git a/src/slic3r/GUI/PublishDialog.cpp b/src/slic3r/GUI/PublishDialog.cpp deleted file mode 100644 index f9c0beadb9..0000000000 --- a/src/slic3r/GUI/PublishDialog.cpp +++ /dev/null @@ -1,270 +0,0 @@ -#include "PublishDialog.hpp" -#include "GUI_App.hpp" - -#include -#include -#include "slic3r/GUI/Widgets/AMSItem.hpp" -#include "slic3r/GUI/GUI_Utils.hpp" -#include -#include -#include -#include -#include "slic3r/GUI/Widgets/Label.hpp" -#include "slic3r/GUI/Widgets/ProgressBar.hpp" -#include "slic3r/GUI/Widgets/Button.hpp" -#include "slic3r/GUI/Widgets/StateColor.hpp" -#include -#include -#include "slic3r/GUI/Plater.hpp" -#include -#include -#include -#include "wx/evtloop.h" - -#include "libslic3r/Model.hpp" -#include "libslic3r/Polygon.hpp" -#include "MainFrame.hpp" -#include "GUI_App.hpp" - - -static const wxColour TEXT_LIGHT_GRAY = wxColour(107, 107, 107); - -namespace Slic3r { -namespace GUI { - -static wxString PUBLISH_STEP_STRING[STEP_COUNT] = { - _L("Slice all plates to obtain time and filament estimation"), - _L("Packing project data into 3MF file"), - _L("Uploading 3MF"), - _L("Jump to model publish web page") -}; - -static wxString NOTE_STRING = _L("Note: The preparation may take several minutes. Please be patient."); - -PublishDialog::PublishDialog(Plater *plater) - : DPIDialog(static_cast(wxGetApp().mainframe), wxID_ANY, _L("Publish"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX) - , m_plater(plater) -{ - this->SetSize(wxSize(FromDIP(540),FromDIP(400))); - - this->SetSizeHints(wxDefaultSize, wxDefaultSize); - - wxBoxSizer *top_sizer = new wxBoxSizer(wxHORIZONTAL); - - wxBoxSizer *m_main_sizer = new wxBoxSizer(wxVERTICAL); - - m_main_sizer->Add(0, FromDIP(30), 0, wxEXPAND, 0); - - m_step_panel = new wxPanel(this, wxID_ANY); - wxBoxSizer *step_sizer = create_publish_step_sizer(); - m_step_panel->SetSizer(step_sizer); - m_step_panel->SetBackgroundColour(wxColour(248, 248, 248)); - - m_main_sizer->Add(m_step_panel, 1, wxEXPAND, 0); - - m_main_sizer->Add(0, FromDIP(20), 0, wxEXPAND, 0); - - m_text_note = new wxStaticText(this, wxID_ANY, NOTE_STRING, wxDefaultPosition, wxDefaultSize, 0); - m_text_note->SetFont(Label::Body_14); - m_text_note->SetForegroundColour(TEXT_LIGHT_GRAY); - m_text_note->Wrap(-1); - m_main_sizer->Add(m_text_note, 0, wxALL | wxEXPAND, 0); - m_main_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 0); - - wxStaticLine *m_staticline = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL); - m_main_sizer->Add(m_staticline, 0, wxALL | wxEXPAND, FromDIP(0)); - m_main_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 0); - - wxBoxSizer *m_progress_text_sizer = new wxBoxSizer(wxHORIZONTAL); - m_text_progress = new wxStaticText(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0); - m_text_progress->Wrap(-1); - m_text_progress->SetFont(Label::Body_12); - m_text_progress->SetForegroundColour(TEXT_LIGHT_GRAY); - - m_progress_text_sizer->Add(FromDIP(20), 0, 0, wxEXPAND | wxALL, 0); - m_progress_text_sizer->Add(m_text_progress, 1, wxALL | wxEXPAND, 0); - m_main_sizer->Add(m_progress_text_sizer, 0, wxALL | wxEXPAND, 0); - - wxBoxSizer *m_progress_sizer = new wxBoxSizer(wxHORIZONTAL); - - m_progress_sizer->Add(FromDIP(20), 0, 0, wxEXPAND | wxALL, 0); - - m_progress = new ProgressBar(this, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize); - m_progress->SetHeight(FromDIP(8)); - m_progress->SetFont(Label::Head_10); - m_progress_sizer->Add(m_progress, 1, wxALIGN_CENTER_VERTICAL | wxALL, 0); - - m_progress_sizer->Add(FromDIP(20), 0, 0, wxEXPAND, 0); - - m_btn_cancel = new Button(this, _L("Cancel")); - m_progress_sizer->Add(m_btn_cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, FromDIP(5)); - StateColor btn_bg_green(std::pair(wxColour(0, 137, 123), StateColor::Pressed), - std::pair(wxColour(38, 166, 154), StateColor::Hovered), - std::pair(wxColour(255, 255, 255), StateColor::Normal)); - StateColor text_color(std::pair(wxColour(255, 255, 255), StateColor::Pressed), - std::pair(wxColour(255, 255, 255), StateColor::Hovered), - std::pair(TEXT_LIGHT_GRAY, StateColor::Normal)); - m_btn_cancel->SetFont(Label::Body_12); - m_btn_cancel->SetBackgroundColor(btn_bg_green); - m_btn_cancel->SetBorderColor(wxColour(0, 150, 136)); - m_btn_cancel->SetTextColor(text_color); - m_btn_cancel->SetSize(wxSize(FromDIP(60), FromDIP(20))); - m_btn_cancel->SetMinSize(wxSize(FromDIP(60), FromDIP(20))); - m_btn_cancel->SetCornerRadius(FromDIP(10)); - - m_progress_sizer->Add(FromDIP(20), 0, 0, wxEXPAND | wxALL, 0); - - m_main_sizer->Add(m_progress_sizer, 0, wxEXPAND, FromDIP(0)); - - wxBoxSizer *m_bottom_sizer; - m_bottom_sizer = new wxBoxSizer(wxHORIZONTAL); - - m_bottom_sizer->Add(FromDIP(20), 0, 0, wxEXPAND, 0); - - m_text_errors = new wxStaticText(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0); - m_text_errors->Wrap(-1); - m_text_errors->SetFont(Label::Body_12); - m_text_errors->SetForegroundColour(wxColour(255, 111, 0)); - m_bottom_sizer->Add(m_text_errors, 1, wxALL, 0); - - m_main_sizer->Add(m_bottom_sizer, 0, wxEXPAND, 0); - m_main_sizer->Add(0, FromDIP(10), 0, wxEXPAND, 0); - - top_sizer->Add(FromDIP(30), 0, 0, wxEXPAND, 0); - top_sizer->Add(m_main_sizer, 1, wxALL | wxEXPAND, 0); - top_sizer->Add(FromDIP(30), 0, 0, wxEXPAND, 0); - - this->SetSizerAndFit(top_sizer); - this->Layout(); - - this->Centre(wxBOTH); - - m_btn_cancel->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { - this->cancel(); - }); - - Bind(wxEVT_CLOSE_WINDOW, &PublishDialog::on_close, this); - wxGetApp().UpdateDlgDarkUI(this); -} - -void PublishDialog::cancel() -{ - m_was_cancelled = true; - m_btn_cancel->Enable(false); - m_text_progress->SetLabelText(_L("Publish was canceled")); - wxCloseEvent evt; - this->on_close(evt); -} - -void PublishDialog::start_slicing() -{ - SetPublishStep(PublishStep::STEP_SLICING); - - wxCommandEvent *evt = new wxCommandEvent(EVT_PUBLISH); - evt->SetInt(EVT_PUBLISHING_START); - wxQueueEvent(m_plater, evt); -} - -bool PublishDialog::UpdateStatus(wxString &msg, int percent, bool yield) -{ - if (m_was_cancelled) return false; - - if (percent >= 0) - m_progress->SetValue(percent); - m_text_progress->SetLabelText(msg); - - if (yield) - wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI | wxEVT_CATEGORY_USER_INPUT); - return true; -} - -void PublishDialog::Pulse(wxString &msg, bool &skip) -{ - if (!msg.IsEmpty()) - m_text_progress->SetLabelText(msg); - wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI | wxEVT_CATEGORY_USER_INPUT); - skip = m_was_cancelled; -} - -void PublishDialog::SetPublishStep(PublishStep step, bool yield, int percent) -{ - m_publish_steps->SelectItem((int)step); - if (step == PublishStep::STEP_SLICING) { - m_text_progress->SetLabelText(_L("Slicing Plate 1")); - if (percent > 0) - m_progress->SetValue(percent); - else - m_progress->SetValue(0); - } else if (step == PublishStep::STEP_PACKING) { - m_text_progress->SetLabelText(_L("Packing data to 3MF")); - if (percent > 0) - m_progress->SetValue(percent); - else - m_progress->SetValue(70); - } else if (step == PublishStep::STEP_UPLOADING) { - m_text_progress->SetLabelText(_L("Uploading data")); - if (percent > 0) - m_progress->SetValue(percent); - else - m_progress->SetValue(85); - } else if (step == PublishStep::STEP_FILL_INFO) { - m_text_progress->SetLabelText(_L("Jump to webpage")); - m_progress->SetValue(100); - } - - if (yield) - wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI | wxEVT_CATEGORY_USER_INPUT); -} - -wxBoxSizer *PublishDialog::create_publish_step_sizer() -{ - auto sizer = new wxBoxSizer(wxHORIZONTAL); - - sizer->Add(FromDIP(30), 0, 0, wxEXPAND, 0); - - auto middle_sizer = new wxBoxSizer(wxVERTICAL); - - m_publish_steps = new StepIndicator(m_step_panel, wxID_ANY); - StateColor bg_color(std::pair(wxColour(248, 248, 248), StateColor::Normal)); - m_publish_steps->SetBackgroundColor(bg_color); - m_publish_steps->SetFont(Label::Body_14); - - for (int i = 0; i < (int) PublishStep::STEP_PUBLISH_COUNT; i++) { - m_publish_steps->AppendItem(PUBLISH_STEP_STRING[i]); - } - - middle_sizer->Add(0, FromDIP(30), 0, wxEXPAND, 0); - middle_sizer->Add(m_publish_steps, 1, wxALL | wxEXPAND, 0); - middle_sizer->Add(0, FromDIP(30), 0, wxEXPAND, 0); - - sizer->Add(middle_sizer, 1, wxALL | wxEXPAND, 0); - - sizer->Add(FromDIP(30), 0, 0, wxEXPAND, 0); - - return sizer; -} - -void PublishDialog::on_dpi_changed(const wxRect &suggested_rect) -{ - Fit(); - Refresh(); -} - -void PublishDialog::on_close(wxCloseEvent &event) -{ - wxCommandEvent *evt = new wxCommandEvent(EVT_PUBLISH); - evt->SetInt(EVT_PUBLISHING_STOP); - wxQueueEvent(m_plater, evt); -} - -void PublishDialog::reset() -{ - m_btn_cancel->Enable(); - m_was_cancelled = false; - SetPublishStep(PublishStep::STEP_SLICING); - m_text_errors->Hide(); -} - - -} // GUI -} // Slic3r diff --git a/src/slic3r/GUI/PublishDialog.hpp b/src/slic3r/GUI/PublishDialog.hpp deleted file mode 100644 index 3accc34784..0000000000 --- a/src/slic3r/GUI/PublishDialog.hpp +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef slic3r_PublishDialog_hpp_ -#define slic3r_PublishDialog_hpp_ - - -#include "I18N.hpp" - -#include "slic3r/GUI/GUI_Utils.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "wxExtensions.hpp" -#include "Plater.hpp" -#include "Widgets/StepCtrl.hpp" -#include "Widgets/ProgressDialog.hpp" -#include "Widgets/Button.hpp" -#include "Widgets/ProgressBar.hpp" - - -namespace Slic3r { -namespace GUI { - -enum PublishStep { - STEP_SLICING = 0, - STEP_PACKING, - STEP_UPLOADING, - STEP_FILL_INFO, - STEP_PUBLISH_COUNT, -}; - -class PublishDialog : public DPIDialog -{ -public: - PublishDialog(Plater* plater = nullptr); - - bool UpdateStatus(wxString &msg, int percent = -1, bool yeild = true); - void Pulse(wxString &msg, bool &skip); - void SetPublishStep(PublishStep step, bool yeild = false, int percent = -1); - void start_slicing(); - void reset(); - bool was_cancelled() { return m_was_cancelled; } - void cancel(); - -protected: - wxPanel* m_step_panel; - ::StepIndicator *m_publish_steps; - wxStaticText *m_text_note; - wxStaticText *m_text_progress; - ProgressBar *m_progress; - Button* m_btn_cancel; - wxStaticText *m_text_errors; - Plater * m_plater{nullptr}; - bool m_was_cancelled { false }; - - wxBoxSizer* create_publish_step_sizer(); - void on_close(wxCloseEvent &event); - void on_dpi_changed(const wxRect &suggested_rect) override; -}; - -} // GUI -} // Slic3r - - -#endif /* slic3r_BedShapeDialog_hpp_ */ From 017bf0a2c83263dfb5d150a175d87174d9c69aa7 Mon Sep 17 00:00:00 2001 From: HanifKoh <76276251+HanifKoh@users.noreply.github.com> Date: Mon, 5 Oct 2026 14:16:59 +0800 Subject: [PATCH 229/389] Remove Unused Web Resources: Duplicate Swiper and jQuery, Test Data and Images (#16119) * Trim the Bundled Swiper Library to the Files the Web Pages Load * Remove Unused jQuery Copies, Model Test Data and Unreferenced Web Images --- resources/web/dialog/js/jquery-2.1.1.min.js | 4 - resources/web/guide/swiper/LICENSE | 20 - resources/web/guide/swiper/README.md | 11 - .../angular/angular/src/public-api.d.ts | 3 - .../angular/src/swiper-slide.directive.d.ts | 26 - .../angular/angular/src/swiper.component.d.ts | 252 - .../angular/angular/src/swiper.module.d.ts | 9 - .../angular/angular/src/utils/get-params.d.ts | 6 - .../angular/src/utils/params-list.d.ts | 1 - .../angular/angular/src/utils/utils.d.ts | 6 - .../angular/bundles/swiper_angular.umd.js | 1830 --- .../angular/bundles/swiper_angular.umd.js.map | 1 - .../angular/esm2015/angular/src/public-api.js | 7 - .../angular/src/swiper-slide.directive.js | 60 - .../esm2015/angular/src/swiper.component.js | 1126 -- .../esm2015/angular/src/swiper.module.js | 19 - .../esm2015/angular/src/utils/get-params.js | 38 - .../esm2015/angular/src/utils/params-list.js | 115 - .../esm2015/angular/src/utils/utils.js | 49 - .../swiper/angular/esm2015/swiper-angular.js | 2 - .../swiper/angular/esm2015/swiper_angular.js | 5 - .../swiper/angular/fesm2015/swiper_angular.js | 1402 --- .../angular/fesm2015/swiper_angular.js.map | 1 - .../web/guide/swiper/angular/package.json | 19 - .../guide/swiper/angular/swiper-angular.d.ts | 1 - .../guide/swiper/angular/swiper_angular.d.ts | 5 - .../swiper/core/breakpoints/getBreakpoint.js | 40 - .../guide/swiper/core/breakpoints/index.js | 6 - .../swiper/core/breakpoints/setBreakpoint.js | 72 - .../guide/swiper/core/check-overflow/index.js | 38 - .../guide/swiper/core/classes/addClasses.js | 52 - .../web/guide/swiper/core/classes/index.js | 6 - .../swiper/core/classes/removeClasses.js | 9 - resources/web/guide/swiper/core/core.js | 610 - resources/web/guide/swiper/core/defaults.js | 120 - .../web/guide/swiper/core/events-emitter.js | 108 - .../web/guide/swiper/core/events/index.js | 97 - .../web/guide/swiper/core/events/onClick.js | 13 - .../web/guide/swiper/core/events/onResize.js | 43 - .../web/guide/swiper/core/events/onScroll.js | 35 - .../guide/swiper/core/events/onTouchEnd.js | 143 - .../guide/swiper/core/events/onTouchMove.js | 222 - .../guide/swiper/core/events/onTouchStart.js | 114 - .../guide/swiper/core/grab-cursor/index.js | 6 - .../swiper/core/grab-cursor/setGrabCursor.js | 9 - .../core/grab-cursor/unsetGrabCursor.js | 9 - .../web/guide/swiper/core/images/index.js | 6 - .../web/guide/swiper/core/images/loadImage.js | 37 - .../guide/swiper/core/images/preloadImages.js | 19 - resources/web/guide/swiper/core/loop/index.js | 8 - .../web/guide/swiper/core/loop/loopCreate.js | 59 - .../web/guide/swiper/core/loop/loopDestroy.js | 10 - .../web/guide/swiper/core/loop/loopFix.js | 41 - .../guide/swiper/core/moduleExtendParams.js | 38 - .../swiper/core/modules/observer/observer.js | 75 - .../swiper/core/modules/resize/resize.js | 68 - .../web/guide/swiper/core/slide/index.js | 16 - .../web/guide/swiper/core/slide/slideNext.js | 26 - .../web/guide/swiper/core/slide/slidePrev.js | 59 - .../web/guide/swiper/core/slide/slideReset.js | 5 - .../web/guide/swiper/core/slide/slideTo.js | 189 - .../swiper/core/slide/slideToClickedSlide.js | 39 - .../guide/swiper/core/slide/slideToClosest.js | 32 - .../guide/swiper/core/slide/slideToLoop.js | 10 - .../web/guide/swiper/core/transition/index.js | 8 - .../swiper/core/transition/setTransition.js | 9 - .../swiper/core/transition/transitionEmit.js | 33 - .../swiper/core/transition/transitionEnd.js | 16 - .../swiper/core/transition/transitionStart.js | 19 - .../swiper/core/translate/getTranslate.js | 22 - .../web/guide/swiper/core/translate/index.js | 12 - .../swiper/core/translate/maxTranslate.js | 3 - .../swiper/core/translate/minTranslate.js | 3 - .../swiper/core/translate/setTranslate.js | 48 - .../swiper/core/translate/translateTo.js | 85 - .../web/guide/swiper/core/update/index.js | 20 - .../swiper/core/update/updateActiveIndex.js | 70 - .../swiper/core/update/updateAutoHeight.js | 49 - .../swiper/core/update/updateClickedSlide.js | 36 - .../swiper/core/update/updateProgress.js | 50 - .../guide/swiper/core/update/updateSize.js | 33 - .../guide/swiper/core/update/updateSlides.js | 309 - .../swiper/core/update/updateSlidesClasses.js | 64 - .../swiper/core/update/updateSlidesOffset.js | 8 - .../core/update/updateSlidesProgress.js | 44 - .../web/guide/swiper/modules/a11y/a11y.js | 283 - .../web/guide/swiper/modules/a11y/a11y.less | 9 - .../guide/swiper/modules/a11y/a11y.min.css | 1 - .../web/guide/swiper/modules/a11y/a11y.scss | 9 - .../guide/swiper/modules/autoplay/autoplay.js | 222 - .../swiper/modules/autoplay/autoplay.less | 0 .../swiper/modules/autoplay/autoplay.min.css | 0 .../swiper/modules/autoplay/autoplay.scss | 0 .../swiper/modules/controller/controller.js | 191 - .../swiper/modules/controller/controller.less | 0 .../modules/controller/controller.min.css | 0 .../swiper/modules/controller/controller.scss | 0 .../modules/effect-cards/effect-cards.js | 125 - .../modules/effect-cards/effect-cards.less | 8 - .../modules/effect-cards/effect-cards.min.css | 1 - .../modules/effect-cards/effect-cards.scss | 7 - .../effect-coverflow/effect-coverflow.js | 103 - .../effect-coverflow/effect-coverflow.less | 2 - .../effect-coverflow/effect-coverflow.min.css | 0 .../effect-coverflow/effect-coverflow.scss | 2 - .../effect-creative/effect-creative.js | 154 - .../effect-creative/effect-creative.less | 7 - .../effect-creative/effect-creative.min.css | 1 - .../effect-creative/effect-creative.scss | 7 - .../swiper/modules/effect-cube/effect-cube.js | 180 - .../modules/effect-cube/effect-cube.less | 59 - .../modules/effect-cube/effect-cube.min.css | 1 - .../modules/effect-cube/effect-cube.scss | 59 - .../swiper/modules/effect-fade/effect-fade.js | 70 - .../modules/effect-fade/effect-fade.less | 20 - .../modules/effect-fade/effect-fade.min.css | 1 - .../modules/effect-fade/effect-fade.scss | 20 - .../swiper/modules/effect-flip/effect-flip.js | 102 - .../modules/effect-flip/effect-flip.less | 24 - .../modules/effect-flip/effect-flip.min.css | 1 - .../modules/effect-flip/effect-flip.scss | 24 - .../swiper/modules/free-mode/free-mode.js | 245 - .../swiper/modules/free-mode/free-mode.less | 4 - .../modules/free-mode/free-mode.min.css | 1 - .../swiper/modules/free-mode/free-mode.scss | 4 - .../web/guide/swiper/modules/grid/grid.js | 116 - .../web/guide/swiper/modules/grid/grid.less | 7 - .../guide/swiper/modules/grid/grid.min.css | 1 - .../web/guide/swiper/modules/grid/grid.scss | 7 - .../hash-navigation/hash-navigation.js | 96 - .../hash-navigation/hash-navigation.less | 2 - .../hash-navigation/hash-navigation.min.css | 0 .../hash-navigation/hash-navigation.scss | 0 .../guide/swiper/modules/history/history.js | 150 - .../guide/swiper/modules/history/history.less | 0 .../swiper/modules/history/history.min.css | 0 .../guide/swiper/modules/history/history.scss | 0 .../guide/swiper/modules/keyboard/keyboard.js | 131 - .../swiper/modules/keyboard/keyboard.less | 0 .../swiper/modules/keyboard/keyboard.min.css | 0 .../swiper/modules/keyboard/keyboard.scss | 0 .../web/guide/swiper/modules/lazy/lazy.js | 283 - .../web/guide/swiper/modules/lazy/lazy.less | 34 - .../guide/swiper/modules/lazy/lazy.min.css | 1 - .../web/guide/swiper/modules/lazy/lazy.scss | 34 - .../modules/manipulation/manipulation.js | 16 - .../modules/manipulation/manipulation.less | 0 .../modules/manipulation/manipulation.min.css | 0 .../modules/manipulation/manipulation.scss | 0 .../modules/manipulation/methods/addSlide.js | 64 - .../manipulation/methods/appendSlide.js | 27 - .../manipulation/methods/prependSlide.js | 34 - .../manipulation/methods/removeAllSlides.js | 10 - .../manipulation/methods/removeSlide.js | 47 - .../swiper/modules/mousewheel/mousewheel.js | 422 - .../swiper/modules/mousewheel/mousewheel.less | 0 .../modules/mousewheel/mousewheel.min.css | 0 .../swiper/modules/mousewheel/mousewheel.scss | 0 .../swiper/modules/navigation/navigation.js | 185 - .../swiper/modules/navigation/navigation.less | 55 - .../modules/navigation/navigation.min.css | 1 - .../swiper/modules/navigation/navigation.scss | 56 - .../swiper/modules/pagination/pagination.js | 410 - .../swiper/modules/pagination/pagination.less | 163 - .../modules/pagination/pagination.min.css | 1 - .../swiper/modules/pagination/pagination.scss | 163 - .../guide/swiper/modules/parallax/parallax.js | 114 - .../swiper/modules/parallax/parallax.less | 0 .../swiper/modules/parallax/parallax.min.css | 0 .../swiper/modules/parallax/parallax.scss | 0 .../swiper/modules/scrollbar/scrollbar.js | 361 - .../swiper/modules/scrollbar/scrollbar.less | 38 - .../modules/scrollbar/scrollbar.min.css | 1 - .../swiper/modules/scrollbar/scrollbar.scss | 38 - .../web/guide/swiper/modules/thumbs/thumbs.js | 204 - .../guide/swiper/modules/thumbs/thumbs.less | 5 - .../swiper/modules/thumbs/thumbs.min.css | 0 .../guide/swiper/modules/thumbs/thumbs.scss | 5 - .../guide/swiper/modules/virtual/virtual.js | 291 - .../guide/swiper/modules/virtual/virtual.less | 17 - .../swiper/modules/virtual/virtual.min.css | 1 - .../guide/swiper/modules/virtual/virtual.scss | 17 - .../web/guide/swiper/modules/zoom/zoom.js | 612 - .../web/guide/swiper/modules/zoom/zoom.less | 20 - .../guide/swiper/modules/zoom/zoom.min.css | 1 - .../web/guide/swiper/modules/zoom/zoom.scss | 20 - .../guide/swiper/node_modules/dom7/LICENSE | 21 - .../guide/swiper/node_modules/dom7/README.md | 47 - .../guide/swiper/node_modules/dom7/dom7.d.ts | 628 - .../swiper/node_modules/dom7/dom7.esm.js | 1478 --- .../guide/swiper/node_modules/dom7/dom7.js | 1768 --- .../swiper/node_modules/dom7/dom7.js.map | 1 - .../swiper/node_modules/dom7/dom7.min.js | 13 - .../swiper/node_modules/dom7/dom7.min.js.map | 1 - .../swiper/node_modules/dom7/package.json | 60 - .../swiper/node_modules/ssr-window/LICENSE | 21 - .../swiper/node_modules/ssr-window/README.md | 59 - .../node_modules/ssr-window/package.json | 55 - .../node_modules/ssr-window/ssr-window.esm.js | 148 - .../node_modules/ssr-window/ssr-window.umd.js | 163 - .../ssr-window/ssr-window.umd.js.map | 1 - .../ssr-window/ssr-window.umd.min.js | 13 - .../ssr-window/ssr-window.umd.min.js.map | 1 - .../ssr-window/types/document.d.ts | 36 - .../node_modules/ssr-window/types/extend.d.ts | 2 - .../ssr-window/types/ssr-window.d.ts | 4 - .../node_modules/ssr-window/types/window.d.ts | 72 - resources/web/guide/swiper/package.json | 191 - resources/web/guide/swiper/postinstall.js | 36 - .../guide/swiper/react/get-changed-params.js | 43 - .../web/guide/swiper/react/get-children.js | 46 - .../web/guide/swiper/react/get-params.js | 46 - .../web/guide/swiper/react/init-swiper.js | 36 - resources/web/guide/swiper/react/loop.js | 78 - .../web/guide/swiper/react/params-list.js | 4 - .../web/guide/swiper/react/swiper-react.d.ts | 467 - .../web/guide/swiper/react/swiper-react.js | 15 - .../web/guide/swiper/react/swiper-slide.js | 79 - resources/web/guide/swiper/react/swiper.js | 202 - .../web/guide/swiper/react/update-swiper.js | 131 - .../react/use-isomorphic-layout-effect.js | 9 - resources/web/guide/swiper/react/utils.js | 37 - resources/web/guide/swiper/react/virtual.js | 33 - .../swiper/shared/classes-to-selector.js | 4 - .../shared/create-element-if-not-defined.js | 23 - .../web/guide/swiper/shared/create-shadow.js | 13 - resources/web/guide/swiper/shared/dom.js | 46 - .../web/guide/swiper/shared/effect-init.js | 31 - .../web/guide/swiper/shared/effect-target.js | 10 - .../shared/effect-virtual-transition-end.js | 35 - .../web/guide/swiper/shared/get-browser.js | 26 - .../web/guide/swiper/shared/get-device.js | 57 - .../web/guide/swiper/shared/get-support.js | 41 - resources/web/guide/swiper/shared/utils.js | 197 - .../guide/swiper/svelte/get-changed-params.js | 39 - .../web/guide/swiper/svelte/get-params.js | 44 - .../web/guide/swiper/svelte/init-swiper.js | 36 - .../web/guide/swiper/svelte/params-list.js | 4 - .../guide/swiper/svelte/swiper-slide.svelte | 95 - .../guide/swiper/svelte/swiper-svelte.d.ts | 431 - .../web/guide/swiper/svelte/swiper-svelte.js | 15 - .../web/guide/swiper/svelte/swiper.svelte | 178 - .../web/guide/swiper/svelte/update-swiper.js | 132 - resources/web/guide/swiper/svelte/utils.js | 37 - resources/web/guide/swiper/swiper-bundle.css | 613 - .../guide/swiper/swiper-bundle.esm.browser.js | 10060 --------------- .../swiper/swiper-bundle.esm.browser.js.map | 1 - .../swiper/swiper-bundle.esm.browser.min.js | 14 - .../swiper-bundle.esm.browser.min.js.map | 1 - .../web/guide/swiper/swiper-bundle.esm.js | 42 - resources/web/guide/swiper/swiper-bundle.js | 10068 ---------------- .../web/guide/swiper/swiper-bundle.js.map | 1 - .../web/guide/swiper/swiper-bundle.min.css | 13 - .../web/guide/swiper/swiper-bundle.min.js | 14 - .../web/guide/swiper/swiper-bundle.min.js.map | 1 - resources/web/guide/swiper/swiper-vars.less | 1 - resources/web/guide/swiper/swiper-vars.scss | 1 - resources/web/guide/swiper/swiper.d.ts | 58 - resources/web/guide/swiper/swiper.esm.js | 37 - resources/web/guide/swiper/swiper.less | 169 - resources/web/guide/swiper/swiper.min.css | 13 - resources/web/guide/swiper/swiper.scss | 170 - resources/web/guide/swiper/types/index.d.ts | 5 - .../web/guide/swiper/types/modules/a11y.d.ts | 89 - .../guide/swiper/types/modules/autoplay.d.ts | 101 - .../swiper/types/modules/controller.d.ts | 35 - .../swiper/types/modules/effect-cards.d.ts | 20 - .../types/modules/effect-coverflow.d.ts | 50 - .../swiper/types/modules/effect-creative.d.ts | 93 - .../swiper/types/modules/effect-cube.d.ts | 30 - .../swiper/types/modules/effect-fade.d.ts | 20 - .../swiper/types/modules/effect-flip.d.ts | 26 - .../guide/swiper/types/modules/free-mode.d.ts | 59 - .../web/guide/swiper/types/modules/grid.d.ts | 21 - .../swiper/types/modules/hash-navigation.d.ts | 32 - .../guide/swiper/types/modules/history.d.ts | 29 - .../guide/swiper/types/modules/keyboard.d.ts | 46 - .../web/guide/swiper/types/modules/lazy.d.ts | 82 - .../swiper/types/modules/manipulation.d.ts | 70 - .../swiper/types/modules/mousewheel.d.ts | 75 - .../swiper/types/modules/navigation.d.ts | 86 - .../swiper/types/modules/pagination.d.ts | 285 - .../guide/swiper/types/modules/parallax.d.ts | 12 - .../swiper/types/modules/public-api.d.ts | 24 - .../guide/swiper/types/modules/scrollbar.d.ts | 115 - .../guide/swiper/types/modules/thumbs.d.ts | 54 - .../guide/swiper/types/modules/virtual.d.ts | 122 - .../web/guide/swiper/types/modules/zoom.d.ts | 79 - resources/web/guide/swiper/types/shared.d.ts | 3 - .../web/guide/swiper/types/swiper-class.d.ts | 472 - .../web/guide/swiper/types/swiper-events.d.ts | 362 - .../guide/swiper/types/swiper-options.d.ts | 1205 -- .../guide/swiper/vue/get-changed-params.js | 43 - .../web/guide/swiper/vue/get-children.js | 41 - resources/web/guide/swiper/vue/get-params.js | 48 - resources/web/guide/swiper/vue/init-swiper.js | 36 - resources/web/guide/swiper/vue/loop.js | 79 - resources/web/guide/swiper/vue/params-list.js | 4 - .../web/guide/swiper/vue/swiper-slide.js | 83 - .../web/guide/swiper/vue/swiper-vue.d.ts | 859 -- resources/web/guide/swiper/vue/swiper-vue.js | 15 - resources/web/guide/swiper/vue/swiper.js | 640 - .../web/guide/swiper/vue/update-swiper.js | 131 - resources/web/guide/swiper/vue/utils.js | 37 - resources/web/guide/swiper/vue/virtual.js | 35 - resources/web/homepage/img/3d_text.png | Bin 27468 -> 0 bytes resources/web/homepage/img/a.jpg | Bin 56697 -> 0 bytes resources/web/homepage/img/b.jpg | Bin 38492 -> 0 bytes .../img/high_speed_print_at_quality.png | Bin 48662 -> 0 bytes resources/web/homepage/img/i1.png | Bin 2509 -> 0 bytes resources/web/homepage/img/i3.png | Bin 5326 -> 0 bytes resources/web/homepage/img/i6.png | Bin 5926 -> 0 bytes .../web/homepage/img/multi_color_printing.png | Bin 168152 -> 0 bytes .../homepage/img/project_based_workflow.png | Bin 58365 -> 0 bytes resources/web/homepage/img/quick_start.png | Bin 13096 -> 0 bytes .../img/remote_control_and_monitoring.png | Bin 110028 -> 0 bytes .../setting_guide_of_slicing_parameters.png | Bin 69971 -> 0 bytes resources/web/homepage/img/step.png | Bin 27163 -> 0 bytes resources/web/homepage/img/t1.svg | 14 - resources/web/homepage/img/t2.svg | 10 - resources/web/homepage/img/wiki.png | Bin 196317 -> 0 bytes resources/web/homepage/img/wiki2.png | Bin 112559 -> 0 bytes resources/web/homepage/img/wiki3.png | Bin 105255 -> 0 bytes resources/web/homepage/test.html | 31 - resources/web/include/jquery-3.6.0.min.js | 2 - resources/web/include/swiper/README.md | 11 - .../angular/angular/src/public-api.d.ts | 3 - .../angular/src/swiper-slide.directive.d.ts | 26 - .../angular/angular/src/swiper.component.d.ts | 252 - .../angular/angular/src/swiper.module.d.ts | 9 - .../angular/angular/src/utils/get-params.d.ts | 6 - .../angular/src/utils/params-list.d.ts | 1 - .../angular/angular/src/utils/utils.d.ts | 6 - .../angular/bundles/swiper_angular.umd.js | 1830 --- .../angular/bundles/swiper_angular.umd.js.map | 1 - .../angular/esm2015/angular/src/public-api.js | 7 - .../angular/src/swiper-slide.directive.js | 60 - .../esm2015/angular/src/swiper.component.js | 1126 -- .../esm2015/angular/src/swiper.module.js | 19 - .../esm2015/angular/src/utils/get-params.js | 38 - .../esm2015/angular/src/utils/params-list.js | 115 - .../esm2015/angular/src/utils/utils.js | 49 - .../swiper/angular/esm2015/swiper-angular.js | 2 - .../swiper/angular/esm2015/swiper_angular.js | 5 - .../swiper/angular/fesm2015/swiper_angular.js | 1402 --- .../angular/fesm2015/swiper_angular.js.map | 1 - .../web/include/swiper/angular/package.json | 19 - .../swiper/angular/swiper-angular.d.ts | 1 - .../swiper/angular/swiper_angular.d.ts | 5 - .../swiper/core/breakpoints/getBreakpoint.js | 40 - .../include/swiper/core/breakpoints/index.js | 6 - .../swiper/core/breakpoints/setBreakpoint.js | 72 - .../swiper/core/check-overflow/index.js | 38 - .../include/swiper/core/classes/addClasses.js | 52 - .../web/include/swiper/core/classes/index.js | 6 - .../swiper/core/classes/removeClasses.js | 9 - resources/web/include/swiper/core/core.js | 610 - resources/web/include/swiper/core/defaults.js | 120 - .../web/include/swiper/core/events-emitter.js | 108 - .../web/include/swiper/core/events/index.js | 97 - .../web/include/swiper/core/events/onClick.js | 13 - .../include/swiper/core/events/onResize.js | 43 - .../include/swiper/core/events/onScroll.js | 35 - .../include/swiper/core/events/onTouchEnd.js | 143 - .../include/swiper/core/events/onTouchMove.js | 222 - .../swiper/core/events/onTouchStart.js | 114 - .../include/swiper/core/grab-cursor/index.js | 6 - .../swiper/core/grab-cursor/setGrabCursor.js | 9 - .../core/grab-cursor/unsetGrabCursor.js | 9 - .../web/include/swiper/core/images/index.js | 6 - .../include/swiper/core/images/loadImage.js | 37 - .../swiper/core/images/preloadImages.js | 19 - .../web/include/swiper/core/loop/index.js | 8 - .../include/swiper/core/loop/loopCreate.js | 59 - .../include/swiper/core/loop/loopDestroy.js | 10 - .../web/include/swiper/core/loop/loopFix.js | 41 - .../include/swiper/core/moduleExtendParams.js | 38 - .../swiper/core/modules/observer/observer.js | 75 - .../swiper/core/modules/resize/resize.js | 68 - .../web/include/swiper/core/slide/index.js | 16 - .../include/swiper/core/slide/slideNext.js | 26 - .../include/swiper/core/slide/slidePrev.js | 59 - .../include/swiper/core/slide/slideReset.js | 5 - .../web/include/swiper/core/slide/slideTo.js | 189 - .../swiper/core/slide/slideToClickedSlide.js | 39 - .../swiper/core/slide/slideToClosest.js | 32 - .../include/swiper/core/slide/slideToLoop.js | 10 - .../include/swiper/core/transition/index.js | 8 - .../swiper/core/transition/setTransition.js | 9 - .../swiper/core/transition/transitionEmit.js | 33 - .../swiper/core/transition/transitionEnd.js | 16 - .../swiper/core/transition/transitionStart.js | 19 - .../swiper/core/translate/getTranslate.js | 22 - .../include/swiper/core/translate/index.js | 12 - .../swiper/core/translate/maxTranslate.js | 3 - .../swiper/core/translate/minTranslate.js | 3 - .../swiper/core/translate/setTranslate.js | 48 - .../swiper/core/translate/translateTo.js | 85 - .../web/include/swiper/core/update/index.js | 20 - .../swiper/core/update/updateActiveIndex.js | 70 - .../swiper/core/update/updateAutoHeight.js | 49 - .../swiper/core/update/updateClickedSlide.js | 36 - .../swiper/core/update/updateProgress.js | 50 - .../include/swiper/core/update/updateSize.js | 33 - .../swiper/core/update/updateSlides.js | 309 - .../swiper/core/update/updateSlidesClasses.js | 64 - .../swiper/core/update/updateSlidesOffset.js | 8 - .../core/update/updateSlidesProgress.js | 44 - .../web/include/swiper/modules/a11y/a11y.js | 283 - .../web/include/swiper/modules/a11y/a11y.less | 9 - .../include/swiper/modules/a11y/a11y.min.css | 1 - .../web/include/swiper/modules/a11y/a11y.scss | 9 - .../swiper/modules/autoplay/autoplay.js | 222 - .../swiper/modules/autoplay/autoplay.less | 0 .../swiper/modules/autoplay/autoplay.min.css | 0 .../swiper/modules/autoplay/autoplay.scss | 0 .../swiper/modules/controller/controller.js | 191 - .../swiper/modules/controller/controller.less | 0 .../modules/controller/controller.min.css | 0 .../swiper/modules/controller/controller.scss | 0 .../modules/effect-cards/effect-cards.js | 125 - .../modules/effect-cards/effect-cards.less | 8 - .../modules/effect-cards/effect-cards.min.css | 1 - .../modules/effect-cards/effect-cards.scss | 7 - .../effect-coverflow/effect-coverflow.js | 103 - .../effect-coverflow/effect-coverflow.less | 2 - .../effect-coverflow/effect-coverflow.min.css | 0 .../effect-coverflow/effect-coverflow.scss | 2 - .../effect-creative/effect-creative.js | 154 - .../effect-creative/effect-creative.less | 7 - .../effect-creative/effect-creative.min.css | 1 - .../effect-creative/effect-creative.scss | 7 - .../swiper/modules/effect-cube/effect-cube.js | 180 - .../modules/effect-cube/effect-cube.less | 59 - .../modules/effect-cube/effect-cube.min.css | 1 - .../modules/effect-cube/effect-cube.scss | 59 - .../swiper/modules/effect-fade/effect-fade.js | 70 - .../modules/effect-fade/effect-fade.less | 20 - .../modules/effect-fade/effect-fade.min.css | 1 - .../modules/effect-fade/effect-fade.scss | 20 - .../swiper/modules/effect-flip/effect-flip.js | 102 - .../modules/effect-flip/effect-flip.less | 24 - .../modules/effect-flip/effect-flip.min.css | 1 - .../modules/effect-flip/effect-flip.scss | 24 - .../swiper/modules/free-mode/free-mode.js | 245 - .../swiper/modules/free-mode/free-mode.less | 4 - .../modules/free-mode/free-mode.min.css | 1 - .../swiper/modules/free-mode/free-mode.scss | 4 - .../web/include/swiper/modules/grid/grid.js | 116 - .../web/include/swiper/modules/grid/grid.less | 7 - .../include/swiper/modules/grid/grid.min.css | 1 - .../web/include/swiper/modules/grid/grid.scss | 7 - .../hash-navigation/hash-navigation.js | 96 - .../hash-navigation/hash-navigation.less | 2 - .../hash-navigation/hash-navigation.min.css | 0 .../hash-navigation/hash-navigation.scss | 0 .../include/swiper/modules/history/history.js | 150 - .../swiper/modules/history/history.less | 0 .../swiper/modules/history/history.min.css | 0 .../swiper/modules/history/history.scss | 0 .../swiper/modules/keyboard/keyboard.js | 131 - .../swiper/modules/keyboard/keyboard.less | 0 .../swiper/modules/keyboard/keyboard.min.css | 0 .../swiper/modules/keyboard/keyboard.scss | 0 .../web/include/swiper/modules/lazy/lazy.js | 283 - .../web/include/swiper/modules/lazy/lazy.less | 34 - .../include/swiper/modules/lazy/lazy.min.css | 1 - .../web/include/swiper/modules/lazy/lazy.scss | 34 - .../modules/manipulation/manipulation.js | 16 - .../modules/manipulation/manipulation.less | 0 .../modules/manipulation/manipulation.min.css | 0 .../modules/manipulation/manipulation.scss | 0 .../modules/manipulation/methods/addSlide.js | 64 - .../manipulation/methods/appendSlide.js | 27 - .../manipulation/methods/prependSlide.js | 34 - .../manipulation/methods/removeAllSlides.js | 10 - .../manipulation/methods/removeSlide.js | 47 - .../swiper/modules/mousewheel/mousewheel.js | 422 - .../swiper/modules/mousewheel/mousewheel.less | 0 .../modules/mousewheel/mousewheel.min.css | 0 .../swiper/modules/mousewheel/mousewheel.scss | 0 .../swiper/modules/navigation/navigation.js | 185 - .../swiper/modules/navigation/navigation.less | 55 - .../modules/navigation/navigation.min.css | 1 - .../swiper/modules/navigation/navigation.scss | 56 - .../swiper/modules/pagination/pagination.js | 410 - .../swiper/modules/pagination/pagination.less | 163 - .../modules/pagination/pagination.min.css | 1 - .../swiper/modules/pagination/pagination.scss | 163 - .../swiper/modules/parallax/parallax.js | 114 - .../swiper/modules/parallax/parallax.less | 0 .../swiper/modules/parallax/parallax.min.css | 0 .../swiper/modules/parallax/parallax.scss | 0 .../swiper/modules/scrollbar/scrollbar.js | 361 - .../swiper/modules/scrollbar/scrollbar.less | 38 - .../modules/scrollbar/scrollbar.min.css | 1 - .../swiper/modules/scrollbar/scrollbar.scss | 38 - .../include/swiper/modules/thumbs/thumbs.js | 204 - .../include/swiper/modules/thumbs/thumbs.less | 5 - .../swiper/modules/thumbs/thumbs.min.css | 0 .../include/swiper/modules/thumbs/thumbs.scss | 5 - .../include/swiper/modules/virtual/virtual.js | 291 - .../swiper/modules/virtual/virtual.less | 17 - .../swiper/modules/virtual/virtual.min.css | 1 - .../swiper/modules/virtual/virtual.scss | 17 - .../web/include/swiper/modules/zoom/zoom.js | 612 - .../web/include/swiper/modules/zoom/zoom.less | 20 - .../include/swiper/modules/zoom/zoom.min.css | 1 - .../web/include/swiper/modules/zoom/zoom.scss | 20 - .../include/swiper/node_modules/dom7/LICENSE | 21 - .../swiper/node_modules/dom7/README.md | 47 - .../swiper/node_modules/dom7/dom7.d.ts | 628 - .../swiper/node_modules/dom7/dom7.esm.js | 1478 --- .../include/swiper/node_modules/dom7/dom7.js | 1768 --- .../swiper/node_modules/dom7/dom7.js.map | 1 - .../swiper/node_modules/dom7/dom7.min.js | 13 - .../swiper/node_modules/dom7/dom7.min.js.map | 1 - .../swiper/node_modules/dom7/package.json | 60 - .../swiper/node_modules/ssr-window/LICENSE | 21 - .../swiper/node_modules/ssr-window/README.md | 59 - .../node_modules/ssr-window/package.json | 55 - .../node_modules/ssr-window/ssr-window.esm.js | 148 - .../node_modules/ssr-window/ssr-window.umd.js | 163 - .../ssr-window/ssr-window.umd.js.map | 1 - .../ssr-window/ssr-window.umd.min.js | 13 - .../ssr-window/ssr-window.umd.min.js.map | 1 - .../ssr-window/types/document.d.ts | 36 - .../node_modules/ssr-window/types/extend.d.ts | 2 - .../ssr-window/types/ssr-window.d.ts | 4 - .../node_modules/ssr-window/types/window.d.ts | 72 - resources/web/include/swiper/package.json | 191 - resources/web/include/swiper/postinstall.js | 36 - .../swiper/react/get-changed-params.js | 43 - .../web/include/swiper/react/get-children.js | 46 - .../web/include/swiper/react/get-params.js | 46 - .../web/include/swiper/react/init-swiper.js | 36 - resources/web/include/swiper/react/loop.js | 78 - .../web/include/swiper/react/params-list.js | 4 - .../include/swiper/react/swiper-react.d.ts | 467 - .../web/include/swiper/react/swiper-react.js | 15 - .../web/include/swiper/react/swiper-slide.js | 79 - resources/web/include/swiper/react/swiper.js | 202 - .../web/include/swiper/react/update-swiper.js | 131 - .../react/use-isomorphic-layout-effect.js | 9 - resources/web/include/swiper/react/utils.js | 37 - resources/web/include/swiper/react/virtual.js | 33 - .../swiper/shared/classes-to-selector.js | 4 - .../shared/create-element-if-not-defined.js | 23 - .../include/swiper/shared/create-shadow.js | 13 - resources/web/include/swiper/shared/dom.js | 46 - .../web/include/swiper/shared/effect-init.js | 31 - .../include/swiper/shared/effect-target.js | 10 - .../shared/effect-virtual-transition-end.js | 35 - .../web/include/swiper/shared/get-browser.js | 26 - .../web/include/swiper/shared/get-device.js | 57 - .../web/include/swiper/shared/get-support.js | 41 - resources/web/include/swiper/shared/utils.js | 197 - .../swiper/svelte/get-changed-params.js | 39 - .../web/include/swiper/svelte/get-params.js | 44 - .../web/include/swiper/svelte/init-swiper.js | 36 - .../web/include/swiper/svelte/params-list.js | 4 - .../include/swiper/svelte/swiper-slide.svelte | 95 - .../include/swiper/svelte/swiper-svelte.d.ts | 431 - .../include/swiper/svelte/swiper-svelte.js | 15 - .../web/include/swiper/svelte/swiper.svelte | 178 - .../include/swiper/svelte/update-swiper.js | 132 - resources/web/include/swiper/svelte/utils.js | 37 - .../web/include/swiper/swiper-bundle.css | 613 - .../swiper/swiper-bundle.esm.browser.js | 10060 --------------- .../swiper/swiper-bundle.esm.browser.js.map | 1 - .../swiper/swiper-bundle.esm.browser.min.js | 14 - .../swiper-bundle.esm.browser.min.js.map | 1 - .../web/include/swiper/swiper-bundle.esm.js | 42 - resources/web/include/swiper/swiper-bundle.js | 10068 ---------------- .../web/include/swiper/swiper-bundle.js.map | 1 - .../include/swiper/swiper-bundle.min.js.map | 1 - resources/web/include/swiper/swiper-vars.less | 1 - resources/web/include/swiper/swiper-vars.scss | 1 - resources/web/include/swiper/swiper.d.ts | 58 - resources/web/include/swiper/swiper.esm.js | 37 - resources/web/include/swiper/swiper.less | 169 - resources/web/include/swiper/swiper.min.css | 13 - resources/web/include/swiper/swiper.scss | 170 - resources/web/include/swiper/types/index.d.ts | 5 - .../include/swiper/types/modules/a11y.d.ts | 89 - .../swiper/types/modules/autoplay.d.ts | 101 - .../swiper/types/modules/controller.d.ts | 35 - .../swiper/types/modules/effect-cards.d.ts | 20 - .../types/modules/effect-coverflow.d.ts | 50 - .../swiper/types/modules/effect-creative.d.ts | 93 - .../swiper/types/modules/effect-cube.d.ts | 30 - .../swiper/types/modules/effect-fade.d.ts | 20 - .../swiper/types/modules/effect-flip.d.ts | 26 - .../swiper/types/modules/free-mode.d.ts | 59 - .../include/swiper/types/modules/grid.d.ts | 21 - .../swiper/types/modules/hash-navigation.d.ts | 32 - .../include/swiper/types/modules/history.d.ts | 29 - .../swiper/types/modules/keyboard.d.ts | 46 - .../include/swiper/types/modules/lazy.d.ts | 82 - .../swiper/types/modules/manipulation.d.ts | 70 - .../swiper/types/modules/mousewheel.d.ts | 75 - .../swiper/types/modules/navigation.d.ts | 86 - .../swiper/types/modules/pagination.d.ts | 285 - .../swiper/types/modules/parallax.d.ts | 12 - .../swiper/types/modules/public-api.d.ts | 24 - .../swiper/types/modules/scrollbar.d.ts | 115 - .../include/swiper/types/modules/thumbs.d.ts | 54 - .../include/swiper/types/modules/virtual.d.ts | 122 - .../include/swiper/types/modules/zoom.d.ts | 79 - .../web/include/swiper/types/shared.d.ts | 3 - .../include/swiper/types/swiper-class.d.ts | 472 - .../include/swiper/types/swiper-events.d.ts | 362 - .../include/swiper/types/swiper-options.d.ts | 1205 -- .../include/swiper/vue/get-changed-params.js | 43 - .../web/include/swiper/vue/get-children.js | 41 - .../web/include/swiper/vue/get-params.js | 48 - .../web/include/swiper/vue/init-swiper.js | 36 - resources/web/include/swiper/vue/loop.js | 79 - .../web/include/swiper/vue/params-list.js | 4 - .../web/include/swiper/vue/swiper-slide.js | 83 - .../web/include/swiper/vue/swiper-vue.d.ts | 859 -- .../web/include/swiper/vue/swiper-vue.js | 15 - resources/web/include/swiper/vue/swiper.js | 640 - .../web/include/swiper/vue/update-swiper.js | 131 - resources/web/include/swiper/vue/utils.js | 37 - resources/web/include/swiper/vue/virtual.js | 35 - resources/web/model/img/p1.png | Bin 124048 -> 0 bytes resources/web/model/img/p2.png | Bin 407140 -> 0 bytes resources/web/model/img/p3.png | Bin 305477 -> 0 bytes resources/web/model/img/p4.png | Bin 90249 -> 0 bytes resources/web/model/img/p5.png | Bin 89532 -> 0 bytes resources/web/model/img/p6.png | Bin 222296 -> 0 bytes resources/web/model/index.html | 1 - resources/web/model/test.js | 124 - 634 files changed, 98581 deletions(-) delete mode 100644 resources/web/dialog/js/jquery-2.1.1.min.js delete mode 100644 resources/web/guide/swiper/LICENSE delete mode 100644 resources/web/guide/swiper/README.md delete mode 100644 resources/web/guide/swiper/angular/angular/src/public-api.d.ts delete mode 100644 resources/web/guide/swiper/angular/angular/src/swiper-slide.directive.d.ts delete mode 100644 resources/web/guide/swiper/angular/angular/src/swiper.component.d.ts delete mode 100644 resources/web/guide/swiper/angular/angular/src/swiper.module.d.ts delete mode 100644 resources/web/guide/swiper/angular/angular/src/utils/get-params.d.ts delete mode 100644 resources/web/guide/swiper/angular/angular/src/utils/params-list.d.ts delete mode 100644 resources/web/guide/swiper/angular/angular/src/utils/utils.d.ts delete mode 100644 resources/web/guide/swiper/angular/bundles/swiper_angular.umd.js delete mode 100644 resources/web/guide/swiper/angular/bundles/swiper_angular.umd.js.map delete mode 100644 resources/web/guide/swiper/angular/esm2015/angular/src/public-api.js delete mode 100644 resources/web/guide/swiper/angular/esm2015/angular/src/swiper-slide.directive.js delete mode 100644 resources/web/guide/swiper/angular/esm2015/angular/src/swiper.component.js delete mode 100644 resources/web/guide/swiper/angular/esm2015/angular/src/swiper.module.js delete mode 100644 resources/web/guide/swiper/angular/esm2015/angular/src/utils/get-params.js delete mode 100644 resources/web/guide/swiper/angular/esm2015/angular/src/utils/params-list.js delete mode 100644 resources/web/guide/swiper/angular/esm2015/angular/src/utils/utils.js delete mode 100644 resources/web/guide/swiper/angular/esm2015/swiper-angular.js delete mode 100644 resources/web/guide/swiper/angular/esm2015/swiper_angular.js delete mode 100644 resources/web/guide/swiper/angular/fesm2015/swiper_angular.js delete mode 100644 resources/web/guide/swiper/angular/fesm2015/swiper_angular.js.map delete mode 100644 resources/web/guide/swiper/angular/package.json delete mode 100644 resources/web/guide/swiper/angular/swiper-angular.d.ts delete mode 100644 resources/web/guide/swiper/angular/swiper_angular.d.ts delete mode 100644 resources/web/guide/swiper/core/breakpoints/getBreakpoint.js delete mode 100644 resources/web/guide/swiper/core/breakpoints/index.js delete mode 100644 resources/web/guide/swiper/core/breakpoints/setBreakpoint.js delete mode 100644 resources/web/guide/swiper/core/check-overflow/index.js delete mode 100644 resources/web/guide/swiper/core/classes/addClasses.js delete mode 100644 resources/web/guide/swiper/core/classes/index.js delete mode 100644 resources/web/guide/swiper/core/classes/removeClasses.js delete mode 100644 resources/web/guide/swiper/core/core.js delete mode 100644 resources/web/guide/swiper/core/defaults.js delete mode 100644 resources/web/guide/swiper/core/events-emitter.js delete mode 100644 resources/web/guide/swiper/core/events/index.js delete mode 100644 resources/web/guide/swiper/core/events/onClick.js delete mode 100644 resources/web/guide/swiper/core/events/onResize.js delete mode 100644 resources/web/guide/swiper/core/events/onScroll.js delete mode 100644 resources/web/guide/swiper/core/events/onTouchEnd.js delete mode 100644 resources/web/guide/swiper/core/events/onTouchMove.js delete mode 100644 resources/web/guide/swiper/core/events/onTouchStart.js delete mode 100644 resources/web/guide/swiper/core/grab-cursor/index.js delete mode 100644 resources/web/guide/swiper/core/grab-cursor/setGrabCursor.js delete mode 100644 resources/web/guide/swiper/core/grab-cursor/unsetGrabCursor.js delete mode 100644 resources/web/guide/swiper/core/images/index.js delete mode 100644 resources/web/guide/swiper/core/images/loadImage.js delete mode 100644 resources/web/guide/swiper/core/images/preloadImages.js delete mode 100644 resources/web/guide/swiper/core/loop/index.js delete mode 100644 resources/web/guide/swiper/core/loop/loopCreate.js delete mode 100644 resources/web/guide/swiper/core/loop/loopDestroy.js delete mode 100644 resources/web/guide/swiper/core/loop/loopFix.js delete mode 100644 resources/web/guide/swiper/core/moduleExtendParams.js delete mode 100644 resources/web/guide/swiper/core/modules/observer/observer.js delete mode 100644 resources/web/guide/swiper/core/modules/resize/resize.js delete mode 100644 resources/web/guide/swiper/core/slide/index.js delete mode 100644 resources/web/guide/swiper/core/slide/slideNext.js delete mode 100644 resources/web/guide/swiper/core/slide/slidePrev.js delete mode 100644 resources/web/guide/swiper/core/slide/slideReset.js delete mode 100644 resources/web/guide/swiper/core/slide/slideTo.js delete mode 100644 resources/web/guide/swiper/core/slide/slideToClickedSlide.js delete mode 100644 resources/web/guide/swiper/core/slide/slideToClosest.js delete mode 100644 resources/web/guide/swiper/core/slide/slideToLoop.js delete mode 100644 resources/web/guide/swiper/core/transition/index.js delete mode 100644 resources/web/guide/swiper/core/transition/setTransition.js delete mode 100644 resources/web/guide/swiper/core/transition/transitionEmit.js delete mode 100644 resources/web/guide/swiper/core/transition/transitionEnd.js delete mode 100644 resources/web/guide/swiper/core/transition/transitionStart.js delete mode 100644 resources/web/guide/swiper/core/translate/getTranslate.js delete mode 100644 resources/web/guide/swiper/core/translate/index.js delete mode 100644 resources/web/guide/swiper/core/translate/maxTranslate.js delete mode 100644 resources/web/guide/swiper/core/translate/minTranslate.js delete mode 100644 resources/web/guide/swiper/core/translate/setTranslate.js delete mode 100644 resources/web/guide/swiper/core/translate/translateTo.js delete mode 100644 resources/web/guide/swiper/core/update/index.js delete mode 100644 resources/web/guide/swiper/core/update/updateActiveIndex.js delete mode 100644 resources/web/guide/swiper/core/update/updateAutoHeight.js delete mode 100644 resources/web/guide/swiper/core/update/updateClickedSlide.js delete mode 100644 resources/web/guide/swiper/core/update/updateProgress.js delete mode 100644 resources/web/guide/swiper/core/update/updateSize.js delete mode 100644 resources/web/guide/swiper/core/update/updateSlides.js delete mode 100644 resources/web/guide/swiper/core/update/updateSlidesClasses.js delete mode 100644 resources/web/guide/swiper/core/update/updateSlidesOffset.js delete mode 100644 resources/web/guide/swiper/core/update/updateSlidesProgress.js delete mode 100644 resources/web/guide/swiper/modules/a11y/a11y.js delete mode 100644 resources/web/guide/swiper/modules/a11y/a11y.less delete mode 100644 resources/web/guide/swiper/modules/a11y/a11y.min.css delete mode 100644 resources/web/guide/swiper/modules/a11y/a11y.scss delete mode 100644 resources/web/guide/swiper/modules/autoplay/autoplay.js delete mode 100644 resources/web/guide/swiper/modules/autoplay/autoplay.less delete mode 100644 resources/web/guide/swiper/modules/autoplay/autoplay.min.css delete mode 100644 resources/web/guide/swiper/modules/autoplay/autoplay.scss delete mode 100644 resources/web/guide/swiper/modules/controller/controller.js delete mode 100644 resources/web/guide/swiper/modules/controller/controller.less delete mode 100644 resources/web/guide/swiper/modules/controller/controller.min.css delete mode 100644 resources/web/guide/swiper/modules/controller/controller.scss delete mode 100644 resources/web/guide/swiper/modules/effect-cards/effect-cards.js delete mode 100644 resources/web/guide/swiper/modules/effect-cards/effect-cards.less delete mode 100644 resources/web/guide/swiper/modules/effect-cards/effect-cards.min.css delete mode 100644 resources/web/guide/swiper/modules/effect-cards/effect-cards.scss delete mode 100644 resources/web/guide/swiper/modules/effect-coverflow/effect-coverflow.js delete mode 100644 resources/web/guide/swiper/modules/effect-coverflow/effect-coverflow.less delete mode 100644 resources/web/guide/swiper/modules/effect-coverflow/effect-coverflow.min.css delete mode 100644 resources/web/guide/swiper/modules/effect-coverflow/effect-coverflow.scss delete mode 100644 resources/web/guide/swiper/modules/effect-creative/effect-creative.js delete mode 100644 resources/web/guide/swiper/modules/effect-creative/effect-creative.less delete mode 100644 resources/web/guide/swiper/modules/effect-creative/effect-creative.min.css delete mode 100644 resources/web/guide/swiper/modules/effect-creative/effect-creative.scss delete mode 100644 resources/web/guide/swiper/modules/effect-cube/effect-cube.js delete mode 100644 resources/web/guide/swiper/modules/effect-cube/effect-cube.less delete mode 100644 resources/web/guide/swiper/modules/effect-cube/effect-cube.min.css delete mode 100644 resources/web/guide/swiper/modules/effect-cube/effect-cube.scss delete mode 100644 resources/web/guide/swiper/modules/effect-fade/effect-fade.js delete mode 100644 resources/web/guide/swiper/modules/effect-fade/effect-fade.less delete mode 100644 resources/web/guide/swiper/modules/effect-fade/effect-fade.min.css delete mode 100644 resources/web/guide/swiper/modules/effect-fade/effect-fade.scss delete mode 100644 resources/web/guide/swiper/modules/effect-flip/effect-flip.js delete mode 100644 resources/web/guide/swiper/modules/effect-flip/effect-flip.less delete mode 100644 resources/web/guide/swiper/modules/effect-flip/effect-flip.min.css delete mode 100644 resources/web/guide/swiper/modules/effect-flip/effect-flip.scss delete mode 100644 resources/web/guide/swiper/modules/free-mode/free-mode.js delete mode 100644 resources/web/guide/swiper/modules/free-mode/free-mode.less delete mode 100644 resources/web/guide/swiper/modules/free-mode/free-mode.min.css delete mode 100644 resources/web/guide/swiper/modules/free-mode/free-mode.scss delete mode 100644 resources/web/guide/swiper/modules/grid/grid.js delete mode 100644 resources/web/guide/swiper/modules/grid/grid.less delete mode 100644 resources/web/guide/swiper/modules/grid/grid.min.css delete mode 100644 resources/web/guide/swiper/modules/grid/grid.scss delete mode 100644 resources/web/guide/swiper/modules/hash-navigation/hash-navigation.js delete mode 100644 resources/web/guide/swiper/modules/hash-navigation/hash-navigation.less delete mode 100644 resources/web/guide/swiper/modules/hash-navigation/hash-navigation.min.css delete mode 100644 resources/web/guide/swiper/modules/hash-navigation/hash-navigation.scss delete mode 100644 resources/web/guide/swiper/modules/history/history.js delete mode 100644 resources/web/guide/swiper/modules/history/history.less delete mode 100644 resources/web/guide/swiper/modules/history/history.min.css delete mode 100644 resources/web/guide/swiper/modules/history/history.scss delete mode 100644 resources/web/guide/swiper/modules/keyboard/keyboard.js delete mode 100644 resources/web/guide/swiper/modules/keyboard/keyboard.less delete mode 100644 resources/web/guide/swiper/modules/keyboard/keyboard.min.css delete mode 100644 resources/web/guide/swiper/modules/keyboard/keyboard.scss delete mode 100644 resources/web/guide/swiper/modules/lazy/lazy.js delete mode 100644 resources/web/guide/swiper/modules/lazy/lazy.less delete mode 100644 resources/web/guide/swiper/modules/lazy/lazy.min.css delete mode 100644 resources/web/guide/swiper/modules/lazy/lazy.scss delete mode 100644 resources/web/guide/swiper/modules/manipulation/manipulation.js delete mode 100644 resources/web/guide/swiper/modules/manipulation/manipulation.less delete mode 100644 resources/web/guide/swiper/modules/manipulation/manipulation.min.css delete mode 100644 resources/web/guide/swiper/modules/manipulation/manipulation.scss delete mode 100644 resources/web/guide/swiper/modules/manipulation/methods/addSlide.js delete mode 100644 resources/web/guide/swiper/modules/manipulation/methods/appendSlide.js delete mode 100644 resources/web/guide/swiper/modules/manipulation/methods/prependSlide.js delete mode 100644 resources/web/guide/swiper/modules/manipulation/methods/removeAllSlides.js delete mode 100644 resources/web/guide/swiper/modules/manipulation/methods/removeSlide.js delete mode 100644 resources/web/guide/swiper/modules/mousewheel/mousewheel.js delete mode 100644 resources/web/guide/swiper/modules/mousewheel/mousewheel.less delete mode 100644 resources/web/guide/swiper/modules/mousewheel/mousewheel.min.css delete mode 100644 resources/web/guide/swiper/modules/mousewheel/mousewheel.scss delete mode 100644 resources/web/guide/swiper/modules/navigation/navigation.js delete mode 100644 resources/web/guide/swiper/modules/navigation/navigation.less delete mode 100644 resources/web/guide/swiper/modules/navigation/navigation.min.css delete mode 100644 resources/web/guide/swiper/modules/navigation/navigation.scss delete mode 100644 resources/web/guide/swiper/modules/pagination/pagination.js delete mode 100644 resources/web/guide/swiper/modules/pagination/pagination.less delete mode 100644 resources/web/guide/swiper/modules/pagination/pagination.min.css delete mode 100644 resources/web/guide/swiper/modules/pagination/pagination.scss delete mode 100644 resources/web/guide/swiper/modules/parallax/parallax.js delete mode 100644 resources/web/guide/swiper/modules/parallax/parallax.less delete mode 100644 resources/web/guide/swiper/modules/parallax/parallax.min.css delete mode 100644 resources/web/guide/swiper/modules/parallax/parallax.scss delete mode 100644 resources/web/guide/swiper/modules/scrollbar/scrollbar.js delete mode 100644 resources/web/guide/swiper/modules/scrollbar/scrollbar.less delete mode 100644 resources/web/guide/swiper/modules/scrollbar/scrollbar.min.css delete mode 100644 resources/web/guide/swiper/modules/scrollbar/scrollbar.scss delete mode 100644 resources/web/guide/swiper/modules/thumbs/thumbs.js delete mode 100644 resources/web/guide/swiper/modules/thumbs/thumbs.less delete mode 100644 resources/web/guide/swiper/modules/thumbs/thumbs.min.css delete mode 100644 resources/web/guide/swiper/modules/thumbs/thumbs.scss delete mode 100644 resources/web/guide/swiper/modules/virtual/virtual.js delete mode 100644 resources/web/guide/swiper/modules/virtual/virtual.less delete mode 100644 resources/web/guide/swiper/modules/virtual/virtual.min.css delete mode 100644 resources/web/guide/swiper/modules/virtual/virtual.scss delete mode 100644 resources/web/guide/swiper/modules/zoom/zoom.js delete mode 100644 resources/web/guide/swiper/modules/zoom/zoom.less delete mode 100644 resources/web/guide/swiper/modules/zoom/zoom.min.css delete mode 100644 resources/web/guide/swiper/modules/zoom/zoom.scss delete mode 100644 resources/web/guide/swiper/node_modules/dom7/LICENSE delete mode 100644 resources/web/guide/swiper/node_modules/dom7/README.md delete mode 100644 resources/web/guide/swiper/node_modules/dom7/dom7.d.ts delete mode 100644 resources/web/guide/swiper/node_modules/dom7/dom7.esm.js delete mode 100644 resources/web/guide/swiper/node_modules/dom7/dom7.js delete mode 100644 resources/web/guide/swiper/node_modules/dom7/dom7.js.map delete mode 100644 resources/web/guide/swiper/node_modules/dom7/dom7.min.js delete mode 100644 resources/web/guide/swiper/node_modules/dom7/dom7.min.js.map delete mode 100644 resources/web/guide/swiper/node_modules/dom7/package.json delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/LICENSE delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/README.md delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/package.json delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/ssr-window.esm.js delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/ssr-window.umd.js delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/ssr-window.umd.js.map delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/ssr-window.umd.min.js delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/ssr-window.umd.min.js.map delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/types/document.d.ts delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/types/extend.d.ts delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/types/ssr-window.d.ts delete mode 100644 resources/web/guide/swiper/node_modules/ssr-window/types/window.d.ts delete mode 100644 resources/web/guide/swiper/package.json delete mode 100644 resources/web/guide/swiper/postinstall.js delete mode 100644 resources/web/guide/swiper/react/get-changed-params.js delete mode 100644 resources/web/guide/swiper/react/get-children.js delete mode 100644 resources/web/guide/swiper/react/get-params.js delete mode 100644 resources/web/guide/swiper/react/init-swiper.js delete mode 100644 resources/web/guide/swiper/react/loop.js delete mode 100644 resources/web/guide/swiper/react/params-list.js delete mode 100644 resources/web/guide/swiper/react/swiper-react.d.ts delete mode 100644 resources/web/guide/swiper/react/swiper-react.js delete mode 100644 resources/web/guide/swiper/react/swiper-slide.js delete mode 100644 resources/web/guide/swiper/react/swiper.js delete mode 100644 resources/web/guide/swiper/react/update-swiper.js delete mode 100644 resources/web/guide/swiper/react/use-isomorphic-layout-effect.js delete mode 100644 resources/web/guide/swiper/react/utils.js delete mode 100644 resources/web/guide/swiper/react/virtual.js delete mode 100644 resources/web/guide/swiper/shared/classes-to-selector.js delete mode 100644 resources/web/guide/swiper/shared/create-element-if-not-defined.js delete mode 100644 resources/web/guide/swiper/shared/create-shadow.js delete mode 100644 resources/web/guide/swiper/shared/dom.js delete mode 100644 resources/web/guide/swiper/shared/effect-init.js delete mode 100644 resources/web/guide/swiper/shared/effect-target.js delete mode 100644 resources/web/guide/swiper/shared/effect-virtual-transition-end.js delete mode 100644 resources/web/guide/swiper/shared/get-browser.js delete mode 100644 resources/web/guide/swiper/shared/get-device.js delete mode 100644 resources/web/guide/swiper/shared/get-support.js delete mode 100644 resources/web/guide/swiper/shared/utils.js delete mode 100644 resources/web/guide/swiper/svelte/get-changed-params.js delete mode 100644 resources/web/guide/swiper/svelte/get-params.js delete mode 100644 resources/web/guide/swiper/svelte/init-swiper.js delete mode 100644 resources/web/guide/swiper/svelte/params-list.js delete mode 100644 resources/web/guide/swiper/svelte/swiper-slide.svelte delete mode 100644 resources/web/guide/swiper/svelte/swiper-svelte.d.ts delete mode 100644 resources/web/guide/swiper/svelte/swiper-svelte.js delete mode 100644 resources/web/guide/swiper/svelte/swiper.svelte delete mode 100644 resources/web/guide/swiper/svelte/update-swiper.js delete mode 100644 resources/web/guide/swiper/svelte/utils.js delete mode 100644 resources/web/guide/swiper/swiper-bundle.css delete mode 100644 resources/web/guide/swiper/swiper-bundle.esm.browser.js delete mode 100644 resources/web/guide/swiper/swiper-bundle.esm.browser.js.map delete mode 100644 resources/web/guide/swiper/swiper-bundle.esm.browser.min.js delete mode 100644 resources/web/guide/swiper/swiper-bundle.esm.browser.min.js.map delete mode 100644 resources/web/guide/swiper/swiper-bundle.esm.js delete mode 100644 resources/web/guide/swiper/swiper-bundle.js delete mode 100644 resources/web/guide/swiper/swiper-bundle.js.map delete mode 100644 resources/web/guide/swiper/swiper-bundle.min.css delete mode 100644 resources/web/guide/swiper/swiper-bundle.min.js delete mode 100644 resources/web/guide/swiper/swiper-bundle.min.js.map delete mode 100644 resources/web/guide/swiper/swiper-vars.less delete mode 100644 resources/web/guide/swiper/swiper-vars.scss delete mode 100644 resources/web/guide/swiper/swiper.d.ts delete mode 100644 resources/web/guide/swiper/swiper.esm.js delete mode 100644 resources/web/guide/swiper/swiper.less delete mode 100644 resources/web/guide/swiper/swiper.min.css delete mode 100644 resources/web/guide/swiper/swiper.scss delete mode 100644 resources/web/guide/swiper/types/index.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/a11y.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/autoplay.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/controller.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/effect-cards.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/effect-coverflow.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/effect-creative.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/effect-cube.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/effect-fade.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/effect-flip.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/free-mode.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/grid.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/hash-navigation.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/history.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/keyboard.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/lazy.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/manipulation.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/mousewheel.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/navigation.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/pagination.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/parallax.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/public-api.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/scrollbar.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/thumbs.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/virtual.d.ts delete mode 100644 resources/web/guide/swiper/types/modules/zoom.d.ts delete mode 100644 resources/web/guide/swiper/types/shared.d.ts delete mode 100644 resources/web/guide/swiper/types/swiper-class.d.ts delete mode 100644 resources/web/guide/swiper/types/swiper-events.d.ts delete mode 100644 resources/web/guide/swiper/types/swiper-options.d.ts delete mode 100644 resources/web/guide/swiper/vue/get-changed-params.js delete mode 100644 resources/web/guide/swiper/vue/get-children.js delete mode 100644 resources/web/guide/swiper/vue/get-params.js delete mode 100644 resources/web/guide/swiper/vue/init-swiper.js delete mode 100644 resources/web/guide/swiper/vue/loop.js delete mode 100644 resources/web/guide/swiper/vue/params-list.js delete mode 100644 resources/web/guide/swiper/vue/swiper-slide.js delete mode 100644 resources/web/guide/swiper/vue/swiper-vue.d.ts delete mode 100644 resources/web/guide/swiper/vue/swiper-vue.js delete mode 100644 resources/web/guide/swiper/vue/swiper.js delete mode 100644 resources/web/guide/swiper/vue/update-swiper.js delete mode 100644 resources/web/guide/swiper/vue/utils.js delete mode 100644 resources/web/guide/swiper/vue/virtual.js delete mode 100644 resources/web/homepage/img/3d_text.png delete mode 100644 resources/web/homepage/img/a.jpg delete mode 100644 resources/web/homepage/img/b.jpg delete mode 100644 resources/web/homepage/img/high_speed_print_at_quality.png delete mode 100644 resources/web/homepage/img/i1.png delete mode 100644 resources/web/homepage/img/i3.png delete mode 100644 resources/web/homepage/img/i6.png delete mode 100644 resources/web/homepage/img/multi_color_printing.png delete mode 100644 resources/web/homepage/img/project_based_workflow.png delete mode 100644 resources/web/homepage/img/quick_start.png delete mode 100644 resources/web/homepage/img/remote_control_and_monitoring.png delete mode 100644 resources/web/homepage/img/setting_guide_of_slicing_parameters.png delete mode 100644 resources/web/homepage/img/step.png delete mode 100644 resources/web/homepage/img/t1.svg delete mode 100644 resources/web/homepage/img/t2.svg delete mode 100644 resources/web/homepage/img/wiki.png delete mode 100644 resources/web/homepage/img/wiki2.png delete mode 100644 resources/web/homepage/img/wiki3.png delete mode 100644 resources/web/homepage/test.html delete mode 100644 resources/web/include/jquery-3.6.0.min.js delete mode 100644 resources/web/include/swiper/README.md delete mode 100644 resources/web/include/swiper/angular/angular/src/public-api.d.ts delete mode 100644 resources/web/include/swiper/angular/angular/src/swiper-slide.directive.d.ts delete mode 100644 resources/web/include/swiper/angular/angular/src/swiper.component.d.ts delete mode 100644 resources/web/include/swiper/angular/angular/src/swiper.module.d.ts delete mode 100644 resources/web/include/swiper/angular/angular/src/utils/get-params.d.ts delete mode 100644 resources/web/include/swiper/angular/angular/src/utils/params-list.d.ts delete mode 100644 resources/web/include/swiper/angular/angular/src/utils/utils.d.ts delete mode 100644 resources/web/include/swiper/angular/bundles/swiper_angular.umd.js delete mode 100644 resources/web/include/swiper/angular/bundles/swiper_angular.umd.js.map delete mode 100644 resources/web/include/swiper/angular/esm2015/angular/src/public-api.js delete mode 100644 resources/web/include/swiper/angular/esm2015/angular/src/swiper-slide.directive.js delete mode 100644 resources/web/include/swiper/angular/esm2015/angular/src/swiper.component.js delete mode 100644 resources/web/include/swiper/angular/esm2015/angular/src/swiper.module.js delete mode 100644 resources/web/include/swiper/angular/esm2015/angular/src/utils/get-params.js delete mode 100644 resources/web/include/swiper/angular/esm2015/angular/src/utils/params-list.js delete mode 100644 resources/web/include/swiper/angular/esm2015/angular/src/utils/utils.js delete mode 100644 resources/web/include/swiper/angular/esm2015/swiper-angular.js delete mode 100644 resources/web/include/swiper/angular/esm2015/swiper_angular.js delete mode 100644 resources/web/include/swiper/angular/fesm2015/swiper_angular.js delete mode 100644 resources/web/include/swiper/angular/fesm2015/swiper_angular.js.map delete mode 100644 resources/web/include/swiper/angular/package.json delete mode 100644 resources/web/include/swiper/angular/swiper-angular.d.ts delete mode 100644 resources/web/include/swiper/angular/swiper_angular.d.ts delete mode 100644 resources/web/include/swiper/core/breakpoints/getBreakpoint.js delete mode 100644 resources/web/include/swiper/core/breakpoints/index.js delete mode 100644 resources/web/include/swiper/core/breakpoints/setBreakpoint.js delete mode 100644 resources/web/include/swiper/core/check-overflow/index.js delete mode 100644 resources/web/include/swiper/core/classes/addClasses.js delete mode 100644 resources/web/include/swiper/core/classes/index.js delete mode 100644 resources/web/include/swiper/core/classes/removeClasses.js delete mode 100644 resources/web/include/swiper/core/core.js delete mode 100644 resources/web/include/swiper/core/defaults.js delete mode 100644 resources/web/include/swiper/core/events-emitter.js delete mode 100644 resources/web/include/swiper/core/events/index.js delete mode 100644 resources/web/include/swiper/core/events/onClick.js delete mode 100644 resources/web/include/swiper/core/events/onResize.js delete mode 100644 resources/web/include/swiper/core/events/onScroll.js delete mode 100644 resources/web/include/swiper/core/events/onTouchEnd.js delete mode 100644 resources/web/include/swiper/core/events/onTouchMove.js delete mode 100644 resources/web/include/swiper/core/events/onTouchStart.js delete mode 100644 resources/web/include/swiper/core/grab-cursor/index.js delete mode 100644 resources/web/include/swiper/core/grab-cursor/setGrabCursor.js delete mode 100644 resources/web/include/swiper/core/grab-cursor/unsetGrabCursor.js delete mode 100644 resources/web/include/swiper/core/images/index.js delete mode 100644 resources/web/include/swiper/core/images/loadImage.js delete mode 100644 resources/web/include/swiper/core/images/preloadImages.js delete mode 100644 resources/web/include/swiper/core/loop/index.js delete mode 100644 resources/web/include/swiper/core/loop/loopCreate.js delete mode 100644 resources/web/include/swiper/core/loop/loopDestroy.js delete mode 100644 resources/web/include/swiper/core/loop/loopFix.js delete mode 100644 resources/web/include/swiper/core/moduleExtendParams.js delete mode 100644 resources/web/include/swiper/core/modules/observer/observer.js delete mode 100644 resources/web/include/swiper/core/modules/resize/resize.js delete mode 100644 resources/web/include/swiper/core/slide/index.js delete mode 100644 resources/web/include/swiper/core/slide/slideNext.js delete mode 100644 resources/web/include/swiper/core/slide/slidePrev.js delete mode 100644 resources/web/include/swiper/core/slide/slideReset.js delete mode 100644 resources/web/include/swiper/core/slide/slideTo.js delete mode 100644 resources/web/include/swiper/core/slide/slideToClickedSlide.js delete mode 100644 resources/web/include/swiper/core/slide/slideToClosest.js delete mode 100644 resources/web/include/swiper/core/slide/slideToLoop.js delete mode 100644 resources/web/include/swiper/core/transition/index.js delete mode 100644 resources/web/include/swiper/core/transition/setTransition.js delete mode 100644 resources/web/include/swiper/core/transition/transitionEmit.js delete mode 100644 resources/web/include/swiper/core/transition/transitionEnd.js delete mode 100644 resources/web/include/swiper/core/transition/transitionStart.js delete mode 100644 resources/web/include/swiper/core/translate/getTranslate.js delete mode 100644 resources/web/include/swiper/core/translate/index.js delete mode 100644 resources/web/include/swiper/core/translate/maxTranslate.js delete mode 100644 resources/web/include/swiper/core/translate/minTranslate.js delete mode 100644 resources/web/include/swiper/core/translate/setTranslate.js delete mode 100644 resources/web/include/swiper/core/translate/translateTo.js delete mode 100644 resources/web/include/swiper/core/update/index.js delete mode 100644 resources/web/include/swiper/core/update/updateActiveIndex.js delete mode 100644 resources/web/include/swiper/core/update/updateAutoHeight.js delete mode 100644 resources/web/include/swiper/core/update/updateClickedSlide.js delete mode 100644 resources/web/include/swiper/core/update/updateProgress.js delete mode 100644 resources/web/include/swiper/core/update/updateSize.js delete mode 100644 resources/web/include/swiper/core/update/updateSlides.js delete mode 100644 resources/web/include/swiper/core/update/updateSlidesClasses.js delete mode 100644 resources/web/include/swiper/core/update/updateSlidesOffset.js delete mode 100644 resources/web/include/swiper/core/update/updateSlidesProgress.js delete mode 100644 resources/web/include/swiper/modules/a11y/a11y.js delete mode 100644 resources/web/include/swiper/modules/a11y/a11y.less delete mode 100644 resources/web/include/swiper/modules/a11y/a11y.min.css delete mode 100644 resources/web/include/swiper/modules/a11y/a11y.scss delete mode 100644 resources/web/include/swiper/modules/autoplay/autoplay.js delete mode 100644 resources/web/include/swiper/modules/autoplay/autoplay.less delete mode 100644 resources/web/include/swiper/modules/autoplay/autoplay.min.css delete mode 100644 resources/web/include/swiper/modules/autoplay/autoplay.scss delete mode 100644 resources/web/include/swiper/modules/controller/controller.js delete mode 100644 resources/web/include/swiper/modules/controller/controller.less delete mode 100644 resources/web/include/swiper/modules/controller/controller.min.css delete mode 100644 resources/web/include/swiper/modules/controller/controller.scss delete mode 100644 resources/web/include/swiper/modules/effect-cards/effect-cards.js delete mode 100644 resources/web/include/swiper/modules/effect-cards/effect-cards.less delete mode 100644 resources/web/include/swiper/modules/effect-cards/effect-cards.min.css delete mode 100644 resources/web/include/swiper/modules/effect-cards/effect-cards.scss delete mode 100644 resources/web/include/swiper/modules/effect-coverflow/effect-coverflow.js delete mode 100644 resources/web/include/swiper/modules/effect-coverflow/effect-coverflow.less delete mode 100644 resources/web/include/swiper/modules/effect-coverflow/effect-coverflow.min.css delete mode 100644 resources/web/include/swiper/modules/effect-coverflow/effect-coverflow.scss delete mode 100644 resources/web/include/swiper/modules/effect-creative/effect-creative.js delete mode 100644 resources/web/include/swiper/modules/effect-creative/effect-creative.less delete mode 100644 resources/web/include/swiper/modules/effect-creative/effect-creative.min.css delete mode 100644 resources/web/include/swiper/modules/effect-creative/effect-creative.scss delete mode 100644 resources/web/include/swiper/modules/effect-cube/effect-cube.js delete mode 100644 resources/web/include/swiper/modules/effect-cube/effect-cube.less delete mode 100644 resources/web/include/swiper/modules/effect-cube/effect-cube.min.css delete mode 100644 resources/web/include/swiper/modules/effect-cube/effect-cube.scss delete mode 100644 resources/web/include/swiper/modules/effect-fade/effect-fade.js delete mode 100644 resources/web/include/swiper/modules/effect-fade/effect-fade.less delete mode 100644 resources/web/include/swiper/modules/effect-fade/effect-fade.min.css delete mode 100644 resources/web/include/swiper/modules/effect-fade/effect-fade.scss delete mode 100644 resources/web/include/swiper/modules/effect-flip/effect-flip.js delete mode 100644 resources/web/include/swiper/modules/effect-flip/effect-flip.less delete mode 100644 resources/web/include/swiper/modules/effect-flip/effect-flip.min.css delete mode 100644 resources/web/include/swiper/modules/effect-flip/effect-flip.scss delete mode 100644 resources/web/include/swiper/modules/free-mode/free-mode.js delete mode 100644 resources/web/include/swiper/modules/free-mode/free-mode.less delete mode 100644 resources/web/include/swiper/modules/free-mode/free-mode.min.css delete mode 100644 resources/web/include/swiper/modules/free-mode/free-mode.scss delete mode 100644 resources/web/include/swiper/modules/grid/grid.js delete mode 100644 resources/web/include/swiper/modules/grid/grid.less delete mode 100644 resources/web/include/swiper/modules/grid/grid.min.css delete mode 100644 resources/web/include/swiper/modules/grid/grid.scss delete mode 100644 resources/web/include/swiper/modules/hash-navigation/hash-navigation.js delete mode 100644 resources/web/include/swiper/modules/hash-navigation/hash-navigation.less delete mode 100644 resources/web/include/swiper/modules/hash-navigation/hash-navigation.min.css delete mode 100644 resources/web/include/swiper/modules/hash-navigation/hash-navigation.scss delete mode 100644 resources/web/include/swiper/modules/history/history.js delete mode 100644 resources/web/include/swiper/modules/history/history.less delete mode 100644 resources/web/include/swiper/modules/history/history.min.css delete mode 100644 resources/web/include/swiper/modules/history/history.scss delete mode 100644 resources/web/include/swiper/modules/keyboard/keyboard.js delete mode 100644 resources/web/include/swiper/modules/keyboard/keyboard.less delete mode 100644 resources/web/include/swiper/modules/keyboard/keyboard.min.css delete mode 100644 resources/web/include/swiper/modules/keyboard/keyboard.scss delete mode 100644 resources/web/include/swiper/modules/lazy/lazy.js delete mode 100644 resources/web/include/swiper/modules/lazy/lazy.less delete mode 100644 resources/web/include/swiper/modules/lazy/lazy.min.css delete mode 100644 resources/web/include/swiper/modules/lazy/lazy.scss delete mode 100644 resources/web/include/swiper/modules/manipulation/manipulation.js delete mode 100644 resources/web/include/swiper/modules/manipulation/manipulation.less delete mode 100644 resources/web/include/swiper/modules/manipulation/manipulation.min.css delete mode 100644 resources/web/include/swiper/modules/manipulation/manipulation.scss delete mode 100644 resources/web/include/swiper/modules/manipulation/methods/addSlide.js delete mode 100644 resources/web/include/swiper/modules/manipulation/methods/appendSlide.js delete mode 100644 resources/web/include/swiper/modules/manipulation/methods/prependSlide.js delete mode 100644 resources/web/include/swiper/modules/manipulation/methods/removeAllSlides.js delete mode 100644 resources/web/include/swiper/modules/manipulation/methods/removeSlide.js delete mode 100644 resources/web/include/swiper/modules/mousewheel/mousewheel.js delete mode 100644 resources/web/include/swiper/modules/mousewheel/mousewheel.less delete mode 100644 resources/web/include/swiper/modules/mousewheel/mousewheel.min.css delete mode 100644 resources/web/include/swiper/modules/mousewheel/mousewheel.scss delete mode 100644 resources/web/include/swiper/modules/navigation/navigation.js delete mode 100644 resources/web/include/swiper/modules/navigation/navigation.less delete mode 100644 resources/web/include/swiper/modules/navigation/navigation.min.css delete mode 100644 resources/web/include/swiper/modules/navigation/navigation.scss delete mode 100644 resources/web/include/swiper/modules/pagination/pagination.js delete mode 100644 resources/web/include/swiper/modules/pagination/pagination.less delete mode 100644 resources/web/include/swiper/modules/pagination/pagination.min.css delete mode 100644 resources/web/include/swiper/modules/pagination/pagination.scss delete mode 100644 resources/web/include/swiper/modules/parallax/parallax.js delete mode 100644 resources/web/include/swiper/modules/parallax/parallax.less delete mode 100644 resources/web/include/swiper/modules/parallax/parallax.min.css delete mode 100644 resources/web/include/swiper/modules/parallax/parallax.scss delete mode 100644 resources/web/include/swiper/modules/scrollbar/scrollbar.js delete mode 100644 resources/web/include/swiper/modules/scrollbar/scrollbar.less delete mode 100644 resources/web/include/swiper/modules/scrollbar/scrollbar.min.css delete mode 100644 resources/web/include/swiper/modules/scrollbar/scrollbar.scss delete mode 100644 resources/web/include/swiper/modules/thumbs/thumbs.js delete mode 100644 resources/web/include/swiper/modules/thumbs/thumbs.less delete mode 100644 resources/web/include/swiper/modules/thumbs/thumbs.min.css delete mode 100644 resources/web/include/swiper/modules/thumbs/thumbs.scss delete mode 100644 resources/web/include/swiper/modules/virtual/virtual.js delete mode 100644 resources/web/include/swiper/modules/virtual/virtual.less delete mode 100644 resources/web/include/swiper/modules/virtual/virtual.min.css delete mode 100644 resources/web/include/swiper/modules/virtual/virtual.scss delete mode 100644 resources/web/include/swiper/modules/zoom/zoom.js delete mode 100644 resources/web/include/swiper/modules/zoom/zoom.less delete mode 100644 resources/web/include/swiper/modules/zoom/zoom.min.css delete mode 100644 resources/web/include/swiper/modules/zoom/zoom.scss delete mode 100644 resources/web/include/swiper/node_modules/dom7/LICENSE delete mode 100644 resources/web/include/swiper/node_modules/dom7/README.md delete mode 100644 resources/web/include/swiper/node_modules/dom7/dom7.d.ts delete mode 100644 resources/web/include/swiper/node_modules/dom7/dom7.esm.js delete mode 100644 resources/web/include/swiper/node_modules/dom7/dom7.js delete mode 100644 resources/web/include/swiper/node_modules/dom7/dom7.js.map delete mode 100644 resources/web/include/swiper/node_modules/dom7/dom7.min.js delete mode 100644 resources/web/include/swiper/node_modules/dom7/dom7.min.js.map delete mode 100644 resources/web/include/swiper/node_modules/dom7/package.json delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/LICENSE delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/README.md delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/package.json delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/ssr-window.esm.js delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/ssr-window.umd.js delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/ssr-window.umd.js.map delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/ssr-window.umd.min.js delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/ssr-window.umd.min.js.map delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/types/document.d.ts delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/types/extend.d.ts delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/types/ssr-window.d.ts delete mode 100644 resources/web/include/swiper/node_modules/ssr-window/types/window.d.ts delete mode 100644 resources/web/include/swiper/package.json delete mode 100644 resources/web/include/swiper/postinstall.js delete mode 100644 resources/web/include/swiper/react/get-changed-params.js delete mode 100644 resources/web/include/swiper/react/get-children.js delete mode 100644 resources/web/include/swiper/react/get-params.js delete mode 100644 resources/web/include/swiper/react/init-swiper.js delete mode 100644 resources/web/include/swiper/react/loop.js delete mode 100644 resources/web/include/swiper/react/params-list.js delete mode 100644 resources/web/include/swiper/react/swiper-react.d.ts delete mode 100644 resources/web/include/swiper/react/swiper-react.js delete mode 100644 resources/web/include/swiper/react/swiper-slide.js delete mode 100644 resources/web/include/swiper/react/swiper.js delete mode 100644 resources/web/include/swiper/react/update-swiper.js delete mode 100644 resources/web/include/swiper/react/use-isomorphic-layout-effect.js delete mode 100644 resources/web/include/swiper/react/utils.js delete mode 100644 resources/web/include/swiper/react/virtual.js delete mode 100644 resources/web/include/swiper/shared/classes-to-selector.js delete mode 100644 resources/web/include/swiper/shared/create-element-if-not-defined.js delete mode 100644 resources/web/include/swiper/shared/create-shadow.js delete mode 100644 resources/web/include/swiper/shared/dom.js delete mode 100644 resources/web/include/swiper/shared/effect-init.js delete mode 100644 resources/web/include/swiper/shared/effect-target.js delete mode 100644 resources/web/include/swiper/shared/effect-virtual-transition-end.js delete mode 100644 resources/web/include/swiper/shared/get-browser.js delete mode 100644 resources/web/include/swiper/shared/get-device.js delete mode 100644 resources/web/include/swiper/shared/get-support.js delete mode 100644 resources/web/include/swiper/shared/utils.js delete mode 100644 resources/web/include/swiper/svelte/get-changed-params.js delete mode 100644 resources/web/include/swiper/svelte/get-params.js delete mode 100644 resources/web/include/swiper/svelte/init-swiper.js delete mode 100644 resources/web/include/swiper/svelte/params-list.js delete mode 100644 resources/web/include/swiper/svelte/swiper-slide.svelte delete mode 100644 resources/web/include/swiper/svelte/swiper-svelte.d.ts delete mode 100644 resources/web/include/swiper/svelte/swiper-svelte.js delete mode 100644 resources/web/include/swiper/svelte/swiper.svelte delete mode 100644 resources/web/include/swiper/svelte/update-swiper.js delete mode 100644 resources/web/include/swiper/svelte/utils.js delete mode 100644 resources/web/include/swiper/swiper-bundle.css delete mode 100644 resources/web/include/swiper/swiper-bundle.esm.browser.js delete mode 100644 resources/web/include/swiper/swiper-bundle.esm.browser.js.map delete mode 100644 resources/web/include/swiper/swiper-bundle.esm.browser.min.js delete mode 100644 resources/web/include/swiper/swiper-bundle.esm.browser.min.js.map delete mode 100644 resources/web/include/swiper/swiper-bundle.esm.js delete mode 100644 resources/web/include/swiper/swiper-bundle.js delete mode 100644 resources/web/include/swiper/swiper-bundle.js.map delete mode 100644 resources/web/include/swiper/swiper-bundle.min.js.map delete mode 100644 resources/web/include/swiper/swiper-vars.less delete mode 100644 resources/web/include/swiper/swiper-vars.scss delete mode 100644 resources/web/include/swiper/swiper.d.ts delete mode 100644 resources/web/include/swiper/swiper.esm.js delete mode 100644 resources/web/include/swiper/swiper.less delete mode 100644 resources/web/include/swiper/swiper.min.css delete mode 100644 resources/web/include/swiper/swiper.scss delete mode 100644 resources/web/include/swiper/types/index.d.ts delete mode 100644 resources/web/include/swiper/types/modules/a11y.d.ts delete mode 100644 resources/web/include/swiper/types/modules/autoplay.d.ts delete mode 100644 resources/web/include/swiper/types/modules/controller.d.ts delete mode 100644 resources/web/include/swiper/types/modules/effect-cards.d.ts delete mode 100644 resources/web/include/swiper/types/modules/effect-coverflow.d.ts delete mode 100644 resources/web/include/swiper/types/modules/effect-creative.d.ts delete mode 100644 resources/web/include/swiper/types/modules/effect-cube.d.ts delete mode 100644 resources/web/include/swiper/types/modules/effect-fade.d.ts delete mode 100644 resources/web/include/swiper/types/modules/effect-flip.d.ts delete mode 100644 resources/web/include/swiper/types/modules/free-mode.d.ts delete mode 100644 resources/web/include/swiper/types/modules/grid.d.ts delete mode 100644 resources/web/include/swiper/types/modules/hash-navigation.d.ts delete mode 100644 resources/web/include/swiper/types/modules/history.d.ts delete mode 100644 resources/web/include/swiper/types/modules/keyboard.d.ts delete mode 100644 resources/web/include/swiper/types/modules/lazy.d.ts delete mode 100644 resources/web/include/swiper/types/modules/manipulation.d.ts delete mode 100644 resources/web/include/swiper/types/modules/mousewheel.d.ts delete mode 100644 resources/web/include/swiper/types/modules/navigation.d.ts delete mode 100644 resources/web/include/swiper/types/modules/pagination.d.ts delete mode 100644 resources/web/include/swiper/types/modules/parallax.d.ts delete mode 100644 resources/web/include/swiper/types/modules/public-api.d.ts delete mode 100644 resources/web/include/swiper/types/modules/scrollbar.d.ts delete mode 100644 resources/web/include/swiper/types/modules/thumbs.d.ts delete mode 100644 resources/web/include/swiper/types/modules/virtual.d.ts delete mode 100644 resources/web/include/swiper/types/modules/zoom.d.ts delete mode 100644 resources/web/include/swiper/types/shared.d.ts delete mode 100644 resources/web/include/swiper/types/swiper-class.d.ts delete mode 100644 resources/web/include/swiper/types/swiper-events.d.ts delete mode 100644 resources/web/include/swiper/types/swiper-options.d.ts delete mode 100644 resources/web/include/swiper/vue/get-changed-params.js delete mode 100644 resources/web/include/swiper/vue/get-children.js delete mode 100644 resources/web/include/swiper/vue/get-params.js delete mode 100644 resources/web/include/swiper/vue/init-swiper.js delete mode 100644 resources/web/include/swiper/vue/loop.js delete mode 100644 resources/web/include/swiper/vue/params-list.js delete mode 100644 resources/web/include/swiper/vue/swiper-slide.js delete mode 100644 resources/web/include/swiper/vue/swiper-vue.d.ts delete mode 100644 resources/web/include/swiper/vue/swiper-vue.js delete mode 100644 resources/web/include/swiper/vue/swiper.js delete mode 100644 resources/web/include/swiper/vue/update-swiper.js delete mode 100644 resources/web/include/swiper/vue/utils.js delete mode 100644 resources/web/include/swiper/vue/virtual.js delete mode 100644 resources/web/model/img/p1.png delete mode 100644 resources/web/model/img/p2.png delete mode 100644 resources/web/model/img/p3.png delete mode 100644 resources/web/model/img/p4.png delete mode 100644 resources/web/model/img/p5.png delete mode 100644 resources/web/model/img/p6.png delete mode 100644 resources/web/model/test.js diff --git a/resources/web/dialog/js/jquery-2.1.1.min.js b/resources/web/dialog/js/jquery-2.1.1.min.js deleted file mode 100644 index e150866a71..0000000000 --- a/resources/web/dialog/js/jquery-2.1.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b) -},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("