3#include <igl/predicates/predicates.h>
4#include <wmtk/Types.hpp>
6namespace wmtk::utils::predicates {
11inline bool is_degenerate(
const Vector2d& v0,
const Vector2d& v1,
const Vector2d& v2)
13 return igl::predicates::orient2d(v0, v1, v2) == igl::predicates::Orientation::COLLINEAR;
19inline bool is_degenerate(
const Vector3d& v0,
const Vector3d& v1,
const Vector3d& v2)
21 for (
int dim = 0; dim < 3; ++dim) {
22 const Vector2d p0(v0[dim], v0[(dim + 1) % 3]);
23 const Vector2d p1(v1[dim], v1[(dim + 1) % 3]);
24 const Vector2d p2(v2[dim], v2[(dim + 1) % 3]);
26 if (!is_degenerate(p0, p1, p2)) {
37is_degenerate(
const Vector3d& v0,
const Vector3d& v1,
const Vector3d& v2,
const Vector3d& v3)
39 return igl::predicates::orient3d(v0, v1, v2, v3) == igl::predicates::Orientation::COPLANAR;