Arbitrary dimension in FreeCAD GitHub Dev 24212

Discussions about the development of the TechDraw workbench
Giovanni Bianchessi
Posts: 15
Joined: Fri Aug 16, 2019 8:16 pm

Arbitrary dimension in FreeCAD GitHub Dev 24212

Postby Giovanni Bianchessi » Sun Feb 21, 2021 8:52 pm

Today I installed FreeCAD 24212 and I am experiencing a problem with Arbitrary dimensioning.

I loaded a drawing made with a previous GitHub version and an arbitrary dimension already placed in a perspective view appears wrong and the message "Warning - no numeric format in formatSpec 580,0 - Dimension020" shows up.

I have tried to replace the correct number without success.
It seems that the "Arbitrary" attribute is always considered as "true" even if visually, in the list, it changes.

I am using MacOS X 10.15.7 Catalina

Regards
Giovanni Bianchessi
aapo
Posts: 365
Joined: Mon Oct 29, 2018 6:41 pm

Re: Arbitrary dimension in FreeCAD GitHub Dev 24212

Postby aapo » Mon Feb 22, 2021 9:45 am

Giovanni Bianchessi wrote:
Sun Feb 21, 2021 8:52 pm
I loaded a drawing made with a previous GitHub version and an arbitrary dimension already placed in a perspective view appears wrong and the message "Warning - no numeric format in formatSpec 580,0 - Dimension020" shows up.
The error message indicates that TechDraw is trying to use a Format Specifier, which means that you have defined an arbitrary value ("580,0"?), but have not set "Arbitrary=true" for the dimension.

I have tried to replace the correct number without success.
It seems that the "Arbitrary" attribute is always considered as "true" even if visually, in the list, it changes.
Vice versa; the error message indicates that the dimension is considered to not have arbitrary numeric format, i.e. the program believes that "Arbitrary=false", and thus expects a format specifier like "%g". If you've set an arbitrary value, e.g. "580,0", you should set "Arbitrary=true". Is this the case?
Giovanni Bianchessi
Posts: 15
Joined: Fri Aug 16, 2019 8:16 pm

Re: Arbitrary dimension in FreeCAD GitHub Dev 24212

Postby Giovanni Bianchessi » Mon Feb 22, 2021 6:03 pm

aapo wrote:
Mon Feb 22, 2021 9:45 am
If you've set an arbitrary value, e.g. "580,0", you should set "Arbitrary=true". Is this the case?
That's the case. And that the case was too, since I've made the drawing previously and the "Arbitrary" argument was set previously as True.
Using the previous version of FreeCAD the dimension appeared correctly.

Now, Arbitrary set as True, I can't place an arbitrary number as dimension. And the error shows up.

Regards
Giovanni
aapo
Posts: 365
Joined: Mon Oct 29, 2018 6:41 pm

Re: Arbitrary dimension in FreeCAD GitHub Dev 24212

Postby aapo » Tue Feb 23, 2021 8:02 am

Giovanni Bianchessi wrote:
Mon Feb 22, 2021 6:03 pm
Now, Arbitrary set as True, I can't place an arbitrary number as dimension. And the error shows up.
That definitely sounds like a bug, but the interesting thing is that used to work about a week or so ago. So, this is a new bug introduced very recently. If you set the dimension Format Spec to "580,0" and "Arbitrary=true", I can confirm that the Arbitrary property has no effect at all with FC v0.19.24212. Thanks for reporting!



OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24212 (Git)
Build type: Release
Branch: master
Hash: 3d227cf7179c00e57f2733f947b4b1b0368d219a
Python version: 3.8.8
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)
david-fairbanks42
Posts: 1
Joined: Tue Feb 23, 2021 12:09 pm

Re: Arbitrary dimension in FreeCAD GitHub Dev 24212

Postby david-fairbanks42 » Tue Feb 23, 2021 12:15 pm

I'm on 0.19.24181 (Arch linux) and have experience the same issue. Looking through the code there's a hack fix for this. Set the Equal Tolerance to False and Arbitrary to True, then it will behave as it should.

Looking through the latest commits, I believe this issue is already fixed just not released yet.

OS: Arch Linux (i3/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24181 (Git)
Build type: Release
Branch: master
Hash: 57a6c18e2f8bc3c5c489d42cb4705005c3cb00e9
Python version: 3.9.1
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)
David
Web App Developer | Machinist | Carpenter
aapo
Posts: 365
Joined: Mon Oct 29, 2018 6:41 pm

Re: Arbitrary dimension in FreeCAD GitHub Dev 24212

Postby aapo » Tue Feb 23, 2021 12:22 pm

Giovanni Bianchessi wrote:
Mon Feb 22, 2021 6:03 pm
Now, Arbitrary set as True, I can't place an arbitrary number as dimension. And the error shows up.
I think I found the bug, it's indeed in a new code introduced in DrawViewDimension.cpp, lines 929-930. The code there tells me that there should luckily be a workaround: Select both "Arbitrary=true" and "Equal Tolerance=false" above in the Base properties for the affected dimensions. That should return the old behavior.

That said, I think it's a bug that selecting Arbitrary dimension label is not respected, if there is also a (default) setting "Equal Tolerance=true". This should probably be fixed for v0.19, I'll try to do a PR today evening. Thanks again for reporting!
aapo
Posts: 365
Joined: Mon Oct 29, 2018 6:41 pm

Re: Arbitrary dimension in FreeCAD GitHub Dev 24212

Postby aapo » Tue Feb 23, 2021 5:18 pm

david-fairbanks42 wrote:
Tue Feb 23, 2021 12:15 pm
I'm on 0.19.24181 (Arch linux) and have experience the same issue. Looking through the code there's a hack fix for this. Set the Equal Tolerance to False and Arbitrary to True, then it will behave as it should.
Sorry I did not see your comment earlier, we were writing the same thing at the same time! :lol:

Looking through the latest commits, I believe this issue is already fixed just not released yet.
That's not entirely true, the fix I made in January only seems to fix the bug if the Dimension has tolerance value(s) or Equal Tolerance is false. According to git log src/Mod/TechDraw/App/DrawViewDimension.cpp I've tried to fix this bug and some others in January 29 with commit e802179cf4272c9a89d1711fc796981d2a077c71, and that has also supposedly been the last day that the file has been edited. However, there's still indeed one aspect of the bug left in the current master that I've overlooked when fixing it, and it is documented in the first post in this thread. The bug can be activated by setting (1) Equal Tolerance = true (2) Over Tolerance = 0.00 (3) Under Tolerance = 0.00 (4) Arbitrary = true for any dimension. Then, a number is shown instead of the Arbitrary dimension.



OS: Debian GNU/Linux bullseye/sid (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24237 (Git)
Build type: Release
Branch: master
Hash: 9b31018b2e541cb27435328aec494d956ef38c87
Python version: 3.9.1+
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.0
Locale: English/United States (en_US)
aapo
Posts: 365
Joined: Mon Oct 29, 2018 6:41 pm

Re: Arbitrary dimension in FreeCAD GitHub Dev 24212

Postby aapo » Tue Feb 23, 2021 5:39 pm

Here is a very small PR to fix this regression: https://github.com/FreeCAD/FreeCAD/pull/4516. It would be important to get this to v0.19, would that still be possible, wmayer?
wmayer wrote: pinged by pinger macro
Giovanni Bianchessi
Posts: 15
Joined: Fri Aug 16, 2019 8:16 pm

Re: Arbitrary dimension in FreeCAD GitHub Dev 24212

Postby Giovanni Bianchessi » Tue Feb 23, 2021 5:57 pm

aapo wrote:
Tue Feb 23, 2021 12:22 pm
Select both "Arbitrary=true" and "Equal Tolerance=false" above in the Base properties for the affected dimensions. That should return the old behavior.
...and clearing tolerances format fields, it works as before.
Thank you.

Regards
Giovanni
wmayer
Site Admin
Posts: 17056
Joined: Thu Feb 19, 2009 10:32 am

Re: Arbitrary dimension in FreeCAD GitHub Dev 24212

Postby wmayer » Thu Feb 25, 2021 9:20 am

aapo wrote:
Tue Feb 23, 2021 5:39 pm
Here is a very small PR to fix this regression: https://github.com/FreeCAD/FreeCAD/pull/4516. It would be important to get this to v0.19, would that still be possible, wmayer?
Sure, bug fixes are always possible.