New feature demo: Measurements of selected elements displayed in bottom bar

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: New feature demo: Measurements of selected elements displayed in bottom bar

Post by easyw-fc »

onekk wrote: Fri Dec 30, 2022 10:58 am Why reinvent a ton of times the wheel.

There are around some measurement tools, why not trying to coordinate efforts to modify the actual tool to make one most useful?

I wonder why this "reasonable" approach is not taken in account.
there were many discussion on that... i.e.
https://forum.freecadweb.org/viewtopic.php?f=3&t=34213

unfortunately it seems that it is not easy to get a common consensual approach
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: New feature demo: Measurements of selected elements displayed in bottom bar

Post by onekk »

easyw-fc wrote: Fri Dec 30, 2022 11:13 am ...
unfortunately it seems that it is not easy to get a common consensual approach
I agree that collaboration is difficult, but as said wasting efforts is a bad thing.

Trying to involve some "developers" should be a way to improve things, as at the very end someone has to "validate" the PR you maybe had done with many "hard work".

I know very well difficulties in talking with other people, even taking in account that as English is not my mother language, there could be some "mismatch" in what I write and what the recipients is guessing, and sometimes I have done some mistakes, but after some clarifications, I have found very little answers without a decent reason about why the ting we are discussing is not doable.

Sometimes it is simple that "there are other thing in my to do list prior to this thing", or "this change is involving changing in a too dep way the code is working", or other "reasonable answers", or maybe a workaround, or a macro that will do same thing.

But as some matters have a "general consensus" about the fact that "how is actually working" is suboptimal or "not complete" or "almost useless", some "offer for help" will be a clever move, in general, as once worked with some developers, probably it will be more easy to "break the ice" and demonstrate your "good will", as it is not uncommon, that people came here trying to "change the world" and their efforts will result in "nothing" or "a little thing".

As there are around as example in @Kunda1 signature "low hanging fruits" in code to improve, probably, if anyone is "willing to help" solve some of these problems should be a "good entry ticket" to FreeCAD developers team.


https://tracker.freecadweb.org/view_all ... ecdb9328d9

But the link is prior to GitHub migration, but probably they could useful, if not ask @Kunda1

https://wiki.freecadweb.org/Help_FreeCAD


It will show your skills and probably introduce yourself better than many long post and elaborate ideas.

I have contributed on small things, I don't remember why my name is on the FreeCAD credits list, but probably it is about some errors reports or some other little thing, so a very small contribution, and I have edited some Wiki Pages, reported some mistypes and similar things, not a big contribution, but many small contributions will improve FreeCAD, and as we probably are here to discuss with the end goal of improving FreeCAD, better a little thing than nothing.

As FreeCAD is complex without some developers help is very difficult to make a decent work on sources, especially if they are C++ sources, so collaborations is the only way I see.

If not fork and create your own version, but as FreeCAD sources are not easy and very big to be managed by a small team of "one person" and few helpers, it is not even this a clever move.

The above are as usual my personal opinions only, as I'm an users, maybe skilled but not involved in FreeCAD development, if not for bothering some developers from time to time. :oops:

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
Saturn
Posts: 5
Joined: Fri Mar 12, 2021 5:19 pm

Re: New feature demo: Measurements of selected elements displayed in bottom bar

Post by Saturn »

The Quick Measure workbench works exactly as I envisioned for this feature, although it does take 1 more click than the always-active feature from this post. 1 click is really a minor inconvenience for taking a measurement though.

Automatically showing measurements has the downside that is sometimes takes a long time to compute values (it seems volumes for compound solids are problematic, I might have to disable that altogether). So the approch taken by the Quick Measure WB makes sense in this regard.

I might take a look at how easy it would be to port the Quick Measure code to C++ then that might result in a feature that requires less clicks and window real estate than the current Quick Measure workbench.

Another option would be to tweak the Quick Measure tool to allow docking the measurement window permanently. That would be a straight forward approach if the goal is primarily to reduce effort needed for taking measurements.
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: New feature demo: Measurements of selected elements displayed in bottom bar

Post by easyw-fc »

ok, so this option has gone again...
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: New feature demo: Measurements of selected elements displayed in bottom bar

Post by dan-miel »

Saturn wrote: Fri Dec 30, 2022 12:05 pm The Quick Measure workbench works exactly as I envisioned for this feature, although it does take 1 more click than the always-active feature from this post. 1 click is really a minor inconvenience for taking a measurement though.

Automatically showing measurements has the downside that is sometimes takes a long time to compute values (it seems volumes for compound solids are problematic, I might have to disable that altogether). So the approch taken by the Quick Measure WB makes sense in this regard.
I consider measuring as a separate function from designing or drawing. The main time I measure is when I have imported a step file or opened someone’s assembly file and I’m measuring between parts so a continuous output of numbers the rest of the time is not needed, and an add-on was fine with me. Docking QM or a similar tool permanently IMO would be a waste of screen space.
Using a dialog with a text box gave me a better way to explain the output of numbers rather than just printing a bunch of numbers and hoping the user could guess what the output meant. The textbox also allowed an easy copy/paste feature. Using a dialog box let me add buttons for options: Where is the origin in a step file? Use the origin button to find it. Do you want to measure from the midpoint of an edge? Select an edge and use the midpoint option to create a point to measure from.
This tool was created because I had a hard time figuring how to use the other available measuring tools when I wanted a quick measurement between features. Other measuring tools will be needed for more complicated tasks.

@Saturn
Good input. I'm not a programmer so my code is weird.
Dan
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: New feature demo: Measurements of selected elements displayed in bottom bar

Post by -alex- »

Thanks for the great job done here! :D

TLDR: This is the feature a lot of users expected for a long time.
Already existing more complex tools with graphical display and some panel menu are very useful as well for more informations or for complex measurements.
However, IMO your tool is definitely neccessary, it avoids carpal tunnel syndrom. FreeCAD needs it as a standard C++ tool in base code.

Full text:
Saturn wrote: Fri Dec 30, 2022 12:05 pm The Quick Measure workbench works exactly as I envisioned for this feature, although it does take 1 more click than the always-active feature from this post. 1 click is really a minor inconvenience for taking a measurement though.
+1 clic is an inconvenient IMO, such tool is very useful and often used, the more the use the more the clics.
Protect users from carpal tunnel syndrom is very important.
Automatically showing measurements has the downside that is sometimes takes a long time to compute values (it seems volumes for compound solids are problematic, I might have to disable that altogether). So the approch taken by the Quick Measure WB makes sense in this regard.
Sure, so maybe you should delete measurement features which are too CPU consuming. Or add an additional shortcut to lauch the complex part of the measurement? So that th user will decide to get or not full measurements informations.
I might take a look at how easy it would be to port the Quick Measure code to C++ then that might result in a feature that requires less clicks and window real estate than the current Quick Measure workbench.
Another option would be to tweak the Quick Measure tool to allow docking the measurement window permanently. That would be a straight forward approach if the goal is primarily to reduce effort needed for taking measurements.
IMO panel menu for existing measurements tools are great, but it clutters the screen and requiere to download addons and/or load WB. Not so easy for beginers.
A text string on bottom of the screen as you done, futhermore as in status bar which is empty, that's perfect at first sigh for beginers and for everyone, that's actually the best way to save screen space for modeling. Then if users want more informations, they will search for more complex tools with graphic panel/popup/buttons/icone interface then they'll download then clic to acces appropriate tools.

Go ahead! ;)
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: New feature demo: Measurements of selected elements displayed in bottom bar

Post by onekk »

Probably the best way will be to have a way to make some measurement in the 3d view using the "right click menu".

Now the behaviour (0.20.2) is that when you select something you will have in the statusbar these informations:

Preselected: "description of what yo have selected" and some data.

But as example for an edge, it will be interesting to have the length if is a line or maybe if is a circle even the radius and the center.
now there is three coordinates, that is the point on which you clicked, interesting, but not very useful.

adding "Curve type" = "Line circle, or similar" the start and ending point coordinates, and maybe for circular arcs, start and end degrees, radius and center.

As example using python console on a circular edge I get:

Code: Select all

print(obj.Shape.Edges[7].Curve)
Circle (Radius : 2.675, Position : (0, 1.90348e-15, 8.5725), Direction : (-0, 2.22045e-16, 1))

This should be achieved in the stock FreeCAD interface, without the need to load anything.

Probably it will be very useful, at least for edge, when modelling.

For faces, what will be a decent set of information, maybe the nature of the surface (plane, or BSplineSurface or similar thing).

Probably for more "complete" info will be interesting to have when you select and right click a menu other than Navigation with maybe an "Geometry Info" items that will supply only when selected more informations.

This should be not a complicated task even in C++ and an interesting addition.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: New feature demo: Measurements of selected elements displayed in bottom bar

Post by -alex- »

onekk wrote: Fri Jan 06, 2023 3:34 pm Probably the best way will be to have a way to make some measurement in the 3d view using the "right click menu".
IMO not the best:
- it adds 1 clic plus moves of mouse -> carpal tunnel syndrome disease.
- measurements information are not displayed by default, then some beginners will not see it easily and will still ask us "how measure elements in FC?"
Now the behavior (0.20.2) is that when you select something you will have in the statusbar these informations:
Are you sure about that? I hope I get you right, but AFAIK now element information is displayed in status bar when mouse cursor spend over elements, no any selection is needed or even efficient.
Hence element information could be temporarily overwritten by measures information, when elements are selected, right?

In some big CADs such measurements text information at first sight provide only mains dimensions, not too much information.
Type of elements is even not mentioned:
- if you read "D=50" you know it's about a diameter of 50mm (360° closed arc in FC)
- if "R=33.5" you know the element an arc (+ center, arc length, angle, cord length or whatever...)
- if "length=xx + start-end points coordinates" means the element is a line (+ delta x,y,z if you want)
- "length (only) = xx": means a accumulation of selection of lines and/or arcs or bsplines
- etc...
- no solid, no weight, no area information available in such tool for quick look.

IMO that is the good approach. Very clear, simple, readable, lightweight, fast: powerful.
If the user want more measurements information he has to use a more specialized tool, like existing measurement tools in addon manager or in some WB.
That's my opinion, but I'm just a CAD experimented user. I let developers talk now.
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: New feature demo: Measurements of selected elements displayed in bottom bar

Post by onekk »

-alex- wrote: Fri Jan 06, 2023 4:39 pm ...
IMO not the best:
- it adds 1 clic plus move of mouse -> carpal tunnel disease.
- measurements informations are not displayed by default, then some beginers will not see it easily and will still ask us "how measure elements in FC?"
...
How many times you want a complete info about an object regarding measurement, not every time you select them. so carpal tunnel is not a problem at least in this case.
-alex- wrote: Fri Jan 06, 2023 4:39 pm ...
Are you sur about that, as I can see now element informations are displayed when mouse cursor spend over elements, no any selection is needed. I hope I get you right?
So that those element informations could be temporily overwrite by measure informations, just when elements are selected?
In fact, only when I select explicitly an element additional infomation should be displayed, not to overload FC when not needed to measure thing, but this is a personal preference.
-alex- wrote: Fri Jan 06, 2023 4:39 pm In some big CADs such measurement text informations at first sight provide only mains dimensions, not too much informations.
Type of elements is even not mentioned: if you read ... In progress
IMO that is the good aproach. If the user want more mesurment informations he has to use a more specialized tool, like existing mesurement tools in addon manager or in some WB.
Main dimensions for a circle "radius, center" are the data you need to know for a line, length and probably start and ending point.

I admit that this things has to be discussed by users and developers, to evaluate:
  1. coding cost of additional info
  2. information that are needed and are easily retrievable in term above 1)
  3. better way to show informations, in the statusbar seems a good place, any additional thing should make 1) more heavy
Probably an alternative way could be to show measurement after some time spent on the element, like after 1sec additional infos will appear in the status bar. But I don't know what this behaviour will affect point 1) above.

If you want a more complete info something should be available in the main interface, for useful info, for more "specialized info" an addon or a WB should be appropriate.

When I model I use mainly scripting so absolute informations, like lengths and start and end point position will suffice for me, to verify things during creation, and I think that even when modelling with GUI you don't need usually informations such tangents, derivative or other things, maybe [pnt, dir] that you will find the Part.make... methods will be interesting, not much more.

I'm not considering things related to links and compounds, as the "global placement" could enter the game, even in Vertex positions.

I'm made this considerations for measurements made on solids shown on 3d view only, as usually measurements are useful when you as example convert a solid from a mesh.

Main point IMHO is to improve the ability to evaluate quickly things, I select and edge of a solid and I have his length and his build data (if they are not to complex to retrieve).

As example I doubt that someone will need "center of Mass", or similar data directly in the interface as usually you need this data when as example you want to create something using draft or Part, as in Sketcher (or Part Design) the workflow is completely different, as for a constraint driven modelling, absolute positions are not useful, i could make four points and then assign lengths later with constraints.

Regards

Carlo D.

Edited to correct considerstions about carpal tunnel, my intention was not to underestimate the problem. :D
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: New feature demo: Measurements of selected elements displayed in bottom bar

Post by dan-miel »

onekk wrote: Fri Jan 06, 2023 5:24 pm Main dimensions for a circle "radius, center" are the data you need to know for a line, length and probably start and ending point.
When a user makes a circle and another feature touches the circle it will create two arcs. I found it hard to determine arcs from circles.
When measuring an arc or circle, sometimes I wanted the radius and other times I wanted the diameter, I made errors by multiplying and dividing in my head.
For the two reasons above I included both radius and diameter in the output.
If I wanted the start or end point of a line or circle I clicked on it to retrieve the x, y, z position.

onekk wrote: Fri Jan 06, 2023 5:24 pm When I model I use mainly scripting so absolute informations, like lengths and start and end point position will suffice for me, to verify things during creation
I don't use scripting to model parts so I never considered that.

If I were to further develop the Quick Measure tool I would like to be able to set the number of decimal units separate from FreeCAD’s units and the decimal units for degrees separate from others. The measurements are converted in separate Def statements for this reason.
These are just some reasons why the tool ended up the way it is. I know other people have other opinions.
Dan
Post Reply