Improvements to faceset_helper in case of nearby verts

This commit is contained in:
Thomas Krijnen
2018-11-30 11:08:19 +01:00
parent b48d17c690
commit 4f8b430040
3 changed files with 39 additions and 10 deletions
+7 -5
View File
@@ -166,22 +166,24 @@ private:
bool wire(const IfcSchema::IfcPolyLoop* loop, TopoDS_Wire& wire) {
BRep_Builder builder;
builder.MakeWire(wire);
bool valid;
int count = 0;
auto ps = loop->Polygon();
loop_(ps, [this, &builder, &wire, &valid](int A, int B, bool fwd) {
loop_(ps, [this, &builder, &wire, &count](int A, int B, bool fwd) {
TopoDS_Edge e;
if (edge(A, B, e)) {
if (!fwd) {
e.Reverse();
}
builder.Add(wire, e);
valid = true;
count += 1;
}
});
if (valid) {
if (count >= 3) {
wire.Closed(true);
return true;
} else {
return false;
}
return valid;
}
};