mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 14:26:30 +00:00
Take into account edge orientation also for polygonal edges #6113
This commit is contained in:
@@ -109,6 +109,8 @@ namespace {
|
|||||||
throw std::runtime_error("Different trim types not supported");
|
throw std::runtime_error("Different trim types not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool reversed = !e->orientation.get_value_or(true);
|
||||||
|
|
||||||
TopoDS_Edge E;
|
TopoDS_Edge E;
|
||||||
auto e_basis = e->basis;
|
auto e_basis = e->basis;
|
||||||
if (e_basis) {
|
if (e_basis) {
|
||||||
@@ -140,7 +142,6 @@ namespace {
|
|||||||
curve = approx.Curve();
|
curve = approx.Curve();
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool reversed = !e->orientation.get_value_or(true);
|
|
||||||
const bool is_conic = e_basis->kind() == taxonomy::ELLIPSE || e_basis->kind() == taxonomy::CIRCLE;
|
const bool is_conic = e_basis->kind() == taxonomy::ELLIPSE || e_basis->kind() == taxonomy::CIRCLE;
|
||||||
|
|
||||||
auto e_start = e->start;
|
auto e_start = e->start;
|
||||||
@@ -180,10 +181,6 @@ namespace {
|
|||||||
if (!e->curve_sense.get_value_or(true)) {
|
if (!e->curve_sense.get_value_or(true)) {
|
||||||
E.Reverse();
|
E.Reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reversed) {
|
|
||||||
E.Reverse();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (e->start.which() != 1) {
|
if (e->start.which() != 1) {
|
||||||
throw std::runtime_error("Non-cartesian trim on edge without curve");
|
throw std::runtime_error("Non-cartesian trim on edge without curve");
|
||||||
@@ -194,6 +191,10 @@ namespace {
|
|||||||
E = BRepBuilderAPI_MakeEdge(p1, p2).Edge();
|
E = BRepBuilderAPI_MakeEdge(p1, p2).Edge();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (reversed) {
|
||||||
|
E.Reverse();
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef IFOPSH_DEBUG
|
#ifdef IFOPSH_DEBUG
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
e->print(oss);
|
e->print(oss);
|
||||||
|
|||||||
Reference in New Issue
Block a user