Broad Phase

Broad Phase

class ipctk.BroadPhase

Bases: pybind11_object

Public Data Attributes:

can_vertices_collide

Function for determining if two vertices can collide.

Public Methods:

__init__(self)

name(self)

Get the name of the broad phase.

build(*args, **kwargs)

Overloaded function.

clear(self)

Clear any built data.

detect_vertex_vertex_candidates(self)

Find the candidate vertex-vertex collisions.

detect_edge_vertex_candidates(self)

Find the candidate edge-vertex collisions.

detect_edge_edge_candidates(self)

Find the candidate edge-edge collisions.

detect_face_vertex_candidates(self)

Find the candidate face-vertex collisions.

detect_edge_face_candidates(self)

Find the candidate edge-face intersections.

detect_face_face_candidates(self)

Find the candidate face-face collisions.

detect_collision_candidates(self)

Detect all collision candidates needed for a given dimensional simulation.

Inherited from pybind11_object

Private Methods:

_pybind11_conduit_v1_


__annotations__ = {}
__init__(self)
__module__ = 'ipctk'
_pybind11_conduit_v1_()
build(*args, **kwargs)

Overloaded function.

  1. build(self: ipctk.BroadPhase, 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”], inflation_radius: typing.SupportsFloat = 0) -> None

    Build the broad phase for static collision detection.

    Parameters:

    vertices: Vertex positions edges: Collision mesh edges faces: Collision mesh faces inflation_radius: Radius of inflation around all elements.

  2. build(self: ipctk.BroadPhase, 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”], 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”], inflation_radius: typing.SupportsFloat = 0) -> None

    Build the broad phase for continuous collision detection.

    Parameters:

    vertices_t0: Starting vertices of the vertices. vertices_t1: Ending vertices of the vertices. edges: Collision mesh edges faces: Collision mesh faces inflation_radius: Radius of inflation around all elements.

property can_vertices_collide : collections.abc.Callable[[SupportsInt, SupportsInt], bool]

Function for determining if two vertices can collide.

clear(self) None

Clear any built data.

detect_collision_candidates(self) ipc::Candidates

Detect all collision candidates needed for a given dimensional simulation.

detect_edge_edge_candidates(self) list[ipc::EdgeEdgeCandidate]

Find the candidate edge-edge collisions.

Returns:

The candidate edge-edge collisions.

detect_edge_face_candidates(self) list[ipc::EdgeFaceCandidate]

Find the candidate edge-face intersections.

Returns:

The candidate edge-face intersections.

detect_edge_vertex_candidates(self) list[ipc::EdgeVertexCandidate]

Find the candidate edge-vertex collisions.

Returns:

The candidate edge-vertex collisions.

detect_face_face_candidates(self) list[ipc::FaceFaceCandidate]

Find the candidate face-face collisions.

Returns:

The candidate face-face collisions.

detect_face_vertex_candidates(self) list[ipc::FaceVertexCandidate]

Find the candidate face-vertex collisions.

Returns:

The candidate face-vertex collisions.

detect_vertex_vertex_candidates(self) list[ipc::VertexVertexCandidate]

Find the candidate vertex-vertex collisions.

Returns:

The candidate vertex-vertex collisions.

name(self) str

Get the name of the broad phase.

Brute Force

class ipctk.BruteForce

Bases: BroadPhase

Public Data Attributes:

Inherited from BroadPhase

can_vertices_collide

Function for determining if two vertices can collide.

Public Methods:

__init__(self)

Inherited from BroadPhase

__init__(self)

name(self)

Get the name of the broad phase.

build(*args, **kwargs)

Overloaded function.

clear(self)

Clear any built data.

detect_vertex_vertex_candidates(self)

Find the candidate vertex-vertex collisions.

detect_edge_vertex_candidates(self)

Find the candidate edge-vertex collisions.

detect_edge_edge_candidates(self)

Find the candidate edge-edge collisions.

detect_face_vertex_candidates(self)

Find the candidate face-vertex collisions.

detect_edge_face_candidates(self)

Find the candidate edge-face intersections.

detect_face_face_candidates(self)

Find the candidate face-face collisions.

detect_collision_candidates(self)

Detect all collision candidates needed for a given dimensional simulation.

Inherited from pybind11_object

Private Methods:

_pybind11_conduit_v1_

Inherited from BroadPhase

_pybind11_conduit_v1_


__annotations__ = {}
__init__(self)
__module__ = 'ipctk'
_pybind11_conduit_v1_()

Hash Grid

class ipctk.HashGrid

Bases: BroadPhase

Public Data Attributes:

cell_size

grid_size

domain_min

domain_max

Inherited from BroadPhase

can_vertices_collide

Function for determining if two vertices can collide.

Public Methods:

__init__(self)

Inherited from BroadPhase

__init__(self)

name(self)

Get the name of the broad phase.

build(*args, **kwargs)

Overloaded function.

clear(self)

Clear any built data.

detect_vertex_vertex_candidates(self)

Find the candidate vertex-vertex collisions.

detect_edge_vertex_candidates(self)

Find the candidate edge-vertex collisions.

detect_edge_edge_candidates(self)

Find the candidate edge-edge collisions.

detect_face_vertex_candidates(self)

Find the candidate face-vertex collisions.

detect_edge_face_candidates(self)

Find the candidate edge-face intersections.

detect_face_face_candidates(self)

Find the candidate face-face collisions.

detect_collision_candidates(self)

Detect all collision candidates needed for a given dimensional simulation.

Inherited from pybind11_object

Private Methods:

_pybind11_conduit_v1_

Inherited from BroadPhase

_pybind11_conduit_v1_


__annotations__ = {}
__init__(self)
__module__ = 'ipctk'
_pybind11_conduit_v1_()
property cell_size : float
property domain_max : Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']
property domain_min : Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']
property grid_size : Annotated[numpy.typing.NDArray[numpy.int32], '[3, 1]']

Spatial Hash

class ipctk.SpatialHash

Bases: BroadPhase

Public Data Attributes:

Inherited from BroadPhase

can_vertices_collide

Function for determining if two vertices can collide.

Public Methods:

__init__(self)

build(*args, **kwargs)

Overloaded function.

Inherited from BroadPhase

__init__(self)

name(self)

Get the name of the broad phase.

build(*args, **kwargs)

Overloaded function.

clear(self)

Clear any built data.

detect_vertex_vertex_candidates(self)

Find the candidate vertex-vertex collisions.

detect_edge_vertex_candidates(self)

Find the candidate edge-vertex collisions.

detect_edge_edge_candidates(self)

Find the candidate edge-edge collisions.

detect_face_vertex_candidates(self)

Find the candidate face-vertex collisions.

detect_edge_face_candidates(self)

Find the candidate edge-face intersections.

detect_face_face_candidates(self)

Find the candidate face-face collisions.

detect_collision_candidates(self)

Detect all collision candidates needed for a given dimensional simulation.

Inherited from pybind11_object

Private Methods:

_pybind11_conduit_v1_

Inherited from BroadPhase

_pybind11_conduit_v1_


__annotations__ = {}
__init__(self)
__module__ = 'ipctk'
_pybind11_conduit_v1_()
build(*args, **kwargs)

Overloaded function.

  1. build(self: ipctk.SpatialHash, 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”], inflation_radius: typing.SupportsFloat = 0, voxel_size: typing.SupportsFloat = -1) -> None

  2. build(self: ipctk.SpatialHash, 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”], 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”], inflation_radius: typing.SupportsFloat = 0, voxel_size: typing.SupportsFloat = -1) -> None

BVH

class ipctk.BVH

Bases: BroadPhase

Public Data Attributes:

Inherited from BroadPhase

can_vertices_collide

Function for determining if two vertices can collide.

Public Methods:

__init__(self)

Inherited from BroadPhase

__init__(self)

name(self)

Get the name of the broad phase.

build(*args, **kwargs)

Overloaded function.

clear(self)

Clear any built data.

detect_vertex_vertex_candidates(self)

Find the candidate vertex-vertex collisions.

detect_edge_vertex_candidates(self)

Find the candidate edge-vertex collisions.

detect_edge_edge_candidates(self)

Find the candidate edge-edge collisions.

detect_face_vertex_candidates(self)

Find the candidate face-vertex collisions.

detect_edge_face_candidates(self)

Find the candidate edge-face intersections.

detect_face_face_candidates(self)

Find the candidate face-face collisions.

detect_collision_candidates(self)

Detect all collision candidates needed for a given dimensional simulation.

Inherited from pybind11_object

Private Methods:

_pybind11_conduit_v1_

Inherited from BroadPhase

_pybind11_conduit_v1_


__annotations__ = {}
__init__(self)
__module__ = 'ipctk'
_pybind11_conduit_v1_()

LBVH

class ipctk.LBVH

Bases: BroadPhase

Public Data Attributes:

vertex_nodes

edge_nodes

face_nodes

Inherited from BroadPhase

can_vertices_collide

Function for determining if two vertices can collide.

Public Methods:

__init__(self)

Inherited from BroadPhase

__init__(self)

name(self)

Get the name of the broad phase.

build(*args, **kwargs)

Overloaded function.

clear(self)

Clear any built data.

detect_vertex_vertex_candidates(self)

Find the candidate vertex-vertex collisions.

detect_edge_vertex_candidates(self)

Find the candidate edge-vertex collisions.

detect_edge_edge_candidates(self)

Find the candidate edge-edge collisions.

detect_face_vertex_candidates(self)

Find the candidate face-vertex collisions.

detect_edge_face_candidates(self)

Find the candidate edge-face intersections.

detect_face_face_candidates(self)

Find the candidate face-face collisions.

detect_collision_candidates(self)

Detect all collision candidates needed for a given dimensional simulation.

Inherited from pybind11_object

Private Methods:

_pybind11_conduit_v1_

Inherited from BroadPhase

_pybind11_conduit_v1_


__annotations__ = {}
__init__(self)
__module__ = 'ipctk'
_pybind11_conduit_v1_()
property edge_nodes : list[ipctk.LBVH_Node]
property face_nodes : list[ipctk.LBVH_Node]
property vertex_nodes : list[ipctk.LBVH_Node]

Sweep and Prune

class ipctk.SweepAndPrune

Bases: BroadPhase

Public Data Attributes:

Inherited from BroadPhase

can_vertices_collide

Function for determining if two vertices can collide.

Public Methods:

__init__(self)

Inherited from BroadPhase

__init__(self)

name(self)

Get the name of the broad phase.

build(*args, **kwargs)

Overloaded function.

clear(self)

Clear any built data.

detect_vertex_vertex_candidates(self)

Find the candidate vertex-vertex collisions.

detect_edge_vertex_candidates(self)

Find the candidate edge-vertex collisions.

detect_edge_edge_candidates(self)

Find the candidate edge-edge collisions.

detect_face_vertex_candidates(self)

Find the candidate face-vertex collisions.

detect_edge_face_candidates(self)

Find the candidate edge-face intersections.

detect_face_face_candidates(self)

Find the candidate face-face collisions.

detect_collision_candidates(self)

Detect all collision candidates needed for a given dimensional simulation.

Inherited from pybind11_object

Private Methods:

_pybind11_conduit_v1_

Inherited from BroadPhase

_pybind11_conduit_v1_


__annotations__ = {}
__init__(self)
__module__ = 'ipctk'
_pybind11_conduit_v1_()

Sweep and Tiniest Queue

AABB

class ipctk.AABB

Bases: pybind11_object

Public Data Attributes:

min

Minimum corner of the AABB.

max

Maximum corner of the AABB.

vertex_ids

Vertex IDs attached to the AABB.

Public Methods:

__init__(*args, **kwargs)

Overloaded function.

from_point(*args, **kwargs)

Overloaded function.

intersects(self, other)

Check if another AABB intersects with this one.

__repr__(self)

__str__(self)

conservative_inflation(min, max, ...)

Compute a conservative inflation of the AABB.

Inherited from pybind11_object

Private Methods:

_pybind11_conduit_v1_


__annotations__ = {}
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: ipctk.AABB) -> None

  2. __init__(self: ipctk.AABB, min: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”], max: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”]) -> None

  3. __init__(self: ipctk.AABB, aabb1: ipctk.AABB, aabb2: ipctk.AABB) -> None

  4. __init__(self: ipctk.AABB, aabb1: ipctk.AABB, aabb2: ipctk.AABB, aabb3: ipctk.AABB) -> None

__module__ = 'ipctk'
__repr__(self) str
__str__(self) str
_pybind11_conduit_v1_()
static conservative_inflation(min: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 1]'], max: Annotated[numpy.typing.ArrayLike, numpy.float64, '[m, 1]'], inflation_radius: SupportsFloat) tuple[Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']]

Compute a conservative inflation of the AABB.

static from_point(*args, **kwargs)

Overloaded function.

  1. from_point(p: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”], inflation_radius: typing.SupportsFloat = 0) -> ipctk.AABB

    Construct an AABB for a static point.

    Parameters:

    p: The point’s position. inflation_radius: Radius of a sphere around the point which the AABB encloses.

    Returns:

    The constructed AABB.

  2. from_point(p_t0: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”], p_t1: typing.Annotated[numpy.typing.NDArray[numpy.float64], “[m, 1]”], inflation_radius: typing.SupportsFloat = 0) -> ipctk.AABB

    Construct an AABB for a moving point (i.e. temporal edge).

    Parameters:

    p_t0: The point’s position at time t=0. p_t1: The point’s position at time t=1. inflation_radius: Radius of a capsule around the temporal edge which the AABB encloses.

    Returns:

    The constructed AABB.

intersects(self, other: ipctk.AABB) bool

Check if another AABB intersects with this one.

Parameters:
other: ipctk.AABB

The other AABB.

Returns:

If the two AABBs intersect.

property max : Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']

Maximum corner of the AABB.

property min : Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']

Minimum corner of the AABB.

property vertex_ids : Annotated[list[int], 'FixedSize(3)']

Vertex IDs attached to the AABB.