![]() |
Prusa Slicer 2.6.0
|
#include <src/libnest2d/include/libnest2d/placers/nfpplacer.hpp>
Collaboration diagram for libnest2d::placers::EdgeCache< RawShape >:Classes | |
| struct | ContourCache |
Public Types | |
| using | iterator = std::vector< double >::iterator |
| using | const_iterator = std::vector< double >::const_iterator |
Public Member Functions | |
| EdgeCache ()=default | |
| EdgeCache (const _Item< RawShape > &item) | |
| EdgeCache (const RawShape &sh) | |
| void | accuracy (double a) |
| Resolution of returned corners. The stride is derived from this value. | |
| Vertex | coords (double distance) const |
| Get a point on the circumference of a polygon. | |
| Vertex | coords (unsigned hidx, double distance) const |
| double | circumference () const BP2D_NOEXCEPT |
| double | circumference (unsigned hidx) const BP2D_NOEXCEPT |
| const std::vector< double > & | corners () const BP2D_NOEXCEPT |
| Get the normalized distance values for each vertex. | |
| const std::vector< double > & | corners (unsigned holeidx) const BP2D_NOEXCEPT |
| corners for a specific hole | |
| size_t | holeCount () const BP2D_NOEXCEPT |
| The number of holes in the abstracted polygon. | |
Private Types | |
| using | Vertex = TPoint< RawShape > |
| using | Coord = TCoord< Vertex > |
| using | Edge = _Segment< Vertex > |
Private Member Functions | |
| void | createCache (const RawShape &sh) |
| size_t | stride (const size_t N) const |
| void | fetchCorners () const |
| void | fetchHoleCorners (unsigned hidx) const |
| Vertex | coords (const ContourCache &cache, double distance) const |
Static Private Member Functions | |
| static double | length (const Edge &e) |
Private Attributes | |
| struct libnest2d::placers::EdgeCache::ContourCache | contour_ |
| std::vector< ContourCache > | holes_ |
| double | accuracy_ = 1.0 |
A class for getting a point on the circumference of the polygon (in log time)
This is a transformation of the provided polygon to be able to pinpoint locations on the circumference. The optimizer will pass a floating point value e.g. within <0,1> and we have to transform this value quickly into a coordinate on the circumference. By definition 0 should yield the first vertex and 1.0 would be the last (which should coincide with first).
We also have to make this work for the holes of the captured polygon.
| struct libnest2d::placers::EdgeCache::ContourCache |
Collaboration diagram for libnest2d::placers::EdgeCache< RawShape >::ContourCache:| Class Members | ||
|---|---|---|
| vector< double > | corners | |
| vector< double > | distances | |
| vector< Edge > | emap | |
| double | full_distance = 0 | |
| using libnest2d::placers::EdgeCache< RawShape >::const_iterator = std::vector<double>::const_iterator |
|
private |
|
private |
| using libnest2d::placers::EdgeCache< RawShape >::iterator = std::vector<double>::iterator |
|
private |
|
inlinedefault |
|
inline |
References libnest2d::placers::EdgeCache< RawShape >::createCache(), and libnest2d::_Item< RawShape >::transformedShape().
Here is the call graph for this function:
|
inline |
References libnest2d::placers::EdgeCache< RawShape >::createCache().
Here is the call graph for this function:
|
inline |
Resolution of returned corners. The stride is derived from this value.
References libnest2d::placers::EdgeCache< RawShape >::accuracy_.
|
inline |
References libnest2d::placers::EdgeCache< RawShape >::contour_, and libnest2d::placers::EdgeCache< RawShape >::ContourCache::full_distance.
|
inline |
References libnest2d::placers::EdgeCache< RawShape >::holes_.
|
inlineprivate |
References libnest2d::placers::EdgeCache< RawShape >::ContourCache::distances, libnest2d::placers::EdgeCache< RawShape >::ContourCache::emap, and libnest2d::placers::EdgeCache< RawShape >::ContourCache::full_distance.
Referenced by libnest2d::placers::EdgeCache< RawShape >::coords(), and libnest2d::placers::EdgeCache< RawShape >::coords().
Here is the caller graph for this function:
|
inline |
Get a point on the circumference of a polygon.
| distance | A relative distance from the starting point to the end. Can be from 0.0 to 1.0 where 0.0 is the starting point and 1.0 is the closing point (which should be eqvivalent with the starting point with closed polygons). |
References libnest2d::placers::EdgeCache< RawShape >::contour_, and libnest2d::placers::EdgeCache< RawShape >::coords().
Here is the call graph for this function:
|
inline |
References libnest2d::placers::EdgeCache< RawShape >::coords(), and libnest2d::placers::EdgeCache< RawShape >::holes_.
Here is the call graph for this function:
|
inline |
Get the normalized distance values for each vertex.
References libnest2d::placers::EdgeCache< RawShape >::contour_, libnest2d::placers::EdgeCache< RawShape >::ContourCache::corners, and libnest2d::placers::EdgeCache< RawShape >::fetchCorners().
Here is the call graph for this function:
|
inline |
corners for a specific hole
References libnest2d::placers::EdgeCache< RawShape >::fetchHoleCorners(), and libnest2d::placers::EdgeCache< RawShape >::holes_.
Here is the call graph for this function:
|
inlineprivate |
References libnest2d::shapelike::back(), libnest2d::shapelike::cbegin(), libnest2d::shapelike::cend(), libnest2d::placers::EdgeCache< RawShape >::contour_, libnest2d::shapelike::contourVertexCount(), libnest2d::placers::EdgeCache< RawShape >::ContourCache::distances, libnest2d::placers::EdgeCache< RawShape >::ContourCache::emap, libnest2d::shapelike::front(), libnest2d::placers::EdgeCache< RawShape >::ContourCache::full_distance, libnest2d::shapelike::holes(), libnest2d::placers::EdgeCache< RawShape >::holes_, libnest2d::placers::EdgeCache< RawShape >::length(), and libnest2d::OPEN.
Referenced by libnest2d::placers::EdgeCache< RawShape >::EdgeCache(), and libnest2d::placers::EdgeCache< RawShape >::EdgeCache().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
References libnest2d::placers::EdgeCache< RawShape >::contour_, libnest2d::placers::EdgeCache< RawShape >::ContourCache::corners, libnest2d::placers::EdgeCache< RawShape >::ContourCache::distances, libnest2d::placers::EdgeCache< RawShape >::ContourCache::full_distance, and libnest2d::placers::EdgeCache< RawShape >::stride().
Referenced by libnest2d::placers::EdgeCache< RawShape >::corners().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
References libnest2d::placers::EdgeCache< RawShape >::holes_, and libnest2d::placers::EdgeCache< RawShape >::stride().
Referenced by libnest2d::placers::EdgeCache< RawShape >::corners().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
The number of holes in the abstracted polygon.
References libnest2d::placers::EdgeCache< RawShape >::holes_.
|
inlinestaticprivate |
Referenced by libnest2d::placers::EdgeCache< RawShape >::createCache().
Here is the caller graph for this function:
|
inlineprivate |
References libnest2d::placers::EdgeCache< RawShape >::accuracy_, and round().
Referenced by libnest2d::placers::EdgeCache< RawShape >::fetchCorners(), and libnest2d::placers::EdgeCache< RawShape >::fetchHoleCorners().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
|
private |
Referenced by libnest2d::placers::EdgeCache< RawShape >::circumference(), libnest2d::placers::EdgeCache< RawShape >::coords(), libnest2d::placers::EdgeCache< RawShape >::corners(), libnest2d::placers::EdgeCache< RawShape >::createCache(), and libnest2d::placers::EdgeCache< RawShape >::fetchCorners().
|
private |
Referenced by libnest2d::placers::EdgeCache< RawShape >::circumference(), libnest2d::placers::EdgeCache< RawShape >::coords(), libnest2d::placers::EdgeCache< RawShape >::corners(), libnest2d::placers::EdgeCache< RawShape >::createCache(), libnest2d::placers::EdgeCache< RawShape >::fetchHoleCorners(), and libnest2d::placers::EdgeCache< RawShape >::holeCount().