Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::PerExtruderAdjustments Struct Reference
+ Collaboration diagram for Slic3r::PerExtruderAdjustments:

Public Member Functions

float elapsed_time_total () const
 
float maximum_time_after_slowdown (bool slowdown_external_perimeters) const
 
float adjustable_time (bool slowdown_external_perimeters) const
 
float non_adjustable_time (bool slowdown_external_perimeters) const
 
float slowdown_to_minimum_feedrate (bool slowdown_external_perimeters)
 
float slow_down_proportional (float factor, bool slowdown_external_perimeters)
 
void sort_lines_by_decreasing_feedrate ()
 
float time_stretch_when_slowing_down_to_feedrate (float min_feedrate) const
 
void slow_down_to_feedrate (float min_feedrate)
 

Public Attributes

unsigned int extruder_id = 0
 
bool cooling_slow_down_enabled = false
 
float slowdown_below_layer_time = 0.f
 
float min_print_speed = 0.f
 
std::vector< CoolingLinelines
 
size_t n_lines_adjustable = 0
 
float time_non_adjustable = 0
 
float time_total = 0
 
float time_maximum = 0
 
size_t idx_line_begin = 0
 
size_t idx_line_end = 0
 

Detailed Description

Member Function Documentation

◆ adjustable_time()

float Slic3r::PerExtruderAdjustments::adjustable_time ( bool  slowdown_external_perimeters) const
inline
126 {
127 float time_total = 0.f;
128 for (const CoolingLine &line : lines)
129 if (line.adjustable(slowdown_external_perimeters))
130 time_total += line.time;
131 return time_total;
132 }
if(!(yy_init))
Definition lexer.c:1190
std::vector< CoolingLine > lines
Definition CoolingBuffer.cpp:232
float time_total
Definition CoolingBuffer.cpp:239

References lines, and time_total.

◆ elapsed_time_total()

float Slic3r::PerExtruderAdjustments::elapsed_time_total ( ) const
inline
105 {
106 float time_total = 0.f;
107 for (const CoolingLine &line : lines)
108 time_total += line.time;
109 return time_total;
110 }

References lines, and time_total.

Referenced by Slic3r::CoolingBuffer::calculate_layer_slowdown().

+ Here is the caller graph for this function:

◆ maximum_time_after_slowdown()

float Slic3r::PerExtruderAdjustments::maximum_time_after_slowdown ( bool  slowdown_external_perimeters) const
inline
113 {
114 float time_total = 0.f;
115 for (const CoolingLine &line : lines)
116 if (line.adjustable(slowdown_external_perimeters)) {
117 if (line.time_max == FLT_MAX)
118 return FLT_MAX;
119 else
120 time_total += line.time_max;
121 } else
122 time_total += line.time;
123 return time_total;
124 }

References lines, and time_total.

◆ non_adjustable_time()

float Slic3r::PerExtruderAdjustments::non_adjustable_time ( bool  slowdown_external_perimeters) const
inline
134 {
135 float time_total = 0.f;
136 for (const CoolingLine &line : lines)
137 if (! line.adjustable(slowdown_external_perimeters))
138 time_total += line.time;
139 return time_total;
140 }

References lines, and time_total.

◆ slow_down_proportional()

float Slic3r::PerExtruderAdjustments::slow_down_proportional ( float  factor,
bool  slowdown_external_perimeters 
)
inline
159 {
160 assert(factor >= 1.f);
161 float time_total = 0.f;
162 for (CoolingLine &line : lines) {
163 if (line.adjustable(slowdown_external_perimeters)) {
164 line.slowdown = true;
165 line.time = std::min(line.time_max, line.time * factor);
166 assert(line.time > 0);
167 line.feedrate = line.length / line.time;
168 }
169 time_total += line.time;
170 }
171 return time_total;
172 }

References lines, and time_total.

◆ slow_down_to_feedrate()

void Slic3r::PerExtruderAdjustments::slow_down_to_feedrate ( float  min_feedrate)
inline
209 {
210 assert(this->min_print_speed < min_feedrate + EPSILON);
211 for (size_t i = 0; i < n_lines_adjustable; ++ i) {
212 CoolingLine &line = lines[i];
213 if (line.feedrate > min_feedrate) {
214 assert(min_feedrate > 0);
215 line.time *= std::max(1.f, line.feedrate / min_feedrate);
216 line.feedrate = min_feedrate;
217 line.slowdown = true;
218 }
219 }
220 }
static constexpr double EPSILON
Definition libslic3r.h:51
size_t n_lines_adjustable
Definition CoolingBuffer.cpp:235
float min_print_speed
Definition CoolingBuffer.cpp:229

References EPSILON, Slic3r::CoolingLine::feedrate, lines, min_print_speed, n_lines_adjustable, Slic3r::CoolingLine::slowdown, and Slic3r::CoolingLine::time.

◆ slowdown_to_minimum_feedrate()

float Slic3r::PerExtruderAdjustments::slowdown_to_minimum_feedrate ( bool  slowdown_external_perimeters)
inline
143 {
144 float time_total = 0.f;
145 for (CoolingLine &line : lines) {
146 if (line.adjustable(slowdown_external_perimeters)) {
147 assert(line.time_max >= 0.f && line.time_max < FLT_MAX);
148 line.slowdown = true;
149 line.time = line.time_max;
150 assert(line.time > 0);
151 line.feedrate = line.length / line.time;
152 }
153 time_total += line.time;
154 }
155 return time_total;
156 }

References lines, and time_total.

◆ sort_lines_by_decreasing_feedrate()

void Slic3r::PerExtruderAdjustments::sort_lines_by_decreasing_feedrate ( )
inline
176 {
177 std::sort(lines.begin(), lines.end(), [](const CoolingLine &l1, const CoolingLine &l2) {
178 bool adj1 = l1.adjustable();
179 bool adj2 = l2.adjustable();
180 return (adj1 == adj2) ? l1.feedrate > l2.feedrate : adj1;
181 });
182 for (n_lines_adjustable = 0;
183 n_lines_adjustable < lines.size() && this->lines[n_lines_adjustable].adjustable();
186 for (size_t i = n_lines_adjustable; i < lines.size(); ++ i)
187 time_non_adjustable += lines[i].time;
188 }
T l2(const boost::geometry::model::d2::point_xy< T > &v)
Definition ExtrusionSimulator.cpp:166
float time_non_adjustable
Definition CoolingBuffer.cpp:237

References Slic3r::l2(), lines, n_lines_adjustable, and time_non_adjustable.

+ Here is the call graph for this function:

◆ time_stretch_when_slowing_down_to_feedrate()

float Slic3r::PerExtruderAdjustments::time_stretch_when_slowing_down_to_feedrate ( float  min_feedrate) const
inline
193 {
194 float time_stretch = 0.f;
195 assert(this->min_print_speed < min_feedrate + EPSILON);
196 for (size_t i = 0; i < n_lines_adjustable; ++ i) {
197 const CoolingLine &line = lines[i];
198 if (line.feedrate > min_feedrate) {
199 assert(min_feedrate > 0);
200 time_stretch += line.time * (line.feedrate / min_feedrate - 1.f);
201 }
202 }
203 return time_stretch;
204 }

References EPSILON, Slic3r::CoolingLine::feedrate, lines, min_print_speed, n_lines_adjustable, and Slic3r::CoolingLine::time.

Member Data Documentation

◆ cooling_slow_down_enabled

bool Slic3r::PerExtruderAdjustments::cooling_slow_down_enabled = false

◆ extruder_id

unsigned int Slic3r::PerExtruderAdjustments::extruder_id = 0

◆ idx_line_begin

size_t Slic3r::PerExtruderAdjustments::idx_line_begin = 0

◆ idx_line_end

size_t Slic3r::PerExtruderAdjustments::idx_line_end = 0

◆ lines

◆ min_print_speed

float Slic3r::PerExtruderAdjustments::min_print_speed = 0.f

◆ n_lines_adjustable

size_t Slic3r::PerExtruderAdjustments::n_lines_adjustable = 0

◆ slowdown_below_layer_time

float Slic3r::PerExtruderAdjustments::slowdown_below_layer_time = 0.f

◆ time_maximum

float Slic3r::PerExtruderAdjustments::time_maximum = 0

◆ time_non_adjustable

float Slic3r::PerExtruderAdjustments::time_non_adjustable = 0

◆ time_total


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