Lots of calculated positions create calculation errors
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
- Build-0-Matic
- Posts: 54
- Joined: Fri Dec 20, 2019 9:31 pm
Lots of calculated positions create calculation errors
I've been working on a complex design that will need to be resized easily, so I used a lot of calculated values for size and position with a lot of references.
But I've come to a point where one calculated value will show a different value whether I'm in the labels and attributes view or in the formula editing view.
Worse, when an object gets a value from another object, that value is wrong.
So I'm wondering if there is a limit to the number of calculated fields possible? Or maybe I've uncovered a bug? Or maybe it's just the clumsy me who's missed something. The file is over 3mb so I can't post it here
I'm currently running Freecad 0.20.2 on Windows 10.
But I've come to a point where one calculated value will show a different value whether I'm in the labels and attributes view or in the formula editing view.
Worse, when an object gets a value from another object, that value is wrong.
So I'm wondering if there is a limit to the number of calculated fields possible? Or maybe I've uncovered a bug? Or maybe it's just the clumsy me who's missed something. The file is over 3mb so I can't post it here
I'm currently running Freecad 0.20.2 on Windows 10.
- Shalmeneser
- Veteran
- Posts: 9558
- Joined: Wed Dec 23, 2020 12:04 am
- Location: Fr
Re: Lots of calculated positions create calculation errors
Are you speaking of TechDraw wb ? TechDraw_RedrawPage
- Build-0-Matic
- Posts: 54
- Joined: Fri Dec 20, 2019 9:31 pm
Re: Lots of calculated positions create calculation errors
No, I forgot to mention that it's all done in the Part workbench...
Re: Lots of calculated positions create calculation errors
you mean that you have rounding errors?
this is imho a weakness of fc, how this is handled.
right now, fc/occt behaves like a cad-system from the 80's, just stacking floating point errors on top of each-other.
it would be great if this was attacked within fc, i.e. that there is an "as intended by user" heuristics for floating point errors (meaning that 1.0 is and stays 1.0 and not 0.9999999998 or whatever it becomes when floating point discrepancies are passed along without touching them). one brutal fix could be to enforce rounding on used geometry, but that will lead to other issues, so to end up with something useful, one has to carefully select when one intervenes on floating point errors.
not so easy to say what the medicine is/should be without an example of your issue.
by the sound of it, you are using expressions, if so you can round in expressions at strategic places, which might improve things.
this is imho a weakness of fc, how this is handled.
right now, fc/occt behaves like a cad-system from the 80's, just stacking floating point errors on top of each-other.
it would be great if this was attacked within fc, i.e. that there is an "as intended by user" heuristics for floating point errors (meaning that 1.0 is and stays 1.0 and not 0.9999999998 or whatever it becomes when floating point discrepancies are passed along without touching them). one brutal fix could be to enforce rounding on used geometry, but that will lead to other issues, so to end up with something useful, one has to carefully select when one intervenes on floating point errors.
not so easy to say what the medicine is/should be without an example of your issue.
by the sound of it, you are using expressions, if so you can round in expressions at strategic places, which might improve things.
Code: Select all
round(6.44 * 10) / 10 # for one decimal rounding in expressions
- Build-0-Matic
- Posts: 54
- Joined: Fri Dec 20, 2019 9:31 pm
Re: Lots of calculated positions create calculation errors
I think I might have hit an upper limit of some kind.
I have a calculated value that, in the formula entry field, shows a value of 30mm. When I accept the calculation, it shows me a value of 7mm.
And when I ask another part to just copy that value, once accepted it shows a value of 36mm... definitely not just a rounding error.
So far I've worked around it by making another document and stripping calculation fields from it. But that's not a solution as I now don't have everything linked together. So modifications will become painful.
I have a calculated value that, in the formula entry field, shows a value of 30mm. When I accept the calculation, it shows me a value of 7mm.
And when I ask another part to just copy that value, once accepted it shows a value of 36mm... definitely not just a rounding error.
So far I've worked around it by making another document and stripping calculation fields from it. But that's not a solution as I now don't have everything linked together. So modifications will become painful.
Re: Lots of calculated positions create calculation errors
That is very big errors. Can you share the document for us to investigate or even better try to create a minimized example file. Then we should be able to find the problem and fix it.
Also you can download and test development version 0.21. Maybe it is due to an already fixed bug.
Also you can download and test development version 0.21. Maybe it is due to an already fixed bug.
Re: Lots of calculated positions create calculation errors
@Build-0-Matic I believe it was fixed by https://github.com/FreeCAD/FreeCAD/pull/8311 so this week's 0.21 build will be worth testing for sure.
- Build-0-Matic
- Posts: 54
- Joined: Fri Dec 20, 2019 9:31 pm
Re: Lots of calculated positions create calculation errors
OK, Thanks!
I'll try this for sure.
I'll try this for sure.
Re: Lots of calculated positions create calculation errors
Please excuse for intruding into this thread.
What heda is stating may possibly be related to another matter, where it would be of interest.
My question is:
Are floating point errors - in relation to the accuracy of elements and their dependencies - 'able' to cause breakage of parts or malfunctioning in a model (in rare cases perhaps?)?
If yes, can one or both settings of 'Number of decimals' and 'Tesselation' have an influence on it?
The questions are of a layman though - but also the laymans mind needs relief..
Regards
Uli
Re: Lots of calculated positions create calculation errors
If it doesn't work, upload your file for further inspection.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.