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

Function test_line_intersections

tests/geometry/test-bounding-box.cpp:134–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134void test_line_intersections()
135{
136 geode::BoundingBox3D bbox;
137 bbox.add_point( geode::Point3D{ { -1, -1, -1 } } );
138 bbox.add_point( geode::Point3D{ { 1, 1, 1 } } );
139
140 const geode::OwnerInfiniteLine3D line_inside{
141 geode::Vector3D{ { 0, 0, 1 } }, geode::Point3D{ { 0, 0, 0 } }
142 };
143 geode::OpenGeodeGeometryException::test(
144 bbox.intersects( line_inside ), "Wrong result with line_inside" );
145
146 const geode::OwnerInfiniteLine3D line_up{ geode::Vector3D{ { 0, 0, 1 } },
147 geode::Point3D{ { 0, 0, 2 } } };
148 geode::OpenGeodeGeometryException::test(
149 bbox.intersects( line_up ), "Wrong result with line_up" );
150
151 const geode::OwnerInfiniteLine3D line_down{ geode::Vector3D{ { 0, 0, 1 } },
152 geode::Point3D{ { 0, 0, -2 } } };
153 geode::OpenGeodeGeometryException::test(
154 bbox.intersects( line_down ), "Wrong result with line_down" );
155}
156
157void test_triangle2d_intersections()
158{

Callers 1

testFunction · 0.85

Calls 3

intersectsMethod · 0.80
testFunction · 0.70
add_pointMethod · 0.45

Tested by

no test coverage detected