Skip to content

Commit

Permalink
Refactoring of FDM support generator:
Browse files Browse the repository at this point in the history
1) If "support on build plate only" is enabled, the support columns are
   newly trimmed to not land on top of an object. However this may make
   the column too small to be stable.
2) Support enforcers newly take precedence over "supports on build plate only"
   and over "don't support bridges".
3) Some refactoring of the support generator code for clarity: Reduced
   some of the worst spagetti offenders.

Fixes Support generated even if support on build only activated #915
Fixes Bug: supports on build plate only #1340
Fixes Bottom interface layer is not generated , support on build plate only. (long open defect) #4199
Fixes option "supports on build plate only" does not work #3980

Fixes No support interface layers generated #1997
Fixes Feature Request: Option to combine results of 'support from build plate only' and 'support enforcers only' #2801
Fixes Support interface isn't generated: build plate only + blocked by model + support enforcer #3831
Fixes Support Enforcer don't create interface layers #5748
Fixes Support Enforcers Don't Have Top Loops/Raft #1870
Fixes Don't cancel support enforcers with "don't support bridges" #5105
  • Loading branch information
bubnikv committed Mar 19, 2021
1 parent 4602f40 commit 9f09f03
Show file tree
Hide file tree
Showing 5 changed files with 1,012 additions and 791 deletions.
2 changes: 1 addition & 1 deletion src/libslic3r/GCode.hpp
Expand Up @@ -373,7 +373,7 @@ class GCode {
void print_machine_envelope(FILE *file, Print &print);
void _print_first_layer_bed_temperature(FILE *file, Print &print, const std::string &gcode, unsigned int first_printing_extruder_id, bool wait);
void _print_first_layer_extruder_temperatures(FILE *file, Print &print, const std::string &gcode, unsigned int first_printing_extruder_id, bool wait);
// this flag triggers first layer speeds
// On the first printing layer. This flag triggers first layer speeds.
bool on_first_layer() const { return m_layer != nullptr && m_layer->id() == 0; }

friend ObjectByExtruder& object_by_extruder(
Expand Down
5 changes: 3 additions & 2 deletions src/libslic3r/Layer.hpp
Expand Up @@ -100,6 +100,7 @@ typedef std::vector<LayerRegion*> LayerRegionPtrs;
class Layer
{
public:
// Sequential index of this layer in PrintObject::m_layers, offsetted by the number of raft layers.
size_t id() const { return m_id; }
void set_id(size_t id) { m_id = id; }
PrintObject* object() { return m_object; }
Expand All @@ -115,7 +116,7 @@ class Layer

// Collection of expolygons generated by slicing the possibly multiple meshes of the source geometry
// (with possibly differing extruder ID and slicing parameters) and merged.
// For the first layer, if the ELephant foot compensation is applied, this lslice is uncompensated, therefore
// For the first layer, if the Elephant foot compensation is applied, this lslice is uncompensated, therefore
// it includes the Elephant foot effect, thus it corresponds to the shape of the printed 1st layer.
// These lslices aka islands are chained by the shortest traverse distance and this traversal
// order will be applied by the G-code generator to the extrusions fitting into these lslices.
Expand Down Expand Up @@ -170,7 +171,7 @@ class Layer
virtual ~Layer();

private:
// sequential number of layer, 0-based
// Sequential index of layer, 0-based, offsetted by number of raft layers.
size_t m_id;
PrintObject *m_object;
LayerRegionPtrs m_regions;
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/LayerRegion.cpp
Expand Up @@ -74,6 +74,7 @@ void LayerRegion::make_perimeters(const SurfaceCollection &slices, SurfaceCollec
const PrintRegionConfig &region_config = this->region()->config();
// This needs to be in sync with PrintObject::_slice() slicing_mode_normal_below_layer!
bool spiral_vase = print_config.spiral_vase &&
//FIXME account for raft layers.
(this->layer()->id() >= size_t(region_config.bottom_solid_layers.value) &&
this->layer()->print_z >= region_config.bottom_solid_min_thickness - EPSILON);

Expand Down

0 comments on commit 9f09f03

Please sign in to comment.