-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[PD] improve blind hole depth handling #4134
Conversation
When I tried to test this I got a crash due to a debug assertion failure in OCC. The steps I followed were:
Error message is: Backtrace:
|
I cannot confirm the behaviour you observed but I realized that there are several locations where the doubles x and z are declared and used for further calculations but they are never correctly initialized so behaviour is undefined. These are the lines 1269, 1298 and 1349. |
fa8703f
to
a3bcf88
Compare
Yes, and since their meaningless name it is even hard to follow what the code does. I now renamed the variables and initialized them. I also improved the code a little bit here. But the whole hole code could benefit from some love. However, not for now. |
I could not reproduce this with a debug build. But maybe it was because of the uninitialized variables. Can you please check again? |
It seems that it was being caused by the weird geometry that was generated when the tip doubled back on itself (due to those duplicated lines 1389 through 1398) -- a3bcf88 should do the trick, but I will re-test shortly. |
Can this PR go in? I fixed the 2 issues spotted by @chennes . I see that the PR is necessary since it popped up again in the forum: https://forum.freecadweb.org/viewtopic.php?t=51491&view=unread#p462138 |
20e67ee
to
1ffc7f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just re-tested and the bug I reported is resolved. It works well and is a good addition, thanks!
8d91c14
to
6216951
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not tested it, but the code looks good. I request that the UI file is sorted, and the PR rebased. Otherwise this looks ready (considering @chennes approval).
a3276df
to
5535ded
Compare
as reported in https://tracker.freecadweb.org/view.php?id=3818 we treat the blind hole depth not according to the conventions. The size of the drill point due to the angle is normally not taken into account but FC does this in any case. This PR adds therefore an option, that is by default off, to take the drill point size into account. Without the option, (the new default) the depth is calculated according to the conventions. The PR also removes unused widgets and restored the tab order in the .ui file. The thread parameters were never used. In case we made in future the decision to carve into holes real (modeled) threads, we need a special UI for that solution anyway so having the dead code in is not helpful at all.
5535ded
to
7306ed2
Compare
Done, thanks for having a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Many thanks for merging. We can now proceed to finish the other 2 pending hole PRs. |
as reported in https://tracker.freecadweb.org/view.php?id=3818
we treat the blind hole depth not according to the conventions. The size of the drill point due to the angle is normally not taken into account but FC does this in every case.
There are of course cases where the total depth, including the drill point size matters.
This PR adds therefore an option, that is by default off, to take the drill point size into account.
Without the option, (the new default) the depth is nor calculated according to the conventions.
I purposely made the new option by default off, because all literature about technical drawings don't take the drill point size into account and the hole dialog should by default offer the normed / conventioned behavior.
As side effect that means that existing blind holes change, but the same applied for my last hole dialog fixed (diameters of existing holes changed). So I think it is OK. If you disagree, please tell. However, I don't see how this can be avoided.
Forum thread: https://forum.freecadweb.org/viewtopic.php?t=51491&view=unread#p457068