GithubHelp home page GithubHelp logo

f3d-app / f3d Goto Github PK

View Code? Open in Web Editor NEW
2.8K 29.0 199.0 59.49 MB

Fast and minimalist 3D viewer.

Home Page: https://f3d.app

License: BSD 3-Clause "New" or "Revised" License

CMake 16.48% Game Maker Language 0.01% Roff 0.02% Shell 0.19% C++ 78.09% Objective-C++ 0.40% C 0.59% Python 1.90% Java 0.37% HTML 1.05% Eiffel 0.02% SCSS 0.13% JavaScript 0.38% GLSL 0.28% PowerShell 0.07%
stl-viewer gltf-viewer vtk 3d-viewer raytracing physically-based-rendering volume-rendering command-line-tool 3d graphics gltf rendering 3d-graphics step fbx dxf obj glb usd hacktoberfest

f3d's Introduction

CI Packaging codecov Downloads Sponsors Discord Contributor Covenant

F3D - Fast and minimalist 3D viewer

By Michael Migliore and Mathieu Westphal.

F3D (pronounced `/fɛd/`) is a fast and minimalist 3D viewer desktop application. It supports many file formats, from digital content to scientific datasets (including glTF, USD, STL, STEP, PLY, OBJ, FBX, Alembic), can show animations and support thumbnails and many rendering and texturing options including real time physically based rendering and raytracing.

It is fully controllable from the command line and support configuration files. It can provide thumbnails, support interactive hotkeys, drag&drop and integration into file managers.

F3D also contains the libf3d, a simple library to render meshes, with a C++17 API, Python Bindings, and experimental Java and Javascript bindings.

A typical render by F3D

Animation of a glTF file within F3D

A direct scalars render by F3D

See the gallery for more images, take a look at the changelog or go to the install guide to download and install F3D!

You can even use F3D directly in your browser!

If you need any help or want to discuss with other F3D users and developers, head over to our discord.

Quickstart

Open a file and visualize it interactively:

f3d /path/to/file.ext

Open a file and save the rendering into an image file:

f3d /path/to/file.ext --output=/path/to/img.png

Get help:

f3d --help
man f3d # Linux only

Documentation

  • To get started, please take a look at the user documentation.
  • If you need any help, are looking for a feature or found a bug, please open an issue.
  • If you want to use the libf3d, please take a look at its documentation.
  • If you want to build F3D, please take a look at the developer documentation.

Support

F3D needs your help!

If you can, please consider sponsoring F3D. Even a small donation would help us offset the recurring maintenance costs. With enough sponsors we would even be able to add support for new devices (as we would need do acquire or rent them first). Read more about it on our sponsor page.

If not, please use F3D, star it on github and share the word about it!

Vision

As a minimalist 3D viewer F3D aims to:

  • Support as many 3D file formats as possible
  • Support many types of renderings (textures, edges, etc... ) and visualizations (meshes, volumic, point sprites)
  • Support any and all use-cases dealing with 3D datasets
  • Let any user easily and quickly view any model with good defaults
  • Be as configurable as possible
  • Be fully controllable from the command line and configuration file
  • Be usable non-interactively
  • Be as modular as possible to be built with a small number of dependencies

but there is no plan to:

  • Provide a classic mouse-based UI, with menus and buttons
  • Provide data processing tools
  • Provide export feature

Contributing

F3D as a community-driven, inclusive and beginner-friendly project. We love to see how the project is growing thanks to the contributions from the community. We would love to see your face in the list below! If you want to contribute to F3D, you are very welcome to! Take a look at our contribution documentation, governance documentation and code of conduct.

Acknowledgments

F3D was initially created by Kitware SAS and is relying on many awesome open source projects, including VTK, OCCT, Assimp, Alembic, Draco, OpenUSD, OpenVDB and OSPRay.

License

F3D can be used and distributed under the 3-Clause BSD License, see the license. F3D integrate the sources of other libraries and tools, all under permissive licenses, see the third party licenses. F3D packages relies on other libraries and tools, all under permissive licenses, all listed in the respective packages.

f3d's People

Contributors

allemangd avatar charlesgueunet avatar chirag-droid avatar hlngrandmontagne avatar jo-chemla avatar jpouderoux avatar kathleenhang avatar kevinsmia1939 avatar kidharb avatar lknknm avatar meakk avatar michaelmigliore avatar mwestphal avatar myd7349 avatar mzf-guest avatar nokse22 avatar nyue avatar samh7 avatar schuhumi avatar shambhupatil avatar snoyer avatar spevnev avatar technologeli avatar topazus avatar vikaskok avatar yangshen398 avatar yogesh9000 avatar yurivict avatar z-shaffer avatar zhiyuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

f3d's Issues

Fix Linux package for older distributions

Linux package currently rely on GLIBC. If the Docker image we use for building the Linux package uses a newer version than the user one, the application refuses to run.

See https://gitlab.kitware.com/f3d/f3d/-/merge_requests/224#note_901968

Possible solutions:

The current version of the package uses Ubuntu 18.04, which we consider good enough and should support Debian 10 and Centos 8. Letting this happen in case there are older distribution user in need of a package.

Add an option to draw axes actor

Context
F3D is used to show models of different sizes. It can be hard to judge the size of a model when opening it in F3D.
Adding a Grid around it as shown below would help with this evaluation:

image

The idea of this issue is to add a CLI and libf3d options to control the showing of such a grid.

Suggested solution
In vtkF3DRenderer, add a vtkGridAxes3DActor similarly to how the GridActor is added and add the method to control the showing of it. In window_impl::UpdateDynamicOptions() , control the showing of the new actor based on a new option that has to be added in the options.
Finally, in F3DOptionsParser, add a CLI option to control the libf3d options.

CLI Option: --axes-grid
libf3d option: render.axes-grid.enable

No interaction planned to control it as of yet.

Required skill

No required skill, this could be a good-first-issue with a bit more work.

Potentially more info here: https://gitlab.kitware.com/f3d/f3d/-/issues/81

Brainstorm libf3d API

libf3d was introduced in !259 (closed), let's brainstorm a stable API for it.

Tasklist:

libf3d

  • Introduce f3d::options: #191
  • Refactor F3DLoader and F3D to use f3d::options cleanly
  • Introduce f3d::loader and use it
  • Introduce f3d::window and use it
  • modularize VTK code
  • Add unit test for VTK modules : #265
  • sanity check call order with window and interactor
  • transform F3DLog into f3d::log
  • fix #32 by using categories for options
  • improve f3d_options by providing initialization methods
  • store init value in f3d::options for easier reset ?
  • support std::initializer_list to be able to call options.set("color", { 1., 1., 1. });
  • add a way to inform user when an options does not exist
  • introduce a factory and use it to create classes to hide the private API
  • Add SDK test infrastructure
  • Adress as many TODOs as possible
  • Rework engine for bit flag and init early
  • Add SDK tests
  • (optional) expand f3d_interactor to support user set behavior for many more context
  • add more window types
  • improve all classes from f3d namespaces to ensure all santiy checks are done correctly
  • unit testing of the API and general coverage improvements
  • Add a vtkNoRenderWindow
  • modernization of API
  • constness of API
  • Public Review of the API to anyone willing to help: #351

F3D

  • Rework F3DOptions and F3DOptionsParser to interface with f3d::options
  • (Optional) introduce f3d::config in libf3d ?
  • rewrite F3DStarter from scratch to not depends on VTK

Doc

  • In header doc
  • example doc
  • website doc

Consider adding a 2D interactor

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.

Improve Windows integration

In order to extend windows explorer:

  • Thumbnails
  • Add opening folder support from context menu
  • Property tab (number of points/cells and dataset type)
  • Allow multi-files opening from explorer (currently open several instances): #497
  • Integrate as a quicklook viewer: #900
  • Improve thumbnails: #797
  • Add dark title bar support: #895
  • Fix FileAssociation: f3d-app/f3d-superbuild#160
  • Improve Window positioning by default: #1590

References:

Implement normal rendering mode

Context:
F3D has many different rendering mode, surface, volume, point sprites.
The idea of this issue is to add yet another rendering mode using VTK provided tools in order to represent the normals as glyphs on top of the surface.

Suggested solution:

  • Add a command line option to enable this : --normal-glyphs
  • Add a libf3d options to enabled this: normal-glyphs
  • Add an interaction key to enable this: Shift + N
  • Implement the feature itself in vtkF3DRendererWithColoring by adding a vtkGlyph3D filter
  • Configure the vtkGlyph3D with a normal orientation

Possible pain point:

  • Nothing

Discussions needed before adding "help-wanted" label:

  • is CPU the right choice here ? It may be simpler to implement but a GPU based solution may be faster

Add a mobile version

Context
F3D is a tool that let user visualize 3D models easily. Having a mobile android version would be benificial for the project.
A simple idea would be able to support opening a file attached to an email. iOS version could be considered as well.

Current status
@Meakk has created a prototype of an android app that rely on the libf3d: https://github.com/f3d-app/f3d-android

Some non-exhaustive related tasks

  • Migrate to Kotlin
  • Improve zoom and pan interaction (it jitters, there must be something wrong)
  • Create CI to generate one .apk per architecture
  • Add an hamburger menu to toggle some options (e.g. grid)

Refactoring ideas

This thread is meant to discuss code improvements. It can be edited by everyone.

Use sub-folders

Architecture may be improve by splitting files in folders:

  • Core
  • Data
  • Filters
  • Rendering
  • Interactors
  • Options
  • ...
    please, edit this list, I am not the best fit to fill it.

Use namespaces

  • create new namespaces for
    • f3d
    • exceptions f3d::except?
    • subfolders (see thread: f3d::filter, f3d::data, ... may be too verbose.)
  • change the clang-format to avoid re-indenting everything (see NamespaceIndentation)

Add CMake Preset for build / testing

  • build
    • minimal (the lightest version)
    • ray-tracing
    • testing

Class splitting/reorganization

...

Misc

  • enforce C++ 11 in clang-format and CMake
    • switch to C++ 14 ?
  • use #pragma once

Provide specialized version of the default config file

Each community of users may want to have different default config file, especially regarding interaction style, up direction, coloring.

It would be nice to provide default config file for each of the basic usage of F3D, eg:

  • 3D Printing
  • Gamedev
  • Animation
  • Sciviz
  • Medical

Ideally, for the NSIS windows installer, a dedicated screen would let the user choose the default config to install.

--no-background does not work

--no-background does not work, either because of a VTK regression or an issue in our code.

It works in 1.0, but not in 1.1

Better scalar range handling with animation

Context
F3D is able to show data using a colormap. Such a colormap has a range. This range is initialized using the min and max value of the data at the first time step. This works in most cases but in same cases, this would lead to unreadable results.

A workaround to this is of course to specify the colormap manually, however, F3D could have a better behavior.

** Suggested Solution**
F3D should expand the colormap on each timestep so that when the animation has been played fully, the colormap will not change anymore and further play through the animation will not make the color map evolve.

To implement this, one would need to ensure that changing the timestep in animationManager turn a flag on in vtkF3DRendererWithColoring so that it knows that the colormap should be expanded, and take that information into account in vtkF3DRendererWithColoring::ConfigureRangeAndCTFForColoring .

Rework documentation

Documentation is hard to maintain, here is the current state:

  • README.md contains the whole user documentation
  • GENERATE.md contains some developper oriented documentation
  • documentation/* contains a duplicate, segmented and slightly modified version of the README.md
  • src/F3DOptions code contains options, hotkeys and examples documentations to be delivered with --help
  • man contains documentations generated from --help and --version
  • We potentially will have one more version of the doc thanks to #47
    There is a few issues with this approach:
  1. Generic doc is duplicated two times
  2. Options/Hotkeys doc is duplicated three times
  3. main README.md is getting very long and hard to read

This should be improved, here is what we need to have:

  1. Complete user documentation should be available in a gitlab markdown format from the main README.md
  2. Complete user documentation should be available in the webdoc
  3. Limit duplication as much as possible

Here is a proposition to fix that:

  1. Put only the most esential and nice looking information in the main README.md
  2. Link from the main README.md to other logically organized .md files in a dedicated directory (see below for an example organization)
  3. Generate webdocumentation .md files during build thanks to cmake custom commands (see below for more info)
  4. If adressing #47, generate simple html doc during build OR generate actual web doc during build
  5. (Optional) Find a way to generate a .h from the options/hotkeys .md file during build so that it can be used in the --help output (and other usages?)
  6. (Optional) Use Pandoc instead of help2man to generate man, relying on generated .md file during build (see expected format here: https://www.pragmaticlinux.com/2021/01/create-a-man-page-for-your-own-program-or-script-with-pandoc/)

Example .md file organization, that could also be used as a webdoc organisation:

- README.md
- doc
-- OPTIONS.md
-- HOTKEYS.md
-- INSTALATION.md
-- USAGE.md
-- BUILD.md (should this go into dev?)
-- CONFIGURATION_FILE.md
-- LIMITATIONS.md
-- TROUBLESHOOTING.md
-- dev
--- GENERATE_WEBDOC.md
--- GENERATE_COVERAGE.md
--- GENERATE_MAN.md
--- DEVELOP.md
- webdoc
...

Differences between README.md and webdoc md files:

  • Image paths are differents (could be fixable):
+ ![F3D Logo](./resources/logo.svg) 
- ![F3D Logo](logo.png) 
+ <img src="https://kitware.github.io/F3D/gallery/04-f3d.png"  width="640">
- ![F3D Demo](../gallery/04-f3d.png)
  • many nbsp in the webdoc (could be fixable?)
+ Options &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&|Description
- Options|Description                                                                                                                                     
  • Internals links are removed (should be fixable)
+ See the coloring cycle section for more info.
- See the [coloring cycle](#Cycling Coloring) section for more info. 

If all slight change are removed, simply symlinking from the webdoc to the doc.md could be a very easy solution to put into place.

Improve cheatsheet

  • Add color to quickly see which option is enabled
  • Using bold for changed options
  • Using color "flash" when changing the option.

Add an option to write depth image

We can already write the color buffer in a PNG image.
We should be able to write the depth buffer too.
I can easily imagine cases where you want to use f3d in a script to generate color and depth images and composite several images using the depth buffers.

Implementation details:

  • Add a new F3D and libf3d option to enable depth rendering
  • Handle this use case by modifying the shader in the function vtkF3DPolyDataMapper::ReplaceShaderLight

For now, just writing the normalized depth in the shader as a greyscale value (something like gl_FragData[0] = vec4(vec3(gl_FragDepth), 1.0);) should be enough, but we could also consider doing color mapping like the image below:

image

Options for CAD formats

CAD formats has been introduced by !236
Visual quality highly depends on the meshing parameters.
Currently, these parameters are hard-coded with a trade-off between loading speed and visual quality.
Moreover, it is standard for CAD visualizer to display surfaces boundaries (curves discretized with poly-lines) but sometimes we do not want it.

How to handle these CAD specific options?

Implement light configuration

Context
F3D is using a simple light configuration that works for most usecases. F3D also supports loading lights from files directly for a file formats supports it. However, there is no way to configure lights manually yet.

The idea of this issue is to add libf3d options and F3D cli options to be able to configure lights

Suggested solution
Being able to add a single light and control its type, position, direction, angle and color would be beneficial.
This light would be added on top of the usual light kit already in use.

CLI options:

  • --light-type
  • --light-position
  • --light-direction
  • --light-angle
  • --light-color

And corresponding libf3d options (render.additional.light.X)

Special care would be needed to ensure --light-intensity works with it as well.

Discussions needed before adding "help-wanted" label

  • Should we support multiple lights ? How would that look in CLI ?
  • Should the CLI options clarify that this is an additional light ?

Add a clear drop zone when not providing a filename to open

Actual Behavior

If no argument is provided, a rendering window is created with nothing shown (gray background). It can be difficult to know if the program is working or freezing.

Expected Behavior

In case no argument is provided, we should expect that the program show a clear drop zone

Specifications

F3D - A fast and minimalist 3D viewer
Version: 1.1.0
Build date: 2021-04-07 11:48:28
System: Linux-5.8.0-48-generic x86_64
Compiler: GNU 10.2.0
RayTracing module: OFF
VTK version: 9.0.0 (build 20210406)
Author: Kitware SAS

Create a fonctionnal f3d-superbuild

Release packages do not contain OSPRay, this requires creating some sort of a superbuild.

VTK warning with direct scalars volume rendering

./bin/f3d -v ../data/vase_4comp.vti --comp=-2

vtkOpenGLVolumeLookupTa:84 WARN| vtkOpenGLVolumeOpacityTable (0x5575e3ea0b10): This OpenGL implementation does not support the required texture size of 131072, falling back to maximum allowed, 32768.This may cause an incorrect lookup table mapping.

The rendering seems fine.
Cycling to -2 does not create this warning for some reason.

Plan the expansion of the options

We are running out of short options and hotkeys, Let's plan how to tackle that.

A few possibilities:

  • Introduce modifies: Ctrl, Alt, Shift
  • Use vim like commands: :comp=2

Review Docker action

@Meakk please review .github/docker/Dockerfile and .github/workflows/build_docker_image.yml

It was not possible to put them in a PR

Consider adding more file formats support

Context
F3D supports many file formats, but they are many that F3D does not support, lets add supports for these formats!

Help wanted
Not an usual help wanted issue, but if you are familiar with any of these formats and want to add supports for it, please say so and we will create a dedicated issue with all needed information.

Formats

  • .fbx : Must have #37

Formats to consider sorted by reddit upvotes:

  • .usd 9: #780
  • .3DXML 9
  • .dae (collada) 7
  • .x (directx) 7 : #1124
  • Parasolid (.x_b, .x_t) 7
  • ACIS (.sat) 7
  • .blend 7: #1125
  • .3mf 7: #1126
  • .ma 4
  • .jt 4
  • .ipt/.iam 3
  • .dwg 3
  • .ifc 3
  • Navisworks .nwd 2
  • .dwx/.dwfx 2
  • .ztl/.ztr 2
  • vdb 2 : supported by VTK ! #181
  • .las 2
  • Revit formats RVT, RFA, RTE, RFT. 2
  • .skp 1
  • .wire 1
  • e57. 1
  • .ztl 1
  • .pcd 1
  • .skp 1
  • .brep 1 : #946
  • .3dm : #1489
  • point clouds: #201
  • Quake MDL 1 : #1310

Improve Importers Progress Management

Context
F3D can display a progress bar when loading a file, however, F3D relies on the progress reporting done by the readers and importers. Some of readers and importers we use, either from F3D or VTK, do not report accurate progress or progress at all.

The idea os this issue is to investigate the status of the different importers and readers in regards to progress reporting, and improve the one that do a bad job of it. First in F3D and second in VTK directly.

Suggested solution

  • Investigate each and every readers and importers in use and check that they perform progress reporting.
  • For the one that don't, implement a simple progress reporting mechanism and merge it into F3D and VTK

Skills needed

  • Knowing how to contribute to VTK is a plus

Notes

  • OBJ importer does not have progress
  • glTF importer does not have progress
  • Other importers may not have progress either

Fullscreen related issues

  • Linux fullscreen issue : Fullscreen break interaction
  • f3d cow.vtp -f
  • cannot interact with the camera
  • Linux fullscreen issue : Starting in fullscreen and then pressing f will not create a window of the right size
  • f3d cow.vtp -f
  • press f
  • window is 300*300
  • press f again window disapear
  • Linux fullscreen issue : Fullscreen with multiple screens cover both screens

  • Linux fullscreen issue : Starting in fullscreen and then pressing Escape segfaults

./bin/f3d --fullscreen
pres Escape
Segfault
  • Windows full screen issue :
  • open f3d.exe without parameter
  • type f -> fullscreen
  • type f -> does not revert to original size but 300x300
  • MacOS fullscreen issue
  • f hotkey is not working
  • All os FullScreen issue :
  • f3d -f
  • H -> FullScreen is not enable
  • F -> stays in fullscreen

Toggle the timer display triggers the render twice

We need to do something smarter to avoid this problem.
One idea:

  • Compute render time for opaque, translucent and volume pass
  • Update the timer
  • Render overlays

Another idea:

  • Use a different renderer for geometry and overlays

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.