joelgraff / freecad.trails

Trails is the Transportation Engineering workbench for FreeCAD
GNU Lesser General Public License v2.1
68 stars 12 forks source link

Slow file opening after recent surface changes #74

Closed smrruby closed 3 years ago

smrruby commented 3 years ago

I had been able to import over 270,000 x,y, elevation points, create a surface, save the file in freecad format, and opening the resulting ~13MB file took about 30-45 seconds. This was as of trails WB code ~4 days ago.

Recent changes to trails WB are now taking VERY long to open much smaller files. This file https://1drv.ms/u/s!AteZnEJEcrMQhfwyAgpw5mkcwwiVtA?e=fAm9fE which has a point cloud and associated surface based on 78,000 points takes over 20 minutes to load. I am running the current 0.19 23463 Freecad on both Windows and Linux (issue is replicable on both OSs) and a copy of Trails WB from git downloaded today.

That file is simply created by importing points from this csv https://1drv.ms/u/s!AteZnEJEcrMQhfwzLGW--UklKwYhtA?e=bVQtw0 then creating a surface based on those points, and saving the file.

OS: Windows 10 (10.0) Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.19.23463 (Git) Build type: Release Branch: master Hash: adc6db8f32c17e9f67cb82aa7962d1e42ce061c6 Python version: 3.8.6 Qt version: 5.12.5 Coin version: 4.0.0 OCC version: 7.4.0 Locale: English/United States (en_US)

OS: Debian GNU/Linux 10 (buster) (GNOME) Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.19.23463 (Git) AppImage Build type: Release Branch: master Hash: adc6db8f32c17e9f67cb82aa7962d1e42ce061c6 Python version: 3.8.6 Qt version: 5.12.5 Coin version: 4.0.0 OCC version: 7.4.0 Locale: English/United States (en_US)

smrruby commented 3 years ago

Using the same version of freecad above I did perform the same tasks (import the same points, create surface, save file, re-open file) using the "--branch main" of trails WB and the file opens in < 5 seconds. Here is the resulting freecad file from that run. https://1drv.ms/u/s!AteZnEJEcrMQhfw0f4RZXvqnmGW0og?e=WpxQx5

HakanSeven12 commented 3 years ago

There was a render issue with old creation method. So we implamented SoGeo nodes to fix this rendering issue. But it decrease the performance. Spatially with bigger files like yours(Mesh: [156142 Faces, 234525 Edges, 78303 Points]). So I recommend you to export a mesh object from trails surface object before you close the file.

import Mesh Mesh.show(obj.Mesh)

Then move that mesh object to another document.

HakanSeven12 commented 3 years ago

Fixed with this commit. It took only 8-9 second on my system to load file. Test again and send feedback. Dont try to open old file. Create a new one.

https://github.com/joelgraff/freecad.trails/pull/71/commits/10b90286e9f907e21034770f75e7427a4445431f

smrruby commented 3 years ago

Fix confirmed, it now takes just a few seconds to open that file and an even larger one that has about 4x the points/faces/edges opens in < 30 seconds. thanks!!

HakanSeven12 commented 3 years ago

You are welcome