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!
User avatar
wandererfan
Veteran
Posts: 6265
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: GSoC 2023: Unified Measurement Facility

Post by wandererfan »

Already lots of good stuff in this thread. Some additional thoughts...

transient vs persistent
Measure module has a transient implementation of various measurements (distance, angle, etc)
vulnerable to Toponaming Problem (uses object + subelement references)

measurement collection vs individual measurements
individual measurement objects clutter tree
many individual measurements may slow system down
a collection adds complexity

UI
need to be able to drag measurement away from interesting bits of the model
need to be able to toggle visibility
colours must be preferences so they can be adjusted to various backgrounds

Scope
not sure I understand the Geometry Targets concept.
primary focus should be on simple 3d geometry to geometry measures (vertex-vertex, edge, edge angles, etc)
this is probably the 80% solution.
don't know enough about meshes, Draft measures, etc to say if specialized targets are required
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: GSoC 2023: Unified Measurement Facility

Post by adrianinsaval »

I too am very interested in this project.

Allowing extension per workbench sounds good, but we mostly just need two extensions: Part and Mesh, most other workbenches shouldn't need to change anything at all and should avoid doing so as much as possible, this way the measurement experience will actually be unified.

Regarding objects in tree, a collection would indeed be better, but even if it proves too complex to do right now the measurements should at least go into a group called Measurements to have the tree organized.
hlorus
Posts: 30
Joined: Sun Oct 17, 2021 9:47 am

Re: GSoC 2023: Unified Measurement Facility

Post by hlorus »

I'm guessing there wouldn't usually be more than a handful of parametric measurements visible and invisble measurements are skipped from most calculations presumably. Therefore i'd say the performance aspect should't be too critical here.
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 »

IMO a measurement program simply measures. When I select a cylinder (bolt hole) I want the diameter and maybe the length, if I select two cylinders I normally want to know if they are parallel and the distance between them (centerline to centerline). If I select two flat surfaces I want to know if they are parallel, if they are parallel the distance between them, if not the angle/draft between them.

If I want a picture with dimensions on it I create a drawing. Then the dimension objects are in the drawing and not slowing down my part. An easier way to make a fast drawing from a screen view would be nice but not in the scope of this project.
If a user wants dimensions to stay in the GUI then IMO this should be a separate program or an option to the first program.

And how much information do you show when a person selects an item? When a user picks a vertex x, y, z is common, select two vertexes, the distance in the x, y, z and distance between is common. Other selections become harder, when selecting an edge, IMO, KISS, the length is the measurement and the placement of the vertexes is just information that can be gotten by selecting the vertexes.

Dan Miel
frcaduser
Posts: 351
Joined: Wed Apr 07, 2021 11:22 pm

Re: GSoC 2023: Unified Measurement Facility

Post by frcaduser »

Hello,

chiming in here to get my two cents in. Based on my experience using Freecad, these are the tools that would be
very helpful to include or improve upon:

1. Presentation.

a. Font: This is with regards to how the measurement values are displayed on the panel. It would be very
helpful if the font size and thickness of the measurement value is sufficient to be easily distinguishable
from the background colors and shapes. Color, font, and size user editable?

b. Location: It would help if the measurement values were not superimposed over the object that you're attempting
to measure. A suggestion that I have is to have the measurement value off to one side (maybe user
moveable to preferred location). Have a tracking arrow bar so that if you have measurement location
control, you know exactly to what that measurement pertains to. You can either drag the measurement
value or have its own 'Placement' submenu.

c. Turn Off/On: The current tool displays the hypotenuse, opposite, and adjacent values. Can the user have explicit
control of which values are displayed, maybe by way of a check off box? Also ensure that the
measurement values are not superimposed over each other appearing cluttered.

2. Angle Measurement: Able to measure angles between planes or edges. This is very helpful when you want to verify if the correct angle
has been implemented in both magnitude and direction. This is especially helpful when you want to verify that the
correct draft angle has been added to a specific surface with respect to another surface.

3. Radius: Is it possible to measure the radius of a surface. For example, this is helpful when you want to verify your design and review
the fillet radius values that were implemented on particular edges.

Update: I am proposing an alternate way to display the measurements. Please reference the added .png sketch file.
You can tabulate them via a 'measurements' window that is auto resizable based on the # of measurements taken.


frcadsuser
Attachments
alternateMeasurementDisplayOption.png
alternateMeasurementDisplayOption.png (8.58 KiB) Viewed 13501 times
potentialMeasurementExample.png
potentialMeasurementExample.png (3.85 KiB) Viewed 13696 times
Last edited by frcaduser on Thu May 11, 2023 3:25 pm, edited 5 times in total.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: GSoC 2023: Unified Measurement Facility

Post by adrianinsaval »

I also suggest a rounded (to make it fancy) rectangle behind the text to ensure it's legible, can be translucent if you want it extra fancy. <- if this is done we should eventually do it for sketcher constraints too
frcaduser
Posts: 351
Joined: Wed Apr 07, 2021 11:22 pm

Re: GSoC 2023: Unified Measurement Facility

Post by frcaduser »

Hello,

another suggestion that I have is that the measurement should appear where you are measuring. I notice that with the
current Part and Part Design workbench measuring tool, the measurement will appear somewhere along
another area. Oftentimes, you have to zoom or pan out to another area just to see the measured result.

frcaduser
hlorus
Posts: 30
Joined: Sun Oct 17, 2021 9:47 am

Re: GSoC 2023: Unified Measurement Facility

Post by hlorus »

Alright a quick update. I've been reading through the inputs here and the source code and made some changes to the planned approach. Here's a diagram of how i imagine the code structure:
code_structure2.png
code_structure2.png (34.33 KiB) Viewed 13224 times
The plan is to have one command defined in the core of FreeCAD which can be placed in a global toolbar. Modules that implement geometry types (such as Part and Mesh) will have to add measure handlers for their types.

IMO this should yield a flexible and extensible system but adds a bit of extra complexity and might not be what others imagined as @wandererfan pointed out. What do you think?

Regarding the UX of the Measurement command this should look something like this:
ux_flow.png
ux_flow.png (64.43 KiB) Viewed 13224 times
Once the tool is invoked it idles in the selection state. Whenever the selection changes it will call the handlers which return a Measurement object if the selection is valid. As a fallback behaiviour the tool will just diplay properties of the last selected element, like the coordinates of a vertex.
Note that the type of the measurement is implicitly picked, in the case where there are multiple possible types there should be a dropdown displayed.

To proceed i'll implement a basic version of the tool that already uses the described handler system but will only support a few measurment modes. Additional modes and geometry types can be added after collecting feedback and iterating on that prototype. For now i'll also focus on transistent measurments and leave persistent annotations for a later point.
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 Jun 03, 2023 8:42 pm Once the tool is invoked it idles in the selection state. Whenever the selection changes it will call the handlers which return a Measurement object if the selection is valid. As a fallback behaiviour the tool will just diplay properties of the last selected element, like the coordinates of a vertex.
hlorus: I don't quite understand the flow graft. In the graft it looks like when a element is selected a measuement is given, but it seems like you would need multiple elements to have a measurement, but when you show multiple elements you are showing element information. Maybe I'm not understanding your meaning of element.
My idea of the flow is below.
Dan
Attachments
Measurement flow.JPG
Measurement flow.JPG (26.74 KiB) Viewed 13135 times
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: GSoC 2023: Unified Measurement Facility

Post by adrianinsaval »

dan-miel wrote: Mon Jun 05, 2023 8:03 pm it seems like you would need multiple elements to have a measurement, but when you show multiple elements you are showing element information.
I think it's the other way around, element information is shown if there is no measurement type available and if there is only one element selected. And btw, in many situations is not actually necessary to select multiple elements to do measurements, if you select a line you would want the length of that line, if you select a circle you would want it's radius, if you select a face you would want it's area and maybe even moment of inertia and such.
So I think his flowchart looks good.
Post Reply