Candidates¶
Candidates¶
- class ipctk.Candidates¶
Bases:
pybind11_objectPublic Data Attributes:
Whether these candidates include the types only ESP needs (set by build(all_types=...)).
Public Methods:
__init__(self)build(*args, **kwargs)Overloaded function.
__len__(self)empty(self)clear(self)__getitem__(self, i)is_step_collision_free(self, mesh, ...)Determine if the step is collision free from the set of candidates.
compute_collision_free_stepsize(self, mesh, ...)Computes a maximal step size that is collision free using the set of collision candidates.
Computes a conservative bound on the largest-feasible step size for surface primitives not in collision.
compute_cfl_stepsize(self, mesh, ...)Computes a CFL-inspired CCD maximum step step size.
compute_per_vertex_safe_distances(self, ...)Compute the maximum distance each vertex can move independently without colliding with any other element.
edge_vertex_to_vertex_vertex(self, mesh, ...)Converts edge-vertex candidates to vertex-vertex candidates.
face_vertex_to_vertex_vertex(self, mesh, ...)Converts face-vertex candidates to vertex-vertex candidates.
face_vertex_to_edge_vertex(self, mesh, vertices)Converts face-vertex candidates to edge-vertex candidates.
edge_edge_to_edge_vertex(self, mesh, vertices)Converts edge-edge candidates to edge-vertex candidates.
write_obj(self, filename, vertices, edges, faces)save_obj(self, filename, vertices, edges, faces)Deprecated: use write_obj instead.
Private Methods:
_pybind11_conduit_v1_
- build(*args, **kwargs)¶
Overloaded function.
build(self: ipctk.Candidates, mesh: ipctk.CollisionMesh, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], inflation_radius: typing.SupportsFloat = 0, broad_phase: ipctk.BroadPhase = None, all_types: bool = False) -> None
Initialize the set of discrete collision detection candidates.
- Parameters:
mesh: The surface of the collision mesh. vertices: Surface vertex positions (rowwise). inflation_radius: Amount to inflate the bounding boxes. broad_phase: Broad phase to use. all_types: Also detect the candidate types only ESP needs.
build(self: ipctk.Candidates, mesh: ipctk.CollisionMesh, vertices_t0: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], vertices_t1: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], inflation_radius: typing.SupportsFloat = 0, broad_phase: ipctk.BroadPhase = None) -> None
Initialize the set of continuous collision detection candidates.
- Note:
Assumes the trajectory is linear.
- Parameters:
mesh: The surface of the collision mesh. vertices_t0: Surface vertex starting positions (rowwise). vertices_t1: Surface vertex ending positions (rowwise). inflation_radius: Amount to inflate the bounding boxes. broad_phase: Broad phase to use.
- compute_cfl_stepsize(self: ipctk.Candidates, mesh: ipctk.CollisionMesh, vertices_t0: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"], vertices_t1: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"], dhat: typing.SupportsFloat, min_distance: typing.SupportsFloat | None = None, broad_phase: ipctk.BroadPhase = None, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x702d7e67e030>) float¶
Computes a CFL-inspired CCD maximum step step size.
- Parameters:¶
- mesh
The collision mesh.
- vertices_t0
Surface vertex starting positions (rowwise).
- vertices_t1
Surface vertex ending positions (rowwise).
- dhat
Barrier activation distance.
- min_distance
Deprecated: give the mesh a thickness (CollisionMesh.set_thickness) instead. If given, every pair keeps this distance and the mesh’s thickness is ignored; otherwise each pair keeps its two primitives’ thicknesses (zero without a thickness).
- broad_phase
Broad phase algorithm to use.
- narrow_phase_ccd
Narrow phase CCD algorithm to use.
- Returns:¶
A step-size \(\in [0, 1]\) that is collision free.
- compute_collision_free_stepsize(self: ipctk.Candidates, mesh: ipctk.CollisionMesh, vertices_t0: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"], vertices_t1: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"], min_distance: typing.SupportsFloat | None = None, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x702d8a7557f0>) float¶
Computes a maximal step size that is collision free using the set of collision candidates.
Note
Assumes the trajectory is linear.
- Parameters:¶
- mesh
The collision mesh.
- vertices_t0
Surface vertex starting positions (rowwise). Assumed to be intersection free.
- vertices_t1
Surface vertex ending positions (rowwise).
- min_distance
Deprecated: give the mesh a thickness (CollisionMesh.set_thickness) instead. If given, every pair keeps this distance and the mesh’s thickness is ignored; otherwise each pair keeps its two primitives’ thicknesses (zero without a thickness).
- narrow_phase_ccd
The narrow phase CCD algorithm to use.
- Returns:¶
A step-size \(\in [0, 1]\) that is collision free. A value of 1.0 if a full step and 0.0 is no step.
- compute_noncandidate_conservative_stepsize(self, mesh: ipctk.CollisionMesh, displacements: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], dhat: SupportsFloat) float¶
Computes a conservative bound on the largest-feasible step size for surface primitives not in collision.
- Parameters:¶
- mesh: ipctk.CollisionMesh¶
The collision mesh.
- displacements: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous']¶
Surface vertex displacements (rowwise).
- dhat: SupportsFloat¶
Barrier activation distance.
- Returns:¶
A step-size \(\in [0, 1]\) that is collision free for non-candidate elements.
-
compute_per_vertex_safe_distances(self, mesh: ipctk.CollisionMesh, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], inflation_radius: SupportsFloat, min_distance: SupportsFloat | None =
None) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶ Compute the maximum distance each vertex can move independently without colliding with any other element.
Notes
Caps the value at the inflation radius used to build the candidates.
- Parameters:¶
- mesh: ipctk.CollisionMesh¶
The collision mesh.
- vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous']¶
Collision mesh vertex positions (rowwise).
- inflation_radius: SupportsFloat¶
The inflation radius used to build the candidates.
- min_distance: SupportsFloat | None =
None¶ Deprecated: give the mesh a thickness (CollisionMesh.set_thickness) instead. If given, every pair keeps this distance and the mesh’s thickness is ignored; otherwise each pair keeps its two primitives’ thicknesses (zero without a thickness).
- Returns:¶
A vector of minimum distances, one for each vertex.
-
edge_edge_to_edge_vertex(self, mesh: ipctk.CollisionMesh, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], is_active: object =
None) list[ipc::EdgeVertexCandidate]¶ Converts edge-edge candidates to edge-vertex candidates.
- Parameters:¶
- mesh: ipctk.CollisionMesh¶
The collision mesh.
- vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous']¶
Collision mesh vertex positions (rowwise).
- is_active: object =
None¶ A function to determine if a candidate is active. If None, uses the default (always true).
- Returns:¶
A list of edge-vertex candidates.
-
edge_vertex_to_vertex_vertex(self, mesh: ipctk.CollisionMesh, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], is_active: object =
None) list[ipc::VertexVertexCandidate]¶ Converts edge-vertex candidates to vertex-vertex candidates.
- Parameters:¶
- mesh: ipctk.CollisionMesh¶
The collision mesh.
- vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous']¶
Collision mesh vertex positions (rowwise).
- is_active: object =
None¶ A function to determine if a candidate is active. If None, uses the default (always true).
- Returns:¶
A list of vertex-vertex candidates.
- property ee_candidates : list[ipc::EdgeEdgeCandidate]¶
- property ev_candidates : list[ipc::EdgeVertexCandidate]¶
-
face_vertex_to_edge_vertex(self, mesh: ipctk.CollisionMesh, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], is_active: object =
None) list[ipc::EdgeVertexCandidate]¶ Converts face-vertex candidates to edge-vertex candidates.
- Parameters:¶
- mesh: ipctk.CollisionMesh¶
The collision mesh.
- vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous']¶
Collision mesh vertex positions (rowwise).
- is_active: object =
None¶ A function to determine if a candidate is active. If None, uses the default (always true).
- Returns:¶
A list of edge-vertex candidates.
-
face_vertex_to_vertex_vertex(self, mesh: ipctk.CollisionMesh, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], is_active: object =
None) list[ipc::VertexVertexCandidate]¶ Converts face-vertex candidates to vertex-vertex candidates.
- Parameters:¶
- mesh: ipctk.CollisionMesh¶
The collision mesh.
- vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous']¶
Collision mesh vertex positions (rowwise).
- is_active: object =
None¶ A function to determine if a candidate is active. If None, uses the default (always true).
- Returns:¶
A list of vertex-vertex candidates.
- property fv_candidates : list[ipc::FaceVertexCandidate]¶
- property has_all_types : bool¶
Whether these candidates include the types only ESP needs (set by build(all_types=…)).
- is_step_collision_free(self: ipctk.Candidates, mesh: ipctk.CollisionMesh, vertices_t0: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"], vertices_t1: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"], min_distance: typing.SupportsFloat | None = None, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x702d7e67e4f0>) bool¶
Determine if the step is collision free from the set of candidates.
Note
Assumes the trajectory is linear.
- Parameters:¶
- mesh
The collision mesh.
- vertices_t0
Surface vertex starting positions (rowwise).
- vertices_t1
Surface vertex ending positions (rowwise).
- min_distance
Deprecated: give the mesh a thickness (CollisionMesh.set_thickness) instead. If given, every pair keeps this distance and the mesh’s thickness is ignored; otherwise each pair keeps its two primitives’ thicknesses (zero without a thickness).
- narrow_phase_ccd
The narrow phase CCD algorithm to use.
- Returns:¶
True if <b>any</b> collisions occur.
- property pv_candidates : list[ipc::PlaneVertexCandidate]¶
- save_obj(self, filename: str, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) bool¶
Deprecated: use write_obj instead.
- property vv_candidates : list[ipc::VertexVertexCandidate]¶
Collision Stencil¶
Error
This autoclass is not working. I don’t know why. I have to investigate.
Vertex-Vertex Candidate¶
- class ipctk.VertexVertexCandidate¶
Bases:
pybind11_objectPublic Data Attributes:
ID of the first vertex
ID of the second vertex
Public Methods:
__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.
Private Methods:
_pybind11_conduit_v1_
- __eq__(self, other: ipctk.VertexVertexCandidate) bool¶
-
__hash__ =
None¶
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: ipctk.VertexVertexCandidate, vertex0_id: typing.SupportsInt, vertex1_id: typing.SupportsInt) -> None
__init__(self: ipctk.VertexVertexCandidate, vertex_ids: tuple[typing.SupportsInt, typing.SupportsInt]) -> None
- __lt__(self, other: ipctk.VertexVertexCandidate) bool¶
Compare EdgeVertexCandidates for sorting.
- __ne__(self, other: ipctk.VertexVertexCandidate) bool¶
- ccd(self: ipctk.VertexVertexCandidate, vertices_t0: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"], vertices_t1: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"], min_distance: typing.SupportsFloat = 0.0, tmax: typing.SupportsFloat = 1.0, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x702d8e0d0670>) tuple[bool, float]¶
Perform narrow-phase CCD on the candidate.
- compute_coefficients(*args, **kwargs)¶
Overloaded function.
compute_coefficients(self: ipctk.VertexVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the coefficients of the stencil.
compute_coefficients(self: ipctk.VertexVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the coefficients of the stencil.
- compute_distance(*args, **kwargs)¶
Overloaded function.
compute_distance(self: ipctk.VertexVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> float
Compute the distance of the stencil.
compute_distance(self: ipctk.VertexVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> float
Compute the distance of the stencil.
- compute_distance_gradient(*args, **kwargs)¶
Overloaded function.
compute_distance_gradient(self: ipctk.VertexVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance gradient of the stencil.
compute_distance_gradient(self: ipctk.VertexVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance gradient of the stencil.
- compute_distance_hessian(*args, **kwargs)¶
Overloaded function.
compute_distance_hessian(self: ipctk.VertexVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”]
Compute the distance Hessian of the stencil.
compute_distance_hessian(self: ipctk.VertexVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”]
Compute the distance Hessian of the stencil.
- compute_distance_vector(*args, **kwargs)¶
Overloaded function.
compute_distance_vector(self: ipctk.VertexVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance vector of the stencil: t = sum(c_i * x_i).
compute_distance_vector(self: ipctk.VertexVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance vector of the stencil.
- compute_distance_vector_jacobian(self, positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]']¶
Compute the Jacobian of the distance vector w.r.t. positions.
- compute_distance_vector_with_coefficients(self, positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) tuple[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']]¶
Compute the distance vector and the coefficients together.
- static contract_distance_vector_jacobian(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], p: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], dim: SupportsInt) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs. 13-14).
- static diag_distance_vector_outer(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], dim: SupportsInt) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq. 11).
- static diag_distance_vector_t_outer(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], distance_vector: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq. 12).
- dof(self, X: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Select this stencil’s DOF from the full matrix of DOF.
- print_ccd_query(self, vertices_t0: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], vertices_t1: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) None¶
Print the CCD query to cout.
- thickness(self, vertex_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], edge_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], face_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) float¶
Get the sum of the two primitives’ thicknesses (see CollisionMesh.set_thickness).
- property vertex0_id : int¶
ID of the first vertex
- property vertex1_id : int¶
ID of the second vertex
- vertex_ids(self, edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[list[int], 'FixedSize(4)']¶
Get the vertex IDs of the collision stencil.
- vertices(self, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[list[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']], 'FixedSize(4)']¶
Get the vertex attributes of the collision stencil.
Edge-Vertex Candidate¶
- class ipctk.EdgeVertexCandidate¶
Bases:
pybind11_objectPublic Methods:
__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.
Private Methods:
_pybind11_conduit_v1_
- __eq__(self, other: ipctk.EdgeVertexCandidate) bool¶
-
__hash__ =
None¶
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: ipctk.EdgeVertexCandidate, edge_id: typing.SupportsInt, vertex_id: typing.SupportsInt) -> None
__init__(self: ipctk.EdgeVertexCandidate, edge_and_vertex_id: tuple[typing.SupportsInt, typing.SupportsInt]) -> None
- __lt__(self, other: ipctk.EdgeVertexCandidate) bool¶
Compare EdgeVertexCandidates for sorting.
- __ne__(self, other: ipctk.EdgeVertexCandidate) bool¶
- ccd(self: ipctk.EdgeVertexCandidate, vertices_t0: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"], vertices_t1: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"], min_distance: typing.SupportsFloat = 0.0, tmax: typing.SupportsFloat = 1.0, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x702d8df6feb0>) tuple[bool, float]¶
Perform narrow-phase CCD on the candidate.
- compute_coefficients(*args, **kwargs)¶
Overloaded function.
compute_coefficients(self: ipctk.EdgeVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the coefficients of the stencil.
compute_coefficients(self: ipctk.EdgeVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the coefficients of the stencil.
- compute_distance(*args, **kwargs)¶
Overloaded function.
compute_distance(self: ipctk.EdgeVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> float
Compute the distance of the stencil.
compute_distance(self: ipctk.EdgeVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> float
Compute the distance of the stencil.
- compute_distance_gradient(*args, **kwargs)¶
Overloaded function.
compute_distance_gradient(self: ipctk.EdgeVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance gradient of the stencil.
compute_distance_gradient(self: ipctk.EdgeVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance gradient of the stencil.
- compute_distance_hessian(*args, **kwargs)¶
Overloaded function.
compute_distance_hessian(self: ipctk.EdgeVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”]
Compute the distance Hessian of the stencil.
compute_distance_hessian(self: ipctk.EdgeVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”]
Compute the distance Hessian of the stencil.
- compute_distance_vector(*args, **kwargs)¶
Overloaded function.
compute_distance_vector(self: ipctk.EdgeVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance vector of the stencil: t = sum(c_i * x_i).
compute_distance_vector(self: ipctk.EdgeVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance vector of the stencil.
- compute_distance_vector_jacobian(self, positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]']¶
Compute the Jacobian of the distance vector w.r.t. positions.
- compute_distance_vector_with_coefficients(self, positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) tuple[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']]¶
Compute the distance vector and the coefficients together.
- static contract_distance_vector_jacobian(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], p: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], dim: SupportsInt) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs. 13-14).
- static diag_distance_vector_outer(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], dim: SupportsInt) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq. 11).
- static diag_distance_vector_t_outer(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], distance_vector: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq. 12).
- dof(self, X: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Select this stencil’s DOF from the full matrix of DOF.
- property edge_id : int¶
ID of the edge
- known_dtype() ipc::PointEdgeDistanceType¶
- print_ccd_query(self, vertices_t0: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], vertices_t1: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) None¶
Print the CCD query to cout.
- thickness(self, vertex_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], edge_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], face_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) float¶
Get the sum of the two primitives’ thicknesses (see CollisionMesh.set_thickness).
- property vertex_id : int¶
ID of the vertex
- vertex_ids(self, edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[list[int], 'FixedSize(4)']¶
Get the vertex IDs of the collision stencil.
- vertices(self, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[list[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']], 'FixedSize(4)']¶
Get the vertex attributes of the collision stencil.
Edge-Edge Candidate¶
- class ipctk.EdgeEdgeCandidate¶
Bases:
pybind11_objectPublic Methods:
__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.
Private Methods:
_pybind11_conduit_v1_
- __eq__(self, other: ipctk.EdgeEdgeCandidate) bool¶
-
__hash__ =
None¶
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: ipctk.EdgeEdgeCandidate, edge0_id: typing.SupportsInt, edge1_id: typing.SupportsInt) -> None
__init__(self: ipctk.EdgeEdgeCandidate, edge_ids: tuple[typing.SupportsInt, typing.SupportsInt]) -> None
- __lt__(self, other: ipctk.EdgeEdgeCandidate) bool¶
Compare EdgeEdgeCandidates for sorting.
- __ne__(self, other: ipctk.EdgeEdgeCandidate) bool¶
- ccd(self: ipctk.EdgeEdgeCandidate, vertices_t0: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"], vertices_t1: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"], min_distance: typing.SupportsFloat = 0.0, tmax: typing.SupportsFloat = 1.0, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x702d7e5f2e70>) tuple[bool, float]¶
Perform narrow-phase CCD on the candidate.
- compute_coefficients(*args, **kwargs)¶
Overloaded function.
compute_coefficients(self: ipctk.EdgeEdgeCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the coefficients of the stencil.
compute_coefficients(self: ipctk.EdgeEdgeCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the coefficients of the stencil.
- compute_distance(*args, **kwargs)¶
Overloaded function.
compute_distance(self: ipctk.EdgeEdgeCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> float
Compute the distance of the stencil.
compute_distance(self: ipctk.EdgeEdgeCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> float
Compute the distance of the stencil.
- compute_distance_gradient(*args, **kwargs)¶
Overloaded function.
compute_distance_gradient(self: ipctk.EdgeEdgeCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance gradient of the stencil.
compute_distance_gradient(self: ipctk.EdgeEdgeCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance gradient of the stencil.
- compute_distance_hessian(*args, **kwargs)¶
Overloaded function.
compute_distance_hessian(self: ipctk.EdgeEdgeCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”]
Compute the distance Hessian of the stencil.
compute_distance_hessian(self: ipctk.EdgeEdgeCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”]
Compute the distance Hessian of the stencil.
- compute_distance_vector(*args, **kwargs)¶
Overloaded function.
compute_distance_vector(self: ipctk.EdgeEdgeCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance vector of the stencil: t = sum(c_i * x_i).
compute_distance_vector(self: ipctk.EdgeEdgeCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance vector of the stencil.
- compute_distance_vector_jacobian(self, positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]']¶
Compute the Jacobian of the distance vector w.r.t. positions.
- compute_distance_vector_with_coefficients(self, positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) tuple[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']]¶
Compute the distance vector and the coefficients together.
- static contract_distance_vector_jacobian(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], p: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], dim: SupportsInt) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs. 13-14).
- static diag_distance_vector_outer(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], dim: SupportsInt) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq. 11).
- static diag_distance_vector_t_outer(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], distance_vector: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq. 12).
- dof(self, X: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Select this stencil’s DOF from the full matrix of DOF.
- property edge0_id : int¶
ID of the first edge.
- property edge1_id : int¶
ID of the second edge.
- known_dtype() ipc::EdgeEdgeDistanceType¶
- print_ccd_query(self, vertices_t0: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], vertices_t1: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) None¶
Print the CCD query to cout.
- thickness(self, vertex_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], edge_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], face_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) float¶
Get the sum of the two primitives’ thicknesses (see CollisionMesh.set_thickness).
- vertex_ids(self, edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[list[int], 'FixedSize(4)']¶
Get the vertex IDs of the collision stencil.
- vertices(self, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[list[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']], 'FixedSize(4)']¶
Get the vertex attributes of the collision stencil.
Edge-Face Candidate¶
- class ipctk.EdgeFaceCandidate¶
Bases:
pybind11_objectPublic Methods:
__init__(*args, **kwargs)Overloaded function.
__str__(self)__repr__(self)__eq__(self, other)__ne__(self, other)__lt__(self, other)Compare EdgeFaceCandidate for sorting.
Private Methods:
_pybind11_conduit_v1_
- __eq__(self, other: ipctk.EdgeFaceCandidate) bool¶
-
__hash__ =
None¶
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: ipctk.EdgeFaceCandidate, edge_id: typing.SupportsInt, face_id: typing.SupportsInt) -> None
__init__(self: ipctk.EdgeFaceCandidate, edge_and_face_id: tuple[typing.SupportsInt, typing.SupportsInt]) -> None
- __lt__(self, other: ipctk.EdgeFaceCandidate) bool¶
Compare EdgeFaceCandidate for sorting.
- __ne__(self, other: ipctk.EdgeFaceCandidate) bool¶
- property edge_id : int¶
ID of the edge
- property face_id : int¶
ID of the face
Face-Vertex Candidate¶
- class ipctk.FaceVertexCandidate¶
Bases:
pybind11_objectPublic Methods:
__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.
Private Methods:
_pybind11_conduit_v1_
- __eq__(self, other: ipctk.FaceVertexCandidate) bool¶
-
__hash__ =
None¶
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: ipctk.FaceVertexCandidate, face_id: typing.SupportsInt, vertex_id: typing.SupportsInt) -> None
__init__(self: ipctk.FaceVertexCandidate, face_and_vertex_id: tuple[typing.SupportsInt, typing.SupportsInt]) -> None
- __lt__(self, other: ipctk.FaceVertexCandidate) bool¶
Compare FaceVertexCandidate for sorting.
- __ne__(self, other: ipctk.FaceVertexCandidate) bool¶
- ccd(self: ipctk.FaceVertexCandidate, vertices_t0: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"], vertices_t1: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"], min_distance: typing.SupportsFloat = 0.0, tmax: typing.SupportsFloat = 1.0, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x702d7e6d2eb0>) tuple[bool, float]¶
Perform narrow-phase CCD on the candidate.
- compute_coefficients(*args, **kwargs)¶
Overloaded function.
compute_coefficients(self: ipctk.FaceVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the coefficients of the stencil.
compute_coefficients(self: ipctk.FaceVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the coefficients of the stencil.
- compute_distance(*args, **kwargs)¶
Overloaded function.
compute_distance(self: ipctk.FaceVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> float
Compute the distance of the stencil.
compute_distance(self: ipctk.FaceVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> float
Compute the distance of the stencil.
- compute_distance_gradient(*args, **kwargs)¶
Overloaded function.
compute_distance_gradient(self: ipctk.FaceVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance gradient of the stencil.
compute_distance_gradient(self: ipctk.FaceVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance gradient of the stencil.
- compute_distance_hessian(*args, **kwargs)¶
Overloaded function.
compute_distance_hessian(self: ipctk.FaceVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”]
Compute the distance Hessian of the stencil.
compute_distance_hessian(self: ipctk.FaceVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”]
Compute the distance Hessian of the stencil.
- compute_distance_vector(*args, **kwargs)¶
Overloaded function.
compute_distance_vector(self: ipctk.FaceVertexCandidate, positions: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance vector of the stencil: t = sum(c_i * x_i).
compute_distance_vector(self: ipctk.FaceVertexCandidate, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, n]”, “flags.f_contiguous”], edges: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”], faces: typing.Annotated[numpy.typing.NDArray[numpy.int32], “[m, n]”, “flags.f_contiguous”]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]
Compute the distance vector of the stencil.
- compute_distance_vector_jacobian(self, positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]']¶
Compute the Jacobian of the distance vector w.r.t. positions.
- compute_distance_vector_with_coefficients(self, positions: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) tuple[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']]¶
Compute the distance vector and the coefficients together.
- static contract_distance_vector_jacobian(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], p: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], dim: SupportsInt) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute p^T (dt/dx) efficiently as sum(c_i * p_i) (Eqs. 13-14).
- static diag_distance_vector_outer(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], dim: SupportsInt) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute diag((dt/dx)(dt/dx)^T) efficiently (Eq. 11).
- static diag_distance_vector_t_outer(coeffs: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], distance_vector: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute diag((dt/dx * t)(dt/dx * t)^T) efficiently (Eq. 12).
- dof(self, X: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Select this stencil’s DOF from the full matrix of DOF.
- property face_id : int¶
ID of the face
- known_dtype() ipc::PointTriangleDistanceType¶
- print_ccd_query(self, vertices_t0: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], vertices_t1: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) None¶
Print the CCD query to cout.
- thickness(self, vertex_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], edge_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], face_thickness: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']) float¶
Get the sum of the two primitives’ thicknesses (see CollisionMesh.set_thickness).
- property vertex_id : int¶
ID of the vertex
- vertex_ids(self, edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[list[int], 'FixedSize(4)']¶
Get the vertex IDs of the collision stencil.
- vertices(self, vertices: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.f_contiguous'], edges: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous'], faces: Annotated[numpy.typing.NDArray[numpy.int32], '[m, n]', 'flags.f_contiguous']) Annotated[list[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']], 'FixedSize(4)']¶
Get the vertex attributes of the collision stencil.