mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user