[BUG?] Negative numbers in feet/inches interpreted wrong
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!
-
- Posts: 3
- Joined: Wed Apr 03, 2019 2:13 am
[BUG?] Negative numbers in feet/inches interpreted wrong
I am seeing some strange behavior when working in feet and inches in the "Building US" units.
FreeCAD is interpreting combined foot/inch values that are negative as expressions and this is giving me incorrect results.
For example, say I want to move an object one foot and four inches in the negative X direction. If I use the Draft Move tool and type this in: -1' 4" for the second point, the program will add these numbers together (-12" + 4"), moving only eight inches (-8"). I can even observe this happening by moving the focus to/from the entry field.
Is this a known issue? Is there a way to force the program not to interpret these entries as expressions?
Thanks
OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.Unknown
Build type: Unknown
Python version: 2.7.15
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1.oce-0.18
Locale: English/UnitedStates (en_US)
FreeCAD is interpreting combined foot/inch values that are negative as expressions and this is giving me incorrect results.
For example, say I want to move an object one foot and four inches in the negative X direction. If I use the Draft Move tool and type this in: -1' 4" for the second point, the program will add these numbers together (-12" + 4"), moving only eight inches (-8"). I can even observe this happening by moving the focus to/from the entry field.
Is this a known issue? Is there a way to force the program not to interpret these entries as expressions?
Thanks
OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.Unknown
Build type: Unknown
Python version: 2.7.15
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1.oce-0.18
Locale: English/UnitedStates (en_US)
Re: [BUG?] Negative numbers in feet/inches interpreted wrong
Confirmed here with latest 0.18 under Windows 7.
This behavior exists :
@metatheorem : as a sidenote, you can read from this thread if you'd like to compile with Qt5 and OCCT7+
This behavior exists :
- Whatever is the base unit selected => You can enter -1'4" value when working in mKs, you'll get the same result
- Whatever is the unit used in the value => You can enter -1m500mm and get same kind of result
@metatheorem : as a sidenote, you can read from this thread if you'd like to compile with Qt5 and OCCT7+

Re: [BUG?] Negative numbers in feet/inches interpreted wrong
This doesn't work either, because it is parsed twice: once when entering the value and a second time when confirming the dialog.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [BUG?] Negative numbers in feet/inches interpreted wrong
Ouch. I admit that I just tried by changing a position in the comboview. Indeed the case described by OP is another one.

I can't try now but what about using something like -(1'4") ?
Re: [BUG?] Negative numbers in feet/inches interpreted wrong
I see you had all the ideas which I had


A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [BUG?] Negative numbers in feet/inches interpreted wrong
I tried some various things and can't find a decent workaround. Definitely sounds as a real bug...
-
- Posts: 3
- Joined: Wed Apr 03, 2019 2:13 am
Re: [BUG?] Negative numbers in feet/inches interpreted wrong
I've opened a bug for this: https://www.freecadweb.org/tracker/view.php?id=3925.
@openBrain: Thanks, I'm working off of a repo build right now, but will probably build if I find the time soon...
@openBrain: Thanks, I'm working off of a repo build right now, but will probably build if I find the time soon...
-
- Veteran
- Posts: 2189
- Joined: Tue Jan 03, 2017 10:55 am
Re: [BUG?] Negative numbers in feet/inches interpreted wrong
The problem is resolved by this PR. When you type the text, remember to separate the unit string and the following number with a space. This is crucial, or else and string and number together will be recognized as an identifier. For example 1m10mm, will be recognized as 1 and m10mm.
Re: [BUG?] Negative numbers in feet/inches interpreted wrong
Hi @realthunder. Actually I have a doubt that your PR solves the exact problem discussed here. Could you have a look at this thread (and maybe if you're comfortable with parser things you can be of help there) ? Thanks.