mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 15:37:30 -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
|
@ -2779,6 +2779,24 @@ void ModelVolume::convert_from_meters()
|
|||
this->source.is_converted_from_meters = true;
|
||||
}
|
||||
|
||||
// Orca: Implement prusa's filament shrink compensation approach
|
||||
// Returns 0-based indices of extruders painted by multi-material painting gizmo.
|
||||
std::vector<size_t> ModelVolume::get_extruders_from_multi_material_painting() const {
|
||||
if (!this->is_mm_painted())
|
||||
return {};
|
||||
|
||||
assert(static_cast<size_t>(TriangleStateType::Extruder1) - 1 == 0);
|
||||
const TriangleSelector::TriangleSplittingData &data = this->mmu_segmentation_facets.get_data();
|
||||
|
||||
std::vector<size_t> extruders;
|
||||
for (size_t state_idx = static_cast<size_t>(EnforcerBlockerType::Extruder1); state_idx < data.used_states.size(); ++state_idx) {
|
||||
if (data.used_states[state_idx])
|
||||
extruders.emplace_back(state_idx - 1);
|
||||
}
|
||||
|
||||
return extruders;
|
||||
}
|
||||
|
||||
void ModelInstance::transform_mesh(TriangleMesh* mesh, bool dont_translate) const
|
||||
{
|
||||
mesh->transform(dont_translate ? get_matrix_no_offset() : get_matrix());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue