delete mesh transforms (#37)

* delete mesh shear, scale and refactor logger

* clean up config options

* reorder UI elements
This commit is contained in:
Joseph Robertson
2026-05-31 05:08:42 -05:00
committed by GitHub
parent 8a578cdf00
commit 0bda684dd7
25 changed files with 377 additions and 1008 deletions

View File

@@ -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;