From ba69d51cc372197ef55feb87a33ed03afd1b0ca3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 6 Mar 2025 02:41:09 +0000 Subject: Create AxisAlignedBoundingBox Used to define the extents of GeoData mesh --- test/test-lib.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/test-lib.cpp b/test/test-lib.cpp index 17c0f63..8dadc70 100644 --- a/test/test-lib.cpp +++ b/test/test-lib.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -110,3 +111,14 @@ BOOST_DATA_TEST_CASE(mergeCloseInts, tolerance))); BOOST_CHECK_EQUAL_COLCOL(mutableCollection, expected); } + +BOOST_AUTO_TEST_CASE(aabb_from_points) +{ + const auto aabb = AxisAlignedBoundingBox::fromPoints(std::vector { + {1, 2, 3}, + {4, 2, 1}, + {9, 1, 7}, + }); + BOOST_CHECK_EQUAL(aabb.min, GlobalPosition3D(1, 1, 1)); + BOOST_CHECK_EQUAL(aabb.max, GlobalPosition3D(9, 2, 7)); +} -- cgit v1.2.3