From 27130d528a2c1b3fbbdb78516d73e089d1922156 Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Thu, 28 May 2020 17:38:07 -0400 Subject: [PATCH 1/6] support levelset complement --- include/csg.hpp | 3 +- src/csg/csg.cpp | 11 ++-- src/csg/tests/CMakeLists.txt | 1 + src/csg/tests/levelset/complement.t.cpp | 69 +++++++++++++++++++++++++ src/csg/tests/meson.build | 1 + 5 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 src/csg/tests/levelset/complement.t.cpp diff --git a/include/csg.hpp b/include/csg.hpp index e29b857..5629d5f 100644 --- a/include/csg.hpp +++ b/include/csg.hpp @@ -26,7 +26,7 @@ std::shared_ptr parse_csg(std::string); class CsgIF : GPUable { public: - CsgIF(std::shared_ptr a_state); + CsgIF(std::shared_ptr a_state, bool is_complement = false); CsgIF(const CsgIF &rhs); CsgIF(CsgIF &&rhs) noexcept; CsgIF &operator=(const CsgIF &rhs) = delete; @@ -42,6 +42,7 @@ public: private: std::shared_ptr m_state; + bool m_is_complement; class Impl; std::unique_ptr m_pimpl; diff --git a/src/csg/csg.cpp b/src/csg/csg.cpp index 8b7c174..6250bce 100644 --- a/src/csg/csg.cpp +++ b/src/csg/csg.cpp @@ -42,16 +42,19 @@ public: }; CsgIF::CsgIF(const CsgIF &rhs) - : m_state(rhs.m_state), m_pimpl(std::make_unique(*rhs.m_pimpl)) {} + : m_state(rhs.m_state), m_is_complement(rhs.m_is_complement), + m_pimpl(std::make_unique(*rhs.m_pimpl)) {} -CsgIF::CsgIF(std::shared_ptr a_state) - : m_state(a_state), m_pimpl(std::make_unique()) {} +CsgIF::CsgIF(std::shared_ptr a_state, bool is_complement) + : m_state(a_state), m_is_complement(is_complement), + m_pimpl(std::make_unique()) {} CsgIF::CsgIF(CsgIF &&rhs) noexcept = default; CsgIF::~CsgIF() = default; double CsgIF::operator()(double xx, double yy, double zz) const noexcept { - return m_pimpl->call_signed_distance(m_state, xx, yy, zz); + double sign = m_is_complement ? -1.0 : 1.0; + return sign * m_pimpl->call_signed_distance(m_state, xx, yy, zz); } std::shared_ptr get_csgtree_from_filename(std::string geom_file) { diff --git a/src/csg/tests/CMakeLists.txt b/src/csg/tests/CMakeLists.txt index a5ee6f4..3925475 100644 --- a/src/csg/tests/CMakeLists.txt +++ b/src/csg/tests/CMakeLists.txt @@ -7,6 +7,7 @@ add_executable(unit_tests_csg EXCLUDE_FROM_ALL levelset/extrude.t.cpp levelset/primitives.t.cpp levelset/transform.t.cpp + levelset/complement.t.cpp parser/boolean.t.cpp parser/extrude.t.cpp parser/nest.cpp diff --git a/src/csg/tests/levelset/complement.t.cpp b/src/csg/tests/levelset/complement.t.cpp new file mode 100644 index 0000000..e72aea2 --- /dev/null +++ b/src/csg/tests/levelset/complement.t.cpp @@ -0,0 +1,69 @@ +#include "catch2/catch.hpp" + +#include +#include + +#include + +namespace { + +TEST_CASE("Boolean", "[Levelset Complement]") { + // Create a union of a cube of size 12 and a sphere of radius 8 + csg::Cube my_cub{.name = std::nullopt, .size = {12, 12, 12}, .center = true}; + csg::Sphere my_sph{.name = std::nullopt, .radius = 8}; + + auto my_union = csg::Union3D(); + my_union.objs.push_back(my_cub); + my_union.objs.push_back(my_sph); + + auto my_tree = std::make_shared(); + my_tree->top.objs.push_back(my_union); + csg::CsgIF my_levelset(my_tree, true); + + CHECK(0 < my_levelset(0, 7, 0)); + CHECK(Approx(8 * 8 - 7 * 7) == my_levelset(0, 7, 0)); + + CHECK(0 < my_levelset(0, 0, -7.5)); + CHECK(Approx(8 * 8 - 7.5 * 7.5) == my_levelset(0, 0, -7.5)); + + CHECK_FALSE(0 < my_levelset(0, -9, 0)); + CHECK_FALSE(Approx(-1) == my_levelset(0, -9, 0)); + + CHECK_FALSE(0 < my_levelset(9, 0, 0)); + CHECK_FALSE(Approx(-1) == my_levelset(9, 0, 0)); +} + +TEST_CASE("Primitive", "[Levelset Complement]") { + + csg::Sphere my_sph{.name = std::nullopt, .radius = 10}; + + auto my_tree = std::make_shared(); + my_tree->top.objs.push_back(my_sph); + csg::CsgIF my_levelset(my_tree, true); + + SECTION("Outside") { + CHECK_FALSE(0 < my_levelset(0, 8, 8)); + CHECK(Approx(-28) == my_levelset(0, 8, 8)); + + CHECK_FALSE(0 < my_levelset(-8, 0, 8)); + CHECK(Approx(-28) == my_levelset(-8, 0, 8)); + + CHECK_FALSE(0 < my_levelset(0, 8, -8)); + CHECK(Approx(-28) == my_levelset(0, 8, -8)); + } + SECTION("Inside") { + CHECK(0 < my_levelset(0, 0, 0)); + CHECK(Approx(100) == my_levelset(0, 0, 0)); + + CHECK(0 < my_levelset(0, 7, 7)); + CHECK(Approx(2) == my_levelset(0, 7, 7)); + + CHECK(0 < my_levelset(-7, 0, 7)); + CHECK(Approx(2) == my_levelset(-7, 0, 7)); + + CHECK(0 < my_levelset(0, 7, -7)); + CHECK(Approx(2) == my_levelset(0, 7, -7)); + } +} + +} // namespace diff --git a/src/csg/tests/meson.build b/src/csg/tests/meson.build index 3051eab..793ef64 100644 --- a/src/csg/tests/meson.build +++ b/src/csg/tests/meson.build @@ -4,6 +4,7 @@ test_csg = executable( 'levelset/extrude.t.cpp', 'levelset/primitives.t.cpp', 'levelset/transform.t.cpp', + 'levelset/complement.t.cpp', 'parser/boolean.t.cpp', 'parser/extrude.t.cpp', 'parser/nest.cpp', -- GitLab From a161595f3a4d2c77f1705a81850ade87fab0b93c Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Thu, 28 May 2020 21:02:17 -0400 Subject: [PATCH 2/6] more work --- src/csg/csg.cpp | 7 ++- src/csg/tests/levelset/complement.t.cpp | 68 +++++++++++++------------ 2 files changed, 40 insertions(+), 35 deletions(-) diff --git a/src/csg/csg.cpp b/src/csg/csg.cpp index 6250bce..ad59bde 100644 --- a/src/csg/csg.cpp +++ b/src/csg/csg.cpp @@ -53,8 +53,11 @@ CsgIF::CsgIF(CsgIF &&rhs) noexcept = default; CsgIF::~CsgIF() = default; double CsgIF::operator()(double xx, double yy, double zz) const noexcept { - double sign = m_is_complement ? -1.0 : 1.0; - return sign * m_pimpl->call_signed_distance(m_state, xx, yy, zz); + auto sd = m_pimpl->call_signed_distance(m_state, xx, yy, zz); + if (m_is_complement) { + return -sd; + } + return sd; } std::shared_ptr get_csgtree_from_filename(std::string geom_file) { diff --git a/src/csg/tests/levelset/complement.t.cpp b/src/csg/tests/levelset/complement.t.cpp index e72aea2..0263ee8 100644 --- a/src/csg/tests/levelset/complement.t.cpp +++ b/src/csg/tests/levelset/complement.t.cpp @@ -7,7 +7,7 @@ namespace { -TEST_CASE("Boolean", "[Levelset Complement]") { +TEST_CASE("union complement", "[Levelset Complement]") { // Create a union of a cube of size 12 and a sphere of radius 8 csg::Cube my_cub{.name = std::nullopt, .size = {12, 12, 12}, .center = true}; csg::Sphere my_sph{.name = std::nullopt, .radius = 8}; @@ -18,51 +18,53 @@ TEST_CASE("Boolean", "[Levelset Complement]") { auto my_tree = std::make_shared(); my_tree->top.objs.push_back(my_union); - csg::CsgIF my_levelset(my_tree, true); + csg::CsgIF my_ls(my_tree); + csg::CsgIF my_ls_comp(my_tree, true); - CHECK(0 < my_levelset(0, 7, 0)); - CHECK(Approx(8 * 8 - 7 * 7) == my_levelset(0, 7, 0)); + auto check = [&my_ls, &my_ls_comp](double xx, double yy, double zz) { + CHECK(my_ls(xx, yy, zz) == -my_ls_comp(xx, yy, zz)); + }; - CHECK(0 < my_levelset(0, 0, -7.5)); - CHECK(Approx(8 * 8 - 7.5 * 7.5) == my_levelset(0, 0, -7.5)); - - CHECK_FALSE(0 < my_levelset(0, -9, 0)); - CHECK_FALSE(Approx(-1) == my_levelset(0, -9, 0)); - - CHECK_FALSE(0 < my_levelset(9, 0, 0)); - CHECK_FALSE(Approx(-1) == my_levelset(9, 0, 0)); + SECTION("Inside") { + check(0, 7, 0); + check(0, 0, -7.5); + } + SECTION("Outside") { + check(0, -9, 0); + check(9, 0, 0); + } } -TEST_CASE("Primitive", "[Levelset Complement]") { +TEST_CASE("CsgIF copy constructor", "[Levelset Complement]") { csg::Sphere my_sph{.name = std::nullopt, .radius = 10}; auto my_tree = std::make_shared(); my_tree->top.objs.push_back(my_sph); - csg::CsgIF my_levelset(my_tree, true); + csg::CsgIF my_ls1(my_tree); + csg::CsgIF my_ls2(my_ls1); + csg::CsgIF my_ls_comp1(my_tree, true); + csg::CsgIF my_ls_comp2(my_ls_comp1); + + auto check = [&my_ls1, &my_ls2, &my_ls_comp1, + &my_ls_comp2](double xx, double yy, double zz) { + CHECK(my_ls1(xx, yy, zz) == my_ls2(xx, yy, zz)); + CHECK(my_ls_comp1(xx, yy, zz) == my_ls_comp2(xx, yy, zz)); + CHECK(my_ls1(xx, yy, zz) == -my_ls_comp1(xx, yy, zz)); + CHECK(my_ls2(xx, yy, zz) == -my_ls_comp2(xx, yy, zz)); + }; SECTION("Outside") { - CHECK_FALSE(0 < my_levelset(0, 8, 8)); - CHECK(Approx(-28) == my_levelset(0, 8, 8)); - - CHECK_FALSE(0 < my_levelset(-8, 0, 8)); - CHECK(Approx(-28) == my_levelset(-8, 0, 8)); - - CHECK_FALSE(0 < my_levelset(0, 8, -8)); - CHECK(Approx(-28) == my_levelset(0, 8, -8)); + check(0, 8, 8); + check(-8, 0, 8); + check(0, 8, -8); } SECTION("Inside") { - CHECK(0 < my_levelset(0, 0, 0)); - CHECK(Approx(100) == my_levelset(0, 0, 0)); - - CHECK(0 < my_levelset(0, 7, 7)); - CHECK(Approx(2) == my_levelset(0, 7, 7)); - - CHECK(0 < my_levelset(-7, 0, 7)); - CHECK(Approx(2) == my_levelset(-7, 0, 7)); - - CHECK(0 < my_levelset(0, 7, -7)); - CHECK(Approx(2) == my_levelset(0, 7, -7)); + check(0, 0, 0); + check(0, 7, 7); + check(-7, 0, 7); + check(-7, 0, 7); + check(0, 7, -7); } } -- GitLab From e3d3ef3f82d2f39939c148f2959c72dd3ae9387a Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Thu, 28 May 2020 21:44:33 -0400 Subject: [PATCH 3/6] more work --- include/csg.hpp | 6 +++++- src/csg/csg.cpp | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/csg.hpp b/include/csg.hpp index 5629d5f..8fe58ce 100644 --- a/include/csg.hpp +++ b/include/csg.hpp @@ -49,7 +49,11 @@ private: }; std::shared_ptr get_csgtree_from_filename(std::string); -std::unique_ptr get_csgif_from_filename(std::string geom_file); +std::unique_ptr +get_csgif_from_filename(std::string geom_file); // TODO: Deprecate once mfix has + // stopped using this call +std::unique_ptr get_csgif(const std::string &geom_file, + bool is_complement = false); } // namespace csg diff --git a/src/csg/csg.cpp b/src/csg/csg.cpp index ad59bde..83bf8fc 100644 --- a/src/csg/csg.cpp +++ b/src/csg/csg.cpp @@ -81,4 +81,17 @@ std::unique_ptr get_csgif_from_filename(std::string geom_file) { return std::make_unique(csg_if); } +std::unique_ptr get_csgif(const std::string &geom_file, + bool is_complement) { + auto csg_obj = get_csgtree_from_filename(geom_file); + + if (!csg_obj) { + std::cout << "Failed to parse .csg file: " << geom_file << std::endl; + return nullptr; + } + + csg::CsgIF csg_if(csg_obj, is_complement); + return std::make_unique(csg_if); +} + } // namespace csg -- GitLab From 9d68f18493e0f0e959dc5161123224751aec2938 Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Fri, 29 May 2020 08:46:01 -0400 Subject: [PATCH 4/6] rename to hollow --- include/csg.hpp | 6 +++--- src/csg/csg.cpp | 13 ++++++------- src/csg/tests/CMakeLists.txt | 2 +- .../{levelset/complement.t.cpp => hollow.t.cpp} | 4 ++-- src/csg/tests/meson.build | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) rename src/csg/tests/{levelset/complement.t.cpp => hollow.t.cpp} (93%) diff --git a/include/csg.hpp b/include/csg.hpp index 8fe58ce..b1c25a9 100644 --- a/include/csg.hpp +++ b/include/csg.hpp @@ -26,7 +26,7 @@ std::shared_ptr parse_csg(std::string); class CsgIF : GPUable { public: - CsgIF(std::shared_ptr a_state, bool is_complement = false); + CsgIF(std::shared_ptr a_state, bool is_hollow = false); CsgIF(const CsgIF &rhs); CsgIF(CsgIF &&rhs) noexcept; CsgIF &operator=(const CsgIF &rhs) = delete; @@ -42,7 +42,7 @@ public: private: std::shared_ptr m_state; - bool m_is_complement; + bool m_is_hollow; class Impl; std::unique_ptr m_pimpl; @@ -53,7 +53,7 @@ std::unique_ptr get_csgif_from_filename(std::string geom_file); // TODO: Deprecate once mfix has // stopped using this call std::unique_ptr get_csgif(const std::string &geom_file, - bool is_complement = false); + bool is_hollow = false); } // namespace csg diff --git a/src/csg/csg.cpp b/src/csg/csg.cpp index 83bf8fc..ecea6cd 100644 --- a/src/csg/csg.cpp +++ b/src/csg/csg.cpp @@ -42,11 +42,11 @@ public: }; CsgIF::CsgIF(const CsgIF &rhs) - : m_state(rhs.m_state), m_is_complement(rhs.m_is_complement), + : m_state(rhs.m_state), m_is_hollow(rhs.m_is_hollow), m_pimpl(std::make_unique(*rhs.m_pimpl)) {} -CsgIF::CsgIF(std::shared_ptr a_state, bool is_complement) - : m_state(a_state), m_is_complement(is_complement), +CsgIF::CsgIF(std::shared_ptr a_state, bool is_hollow) + : m_state(a_state), m_is_hollow(is_hollow), m_pimpl(std::make_unique()) {} CsgIF::CsgIF(CsgIF &&rhs) noexcept = default; @@ -54,7 +54,7 @@ CsgIF::~CsgIF() = default; double CsgIF::operator()(double xx, double yy, double zz) const noexcept { auto sd = m_pimpl->call_signed_distance(m_state, xx, yy, zz); - if (m_is_complement) { + if (m_is_hollow) { return -sd; } return sd; @@ -81,8 +81,7 @@ std::unique_ptr get_csgif_from_filename(std::string geom_file) { return std::make_unique(csg_if); } -std::unique_ptr get_csgif(const std::string &geom_file, - bool is_complement) { +std::unique_ptr get_csgif(const std::string &geom_file, bool is_hollow) { auto csg_obj = get_csgtree_from_filename(geom_file); if (!csg_obj) { @@ -90,7 +89,7 @@ std::unique_ptr get_csgif(const std::string &geom_file, return nullptr; } - csg::CsgIF csg_if(csg_obj, is_complement); + csg::CsgIF csg_if(csg_obj, is_hollow); return std::make_unique(csg_if); } diff --git a/src/csg/tests/CMakeLists.txt b/src/csg/tests/CMakeLists.txt index 3925475..329cac4 100644 --- a/src/csg/tests/CMakeLists.txt +++ b/src/csg/tests/CMakeLists.txt @@ -7,7 +7,7 @@ add_executable(unit_tests_csg EXCLUDE_FROM_ALL levelset/extrude.t.cpp levelset/primitives.t.cpp levelset/transform.t.cpp - levelset/complement.t.cpp + levelset/hollow.t.cpp parser/boolean.t.cpp parser/extrude.t.cpp parser/nest.cpp diff --git a/src/csg/tests/levelset/complement.t.cpp b/src/csg/tests/hollow.t.cpp similarity index 93% rename from src/csg/tests/levelset/complement.t.cpp rename to src/csg/tests/hollow.t.cpp index 0263ee8..4922424 100644 --- a/src/csg/tests/levelset/complement.t.cpp +++ b/src/csg/tests/hollow.t.cpp @@ -7,7 +7,7 @@ namespace { -TEST_CASE("union complement", "[Levelset Complement]") { +TEST_CASE("union hollow", "[Levelset hollow]") { // Create a union of a cube of size 12 and a sphere of radius 8 csg::Cube my_cub{.name = std::nullopt, .size = {12, 12, 12}, .center = true}; csg::Sphere my_sph{.name = std::nullopt, .radius = 8}; @@ -35,7 +35,7 @@ TEST_CASE("union complement", "[Levelset Complement]") { } } -TEST_CASE("CsgIF copy constructor", "[Levelset Complement]") { +TEST_CASE("CsgIF copy constructor", "[Levelset hollow]") { csg::Sphere my_sph{.name = std::nullopt, .radius = 10}; diff --git a/src/csg/tests/meson.build b/src/csg/tests/meson.build index 793ef64..6b6a1fb 100644 --- a/src/csg/tests/meson.build +++ b/src/csg/tests/meson.build @@ -4,7 +4,7 @@ test_csg = executable( 'levelset/extrude.t.cpp', 'levelset/primitives.t.cpp', 'levelset/transform.t.cpp', - 'levelset/complement.t.cpp', + 'levelset/hollow.t.cpp', 'parser/boolean.t.cpp', 'parser/extrude.t.cpp', 'parser/nest.cpp', -- GitLab From 8f8b850899b974e4971f8d9a5499df45bafc4107 Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Fri, 29 May 2020 08:48:56 -0400 Subject: [PATCH 5/6] fix --- src/csg/tests/{ => levelset}/hollow.t.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/csg/tests/{ => levelset}/hollow.t.cpp (100%) diff --git a/src/csg/tests/hollow.t.cpp b/src/csg/tests/levelset/hollow.t.cpp similarity index 100% rename from src/csg/tests/hollow.t.cpp rename to src/csg/tests/levelset/hollow.t.cpp -- GitLab From ddb51b107fb7d5df4ff530716e29050c6f0fbfa7 Mon Sep 17 00:00:00 2001 From: Deepak Rangarajan Date: Fri, 29 May 2020 09:15:36 -0400 Subject: [PATCH 6/6] rename again --- include/csg.hpp | 6 +++--- src/csg/csg.cpp | 13 +++++++------ src/csg/tests/CMakeLists.txt | 2 +- .../levelset/{hollow.t.cpp => internal_flow.t.cpp} | 4 ++-- src/csg/tests/meson.build | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) rename src/csg/tests/levelset/{hollow.t.cpp => internal_flow.t.cpp} (93%) diff --git a/include/csg.hpp b/include/csg.hpp index b1c25a9..23819fa 100644 --- a/include/csg.hpp +++ b/include/csg.hpp @@ -26,7 +26,7 @@ std::shared_ptr parse_csg(std::string); class CsgIF : GPUable { public: - CsgIF(std::shared_ptr a_state, bool is_hollow = false); + CsgIF(std::shared_ptr a_state, bool is_internal_flow = false); CsgIF(const CsgIF &rhs); CsgIF(CsgIF &&rhs) noexcept; CsgIF &operator=(const CsgIF &rhs) = delete; @@ -42,7 +42,7 @@ public: private: std::shared_ptr m_state; - bool m_is_hollow; + bool m_is_internal_flow; class Impl; std::unique_ptr m_pimpl; @@ -53,7 +53,7 @@ std::unique_ptr get_csgif_from_filename(std::string geom_file); // TODO: Deprecate once mfix has // stopped using this call std::unique_ptr get_csgif(const std::string &geom_file, - bool is_hollow = false); + bool is_internal_flow = false); } // namespace csg diff --git a/src/csg/csg.cpp b/src/csg/csg.cpp index ecea6cd..7de1dde 100644 --- a/src/csg/csg.cpp +++ b/src/csg/csg.cpp @@ -42,11 +42,11 @@ public: }; CsgIF::CsgIF(const CsgIF &rhs) - : m_state(rhs.m_state), m_is_hollow(rhs.m_is_hollow), + : m_state(rhs.m_state), m_is_internal_flow(rhs.m_is_internal_flow), m_pimpl(std::make_unique(*rhs.m_pimpl)) {} -CsgIF::CsgIF(std::shared_ptr a_state, bool is_hollow) - : m_state(a_state), m_is_hollow(is_hollow), +CsgIF::CsgIF(std::shared_ptr a_state, bool is_internal_flow) + : m_state(a_state), m_is_internal_flow(is_internal_flow), m_pimpl(std::make_unique()) {} CsgIF::CsgIF(CsgIF &&rhs) noexcept = default; @@ -54,7 +54,7 @@ CsgIF::~CsgIF() = default; double CsgIF::operator()(double xx, double yy, double zz) const noexcept { auto sd = m_pimpl->call_signed_distance(m_state, xx, yy, zz); - if (m_is_hollow) { + if (m_is_internal_flow) { return -sd; } return sd; @@ -81,7 +81,8 @@ std::unique_ptr get_csgif_from_filename(std::string geom_file) { return std::make_unique(csg_if); } -std::unique_ptr get_csgif(const std::string &geom_file, bool is_hollow) { +std::unique_ptr get_csgif(const std::string &geom_file, + bool is_internal_flow) { auto csg_obj = get_csgtree_from_filename(geom_file); if (!csg_obj) { @@ -89,7 +90,7 @@ std::unique_ptr get_csgif(const std::string &geom_file, bool is_hollow) { return nullptr; } - csg::CsgIF csg_if(csg_obj, is_hollow); + csg::CsgIF csg_if(csg_obj, is_internal_flow); return std::make_unique(csg_if); } diff --git a/src/csg/tests/CMakeLists.txt b/src/csg/tests/CMakeLists.txt index 329cac4..6679700 100644 --- a/src/csg/tests/CMakeLists.txt +++ b/src/csg/tests/CMakeLists.txt @@ -7,7 +7,7 @@ add_executable(unit_tests_csg EXCLUDE_FROM_ALL levelset/extrude.t.cpp levelset/primitives.t.cpp levelset/transform.t.cpp - levelset/hollow.t.cpp + levelset/internal_flow.t.cpp parser/boolean.t.cpp parser/extrude.t.cpp parser/nest.cpp diff --git a/src/csg/tests/levelset/hollow.t.cpp b/src/csg/tests/levelset/internal_flow.t.cpp similarity index 93% rename from src/csg/tests/levelset/hollow.t.cpp rename to src/csg/tests/levelset/internal_flow.t.cpp index 4922424..230c7e2 100644 --- a/src/csg/tests/levelset/hollow.t.cpp +++ b/src/csg/tests/levelset/internal_flow.t.cpp @@ -7,7 +7,7 @@ namespace { -TEST_CASE("union hollow", "[Levelset hollow]") { +TEST_CASE("union internal flow", "[Levelset Internal Flow]") { // Create a union of a cube of size 12 and a sphere of radius 8 csg::Cube my_cub{.name = std::nullopt, .size = {12, 12, 12}, .center = true}; csg::Sphere my_sph{.name = std::nullopt, .radius = 8}; @@ -35,7 +35,7 @@ TEST_CASE("union hollow", "[Levelset hollow]") { } } -TEST_CASE("CsgIF copy constructor", "[Levelset hollow]") { +TEST_CASE("CsgIF copy constructor", "[Levelset Internal Flow]") { csg::Sphere my_sph{.name = std::nullopt, .radius = 10}; diff --git a/src/csg/tests/meson.build b/src/csg/tests/meson.build index 6b6a1fb..5aac104 100644 --- a/src/csg/tests/meson.build +++ b/src/csg/tests/meson.build @@ -4,7 +4,7 @@ test_csg = executable( 'levelset/extrude.t.cpp', 'levelset/primitives.t.cpp', 'levelset/transform.t.cpp', - 'levelset/hollow.t.cpp', + 'levelset/internal_flow.t.cpp', 'parser/boolean.t.cpp', 'parser/extrude.t.cpp', 'parser/nest.cpp', -- GitLab