GSoC 2023: Unified Measurement Facility

Contributions from the participants, questions and answers to their projects.
Discussions of proposals for upcoming events.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
hlorus
Posts: 30
Joined: Sun Oct 17, 2021 9:47 am

GSoC 2023: Unified Measurement Facility

Post by hlorus »

Hey there,

I'm David (hlorus), I'm motivated to participate in this years GSoC event. This thread is for discussion and feedback about the Unified Measurement Facility.

FreeCAD currently has several ways of measuring objects, causing confusion for users and making the learning curve steeper. The project aims to implement a generic measurement command that can be extended by workbenches, refactor and port existing commands to use the
new system, and polish existing measuring commands for a consistent user experience.

I'll be posting here about my progress and appreciate any kind of support and feedback.

Primary mentor: @wandererfan

Reference:
GSoC 2023 Proposal.pdf
(69.17 KiB) Downloaded 192 times
GitHub issue
Working fork
User avatar
bambuko
Veteran
Posts: 2185
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: GSoC 2023: Unified Measurement Facility

Post by bambuko »

As far as existing functionality, there is also "delta X,Y,Z"

Gives the Delta values and distance between 2 points.
Start the macro
Select the first point in 3D view
Select the second point in 3D view
If the "SHIFT" key is pressed, the Delta value begin on coordinate 0,0,0 to point clicked (the coordinate 0,0,0 is displayed in red).
One option is possible for the macro stay resident (continuous) then push "Q" key to quit the macro, and option for impose the number of decimals or use the decimal in the preference option.

Macro version: 0.2
Last modified: 2020-10-23
FreeCAD version: All
Download: ToolBar Icon
Author: Mario52

Macro location: https://wiki.freecadweb.org/Macro_Delta_xyz


I wouldn't be without it - use it all the time.
Hopefully this can be added to your all encompassing thingy, please?
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: GSoC 2023: Unified Measurement Facility

Post by onekk »

Interesting.

It is advisable to have a unique place were you could make measurements, and probably even a simple way to display annotated dimensions.

I make model for other people and having a quick way to makea screenshot of a dimension that lacks of a proper measure in project will be very welcomed.

Actually I have to:

- make a screenshot
- crop with an external program the 3dview content
- use another external program to annotate the image.

Avoiding the external annotation phase would be great.

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/
maxwxyz
Posts: 168
Joined: Sat Dec 31, 2022 2:42 pm
Location: Munich, Germany
Contact:

Re: GSoC 2023: Unified Measurement Facility

Post by maxwxyz »

This is really great news, thanks for your effort.
I would appreciate if you could switch between different results and still keep your selection (maybe multiple results could be displayed at the same time). Interesting results would be, depending on the selection:
  • Length (also of an arc) and Distance (min/max, also between two edges e.g. two circles or filleted faces)
  • Angle (between three points, two lines, two surfaces or an arc)
  • Area (of body or selected faces) and perimeter
  • Volume
  • Mass
  • Center of Mass
  • Center point (e.g. hole, arc, circle)
  • Diameter (on edges/circles but also surfaces like holes)
  • Radius (also on surfaces, e.g. fillets)
  • Inertia (moment of inertia and area moment of inertia around a selected axis)
It would be beneficial if the tool could support or asks for the selection mode of the first and second input, e.g. any geometry, edge only, and so on. Points to select or reference would be
  • Points
  • Edges
  • Surfaces
  • Bodies, parts
  • Midpoints, arc center
  • Axis
  • Intersection
  • An individual "picking point" of the geometry under the mouse cursor if there is no select-able feature
It would be awesome if new geometry could be created (and maybe linked/updated) through the measurement selection. For example measure a distance between two circle midpoints and create a new line/edge from this measurement or output this vector in any form to use as a new reference. Or create the center of mass as a new point in the model tree.
It would be also great if the tool could output the result in coordinates (absolute and relative to first selection)
mario52
Veteran
Posts: 4692
Joined: Wed May 16, 2012 2:13 pm

Re: GSoC 2023: Unified Measurement Facility

Post by mario52 »

Hi

Thanks @bambuko
maxwxyz wrote: Sun May 07, 2023 9:04 am Length (also of an arc) and Distance (min/max, also between two edges e.g. two circles or filleted faces)
Angle (between three points, two lines, two surfaces or an arc)
Area (of body or selected faces) and perimeter
Volume
Mass
Center of Mass
Center point (e.g. hole, arc, circle)
Diameter (on edges/circles but also surfaces like holes)
Radius (also on surfaces, e.g. fillets)
Inertia (moment of inertia and area moment of inertia around a selected axis)
have you tried Macro_FCInfo Image (info only with 1 object selected)
maxwxyz wrote: Sun May 07, 2023 9:04 am selection mode
  • Points
  • Edges
  • Surfaces
see Macro_Select_Hovering Image
maxwxyz wrote: Sun May 07, 2023 9:04 am Bodies, parts
and all type Macro_FCTreeView Image

you have to study , enjoy

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.
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: GSoC 2023: Unified Measurement Facility

Post by onekk »

maxwxyz wrote: Sun May 07, 2023 9:04 am ...
Did you trad GSoC proposal document?

You are mixing too many different things.

This is focused on the measurement tool, eventually expanded for a simple annotation system.

Once this new code will be in place other coders could make specialized tools.

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/
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: GSoC 2023: Unified Measurement Facility

Post by openBrain »

Interested in this one. Will try to follow progress and advise if needed. ;)
maxwxyz
Posts: 168
Joined: Sat Dec 31, 2022 2:42 pm
Location: Munich, Germany
Contact:

Re: GSoC 2023: Unified Measurement Facility

Post by maxwxyz »

onekk wrote: Sun May 07, 2023 12:31 pm ...
Just saw it, thanks for the reminder. I was fiddling around with the measurement tool and spiraled in new ideas :|
mario52 wrote: Sun May 07, 2023 11:29 am ...
Awesome thanks! I never think of the add-ons :roll: BTW off-topic: is there a script or setting I can copy to a new machine when setting up FreeCAD to install all my last workspaces and macros?

And I am still curious if new measurement tools will be implemented.
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: GSoC 2023: Unified Measurement Facility

Post by onekk »

maxwxyz wrote: Sun May 07, 2023 12:58 pm ...

is there a script or setting I can copy to a new machine when setting up FreeCAD to install all my last workspaces and macros?
...
Usually it suffice to save /Mod directory found in your user directory for WB and Macro folder.

but Macro folder place could be customized.

There are some posts around.

Regads

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/
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: GSoC 2023: Unified Measurement Facility

Post by dan-miel »

hlorus wrote: Sat May 06, 2023 6:47 am I'm David (hlorus), I'm motivated to participate in this years GSoC event. This thread is for discussion and feedback about the Unified Measurement Facility.
Welcome David.
It is good to see someone take this project on. This is long overdue.
Thanks in advance for your time.
Dan Miel
Post Reply