Repository navigation
Conversation
- 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
…_throw_error for consistency
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #184 +/- ##
==========================================
- Coverage 96.86% 96.09% -0.78%
==========================================
Files 229 270 +41
Lines 23047 26412 +3365
Branches 1619 2039 +420
==========================================
+ Hits 22325 25381 +3056
- Misses 722 1031 +309
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…in normal collisions test (#185)
- 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.
… function signatures
…ment collision detection methods
# Conflicts: # python/src/candidates/plane_vertex.cpp # src/ipc/broad_phase/lbvh.hpp # src/ipc/candidates/plane_vertex.hpp # src/ipc/utils/save_obj.hpp Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ipc_toolkit defines it publicly when SIMD is on, and the demo Simulator passes Eigen objects across the polysolve boundary. Match the setting on polysolve and polysolve_linear, as done for finite-diff and MeshFEMSparse, so both sides agree on alignment and layout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts: # .gitignore
v3 is a rewrite that ships tiny_gltf_v3.h/.c and no tiny_gltf.h or tiny_gltf.cc, so the recipe failed at configure on every platform. read_gltf and write_gltf also use the v2 API, so moving to v3 needs a port first. This reverts commit 5bf9f24. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
GENERATE expands to a lambda with no captures, and MSVC cannot capture a local constexpr implicitly. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts: # .gitattributes # src/ipc/broad_phase/lbvh.cpp # src/ipc/broad_phase/lbvh.hpp
# Conflicts: # docs/source/cpp-api/ccd.rst # docs/source/python-api/ccd.rst # python/src/ccd/additive_ccd.cpp # python/src/ccd/narrow_phase_ccd.cpp # python/src/ccd/nonlinear_ccd.cpp # python/tests/test_ccd.py # src/ipc/ccd/additive_ccd.cpp # src/ipc/ccd/additive_ccd.hpp # src/ipc/ccd/inexact_ccd.cpp # src/ipc/ccd/inexact_ccd.hpp # src/ipc/ccd/narrow_phase_ccd.hpp # src/ipc/ccd/nonlinear_ccd.cpp # src/ipc/ccd/nonlinear_ccd.hpp # src/ipc/ccd/tight_inclusion_ccd.cpp # src/ipc/ccd/tight_inclusion_ccd.hpp # src/ipc/io/CMakeLists.txt # tests/src/tests/ccd/test_nonlinear_ccd.cpp
# Conflicts: # src/ipc/math/math.cpp # src/ipc/math/math.hpp
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The demo simulator tests now share the runner with the slow barrier potential tests, which can push one past ctest's default 1500 s. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Add C++ pages for rigid bodies, affine bodies, dynamics, and I/O - Add Python pages for rigid bodies, affine bodies, I/O, and the demo - Build the docs with glTF enabled so the I/O pages render - Drop explicit entries for nested enums that their class already lists
- Walk through dropping a cube with the demo simulator in both models - Pull the C++ and Python snippets from new tests so they stay working
PolySolve now inherits it from the Eigen target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These files had no trailing newline on main, so adding one only creates diff noise. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Wrap the compiled bindings, now ipctk._ipctk, in a Python package - Move rigid.py to ipctk.demo.rigid (python -m or ipctk-rigid) - Report the installed package version in __version__ Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 of 7 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds rigid and affine body dynamics as reusable library components (
src/ipc/dynamics/), glTF scene I/O (src/ipc/io/), and a demo simulator (demo/) that assembles them.This PR used to carry the CCD, LBVH, math, logging, and docs changes that the simulator depends on. Those were split out and have all merged, so what remains here is the dynamics work itself:
NonlinearCCDcan delegate to anyNarrowPhaseCCD(NarrowPhaseCCD::Mode).ipc::PI,sinc, andnearest_rotation.iomodule.LBVHqueries against another set's leaves.Mechanism
ipc::rigid—Pose,RigidBody, andRigidBodies(aCollisionMeshof all bodies, built from per-body meshes). Each body is re-centered on its center of mass and expressed in its principal frame. This follows Rigid IPC (Ferguson et al. 2021).ipc::rigid::RigidCandidates— finds body pairs with a bounding-sphere broad phase, then queries each pair with the two-tree LBVH queries from Query an LBVH against another set's leaves #293 in one body's rest frame. Narrow-phase CCD follows the curved rigid trajectories throughNonlinearCCD(Let NonlinearCCD delegate to any NarrowPhaseCCD #290), with a conservative bound on how far each piece strays from its chord.ipc::affine— the body terms are written once in affine coordinates y = [p; vec(A)]:InertialTerm,BodyForces,OrthogonalityPotential, anAugmentedLagrangianthat drives kinematic bodies, and linearJointConstraints. This follows ABD (Lan et al. 2022), with joints as in Chen et al. 2022, §4.1.ipc::dynamics— aToAffinechange of variables lets the same terms serve both models.RigidToAffinemaps [p; θ] to A = R(θ);AffineToAffineis the identity.BodyPotentialssums the terms and applies the chain rule once, andBDFprovides orders 1–6.demo/(ipc_toolkit_demo, not part of the library) — a polysolve-basedSimulatorwith adaptive barrier stiffness, lagged friction, and static/kinematic bodies. It is exposed in Python asipctk.demo.Impact
AdditiveCCDas the per-piece linear CCD insideNonlinearCCD.IPC_TOOLKIT_WITH_GLTF=ON.API changes
IPC_TOOLKIT_BUILD_DEMO(ON at top level, OFF as a subproject) andIPC_TOOLKIT_WITH_GLTF(OFF).CollisionMesh: the destructor andvertices(full_positions)are now virtual, soRigidBodiescan map poses to vertices. This is source compatible, butCollisionMeshnow has a vtable, so it is not binary compatible with earlier builds.RigidBodies,RigidBody,Pose/Poses,AffinePose,JointConstraints, andread_gltf/write_gltf, plus the demo simulator asipctk.demo.💥 Breaking changes
None. The breaking changes this work originally needed (the
NarrowPhaseCCDmode parameter, theNonlinearCCDconstructor, and thesave_objrename) shipped in #290 and #292.New dependencies
ipc_toolkit_demo, never byipc_toolkit.PRIVATE.IPC_TOOLKIT_WITH_GLTF=ON.Type of change
How Has This Been Tested?
ipc_toolkit_tests "~[!benchmark]": all 518 test cases pass (last full local run, before the split PRs landed; CI covers the merged state). This includes 86 new cases intests/src/tests/{dynamics,demo,io}:ToAffinechain rule, and rigid pose derivatives.python -m nose2inpython/tests: all 106 tests pass.Test Configuration:
Benchmark: rotation vector → rotation matrix
The new analytic
rotation_vector_to_matrix(plus_jacobianand_hessian) compared against the autodiff pose construction in Rigid IPC (dfff467b). Catch2 mean time per call, averaged over three runs of each benchmark:Every measurement stayed within about ±3% of its mean across the three runs.
These are not identical workloads, so read the Jacobian and Hessian rows as "what each simulator pays to get these derivatives" rather than a pure algorithmic comparison:
To reproduce (Release, AppleClang 21,
-O3, Apple Silicon):Checklist