Candidates

Candidates

class ipctk.Candidates

Bases: pybind11_object

Public Methods:

__init__(self)

build(*args, **kwargs)

Overloaded function.

__len__(self)

empty(self)

clear(self)

__getitem__(self, arg0)

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.

compute_noncandidate_conservative_stepsize(...)

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.

save_obj(self, filename, vertices, edges, faces)

Inherited from pybind11_object

__annotations__ = {}
__getitem__(self, arg0: int) ipc::CollisionStencil
__init__(self)
__len__(self) int
__module__ = 'ipctk'
build(*args, **kwargs)

Overloaded function.

  1. build(self: ipctk.Candidates, mesh: ipc::CollisionMesh, vertices: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], inflation_radius: float = 0, broad_phase: ipctk.BroadPhase = <ipctk.HashGrid object at 0x7fd2aad71f70>) -> 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.

  2. build(self: ipctk.Candidates, mesh: ipc::CollisionMesh, vertices_t0: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], vertices_t1: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], inflation_radius: float = 0, broad_phase: ipctk.BroadPhase = <ipctk.HashGrid object at 0x7fd2aad720f0>) -> 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.

clear(self) None
compute_cfl_stepsize(self: ipctk.Candidates, mesh: ipc::CollisionMesh, vertices_t0: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], vertices_t1: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], dhat: float, min_distance: float = 0.0, broad_phase: ipctk.BroadPhase = <ipctk.HashGrid object at 0x7fd2aad727b0>, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x7fd2aad6a1b0>) 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

Minimum distance allowable between any two elements.

broad_phase

Broad phase algorithm to use.

narrow_phase_ccd

Narrow phase CCD algorithm to use.

compute_collision_free_stepsize(self: ipctk.Candidates, mesh: ipc::CollisionMesh, vertices_t0: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], vertices_t1: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], min_distance: float = 0.0, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x7fd2aad72570>) 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

The minimum distance allowable between any two elements.

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: ipctk.Candidates, mesh: ipc::CollisionMesh, displacements: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], dhat: float) float

Computes a conservative bound on the largest-feasible step size for surface primitives not in collision.

Parameters:
mesh

The collision mesh.

displacements

Surface vertex displacements (rowwise).

dhat

Barrier activation distance.

property ee_candidates : list[ipc::EdgeEdgeCandidate]
empty(self) bool
property ev_candidates : list[ipc::EdgeVertexCandidate]
property fv_candidates : list[ipc::FaceVertexCandidate]
is_step_collision_free(self: ipctk.Candidates, mesh: ipc::CollisionMesh, vertices_t0: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], vertices_t1: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], min_distance: float = 0.0, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x7fd2aad72470>) 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

The minimum distance allowable between any two elements.

narrow_phase_ccd

The narrow phase CCD algorithm to use.

Returns:

True if <b>any</b> collisions occur.

save_obj(self, filename: str, vertices: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], edges: numpy.ndarray[numpy.int32[m, n], flags.f_contiguous], faces: numpy.ndarray[numpy.int32[m, n], flags.f_contiguous]) bool
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: CollisionStencil

Public Data Attributes:

vertex0_id

ID of the first vertex

vertex1_id

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.

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.

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__ = {}
__eq__(self, other: ipctk.VertexVertexCandidate) bool
__hash__ = None
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: ipctk.VertexVertexCandidate, vertex0_id: int, vertex1_id: int) -> None

  2. __init__(self: ipctk.VertexVertexCandidate, vertex_ids: tuple[int, int]) -> None

__lt__(self, other: ipctk.VertexVertexCandidate) bool

Compare EdgeVertexCandidates for sorting.

__module__ = 'ipctk'
__ne__(self, other: ipctk.VertexVertexCandidate) bool
__repr__(self) str
__str__(self) str
property vertex0_id : int

ID of the first vertex

property vertex1_id : int

ID of the second vertex

Edge-Vertex Candidate

class ipctk.EdgeVertexCandidate

Bases: CollisionStencil

Public Data Attributes:

edge_id

ID of the edge

vertex_id

ID of the vertex

Public Methods:

__init__(*args, **kwargs)

Overloaded function.

known_dtype(self)

__str__(self)

__repr__(self)

__eq__(self, other)

__ne__(self, other)

__lt__(self, other)

Compare EdgeVertexCandidates for sorting.

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.

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__ = {}
__eq__(self, other: ipctk.EdgeVertexCandidate) bool
__hash__ = None
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: ipctk.EdgeVertexCandidate, edge_id: int, vertex_id: int) -> None

  2. __init__(self: ipctk.EdgeVertexCandidate, edge_and_vertex_id: tuple[int, int]) -> None

__lt__(self, other: ipctk.EdgeVertexCandidate) bool

Compare EdgeVertexCandidates for sorting.

__module__ = 'ipctk'
__ne__(self, other: ipctk.EdgeVertexCandidate) bool
__repr__(self) str
__str__(self) str
property edge_id : int

ID of the edge

known_dtype(self) ipc::PointEdgeDistanceType
property vertex_id : int

ID of the vertex

Edge-Edge Candidate

class ipctk.EdgeEdgeCandidate

Bases: CollisionStencil

Public Data Attributes:

edge0_id

ID of the first edge.

edge1_id

ID of the second edge.

Public Methods:

__init__(*args, **kwargs)

Overloaded function.

known_dtype(self)

__str__(self)

__repr__(self)

__eq__(self, other)

__ne__(self, other)

__lt__(self, other)

Compare EdgeEdgeCandidates for sorting.

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.

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__ = {}
__eq__(self, other: ipctk.EdgeEdgeCandidate) bool
__hash__ = None
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: ipctk.EdgeEdgeCandidate, edge0_id: int, edge1_id: int) -> None

  2. __init__(self: ipctk.EdgeEdgeCandidate, edge_ids: tuple[int, int]) -> None

__lt__(self, other: ipctk.EdgeEdgeCandidate) bool

Compare EdgeEdgeCandidates for sorting.

__module__ = 'ipctk'
__ne__(self, other: ipctk.EdgeEdgeCandidate) bool
__repr__(self) str
__str__(self) str
property edge0_id : int

ID of the first edge.

property edge1_id : int

ID of the second edge.

known_dtype(self) ipc::EdgeEdgeDistanceType

Edge-Face Candidate

class ipctk.EdgeFaceCandidate

Bases: pybind11_object

Public Data Attributes:

edge_id

ID of the edge

face_id

ID of the face

Public Methods:

__init__(*args, **kwargs)

Overloaded function.

__str__(self)

__repr__(self)

__eq__(self, other)

__ne__(self, other)

__lt__(self, other)

Compare EdgeFaceCandidate for sorting.

Inherited from pybind11_object

__annotations__ = {}
__eq__(self, other: ipctk.EdgeFaceCandidate) bool
__hash__ = None
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: ipctk.EdgeFaceCandidate, edge_id: int, face_id: int) -> None

  2. __init__(self: ipctk.EdgeFaceCandidate, edge_and_face_id: tuple[int, int]) -> None

__lt__(self, other: ipctk.EdgeFaceCandidate) bool

Compare EdgeFaceCandidate for sorting.

__module__ = 'ipctk'
__ne__(self, other: ipctk.EdgeFaceCandidate) bool
__repr__(self) str
__str__(self) str
property edge_id : int

ID of the edge

property face_id : int

ID of the face

Face-Vertex Candidate

class ipctk.FaceVertexCandidate

Bases: CollisionStencil

Public Data Attributes:

face_id

ID of the face

vertex_id

ID of the vertex

Public Methods:

__init__(*args, **kwargs)

Overloaded function.

known_dtype(self)

__str__(self)

__repr__(self)

__eq__(self, other)

__ne__(self, other)

__lt__(self, other)

Compare FaceVertexCandidate for sorting.

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.

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__ = {}
__eq__(self, other: ipctk.FaceVertexCandidate) bool
__hash__ = None
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: ipctk.FaceVertexCandidate, face_id: int, vertex_id: int) -> None

  2. __init__(self: ipctk.FaceVertexCandidate, face_and_vertex_id: tuple[int, int]) -> None

__lt__(self, other: ipctk.FaceVertexCandidate) bool

Compare FaceVertexCandidate for sorting.

__module__ = 'ipctk'
__ne__(self, other: ipctk.FaceVertexCandidate) bool
__repr__(self) str
__str__(self) str
property face_id : int

ID of the face

known_dtype(self) ipc::PointTriangleDistanceType
property vertex_id : int

ID of the vertex