unwanted rounding for subtractive cylinder

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!
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: unwanted rounding for subtractive cylinder

Post by openBrain »

meme2704 wrote: Mon Feb 18, 2019 4:09 pm I have just taken the procedure to zero:
I open your file, I measure your hole, = 0.53mm, including in techdraw
I modify your hole to 0.525mm I measure it (by the two techniques) = 0.525mm, I save, I reopen, I measure = 0.53mm, Damned :mrgreen:
I modify "Preferences" to 4 decimals places, I close Fc, I restart Fc, I redo all the tralala, and .... (roll of drums) .... the hole is to remain at 0.5250mm ...... youpie :lol: :lol:
it should be written on Fc's pediment:
:!: "DO NOT FORGET TO CLOSE Fc FOR CHANGES OF PREFERENCE TO BE TAKEN INTO ACCOUNT" :!:
This workaround doesn't fix here. What does happen if you double-click the function and just validate by clicking "OK" in the Tasks tab ? Here it is rounded (to 0.530 mm, so keeping 3 decimals). ;)
User avatar
meme2704
Veteran
Posts: 2926
Joined: Sat Apr 01, 2017 2:47 pm
Location: Vosges

Re: unwanted rounding for subtractive cylinder

Post by meme2704 »

I do not understand what you call a workaround
if you do not modify "Preferance", close, reopen, it will remain to 2 decimal rounded
I put 4 decimals, to check that it would put well 0.5250 and would save it, but indeed, 3 are enough if you do not fall below the micrometers
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: unwanted rounding for subtractive cylinder

Post by chrisb »

I cannot confirm meme's fix either. Using the dialog the values are always rounded to 2 decimals. It is even worse: this error exists for subtractive and additive primitives, tested for cylinder and cube.

Any other places before we create a bug report?

OS: Ubuntu 16.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15860 (Git)
Build type: Release
Branch: master
Hash: 3b708c7f84b0425076b520e1d95627b20fd75fe0
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: unwanted rounding for subtractive cylinder

Post by chrisb »

The issue existed already in 0.17.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
meme2704
Veteran
Posts: 2926
Joined: Sat Apr 01, 2017 2:47 pm
Location: Vosges

Re: unwanted rounding for subtractive cylinder

Post by meme2704 »

I cannot confirm meme's fix either
Bof!, if you want, I do not use any magic formula to get this, you can check with this file, if your machine is set to 4decimales of course
Attachments
rayon5250.PNG
rayon5250.PNG (16.26 KiB) Viewed 670 times
Cylinder-rounding-issue5250.FCStd
(20.53 KiB) Downloaded 20 times
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: unwanted rounding for subtractive cylinder

Post by openBrain »

meme2704 wrote: Mon Feb 18, 2019 5:42 pm
I cannot confirm meme's fix either
Bof!, if you want, I do not use any magic formula to get this, you can check with this file, if your machine is set to 4decimales of course
I confirm that as soon as you edit the function as previously mentionned (double-click function & validate values - without changing - in Tasks tab), the value is rounded again. ;)

EDIT :
not_fixed.png
not_fixed.png (9.79 KiB) Viewed 664 times
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: unwanted rounding for subtractive cylinder

Post by openBrain »

chrisb wrote: Mon Feb 18, 2019 4:51 pm Using the dialog the values are always rounded to 2 decimals. It is even worse: this error exists for subtractive and additive primitives, tested for cylinder and cube.
I did some tests also and it seems like problem exists with all values of all additive & substrative primitives. ;) For example I tested with wedge, all values are concerned.
Oppositely, I found no problem with other values that are editable in the Tasks tab (eg. pad or pocket length).

I found another strange behavior : for example, a value of 2,525 is rounded to 2,520 (floor) while 8,525 is rounded to 8,530 (ceiling).
User avatar
meme2704
Veteran
Posts: 2926
Joined: Sat Apr 01, 2017 2:47 pm
Location: Vosges

Re: unwanted rounding for subtractive cylinder

Post by meme2704 »

Démerdez-vous j'ai fais ce que j'ai pû
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: unwanted rounding for subtractive cylinder

Post by bejant »

Using the file in the OP, FreeCAD works for me as expected using these Edit > Preferences > General > Units settings:
Edit: After quitting FreeCAD, opening it again, and creating a new Sketch from Part Design, constraints in the 3D window are whole numbers - no decimal point.

Units system: Standard
Number of Decimals: 6

OS: Ubuntu 18.04.2 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.18.15860 (Git)
Build type: Release
Branch: master
Hash: 3b708c7f84b0425076b520e1d95627b20fd75fe0
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

blue and strike-through = edit
Last edited by bejant on Mon Feb 18, 2019 7:07 pm, edited 1 time in total.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: unwanted rounding for subtractive cylinder

Post by openBrain »

bejant wrote: Mon Feb 18, 2019 6:17 pm Using the file in the OP, FreeCAD works for me as expected using these Edit > Preferences > General > Units settings:
Units system: Standard
Number of Decimals: 6
Problem also exists here with 6 decimals. ;)
---
OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15860 (Git)
Build type: Release
Branch: master
Hash: 3b708c7f84b0425076b520e1d95627b20fd75fe0
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
Post Reply