Decrease Triangle Count in imported STEP file

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

Moderators: SDS, support, admin

Post Reply
Tiago.Rodrigues
Posts: 8
Joined: 26 Aug 2015, 11:12

Decrease Triangle Count in imported STEP file

Post by Tiago.Rodrigues » 22 Aug 2016, 12:30

Hi!

I have some heavy STEP files to show in 3D. It is taking a long time to load and show theses objects, and since i do not need them to have the best quality, I want to know if it would be possible to decrease the triangle count of the imported MeshObject's created by the converter.

I've changed the MeshQuality property of the converter and the cnstDeviationCoefficientDefault/ cnstDeviationCoefficientRealistic values, but i cant seem to get the triangle count to decrease to a relevant value.

if I set the mesh quality to 0,0001 I get, lets say 15000 triangles.
If i set i to 0.001,0.01,0.1 I always get the same amount, lets say 10000 triangles.

Is there any other property that i can change to achieve this?
Thank you.

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

Re: Decrease Triangle Count in imported STEP file

Post by support » 22 Aug 2016, 14:13

Hello Tiago,

The quantity of triangles in imported STEP file is calculated basing on the deflection value (the maximum distance between an edge of the mesh and the corresponding surface, this will always be non-zero for a curved surface) which in turn is calculated using the following formula:

aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4

where dx, dy and dz are the 3D model dimensions.

Could you send one of your STEP files to the Technical Support e-mail for testing this issue?


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

Tiago.Rodrigues
Posts: 8
Joined: 26 Aug 2015, 11:12

Re: Decrease Triangle Count in imported STEP file

Post by Tiago.Rodrigues » 22 Aug 2016, 17:09

Ok, i've just sent you an email.
Thanks

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

Re: Decrease Triangle Count in imported STEP file

Post by support » 24 Aug 2016, 17:17

Hello Tiago,

There is no direct correlation between increasing the deviation coefficient and decreasing the triangles quantity. The quantity of triangles in a triangular mesh which represents a 3D surface actually is limited by some minumum value depending on the surface curvature (e.g. two triangles for a flat surface).

If you are trying to decrease loading time for heavy STEP files by setting a lower mesh quality, it won't help, because approximately 50% of time is spent on transferring the data within OPEN CASCADE libraries, while meshing takes 12-13% of the overall loading time.


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

Tiago.Rodrigues
Posts: 8
Joined: 26 Aug 2015, 11:12

Re: Decrease Triangle Count in imported STEP file

Post by Tiago.Rodrigues » 24 Aug 2016, 17:36

It could help because after the STEP import i save the MeshObjects to a file, using TMeshObject.SaveToFile and from that moment on i only load that file, using TMeshObject.LoadFromFile

Wich means i'm ok with the time consumed importing the STEP file. My concern is the time that takes those TMeshObject.LoadFromFile calls. So if the resulting object was more 'light' then it would be fine, because the next calls would take less time

Thats why i was trying to create an object with less triangles, for that load to take less time.
My problem could also be solved if there was some function in GLScene that could 'sharp' a TMeshObject... but i found nothing...

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

Re: Decrease Triangle Count in imported STEP file

Post by support » 26 Aug 2016, 16:05

Hello Tiago,

Another way to decrease the loading time is to convert the imported STEP file to the STL format, then load the STL file with CAD VCL. Loading the STL mesh doesn't take a lot of time as opposed to the STEP import, this is especially notable when using heavy files.

FYI, STEP to STL converter is already available in ABViewer 11 beta release and will be available in CAD VCL. You can download ABViewer 11 Beta at these links:

ABViewer 11 Beta [32-bit]
ABViewer 11 Beta [64-bit]


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

Post Reply