Code Monkey home page Code Monkey logo

taichi_elements's Introduction

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

  • 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.)

  • 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

taichi_elements's People

Contributors

ailzhang avatar archibate avatar eydcao avatar izackwu avatar jack12xl avatar klozes avatar ltt1598 avatar neozhaoliang avatar pavelblend avatar strongoier avatar taichi-gardener avatar victoriacity avatar yuanming-hu avatar

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.