Topo Naming accumulated fixes (#7792)
* Part: fix Part.sortEdges() (Fixes realthunder/fcad_pcb#61) * App: fix indexed element name parsing * Part: avoid unnecessary wire making in TopoShape::makELoft/makEPipeShell()
This commit is contained in:
@@ -107,7 +107,7 @@ void IndexedName::set(const char *name,
|
||||
for (const char *n=name, *t=type; *n; ++n) {
|
||||
if (*n != *t || j >= i)
|
||||
break;
|
||||
++i;
|
||||
++j;
|
||||
++t;
|
||||
if (!*t) {
|
||||
this->type = type;
|
||||
@@ -118,8 +118,8 @@ void IndexedName::set(const char *name,
|
||||
|
||||
if (allowOthers) {
|
||||
auto res = NameSet.insert(QByteArray::fromRawData(name, i));
|
||||
if (res.second)
|
||||
res.first->mutate();
|
||||
if (res.second)
|
||||
res.first->mutate();
|
||||
this->type = res.first->bytes.constData();
|
||||
} else
|
||||
this->type = "";
|
||||
|
||||
@@ -1534,8 +1534,7 @@ static std::vector<TopoShape> prepareProfiles(const std::vector<TopoShape> &shap
|
||||
if (shape.ShapeType() == TopAbs_FACE) {
|
||||
shape = sh.splitWires().getShape();
|
||||
} else if (shape.ShapeType() == TopAbs_WIRE) {
|
||||
BRepBuilderAPI_MakeWire mkWire(TopoDS::Wire(shape));
|
||||
shape = mkWire.Wire();
|
||||
// do nothing
|
||||
} else if (shape.ShapeType() == TopAbs_EDGE) {
|
||||
BRepBuilderAPI_MakeWire mkWire(TopoDS::Edge(shape));
|
||||
shape = mkWire.Wire();
|
||||
@@ -2921,7 +2920,7 @@ TopoShape::sortEdges(std::list<TopoShape>& edges, bool keepOrder, double tol)
|
||||
}
|
||||
else if (pEI->v1.SquareDistance(first) <= tol3d) {
|
||||
first = pEI->v2;
|
||||
sorted.push_back(reverseEdge(pEI->edge));
|
||||
sorted.push_front(reverseEdge(pEI->edge));
|
||||
edges.erase(pEI->it);
|
||||
edge_points.erase(pEI);
|
||||
pEI = edge_points.begin();
|
||||
|
||||
Reference in New Issue
Block a user