36 #include <ringmesh/ringmesh_tests_config.h> 48 Logger::out(
"TEST",
"Test triangle barycentric coordinates" );
53 std::array< double, 3 > lambdas;
54 std::tie( std::ignore, lambdas ) =
56 if( lambdas[0] != 0.5 || lambdas[1] != 0.25 || lambdas[2] != 0.25 )
59 "TEST",
"Error in triangle barycentric coordinates" );
61 std::tie( std::ignore, lambdas ) =
63 if( lambdas[0] != 0 || lambdas[1] != 0.5 || lambdas[2] != 0.5 )
66 "TEST",
"Error in triangle barycentric coordinates" );
68 std::tie( std::ignore, lambdas ) =
70 if( lambdas[0] != -1 || lambdas[1] != 1 || lambdas[2] != 1 )
73 "TEST",
"Error in triangle barycentric coordinates" );
81 vec3 test0{ 1, 1, 1 };
84 std::tie( std::ignore, projected0 ) =
86 if( projected0 !=
vec3{ 1, 1, 0 } )
91 vec3 test1{ 0, 0.5, 1 };
94 std::tie( std::ignore, projected1 ) =
96 if( projected1 !=
vec3{ 1, 0.5, 1 } )
120 catch(
const std::exception& e )
void test_point_plane_distance()
std::tuple< bool, std::array< double, 3 > > RINGMESH_API triangle_barycentric_coordinates(const vec3 &p, const vec3 &p0, const vec3 &p1, const vec3 &p2)
void test_triangle_barycentric_coordinates()
static void err(const std::string &feature, const Args &... args)
static void out(const std::string &feature, const Args &... args)
std::tuple< double, vec3 > RINGMESH_API point_to_plane(const Geometry::Point3D &point, const Geometry::Plane &plane)
const std::string & category() const
Classes to build GeoModel from various inputs.
void RINGMESH_API default_configure()