Continuous Collision Detection¶
-
bool ipc::is_step_collision_free(const CollisionMesh& mesh,
const Eigen::MatrixXd& vertices_t0,
const Eigen::MatrixXd& vertices_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 CollisionMesh& mesh, const Eigen::MatrixXd& vertices_t0,
const Eigen::MatrixXd& vertices_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::Vector3d& p0_t0,
const Eigen::Vector3d& p1_t0, const Eigen::Vector3d& p0_t1,
const Eigen::Vector3d& p1_t1, double& toi,
const double min_distance, const double tmax,
const double tolerance, const long max_iterations,
const double conservative_rescaling);¶
-
bool ipc::point_edge_ccd(const VectorMax3d& p_t0,
const VectorMax3d& e0_t0, const VectorMax3d& e1_t0,
const VectorMax3d& p_t1, const VectorMax3d& e0_t1,
const VectorMax3d& e1_t1, double& toi,
const double min_distance, const double tmax,
const double tolerance, const long max_iterations,
const double conservative_rescaling);¶
-
bool ipc::edge_edge_ccd(const Eigen::Vector3d& ea0_t0,
const Eigen::Vector3d& ea1_t0, const Eigen::Vector3d& eb0_t0,
const Eigen::Vector3d& eb1_t0, const Eigen::Vector3d& ea0_t1,
const Eigen::Vector3d& ea1_t1, const Eigen::Vector3d& eb0_t1,
const Eigen::Vector3d& eb1_t1, double& toi,
const double min_distance, const double tmax,
const double tolerance, const long max_iterations,
const double conservative_rescaling);¶
-
bool ipc::point_triangle_ccd(const Eigen::Vector3d& p_t0,
const Eigen::Vector3d& t0_t0, const Eigen::Vector3d& t1_t0,
const Eigen::Vector3d& t2_t0, const Eigen::Vector3d& p_t1,
const Eigen::Vector3d& t0_t1, const Eigen::Vector3d& t1_t1,
const Eigen::Vector3d& t2_t1, double& toi,
const double min_distance, const double tmax,
const double tolerance, const long max_iterations,
const double conservative_rescaling);¶