Comparing curver

Hello,
I am trying to implement a method of comparing two edges. My approach is to check parameters of underlying geometric curves (gp_Lin, gp_Circ etc.) to see if the edges lie on the same curve and then check first and last parameters of the two curves to see if they overlap. The problem I am having is: even though a pair of edges are identical (in 3D space), once I acquire Geom_Curve, by calling BRep_Tool::Curve(), first and last parameters of the curves are different.
For example, having two lines, connecting two points (0,2,2) and (0,4,2), sometimes first and last parameters of the underlying curves are as follow: 2.0 - 4.0 and 0.0 - 2.0 respectively. I would like to ask you guys to help me understand what I am missing.

Best regards.

Mauro Mariotti's picture

Maybe the lines have a different origin, I mean an origin is shifted along the line with respect to the other one.

Bye.
Mauro

Balesss's picture

Well, the problem I described arises when I have two edges from two different faces. One of the face belongs to a solid, while the other does not. I suspect that the problem is related to location of the edge/face but I don't know how to solve it.
I can see however that if I try to get UV points of the curves by calling
BRep_Tool::UVPoints(const TopoDS_Edge& E, const TopoDS_Face& F, gp_Pnt2d& PFirst, gp_Pnt2d& PLast)
I can get the same results for both edges if I put the same face (i.e. one the faces) as the F parameters for both edges.

Best regards.