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 ❌ Your patch check has failed because the patch coverage (68.37%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #184 +/- ##
==========================================
- Coverage 96.95% 94.42% -2.54%
==========================================
Files 158 184 +26
Lines 24663 26225 +1562
Branches 883 1044 +161
==========================================
+ Hits 23912 24762 +850
- Misses 751 1463 +712
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 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
- q_hat and Q_hat should be force and torque in BodyForces
Replace many Eigen vector/matrix parameters with Eigen::ConstRef to avoid unnecessary copies and clarify ownership. Also add const correctness to various methods (e.g. BodyForces operator(), gradient), rename forces/torques to m_forces/m_torques, add test_body_forces.
- Add Pose::inverse - Fix Pose::operator*
- Update tests to use finite_jacobian_tensor
Add checks in BodyForces to skip translational and rotational computations when force or torque is zero, avoiding unnecessary dot/jacobian/hessian work. Also add test diagnostics: include iostream and print analytical vs numerical gradient/hessian on comparison failures to aid debugging.
- Updated the return types of tangent basis Jacobian functions to reflect correct matrix dimensions. - Modified the corresponding test cases to use auto for Jacobian variable declarations for improved readability. - Added new test cases for point-point, point-edge, edge-edge, and point-triangle relative velocity matrix Jacobians, ensuring analytical and numerical Jacobians are compared. - Included necessary headers for finite difference calculations in the test files.
- Implemented GroundContact class for handling ground interaction in rigid body dynamics. - Added methods for energy computation, gradient, and Hessian in GroundContact. - Updated rigid body simulator to include body forces and integrate ground contact dynamics. - Refactored rigid body initialization to apply centering pose correctly. - Added tests for GroundContact energy, gradient, and Hessian calculations. - Enhanced pose class with methods for transforming vertices and computing Jacobians and Hessians. - Updated existing tests to ensure compatibility with new features and validate correctness.
Delete maybe_parallel_for.hpp and maybe_parallel_for.tpp from src/ipc/utils/CMakeLists.txt SOURCES list. This updates the build to no longer include these files (they may have been removed or relocated), preventing build errors from missing source entries.
Change the simulator API to return a success state (bool) and pass a bool to the per-step callback; step() now returns bool and run() returns false if simulation is complete or a step failed. Add convergence warning when solver hits iteration limit and preserve behavior notes; add has_time_remaining helper for robust time checks. Fix CollisionMesh initialization (use setConstant) and log a warning for non-manifold edges instead of asserting. Adjust RigidBodies indexing math for body-local edges/faces. Update Python example to load multiple meshes and set up multiple rigid bodies. Extend mass tests to cover multiple meshes/densities using igl::moments, add test_simulator and include it in CMake, and update the ipc-toolkit-tests-data GIT_TAG.
- Implemented zero-initialization for Hessian matrix in InertialTerm. - Added handling for zero rotation in Pose struct to return identity quaternion. - Introduced plane detection in RigidBodies construction from meshes, allowing conversion of flat bodies to planes. - Updated RigidBodies class to accommodate plane bodies and modified build_from_meshes method accordingly. - Added read_gltf function to import rigid body scenes from GLTF files, supporting plane conversion. - Created write_gltf function to export rigid body states to GLTF format, including analytic planes. - Removed GroundContact class and related tests, streamlining the dynamics module. - Added unit tests for GLTF reading functionality, verifying correct body and plane extraction.
Clamp pose rotation vectors to [-π, π] to prevent angle drift and improve optimizer convergence. Tighten barrier params (dhat 0.1→0.001, kappa 10→1). Enable area-weighting and use IMPROVED_MAX_APPROX collisions. Remove GroundContact from simulator and energy/gradient/hessian. Add numeric checks (assert finite) and verify energy after collision updates; cap Newton iterations (max_iters=100) and improve log messages. Update tests to add a ground plane for contact.
Replace the custom Plane struct and implicit plane implementation with Eigen::Hyperplane across the codebase. Remove implicits plane sources and CMake entries, update C++ code, Python bindings, tests, and GLTF IO to use the Hyperplane API (normal, offset, origin helper) and fix related includes.
Big refactor of rigid/affine dynamics: remove the old AffineBody type and adapt affine potentials to work with rigid::RigidBodies and per-body RigidBody DOFs. Add affine inertial term (inertial_term.{cpp,hpp}) that uses the time integrator state. Introduce an abstract RigidPotential base class (rigid_potential.{hpp,cpp}) to consolidate cumulative -> per-body dispatch; make BodyForces and InertialTerm inherit and implement per-body indexed interfaces. Update OrthogonalityPotential to use RigidBodies, per-body vectors, tbb::parallel_reduce, and PSD projection for hessians. Add Pose transform/J and Jacobian helpers, expose volume/density in RigidBody (compute volume in ctor), and expose x_hat() in the time integrator. Update CMakeLists and tests to reflect the new APIs and validate gradients with finite differences. Misc: adjust includes and parallelization patterns.
Set GIT_TAG for ipc_toolkit_tests_data to 5f455c16f461e56d68e9241fa038bd20d95bce0a (was 9061bb85b30b7e410db736f6e16de234d5b0555a)
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
This pull request introduces support for rigid body dynamics simulation.
Rigid body dynamics support in Python bindings
dynamicsmodule with subfolderrigid, includingSimulator,RigidBodies,Pose, andPosesclasses, and exposed them via pybind11 in the Python bindingsImprovements to CMake dependency management
OPTIONSargument for configuration, improving clarity and maintainability.Python usability improvements and new examples
ipctk,meshio, andpolyscope(python/examples/rigid.py).Minor Python binding improvements
save_objmethod towrite_objinCandidatesPython bindings for clarity.CollisionMeshPython class usestd::shared_ptrfor better memory management.Type of change