mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
Fix faceset helper on advanced brep oriented edges #6604
This commit is contained in:
@@ -270,7 +270,8 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
|||||||
|
|
||||||
face_definition fd;
|
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);
|
fd.surface() = convert_surface(face->basis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,11 +41,13 @@ IfcGeom::OpenCascadeKernel::faceset_helper::faceset_helper(
|
|||||||
for (auto& l : f->children) {
|
for (auto& l : f->children) {
|
||||||
loops.push_back(l);
|
loops.push_back(l);
|
||||||
for (auto& e : l->children) {
|
for (auto& e : l->children) {
|
||||||
// @todo make sure only cartesian points are provided here
|
for (size_t i = 0; i < 2; ++i) {
|
||||||
auto& p = boost::get<ifcopenshell::geometry::taxonomy::point3::ptr>(e->orientation.get_value_or(true) ? e->start : e->end);
|
// @todo make sure only cartesian points are provided here
|
||||||
if (point_identities_visited.find(p->identity()) == point_identities_visited.end()) {
|
auto& p = boost::get<ifcopenshell::geometry::taxonomy::point3::ptr>(i == 0 ? e->start : e->end);
|
||||||
point_identities_visited.insert(p->identity());
|
if (point_identities_visited.find(p->identity()) == point_identities_visited.end()) {
|
||||||
points.push_back(p);
|
point_identities_visited.insert(p->identity());
|
||||||
|
points.push_back(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,21 +208,19 @@ void IfcGeom::OpenCascadeKernel::faceset_helper::loop_(const ifcopenshell::geome
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto a = boost::get<ifcopenshell::geometry::taxonomy::point3::ptr>(ps->children.back()->orientation.get_value_or(true) ? ps->children.back()->start : ps->children.back()->end);
|
for (auto& edge : ps->children) {
|
||||||
auto A = a->identity();
|
auto A = boost::get<ifcopenshell::geometry::taxonomy::point3::ptr>(edge->start)->identity();
|
||||||
for (auto& b : ps->children) {
|
auto B = boost::get<ifcopenshell::geometry::taxonomy::point3::ptr>(edge->end)->identity();
|
||||||
auto B = boost::get<ifcopenshell::geometry::taxonomy::point3::ptr>(b->orientation.get_value_or(true) ? b->start : b->end)->identity();
|
|
||||||
auto C = vertex_mapping_[A], D = vertex_mapping_[B];
|
auto C = vertex_mapping_[A], D = vertex_mapping_[B];
|
||||||
bool fwd = C < D;
|
bool fwd = C < D;
|
||||||
if (!b->orientation) {
|
|
||||||
fwd = !fwd;
|
|
||||||
}
|
|
||||||
if (!fwd) {
|
if (!fwd) {
|
||||||
std::swap(C, D);
|
std::swap(C, D);
|
||||||
}
|
}
|
||||||
|
if (!edge->orientation.get_value_or(true)) {
|
||||||
|
fwd = !fwd;
|
||||||
|
}
|
||||||
if (C != D) {
|
if (C != D) {
|
||||||
callback(C, D, fwd);
|
callback(C, D, fwd);
|
||||||
A = B;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user