Follow-up of 5a84b46ec9
- Faster implementation of method TriangleMesh::transformed_bounding_box(const Transform3d& trafo, double world_min_z)
This commit is contained in:
parent
5a84b46ec9
commit
2f95c7721f
1 changed files with 5 additions and 7 deletions
|
@ -588,14 +588,12 @@ BoundingBoxf3 TriangleMesh::transformed_bounding_box(const Transform3d& trafo, d
|
|||
}
|
||||
|
||||
// add new vertices along the cut
|
||||
MeshSlicingParams slicing_params;
|
||||
slicing_params.trafo = trafo;
|
||||
Polygons polygons = union_(slice_mesh(its, world_min_z, slicing_params));
|
||||
for (const Polygon& polygon : polygons) {
|
||||
for (const Point& p : polygon.points) {
|
||||
bbox.merge(unscale(p.x(), p.y(), world_min_z));
|
||||
}
|
||||
Points all_pts;
|
||||
its_collect_mesh_projection_points_above(its, trafo.cast<float>(), static_cast<float>(world_min_z), all_pts);
|
||||
for (const Point& p : all_pts) {
|
||||
bbox.merge(unscale(p.x(), p.y(), world_min_z));
|
||||
}
|
||||
|
||||
return bbox;
|
||||
}
|
||||
#endif // ENABLE_FIX_SINKING_OBJECT_OUT_OF_BED_DETECTION
|
||||
|
|
Loading…
Reference in a new issue