View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002034||Part||[FreeCAD] Bug||public||2015-03-31 12:57||2019-07-30 22:48|
|Platform||Ubuntu 14.04.2 x64||OS||Linux||OS Version||3.13.0-49-generi|
|Product Version||[FreeCAD] 0.17|
|Target Version||[FreeCAD] 0.19||Fixed in Version||[FreeCAD] 0.18|
|Summary||0002034: Measurement arrowheads are ridiculously out of proportion at some scales/zooms/measurements.|
|Description||See http://www.toms.net/FreeCAD/fc2.png (attached to ticket)|
|Steps To Reproduce||measure something small|
|Additional Information||arrowheads even overlap into hourglasses|
Please retest on 0.16
Forum thread: https://forum.freecadweb.org/viewtopic.php?f=10&t=20175
Edit: Another thread found at https://forum.freecadweb.org/viewtopic.php?f=3&t=7126
I confirm this bug in current master.
Steps to reproduce:
1. Create a Part Cube of dimensions 0.1 x 0.1 x 0.1 mm
2. Select two vertices
3. Click on "Measure Linear" from the Measure toolbar in the Part workbench
4. The measurement arrows are disproportionally huge.
OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9747 (Git)
Build type: None
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
||Changing status to 'confirmed'|
Copypasta from https://forum.freecadweb.org/viewtopic.php?f=3&t=7126#p157425
Been several iterations so can be hard to find. The part measure entities are not document objects and live as pure coin3d objects. This means they have no view provider. The arrow head creation is at:
setting up 'autoscale' in coin3d seems harder than it should be, at least to me. Anyway I did make it work for the default reposition dragger. You can use it by double clicking on a primitive. You can find the code here.
luke parry added a custom node, but I have never used it to know if it does what you want.
Thanks for the pointers. I don't have the build platform set up, hell I don't even know what you guys recommend, gcc or something I'm assuming. Anyway, just looking at TaskDimension.cpp, the cone size of the arrow, which is the problem, not the arrow itself, is set with these lines:
(similar for the cones at line 1060)
I don't know the correct method for calling the function, but couldn't you could calculate the scale factor off the vector at around line 432:
textVecCalc->dot(A,B) // should return length of the 3D arrow
And again, at around line 1137.
Then you know based on the size of the vectors that make the arrow length, say are fine at 20mm (just guessing), you could then scale the cone size based on that dot product in relation to 20mm.
Of course, maybe I'm missing something here? I am not familiar with the code, or with Coin3D, just a brief look at both, but it looks like an easy fix to me.
The reason this is OK is that if you are looking at a small area, the cones NEED to be small. Even if you were zooming out and looking at the part in a wider view, it doesn't help to have the cones be big and overlapping. Basically, I'm saying scale the cone based on the arrow length, NOT the camera view.
The other option is how about just not displaying the arrow cones at all? It could be a checkbox in the preferences. I don't see why they're really necessary anyway. With that, you just make it a conditional based on the global preference around lines:
Anyone who has the build environment already set up care to test or implement either of these suggested changes?
I realize that this may not be as important as implementing a much cooler feature, but as a novice user (at this point I might call myself novice->intermediate as there are many features I stil am not familiar with), the arrow cone issue is one of the first things that I ran into that has bugged me from probably the first or second part I made, and continues to bug me pretty much anytime I am working on something with tight tolerances. If it's that easy and annoying of a "bug" for someone to find, and at least just having the option to turn them off is available, that might keep someone from getting really frustrated and saying "f-this, I'll just go back to whatever-cad"
I think FreeCAD is awesome, by the way. Thank you guys so much for creating / working on it. I will be happy to make the change myself, but getting the build environment all set up is going to take some time that I don't have at the moment. I don't know if this really matters to anyone who is doing the regular builds / code merges or what have you.
Re-added attached photo
IMG_0010.PNG (31,319 bytes)
IMG_0010.PNG (31,319 bytes)
I have made an attempt to fix this bug. The code is available at:
Please let me know if I haven't followed the standard procedure in any way. (Or if the fix is no good)
||The fix looks good, I just merged it. Thanks!|
||Unfortunately, this issue is not correctly solved. When creating a cube of size 0.1 x 0.1 x 0.1 then the arrows are not correctly placed. The peaks of the arrows should lie on the selected points.|
Thanks wmayer for pointing that out.
I looked into it a little further, and there was a precision error, so I've increased that by four decimals, which gives good results at 0.1mm, and acceptable results at 10nm. Going much further would require using a double instead of a float, and I'm not sure whether there would be any knock-on effects.
Update: Please excuse the git mess, I neglected to rebase first, so there are a few commits that may not make sense, but the end result should be good. I'm learning git as I go, and there seems to be a bit of an art to fetching and merging and pushing from/to different sources. If you'd like me to create a new branch to keep the history clean, that's fine, just let me know.
Thanks for providing a fix. I think it's sufficient the way how it works now because when entering value of 1nm or lower (or for very huge values) then the whole scene starts to behave weirdly. This is because OpenInventor only uses floats.
About git: I was able to cherry-pick the last commit which includes the relevant changes.
||Thanks wmayer. And - thanks for the reminder about the cherry pick feature within git. I will look into that.|
FreeCAD: releases/FreeCAD-0-18 690774c0
Committer: Yorik van Havre Details Diff
|Fixes Bug 2034. Made Part dimensional arrows proportional to line length and radius||
|mod - src/Mod/Part/Gui/TaskDimension.cpp||Diff File|
|mod - src/Mod/Part/Gui/TaskDimension.h||Diff File|
|2015-03-31 12:57||toehser||New Issue|
|2017-01-24 00:21||Kunda1||File Added: fc2.png|
|2017-01-24 00:21||Kunda1||Description Updated||View Revisions|
|2017-01-24 00:28||Kunda1||Note Added: 0007941|
|2017-01-24 00:28||Kunda1||Status||new => feedback|
|2017-01-24 00:29||Kunda1||Tag Attached: #pending|
|2017-01-24 04:15||normandc||Note Added: 0007943|
|2017-01-30 13:39||Kunda1||Note Added: 0008102|
|2017-01-30 13:39||Kunda1||Status||feedback => confirmed|
|2017-01-30 20:03||Kunda1||Note Edited: 0007941||View Revisions|
|2017-02-01 23:56||Kunda1||Tag Attached: #lowhangingfruit|
|2017-03-10 00:16||Kunda1||Note Added: 0008601|
|2017-03-10 00:18||Kunda1||Note Edited: 0008601||View Revisions|
|2017-03-10 00:21||Kunda1||Product Version||=> 0.17|
|2017-03-10 00:21||Kunda1||Target Version||=> 0.17|
|2017-05-01 22:59||Kunda1||File Deleted: fc2.png|
|2017-05-01 23:00||Kunda1||File Added: IMG_0010.PNG|
|2017-05-01 23:00||Kunda1||Note Added: 0008841|
|2017-06-27 11:31||Kunda1||Relationship added||related to 0002520|
|2017-10-18 14:21||wmayer||Project||FreeCAD => Part|
|2018-01-05 21:11||wmayer||Target Version||0.17 => 0.18|
|2019-02-14 21:29||wmayer||Target Version||0.18 => 0.19|
|2019-03-11 02:05||craig9||Note Added: 0012878|
|2019-03-12 13:38||yorik||Note Added: 0012894|
|2019-03-12 13:39||yorik||Assigned To||=> yorik|
|2019-03-12 13:39||yorik||Status||confirmed => closed|
|2019-03-12 13:39||yorik||Resolution||open => fixed|
|2019-03-12 13:39||yorik||Fixed in Version||=> 0.18|
|2019-03-12 13:39||yorik||Note Added: 0012895|
|2019-03-12 16:54||wmayer||Status||closed => new|
|2019-03-12 16:54||wmayer||Resolution||fixed => reopened|
|2019-03-12 16:54||wmayer||Note Added: 0012897|
|2019-03-12 21:31||craig9||Note Added: 0012903|
|2019-03-12 21:33||craig9||Note Edited: 0012903||View Revisions|
|2019-03-12 22:30||craig9||Note Edited: 0012903||View Revisions|
|2019-03-14 22:40||wmayer||Note Added: 0012907|
|2019-03-14 22:43||craig9||Note Added: 0012908|
|2019-03-14 22:49||wmayer||Status||new => closed|
|2019-03-14 22:49||wmayer||Note Added: 0012909|
|2019-07-30 22:48||Kunda1||Changeset attached||=> FreeCAD releases/FreeCAD-0-18 690774c0|