• Stars
    star
    486
  • Rank 90,527 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 7 months ago

Reviews

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

Repository Details

High-performance multi-material continuum physics engine in Taichi

Taichi Elements Build Status Code Coverage

Taichi elements is a high-performance multi-material continuum physics engine (work in progress).

Features:

  • Cross-platform: Windows, Linux, and OS X
  • Supports multi-threaded CPUs and massively parallel GPUs
  • Supports multiple materials, including water, elastic objects, snow, and sand
  • Supports (virtually) infinitely large simulation domains
  • Supports sparse grids
  • Highly efficient and scalable, especially on GPUs




Using taichi_elements in Python


Run demo with Python

  • Install taichi with pip: python3 -m pip install taichi
  • Execute python3 download_ply.py to download model files used by the demos
  • Execute python3 demo/demo_2d.py and you will see

  • Execute python3 demo_3d.py and you will see a 3D simulation visualized in 2D
  • Execute python3 demo_3d_ggui.py and you will see a 3D simulation rendered with GGUI. Note that GGUI requires Vulkan so please make sure your platform supports that.

  • Execute python3 demo/demo_2d_sparse_active_blocks.py to get a visual understanding of Taichi sparse computation


To simulate and render an example 3D scene with Python

  • Make sure you have a modern NVIDIA GPU (e.g. GTX 1080)
  • Execute python3 download_ply.py to download model files
  • Run python3 demo/demo_3d_letters.py (wait for at least 10 frames)
    • A binary particle folder with a timestamp in its time (e.g., sim_2020-07-27_20-55-48) will be created under the current folder.
  • Example:
python3 render_particles.py \
    -i ./path/to/particles \
    -b 0 -e 400 -s 1 \
    -o ./output \
    --gpu-memory 20 \
    -M 460 \
    --shutter-time 0.0 \
    -r 128
  • Images are in the output/ folder. For example, 100 million MPM particles simulated in 8 hours on a V100 GPU:

[Watch on YouTube]

  • Here is a one-billion-particle simulation on a GPU with 80 GB memory. Each particle takes 40 bytes, thanks to quantization.
taichi_elements_1billion_480p.mp4




Using taichi_elements in Blender


Installing Taichi for Blender

(Not sure if it is the standard approach, but it works for now.)

  • Install Blender 3.4.1
  • Find the Python3 executable bundled in Blender. Open a console in Blender and type in
import sys
print(sys.exec_prefix)

The output looks like /XXX/blender-2.81a-linux-glibc217-x86_64/2.81, which means python3 is located at /XXX/blender-2.81a-linux-glibc217-x86_64/2.81/python/bin/python3.7

  • Install pip using that Python executable
  • Install Taichi: ./python3.7m -m pip install --upgrade taichi (Note: as of Oct 8 2021, Taichi version is v0.8.1. Please use the latest version.)

Installing taichi_elements (experimental) for Blender

  • Set the environment variable BLENDER_USER_ADDON_PATH, e.g. /home/XXX/.config/blender/2.81/scripts/addons
  • Go to utils folder
  • Execute python3 install_blender_addon.py to install the addon
    • If you are doing development and wish to keep refreshing the installed addon, add an argument -k.
  • Restart Blender to reload the addon

More Repositories

1

taichi

Productive, portable, and performant GPU programming in Python.
C++
25,488
star
2

difftaichi

10 differentiable physical simulators built with Taichi differentiable programming (DiffTaichi, ICLR 2020)
2,449
star
3

taichi-nerfs

Implementations of NeRF variants based on Taichi + PyTorch
Python
726
star
4

games201

Advanced Physics Engines 2020: A Hands-on Tutorial
Python
490
star
5

awesome-taichi

A curated list of awesome Taichi applications, courses, demos and features.
322
star
6

taichi_three

A soft renderer based on Taichi (work in progress)
Python
223
star
7

voxel-challenge

Python
216
star
8

meshtaichi

MeshTaichi: A Compiler for Efficient Mesh-based Operations (SIGGRAPH Asia 2022)
Python
211
star
9

taichi_blend

Taichi Blender intergration for physics simulation and animation
Python
156
star
10

quantaichi

QuanTaichi evaluation suite
Python
134
star
11

taichi-docs-zh-cn

TaichiδΈ­ζ–‡ζ–‡ζ‘£
126
star
12

taichi_houdini

Python
101
star
13

faster-python-with-taichi

Python
76
star
14

taichicon

TaichiCon: Taichi Conferences
71
star
15

taichi_glsl

A Taichi extension library providing a set of GLSL-alike helper functions
Python
70
star
16

taichi-aot-demo

A demo illustrating how to use Taichi as an AOT shader compiler
C++
70
star
17

taichi.js

Run compiled Taichi kernels in JavaScript and WASM
Python
62
star
18

Taichi-UnityExample

C#
54
star
19

image-processing-with-taichi

Python
52
star
20

soft2d-release

Soft2D: A 2D multi-material continuum physics engine designed for real-time applications.
C++
48
star
21

cpp-training-season1

C++ training, season 1
C++
45
star
22

taichi_benchmark

Python
25
star
23

cheatsheet

TeX
24
star
24

taichi_dem

A minimal DEM simulation demo written in Taichi.
Python
24
star
25

docs.taichi.graphics

Home of the Taichi documentation site.
HTML
23
star
26

taichi-unity2

C++
21
star
27

cloth-simulation-homework

Python
16
star
28

community

14
star
29

poisson-sampling-homework

Python
10
star
30

advanced_examples

More advanced Taichi examples
Python
10
star
31

soft2d-for-unity

Soft2D-for-Unity
C#
10
star
32

sourceinspect

A unified inspector for retriving source from Python objects
Python
8
star
33

mls_mpm_88_extensions

Python
6
star
34

test_actions

C++
5
star
35

taichi_elements_blender_examples

5
star
36

public_files

5
star
37

dummy-rdp-client

Keep a live session by RDP, so OpenGL can function.
Rust
4
star
38

docstring-gen

Workflow for generating the docstring website
Python
4
star
39

mpm_3d_exercise

Python
4
star
40

stock_trading_strategy

Optimal stock trading strategy using Taichi
Python
3
star
41

taitopia-status-page

Taitopia status page
Markdown
3
star
42

taichi_assets

Taichi binary assets (submodule of the main Taichi repository)
3
star
43

taichi-release-tests

Python
2
star
44

blogs

Python
2
star
45

voxel-rt2

Voxel Ray Tracer v2 (supersedes https://github.com/taichi-dev/voxel_editor)
Python
2
star
46

taichi-zoo-issue-tracker

This repository is used for collecting user feedback from the community
1
star
47

hackathons

Taichi ❀️ Hackathons
1
star
48

taichi_glad_ready

Ready to use GLAD as a OpenGL API loader
C
1
star