Very slow to _open_ complex fillet

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
chrisf
Posts: 212
Joined: Fri Jan 03, 2014 10:20 am

Very slow to _open_ complex fillet

Post by chrisf »

I'm working on some multi-faceted parts and am finding that it's taking a very long time to open the fillet object to edit it (to find out why it doesn't fillet!) when large numbers of edges are selected.

The parts have upwards of 500 edges. The attached shows the problem.

With the array of cubes set to 5 x 5, the resulting cut has 312 edges and you can the fillet opens for editing in around 5 seconds.
Increasing the array to 7 x 7 results in 600 edges and the fillet now takes over 60 seconds to open.
I tried at 10 x 10 but gave up after a couple of minutes.

Note that I am not talking about the time taken to create a new fillet. For the 7x7 example, that is a very reasonable 20 seconds on my machine. I can't see that FreeCAD is doing anything during this delay. The listview already shows all of the edges checked but effectively the programme hangs for a long time.

Anyone else seen this or can anyone else confirm this behaviour?

OS: Ubuntu 13.10
Platform: 64-bit
Version: 0.14.3398 (Git)
Branch: master
Hash: 95bda087643493a7e31e9cf507f1041fd446c4c7
Python version: 2.7.5+
Qt version: 4.8.4
Coin version: 4.0.0a
SoQt version: 1.5.0
OCC version: 6.5.4
Attachments
slow_fillet.fcstd
(184.16 KiB) Downloaded 60 times
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Very slow to _open_ complex fillet

Post by triplus »

I had to double check but yes you actually selected all the edges. Well i will say the obvious and that is you are hitting current software/hardware limit but one of the devs or somebody else could give better explanation.

About modelling technique used i would say there is room for improvement. It is really hard to change anything in this model. Adding/removing few of the rows will probably give unexpected results with existing fillets (topological naming) and you would always have to redo the new ones (time consuming). I will show you alternative solution that will enable you to do changes easily and it just so happens it is faster (but you will sooner or later hit the software/hardware limit with this method when adding rows).

Delete everything but Cube and Cube001. Add sketch on top face of Cube001 and Pad it. Add Fillet:
Fillet.png
Fillet.png (9.49 KiB) Viewed 2555 times
Here is where you will do all future Radius Fillet changes! Open Draft Workbench and create Array:
Draft Array.png
Draft Array.png (11.74 KiB) Viewed 2555 times
Here is where you will do all future Draft Array changes! Set number of vertical/horizontal rows and spacing. Open Part Workbench and make a Cut between Cube and Array:
Cut.png
Cut.png (61.77 KiB) Viewed 2555 times
What you have now is a bit different compared to your original model. First thing you will notice it is a bit faster and most importantly you can change Fillet Radius and number of vertical/horizontal rows with just setting some properties for features in tree view. Just like you would expect from parametric CAD software package. You will notice there is no (topological name) braking involved. You could set this 3 properties in spreadsheet for easy changing.
8x8.png
8x8.png (50.11 KiB) Viewed 2555 times
Changed number of rows and Fillet Radius.
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: Very slow to _open_ complex fillet

Post by bejant »

triplus wrote:or somebody else could give better explanation.
Well ... this may not be better, just different. I think it's because chrisf is using a development version which has more error checking than the production releases?

For example, I opened the 10x10 array with 0.13.1828 (which I just reinstalled) in a matter of seconds.
Opening "Fillet" from the tree view was pretty quick too.
Selecting all 1212 edges took about a minute.
Filleting all to 1.0 mm was about 2 minutes.
It could have been a little quicker; when the CPU fan slowed down I tabbed back to FC and it was done.
20140423a_10x10.jpg
20140423a_10x10.jpg (109.5 KiB) Viewed 2545 times
OS: Windows XP
Platform: 32-bit
Version: 0.13.1828
Python version: 2.6.2
Qt version: 4.5.2
Coin version: 3.1.0
SoQt version: 1.4.1
OCC version: 6.3.0
chrisf
Posts: 212
Joined: Fri Jan 03, 2014 10:20 am

Re: Very slow to _open_ complex fillet

Post by chrisf »

triplus wrote:I had to double check but yes you actually selected all the edges. Well i will say the obvious and that is you are hitting current software/hardware limit but one of the devs or somebody else could give better explanation.
You may be right but I'm not sure. As I say, I don't see that FreeCAD has to actually do anything in this phase except load up a QListView (or some such). This really shouldn't take very long. The source will tell.
triplus wrote:About modelling technique used i would say there is room for improvement ...
Thanks for the input. You make some interesting points. Certainly filleting then creating an array would be a better approach for the example that I posted but that file was not the model I'm working on, it was just an example. Here's a screen shot of one of the parts that is causing trouble.
Selection_113.png
Selection_113.png (67.36 KiB) Viewed 2535 times
chrisf
Posts: 212
Joined: Fri Jan 03, 2014 10:20 am

Re: Very slow to _open_ complex fillet

Post by chrisf »

bejant wrote:
triplus wrote:or somebody else could give better explanation.
Well ... this may not be better, just different. I think it's because chrisf is using a development version which has more error checking than the production releases?

For example, I opened the 10x10 array with 0.13.1828 (which I just reinstalled) in a matter of seconds.
Opening "Fillet" from the tree view was pretty quick too.
Selecting all 1212 edges took about a minute.
Filleting all to 1.0 mm was about 2 minutes.
It could have been a little quicker; when the CPU fan slowed down I tabbed back to FC and it was done.
Interesting. I'll see what 0.13 does with my file. Thanks for looking into it.
Chris
chrisf
Posts: 212
Joined: Fri Jan 03, 2014 10:20 am

Re: Very slow to _open_ complex fillet

Post by chrisf »

chrisf wrote:Interesting. I'll see what 0.13 does with my file. Thanks for looking into it.
Chris
The problem isn't there in 0.13.1830. I'm just going to make sure I don't have debug build enabled on 0.14.
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Very slow to _open_ complex fillet

Post by ickby »

just a guess: often when you open a freecad task view the shape is calculated for "life-view" of the task input.The real feature is just calculated when you hit the ok button. That could be the reason for the delay on opening the feature. But I did not check if this is the case for this special command.
chrisf
Posts: 212
Joined: Fri Jan 03, 2014 10:20 am

Re: Very slow to _open_ complex fillet

Post by chrisf »

ickby wrote:just a guess: often when you open a freecad task view the shape is calculated for "life-view" of the task input.The real feature is just calculated when you hit the ok button. That could be the reason for the delay on opening the feature. But I did not check if this is the case for this special command.
The 'live view' doesn't require any calculation for fillet edge/face selection. It's just the base part with selected edges highlighted.

I've just rebuilt with:

Code: Select all

cmake -DCOIN3D_INCLUDE_DIR=/usr/include/coin/ -DOCC_INCLUDE_DIR=/usr/include/oce/ -DFREECAD_USE_EXTERNAL_PIVY=true ../free-cad-code
make clean
make
and the problem is still there.

I'd appreciate any pointers as to which area of the code might be causing this.
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: Very slow to _open_ complex fillet

Post by tanderson69 »

chrisf wrote:I'd appreciate any pointers as to which area of the code might be causing this.
It appears to me that it is: src/Mod/Part/Gui/SoBrepEdgeSet.cpp:197 createIndexArray

I couldn't sample the whole run, but most of the samples I took look like the following:
profile.png
profile.png (215.69 KiB) Viewed 2514 times
chrisf
Posts: 212
Joined: Fri Jan 03, 2014 10:20 am

Re: Very slow to _open_ complex fillet

Post by chrisf »

tanderson69 wrote:
chrisf wrote:I'd appreciate any pointers as to which area of the code might be causing this.
It appears to me that it is: src/Mod/Part/Gui/SoBrepEdgeSet.cpp:197 createIndexArray
Very useful.Thanks. Which profiler do you use to generate that picture btw?

The code for createIndexArray isn't super efficient but that's not the problem.

The problem is that it's being called ... 268,000 times to open my 518 edge fillet. 518 x 519 = 268,842. I need to look at what's calling doAction (presumably to add an edge to the highlight) Nx(N+1) times for N edges.

Code: Select all

doAction called: 268838
createIndexArray: numsegm 514, numcindices 1898, v.size() 1880
doAction called: 268839
createIndexArray: numsegm 515, numcindices 1898, v.size() 1883
doAction called: 268840
createIndexArray: numsegm 516, numcindices 1898, v.size() 1886
doAction called: 268841
createIndexArray: numsegm 517, numcindices 1898, v.size() 1889
doAction called: 268842
createIndexArray: numsegm 518, numcindices 1898, v.size() 1892
Post Reply