Part 2.5: Add global shear transform, support clipping, and belt UI improvements

- 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)
This commit is contained in:
harrierpigeon
2026-04-09 23:07:07 -05:00
parent 501aff7e53
commit 98f4d34dcb
13 changed files with 452 additions and 91 deletions
+51
View File
@@ -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);
}