mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-05 23:01:17 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user