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
This commit is contained in:
harrierpigeon
2026-03-11 03:58:52 -05:00
parent a7441c7f48
commit c808653565
22 changed files with 375 additions and 31 deletions

View File

@@ -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<ConfigOptionBool>("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<float>(belt_angle));
if (preview)
preview->get_canvas3d()->get_gcode_viewer().set_belt_printer(true, static_cast<float>(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");