Skip to content

Commit b6abb24

Browse files
committed
Support single circ/elip compcurves #7149
1 parent 2b24d5e commit b6abb24

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/ifcgeom/mapping/IfcCompositeCurve.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,20 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve* inst) {
5858
if (crv->kind() == taxonomy::EDGE) {
5959
auto ecrv = taxonomy::cast<taxonomy::edge>(crv);
6060
loop->children.push_back(ecrv);
61-
}
62-
else if (crv->kind() == taxonomy::LOOP) {
61+
} else if (crv->kind() == taxonomy::LOOP) {
6362
for (auto& s : taxonomy::cast<taxonomy::loop>(crv)->children) {
6463
loop->children.push_back(s);
6564
}
65+
} else if ((crv->kind() == taxonomy::CIRCLE || crv->kind() == taxonomy::ELLIPSE) && segments->size() == 1) {
66+
// A circle or ellipse segment is a full circle/ellipse, only possible when it is the only segment
67+
std::shared_ptr<taxonomy::edge> e = std::make_shared<taxonomy::edge>();
68+
e->basis = crv;
69+
e->start = 0.0;
70+
e->end = 2.0 * boost::math::constants::pi<double>();
71+
loop->children.push_back(e);
72+
} else {
73+
Logger::Warning("Unexpected segment type", segment);
74+
return nullptr;
6675
}
6776
}
6877
}

0 commit comments

Comments
 (0)