-
Notifications
You must be signed in to change notification settings - Fork 39
Rigid and Affine Body Dynamics #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
zfergus
wants to merge
46
commits into
main
Choose a base branch
from
dynamics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+51,140
−92,911
Conversation
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
- 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.96% 95.24% -1.73%
==========================================
Files 161 182 +21
Lines 24747 25905 +1158
Branches 893 1010 +117
==========================================
+ Hits 23997 24672 +675
- Misses 750 1233 +483
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
Move sinc implementation from ipc/utils to ipc/math and update CMake. Replace includes of ipc/utils/interval.hpp with ipc/math/interval.hpp. Expose NonlinearCCD constructor and properties in Python bindings and adjust tests accordingly. Rename candidates::save_obj to write_obj and add missing ipc/geometry/normal.hpp includes where required.
- Reorder conservative_piecewise_linear_ccd parameters so min_distance comes before tmax, rename the intermediate min_distance to min_distance_linear to avoid confusion/shadowing, and update all call-sites accordingly. - Also remove an overly restrictive assertion in HashGrid::resize that limited the grid size.
- Rename BodyForces parameters (force/torque -> q_hat/Q_hat). - Add const qualifiers to InertialTerm methods. - Take RigidBodies shared_ptr and the Simulator callback by reference. - Add linter NOLINT annotations, remove an unused include, replace/tidy sinc taylor bound constants, and fix RigidBodies initializer and RigidBody enum underlying type.
- 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.
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