18 #define NEAR(val1, val2, epsilon) (fabs((val1)-(val2)) <= (epsilon))
20 #undef NDEBUG // enable assert in release mode
25 template<
typename MeshT >
49 auto vec1 =
get(vn_pm, v1);
50 std::cout <<
"v vec1 = " << vec1[0] <<
" " << vec1[1] <<
" " << vec1[2]
52 assert(
NEAR(vec1[0], 0.371391f, eps));
53 assert(
NEAR(vec1[1], 0.557086f, eps));
54 assert(
NEAR(vec1[2], 0.742781f, eps));
56 auto vec2 =
get(vn_pm, v2);
57 std::cout <<
"v vec2 = " << vec2[0] <<
" " << vec2[1] <<
" " << vec2[2]
59 assert(
NEAR(vec2[0], 0.557086f, eps));
60 assert(
NEAR(vec2[1], 0.742781f, eps));
61 assert(
NEAR(vec2[2], 0.371391f, eps));
76 auto vec1 =
get(fn_pm, f1);
77 std::cout <<
"f vec1 = " << vec1[0] <<
" " << vec1[1] <<
" " << vec1[2]
79 assert(
NEAR(vec1[0], 0.742781f, eps));
80 assert(
NEAR(vec1[1], 0.371391f, eps));
81 assert(
NEAR(vec1[2], 0.557086f, eps));
83 auto vec2 =
get(fn_pm, f2);
84 std::cout <<
"f vec2 = " << vec2[0] <<
" " << vec2[1] <<
" " << vec2[2]
86 assert(
NEAR(vec2[0], 0.371391f, eps));
87 assert(
NEAR(vec2[1], 0.557086f, eps));
88 assert(
NEAR(vec2[2], 0.742781f, eps));
100 put(hn_pm, h2,
Vector(4.0f, 2.0f, 3.0f));
104 auto vec1 =
get(hn_pm, h1);
105 std::cout <<
"h vec1 = " << vec1[0] <<
" " << vec1[1] <<
" " << vec1[2]
107 assert(
NEAR(vec1[0], 0.557086f, eps));
108 assert(
NEAR(vec1[1], 0.742781f, eps));
109 assert(
NEAR(vec1[2], 0.371391f, eps));
111 auto vec2 =
get(hn_pm, h2);
112 std::cout <<
"h vec2 = " << vec2[0] <<
" " << vec2[1] <<
" " << vec2[2]
114 assert(
NEAR(vec2[0], 0.742781f, eps));
115 assert(
NEAR(vec2[1], 0.371391f, eps));
116 assert(
NEAR(vec2[2], 0.557086f, eps));