2D viewing of an object

Technical discussions
Post Reply
Ibi
Posts: 19
Joined: Mon Jul 29, 2013 12:44 am

2D viewing of an object

Post by Ibi »

Hi
I want to display 2D of 3D object (orthogonal drawing). Just wanted to know what is the best way of doing this.
Thank you
Ibi

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: 2D viewing of an object

Post by nickz »

Hi Ibi
There are different ways to do it. They depend significantly on the objective and type of the object(s). Could you tell a bit more about the purpose? Printing, getting a silhouette for calculations, etc.? Is it a mesh section or other type or whole mode, etc.?
Nick

Ibi
Posts: 19
Joined: Mon Jul 29, 2013 12:44 am

Re: 2D viewing of an object

Post by Ibi »

I have a number of mesh objects, I want to draw Oxy, Oxz or Oyz views. I want to draw orthogonal views of mesh objects.
Regards

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: 2D viewing of an object

Post by nickz »

Ibi,

If you just need to set the view point it is easy:

You need to get IFrame of the eye frame (~=Camera) like:
m_kernelCAD.GetView() > IView > IFrame
The last one is a cast (query)

And for the obtained iFrameEye do:
iFrameEye. ResetOrientation() (Or Reset() to set position = global axes also)

iFrameEye determines position of eye frame wrt the global axes.

This will make the view to show the x,y axes as if 2D view.

Call iFrameEye.RotateStd( -90, 0 ); after that to show x,z axes.
Call iFrameEye.RotateStd( 90, 1 ); to show y,z axes

It is demonstrated in the View Point sample (C++). Sorry we do not have VB Net version of it. And C# version does not have the x,y etc. buttons.

In C++ it is done in CViewPointDlg::OnProjectionXY() etc. handlers.

You can also disable view rotations with the mouse to make it 2D view:
IView > IView2 > IView2.Enable(EEnableBit.eEnableRotate, False)

Like in CrossViewForm.Init() , Samples\NET\C#\View\CrossView\CrossViewForm.cs

Kind regards
Nick

Post Reply