Skip to main content

A cloth simulation SDK for Python

Project description

Tissu

Language Language License Physics Platform CI

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++.

On Sphere

Table of Contents


Features

Tissu includes the following features:

  • IO

    • Alembic exportation (.abc)
    • Wavefront .obj importation and exportation
    • State serialization (.tissu)
    • Scene loader and exporter (.json)
    • Material presets loader (.json)
  • 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 tissu Python package
    • Event scheduling

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

Viewer

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:

  • Cmake ($\ge$ 3.16)
  • C++ Compiler with C++17 support (GCC, Clang, or MSVC)
  • Alembic
  • Imath
  • OpenMP

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:

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):

  • GLFW (3.3.8)
  • GLAD (v2.0.8, Core 4.6)
  • ImGui (v1.91.5 - Docking branch)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytissu-1.0.2.tar.gz (66.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pytissu-1.0.2-cp314-cp314-manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

pytissu-1.0.2-cp313-cp313-manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

pytissu-1.0.2-cp312-cp312-manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

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

Hashes for pytissu-1.0.2.tar.gz
Algorithm Hash digest
SHA256 139516684b795dde1c0bd6de7548fe5660821278aacb7d6d15e1b5760b55be05
MD5 e9e45c54f99781964b1a09d3e2ee5ed8
BLAKE2b-256 dd8d9d5e46acba06bca2425b1035c86257069b376c977a6b15cc19b3ad13aff3

See more details on using hashes here.

File details

Details for the file pytissu-1.0.2-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pytissu-1.0.2-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 325567af4a62d825ed147d2eed61853143d022daffbe39f9c4efcf75e34782f9
MD5 bbd8c4d7913ccc2d6c913247338ccaeb
BLAKE2b-256 ebb835069b0e199d75b66bdacf553b3cc7628e1343c7d398f57cdcd9e70f93ea

See more details on using hashes here.

File details

Details for the file pytissu-1.0.2-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pytissu-1.0.2-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ab079ff3d0d30177f6fb027ca4486b66788db79155505beb8f9436f03a5395d6
MD5 f8a69d14ceccb18bf7af35947202be7a
BLAKE2b-256 4fa1a7d72c66bbcf2cb504f442823809053aacfded173f3b898f01153efbf35b

See more details on using hashes here.

File details

Details for the file pytissu-1.0.2-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pytissu-1.0.2-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 1fccc1494300f791c0f75a087d8611d749bd51a8779d2aea31e4d375bd1bdcb9
MD5 7f3bcb24e3a767212ce81ff3e8060947
BLAKE2b-256 af600a6571de2e676f09d1b863aa3b5e1417e4b66ccc1830a921d9e75d5ffffa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page