Sketch on a specific plane

Hi, All,

I want to choose a plane in a V3d_View as a datum plane, and to make sketch in this plane. Therefore, I need to (1) zoom the plane to fit the window, and (2) set grid on the plane, is there any way to do so?

Thanks in advance!


Paul Jimenez's picture

Sure it is possible, yet you will have to write some code to get it working.

To set the grid on the plane, check V3d_Viewer::SetPrivilegedPlane. For sure you need to pass gp_Ax3 with the same normal as the plane and a point of it for the location. As for the zooming, check how the view fits objects and apply the technique for your plane. If you want to rotate it in such a way that the plane's normal points to you, then you must guarantee that the view's projection is parallel to the plane's normal.

Don't forget to post your findings.

Good luck.

P Dolbey's picture

Once you've set the priviledged plane to your datum plane, you can use code similar to that found in to map your 2D mouse co-ordinates to a 3D point on the plane, and use that as basis for creating vertices and edges etc.