Doxygen comments for Extruder, ExtrusionEntity, BridgeDetector.

This commit is contained in:
Joseph Lenox 2017-05-20 22:07:02 -05:00
parent 725f3ed94f
commit bfb8166673
4 changed files with 37 additions and 27 deletions

View File

@ -10,15 +10,15 @@ namespace Slic3r {
class BridgeDetector {
public:
// The non-grown hole.
/// The non-grown hole.
ExPolygon expolygon;
// Lower slices, all regions.
/// Lower slices, all regions.
ExPolygonCollection lower_slices;
// Scaled extrusion width of the infill.
/// Scaled extrusion width of the infill.
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;
// The final optimal angle.
/// The final optimal angle.
double angle;
BridgeDetector(const ExPolygon &_expolygon, const ExPolygonCollection &_lower_slices, coord_t _extrusion_width);
@ -28,15 +28,15 @@ public:
Polylines unsupported_edges(double angle = -1) const;
private:
// Open lines representing the supporting edges.
/// Open lines representing the supporting edges.
Polylines _edges;
// Closed polygons representing the supporting areas.
/// Closed polygons representing the supporting areas.
ExPolygons _anchors;
class BridgeDirection {
public:
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 {
// Initial sort by coverage only - comparator must obey strict weak ordering
return this->coverage > other.coverage;

View File

@ -39,13 +39,14 @@ Extruder::extrude(double 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.
If the extruder is already retracted by the same or a greater amount,
this method is a no-op.
The restart_extra argument sets the extra length to be used for
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
Extruder::retract(double length, double restart_extra)
{

View File

@ -10,6 +10,7 @@ namespace Slic3r {
class Extruder
{
public:
/// ID of current object.
unsigned int id;
double E;
double absolute_E;
@ -21,16 +22,23 @@ class Extruder
Extruder(unsigned int id, GCodeConfig *config);
virtual ~Extruder() {}
void reset();
/// Calculate the amount extruded for relative or absolute moves.
double extrude(double dE);
double retract(double length, double restart_extra);
double unretract();
double e_per_mm(double mm3_per_mm) const;
double extruded_volume() const;
double used_filament() const;
/// Calculate amount of filament used for current Extruder object.
double used_filament() const;
/// Retrieve the filament diameter for this Extruder from config.
double filament_diameter() const;
/// Retrieve the filament density for this Extruder from config.
double filament_density() const;
/// Retrieve the filament cost for this Extruder from config.
double filament_cost() const;
/// Retrieve the extrustion multiplier for this Extruder from config.
double extrusion_multiplier() const;
double retract_length() const;
double retract_lift() const;

View File

@ -11,7 +11,8 @@ class ExPolygonCollection;
class ExtrusionEntityCollection;
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 {
erNone,
erPerimeter,
@ -27,7 +28,7 @@ enum ExtrusionRole {
erSupportMaterialInterface,
};
/* Special flags describing loop */
/** \brief Special flags describing loop */
enum ExtrusionLoopRole {
elrDefault,
elrContourInternalPerimeter,
@ -45,9 +46,9 @@ public:
virtual void reverse() = 0;
virtual Point first_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;
// 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 Polyline as_polyline() const = 0;
virtual double length() const { return 0; };
@ -60,11 +61,11 @@ class ExtrusionPath : public ExtrusionEntity
public:
Polyline polyline;
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;
// Width of the extrusion.
/// Width of the extrusion.
float width;
// Height of the extrusion.
/// Height of the extrusion.
float height;
ExtrusionPath(ExtrusionRole role) : role(role), mm3_per_mm(-1), width(-1), height(-1) {};
@ -74,11 +75,11 @@ public:
void reverse() { this->polyline.reverse(); }
Point first_point() const { return this->polyline.points.front(); }
Point last_point() const { return this->polyline.points.back(); }
// Produce a list of extrusion paths into retval by clipping this path by ExPolygonCollection.
// Currently not used.
/// Produce a list of extrusion paths into retval by clipping this path by ExPolygonCollection.
/// Currently not used.
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.
// Currently not used.
/// Produce a list of extrusion paths into retval by removing parts of this path by ExPolygonCollection.
/// Currently not used.
void subtract_expolygons(const ExPolygonCollection &collection, ExtrusionEntityCollection* retval) const;
void clip_end(double distance);
void simplify(double tolerance);
@ -103,9 +104,9 @@ public:
return this->role == erBridgeInfill
|| 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;
// 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; }
Polyline as_polyline() const { return this->polyline; }
@ -141,7 +142,7 @@ class ExtrusionLoop : public ExtrusionEntity
bool split_at_vertex(const Point &point);
void split_at(const Point &point, bool prefer_non_overhang = false);
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 is_perimeter() const {
return this->paths.front().role == erPerimeter
@ -159,9 +160,9 @@ class ExtrusionLoop : public ExtrusionEntity
|| this->paths.front().role == erSolidInfill
|| 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;
// 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;
Polyline as_polyline() const { return this->polygon().split_at_first_point(); }
void append(const ExtrusionPath &path) {