mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-31 00:52:51 +00:00
Perform additional checks before merging solid surfaces (i.e. take flow and fill pattern into account)
This commit is contained in:
@@ -16,6 +16,13 @@ Surface::is_solid() const
|
||||
|| this->surface_type == stInternalSolid;
|
||||
}
|
||||
|
||||
bool
|
||||
Surface::is_external() const
|
||||
{
|
||||
return this->surface_type == stTop
|
||||
|| this->surface_type == stBottom;
|
||||
}
|
||||
|
||||
bool
|
||||
Surface::is_bridge() const
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ class Surface
|
||||
unsigned short extra_perimeters;
|
||||
double area() const;
|
||||
bool is_solid() const;
|
||||
bool is_external() const;
|
||||
bool is_bridge() const;
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
|
||||
@@ -21,14 +21,14 @@ SurfaceCollection::simplify(double tolerance)
|
||||
|
||||
/* group surfaces by common properties */
|
||||
void
|
||||
SurfaceCollection::group(std::vector<SurfacesPtr> *retval, bool merge_solid)
|
||||
SurfaceCollection::group(std::vector<SurfacesPtr> *retval)
|
||||
{
|
||||
for (Surfaces::iterator it = this->surfaces.begin(); it != this->surfaces.end(); ++it) {
|
||||
// find a group with the same properties
|
||||
SurfacesPtr* group = NULL;
|
||||
for (std::vector<SurfacesPtr>::iterator git = retval->begin(); git != retval->end(); ++git) {
|
||||
Surface* gkey = git->front();
|
||||
if ((gkey->surface_type == it->surface_type || (merge_solid && gkey->is_solid() && it->is_solid()))
|
||||
if ( gkey->surface_type == it->surface_type
|
||||
&& gkey->thickness == it->thickness
|
||||
&& gkey->thickness_layers == it->thickness_layers
|
||||
&& gkey->bridge_angle == it->bridge_angle) {
|
||||
|
||||
@@ -11,7 +11,7 @@ class SurfaceCollection
|
||||
public:
|
||||
Surfaces surfaces;
|
||||
void simplify(double tolerance);
|
||||
void group(std::vector<SurfacesPtr> *retval, bool merge_solid = false);
|
||||
void group(std::vector<SurfacesPtr> *retval);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user