Finding the common edges of two surfaces

How to do this with OpenCascade?
If there is no built-in tool, then I have to iterate over the edges of the surfaces and do some edge-based comparison. How to check the equality of twotwo topological edges?

Thanks.

Hugues's picture

I have found a class in OpenCascade that does the trick.
`BRepOffsetAPI_FindContigousEdges' is the class, be aware it's FindContigous and not FindContiguous as the orthography would expect it.

Fabio Napodano's picture

for future references:

check out ShapeAnalysis_Edge::CheckOverlapping

the usage is a bit obscure at first, but a look at the source code will unveil the idea

Jihui Cong's picture

how to use it can you show me?

Jihui Cong's picture

how to use ShapeAnalysis_Edge::CheckOverlapping() correctly?I don't know how to use it.

Thomas Hafemann's picture

For reference:
Standard_Boolean ShapeAnalysis_Edge::CheckOverlapping(const TopoDS_Edge& theEdge1,
const TopoDS_Edge& theEdge2,
Standard_Real& theTolOverlap,
const Standard_Real theDomainDist)

It compares two edges. It also requires the tolerance (if the distance between edges is smaller than tolerance it will return true) and a domain size, which should be !=0.
Ideally theDomainDist is close to the length of the smallest edge.

I could not get exactly what I wanted from it, so I just implemented something similar:
- Check lengths of edges
- Check first and last vertices
- Check bounding box of edges

For a complete overlap to exist one bounding box should be within the other.
For a partial overlap check where the boundign boxes cross each other and use GCPnts_AbscissaPoint from that point on.
You can divide the overlapped box-length to estimate a nice step for the abscissas.
With the abscissas calculate points.
If they match (within tolerance) there is an overlap otherwise not.

This way you know:
- where the overlap is (pnt)
- how much is overlapping