mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027552: Wire creation fails depending on the order of edges
1) BRepBuilderAPI_MakeWire::Add (const TopTools_ListOfShape &L) method have been completely rewritten. The order of edges is not significant now. 2) The geometric proximity of free vertices from already existing wire and from input list of edges are also have been taken into account. If such vertices are coincident with each other then they are fused into the one. The original wire remains untouched topologically (yet the tolerances and points can be modified). 3) UBTreeFiller is used to speed up the process of picking of coincident vertices. 4) BRepLib now contains the 'new' method - BoundingVertex(..). The implemenation of this method are taken from BOPTools_AlgoTools::MakeVertex(..). 5) The '-unsorted' argument have been added to 'wire' command. Conflicts: src/QABugs/QABugs_20.cxx Add missing include. Eliminate warning.
This commit is contained in:
@@ -224,22 +224,56 @@ static Standard_Integer wire(Draw_Interpretor& di, Standard_Integer n, const cha
|
||||
if (n < 3) return 1;
|
||||
Standard_Integer i;
|
||||
BRepBuilderAPI_MakeWire MW;
|
||||
for (i = 2; i < n; i ++) {
|
||||
TopoDS_Shape S = DBRep::Get(a[i]);
|
||||
if (S.IsNull()) continue;
|
||||
if (S.ShapeType() == TopAbs_EDGE)
|
||||
MW.Add(TopoDS::Edge(S));
|
||||
else if (S.ShapeType() == TopAbs_WIRE)
|
||||
MW.Add(TopoDS::Wire(S));
|
||||
else
|
||||
continue;
|
||||
Standard_Boolean IsUnsorted = !strcmp(a[2], "-unsorted");
|
||||
|
||||
if (!IsUnsorted)
|
||||
for (i = 2; i < n; i ++) {
|
||||
TopoDS_Shape S = DBRep::Get(a[i]);
|
||||
if (S.IsNull()) continue;
|
||||
if (S.ShapeType() == TopAbs_EDGE)
|
||||
MW.Add(TopoDS::Edge(S));
|
||||
else if (S.ShapeType() == TopAbs_WIRE)
|
||||
MW.Add(TopoDS::Wire(S));
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
TopTools_ListOfShape aLE;
|
||||
for (i = 3; i < n; i ++)
|
||||
{
|
||||
TopoDS_Shape S = DBRep::Get(a[i]);
|
||||
TopExp_Explorer Exp(S, TopAbs_EDGE);
|
||||
for (;Exp.More();Exp.Next())
|
||||
{
|
||||
const TopoDS_Edge& anE = TopoDS::Edge(Exp.Current());
|
||||
if (!anE.IsNull())
|
||||
aLE.Append(anE);
|
||||
}
|
||||
}
|
||||
MW.Add(aLE);
|
||||
}
|
||||
|
||||
if (!MW.IsDone()) {
|
||||
//cout << "Wire not done" << endl;
|
||||
di << "Wire not done\n";
|
||||
return 0;
|
||||
di << "Wire not done with an error:\n";
|
||||
switch (MW.Error())
|
||||
{
|
||||
case BRepBuilderAPI_EmptyWire:
|
||||
di << "BRepBuilderAPI_EmptyWire\n";
|
||||
break;
|
||||
case BRepBuilderAPI_DisconnectedWire:
|
||||
di << "BRepBuilderAPI_DisconnectedWire\n";
|
||||
break;
|
||||
case BRepBuilderAPI_NonManifoldWire:
|
||||
di << "BRepBuilderAPI_NonManifoldWire\n";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DBRep::Set(a[1],MW);
|
||||
else
|
||||
DBRep::Set(a[1],MW);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1864,7 +1898,7 @@ void BRepTest::CurveCommands(Draw_Interpretor& theCommands)
|
||||
polyvertex,g);
|
||||
|
||||
theCommands.Add("wire",
|
||||
"wire wirename e1/w1 [e2/w2 ...]",__FILE__,
|
||||
"wire wirename [-unsorted] e1/w1 [e2/w2 ...]",__FILE__,
|
||||
wire,g);
|
||||
|
||||
theCommands.Add("profile",
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
#include <ChFi2d_FilletAPI.hxx>
|
||||
#include <ChFi2d_ChamferAPI.hxx>
|
||||
|
Reference in New Issue
Block a user