Extract triangles from 3D import

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
KGZ
Posts: 5
Joined: 23 Apr 2015, 15:49

Extract triangles from 3D import

Post by KGZ » 23 Apr 2015, 17:03

Since we don't have the source code of VCL import (yet not a customer), a question:

After loading a 3D CAD file to a TsgDrawingNavigator, can we access the triangulated faces of the object instead of the higher level TsgFlatPoly3D/TsgBrepIndexFace/TsgDXFSpline entitites?
Where is the triangulation taking place - in CAD VCL import library or in GLScene?
After all, is it possible at some point to access the triangles/quads?
If we purchase, do we get all the source code that with some modifications we can achieve this? Or is it hidden in a DLL / precompiled unit?

Thank you.

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

Re: Extract triangles from 3D import

Post by support » 23 Apr 2015, 20:01

Hello,

It is not possible to access the triangulated faces of the object using TsgDrawingNavigator, because the triangulation takes place in MeshBuilder.dll (CADVCL 10.1 Demo\Delphi\ExternalLib\OpenCascade\win32\vc9\bin\MeshBuilder.dll).


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

KGZ
Posts: 5
Joined: 23 Apr 2015, 15:49

Re: Extract triangles from 3D import

Post by KGZ » 27 Apr 2015, 14:23

Thank you,
as a workaround - is there a way to test the 3D export capabilities of CAD VCL ? Maybe a precompiled demo?
Calling SaveToFile on (FDN.Picture.Graphic as TsgCADImage) just creates a 0 byte file in the free trial version.

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

Re: Extract triangles from 3D import

Post by support » 27 Apr 2015, 21:51

Hello,

Please, specify the file format you want to export to. For example, the following code exports the loaded drawing to the DWG format:

Code: Select all

uses
..., CADImage, CADtoDWG;

procedure SaveToDWG(ACADImage: TsgCADImage; AFileName: string);
var
  vCADtoDWG: TsgCADtoDWG;
begin
  if not Assigned(ACADImage) then Exit;
  vCADtoDWG := TsgCADtoDWG.Create(ACADImage);
  try
    vCADtoDWG.SaveToFile(AFileName);
  finally
    vCADtoDWG.Free;
  end;
end;
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

KGZ
Posts: 5
Joined: 23 Apr 2015, 15:49

Re: Extract triangles from 3D import

Post by KGZ » 28 Apr 2015, 16:04

Well this must work for 2D, I guess. It fails (access violation) with a STEP model loaded.

Can I export to simple 3D formats like OBJ, VRML or anything 3D?

Thank you.

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

Re: Extract triangles from 3D import

Post by support » 28 Apr 2015, 21:35

Hello,

Could you give us more information about the Access Violation error? Call Stack info, for instance.


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

KGZ
Posts: 5
Joined: 23 Apr 2015, 15:49

Re: Extract triangles from 3D import

Post by KGZ » 30 Apr 2015, 12:19

-deleted-
Last edited by KGZ on 30 Apr 2015, 13:43, edited 1 time in total.

KGZ
Posts: 5
Joined: 23 Apr 2015, 15:49

Re: Extract triangles from 3D import

Post by KGZ » 30 Apr 2015, 13:25

My mistake, I've found out that I was missing .Graphic after "FDN.Picture", now it saves DWG in 3D.

Are there any other exporters available, STEP or vrml, obj, or which format? I've found PDF,SVG,HPGL,CGM,DXF,SWF, but only DWG is 3D - DXF 3D seems to be invalid:

AutoDesk TrueView is not able to open exported DXF from this model : https://www.dropbox.com/s/me0vb3ektqydd ... .STEP?dl=0

EDIT: I guess no more export formats are supported at the moment - http://cadsofttools.com/help/cadvcl/exp ... ts_eng.htm

Still, we will consider using the library for importing STEP.

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

Re: Extract triangles from 3D import

Post by support » 30 Apr 2015, 20:06

Hello,

There is a problem with export your STEP file to the DXF format: CAD VCL generates a corrupted DXF file that can not be read by AutoCAD/DWG TrueView. Our developers will look into this problem.


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

Post Reply