How to get the points of intersection of the 2D edges and the 2D edges in a parametric surface?

Hello,

I wrote program to read a iges file and display it.
I tried to get the points of intersection of the 2D edges and the 2D edges in a parametric surface,but I have no idea to do this. Hope someone can give me advices.

This is my code:

Standard_Real umin, umax;
Standard_Real vmin, vmax;
aSurf->Bounds(umin, umax, vmin, vmax)

for(int i = 1;i {
int count = 0,c=0;
for (edge_exp.Init(aFace, TopAbs_EDGE); edge_exp.More(); edge_exp.Next())
{

TopoDS_Edge edge = TopoDS::Edge(edge_exp.Current());

// I what to Calculate the points of intersection of current edge and
any edge in their 2D parametric space.
}

}

Please help me.

Benjamin Bihler's picture

I have not done that yet, therefore I can only give a very short hint what you could try:

Convert edge to 2d curve:

Handle(Geom2d_Curve) curve = BRep_Tool::CurveOnSurface(edge, face, first, last);

Find intersection of two 2d curves: use Geom2dAPI_ExtremaCurveCurve.

Good luck,
Benjamin

Mauro Mariotti's picture

I use Geom2dAPI_InterCurveCurve.

Regards.
Mauro

Dante Liu's picture

Sorry, now I have two 2D points, I don't konw how to use 2 points to generated a 2d curve or 2d edges.
please help me,thanks.