mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-05 09:07:39 +00:00
Anisotropic surfaces + Separated Infills (remake) (#11682)
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com> Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
This commit is contained in:
@@ -2708,6 +2708,23 @@ 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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user