Intersection of two Geom_Planes


I think it's quite a simple question but I found nothing about it in the doumentation, the samples and the user forum. I want to intersect two planes (Geom_Plane) using GeomAPI_IntSS. The result from the intersection is returned as a Geom_Curve, but is in fact a 3D line. I need this line for further computations but I don't know how convert it into a Geom_Line. Here's a code snippet for better understanding:

// First plane
Handle(Geom_Plane) plane_normal = new Geom_Plane(base, aw_direction);

// Second plane
gp_Dir z_direction(0, 0, 1);
Handle(Geom_Plane) plane_xy = new Geom_Plane(base, z_direction);

// Intersection
GeomAPI_IntSS intersection;
intersection.Perform(plane_normal, plane_xy, 1.0e-7);

// For debugging only
int number = intersection.NbLines();
Standard_Boolean flag = intersection.IsDone();

// Get intersection curve
Handle(Geom_Curve) curve = intersection.Line(1);

Can anybody give me a hint?

Thanks, Sven.

Sven Jungnickel's picture

Ok, I found the solution on myself...Simply use the Downcast function of Geom_Line on the Geom_Curve to retrieve a handle to the line, e.g.

// To set the starting point of the intersection line