Friction

Friction Collisions

class ipctk.FrictionCollisions

Bases: pybind11_object

Public Methods:

__init__(self)

build(*args, **kwargs)

Overloaded function.

__len__(self)

Get the number of friction collisions.

empty(self)

Get if the friction collisions are empty.

clear(self)

Clear the friction collisions.

__getitem__(self, i)

Get a reference to collision at index i.

default_blend_mu(mu0, mu1)

Inherited from pybind11_object

__annotations__ = {}
__getitem__(self, i: int) ipc::FrictionCollision

Get a reference to collision at index i.

Parameters:
i: int

The index of the collision.

Returns:

A reference to the collision.

__init__(self)
__len__(self) int

Get the number of friction collisions.

__module__ = 'ipctk'
build(*args, **kwargs)

Overloaded function.

  1. build(self: ipctk.FrictionCollisions, mesh: ipc::CollisionMesh, vertices: numpy.ndarray[numpy.float64[m, n]], collisions: ipctk.Collisions, barrier_potential: ipctk.BarrierPotential, barrier_stiffness: float, mu: float) -> None

  2. build(self: ipctk.FrictionCollisions, mesh: ipc::CollisionMesh, vertices: numpy.ndarray[numpy.float64[m, n]], collisions: ipctk.Collisions, barrier_potential: ipctk.BarrierPotential, barrier_stiffness: float, mus: numpy.ndarray[numpy.float64[m, 1]]) -> None

  3. build(self: ipctk.FrictionCollisions, mesh: ipc::CollisionMesh, vertices: numpy.ndarray[numpy.float64[m, n]], collisions: ipctk.Collisions, barrier_potential: ipctk.BarrierPotential, barrier_stiffness: float, mus: numpy.ndarray[numpy.float64[m, 1]], blend_mu: Callable[[float, float], float]) -> None

clear(self) None

Clear the friction collisions.

static default_blend_mu(mu0: float, mu1: float) float
property ee_collisions : list[ipc::EdgeEdgeFrictionCollision]
empty(self) bool

Get if the friction collisions are empty.

property ev_collisions : list[ipc::EdgeVertexFrictionCollision]
property fv_collisions : list[ipc::FaceVertexFrictionCollision]
property vv_collisions : list[ipc::VertexVertexFrictionCollision]

Friction Collision

class ipctk.FrictionCollision

Bases: CollisionStencil

Public Data Attributes:

normal_force_magnitude

Collision force magnitude

mu

Coefficient of friction

weight

Weight

weight_gradient

Gradient of weight with respect to all DOF

closest_point

Barycentric coordinates of the closest point(s)

tangent_basis

Tangent basis of the collision (max size 3×2)

Public Methods:

__init__(*args, **kwargs)

dim(self)

Get the dimension of the collision.

ndof(self)

Get the number of degrees of freedom for the collision.

compute_normal_force_magnitude(self, ...[, dmin])

Compute the normal force magnitude.

compute_normal_force_magnitude_gradient(...)

Compute the gradient of the normal force magnitude.

compute_tangent_basis(self, positions)

Compute the tangent basis of the collision.

compute_tangent_basis_jacobian(self, positions)

Compute the Jacobian of the tangent basis of the collision.

compute_closest_point(self, positions)

Compute the barycentric coordinates of the closest point.

compute_closest_point_jacobian(self, positions)

Compute the Jacobian of the barycentric coordinates of the closest point.

relative_velocity(self, velocities)

Compute the relative velocity of the collision.

relative_velocity_matrix(*args, **kwargs)

Overloaded function.

relative_velocity_matrix_jacobian(self, ...)

Construct the Jacobian of the relative velocity premultiplier wrt the closest points.

Inherited from CollisionStencil

__init__(*args, **kwargs)

num_vertices(self)

Get the number of vertices in 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 pybind11_object

__annotations__ = {}
__init__(*args, **kwargs)
__module__ = 'ipctk'
property closest_point : numpy.ndarray[numpy.float64[m, 1]]

Barycentric coordinates of the closest point(s)

compute_closest_point(self, positions: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, 1]]

Compute the barycentric coordinates of the closest point.

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

Collision stencil’s vertex positions.

Returns:

Barycentric coordinates of the closest point.

compute_closest_point_jacobian(self, positions: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]]

Compute the Jacobian of the barycentric coordinates of the closest point.

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

Collision stencil’s vertex positions.

Returns:

Jacobian of the barycentric coordinates of the closest point.

compute_normal_force_magnitude(self, positions: numpy.ndarray[numpy.float64[m, 1]], barrier_potential: ipctk.BarrierPotential, barrier_stiffness: float, dmin: float = 0) float

Compute the normal force magnitude.

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

Collision stencil’s vertex positions.

dhat

Barrier activation distance.

barrier_stiffness: float

Barrier stiffness.

dmin: float = 0

Minimum distance.

Returns:

Normal force magnitude.

compute_normal_force_magnitude_gradient(self, positions: numpy.ndarray[numpy.float64[m, 1]], barrier_potential: ipctk.BarrierPotential, barrier_stiffness: float, dmin: float = 0) numpy.ndarray[numpy.float64[m, 1]]

Compute the gradient of the normal force magnitude.

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

Collision stencil’s vertex positions.

dhat

Barrier activation distance.

barrier_stiffness: float

Barrier stiffness.

dmin: float = 0

Minimum distance.

Returns:

Gradient of the normal force magnitude wrt positions.

compute_tangent_basis(self, positions: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]]

Compute the tangent basis of the collision.

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

Collision stencil’s vertex positions.

Returns:

Tangent basis of the collision.

compute_tangent_basis_jacobian(self, positions: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]]

Compute the Jacobian of the tangent basis of the collision.

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

Collision stencil’s vertex positions.

Returns:

Jacobian of the tangent basis of the collision.

dim(self) int

Get the dimension of the collision.

property mu : float

Coefficient of friction

ndof(self) int

Get the number of degrees of freedom for the collision.

property normal_force_magnitude : float

Collision force magnitude

relative_velocity(self, velocities: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, 1]]

Compute the relative velocity of the collision.

Parameters:
positions

Collision stencil’s vertex velocities.

Returns:

Relative velocity of the collision.

relative_velocity_matrix(*args, **kwargs)

Overloaded function.

  1. relative_velocity_matrix(self: ipctk.FrictionCollision) -> numpy.ndarray[numpy.float64[m, n]]

    Construct the premultiplier matrix for the relative velocity.

    Note:

    Uses the cached closest point.

    Returns:

    A matrix M such that relative_velocity = M * velocities.

  2. relative_velocity_matrix(self: ipctk.FrictionCollision, closest_point: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, n]]

    Construct the premultiplier matrix for the relative velocity.

    Parameters:

    closest_point: Barycentric coordinates of the closest point.

    Returns:

    A matrix M such that relative_velocity = M * velocities.

relative_velocity_matrix_jacobian(self, closest_point: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]]

Construct the Jacobian of the relative velocity premultiplier wrt the closest points.

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

Barycentric coordinates of the closest point.

Returns:

Jacobian of the relative velocity premultiplier wrt the closest points.

property tangent_basis : numpy.ndarray[numpy.float64[m, n]]

Tangent basis of the collision (max size 3×2)

property weight : float

Weight

property weight_gradient : scipy.sparse.csc_matrix[numpy.float64]

Gradient of weight with respect to all DOF

Vertex-Vertex Friction Collision

class ipctk.VertexVertexFrictionCollision

Bases: VertexVertexCandidate, FrictionCollision

Public Data Attributes:

Inherited from VertexVertexCandidate

vertex0_id

ID of the first vertex

vertex1_id

ID of the second vertex

Inherited from FrictionCollision

normal_force_magnitude

Collision force magnitude

mu

Coefficient of friction

weight

Weight

weight_gradient

Gradient of weight with respect to all DOF

closest_point

Barycentric coordinates of the closest point(s)

tangent_basis

Tangent basis of the collision (max size 3×2)

Public Methods:

__init__(*args, **kwargs)

Overloaded function.

Inherited from VertexVertexCandidate

__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 FrictionCollision

__init__(*args, **kwargs)

dim(self)

Get the dimension of the collision.

ndof(self)

Get the number of degrees of freedom for the collision.

compute_normal_force_magnitude(self, ...[, dmin])

Compute the normal force magnitude.

compute_normal_force_magnitude_gradient(...)

Compute the gradient of the normal force magnitude.

compute_tangent_basis(self, positions)

Compute the tangent basis of the collision.

compute_tangent_basis_jacobian(self, positions)

Compute the Jacobian of the tangent basis of the collision.

compute_closest_point(self, positions)

Compute the barycentric coordinates of the closest point.

compute_closest_point_jacobian(self, positions)

Compute the Jacobian of the barycentric coordinates of the closest point.

relative_velocity(self, velocities)

Compute the relative velocity of the collision.

relative_velocity_matrix(*args, **kwargs)

Overloaded function.

relative_velocity_matrix_jacobian(self, ...)

Construct the Jacobian of the relative velocity premultiplier wrt the closest points.

Inherited from CollisionStencil

__init__(*args, **kwargs)

num_vertices(self)

Get the number of vertices in 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, 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)

Overloaded function.

  1. __init__(self: ipctk.VertexVertexFrictionCollision, collision: ipctk.VertexVertexCollision) -> None

  2. __init__(self: ipctk.VertexVertexFrictionCollision, collision: ipctk.VertexVertexCollision, positions: numpy.ndarray[numpy.float64[m, 1]], barrier_potential: ipctk.BarrierPotential, barrier_stiffness: float) -> None

__module__ = 'ipctk'

Edge-Vertex Friction Collision

class ipctk.EdgeVertexFrictionCollision

Bases: EdgeVertexCandidate, FrictionCollision

Public Data Attributes:

Inherited from EdgeVertexCandidate

edge_id

ID of the edge

vertex_id

ID of the vertex

Inherited from FrictionCollision

normal_force_magnitude

Collision force magnitude

mu

Coefficient of friction

weight

Weight

weight_gradient

Gradient of weight with respect to all DOF

closest_point

Barycentric coordinates of the closest point(s)

tangent_basis

Tangent basis of the collision (max size 3×2)

Public Methods:

__init__(*args, **kwargs)

Overloaded function.

Inherited from EdgeVertexCandidate

__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 FrictionCollision

__init__(*args, **kwargs)

dim(self)

Get the dimension of the collision.

ndof(self)

Get the number of degrees of freedom for the collision.

compute_normal_force_magnitude(self, ...[, dmin])

Compute the normal force magnitude.

compute_normal_force_magnitude_gradient(...)

Compute the gradient of the normal force magnitude.

compute_tangent_basis(self, positions)

Compute the tangent basis of the collision.

compute_tangent_basis_jacobian(self, positions)

Compute the Jacobian of the tangent basis of the collision.

compute_closest_point(self, positions)

Compute the barycentric coordinates of the closest point.

compute_closest_point_jacobian(self, positions)

Compute the Jacobian of the barycentric coordinates of the closest point.

relative_velocity(self, velocities)

Compute the relative velocity of the collision.

relative_velocity_matrix(*args, **kwargs)

Overloaded function.

relative_velocity_matrix_jacobian(self, ...)

Construct the Jacobian of the relative velocity premultiplier wrt the closest points.

Inherited from CollisionStencil

__init__(*args, **kwargs)

num_vertices(self)

Get the number of vertices in 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, 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)

Overloaded function.

  1. __init__(self: ipctk.EdgeVertexFrictionCollision, collision: ipctk.EdgeVertexCollision) -> None

  2. __init__(self: ipctk.EdgeVertexFrictionCollision, collision: ipctk.EdgeVertexCollision, positions: numpy.ndarray[numpy.float64[m, 1]], barrier_potential: ipctk.BarrierPotential, barrier_stiffness: float) -> None

__module__ = 'ipctk'

Edge-Edge Friction Collision

class ipctk.EdgeEdgeFrictionCollision

Bases: EdgeEdgeCandidate, FrictionCollision

Public Data Attributes:

Inherited from EdgeEdgeCandidate

edge0_id

ID of the first edge.

edge1_id

ID of the second edge.

Inherited from FrictionCollision

normal_force_magnitude

Collision force magnitude

mu

Coefficient of friction

weight

Weight

weight_gradient

Gradient of weight with respect to all DOF

closest_point

Barycentric coordinates of the closest point(s)

tangent_basis

Tangent basis of the collision (max size 3×2)

Public Methods:

__init__(*args, **kwargs)

Overloaded function.

Inherited from EdgeEdgeCandidate

__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 FrictionCollision

__init__(*args, **kwargs)

dim(self)

Get the dimension of the collision.

ndof(self)

Get the number of degrees of freedom for the collision.

compute_normal_force_magnitude(self, ...[, dmin])

Compute the normal force magnitude.

compute_normal_force_magnitude_gradient(...)

Compute the gradient of the normal force magnitude.

compute_tangent_basis(self, positions)

Compute the tangent basis of the collision.

compute_tangent_basis_jacobian(self, positions)

Compute the Jacobian of the tangent basis of the collision.

compute_closest_point(self, positions)

Compute the barycentric coordinates of the closest point.

compute_closest_point_jacobian(self, positions)

Compute the Jacobian of the barycentric coordinates of the closest point.

relative_velocity(self, velocities)

Compute the relative velocity of the collision.

relative_velocity_matrix(*args, **kwargs)

Overloaded function.

relative_velocity_matrix_jacobian(self, ...)

Construct the Jacobian of the relative velocity premultiplier wrt the closest points.

Inherited from CollisionStencil

__init__(*args, **kwargs)

num_vertices(self)

Get the number of vertices in 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, 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)

Overloaded function.

  1. __init__(self: ipctk.EdgeEdgeFrictionCollision, collision: ipctk.EdgeEdgeCollision) -> None

  2. __init__(self: ipctk.EdgeEdgeFrictionCollision, collision: ipctk.EdgeEdgeCollision, positions: numpy.ndarray[numpy.float64[m, 1]], barrier_potential: ipctk.BarrierPotential, barrier_stiffness: float) -> None

__module__ = 'ipctk'

Triangle-Vertex Friction Collision

class ipctk.FaceVertexFrictionCollision

Bases: FaceVertexCandidate, FrictionCollision

Public Data Attributes:

Inherited from FaceVertexCandidate

face_id

ID of the face

vertex_id

ID of the vertex

Inherited from FrictionCollision

normal_force_magnitude

Collision force magnitude

mu

Coefficient of friction

weight

Weight

weight_gradient

Gradient of weight with respect to all DOF

closest_point

Barycentric coordinates of the closest point(s)

tangent_basis

Tangent basis of the collision (max size 3×2)

Public Methods:

__init__(*args, **kwargs)

Overloaded function.

Inherited from FaceVertexCandidate

__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 FrictionCollision

__init__(*args, **kwargs)

dim(self)

Get the dimension of the collision.

ndof(self)

Get the number of degrees of freedom for the collision.

compute_normal_force_magnitude(self, ...[, dmin])

Compute the normal force magnitude.

compute_normal_force_magnitude_gradient(...)

Compute the gradient of the normal force magnitude.

compute_tangent_basis(self, positions)

Compute the tangent basis of the collision.

compute_tangent_basis_jacobian(self, positions)

Compute the Jacobian of the tangent basis of the collision.

compute_closest_point(self, positions)

Compute the barycentric coordinates of the closest point.

compute_closest_point_jacobian(self, positions)

Compute the Jacobian of the barycentric coordinates of the closest point.

relative_velocity(self, velocities)

Compute the relative velocity of the collision.

relative_velocity_matrix(*args, **kwargs)

Overloaded function.

relative_velocity_matrix_jacobian(self, ...)

Construct the Jacobian of the relative velocity premultiplier wrt the closest points.

Inherited from CollisionStencil

__init__(*args, **kwargs)

num_vertices(self)

Get the number of vertices in 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, 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)

Overloaded function.

  1. __init__(self: ipctk.FaceVertexFrictionCollision, collision: ipctk.FaceVertexCollision) -> None

  2. __init__(self: ipctk.FaceVertexFrictionCollision, collision: ipctk.FaceVertexCollision, positions: numpy.ndarray[numpy.float64[m, 1]], barrier_potential: ipctk.BarrierPotential, barrier_stiffness: float) -> None

__module__ = 'ipctk'

Smooth Mollifier

ipctk.f0_SF(s: float, epsv: float) float

Smooth friction mollifier function.

\[f_0(s)= \begin{cases} -\frac{s^3}{3\epsilon_v^2} + \frac{s^2}{\epsilon_v} + \frac{\epsilon_v}{3}, & |s| < \epsilon_v \newline s, & |s| \geq \epsilon_v \end{cases}\]
Parameters:
s: float

The tangential relative speed.

epsv: float

Mollifier parameter \(\epsilon_v\).

Returns:

The value of the mollifier function at s.

ipctk.f1_SF_over_x(s: float, epsv: float) float

Compute the derivative of f0_SF divided by s (\(\frac{f_0'(s)}{s}\)).

\[f_1(s) = f_0'(s) = \begin{cases} -\frac{s^2}{\epsilon_v^2}+\frac{2 s}{\epsilon_v}, & |s| < \epsilon_v \newline 1, & |s| \geq \epsilon_v \end{cases}\]
\[\frac{f_1(s)}{s} = \begin{cases} -\frac{s}{\epsilon_v^2}+\frac{2}{\epsilon_v}, & |s| < \epsilon_v \newline \frac{1}{s}, & |s| \geq \epsilon_v \end{cases}\]
Parameters:
s: float

The tangential relative speed.

epsv: float

Mollifier parameter \(\epsilon_v\).

Returns:

The value of the derivative of f0_SF divided by s.

ipctk.df1_x_minus_f1_over_x3(s: float, epsv: float) float

The derivative of f1 times s minus f1 all divided by s cubed.

\[\frac{f_1'(s) s - f_1(s)}{s^3} = \begin{cases} -\frac{1}{s \epsilon_v^2}, & |s| < \epsilon_v \newline -\frac{1}{s^3}, & |s| \geq \epsilon_v \end{cases}\]
Parameters:
s: float

The tangential relative speed.

epsv: float

Mollifier parameter \(\epsilon_v\).

Returns:

The derivative of f1 times s minus f1 all divided by s cubed.

Normal Force Magnitude

ipctk.compute_normal_force_magnitude(distance_squared: float, barrier: ipctk.Barrier, dhat: float, barrier_stiffness: float, dmin: float = 0) float
ipctk.compute_normal_force_magnitude_gradient(distance_squared: float, distance_squared_gradient: numpy.ndarray[numpy.float64[m, 1]], barrier: ipctk.Barrier, dhat: float, barrier_stiffness: float, dmin: float = 0) numpy.ndarray[numpy.float64[m, 1]]

Tangent Basis

ipctk.point_point_tangent_basis(p0: numpy.ndarray[numpy.float64[m, 1]], p1: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]]

Compute a basis for the space tangent to the point-point pair.

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

First point

p1: numpy.ndarray[numpy.float64[m, 1]]

Second point

Returns:

A 3x2 matrix whose columns are the basis vectors.

ipctk.point_edge_tangent_basis(p: numpy.ndarray[numpy.float64[m, 1]], e0: numpy.ndarray[numpy.float64[m, 1]], e1: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]]
ipctk.edge_edge_tangent_basis(ea0: numpy.ndarray[numpy.float64[3, 1]], ea1: numpy.ndarray[numpy.float64[3, 1]], eb0: numpy.ndarray[numpy.float64[3, 1]], eb1: numpy.ndarray[numpy.float64[3, 1]]) numpy.ndarray[numpy.float64[3, 2]]

Compute a basis for the space tangent to the edge-edge pair.

ipctk.point_triangle_tangent_basis(p: numpy.ndarray[numpy.float64[3, 1]], t0: numpy.ndarray[numpy.float64[3, 1]], t1: numpy.ndarray[numpy.float64[3, 1]], t2: numpy.ndarray[numpy.float64[3, 1]]) numpy.ndarray[numpy.float64[3, 2]]

Compute a basis for the space tangent to the point-triangle pair.

\[\begin{bmatrix} \frac{t_1 - t_0}{\|t_1 - t_0\|} & \frac{((t_1 - t_0)\times(t_2 - t_0)) \times(t_1 - t_0)}{\|((t_1 - t_0)\times(t_2 - t_0))\times(t_1 - t_0)\|} \end{bmatrix}\]
Parameters:
p: numpy.ndarray[numpy.float64[3, 1]]

Point

t0: numpy.ndarray[numpy.float64[3, 1]]

Triangle’s first vertex

t1: numpy.ndarray[numpy.float64[3, 1]]

Triangle’s second vertex

t2: numpy.ndarray[numpy.float64[3, 1]]

Triangle’s third vertex

Returns:

A 3x2 matrix whose columns are the basis vectors.

Tangent Basis Jacobians

ipctk.point_point_tangent_basis_jacobian(p0: numpy.ndarray[numpy.float64[m, 1]], p1: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]]
ipctk.point_edge_tangent_basis_jacobian(p: numpy.ndarray[numpy.float64[m, 1]], e0: numpy.ndarray[numpy.float64[m, 1]], e1: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, n]]
ipctk.edge_edge_tangent_basis_jacobian(ea0: numpy.ndarray[numpy.float64[3, 1]], ea1: numpy.ndarray[numpy.float64[3, 1]], eb0: numpy.ndarray[numpy.float64[3, 1]], eb1: numpy.ndarray[numpy.float64[3, 1]]) numpy.ndarray[numpy.float64[36, 2]]
ipctk.point_triangle_tangent_basis_jacobian(p: numpy.ndarray[numpy.float64[3, 1]], t0: numpy.ndarray[numpy.float64[3, 1]], t1: numpy.ndarray[numpy.float64[3, 1]], t2: numpy.ndarray[numpy.float64[3, 1]]) numpy.ndarray[numpy.float64[36, 2]]

Relative Velocity

ipctk.point_point_relative_velocity(dp0: numpy.ndarray[numpy.float64[m, 1]], dp1: numpy.ndarray[numpy.float64[m, 1]]) numpy.ndarray[numpy.float64[m, 1]]

Compute the relative velocity of two points

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

Velocity of the first point

dp1: numpy.ndarray[numpy.float64[m, 1]]

Velocity of the second point

Returns:

The relative velocity of the two points

ipctk.point_edge_relative_velocity(dp: numpy.ndarray[numpy.float64[m, 1]], de0: numpy.ndarray[numpy.float64[m, 1]], de1: numpy.ndarray[numpy.float64[m, 1]], alpha: float) numpy.ndarray[numpy.float64[m, 1]]

Compute the relative velocity of a point and an edge

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

Velocity of the point

de0: numpy.ndarray[numpy.float64[m, 1]]

Velocity of the first endpoint of the edge

de1: numpy.ndarray[numpy.float64[m, 1]]

Velocity of the second endpoint of the edge

alpha: float

Parametric coordinate of the closest point on the edge

Returns:

The relative velocity of the point and the edge

ipctk.edge_edge_relative_velocity(dea0: numpy.ndarray[numpy.float64[3, 1]], dea1: numpy.ndarray[numpy.float64[3, 1]], deb0: numpy.ndarray[numpy.float64[3, 1]], deb1: numpy.ndarray[numpy.float64[3, 1]], coords: numpy.ndarray[numpy.float64[2, 1]]) numpy.ndarray[numpy.float64[3, 1]]

Compute the relative velocity of the edges.

Parameters:
dea0: numpy.ndarray[numpy.float64[3, 1]]

Velocity of the first endpoint of the first edge

dea1: numpy.ndarray[numpy.float64[3, 1]]

Velocity of the second endpoint of the first edge

deb0: numpy.ndarray[numpy.float64[3, 1]]

Velocity of the first endpoint of the second edge

deb1: numpy.ndarray[numpy.float64[3, 1]]

Velocity of the second endpoint of the second edge

coords: numpy.ndarray[numpy.float64[2, 1]]

Two parametric coordinates of the closest points on the edges

Returns:

The relative velocity of the edges

ipctk.point_triangle_relative_velocity(dp: numpy.ndarray[numpy.float64[3, 1]], dt0: numpy.ndarray[numpy.float64[3, 1]], dt1: numpy.ndarray[numpy.float64[3, 1]], dt2: numpy.ndarray[numpy.float64[3, 1]], coords: numpy.ndarray[numpy.float64[2, 1]]) numpy.ndarray[numpy.float64[3, 1]]

Compute the relative velocity of the point to the triangle.

Parameters:
dp: numpy.ndarray[numpy.float64[3, 1]]

Velocity of the point

dt0: numpy.ndarray[numpy.float64[3, 1]]

Velocity of the first vertex of the triangle

dt1: numpy.ndarray[numpy.float64[3, 1]]

Velocity of the second vertex of the triangle

dt2: numpy.ndarray[numpy.float64[3, 1]]

Velocity of the third vertex of the triangle

coords: numpy.ndarray[numpy.float64[2, 1]]

Baricentric coordinates of the closest point on the triangle

Returns:

The relative velocity of the point to the triangle

Relative Velocity as Multiplier Matricies

ipctk.point_point_relative_velocity_matrix(dim: int) numpy.ndarray[numpy.float64[m, n]]

Compute the relative velocity premultiplier matrix

Parameters:
dim: int

Dimension (2 or 3)

Returns:

The relative velocity premultiplier matrix

ipctk.point_edge_relative_velocity_matrix(dim: int, alpha: float) numpy.ndarray[numpy.float64[m, n]]
ipctk.edge_edge_relative_velocity_matrix(dim: int, coords: numpy.ndarray[numpy.float64[2, 1]]) numpy.ndarray[numpy.float64[m, n]]
ipctk.point_triangle_relative_velocity_matrix(dim: int, coords: numpy.ndarray[numpy.float64[2, 1]]) numpy.ndarray[numpy.float64[m, n]]

Relative Velocity Matrix Jacobians

ipctk.point_point_relative_velocity_matrix_jacobian(dim: int) numpy.ndarray[numpy.float64[m, n]]

Compute the jacobian of the relative velocity premultiplier matrix

Parameters:
dim: int

Dimension (2 or 3)

Returns:

The jacobian of the relative velocity premultiplier matrix

ipctk.point_edge_relative_velocity_matrix_jacobian(dim: int, alpha: float) numpy.ndarray[numpy.float64[m, n]]
ipctk.edge_edge_relative_velocity_matrix_jacobian(dim: int, coords: numpy.ndarray[numpy.float64[2, 1]]) numpy.ndarray[numpy.float64[m, n]]
ipctk.point_triangle_relative_velocity_matrix_jacobian(dim: int, coords: numpy.ndarray[numpy.float64[2, 1]]) numpy.ndarray[numpy.float64[m, n]]

Last update: Apr 03, 2024