Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2016-11-08 17:35:08 +0300
committerbubnikv <bubnikv@gmail.com>2016-11-08 17:35:08 +0300
commite92501e51e24c005fd0b2d5ff167b32f14431390 (patch)
tree07633817ccede4046192a46313ab72b060b53127 /xs
parentb8590180d8152844e8709063d3fe048dec305c1c (diff)
Use a less aggressive positive offset for top/bottom/bridge surfaces,
when enlarging them for better anchoring.
Diffstat (limited to 'xs')
-rw-r--r--xs/src/libslic3r/LayerRegion.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/xs/src/libslic3r/LayerRegion.cpp b/xs/src/libslic3r/LayerRegion.cpp
index 0f916c2bf..f25ad2dc0 100644
--- a/xs/src/libslic3r/LayerRegion.cpp
+++ b/xs/src/libslic3r/LayerRegion.cpp
@@ -88,6 +88,10 @@ LayerRegion::make_perimeters(const SurfaceCollection &slices, SurfaceCollection*
g.process();
}
+//#define EXTERNAL_SURFACES_OFFSET_PARAMETERS CLIPPER_OFFSET_SCALE, ClipperLib::jtMiter, 3.
+//#define EXTERNAL_SURFACES_OFFSET_PARAMETERS CLIPPER_OFFSET_SCALE, ClipperLib::jtMiter, 1.5
+#define EXTERNAL_SURFACES_OFFSET_PARAMETERS CLIPPER_OFFSET_SCALE, ClipperLib::jtSquare, 0.
+
void
LayerRegion::process_external_surfaces(const Layer* lower_layer)
{
@@ -104,7 +108,7 @@ LayerRegion::process_external_surfaces(const Layer* lower_layer)
for (Surfaces::const_iterator surface = surfaces.begin(); surface != surfaces.end(); ++surface) {
if (!surface->is_bottom()) continue;
- ExPolygons grown = offset_ex(surface->expolygon, +margin);
+ ExPolygons grown = offset_ex(surface->expolygon, +margin, EXTERNAL_SURFACES_OFFSET_PARAMETERS);
/* detect bridge direction before merging grown surfaces otherwise adjacent bridges
would get merged into a single one while they need different directions
@@ -156,11 +160,11 @@ LayerRegion::process_external_surfaces(const Layer* lower_layer)
for (Surfaces::const_iterator surface = surfaces.begin(); surface != surfaces.end(); ++surface) {
if (surface->surface_type == stBottom || lower_layer == NULL) {
// Grown by 3mm.
- surfaces_append(bottom, offset_ex(surface->expolygon, float(margin)), *surface);
+ surfaces_append(bottom, offset_ex(surface->expolygon, float(margin), EXTERNAL_SURFACES_OFFSET_PARAMETERS), *surface);
} else if (surface->surface_type == stBottomBridge) {
bridges.push_back(*surface);
// Grown by 3mm.
- bridges_grown.push_back(offset(surface->expolygon, float(margin)));
+ bridges_grown.push_back(offset(surface->expolygon, float(margin), EXTERNAL_SURFACES_OFFSET_PARAMETERS));
bridge_bboxes.push_back(get_extents(bridges_grown.back()));
}
}
@@ -275,7 +279,7 @@ LayerRegion::process_external_surfaces(const Layer* lower_layer)
// This gives the priority to bottom surfaces.
surfaces_append(
top,
- STDMOVE(diff_ex(offset(surface->expolygon, float(margin)), bottom_polygons)),
+ STDMOVE(diff_ex(offset(surface->expolygon, float(margin), EXTERNAL_SURFACES_OFFSET_PARAMETERS), bottom_polygons)),
*surface); // template
bool internal_surface = surface->surface_type != stTop && ! surface->is_bottom();
if (has_infill || surface->surface_type != stInternal) {