Solid 3D View

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
Luis
Posts: 10
Joined: 25 Oct 2013, 16:40

Solid 3D View

Post by Luis » 25 Oct 2013, 16:59

Hello,

I used CADImport.NET in my C# application. I have a drawing in a CADPictureBox.

I want to visualize the drawing in a 3D View. In the CAD file there are polylines with nonzero thickness.

I set graphicsMode as OpenGL and RenderMode as Solid and then I imposed SEIsometric View but my application visualizes a 3D View as if the RenderMode had Wireframe.

Am I forgetting any step?

Regards,

Luis

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Solid 3D View

Post by support » 25 Oct 2013, 17:26

Hello!

If the drawing contains only POLYLINE entities, it should be visualized correctly in the Solid mode. Does the Viewer demo visualizes the drawing the same way? If so, could you send the drawing to our e-mail: support@cadsofttools.com for the purpose of testing?


Mikhail.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Luis
Posts: 10
Joined: 25 Oct 2013, 16:40

Re: Solid 3D View

Post by Luis » 25 Oct 2013, 17:40

Hello,

in Demo Viewer the visualization is corrected and I tried to do the same.

This is the involved part of my code:

"
DrawGraphicsMode graphicsMode;
CadPictureBox cadPictureBox;
RenderMode renderMode;
CadImage cadImage;

graphicsMode = DrawGraphicsMode.OpenGL;
cadPictureBox.Set3DStyle();
renderMode = RenderMode.Solid;
cadImage = CADImage.CreateImageByExtension(filename);
cadImage.GraphicsOutMode = graphicsMode;
cadImage.ChangeDrawMode(graphicsMode, cadPictureBox);
cadImage.ChangeGraphicsMode(graphicsMode, renderMode);

cadImage.RotToView(CADViewDirection.SEIsometric);
cadImage.Rotate(....);
cadPictureBox.Invalidate();

"

Luis
Posts: 10
Joined: 25 Oct 2013, 16:40

Re: Solid 3D View

Post by Luis » 12 Nov 2013, 15:00

Hello,

I still have the same problem.

I set in my code the Graphic Mode as OpenGL and the RenderMode as Solid, but the view is Wireframe.

I have followed all the steps of DemoViewer's code.

Can you help me?

Thanks,

Luis

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Solid 3D View

Post by support » 02 Dec 2013, 13:06

Hello Luis,

The code snippet below visualizes the drawing using OpenGL in the Solid mode:

Code: Select all

CADImage cadImage;
...

cadPictureBox1.Set3DStyle();
cadImage = null;
cadImage = CADImage.CreateImageByExtension(fileName);
cadImage.LoadFromFile(fileName);
cadImage.ChangeDrawMode(DrawGraphicsMode.OpenGL, cadPictureBox1);
cadImage.ChangeGraphicsMode(DrawGraphicsMode.OpenGL, RenderMode.Solid);
cadImage.DefaultColor = Color.Gray;
cadImage.BackgroundColor = Color.Black;
cadImage.Draw(cadPictureBox1.CreateGraphics(), new RectangleF(0, 0, 8000, 8000), cadPictureBox1);
Mikhail.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Luis
Posts: 10
Joined: 25 Oct 2013, 16:40

Re: Solid 3D View

Post by Luis » 02 Dec 2013, 16:53

Hello Mikhail,

thanks for your reply.

When I try to rotate the view in SEIsometric Direction, cadImage doesn't rotate.

This is my code:

Code: Select all

cadImage.RotToView(CADViewDirection.SEIsometric);
this.Orb3D.OnRotate();
cadPictureBox1.Invalidate();
The same code is good when drawgraphicmode is GDIPlus.

Luis

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Solid 3D View

Post by support » 02 Dec 2013, 17:25

Hello Luis,

You should call RotToView() method before the image will be drawn to CADPictureBox:

Code: Select all

...
cadImage.RotToView(CADViewDirection.SEIsometric);
...
cadImage.Draw(cadPictureBox1.CreateGraphics(), new RectangleF(0, 0, 8000, 8000), cadPictureBox1);
Mikhail.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply