Convert Geom2d_Curve to Geom_Curve


Is there a way to build a Geom_Curve from a Geom2d_Curve and a Geom_Surface?

We have a own 3D viewer which displays discretized Geom_Curves. As a result of HLRBRep_Algo I get a Compound containing edges. Thesee edges should be displayed in our viewer. Because the curve representation of these edges is of type BRep_CurveOnSurface I can not retrieve a Geom_Curve (Curve3D fails). But I can access a Geom2d_Curve and the surface where the curve lays in. So is there a way to build a Geom_Curve from this information?

Thanks in advance for any suggestions


Christian R. Krug's picture

Hi Markus,

Since you do some hidden line removal, I assume your Geom2d_Curve's all lie on some plane or other. So all you have to do is get the gp_Pln from the surface and call GeomAPI::To3d to get the corresponding Geom_Curve.

If your surfaces are non-planar, you have to use an approximation in order to compute your 3D curves, e.g. Approx_CurveOnSurface.

Regards, Kris.