![]() |
Prusa Slicer 2.6.0
|
#include <src/libslic3r/Arachne/utils/ExtrusionLine.hpp>
Collaboration diagram for Slic3r::Arachne::ExtrusionLine:Public Member Functions | |
| size_t | size () const |
| bool | empty () const |
| ExtrusionLine (const size_t inset_idx, const bool is_odd) | |
| ExtrusionLine () | |
| ExtrusionLine (const ExtrusionLine &other) | |
| ExtrusionLine & | operator= (ExtrusionLine &&other) |
| ExtrusionLine & | operator= (const ExtrusionLine &other) |
| std::vector< ExtrusionJunction >::const_iterator | begin () const |
| std::vector< ExtrusionJunction >::const_iterator | end () const |
| std::vector< ExtrusionJunction >::const_reverse_iterator | rbegin () const |
| std::vector< ExtrusionJunction >::const_reverse_iterator | rend () const |
| std::vector< ExtrusionJunction >::const_reference | front () const |
| std::vector< ExtrusionJunction >::const_reference | back () const |
| const ExtrusionJunction & | operator[] (unsigned int index) const |
| ExtrusionJunction & | operator[] (unsigned int index) |
| std::vector< ExtrusionJunction >::iterator | begin () |
| std::vector< ExtrusionJunction >::iterator | end () |
| std::vector< ExtrusionJunction >::reference | front () |
| std::vector< ExtrusionJunction >::reference | back () |
| template<typename... Args> | |
| void | emplace_back (Args &&...args) |
| void | remove (unsigned int index) |
| void | insert (size_t index, const ExtrusionJunction &p) |
| template<class iterator > | |
| std::vector< ExtrusionJunction >::iterator | insert (std::vector< ExtrusionJunction >::const_iterator pos, iterator first, iterator last) |
| void | clear () |
| void | reverse () |
| int64_t | getLength () const |
| int64_t | polylineLength () const |
| Polygon | toPolygon () const |
| coord_t | getMinimalWidth () const |
| void | simplify (int64_t smallest_line_segment_squared, int64_t allowed_error_distance_squared, int64_t maximum_extrusion_area_deviation) |
| bool | is_contour () const |
| double | area () const |
Static Public Member Functions | |
| static int64_t | calculateExtrusionAreaDeviationError (ExtrusionJunction A, ExtrusionJunction B, ExtrusionJunction C) |
Public Attributes | |
| size_t | inset_idx |
| bool | is_odd |
| bool | is_closed |
| std::vector< ExtrusionJunction > | junctions |
Represents a polyline (not just a line) that is to be extruded with variable line width.
This polyline is a sequence of ExtrusionJunction, with a bit of metadata about which inset it represents.
|
inline |
|
inline |
| double Slic3r::Arachne::ExtrusionLine::area | ( | ) | const |
References Slic3r::cross2(), is_closed, and junctions.
Here is the call graph for this function:
|
inline |
|
inline |
References junctions.
Referenced by Slic3r::fuzzy_extrusion_line(), Slic3r::Arachne::SkeletalTrapezoidation::generateLocalMaximaSingleBeads(), and getLength().
Here is the caller graph for this function:
|
inline |
|
inline |
References junctions.
Referenced by Slic3r::Arachne::to_thick_polyline().
Here is the caller graph for this function:
|
static |
Computes and returns the total area error (in μm²) of the AB and BC segments of an ABC straight ExtrusionLine when the junction B with a width B.w is removed from the ExtrusionLine. The area changes due to the fact that the new simplified line AC has a uniform width which equals to the weighted average of the width of the subsegments (based on their length).
| A | Start point of the 3-point-straight line |
| B | Intermediate point of the 3-point-straight line |
| C | End point of the 3-point-straight line |
References Slic3r::Arachne::ExtrusionJunction::p, and Slic3r::Arachne::ExtrusionJunction::w.
Referenced by simplify().
Here is the caller graph for this function:
|
inline |
|
inline |
|
inline |
Whether there are no junctions.
References junctions.
Referenced by Slic3r::traverse_extrusions().
Here is the caller graph for this function:
|
inline |
|
inline |
References junctions.
Referenced by Slic3r::Arachne::to_thick_polyline().
Here is the caller graph for this function:
|
inline |
|
inline |
References junctions.
Referenced by Slic3r::fuzzy_extrusion_line(), getLength(), and Slic3r::Arachne::to_thick_polyline().
Here is the caller graph for this function:| int64_t Slic3r::Arachne::ExtrusionLine::getLength | ( | ) | const |
Sum the total length of this path.
References back(), front(), is_closed, junctions, and Slic3r::Arachne::ExtrusionJunction::p.
Referenced by polylineLength().
Here is the call graph for this function:
Here is the caller graph for this function:| coord_t Slic3r::Arachne::ExtrusionLine::getMinimalWidth | ( | ) | const |
|
inline |
|
inline |
| bool Slic3r::Arachne::ExtrusionLine::is_contour | ( | ) | const |
References Slic3r::Polygon::is_clockwise(), is_closed, junctions, and Slic3r::MultiPoint::points.
Here is the call graph for this function:
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void Slic3r::Arachne::ExtrusionLine::simplify | ( | int64_t | smallest_line_segment_squared, |
| int64_t | allowed_error_distance_squared, | ||
| int64_t | maximum_extrusion_area_deviation | ||
| ) |
Removes vertices of the ExtrusionLines to make sure that they are not too high resolution.
This removes junctions which are connected to line segments that are shorter than the smallest_line_segment, unless that would introduce a deviation in the contour of more than allowed_error_distance.
Criteria:
smallest_line_segment allowed_error_distance smallest_line_segment always remains unaltered (but their end points may change if it is connected to a small segment)Simplify uses a heuristic and doesn't necessarily remove all removable vertices under the above criteria, but simplify may never violate these criteria. Unless the segments or the distance is smaller than the rounding error of 5 micron.
Vertices which introduce an error of less than 5 microns are removed anyway, even if the segments are longer than the smallest line segment. This makes sure that (practically) co-linear line segments are joined into a single line segment.
| smallest_line_segment | Maximal length of removed line segments. |
| allowed_error_distance | If removing a vertex introduces a deviation from the original path that is more than this distance, the vertex may not be removed. |
| maximum_extrusion_area_deviation | The maximum extrusion area deviation allowed when removing intermediate junctions from a straight ExtrusionLine |
References calculateExtrusionAreaDeviationError(), Slic3r::Line::distance_to_infinite(), Slic3r::Line::distance_to_infinite_squared(), Slic3r::Line::intersection_infinite(), is_closed, junctions, Slic3r::Arachne::ExtrusionJunction::p, Slic3r::Arachne::ExtrusionJunction::perimeter_index, and Slic3r::Arachne::ExtrusionJunction::w.
Here is the call graph for this function:
|
inline |
Gets the number of vertices in this polygon.
References junctions.
Referenced by Slic3r::fuzzy_extrusion_line(), Slic3r::Arachne::to_thick_polyline(), and Slic3r::traverse_extrusions().
Here is the caller graph for this function:
|
inline |
Put all junction locations into a polygon object.
When this path is not closed the returned Polygon should be handled as a polyline, rather than a polygon.
References junctions, and Slic3r::MultiPoint::points.
| size_t Slic3r::Arachne::ExtrusionLine::inset_idx |
Which inset this path represents, counted from the outside inwards.
The outer wall has index 0.
Referenced by operator=(), operator=(), and Slic3r::traverse_extrusions().
| bool Slic3r::Arachne::ExtrusionLine::is_closed |
Whether this is a closed polygonal path
Referenced by area(), getLength(), is_contour(), operator=(), operator=(), Slic3r::Arachne::WallToolPaths::removeSmallLines(), simplify(), and Slic3r::traverse_extrusions().
| bool Slic3r::Arachne::ExtrusionLine::is_odd |
If a thin piece needs to be printed with an odd number of walls (e.g. 5 walls) then there will be one wall in the middle that is not a loop. This field indicates whether this path is such a line through the middle, that has no companion line going back on the other side and is not a closed loop.
Referenced by Slic3r::Arachne::PolylineStitcher< Paths, Path, Junction >::isOdd(), operator=(), operator=(), and Slic3r::Arachne::WallToolPaths::removeSmallLines().
| std::vector<ExtrusionJunction> Slic3r::Arachne::ExtrusionLine::junctions |
The list of vertices along which this path runs.
Each junction has a width, making this path a variable-width path.
Referenced by area(), back(), back(), begin(), begin(), clear(), emplace_back(), empty(), end(), end(), front(), front(), Slic3r::fuzzy_extrusion_line(), Slic3r::Arachne::SkeletalTrapezoidation::generateLocalMaximaSingleBeads(), getLength(), getMinimalWidth(), insert(), insert(), is_contour(), operator=(), operator=(), operator[](), operator[](), rbegin(), remove(), rend(), reverse(), simplify(), size(), Slic3r::Arachne::to_polygon(), toPolygon(), and Slic3r::traverse_extrusions().