What makes this model so slow?

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!
euphi77
Posts: 13
Joined: Sat Dec 02, 2017 9:45 am

What makes this model so slow?

Post by euphi77 »

Since some change I did to a model (I'm unsure which one), FreeCAD (Part Design WB) takes a very long time to calculate each update (opening/adding sketch, changing parameters etc.).

The model has two part design bodies (+ some imported from STL/step), the second one uses a Shapebinder from the first one as Base Feature (hints how to do this better are welcome, but this is a secondary question).

Every small change to the bodies (paramter, sketch etc.) results in > 1 Min time to update the model (on a decent CPU (Ryzen5 Hexacore)). This was not the case with design very similar to the current one (already with the shapebinder). Can someone explain me, what is the issue? Or help me how to analyze on my own?
Screenshot
Screenshot
Screenshot_20230331_232050.png (648.27 KiB) Viewed 778 times
The freecad file is too large, so I uploaded it to github:
https://github.com/euphi/TRGB-BikeCompu ... r-FL.FCStd (Direct (raw) download: https://github.com/euphi/TRGB-BikeCompu ... r-FL.FCStd
(Note the gap between the two parts is intended (space for TPU seal))

FreeCAD is current weekly version (0.21.0 Build 32637 and several previous builds).
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: What makes this model so slow?

Post by Shalmeneser »

Sketch upon face = TNP
lots of problems : Part_CheckGeometry
chrisb
Veteran
Posts: 53924
Joined: Tue Mar 17, 2015 9:14 am

Re: What makes this model so slow?

Post by chrisb »

Shalmeneser wrote: Fri Mar 31, 2023 10:24 pm Sketch upon face = TNP
Are they also time relevant or is this rather a general remark?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: What makes this model so slow?

Post by Shalmeneser »

TNP here is a general remark but it's not helping if you want to suppress a certain feature.
euphi77
Posts: 13
Joined: Sat Dec 02, 2017 9:45 am

Re: What makes this model so slow?

Post by euphi77 »

Well, I tried to avoid TNP whenever possible, but many of the sketches need to be on specific faces of "later" features.

I also don't see why TNP should slow done recalculation that much?

Also, CheckGeometry does not show any issues for the bottom part and two (related) errors for the top part.

I don't understand the reason for these errors, because model looks exactly as intented. Also, I see no reason why these should slow down recalculation.

Screenshot_20230401_110635.png
Screenshot_20230401_110635.png (176.58 KiB) Viewed 571 times
User avatar
Vincent B
Veteran
Posts: 4713
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: What makes this model so slow?

Post by Vincent B »

I'm not too surprised with the calculating time because there are a lot of features. Little bit compelling :roll: anyway. A get around could be to separate a body with 2: splitting the workflow by two parts. The first body could be link with a basefeature inside the next.
chrisb
Veteran
Posts: 53924
Joined: Tue Mar 17, 2015 9:14 am

Re: What makes this model so slow?

Post by chrisb »

I find the automatic refine to be suspicious. Alas, due to mapping on faces, this is not easily be changed.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: What makes this model so slow?

Post by thomas-neemann »

euphi77 wrote: Fri Mar 31, 2023 9:56 pm ...
I only use Sketcher when it offers advantages over draft (arch) (e.g. tangential transitions, kinematics or automatic closing of open contours). I find it too slow for larger sketches, even without tnp or other errors
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
imm
Posts: 250
Joined: Wed Nov 03, 2021 1:00 pm

Re: What makes this model so slow?

Post by imm »

1. Turn off 'Boden002' Body. (space bar to hide)
2. Expand Deckel Body.
3. Go to Part Workbench.
4. Select Aussenform in your Model tree. Go to Part | Check Geometry. It will check OK.
5. Work your way down through the other objects. You start to see problems at Box - akku.

The problems relate to the way you are using datum planes, especially the definition of their 'support'.

By linking the datum plane support to faces in your model you are bound to have issues with TNP.

To avoid this create datum planes that are not linked to any object at the support level. You can still change their placement using formulas.
As shown below.

After you have created the shown datum planes you have to change the support on your parts to reference the datum planes, not the part faces.
This avoids using 'Named Faces' as a reference to your geometry and should allow you to avoid TNP.

You will have to 'redefine' your external geometry in some of your sketches. That is again because of TNP.

And yes, Speed issue goes away after adding these Datum Planes.

The individual Datum Planes not tied to an object
The individual Datum Planes not tied to an object
DatumPlane_ex1.PNG (62.59 KiB) Viewed 459 times
A Datum Plane referencing an Object Length
A Datum Plane referencing an Object Length
DatumPlane_ex2.PNG (53.99 KiB) Viewed 459 times
A Datum Plane referencing another Datum Plane
A Datum Plane referencing another Datum Plane
DatumPlane_ex3.PNG (52.43 KiB) Viewed 459 times
Adjust Support references on objects and sketches
Adjust Support references on objects and sketches
DatumPlane_ex4.PNG (14.71 KiB) Viewed 459 times
chrisb
Veteran
Posts: 53924
Joined: Tue Mar 17, 2015 9:14 am

Re: What makes this model so slow?

Post by chrisb »

thomas-neemann wrote: Sat Apr 01, 2023 11:22 am I only use Sketcher when it offers advantages over draft (arch) (e.g. tangential transitions, kinematics or automatic closing of open contours). I find it too slow for larger sketches, even without tnp or other errors
That doesn't really contribute to an explanation why this model recomputes slow. It might not even offer a solution without knowing where the problem comes from, I doubt very much that it is the Sketcher.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply