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!
FredOP
Posts: 65
Joined: Sat Sep 26, 2020 1:25 pm

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

Post by FredOP »

drmacro wrote: Tue Jun 15, 2021 3:44 pm Since you insist, sure some examples. :mrgreen:

Snip macro screenshot-548157.png

Snip macro screenshot-43cbaf.png




Disclaimer: "point array example.FCStd" file comes from Forthman Forthman on Facebook.
Is it doable in PartDesign though ?
I'd rather stay in PD, this is already confusing enough
drmacro
Veteran
Posts: 8867
Joined: Sun Mar 02, 2014 4:35 pm

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

Post by drmacro »

FredOP wrote: Tue Jun 15, 2021 4:16 pm ...
Is it doable in PartDesign though ?
I'd rather stay in PD, this is already confusing enough
Yes, but, somewhere along the line you want/need to use Draft array, right? And that, takes you out of PD.
This example uses PD, you'll note the point array USES a PD Body, the result is not in a Body, it is a Draft object. Thus the Boolean is done with a Part WB Boolean.
Snip macro screenshot-dd6a2c.png
Snip macro screenshot-dd6a2c.png (88.04 KiB) Viewed 727 times
Attachments
PotDivits-2.FCStd
(39.09 KiB) Downloaded 21 times
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
FredOP
Posts: 65
Joined: Sat Sep 26, 2020 1:25 pm

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

Post by FredOP »

user1234 wrote: Tue Jun 15, 2021 3:56 pm
papyblaise wrote: Tue Jun 15, 2021 3:50 pm but as soon as you want to have 20 or 30 (and more) it becomes impossible
Draft Array has no limits
not more! This is fixed in 0.20dev!
Not really
Talking about Pocket / Multitransform performance here
I made this box with a 30x30 ( 900 ) square holes through pocket. While this clearly is done in a reasonable time (35 seconds on my workstation, still a very long time IMO) and the result looks good, every operation after that (downstream) requires 30 seconds just to be accepted, and every time you move one point in a sketch downstream, you have a 5 second wait. This is the point where I would give up. In 0.20 Version: 0.20.25025 (Git) AppImage. And I have unlimited RAM and CPU power (64 GB RAM, DUal Xeon E5-2670, 32 cores total). Even
Attachments
holes2.png
holes2.png (50.75 KiB) Viewed 719 times
user1234
Veteran
Posts: 3342
Joined: Mon Jul 11, 2016 5:08 pm

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

Post by user1234 »

FredOP wrote: Tue Jun 15, 2021 4:39 pmI made this box with a 30x30 ( 900 ) square holes through pocket. While this clearly is done in a reasonable time (35 seconds on my workstation, still a very long time IMO)
For that part is sound pretty good. Before the optimization, i am pretty sure, that it took around 5min in PartDesign (normally 0.3s per operation).
FredOP wrote: Tue Jun 15, 2021 4:39 pm64 GB RAM
does not matter
FredOP wrote: Tue Jun 15, 2021 4:39 pm DUal Xeon E5-2670, 32 cores
does not matter ether

What is important is if your OCCT is compiled with TTB. Than you gain max. 50%. By the way, the only CAD system know that uses muitcore is FreeCAD with OCCT with TBB (but an operation took longer than the others).

Greetings
user1234
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

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

Post by onekk »

The problem I think is Part Design.

I usually use scripting with Part and make some hole (maybe and array of 30x30) is not taking forever, the down side is that you have to script the model and use the Part Module only (I suspect that is more efficient as there no overloads, as it is the most direct way to use OCCT).

I've found some slow down in the past, but only with some complex solids, or if many boolean operation has to be applied, but recently I've tried to code something with 100 or more holes in a "plate" and the operation was executed in less than 1 minute, maybe 30 or 30 seconds, with a slow i3-2100 and 4GB of RAM.

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

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

Post by Shalmeneser »

You can easily draw all the holes in the same sketch with Sketcher_RectangularArray (more than 200 constraints).

I don't know if this method is better than PartDesign_MultiTransform.
Attachments
Corpus delicti 19.png
Corpus delicti 19.png (110.64 KiB) Viewed 680 times
user1234
Veteran
Posts: 3342
Joined: Mon Jul 11, 2016 5:08 pm

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

Post by user1234 »

Shalmeneser wrote: Tue Jun 15, 2021 5:30 pm You can easily draw all the holes in the same sketch with Sketcher_RectangularArray (more than 200 constraints).

I don't know if this method is better than PartDesign_MultiTransform.
That would kill the sketcher solver.

Here a example file with 2500 holes.
test28_array.FCStd
(978.37 KiB) Downloaded 21 times
Draft + Part : ~080 seconds
PartDesign: ~100 seconds


The 20 seconds difference are because PartDesign has no rectangle array, only a the multitransform tool, so there is a small internal extra step, while the draft array tool have a rectangle pattern as default. Before the PartDesign optimization that would took around 15min.

Greetings
user1234

edit: version

Code: Select all

OS: Debian GNU/Linux 11 (bullseye) (X-Cinnamon/lightdm-xsession)
Word size of FreeCAD: 64-bit
Version: 0.20.24783 (Git)
Build type: Debug
Branch: TopoNaming
Hash: 9e7f78ba3839050d5a7375bd7ce8dac49a49feaa
Python version: 3.9.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)
drmacro
Veteran
Posts: 8867
Joined: Sun Mar 02, 2014 4:35 pm

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

Post by drmacro »

Shalmeneser wrote: Tue Jun 15, 2021 5:30 pm You can easily draw all the holes in the same sketch with Sketcher_RectangularArray (more than 200 constraints).

I don't know if this method is better than PartDesign_MultiTransform.
It is worse, actually. :mrgreen:

More constraints will exponentially increase compute time.

The goal should ALWAYS be the most simple, fewest constraints (especially dimensional constraints) as possible.

Every constrain increases the dimensions of the solver and means additional DOF's to solve.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

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

Post by Shalmeneser »

test28_array has killed my computer twice. I cannot run it.

MultiTransform is intellectually more simple but for this number of hole, is it faster ?

Why Transformations need to 'recompute' each time ?
Some sketcher constraints are not easier to compute than others ?
user1234
Veteran
Posts: 3342
Joined: Mon Jul 11, 2016 5:08 pm

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

Post by user1234 »

Shalmeneser wrote: Tue Jun 15, 2021 7:22 pmtest28_array has killed my computer twice.
Works flawless here:

Code: Select all

OS: Debian GNU/Linux 11 (bullseye) (X-Cinnamon/lightdm-xsession)
Word size of FreeCAD: 64-bit
Version: 0.20.25057 (Git)
Build type: Release
Branch: master
Hash: 4a9963a03f2530ebe4c38d230a5471edfd7337cd
Python version: 3.9.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)
and here

Code: Select all

OS: Debian GNU/Linux 11 (bullseye) (X-Cinnamon/lightdm-xsession)
Word size of FreeCAD: 64-bit
Version: 0.20.24783 (Git)
Build type: Debug
Branch: TopoNaming
Hash: 9e7f78ba3839050d5a7375bd7ce8dac49a49feaa
Python version: 3.9.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)
Maybe you are out of RAM? FreeCAD uses here ~14.8GByte. Try it if the sketcher. I am pretty sure that will not work with the sketcher. With the amount of elements, the solver of the sketcher needs minimum quadratic of power.

Greetings
user1234
Post Reply