mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-05 19:42:47 +00:00
Ported test_trianglemesh from upstream slic3r, thanks @lordofhyphens
This commit is contained in:
@@ -134,12 +134,30 @@ inline bool is_approx(const Point &p1, const Point &p2, coord_t epsilon = coord_
|
||||
return d.x() < epsilon && d.y() < epsilon;
|
||||
}
|
||||
|
||||
inline bool is_approx(const Vec2f &p1, const Vec2f &p2, float epsilon = float(EPSILON))
|
||||
{
|
||||
Vec2f d = (p2 - p1).cwiseAbs();
|
||||
return d.x() < epsilon && d.y() < epsilon;
|
||||
}
|
||||
|
||||
inline bool is_approx(const Vec2d &p1, const Vec2d &p2, double epsilon = EPSILON)
|
||||
{
|
||||
Vec2d d = (p2 - p1).cwiseAbs();
|
||||
return d.x() < epsilon && d.y() < epsilon;
|
||||
}
|
||||
|
||||
inline bool is_approx(const Vec3f &p1, const Vec3f &p2, float epsilon = float(EPSILON))
|
||||
{
|
||||
Vec3f d = (p2 - p1).cwiseAbs();
|
||||
return d.x() < epsilon && d.y() < epsilon && d.z() < epsilon;
|
||||
}
|
||||
|
||||
inline bool is_approx(const Vec3d &p1, const Vec3d &p2, double epsilon = EPSILON)
|
||||
{
|
||||
Vec3d d = (p2 - p1).cwiseAbs();
|
||||
return d.x() < epsilon && d.y() < epsilon && d.z() < epsilon;
|
||||
}
|
||||
|
||||
namespace int128 {
|
||||
// Exact orientation predicate,
|
||||
// returns +1: CCW, 0: collinear, -1: CW.
|
||||
|
||||
Reference in New Issue
Block a user