Giter VIP home page Giter VIP logo

mfxvtk's Introduction

MfxVTK

An Open Mesh Effect plugin for VTK filters

Smoothing Suzanne the monkey with VTK filters

MfxVTK is a plugin that brings filters from the Visualization Toolkit (VTK) library into any 3D software that supports the Open Mesh Effect standard. It provides a non-destructive workflow for polygonal meshes, wireframes and point clouds.

To learn more, please have a look at MfxVTK documentation.

🚧 Currently this is a proof-of-concept; it works, but more features and polish should come in the future.

Features

  • Surface/volume point sampling
  • Creating tetrahedral wireframe from points
  • Smooth and Decimate effects
  • ...and more, see list of all effects.

How to use it

In the OpenMeshEffectForBlender branch of Blender:

  • select your mesh
  • open the Modifier tab and select Open Mesh Effect modifier
  • in modifier properties, set path to MfxVTK plugin (mfx_vtk_plugin.ofx – download MfxVTK release from GitHub or build it yourself)
  • select desired effect from the drop-down menu

How to build it yourself

You will need Git, CMake and a C++ compiler toolchain (like Microsoft Visual Studio or GCC/Make).

First, build VTK (version >= 9.0), see instructions on VTK wiki.

  • Use BUILD_SHARED_LIBS=OFF to make your MfxVTK binary not depend on VTK shared libraries.
  • Turn off VTK_GROUP_ENABLE_Rendering, VTK_GROUP_ENABLE_Web, VTK_GROUP_ENABLE_MPI, VTK_GROUP_ENABLE_QT to make compilation faster.
  • (Optional) Use VTK_SMP_IMPLEMENTATION_TYPE other than Sequential for better performance of some filters.

Then clone MfxVTK from GitHub (note that it has the OpenMeshEffect repository as a submodule):

git clone --recurse-submodules https://github.com/tkarabela/MfxVTK

Build MfxVTK using CMake:

cd MfxVTK
mkdir cmake-build
cd cmake-build
cmake .. -DVTK_DIR:PATH=/path/to/VTK-9.0.1-build  # change this accordingly
cmake --build . --config Debug

The plugin is now in your build directory: src/mfx_vtk_plugin/libmfx_vtk_plugin.ofx.

How it works

It converts Open Mesh Effect mesh into vtkPolyData. General structure of the plugin as well as handy C++ wrapper over the Open Mesh Effect interface is borrowed from MfxVCG.

License

MfxVTK source code (src/mfx_vtk_plugin) is released under the MIT license, see LICENSE.txt. Parts of this repository also contain code licensed under the Apache 2 license, please see copyright notices in individual files.

MfxVTK Open Mesh Effect plug-in
Copyright (c) 2020 Tomas Karabela

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

mfxvtk's People

Contributors

tkarabela avatar eliemichel avatar

Stargazers

 avatar  avatar  avatar Dipterix Wang avatar Aleks Berland avatar  avatar Tosh Iba avatar Man Sun avatar David Ballesteros avatar Qubit avatar  avatar

Watchers

James Cloos avatar GP Wang avatar  avatar

Forkers

eliemichel

mfxvtk's Issues

Sample points (volume) robustness

  • add Sample points (volume) to a mesh
  • copy the modifier
  • VTK error window pops up, error in
VTK-9.0.1\Filters\Core\vtkImplicitPolyDataDistance.cxx, line 156
vtkImplicitPolyDataDistance (0,000,01E,DF0,79A,BA0): No polygons to evaluate function!

Mention VTK DLLs in Readme

Super nice, builds nicely! :) I am actually thrilled to run an effect written by somebody else than myself. ^^

I think you could just precise to either add the bin directory of VTK's build to the PATH or copy the appropriate dll/so files next to the .ofx:
image

PS: Also aren't they missing from the release zip/tarball you provided?

Implement "Poke" filter

This effect will displace input mesh to make a dent from collider mesh (secondary input mesh, or even self-collision when main mesh is divided into "collider" and "mesh" parts via attribute). It should look roughly like a softbody simulation, including falloff from the dent, but without any physics simulation/time going on. It's a bit like Blender's Shrinkwrap modifier with "Outside" option.

  • implement Poke modifier with self-collision (hardcoded color attribute)
  • implement Poke modifier with collider mesh (when it lands in OFX)
  • implement Poke modifier with custom attribute for self-collision (when it lands in OFX)

Note: This will be the first effect built from scratch, not based on any particular VTK filter (just using VTK for raycasting etc.).

Implement attribute forwarding

  • input geometry attributes
  • output geometry attributes - implemented in c341549
  • extra attributes (UVs, etc.) - partial support in f0b60a9 (copying instead of forwarding; only uv{0..3}, color{0..3} as supported by Blender host)

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.