Separated Infills enhancements (#14674)

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
This commit is contained in:
Ian Bassi
2026-07-12 11:45:00 -03:00
committed by GitHub
parent bfbf591613
commit c4ea86041b
10 changed files with 164 additions and 100 deletions

View File

@@ -2708,23 +2708,6 @@ const TriangleMesh& ModelVolume::get_convex_hull() const
return *m_convex_hull.get();
}
// Orca: get volume bbox for separate infill
static std::mutex mtx_model;
BoundingBox ModelVolume::get_volume_bbox(const Transform3d &matrix, Point &shift, bool apply_cache = false) {
std::unique_lock l(mtx_model); // locks function here
// Orca: the cache is keyed by the instance transform/shift; a ModelVolume is shared
// across instances, so returning the cache blindly would hand back another instance's bbox.
if (m_cached_volume_bbox.defined && apply_cache
&& matrix.isApprox(m_cached_volume_bbox_matrix)
&& shift == m_cached_volume_bbox_shift)
return m_cached_volume_bbox;
auto hull = get_convex_hull_2d(matrix);
hull.translate(-shift);
m_cached_volume_bbox_matrix = matrix;
m_cached_volume_bbox_shift = shift;
return m_cached_volume_bbox = hull.bounding_box().polygon().bounding_box();
}
//BBS: refine the model part names
ModelVolumeType ModelVolume::type_from_string(const std::string &s)
{