Bug? Expression Engine update Inconsistent Figures?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Bug? Expression Engine update Inconsistent Figures?

Post by paullee »

Hi, just notice a strange phenomenon...

Using expression to link objects - in example attached - object's placement e.g. Axes.Placement.Rotation.Axis.x linking the Section Plane to Axis. So far so good.

But when I click the property field with the expressions inside, the figures in these fields returned something slightly difference each time :!:
So the section plane slightly shift, shake.... :?:

In the Axis-xyz fields, it originally read -0.6, or Axis field read -0.58,-0.58,-0.58.

Clicking them, it sometime return -0.57 for 1 field or another ... then the section plane shake!

Missing something?

phpBB [video]


Screenshot from 2018-04-21 16-45-42.png
Screenshot from 2018-04-21 16-45-42.png (165.92 KiB) Viewed 1189 times
Screenshot from 2018-04-21 16-46-14.png
Screenshot from 2018-04-21 16-46-14.png (173.94 KiB) Viewed 1189 times
Screenshot from 2018-04-21 16-48-02.png
Screenshot from 2018-04-21 16-48-02.png (206.92 KiB) Viewed 1189 times

0.17.13509 (Git) AppImage on Fedora 27

(OCC 7.1.0)

OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13509 (Git)
Build type: None
Branch: master
Hash: 0258808ccb6ba3bd5ea9312f79cd023f1a8671b7
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/HongKong (en_HK)
Attachments
Test_ ExpressionEngine_ Inconsistent Updating.fcstd
(4.61 KiB) Downloaded 24 times
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Bug? Expression Engine update Inconsistent Figures?

Post by DeepSOIC »

Hi!
I have my number of decimals up by quite a bit than default, and I don't experience the issue. Seems to be rounding getting in the way somehow.
placement-expression-no-problem.png
placement-expression-no-problem.png (105.25 KiB) Viewed 1176 times
OS: Windows 8
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13509 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 0258808ccb6ba3bd5ea9312f79cd023f1a8671b7
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Russian/RussianFederation (ru_RU)
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Bug? Expression Engine update Inconsistent Figures?

Post by paullee »

Thanks, it seem to be the crux of problem :!:

Previously set the unit decimal place to 0.1mm (much more than enough for Architecture in fact), now set to some 12 places seem solve the problem.


But, this should be a Bug - the internal calculation should not be affected - I thought the decimal place setting is sort of 'presentation' :?:
Maybe other problems I had run into related to this...


Anybody can look into this?

Thanks again.

Screenshot from 2018-04-22 00-09-56.png
Screenshot from 2018-04-22 00-09-56.png (186.75 KiB) Viewed 1159 times
Screenshot from 2018-04-22 00-11-20.png
Screenshot from 2018-04-22 00-11-20.png (168.62 KiB) Viewed 1159 times
chrisb
Veteran
Posts: 54177
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug? Expression Engine update Inconsistent Figures?

Post by chrisb »

You should have changed the units instead of the precision. I haven't thought about this before, but as soon as angles come into play, it's not enough to have only 1 decimal.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Bug? Expression Engine update Inconsistent Figures?

Post by paullee »

chrisb wrote: Sat Apr 21, 2018 4:39 pm You should have changed the units instead of the precision. I haven't thought about this before, but as soon as angles come into play, it's not enough to have only 1 decimal.
Thanks.

I have been using mm, with 1 decimal place, which is far more than enough for building or interior design works. Architecture / I.D. usually works with mm / cm (or inch or imperial system). Not quite handy, if use m with 3 decimal place, say 0.008m to represent thickness of plywood instead of 8mm :!:

Now I set precision to say 12 decimal place, it also sound ridiculous but solve the problem to read 8.000000000000000mm plywood.


But yes then I know when that 0.1 precision come into play on other scenario, rotation e.g., which is sometime radian, it means 1 or 2 degree.


I think this is a problem / bug - as I said, I thought the 'precision' setting is a representation only.
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Bug? Expression Engine update Inconsistent Figures?

Post by paullee »

BTW, I remember I still get reading of a vertex of e.g. ArchWall / Underlying Sketch as something 98.33223525235235215135mm - even I think I had long time no changing (not realizing the 'importance') of the decimal place from that 1 decimal place setting.

So it seem the setting is not consistently having 'effect' on different places?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Bug? Expression Engine update Inconsistent Figures?

Post by DeepSOIC »

A better implementation could be to set number of meaningful digits, rather than number of digits after decimal point. Then it would say "8.0000 mm" for thickness and "10000 mm" for length without any problem. It has already been reported, that setting Clone's scale to 1:1000 is impossible with standard unit preferences.

In the end, even though it should be only a display thing, nailing it in every possible number editing field can be a big coding effort. So my preferred solution (as user) is still to set a fair bit of extra precision, just to be safe.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Bug? Expression Engine update Inconsistent Figures?

Post by ulrich1a »

paullee wrote: Sat Apr 21, 2018 5:00 pm I think this is a problem / bug - as I said, I thought the 'precision' setting is a representation only.
I consider it also a bug. In some places it is not possible to set accurate numbers from the Gui. Consider the case, that you want to have the length of a cube pi mm = 3.141592653589793 mm.
FreeCAD knows pi, so one can type in PartDesign pi mm for the length in the Gui-dialog for an additive cube. You end with a length set to 3.14 mm, because the Gui dialog cuts independent of a setting the calculated length after two digits after the decimal point.

Trying to set it in the property editor yields 3,141590000000 mm.
Using python to set it, yields 3,141592653590 mm. This stays until the property is touched, than is it again 3,141590000000 mm.
Measuring the part delivers 3.141592741013 mm. This seems to be caused by the internal accuracy of the cad-kernel and is expected.
After touching the number its 3.14159011... mm.
A problem is touching the property in the Gui, which feeds back the rounding to the part.

Ulrich
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Bug? Expression Engine update Inconsistent Figures?

Post by paullee »

DeepSOIC wrote: Sat Apr 21, 2018 5:32 pm A better implementation could be to set number of meaningful digits, rather than number of digits after decimal point. Then it would say "8.0000 mm" for thickness and "10000 mm" for length without any problem. It has already been reported, that setting Clone's scale to 1:1000 is impossible with standard unit preferences.
Thought for a while …

For use related to geographical matter, GeoData, Civil EngIneering, Arch Site related where one might need to have actual world coordinates (hugh difference in US or in Europe), but still precision of model may still be in mm or +-10mm … not sure how it could works.

BTW, currently setting to 12 decimal place have impact on performance?
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Bug? Expression Engine update Inconsistent Figures?

Post by paullee »

National Geograhic Society indicate circumference of the earth is 40,075 km

i,e. 40,075,000,000 mm?

11 digits
Post Reply