Skip to content

Conversation

zfergus
Copy link
Member

@zfergus zfergus commented Aug 18, 2025

Description

This pull request introduces support for rigid body dynamics simulation.

Rigid body dynamics support in Python bindings

  • Added a new dynamics module with subfolder rigid, including Simulator, RigidBodies, Pose, and Poses classes, and exposed them via pybind11 in the Python bindings

Improvements to CMake dependency management

  • Updated CPM versions and refactored third-party recipes to use the OPTIONS argument for configuration, improving clarity and maintainability.
  • Added a new CMake recipe for TinyGLTF and integrated it into the build.

Python usability improvements and new examples

  • Added a new example script demonstrating rigid body simulation and visualization using ipctk, meshio, and polyscope (python/examples/rigid.py).

Minor Python binding improvements

  • Changed save_obj method to write_obj in Candidates Python bindings for clarity.
  • Made CollisionMesh Python class use std::shared_ptr for better memory management.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

zfergus and others added 17 commits May 31, 2024 00:41
- Added InertialTerm class for computing energy, gradient, and Hessian of rigid bodies.
- Implemented mass properties computation for 2D and 3D meshes, including point clouds.
- Created pose representation with rotation vector and matrix conversions.
- Developed RigidBodies class to manage multiple rigid bodies from mesh data.
- Implemented ImplicitEuler time integrator for updating positions and velocities.
- Added unit tests for mass properties and pose transformations using Catch2 framework.
- Updated finite-diff package from version 1.0.1 to 1.0.3 in CMake configuration.
- Remove template from Pose.
- Modified RigidBody and related classes to use the updated Pose structure.
- Added unit tests for RigidBody construction and transformations.
- Update CPM to 0.42.0
- Add TinyGLTF dependency
- Rename save_obj to write_candidates_obj
- Add write_gltf
@zfergus zfergus added the enhancement New feature or request label Aug 18, 2025
@zfergus zfergus added this to the v1.5.0 milestone Aug 18, 2025
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

❌ Patch coverage is 75.31557% with 176 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.37%. Comparing base (b9a841f) to head (7f75e25).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...rc/ipc/dynamics/affine/orthogonality_potential.cpp 34.88% 56 Missing ⚠️
src/ipc/dynamics/rigid/mass.cpp 66.24% 53 Missing ⚠️
src/ipc/dynamics/rigid/inertial_term.cpp 84.04% 15 Missing ⚠️
src/ipc/broad_phase/sweep_and_prune.cpp 0.00% 14 Missing ⚠️
src/ipc/candidates/candidates.cpp 0.00% 9 Missing ⚠️
src/ipc/broad_phase/broad_phase.cpp 53.84% 6 Missing ⚠️
src/ipc/broad_phase/spatial_hash.cpp 77.77% 6 Missing ⚠️
src/ipc/dynamics/rigid/rigid_body.cpp 89.83% 6 Missing ⚠️
src/ipc/broad_phase/spatial_hash.hpp 0.00% 3 Missing ⚠️
src/ipc/dynamics/rigid/rigid_body.hpp 50.00% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #184      +/-   ##
==========================================
- Coverage   96.25%   94.37%   -1.88%     
==========================================
  Files         105      118      +13     
  Lines        8064     8717     +653     
==========================================
+ Hits         7762     8227     +465     
- Misses        302      490     +188     
Flag Coverage Δ
unittests 94.37% <75.31%> (-1.88%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Introduce new overloads for build methods across various classes, allowing for the use of precomputed AABBs.
- Update related documentation and ensure consistent handling of vertex boxes and edges.
- Improve voxel size suggestion logic based on bounding box dimensions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant