Tue, 07/26/2022 - 22:38
Forums:
Given 2 TopoDS_Edges (or their curves) A & B, how to determine if A and B are superimposed over any part of their length, within some tolerance?
My best idea so far is to find a common starting point, find the parameter p on each curve at that point, find n points on each curve at (p + (someInterval * i)) and then test the distance between each pair of points. Maybe a sum of the squares instead of
doing individual comparisons?
I suspect that this approach does not take the full advantage of OCC's capabilities. :(
Any suggestions appreciated.
Thanks.
Tue, 07/26/2022 - 23:51
May be the common Boolean operation will help in your case.
Just set the fuzzy value to the given tolerance and compute common (BRepAlgoAPI_Common) between the two edges.
aRes will contain the edge that is a common part of two edges. It will be an empty compound in case of no common.
Wed, 08/03/2022 - 02:50
This is great. Never occurred to me to use booleans on edges. Thank you. In case somebody else comes looking, here is the code to interpret the result of the common.