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

Function test_plane

tests/geometry/test-basic-objects.cpp:114–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void test_plane()
115{
116 const auto normal = geode::Vector3D{ { 1.0, 5.0, 42 } }.normalize();
117 const geode::Point3D origin{ { -1.0, -5.0, 42 } };
118 const geode::Plane plane{ normal, origin };
119
120 geode::Plane plane2{ plane };
121 geode::OpenGeodeGeometryException::test(
122 plane2.normal() == normal && plane2.origin() == origin,
123 "Wrong result for plane2" );
124
125 geode::Plane plane3{ std::move( plane ) };
126 geode::OpenGeodeGeometryException::test(
127 plane3.normal() == normal && plane3.origin() == origin,
128 "Wrong result for plane3" );
129
130 const auto normal2 = geode::Vector3D{ { -1.0, -5.0, 42 } }.normalize();
131 const geode::Point3D origin2{ { 1.0, 5.0, 42 } };
132 geode::Plane plane4{ normal2, origin2 };
133 plane4 = plane2;
134 geode::OpenGeodeGeometryException::test(
135 plane4.normal() == normal && plane4.origin() == origin,
136 "Wrong result for plane4" );
137
138 geode::Plane plane5{ normal2, origin2 };
139 plane5 = std::move( plane2 );
140 geode::OpenGeodeGeometryException::test(
141 plane5.normal() == normal && plane5.origin() == origin,
142 "Wrong result for plane5" );
143}
144
145void test_triangle()
146{

Callers 1

testFunction · 0.85

Calls 3

normalizeMethod · 0.80
testFunction · 0.70
normalMethod · 0.45

Tested by

no test coverage detected