Collision Constraints¶
- class ipctk.Constraints¶
- build(*args, **kwargs)¶
Overloaded function.
build(self: ipctk.Constraints, mesh: ipc::CollisionMesh, V: numpy.ndarray[numpy.float64[m, n]], dhat: float, dmin: float = 0, method: ipctk.BroadPhaseMethod = <BroadPhaseMethod.HASH_GRID: 1>) -> None
Construct a set of constraints used to compute the barrier potential.
- Parameters:
mesh: The collision mesh. V: Vertices of the collision mesh. dhat: The activation distance of the barrier. dmin: (optional) Minimum distance. method: (optional) Broad-phase method to use.
- Returns:
The constructed set of constraints.
build(self: ipctk.Constraints, candidates: ipctk.Candidates, mesh: ipc::CollisionMesh, V: numpy.ndarray[numpy.float64[m, n]], dhat: float, dmin: float = 0) -> None
Construct a set of constraints used to compute the barrier potential.
- Parameters:
candidates: Distance candidates from which the constraint set is built. mesh: The collision mesh. V: Vertices of the collision mesh. dhat: The activation distance of the barrier. dmin: Minimum distance.
- Returns:
The constructed set of constraints (any existing constraints will be cleared).
- class ipctk.CollisionConstraint¶
Bases:
pybind11_object
- compute_distance(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) float ¶
- compute_distance_gradient(*args, **kwargs)¶
Overloaded function.
compute_distance_gradient(self: ipctk.CollisionConstraint, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) -> numpy.ndarray[numpy.float64[m, 1]]
compute_distance_gradient(self: ipctk.CollisionConstraint, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) -> numpy.ndarray[numpy.float64[m, 1]]
- compute_distance_hessian(*args, **kwargs)¶
Overloaded function.
compute_distance_hessian(self: ipctk.CollisionConstraint, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) -> numpy.ndarray[numpy.float64[m, n]]
compute_distance_hessian(self: ipctk.CollisionConstraint, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) -> numpy.ndarray[numpy.float64[m, n]]
- compute_potential(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]], dhat: float) float ¶
- compute_potential_gradient(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]], dhat: float) numpy.ndarray[numpy.float64[m, 1]] ¶
- compute_potential_hessian(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]], dhat: float, project_to_psd: bool) numpy.ndarray[numpy.float64[m, n]] ¶
- num_vertices(*args, **kwargs)¶
Overloaded function.
num_vertices(self: ipctk.CollisionConstraint) -> int
num_vertices(self: ipctk.CollisionConstraint) -> int
- vertex_indices(*args, **kwargs)¶
Overloaded function.
vertex_indices(self: ipctk.CollisionConstraint, E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) -> List[int[4]]
Get the indices of the vertices
- Parameters:
E: edge matrix of mesh F: face matrix of mesh
- Returns:
List of vertex indices
vertex_indices(self: ipctk.CollisionConstraint, E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) -> List[int[4]]
- property weight : float¶
Weight in the final sum of potentials
- class ipctk.VertexVertexConstraint¶
Bases:
VertexVertexCandidate
,CollisionConstraint
- compute_distance(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) float ¶
- compute_distance_gradient(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) numpy.ndarray[numpy.float64[m, 1]] ¶
- compute_distance_hessian(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) numpy.ndarray[numpy.float64[m, n]] ¶
- compute_potential(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]], dhat: float) float ¶
- compute_potential_gradient(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]], dhat: float) numpy.ndarray[numpy.float64[m, 1]] ¶
- class ipctk.EdgeVertexConstraint¶
Bases:
EdgeVertexCandidate
,CollisionConstraint
- compute_distance(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) float ¶
- compute_distance_gradient(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) numpy.ndarray[numpy.float64[m, 1]] ¶
- compute_distance_hessian(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) numpy.ndarray[numpy.float64[m, n]] ¶
- compute_potential(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]], dhat: float) float ¶
- compute_potential_gradient(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]], dhat: float) numpy.ndarray[numpy.float64[m, 1]] ¶
- class ipctk.EdgeEdgeConstraint¶
Bases:
EdgeEdgeCandidate
,CollisionConstraint
- compute_distance(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) float ¶
- compute_distance_gradient(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) numpy.ndarray[numpy.float64[m, 1]] ¶
- compute_distance_hessian(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) numpy.ndarray[numpy.float64[m, n]] ¶
- compute_potential(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]], dhat: float) float ¶
- compute_potential_gradient(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]], dhat: float) numpy.ndarray[numpy.float64[m, 1]] ¶
- class ipctk.FaceVertexConstraint¶
Bases:
FaceVertexCandidate
,CollisionConstraint
- compute_distance(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) float ¶
- compute_distance_gradient(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) numpy.ndarray[numpy.float64[m, 1]] ¶
- class ipctk.PlaneVertexConstraint¶
Bases:
CollisionConstraint
- compute_distance(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) float ¶
- compute_distance_gradient(self, V: numpy.ndarray[numpy.float64[m, n]], E: numpy.ndarray[numpy.int32[m, n]], F: numpy.ndarray[numpy.int32[m, n]]) numpy.ndarray[numpy.float64[m, 1]] ¶