Use draft / array to make holes in Part Design

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!
User avatar
Shalmeneser
Veteran
Posts: 9560
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Use draft / array to make holes in Part Design

Post by Shalmeneser »

OS: Linux Mint 19.3 (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.20.25025 (Git) AppImage
Build type: Release
Branch: master
Hash: fb8b21ec43dca706a4aa2d63d59a4fb79f050369
Python version: 3.9.4
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: French/France (fr_FR)

Memory : 7.7 Gio
i3
user1234
Veteran
Posts: 3511
Joined: Mon Jul 11, 2016 5:08 pm

Re: Use draft / array to make holes in Part Design

Post by user1234 »

That is funny, FreeCAD crash before it is out of RAM?

Greetings
user1234
User avatar
papyblaise
Veteran
Posts: 8002
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Use draft / array to make holes in Part Design

Post by papyblaise »

Ha that reassures me I'm not alone :!:
User avatar
papyblaise
Veteran
Posts: 8002
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Use draft / array to make holes in Part Design

Post by papyblaise »

not more! This is fixed in 0.20dev
I would like to believe you, here is an example
1600 spiral holes: with part 2.5mn, with Partdesign: crash after 10mn
I warn: wear sunglasses, because it makes the eyes spiral too :lol:
Fc V20pre
Attachments
spirale.PNG
spirale.PNG (52.88 KiB) Viewed 663 times
spirale.FCStd
(964.62 KiB) Downloaded 16 times
user1234
Veteran
Posts: 3511
Joined: Mon Jul 11, 2016 5:08 pm

Re: Use draft / array to make holes in Part Design

Post by user1234 »

papyblaise wrote: Wed Jun 16, 2021 11:47 am I would like to believe you, here is an example
This example has nothing to to with the array (transformation) tools in PartDesign. Your example is Draft + Part only. Also PartDesign has not a spiral array.
papyblaise wrote: Wed Jun 16, 2021 11:47 am 1600 spiral holes: with part 2.5mn, with Partdesign: crash after 10mn
No problem here, is done in 72 seconds.

Greetings
user1234
User avatar
papyblaise
Veteran
Posts: 8002
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Use draft / array to make holes in Part Design

Post by papyblaise »

always these phony excuses, and each time I evoke this figure, I receive a fall of mockery, I nevertheless find this form nice :lol:
user1234
Veteran
Posts: 3511
Joined: Mon Jul 11, 2016 5:08 pm

Re: Use draft / array to make holes in Part Design

Post by user1234 »

papyblaise wrote: Wed Jun 16, 2021 2:13 pm always these phony excuses
What excuses? I think you get not he point. The issue was, that the PartDesign transformation tools was slow. Now they are fast as the Draft array + Part workaround. The only issue is now that PartDesign have no special array like spiral array in Draft.
papyblaise wrote: Wed Jun 16, 2021 2:13 pm I nevertheless find this form nice
Flippancy forms does not matter, only function.

Greetings
user1234
User avatar
papyblaise
Veteran
Posts: 8002
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Use draft / array to make holes in Part Design

Post by papyblaise »

good, good if you prefer the classic: 2500holes:
2mn50 "with Partdesignet a 760mb file
1mn and 306mo with Draft array
so there is no equal
Attachments
2500trous1.FCStd
(306.81 KiB) Downloaded 12 times
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Use draft / array to make holes in Part Design

Post by chrisb »

The differences between Part and PartDesign are fairly good visible but by far not as serious as they used to be.
I took papyblaises's model and made the Part model completely independent from the Body to avoid the "link goes out of allowed scope" message.
The uploaded file has only few holes in the Body, for a comparison set the following values. I recommend to check skip recomputes before changing the values:
- in LinearPattern the number of occurrences to 50 instead of 5
- in LinearPattern001 the number of occurrences to 50 instead of 5
- in Array change NumberX from 5 to 50
- in Array change NumberY from 5 to 50

Mark everything in the body and measure the time for recompute and compare it to marking everything in the Cut for recompute.

Results here:
PartDesign
Recompute Body and everythig inside with autodetecting overlap mode: 181-184sec CPU time / 176-178sec elapsed time
Recompute Body and everythig inside with manually setting non-overlap mode: 178-182 sec CPU time / 73-77sec elapsed time

Part
Recompute Cut and everything below: 179-180sec CPU time / 51-56sec elapsed

So it seems that the CPU time is the same, but the Part model's recompute can be better parallelized.

Here is a script to measure the time for the recompute. Some lines are commented out for slightly different use cases.

Code: Select all

# measure the time elapsed for a recompute
# exec(open('/Users/cb/panhard/coupe/sanssoupapes/timeToRecompute.py').read())
import time
import FreeCAD

# # touch everything:
# for obj in FreeCAD.ActiveDocument.Objects:
#  obj.touch()

# Uncomment exactly one of these two:
timeFn = time.perf_counter # measure real time
## timeFn = time.process_time # measure process time, ignore sleep, count each processor

# measure recompute
startTime = timeFn()
App.ActiveDocument.recompute()
endTime   = timeFn()
elapsed = int(endTime - startTime)
print('{:02d}:{:02d}:{:05.2f}'.format(int(elapsed) // 3600, (int(elapsed) % 3600 // 60), elapsed % 60))
print(endTime - startTime)
Attachments
2500trous_cb.FCStd
(28.95 KiB) Downloaded 14 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
user1234
Veteran
Posts: 3511
Joined: Mon Jul 11, 2016 5:08 pm

Re: Use draft / array to make holes in Part Design

Post by user1234 »

papyblaise wrote: Wed Jun 16, 2021 4:14 pm 2mn50 "with Partdesignet a 760mb file
1mn and 306mo with Draft array
You know that the RAM depends on the graphical (tessellation) settings? Of course the must be the same for a comparison.
papyblaise wrote: Wed Jun 16, 2021 4:14 pm so there is no equal
I never said that, only that almost, since PartDesign have not all default patterns like Draft.

And if you do not believe me, read:
https://github.com/FreeCAD/FreeCAD/pull/4504
https://forum.freecadweb.org/viewtopic.php?t=55860

Greetings
user1234
Post Reply