up version to 47.1

fix macos/linux build
This commit is contained in:
supermerill 2020-01-15 18:04:23 +01:00
parent eecf28c00c
commit 705edaa7fb
2 changed files with 31 additions and 33 deletions

View File

@ -2349,41 +2349,39 @@ end:
} }
ExPolygons PrintObject::_offset_holes(double hole_delta, const ExPolygons &polys) const{ ExPolygons PrintObject::_offset_holes(double hole_delta, const ExPolygons &polys) const{
if (hole_delta != 0.f) { ExPolygons new_polys;
ExPolygons new_polys; for (const ExPolygon &ex_poly : polys) {
for (const ExPolygon &ex_poly : polys) { ExPolygon new_ex_poly(ex_poly);
ExPolygon new_ex_poly(ex_poly); new_ex_poly.holes.clear();
new_ex_poly.holes.clear(); for (const Polygon &hole : ex_poly.holes) {
for (const Polygon &hole : ex_poly.holes) { //check if convex to reduce it
//check if convex to reduce it // check whether first point forms a convex angle
// check whether first point forms a convex angle //note: we allow a deviation of 5.7° (0.01rad = 0.57°)
//note: we allow a deviation of 5.7° (0.01rad = 0.57°) bool ok = true;
bool ok = true; ok = (hole.points.front().ccw_angle(hole.points.back(), *(hole.points.begin() + 1)) <= PI + 0.1);
ok = (hole.points.front().ccw_angle(hole.points.back(), *(hole.points.begin() + 1)) <= PI + 0.1); // check whether points 1..(n-1) form convex angles
// check whether points 1..(n-1) form convex angles if (ok)
if (ok) for (Points::const_iterator p = hole.points.begin() + 1; p != hole.points.end() - 1; ++p) {
for (Points::const_iterator p = hole.points.begin() + 1; p != hole.points.end() - 1; ++p) { ok = (p->ccw_angle(*(p - 1), *(p + 1)) <= PI + 0.1);
ok = (p->ccw_angle(*(p - 1), *(p + 1)) <= PI + 0.1); if (!ok) break;
if (!ok) break;
}
// check whether last point forms a convex angle
ok &= (hole.points.back().ccw_angle(*(hole.points.end() - 2), hole.points.front()) <= PI + 0.1);
if (ok) {
for (Polygon newHole : offset(hole, hole_delta)) {
//reverse because it's a hole, not an object
newHole.make_clockwise();
new_ex_poly.holes.push_back(newHole);
}
} else {
new_ex_poly.holes.push_back(hole);
} }
// check whether last point forms a convex angle
ok &= (hole.points.back().ccw_angle(*(hole.points.end() - 2), hole.points.front()) <= PI + 0.1);
if (ok) {
for (Polygon newHole : offset(hole, hole_delta)) {
//reverse because it's a hole, not an object
newHole.make_clockwise();
new_ex_poly.holes.push_back(newHole);
}
} else {
new_ex_poly.holes.push_back(hole);
} }
new_polys.push_back(new_ex_poly);
} }
return new_polys; new_polys.push_back(new_ex_poly);
} }
return new_polys;
} }
/// max angle: you ahve to be lwer than that to divide it. PI => all accepted /// max angle: you ahve to be lwer than that to divide it. PI => all accepted

View File

@ -5,5 +5,5 @@ set(SLIC3R_APP_NAME "Slic3r++")
set(SLIC3R_APP_KEY "Slic3r++") set(SLIC3R_APP_KEY "Slic3r++")
set(SLIC3R_VERSION "2.2.47") set(SLIC3R_VERSION "2.2.47")
set(SLIC3R_BUILD_ID "slic3r++_${SLIC3R_VERSION}+UNKNOWN") set(SLIC3R_BUILD_ID "slic3r++_${SLIC3R_VERSION}+UNKNOWN")
set(SLIC3R_RC_VERSION "2,2,47,0") set(SLIC3R_RC_VERSION "2,2,47,1")
set(SLIC3R_RC_VERSION_DOTS "2.2.47.0") set(SLIC3R_RC_VERSION_DOTS "2.2.47.1")