Geometry / Placement Accuracy

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

Geometry / Placement Accuracy

Post by paullee »

Not sure which forum to put this into is more proper:

Annoyed by reading of x,y,z coordinate seem not accurate for a while, e.g.

Vertexes below should be digital (x.000000mm) as modelled. But readings seem not digital, have readings like ...4.999995117m, 40.000004m. Any idea where have I make some mistake or inherent design of FC ? :)

Thanks !

  1. Image 1 - Have a few Sketches at different placement aligned to X plane, Y planes ...
  2. Image 2 - ArchSketch.Vertex2 = 55m, 5m, 0m (Bottom dashed line Sketch)
  3. Image 3 - ArchSketch001.Vertex3 = 55m, 4.999995117m, 40.000004m (Front White Upright Sketch)
  4. Image 4 - ArchSketch002.Vertex1 = 55m, 5.000000000m, 40.000000m (Right Red Upright Sketch)
  5. Image 5 - ArchSketch002.Vertex2 = 55m, 45.000000m, 45.000000m (Right Red Upright Sketch)
  6. Image 6 - ArchSketch003.Vertex1 = 55m, 4.999996m, 45.000004m (Behind Blue Upright Sketch)
  7. Image 7 - Surface formed by selected (seem vertexes not connected) edges
Test_ ArchSketch_ 48_ Placement-Accuracy.FCStd
(44.85 KiB) Downloaded 18 times
Screenshot from 2022-01-21 01-56-06.png
Screenshot from 2022-01-21 01-56-06.png (171.71 KiB) Viewed 1326 times
Screenshot from 2022-01-21 01-59-22.png
Screenshot from 2022-01-21 01-59-22.png (194.14 KiB) Viewed 1326 times
Screenshot from 2022-01-21 01-57-47.png
Screenshot from 2022-01-21 01-57-47.png (197.92 KiB) Viewed 1326 times
Screenshot from 2022-01-21 02-12-31.png
Screenshot from 2022-01-21 02-12-31.png (190.94 KiB) Viewed 1326 times
Screenshot from 2022-01-21 02-12-42.png
Screenshot from 2022-01-21 02-12-42.png (191.96 KiB) Viewed 1326 times
Screenshot from 2022-01-21 01-58-02.png
Screenshot from 2022-01-21 01-58-02.png (196.99 KiB) Viewed 1326 times
Screenshot from 2022-01-21 01-58-27.png
Screenshot from 2022-01-21 01-58-27.png (192.33 KiB) Viewed 1326 times
OS: Fedora 34 (Workstation Edition) (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.20.26720 (Git)
Build type: Release
Branch: (HEAD detached at 7bca26e)
Hash: 7bca26e7c14d4d43374ff7e0c8582735b249cbfd
Python version: 3.9.9
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: English/United States (en_US)
User avatar
onekk
Veteran
Posts: 6094
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Geometry / Placement Accuracy

Post by onekk »

the usual problem of ieee floating point accuracy, it depends from the fact that the conversion between binary and decimal could not match some values.

The fact that a decimal number is transformed in binary, usually with a representation made dividing the number in two part mantissa and exponent with a 64 or 128 bit representation depending in the system.

number like 1.234334 e-17 or 1.234334 e14 should gave you an idea.

plus some routine that calculate number are based on approximating the result using maybe series or other things.

You will find that there is an precision around 1 e-7 if I remember well that is the standard epsilon to check for equality in many FreeCAD routine.

Short answer is "how this precision will affect results"

if you a fractional digit with a mismatch around the 10 decimal you have a 0.00000001 precision (Hoping to have written all the 0 correctly).

this mean 1 over 10 000 000 000.

consider that if you use meters as unit the absolute number must me compared with the unit used.

But this risk to be OT and probably Inhave already bothered you.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
Roy_043
Veteran
Posts: 8409
Joined: Thu Dec 27, 2018 12:28 pm

Re: Geometry / Placement Accuracy

Post by Roy_043 »

The actual points are accurate (within floating point margins):

Code: Select all

>>> sk1 = App.ActiveDocument.ArchSketch001
>>> sk1.Shape.Vertexes[2].Point
Vector (55000.000000000015, 4999.999999999989, 40000.00000000001)
>>> sk3 = App.ActiveDocument.ArchSketch003
>>> sk3.Shape.Vertexes[0].Point
Vector (55000.0, 44999.99999999999, 45000.00000000001)
I assume that the point displayed in the status bar is derived from the coarser rendering.
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

Re: Geometry / Placement Accuracy

Post by paullee »

Many thanks all ! :D

It remind me of a few things and there seems to 2 issues involved :-
  1. It seems to be something about precision rather than accuracy on one hand. In earlier discussion about Arch/BIM and Trail WB usecases, some discussion about 'double precision floating point' is not yet available in FC that limit some of the usescases ?
  2. Then, the reading in status bar is something related to GUI / rendering rather than actual geometry - so it is something at least inconsistent (if not a bug?)
User avatar
onekk
Veteran
Posts: 6094
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Geometry / Placement Accuracy

Post by onekk »

Probably not measured from the rendering, but a different display precision as GUI has different routines.

Maybe waiting for some other answers or if no one answers trying to poke sone developers for an explanation, here maybe @yorik will be the most autoritathive person to ask.

I've not investigated but I think that what is sown in GUI is different, maybe using a Macro like SimpleMeasure or FCInfo that display information abiut selected edges will solve the doubt. Sorry but I'm on mobile so SimpleMeasure is nit exact name it is an OpenBrain Macro)

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

Re: Geometry / Placement Accuracy

Post by paullee »

Thanks again !
paullee
Veteran
Posts: 5092
Joined: Wed May 04, 2016 3:58 pm

Re: Geometry / Placement Accuracy

Post by paullee »

abdullah wrote: Ping
Would @abdullah shed some light when there is a gap if this is something about Sketch ? Thanks :)
Post Reply