Skip to main content

Physics Based Animation Toolkit

Project description

Physics Based Animation Toolkit

Wheels

We recommend exploring the official CMake documentation to beginner CMake users.

Overview

The Physics Based Animation Toolkit (PBAT) is a (mostly templated) cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation in dimensions 1,2,3. For most use cases, we recommend using our library via its Python interface, enabling seamless integration into Python's ecosystem of powerful scientific computing packages.

Our Python bindings are currently not available on MacOS via PyPI.

Dependencies

See vcpkg.json for a versioned list of our dependencies, available via vcpkg (use of vcpkg is not mandatory, as long as dependencies have compatible versions and are discoverable by CMake's find_package mechanism).

Configuration

Option Values Default Description
PBAT_BUILD_PYTHON_BINDINGS ON,OFF OFF Enable PhysicsBasedAnimationToolkit_PhysicsBasedAnimationToolkit Python bindings. Generates the CMake target PhysicsBasedAnimationToolkit_Python, an extension module for Python, built by this project.
PBAT_BUILD_TESTS ON,OFF OFF Enable PhysicsBasedAnimationToolkit_PhysicsBasedAnimationToolkit unit tests. Generates the CMake target executable PhysicsBasedAnimationToolkit_Tests, built by this project.
PBAT_ENABLE_PROFILER ON,OFF OFF Enable Tracy instrumentation profiling in built PhysicsBasedAnimationToolkit_PhysicsBasedAnimationToolkit.
PBAT_USE_INTEL_MKL ON,OFF OFF Link to user-provided Intel MKL installation via CMake's find_package.
PBAT_USE_SUITESPARSE ON,OFF OFF Link to user-provided SuiteSparse installation via CMake's find_package.
PBAT_BUILD_SHARED_LIBS ON,OFF OFF Build project's library targets as shared/dynamic.

Build

Build transparently across platforms using the cmake build CLI.

CMake build targets:

Target Description
PhysicsBasedAnimationToolkit_PhysicsBasedAnimationToolkit The PBA Toolkit library.
PhysicsBasedAnimationToolkit_Tests The test executable, using doctest.
PhysicsBasedAnimationToolkit_Python PBAT's Python extension module, using pybind11.

Install

From command line:

cd path/to/PhysicsBasedAnimationToolkit
cmake -S . -B build -A x64 -DPBAT_ENABLE_PROFILER:BOOL=ON -DPBAT_BUILD_TESTS:BOOL=ON
cmake --install build --config Release

Quick start

We recommend downloading the Tracy profiler server to analyze execution of PBAT algorithms, available as precompiled executable.

C++

Take a look at the unit tests, found in the library's source (.cpp) files.

Python

To download and install from PyPI, run in command line:

pip install pbatoolkit

To install locally and get the most up to date features, run in command line:

pip install .

Example code can be found here.

To profile relevant calls to pbatoolkit functions/methods, connect to python.exe in the Tracy profiler server GUI. All calls to pbat will be profiled on a per-frame basis in the Tracy profiler server GUI.

Use method profile of pbatoolkit.profiling.Profiler to profile code external to PBAT, allowing for an integrated profiling experience while using various scientific computing packages.

def expensive_external_computation():
    # Some expensive computation
profiler.profile("My expensive external computation", expensive_external_computation)

Contributing

Coding style

A .clang-format description file is provided in the repository root which should be used to enforce a uniform coding style throughout the code base using the clang-format tool. Recent versions of Visual Studio Code and Visual Studio should come bundled with a clang-format installation. On Unix-like systems, clang-format can be installed using your favorite package manager.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pbatoolkit-0.0.3-cp312-cp312-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.12 Windows x86-64

pbatoolkit-0.0.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.8 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

pbatoolkit-0.0.3-cp311-cp311-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.11 Windows x86-64

pbatoolkit-0.0.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (17.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

pbatoolkit-0.0.3-cp310-cp310-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.10 Windows x86-64

pbatoolkit-0.0.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

File details

Details for the file pbatoolkit-0.0.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pbatoolkit-0.0.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ee8d76314e64906734061dd82ef358c6d1b78ce2a75afc37f4f246b62039d7d4
MD5 d54be4f5b9ded0eb5412bc13e87bcac4
BLAKE2b-256 9e95e830fb512c1baf82dd210492cf411c665b58541a02d257ad09ae92f020cd

See more details on using hashes here.

File details

Details for the file pbatoolkit-0.0.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pbatoolkit-0.0.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a021709afd257be86ea65f52c08f5c8adc61f4cedb13a56f95847982b1be8af2
MD5 1bef88b2232b113cd8116476ef553209
BLAKE2b-256 37b9ea5622c7575dae4553e4e8f0f14bfb09f2d79ee6d50cc9819c2b808f3924

See more details on using hashes here.

File details

Details for the file pbatoolkit-0.0.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pbatoolkit-0.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 34e4dc9262b90d252a905bd3f71b6efb3f1d6bf40f63eea97511a6fac9b6b9fb
MD5 d534b5bf4c84da4e112671ad52c3e54b
BLAKE2b-256 359aad2478ad3a51605439139fc05e23f398c63677bc4d6489840079ba841938

See more details on using hashes here.

File details

Details for the file pbatoolkit-0.0.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pbatoolkit-0.0.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ad171e609b39faefdfcd97af4162e8d2c39b8aae76d1674a7ba42a2a65d28497
MD5 ea2a27b3a4de7bccb925c5778de7817d
BLAKE2b-256 f075ad4ee97a78272d5999019f4447055b4ed91d9127c27d10e1fbd1c17ef503

See more details on using hashes here.

File details

Details for the file pbatoolkit-0.0.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pbatoolkit-0.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 023cc9e0cce56e85a405a4e7b753f8e72207cfad57af2b9736d86aec780f4731
MD5 c30155ab3e530544366c94b1bde7206d
BLAKE2b-256 d640bbce2e49f0b6225da34b34420af45593a1d70e42b84886addc7721971e24

See more details on using hashes here.

File details

Details for the file pbatoolkit-0.0.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pbatoolkit-0.0.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 94a89a7ba3f58e72c630f77d780e916ce1ad380893bacc93b25685a1d5a63e05
MD5 4c8a9b2f0d8bad2bda34fc8a19b99332
BLAKE2b-256 bd3bde260fb8f6cbc9a96d823d40f5be97bb0c9a1e7d318f1c85ec7c91810406

See more details on using hashes here.

Supported by

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