Measurement

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Measurement

Post by jriegel »

Hi,
I added a command to do simple measurement task on Objects in FreeCAD.

An example you can see here:
http://freecad-project.de/svn/ExampleDa ... ents.FCStd

Have fun
Attachments
Measurement.jpeg
Measurement.jpeg (40.23 KiB) Viewed 3579 times
Stop whining - start coding!
wmayer
Founder
Posts: 20323
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Measurement

Post by wmayer »

Hmm, I'm not sure if it's such a good idea to combine the measurement method with the selection framework because there are some strong limitations. For instance, objects which only have one SoFCSelection node like meshes or a component of a shape are not able to be measured. Another point is when selecting objects by tree because then the result is always garbage.

BTW, the above link is invalid.
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Measurement

Post by jriegel »

Thats right, its far from perfect. But at least you can use it in the Part world relatively good. But the usage its not very intuitive.

Surly it would be good to implement for each main module (like Part and Mesh) a special one which can also use the
specialties of the module. E.g. if you select a Circle he can give you the diameter...
But that would be much more work....

Something is better as nothing. I have no time for more, Im busy getting the sketcher to fly....

Here the right link:
http://freecad-project.de/svn/ExampleDa ... ents.FCStd
Stop whining - start coding!
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Measurement

Post by yorik »

What did you guys think of the draft dimension? It does more or less the same job... And you can place it quite precisely. The only small problem I have is to orient the dimension text so it is well aligned with the dimension "bridge". I have to look at how 3D text is oriented. And of course it needs all kinds of user settings like precision, unit suffix, markers style, etc...

Maybe we could join both features into a killing, total powerful one?
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Measurement

Post by jriegel »

Why not!
Can you point me to the code where you build up the scene graph?
Stop whining - start coding!
wmayer
Founder
Posts: 20323
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Measurement

Post by wmayer »

Surly it would be good to implement for each main module (like Part and Mesh) a special one which can also use the
specialties of the module. E.g. if you select a Circle he can give you the diameter...
I disagree. The measurement tool should only do what it is supposed to do, i.e. measuring the distance between two arbitrary points. If we need special tools for things like measuring the diameter of a circle then we should call it like that.

Furthermore we already had a measurement tool under the View menu which works as expected. However, I have polished a few issues to make it working properly.
Maybe we could join both features into a killing, total powerful one?
Oh yes, they work very similar.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Measurement

Post by yorik »

jriegel wrote:Can you point me to the code where you build up the scene graph?
Sure, the python feature definitiion is in src/Mod/Draft/Draft.py at line 707, and the command that creates it is in the same file at line 1678...
The only real difference with yours is that it supports the snapping mode of the draft module, so you can pick a point precisely, and also it asks you for 3 points, the third point being where passes the dimension line.

I haven't looked, but your dimension is not bound to the selected objects, right? i mean, if you move one of the objects the dimension stays where it was, right? Then really both are very similar...
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Measurement

Post by jriegel »

Hi again,

@Werner
Your right, you creation command is better, I exchanged it and put yoriks ruler SVG to it (nice icon!)
I put it also in the view toolbar, IMO its a very often used tool, it should be easy accessibly.

@Yorik
Your basically right, but I still cautious to put pivy stuff in the core system. We have so much
trouble with pivy. IMO core (GUI) should run without pivy..... Sorry :(
Anyway its a great prototype for any custom measurement facility in FreeCAD and Python!
Stop whining - start coding!
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Measurement

Post by yorik »

jriegel wrote:IMO core (GUI) should run without pivy
Yes I agree totally... Pivy is really a pain in the ass and it would give much hassle.
Too bad the guy who created pivy has disappeard, because it is really useful.
But reproducing my little code in C++ won't be too hard either, so maybe later I have a try.
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Measurement

Post by jriegel »

Sure,
be welcome to improve the ViewProvider for the measurement object!
http://free-cad.svn.sourceforge.net/vie ... iew=markup

I think we have more stuff to work out together since I now work seriously at the
sketch solver and thats very close to your work.
The first package I will work on is the python interface to the solver itself.
Stop whining - start coding!
Post Reply