Fine tuning parameters and fixing pad wings when greater gaps are used.

This commit is contained in:
tamasmeszaros 2019-06-12 13:15:42 +02:00
parent c80aae1bdb
commit 12396c3051
8 changed files with 64 additions and 33 deletions

View file

@ -383,18 +383,12 @@ Polygons unify(const Polygons& shapes) {
// inserted along the perimeter in every "stride" distance. The stick rectangles
// will have a with about "stick_width". The input dimensions are in world
// measure, not the scaled clipper units.
void offset_with_breakstick_holes(ExPolygon& poly,
double padding,
double stride,
double stick_width,
double penetration)
{
// We do the basic offsetting first
static const bool dont_round_edges = false;
if(padding > 0.0)
offset(poly, coord_t(padding / SCALING_FACTOR), dont_round_edges);
void breakstick_holes(ExPolygon& poly,
double padding,
double stride,
double stick_width,
double penetration)
{
// SVG svg("bridgestick_plate.svg");
// svg.draw(poly);
@ -428,8 +422,8 @@ void offset_with_breakstick_holes(ExPolygon& poly,
out.emplace_back(a);
// dodge the start point, do not make sticks on the joins
while (t < sright) t += sright;
double tend = nrm - sright;
while (t < sbottom) t += sbottom;
double tend = nrm - sbottom;
while (t < tend) { // insert the stick on the polygon perimeter

View file

@ -30,11 +30,11 @@ void base_plate(const TriangleMesh& mesh, // input mesh
// inserted along the perimeter in every "stride" distance. The stick rectangles
// will have a with about "stick_width". The input dimensions are in world
// measure, not the scaled clipper units.
void offset_with_breakstick_holes(ExPolygon& poly,
double padding,
double stride,
double stick_width,
double penetration = 0.0);
void breakstick_holes(ExPolygon &poly,
double padding,
double stride,
double stick_width,
double penetration = 0.0);
struct PoolConfig {
double min_wall_thickness_mm = 2;

View file

@ -578,23 +578,31 @@ struct Pad {
float(cfg.min_wall_height_mm + cfg.min_wall_thickness_mm),
0.1f, pcfg.throw_on_cancel);
// We don't need the holes for the base plate from the supports
for (const ExPolygon &bp : platetmp) basep.emplace_back(bp.contour);
for (const ExPolygon &bp : modelbase) basep.emplace_back(bp.contour);
if(pcfg.embed_object) {
auto modelbase_sticks = modelbase;
for(auto& poly : modelbase_sticks)
sla::offset_with_breakstick_holes(
if (pcfg.embed_object.object_gap_mm > 0.0)
modelbase_sticks
= offset_ex(modelbase_sticks,
coord_t(pcfg.embed_object.object_gap_mm
/ SCALING_FACTOR));
for(auto& poly : modelbase_sticks) {
basep.emplace_back(poly);
sla::breakstick_holes(
poly,
pcfg.embed_object.object_gap_mm, // padding
pcfg.embed_object.stick_stride_mm,
pcfg.embed_object.stick_width_mm,
pcfg.embed_object.stick_penetration_mm);
}
create_base_pool(basep, tmesh, modelbase_sticks, cfg);
} else {
for (const ExPolygon &bp : modelbase) basep.emplace_back(bp.contour);
create_base_pool(basep, tmesh, {}, cfg);
}