Ondsel-Development / FreeCAD

This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler.
https://www.freecad.org
Other
192 stars 9 forks source link

[Feature Request] Better Measuring Tools and General Reverse Engineering (and a few bugs) #138

Open stevenwalton opened 2 months ago

stevenwalton commented 2 months ago

Is there an existing issue for this?

Problem description

One of the common tasks in engineering this is reverse engineering things, even if the sole purpose of this is so that you have the part to build things on top of.

I've also identified a few bugs

There's a lot of issues with the current systems of measuring that make these tasks quite cumbersome. I think this might be easier to understand from an example so we can understand motivation and pain points. I'll include screenshots to illustrate the points and you should be able to click on them to view the higher resolution images.

TLDR:

Illustrative Example

I've been slowly importing a cad model for my 3D printer. While FlashForge does provide STEP files for their official upgrade, there are issues[^1] with the files and I don't exactly trust them to be reliable. But it is much easier to start from these and work compare with my printer in front of me without needing to do a much larger teardown. It's better than tracing from pictures :)

[^1]: Ondsel/FreeCAD definitely isn't happy about the Chinese language naming.

So typical fashion I might want to outline things through sketches.

Tracing Over Part

Screenshot 2024-09-12 at 5 14 00 PM

Here's the first pain point. I want to actually have the part building in a new project. Not a big issue, I can just copy the new part from one project to another. But we have the tree there on the left and I can select things from the other project, just enabling the ability to show it a body so I can directly trace in the new project instead of the old and then transfer saves a lot of time and effort because the copy actions are costly and we get some unnecessary recency.

Next is the larger pain point: measurements.

A Non-Trivial Number of Measurements

Screenshot 2024-09-12 at 5 20 59 PM

To make this issue I actually had to restart Ondsel because I was unable to select the measurements to hide them for the first picture. Crashing has happened a few times with measuring as well. It is unclear what exactly is the issue but I suspect it shouldn't be too hard to reproduce if you try something similar (just go ham on measuring shit lol). Let me know if there's difficulties and I'll dig deeper.

Here's an example of where measurements work mostly nicely.

Mostly Nice Measurements

Screenshot 2024-09-12 at 5 28 13 PM

This works do to clear corners that I'm able to exploit because the tool snaps to points. But this does not always hold true for holes and we can see some messiness around the two center hole measurements. The y-axis one actually reads 23.980mm while the x-axis one reads 24.000mm. Close enough we know the answer, but requires careful clicks and it is why I'm confirming.

This image shows the issue a little more clearly. Messier Measurements

Screenshot 2024-09-12 at 5 34 05 PM

First, I did a near edge to far edge measurement to proxy a center to center measurement, giving us 31mm. We know the holes are 3.5mm so the outer to outer should be 31mm + 3.5mm or 34.5mm. We instead see 34.473mm. I don't think this is a precision error, but if it is we have some major issues in order of operations (if you point me towards the code section I can take a look).

This gets even trickier because often you won't select an edge you think you're selecting. This can lead to some weird unexpected measurements and worse, depending on the viewing angle it can appear that we're measuring to some non-existent point (this particular example had be confused). Note that I selected the top view when I performed all measurements

Top View Illusion View

Screenshot 2024-09-12 at 6 07 53 PM

Screenshot 2024-09-12 at 6 08 42 PM

Illusion View 2 Illusion View 3

Screenshot 2024-09-12 at 6 10 32 PM

Screenshot 2024-09-12 at 6 11 30 PM

I call these illusions but I'm not sure tbh. I think the measurement is actually to the top corner but I have no idea.

Either way it appears to be a bug. I am just unsure if it is a rendering bug, selection bug, or something else. If you look closer at the second image you'll find more examples of this happening.

This is really hard to get right when we're doing an edge to edge measurement, such as across the whole part. There's no chance of so our best shot is actually taking cross sections

Full Body Cross-Section

Screenshot 2024-09-12 at 5 41 04 PM

Screenshot 2024-09-12 at 5 41 36 PM

The issue here is that we might not have clear boundaries and so we gotta pick our cross sections just right. So I think increasing the usability of the cross section view could go a long way. What I'd personally love to see a slider where you can slice a plane[^2] through the object and either view just that 2D cross section or the our cut[^3]. But don't let my preference stop you if you find a better methodology.

[^2]: Better if this is abstracted and we can do an arbitrary shape. But plane probably fits 90% of cases.

[^3]: I forgot where, but I was certain I saw similar functionality in one of the existing tools.

So I hope the example helps clarify some usability issues and a few of the bugs I uncovered along the way. I think the highest value items would be allowing for better measurements of features, axis line measurements, and resolving the bugs. But there's a lot of potential improvements I think could happen here and maybe some could move to a conversation to better understand what the community wants, especially from people who do this work more often.

While this isn't high priority to me personally, I think it will be highly beneficial considering Ondsel's business model. Since the more easily users can reverse engineer and create parts the more powerful Lens becomes. The faster we can reverse engineer parts the faster we can upload them and the more draw there is to Lens.

Side note, but I've noticed some dupes. I know these aren't easy to detect but here's an example of some trivial parts 1 2 (also, the site prevents right clicking and opening parts in a new tab. Considering we might want to investigate parts this can really hinder search as the experience and effectiveness of this. It is probably worth optimizing the loading a bit too).

Full version info

OS: macOS 14.6.1
Word size of Ondsel: 64-bit
Version: 2024.2.2.37240 (Git)
Build type: Release
Branch: (HEAD detached at 2024.2.2)
Hash: fbb794cd2e56fba5fd911c8832332b5e5e235319
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: C/Default (C)
Installed mods: 
  * Ondsel-Lens 2024.7.5.02 (Disabled)
  * freecad.gears 1.2.0
  * fasteners 0.5.24
  * lattice2 1.0.0
  * 3D_Printing_Tools

MacBook Air
Apple M2
Sonoma 14.6.1

Subproject(s) affected?

None

Anything else?

No response

Code of Conduct