New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TD] handle equal tolerances correctly #4197
Conversation
That's a good improvement, thanks! Just a couple of notes, though:
|
OK, we could do this:
This way we enable the user to save time by entering only one value and keep the functionality to get the two-line output if he really wants. If you agree, I'll implement this. |
f3d7ffd
to
69be2a3
Compare
Why not just add a boolean "PreferBilaterals" to TechDraw Dimension Preferences, with default value "true". If this boolean would be true, the ± sign would be used if possible (i.e. if the sum of the tolerance values is zero), and the classic printing would be used if ± does not fit. If the boolean in the Prefs would be false, the classic printing would always be used. I would surely always use the new way, but it'd be nice to offer the choice for non-standard users! |
I prefer my proposal because the boolean does not increase the workload. When I have e.g. ± 0.5 as tolerance, I want to just enter the 0.5 once and not 2 values to make sure it is not + 0.5 and 0.0. What do you think would be a disadvantage in my proposal?
I think there is no such classic. The norms I could access so far use for equal tolerance ±. Only because FC handled this wrong, it doesn't make it a classic :-) With my proposal, users who nevertheless want to use the classical misbehavior, the could do so. |
to make it clear, I refer to this one: |
Well, I implemented it as I proposed and adapted the PR accordingly: the common rule is that if a dimension has equal over- and undertolerance, they are output on the same line as the dimension concatenated using the ± character. This PR does this. Note that this is not just cosmetics, it is even standardized in the GD&T norms. The issue is also described in the Wiki: https://wiki.freecadweb.org/TechDraw_Geometric_dimensioning_and_tolerancing#Formatting_2
This is the output (contains the changes from #4203): The benefits:
I also fixed the issue that FC allows different form specifiers for the over- and undertolerance. It would be strange to have the overtolerance with e.g. %.2f and the undertolerance with %.1e. With this PR there is one format specifier used for both tolerances. I think this is a handy and intuitive solution that minimizes the workload (only on value to input for equal tolerances and no time-consuming additional toggling of options. |
528bddc
to
1f83dd3
Compare
IMO, this is an awkward workflow in some cases. It's fine as long as you only change the Tolerance property directly after creating a dimension. But it increases the work when switching from unilateral to bilateral tolerancing because you have to make sure that Over/UnderTolerance is 0 before the value of Tolerance is considered. Also, due to the fact of three different tolerance types the logic is IMO not very intuitive for users to understand when which tolerance is active. If you e.g. have a look at the scale function of GIMP you will see two spin boxes and in between a toggle button with the symbol of a chain link. If the chain link is locked the two scale values are always synchronized. This means if you modify the height value the width value is changed automatically and vice versa. If the chain link is unlocked you can freely change both values. So, this idea applied to tolerances I suggest to use a boolean property where you can switch between unilateral and bilateral tolerancing. |
But how often do you have in real life that you first specified an equal tolerance and then change to an unequal one, maybe once every few drawings. Then, you need to set 2 values to zero. However, the main use case (about 80 - 90%) in a drawing - are equal, bilateral tolerances.
That is what also @aapo proposed. But there is a major issue why I do not support this:
So the question is of we keep existing drawings or not. Changing existing drawings make them more norm-conform that is what I like, but I also know that "automatic changes" that can even not be reverted will cause problems in companies because every change in a drawing has to get a new revision (I think this is normed as well) no matter if it is a pure editorial change or not. So the danger is to open an existing drawing, press save because you just changed something in a model (e.g. a construction sketch) and without noticing you get a changed drawing. To summarize:
Therefore I think my proposal is more safe and provides the minimal possible workload for future drawings and therefore the better compromise. |
Hmm, I realize now that we already changed existing drawings by the changes we made during the last 2 weeks. Some of them only affect dimensions created with FC 0.19 but some, like the omission of the plus sign for unilateral tolerances. So then we can go on an implement the chain option and set it ON by default. Then exisiting drawings will get norm-conform equal tolerances and one has to perform only 1 action for new equal tolerances. |
(Cited from your first post.) I have compiled your PR and it does not do it. It still shows the values in two lines.
It's not about how often you do this. It's about when you do it how easy and logical it is to change the values.
Why? If the equal bilateral mode is active the user has to exactly change one value. With your approach the user has to change up to three values: set Over/UnderTolerance to 0 and then change Tolerance. And as already said for an average user it's not obvious at all when unilateral mode, unequal bilateral mode or equal bilateral mode is active. Furthermore, Tolerance can accept arbitrary values. So, if it's set to a negative value the text will be:
So, the equal bilateral mode can be activated for every newly created dimension. Then the user only has to change one value like with your PR but without the disadvantage of three different tolerance properties. To reduce possible confusions the UnderTolerance can be made read-only in the property editor if equal bilateral mode is active.
I disagree. You implicitly expect equal bilateral mode if Over- and UnderTolerance are 0 and Tolerance is set. If for some reason Over- or UnderTolerance becomes non-zero (e.g. if bound to an expression that becomes non-zero due to round-off errors) the dimension automatically switches to unequal bilateral or unilateral mode.
If the boolean property to force equal bilateral mode is off but Over- and UnderTolerance are equal you could handle this situation, too. But I wonder why should this even be allowed as you said yourself that it violates the norm.
This can be very easily avoided. There are two methods to achieve this:
|
Because I already changed that in favor of the solution to just fill the "Tolerance" field. However, as I wrote in my last comment, I will change the PR now anyway since we are free to change existing drawings because we already did this lot during the FC 0.19 development cycle.
I don't agree because let's calculate assuming every action takes e.g. 3 seconds to perform and you have 2 dozen (24) dimensions in a drawing: So it is in my opinion very important that the use case that appears most often needs as less actions as possible. |
b8b6a06
to
8b0bcc2
Compare
I did so now. Now we have a new option "Equal Tolerance" set by default to true. Existing documents will thus change but as I wrote, we did so already and the benefit is a norm-conform layout also for existing drawings. In case users still want the old output, they still can force this. |
67835ff
to
9d97659
Compare
I described two methods how to avoid to change two properties and instead only change one. So, it's rather 86.4 s vs 72.0 s Now when looking at the latest code changes I am confused. You always said how important it is not to change the drawings when loading a project and now you don't pay any attention. The EqualProperty is set to True but UnderTolerance is not read-only (another bug) and I am able to change it. However, all the changes are ignored because EqualProperty is True. This can be fixed with:
|
9d97659
to
c053b5c
Compare
the common rule is that if a dimension has equal over- and undertolerance, they are output on the same line as the dimension concatenated using the ± character. This PR does this. Note that this is not just cosmetics, it is even standardized in the GD&T norms. also: * use one format specifier for tolerances since the norms don't allow a different format for the over- and the undertolerance * some code optimizations like a self-explaining function name, remove unnecessary/outdated comments
c053b5c
to
6c0030c
Compare
Yes, changing drawings is an issue in terms of QA. Every change deserves a new drawing revision. (I did not know this few weeks ago). The point is that TD was full of small bugs here and there and the many fixes in the 0.19 development cycle changed existing drawings already a lot. OK, FC 0.19 was not released as being stable, but we had to introduce changes nevertheless. For example a machining company reported that my clearance hole diameters were wrong. That was when I realized that the Hole dialog did not apply norm-conform hole diameters. I hope I fixed the hole dialog but of course the new diameters (only slight changes, however) change existing drawings as well. So I already broke existing drawings.
Yes.
Thanks. |
A question: since tolerances are in many cases in sub-millimeter range, the stepsize for the tolerances should be 0.1 mm instead of 1.0mm. How can this be achieved without the need to set a range constraint for the App::Property? By the way, when this PR is in, I will add a dialog to change dimensions. Surprisingly dimensions are the only TD feature without a dialog and while learning GD&T I noticed that a dialog would speed op the workflow a bit. |
Just for information since this was also new to me:
That can but not need to be. It is valid to have e.g. 8.0 +0.4 +0.1 Then the resulting value can be in the range 8.4 - 8.1. While googling around, I found sch drawings and apparently one sometimes don't like to dimension 8.25 +- 0.15. |
If a drawing violates the standard then IMO it's OK to make changes that automatically fix the drawing. But if over and under tolerance is not equal bilateral then it should not change the drawing to show them as equal bilateral.
You can't. But one way is to set the lower and upper limit to DBL_MIN/DBL_MAX.
Yes, I realized this as well. It would be a nice feature.
But isn't this very odd? I mean you say the length dimension is 8mm but the value can be in the range 8.1-8.4 mm. Sounds a bit contradictory to me.
So, if the standard allows it then I don't mind (but still find it strange). |
Merged. |
Yes, of course.
Thanks, I will make a new PR to do this.
Yes. I won't do this by myself since as a physicist this is illogical. However, I read to learn. |
Here it is: #4263 |
Here is the PR that adds the dialog: #4271 |
the common rule is that if a dimension has equal over- and undertolerance, they are output on the same line as the dimension concatenated using the ± character.
This PR does this.
(It also uses a more self-explaining function name.)
Note that this is not just cosmetics, it is even standardized in the GD&T norms. The issue is also described in the Wiki: https://wiki.freecadweb.org/TechDraw_Geometric_dimensioning_and_tolerancing#Formatting_2
The implementation allows the user to choose