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::ContinuousCollisionCandidate
__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]], inflation_radius: float = 0, broad_phase_method: ipctk.BroadPhaseMethod = <BroadPhaseMethod.HASH_GRID: 1>) -> 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_method: Broad phase method to use.

  2. build(self: ipctk.Candidates, mesh: ipc::CollisionMesh, vertices_t0: numpy.ndarray[numpy.float64[m, n]], vertices_t1: numpy.ndarray[numpy.float64[m, n]], inflation_radius: float = 0, broad_phase_method: ipctk.BroadPhaseMethod = <BroadPhaseMethod.HASH_GRID: 1>) -> 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_method: Broad phase method to use.

clear(self) None
compute_cfl_stepsize(self: ipctk.Candidates, mesh: ipc::CollisionMesh, vertices_t0: numpy.ndarray[numpy.float64[m, n]], vertices_t1: numpy.ndarray[numpy.float64[m, n]], dhat: float, broad_phase_method: ipctk.BroadPhaseMethod = <BroadPhaseMethod.HASH_GRID: 1>, min_distance: float = 0.0, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x7f2ab0bc5770>) 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

The minimum distance allowable between any two elements.

narrow_phase_ccd

The narrow phase CCD algorithm to use.

compute_collision_free_stepsize(self: ipctk.Candidates, mesh: ipc::CollisionMesh, vertices_t0: numpy.ndarray[numpy.float64[m, n]], vertices_t1: numpy.ndarray[numpy.float64[m, n]], min_distance: float = 0.0, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x7f2ab0bb8230>) 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]], 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]], vertices_t1: numpy.ndarray[numpy.float64[m, n]], min_distance: float = 0.0, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x7f2ab19bf5b0>) 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]], edges: numpy.ndarray[numpy.int32[m, n]], faces: numpy.ndarray[numpy.int32[m, n]]) bool
property vv_candidates : list[ipc::VertexVertexCandidate]

Collision Stencil

Error

This autoclass is not working. I don’t know why. I have to investigate.

Continuous Collision Candidate

class ipctk.ContinuousCollisionCandidate

Bases: pybind11_object

Public Methods:

__init__(*args, **kwargs)

ccd(self, vertices_t0, 1]], vertices_t1, ...)

Perform narrow-phase CCD on the candidate.

print_ccd_query(self, vertices_t0, vertices_t1)

Print the CCD query to cout.

Inherited from pybind11_object

__annotations__ = {}
__init__(*args, **kwargs)
__module__ = 'ipctk'
ccd(self: ipctk.ContinuousCollisionCandidate, vertices_t0: numpy.ndarray[numpy.float64[m, 1]], vertices_t1: numpy.ndarray[numpy.float64[m, 1]], min_distance: float = 0.0, tmax: float = 1.0, narrow_phase_ccd: ipctk.NarrowPhaseCCD = <ipctk.TightInclusionCCD object at 0x7f2ab0bc6cf0>) tuple[bool, float]

Perform narrow-phase CCD on the candidate.

Parameters:
vertices_t0

Stencil vertices at the start of the time step.

vertices_t1

Stencil vertices at the end of the time step.

min_distance

Minimum separation distance between primitives.

tmax

Maximum time (normalized) to look for collisions. Should be in [0, 1].

narrow_phase_ccd

The narrow phase CCD algorithm to use.

Returns:

If the candidate had a collision over the time interval. Computed time of impact (normalized).

Return type:

Tuple of

print_ccd_query(self, vertices_t0: numpy.ndarray[numpy.float64[m, 1]], vertices_t1: numpy.ndarray[numpy.float64[m, 1]]) None

Print the CCD query to cout.

Parameters:
vertices_t0: numpy.ndarray[numpy.float64[m, 1]]

Stencil vertices at the start of the time step.

vertices_t1: Stencil vertices at the end of the time step.

Vertex-Vertex Candidate

class ipctk.VertexVertexCandidate

Bases: CollisionStencil, ContinuousCollisionCandidate

Public Data Attributes:

vertex0_id

ID of the first vertex

vertex1_id

ID of the second vertex

Public Methods:

__init__(self, vertex0_id, vertex1_id)

__str__(self)

__repr__(self)

__eq__(self, other)

__ne__(self, other)

__lt__(self, other)

Compare EdgeVertexCandidates for sorting.

Inherited from CollisionStencil

__init__(*args, **kwargs)

num_vertices(self)

Get the number of vertices in the collision stencil.

dim(self, ndof)

Get the dimension of the collision stencil.

vertex_ids(self, edges, faces)

Get the vertex IDs of the collision stencil.

vertices(self, vertices, edges, faces)

Get the vertex attributes of the collision stencil.

dof(self, X, edges, faces)

Select this stencil's DOF from the full matrix of DOF.

compute_distance(self, positions)

Compute the distance of the stencil.

compute_distance_gradient(self, positions)

Compute the distance gradient of the stencil w.r.t.

compute_distance_hessian(self, positions)

Compute the distance Hessian of the stencil w.r.t.

Inherited from ContinuousCollisionCandidate

__init__(*args, **kwargs)

ccd(self, vertices_t0, 1]], vertices_t1, ...)

Perform narrow-phase CCD on the candidate.

print_ccd_query(self, vertices_t0, vertices_t1)

Print the CCD query to cout.

Inherited from pybind11_object

__annotations__ = {}
__eq__(self, other: ipctk.VertexVertexCandidate) bool
__hash__ = None
__init__(self, vertex0_id: int, vertex1_id: int)
__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, ContinuousCollisionCandidate

Public Data Attributes:

edge_id

ID of the edge

vertex_id

ID of the vertex

Public Methods:

__init__(self, edge_id, vertex_id)

known_dtype(self)

__str__(self)

__repr__(self)

__eq__(self, other)

__ne__(self, other)

__lt__(self, other)

Compare EdgeVertexCandidates for sorting.

Inherited from CollisionStencil

__init__(*args, **kwargs)

num_vertices(self)

Get the number of vertices in the collision stencil.

dim(self, ndof)

Get the dimension of the collision stencil.

vertex_ids(self, edges, faces)

Get the vertex IDs of the collision stencil.

vertices(self, vertices, edges, faces)

Get the vertex attributes of the collision stencil.

dof(self, X, edges, faces)

Select this stencil's DOF from the full matrix of DOF.

compute_distance(self, positions)

Compute the distance of the stencil.

compute_distance_gradient(self, positions)

Compute the distance gradient of the stencil w.r.t.

compute_distance_hessian(self, positions)

Compute the distance Hessian of the stencil w.r.t.

Inherited from ContinuousCollisionCandidate

__init__(*args, **kwargs)

ccd(self, vertices_t0, 1]], vertices_t1, ...)

Perform narrow-phase CCD on the candidate.

print_ccd_query(self, vertices_t0, vertices_t1)

Print the CCD query to cout.

Inherited from pybind11_object

__annotations__ = {}
__eq__(self, other: ipctk.EdgeVertexCandidate) bool
__hash__ = None
__init__(self, edge_id: int, vertex_id: int)
__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, ContinuousCollisionCandidate

Public Data Attributes:

edge0_id

ID of the first edge.

edge1_id

ID of the second edge.

Public Methods:

__init__(self, edge0_id, edge1_id)

known_dtype(self)

__str__(self)

__repr__(self)

__eq__(self, other)

__ne__(self, other)

__lt__(self, other)

Compare EdgeEdgeCandidates for sorting.

Inherited from CollisionStencil

__init__(*args, **kwargs)

num_vertices(self)

Get the number of vertices in the collision stencil.

dim(self, ndof)

Get the dimension of the collision stencil.

vertex_ids(self, edges, faces)

Get the vertex IDs of the collision stencil.

vertices(self, vertices, edges, faces)

Get the vertex attributes of the collision stencil.

dof(self, X, edges, faces)

Select this stencil's DOF from the full matrix of DOF.

compute_distance(self, positions)

Compute the distance of the stencil.

compute_distance_gradient(self, positions)

Compute the distance gradient of the stencil w.r.t.

compute_distance_hessian(self, positions)

Compute the distance Hessian of the stencil w.r.t.

Inherited from ContinuousCollisionCandidate

__init__(*args, **kwargs)

ccd(self, vertices_t0, 1]], vertices_t1, ...)

Perform narrow-phase CCD on the candidate.

print_ccd_query(self, vertices_t0, vertices_t1)

Print the CCD query to cout.

Inherited from pybind11_object

__annotations__ = {}
__eq__(self, other: ipctk.EdgeEdgeCandidate) bool
__hash__ = None
__init__(self, edge0_id: int, edge1_id: int)
__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__(self, edge_id, face_id)

__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__(self, edge_id: int, face_id: int)
__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, ContinuousCollisionCandidate

Public Data Attributes:

face_id

ID of the face

vertex_id

ID of the vertex

Public Methods:

__init__(self, face_id, vertex_id)

known_dtype(self)

__str__(self)

__repr__(self)

__eq__(self, other)

__ne__(self, other)

__lt__(self, other)

Compare FaceVertexCandidate for sorting.

Inherited from CollisionStencil

__init__(*args, **kwargs)

num_vertices(self)

Get the number of vertices in the collision stencil.

dim(self, ndof)

Get the dimension of the collision stencil.

vertex_ids(self, edges, faces)

Get the vertex IDs of the collision stencil.

vertices(self, vertices, edges, faces)

Get the vertex attributes of the collision stencil.

dof(self, X, edges, faces)

Select this stencil's DOF from the full matrix of DOF.

compute_distance(self, positions)

Compute the distance of the stencil.

compute_distance_gradient(self, positions)

Compute the distance gradient of the stencil w.r.t.

compute_distance_hessian(self, positions)

Compute the distance Hessian of the stencil w.r.t.

Inherited from ContinuousCollisionCandidate

__init__(*args, **kwargs)

ccd(self, vertices_t0, 1]], vertices_t1, ...)

Perform narrow-phase CCD on the candidate.

print_ccd_query(self, vertices_t0, vertices_t1)

Print the CCD query to cout.

Inherited from pybind11_object

__annotations__ = {}
__eq__(self, other: ipctk.FaceVertexCandidate) bool
__hash__ = None
__init__(self, face_id: int, vertex_id: int)
__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


Last update: Nov 16, 2024