mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 02:37:51 -06:00
Ported test_trianglemesh from upstream slic3r, thanks @lordofhyphens
This commit is contained in:
parent
67e1eba8e6
commit
c99e7cb0df
7 changed files with 506 additions and 9 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue