MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test_point_side_to_plane

Function test_point_side_to_plane

tests/geometry/test-position.cpp:84–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void test_point_side_to_plane()
85{
86 const geode::Point3D origin{ { 0.0, 0.0, 2.0 } };
87 const geode::Vector3D normal{ { 0.0, 0.0, 4.0 } };
88 const geode::Plane plane{ normal, origin };
89
90 const geode::Point3D q1{ { 0.5, 1.0, 2.0 } };
91 const auto side_q1 = geode::point_side_to_plane( q1, plane );
92 geode::OpenGeodeGeometryException::test( side_q1 == geode::SIDE::zero,
93 "Wrong result for point_side_to_plane with query point "
94 "q1" );
95
96 const geode::Point3D q2{ { 0.5, 1.0, 3.0 } };
97 const auto side_q2 = geode::point_side_to_plane( q2, plane );
98 geode::OpenGeodeGeometryException::test( side_q2 == geode::SIDE::positive,
99 "Wrong result for point_side_to_plane with query point "
100 "q2" );
101
102 const geode::Point3D q3{ { 0.5, 1.0, 1.0 } };
103 const auto side_q3 = geode::point_side_to_plane( q3, plane );
104 geode::OpenGeodeGeometryException::test( side_q3 == geode::SIDE::negative,
105 "Wrong result for point_side_to_plane with query point "
106 "q3" );
107
108 const geode::Point3D q4{ { 0.5, 1.0, 2.0 + 1e-10 } };
109 const auto side_q4 = geode::point_side_to_plane( q4, plane );
110 geode::OpenGeodeGeometryException::test( side_q4 == geode::SIDE::positive,
111 "Wrong result for point_side_to_plane with query point "
112 "q4" );
113
114 const geode::Point3D q5{ { 0.5, 1.0, 2.0 - 1e-10 } };
115 const auto side_q5 = geode::point_side_to_plane( q5, plane );
116 geode::OpenGeodeGeometryException::test( side_q5 == geode::SIDE::negative,
117 "Wrong result for point_side_to_plane with query point "
118 "q5" );
119}
120
121void test_point_segment_position_2d()
122{

Callers 1

testFunction · 0.70

Calls 2

point_side_to_planeFunction · 0.85
testFunction · 0.70

Tested by

no test coverage detected