diff --git a/src/ifcgeom/kernels/cgal/CgalConversionResult.cpp b/src/ifcgeom/kernels/cgal/CgalConversionResult.cpp index f29b935501..207a55e186 100644 --- a/src/ifcgeom/kernels/cgal/CgalConversionResult.cpp +++ b/src/ifcgeom/kernels/cgal/CgalConversionResult.cpp @@ -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_) { diff --git a/src/ifcgeom/kernels/cgal/CgalConversionResult.h b/src/ifcgeom/kernels/cgal/CgalConversionResult.h index b0e3da28c0..0811b1968d 100644 --- a/src/ifcgeom/kernels/cgal/CgalConversionResult.h +++ b/src/ifcgeom/kernels/cgal/CgalConversionResult.h @@ -171,9 +171,7 @@ namespace ifcopenshell { namespace geometry { mutable boost::optional> 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& shape) {