Tangent

Tangent Basis

MatrixMax<double, 3, 2> ipc::point_point_tangent_basis(
    
Eigen::ConstRef<VectorMax3d> p0,
    
Eigen::ConstRef<VectorMax3d> p1);

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

Parameters:
Eigen::ConstRef<VectorMax3d> p0

First point

Eigen::ConstRef<VectorMax3d> p1

Second point

Returns:

A 3x2 matrix whose columns are the basis vectors.

MatrixMax<double, 3, 2> ipc::point_edge_tangent_basis(
    
Eigen::ConstRef<VectorMax3d> pEigen::ConstRef<VectorMax3d> e0,
    
Eigen::ConstRef<VectorMax3d> e1);

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

Parameters:
Eigen::ConstRef<VectorMax3d> p

Point

Eigen::ConstRef<VectorMax3d> e0

First edge point

Eigen::ConstRef<VectorMax3d> e1

Second edge point

Returns:

A 3x2 matrix whose columns are the basis vectors.

Eigen::Matrix<double, 3, 2> ipc::edge_edge_tangent_basis(
    
Eigen::ConstRef<Eigen::Vector3d> ea0,
    
Eigen::ConstRef<Eigen::Vector3d> ea1,
    
Eigen::ConstRef<Eigen::Vector3d> eb0,
    
Eigen::ConstRef<Eigen::Vector3d> eb1);

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

Parameters:
Eigen::ConstRef<Eigen::Vector3d> ea0

First point of the first edge

Eigen::ConstRef<Eigen::Vector3d> ea1

Second point of the first edge

Eigen::ConstRef<Eigen::Vector3d> eb0

First point of the second edge

Eigen::ConstRef<Eigen::Vector3d> eb1

Second point of the second edge

Returns:

A 3x2 matrix whose columns are the basis vectors.

Eigen::Matrix<double, 3, 2> ipc::point_triangle_tangent_basis(
    
Eigen::ConstRef<Eigen::Vector3d> p,
    
Eigen::ConstRef<Eigen::Vector3d> t0,
    
Eigen::ConstRef<Eigen::Vector3d> t1,
    
Eigen::ConstRef<Eigen::Vector3d> t2);

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:
Eigen::ConstRef<Eigen::Vector3d> p

Point

Eigen::ConstRef<Eigen::Vector3d> t0

Triangle’s first vertex

Eigen::ConstRef<Eigen::Vector3d> t1

Triangle’s second vertex

Eigen::ConstRef<Eigen::Vector3d> t2

Triangle’s third vertex

Returns:

A 3x2 matrix whose columns are the basis vectors.

Tangent Basis Jacobians

MatrixMax<double, 6, 6> ipc::point_point_tangent_basis_jacobian(
    
Eigen::ConstRef<VectorMax3d> p0,
    
Eigen::ConstRef<VectorMax3d> p1);

Compute the Jacobian of the tangent basis for the point-point pair.

Parameters:
Eigen::ConstRef<VectorMax3d> p0

First point

Eigen::ConstRef<VectorMax3d> p1

Second point

Returns:

A (3*2)x6 matrix whose columns are the basis vectors.

MatrixMax<double, 6, 9> ipc::point_edge_tangent_basis_jacobian(
    
Eigen::ConstRef<VectorMax3d> pEigen::ConstRef<VectorMax3d> e0,
    
Eigen::ConstRef<VectorMax3d> e1);

Compute the Jacobian of the tangent basis for the point-edge pair.

Parameters:
Eigen::ConstRef<VectorMax3d> p

Point

Eigen::ConstRef<VectorMax3d> e0

First edge point

Eigen::ConstRef<VectorMax3d> e1

Second edge point

Returns:

A (3*2)x9 matrix whose columns are the basis vectors.

Eigen::Matrix<double, 6, 12> ipc::edge_edge_tangent_basis_jacobian(
    
Eigen::ConstRef<Eigen::Vector3d> ea0,
    
Eigen::ConstRef<Eigen::Vector3d> ea1,
    
Eigen::ConstRef<Eigen::Vector3d> eb0,
    
Eigen::ConstRef<Eigen::Vector3d> eb1);

Compute the Jacobian of the tangent basis for the edge-edge pair.

Parameters:
Eigen::ConstRef<Eigen::Vector3d> ea0

First point of the first edge

Eigen::ConstRef<Eigen::Vector3d> ea1

Second point of the first edge

Eigen::ConstRef<Eigen::Vector3d> eb0

First point of the second edge

Eigen::ConstRef<Eigen::Vector3d> eb1

Second point of the second edge

Returns:

A (3*2)x12 matrix whose columns are the basis vectors.

Eigen::Matrix<double, 6, 12>
ipc::point_triangle_tangent_basis_jacobian(
    
Eigen::ConstRef<Eigen::Vector3d> p,
    
Eigen::ConstRef<Eigen::Vector3d> t0,
    
Eigen::ConstRef<Eigen::Vector3d> t1,
    
Eigen::ConstRef<Eigen::Vector3d> t2);

Compute the Jacobian of the tangent basis for the point-triangle pair.

Parameters:
Eigen::ConstRef<Eigen::Vector3d> p

Point

Eigen::ConstRef<Eigen::Vector3d> t0

Triangle’s first vertex

Eigen::ConstRef<Eigen::Vector3d> t1

Triangle’s second vertex

Eigen::ConstRef<Eigen::Vector3d> t2

Triangle’s third vertex

Returns:

A (3*2)x12 matrix whose columns are the basis vectors.

Relative Velocity

VectorMax3d ipc::point_point_relative_velocity(
    
Eigen::ConstRef<VectorMax3d> dp0,
    
Eigen::ConstRef<VectorMax3d> dp1);

Compute the relative velocity of two points.

Parameters:
Eigen::ConstRef<VectorMax3d> dp0

Velocity of the first point

Eigen::ConstRef<VectorMax3d> dp1

Velocity of the second point

Returns:

The relative velocity of the two points

VectorMax3d ipc::point_edge_relative_velocity(
    
Eigen::ConstRef<VectorMax3d> dp,
    
Eigen::ConstRef<VectorMax3d> de0,
    
Eigen::ConstRef<VectorMax3d> de1const double alpha);

Compute the relative velocity of a point and an edge.

Parameters:
Eigen::ConstRef<VectorMax3d> dp

Velocity of the point

Eigen::ConstRef<VectorMax3d> de0

Velocity of the first endpoint of the edge

Eigen::ConstRef<VectorMax3d> de1

Velocity of the second endpoint of the edge

const double alpha

Parametric coordinate of the closest point on the edge

Returns:

The relative velocity of the point and the edge

Eigen::Vector3d ipc::edge_edge_relative_velocity(
    
Eigen::ConstRef<Eigen::Vector3d> dea0,
    
Eigen::ConstRef<Eigen::Vector3d> dea1,
    
Eigen::ConstRef<Eigen::Vector3d> deb0,
    
Eigen::ConstRef<Eigen::Vector3d> deb1,
    
Eigen::ConstRef<Eigen::Vector2d> coords);

Compute the relative velocity of the edges.

Parameters:
Eigen::ConstRef<Eigen::Vector3d> dea0

Velocity of the first endpoint of the first edge

Eigen::ConstRef<Eigen::Vector3d> dea1

Velocity of the second endpoint of the first edge

Eigen::ConstRef<Eigen::Vector3d> deb0

Velocity of the first endpoint of the second edge

Eigen::ConstRef<Eigen::Vector3d> deb1

Velocity of the second endpoint of the second edge

Eigen::ConstRef<Eigen::Vector2d> coords

Two parametric coordinates of the closest points on the edges

Returns:

The relative velocity of the edges

Eigen::Vector3d ipc::point_triangle_relative_velocity(
    
Eigen::ConstRef<Eigen::Vector3d> dp,
    
Eigen::ConstRef<Eigen::Vector3d> dt0,
    
Eigen::ConstRef<Eigen::Vector3d> dt1,
    
Eigen::ConstRef<Eigen::Vector3d> dt2,
    
Eigen::ConstRef<Eigen::Vector2d> coords);

Compute the relative velocity of the point to the triangle.

Parameters:
Eigen::ConstRef<Eigen::Vector3d> dp

Velocity of the point

Eigen::ConstRef<Eigen::Vector3d> dt0

Velocity of the first vertex of the triangle

Eigen::ConstRef<Eigen::Vector3d> dt1

Velocity of the second vertex of the triangle

Eigen::ConstRef<Eigen::Vector3d> dt2

Velocity of the third vertex of the triangle

Eigen::ConstRef<Eigen::Vector2d> coords

Baricentric coordinates of the closest point on the triangle

Returns:

The relative velocity of the point to the triangle

Relative Velocity as Multiplier Matricies

MatrixMax<double, 3, 6> ipc::point_point_relative_velocity_jacobian(
    
const int dim);

Compute du/dx where u is the relative velocity of two points.

Parameters:
const int dim

Dimension (2 or 3)

Returns:

The relative velocity Jacobian du/dx

MatrixMax<double, 3, 9> ipc::point_edge_relative_velocity_jacobian(
    
const int dimconst double alpha);

Compute du/dx where u is the relative velocity of a point and an edge.

Parameters:
const int dim

Dimension (2 or 3)

const double alpha

Parametric coordinate of the closest point on the edge

Returns:

The relative velocity Jacobian du/dx

Eigen::Matrix<double, 3, 12>
ipc::edge_edge_relative_velocity_jacobian(
    
Eigen::ConstRef<Eigen::Vector2d> coords);

Compute du/dx where u is the relative velocity of two edges.

Parameters:
dim

Dimension (2 or 3)

Eigen::ConstRef<Eigen::Vector2d> coords

Two parametric coordinates of the closest points on the edges

Returns:

The relative velocity Jacobian du/dx

Eigen::Matrix<double, 3, 12>
ipc::point_triangle_relative_velocity_jacobian(
    
Eigen::ConstRef<Eigen::Vector2d> coords);

Compute du/dx where u is the relative velocity of a point and a triangle.

Parameters:
Eigen::ConstRef<Eigen::Vector2d> coords

Barycentric coordinates of the closest point on the triangle

Returns:

The relative velocity Jacobian du/dx

Relative Velocity Matrix Jacobians

VectorMax<double, 18> ipc::point_point_relative_velocity_dx_dbeta(
    
const int dim);

Compute d²u/dxdβ where u is the relative velocity of two points.

Parameters:
const int dim

Dimension (2 or 3)

Returns:

The vectorized tensor of d²u/dxdβ

VectorMax<double, 27> ipc::point_edge_relative_velocity_dx_dbeta(
    
const int dimconst double alpha);

Compute d²u/dxdα where u is the relative velocity of a point and an edge.

Parameters:
const int dim

Dimension (2 or 3)

const double alpha

Parametric coordinate of the closest point on the edge

Returns:

The vectorized tensor of d²u/dxdα

Eigen::Matrix<double, 36, 2>
ipc::edge_edge_relative_velocity_dx_dbeta(
    
Eigen::ConstRef<Eigen::Vector2d> coords);

Compute d²u/dxdβ where u is the relative velocity of two edges.

Parameters:
Eigen::ConstRef<Eigen::Vector2d> coords

Two parametric coordinates of the closest points on the edges

Returns:

The vectorized tensor of d²u/dxdβ

Eigen::Matrix<double, 36, 2>
ipc::point_triangle_relative_velocity_dx_dbeta(
    
Eigen::ConstRef<Eigen::Vector2d> coords);

Compute d²u/dxdβ where u is the relative velocity of a point and a triangle.

Parameters:
Eigen::ConstRef<Eigen::Vector2d> coords

Baricentric coordinates of the closest point on the triangle

Returns:

The vectorized tensor of d²u/dxdβ

Closet Points

double ipc::point_edge_closest_point(Eigen::ConstRef<VectorMax3d> p,
    
Eigen::ConstRef<VectorMax3d> e0,
    
Eigen::ConstRef<VectorMax3d> e1);

Compute the baricentric coordinate of the closest point on the edge.

Parameters:
Eigen::ConstRef<VectorMax3d> p

Point

Eigen::ConstRef<VectorMax3d> e0

First edge point

Eigen::ConstRef<VectorMax3d> e1

Second edge point

Returns:

barycentric coordinates of the closest point

Eigen::Vector2d ipc::edge_edge_closest_point(
    
Eigen::ConstRef<Eigen::Vector3d> ea0,
    
Eigen::ConstRef<Eigen::Vector3d> ea1,
    
Eigen::ConstRef<Eigen::Vector3d> eb0,
    
Eigen::ConstRef<Eigen::Vector3d> eb1);

Compute the barycentric coordinates of the closest points between two edges.

Parameters:
Eigen::ConstRef<Eigen::Vector3d> ea0

First point of the first edge

Eigen::ConstRef<Eigen::Vector3d> ea1

Second point of the first edge

Eigen::ConstRef<Eigen::Vector3d> eb0

First point of the second edge

Eigen::ConstRef<Eigen::Vector3d> eb1

Second point of the second edge

Returns:

Barycentric coordinates of the closest points

Eigen::Vector2d ipc::point_triangle_closest_point(
    
Eigen::ConstRef<Eigen::Vector3d> p,
    
Eigen::ConstRef<Eigen::Vector3d> t0,
    
Eigen::ConstRef<Eigen::Vector3d> t1,
    
Eigen::ConstRef<Eigen::Vector3d> t2);

Compute the barycentric coordinates of the closest point on the triangle.

Parameters:
Eigen::ConstRef<Eigen::Vector3d> p

Point

Eigen::ConstRef<Eigen::Vector3d> t0

Triangle’s first vertex

Eigen::ConstRef<Eigen::Vector3d> t1

Triangle’s second vertex

Eigen::ConstRef<Eigen::Vector3d> t2

Triangle’s third vertex

Returns:

Barycentric coordinates of the closest point

Closet Points Jacobians

VectorMax9d ipc::point_edge_closest_point_jacobian(
    
Eigen::ConstRef<VectorMax3d> pEigen::ConstRef<VectorMax3d> e0,
    
Eigen::ConstRef<VectorMax3d> e1);

Compute the Jacobian of the closest point on the edge.

Parameters:
Eigen::ConstRef<VectorMax3d> p

Point

Eigen::ConstRef<VectorMax3d> e0

First edge point

Eigen::ConstRef<VectorMax3d> e1

Second edge point

Returns:

Jacobian of the closest point

Eigen::Matrix<double, 2, 12> ipc::edge_edge_closest_point_jacobian(
    
Eigen::ConstRef<Eigen::Vector3d> ea0,
    
Eigen::ConstRef<Eigen::Vector3d> ea1,
    
Eigen::ConstRef<Eigen::Vector3d> eb0,
    
Eigen::ConstRef<Eigen::Vector3d> eb1);

Compute the Jacobian of the closest points between two edges.

Parameters:
Eigen::ConstRef<Eigen::Vector3d> ea0

First point of the first edge

Eigen::ConstRef<Eigen::Vector3d> ea1

Second point of the first edge

Eigen::ConstRef<Eigen::Vector3d> eb0

First point of the second edge

Eigen::ConstRef<Eigen::Vector3d> eb1

Second point of the second edge

Returns:

Jacobian of the closest points

Eigen::Matrix<double, 2, 12>
ipc::point_triangle_closest_point_jacobian(
    
Eigen::ConstRef<Eigen::Vector3d> p,
    
Eigen::ConstRef<Eigen::Vector3d> t0,
    
Eigen::ConstRef<Eigen::Vector3d> t1,
    
Eigen::ConstRef<Eigen::Vector3d> t2);

Compute the Jacobian of the closest point on the triangle.

Parameters:
Eigen::ConstRef<Eigen::Vector3d> p

Point

Eigen::ConstRef<Eigen::Vector3d> t0

Triangle’s first vertex

Eigen::ConstRef<Eigen::Vector3d> t1

Triangle’s second vertex

Eigen::ConstRef<Eigen::Vector3d> t2

Triangle’s third vertex

Returns:

Jacobian of the closest point