Distance

Distance Type

enum class ipc::PointEdgeDistanceType

Closest pair between a point and edge.

Values:

enumerator P_E0

The point is closest to edge vertex zero.

enumerator P_E1

The point is closest to edge vertex one.

enumerator P_E

The point is closest to the interior of the edge.

enumerator AUTO

Automatically determine the closest pair.

enum class ipc::EdgeEdgeDistanceType

Closest pair between two edges.

Values:

enumerator EA0_EB0

The edges are closest at vertex 0 of edge A and 0 of edge B.

enumerator EA0_EB1

The edges are closest at vertex 0 of edge A and 1 of edge B.

enumerator EA1_EB0

The edges are closest at vertex 1 of edge A and 0 of edge B.

enumerator EA1_EB1

The edges are closest at vertex 1 of edge A and 1 of edge B.

enumerator EA_EB0

The edges are closest at the interior of edge A and vertex 0 of edge B.

enumerator EA_EB1

The edges are closest at the interior of edge A and vertex 1 of edge B.

enumerator EA0_EB

The edges are closest at vertex 0 of edge A and the interior of edge B.

enumerator EA1_EB

The edges are closest at vertex 1 of edge A and the interior of edge B.

enumerator EA_EB

The edges are closest at an interior point of edge A and B.

enumerator AUTO

Automatically determine the closest pair.

enum class ipc::PointTriangleDistanceType

Closest pair between a point and triangle.

Values:

enumerator P_T0

The point is closest to triangle vertex zero.

enumerator P_T1

The point is closest to triangle vertex one.

enumerator P_T2

The point is closest to triangle vertex two.

enumerator P_E0

The point is closest to triangle edge zero (vertex zero to one).

enumerator P_E1

The point is closest to triangle edge one (vertex one to two).

enumerator P_E2

The point is closest to triangle edge two (vertex two to zero).

enumerator P_T

The point is closest to the interior of the triangle.

enumerator AUTO

Automatically determine the closest pair.

template<typename DerivedP, typename DerivedE0, typename DerivedE1>
PointEdgeDistanceType ipc::point_edge_distance_type(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedE0> &e0, const Eigen::MatrixBase<DerivedE1> &e1)

Determine the closest pair between a point and edge.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

The point.

const Eigen::MatrixBase<DerivedE0> &e0

The first vertex of the edge.

const Eigen::MatrixBase<DerivedE1> &e1

The second vertex of the edge.

Returns:

The distance type of the point-edge pair.

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1>
EdgeEdgeDistanceType ipc::edge_edge_distance_type(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1)

Determine the closest pair between two edges.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

The first vertex of the first edge.

const Eigen::MatrixBase<DerivedEA1> &ea1

The second vertex of the first edge.

const Eigen::MatrixBase<DerivedEB0> &eb0

The first vertex of the second edge.

const Eigen::MatrixBase<DerivedEB1> &eb1

The second vertex of the second edge.

Returns:

The distance type of the edge-edge pair.

template<typename DerivedP, typename DerivedT0, typename DerivedT1, typename DerivedT2>
PointTriangleDistanceType ipc::point_triangle_distance_type(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedT0> &t0, const Eigen::MatrixBase<DerivedT1> &t1, const Eigen::MatrixBase<DerivedT2> &t2)

Determine the closest pair between a point and triangle.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

The point.

const Eigen::MatrixBase<DerivedT0> &t0

The first vertex of the triangle.

const Eigen::MatrixBase<DerivedT1> &t1

The second vertex of the triangle.

const Eigen::MatrixBase<DerivedT2> &t2

The third vertex of the triangle.

Returns:

The distance type of the point-triangle pair.

Edge-Edge Mollifier

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1>
double ipc::edge_edge_mollifier_threshold(const Eigen::MatrixBase<DerivedEA0> &ea0_rest, const Eigen::MatrixBase<DerivedEA1> &ea1_rest, const Eigen::MatrixBase<DerivedEB0> &eb0_rest, const Eigen::MatrixBase<DerivedEB1> &eb1_rest)

Compute the threshold of the mollifier edge-edge distance.

This values is computed based on the edges at rest length.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0_rest

The rest position of the first vertex of the first edge.

const Eigen::MatrixBase<DerivedEA1> &ea1_rest

The rest position of the second vertex of the first edge.

const Eigen::MatrixBase<DerivedEB0> &eb0_rest

The rest position of the first vertex of the second edge.

const Eigen::MatrixBase<DerivedEB1> &eb1_rest

The rest position of the second vertex of the second edge.

Returns:

Threshold for edge-edge mollification.

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1>
auto ipc::edge_edge_cross_squarednorm(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1)

Compute the squared norm of the edge-edge cross product.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

The first vertex of the first edge.

const Eigen::MatrixBase<DerivedEA1> &ea1

The second vertex of the first edge.

const Eigen::MatrixBase<DerivedEB0> &eb0

The first vertex of the second edge.

const Eigen::MatrixBase<DerivedEB1> &eb1

The second vertex of the second edge.

Returns:

The squared norm of the edge-edge cross product.

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1, typename DerivedGrad>
void ipc::edge_edge_cross_squarednorm_gradient(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, Eigen::PlainObjectBase<DerivedGrad> &grad)

Compute the gradient of the squared norm of the edge cross product.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

[in] The first vertex of the first edge.

const Eigen::MatrixBase<DerivedEA1> &ea1

[in] The second vertex of the first edge.

const Eigen::MatrixBase<DerivedEB0> &eb0

[in] The first vertex of the second edge.

const Eigen::MatrixBase<DerivedEB1> &eb1

[in] The second vertex of the second edge.

Eigen::PlainObjectBase<DerivedGrad> &grad

[out] The gradient of the squared norm of the edge cross product wrt ea0, ea1, eb0, and eb1.

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1, typename DerivedHess>
void ipc::edge_edge_cross_squarednorm_hessian(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, Eigen::PlainObjectBase<DerivedHess> &hess)

Compute the hessian of the squared norm of the edge cross product.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

The first vertex of the first edge.

const Eigen::MatrixBase<DerivedEA1> &ea1

The second vertex of the first edge.

const Eigen::MatrixBase<DerivedEB0> &eb0

The first vertex of the second edge.

const Eigen::MatrixBase<DerivedEB1> &eb1

The second vertex of the second edge.

Eigen::PlainObjectBase<DerivedHess> &hess

[out] The hessian of the squared norm of the edge cross product wrt ea0, ea1, eb0, and eb1.

Returns:

The squared norm of the edge-edge cross product.

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1>
inline auto ipc::edge_edge_mollifier(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, const double eps_x)

Compute a mollifier for the edge-edge distance.

This helps smooth the non-smoothness at close to parallel edges.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

The first vertex of the first edge.

const Eigen::MatrixBase<DerivedEA1> &ea1

The second vertex of the first edge.

const Eigen::MatrixBase<DerivedEB0> &eb0

The first vertex of the second edge.

const Eigen::MatrixBase<DerivedEB1> &eb1

The second vertex of the second edge.

const double eps_x

Mollifier activation threshold.

Returns:

The mollifier coefficient to premultiply the edge-edge distance.

template<typename T>
T ipc::edge_edge_mollifier(const T &x, double eps_x)

Mollifier function for edge-edge distance.

Parameters:
const T &x

Squared norm of the edge-edge cross product.

double eps_x

Mollifier activation threshold.

Returns:

The mollifier coefficient to premultiply the edge-edge distance.

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1, typename DerivedGrad>
void ipc::edge_edge_mollifier_gradient(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, const double eps_x, Eigen::PlainObjectBase<DerivedGrad> &grad)

Compute the gradient of the mollifier for the edge-edge distance.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

[in] The first vertex of the first edge.

const Eigen::MatrixBase<DerivedEA1> &ea1

[in] The second vertex of the first edge.

const Eigen::MatrixBase<DerivedEB0> &eb0

[in] The first vertex of the second edge.

const Eigen::MatrixBase<DerivedEB1> &eb1

[in] The second vertex of the second edge.

in
const double eps_x

Mollifier activation threshold.

Eigen::PlainObjectBase<DerivedGrad> &grad

[out] The gradient of the mollifier.

template<typename T>
T ipc::edge_edge_mollifier_gradient(const T &x, double eps_x)

The gradient of the mollifier function for edge-edge distance.

Parameters:
const T &x

Squared norm of the edge-edge cross product.

double eps_x

Mollifier activation threshold.

Returns:

The gradient of the mollifier function for edge-edge distance wrt x.

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1, typename DerivedHess>
void ipc::edge_edge_mollifier_hessian(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, const double eps_x, Eigen::PlainObjectBase<DerivedHess> &hess)

Compute the hessian of the mollifier for the edge-edge distance.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

[in] The first vertex of the first edge.

const Eigen::MatrixBase<DerivedEA1> &ea1

[in] The second vertex of the first edge.

const Eigen::MatrixBase<DerivedEB0> &eb0

[in] The first vertex of the second edge.

const Eigen::MatrixBase<DerivedEB1> &eb1

[in] The second vertex of the second edge.

in
const double eps_x

Mollifier activation threshold.

Eigen::PlainObjectBase<DerivedHess> &hess

[out] The hessian of the mollifier.

template<typename T>
T ipc::edge_edge_mollifier_hessian(const T &x, double eps_x)

The hessian of the mollifier function for edge-edge distance.

Parameters:
const T &x

Squared norm of the edge-edge cross product.

double eps_x

Mollifier activation threshold.

Returns:

The hessian of the mollifier function for edge-edge distance wrt x.

Edge-Edge

Warning

doxygenfunction: Unable to resolve function “edge_edge_distance” with arguments (const Eigen::MatrixBase<DerivedEA0>&, const Eigen::MatrixBase<DerivedEA1>&, const Eigen::MatrixBase<DerivedEB0>&, const Eigen::MatrixBase<DerivedEB1>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1> auto edge_edge_distance(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, const EdgeEdgeDistanceType dtype = EdgeEdgeDistanceType::AUTO)
template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1>
auto ipc::edge_edge_distance(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, const EdgeEdgeDistanceType dtype = EdgeEdgeDistanceType::AUTO)

Compute the distance between a two lines segments in 3D.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

The first vertex of the first edge.

const Eigen::MatrixBase<DerivedEA1> &ea1

The second vertex of the first edge.

const Eigen::MatrixBase<DerivedEB0> &eb0

The first vertex of the second edge.

const Eigen::MatrixBase<DerivedEB1> &eb1

The second vertex of the second edge.

const EdgeEdgeDistanceType dtype = EdgeEdgeDistanceType::AUTO

The point edge distance type to compute.

Returns:

The distance between the two edges.

Warning

doxygenfunction: Unable to resolve function “edge_edge_distance_gradient” with arguments (const Eigen::MatrixBase<DerivedEA0>&, const Eigen::MatrixBase<DerivedEA1>&, const Eigen::MatrixBase<DerivedEB0>&, const Eigen::MatrixBase<DerivedEB1>&, Eigen::PlainObjectBase<DerivedGrad>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1, typename DerivedGrad> void edge_edge_distance_gradient(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, Eigen::PlainObjectBase<DerivedGrad> &grad, const EdgeEdgeDistanceType dtype = EdgeEdgeDistanceType::AUTO)

Warning

doxygenfunction: Unable to resolve function “edge_edge_distance_gradient” with arguments (const Eigen::MatrixBase<DerivedEA0>&, const Eigen::MatrixBase<DerivedEA1>&, const Eigen::MatrixBase<DerivedEB0>&, const Eigen::MatrixBase<DerivedEB1>&, const EdgeEdgeDistanceType, Eigen::PlainObjectBase<DerivedGrad>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1, typename DerivedGrad> void edge_edge_distance_gradient(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, Eigen::PlainObjectBase<DerivedGrad> &grad, const EdgeEdgeDistanceType dtype = EdgeEdgeDistanceType::AUTO)

Warning

doxygenfunction: Unable to resolve function “edge_edge_distance_hessian” with arguments (const Eigen::MatrixBase<DerivedEA0>&, const Eigen::MatrixBase<DerivedEA1>&, const Eigen::MatrixBase<DerivedEB0>&, const Eigen::MatrixBase<DerivedEB1>&, Eigen::PlainObjectBase<DerivedHess>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1, typename DerivedHess> void edge_edge_distance_hessian(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, Eigen::PlainObjectBase<DerivedHess> &hess, const EdgeEdgeDistanceType dtype = EdgeEdgeDistanceType::AUTO)

Warning

doxygenfunction: Unable to resolve function “edge_edge_distance_hessian” with arguments (const Eigen::MatrixBase<DerivedEA0>&, const Eigen::MatrixBase<DerivedEA1>&, const Eigen::MatrixBase<DerivedEB0>&, const Eigen::MatrixBase<DerivedEB1>&, const EdgeEdgeDistanceType, Eigen::PlainObjectBase<DerivedHess>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1, typename DerivedHess> void edge_edge_distance_hessian(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, Eigen::PlainObjectBase<DerivedHess> &hess, const EdgeEdgeDistanceType dtype = EdgeEdgeDistanceType::AUTO)

Line-Line

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1>
auto ipc::line_line_distance(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1)

Compute the distance between a two infinite lines in 3D.

Note

The distance is actually squared distance.

Warning

If the lines are parallel this function returns a distance of zero.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

The first vertex of the edge defining the first line.

const Eigen::MatrixBase<DerivedEA1> &ea1

The second vertex of the edge defining the first line.

const Eigen::MatrixBase<DerivedEA0> &ea0

The first vertex of the edge defining the second line.

const Eigen::MatrixBase<DerivedEA1> &ea1

The second vertex of the edge defining the second line.

Returns:

The distance between the two lines.

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1, typename DerivedGrad>
void ipc::line_line_distance_gradient(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, Eigen::PlainObjectBase<DerivedGrad> &grad)

Compute the gradient of the distance between a two lines in 3D.

Note

The distance is actually squared distance.

Warning

If the lines are parallel this function returns a distance of zero.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

[in] The first vertex of the edge defining the first line.

const Eigen::MatrixBase<DerivedEA1> &ea1

[in] The second vertex of the edge defining the first line.

const Eigen::MatrixBase<DerivedEA0> &ea0

[in] The first vertex of the edge defining the second line.

const Eigen::MatrixBase<DerivedEA1> &ea1

[in] The second vertex of the edge defining the second line.

Eigen::PlainObjectBase<DerivedGrad> &grad

[out] The gradient of the distance wrt ea0, ea1, eb0, and eb1.

template<typename DerivedEA0, typename DerivedEA1, typename DerivedEB0, typename DerivedEB1, typename DerivedHess>
void ipc::line_line_distance_hessian(const Eigen::MatrixBase<DerivedEA0> &ea0, const Eigen::MatrixBase<DerivedEA1> &ea1, const Eigen::MatrixBase<DerivedEB0> &eb0, const Eigen::MatrixBase<DerivedEB1> &eb1, Eigen::PlainObjectBase<DerivedHess> &hess)

Compute the hessian of the distance between a two lines in 3D.

Note

The distance is actually squared distance.

Warning

If the lines are parallel this function returns a distance of zero.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

[in] The first vertex of the edge defining the first line.

const Eigen::MatrixBase<DerivedEA1> &ea1

[in] The second vertex of the edge defining the first line.

const Eigen::MatrixBase<DerivedEA0> &ea0

[in] The first vertex of the edge defining the second line.

const Eigen::MatrixBase<DerivedEA1> &ea1

[in] The second vertex of the edge defining the second line.

Eigen::PlainObjectBase<DerivedHess> &hess

[out] The hessian of the distance wrt ea0, ea1, eb0, and eb1.

Point-Edge

Warning

doxygenfunction: Unable to resolve function “point_edge_distance” with arguments (const Eigen::MatrixBase<DerivedP>&, const Eigen::MatrixBase<DerivedE0>&, const Eigen::MatrixBase<DerivedE1>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedP, typename DerivedE0, typename DerivedE1> auto point_edge_distance(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedE0> &e0, const Eigen::MatrixBase<DerivedE1> &e1, const PointEdgeDistanceType dtype = PointEdgeDistanceType::AUTO)
template<typename DerivedP, typename DerivedE0, typename DerivedE1>
auto ipc::point_edge_distance(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedE0> &e0, const Eigen::MatrixBase<DerivedE1> &e1, const PointEdgeDistanceType dtype = PointEdgeDistanceType::AUTO)

Compute the distance between a point and edge in 2D or 3D.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

[in] The point.

const Eigen::MatrixBase<DerivedE0> &e0

[in] The first vertex of the edge.

const Eigen::MatrixBase<DerivedE1> &e1

[in] The second vertex of the edge.

const PointEdgeDistanceType dtype = PointEdgeDistanceType::AUTO

[in] The point edge distance type to compute.

Returns:

The distance between the point and edge.

Warning

doxygenfunction: Unable to resolve function “point_edge_distance_gradient” with arguments (const Eigen::MatrixBase<DerivedP>&, const Eigen::MatrixBase<DerivedE0>&, const Eigen::MatrixBase<DerivedE1>&, Eigen::PlainObjectBase<DerivedGrad>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedP, typename DerivedE0, typename DerivedE1, typename DerivedGrad> void point_edge_distance_gradient(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedE0> &e0, const Eigen::MatrixBase<DerivedE1> &e1, Eigen::PlainObjectBase<DerivedGrad> &grad, const PointEdgeDistanceType dtype = PointEdgeDistanceType::AUTO)

Warning

doxygenfunction: Unable to resolve function “point_edge_distance_gradient” with arguments (const Eigen::MatrixBase<DerivedP>&, const Eigen::MatrixBase<DerivedE0>&, const Eigen::MatrixBase<DerivedE1>&, const PointEdgeDistanceType, Eigen::PlainObjectBase<DerivedGrad>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedP, typename DerivedE0, typename DerivedE1, typename DerivedGrad> void point_edge_distance_gradient(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedE0> &e0, const Eigen::MatrixBase<DerivedE1> &e1, Eigen::PlainObjectBase<DerivedGrad> &grad, const PointEdgeDistanceType dtype = PointEdgeDistanceType::AUTO)

Warning

doxygenfunction: Unable to resolve function “point_edge_distance_hessian” with arguments (const Eigen::MatrixBase<DerivedP>&, const Eigen::MatrixBase<DerivedE0>&, const Eigen::MatrixBase<DerivedE1>&, Eigen::PlainObjectBase<DerivedHess>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedP, typename DerivedE0, typename DerivedE1, typename DerivedHess> void point_edge_distance_hessian(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedE0> &e0, const Eigen::MatrixBase<DerivedE1> &e1, Eigen::PlainObjectBase<DerivedHess> &hess, const PointEdgeDistanceType dtype = PointEdgeDistanceType::AUTO)

Warning

doxygenfunction: Unable to resolve function “point_edge_distance_hessian” with arguments (const Eigen::MatrixBase<DerivedP>&, const Eigen::MatrixBase<DerivedE0>&, const Eigen::MatrixBase<DerivedE1>&, const PointEdgeDistanceType, Eigen::PlainObjectBase<DerivedHess>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedP, typename DerivedE0, typename DerivedE1, typename DerivedHess> void point_edge_distance_hessian(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedE0> &e0, const Eigen::MatrixBase<DerivedE1> &e1, Eigen::PlainObjectBase<DerivedHess> &hess, const PointEdgeDistanceType dtype = PointEdgeDistanceType::AUTO)

Point-Line

template<typename DerivedP, typename DerivedE0, typename DerivedE1>
auto ipc::point_line_distance(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedE0> &e0, const Eigen::MatrixBase<DerivedE1> &e1)

Compute the distance between a point and line in 2D or 3D.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

The point.

const Eigen::MatrixBase<DerivedE0> &e0

The first vertex of the edge defining the line.

const Eigen::MatrixBase<DerivedE1> &e1

The second vertex of the edge defining the line.

Returns:

The distance between the point and line.

template<typename DerivedP, typename DerivedE0, typename DerivedE1, typename DerivedGrad>
void ipc::point_line_distance_gradient(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedE0> &e0, const Eigen::MatrixBase<DerivedE1> &e1, Eigen::PlainObjectBase<DerivedGrad> &grad)

Compute the gradient of the distance between a point and line.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

[in] The point.

const Eigen::MatrixBase<DerivedE0> &e0

[in] The first vertex of the edge defining the line.

const Eigen::MatrixBase<DerivedE1> &e1

[in] The second vertex of the edge defining the line.

Eigen::PlainObjectBase<DerivedGrad> &grad

[out] The gradient of the distance wrt p, e0, and e1.

template<typename DerivedP, typename DerivedE0, typename DerivedE1, typename DerivedHess>
void ipc::point_line_distance_hessian(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedE0> &e0, const Eigen::MatrixBase<DerivedE1> &e1, Eigen::PlainObjectBase<DerivedHess> &hess)

Compute the hessian of the distance between a point and line.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

[in] The point.

const Eigen::MatrixBase<DerivedE0> &e0

[in] The first vertex of the edge defining the line.

const Eigen::MatrixBase<DerivedE1> &e1

[in] The second vertex of the edge defining the line.

Eigen::PlainObjectBase<DerivedHess> &hess

[out] The hessian of the distance wrt p, e0, and e1.

Point-Plane

template<typename DerivedP, typename DerivedOrigin, typename DerivedNormal>
auto ipc::point_plane_distance(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedOrigin> &origin, const Eigen::MatrixBase<DerivedNormal> &normal)

Compute the distance between a point and a plane.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

The point.

const Eigen::MatrixBase<DerivedOrigin> &origin

The origin of the plane.

const Eigen::MatrixBase<DerivedNormal> &normal

The normal of the plane.

Returns:

The distance between the point and plane.

template<typename DerivedP, typename DerivedT0, typename DerivedT1, typename DerivedT2>
auto ipc::point_plane_distance(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedT0> &t0, const Eigen::MatrixBase<DerivedT1> &t1, const Eigen::MatrixBase<DerivedT2> &t2)

Compute the distance between a point and a plane.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

The point.

const Eigen::MatrixBase<DerivedT0> &t0

The first vertex of the triangle.

const Eigen::MatrixBase<DerivedT1> &t1

The second vertex of the triangle.

const Eigen::MatrixBase<DerivedT2> &t2

The third vertex of the triangle.

Returns:

The distance between the point and plane.

template<typename DerivedP, typename DerivedOrigin, typename DerivedNormal, typename DerivedGrad>
void ipc::point_plane_distance_gradient(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedOrigin> &origin, const Eigen::MatrixBase<DerivedNormal> &normal, Eigen::PlainObjectBase<DerivedGrad> &grad)

Compute the gradient of the distance between a point and a plane.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

[in] The point.

const Eigen::MatrixBase<DerivedOrigin> &origin

[in] The origin of the plane.

const Eigen::MatrixBase<DerivedNormal> &normal

[in] The normal of the plane.

Eigen::PlainObjectBase<DerivedGrad> &grad

[out] The gradient of the distance wrt p.

template<typename DerivedP, typename DerivedT0, typename DerivedT1, typename DerivedT2, typename DerivedGrad>
void ipc::point_plane_distance_gradient(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedT0> &t0, const Eigen::MatrixBase<DerivedT1> &t1, const Eigen::MatrixBase<DerivedT2> &t2, Eigen::PlainObjectBase<DerivedGrad> &grad)

Compute the gradient of the distance between a point and a plane.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

[in] The point.

const Eigen::MatrixBase<DerivedT0> &t0

[in] The first vertex of the triangle.

const Eigen::MatrixBase<DerivedT1> &t1

[in] The second vertex of the triangle.

const Eigen::MatrixBase<DerivedT2> &t2

[in] The third vertex of the triangle.

Eigen::PlainObjectBase<DerivedGrad> &grad

[out] The gradient of the distance wrt p, t0, t1, and t2.

template<typename DerivedP, typename DerivedOrigin, typename DerivedNormal, typename DerivedHess>
void ipc::point_plane_distance_hessian(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedOrigin> &origin, const Eigen::MatrixBase<DerivedNormal> &normal, Eigen::PlainObjectBase<DerivedHess> &hess)

Compute the hessian of the distance between a point and a plane.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

[in] The point.

const Eigen::MatrixBase<DerivedOrigin> &origin

[in] The origin of the plane.

const Eigen::MatrixBase<DerivedNormal> &normal

[in] The normal of the plane.

Eigen::PlainObjectBase<DerivedHess> &hess

[out] The hessian of the distance wrt p.

template<typename DerivedP, typename DerivedT0, typename DerivedT1, typename DerivedT2, typename DerivedHess>
void ipc::point_plane_distance_hessian(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedT0> &t0, const Eigen::MatrixBase<DerivedT1> &t1, const Eigen::MatrixBase<DerivedT2> &t2, Eigen::PlainObjectBase<DerivedHess> &hess)

Compute the hessian of the distance between a point and a plane.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

[in] The point.

const Eigen::MatrixBase<DerivedT0> &t0

[in] The first vertex of the triangle.

const Eigen::MatrixBase<DerivedT1> &t1

[in] The second vertex of the triangle.

const Eigen::MatrixBase<DerivedT2> &t2

[in] The third vertex of the triangle.

Eigen::PlainObjectBase<DerivedHess> &hess

[out] The hessian of the distance wrt p, t0, t1, and t2.

Point-Point

template<typename DerivedP0, typename DerivedP1>
inline auto ipc::point_point_distance(const Eigen::MatrixBase<DerivedP0> &p0, const Eigen::MatrixBase<DerivedP1> &p1)

Compute the distance between two points.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP0> &p0

[in] The first point.

const Eigen::MatrixBase<DerivedP1> &p1

[in] The second point.

Returns:

The distance between p0 and p1.

template<typename DerivedP0, typename DerivedP1, typename DerivedGrad>
inline void ipc::point_point_distance_gradient(const Eigen::MatrixBase<DerivedP0> &p0, const Eigen::MatrixBase<DerivedP1> &p1, Eigen::PlainObjectBase<DerivedGrad> &grad)

Compute the gradient of the distance between two points.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP0> &p0

[in] The first point.

const Eigen::MatrixBase<DerivedP1> &p1

[in] The second point.

Eigen::PlainObjectBase<DerivedGrad> &grad

[out] The computed gradient.

template<typename DerivedP0, typename DerivedP1, typename DerivedHess>
inline void ipc::point_point_distance_hessian(const Eigen::MatrixBase<DerivedP0> &p0, const Eigen::MatrixBase<DerivedP1> &p1, Eigen::PlainObjectBase<DerivedHess> &hess)

Compute the hessian of the distance between two points.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP0> &p0

[in] The first point.

const Eigen::MatrixBase<DerivedP1> &p1

[in] The second point.

Eigen::PlainObjectBase<DerivedHess> &hess

[out] The computed hessian.

Point-Triangle

Warning

doxygenfunction: Unable to resolve function “point_triangle_distance” with arguments (const Eigen::MatrixBase<DerivedP>&, const Eigen::MatrixBase<DerivedT0>&, const Eigen::MatrixBase<DerivedT1>&, const Eigen::MatrixBase<DerivedT2>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedP, typename DerivedT0, typename DerivedT1, typename DerivedT2> auto point_triangle_distance(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedT0> &t0, const Eigen::MatrixBase<DerivedT1> &t1, const Eigen::MatrixBase<DerivedT2> &t2, const PointTriangleDistanceType dtype = PointTriangleDistanceType::AUTO)
template<typename DerivedP, typename DerivedT0, typename DerivedT1, typename DerivedT2>
auto ipc::point_triangle_distance(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedT0> &t0, const Eigen::MatrixBase<DerivedT1> &t1, const Eigen::MatrixBase<DerivedT2> &t2, const PointTriangleDistanceType dtype = PointTriangleDistanceType::AUTO)

Compute the distance between a points and a triangle.

Note

The distance is actually squared distance.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

The point.

const Eigen::MatrixBase<DerivedT0> &t0

The first vertex of the triangle.

const Eigen::MatrixBase<DerivedT1> &t1

The second vertex of the triangle.

const Eigen::MatrixBase<DerivedT2> &t2

The third vertex of the triangle.

const PointTriangleDistanceType dtype = PointTriangleDistanceType::AUTO

The point-triangle distance type to compute.

Returns:

The distance between the point and triangle.

Warning

doxygenfunction: Unable to resolve function “point_triangle_distance_gradient” with arguments (const Eigen::MatrixBase<DerivedP>&, const Eigen::MatrixBase<DerivedT0>&, const Eigen::MatrixBase<DerivedT1>&, const Eigen::MatrixBase<DerivedT2>&, Eigen::PlainObjectBase<DerivedGrad>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedP, typename DerivedT0, typename DerivedT1, typename DerivedT2, typename DerivedGrad> void point_triangle_distance_gradient(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedT0> &t0, const Eigen::MatrixBase<DerivedT1> &t1, const Eigen::MatrixBase<DerivedT2> &t2, Eigen::PlainObjectBase<DerivedGrad> &grad, const PointTriangleDistanceType dtype = PointTriangleDistanceType::AUTO)

Warning

doxygenfunction: Unable to resolve function “point_triangle_distance_gradient” with arguments (const Eigen::MatrixBase<DerivedP>&, const Eigen::MatrixBase<DerivedT0>&, const Eigen::MatrixBase<DerivedT1>&, const Eigen::MatrixBase<DerivedT2>&, const PointTriangleDistanceType, Eigen::PlainObjectBase<DerivedGrad>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedP, typename DerivedT0, typename DerivedT1, typename DerivedT2, typename DerivedGrad> void point_triangle_distance_gradient(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedT0> &t0, const Eigen::MatrixBase<DerivedT1> &t1, const Eigen::MatrixBase<DerivedT2> &t2, Eigen::PlainObjectBase<DerivedGrad> &grad, const PointTriangleDistanceType dtype = PointTriangleDistanceType::AUTO)

Warning

doxygenfunction: Unable to resolve function “point_triangle_distance_hessian” with arguments (const Eigen::MatrixBase<DerivedP>&, const Eigen::MatrixBase<DerivedT0>&, const Eigen::MatrixBase<DerivedT1>&, const Eigen::MatrixBase<DerivedT2>&, Eigen::PlainObjectBase<DerivedHess>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedP, typename DerivedT0, typename DerivedT1, typename DerivedT2, typename DerivedHess> void point_triangle_distance_hessian(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedT0> &t0, const Eigen::MatrixBase<DerivedT1> &t1, const Eigen::MatrixBase<DerivedT2> &t2, Eigen::PlainObjectBase<DerivedHess> &hess, const PointTriangleDistanceType dtype = PointTriangleDistanceType::AUTO)

Warning

doxygenfunction: Unable to resolve function “point_triangle_distance_hessian” with arguments (const Eigen::MatrixBase<DerivedP>&, const Eigen::MatrixBase<DerivedT0>&, const Eigen::MatrixBase<DerivedT1>&, const Eigen::MatrixBase<DerivedT2>&, const PointTriangleDistanceType, Eigen::PlainObjectBase<DerivedHess>&) in doxygen xml output for project “IPC Toolkit” from directory: ../build/doxyoutput/xml. Potential matches:

- template<typename DerivedP, typename DerivedT0, typename DerivedT1, typename DerivedT2, typename DerivedHess> void point_triangle_distance_hessian(const Eigen::MatrixBase<DerivedP> &p, const Eigen::MatrixBase<DerivedT0> &t0, const Eigen::MatrixBase<DerivedT1> &t1, const Eigen::MatrixBase<DerivedT2> &t2, Eigen::PlainObjectBase<DerivedHess> &hess, const PointTriangleDistanceType dtype = PointTriangleDistanceType::AUTO)

Last update: January 26, 2023