gp_Pnt2d to gp_Pnt

Hi,

I am just wondering how can I convert the gp_Pnt2d type to gp_Pnt?

Thanks!

Rob Bachrach's picture

Assuming you want to put it in a particular Z plane (like Z=0), you simply create the 3D point using the 2D coords:

gp_Pnt pnt3D(pnt2D.X(), pnt2D.Y(), 0.0);

DiRose's picture

Hi Rob,

Thanks for your help!!
I have done that already, but the coordance points doesn't seem to be right. any idea why that happened?

thanks!!

Rob Bachrach's picture

What do you mean by it doesn't seem right. The gp_Pnt just stores the data you give it. Are you referring to the graphical display? If so, I am sorry that I cannot help. I am not using OpenCASCADE for graphical display at this time.

Rob