Page 1 of 1
Extract triangles from 3D import
Posted: 23 Apr 2015, 17:03
by KGZ
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.
Re: Extract triangles from 3D import
Posted: 23 Apr 2015, 20:01
by support
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
Re: Extract triangles from 3D import
Posted: 27 Apr 2015, 14:23
by KGZ
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.
Re: Extract triangles from 3D import
Posted: 27 Apr 2015, 21:51
by support
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
Re: Extract triangles from 3D import
Posted: 28 Apr 2015, 16:04
by KGZ
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.
Re: Extract triangles from 3D import
Posted: 28 Apr 2015, 21:35
by support
Hello,
Could you give us more information about the Access Violation error? Call Stack info, for instance.
Mikhail
Re: Extract triangles from 3D import
Posted: 30 Apr 2015, 12:19
by KGZ
-deleted-
Re: Extract triangles from 3D import
Posted: 30 Apr 2015, 13:25
by KGZ
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.
Re: Extract triangles from 3D import
Posted: 30 Apr 2015, 20:06
by support
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