mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 21:57:22 +08:00
Doxygen comments for Extruder, ExtrusionEntity, BridgeDetector.
This commit is contained in:
parent
725f3ed94f
commit
bfb8166673
@ -10,15 +10,15 @@ namespace Slic3r {
|
|||||||
|
|
||||||
class BridgeDetector {
|
class BridgeDetector {
|
||||||
public:
|
public:
|
||||||
// The non-grown hole.
|
/// The non-grown hole.
|
||||||
ExPolygon expolygon;
|
ExPolygon expolygon;
|
||||||
// Lower slices, all regions.
|
/// Lower slices, all regions.
|
||||||
ExPolygonCollection lower_slices;
|
ExPolygonCollection lower_slices;
|
||||||
// Scaled extrusion width of the infill.
|
/// Scaled extrusion width of the infill.
|
||||||
coord_t extrusion_width;
|
coord_t extrusion_width;
|
||||||
// Angle resolution for the brute force search of the best bridging angle.
|
/// Angle resolution for the brute force search of the best bridging angle.
|
||||||
double resolution;
|
double resolution;
|
||||||
// The final optimal angle.
|
/// The final optimal angle.
|
||||||
double angle;
|
double angle;
|
||||||
|
|
||||||
BridgeDetector(const ExPolygon &_expolygon, const ExPolygonCollection &_lower_slices, coord_t _extrusion_width);
|
BridgeDetector(const ExPolygon &_expolygon, const ExPolygonCollection &_lower_slices, coord_t _extrusion_width);
|
||||||
@ -28,15 +28,15 @@ public:
|
|||||||
Polylines unsupported_edges(double angle = -1) const;
|
Polylines unsupported_edges(double angle = -1) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Open lines representing the supporting edges.
|
/// Open lines representing the supporting edges.
|
||||||
Polylines _edges;
|
Polylines _edges;
|
||||||
// Closed polygons representing the supporting areas.
|
/// Closed polygons representing the supporting areas.
|
||||||
ExPolygons _anchors;
|
ExPolygons _anchors;
|
||||||
|
|
||||||
class BridgeDirection {
|
class BridgeDirection {
|
||||||
public:
|
public:
|
||||||
BridgeDirection(double a = -1.) : angle(a), coverage(0.), max_length(0.) {}
|
BridgeDirection(double a = -1.) : angle(a), coverage(0.), max_length(0.) {}
|
||||||
// the best direction is the one causing most lines to be bridged (thus most coverage)
|
/// the best direction is the one causing most lines to be bridged (thus most coverage)
|
||||||
bool operator<(const BridgeDirection &other) const {
|
bool operator<(const BridgeDirection &other) const {
|
||||||
// Initial sort by coverage only - comparator must obey strict weak ordering
|
// Initial sort by coverage only - comparator must obey strict weak ordering
|
||||||
return this->coverage > other.coverage;
|
return this->coverage > other.coverage;
|
||||||
|
@ -39,13 +39,14 @@ Extruder::extrude(double dE)
|
|||||||
return dE;
|
return dE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This method makes sure the extruder is retracted by the specified amount
|
/** This method makes sure the extruder is retracted by the specified amount
|
||||||
of filament and returns the amount of filament retracted.
|
of filament and returns the amount of filament retracted.
|
||||||
If the extruder is already retracted by the same or a greater amount,
|
If the extruder is already retracted by the same or a greater amount,
|
||||||
this method is a no-op.
|
this method is a no-op.
|
||||||
The restart_extra argument sets the extra length to be used for
|
The restart_extra argument sets the extra length to be used for
|
||||||
unretraction. If we're actually performing a retraction, any restart_extra
|
unretraction. If we're actually performing a retraction, any restart_extra
|
||||||
value supplied will overwrite the previous one if any. */
|
value supplied will overwrite the previous one if any.
|
||||||
|
*/
|
||||||
double
|
double
|
||||||
Extruder::retract(double length, double restart_extra)
|
Extruder::retract(double length, double restart_extra)
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,7 @@ namespace Slic3r {
|
|||||||
class Extruder
|
class Extruder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/// ID of current object.
|
||||||
unsigned int id;
|
unsigned int id;
|
||||||
double E;
|
double E;
|
||||||
double absolute_E;
|
double absolute_E;
|
||||||
@ -21,16 +22,23 @@ class Extruder
|
|||||||
Extruder(unsigned int id, GCodeConfig *config);
|
Extruder(unsigned int id, GCodeConfig *config);
|
||||||
virtual ~Extruder() {}
|
virtual ~Extruder() {}
|
||||||
void reset();
|
void reset();
|
||||||
|
/// Calculate the amount extruded for relative or absolute moves.
|
||||||
double extrude(double dE);
|
double extrude(double dE);
|
||||||
double retract(double length, double restart_extra);
|
double retract(double length, double restart_extra);
|
||||||
double unretract();
|
double unretract();
|
||||||
double e_per_mm(double mm3_per_mm) const;
|
double e_per_mm(double mm3_per_mm) const;
|
||||||
double extruded_volume() const;
|
double extruded_volume() const;
|
||||||
|
|
||||||
|
/// Calculate amount of filament used for current Extruder object.
|
||||||
double used_filament() const;
|
double used_filament() const;
|
||||||
|
|
||||||
|
/// Retrieve the filament diameter for this Extruder from config.
|
||||||
double filament_diameter() const;
|
double filament_diameter() const;
|
||||||
|
/// Retrieve the filament density for this Extruder from config.
|
||||||
double filament_density() const;
|
double filament_density() const;
|
||||||
|
/// Retrieve the filament cost for this Extruder from config.
|
||||||
double filament_cost() const;
|
double filament_cost() const;
|
||||||
|
/// Retrieve the extrustion multiplier for this Extruder from config.
|
||||||
double extrusion_multiplier() const;
|
double extrusion_multiplier() const;
|
||||||
double retract_length() const;
|
double retract_length() const;
|
||||||
double retract_lift() const;
|
double retract_lift() const;
|
||||||
|
@ -11,7 +11,8 @@ class ExPolygonCollection;
|
|||||||
class ExtrusionEntityCollection;
|
class ExtrusionEntityCollection;
|
||||||
class Extruder;
|
class Extruder;
|
||||||
|
|
||||||
/* Each ExtrusionRole value identifies a distinct set of { extruder, speed } */
|
/** \brief Each ExtrusionRole value identifies a distinct set of { extruder, speed }
|
||||||
|
*/
|
||||||
enum ExtrusionRole {
|
enum ExtrusionRole {
|
||||||
erNone,
|
erNone,
|
||||||
erPerimeter,
|
erPerimeter,
|
||||||
@ -27,7 +28,7 @@ enum ExtrusionRole {
|
|||||||
erSupportMaterialInterface,
|
erSupportMaterialInterface,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Special flags describing loop */
|
/** \brief Special flags describing loop */
|
||||||
enum ExtrusionLoopRole {
|
enum ExtrusionLoopRole {
|
||||||
elrDefault,
|
elrDefault,
|
||||||
elrContourInternalPerimeter,
|
elrContourInternalPerimeter,
|
||||||
@ -45,9 +46,9 @@ public:
|
|||||||
virtual void reverse() = 0;
|
virtual void reverse() = 0;
|
||||||
virtual Point first_point() const = 0;
|
virtual Point first_point() const = 0;
|
||||||
virtual Point last_point() const = 0;
|
virtual Point last_point() const = 0;
|
||||||
// Produce a list of 2D polygons covered by the extruded path.
|
/// Produce a list of 2D polygons covered by the extruded path.
|
||||||
virtual Polygons grow() const = 0;
|
virtual Polygons grow() const = 0;
|
||||||
// Minimum volumetric velocity of this extrusion entity. Used by the constant nozzle pressure algorithm.
|
/// Minimum volumetric velocity of this extrusion entity. Used by the constant nozzle pressure algorithm.
|
||||||
virtual double min_mm3_per_mm() const = 0;
|
virtual double min_mm3_per_mm() const = 0;
|
||||||
virtual Polyline as_polyline() const = 0;
|
virtual Polyline as_polyline() const = 0;
|
||||||
virtual double length() const { return 0; };
|
virtual double length() const { return 0; };
|
||||||
@ -60,11 +61,11 @@ class ExtrusionPath : public ExtrusionEntity
|
|||||||
public:
|
public:
|
||||||
Polyline polyline;
|
Polyline polyline;
|
||||||
ExtrusionRole role;
|
ExtrusionRole role;
|
||||||
// Volumetric velocity. mm^3 of plastic per mm of linear head motion
|
/// Volumetric velocity. mm^3 of plastic per mm of linear head motion
|
||||||
double mm3_per_mm;
|
double mm3_per_mm;
|
||||||
// Width of the extrusion.
|
/// Width of the extrusion.
|
||||||
float width;
|
float width;
|
||||||
// Height of the extrusion.
|
/// Height of the extrusion.
|
||||||
float height;
|
float height;
|
||||||
|
|
||||||
ExtrusionPath(ExtrusionRole role) : role(role), mm3_per_mm(-1), width(-1), height(-1) {};
|
ExtrusionPath(ExtrusionRole role) : role(role), mm3_per_mm(-1), width(-1), height(-1) {};
|
||||||
@ -74,11 +75,11 @@ public:
|
|||||||
void reverse() { this->polyline.reverse(); }
|
void reverse() { this->polyline.reverse(); }
|
||||||
Point first_point() const { return this->polyline.points.front(); }
|
Point first_point() const { return this->polyline.points.front(); }
|
||||||
Point last_point() const { return this->polyline.points.back(); }
|
Point last_point() const { return this->polyline.points.back(); }
|
||||||
// Produce a list of extrusion paths into retval by clipping this path by ExPolygonCollection.
|
/// Produce a list of extrusion paths into retval by clipping this path by ExPolygonCollection.
|
||||||
// Currently not used.
|
/// Currently not used.
|
||||||
void intersect_expolygons(const ExPolygonCollection &collection, ExtrusionEntityCollection* retval) const;
|
void intersect_expolygons(const ExPolygonCollection &collection, ExtrusionEntityCollection* retval) const;
|
||||||
// Produce a list of extrusion paths into retval by removing parts of this path by ExPolygonCollection.
|
/// Produce a list of extrusion paths into retval by removing parts of this path by ExPolygonCollection.
|
||||||
// Currently not used.
|
/// Currently not used.
|
||||||
void subtract_expolygons(const ExPolygonCollection &collection, ExtrusionEntityCollection* retval) const;
|
void subtract_expolygons(const ExPolygonCollection &collection, ExtrusionEntityCollection* retval) const;
|
||||||
void clip_end(double distance);
|
void clip_end(double distance);
|
||||||
void simplify(double tolerance);
|
void simplify(double tolerance);
|
||||||
@ -103,9 +104,9 @@ public:
|
|||||||
return this->role == erBridgeInfill
|
return this->role == erBridgeInfill
|
||||||
|| this->role == erOverhangPerimeter;
|
|| this->role == erOverhangPerimeter;
|
||||||
};
|
};
|
||||||
// Produce a list of 2D polygons covered by the extruded path.
|
/// Produce a list of 2D polygons covered by the extruded path.
|
||||||
Polygons grow() const;
|
Polygons grow() const;
|
||||||
// Minimum volumetric velocity of this extrusion entity. Used by the constant nozzle pressure algorithm.
|
/// Minimum volumetric velocity of this extrusion entity. Used by the constant nozzle pressure algorithm.
|
||||||
double min_mm3_per_mm() const { return this->mm3_per_mm; }
|
double min_mm3_per_mm() const { return this->mm3_per_mm; }
|
||||||
Polyline as_polyline() const { return this->polyline; }
|
Polyline as_polyline() const { return this->polyline; }
|
||||||
|
|
||||||
@ -141,7 +142,7 @@ class ExtrusionLoop : public ExtrusionEntity
|
|||||||
bool split_at_vertex(const Point &point);
|
bool split_at_vertex(const Point &point);
|
||||||
void split_at(const Point &point, bool prefer_non_overhang = false);
|
void split_at(const Point &point, bool prefer_non_overhang = false);
|
||||||
void clip_end(double distance, ExtrusionPaths* paths) const;
|
void clip_end(double distance, ExtrusionPaths* paths) const;
|
||||||
// Test, whether the point is extruded by a bridging flow.
|
/// Test, whether the point is extruded by a bridging flow.
|
||||||
bool has_overhang_point(const Point &point) const;
|
bool has_overhang_point(const Point &point) const;
|
||||||
bool is_perimeter() const {
|
bool is_perimeter() const {
|
||||||
return this->paths.front().role == erPerimeter
|
return this->paths.front().role == erPerimeter
|
||||||
@ -159,9 +160,9 @@ class ExtrusionLoop : public ExtrusionEntity
|
|||||||
|| this->paths.front().role == erSolidInfill
|
|| this->paths.front().role == erSolidInfill
|
||||||
|| this->paths.front().role == erTopSolidInfill;
|
|| this->paths.front().role == erTopSolidInfill;
|
||||||
}
|
}
|
||||||
// Produce a list of 2D polygons covered by the extruded path.
|
/// Produce a list of 2D polygons covered by the extruded path.
|
||||||
Polygons grow() const;
|
Polygons grow() const;
|
||||||
// Minimum volumetric velocity of this extrusion entity. Used by the constant nozzle pressure algorithm.
|
/// Minimum volumetric velocity of this extrusion entity. Used by the constant nozzle pressure algorithm.
|
||||||
double min_mm3_per_mm() const;
|
double min_mm3_per_mm() const;
|
||||||
Polyline as_polyline() const { return this->polygon().split_at_first_point(); }
|
Polyline as_polyline() const { return this->polygon().split_at_first_point(); }
|
||||||
void append(const ExtrusionPath &path) {
|
void append(const ExtrusionPath &path) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user