Continuous Collision Detection

bool ipc::is_step_collision_free(const CollisionMeshmesh,
    
const Eigen::MatrixXdvertices_t0,
    
const Eigen::MatrixXdvertices_t1,
    
const BroadPhaseMethod broad_phase_method
    
= DEFAULT_BROAD_PHASE_METHOD
,
    
const double min_distance = 0.0,
    
const double tolerance = DEFAULT_CCD_TOLERANCE,
    
const long max_iterations = DEFAULT_CCD_MAX_ITERATIONS);

Determine if the step is collision free.

Note

Assumes the trajectory is linear.

Parameters:
const CollisionMesh &mesh

The collision mesh.

const Eigen::MatrixXd &vertices_t0

Surface vertex vertices at start as rows of a matrix.

const Eigen::MatrixXd &vertices_t1

Surface vertex vertices at end as rows of a matrix.

const BroadPhaseMethod broad_phase_method = DEFAULT_BROAD_PHASE_METHOD

The broad phase method to use.

const double min_distance = 0.0

The minimum distance allowable between any two elements.

const double tolerance = DEFAULT_CCD_TOLERANCE

The tolerance for the CCD algorithm.

const long max_iterations = DEFAULT_CCD_MAX_ITERATIONS

The maximum number of iterations for the CCD algorithm.

Returns:

True if any collisions occur.

double ipc::compute_collision_free_stepsize(
    
const CollisionMeshmeshconst Eigen::MatrixXdvertices_t0,
    
const Eigen::MatrixXdvertices_t1,
    
const BroadPhaseMethod broad_phase_method
    
= DEFAULT_BROAD_PHASE_METHOD
,
    
const double min_distance = 0.0,
    
const double tolerance = DEFAULT_CCD_TOLERANCE,
    
const long max_iterations = DEFAULT_CCD_MAX_ITERATIONS);

Computes a maximal step size that is collision free.

Note

Assumes the trajectory is linear.

Parameters:
const CollisionMesh &mesh

The collision mesh.

const Eigen::MatrixXd &vertices_t0

Vertex vertices at start as rows of a matrix. Assumes vertices_t0 is intersection free.

const Eigen::MatrixXd &vertices_t1

Surface vertex vertices at end as rows of a matrix.

const BroadPhaseMethod broad_phase_method = DEFAULT_BROAD_PHASE_METHOD

The broad phase method to use.

const double min_distance = 0.0

The minimum distance allowable between any two elements.

const double tolerance = DEFAULT_CCD_TOLERANCE

The tolerance for the CCD algorithm.

const long max_iterations = DEFAULT_CCD_MAX_ITERATIONS

The maximum number of iterations for the CCD algorithm.

Returns:

A step-size \(\in [0, 1]\) that is collision free. A value of 1.0 if a full step and 0.0 is no step.

static constexpr double ipc::DEFAULT_CCD_TOLERANCE = 1e-6;

The default tolerance used with Tight-Inclusion CCD.

static constexpr long ipc::DEFAULT_CCD_MAX_ITERATIONS = 10'000'000l;

The default maximum number of iterations used with Tight-Inclusion CCD.

static constexpr double ipc::DEFAULT_CCD_CONSERVATIVE_RESCALING
   
 = 0.8;

The default conservative rescaling value used to avoid taking steps exactly to impact.

bool ipc::point_point_ccd(const Eigen::Vector3dp0_t0,
    
const Eigen::Vector3dp1_t0const Eigen::Vector3dp0_t1,
    
const Eigen::Vector3dp1_t1double& toi,
    
const double min_distanceconst double tmax,
    
const double toleranceconst long max_iterations,
    
const double conservative_rescaling);
bool ipc::point_edge_ccd(const VectorMax3dp_t0,
    
const VectorMax3de0_t0const VectorMax3de1_t0,
    
const VectorMax3dp_t1const VectorMax3de0_t1,
    
const VectorMax3de1_t1double& toi,
    
const double min_distanceconst double tmax,
    
const double toleranceconst long max_iterations,
    
const double conservative_rescaling);
bool ipc::edge_edge_ccd(const Eigen::Vector3dea0_t0,
    
const Eigen::Vector3dea1_t0const Eigen::Vector3deb0_t0,
    
const Eigen::Vector3deb1_t0const Eigen::Vector3dea0_t1,
    
const Eigen::Vector3dea1_t1const Eigen::Vector3deb0_t1,
    
const Eigen::Vector3deb1_t1double& toi,
    
const double min_distanceconst double tmax,
    
const double toleranceconst long max_iterations,
    
const double conservative_rescaling);
bool ipc::point_triangle_ccd(const Eigen::Vector3dp_t0,
    
const Eigen::Vector3dt0_t0const Eigen::Vector3dt1_t0,
    
const Eigen::Vector3dt2_t0const Eigen::Vector3dp_t1,
    
const Eigen::Vector3dt0_t1const Eigen::Vector3dt1_t1,
    
const Eigen::Vector3dt2_t1double& toi,
    
const double min_distanceconst double tmax,
    
const double toleranceconst long max_iterations,
    
const double conservative_rescaling);