Determine TopoDS_Edge lies on TopoDS_Face

Hi guys, i have a two questins:

1.How to determine whether this edge lies/belongs to this face?

2. Is any way to check TopoDS_Edge is same to another TopoDS_Edge geometricaly? Methods like TopoDS_Edge ::IsSame and TopoDS_EdgeIsEqual don't work correctly, because they comparing own "entity" pointers and works like comapring two raw pointers. I want to check, for example, two segements have internaly two equal points by coords. Is any way to do this?

Mikhail Sazonov's picture

1. To explore all edges belonging to face use the class TopExp_Explorer:
for (TopExp_Explorer exp(face, TopAbs_EDGE); exp.More(); exp.Next()) {
const TopoDS_Edge& edge = TopoDS::Edge(exp.Current());
}
If an edge is lying on a face you cannot determine that without first projecting the curve of this edge on the surface of that face and then checking the distance between original and projection. The last can be performed with GeomLib_CheckCurveOnSurface.

2. In order to check if two independent edges coincide you can get their tessellations using uniform distribution of points (GCPnts_UniformAbscissa) and compare them point by point.