Projecting a wire onto a plane

Hello whats the best strategy to project a wire onto a plane.

1) Itereate over the wire exploring the vertices, translate (project) the vertices onto the plane. Can be problematic in my eyes because if I have arcs or something similar in the wire - the projection is not correct????
2) Using a projection function like this:

TopoDS_Wire lWire = (*pWire);
Handle (Geom_Curve) lGeomCurveHandle;
Handle (Geom_Plane) lPlaneHandle = new Geom_Plane(Geom_Plane(gp_Pnt( 0, 0, pZValue),gp_Dir(0, 0, 1)));

BRepAdaptor_CompCurve lCurve = BRepAdaptor_CompCurve(lWire);
Handle (BRepAdaptor_HCompCurve) lCurveHandle = new BRepAdaptor_HCompCurve(lCurve);
Approx_Curve3d lCurveApproximation(lCurveHandle,TOLERANCE_3D,GeomAbs_C0,1000,2);
if (lCurveApproximation.IsDone() && lCurveApproximation.HasResult())
lGeomCurveHandle = lCurveApproximation.Curve();

The question here is... is the original wire manipulated?? And if not how can I create one using lGeomCurveHandle???
There are many classes for projection... but noone seems to fit me??? Are there other strategies???

Thanks in advance -Stefan

Bearloga's picture

The more reliable way is to make cylindrical projection. For that define a direction of projection (in your case it is the normal of the plane), create a prism of your wire and intersect the shell with the plane.

StefanKunze's picture

In principle this would work. But I´m not sure that the startpoint of my "closed" wire (start and endpoint are the same) will be the same as a correct projected wire!?! Can someone confirm that???
Thanks - Stefan