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
This commit is contained in:
Joseph Robertson
2026-05-18 19:01:43 -05:00
committed by GitHub
parent 8fa6a4602b
commit 6a2d690f45
19 changed files with 621 additions and 46 deletions
+14
View File
@@ -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) {