Page 1 of 1

Issue #4370. Bug: duplicated window object when using expression with wall width

Posted: Tue Jun 02, 2020 5:26 pm
by vocx
This is reported as issue #4370.

Code: Select all

OS: Ubuntu 18.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21375 (Git)
Build type: Unknown
Branch: master
Hash: 11f9c249e764b27c78afd9b0a0de5acb3f05f760
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
1. Click on Arch Wall, and create a wall 3 m, 3 m, and 0.2 m. The wall should be big enough to hold a standard window.
2. Click on Arch Window, Fixed, and place it on the wall.
3. In the tree view click on the Window, go to the property editor, choose "Hole Depth", and click on the rightmost "f(x)" symbol to set an expression (expressions).
4. The expression is just the Wall's width, so enter Wall.Width in the expression field, and click OK.
5. The Window will show the blue mark indicating the need for recomputing, so recompute, F5 (Std_Refresh).
6. The Wall doesn't show a blue mark. Nevertheless, right click on it on the tree view, and then choose "Recompute object".
7. The Window will appear a second time in the tree view. There will be two windows, and both will have the blue checkmark.
Also the following warning appears in the report view.

Code: Select all

856.501 Tree.cpp(293): [ComboView] duplicate child item Unnamed#Wall.Window
The two windows refer to the same Window object. Toggling the visibility (Space bar) turns both on and off. If you delete one, you delete both.

The issue here is the sort of circular dependency that exists between the Wall and the Window. The Window sets its width by looking at the Wall, and the Wall also looks at the Window. Maybe the error is in the Wall code, or somewhere in the tree view code in C++.

This was originally found here, Arch: window creates an extra hole in a different part of the wall in addition to the actual window.

Re: Bug: duplicated window object when using expression with wall width

Posted: Tue Jun 02, 2020 6:27 pm
by carlopav
Confirmed with current upstream master.

Re: Bug: duplicated window object when using expression with wall width

Posted: Wed Jun 03, 2020 3:20 pm
by yorik
Objects can appear many times in the tree view, that's normal.
But the recomputation indeed has something weird, I'll have a better look. In any case, the expression engine works with the dependency tree, so if there was a circular dependency, you'd see it in the dag view, so it's probably not the case

Re: Issue #4370. Bug: duplicated window object when using expression with wall width

Posted: Mon Mar 08, 2021 10:19 am
by Roy_043
It seems this has somehow been fixed. I can't reproduce with:

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24219 (Git)
Build type: Release
Branch: master
Hash: 8c26baebab320b8c1c3279bc8eb34a1eb6c7a363
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)

Re: Issue #4370. Bug: duplicated window object when using expression with wall width

Posted: Tue May 03, 2022 3:42 pm
by Kunda1
Bumping for testers (see issue #6074)

Re: Issue #4370. Bug: duplicated window object when using expression with wall width

Posted: Wed May 04, 2022 8:24 am
by Roy_043
I still can't reproduce. IMO the issue can be closed.
See https://github.com/FreeCAD/FreeCAD/issu ... 1117048810