Parallel Projection of Face (or its Edges) onto a Plane

I need to do a parallel projections of faces on to a plane (actually the z=0 plane).

Actually, I am interested in the Edges of the face, so perhaps it is the Edges I should be projecting rather than the face itself.

The result I want is the Edges of the face after projection.

I have searched the documentation and forums, and there seems to be conflicting advice on how to do this - or possibly I am misunderstanding something.

I see some advice saying to use  BRepProj_Projection , some to use ProjLib_ProjectOnPlane, some to use Prs3d_Projector. And I can see other functions like GeomProjLib::ProjectOnPlane().

What is the best way to do this?

I am reasonably familiar with I am successfully iterating through a Shape, to get all it's faces, and iterating through the faces to get the wires.

These Shapes are loaded from STEP files - I have code successfully doing this.

Thank you


Jim Williams's picture

OK, an update:

After some experimentation, this code seems to work - at least so far:


TopoDS_Edge aEdge = ...;// From the wire of the face of the shape...

//Get the curve from the edge
Standard_Real first, last;
TopLoc_Location location;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aEdge, location, first, last);
//define a plane    
gp_Pnt planeLoc = gp_Pnt(0, 0, 0);
gp_Dir planeDir  = gp_Dir(0, 0, 1);
//define a projection dir
gp_Dir projDir = gp_Dir(0, 0.5, 0.5);
//create the plane
Handle(Geom_Plane) lPlaneHandle = new Geom_Plane(Geom_Plane(planeLoc, planeDir ));    
//project the curve on to the plane
Handle(Geom_Curve) projectedCurve = GeomProjLib::ProjectOnPlane(aCurve, lPlaneHandle, projDir , Standard_True);


However, I am still not clear on all the different projection classes/methods I mentioned in the previous post.

Can anyone help?