[RFC] standalone measurement panel for FC

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
uwestoehr
Posts: 2385
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

[RFC] standalone measurement panel for FC

Postby uwestoehr » Tue Jan 12, 2021 2:00 am

One of the complaints I hear for sure when showing new persons FreeCAD is that there is no measurement tool that can do everything. And that was also one of the things I missed quickly after starting with FC.

To improve the situation, there should be a standalone measurement tool available for all WBs
The question is what content will/could it have? And this is what I want to discuss here.

My opinion:
- For daily work one needs to measure distances, angles and radiuses. It should furthermore provide the feature to calculate the length of edges, areas, center of mass and geometric center of faces and also volumetric info like center of mass of selected bodies.
- the tool should behave like the clipping panel - available for all WBs, you can move it around or dock it to where you like.

Personally I use the measurement tool of the Part WB daily in combination with the one from the Manipulator WB. Recently I discovered the measurement tool from the Assembly 4 WB and use this one now too.
Concerning the tool from the Part WB, last week I fixed the angle tool and realized that this tool will never become as powerful as necessary. Thus I would say the manipulator and the assembly 4 tool should be used as basis for the standalone measurement tool.

Newbies opinion:
As a developer I am biased. But I have a new colleague coming from Solidworks. He is now learning FreeCAD and, surprise, surprise :mrgreen: complained the second day that there is no tool to measure radiuses and lengths. I informed him about Manipulator, Assembly 4 and showed him how to use the tool from the Part WB and asked for a quick feedback. Here are the results:
- he likes with the manipulator tool that it stays open when switching to another WB
- he likes with the Assembly 4 its compact output with results provided as copyable text
- he wonders why be default the results appear in the tree despite one mostly just need the result and not more. (Note from me: I see that with the assembly 4 tool one can by pressing Cancel keep the tree clean after one is done.)
- if one decides to keep a measurement result in the tree, then it should be updateable. So if one e.g. later changes a radius the results in the model tree should be updated on demand (like the Part WB provides).

-------------------------

What is your opinion?
Do you agree that FC should get a standalone tool?
If so, what do you think it should provide?
What are the requirements for larger "parts" ;) , meaning buildings?

EDIT: to clarify: the FC 0.19 development cycle should come to an end, so the outcome of this discussion should in my opinion be FC 0.20 stuff.

Zolko wrote: .
easyw-fc wrote: .
yorik wrote: .
kbwbe wrote: .
Last edited by uwestoehr on Thu Jan 14, 2021 10:20 am, edited 4 times in total.
ickby
Posts: 3005
Joined: Wed Oct 05, 2011 7:36 am

Re: [RFC] standalone measurement panel for FC

Postby ickby » Tue Jan 12, 2021 7:19 am

I think a standalone tool is the way to go, it would be super nice! So here is what I would like to have for my work:
  1. A single tool for all measurements, which can stay open and is dockable (not blocking the edit workflow by using the task view)
  2. Results are shown in the tool, not in the tree
  3. Showing properties based on what I select. E.g. if I select a straigth edge it shows the length, if a full body the volume, a circular edge the radius etc. So all available information shown dependend on selection. I do not want to have a million options to choose what to measure beore the selection.
  4. Showing measurements based on what I select, e.g. selecting two edges: max distance, min distance, selecting two bodies: summed mass, shared center of gravity etc. Again I do not want to have a million options to choose what to measure beore the selection.
  5. All available results are simply listed in a text field to be easily copy/pastable
  6. All measurements are shown with units, and there is a simple and intuitive way of changing the units in the tool (useful for communiucation with others while exploring the model together)
  7. There is a selection helper UI: you can choose to only select edges, or vertices for the next click, etc., maybe even the display mode to wireframe etc... everything needed to select hard to reach entities.

Implementation wise I think this should be a central FreeCAD tool which can be extended by individual workbenches. E.g. only Part workbench knows how to measure and access shapes, mesh knows about triangular meshes, Pointcloud about... etc. So I think two ways are possible:

First the extension system could be utilized. The measurement tool is provided by mesurement Workbench and adds a Measurement extension. This extension is the interface that the measurement tool uses to grap all information, and than all workbenches can add this extension to the relevant document objects and implement its methods.

Second option would be to implement it more in the heart of freecad. There is a general "geometry" abstraction layer in FreeCAD, which is quite rudementary at the moment. One could detail this out to be enough for geometrical measurements. This is already inherited by part and mesh etc. I think currently only for selection purposes.
User avatar
Zolko
Posts: 1227
Joined: Mon Dec 17, 2018 10:02 am

Re: [RFC] standalone measurement panel for FC

Postby Zolko » Tue Jan 12, 2021 7:38 am

A agree that FreeCAD should have a good built-in standalone measurement tool. I think it should be written in Python, meaning it's really a macro.

But I don't like it to be dockable, I prefer to have it either as a task panel or as a floating window. I use this tool often, but not continuously, and I don't want it to clutter my screen when I don't use it. So I prefer to activate it when needed, and have it out of the way when not. That's how SolidWorks measurement tool behaves I think.

There is also a technical aspect to it : such a measurement tool needs a selection observer, so if you have it always available this might interfer with other tools that have their own selection observer.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
wmayer
Site Admin
Posts: 17067
Joined: Thu Feb 19, 2009 10:32 am

Re: [RFC] standalone measurement panel for FC

Postby wmayer » Tue Jan 12, 2021 2:19 pm

issue #0000503

ickby already said it all how it should be implemented.
chrisb
Posts: 32055
Joined: Tue Mar 17, 2015 9:14 am

Re: [RFC] standalone measurement panel for FC

Postby chrisb » Tue Jan 12, 2021 9:24 pm

There is nothing to say against good tools, but I wonder what you are all measuring around? I mean parametric modeling is not like modeling with clay, where you add something, measure, add some more, measure, remove, ... You set a measure and it has the measure.

So this urgent need for a measuring tool may be - as described in the OP - helpful for newbies as a matter of reassurance, that things after modeling have indeed the right measures. But with more and more experience, measuring becomes less and less important.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Posts: 2385
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: [RFC] standalone measurement panel for FC

Postby uwestoehr » Tue Jan 12, 2021 9:54 pm

chrisb wrote:
Tue Jan 12, 2021 9:24 pm
I wonder what you are all measuring around?
I guess you are joking. If not:
- You'll never work alone! You get all the time models from others, or you download STEP files from part suppliers because you need to integrate e.g. a motor into your device. Or you need to design a housing for PCBs etc.
- for example with 3D-printing and injection molding the designs often use splines, so you need to measure out e.g. distances at certain positions
- you need to control yourself - maybe you made a typo and your fillet is now 5.4 instead of 4.5 or an extrusion is 12.3 instead of 12.6.
- there are countless other use cases
davidosterberg
Posts: 436
Joined: Fri Sep 18, 2020 5:40 pm

Re: [RFC] standalone measurement panel for FC

Postby davidosterberg » Tue Jan 12, 2021 10:25 pm

A few additional features

- measure central distance between holes (or cylindrical surfaces)
- measure the BCD of a circular hole pattern by selecting 3 holes and telling the tool that they are lying on a circle
kbwbe
Posts: 1011
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: [RFC] standalone measurement panel for FC

Postby kbwbe » Wed Jan 13, 2021 9:43 pm

chrisb wrote:
Tue Jan 12, 2021 9:24 pm
But with more and more experience, measuring becomes less and less important.
I think this is a wrong assumption.
When doing big projects, many step files are used, a lot of complex sub-assemblies too. Not all dimensions are clearly written to data sheets. Not every aspect of a subassembly mets the requirements of a main assembly. It is not possible to calculate everything in advance when doing big designs. Good measuring is really necessary to control and fix things. Just at moment i am working for a complex machine design, see the screenshot. Without measuring, i would be lost. Getting more powerful measuring tools would be great!
.
packaging-machine.png
packaging-machine.png (354.76 KiB) Viewed 329 times
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.52, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
jmaustpc
Posts: 10791
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: [RFC] standalone measurement panel for FC

Postby jmaustpc » Thu Jan 14, 2021 5:03 am

wmayer wrote:
Tue Jan 12, 2021 2:19 pm
issue #0000503
Almost 10 years ago! :) I also agree with you.
ickby wrote:
Tue Jan 12, 2021 7:19 am
I think a standalone tool is the way to go,
I agree of course,
uwestoehr wrote:
Tue Jan 12, 2021 2:00 am
What is your opinion?
I agree, but I just wanted to say that most or all of that functionality exists in FreeCAD already, in various places (some more hackish than others) and some in addons.

For example if we forget about the add ons/macros, there is still Part Check Geometry (in 0.19 gives volumes and other data), Yorik's Survey tool, Draft Dimensions, the Python command line, attach a sketch and use external geometry and driven constraints (that is hackish of course but does work), obviously Part Measure tools, also the measure distance tool (I think Werner once told me that we got that functionality pretty much for free with coin or something like that...), even TechDraw with its dimensions or linked dimensions, Some of this can be read via an expression for example in a spreadsheet cell or elsewhere.
uwestoehr wrote:
Tue Jan 12, 2021 2:00 am
- if one decides to keep a measurement result in the tree, then it should be updateable.
For example, that is exactly what a "linked" Draft Dimension does,

I am saying "yes please" this is a good idea, just that you can tell your newbie friend that most advanced users have long since worked out how to get data with work arounds etc. so it's not impossible.
User avatar
Zolko
Posts: 1227
Joined: Mon Dec 17, 2018 10:02 am

Re: [RFC] standalone measurement panel for FC

Postby Zolko » Thu Jan 14, 2021 12:42 pm

wmayer wrote:
Tue Jan 12, 2021 2:19 pm
issue #0000503
that leads to a thread where I read:

NormandC wrote:
Sun Feb 10, 2013 9:01 am
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.

If you want a measurement to be permanent, it's a dimension you should be using.
THIS is the good way for me. OCC has mostly all the info needed to do the measures, and FreeCAD already exposes those functions to python:

Code: Select all

measure = shape1.distToShape(shape2)
angle = dir1.getAngle(dir2)*180./math.pi
radius = circle.Curve.Radius
center = circle.Curve.Center
uwestoehr wrote:
Tue Jan 12, 2021 2:00 am
- he likes with the Assembly 4 its compact output with results provided as copyable text
The Assembly4 WB's measurement tool is a stand-alone Python script that can do all of the measurements listed here. Please feel free to make it a stand-alone tool and improve upon it. As for window, task, or side-panel, this could be an option set by the user (I prefer the task panel)

Visually it's quite primitive, but I use it for real work:

dims_and_angle.png
dims_and_angle.png (196.31 KiB) Viewed 233 times
pos_RefCS_IPAGINAF.png
pos_RefCS_IPAGINAF.png (210.7 KiB) Viewed 233 times
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here