tolerances are not displayed norm-conform

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

tolerances are not displayed norm-conform

Post by uwestoehr »

I recently had to create several real-world drawings. Besides the expected feedback from the workshops that will manufacture the parts, I got critical feedback about my tolerancing.

Now I found time to learn how tolerancing is done the right way, meaning the normed way.
One result is this Wiki page TechDraw_Geometric_dimensioning_and_tolerancing that aims to describe tolerancing with FreeCAD.

Another result is that I realized that our current tolerance output is not norm-conform. For example the norm ASME Y15.4 defines this layout for dimensional tolerances:
screenshot from ASME Y15.4
screenshot from ASME Y15.4
AcroRd32_eASeHof6nu.png (15.01 KiB) Viewed 1171 times

This is our current output:
FC's output
FC's output
FreeCAD_V1VrroOM8r.png (2.12 KiB) Viewed 1171 times
wrong plus sign
wrong plus sign
FreeCAD_qu5Cv3ebV3.png (2.1 KiB) Viewed 1171 times

So we have currently 2 issues to be solved:

1. equal tolerances appear behind the dimension so there is one line in the form "dimension ± tolerance". This issue will be addresses by this PR: https://github.com/FreeCAD/FreeCAD/pull/4197

2. when the tolerances are not equal, the overtolerance appear above the undertolerance in two lines. We already have this layout but our text size is too small and the spacing is incorrect: the minus sign for the undertolerance is as wide as the plus sign and the space between the plus sign and the number is the same as the spacing between the minus sign and the number. If the over/undertolerance is zero there must be no plus sign in front.
I had a look in the Internet since I also got the feedback from a workshop that the tolerances are hard to read. And indeed the tolerances appear in most cases with the same size than the dimension text.
For reference, this is our current

@aapo, I think I can fix the first issue. Since you recently worked on the tolerancing would you like to have a look at the second issue?
aapo wrote: .
chrisb
Veteran
Posts: 54280
Joined: Tue Mar 17, 2015 9:14 am

Re: tolerances are not displayed norm-conform

Post by chrisb »

Can we keep the variant with the smaller tolerances as an option? The norm was made when different fonts were exotic things to be used by professional typesetting systems; but they are often used in books or other documents, probably for improved readability.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
aapo
Posts: 626
Joined: Mon Oct 29, 2018 6:41 pm

Re: tolerances are not displayed norm-conform

Post by aapo »

uwestoehr wrote: Sun Dec 27, 2020 6:07 pm 2. when the tolerances are not equal, the overtolerance appear above the undertolerance in two lines. We already have this layout but our text size is too small and the spacing is incorrect: the minus sign for the undertolerance is as wide as the plus sign and the space between the plus sign and the number is the same as the spacing between the minus sign and the number.
This, i.e., the size of the 'plus' and 'minus' signs depends on the font. I think you are not using the default FreeCAD "Osifont", where the 'plus' and 'minus' are the same size. Moreover, you can already adjust the tolerance scaling in TD prefs; just put 1.0 there to get same font sizes as for the main Dimension value. If you want to make sure that the characters are the same size, please use a fixed font size, but don't adjust the printing to work with only just one font, especially not some other font than "Osifont".

On the font size issue, I agree that the current default scale is ridiculously small. I have always used 0.8 (or 1.0), and that's the reason that I wrote the bounding box patch a month ago; back then, after the Qt library change, the tolerances with 1.0 scale looked awful when using the Qt loose bounding boxes. Maybe change the TD default scale to 0.8, or even 1.0? Quite a lot of people woudn't like that, but it'd be "standard", and it's always possible to change it back to 0.25 in the prefs.

If the over/undertolerance is zero there must be no plus sign in front.
This is a fair point. I have also noticed this, but did not have the energy to fix it properly back then, and later forgot, sorry! :D I can do it now, and I think everyone here agrees that "+0" (or "-0") is always wrong.


@aapo, I think I can fix the first issue. Since you recently worked on the tolerancing would you like to have a look at the second issue?
Yes, I can have a look at this. But, as I said I think we already have a configuration option for this, and I use it already exatctly how you propose. Also, regarding the width of the '+' and '-' characters, that really depends on the typefaces of the font. It would be possible to do tricks, but clearly the best way to handle this is to select a font which is suited for mathematics/engineering. The font you are using has a really tiny '-' typeface, probably for artistic reasons as the same char is used for hyphenation.

EDIT: The "Tolerance text scale" option seems to be in the Prefs->TechDraw->Scale->"Size Adjustments" box, and not in the "Dimensions" tab, so it's a bit difficult to find, and that's probably the reason you were not aware of it. The TD Prefs and options are sometimes quite confusing. There has probably not been enough effort and consideration spent there to sort them out in a more logical fashion.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: tolerances are not displayed norm-conform

Post by uwestoehr »

aapo wrote: Sun Dec 27, 2020 9:45 pm This, i.e., the size of the 'plus' and 'minus' signs depends on the font. I think you are not using the default FreeCAD "Osifont"
I use Osifont. But OK, let's keep this aside since as long as it is readable the workshop people know what is meant. I could not find the norm where the fonts are normed for techical drawings and unless we can be sure the minus sign is normed, we are not forced to act.
On the font size issue, I agree that the current default scale is ridiculously small.
...
Maybe change the TD default scale to 0.8, or even 1.0? Quite a lot of people woudn't like that, but it'd be "standard", and it's always possible to change it back to 0.25 in the prefs.
OK, setting it to 0.8 is a good compromise. I'll make a PR because I see there some further UI issues in the preferences I want to improve.

This is a fair point. I have also noticed this, but did not have the energy to fix it properly back then, and later forgot, sorry! :D I can do it now, and I think everyone here agrees that "+0" (or "-0") is always wrong.
Please do so. It is not about our personal feelings but what is common and normed. It should basically just be :mrgreen:

Code: Select all

if (string.at(0) == QChar::fromLatin1('+') && value == 0.0)
string.remove(0, 1);
EDIT: The "Tolerance text scale" option seems to be in the Prefs->TechDraw->Scale->"Size Adjustments" box,
You made my day! Thank you, this way I can correct also my existing drawings.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: tolerances are not displayed norm-conform

Post by uwestoehr »

chrisb wrote: Sun Dec 27, 2020 8:47 pm Can we keep the variant with the smaller tolerances as an option? The norm was made when different fonts were exotic things to be used by professional typesetting systems
:shock: The norm is from 2018
As @aapo pointed out, there is already a preferences option so you can change the size at any time.
aapo
Posts: 626
Joined: Mon Oct 29, 2018 6:41 pm

Re: tolerances are not displayed norm-conform

Post by aapo »

uwestoehr wrote: Sun Dec 27, 2020 11:19 pm Please do so. It is not about our personal feelings but what is common and normed. It should basically just be :mrgreen:

Code: Select all

if (string.at(0) == QChar::fromLatin1('+') && value == 0.0)
string.remove(0, 1);
I made a PR https://github.com/FreeCAD/FreeCAD/pull/4203, but I ended up to implement it bit differently. I also first tried string manipulation with regexps, but then I realized that we have a ready-made function supposed to tackle the locale and unit issues, so I ended up to just ask for "%.0f" format (no sign, zero decimals without point). Also, one should use fpCompare() and not check floating point value directly against zero.

You made my day! Thank you, this way I can correct also my existing drawings.
You're welcome! I hope missing the option encourages you to improve the TD prefs layout, I think this particular scale should be in the Dimensions tab, and the Scale tab is a bit of weird idea (some scales are collected there, but not all, and there is even one "mm" value, which is not a scale by definition). Everytime, I have to go through all the TD Prefs Tabs to find something I need. :D
aapo
Posts: 626
Joined: Mon Oct 29, 2018 6:41 pm

Re: tolerances are not displayed norm-conform

Post by aapo »

uwestoehr wrote: Sun Dec 27, 2020 11:19 pm I use Osifont.
The font in your FC example pics in the top of the thread is definitely not the "osifont" distributed with FreeCAD. Yours looks like a system regular sans serif font. According to Google, osifont looks like this:

osifont.png
osifont.png (27.92 KiB) Viewed 1064 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: tolerances are not displayed norm-conform

Post by uwestoehr »

aapo wrote: Sun Dec 27, 2020 11:40 pm The font in your FC example pics in the top of the thread is definitely not the "osifont"
Ah, the font change only has an effect on new dimensions (one of the preferences UI bugs)
aapo wrote: Sun Dec 27, 2020 11:40 pm the Scale tab is a bit of weird idea (some scales are collected there, but not all, and there is even one "mm" value, which is not a scale by definition). Everytime, I have to go through all the TD Prefs Tabs to find something I need.
That is a difficult topic. It was once me who sorted the preferences this way. I agree that the tolerance settings belongs to "Dimensions". Also the Fuzz settings do not belong to the scale settings but to general.
I will make a PR that will improve this.
chrisb
Veteran
Posts: 54280
Joined: Tue Mar 17, 2015 9:14 am

Re: tolerances are not displayed norm-conform

Post by chrisb »

uwestoehr wrote: Sun Dec 27, 2020 11:22 pm :shock: The norm is from 2018
Probably the latest revision, not the date where it originated.
As @aapo pointed out, there is already a preferences option so you can change the size at any time.
Thanks. If this is kept, I'm all happy.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: tolerances are not displayed norm-conform

Post by uwestoehr »

uwestoehr wrote: Mon Dec 28, 2020 12:17 am I agree that the tolerance settings belongs to "Dimensions". Also the Fuzz settings do not belong to the scale settings but to general.
I will make a PR that will improve this.
Done: https://github.com/FreeCAD/FreeCAD/pull/4205
Post Reply