GithubHelp home page GithubHelp logo

tetsim's Introduction

Simulate Tetrahedral FEM Models in your browser in real-time using the GPU!

Gif of TetSim in action

This repo contains two proof-of-concept demos:

This one is a plain rehosting of Miles Macklin and Matthias Müller's A Constraint-based Formulation of Stable Neo-Hookean Materials demo.
I've broken the script into several ES6 Module pieces with the intention of improving reusability.

This one rewrites the entire simulation as a set of GPU passes on Render Textures (gaining a ~20x speedup). This does NOT use the Neohookean energy/constraint function. This is because the Neohookean function only converges well with Gauss-Seidel iterations (which are tricky to implement on the GPU (see: Graph Coloring), and especially tricky to implement for this example dragon mesh, which has vertices with over 30 connecting tetrahedra). Instead, this simulation uses Matthias Müller's Robust Polar Decomposition on the tetrahedra, which converges much faster (and with GPU-friendly Jacobi Iterations).

  • 20x faster
  • Even works on Mobile Devices (though Android devices behave strangely)
  • Not physically correct (doesn't incorporate deltaTime properly yet)

Building

This demo can either be run without building (in Chrome/Edge/Opera since raw three.js examples need Import Maps), or built with:

npm install
npm run build

After building, make sure to edit the index .html to point from "./src/main.js" to "./build/main.js".

Dependencies

tetsim's People

Contributors

zalo 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tetsim's Issues

How can I build the project?

Thanks for your great work. I tried to build the repo. But the main.html still doesn't show anything.

I build the repo in 2 steps:

  1. npm install
  2. npm run build

The three.js (3D Rendering Engine) and esbuild (Bundler) is under the node_modules directory.

Could you write a build step tutorial in README.md?

Thanks!

I have a data problem

First of all thank you very much,How is this data generated
image
Thank you very much for your reply

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.