Measurements Framework?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
mrlukeparry
Posts: 655
Joined: Fri Jul 22, 2011 8:37 pm
Contact:

Re: Measurements Framework?

Postby mrlukeparry » Sun Feb 10, 2013 11:07 am

yorikvanhavre wrote:I have difficulties to totally imagine how would be the first tool... Would you just click 2 points, or an edge, and it would give you a length? But that would be just text output in the output window? Or would it involve displaying something in the 3D view? In that case how would it be different from tool 3? Or is it like the solidworks example, it draws a line and a dimension in the 3d view, but that vanishes as soon as you finish the tool? I'm not imagining something very kick-ass such as draw an actual ruler where you could count the millimeters (there is something like that in heekscad IIRC) or a protractor when measuring angles...
Yes it would hopefully have lines in the 3D view to represent what is being measured (such as delta x, delta y, delta z etc.)
yorikvanhavre wrote:- P3 (a point through which the dimension line passes)
- Direction (the direction of the dimension line, this would allow us to measure a distance on any axis, for example the distance on the Y axis of 2 points that are not on the same Y axis)
- ObjectLink1 (a link to the first object to be measured)
- ObjectLink2 (a link to the second object to be measured)
- Element1 (the element of ObjectLink1 to be measured (Edge1, Face3, Vertex4,...). If the element is an edge or a face, its center point would be used )
- Element2 (the element of ObjectLink2 to be measured)
That seems to make sense to me. I think the current dimension tool in draft needs to reference actual parts of the geometry so it is more parametric and also accurate,and that would be a significant improvement.
jmaustpc wrote:would it be a good idea if I write a guide lines document (that you guys could modify) on the wiki or elsewhere that covers all of this?
It would be helpful to have this somewhere else, so that it doesn't get lost in the forums in the distance future.
normandc wrote:Measurement should not be only about linear distance, but about any type of measurement: angle between 2 edges or planes, minimum distance between two surfaces, a few others that I don't recall ATM. Persistence is irrelevant to measurement, although the measurement history like in the SW 2013 video would be a great plus. You use the measurement as a temporary tool, it shows a visual cue (line between selected vertices, arc between edges/planes for an angle query) and vanishes when you're done with the tool. It is like working in any shop when you take your tape measure or protractor to check on some distance or angle. I use measurements extensively.
In Soldiworks it simply shows the 3D components of the distance and the overall distance between the set of points.
normandc wrote:If you want a measurement to be permanent, it's a dimension you should be using. About dimensions on a 3D model, they could be part of a wider set of attributes which is sometimes called PMI for product manufacturing information. I think this naming scheme comes from Siemens PLM (formerly UGS) but there is something to this effect in the ISO 10303 (STEP) standard.
True, there are lots of things to consider in this and will require considerable effort to get up to the standards.
normandc wrote:So what I'm saying is we need some kind of "measurements" toolbar or workbench with these measurement tools (the two I mentioned in addition to the linear distance measurement tool), and a PMI toolbar, or for starters a Dimensions toolbar, since a full PMI toolbar may be a big job to implement.
I think a task view would be better for this, since there are quite a lot of properties that would need to be assigned.
User avatar
yorik
Site Admin
Posts: 11585
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Measurements Framework?

Postby yorik » Sun Feb 10, 2013 3:27 pm

normandc wrote:Basically PMI includes geometric dimensions and tolerances (GD&T), annotations and other relevant info to a model.
Damn, one more standard!:)
normandc wrote:It is like working in any shop when you take your tape measure or protractor to check on some distance or angle. I use measurements extensively.
Exactly! This is the analogy I am thinking to too... I'm pretty sure heekscad has a ruler tool, but I can't find back, I'll compile it again to see. Sketchup also has a protractor tool where a real protractor appears... Maybe we could build 2 cool new coin nodes... Maybe we could even draw them in FreeCAD, then convert to .iv...
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Measurements Framework?

Postby NormandC » Sun Feb 10, 2013 5:51 pm

I've used the protractor in SketchUp. It's just an annoying gimmick IMO. And it's limited too, since it only accepts 3 points, so the 2 edges must coincide on one point. If you have two separate edges it doesn't work.

I think visually this should be kept as simple as possible. The icon could be a protractor though! But I wonder, these days with design work being done almost exclusively on CAD, who remembers what a protractor looks like or what it's for, except experienced people like us (I won't say old! :D ) who saw the advent of personal computing? What about young people? Luke, do you know what a protractor is? :P
mrlukeparry wrote:I think a task view would be better for this, since there are quite a lot of properties that would need to be assigned.
To be honest I didn't much think about where or how to implement this. The task view would be a great place so there is no pop up dialog grabbing screen space. That's what Keith did for his Info wb. But the icons need to be somewhere, hence a toolbar. As a few people have said these tools could be available in any workbench, I wouldn't mind it there was a specific "Inquiry" workbench grouping the measurements and possibly PMI stuff, but I know other people find it a hassle to switch workbenches. I don't mind much, as long as the tools are there. ;)
mrlukeparry
Posts: 655
Joined: Fri Jul 22, 2011 8:37 pm
Contact:

Re: Measurements Framework?

Postby mrlukeparry » Sun Feb 10, 2013 6:36 pm

normandc wrote:I think visually this should be kept as simple as possible. The icon could be a protractor though! But I wonder, these days with design work being done almost exclusively on CAD, who remembers what a protractor looks like or what it's for, except experienced people like us (I won't say old! :D ) who saw the advent of personal computing? What about young people? Luke, do you know what a protractor is? :P
Probably the last of our generation. We had graphical design at high school, so we had to draw by hand technical drawings on paper. They were starting to introduce CAD at that point, but was very limited to 2D vinyl cutter, circuit board cutter. The other day we were asked if we even knew what floppy disks were haha.
normandc wrote:I've used the protractor in SketchUp. It's just an annoying gimmick IMO. And it's limited too, since it only accepts 3 points, so the 2 edges must coincide on one point. If you have two separate edges it doesn't work.
I don't think in Solidworks it can measure 3D angles - I have only had to do this once but had to basic trigonometry to work it out from the components.
normandc wrote:To be honest I didn't much think about where or how to implement this. The task view would be a great place so there is no pop up dialog grabbing screen space. That's what Keith did for his Info wb. But the icons need to be somewhere, hence a toolbar. As a few people have said these tools could be available in any workbench, I wouldn't mind it there was a specific "Inquiry" workbench grouping the measurements and possibly PMI stuff, but I know other people find it a hassle to switch workbenches. I don't mind much, as long as the tools are there. ;)
When I meant task view it was for the dimensions, not necessarily the measurement tool. One thing we have to consider is if the measurement tool (1) can be still used during an operation such as an extrude without interruption. It probably would be useful if it was.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Measurements Framework?

Postby NormandC » Sun Feb 10, 2013 7:05 pm

mrlukeparry wrote:I don't think in Solidworks it can measure 3D angles - I have only had to do this once but had to basic trigonometry to work it out from the components.
I haven't used SW in quite some time so I don't remember. But there is a 3D angle measurement tool in Solid Edge and I find it very useful. I mostly use it in the Assembly environment. Now that I think of it, measurement tools could also be in a specific menu available to all workbenches, and if users want to create a measurement toolbar they could customize one.
jmaustpc
Posts: 9566
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Measurements Framework?

Postby jmaustpc » Mon Feb 11, 2013 12:50 am

My point for wanting what I referred to as optional "persistence", like the current tool is that I sometimes want to measure one, or often more than one thing, and leave a note somewhere which I can refer to temporarily while creating some aspect of the model. But then I don't want them confusing the end result model. However I could just use a dimension for that, and then delete it later.

mrlukeparry wrote:One thing we have to consider is if the measurement tool (1) can be still used during an operation such as an extrude without interruption. It probably would be useful if it was.
That is a really good point. My objection with putting measurements (and to a lesser extent dimensions) in a separate workbench is the interruption to the work flow. Picture you in the middle of doing anything and then you think "what was that value again", you don't want to stop everything and have to change to another workbench and back again, just to check an angle/dimension/parameter etc. Although I could understand someone's work flow, wanting to finish a model and then go back and add all the dimensions as another operation in which case changing workbenches would seem more rational.

Another point about "measurement", it should display its output such that it can be copy/pasted into something, e.g. an extrude length or perhaps and angle constraint in sketcher.
yorikvanhavre wrote:Sketchup also has a protractor tool where a real protractor appears...
KDE has a utility called KRuler. I is both very limited and yet also has some very useful features. It might be worth a look in case it gives anyone some inspiration, although probably not much applicable to CAD. Its under in the menu Graphics..more applications...
Its limitations,
  • it only measures 2d and only horizontal and vertical.
Its good points,
  • you can change its units, change the order of the units (from left, right or centre), the units can be percentage, and units can be offset (start at something other than 0), it also has variable opacity, it has an accurate pointer line thingy mouse pointer that appears when you hold the mouse over the ruler
@ Norm, of course the young ones know what a protractor is....................they looked up Wikipedia! :D
jmaustpc
Posts: 9566
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Measurements Framework?

Postby jmaustpc » Mon Feb 11, 2013 4:09 pm

I have been playing around with some concepts for icons,

I thought perhaps for measure the icons could show the tool you might measure it with, perhaps something like these?
https://sites.google.com/site/austpcpub ... ns/measure


where as dimensions icons could show the dimension itself, perhaps something like these?

https://sites.google.com/site/austpcpub ... dimensions

note the 3 sub-pages radius, diameter and lineal. These are just direct links to those sub-pages
https://sites.google.com/site/austpcpub ... ons/radius
https://sites.google.com/site/austpcpub ... s/diameter
https://sites.google.com/site/austpcpub ... ons/lineal

good night

Jim
mrlukeparry
Posts: 655
Joined: Fri Jul 22, 2011 8:37 pm
Contact:

Re: Measurements Framework?

Postby mrlukeparry » Wed Mar 06, 2013 4:53 pm

I'm going to try and put a plan together for some measurements framework.

One thing I would like some input on is the Python interface because it would be extremely practical to use here: My thoughts were that it should be a simple c++ class / python object where one or two argument are provided: these are links to edges or vertexes, faces or features.

Depending on the arguments, you could call method to obtain geometric information:

Code: Select all

myMeasurement = Measurement(Vertex, Vertex)
print myMeasurement.length => displays computed length
print myMeasurement.area => displays error (not 2d)

myAreaMeasurement = Measurement(Surface)
print myAreaMeasurement.length => displays error (since 3D / 2D Object)
print myAreaMeasurement.area => displays surface area
My motive to keep it simple is so that in theory a person who knows very little about programming can make a measurement without a GUI fairly easily in two lines. Hopefully this seems quite logical?

Eventually later this Measurement could be passed to a permanent Dimension Feature which extends the measurement with greater annotation detail - e.g. line type, tolerances etc..
User avatar
yorik
Site Admin
Posts: 11585
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Measurements Framework?

Postby yorik » Wed Mar 06, 2013 8:23 pm

Wow, that seems very cool! Indeed it might become useful for a lot of situations and could be fairly easy to put in macros...
User avatar
tanderson69
Posts: 1501
Joined: Thu Feb 18, 2010 1:07 am

Re: Measurements Framework?

Postby tanderson69 » Tue Nov 26, 2013 8:49 pm

Alright I have made some minor moves on this. I hacked in BRepExtrema_DistShapeShape into part workbench for now. Preliminary testing is working good. See image below.

I have created an inkscape svg drawing of what I am thinking. It can downloaded here:https://files.one.ubuntu.com/3Ka2mX3IQAqVocrVWLd-6Q

At this time I have 2 major questions, they are also on the drawing from above.

1) Is everything we will want to measure ultimately expressed as a TopoDS_Shape? I am guessing not, and how should we deal with this from a programming stand point.

2) Transparent command(for lack of a better term). I would like to be able to lauch the measure command, during another command. For example: Lets say I am half way through making a linear pattern in the part design workbench and I need to measure something. Can we make it so, we take our measurement and return to the linear pattern with data intact? Almost like a "command stack".
measureScreenDump.png
measureScreenDump.png (212.96 KiB) Viewed 2306 times