mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-03 02:22:46 +00:00
Ported from the playground branch. Various documentation and optimization.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include "BoundingBox.hpp"
|
||||
#include "Surface.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
@@ -54,4 +55,31 @@ Surface::is_bridge() const
|
||||
|| this->surface_type == stInternalBridge;
|
||||
}
|
||||
|
||||
BoundingBox get_extents(const Surface &surface)
|
||||
{
|
||||
return get_extents(surface.expolygon.contour);
|
||||
}
|
||||
|
||||
BoundingBox get_extents(const Surfaces &surfaces)
|
||||
{
|
||||
BoundingBox bbox;
|
||||
if (! surfaces.empty()) {
|
||||
bbox = get_extents(surfaces.front());
|
||||
for (size_t i = 1; i < surfaces.size(); ++ i)
|
||||
bbox.merge(get_extents(surfaces[i]));
|
||||
}
|
||||
return bbox;
|
||||
}
|
||||
|
||||
BoundingBox get_extents(const SurfacesPtr &surfaces)
|
||||
{
|
||||
BoundingBox bbox;
|
||||
if (! surfaces.empty()) {
|
||||
bbox = get_extents(*surfaces.front());
|
||||
for (size_t i = 1; i < surfaces.size(); ++ i)
|
||||
bbox.merge(get_extents(*surfaces[i]));
|
||||
}
|
||||
return bbox;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user