Add revolve as top-level item in occt kernel

This commit is contained in:
Thomas Krijnen
2024-08-01 07:48:42 +02:00
parent 2fd339ac6b
commit 7d6e26bfd5
2 changed files with 26 additions and 0 deletions
@@ -391,6 +391,31 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const IfcUtil::IfcBaseEntity*
return true;
}
#include <BRepPrimAPI_MakeRevol.hxx>
bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, IfcGeom::ConversionResults& results) {
gp_Ax1 ax(
convert_xyz<gp_Pnt>(*r->axis_origin),
convert_xyz<gp_Dir>(*r->direction));
TopoDS_Shape face;
if (!convert(taxonomy::cast<taxonomy::face>(r->basis), face)) {
return false;
}
TopoDS_Shape shape = BRepPrimAPI_MakeRevol(face, ax);
results.emplace_back(ConversionResult(
r->instance->data().id(),
r->matrix,
new OpenCascadeShape(shape),
r->surface_style
));
return true;
}
// IfcSchema::IfcRelVoidsElement::list::ptr IfcGeom::Kernel::find_openings(IfcSchema::IfcProduct* product) {
// std::vector<IfcSchema::IfcRelVoidsElement*> rs;
//
@@ -143,6 +143,7 @@ public:
virtual bool convert_impl(const ifcopenshell::geometry::taxonomy::solid::ptr, IfcGeom::ConversionResults&);
virtual bool convert_impl(const ifcopenshell::geometry::taxonomy::shell::ptr, IfcGeom::ConversionResults&);
virtual bool convert_impl(const ifcopenshell::geometry::taxonomy::extrusion::ptr, IfcGeom::ConversionResults&);
virtual bool convert_impl(const ifcopenshell::geometry::taxonomy::revolve::ptr, IfcGeom::ConversionResults&);
virtual bool convert_impl(const ifcopenshell::geometry::taxonomy::boolean_result::ptr, IfcGeom::ConversionResults&);
virtual bool convert_impl(const ifcopenshell::geometry::taxonomy::loft::ptr, IfcGeom::ConversionResults&);
virtual bool convert_impl(const ifcopenshell::geometry::taxonomy::sweep_along_curve::ptr, IfcGeom::ConversionResults&);