bool SortEdgesForConstructWire(const NCollection_Vector& oldedges, NCollection_Vector& newedges, double tol, bool *pClosed, double* pMaxGap) { int i, n, minID, id, id2; NCollection_Vector bTaken, matchedIDs, sortedIDs; NCollection_Vector pnts; TopExp_Explorer ex; std::vector edges; gp_Pnt pnt, endPnts[2]; bool bSucc; double minDis, otherDis, minminDis; Standard_Boolean bDeg; TopoDS_Vertex v1, v2; TopoDS_Edge degEdge; newedges.Clear(); if(pMaxGap) *pMaxGap = 0.0; n = oldedges.Length(); if(n==0) return false; for(i=0; i