diff --git a/src/ifcgeom/kernels/opencascade/face.cpp b/src/ifcgeom/kernels/opencascade/face.cpp index 6dadf2b41b..8986dcd6b1 100644 --- a/src/ifcgeom/kernels/opencascade/face.cpp +++ b/src/ifcgeom/kernels/opencascade/face.cpp @@ -306,33 +306,14 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re } bool OpenCascadeKernel::convert_impl(const taxonomy::face::ptr face, IfcGeom::ConversionResults& results) { - throw std::runtime_error("Root-level face not expected"); - /* - - // Root level faces are only encountered in case of half spaces - // @todo this is not true, halfspace will be solid>face - - if (face->basis == nullptr) { - Logger::Error("Half space without underlying surface:", face->instance); + TopoDS_Shape shape; + if (!convert(face, shape)) { return false; } - - if (face->basis->kind() != taxonomy::PLANE) { - Logger::Message(Logger::LOG_ERROR, "Unsupported BaseSurface:", face->basis->instance); - return false; - } - - // @todo boundary - const auto& m = ((taxonomy::geom_ptr)face->basis)->matrix.ccomponents(); - gp_Pln pln(convert_xyz2(m.col(3)), convert_xyz2(m.col(2))); - const gp_Pnt pnt = pln.Location().Translated(face->orientation.get_value_or(false) ? -pln.Axis().Direction() : pln.Axis().Direction()); - TopoDS_Shape shape = BRepPrimAPI_MakeHalfSpace(BRepBuilderAPI_MakeFace(pln), pnt).Solid(); results.emplace_back(ConversionResult( face->instance->data().id(), new OpenCascadeShape(shape), face->surface_style )); - return true; - */ } diff --git a/src/ifcgeom/mapping/IfcCircleProfileDef.cpp b/src/ifcgeom/mapping/IfcCircleProfileDef.cpp index 983aa7f0ea..f762fca18c 100644 --- a/src/ifcgeom/mapping/IfcCircleProfileDef.cpp +++ b/src/ifcgeom/mapping/IfcCircleProfileDef.cpp @@ -46,6 +46,9 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCircleProfileDef* inst) { #endif if (has_position) { c->matrix = taxonomy::cast(map(inst->Position())); + } else { + // matrix needs to be set on elementary curves + c->matrix = taxonomy::make(); } auto e = taxonomy::make();