f3d-app / f3d

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

Consider adding a 2D interactor #49

Open mwestphal opened 2 years ago

mwestphal commented 2 years ago

If an image is 2D, it can be useful to have a 2D interactor (I'm thinking of DXF or medical images). And tbh, if we implement it, then it makes sense to supports JPG/PNG/TIFF/HDR/TGA/... too since it is basically free. I know this is not the main purpose of f3d but since f3d is GPU accelerated, it may outperform other image previewers with large images.

mwestphal commented 2 years ago

https://gitlab.kitware.com/f3d/f3d/-/issues/237

jpouderoux commented 2 years ago

Good idea - however, as images are loaded as textures, there are limited in size.

mwestphal commented 2 years ago

images are not loaded as texture but as geometries, in vtk. not sure wht you mean.

jpouderoux commented 2 years ago

VTK can do whatever you want, use image as a texture on a plane or define a fine regular mesh with a color attribute per cell/point. Sorry, I thought we chose the first approach.

mwestphal commented 2 years ago

After trying playing with fbx and textures, supporting images (png, jpg, tga) and a 2D interactor makes complete sense !

jpouderoux commented 2 years ago

Work in progress!

mwestphal commented 2 years ago

Is this still planned @jpouderoux ?

jpouderoux commented 2 years ago

Is this still planned @jpouderoux ?

I just rewrote the old MR for the new master in #438. Let me know what you think. Note: it does not includes image reading as the previous MR. We should do that in a dedicated MR.

vmario89 commented 1 year ago

hi. found this ticket when searching for dxf. Basically, i found the F3D tool because i was looking for a tool which can create thumbnails for Linux for DXF files. It works, but 2D DXF are looking totally wrong. Seems there is no support for 2D DXF yet. I am a vector grahpics guy, which often converts SVG to DXF to postprocess them later on.

this is the output by F3D: grafik

by the way i am using Fedora and F3D can be installed easily using alien:

wget https://github.com/f3d-app/f3d/releases/download/v1.3.1/f3d-1.3.1-Linux.deb
sudo alien --to-rpm -vv f3d-1.3.1-Linux.deb
sudo rpm -ivh f3d-1.3.1-2.x86_64.rpm --nodeps --force
Meakk commented 1 year ago

Hi @vmario89

The DXF support in F3D is done with Assimp, and the support is not great, to be honest.
For instance, it only supports polylines but not curves.

Also, you are only seeing an horizontal line because the thumbnailer does not orient the DXF file properly in 1.3.1 (the 2D is drawn on the Y=0 plane, so everything is projected onto a line) It is fixed already on master, and it will be fixed in the next release.

Meakk commented 1 year ago

As a workaround to the orientation problem, you can modify the file f3d.thumbnailer and add --up=-Z to the command line.

vmario89 commented 1 year ago

nice to know. thanks for help! that works fine (except the curves)

mwestphal commented 1 year ago

@vmario89 Thanks for using F3D et do not hesitate to join our discord :) https://discord.f3d.app/

mwestphal commented 10 months ago

@jpouderoux are you still around ?