mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 01:37:53 -06:00
Ported filament shrinkage compensation for XY and independent Z from Prusa Slicer (fixing MMU painting, seam painting, support painting issues) (#6507)
* Ported filament shrinkage compensation from Prusa Slicer. Updated logic to be 100 = no shrinkage to be consistent with orca definitions * Code comments update * Merge branch 'main' into Filament-Shrinkage-compension---port-from-Prusa-slicer * Merge remote-tracking branch 'upstream/main' into Filament-Shrinkage-compension---port-from-Prusa-slicer * Merge branch 'main' into Filament-Shrinkage-compension---port-from-Prusa-slicer
This commit is contained in:
parent
d1e7bb2762
commit
0ba4181a06
17 changed files with 198 additions and 52 deletions
|
@ -640,6 +640,22 @@ Transform3d Transformation::get_matrix_no_scaling_factor() const
|
|||
return copy.get_matrix();
|
||||
}
|
||||
|
||||
// Orca: Implement prusa's filament shrink compensation approach
|
||||
Transform3d Transformation::get_matrix_with_applied_shrinkage_compensation(const Vec3d &shrinkage_compensation) const {
|
||||
const Transform3d shrinkage_trafo = Geometry::scale_transform(shrinkage_compensation);
|
||||
const Vec3d trafo_offset = this->get_offset();
|
||||
const Vec3d trafo_offset_xy = Vec3d(trafo_offset.x(), trafo_offset.y(), 0.);
|
||||
|
||||
Transformation copy(*this);
|
||||
copy.set_offset(Axis::X, 0.);
|
||||
copy.set_offset(Axis::Y, 0.);
|
||||
|
||||
Transform3d trafo_after_shrinkage = (shrinkage_trafo * copy.get_matrix());
|
||||
trafo_after_shrinkage.translation() += trafo_offset_xy;
|
||||
|
||||
return trafo_after_shrinkage;
|
||||
}
|
||||
|
||||
Transformation Transformation::operator * (const Transformation& other) const
|
||||
{
|
||||
return Transformation(get_matrix() * other.get_matrix());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue