OrcaSlicer latest
OrcaSlicer
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 slow_down_layer_time = 0.f
float slow_down_min_speed = 0.f
bool dont_slow_down_outer_wall = false
std::vector< CoolingLine > lines
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
156 {
157 float time_total = 0.f;
158 for (const CoolingLine &line : lines)
159 if (line.adjustable(slowdown_external_perimeters))
160 time_total += line.time;
161 return time_total;
162 }
std::vector< CoolingLine > lines
Definition CoolingBuffer.cpp:267
float time_total
Definition CoolingBuffer.cpp:274

References lines, and time_total.

◆ elapsed_time_total()

float Slic3r::PerExtruderAdjustments::elapsed_time_total ( ) const
inline
135 {
136 float time_total = 0.f;
137 for (const CoolingLine &line : lines)
138 time_total += line.time;
139 return time_total;
140 }

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
143 {
144 float time_total = 0.f;
145 for (const CoolingLine &line : lines)
146 if (line.adjustable(slowdown_external_perimeters)) {
147 if (line.time_max == FLT_MAX)
148 return FLT_MAX;
149 else
150 time_total += line.time_max;
151 } else
152 time_total += line.time;
153 return time_total;
154 }

References lines, and time_total.

◆ non_adjustable_time()

float Slic3r::PerExtruderAdjustments::non_adjustable_time ( bool slowdown_external_perimeters) const
inline
164 {
165 float time_total = 0.f;
166 for (const CoolingLine &line : lines)
167 if (! line.adjustable(slowdown_external_perimeters))
168 time_total += line.time;
169 return time_total;
170 }

References lines, and time_total.

◆ slow_down_proportional()

float Slic3r::PerExtruderAdjustments::slow_down_proportional ( float factor,
bool slowdown_external_perimeters )
inline
190 {
191 assert(factor >= 1.f);
192 float time_total = 0.f;
193 for (CoolingLine &line : lines) {
194 if (line.adjustable(slowdown_external_perimeters)) {
195 line.slowdown = true;
196 line.time = std::min(line.time_max, line.time * factor);
197 if (line.time > 0.f)
198 line.feedrate = line.length / line.time;
199 }
200 time_total += line.time;
201 }
202 this->time_total = time_total;
203 return time_total;
204 }

References lines, and time_total.

◆ slow_down_to_feedrate()

void Slic3r::PerExtruderAdjustments::slow_down_to_feedrate ( float min_feedrate)
inline
239 {
240 assert(this->slow_down_min_speed < min_feedrate + EPSILON);
241 float time_total = 0.f;
242 for (size_t i = 0; i < n_lines_adjustable; ++ i) {
243 CoolingLine &line = lines[i];
244 if (line.feedrate > min_feedrate) {
245 line.time *= std::max(1.f, line.feedrate / min_feedrate);
246 line.feedrate = min_feedrate;
247 line.slowdown = true;
248 }
249 time_total += line.time;
250 }
251 this->time_total = time_total;
252 }
#define EPSILON
Definition ColorUtils.cpp:64
size_t n_lines_adjustable
Definition CoolingBuffer.cpp:270
float slow_down_min_speed
Definition CoolingBuffer.cpp:261

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

◆ slowdown_to_minimum_feedrate()

float Slic3r::PerExtruderAdjustments::slowdown_to_minimum_feedrate ( bool slowdown_external_perimeters)
inline
173 {
174 float time_total = 0.f;
175 for (CoolingLine &line : lines) {
176 if (line.adjustable(slowdown_external_perimeters)) {
177 assert(line.time_max >= 0.f && line.time_max < FLT_MAX);
178 line.slowdown = true;
179 line.time = line.time_max;
180 if (line.time > 0.f)
181 line.feedrate = line.length / line.time;
182 }
183 time_total += line.time;
184 }
185 this->time_total = time_total;
186 return time_total;
187 }

References lines, and time_total.

◆ sort_lines_by_decreasing_feedrate()

void Slic3r::PerExtruderAdjustments::sort_lines_by_decreasing_feedrate ( )
inline
208 {
209 std::sort(lines.begin(), lines.end(), [](const CoolingLine &l1, const CoolingLine &l2) {
210 bool adj1 = l1.adjustable();
211 bool adj2 = l2.adjustable();
212 return (adj1 == adj2) ? l1.feedrate > l2.feedrate : adj1;
213 });
214 for (n_lines_adjustable = 0;
215 n_lines_adjustable < lines.size() && this->lines[n_lines_adjustable].adjustable();
218 for (size_t i = n_lines_adjustable; i < lines.size(); ++ i)
219 time_non_adjustable += lines[i].time;
220 }
T l2(const boost::geometry::model::d2::point_xy< T > &v)
Definition ExtrusionSimulator.cpp:177
float time_non_adjustable
Definition CoolingBuffer.cpp:272

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
225 {
226 float time_stretch = 0.f;
227 assert(this->slow_down_min_speed < min_feedrate + EPSILON);
228 for (size_t i = 0; i < n_lines_adjustable; ++ i) {
229 const CoolingLine &line = lines[i];
230 if (line.feedrate > min_feedrate)
231 time_stretch += line.time * (line.feedrate / min_feedrate - 1.f);
232 }
233 return time_stretch;
234 }

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

Member Data Documentation

◆ cooling_slow_down_enabled

bool Slic3r::PerExtruderAdjustments::cooling_slow_down_enabled = false

◆ dont_slow_down_outer_wall

bool Slic3r::PerExtruderAdjustments::dont_slow_down_outer_wall = 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

◆ n_lines_adjustable

size_t Slic3r::PerExtruderAdjustments::n_lines_adjustable = 0

◆ slow_down_layer_time

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

◆ slow_down_min_speed

float Slic3r::PerExtruderAdjustments::slow_down_min_speed = 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: