Performance: Subtractive helix & Polar Pattern

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
PJtraveler
Posts: 30
Joined: Mon Apr 23, 2018 2:57 pm

Performance: Subtractive helix & Polar Pattern

Post by PJtraveler »

I'm working on knurling a cylinder. It took about 20 minutes with 24 instances to 2 subtractive helixes. The GPU was at 0% or close to it, the cpu was running at 2 % and only 17% of memory was in use. I have a reasonably powerful machine (24 cores) 128 GB mem, 3060 GPU, and lots of disk.
Please could we work on the algo to improve the speed?

Thanks,
:-)
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Performance: Subtractive helix & Polar Pattern

Post by jnxd »

One thing I can think of is regarding parallelization. There's not much work to do, but whatever is is being done sequentially. I expect knurling to have a fair bit of intersections, which may be slowing down each of the steps.

As of now I don't know how well parallism is supported in OCCT itself, so what can be done may very well be limited by that.

Are you in the position to show us the model, or any other example where it takes a long time? It can be iaed for future benchmarks.
My latest (or last) project: B-spline Construction Project.
prai
Posts: 3
Joined: Thu Aug 25, 2022 12:27 am

Re: Performance: Subtractive helix & Polar Pattern

Post by prai »

I've faced similar issue with Additive Helix, while trying to create a bolt. Please refer : https://forum.freecadweb.org/viewtopic.php?f=19&t=71382

I am attaching the part file with this post, that presents the problem. To replicate the issue, one may try editing the dimensions in Sketch002 in M6_SQ12_3Tr_12mm.FCStd.
Attachments
M6_SQ12_3Tr_12mm.FCStd
(191.03 KiB) Downloaded 65 times
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Performance: Subtractive helix & Polar Pattern

Post by onekk »

jnxd wrote: Wed Aug 03, 2022 1:22 am One thing I can think of is regarding parallelization. ...
If parallelization is multithreading, I fear that there is not too much support for it in FC, nor for Graphics accelerations or similar thing.

I remember a recent message of @wmayer about this matter, but now I don't remember the proper place.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
user1234
Veteran
Posts: 3319
Joined: Mon Jul 11, 2016 5:08 pm

Re: Performance: Subtractive helix & Polar Pattern

Post by user1234 »

PJtraveler wrote: Tue Aug 02, 2022 11:05 pm Please could we work on the algo to improve the speed?
Except FreeCAD (with OCCT and tbb2), there is literately no CAD out there, even commercial, which supports multicore, except a server for deviate 2D drawings with extra license. That more cores are faster in CAD is a fallacy.

Greetings
user1234
user1234
Veteran
Posts: 3319
Joined: Mon Jul 11, 2016 5:08 pm

Re: Performance: Subtractive helix & Polar Pattern

Post by user1234 »

prai wrote: Thu Aug 25, 2022 2:12 am I am attaching the part file with this post, that presents the problem. To replicate the issue, one may try editing the dimensions in Sketch002 in M6_SQ12_3Tr_12mm.FCStd.
There are touching b-spline surfaces there are twisted with a b-spline result line in the middle. Even i give a good commercial CAD only a 50/50 change that the result is good. Just make a rod and cut the helix thread out.

Greetings
user1234
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Performance: Subtractive helix & Polar Pattern

Post by jnxd »

onekk wrote: Sat Aug 27, 2022 4:10 pm
jnxd wrote: Wed Aug 03, 2022 1:22 am One thing I can think of is regarding parallelization. ...
If parallelization is multithreading, I fear that there is not too much support for it in FC, nor for Graphics accelerations or similar thing.

I remember a recent message of @wmayer about this matter, but now I don't remember the proper place.

Regards

Carlo D.
Multithreading is one kind of parallelism.

And indeed there is little support for parallelism in FreeCAD. What I was saying was that we can't even add support, or will have great difficulty doing so, if it doesn't already exist in OCCT.

I wouldn't be surprised if there are multiple places wmayer said so.
My latest (or last) project: B-spline Construction Project.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Performance: Subtractive helix & Polar Pattern

Post by GeneFC »

I don't pay much attention to speed, and I claim no expertise in multicore strategies.

However, I have noted many times that all cores (4) are blasting away at 100% on some mesh operations in FreeCAD. I would guess that the mesh libraries know something about multicore.

Gene
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Performance: Subtractive helix & Polar Pattern

Post by chrisb »

Knurling with patterns of intersecting helices must be a challenge of every CAD system. In FreeCAD it could help a bit giving the helices a very slightly different depth, 10µ should suffice. Increasing the values of AngularDeflection and Deviation can help a lot.
But the best possibility to work on such a file with reasonable response times is to decrease during development time the number of helix instances to 2 or 3 for each direction.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Performance: Subtractive helix & Polar Pattern

Post by adrianinsaval »

Image
Post Reply