Tangential Collisions¶
- class ipctk.TangentialCollisions¶
Bases:
pybind11_object
Public Data Attributes:
Public Methods:
__init__
(self)build
(*args, **kwargs)Overloaded function.
__len__
(self)Get the number of friction collisions.
empty
(self)Get if the friction collisions are empty.
clear
(self)Clear the friction collisions.
__getitem__
(self, i)Get a reference to collision at index i.
default_blend_mu
(mu0, mu1)Inherited from
pybind11_object
-
__annotations__ =
{}
¶
- __getitem__(self, i: int) ipctk.TangentialCollision ¶
Get a reference to collision at index i.
- __init__(self)¶
- __len__(self) int ¶
Get the number of friction collisions.
-
__module__ =
'ipctk'
¶
- build(*args, **kwargs)¶
Overloaded function.
build(self: ipctk.TangentialCollisions, mesh: ipc::CollisionMesh, vertices: numpy.ndarray[numpy.float64[m, n]], collisions: ipctk.NormalCollisions, normal_potential: ipc::NormalPotential, normal_stiffness: float, mu: float) -> None
build(self: ipctk.TangentialCollisions, mesh: ipc::CollisionMesh, vertices: numpy.ndarray[numpy.float64[m, n]], collisions: ipctk.NormalCollisions, normal_potential: ipc::NormalPotential, normal_stiffness: float, mus: numpy.ndarray[numpy.float64[m, 1]]) -> None
build(self: ipctk.TangentialCollisions, mesh: ipc::CollisionMesh, vertices: numpy.ndarray[numpy.float64[m, n]], collisions: ipctk.NormalCollisions, normal_potential: ipc::NormalPotential, normal_stiffness: float, mus: numpy.ndarray[numpy.float64[m, 1]], blend_mu: Callable[[float, float], float]) -> None
- clear(self) None ¶
Clear the friction collisions.
- static default_blend_mu(mu0: float, mu1: float) float ¶
- property ee_collisions : list[ipc::EdgeEdgeTangentialCollision]¶
- empty(self) bool ¶
Get if the friction collisions are empty.
- property ev_collisions : list[ipc::EdgeVertexTangentialCollision]¶
- property fv_collisions : list[ipc::FaceVertexTangentialCollision]¶
- property vv_collisions : list[ipc::VertexVertexTangentialCollision]¶
-
__annotations__ =
Tangential Collision¶
- class ipctk.TangentialCollision¶
Bases:
CollisionStencil
Public Data Attributes:
Get the dimension of the collision.
Get the number of degrees of freedom for the collision.
Normal force magnitude
Ratio between normal and tangential forces (e.g., friction coefficient)
Weight
Gradient of weight with respect to all DOF
Barycentric coordinates of the closest point(s)
Tangent basis of the collision (max size 3×2)
Public Methods:
__init__
(*args, **kwargs)compute_tangent_basis
(self, positions)Compute the tangent basis of the collision.
compute_tangent_basis_jacobian
(self, positions)Compute the Jacobian of the tangent basis of the collision.
compute_closest_point
(self, positions)Compute the barycentric coordinates of the closest point.
compute_closest_point_jacobian
(self, positions)Compute the Jacobian of the barycentric coordinates of the closest point.
relative_velocity
(self, velocities)Compute the relative velocity of the collision.
relative_velocity_matrix
(*args, **kwargs)Overloaded function.
relative_velocity_matrix_jacobian
(self, ...)Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
Inherited from
CollisionStencil
__init__
(*args, **kwargs)num_vertices
(self)Get the number of vertices in the collision stencil.
dim
(self, ndof)Get the dimension of the collision stencil.
vertex_ids
(self, edges, faces)Get the vertex IDs of the collision stencil.
vertices
(self, vertices, edges, faces)Get the vertex attributes of the collision stencil.
dof
(self, X, edges, faces)Select this stencil's DOF from the full matrix of DOF.
compute_distance
(self, positions)Compute the distance of the stencil.
compute_distance_gradient
(self, positions)Compute the distance gradient of the stencil w.r.t.
compute_distance_hessian
(self, positions)Compute the distance Hessian of the stencil w.r.t.
Inherited from
pybind11_object
-
__annotations__ =
{}
¶
- __init__(*args, **kwargs)¶
-
__module__ =
'ipctk'
¶
- property closest_point : numpy.ndarray[numpy.float64[m, 1]]¶
Barycentric coordinates of the closest point(s)
- compute_closest_point(self, positions: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, 1]] ¶
Compute the barycentric coordinates of the closest point.
- compute_closest_point_jacobian(self, positions: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]] ¶
Compute the Jacobian of the barycentric coordinates of the closest point.
- compute_tangent_basis(self, positions: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]] ¶
Compute the tangent basis of the collision.
- compute_tangent_basis_jacobian(self, positions: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]] ¶
Compute the Jacobian of the tangent basis of the collision.
- property dim : int¶
Get the dimension of the collision.
- property mu : float¶
Ratio between normal and tangential forces (e.g., friction coefficient)
- property ndof : int¶
Get the number of degrees of freedom for the collision.
- property normal_force_magnitude : float¶
Normal force magnitude
- relative_velocity(self, velocities: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, 1]] ¶
Compute the relative velocity of the collision.
- relative_velocity_matrix(*args, **kwargs)¶
Overloaded function.
relative_velocity_matrix(self: ipctk.TangentialCollision) -> numpy.ndarray[numpy.float64[m, n]]
Construct the premultiplier matrix for the relative velocity.
- Note:
Uses the cached closest point.
- Returns:
A matrix M such that relative_velocity = M * velocities.
relative_velocity_matrix(self: ipctk.TangentialCollision, closest_point: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, n]]
Construct the premultiplier matrix for the relative velocity.
- Parameters:
closest_point: Barycentric coordinates of the closest point.
- Returns:
A matrix M such that relative_velocity = M * velocities.
- relative_velocity_matrix_jacobian(self, closest_point: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]] ¶
Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
- property tangent_basis : numpy.ndarray[numpy.float64[m, n]]¶
Tangent basis of the collision (max size 3×2)
- property weight : float¶
Weight
- property weight_gradient : scipy.sparse.csc_matrix[numpy.float64]¶
Gradient of weight with respect to all DOF
-
__annotations__ =
Vertex-Vertex Tangential Collision¶
- class ipctk.VertexVertexTangentialCollision¶
Bases:
VertexVertexCandidate
,TangentialCollision
Public Data Attributes:
Inherited from
VertexVertexCandidate
ID of the first vertex
ID of the second vertex
Inherited from
TangentialCollision
Get the dimension of the collision.
Get the number of degrees of freedom for the collision.
Normal force magnitude
Ratio between normal and tangential forces (e.g., friction coefficient)
Weight
Gradient of weight with respect to all DOF
Barycentric coordinates of the closest point(s)
Tangent basis of the collision (max size 3×2)
Public Methods:
__init__
(*args, **kwargs)Overloaded function.
Inherited from
VertexVertexCandidate
__init__
(self, vertex0_id, vertex1_id)__str__
(self)__repr__
(self)__eq__
(self, other)__ne__
(self, other)__lt__
(self, other)Compare EdgeVertexCandidates for sorting.
Inherited from
TangentialCollision
__init__
(*args, **kwargs)compute_tangent_basis
(self, positions)Compute the tangent basis of the collision.
compute_tangent_basis_jacobian
(self, positions)Compute the Jacobian of the tangent basis of the collision.
compute_closest_point
(self, positions)Compute the barycentric coordinates of the closest point.
compute_closest_point_jacobian
(self, positions)Compute the Jacobian of the barycentric coordinates of the closest point.
relative_velocity
(self, velocities)Compute the relative velocity of the collision.
relative_velocity_matrix
(*args, **kwargs)Overloaded function.
relative_velocity_matrix_jacobian
(self, ...)Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
Inherited from
CollisionStencil
__init__
(*args, **kwargs)num_vertices
(self)Get the number of vertices in the collision stencil.
dim
(self, ndof)Get the dimension of the collision stencil.
vertex_ids
(self, edges, faces)Get the vertex IDs of the collision stencil.
vertices
(self, vertices, edges, faces)Get the vertex attributes of the collision stencil.
dof
(self, X, edges, faces)Select this stencil's DOF from the full matrix of DOF.
compute_distance
(self, positions)Compute the distance of the stencil.
compute_distance_gradient
(self, positions)Compute the distance gradient of the stencil w.r.t.
compute_distance_hessian
(self, positions)Compute the distance Hessian of the stencil w.r.t.
Inherited from
ContinuousCollisionCandidate
__init__
(*args, **kwargs)ccd
(self, vertices_t0, 1]], vertices_t1, ...)Perform narrow-phase CCD on the candidate.
print_ccd_query
(self, vertices_t0, vertices_t1)Print the CCD query to cout.
Inherited from
pybind11_object
-
__annotations__ =
{}
¶
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: ipctk.VertexVertexTangentialCollision, collision: ipctk.VertexVertexNormalCollision) -> None
__init__(self: ipctk.VertexVertexTangentialCollision, collision: ipctk.VertexVertexNormalCollision, positions: numpy.ndarray[numpy.float64[m, 1]], normal_potential: ipc::NormalPotential, normal_stiffness: float) -> None
-
__module__ =
'ipctk'
¶
-
__annotations__ =
Edge-Vertex Tangential Collision¶
- class ipctk.EdgeVertexTangentialCollision¶
Bases:
EdgeVertexCandidate
,TangentialCollision
Public Data Attributes:
Inherited from
EdgeVertexCandidate
ID of the edge
ID of the vertex
Inherited from
TangentialCollision
Get the dimension of the collision.
Get the number of degrees of freedom for the collision.
Normal force magnitude
Ratio between normal and tangential forces (e.g., friction coefficient)
Weight
Gradient of weight with respect to all DOF
Barycentric coordinates of the closest point(s)
Tangent basis of the collision (max size 3×2)
Public Methods:
__init__
(*args, **kwargs)Overloaded function.
Inherited from
EdgeVertexCandidate
__init__
(self, edge_id, vertex_id)known_dtype
(self)__str__
(self)__repr__
(self)__eq__
(self, other)__ne__
(self, other)__lt__
(self, other)Compare EdgeVertexCandidates for sorting.
Inherited from
TangentialCollision
__init__
(*args, **kwargs)compute_tangent_basis
(self, positions)Compute the tangent basis of the collision.
compute_tangent_basis_jacobian
(self, positions)Compute the Jacobian of the tangent basis of the collision.
compute_closest_point
(self, positions)Compute the barycentric coordinates of the closest point.
compute_closest_point_jacobian
(self, positions)Compute the Jacobian of the barycentric coordinates of the closest point.
relative_velocity
(self, velocities)Compute the relative velocity of the collision.
relative_velocity_matrix
(*args, **kwargs)Overloaded function.
relative_velocity_matrix_jacobian
(self, ...)Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
Inherited from
CollisionStencil
__init__
(*args, **kwargs)num_vertices
(self)Get the number of vertices in the collision stencil.
dim
(self, ndof)Get the dimension of the collision stencil.
vertex_ids
(self, edges, faces)Get the vertex IDs of the collision stencil.
vertices
(self, vertices, edges, faces)Get the vertex attributes of the collision stencil.
dof
(self, X, edges, faces)Select this stencil's DOF from the full matrix of DOF.
compute_distance
(self, positions)Compute the distance of the stencil.
compute_distance_gradient
(self, positions)Compute the distance gradient of the stencil w.r.t.
compute_distance_hessian
(self, positions)Compute the distance Hessian of the stencil w.r.t.
Inherited from
ContinuousCollisionCandidate
__init__
(*args, **kwargs)ccd
(self, vertices_t0, 1]], vertices_t1, ...)Perform narrow-phase CCD on the candidate.
print_ccd_query
(self, vertices_t0, vertices_t1)Print the CCD query to cout.
Inherited from
pybind11_object
-
__annotations__ =
{}
¶
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: ipctk.EdgeVertexTangentialCollision, collision: ipctk.EdgeVertexNormalCollision) -> None
__init__(self: ipctk.EdgeVertexTangentialCollision, collision: ipctk.EdgeVertexNormalCollision, positions: numpy.ndarray[numpy.float64[m, 1]], normal_potential: ipc::NormalPotential, normal_stiffness: float) -> None
-
__module__ =
'ipctk'
¶
-
__annotations__ =
Edge-Edge Tangential Collision¶
- class ipctk.EdgeEdgeTangentialCollision¶
Bases:
EdgeEdgeCandidate
,TangentialCollision
Public Data Attributes:
Inherited from
EdgeEdgeCandidate
ID of the first edge.
ID of the second edge.
Inherited from
TangentialCollision
Get the dimension of the collision.
Get the number of degrees of freedom for the collision.
Normal force magnitude
Ratio between normal and tangential forces (e.g., friction coefficient)
Weight
Gradient of weight with respect to all DOF
Barycentric coordinates of the closest point(s)
Tangent basis of the collision (max size 3×2)
Public Methods:
__init__
(*args, **kwargs)Overloaded function.
Inherited from
EdgeEdgeCandidate
__init__
(self, edge0_id, edge1_id)known_dtype
(self)__str__
(self)__repr__
(self)__eq__
(self, other)__ne__
(self, other)__lt__
(self, other)Compare EdgeEdgeCandidates for sorting.
Inherited from
TangentialCollision
__init__
(*args, **kwargs)compute_tangent_basis
(self, positions)Compute the tangent basis of the collision.
compute_tangent_basis_jacobian
(self, positions)Compute the Jacobian of the tangent basis of the collision.
compute_closest_point
(self, positions)Compute the barycentric coordinates of the closest point.
compute_closest_point_jacobian
(self, positions)Compute the Jacobian of the barycentric coordinates of the closest point.
relative_velocity
(self, velocities)Compute the relative velocity of the collision.
relative_velocity_matrix
(*args, **kwargs)Overloaded function.
relative_velocity_matrix_jacobian
(self, ...)Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
Inherited from
CollisionStencil
__init__
(*args, **kwargs)num_vertices
(self)Get the number of vertices in the collision stencil.
dim
(self, ndof)Get the dimension of the collision stencil.
vertex_ids
(self, edges, faces)Get the vertex IDs of the collision stencil.
vertices
(self, vertices, edges, faces)Get the vertex attributes of the collision stencil.
dof
(self, X, edges, faces)Select this stencil's DOF from the full matrix of DOF.
compute_distance
(self, positions)Compute the distance of the stencil.
compute_distance_gradient
(self, positions)Compute the distance gradient of the stencil w.r.t.
compute_distance_hessian
(self, positions)Compute the distance Hessian of the stencil w.r.t.
Inherited from
ContinuousCollisionCandidate
__init__
(*args, **kwargs)ccd
(self, vertices_t0, 1]], vertices_t1, ...)Perform narrow-phase CCD on the candidate.
print_ccd_query
(self, vertices_t0, vertices_t1)Print the CCD query to cout.
Inherited from
pybind11_object
-
__annotations__ =
{}
¶
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: ipctk.EdgeEdgeTangentialCollision, collision: ipctk.EdgeEdgeNormalCollision) -> None
__init__(self: ipctk.EdgeEdgeTangentialCollision, collision: ipctk.EdgeEdgeNormalCollision, positions: numpy.ndarray[numpy.float64[m, 1]], normal_potential: ipc::NormalPotential, normal_stiffness: float) -> None
-
__module__ =
'ipctk'
¶
-
__annotations__ =
Face-Vertex Tangential Collision¶
- class ipctk.FaceVertexTangentialCollision¶
Bases:
FaceVertexCandidate
,TangentialCollision
Public Data Attributes:
Inherited from
FaceVertexCandidate
ID of the face
ID of the vertex
Inherited from
TangentialCollision
Get the dimension of the collision.
Get the number of degrees of freedom for the collision.
Normal force magnitude
Ratio between normal and tangential forces (e.g., friction coefficient)
Weight
Gradient of weight with respect to all DOF
Barycentric coordinates of the closest point(s)
Tangent basis of the collision (max size 3×2)
Public Methods:
__init__
(*args, **kwargs)Overloaded function.
Inherited from
FaceVertexCandidate
__init__
(self, face_id, vertex_id)known_dtype
(self)__str__
(self)__repr__
(self)__eq__
(self, other)__ne__
(self, other)__lt__
(self, other)Compare FaceVertexCandidate for sorting.
Inherited from
TangentialCollision
__init__
(*args, **kwargs)compute_tangent_basis
(self, positions)Compute the tangent basis of the collision.
compute_tangent_basis_jacobian
(self, positions)Compute the Jacobian of the tangent basis of the collision.
compute_closest_point
(self, positions)Compute the barycentric coordinates of the closest point.
compute_closest_point_jacobian
(self, positions)Compute the Jacobian of the barycentric coordinates of the closest point.
relative_velocity
(self, velocities)Compute the relative velocity of the collision.
relative_velocity_matrix
(*args, **kwargs)Overloaded function.
relative_velocity_matrix_jacobian
(self, ...)Construct the Jacobian of the relative velocity premultiplier wrt the closest points.
Inherited from
CollisionStencil
__init__
(*args, **kwargs)num_vertices
(self)Get the number of vertices in the collision stencil.
dim
(self, ndof)Get the dimension of the collision stencil.
vertex_ids
(self, edges, faces)Get the vertex IDs of the collision stencil.
vertices
(self, vertices, edges, faces)Get the vertex attributes of the collision stencil.
dof
(self, X, edges, faces)Select this stencil's DOF from the full matrix of DOF.
compute_distance
(self, positions)Compute the distance of the stencil.
compute_distance_gradient
(self, positions)Compute the distance gradient of the stencil w.r.t.
compute_distance_hessian
(self, positions)Compute the distance Hessian of the stencil w.r.t.
Inherited from
ContinuousCollisionCandidate
__init__
(*args, **kwargs)ccd
(self, vertices_t0, 1]], vertices_t1, ...)Perform narrow-phase CCD on the candidate.
print_ccd_query
(self, vertices_t0, vertices_t1)Print the CCD query to cout.
Inherited from
pybind11_object
-
__annotations__ =
{}
¶
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: ipctk.FaceVertexTangentialCollision, collision: ipctk.FaceVertexNormalCollision) -> None
__init__(self: ipctk.FaceVertexTangentialCollision, collision: ipctk.FaceVertexNormalCollision, positions: numpy.ndarray[numpy.float64[m, 1]], normal_potential: ipc::NormalPotential, normal_stiffness: float) -> None
-
__module__ =
'ipctk'
¶
-
__annotations__ =