Normal Collisions¶
Normal Collisions¶
- class ipctk.NormalCollisions¶
Bases:
pybind11_objectPublic Data Attributes:
If the NormalCollisions should use the convergent formulation.
The type of collision set to use.
If the NormalCollisions are using the convergent formulation.
Public Methods:
__init__(self)build(*args, **kwargs)Overloaded function.
compute_minimum_distance(self, mesh, vertices)Computes the minimum distance between any non-adjacent elements.
__len__(self)Get the number of collisions.
empty(self)Get if the collision set are empty.
clear(self)Clear the collision set.
__getitem__(self, i)Get a reference to collision at index i.
is_vertex_vertex(self, i)Get if the collision at i is a vertex-vertex collision.
is_edge_vertex(self, i)Get if the collision at i is an edge-vertex collision.
is_edge_edge(self, i)Get if the collision at i is an edge-edge collision.
is_face_vertex(self, i)Get if the collision at i is an face-vertex collision.
is_plane_vertex(self, i)Get if the collision at i is an plane-vertex collision.
__str__(self, mesh, vertices)Private Methods:
_pybind11_conduit_v1_
- class CollisionSetType¶
Bases:
pybind11_objectMembers:
IPC : IPC set type, which uses the original formulation described in [Li et al. 2020].
IMPROVED_MAX_APPROX : Improved max approximation set type, which uses the improved max approximation formulation described in [Li et al. 2023].
OGC : Offset Geometric Contact set type, which uses the formulation described in [Chen et al. 2025].
-
IMPROVED_MAX_APPROX =
<CollisionSetType.IMPROVED_MAX_APPROX: 1>¶
-
IPC =
<CollisionSetType.IPC: 0>¶
-
OGC =
<CollisionSetType.OGC: 2>¶
-
__members__ =
{'IMPROVED_MAX_APPROX': <CollisionSetType.IMPROVED_MAX_APPROX: 1>, 'IPC': <CollisionSetType.IPC: 0>, 'OGC': <CollisionSetType.OGC: 2>}¶
- property name : str¶
- property value : int¶
-
IMPROVED_MAX_APPROX =
-
IMPROVED_MAX_APPROX =
<CollisionSetType.IMPROVED_MAX_APPROX: 1>¶
-
IPC =
<CollisionSetType.IPC: 0>¶
-
OGC =
<CollisionSetType.OGC: 2>¶
- __getitem__(self, i: SupportsInt) ipctk.NormalCollision¶
Get a reference to collision at index i.
- __str__(self, mesh: ipctk.CollisionMesh, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous']) str¶
- build(*args, **kwargs)¶
Overloaded function.
build(self: ipctk.NormalCollisions, mesh: ipctk.CollisionMesh, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], dhat: typing.SupportsFloat, dmin: typing.SupportsFloat | None = None, broad_phase: ipctk.BroadPhase = None) -> None
Initialize the set of collisions used to compute the barrier potential.
- Parameters:
mesh: The collision mesh. vertices: Vertices of the collision mesh. dhat: The activation distance of the barrier. dmin: Deprecated: give the mesh a thickness (CollisionMesh.set_thickness) instead. If given, every collision keeps this minimum distance and the mesh’s thickness is ignored; otherwise each keeps its two primitives’ thicknesses. broad_phase: Broad-phase to use.
build(self: ipctk.NormalCollisions, candidates: ipctk.Candidates, mesh: ipctk.CollisionMesh, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], dhat: typing.SupportsFloat, dmin: typing.SupportsFloat | None = None) -> None
Initialize the set of collisions used to compute the barrier potential.
- Parameters:
candidates: Distance candidates from which the collision set is built. mesh: The collision mesh. vertices: Vertices of the collision mesh. dhat: The activation distance of the barrier. dmin: Deprecated: give the mesh a thickness (CollisionMesh.set_thickness) instead. If given, every collision keeps this minimum distance and the mesh’s thickness is ignored; otherwise each keeps its two primitives’ thicknesses.
- Raises:
ValueError: In 3D, if the candidates were built with all_types=True.
- property collision_set_type : ipctk.NormalCollisions.CollisionSetType¶
The type of collision set to use.
- This can be either:
IPC (Implicit Potential Collisions)
IMPROVED_MAX_APPROX (Improved Max Approximation)
OGC (Offset Geometric Contact)
- compute_minimum_distance(self, mesh: ipctk.CollisionMesh, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous']) float¶
Computes the minimum distance between any non-adjacent elements.
- Parameters:¶
- mesh: ipctk.CollisionMesh¶
The collision mesh.
- vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous']¶
Vertices of the collision mesh.
- Returns:¶
The minimum distance between any non-adjacent elements.
- property ee_collisions : list[ipc::EdgeEdgeNormalCollision]¶
- property enable_shape_derivatives : bool¶
If the NormalCollisions are using the convergent formulation.
- property ev_collisions : list[ipc::EdgeVertexNormalCollision]¶
- property fv_collisions : list[ipc::FaceVertexNormalCollision]¶
- is_vertex_vertex(self, i: SupportsInt) bool¶
Get if the collision at i is a vertex-vertex collision.
- property pv_collisions : list[ipc::PlaneVertexNormalCollision]¶
- property use_area_weighting : bool¶
If the NormalCollisions should use the convergent formulation.
- property vv_collisions : list[ipc::VertexVertexNormalCollision]¶
Normal Collision¶
- class ipctk.NormalCollision¶
Bases:
CollisionStencilPublic Data Attributes:
The minimum separation distance.
The term's weight (e.g., collision area)
The gradient of the term's weight wrt the rest positions.
Public Methods:
__init__(*args, **kwargs)is_mollified(self)Does the distance potentially have to be mollified?
mollifier_threshold(self, rest_positions)Compute the mollifier threshold for the distance.
mollifier(*args, **kwargs)Overloaded function.
mollifier_gradient(*args, **kwargs)Overloaded function.
mollifier_hessian(*args, **kwargs)Overloaded function.
mollifier_gradient_wrt_x(self, ...)Compute the gradient of the mollifier for the distance w.r.t.
mollifier_gradient_jacobian_wrt_x(self, ...)Compute the jacobian of the distance mollifier's gradient w.r.t.
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(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
compute_distance_vector(*args, **kwargs)Overloaded function.
compute_distance_vector_with_coefficients(...)Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Private Methods:
_pybind11_conduit_v1_Inherited from
CollisionStencil_pybind11_conduit_v1_
- property dmin : float¶
The minimum separation distance.
- mollifier(*args, **kwargs)¶
Overloaded function.
mollifier(self: ipctk.NormalCollision, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> float
Compute the mollifier for the distance.
- Parameters:
positions: The stencil’s vertex positions.
- Returns:
The mollifier value.
mollifier(self: ipctk.NormalCollision, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”], eps_x: typing.SupportsFloat) -> float
Compute the mollifier for the distance.
- Parameters:
positions: The stencil’s vertex positions. eps_x: The mollifier’s threshold.
- Returns:
The mollifier value.
- mollifier_gradient(*args, **kwargs)¶
Overloaded function.
mollifier_gradient(self: ipctk.NormalCollision, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the gradient of the mollifier for the distance wrt the positions.
- Parameters:
positions: The stencil’s vertex positions.
- Returns:
The mollifier gradient.
mollifier_gradient(self: ipctk.NormalCollision, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”], eps_x: typing.SupportsFloat) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the gradient of the mollifier for the distance wrt the positions.
- Parameters:
positions: The stencil’s vertex positions. eps_x: The mollifier’s threshold.
- Returns:
The mollifier gradient.
- mollifier_gradient_jacobian_wrt_x(self, rest_positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[12, 12]']¶
Compute the jacobian of the distance mollifier’s gradient w.r.t. rest positions.
- mollifier_gradient_wrt_x(self, rest_positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[12, 1]']¶
Compute the gradient of the mollifier for the distance w.r.t. rest positions.
- mollifier_hessian(*args, **kwargs)¶
Overloaded function.
mollifier_hessian(self: ipctk.NormalCollision, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”]
Compute the Hessian of the mollifier for the distance wrt the positions.
- Parameters:
positions: The stencil’s vertex positions.
- Returns:
The mollifier Hessian.
mollifier_hessian(self: ipctk.NormalCollision, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”], eps_x: typing.SupportsFloat) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”]
Compute the Hessian of the mollifier for the distance wrt the positions.
- Parameters:
positions: The stencil’s vertex positions. eps_x: The mollifier’s threshold.
- Returns:
The mollifier Hessian.
- mollifier_threshold(self, rest_positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) float¶
Compute the mollifier threshold for the distance.
- property weight : float¶
The term’s weight (e.g., collision area)
- property weight_gradient : scipy.sparse.csc_matrix[numpy.float64]¶
The gradient of the term’s weight wrt the rest positions.
Vertex-Vertex Normal Collision¶
- class ipctk.VertexVertexNormalCollision¶
Bases:
VertexVertexStencil,NormalCollisionPublic Data Attributes:
Inherited from
VertexVertexCandidateID of the first vertex
ID of the second vertex
Inherited from
NormalCollisionThe minimum separation distance.
The term's weight (e.g., collision area)
The gradient of the term's weight wrt the rest positions.
Public Methods:
__init__(*args, **kwargs)Overloaded function.
Inherited from
VertexVertexStencil__init__(*args, **kwargs)Inherited from
VertexVertexCandidate__init__(*args, **kwargs)Overloaded function.
__str__(self)__repr__(self)__eq__(self, other)__ne__(self, other)__lt__(self, other)Compare EdgeVertexCandidates for sorting.
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.
thickness(self, vertex_thickness, ...)Get the sum of the two primitives' thicknesses (see CollisionMesh.set_thickness).
compute_distance(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
compute_distance_vector(*args, **kwargs)Overloaded function.
Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Inherited from
NormalCollision__init__(*args, **kwargs)is_mollified(self)Does the distance potentially have to be mollified?
mollifier_threshold(self, rest_positions)Compute the mollifier threshold for the distance.
mollifier(*args, **kwargs)Overloaded function.
mollifier_gradient(*args, **kwargs)Overloaded function.
mollifier_hessian(*args, **kwargs)Overloaded function.
mollifier_gradient_wrt_x(self, ...)Compute the gradient of the mollifier for the distance w.r.t.
mollifier_gradient_jacobian_wrt_x(self, ...)Compute the jacobian of the distance mollifier's gradient w.r.t.
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(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
compute_distance_vector(*args, **kwargs)Overloaded function.
compute_distance_vector_with_coefficients(...)Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Private Methods:
_pybind11_conduit_v1_Inherited from
VertexVertexStencil_pybind11_conduit_v1_Inherited from
VertexVertexCandidate_pybind11_conduit_v1_Inherited from
NormalCollision_pybind11_conduit_v1_Inherited from
CollisionStencil_pybind11_conduit_v1_
Edge-Vertex Normal Collision¶
- class ipctk.EdgeVertexNormalCollision¶
Bases:
EdgeVertexStencil,NormalCollisionPublic Data Attributes:
Inherited from
EdgeVertexCandidateID of the edge
ID of the vertex
Inherited from
NormalCollisionThe minimum separation distance.
The term's weight (e.g., collision area)
The gradient of the term's weight wrt the rest positions.
Public Methods:
__init__(*args, **kwargs)Overloaded function.
Inherited from
EdgeVertexStencil__init__(*args, **kwargs)Inherited from
EdgeVertexCandidate__init__(*args, **kwargs)Overloaded function.
__str__(self)__repr__(self)__eq__(self, other)__ne__(self, other)__lt__(self, other)Compare EdgeVertexCandidates for sorting.
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.
thickness(self, vertex_thickness, ...)Get the sum of the two primitives' thicknesses (see CollisionMesh.set_thickness).
compute_distance(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
compute_distance_vector(*args, **kwargs)Overloaded function.
Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Inherited from
NormalCollision__init__(*args, **kwargs)is_mollified(self)Does the distance potentially have to be mollified?
mollifier_threshold(self, rest_positions)Compute the mollifier threshold for the distance.
mollifier(*args, **kwargs)Overloaded function.
mollifier_gradient(*args, **kwargs)Overloaded function.
mollifier_hessian(*args, **kwargs)Overloaded function.
mollifier_gradient_wrt_x(self, ...)Compute the gradient of the mollifier for the distance w.r.t.
mollifier_gradient_jacobian_wrt_x(self, ...)Compute the jacobian of the distance mollifier's gradient w.r.t.
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(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
compute_distance_vector(*args, **kwargs)Overloaded function.
compute_distance_vector_with_coefficients(...)Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Private Methods:
_pybind11_conduit_v1_Inherited from
EdgeVertexStencil_pybind11_conduit_v1_Inherited from
EdgeVertexCandidate_pybind11_conduit_v1_Inherited from
NormalCollision_pybind11_conduit_v1_Inherited from
CollisionStencil_pybind11_conduit_v1_
Edge-Edge Normal Collision¶
- class ipctk.EdgeEdgeNormalCollision¶
Bases:
EdgeEdgeStencil,NormalCollisionPublic Data Attributes:
Mollifier activation threshold.
Cached distance type.
Inherited from
EdgeEdgeCandidateID of the first edge.
ID of the second edge.
Inherited from
NormalCollisionThe minimum separation distance.
The term's weight (e.g., collision area)
The gradient of the term's weight wrt the rest positions.
Public Methods:
__init__(*args, **kwargs)Overloaded function.
__eq__(self, other)__ne__(self, other)__lt__(self, other)Inherited from
EdgeEdgeStencil__init__(*args, **kwargs)Inherited from
EdgeEdgeCandidate__init__(*args, **kwargs)Overloaded function.
__str__(self)__repr__(self)__eq__(self, other)__ne__(self, other)__lt__(self, other)Compare EdgeEdgeCandidates for sorting.
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.
thickness(self, vertex_thickness, ...)Get the sum of the two primitives' thicknesses (see CollisionMesh.set_thickness).
compute_distance(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
compute_distance_vector(*args, **kwargs)Overloaded function.
Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Inherited from
NormalCollision__init__(*args, **kwargs)is_mollified(self)Does the distance potentially have to be mollified?
mollifier_threshold(self, rest_positions)Compute the mollifier threshold for the distance.
mollifier(*args, **kwargs)Overloaded function.
mollifier_gradient(*args, **kwargs)Overloaded function.
mollifier_hessian(*args, **kwargs)Overloaded function.
mollifier_gradient_wrt_x(self, ...)Compute the gradient of the mollifier for the distance w.r.t.
mollifier_gradient_jacobian_wrt_x(self, ...)Compute the jacobian of the distance mollifier's gradient w.r.t.
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(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
compute_distance_vector(*args, **kwargs)Overloaded function.
compute_distance_vector_with_coefficients(...)Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Private Methods:
_pybind11_conduit_v1_Inherited from
EdgeEdgeStencil_pybind11_conduit_v1_Inherited from
EdgeEdgeCandidate_pybind11_conduit_v1_Inherited from
NormalCollision_pybind11_conduit_v1_Inherited from
CollisionStencil_pybind11_conduit_v1_
- __eq__(self, other: ipctk.EdgeEdgeNormalCollision) bool¶
-
__hash__ =
None¶
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: ipctk.EdgeEdgeNormalCollision, edge0_id: typing.SupportsInt, edge1_id: typing.SupportsInt, eps_x: typing.SupportsFloat, dtype: ipctk.EdgeEdgeDistanceType = <EdgeEdgeDistanceType.AUTO: 9>) -> None
__init__(self: ipctk.EdgeEdgeNormalCollision, candidate: ipctk.EdgeEdgeCandidate, eps_x: typing.SupportsFloat, dtype: ipctk.EdgeEdgeDistanceType = <EdgeEdgeDistanceType.AUTO: 9>) -> None
- __lt__(self, other: ipctk.EdgeEdgeNormalCollision) bool¶
- __ne__(self, other: ipctk.EdgeEdgeNormalCollision) bool¶
- property dtype : ipctk.EdgeEdgeDistanceType¶
Cached distance type.
Some EE collisions are mollified EV or VV collisions.
- property eps_x : float¶
Mollifier activation threshold.
Face-Vertex Normal Collision¶
- class ipctk.FaceVertexNormalCollision¶
Bases:
FaceVertexStencil,NormalCollisionPublic Data Attributes:
Inherited from
FaceVertexCandidateID of the face
ID of the vertex
Inherited from
NormalCollisionThe minimum separation distance.
The term's weight (e.g., collision area)
The gradient of the term's weight wrt the rest positions.
Public Methods:
__init__(*args, **kwargs)Overloaded function.
Inherited from
FaceVertexStencil__init__(*args, **kwargs)Inherited from
FaceVertexCandidate__init__(*args, **kwargs)Overloaded function.
__str__(self)__repr__(self)__eq__(self, other)__ne__(self, other)__lt__(self, other)Compare FaceVertexCandidate for sorting.
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.
thickness(self, vertex_thickness, ...)Get the sum of the two primitives' thicknesses (see CollisionMesh.set_thickness).
compute_distance(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
compute_distance_vector(*args, **kwargs)Overloaded function.
Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Inherited from
NormalCollision__init__(*args, **kwargs)is_mollified(self)Does the distance potentially have to be mollified?
mollifier_threshold(self, rest_positions)Compute the mollifier threshold for the distance.
mollifier(*args, **kwargs)Overloaded function.
mollifier_gradient(*args, **kwargs)Overloaded function.
mollifier_hessian(*args, **kwargs)Overloaded function.
mollifier_gradient_wrt_x(self, ...)Compute the gradient of the mollifier for the distance w.r.t.
mollifier_gradient_jacobian_wrt_x(self, ...)Compute the jacobian of the distance mollifier's gradient w.r.t.
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(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
compute_distance_vector(*args, **kwargs)Overloaded function.
compute_distance_vector_with_coefficients(...)Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Private Methods:
_pybind11_conduit_v1_Inherited from
FaceVertexStencil_pybind11_conduit_v1_Inherited from
FaceVertexCandidate_pybind11_conduit_v1_Inherited from
NormalCollision_pybind11_conduit_v1_Inherited from
CollisionStencil_pybind11_conduit_v1_
Plane-Vertex Normal Collision¶
- class ipctk.PlaneVertexNormalCollision¶
Bases:
PlaneVertexStencil,NormalCollisionPublic Data Attributes:
Inherited from
PlaneVertexCandidateplanePlane of the candidate
vertex_idID of the vertex
Inherited from
NormalCollisionThe minimum separation distance.
The term's weight (e.g., collision area)
The gradient of the term's weight wrt the rest positions.
Public Methods:
__init__(self, plane, vertex_id)Inherited from
PlaneVertexStencil__init__(*args, **kwargs)Inherited from
PlaneVertexCandidate__init__(self, plane, vertex_id)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.
thickness(self, vertex_thickness, ...)Get the sum of the two primitives' thicknesses (see CollisionMesh.set_thickness).
compute_distance(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
compute_distance_vector(*args, **kwargs)Overloaded function.
compute_distance_vector_with_coefficients(...)Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Inherited from
NormalCollision__init__(*args, **kwargs)is_mollified(self)Does the distance potentially have to be mollified?
mollifier_threshold(self, rest_positions)Compute the mollifier threshold for the distance.
mollifier(*args, **kwargs)Overloaded function.
mollifier_gradient(*args, **kwargs)Overloaded function.
mollifier_hessian(*args, **kwargs)Overloaded function.
mollifier_gradient_wrt_x(self, ...)Compute the gradient of the mollifier for the distance w.r.t.
mollifier_gradient_jacobian_wrt_x(self, ...)Compute the jacobian of the distance mollifier's gradient w.r.t.
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(*args, **kwargs)Overloaded function.
compute_distance_gradient(*args, **kwargs)Overloaded function.
compute_distance_hessian(*args, **kwargs)Overloaded function.
compute_coefficients(*args, **kwargs)Overloaded function.
ccd(self, vertices_t0, ], vertices_t1, ], ...)Perform narrow-phase CCD on the candidate.
print_ccd_query(self, vertices_t0, vertices_t1)Print the CCD query to cout.
compute_distance_vector(*args, **kwargs)Overloaded function.
compute_distance_vector_with_coefficients(...)Compute the distance vector and the coefficients together.
compute_distance_vector_jacobian(self, positions)Compute the Jacobian of the distance vector w.r.t.
diag_distance_vector_outer(coeffs, dim)Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq.
diag_distance_vector_t_outer(coeffs, ...)Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq.
contract_distance_vector_jacobian(coeffs, p, dim)Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs.
Private Methods:
_pybind11_conduit_v1_Inherited from
PlaneVertexStencil_pybind11_conduit_v1_Inherited from
PlaneVertexCandidate_pybind11_conduit_v1_Inherited from
NormalCollision_pybind11_conduit_v1_Inherited from
CollisionStencil_pybind11_conduit_v1_