Performance improvements for PartDesign patterns (PR)

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!
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Performance improvements for PartDesign patterns (PR)

Post by freedman »

davidosterberg , could this option be considered an array option, meaning that for reliable operation all features will need to be the same. That might mitigate the Topo-naming issue.
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: Performance improvements for PartDesign patterns (PR)

Post by davidosterberg »

davidosterberg wrote: Tue Feb 23, 2021 3:52 pm As mentioned in the OP, topological naming issues is a risk with this PR, since it is changing things around under the hood. I did some testing with recomputing a Topo-sensitive test model created with master. Indeed this is a real issue. That I don't know how to manage best.

1) We could ignore the problem and say that FreeCAD has no guarantees with respect to topological naming.
-alex- wrote: Wed Feb 24, 2021 9:35 am - hypothesis nb1: realthunder's toponaming algorythm will be merge in FC0.20
- hypothesis nb2: toponaming algo will fix any issue related to your PR as topologie is concerned
I almost wrote this hypothesis myself when I considered option 1. I didn't mention it because I don't know how the @realthunder TNP-solution would react to to naming just changing by itself like this.
realthunder wrote: :bell:
@realthunder, what do you think?

Could you test the behaviour of your PR with Linkstage3 branch of @realthunder?
It is interesting. I might give it a shot.
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: Performance improvements for PartDesign patterns (PR)

Post by davidosterberg »

freedman wrote: Wed Feb 24, 2021 8:36 pm davidosterberg , could this option be considered an array option, meaning that for reliable operation all features will need to be the same. That might mitigate the Topo-naming issue.
Hmm, I don't think I understand. Sorry. :?
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Performance improvements for PartDesign patterns (PR)

Post by realthunder »

davidosterberg wrote: Thu Feb 25, 2021 7:17 am @realthunder, what do you think?
Looks like your PR here might conflict with what I have implemented in my branch. There are some significant overall changes with PartDesign in my branch. It allows for multiple solids, so there is no need to check for pattern touching base at all. In other word, I have already changed it to behavior like draft array, that is, fuse all instances in one go. In case you do want to selectively exclude some instance (not necessarily based on whether it touches the base or not), there is a way to achieve that. When you create the pattern as a new solid as shown in the linked post, it will produce a compound instead of fuse further improving performance.

As for topo naming issue, my topo naming framework will add some prefix to distinguish each instance of the pattern. So it won't be of much a problem there, although it does have some performance impact on large patterns.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: Performance improvements for PartDesign patterns (PR)

Post by davidosterberg »

realthunder wrote: Thu Feb 25, 2021 9:43 am Looks like your PR here might conflict with what I have implemented in my branch. There are some significant overall changes with PartDesign in my branch. It allows for multiple solids, so there is no need to check for pattern touching base at all. In other word, I have already changed it to behavior like draft array, that is, fuse all instances in one go. In case you do want to selectively exclude some instance (not necessarily based on whether it touches the base or not), there is a way to achieve that. When you create the pattern as a new solid as shown in the linked post, it will produce a compound instead of fuse further improving performance.
Good to know. This PR is actually removing the check for if the pattern touch the base (for performance reasons). It is all about improving performance within the existing framework. It can therefore be merged now, so that the community can enjoy the performance boost. It sounds like your changes, including the skipping code, can be applied later. Also see my Draft array skipping PR (#4430) for my proposal for a syntax for skipping copies in patterns. Again within the existing framework. Perhaps the same syntax can be supported in the PartDesign Transformed class.

Regarding the multiple solids in one body, I am not sure if that has been properly discussed yet. I can certainly see the practical advantage of this. But it also goes against the name "Body" and "PartDesign", words that are singular. It is a part of the quest to making PartDesign self sufficient. I see that you also give PartDesign support for a CSG workflow. Again in the same spirit. A quest that I can sympathize with. I was even more in this camp a few month ago, when I was more a beginner. Now it does not bother me so much that I have to switch to Draft for some operations. What bothers me a bit, is that the division of responsibility for the different workbenches is blurred.
As for topo naming issue, my topo naming framework will add some prefix to distinguish each instance of the pattern. So it won't be of much a problem there, although it does have some performance impact on large patterns.
Excellent. No need to deal with this in this PR then.
Last edited by davidosterberg on Thu Feb 25, 2021 12:58 pm, edited 2 times in total.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Performance improvements for PartDesign patterns (PR)

Post by Jee-Bee »

Large patterns (for example a die cut plate) are i think for every CAD software hard.
In most compays i worked the create 2 configurations of a part one for part with all holes for the part drawing and one (default) with a simplified small pattern just for graphical purposes.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Performance improvements for PartDesign patterns (PR)

Post by realthunder »

davidosterberg wrote: Thu Feb 25, 2021 10:37 am Also see my Draft array skipping PR (#4430) for how my proposal is for a syntax for skipping copies in patterns. Perhaps the same syntax can be supported in the PartDesign Transformed class.
The upstream Draft link array actually can skip instance. Simply set the array property 'ExpandArray' to true, and each element will be exposed as child objects grouped under the array. Hide any child you don't want. And that's it. You can optionally collapse the array again by reverting 'ExpandArray'.

davidosterberg wrote: Thu Feb 25, 2021 10:37 am Regarding the multiple solids in one body, I am not sure if that has been properly discussed yet. I can certainly see the practical advantage of this. But it also goes against the name "Body" and "PartDesign", words that are singular. It is a part of the quest to making PartDesign self sufficient. A quest that I can sympathize with. I was even more in this camp a few month ago, when I was more a beginner. Now it does not bother me so much that I have to switch to Draft for some operations.
Well, naming is certainly not a strength of FreeCAD. Comparing to most other CAD software, FreeCAD Body is more of a Part, while the multi-solid support I am aiming for is kinda equivalent to multi-body in other CAD.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Performance improvements for PartDesign patterns (PR)

Post by chrisb »

I have split this topic, follow-up is here: https://forum.freecadweb.org/viewtopic.php?f=8&t=56055 .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
davidosterberg
Posts: 529
Joined: Fri Sep 18, 2020 5:40 pm

Re: Performance improvements for PartDesign patterns (PR)

Post by davidosterberg »

I fixed the preview logic. It is now working as before. However, the pattern still accepts this as a successful transform. Unlike the old behavior that threw an error.
Attachments
new_behavior.png
new_behavior.png (64.36 KiB) Viewed 2611 times
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Performance improvements for PartDesign patterns (PR)

Post by chrisb »

The skipping was already possible before, it was only the dialog which prevented it. With a change later in the properties what you show could be achieved without throwing an error. The new behaviour was several times asked for.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply