ifcgeom: map IfcSphericalSurface so advanced-brep spheres render (#586)

The IfcSphericalSurface mapping was a dead stub returning nullptr (the
0.5-era implementation was left commented out against a removed kernel
API), so any IfcAdvancedBrep whose face lies on a spherical surface
failed to convert - the Sphere case from the Allplan free-form models
attached to #586. Map it to taxonomy::sphere, mirroring the existing
IfcCylindricalSurface and IfcToroidalSurface mappings.

This activates the existing single-face spherical-solid shortcut in the
OpenCascade kernel (BRepPrimAPI_MakeSphere), which is only reachable
from IfcManifoldSolidBrep closed shells and CSG primitives, so it can
only fire on the genuine full-sphere degenerate-seam pattern.

This change was written with AI assistance.
This commit is contained in:
Petru Conduraru
2026-07-21 19:55:25 +03:00
parent e52e5e2e58
commit 56b1406fff
+4 -10
View File
@@ -24,16 +24,10 @@ using namespace ifcopenshell::geometry;
#ifdef SCHEMA_HAS_IfcSphericalSurface
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSphericalSurface* inst) {
return nullptr;
/*
gp_Trsf trsf;
IfcGeom::Kernel::convert(inst->Position(), trsf);
// IfcElementarySurface.Position has unit scale factor
face = BRepBuilderAPI_MakeFace(new Geom_SphericalSurface(gp::XOY(), inst->Radius() * length_unit_), getValue(GV_PRECISION)).Face().Moved(trsf);
return true;
*/
auto s = taxonomy::make<taxonomy::sphere>();
s->radius = inst->Radius() * length_unit_;
s->matrix = taxonomy::cast<taxonomy::matrix4>(map(inst->Position()));
return s;
}
#endif