Go to the documentation of this file.
38 #ifndef COAL_BV_SPLITTER_H
39 #define COAL_BV_SPLITTER_H
57 template <
typename BV>
75 void computeRule(
const BV& bv,
unsigned int* primitive_indices,
76 unsigned int num_primitives) {
88 std::cerr <<
"Split method not supported" << std::endl;
129 Vec3s center = bv.center();
132 if (bv.width() >= bv.height() && bv.width() >= bv.depth())
134 else if (bv.height() >= bv.width() && bv.height() >= bv.depth())
144 unsigned int num_primitives) {
147 if (bv.width() >= bv.height() && bv.width() >= bv.depth())
149 else if (bv.height() >= bv.width() && bv.height() >= bv.depth())
156 for (
unsigned int i = 0; i < num_primitives; ++i) {
164 for (
unsigned int i = 0; i < num_primitives; ++i) {
175 unsigned int num_primitives) {
178 if (bv.width() >= bv.height() && bv.width() >= bv.depth())
180 else if (bv.height() >= bv.width() && bv.height() >= bv.depth())
184 std::vector<CoalScalar> proj((
size_t)num_primitives);
187 for (
unsigned int i = 0; i < num_primitives; ++i) {
194 for (
unsigned int i = 0; i < num_primitives; ++i)
198 std::sort(proj.begin(), proj.end());
200 if (num_primitives % 2 == 1) {
204 (proj[num_primitives / 2] + proj[num_primitives / 2 - 1]) / 2;
223 const OBB& bv,
unsigned int* primitive_indices,
224 unsigned int num_primitives);
228 const OBB& bv,
unsigned int* primitive_indices,
229 unsigned int num_primitives);
233 const OBB& bv,
unsigned int* primitive_indices,
234 unsigned int num_primitives);
238 const RSS& bv,
unsigned int* primitive_indices,
239 unsigned int num_primitives);
243 const RSS& bv,
unsigned int* primitive_indices,
244 unsigned int num_primitives);
248 const RSS& bv,
unsigned int* primitive_indices,
249 unsigned int num_primitives);
253 const kIOS& bv,
unsigned int* primitive_indices,
254 unsigned int num_primitives);
258 const kIOS& bv,
unsigned int* primitive_indices,
259 unsigned int num_primitives);
263 const kIOS& bv,
unsigned int* primitive_indices,
264 unsigned int num_primitives);
268 const OBBRSS& bv,
unsigned int* primitive_indices,
269 unsigned int num_primitives);
273 const OBBRSS& bv,
unsigned int* primitive_indices,
274 unsigned int num_primitives);
278 const OBBRSS& bv,
unsigned int* primitive_indices,
279 unsigned int num_primitives);
SplitMethodType split_method
The split algorithm used.
Eigen::Matrix< CoalScalar, 3, 1 > Vec3s
BVHModelType
BVH model type.
SplitMethodType
Three types of split algorithms are provided in FCL as default.
virtual ~BVSplitter()
Default deconstructor.
BVSplitter(SplitMethodType method)
void computeRule_bvcenter(const BV &bv, unsigned int *, unsigned int)
Split algorithm 1: Split the node from center.
void clear()
Clear the geometry data set before.
CoalScalar split_value
The split threshold, different primitives are splitted according whether their projection on the spli...
@ BVH_MODEL_POINTCLOUD
triangle model
@ BVH_MODEL_TRIANGLES
unknown model type
Vec3s * vertices
The mesh vertices or points handled by the splitter.
void computeRule_mean(const BV &bv, unsigned int *primitive_indices, unsigned int num_primitives)
Split algorithm 2: Split the node according to the mean of the data contained.
BVHModelType type
Whether the geometry is mesh or point cloud.
bool apply(const Vec3s &q) const
Apply the split rule on a given point.
Triangle * tri_indices
The triangles handled by the splitter.
void computeRule(const BV &bv, unsigned int *primitive_indices, unsigned int num_primitives)
Compute the split rule according to a subset of geometry and the corresponding BV node.
Triangle with 3 indices for points.
void set(Vec3s *vertices_, Triangle *tri_indices_, BVHModelType type_)
Set the geometry data needed by the split rule.
int split_axis
The axis based on which the split decision is made. For most BV, the axis is aligned with one of the ...
void computeRule_median(const BV &bv, unsigned int *primitive_indices, unsigned int num_primitives)
Split algorithm 3: Split the node according to the median of the data contained.
hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:57