Collision Mesh

class ipctk.CollisionMesh
are_adjacencies_initialized(self) bool

Determine if the adjacencies have been initialized by calling init_adjacencies().

are_area_jacobians_initialized(self) bool
static build_from_full_mesh(full_vertices_at_rest: numpy.ndarray[numpy.float64[m, n]], edges: numpy.ndarray[numpy.int32[m, n]], faces: numpy.ndarray[numpy.int32[m, n]]) ipctk.CollisionMesh

Helper function that automatically builds include_vertex using construct_is_on_surface.

Parameters:
full_vertices_at_rest: numpy.ndarray[numpy.float64[m, n]]

The full vertices at rest.

edges: numpy.ndarray[numpy.int32[m, n]]

The edge matrix of mesh.

faces: numpy.ndarray[numpy.int32[m, n]]

The face matrix of mesh.

Returns:

Constructed CollisionMesh.

property can_collide : std::function<bool (unsigned long, unsigned long)>

A function that takes two vertex IDs (row numbers in V) and returns true if the vertices (and faces or edges containing the vertices) can collide. By default all primitives can collide with all other primitives.

static construct_faces_to_edges(faces: numpy.ndarray[numpy.int32[m, n]], edges: numpy.ndarray[numpy.int32[m, n]]) numpy.ndarray[numpy.int32[m, n]]

Construct a matrix that maps from the faces’ edges to rows in the edges matrix.

Parameters:
faces: numpy.ndarray[numpy.int32[m, n]]

The face matrix of mesh.

edges: numpy.ndarray[numpy.int32[m, n]]

The edge matrix of mesh.

Returns:

Matrix that maps from the faces’ edges to rows in the edges matrix.

static construct_is_on_surface(num_vertices: int, edges: numpy.ndarray[numpy.int32[m, n]]) list[bool]
displace_vertices(self, full_displacements: numpy.ndarray[numpy.float64[m, n]]) numpy.ndarray[numpy.float64[m, n]]
edge_area(self, ei: int) float
init_adjacencies(self) None

Initialize vertex-vertex and edge-vertex adjacencies.

is_vertex_on_boundary(self, i: int) bool
to_full_dof(*args, **kwargs)

Overloaded function.

  1. to_full_dof(self: ipctk.CollisionMesh, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]

  2. to_full_dof(self: ipctk.CollisionMesh, X: scipy.sparse.csc_matrix[numpy.float64]) -> scipy.sparse.csc_matrix[numpy.float64]

to_full_vertex_id(self, id: int) int
vertex_area(self, vi: int) float
vertices(self, full_vertices: numpy.ndarray[numpy.float64[m, n]]) numpy.ndarray[numpy.float64[m, n]]

Last update: January 26, 2023