Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::SlicingParameters Struct Reference

#include <src/libslic3r/Slicing.hpp>

Public Member Functions

 SlicingParameters ()=default
 
bool has_raft () const
 
size_t raft_layers () const
 
bool first_object_layer_height_fixed () const
 
coordf_t object_print_z_height () const
 

Static Public Member Functions

static SlicingParameters create_from_config (const PrintConfig &print_config, const PrintObjectConfig &object_config, coordf_t object_height, const std::vector< unsigned int > &object_extruders)
 

Public Attributes

bool valid { false }
 
size_t base_raft_layers { 0 }
 
size_t interface_raft_layers { 0 }
 
coordf_t base_raft_layer_height { 0 }
 
coordf_t interface_raft_layer_height { 0 }
 
coordf_t contact_raft_layer_height { 0 }
 
coordf_t layer_height { 0 }
 
coordf_t min_layer_height { 0 }
 
coordf_t max_layer_height { 0 }
 
coordf_t max_suport_layer_height { 0 }
 
coordf_t first_print_layer_height { 0 }
 
coordf_t first_object_layer_height { 0 }
 
bool first_object_layer_bridging { false }
 
bool soluble_interface { false }
 
coordf_t gap_raft_object { 0 }
 
coordf_t gap_object_support { 0 }
 
coordf_t gap_support_object { 0 }
 
coordf_t raft_base_top_z { 0 }
 
coordf_t raft_interface_top_z { 0 }
 
coordf_t raft_contact_top_z { 0 }
 
coordf_t object_print_z_min { 0 }
 
coordf_t object_print_z_max { 0 }
 

Detailed Description

Constructor & Destructor Documentation

◆ SlicingParameters()

Slic3r::SlicingParameters::SlicingParameters ( )
default

Member Function Documentation

◆ create_from_config()

SlicingParameters Slic3r::SlicingParameters::create_from_config ( const PrintConfig &  print_config,
const PrintObjectConfig object_config,
coordf_t  object_height,
const std::vector< unsigned int > &  object_extruders 
)
static
66{
67 assert(! print_config.first_layer_height.percent);
68 coordf_t first_layer_height = (print_config.first_layer_height.value <= 0) ?
69 object_config.layer_height.value : print_config.first_layer_height.value;
70 // If object_config.support_material_extruder == 0 resp. object_config.support_material_interface_extruder == 0,
71 // print_config.nozzle_diameter.get_at(size_t(-1)) returns the 0th nozzle diameter,
72 // which is consistent with the requirement that if support_material_extruder == 0 resp. support_material_interface_extruder == 0,
73 // support will not trigger tool change, but it will use the current nozzle instead.
74 // In that case all the nozzles have to be of the same diameter.
75 coordf_t support_material_extruder_dmr = print_config.nozzle_diameter.get_at(object_config.support_material_extruder.value - 1);
76 coordf_t support_material_interface_extruder_dmr = print_config.nozzle_diameter.get_at(object_config.support_material_interface_extruder.value - 1);
77 bool soluble_interface = object_config.support_material_contact_distance.value == 0.;
78
79 SlicingParameters params;
80 params.layer_height = object_config.layer_height.value;
81 params.first_print_layer_height = first_layer_height;
82 params.first_object_layer_height = first_layer_height;
83 params.object_print_z_min = 0.;
84 params.object_print_z_max = object_height;
85 params.base_raft_layers = object_config.raft_layers.value;
86 params.soluble_interface = soluble_interface;
87
88 // Miniumum/maximum of the minimum layer height over all extruders.
89 params.min_layer_height = MIN_LAYER_HEIGHT;
90 params.max_layer_height = std::numeric_limits<double>::max();
91 if (object_config.support_material.value || params.base_raft_layers > 0 || object_config.support_material_enforce_layers > 0) {
92 // Has some form of support. Add the support layers to the minimum / maximum layer height limits.
93 params.min_layer_height = std::max(
94 min_layer_height_from_nozzle(print_config, object_config.support_material_extruder),
95 min_layer_height_from_nozzle(print_config, object_config.support_material_interface_extruder));
96 params.max_layer_height = std::min(
97 max_layer_height_from_nozzle(print_config, object_config.support_material_extruder),
98 max_layer_height_from_nozzle(print_config, object_config.support_material_interface_extruder));
99 params.max_suport_layer_height = params.max_layer_height;
100 }
101 if (object_extruders.empty()) {
102 params.min_layer_height = std::max(params.min_layer_height, min_layer_height_from_nozzle(print_config, 0));
103 params.max_layer_height = std::min(params.max_layer_height, max_layer_height_from_nozzle(print_config, 0));
104 } else {
105 for (unsigned int extruder_id : object_extruders) {
106 params.min_layer_height = std::max(params.min_layer_height, min_layer_height_from_nozzle(print_config, extruder_id));
107 params.max_layer_height = std::min(params.max_layer_height, max_layer_height_from_nozzle(print_config, extruder_id));
108 }
109 }
110 params.min_layer_height = std::min(params.min_layer_height, params.layer_height);
111 params.max_layer_height = std::max(params.max_layer_height, params.layer_height);
112
113 if (! soluble_interface) {
114 params.gap_raft_object = object_config.raft_contact_distance.value;
115 params.gap_object_support = object_config.support_material_bottom_contact_distance.value;
116 params.gap_support_object = object_config.support_material_contact_distance.value;
117 if (params.gap_object_support <= 0)
118 params.gap_object_support = params.gap_support_object;
119 }
120
121 if (params.base_raft_layers > 0) {
122 params.interface_raft_layers = (params.base_raft_layers + 1) / 2;
123 params.base_raft_layers -= params.interface_raft_layers;
124 // Use as large as possible layer height for the intermediate raft layers.
125 params.base_raft_layer_height = std::max(params.layer_height, 0.75 * support_material_extruder_dmr);
126 params.interface_raft_layer_height = std::max(params.layer_height, 0.75 * support_material_interface_extruder_dmr);
127 params.first_object_layer_bridging = false;
128 params.contact_raft_layer_height = std::max(params.layer_height, 0.75 * support_material_interface_extruder_dmr);
129 params.first_object_layer_height = params.layer_height;
130 }
131
132 if (params.has_raft()) {
133 // Raise first object layer Z by the thickness of the raft itself plus the extra distance required by the support material logic.
134 //FIXME The last raft layer is the contact layer, which shall be printed with a bridging flow for ease of separation. Currently it is not the case.
135 if (params.raft_layers() == 1) {
136 // There is only the contact layer.
137 params.contact_raft_layer_height = first_layer_height;
138 params.raft_contact_top_z = first_layer_height;
139 } else {
140 assert(params.base_raft_layers > 0);
141 assert(params.interface_raft_layers > 0);
142 // Number of the base raft layers is decreased by the first layer.
143 params.raft_base_top_z = first_layer_height + coordf_t(params.base_raft_layers - 1) * params.base_raft_layer_height;
144 // Number of the interface raft layers is decreased by the contact layer.
145 params.raft_interface_top_z = params.raft_base_top_z + coordf_t(params.interface_raft_layers - 1) * params.interface_raft_layer_height;
146 params.raft_contact_top_z = params.raft_interface_top_z + params.contact_raft_layer_height;
147 }
148 coordf_t print_z = params.raft_contact_top_z + params.gap_raft_object;
149 params.object_print_z_min = print_z;
150 params.object_print_z_max += print_z;
151 }
152
153 params.valid = true;
154 return params;
155}
double coordf_t
Definition libslic3r.h:45
double coordf_t
Definition GUI_ObjectList.hpp:36
coordf_t max_layer_height_from_nozzle(const PrintConfig &print_config, int idx_nozzle)
Definition Slicing.cpp:36
coordf_t min_layer_height_from_nozzle(const PrintConfig &print_config, int idx_nozzle)
Definition Slicing.cpp:28
static const coordf_t MIN_LAYER_HEIGHT
Definition Slicing.cpp:24
bool soluble_interface
Definition Slicing.hpp:82

References base_raft_layer_height, base_raft_layers, contact_raft_layer_height, first_object_layer_bridging, first_object_layer_height, first_print_layer_height, gap_object_support, gap_raft_object, gap_support_object, has_raft(), interface_raft_layer_height, interface_raft_layers, layer_height, max_layer_height, Slic3r::max_layer_height_from_nozzle(), max_suport_layer_height, Slic3r::MIN_LAYER_HEIGHT, min_layer_height, Slic3r::min_layer_height_from_nozzle(), object_print_z_max, object_print_z_min, raft_base_top_z, raft_contact_top_z, raft_interface_top_z, raft_layers(), soluble_interface, and valid.

+ Here is the call graph for this function:

◆ first_object_layer_height_fixed()

bool Slic3r::SlicingParameters::first_object_layer_height_fixed ( ) const
inline
bool has_raft() const
Definition Slicing.hpp:38
bool first_object_layer_bridging
Definition Slicing.hpp:78

References first_object_layer_bridging, and has_raft().

Referenced by Slic3r::adjust_layer_height_profile(), Slic3r::generate_object_layers(), Slic3r::layer_height_profile_adaptive(), Slic3r::layer_height_profile_from_ranges(), and Slic3r::smooth_height_profile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ has_raft()

bool Slic3r::SlicingParameters::has_raft ( ) const
inline
38{ return raft_layers() > 0; }
size_t raft_layers() const
Definition Slicing.hpp:39

References raft_layers().

Referenced by create_from_config(), first_object_layer_height_fixed(), Slic3r::PrintObjectSupportMaterial::has_raft(), and Slic3r::new_contact_layer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ object_print_z_height()

coordf_t Slic3r::SlicingParameters::object_print_z_height ( ) const
inline
coordf_t object_print_z_max
Definition Slicing.hpp:98
coordf_t object_print_z_min
Definition Slicing.hpp:97

References object_print_z_max, and object_print_z_min.

Referenced by Slic3r::adjust_layer_height_profile(), Slic3r::generate_layer_height_texture(), Slic3r::generate_object_layers(), Slic3r::SlicingAdaptive::horizontal_facet_distance(), Slic3r::layer_height_profile_adaptive(), and Slic3r::layer_height_profile_from_ranges().

+ Here is the caller graph for this function:

◆ raft_layers()

Member Data Documentation

◆ base_raft_layer_height

◆ base_raft_layers

◆ contact_raft_layer_height

coordf_t Slic3r::SlicingParameters::contact_raft_layer_height { 0 }

◆ first_object_layer_bridging

bool Slic3r::SlicingParameters::first_object_layer_bridging { false }

◆ first_object_layer_height

◆ first_print_layer_height

◆ gap_object_support

◆ gap_raft_object

coordf_t Slic3r::SlicingParameters::gap_raft_object { 0 }

◆ gap_support_object

◆ interface_raft_layer_height

◆ interface_raft_layers

◆ layer_height

◆ max_layer_height

◆ max_suport_layer_height

coordf_t Slic3r::SlicingParameters::max_suport_layer_height { 0 }

◆ min_layer_height

◆ object_print_z_max

coordf_t Slic3r::SlicingParameters::object_print_z_max { 0 }

◆ object_print_z_min

◆ raft_base_top_z

coordf_t Slic3r::SlicingParameters::raft_base_top_z { 0 }

◆ raft_contact_top_z

◆ raft_interface_top_z

coordf_t Slic3r::SlicingParameters::raft_interface_top_z { 0 }

◆ soluble_interface

◆ valid

bool Slic3r::SlicingParameters::valid { false }

The documentation for this struct was generated from the following files: