diff --git a/src/ifcgeom/kernels/opencascade/face.cpp b/src/ifcgeom/kernels/opencascade/face.cpp index e04baa9000..b2313487c1 100644 --- a/src/ifcgeom/kernels/opencascade/face.cpp +++ b/src/ifcgeom/kernels/opencascade/face.cpp @@ -270,7 +270,8 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re face_definition fd; - if (face->basis) { + // when the surface is planar we do not care about it + if (face->basis && face->basis->kind() != taxonomy::PLANE) { fd.surface() = convert_surface(face->basis); } diff --git a/src/ifcgeom/kernels/opencascade/faceset_helper.cpp b/src/ifcgeom/kernels/opencascade/faceset_helper.cpp index f6ebd9c7ec..2fd74cdf2d 100644 --- a/src/ifcgeom/kernels/opencascade/faceset_helper.cpp +++ b/src/ifcgeom/kernels/opencascade/faceset_helper.cpp @@ -41,11 +41,13 @@ IfcGeom::OpenCascadeKernel::faceset_helper::faceset_helper( for (auto& l : f->children) { loops.push_back(l); for (auto& e : l->children) { - // @todo make sure only cartesian points are provided here - auto& p = boost::get(e->orientation.get_value_or(true) ? e->start : e->end); - if (point_identities_visited.find(p->identity()) == point_identities_visited.end()) { - point_identities_visited.insert(p->identity()); - points.push_back(p); + for (size_t i = 0; i < 2; ++i) { + // @todo make sure only cartesian points are provided here + auto& p = boost::get(i == 0 ? e->start : e->end); + if (point_identities_visited.find(p->identity()) == point_identities_visited.end()) { + point_identities_visited.insert(p->identity()); + points.push_back(p); + } } } } @@ -206,21 +208,19 @@ void IfcGeom::OpenCascadeKernel::faceset_helper::loop_(const ifcopenshell::geome return; } - auto a = boost::get(ps->children.back()->orientation.get_value_or(true) ? ps->children.back()->start : ps->children.back()->end); - auto A = a->identity(); - for (auto& b : ps->children) { - auto B = boost::get(b->orientation.get_value_or(true) ? b->start : b->end)->identity(); + for (auto& edge : ps->children) { + auto A = boost::get(edge->start)->identity(); + auto B = boost::get(edge->end)->identity(); auto C = vertex_mapping_[A], D = vertex_mapping_[B]; bool fwd = C < D; - if (!b->orientation) { - fwd = !fwd; - } if (!fwd) { std::swap(C, D); } + if (!edge->orientation.get_value_or(true)) { + fwd = !fwd; + } if (C != D) { callback(C, D, fwd); - A = B; } } }