Class for processing TriangleMesh objects.
More...
#include <TriangleMesh.hpp>
|
| TriangleMeshSlicer (TriangleMesh *_mesh) |
|
| ~TriangleMeshSlicer () |
|
void | slice (const std::vector< float > &z, std::vector< Polygons > *layers) const |
|
void | slice (const std::vector< float > &z, std::vector< ExPolygons > *layers) const |
|
void | slice (float z, ExPolygons *slices) const |
|
void | slice_facet (float slice_z, const stl_facet &facet, const int &facet_idx, const float &min_z, const float &max_z, std::vector< IntersectionLine > *lines, boost::mutex *lines_mutex=NULL) const |
|
void | cut (float z, TriangleMesh *upper, TriangleMesh *lower) const |
| Splits the current mesh into two parts. More...
|
|
template<Axis A>
class Slic3r::TriangleMeshSlicer< A >
Class for processing TriangleMesh objects.
◆ TriangleMeshSlicer()
◆ ~TriangleMeshSlicer()
◆ cut()
Splits the current mesh into two parts.
- Parameters
-
[in] | z | Coordinate plane to cut along. |
[out] | upper | TriangleMesh object to add the mesh > z. NULL suppresses saving this. |
[out] | lower | TriangleMesh object to save the mesh < z. NULL suppresses saving this. |
◆ slice() [1/3]
This method gets called with a list of unscaled Z coordinates and outputs a vector pointer having the same number of items as the original list. Each item is a vector of polygons created by slicing our mesh at the given heights.
This method should basically combine the behavior of the existing Perl methods defined in lib/Slic3r/TriangleMesh.pm:
- analyze(): this creates the 'facets_edges' and the 'edges_facets' tables (we don't need the 'edges' table)
- slice_facet(): this has to be done for each facet. It generates intersection lines with each plane identified by the Z list. The get_layer_range() binary search used to identify the Z range of the facet is already ported to C++ (see Object.xsp)
make_loops(): this has to be done for each layer. It creates polygons from the lines generated by the previous step.
At the end, we free the tables generated by analyze() as we don't need them anymore.
NOTE: this method accepts a vector of floats because the mesh coordinate type is float.
◆ slice() [2/3]
◆ slice() [3/3]
◆ slice_facet()
template<Axis A>
void Slic3r::TriangleMeshSlicer< A >::slice_facet |
( |
float |
slice_z, |
|
|
const stl_facet & |
facet, |
|
|
const int & |
facet_idx, |
|
|
const float & |
min_z, |
|
|
const float & |
max_z, |
|
|
std::vector< IntersectionLine > * |
lines, |
|
|
boost::mutex * |
lines_mutex = NULL |
|
) |
| const |
◆ mesh
The documentation for this class was generated from the following files: