Collision Constraints¶
-
struct Constraints¶
Public Functions¶
-
void build(const CollisionMesh &mesh, const Eigen::MatrixXd &V, const double dhat, const double dmin = 0, const BroadPhaseMethod method = BroadPhaseMethod::HASH_GRID)¶
Construct a set of constraints used to compute the barrier potential.
- Parameters:¶
- const CollisionMesh &mesh¶
The collision mesh.
- const Eigen::MatrixXd &V¶
Vertices of the collision mesh.
- const double dhat¶
The activation distance of the barrier.
- const double dmin = 0¶
Minimum distance.
- const BroadPhaseMethod method = BroadPhaseMethod::HASH_GRID¶
Broad-phase method to use.
-
void build(const Candidates &candidates, const CollisionMesh &mesh, const Eigen::MatrixXd &V, const double dhat, const double dmin = 0)¶
Construct a set of constraints used to compute the barrier potential.
- Parameters:¶
- const Candidates &candidates¶
Distance candidates from which the constraint set is built.
- const CollisionMesh &mesh¶
The collision mesh.
- const Eigen::MatrixXd &V¶
Vertices of the collision mesh.
- const double dhat¶
The activation distance of the barrier.
- const double dmin = 0¶
Minimum distance.
-
size_t size() const¶
-
bool empty() const¶
-
void clear()¶
-
CollisionConstraint &operator[](size_t idx)¶
-
const CollisionConstraint &operator[](size_t idx) const¶
Public Members¶
-
std::vector<VertexVertexConstraint> vv_constraints¶
-
std::vector<EdgeVertexConstraint> ev_constraints¶
-
std::vector<EdgeEdgeConstraint> ee_constraints¶
-
std::vector<FaceVertexConstraint> fv_constraints¶
-
std::vector<PlaneVertexConstraint> pv_constraints¶
-
bool use_convergent_formulation = false¶
-
bool compute_shape_derivatives = false¶
-
struct Builder¶
Collaboration diagram for ipc::Constraints::Builder:
Public Members¶
-
unordered_map<VertexVertexConstraint, long> vv_to_index¶
-
unordered_map<EdgeVertexConstraint, long> ev_to_index¶
-
Constraints constraint_set¶
-
unordered_map<VertexVertexConstraint, long> vv_to_index¶
-
void build(const CollisionMesh &mesh, const Eigen::MatrixXd &V, const double dhat, const double dmin = 0, const BroadPhaseMethod method = BroadPhaseMethod::HASH_GRID)¶
-
struct CollisionConstraint¶
Inheritance diagram for ipc::CollisionConstraint:
Subclassed by ipc::EdgeEdgeConstraint, ipc::EdgeVertexConstraint, ipc::FaceVertexConstraint, ipc::PlaneVertexConstraint, ipc::VertexVertexConstraint
Public Functions¶
-
inline virtual ~CollisionConstraint()¶
-
virtual int num_vertices() const = 0¶
-
virtual std::array<long, 4> vertex_indices(const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const = 0¶
Get the indices of the vertices.
-
virtual double compute_distance(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const = 0¶
-
virtual VectorMax12d compute_distance_gradient(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const = 0¶
-
virtual MatrixMax12d compute_distance_hessian(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const = 0¶
-
virtual double compute_potential(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F, const double dhat) const¶
-
inline virtual ~CollisionConstraint()¶
-
struct VertexVertexConstraint : public ipc::VertexVertexCandidate, public ipc::CollisionConstraint¶
Inheritance diagram for ipc::VertexVertexConstraint:
Collaboration diagram for ipc::VertexVertexConstraint:
Public Functions¶
-
inline VertexVertexConstraint(const VertexVertexCandidate &candidate)¶
-
inline virtual int num_vertices() const override¶
-
inline virtual std::array<long, 4> vertex_indices(const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
Get the indices of the vertices.
-
inline virtual double compute_distance(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
inline virtual VectorMax12d compute_distance_gradient(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
inline virtual MatrixMax12d compute_distance_hessian(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
VertexVertexCandidate(long vertex0_index, long vertex1_index)¶
-
inline VertexVertexConstraint(const VertexVertexCandidate &candidate)¶
-
struct EdgeVertexConstraint : public ipc::EdgeVertexCandidate, public ipc::CollisionConstraint¶
Inheritance diagram for ipc::EdgeVertexConstraint:
Collaboration diagram for ipc::EdgeVertexConstraint:
Public Functions¶
-
inline EdgeVertexConstraint(const EdgeVertexCandidate &candidate)¶
-
inline virtual int num_vertices() const override¶
-
inline virtual std::array<long, 4> vertex_indices(const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
Get the indices of the vertices.
-
inline virtual double compute_distance(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
inline virtual VectorMax12d compute_distance_gradient(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
inline virtual MatrixMax12d compute_distance_hessian(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
EdgeVertexCandidate(long edge_index, long vertex_index)¶
-
inline EdgeVertexConstraint(const EdgeVertexCandidate &candidate)¶
-
struct EdgeEdgeConstraint : public ipc::EdgeEdgeCandidate, public ipc::CollisionConstraint¶
Inheritance diagram for ipc::EdgeEdgeConstraint:
Collaboration diagram for ipc::EdgeEdgeConstraint:
Public Functions¶
-
EdgeEdgeConstraint(long edge0_index, long edge1_index, double eps_x)¶
-
EdgeEdgeConstraint(const EdgeEdgeCandidate &candidate, double eps_x)¶
-
inline virtual int num_vertices() const override¶
-
inline virtual std::array<long, 4> vertex_indices(const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
Get the indices of the vertices.
-
inline virtual double compute_distance(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
inline virtual VectorMax12d compute_distance_gradient(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
inline virtual MatrixMax12d compute_distance_hessian(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
virtual double compute_potential(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F, const double dhat) const override¶
-
EdgeEdgeConstraint(long edge0_index, long edge1_index, double eps_x)¶
-
struct FaceVertexConstraint : public ipc::FaceVertexCandidate, public ipc::CollisionConstraint¶
Inheritance diagram for ipc::FaceVertexConstraint:
Collaboration diagram for ipc::FaceVertexConstraint:
Public Functions¶
-
inline FaceVertexConstraint(const FaceVertexCandidate &candidate)¶
-
inline virtual int num_vertices() const override¶
-
inline virtual std::array<long, 4> vertex_indices(const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
Get the indices of the vertices.
-
inline virtual double compute_distance(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
inline virtual VectorMax12d compute_distance_gradient(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
inline virtual MatrixMax12d compute_distance_hessian(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
FaceVertexCandidate(long face_index, long vertex_index)¶
-
inline FaceVertexConstraint(const FaceVertexCandidate &candidate)¶
-
struct PlaneVertexConstraint : public ipc::CollisionConstraint¶
Inheritance diagram for ipc::PlaneVertexConstraint:
Collaboration diagram for ipc::PlaneVertexConstraint:
Public Functions¶
-
PlaneVertexConstraint(const VectorMax3d &plane_origin, const VectorMax3d &plane_normal, const long vertex_index)¶
-
inline virtual int num_vertices() const override¶
-
inline virtual std::array<long, 4> vertex_indices(const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
Get the indices of the vertices.
-
virtual double compute_distance(const Eigen::MatrixXd &V, const Eigen::MatrixXi &E, const Eigen::MatrixXi &F) const override¶
-
PlaneVertexConstraint(const VectorMax3d &plane_origin, const VectorMax3d &plane_normal, const long vertex_index)¶