A cloth simulation SDK for Python
Project description
Tissu
Tissu is a C++ cloth simulation SDK designed to integrate seamlessly into Digital Content Creation (DCC) tools such as Blender. It was developed to make high-fidelity cloth simulation as accessible as possible for technical artists and developers.
By combining a high-performance C++ core with a flexible Python API. Tissu lets you script complex simulations with the simplicity of Python and the velocity of C++.
Table of Contents
- Features
- How To Use
- Real-time Viewer
- Requirements
- Supported Operating Systems
- Build and Installation
- Development and Testing
- Technical Documentation
- License
Features
Tissu includes the following features:
-
IO
- Alembic exportation (
.abc) - Wavefront
.objimportation and exportation - State serialization (
.tissu) - Scene loader and exporter (
.json) - Material presets loader (
.json)
- Alembic exportation (
-
Physics (XPBD Solver)
- Distance constraint
- Bending constraint
- Volume constraint
- Pin constraint
- Broad-phase collision detection via Spatial Hash
- Sphere, capsule and plane colliders
- Kinematic Colliders
- Self-collision detection
- Gravity force
- Aerodynamic force
-
Python API
- Full simulation scripting via
tissuPython package - Event scheduling
- Full simulation scripting via
Coming Soon
Features planned for future releases:
- USD exportation
- Mesh colliders
- Stitch constraint
- Full multi-cloth support (viewer + Alembic)
The ultimate goal of Tissu is to become a Blender add-on.
How To Use
Let's script a cloth falling onto a sphere collider. The following example demonstrates how to set up a simulation, add constraints, schedule events, and export the result.
from tissu import Simulation
# 1. Initialize the simulation environment
sim = Simulation(substeps=10, iterations=3, thickness=0.05)
# 2. Create a cloth grid
curtain = sim.create_grid(
name="curtain",
rows=80,
cols=80,
spacing=0.05,
material="silk"
)
# Pin the top corners to initially hold the curtain in place
curtain.pin_top_corners()
# 3. Add a sphere collider
# (name, initial position, radius, friction)
ball = sim.add_sphere('ball', [2.0, 0.0, 0.0], 1.0, 0.5)
# 4. Schedule an event: Unpin the curtain at frame 40 so it falls
@sim.on_frame(40)
def unpin(sim):
curtain.unpin()
# 5. Run the simulation and export the result directly to Alembic
output = "data/animations/cloth_on_sphere.abc"
sim.bake_alembic(
filepath=output,
start_frame=1,
end_frame=240,
fps=60
)
Real-time Viewer
Tissu comes with a built-in OpenGL viewer for real-time visualization. If you install Tissu with viewer support, you can preview your simulation before baking.
Instead of calling sim.bake_alembic(), simply launch the interactive viewer.
sim.view()
The viewer includes an integrated ImGui control panel to manage the simulation on the fly. From here, you can:
- Load Scenes, Materials, and Physics presets
- Adjust Shader and World parameters
- Tune Solver parameters in real-time
- Monitor performance statistics
Keybindings
- G : Take a state snapshot (.tissu files)
- S : Take a geometry snapshot (.obj files)
- R : Reset the simulation
- Space : Play / Pause the simulation
- Left Click : Grab and interact with particles manually
Requirements
These dependencies must be installed on your system before building the project:
Python Requirements
To build and use tissu, you need:
- Python ($\ge$ 3.8)
- Build Tools: setuptools $\ge$ 61.0, wheel
- Packages: mypy, numpy, tqdm, pytest
Python dependencies are automatically handled if you install the package via
pip install .
Fetched Dependencies (Core)
These dependencies are automatically downloaded and built by CMake via FetchContent:
- Eigen (3.4.0)
- tinyobjloader
- nlohmann/json (v3.11.3)
- pybind11 (v2.13.6)
- GoogleTest (v1.15.2) - For testing
- Google Benchmark (v1.9.1) - For benchmarking
Standalone Viewer Requirements (Optional)
If the build includes the standalone viewer (TISSU_BUILD_VIEWER=ON), the following additional dependencies apply:
System Requirements:
- OpenGL (System graphics libraries)
- Threads (Standard OS threading support)
Fetched Dependencies (Handled by CMake):
Supported Operating Systems
- Linux: Supported and tested (On Fedora)
- macOS: Untested.
- Windows: Experimental. (Need more tests)
Build and Installation
1. Clone Repository
Cloning the repository is as simple as
git clone https://github.com/evanrock520-ciencias/Tissu.git
cd Tissu
2. Compile the SDK
Build the shared library and the standalone viewer using CMake.
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4
cd ..
3. Install Tissu
To import the library in your scripts, install the tissu package with pip:
pip install .
Run this from the root of the repo after building with CMake
Development and Testing
Tissu includes a test suite for both C++ and Python
- C++ Tests: Powered by Google Test (
tests/) - Python Tests: Powered by Pytest (
tests/python/). - Benchmarks: Powered by Google Benchmark (
benchmarks/).
Technical Documentation
Technical documentation is currently a work in progress. It is expected to include:
Almost all pages may be incomplete or missing content.
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytissu-1.0.2.tar.gz.
File metadata
- Download URL: pytissu-1.0.2.tar.gz
- Upload date:
- Size: 66.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
139516684b795dde1c0bd6de7548fe5660821278aacb7d6d15e1b5760b55be05
|
|
| MD5 |
e9e45c54f99781964b1a09d3e2ee5ed8
|
|
| BLAKE2b-256 |
dd8d9d5e46acba06bca2425b1035c86257069b376c977a6b15cc19b3ad13aff3
|
File details
Details for the file pytissu-1.0.2-cp314-cp314-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: pytissu-1.0.2-cp314-cp314-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.14, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
325567af4a62d825ed147d2eed61853143d022daffbe39f9c4efcf75e34782f9
|
|
| MD5 |
bbd8c4d7913ccc2d6c913247338ccaeb
|
|
| BLAKE2b-256 |
ebb835069b0e199d75b66bdacf553b3cc7628e1343c7d398f57cdcd9e70f93ea
|
File details
Details for the file pytissu-1.0.2-cp313-cp313-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: pytissu-1.0.2-cp313-cp313-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.13, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab079ff3d0d30177f6fb027ca4486b66788db79155505beb8f9436f03a5395d6
|
|
| MD5 |
f8a69d14ceccb18bf7af35947202be7a
|
|
| BLAKE2b-256 |
4fa1a7d72c66bbcf2cb504f442823809053aacfded173f3b898f01153efbf35b
|
File details
Details for the file pytissu-1.0.2-cp312-cp312-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: pytissu-1.0.2-cp312-cp312-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fccc1494300f791c0f75a087d8611d749bd51a8779d2aea31e4d375bd1bdcb9
|
|
| MD5 |
7f3bcb24e3a767212ce81ff3e8060947
|
|
| BLAKE2b-256 |
af600a6571de2e676f09d1b863aa3b5e1417e4b66ccc1830a921d9e75d5ffffa
|