OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::sla::SupportPointGenerator::PointGrid3D Struct Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/SLA/SupportPointGenerator.hpp>

Collaboration diagram for Slic3r::sla::SupportPointGenerator::PointGrid3D:

Classes

struct  GridHash

Public Types

typedef std::unordered_multimap< Vec3i32, RichSupportPoint, GridHash > Grid

Public Member Functions

Vec3i32 cell_id (const Vec3f &pos)
void insert (const Vec2f &pos, Structure *island)
bool collides_with (const Vec2f &pos, float print_z, float radius)

Public Attributes

Vec3f cell_size
Grid grid

Private Member Functions

bool collides_with (const Vec3f &pos, float radius, Grid::const_iterator it_begin, Grid::const_iterator it_end)

Detailed Description

Member Typedef Documentation

◆ Grid

Member Function Documentation

◆ cell_id()

Vec3i32 Slic3r::sla::SupportPointGenerator::PointGrid3D::cell_id ( const Vec3f & pos)
inline
162 {
163 return Vec3i32(int(floor(pos.x() / cell_size.x())),
164 int(floor(pos.y() / cell_size.y())),
165 int(floor(pos.z() / cell_size.z())));
166 }
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16
Eigen::Matrix< int32_t, 3, 1, Eigen::DontAlign > Vec3i32
Definition Point.hpp:59
Vec3f cell_size
Definition SupportPointGenerator.hpp:159

References cell_size, and Slic3r::sla::pos().

Referenced by collides_with(), insert(), and Slic3r::sla::SupportPointGenerator::PointGrid3D::GridHash::operator()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ collides_with() [1/2]

bool Slic3r::sla::SupportPointGenerator::PointGrid3D::collides_with ( const Vec2f & pos,
float print_z,
float radius )
inline
175 {
176 Vec3f pos3d(pos.x(), pos.y(), print_z);
177 Vec3i32 cell = cell_id(pos3d);
178 std::pair<Grid::const_iterator, Grid::const_iterator> it_pair = grid.equal_range(cell);
179 if (collides_with(pos3d, radius, it_pair.first, it_pair.second))
180 return true;
181 for (int i = -1; i < 2; ++ i)
182 for (int j = -1; j < 2; ++ j)
183 for (int k = -1; k < 1; ++ k) {
184 if (i == 0 && j == 0 && k == 0)
185 continue;
186 it_pair = grid.equal_range(cell + Vec3i32(i, j, k));
187 if (collides_with(pos3d, radius, it_pair.first, it_pair.second))
188 return true;
189 }
190 return false;
191 }
Eigen::Matrix< float, 3, 1, Eigen::DontAlign > Vec3f
Definition Point.hpp:65
Vec3i32 cell_id(const Vec3f &pos)
Definition SupportPointGenerator.hpp:162
Grid grid
Definition SupportPointGenerator.hpp:160
bool collides_with(const Vec2f &pos, float print_z, float radius)
Definition SupportPointGenerator.hpp:175

References cell_id(), collides_with(), grid, and Slic3r::sla::pos().

Referenced by collides_with(), and Slic3r::sla::SupportPointGenerator::uniformly_cover().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ collides_with() [2/2]

bool Slic3r::sla::SupportPointGenerator::PointGrid3D::collides_with ( const Vec3f & pos,
float radius,
Grid::const_iterator it_begin,
Grid::const_iterator it_end )
inlineprivate
194 {
195 for (Grid::const_iterator it = it_begin; it != it_end; ++ it) {
196 float dist2 = (it->second.position - pos).squaredNorm();
197 if (dist2 < radius * radius)
198 return true;
199 }
200 return false;
201 }

References Slic3r::sla::pos().

Here is the call graph for this function:

◆ insert()

void Slic3r::sla::SupportPointGenerator::PointGrid3D::insert ( const Vec2f & pos,
Structure * island )
inline
168 {
169 RichSupportPoint pt;
170 pt.position = Vec3f(pos.x(), pos.y(), float(island->layer->print_z));
171 pt.island = island;
172 grid.emplace(cell_id(pt.position), pt);
173 }

References cell_id(), grid, Slic3r::sla::SupportPointGenerator::RichSupportPoint::island, Slic3r::sla::SupportPointGenerator::Structure::layer, Slic3r::sla::pos(), Slic3r::sla::SupportPointGenerator::RichSupportPoint::position, and Slic3r::sla::SupportPointGenerator::MyLayer::print_z.

Referenced by Slic3r::sla::SupportPointGenerator::uniformly_cover().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ cell_size

Vec3f Slic3r::sla::SupportPointGenerator::PointGrid3D::cell_size

◆ grid

Grid Slic3r::sla::SupportPointGenerator::PointGrid3D::grid

Referenced by collides_with(), and insert().


The documentation for this struct was generated from the following file: