mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 02:32:04 +08:00
Don't consider top surface as safe for 'only_retract_when_crossing_perimeters'
supermerill/SuperSlicer#2128
This commit is contained in:
parent
f0548ab5f7
commit
74e01b5759
@ -4432,13 +4432,20 @@ bool GCode::can_cross_perimeter(const Polyline& travel, bool offset)
|
|||||||
//if (inside) {
|
//if (inside) {
|
||||||
//contained inside at least one bb
|
//contained inside at least one bb
|
||||||
//construct m_layer_slices_offseted if needed
|
//construct m_layer_slices_offseted if needed
|
||||||
if (m_layer_slices_offseted.layer != m_layer && offset) {
|
if (m_layer_slices_offseted.layer != m_layer) {
|
||||||
m_layer_slices_offseted.layer = m_layer;
|
m_layer_slices_offseted.layer = m_layer;
|
||||||
m_layer_slices_offseted.diameter = scale_t(EXTRUDER_CONFIG_WITH_DEFAULT(nozzle_diameter, 0.4));
|
m_layer_slices_offseted.diameter = scale_t(EXTRUDER_CONFIG_WITH_DEFAULT(nozzle_diameter, 0.4));
|
||||||
m_layer_slices_offseted.slices = offset_ex(m_layer->lslices, -m_layer_slices_offseted.diameter * 1.5f);
|
m_layer_slices_offseted.slices = m_layer->lslices;
|
||||||
|
m_layer_slices_offseted.slices_offsetted = offset_ex(m_layer->lslices, -m_layer_slices_offseted.diameter * 1.5f);
|
||||||
|
//remove top surfaces
|
||||||
|
for (const LayerRegion* reg : m_layer->regions()) {
|
||||||
|
m_layer_slices_offseted.slices_offsetted = diff_ex(m_layer_slices_offseted.slices_offsetted, to_expolygons(reg->fill_surfaces.filter_by_type_flag(SurfaceType::stPosTop)));
|
||||||
|
m_layer_slices_offseted.slices = diff_ex(m_layer_slices_offseted.slices, to_expolygons(reg->fill_surfaces.filter_by_type_flag(SurfaceType::stPosTop)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// test if a expoly contains the entire travel
|
// test if a expoly contains the entire travel
|
||||||
for (const ExPolygon &poly : offset ? m_layer_slices_offseted.slices : m_layer->lslices)
|
for (const ExPolygon &poly : offset ? m_layer_slices_offseted.slices_offsetted : m_layer_slices_offseted.slices)
|
||||||
if (poly.contains(travel)) {
|
if (poly.contains(travel)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -367,8 +367,11 @@ private:
|
|||||||
// For crossing perimeter retraction detection (contain the layer & nozzle widdth used to construct it)
|
// For crossing perimeter retraction detection (contain the layer & nozzle widdth used to construct it)
|
||||||
// !!!! not thread-safe !!!! if threaded per layer, please store it in the thread.
|
// !!!! not thread-safe !!!! if threaded per layer, please store it in the thread.
|
||||||
struct SliceOffsetted {
|
struct SliceOffsetted {
|
||||||
ExPolygons slices; const Layer* layer; coord_t diameter;
|
ExPolygons slices;
|
||||||
} m_layer_slices_offseted{ {},nullptr, 0};
|
ExPolygons slices_offsetted;
|
||||||
|
const Layer* layer;
|
||||||
|
coord_t diameter;
|
||||||
|
} m_layer_slices_offseted{ {},{},nullptr, 0};
|
||||||
double m_volumetric_speed;
|
double m_volumetric_speed;
|
||||||
// Support for the extrusion role markers. Which marker is active?
|
// Support for the extrusion role markers. Which marker is active?
|
||||||
ExtrusionRole m_last_extrusion_role;
|
ExtrusionRole m_last_extrusion_role;
|
||||||
|
@ -19,7 +19,9 @@ public:
|
|||||||
operator ExPolygons() const;
|
operator ExPolygons() const;
|
||||||
void simplify(double tolerance);
|
void simplify(double tolerance);
|
||||||
void group(std::vector<SurfacesPtr> *retval);
|
void group(std::vector<SurfacesPtr> *retval);
|
||||||
|
// get all surfaces that have this exact SurfaceType
|
||||||
SurfacesConstPtr filter_by_type(const SurfaceType type) const;
|
SurfacesConstPtr filter_by_type(const SurfaceType type) const;
|
||||||
|
// get all surfaces that have this SurfaceType flag in their SurfaceType
|
||||||
SurfacesConstPtr filter_by_type_flag(const SurfaceType allowed, const SurfaceType not_allowed = stNone) const;
|
SurfacesConstPtr filter_by_type_flag(const SurfaceType allowed, const SurfaceType not_allowed = stNone) const;
|
||||||
SurfacesConstPtr filter_by_types(const SurfaceType *types, int ntypes) const;
|
SurfacesConstPtr filter_by_types(const SurfaceType *types, int ntypes) const;
|
||||||
void keep_type(const SurfaceType type);
|
void keep_type(const SurfaceType type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user