Thanks for looking into this issue, questions about slow array speed have come up hundreds of times. Can't wait to try it.davidosterberg
Performance improvements for PartDesign patterns (PR)
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Performance improvements for PartDesign patterns (PR)
-
- Posts: 529
- Joined: Fri Sep 18, 2020 5:40 pm
Re: Performance improvements for PartDesign patterns (PR)
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.
2) We could keep the old method, and introduce a new Boolean property for Legacy compatibility. Old models would open and default to Legacy=True, and new models would default to Legacy=False. (Edit: is this even possible?)
After having written this down, I would say that option 2 is my favorite. But maybe there are other possibilities that were not mentioned. Is there any precedence for what to name the "Legacy" property?
In below model, there are some fillets that are applied on the result of the MultiTransform. You can see how one fillet on a hole edge jumps to another edge when I recompute the model.
1) We could ignore the problem and say that FreeCAD has no guarantees with respect to topological naming.
2) We could keep the old method, and introduce a new Boolean property for Legacy compatibility. Old models would open and default to Legacy=True, and new models would default to Legacy=False. (Edit: is this even possible?)
After having written this down, I would say that option 2 is my favorite. But maybe there are other possibilities that were not mentioned. Is there any precedence for what to name the "Legacy" property?
In below model, there are some fillets that are applied on the result of the MultiTransform. You can see how one fillet on a hole edge jumps to another edge when I recompute the model.
Last edited by davidosterberg on Tue Feb 23, 2021 5:59 pm, edited 4 times in total.
Re: Performance improvements for PartDesign patterns (PR)
I don't really see from the screencast what you have changed. If I understand it right, then it is not the pattern itself which has troubles with the topological naming, but rather further steps after it, which use generated geometry. In that case I'm for option 2 too.
Isn't the legacy property the same as the Overlap mode from above?
Isn't the legacy property the same as the Overlap mode from above?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Posts: 529
- Joined: Fri Sep 18, 2020 5:40 pm
Re: Performance improvements for PartDesign patterns (PR)
chrisb wrote: ↑Tue Feb 23, 2021 4:12 pm I don't really see from the screencast what you have changed. If I understand it right, then it is not the pattern itself which has troubles with the topological naming, but rather further steps after it, which use generated geometry. In that case I'm for option 2 too.
Isn't the legacy property the same as the Overlap mode from above?
There are just some fillets applied further down the tree. You can see how one fillet on a hole edge jumps to another edge when I recompute the model. Overlap mode is still 3x faster than Legacy mode.
Re: Performance improvements for PartDesign patterns (PR)
I saw the fillets, I just wondered what the Rename would do.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Posts: 529
- Joined: Fri Sep 18, 2020 5:40 pm
Re: Performance improvements for PartDesign patterns (PR)
Well this sounded good in principle. But now when I try to implement it I figure out that I dont really know how to achieve this effect. Anybody know if it is possible?davidosterberg wrote: ↑Tue Feb 23, 2021 3:52 pm 2) We could keep the old method, and introduce a new Boolean property for Legacy compatibility. Old models would open and default to Legacy=True, and new models would default to Legacy=False.
Re: Performance improvements for PartDesign patterns (PR)
With a new OCC version there is quite some probability that old models will break with toponaming issues. This was discussed some time ago here iin the forum. Perhaps we should simply accept that some models need some rework.
And it would keep the code clean .
And it would keep the code clean .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Performance improvements for PartDesign patterns (PR)
May i have a question.
If i have a object and i add a extrude on it, then then exacly the same on with a shift less then the first one.
Is the pad also checking for intersection?
If the answer is no why does pattern have? I would say the only thing the pattern does is creating a loop with the selected features over and over again?
If yes there a measurable difference?
If i have a object and i add a extrude on it, then then exacly the same on with a shift less then the first one.
Is the pad also checking for intersection?
If the answer is no why does pattern have? I would say the only thing the pattern does is creating a loop with the selected features over and over again?
If yes there a measurable difference?
-
- Posts: 529
- Joined: Fri Sep 18, 2020 5:40 pm
Re: Performance improvements for PartDesign patterns (PR)
Your description is accurate for what the pattern features do currently. Unfortunately it is too slow to be useful if there are many copies. This is because each fuse operation is more costly than the previous, because the base object is getting more and more faces for every copy that is sequentially fused to it. And the OCC fuse operation has to start from scratch each time.
The new code does it faster by detecting if there is overlap between what is added/removed. If there is no overlap all the copies are made into a compound object (very fast) that is cut/fused with the base object in one operation. If there is overlap between the copies then the copies are fused first (in one operation) and then cut/fused to the base (one operation). This way we get the needed speedup.
I hope it helps.
Re: Performance improvements for PartDesign patterns (PR)
Hi David and thank you for recent enhancements in PD!
- hypothesis nb2: toponaming algo will fix any issue related to your PR as topologie is concerned
Could you test the behaviour of your PR with Linkstage3 branch of @realthunder?
Just my 2 cts. Does it make sens in your opinion?
- hypothesis nb1: realthunder's toponaming algorythm will be merge in FC0.20davidosterberg 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.
- hypothesis nb2: toponaming algo will fix any issue related to your PR as topologie is concerned
If both above hypothesis were correct, I would say we could ignore the problem and say that FreeCAD has a reliable guarantee with respect to toponaming1) We could ignore the problem and say that FreeCAD has no guarantees with respect to topological naming.
2) We could keep the old method, and introduce a new Boolean property for Legacy compatibility. Old models would open and default to Legacy=True, and new models would default to Legacy=False. (Edit: is this even possible?)
Could you test the behaviour of your PR with Linkstage3 branch of @realthunder?
Just my 2 cts. Does it make sens in your opinion?