#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Feature/Interlocking/VoxelUtils.hpp>
Public Types | |
| using | grid_coord_t = coord_t |
Public Member Functions | |
| VoxelUtils (Vec3crd cell_size) | |
| bool | walkLine (Vec3crd start, Vec3crd end, const std::function< bool(GridPoint3)> &process_cell_func) const |
| bool | walkPolygons (const ExPolygon &polys, coord_t z, const std::function< bool(GridPoint3)> &process_cell_func) const |
| bool | walkDilatedPolygons (const ExPolygon &polys, coord_t z, const DilationKernel &kernel, const std::function< bool(GridPoint3)> &process_cell_func) const |
| bool | walkDilatedPolygons (const ExPolygons &polys, coord_t z, const DilationKernel &kernel, const std::function< bool(GridPoint3)> &process_cell_func) const |
| bool | walkAreas (const ExPolygon &polys, coord_t z, const std::function< bool(GridPoint3)> &process_cell_func) const |
| bool | walkDilatedAreas (const ExPolygon &polys, coord_t z, const DilationKernel &kernel, const std::function< bool(GridPoint3)> &process_cell_func) const |
| bool | walkDilatedAreas (const ExPolygons &polys, coord_t z, const DilationKernel &kernel, const std::function< bool(GridPoint3)> &process_cell_func) const |
| std::function< bool(GridPoint3)> | dilate (const DilationKernel &kernel, const std::function< bool(GridPoint3)> &process_cell_func) const |
| GridPoint3 | toGridPoint (const Vec3crd &point) const |
| grid_coord_t | toGridCoord (const coord_t &coord, const size_t dim) const |
| Vec3crd | toLowerCorner (const GridPoint3 &location) const |
| coord_t | toLowerCoord (const grid_coord_t &grid_coord, const size_t dim) const |
| Polygon | toPolygon (const GridPoint3 p) const |
Public Attributes | |
| Vec3crd | cell_size_ |
Private Member Functions | |
| bool | _walkAreas (const ExPolygon &polys, coord_t z, const std::function< bool(GridPoint3)> &process_cell_func) const |
Utility class for walking over a 3D voxel grid.
Contains the math for intersecting voxels with lines, polgons, areas, etc.
|
inline |
References cell_size_.
|
private |
polys is assumed to be translated by half the cell_size in xy already References _walkAreas(), cell_size_, Slic3r::spreadDotsArea(), and toGridPoint().
Referenced by _walkAreas(), walkAreas(), and walkDilatedAreas().
| std::function< bool(GridPoint3)> Slic3r::VoxelUtils::dilate | ( | const DilationKernel & | kernel, |
| const std::function< bool(GridPoint3)> & | process_cell_func ) const |
Dilate with a kernel.
Extends the process_cell_func, so that for each cell we process nearby cells as well.
Apply this function to a process_cell_func to create a new process_cell_func which applies the effect to nearby voxels as well.
| kernel | The offset positions relative to the input of process_cell_func |
| process_cell_func | Function to perform on each voxel cell |
References dilate(), and Slic3r::DilationKernel::relative_cells_.
Referenced by dilate(), walkDilatedAreas(), and walkDilatedPolygons().
|
inline |
|
inline |
References toGridCoord().
Referenced by _walkAreas(), and walkLine().
|
inline |
References cell_size_.
Referenced by toLowerCorner(), and walkLine().
|
inline |
References toLowerCoord().
Referenced by toPolygon().
|
inline |
Returns a rectangular polygon equal to the cross section of a voxel cell at coordinate p
References Slic3r::MultiPoint::append(), cell_size_, and toLowerCorner().
| bool Slic3r::VoxelUtils::walkAreas | ( | const ExPolygon & | polys, |
| coord_t | z, | ||
| const std::function< bool(GridPoint3)> & | process_cell_func ) const |
Process all voxels inside the area of a polygons object.
| polys | The area to fill |
| z | The height at which the polygons occur |
| process_cell_func | Function to perform on each voxel cell |
cell_processing_function References _walkAreas(), cell_size_, Slic3r::ExPolygon::translate(), and walkAreas().
Referenced by walkAreas().
| bool Slic3r::VoxelUtils::walkDilatedAreas | ( | const ExPolygon & | polys, |
| coord_t | z, | ||
| const DilationKernel & | kernel, | ||
| const std::function< bool(GridPoint3)> & | process_cell_func ) const |
Process all voxels inside the area of a polygons object. For each voxel inside the polygon we process each of the offset voxels according to the kernel.
| polys | The area to fill |
| z | The height at which the polygons occur |
| process_cell_func | Function to perform on each voxel cell |
cell_processing_function References _walkAreas(), cell_size_, dilate(), Slic3r::DilationKernel::kernel_size_, Slic3r::ExPolygon::translate(), and walkDilatedAreas().
Referenced by walkDilatedAreas(), and walkDilatedAreas().
|
inline |
References walkDilatedAreas().
| bool Slic3r::VoxelUtils::walkDilatedPolygons | ( | const ExPolygon & | polys, |
| coord_t | z, | ||
| const DilationKernel & | kernel, | ||
| const std::function< bool(GridPoint3)> & | process_cell_func ) const |
Process voxels near the line segments of a polygon. For each voxel the polygon crosses we process each of the offset voxels according to the kernel.
| polys | The polygons to walk |
| z | The height at which the polygons occur |
| process_cell_func | Function to perform on each voxel cell |
cell_processing_function References cell_size_, dilate(), Slic3r::DilationKernel::kernel_size_, Slic3r::ExPolygon::translate(), walkDilatedPolygons(), and walkPolygons().
Referenced by walkDilatedPolygons(), and walkDilatedPolygons().
|
inline |
References walkDilatedPolygons().
| bool Slic3r::VoxelUtils::walkLine | ( | Vec3crd | start, |
| Vec3crd | end, | ||
| const std::function< bool(GridPoint3)> & | process_cell_func ) const |
Process voxels which a line segment crosses.
| start | Start point of the line |
| end | End point of the line |
| process_cell_func | Function to perform on each cell the line crosses |
cell_processing_function References cell_size_, Slic3r::diff(), toGridPoint(), toLowerCoord(), and walkLine().
Referenced by walkLine(), and walkPolygons().
| bool Slic3r::VoxelUtils::walkPolygons | ( | const ExPolygon & | polys, |
| coord_t | z, | ||
| const std::function< bool(GridPoint3)> & | process_cell_func ) const |
Process voxels which the line segments of a polygon crosses.
| polys | The polygons to walk |
| z | The height at which the polygons occur |
| process_cell_func | Function to perform on each voxel cell |
cell_processing_function References Slic3r::to_polygons(), walkLine(), and walkPolygons().
Referenced by walkDilatedPolygons(), and walkPolygons().
| Vec3crd Slic3r::VoxelUtils::cell_size_ |
Referenced by VoxelUtils(), _walkAreas(), toGridCoord(), toLowerCoord(), toPolygon(), walkAreas(), walkDilatedAreas(), walkDilatedPolygons(), and walkLine().