mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-17 13:46:49 +08:00
Merge fixes
This commit is contained in:
parent
32ce0b91dc
commit
4e9372c58b
@ -49,6 +49,8 @@ struct ModelID
|
|||||||
bool operator<=(const ModelID &rhs) const { return this->id <= rhs.id; }
|
bool operator<=(const ModelID &rhs) const { return this->id <= rhs.id; }
|
||||||
bool operator>=(const ModelID &rhs) const { return this->id >= rhs.id; }
|
bool operator>=(const ModelID &rhs) const { return this->id >= rhs.id; }
|
||||||
|
|
||||||
|
bool valid() const { return id != 0; }
|
||||||
|
|
||||||
size_t id;
|
size_t id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -306,8 +306,8 @@ ExPolygons unify(const ExPolygons& shapes) {
|
|||||||
/// Only a debug function to generate top and bottom plates from a 2D shape.
|
/// Only a debug function to generate top and bottom plates from a 2D shape.
|
||||||
/// It is not used in the algorithm directly.
|
/// It is not used in the algorithm directly.
|
||||||
inline Contour3D roofs(const ExPolygon& poly, coord_t z_distance) {
|
inline Contour3D roofs(const ExPolygon& poly, coord_t z_distance) {
|
||||||
auto lower = triangulate_expolygons_3df(poly);
|
auto lower = triangulate_expolygon_3d(poly);
|
||||||
auto upper = triangulate_expolygons_3df(poly, z_distance*SCALING_FACTOR, true);
|
auto upper = triangulate_expolygon_3d(poly, z_distance*SCALING_FACTOR, true);
|
||||||
Contour3D ret;
|
Contour3D ret;
|
||||||
ret.merge(lower); ret.merge(upper);
|
ret.merge(lower); ret.merge(upper);
|
||||||
return ret;
|
return ret;
|
||||||
@ -409,8 +409,7 @@ Contour3D inner_bed(const ExPolygon& poly,
|
|||||||
double begin_h_mm = 0)
|
double begin_h_mm = 0)
|
||||||
{
|
{
|
||||||
Contour3D bottom;
|
Contour3D bottom;
|
||||||
Pointf3s triangles = triangulate_expolygons_3df(poly,
|
Pointf3s triangles = triangulate_expolygon_3d(poly, -depth_mm + begin_h_mm);
|
||||||
-depth_mm + begin_h_mm);
|
|
||||||
bottom.merge(triangles);
|
bottom.merge(triangles);
|
||||||
|
|
||||||
coord_t depth = mm(depth_mm);
|
coord_t depth = mm(depth_mm);
|
||||||
@ -597,7 +596,7 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
|
|||||||
// serve as the bottom plate of the pad. We will offset this concave hull
|
// serve as the bottom plate of the pad. We will offset this concave hull
|
||||||
// and then offset back the result with clipper with rounding edges ON. This
|
// and then offset back the result with clipper with rounding edges ON. This
|
||||||
// trick will create a nice rounded pad shape.
|
// trick will create a nice rounded pad shape.
|
||||||
auto concavehs = concave_hull(ground_layer, mergedist, cfg.throw_on_cancel);
|
ExPolygons concavehs = concave_hull(ground_layer, mergedist, cfg.throw_on_cancel);
|
||||||
|
|
||||||
const double thickness = cfg.min_wall_thickness_mm;
|
const double thickness = cfg.min_wall_thickness_mm;
|
||||||
const double wingheight = cfg.min_wall_height_mm;
|
const double wingheight = cfg.min_wall_height_mm;
|
||||||
@ -707,11 +706,11 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
|
|||||||
// Now we need to triangulate the top and bottom plates as well as the
|
// Now we need to triangulate the top and bottom plates as well as the
|
||||||
// cavity bottom plate which is the same as the bottom plate but it is
|
// cavity bottom plate which is the same as the bottom plate but it is
|
||||||
// elevated by the thickness.
|
// elevated by the thickness.
|
||||||
pool.merge(triangulate_expolygons_3df(top_poly));
|
pool.merge(triangulate_expolygon_3d(top_poly));
|
||||||
pool.merge(triangulate_expolygons_3df(inner_base, -fullheight, true));
|
pool.merge(triangulate_expolygon_3d(inner_base, -fullheight, true));
|
||||||
|
|
||||||
if(wingheight > 0)
|
if(wingheight > 0)
|
||||||
pool.merge(triangulate_expolygons_3df(inner_base, -wingheight));
|
pool.merge(triangulate_expolygon_3d(inner_base, -wingheight));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ struct Contour3D {
|
|||||||
points.insert(points.end(), triangles.begin(), triangles.end());
|
points.insert(points.end(), triangles.begin(), triangles.end());
|
||||||
indices.reserve(indices.size() + points.size() / 3);
|
indices.reserve(indices.size() + points.size() / 3);
|
||||||
|
|
||||||
for(size_t i = offs; i < points.size(); i += 3)
|
for(int i = (int)offs; i < (int)points.size(); i += 3)
|
||||||
indices.emplace_back(i, i + 1, i + 2);
|
indices.emplace_back(i, i + 1, i + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user