mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Don't generate the pad cavity if the depth is zero.
This commit is contained in:
parent
f26ec7feb3
commit
e269758df7
1 changed files with 35 additions and 26 deletions
|
@ -498,21 +498,23 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
|
||||||
// be rounded because we offset twice: ones to get the outer (top) plate
|
// be rounded because we offset twice: ones to get the outer (top) plate
|
||||||
// and again to get the inner (bottom) plate
|
// and again to get the inner (bottom) plate
|
||||||
auto outer_base = concaveh;
|
auto outer_base = concaveh;
|
||||||
|
outer_base.holes.clear();
|
||||||
offset(outer_base, s_safety_dist + s_wingdist + s_thickness);
|
offset(outer_base, s_safety_dist + s_wingdist + s_thickness);
|
||||||
auto inner_base = outer_base;
|
auto inner_base = outer_base;
|
||||||
auto middle_base = outer_base;
|
|
||||||
offset(inner_base, -(s_thickness + s_wingdist));
|
offset(inner_base, -(s_thickness + s_wingdist));
|
||||||
offset(middle_base, -s_thickness);
|
|
||||||
inner_base.holes.clear(); // bottom contour
|
|
||||||
middle_base.holes.clear(); // contour of the cavity-top
|
|
||||||
outer_base.holes.clear(); // bottom contour, also for the cavity
|
|
||||||
|
|
||||||
// Punching a hole in the top plate for the cavity
|
// Punching a hole in the top plate for the cavity
|
||||||
ExPolygon top_poly;
|
ExPolygon top_poly;
|
||||||
|
ExPolygon middle_base;
|
||||||
top_poly.contour = outer_base.contour;
|
top_poly.contour = outer_base.contour;
|
||||||
top_poly.holes.emplace_back(middle_base.contour);
|
|
||||||
auto& tph = top_poly.holes.back().points;
|
if(wingheight > 0) {
|
||||||
std::reverse(tph.begin(), tph.end());
|
middle_base = outer_base;
|
||||||
|
offset(middle_base, -s_thickness);
|
||||||
|
top_poly.holes.emplace_back(middle_base.contour);
|
||||||
|
auto& tph = top_poly.holes.back().points;
|
||||||
|
std::reverse(tph.begin(), tph.end());
|
||||||
|
}
|
||||||
|
|
||||||
Contour3D pool;
|
Contour3D pool;
|
||||||
|
|
||||||
|
@ -549,7 +551,7 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
|
||||||
// Generate the smoothed edge geometry
|
// Generate the smoothed edge geometry
|
||||||
auto walledges = round_edges(ob,
|
auto walledges = round_edges(ob,
|
||||||
r,
|
r,
|
||||||
phi, // 170 degrees
|
phi,
|
||||||
0, // z position of the input plane
|
0, // z position of the input plane
|
||||||
true,
|
true,
|
||||||
thrcl,
|
thrcl,
|
||||||
|
@ -561,37 +563,44 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out,
|
||||||
auto pwalls = walls(ob, inner_base, wh, -fullheight, thrcl);
|
auto pwalls = walls(ob, inner_base, wh, -fullheight, thrcl);
|
||||||
pool.merge(pwalls);
|
pool.merge(pwalls);
|
||||||
|
|
||||||
// Generate the smoothed edge geometry
|
if(wingheight > 0) {
|
||||||
auto cavityedges = round_edges(middle_base,
|
// Generate the smoothed edge geometry
|
||||||
r,
|
auto cavityedges = round_edges(middle_base,
|
||||||
phi - 90, // 170 degrees
|
r,
|
||||||
0, // z position of the input plane
|
phi - 90, // from tangent lines
|
||||||
false,
|
0,
|
||||||
thrcl,
|
false,
|
||||||
ob, wh);
|
thrcl,
|
||||||
pool.merge(cavityedges);
|
ob, wh);
|
||||||
|
pool.merge(cavityedges);
|
||||||
|
|
||||||
// Next is the cavity walls connecting to the top plate's artificially
|
// Next is the cavity walls connecting to the top plate's
|
||||||
// created hole.
|
// artificially created hole.
|
||||||
auto cavitywalls = walls(inner_base, ob, -wingheight, wh, thrcl);
|
auto cavitywalls = walls(inner_base, ob, -wingheight, wh, thrcl);
|
||||||
pool.merge(cavitywalls);
|
pool.merge(cavitywalls);
|
||||||
|
}
|
||||||
|
|
||||||
// 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
|
||||||
// eleveted by the thickness.
|
// eleveted by the thickness.
|
||||||
Polygons top_triangles, middle_triangles, bottom_triangles;
|
Polygons top_triangles, bottom_triangles;
|
||||||
|
|
||||||
triangulate(top_poly, top_triangles);
|
triangulate(top_poly, top_triangles);
|
||||||
triangulate(inner_base, middle_triangles);
|
|
||||||
triangulate(inner_base, bottom_triangles);
|
triangulate(inner_base, bottom_triangles);
|
||||||
|
|
||||||
auto top_plate = convert(top_triangles, 0, false);
|
auto top_plate = convert(top_triangles, 0, false);
|
||||||
auto middle_plate = convert(middle_triangles, -mm(wingheight), false);
|
|
||||||
auto bottom_plate = convert(bottom_triangles, -mm(fullheight), true);
|
auto bottom_plate = convert(bottom_triangles, -mm(fullheight), true);
|
||||||
|
|
||||||
pool.merge(top_plate);
|
pool.merge(top_plate);
|
||||||
pool.merge(middle_plate);
|
|
||||||
pool.merge(bottom_plate);
|
pool.merge(bottom_plate);
|
||||||
|
|
||||||
|
if(wingheight > 0) {
|
||||||
|
Polygons middle_triangles;
|
||||||
|
triangulate(inner_base, middle_triangles);
|
||||||
|
auto middle_plate = convert(middle_triangles, -mm(wingheight), false);
|
||||||
|
pool.merge(middle_plate);
|
||||||
|
}
|
||||||
|
|
||||||
out.merge(mesh(pool));
|
out.merge(mesh(pool));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue