remove_degenerate_faces() in order to prevent division by zero

This commit is contained in:
Thomas Krijnen
2023-12-05 21:13:43 +01:00
parent 0b4718b3b5
commit 059c9fb7d5
2 changed files with 7 additions and 3 deletions
@@ -18,6 +18,12 @@ using ifcopenshell::geometry::NumberEpeck;
#define NumberType NumberEpeck
#endif
ifcopenshell::geometry::CgalShape::CgalShape(const cgal_shape_t & shape) {
shape_ = shape;
CGAL::Polygon_mesh_processing::triangulate_faces(*shape_);
CGAL::Polygon_mesh_processing::remove_degenerate_faces(*shape_);
}
#ifndef IFOPSH_SIMPLE_KERNEL
void ifcopenshell::geometry::CgalShape::to_poly() const {
if (!shape_) {
@@ -171,9 +171,7 @@ namespace ifcopenshell { namespace geometry {
mutable boost::optional<CGAL::Nef_polyhedron_3<Kernel_>> nef_;
#endif
public:
CgalShape(const cgal_shape_t& shape) {
shape_ = shape;
}
CgalShape(const cgal_shape_t& shape);
#ifndef IFOPSH_SIMPLE_KERNEL
CgalShape(const CGAL::Nef_polyhedron_3<Kernel_>& shape) {