• Stars
    star
    178
  • Rank 214,989 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Python implementation of the paper "Deformation Transfer for Triangle Meshes" with 3D views in the browser.

Python: "Deformation Transfer for Triangle Meshes"

A Python implementation of the paper "Deformation Transfer for Triangle Meshes" by Sumner, Popović with 3D views in the browser.

alt text

TL; DR

The goal is to transfer animations (deformations) from one model (source) to any other model (target) which does not share the same vertices count.

The core idea is to describe the linear problems as position-independent triangle transformations (triangle span + normal).

First a correspondence mapping between the source and target reference models is created by progressively "inflating" the source shape into the target shape. Each step minimizes the cost of the triangle transformation of the source mesh while pinning the user-provided marker vertices to the target mesh. Iteratively closest points are selected and increasingly weighted in the cost function.

The deformation transfer is the minimum solution of the Frobenius distance between the triangle transformations (source🠊deformed-source, target🠊deformed-target) for each mapped triangle pairs.

  • "Pinning": The markers are already solved and moved to the right side of Ax=b.
  • "Frobenius norm": Very useful matrix norm that is invariant to matrix equation rearrangements.

Examples

There are online interactive renders at: https://mickare.github.io/Deformation-Transfer-for-Triangle-Meshes/

How it works

  1. Build correspondence mapping
    1. Iterate n number of times:
      1. Solve minimum cost of the source mesh transformation with the markers pinned to the target mesh alt text
        • ES: Smoothness cost, EI: Identity cost, EC: Clostest-point cost
      2. Find closest point on target mesh for each source vertice
      3. Increase weight wC of closest-point cost function
    2. Find matching triangles via triangle centroids and orientation alt text
  2. Transfer deformation
    • Solve minimum of the Frobenius distance between the transformations of source to deformed source and of the target to the unknown deformed target. alt text
      • M: mappings, SSj: j'th triangle transformation of source, Ttj: j'th triangle transformation of target, ˜v: vertices of the deformed target
    • The deformed target is the objective of the minimization.

Requirements

Python >= 3.9

Pip-Requirements:

  • pip install -r requirements.txt

Usage

Each part of the .py files can be run by themself to visualize the results of each component.

For simplification none accepts command arguments. You'll have to modify the "main" yourself to change for example the used model.

File Description Main
correspondence.py Create the correspondence mapping. Will plot each step of the correspondence.
transformation.py Use a mapping to transfer a deformation Will plot the result of the transformation
animation.py Plots an animation for all deformations for a model.
export.py Exports each step of correspondence, transformation and the animation to a html page.
config.py Default configuration and file paths to markers and models.

Helper

File Main
render/plot_marker.py Plots the markers for two models.

Contributors

License

The code in this repository is licensed under the MIT License.

The models are each licensed from a third party and are not part of this license! You should NOT distribute or use these models against their license. A list of the used model licenses and source is under models/.

More Repositories

1

Robust-Reconstruction-of-Watertight-3D-Models

A Python implementation of the paper "Robust Reconstruction of Watertight 3D Models from Non-uniformly Sampled Point Clouds Without Normal Information".
Python
28
star
2

battery_swap_fix

Fix Lenovo's Battery Power Management under Linux (T470s)
Shell
23
star
3

xserver

Network library for fully connected nodes on Bukkit, Bungeecord
Java
8
star
4

Weighted-Expectation-Maximization-GMM

Weighted Expectation-Maximization for sparse GMM Training that was a sub-algorithm in my thesis.
Python
4
star
5

cargo-spellcheck-action

Github action for cargo-spellcheck
Dockerfile
3
star
6

jcp

A Java library for creating custom command line parser and command pipelines.
Java
1
star
7

voxly

Chunked voxel data structure that facilitates basic logic and math operations on a 3d voxel grid.
Python
1
star
8

fsnn

Fast Stack Neural Network - C++ stack-only implementation of a neural network
C++
1
star
9

ArmorTools

Modify armorstands
Java
1
star
10

RouterNet

A easy-to-use router network library for Java
Java
1
star
11

ajenti-docker-plugin-dev

Ajenti dockerized Plugin Dev-Environment
Shell
1
star
12

textslider

TextSlider is a jQuery Slide Gallery with a timeshift between text and background changes.
JavaScript
1
star
13

sync-e2e-cloud-demo

Demo of a fully featured end-to-end encrypted cloud file storage.
Python
1
star
14

honeysling

A honeypot that simulates a bash terminal and logs the activity with no risk exposing any real terminal.
Python
1
star
15

muehle_mcts

Nine man's morris game, that is simulated and played by two MCTS players... be warned - very hacky & ugly code
Python
1
star