f3d-app / f3d

Fast and minimalist 3D viewer.
https://f3d.app
BSD 3-Clause "New" or "Revised" License
2.91k stars 211 forks source link

Add measurement tools similar to CAD software #119

Open drtrigon opened 2 years ago

drtrigon commented 2 years ago

Context F3D can load CAD dataset however it does not have any measuring tool. Adding a simple ruler widget that user would be able to manipulate with the mouse would go a long way.

First step would be to prototype this to see if it is feasible in the F3D framework.

Notes Issue was initially:

I have several proposals, that I would like to discuss here. May be some of them could be included in a next release:

I would be willing to help testing.

mwestphal commented 2 years ago
  1. is already supported, just drop a folder :)
  2. Can you precise what you have in mind, maybe woth a screenshot from another software ?
  3. I suppose we can take a look, but I believe this is something someone from the community could take care of ?
Meakk commented 2 years ago

For 2, I was thinking about an axes actor (see https://gitlab.kitware.com/f3d/f3d/-/issues/81)
I'm afraid more complex inspection tools like measure, clipping planes, are out of scope of f3d which is supposed to be a simple visualizer. But we may reconsider it if we find a way to integrate it without being too intrusive.

drtrigon commented 2 years ago
  1. Would it be possible to add a key that allows to add all files from a folder after opening one file out of it? E.g. I drop a file from a folder, then - while looking at the file - consider to look at all. Also (it's a shame to say that, but) as I am forced to use win at work I got used to its picture viewer that by default allows to browse all files in the same folder.
  2. I was thinking about something like https://wiki.freecadweb.org/Part_Measure_Menu and yes may be a cut plane - something that allows looking into models/parts. I not sure whether I understand the point of the actor but having axes with ticks would for sure be a good starting point.
mwestphal commented 2 years ago
  1. That sounds like a good idea. We do not have a binding for the down key yet :)
  2. Ok I see what you are looking for, I'm not enterely sure F3D should provide that, I would suggest opening a dedicated issue to see if there is other F3D users interested.
drtrigon commented 2 years ago

(to criticize myself: 2. I have to agree with @Meakk this is sort of against the "lightweight" viewer strategy - but as said if it could be done without blowing up code and binary it would be a great thing to have...)

HakunMatat4 commented 2 years ago
  1. Making its installation more user friendly is a good start: Bash script for example and it could be released in the next release

Some more content on this. I use Linux Mint Cinnamon(Debian based like any .deb distro) and I couldn't quite find a clear installation procedure. I didn't wanna bother having to compile things. I used common sense and old school copy/paste:

- bin/          -> /usr/bin/
- lib/          -> /usr/lib/
- share/applications/   -> /usr/share/applications/
- share/icons/      -> /usr/share/icons/
- share/metainfo/   -> /usr/share/metainfo/
- share/mime/       -> /usr/share/mime/
- share/thumbnailers/   -> /usr/share/thumbnailers/
- config.json       -> YOUR_USER_HOME/.config/f3d/config.json

I was still unable to see the thumbnails which were solved with the command. Safer than deleting the folder right away as suggested, you never know.

mv YOUR_USER_HOME/.cache/ YOUR_USER_HOME/bkp_cache/

No less important, since the bin file was copied over to the system, right-click in a STL file, "Open With" and F3D will be displayed as an option, and I can just call f3d via terminal, no need to navigate to a folder.

A bash script taking care of those 2 code blocks and no .appimage is needed.

Meakk commented 2 years ago

@whiiiskyy we do not recommend copying f3d files to the /usr directory from the archive we provide.
It's better to just copy the files somewhere in your home directory, and add the directory to your PATH variable.
We should document it for sure.
We can also provide a .deb package for Debian-based distro but we need help for testing, would you be interested to help @whiiiskyy?

I'll create a specific issue for it.

HakunMatat4 commented 2 years ago

@Meakk ,

I did check the files and although it isn't recommended, I did what I did hoping to have everything working. You have no idea how frustrating it has been not having a decent Linux solution for that, until now.

I'm more than happy to test the .deb package. I can undo the binary, etc, and use the deb package instead.

Please, let me know how to proceed.

Cheers

Meakk commented 2 years ago

Continuing the discussion on https://github.com/f3d-app/f3d/issues/123

mwestphal commented 2 years ago

@drtrigon @whiiiskyy : I have separated this issue in smaller bites:

xyont commented 2 years ago

may i add some notes and picture to clarify. in another software which the same as using VTK library, it's called Query Tool, then requires to select two nodes for showing distance info's

software_VTKlib_query_distance

drtrigon commented 2 years ago

Nice picture that makes me ask; can we also add a ruler or axes, grid, ticks labels that use real units like mm, e.g.?

mwestphal commented 2 years ago

There is no such things as real units in VTK world. Nice visual input though.

Meakk commented 2 years ago

I'd like to implement that, but I think it's out of the scope of f3d right now.

drtrigon commented 2 years ago

There is no such things as real units in VTK world. Nice visual input though.

No possibility to display a rules by assuming the units are millimeters? Or allowing the user to enter a scaling? That would allow to easily disinguish between an model from architecture and one from microscopy. It would allow to get a rough understanding of the models dimensions. (E.g. the current windows .stl viewer does have something like that.)

If no possibilities exist to have something like this we can actually close the issue.

mwestphal commented 2 years ago

We could add a parameter to let user specify a scaling unit, but it is down to the user to specify it. VTK cannot guess it.

The issue can stay open though.

mwestphal commented 1 year ago

I think adding a simple ruler could go a long way for CAD users,

mwestphal commented 1 year ago

I will try to prototype that soon, we will see

mwestphal commented 10 months ago

Rewording the issue to add a ruler.