Tangential Collisions¶
- class TangentialCollisions¶
Public Types
- using value_type = TangentialCollision¶
The type of the collisions.
Public Functions
- TangentialCollisions() = default¶
-
inline void build(const CollisionMesh& mesh,
const Eigen::MatrixXd& vertices,
const NormalCollisions& collisions,
const NormalPotential& normal_potential,
double normal_stiffness, double mu)¶
-
void build(const CollisionMesh& mesh,
const Eigen::MatrixXd& vertices,
const NormalCollisions& collisions,
const NormalPotential& normal_potential,
const double normal_stiffness, const Eigen::VectorXd& mus,
const std::function<double(double, double)>& blend_mu
= default_blend_mu)¶
- size_t size() const¶
Get the number of friction collisions.
- bool empty() const¶
Get if the friction collisions are empty.
- void clear()¶
Clear the friction collisions.
- TangentialCollision& operator[](const size_t i)¶
Get a reference to collision at index i.
Public Members
- std::vector<VertexVertexTangentialCollision> vv_collisions¶
Vertex-vertex tangential collisions.
- std::vector<EdgeVertexTangentialCollision> ev_collisions¶
Edge-vertex tangential collisions.
- std::vector<EdgeEdgeTangentialCollision> ee_collisions¶
Edge-edge tangential collisions.
- std::vector<FaceVertexTangentialCollision> fv_collisions¶
Face-vertex tangential collisions.
Tangential Collision¶
- class TangentialCollision : public virtual ipc::CollisionStencil¶
Inheritence diagram for ipc::TangentialCollision:
Collaboration diagram for ipc::TangentialCollision:
Subclassed by ipc::EdgeEdgeTangentialCollision, ipc::EdgeVertexTangentialCollision, ipc::FaceVertexTangentialCollision, ipc::VertexVertexTangentialCollision
Public Functions
- virtual ~TangentialCollision() = default¶
- inline int dim() const¶
Get the dimension of the collision.
- inline int ndof() const¶
Get the number of degrees of freedom for the collision.
-
virtual MatrixMax<double, 3, 2> compute_tangent_basis(
const VectorMax12d& positions) const = 0¶ Compute the tangent basis of the collision.
-
virtual MatrixMax<double, 36, 2> compute_tangent_basis_jacobian(
const VectorMax12d& positions) const = 0¶ Compute the Jacobian of the tangent basis of the collision.
-
virtual VectorMax2d compute_closest_point(
const VectorMax12d& positions) const = 0¶ Compute the barycentric coordinates of the closest point.
-
virtual MatrixMax<double, 2, 12> compute_closest_point_jacobian(
const VectorMax12d& positions) const = 0¶ Compute the Jacobian of the barycentric coordinates of the closest point.
-
virtual VectorMax3d relative_velocity(
const VectorMax12d& velocities) const = 0¶ Compute the relative velocity of the collision.
-
inline virtual MatrixMax<double, 3, 12>
relative_velocity_matrix() const¶ Construct the premultiplier matrix for the relative velocity.
Note
Uses the cached closest point.
- Returns:¶
A matrix M such that
relative_velocity = M * velocities
.
-
virtual MatrixMax<double, 3, 12> relative_velocity_matrix(
const VectorMax2d& closest_point) const = 0¶ Construct the premultiplier matrix for the relative velocity.
-
virtual MatrixMax<double, 6, 12> relative_velocity_matrix_jacobian(
const VectorMax2d& closest_point) const = 0¶ Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
Public Members
- double normal_force_magnitude¶
Normal force magnitude.
- double mu¶
Ratio between normal and tangential forces (e.g., friction coefficient)
- double weight = 1¶
Weight.
- Eigen::SparseVector<double> weight_gradient¶
Gradient of weight with respect to all DOF.
- VectorMax2d closest_point¶
Barycentric coordinates of the closest point(s)
- MatrixMax<double, 3, 2> tangent_basis¶
Tangent basis of the collision (max size 3×2)
Protected Functions
-
void init(const NormalCollision& collision,
const VectorMax12d& positions,
const NormalPotential& normal_potential,
const double normal_stiffness)¶ Initialize the collision.
- Parameters:¶
- const NormalCollision &collision¶
NormalCollision stencil.
- const VectorMax12d &positions¶
Collision stencil’s vertex positions.
- const NormalPotential &normal_potential¶
Normal potential used for normal force.
- const double normal_stiffness¶
Normal potential stiffness.
Vertex-Vertex Tangential Collision¶
-
class VertexVertexTangentialCollision
: public ipc::VertexVertexCandidate,
public ipc::TangentialCollision¶ Inheritence diagram for ipc::VertexVertexTangentialCollision:
Collaboration diagram for ipc::VertexVertexTangentialCollision:
Public Functions
-
VertexVertexTangentialCollision(
const VertexVertexNormalCollision& collision)¶
-
VertexVertexTangentialCollision(
const VertexVertexNormalCollision& collision,
const VectorMax12d& positions,
const NormalPotential& normal_potential,
const double normal_stiffness)¶
- VertexVertexCandidate(long vertex0_id, long vertex1_id)¶
Protected Functions
-
virtual MatrixMax<double, 3, 2> compute_tangent_basis(
const VectorMax12d& positions) const override¶ Compute the tangent basis of the collision.
-
virtual MatrixMax<double, 36, 2> compute_tangent_basis_jacobian(
const VectorMax12d& positions) const override¶ Compute the Jacobian of the tangent basis of the collision.
-
virtual VectorMax2d compute_closest_point(
const VectorMax12d& positions) const override¶ Compute the barycentric coordinates of the closest point.
-
virtual MatrixMax<double, 2, 12> compute_closest_point_jacobian(
const VectorMax12d& positions) const override¶ Compute the Jacobian of the barycentric coordinates of the closest point.
-
virtual VectorMax3d relative_velocity(
const VectorMax12d& velocities) const override¶ Compute the relative velocity of the collision.
-
virtual MatrixMax<double, 3, 12> relative_velocity_matrix(
const VectorMax2d& closest_point) const override¶ Construct the premultiplier matrix for the relative velocity.
-
virtual MatrixMax<double, 6, 12> relative_velocity_matrix_jacobian(
const VectorMax2d& closest_point) const override¶ Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
- inline MatrixMax<double, 3, 12> relative_velocity_matrix() const¶
Construct the premultiplier matrix for the relative velocity.
Note
Uses the cached closest point.
- Returns:¶
A matrix M such that
relative_velocity = M * velocities
.
-
MatrixMax<double, 3, 12> relative_velocity_matrix(
const VectorMax2d& closest_point) const = 0 Construct the premultiplier matrix for the relative velocity.
-
VertexVertexTangentialCollision(
Edge-Vertex Tangential Collision¶
-
class EdgeVertexTangentialCollision
: public ipc::EdgeVertexCandidate,
public ipc::TangentialCollision¶ Inheritence diagram for ipc::EdgeVertexTangentialCollision:
Collaboration diagram for ipc::EdgeVertexTangentialCollision:
Public Functions
-
EdgeVertexTangentialCollision(
const EdgeVertexNormalCollision& collision)¶
-
EdgeVertexTangentialCollision(
const EdgeVertexNormalCollision& collision,
const VectorMax12d& positions,
const NormalPotential& normal_potential,
const double normal_stiffness)¶
Protected Functions
-
virtual MatrixMax<double, 3, 2> compute_tangent_basis(
const VectorMax12d& positions) const override¶ Compute the tangent basis of the collision.
-
virtual MatrixMax<double, 36, 2> compute_tangent_basis_jacobian(
const VectorMax12d& positions) const override¶ Compute the Jacobian of the tangent basis of the collision.
-
virtual VectorMax2d compute_closest_point(
const VectorMax12d& positions) const override¶ Compute the barycentric coordinates of the closest point.
-
virtual MatrixMax<double, 2, 12> compute_closest_point_jacobian(
const VectorMax12d& positions) const override¶ Compute the Jacobian of the barycentric coordinates of the closest point.
-
virtual VectorMax3d relative_velocity(
const VectorMax12d& velocities) const override¶ Compute the relative velocity of the collision.
-
virtual MatrixMax<double, 3, 12> relative_velocity_matrix(
const VectorMax2d& closest_point) const override¶ Construct the premultiplier matrix for the relative velocity.
-
virtual MatrixMax<double, 6, 12> relative_velocity_matrix_jacobian(
const VectorMax2d& closest_point) const override¶ Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
- inline MatrixMax<double, 3, 12> relative_velocity_matrix() const¶
Construct the premultiplier matrix for the relative velocity.
Note
Uses the cached closest point.
- Returns:¶
A matrix M such that
relative_velocity = M * velocities
.
-
MatrixMax<double, 3, 12> relative_velocity_matrix(
const VectorMax2d& closest_point) const = 0 Construct the premultiplier matrix for the relative velocity.
-
EdgeVertexTangentialCollision(
Edge-Edge Tangential Collision¶
-
class EdgeEdgeTangentialCollision : public ipc::EdgeEdgeCandidate,
public ipc::TangentialCollision¶ Inheritence diagram for ipc::EdgeEdgeTangentialCollision:
Collaboration diagram for ipc::EdgeEdgeTangentialCollision:
Public Functions
-
EdgeEdgeTangentialCollision(
const EdgeEdgeNormalCollision& collision)¶
-
EdgeEdgeTangentialCollision(
const EdgeEdgeNormalCollision& collision,
const VectorMax12d& positions,
const NormalPotential& normal_potential,
const double normal_stiffness)¶
Protected Functions
- inline virtual EdgeEdgeDistanceType known_dtype() const override¶
-
virtual MatrixMax<double, 3, 2> compute_tangent_basis(
const VectorMax12d& positions) const override¶ Compute the tangent basis of the collision.
-
virtual MatrixMax<double, 36, 2> compute_tangent_basis_jacobian(
const VectorMax12d& positions) const override¶ Compute the Jacobian of the tangent basis of the collision.
-
virtual VectorMax2d compute_closest_point(
const VectorMax12d& positions) const override¶ Compute the barycentric coordinates of the closest point.
-
virtual MatrixMax<double, 2, 12> compute_closest_point_jacobian(
const VectorMax12d& positions) const override¶ Compute the Jacobian of the barycentric coordinates of the closest point.
-
virtual VectorMax3d relative_velocity(
const VectorMax12d& velocities) const override¶ Compute the relative velocity of the collision.
-
virtual MatrixMax<double, 3, 12> relative_velocity_matrix(
const VectorMax2d& closest_point) const override¶ Construct the premultiplier matrix for the relative velocity.
-
virtual MatrixMax<double, 6, 12> relative_velocity_matrix_jacobian(
const VectorMax2d& closest_point) const override¶ Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
- inline MatrixMax<double, 3, 12> relative_velocity_matrix() const¶
Construct the premultiplier matrix for the relative velocity.
Note
Uses the cached closest point.
- Returns:¶
A matrix M such that
relative_velocity = M * velocities
.
-
MatrixMax<double, 3, 12> relative_velocity_matrix(
const VectorMax2d& closest_point) const = 0 Construct the premultiplier matrix for the relative velocity.
-
EdgeEdgeTangentialCollision(
Face-Vertex Tangential Collision¶
-
class FaceVertexTangentialCollision
: public ipc::FaceVertexCandidate,
public ipc::TangentialCollision¶ Inheritence diagram for ipc::FaceVertexTangentialCollision:
Collaboration diagram for ipc::FaceVertexTangentialCollision:
Public Functions
-
FaceVertexTangentialCollision(
const FaceVertexNormalCollision& collision)¶
-
FaceVertexTangentialCollision(
const FaceVertexNormalCollision& collision,
const VectorMax12d& positions,
const NormalPotential& normal_potential,
const double normal_stiffness)¶
Protected Functions
-
virtual MatrixMax<double, 3, 2> compute_tangent_basis(
const VectorMax12d& positions) const override¶ Compute the tangent basis of the collision.
-
virtual MatrixMax<double, 36, 2> compute_tangent_basis_jacobian(
const VectorMax12d& positions) const override¶ Compute the Jacobian of the tangent basis of the collision.
-
virtual VectorMax2d compute_closest_point(
const VectorMax12d& positions) const override¶ Compute the barycentric coordinates of the closest point.
-
virtual MatrixMax<double, 2, 12> compute_closest_point_jacobian(
const VectorMax12d& positions) const override¶ Compute the Jacobian of the barycentric coordinates of the closest point.
-
virtual VectorMax3d relative_velocity(
const VectorMax12d& velocities) const override¶ Compute the relative velocity of the collision.
-
virtual MatrixMax<double, 3, 12> relative_velocity_matrix(
const VectorMax2d& closest_point) const override¶ Construct the premultiplier matrix for the relative velocity.
-
virtual MatrixMax<double, 6, 12> relative_velocity_matrix_jacobian(
const VectorMax2d& closest_point) const override¶ Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
- inline MatrixMax<double, 3, 12> relative_velocity_matrix() const¶
Construct the premultiplier matrix for the relative velocity.
Note
Uses the cached closest point.
- Returns:¶
A matrix M such that
relative_velocity = M * velocities
.
-
MatrixMax<double, 3, 12> relative_velocity_matrix(
const VectorMax2d& closest_point) const = 0 Construct the premultiplier matrix for the relative velocity.
-
FaceVertexTangentialCollision(