App::Link: the big merge

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
wmayer
Site Admin
Posts: 16649
Joined: Thu Feb 19, 2009 10:32 am

Re: App::Link: the big merge

Postby wmayer » Mon Sep 02, 2019 11:24 am

In the German forum another critical bug has been reported: https://forum.freecadweb.org/viewtopic.php?f=13&t=39023

The steps to reproduce:
  • Switch to Part wb and create a document
  • Create a Part container and a box
  • Move the box inside the Part container
  • Start fillet or chamfer tool
  • In the 3d view select an edge of the box
FreeCAD freezes and starts to allocate more and more memory. The memory allocation happens because the selection's internal list "_SelList" grows and grows and starting from the 2nd element all entries are identical. For the first element only the x,y,z coordinates are different.

Looking at the call stack this is what happens:
DlgFilletEdges::onSelectionChanged reacts on the selection change and calls DlgFilletEdges::toggleCheckState. This calls Gui::Selection().addSelection() where object name is Box and sub-name e.g. Edge3.

Internally SelectionSingleton::checkSelection() fills up the passed reference of _SelObj and sets FeatName to "Part" and SubName to "Box.Edge3" and then it tries to find this entry in _SelList but cannot find it there because the passed pObjectName is still set to "Box".
realthunder
Posts: 1810
Joined: Tue Jan 03, 2017 10:55 am

Re: App::Link: the big merge

Postby realthunder » Mon Sep 02, 2019 1:21 pm

Zolko wrote:
Mon Sep 02, 2019 11:11 am
When I insert a link (App::Link), it has a Placement and a Link Placement property, which seem identical: when I modify one, the other is changed. What is the rationale behind it ? Testing with the lates AppImage 18009 on Linux:
They are internally synchronized. When 'LinkTransform' is set to true. The Link will hide its Placement property from the property editor. Instead, the editor will display the linked object's Placement in green font. In fact, any property showing green belongs to the linked object.

When 'LinkTransform' is false, the link display the 3D view object independent of its original placement. When it is true, it is synced to the linked object's placement. You can set additional placement (now accessible as the LinkPlacement property) as an offset. See the video demo below
link-transform.webm
Try Assembly3 (latest version 0.11) along 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
realthunder
Posts: 1810
Joined: Tue Jan 03, 2017 10:55 am

Re: App::Link: the big merge

Postby realthunder » Mon Sep 02, 2019 1:26 pm

wmayer wrote:
Mon Sep 02, 2019 11:24 am
In the German forum another critical bug has been reported: https://forum.freecadweb.org/viewtopic.php?f=13&t=39023
PR submitted here
Try Assembly3 (latest version 0.11) along 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
User avatar
Zolko
Posts: 1101
Joined: Mon Dec 17, 2018 10:02 am

Re: App::Link: the big merge

Postby Zolko » Mon Sep 02, 2019 4:49 pm

realthunder wrote:
Mon Sep 02, 2019 1:21 pm
Zolko wrote:
Mon Sep 02, 2019 11:11 am
When I insert a link (App::Link), it has a Placement and a Link Placement property, which seem identical: when I modify one, the other is changed. What is the rationale behind it ?
When 'LinkTransform' is false, the link display the 3D view object independent of its original placement. When it is true, it is synced to the linked object's placement. You can set additional placement (now accessible as the LinkPlacement property) as an offset. See the video demo below
I'm sorry, I don't understand. And I think you forgot to attach the demo video. You mean that if LinkTransform==False, then there are 2 successive Placements applied to it: Placement and LinkPlacement ? What is the use-case ?
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
realthunder
Posts: 1810
Joined: Tue Jan 03, 2017 10:55 am

Re: App::Link: the big merge

Postby realthunder » Mon Sep 02, 2019 10:30 pm

Zolko wrote:
Mon Sep 02, 2019 4:49 pm
I'm sorry, I don't understand. And I think you forgot to attach the demo video. You mean that if LinkTransform==False, then there are 2 successive Placements applied to it: Placement and LinkPlacement ? What is the use-case ?
Two sucessive placements, yes, but it is the Link's LinkPlacement (which can be considered as an alias to Link's Placement), and the linked object's Placement. Being able to track linked object's placement is very important in many use case, like the asm3 constraining element is a link that follows its target.
Attachments
link-transform.webm
(407.21 KiB) Downloaded 37 times
Try Assembly3 (latest version 0.11) along 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
User avatar
Zolko
Posts: 1101
Joined: Mon Dec 17, 2018 10:02 am

Re: App::Link: the big merge

Postby Zolko » Tue Sep 03, 2019 6:26 am

realthunder wrote:
Mon Sep 02, 2019 10:30 pm
Being able to track linked object's placement is very important in many use case, like the asm3 constraining element is a link that follows its target.
OK. I always think about App::Link as links between documents, not links inside the same document.

May I suggest that the boolean's name LinkTransform is not very self-explanatory ?
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
realthunder
Posts: 1810
Joined: Tue Jan 03, 2017 10:55 am

Re: App::Link: the big merge

Postby realthunder » Tue Sep 03, 2019 6:59 am

Zolko wrote:
Tue Sep 03, 2019 6:26 am
May I suggest that the boolean's name LinkTransform is not very self-explanatory ?
Yes, it is not the best choice. But changing the property name is not worth it IMO. Maybe some more explanatory tooltips. Normal user shouldn't need to change this property anyway. There are two Link creation buttons exposed now. The second button is meant to create a placement tracking link.
Try Assembly3 (latest version 0.11) along 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
Posts: 29039
Joined: Tue Mar 17, 2015 9:14 am

App::Link: the big merge: Reverting crashes FreeCAD

Postby chrisb » Tue Sep 03, 2019 7:10 am

Reverting of some models still crashes FreeCAD. Other models are ok.
- download the model attached to this post: https://forum.freecadweb.org/viewtopic. ... 34#p331325
- start FreeCAD
- open 0902-thick_cb.FCStd
- File->Revert
->Crash

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18009 (Git)
Build type: Release
Branch: master
Hash: 0641ca0d1e020d18f23d2adb49959195266f04f7
Python version: 3.7.3
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)
A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: App::Link: the big merge

Postby vocx » Tue Sep 03, 2019 11:39 pm

realthunder wrote:
Tue Sep 03, 2019 6:59 am
...
There are two Link creation buttons exposed now. The second button is meant to create a placement tracking link.
I created the Std LinkMake page in the wiki to start collecting information on how to use these tools.

The second button calls Std LinkMakeRelative but is still empty. If you already have user documentation on how to use these new tools, then we can start filling the pages in the wiki, and creating examples that everybody can reference.

There were also many icons added, I guess for further buttons or menu commands. They were added to the src/Gui/Icons section in Artwork.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
realthunder
Posts: 1810
Joined: Tue Jan 03, 2017 10:55 am

Re: App::Link: the big merge

Postby realthunder » Wed Sep 04, 2019 12:59 am

vocx wrote:
Tue Sep 03, 2019 11:39 pm
The second button calls Std LinkMakeRelative but is still empty. If you already have user documentation on how to use these new tools, then we can start filling the pages in the wiki, and creating examples that everybody can reference.
I have a recent adjustment of this button function. I'll put more details when I submit the PR.
There were also many icons added, I guess for further buttons or menu commands. They were added to the src/Gui/Icons section in Artwork.
I'll add details for that too.
Try Assembly3 (latest version 0.11) along 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