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 (not verified) Wed, 05/18/2005 - 19:22
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.
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
Wed, 05/18/2005 - 19:22
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.
Tue, 01/17/2006 - 17:26
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
Fri, 07/21/2023 - 12:53
how to use it can you show me?
Sat, 07/22/2023 - 16:11
how to use ShapeAnalysis_Edge::CheckOverlapping() correctly?I don't know how to use it.
Mon, 07/24/2023 - 17:28
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