Problem with dimension tool. [SOLVED]

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
crobar
Posts: 160
Joined: Fri Aug 29, 2014 1:26 pm

Problem with dimension tool. [SOLVED]

Post by crobar »

Hello,

I'm exploring the many features of FreeCAD, and am trying out the dimension tool, but getting some odd results. I would like to know if I am doing something wrong (most likely) or something else is going on.

I have a quite simple part which I created using a series of csg operations. It is slightly cuved along the dimension which is around 30mm, but straight along the other dimensions, and is shown below:
freecad-dim-problem-1.png
freecad-dim-problem-1.png (18.12 KiB) Viewed 3210 times
:

I created the dimension with ~size 110mm by using 'select edge', same with the vertical dim of size 5.94. The other dim I created by selecting the vertices at either end. There are some problems with this dimension. The reported size of this is not correct (although I know I can override the text), and when I rotate or move the object from the standard view it is not actually attached where it should be (see image below).
freecad-dim-proble-2.png
freecad-dim-proble-2.png (11.64 KiB) Viewed 3210 times
If I create the other dimensions on the straight edges by selecting each vertex (rather than using 'select edge') the dimensions are also wrong, see below where I've done this.
freecad-dim-problem-3.png
freecad-dim-problem-3.png (13.52 KiB) Viewed 3210 times
The dimension again doesn't move with the part when rotated.
freecad-dim-problem-4.png
freecad-dim-problem-4.png (12.8 KiB) Viewed 3210 times
In case it's something I'm doing wrong, here is exactly how I added the dimension:

1. Activate Draft

2. Click on Add Dimension

3. Hover over desired vertex selection, click when highlighted with a filled circle, and the little green symbol beside the cursor is a green dot with a line sticking out of it

4. Hover over second desired vertex, click when highlighted with a filled circle, and the little green symbol beside the cursor is a green dot with a line sticking out of it

5. place the dimension line wherever

During this process, the numbers in the dimension tool never match the vertex location displayed in the FreeCAD main window as I hover over the shape components.

I am using the development version of FreeCAD from git on Linux, cloned yesterday, but get the same behaviour in the released version 0.14 as well.

EDIT--UPDATE

I have found I can get the correct behaviour by adding the dimension manually through the python API. Steps are:

1) print first vertex (would be nice if there was an easier way to display this info for debugging purposes, and yes, I know it is briefly displayed in the main window when you hover):

Code: Select all

print(FreeCADGui.Selection.getSelectionEx()[0].SubObjects[0].Point)
2) select other vetex and print it too

Code: Select all

print(FreeCADGui.Selection.getSelectionEx()[0].SubObjects[0].Point)
3) Now add the dimension by calling makeDimension, replaicing the X,Y,Z values with those printed before

Code: Select all

Draft.makeDimension(FreeCAD.Vector(X1, Y1, Z1),FreeCAD.Vector(X2, Y2, Z2))
4) fiddle around with the object to make it look nicer
Last edited by crobar on Wed Oct 29, 2014 4:03 pm, edited 1 time in total.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Problem with dimension tool.

Post by jmaustpc »

Since both your post are about the same thing, I moved them to the same topic.

Edit:- you deleted one

The problem looks like you have not set the "working plane" before each "non-linked" dimension. :)

Note that a dimension from one point to another point is a not linked or manual dimension. A linked dimension, where you selected an edge for example, will change and move with any changes to the dimensions or placement or orientation of your shape, the manual dimension do not follow any changes.

When you say you rotate your solid...it is not clear if you mean you actually rotate the solid (which would and should leave the non-linked dimension not longer connected) or if you mean rotate the view of the solid (in which case the non-linked dimensions should still be attached to the solid)....I suspect you mean the later and the problem comes back to you might not have set the working plane before creating each dimension.

If you set a linked dimension to the slightly curved edge, it will default to dimensioning the diameter of the curve, this can be changed to radius. If you do want to show the width of the block you will have to use the non-linked dimension from point to point.

The reason you are getting wrong dimensions is also because you had not correctly set the working plane. :)

Jim
crobar
Posts: 160
Joined: Fri Aug 29, 2014 1:26 pm

Re: Problem with dimension tool.

Post by crobar »

jmaustpc wrote:Since both your post are about the same thing, I moved them to the same topic.
Ahh, well, I see, in my view they were seperate issues, but I could be wrong (I actually somehow thought I'd moved the post myself by accident.)
jmaustpc wrote:The problem looks like you have not set the "working plane" before each "non-linked" dimension. :)
Actually I'm pretty sure the real issue is that the dimension tool adds the points in the wrong place. See my edit above, using the python API to add the dimension.

jmaustpc wrote:When you say you rotate your solid...it is not clear if you mean you actually rotate the solid
Sorry, I just mean rotate the view, not the actual object.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Problem with dimension tool.

Post by jmaustpc »

crobar wrote: jmaustpc wrote:The problem looks like you have not set the "working plane" before each "non-linked" dimension. :)



Actually I'm pretty sure the real issue is that the dimension tool adds the points in the wrong place. See my edit above, using the python API to add the dimension.
If you post the file, or some other example file we could have a look at it, and see if we could find the problem.

Also what is your "default working plane" in Draft Preferences set to?

Please post Help about FreeCAD data, there is a lot more information in it than just the FreeCAD code version, some of that info might be useful.

By the way Draft Dimensions seem to be working perfectly for me here....my default working plane is "none"....

OS: Ubuntu 14.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4136 (Git)
Branch: master
Hash: 8fb596221ff4632b5b9fa5af390ad19f2ea71321
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.1
crobar
Posts: 160
Joined: Fri Aug 29, 2014 1:26 pm

Re: Problem with dimension tool.

Post by crobar »

ok, I have attached a file containing the shape, I was unable to replicate the problem in a simpler shape. This file was created by copying and pasting the shape from a document with many other shapes in it.

My default working plane is also 'none'.

The problem with dimensions not showing up was unrelated, as I've now realised it was simply that they show up off the page due to the offsets and things of the page contents. It would be nice if FreeCAD still showed them so you could guess what you have to do to get them onto the page.

FreeCAD info

OS: Linux Mint 17 Qiana
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4107 (Git)
Branch: master
Hash: 980d1eb0ebf8eafc4c8885d9c8a499b98fc2be0d
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.0
Attachments
freecad_problem_shape.fcstd
(2.88 KiB) Downloaded 39 times
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Problem with dimension tool.

Post by mario52 »

hi
the cotation are placed at points 0,0,0
Top View
Cot_TopView.png
Cot_TopView.png (5.87 KiB) Viewed 3154 times
Rear View
Cot_RearView.png
Cot_RearView.png (10.51 KiB) Viewed 3154 times
Right View
Cot_RightView.png
Cot_RightView.png (9.47 KiB) Viewed 3154 times
Cot_accrochage.png
Cot_accrochage.png (11.58 KiB) Viewed 3154 times
I think it's related to the same hook with CTRL fit (snap) objects to each other

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Problem with dimension tool.

Post by jmaustpc »

Hi crobar

Thanks for the file and the version data, now I can test things and try to resolve the matter.

Unfortunately, you did not post your full file, it has none of the problematic dimensions, just the solid. So I am still left guessing what you did wrong in your specific case. However the good news is there is nothing wrong with FreeCAD, it all works as it is supposed to for me in the version below with your solid! :)

Something Mario said though, reminded be of another "newbie gotcha"....if you look at Draft snaps, you want to turn off the types you don't want and just turn on what you do want, I suspect you might have had "snap to working plane" or one of the other snap types, activated in such away as to confuse the situation.....


OS: Ubuntu 14.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4136 (Git)
Branch: master
Hash: 8fb596221ff4632b5b9fa5af390ad19f2ea71321
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.1
draftdimensions.jpg
draftdimensions.jpg (76.55 KiB) Viewed 3122 times
then I prettied them up by changing their parameters (I removed the two I didn't want)
draftdimensions1.jpg
draftdimensions1.jpg (84.07 KiB) Viewed 3122 times
then I measured with Part Measure, subject to the precision value set in Draft, they agreed
draftdimensions2.jpg
draftdimensions2.jpg (82.69 KiB) Viewed 3122 times
I told the end dimension to display 3 decimal places and now they display exactly the same.
draftdimensions3.jpg
draftdimensions3.jpg (94.63 KiB) Viewed 3122 times
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Problem with dimension tool.

Post by jmaustpc »

Your solid is a long way from global origin, Which is OK if that's what you want,
draftdimensions4.jpg
draftdimensions4.jpg (75.5 KiB) Viewed 3118 times
crobar
Posts: 160
Joined: Fri Aug 29, 2014 1:26 pm

Re: Problem with dimension tool.

Post by crobar »

jmaustpc wrote:Hi crobar
Something Mario said though, reminded be of another "newbie gotcha"....if you look at Draft snaps, you want to turn off the types you don't want and just turn on what you do want, I suspect you might have had "snap to working plane" or one of the other snap types, activated in such away as to confuse the situation.....
I think you've hit the nail on the head with this! Looks like it was something to do with the snapping options. I knew it must be something I was doing, because a bug which caused that behaviour would have been noticed already.

I think I had 'passive' selected?

Thanks everyone for the help!
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Problem with dimension tool.

Post by mario52 »

hi
must coordinate the snap on the preselection and the problem is solved
Cotation_05.png
Cotation_05.png (80.12 KiB) Viewed 3079 times
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply