Add back support for IfcSphere

This commit is contained in:
Thomas Krijnen
2024-04-29 20:54:36 +02:00
parent ae2600afb9
commit 6fdf46f151
5 changed files with 60 additions and 25 deletions
+10 -14
View File
@@ -22,18 +22,14 @@
using namespace ifcopenshell::geometry;
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSphere* inst) {
// @todo
return nullptr;
/*
const double r = inst->Radius() * length_unit_;
BRepPrimAPI_MakeSphere builder(r);
gp_Trsf trsf;
IfcGeom::Kernel::convert(inst->Position(),trsf);
// IfcCsgPrimitive3D.Position has unit scale factor
shape = builder.Solid().Moved(trsf);
return true;
*/
auto sol = taxonomy::make<taxonomy::solid>();
auto shl = taxonomy::make<taxonomy::shell>();
auto fac = taxonomy::make<taxonomy::face>();
auto spr = taxonomy::make<taxonomy::sphere>();
spr->matrix = taxonomy::cast<taxonomy::matrix4>(map(inst->Position()));
spr->radius = inst->Radius() * length_unit_;
fac->basis = spr;
shl->children.push_back(fac);
sol->children.push_back(shl);
return sol;
}