Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thin wall improvements (v3) #4790

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6ba61fe
Thin wall improvements
Aug 10, 2018
2841809
thin wall : medial axis:
Sep 25, 2018
e4484c4
forgot medial_axis.hpp/cpp files
Oct 1, 2018
418c770
Merge remote-tracking branch 'remotes/origin/master' into alexrj_thin…
Dec 3, 2018
2235c87
correct error with Polygon / ExPolygon
Dec 3, 2018
97c226a
Correct thin_wall bugs discovered with disc.stl from lordofhyphens
Dec 3, 2018
1c1451c
some modifs for a small bug (a hole that appeared between thin zone a…
Dec 4, 2018
155a68b
change the all 'medial axis segments of a semicircumference have the …
Dec 4, 2018
b6edcc4
rename variable "near" as appveyor seems to not like it.
Dec 4, 2018
d0f5bd7
one more test, reworked the thin semi-circle test.
Dec 5, 2018
32e9d9d
bugfix polylines & try to avoid many periemter splits.
Dec 5, 2018
90df3a5
debug test, relax min area for medial_axis
Dec 6, 2018
ca9f3f7
edge-case bugfix (a perimeter inside a thin_wall area)
Dec 6, 2018
6643d78
stop_at_min_width : do not extends the thin wall if it's over the min…
Dec 7, 2018
137c99c
bugfix, remove \t, #4640
Dec 10, 2018
4534c5e
Review corrections
Dec 11, 2018
767fc86
Medial axis: avoid duplication + bugfix
Dec 17, 2018
44e7ec8
bugfix ensure_not_overextrude
Dec 18, 2018
fff41c2
thin_walls_min_width & min size of thin wall is the nozzle diameter
Jan 4, 2019
69aea31
taper ends of thin walls lines
Jan 4, 2019
8555930
Merge remote-tracking branch 'remotes/origin/master' into alexrj_thin…
Jan 4, 2019
e34e75a
typo
Jan 4, 2019
fc46316
Thin_wall / medial axis:
Feb 7, 2019
f6ae12f
bugfix thin wall / gapfill width
Feb 8, 2019
f06491c
medial axis: debug
Feb 18, 2019
1687c5c
little bugfix for thinwall : concatenate_polylines_with_crossing
Apr 6, 2019
1c45045
Add sanity check for gapfill's min width.
Apr 7, 2019
8e652f1
Merge remote-tracking branch 'remotes/origin/master' into alexrj_thin…
Apr 18, 2019
d1a5fe2
medial axis: fixes
Apr 9, 2019
45a5630
Cleaning pull request
Apr 18, 2019
6273f0d
bugfix to test_fill
Jun 27, 2019
7770f70
Merge remote-tracking branch 'remotes/origin/master' into merill_thin…
Oct 22, 2019
d7357cc
some bugfix for medial axis
Oct 22, 2019
79db85d
fix for edge-cases
Feb 24, 2020
a10cf71
Merge branch 'master' into merill_thinwall
lordofhyphens Aug 23, 2020
da90a83
Change merge to prefer @supermerill implementation
lordofhyphens Aug 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
stop_at_min_width : do not extends the thin wall if it's over the min…
…_width (can be toggled when calling expolygon.medial_axis).
  • Loading branch information
supermerill committed Dec 7, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 6643d7876930e7c6ec7df71bfc7c2b5f97a2a047
9 changes: 3 additions & 6 deletions xs/src/libslic3r/ExPolygon.cpp
Original file line number Diff line number Diff line change
@@ -210,12 +210,9 @@ ExPolygon::remove_point_too_near(const coord_t tolerance) {
}

void
ExPolygon::medial_axis(const ExPolygon &bounds, double max_width, double min_width, ThickPolylines* polylines, double height) const {
ExPolygon simplifiedBounds = bounds;
simplifiedBounds.remove_point_too_near(SCALED_RESOLUTION);
ExPolygon simplifiedPolygon = *this;
simplifiedPolygon.remove_point_too_near(SCALED_RESOLUTION);
Slic3r::MedialAxis ma(simplifiedPolygon, simplifiedBounds, max_width, min_width, height);
ExPolygon::medial_axis(const ExPolygon &bounds, double max_width, double min_width, ThickPolylines* polylines, double height, bool stop_at_min_width) const {
Slic3r::MedialAxis ma(*this, bounds, max_width, min_width, height);
ma.stop_at_min_width = stop_at_min_width;
ma.build(polylines);
}

2 changes: 1 addition & 1 deletion xs/src/libslic3r/ExPolygon.hpp
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ class ExPolygon
ExPolygons simplify(double tolerance) const;
void simplify(double tolerance, ExPolygons* expolygons) const;
void remove_point_too_near(const coord_t tolerance);
void medial_axis(const ExPolygon &bounds, double max_width, double min_width, ThickPolylines* polylines, double height) const;
void medial_axis(const ExPolygon &bounds, double max_width, double min_width, ThickPolylines* polylines, double height, bool stop_at_min_width = true) const;
void medial_axis(double max_width, double min_width, Polylines* polylines) const;
void get_trapezoids(Polygons* polygons) const;
void get_trapezoids(Polygons* polygons, double angle) const;
28 changes: 21 additions & 7 deletions xs/src/libslic3r/MedialAxis.cpp
Original file line number Diff line number Diff line change
@@ -1360,6 +1360,18 @@ MedialAxis::build(ThickPolylines* polylines_out)
//fusion right-angle corners.
fusion_corners(pp);

// Loop through all returned polylines in order to extend their endpoints to the
// expolygon boundaries (if done here, it may be cut later if not thick enough)
if (stop_at_min_width) {
const ExPolygons anchors = offset2_ex(to_polygons(diff_ex(this->bounds, this->expolygon)), -SCALED_RESOLUTION, SCALED_RESOLUTION);
for (size_t i = 0; i < pp.size(); ++i) {
ThickPolyline& polyline = pp[i];
extends_line(polyline, anchors, min_width);
polyline.reverse();
extends_line(polyline, anchors, min_width);
}
}

//reduce extrusion when it's too thin to be printable
remove_too_thin_extrusion(pp);
//{
@@ -1385,13 +1397,15 @@ MedialAxis::build(ThickPolylines* polylines_out)

// Loop through all returned polylines in order to extend their endpoints to the
// expolygon boundaries
const ExPolygons anchors = offset2_ex(to_polygons(diff_ex(this->bounds, this->expolygon)), -SCALED_RESOLUTION, SCALED_RESOLUTION);
for (size_t i = 0; i < pp.size(); ++i) {
ThickPolyline& polyline = pp[i];
extends_line(polyline, anchors, min_width);
polyline.reverse();
extends_line(polyline, anchors, min_width);
}
if (!stop_at_min_width) {
const ExPolygons anchors = offset2_ex(to_polygons(diff_ex(this->bounds, this->expolygon)), -SCALED_RESOLUTION, SCALED_RESOLUTION);
for (size_t i = 0; i < pp.size(); ++i) {
ThickPolyline& polyline = pp[i];
extends_line(polyline, anchors, min_width);
polyline.reverse();
extends_line(polyline, anchors, min_width);
}
}
//{
// stringstream stri;
// stri << "medial_axis_5_expand_" << id << ".svg";
1 change: 1 addition & 0 deletions xs/src/libslic3r/MedialAxis.hpp
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ namespace Slic3r {
const double max_width;
const double min_width;
const double height;
bool stop_at_min_width = true;
MedialAxis(const ExPolygon &_expolygon, const ExPolygon &_bounds, const double _max_width, const double _min_width, const double _height)
: surface(_expolygon), bounds(_bounds), max_width(_max_width), min_width(_min_width), height(_height) {
};