how to know number of 'free' edges

I have two surface/faces( 4 egdes each) which are sewed.
After sewing one edge is common to the new single surface topology.
Now the number of 'free' edges is 7.

If I have a topology shape, can I know number of 'free' edges ??
thanks

- PG

Rob Bachrach's picture

If your shape is a shell, consider using ShapeAnalysis_Shell. It has a function to return the free edges.

Otherwise, you can explore the edges in your geoemtry, recording the edges in a map as you go. On each edge, remove it from the map if it is already there. Anything left at the end is free.

Rob

Fotis Sioutis's picture

You can try also the following :

ShapeAnalysis_FreeBounds Analyzer( yourShape );

TopoDS_Compound Closed = Analyzer.GetClosedWires();
TopoDS_Compound Open = Analyzer.GetOpenWires();

you can then explore the resulting compounds to get your free wires or edges.

Fotis

Evgeny Lodyzhehsky's picture

try to use this
...
Standard_Integer i, aNbE, aNbF, iCnt;
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
//
TopExp::MapShapesAndAncestors(aS, TopAbs_EDGE, TopAbs_FACE, aMEF);
//
iCnt=0;// number of free edges
aNbE=aMEF.Extent();// number of all edges
for(i=1; i<=aNbE; ++i) {
const TopTools_ListOfShape& aLF=aMEF(i);
aNbF=aLF.Extent();// number of faces attached to the edge "i"
if (aNbF==1) {
++iCnt;
}
}
...

ziyoo's picture

Prs3d_ShapeTool Tool(aShape);
for (Tool.InitCurve();Tool.MoreCurve();Tool.NextCurve())
{
const TopoDS_Edge& E = Tool.GetCurve();
Standard_Integer neighbour = Tool.Neighbours();
......
}