{"id":20349485,"url":"https://github.com/zalo/tetsim","last_synced_at":"2025-07-20T17:37:09.852Z","repository":{"id":46250874,"uuid":"422013398","full_name":"zalo/TetSim","owner":"zalo","description":"Javascript Tetrahedral FEM Simulation","archived":false,"fork":false,"pushed_at":"2023-12-28T22:18:37.000Z","size":7847,"stargazers_count":40,"open_issues_count":1,"forks_count":8,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-19T08:01:36.679Z","etag":null,"topics":["fem","physics-simulation","xpbd"],"latest_commit_sha":null,"homepage":"https://zalo.github.io/TetSim/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zalo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-28T00:24:16.000Z","updated_at":"2025-03-27T10:24:19.000Z","dependencies_parsed_at":"2024-11-15T01:01:38.205Z","dependency_job_id":null,"html_url":"https://github.com/zalo/TetSim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zalo/TetSim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zalo%2FTetSim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zalo%2FTetSim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zalo%2FTetSim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zalo%2FTetSim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zalo","download_url":"https://codeload.github.com/zalo/TetSim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zalo%2FTetSim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266166977,"owners_count":23886901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fem","physics-simulation","xpbd"],"created_at":"2024-11-14T22:26:03.295Z","updated_at":"2025-07-20T17:37:09.829Z","avatar_url":"https://github.com/zalo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [TetSim](https://zalo.github.io/TetSim/)\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://github.com/zalo/TetSim/deployments/activity_log?environment=github-pages\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/deployments/zalo/TetSim/github-pages?label=Github%20Pages%20Deployment\" title=\"Github Pages Deployment\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/zalo/TetSim/commits/master\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/last-commit/zalo/TetSim\" title=\"Last Commit Date\"\u003e\u003c/a\u003e\n  \u003c!--\u003ca href=\"https://github.com/zalo/TetSim/blob/master/LICENSE\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/zalo/TetSim\" title=\"License: Apache V2\"\u003e\u003c/a\u003e--\u003e  \u003c!-- No idea what license this should be! --\u003e\n\u003c/p\u003e\n\nSimulate Tetrahedral FEM Models in your browser in real-time using the GPU!\n\n![Gif of TetSim in action](./TetSimDemo.gif)\n\nThis repo contains two proof-of-concept demos:\n\n## [CPU Sim](https://zalo.github.io/TetSim/?cpu=true)\n\nThis one is a plain rehosting of [Miles Macklin and Matthias Müller's A Constraint-based Formulation of Stable Neo-Hookean Materials](http://blog.mmacklin.com/publications/#:~:text=A%20Constraint-based%20Formulation%20of%20Stable%20Neo-Hookean%20Materials) demo.  \nI've broken the script into several ES6 Module pieces with the intention of improving reusability.\n\n## [GPU Sim](https://zalo.github.io/TetSim?cpu=false)\n\nThis 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](https://erkaman.github.io/posts/gauss_seidel_graph_coloring.html)), 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](https://www.youtube.com/watch?v=YOBjHpoImu8) on the tetrahedra, which converges much faster (and with GPU-friendly Jacobi Iterations).\n\n - 20x faster\n - Even works on Mobile Devices (though Android devices behave strangely)\n - Not physically correct (doesn't incorporate deltaTime properly yet)\n\n\n # Building\n\nThis demo can either be run without building (in Chrome/Edge/Opera since raw three.js examples need [Import Maps](https://caniuse.com/import-maps)), or built with:\n```\nnpm install\nnpm run build\n```\nAfter building, make sure to edit the index .html to point from `\"./src/main.js\"` to `\"./build/main.js\"`.\n\n # Dependencies\n - [three.js](https://github.com/mrdoob/three.js/) (3D Rendering Engine)\n - [esbuild](https://github.com/evanw/esbuild/) (Bundler)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzalo%2Ftetsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzalo%2Ftetsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzalo%2Ftetsim/lists"}