From 124841c4eee2f42575e4f584a4d6228774cf9f98 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Sun, 8 Sep 2024 13:07:49 +0800 Subject: [PATCH 1/6] change directory structure --- bindings/c/CMakeLists.txt | 15 ++++++++++--- bindings/c/box.cpp | 16 +++++++++----- bindings/c/conv.cpp | 10 ++++----- bindings/c/cross.cpp | 18 ++++++++++------ bindings/c/include/{ => manifold}/conv.h | 8 +++---- bindings/c/include/{ => manifold}/manifoldc.h | 2 +- bindings/c/include/{ => manifold}/types.h | 0 bindings/c/manifoldc.cpp | 21 ++++++------------- bindings/c/meshio.cpp | 6 +++--- bindings/c/rect.cpp | 18 ++++++++++------ bindings/python/CMakeLists.txt | 2 +- bindings/python/gen_docs.py | 2 +- bindings/python/manifold3d.cpp | 14 ++++++++----- bindings/wasm/bindings.cpp | 6 +++--- bindings/wasm/helpers.cpp | 6 +++--- extras/convert_file.cpp | 6 +++--- extras/large_scene_test.cpp | 2 +- extras/minimize_testcase.cpp | 4 ++-- extras/perf_test.cpp | 2 +- extras/perf_test_cgal.cpp | 2 +- extras/stl_test.cpp | 2 +- extras/test_hull_performance.cpp | 4 ++-- meshIO/CMakeLists.txt | 4 ++-- meshIO/include/{ => manifold}/meshIO.h | 2 +- meshIO/src/meshIO.cpp | 4 ++-- samples/include/samples.h | 2 +- samples/src/bracelet.cpp | 2 +- samples/src/gyroid_module.cpp | 2 +- samples/src/knot.cpp | 2 +- src/collider/CMakeLists.txt | 2 +- .../include/{ => manifold}/collider.h | 10 ++++----- src/cross_section/CMakeLists.txt | 2 +- .../include/{ => manifold}/cross_section.h | 4 ++-- src/cross_section/src/cross_section.cpp | 2 +- src/manifold/CMakeLists.txt | 2 +- .../include/{ => manifold}/manifold.h | 4 ++-- src/manifold/src/boolean3.cpp | 2 +- src/manifold/src/boolean_result.cpp | 2 +- src/manifold/src/constructors.cpp | 4 ++-- src/manifold/src/csg_tree.cpp | 2 +- src/manifold/src/csg_tree.h | 4 ++-- src/manifold/src/edge_op.cpp | 2 +- src/manifold/src/face_op.cpp | 2 +- src/manifold/src/impl.cpp | 8 +++---- src/manifold/src/impl.h | 14 ++++++------- src/manifold/src/manifold.cpp | 2 +- src/manifold/src/properties.cpp | 4 ++-- src/manifold/src/quickhull.h | 2 +- src/manifold/src/sdf.cpp | 10 ++++----- src/manifold/src/shared.h | 8 +++---- src/manifold/src/smoothing.cpp | 2 +- src/manifold/src/sort.cpp | 2 +- src/manifold/src/subdivision.cpp | 2 +- src/polygon/CMakeLists.txt | 2 +- src/polygon/include/{ => manifold}/polygon.h | 4 +--- src/polygon/src/polygon.cpp | 8 +++---- src/utilities/CMakeLists.txt | 13 +++++------- .../include/{public.h => manifold/common.h} | 0 .../include/{ => manifold}/hashtable.h | 4 ++-- src/utilities/include/{ => manifold}/iters.h | 0 .../include/{ => manifold}/optional_assert.h | 1 - .../include/{par.h => manifold/parallel.h} | 4 ++-- src/utilities/include/{ => manifold}/sparse.h | 10 ++++----- src/utilities/include/{ => manifold}/svd.h | 5 +---- .../include/{ => manifold}/tri_dist.h | 2 +- src/utilities/include/{ => manifold}/utils.h | 4 ++-- src/utilities/include/{ => manifold}/vec.h | 4 ++-- .../include/{ => manifold}/vec_view.h | 2 +- test-cmake.sh | 2 +- test/boolean_complex_test.cpp | 6 +++--- test/boolean_test.cpp | 4 ++-- test/cross_section_test.cpp | 8 +++---- test/hull_test.cpp | 4 ++-- test/manifold_test.cpp | 6 +++--- test/manifoldc_test.cpp | 8 +++---- test/polygon_fuzz.cpp | 2 +- test/polygon_test.cpp | 2 +- test/properties_test.cpp | 4 ++-- test/samples_test.cpp | 4 ++-- test/sdf_test.cpp | 2 +- test/smooth_test.cpp | 6 +++--- test/test.h | 6 +++--- test/test_main.cpp | 4 ++-- 83 files changed, 213 insertions(+), 200 deletions(-) rename bindings/c/include/{ => manifold}/conv.h (95%) rename bindings/c/include/{ => manifold}/manifoldc.h (99%) rename bindings/c/include/{ => manifold}/types.h (100%) rename meshIO/include/{ => manifold}/meshIO.h (98%) rename src/collider/include/{ => manifold}/collider.h (98%) rename src/cross_section/include/{ => manifold}/cross_section.h (98%) rename src/manifold/include/{ => manifold}/manifold.h (99%) rename src/polygon/include/{ => manifold}/polygon.h (96%) rename src/utilities/include/{public.h => manifold/common.h} (100%) rename src/utilities/include/{ => manifold}/hashtable.h (98%) rename src/utilities/include/{ => manifold}/iters.h (100%) rename src/utilities/include/{ => manifold}/optional_assert.h (98%) rename src/utilities/include/{par.h => manifold/parallel.h} (99%) rename src/utilities/include/{ => manifold}/sparse.h (97%) rename src/utilities/include/{ => manifold}/svd.h (99%) rename src/utilities/include/{ => manifold}/tri_dist.h (99%) rename src/utilities/include/{ => manifold}/utils.h (98%) rename src/utilities/include/{ => manifold}/vec.h (99%) rename src/utilities/include/{ => manifold}/vec_view.h (98%) diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index c34f8cd07..3fe7dd9d0 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -1,7 +1,12 @@ project(manifoldc) # this is a shared library for FFI bindings -add_library(${PROJECT_NAME} SHARED manifoldc.cpp conv.cpp) +add_library(${PROJECT_NAME} SHARED + manifoldc.cpp + conv.cpp + box.cpp + cross.cpp + rect.cpp) if(MSVC) set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -12,6 +17,7 @@ if(MSVC) endif() if(MANIFOLD_EXPORT) + target_sources(${PROJECT_NAME} PRIVATE meshio.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE meshIO) target_compile_options(${PROJECT_NAME} PUBLIC -DMANIFOLD_EXPORT) endif() @@ -22,10 +28,13 @@ target_link_libraries( ) target_include_directories(${PROJECT_NAME} PUBLIC - $ + $ $) target_compile_options(${PROJECT_NAME} PRIVATE ${MANIFOLD_FLAGS}) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) install(TARGETS ${PROJECT_NAME} EXPORT manifoldTargets) -install(FILES include/manifoldc.h include/types.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) +install(FILES + include/manifold/manifoldc.h + include/manifold/types.h DESTINATION + ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) diff --git a/bindings/c/box.cpp b/bindings/c/box.cpp index d18b9d027..dbed876d4 100644 --- a/bindings/c/box.cpp +++ b/bindings/c/box.cpp @@ -12,11 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "conv.h" -#include "manifold.h" -#include "public.h" -#include "types.h" - +#include "manifold/conv.h" +#include "manifold/manifold.h" +#include "manifold/common.h" +#include "manifold/types.h" + +#ifdef __cplusplus +extern "C" { +#endif ManifoldBox *manifold_box(void *mem, double x1, double y1, double z1, double x2, double y2, double z2) { auto p1 = vec3(x1, y1, z1); @@ -96,3 +99,6 @@ int manifold_box_does_overlap_box(ManifoldBox *a, ManifoldBox *b) { } int manifold_box_is_finite(ManifoldBox *b) { return from_c(b)->IsFinite(); } +#ifdef __cplusplus +} +#endif diff --git a/bindings/c/conv.cpp b/bindings/c/conv.cpp index 3651ece0c..6b7b5405e 100644 --- a/bindings/c/conv.cpp +++ b/bindings/c/conv.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "conv.h" +#include "manifold/conv.h" #include -#include "cross_section.h" -#include "manifold.h" -#include "public.h" -#include "types.h" +#include "manifold/cross_section.h" +#include "manifold/manifold.h" +#include "manifold/common.h" +#include "manifold/types.h" ManifoldManifold *to_c(manifold::Manifold *m) { return reinterpret_cast(m); diff --git a/bindings/c/cross.cpp b/bindings/c/cross.cpp index e5c16fa47..6e2df7766 100644 --- a/bindings/c/cross.cpp +++ b/bindings/c/cross.cpp @@ -14,12 +14,15 @@ #include -#include "conv.h" -#include "cross_section.h" -#include "manifold.h" -#include "public.h" -#include "types.h" - +#include "manifold/conv.h" +#include "manifold/cross_section.h" +#include "manifold/manifold.h" +#include "manifold/common.h" +#include "manifold/types.h" + +#ifdef __cplusplus +extern "C" { +#endif ManifoldCrossSection *manifold_cross_section_empty(void *mem) { return to_c(new (mem) CrossSection()); } @@ -248,3 +251,6 @@ ManifoldCrossSectionVec *manifold_cross_section_decompose( auto comps = from_c(cs)->Decompose(); return to_c(new (mem) CrossSectionVec(comps)); } +#ifdef __cplusplus +} +#endif diff --git a/bindings/c/include/conv.h b/bindings/c/include/manifold/conv.h similarity index 95% rename from bindings/c/include/conv.h rename to bindings/c/include/manifold/conv.h index 6efa81235..1fe2da622 100644 --- a/bindings/c/include/conv.h +++ b/bindings/c/include/manifold/conv.h @@ -16,10 +16,10 @@ #include #include -#include "cross_section.h" -#include "manifold.h" -#include "public.h" -#include "types.h" +#include "manifold/common.h" +#include "manifold/cross_section.h" +#include "manifold/manifold.h" +#include "manifold/types.h" using namespace manifold; using ManifoldVec = std::vector; diff --git a/bindings/c/include/manifoldc.h b/bindings/c/include/manifold/manifoldc.h similarity index 99% rename from bindings/c/include/manifoldc.h rename to bindings/c/include/manifold/manifoldc.h index 2d78e0360..7dd725c34 100644 --- a/bindings/c/include/manifoldc.h +++ b/bindings/c/include/manifold/manifoldc.h @@ -15,7 +15,7 @@ #include #include -#include "types.h" +#include "manifold/types.h" #ifdef __cplusplus #include diff --git a/bindings/c/include/types.h b/bindings/c/include/manifold/types.h similarity index 100% rename from bindings/c/include/types.h rename to bindings/c/include/manifold/types.h diff --git a/bindings/c/manifoldc.cpp b/bindings/c/manifoldc.cpp index 0082d77d8..3f20eefc3 100644 --- a/bindings/c/manifoldc.cpp +++ b/bindings/c/manifoldc.cpp @@ -12,24 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include -#include -#include -#include +#include "manifold/manifoldc.h" #include -#include "box.cpp" -#include "cross.cpp" -#include "include/conv.h" -#include "include/types.h" -#include "rect.cpp" -#include "types.h" - -#ifdef MANIFOLD_EXPORT -#include "meshio.cpp" -#endif +#include "manifold/common.h" +#include "manifold/conv.h" +#include "manifold/cross_section.h" +#include "manifold/manifold.h" +#include "manifold/types.h" using namespace manifold; diff --git a/bindings/c/meshio.cpp b/bindings/c/meshio.cpp index a04249178..f0b70ff56 100644 --- a/bindings/c/meshio.cpp +++ b/bindings/c/meshio.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "meshIO.h" +#include "manifold/meshIO.h" -#include "conv.h" -#include "types.h" +#include "manifold/conv.h" +#include "manifold/types.h" // C <-> C++ conversions diff --git a/bindings/c/rect.cpp b/bindings/c/rect.cpp index 5141cd488..df7ede67f 100644 --- a/bindings/c/rect.cpp +++ b/bindings/c/rect.cpp @@ -12,12 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "conv.h" -#include "cross_section.h" -#include "manifold.h" -#include "public.h" -#include "types.h" - +#include "manifold/conv.h" +#include "manifold/cross_section.h" +#include "manifold/manifold.h" +#include "manifold/common.h" +#include "manifold/types.h" + +#ifdef __cplusplus +extern "C" { +#endif ManifoldRect *manifold_rect(void *mem, double x1, double y1, double x2, double y2) { auto p1 = vec2(x1, y1); @@ -100,3 +103,6 @@ int manifold_rect_does_overlap_rect(ManifoldRect *a, ManifoldRect *r) { int manifold_rect_is_empty(ManifoldRect *r) { return from_c(r)->IsEmpty(); } int manifold_rect_is_finite(ManifoldRect *r) { return from_c(r)->IsFinite(); } +#ifdef __cplusplus +} +#endif diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index ecf997ac7..e2dfb70bc 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -51,7 +51,7 @@ set(DOCSTRING_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/../../src/manifold/src/sort.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../src/cross_section/src/cross_section.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../src/polygon/src/polygon.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../../src/utilities/include/public.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../src/utilities/include/manifold/common.h ) add_custom_command( OUTPUT autogen_docstrings.inl diff --git a/bindings/python/gen_docs.py b/bindings/python/gen_docs.py index fd353bf0b..1ee1adaa6 100644 --- a/bindings/python/gen_docs.py +++ b/bindings/python/gen_docs.py @@ -96,7 +96,7 @@ def select_functions(s): f"{base}/src/cross_section/src/cross_section.cpp", lambda s: method_re.search(s) ) collect(f"{base}/src/polygon/src/polygon.cpp", select_functions) -collect(f"{base}/src/utilities/include/public.h", select_functions) +collect(f"{base}/src/utilities/include/manifold/common.h", select_functions) comments = dict(sorted(comments.items())) diff --git a/bindings/python/manifold3d.cpp b/bindings/python/manifold3d.cpp index cc492527e..ee5f13375 100644 --- a/bindings/python/manifold3d.cpp +++ b/bindings/python/manifold3d.cpp @@ -16,8 +16,9 @@ #include #include "autogen_docstrings.inl" // generated in build folder -#include "cross_section.h" -#include "manifold.h" +#include "manifold/cross_section.h" +#include "manifold/manifold.h" +#include "manifold/polygon.h" #include "nanobind/nanobind.h" #include "nanobind/ndarray.h" #include "nanobind/operators.h" @@ -26,7 +27,6 @@ #include "nanobind/stl/pair.h" #include "nanobind/stl/tuple.h" #include "nanobind/stl/vector.h" -#include "polygon.h" namespace nb = nanobind; using namespace manifold; @@ -257,7 +257,9 @@ NB_MODULE(manifold3d, m) { .def("scale", &Manifold::Scale, nb::arg("v"), manifold__scale__v) .def( "scale", - [](const Manifold &self, double s) { self.Scale({s, s, s}); }, + [](const Manifold &self, double s) { + self.Scale({s, s, s}); + }, nb::arg("s"), "Scale this Manifold in space. This operation can be chained. " "Transforms are combined and applied lazily.\n\n" @@ -646,7 +648,9 @@ NB_MODULE(manifold3d, m) { cross_section__scale__scale) .def( "scale", - [](const CrossSection &self, double s) { self.Scale({s, s}); }, + [](const CrossSection &self, double s) { + self.Scale({s, s}); + }, nb::arg("s"), "Scale this CrossSection in space. This operation can be chained. " "Transforms are combined and applied lazily." diff --git a/bindings/wasm/bindings.cpp b/bindings/wasm/bindings.cpp index e867d03eb..8e04adc67 100644 --- a/bindings/wasm/bindings.cpp +++ b/bindings/wasm/bindings.cpp @@ -17,10 +17,10 @@ #include -#include "cross_section.h" +#include "manifold/cross_section.h" #include "helpers.cpp" -#include "manifold.h" -#include "polygon.h" +#include "manifold/manifold.h" +#include "manifold/polygon.h" using namespace emscripten; using namespace manifold; diff --git a/bindings/wasm/helpers.cpp b/bindings/wasm/helpers.cpp index 0977b264a..fe3f36c24 100644 --- a/bindings/wasm/helpers.cpp +++ b/bindings/wasm/helpers.cpp @@ -3,9 +3,9 @@ #include -#include "cross_section.h" -#include "manifold.h" -#include "polygon.h" +#include "manifold/cross_section.h" +#include "manifold/manifold.h" +#include "manifold/polygon.h" using namespace emscripten; using namespace manifold; diff --git a/extras/convert_file.cpp b/extras/convert_file.cpp index b9e7ca0e7..402f0d827 100644 --- a/extras/convert_file.cpp +++ b/extras/convert_file.cpp @@ -14,8 +14,8 @@ #include -#include "manifold.h" -#include "meshIO.h" +#include "manifold/manifold.h" +#include "manifold/meshIO.h" using namespace manifold; @@ -64,4 +64,4 @@ int main(int argc, char** argv) { } return 0; -} \ No newline at end of file +} diff --git a/extras/large_scene_test.cpp b/extras/large_scene_test.cpp index 6a71d4b80..8e85d53e7 100644 --- a/extras/large_scene_test.cpp +++ b/extras/large_scene_test.cpp @@ -15,7 +15,7 @@ #include #include -#include "manifold.h" +#include "manifold/manifold.h" using namespace manifold; diff --git a/extras/minimize_testcase.cpp b/extras/minimize_testcase.cpp index d0f573d57..54a7c5348 100644 --- a/extras/minimize_testcase.cpp +++ b/extras/minimize_testcase.cpp @@ -6,8 +6,8 @@ #include #endif -#include "polygon.h" -#include "utils.h" +#include "manifold/polygon.h" +#include "manifold/utils.h" using namespace manifold; diff --git a/extras/perf_test.cpp b/extras/perf_test.cpp index e370f9840..9dc039065 100644 --- a/extras/perf_test.cpp +++ b/extras/perf_test.cpp @@ -15,7 +15,7 @@ #include #include -#include "manifold.h" +#include "manifold/manifold.h" using namespace manifold; diff --git a/extras/perf_test_cgal.cpp b/extras/perf_test_cgal.cpp index e43f6ea96..0f61e3e6c 100644 --- a/extras/perf_test_cgal.cpp +++ b/extras/perf_test_cgal.cpp @@ -21,7 +21,7 @@ #include #include -#include "manifold.h" +#include "manifold/manifold.h" using namespace manifold; diff --git a/extras/stl_test.cpp b/extras/stl_test.cpp index 299df741a..4d2c7f502 100644 --- a/extras/stl_test.cpp +++ b/extras/stl_test.cpp @@ -10,7 +10,7 @@ #include #include -#include "par.h" +#include "manifold/parallel.h" static constexpr size_t g_Iterations = 5; static constexpr size_t g_IterationsDiscard = 1; diff --git a/extras/test_hull_performance.cpp b/extras/test_hull_performance.cpp index 3cd05152c..d4d2d522d 100644 --- a/extras/test_hull_performance.cpp +++ b/extras/test_hull_performance.cpp @@ -27,8 +27,8 @@ #include #include // For string manipulation -#include "manifold.h" -#include "meshIO.h" +#include "manifold/manifold.h" +#include "manifold/meshIO.h" #include "samples.h" using namespace std; using namespace glm; diff --git a/meshIO/CMakeLists.txt b/meshIO/CMakeLists.txt index d551a501b..8fa9f6a3c 100644 --- a/meshIO/CMakeLists.txt +++ b/meshIO/CMakeLists.txt @@ -17,7 +17,7 @@ project(meshIO) add_library(${PROJECT_NAME} src/meshIO.cpp) target_include_directories(${PROJECT_NAME} PUBLIC - $ + $ $) target_link_libraries(${PROJECT_NAME} @@ -29,4 +29,4 @@ target_compile_options(${PROJECT_NAME} PRIVATE ${MANIFOLD_FLAGS}) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) install(TARGETS ${PROJECT_NAME} EXPORT manifoldTargets) -install(FILES include/meshIO.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) +install(FILES include/manifold/meshIO.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) diff --git a/meshIO/include/meshIO.h b/meshIO/include/manifold/meshIO.h similarity index 98% rename from meshIO/include/meshIO.h rename to meshIO/include/manifold/meshIO.h index 87e08f651..397598ec7 100644 --- a/meshIO/include/meshIO.h +++ b/meshIO/include/manifold/meshIO.h @@ -15,7 +15,7 @@ #pragma once #include -#include "manifold.h" +#include "manifold/manifold.h" namespace manifold { diff --git a/meshIO/src/meshIO.cpp b/meshIO/src/meshIO.cpp index 0498e7058..88b0297dc 100644 --- a/meshIO/src/meshIO.cpp +++ b/meshIO/src/meshIO.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "meshIO.h" +#include "manifold/meshIO.h" #include #include @@ -22,7 +22,7 @@ #include "assimp/material.h" #include "assimp/postprocess.h" #include "assimp/scene.h" -#include "optional_assert.h" +#include "manifold/optional_assert.h" #ifndef AI_MATKEY_ROUGHNESS_FACTOR #include "assimp/pbrmaterial.h" diff --git a/samples/include/samples.h b/samples/include/samples.h index 01b29fa76..51317a15f 100644 --- a/samples/include/samples.h +++ b/samples/include/samples.h @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "manifold.h" +#include "manifold/manifold.h" namespace manifold { diff --git a/samples/src/bracelet.cpp b/samples/src/bracelet.cpp index 06f9734f7..5138b0654 100644 --- a/samples/src/bracelet.cpp +++ b/samples/src/bracelet.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cross_section.h" +#include "manifold/cross_section.h" #include "samples.h" namespace { diff --git a/samples/src/gyroid_module.cpp b/samples/src/gyroid_module.cpp index 8b8bbe4aa..98350fe7a 100644 --- a/samples/src/gyroid_module.cpp +++ b/samples/src/gyroid_module.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "manifold.h" +#include "manifold/manifold.h" #include "samples.h" namespace { diff --git a/samples/src/knot.cpp b/samples/src/knot.cpp index da527a8c1..09d6e4350 100644 --- a/samples/src/knot.cpp +++ b/samples/src/knot.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cross_section.h" +#include "manifold/cross_section.h" #include "samples.h" namespace { diff --git a/src/collider/CMakeLists.txt b/src/collider/CMakeLists.txt index ecbccfdfe..2f5d20a25 100644 --- a/src/collider/CMakeLists.txt +++ b/src/collider/CMakeLists.txt @@ -16,7 +16,7 @@ project (collider) add_library(${PROJECT_NAME} INTERFACE) target_include_directories(${PROJECT_NAME} INTERFACE - $ + $ $) target_link_libraries(${PROJECT_NAME} INTERFACE utilities) target_compile_options(${PROJECT_NAME} INTERFACE ${MANIFOLD_FLAGS}) diff --git a/src/collider/include/collider.h b/src/collider/include/manifold/collider.h similarity index 98% rename from src/collider/include/collider.h rename to src/collider/include/manifold/collider.h index 93f9f8950..2cfc8dfa7 100644 --- a/src/collider/include/collider.h +++ b/src/collider/include/manifold/collider.h @@ -13,11 +13,11 @@ // limitations under the License. #pragma once -#include "par.h" -#include "public.h" -#include "sparse.h" -#include "utils.h" -#include "vec.h" +#include "manifold/parallel.h" +#include "manifold/common.h" +#include "manifold/sparse.h" +#include "manifold/utils.h" +#include "manifold/vec.h" #ifdef _MSC_VER #include diff --git a/src/cross_section/CMakeLists.txt b/src/cross_section/CMakeLists.txt index 1fe77ebb2..00b4fb4f3 100644 --- a/src/cross_section/CMakeLists.txt +++ b/src/cross_section/CMakeLists.txt @@ -16,7 +16,7 @@ project (cross_section) file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS *.cpp) add_library(${PROJECT_NAME} ${SOURCE_FILES}) target_include_directories(${PROJECT_NAME} PUBLIC - $ + $ $) if(TARGET Clipper2::Clipper2) diff --git a/src/cross_section/include/cross_section.h b/src/cross_section/include/manifold/cross_section.h similarity index 98% rename from src/cross_section/include/cross_section.h rename to src/cross_section/include/manifold/cross_section.h index ec2c42de5..bf016692a 100644 --- a/src/cross_section/include/cross_section.h +++ b/src/cross_section/include/manifold/cross_section.h @@ -18,8 +18,8 @@ #include #include -#include "public.h" -#include "vec_view.h" +#include "manifold/common.h" +#include "manifold/vec_view.h" namespace manifold { diff --git a/src/cross_section/src/cross_section.cpp b/src/cross_section/src/cross_section.cpp index be52e3a35..5b25c1b7e 100644 --- a/src/cross_section/src/cross_section.cpp +++ b/src/cross_section/src/cross_section.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cross_section.h" +#include "manifold/cross_section.h" #include "clipper2/clipper.core.h" #include "clipper2/clipper.h" diff --git a/src/manifold/CMakeLists.txt b/src/manifold/CMakeLists.txt index ed5e30e53..6b784e71b 100644 --- a/src/manifold/CMakeLists.txt +++ b/src/manifold/CMakeLists.txt @@ -18,7 +18,7 @@ file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS *.cpp) add_library(${PROJECT_NAME} ${SOURCE_FILES}) target_include_directories(${PROJECT_NAME} PUBLIC - $ + $ $) target_link_libraries(${PROJECT_NAME} PUBLIC utilities diff --git a/src/manifold/include/manifold.h b/src/manifold/include/manifold/manifold.h similarity index 99% rename from src/manifold/include/manifold.h rename to src/manifold/include/manifold/manifold.h index 0e3ebbfb3..bc081849f 100644 --- a/src/manifold/include/manifold.h +++ b/src/manifold/include/manifold/manifold.h @@ -16,8 +16,8 @@ #include #include -#include "public.h" -#include "vec_view.h" +#include "manifold/common.h" +#include "manifold/vec_view.h" namespace manifold { diff --git a/src/manifold/src/boolean3.cpp b/src/manifold/src/boolean3.cpp index efa2a7368..15e98c80c 100644 --- a/src/manifold/src/boolean3.cpp +++ b/src/manifold/src/boolean3.cpp @@ -16,7 +16,7 @@ #include -#include "par.h" +#include "manifold/parallel.h" using namespace manifold; diff --git a/src/manifold/src/boolean_result.cpp b/src/manifold/src/boolean_result.cpp index 5dfa01da7..fac064d3b 100644 --- a/src/manifold/src/boolean_result.cpp +++ b/src/manifold/src/boolean_result.cpp @@ -30,7 +30,7 @@ template using concurrent_map = std::map; #endif #include "boolean3.h" -#include "par.h" +#include "manifold/parallel.h" using namespace manifold; diff --git a/src/manifold/src/constructors.cpp b/src/manifold/src/constructors.cpp index 7259125e7..cae95f7c2 100644 --- a/src/manifold/src/constructors.cpp +++ b/src/manifold/src/constructors.cpp @@ -14,8 +14,8 @@ #include "csg_tree.h" #include "impl.h" -#include "par.h" -#include "polygon.h" +#include "manifold/parallel.h" +#include "manifold/polygon.h" namespace manifold { /** diff --git a/src/manifold/src/csg_tree.cpp b/src/manifold/src/csg_tree.cpp index 768c8d44e..be7f17a3a 100644 --- a/src/manifold/src/csg_tree.cpp +++ b/src/manifold/src/csg_tree.cpp @@ -25,7 +25,7 @@ #include "csg_tree.h" #include "impl.h" #include "mesh_fixes.h" -#include "par.h" +#include "manifold/parallel.h" constexpr int kParallelThreshold = 4096; diff --git a/src/manifold/src/csg_tree.h b/src/manifold/src/csg_tree.h index 814462b12..c94c8a9ef 100644 --- a/src/manifold/src/csg_tree.h +++ b/src/manifold/src/csg_tree.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include "manifold.h" -#include "utils.h" +#include "manifold/manifold.h" +#include "manifold/utils.h" namespace manifold { diff --git a/src/manifold/src/edge_op.cpp b/src/manifold/src/edge_op.cpp index 7ff27fcec..78f10af99 100644 --- a/src/manifold/src/edge_op.cpp +++ b/src/manifold/src/edge_op.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include "impl.h" -#include "par.h" +#include "manifold/parallel.h" namespace { using namespace manifold; diff --git a/src/manifold/src/face_op.cpp b/src/manifold/src/face_op.cpp index 4a82cb149..0b9409e2f 100644 --- a/src/manifold/src/face_op.cpp +++ b/src/manifold/src/face_op.cpp @@ -20,7 +20,7 @@ #include #include "impl.h" -#include "polygon.h" +#include "manifold/polygon.h" namespace manifold { diff --git a/src/manifold/src/impl.cpp b/src/manifold/src/impl.cpp index e41576c84..02f5f3f6e 100644 --- a/src/manifold/src/impl.cpp +++ b/src/manifold/src/impl.cpp @@ -19,11 +19,11 @@ #include #include -#include "hashtable.h" +#include "manifold/hashtable.h" #include "mesh_fixes.h" -#include "par.h" -#include "svd.h" -#include "tri_dist.h" +#include "manifold/parallel.h" +#include "manifold/svd.h" +#include "manifold/tri_dist.h" namespace { using namespace manifold; diff --git a/src/manifold/src/impl.h b/src/manifold/src/impl.h index 6815448a0..754bc97f9 100644 --- a/src/manifold/src/impl.h +++ b/src/manifold/src/impl.h @@ -15,15 +15,15 @@ #pragma once #include -#include "collider.h" -#include "manifold.h" -#include "optional_assert.h" -#include "polygon.h" +#include "manifold/collider.h" +#include "manifold/manifold.h" +#include "manifold/optional_assert.h" +#include "manifold/polygon.h" +#include "manifold/sparse.h" +#include "manifold/utils.h" +#include "manifold/vec.h" #include "quickhull.h" #include "shared.h" -#include "sparse.h" -#include "utils.h" -#include "vec.h" namespace manifold { diff --git a/src/manifold/src/manifold.cpp b/src/manifold/src/manifold.cpp index 811f35e4b..a0893bdd2 100644 --- a/src/manifold/src/manifold.cpp +++ b/src/manifold/src/manifold.cpp @@ -19,7 +19,7 @@ #include "boolean3.h" #include "csg_tree.h" #include "impl.h" -#include "par.h" +#include "manifold/parallel.h" #include "quickhull.h" namespace { diff --git a/src/manifold/src/properties.cpp b/src/manifold/src/properties.cpp index ef5303053..1b10d8e70 100644 --- a/src/manifold/src/properties.cpp +++ b/src/manifold/src/properties.cpp @@ -15,8 +15,8 @@ #include #include "impl.h" -#include "par.h" -#include "tri_dist.h" +#include "manifold/parallel.h" +#include "manifold/tri_dist.h" namespace { using namespace manifold; diff --git a/src/manifold/src/quickhull.h b/src/manifold/src/quickhull.h index ad2ca13e5..2ed407c66 100644 --- a/src/manifold/src/quickhull.h +++ b/src/manifold/src/quickhull.h @@ -59,7 +59,7 @@ #include #include "shared.h" -#include "vec.h" +#include "manifold/vec.h" namespace manifold { diff --git a/src/manifold/src/sdf.cpp b/src/manifold/src/sdf.cpp index a71f46611..983f961f5 100644 --- a/src/manifold/src/sdf.cpp +++ b/src/manifold/src/sdf.cpp @@ -14,12 +14,12 @@ #include -#include "hashtable.h" +#include "manifold/hashtable.h" #include "impl.h" -#include "manifold.h" -#include "par.h" -#include "utils.h" -#include "vec.h" +#include "manifold/manifold.h" +#include "manifold/parallel.h" +#include "manifold/utils.h" +#include "manifold/vec.h" namespace { using namespace manifold; diff --git a/src/manifold/src/shared.h b/src/manifold/src/shared.h index cc05cf20a..f27725c86 100644 --- a/src/manifold/src/shared.h +++ b/src/manifold/src/shared.h @@ -14,10 +14,10 @@ #pragma once -#include "par.h" -#include "sparse.h" -#include "utils.h" -#include "vec.h" +#include "manifold/parallel.h" +#include "manifold/sparse.h" +#include "manifold/utils.h" +#include "manifold/vec.h" namespace manifold { diff --git a/src/manifold/src/smoothing.cpp b/src/manifold/src/smoothing.cpp index e01dba2b0..e4925c0a8 100644 --- a/src/manifold/src/smoothing.cpp +++ b/src/manifold/src/smoothing.cpp @@ -16,7 +16,7 @@ #include #include "impl.h" -#include "par.h" +#include "manifold/parallel.h" namespace { using namespace manifold; diff --git a/src/manifold/src/sort.cpp b/src/manifold/src/sort.cpp index a2f3c6283..b7bce43df 100644 --- a/src/manifold/src/sort.cpp +++ b/src/manifold/src/sort.cpp @@ -16,7 +16,7 @@ #include #include "impl.h" -#include "par.h" +#include "manifold/parallel.h" namespace { using namespace manifold; diff --git a/src/manifold/src/subdivision.cpp b/src/manifold/src/subdivision.cpp index c12ad2849..fca2a9aaf 100644 --- a/src/manifold/src/subdivision.cpp +++ b/src/manifold/src/subdivision.cpp @@ -13,7 +13,7 @@ // limitations under the License. #include "impl.h" -#include "par.h" +#include "manifold/parallel.h" template <> struct std::hash { diff --git a/src/polygon/CMakeLists.txt b/src/polygon/CMakeLists.txt index 46274125a..3e76fd37b 100644 --- a/src/polygon/CMakeLists.txt +++ b/src/polygon/CMakeLists.txt @@ -17,7 +17,7 @@ project (polygon) file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS *.cpp) add_library(${PROJECT_NAME} ${SOURCE_FILES}) target_include_directories(${PROJECT_NAME} PUBLIC - $ + $ $) target_link_libraries(${PROJECT_NAME} PUBLIC utilities diff --git a/src/polygon/include/polygon.h b/src/polygon/include/manifold/polygon.h similarity index 96% rename from src/polygon/include/polygon.h rename to src/polygon/include/manifold/polygon.h index 069667946..789b405b9 100644 --- a/src/polygon/include/polygon.h +++ b/src/polygon/include/manifold/polygon.h @@ -13,9 +13,7 @@ // limitations under the License. #pragma once -#include - -#include "public.h" +#include "manifold/common.h" namespace manifold { diff --git a/src/polygon/src/polygon.cpp b/src/polygon/src/polygon.cpp index 53da3a137..9ba473d5d 100644 --- a/src/polygon/src/polygon.cpp +++ b/src/polygon/src/polygon.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "polygon.h" +#include "manifold/polygon.h" #include #include -#include "collider.h" -#include "optional_assert.h" -#include "utils.h" +#include "manifold/collider.h" +#include "manifold/optional_assert.h" +#include "manifold/utils.h" namespace { using namespace manifold; diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt index 0c60f6aa7..1b2ad0c99 100644 --- a/src/utilities/CMakeLists.txt +++ b/src/utilities/CMakeLists.txt @@ -53,16 +53,10 @@ else() endif() target_include_directories(${PROJECT_NAME} INTERFACE - $ + $ $) target_link_libraries(${PROJECT_NAME} INTERFACE glm::glm) -# if(NOT MSVC) -# target_precompile_headers(${PROJECT_NAME} INTERFACE -# $ -# $) -# endif() - if(MANIFOLD_EXCEPTIONS) target_compile_options(${PROJECT_NAME} INTERFACE -DMANIFOLD_EXCEPTIONS=1 @@ -78,5 +72,8 @@ target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17) install(TARGETS ${PROJECT_NAME} EXPORT manifoldTargets) install(FILES - include/public.h include/vec_view.h include/tri_dist.h include/optional_assert.h + include/manifold/common.h + include/manifold/vec_view.h + include/manifold/tri_dist.h + include/manifold/optional_assert.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) diff --git a/src/utilities/include/public.h b/src/utilities/include/manifold/common.h similarity index 100% rename from src/utilities/include/public.h rename to src/utilities/include/manifold/common.h diff --git a/src/utilities/include/hashtable.h b/src/utilities/include/manifold/hashtable.h similarity index 98% rename from src/utilities/include/hashtable.h rename to src/utilities/include/manifold/hashtable.h index 7b859a468..8a4e11e37 100644 --- a/src/utilities/include/hashtable.h +++ b/src/utilities/include/manifold/hashtable.h @@ -16,8 +16,8 @@ #include -#include "public.h" -#include "vec.h" +#include "manifold/common.h" +#include "manifold/vec.h" namespace { typedef unsigned long long int Uint64; diff --git a/src/utilities/include/iters.h b/src/utilities/include/manifold/iters.h similarity index 100% rename from src/utilities/include/iters.h rename to src/utilities/include/manifold/iters.h diff --git a/src/utilities/include/optional_assert.h b/src/utilities/include/manifold/optional_assert.h similarity index 98% rename from src/utilities/include/optional_assert.h rename to src/utilities/include/manifold/optional_assert.h index 9a8f9ba80..6997b17da 100644 --- a/src/utilities/include/optional_assert.h +++ b/src/utilities/include/manifold/optional_assert.h @@ -14,7 +14,6 @@ #pragma once -#include "public.h" #ifdef MANIFOLD_EXCEPTIONS #include #endif diff --git a/src/utilities/include/par.h b/src/utilities/include/manifold/parallel.h similarity index 99% rename from src/utilities/include/par.h rename to src/utilities/include/manifold/parallel.h index 9d400e6b9..02f59560d 100644 --- a/src/utilities/include/par.h +++ b/src/utilities/include/manifold/parallel.h @@ -26,8 +26,8 @@ #include #include -#include "iters.h" -#include "public.h" +#include "manifold/iters.h" +#include "manifold/common.h" namespace manifold { enum class ExecutionPolicy { diff --git a/src/utilities/include/sparse.h b/src/utilities/include/manifold/sparse.h similarity index 97% rename from src/utilities/include/sparse.h rename to src/utilities/include/manifold/sparse.h index eca027de0..6e24a6337 100644 --- a/src/utilities/include/sparse.h +++ b/src/utilities/include/manifold/sparse.h @@ -15,11 +15,11 @@ #pragma once #include -#include "optional_assert.h" -#include "par.h" -#include "public.h" -#include "utils.h" -#include "vec.h" +#include "manifold/optional_assert.h" +#include "manifold/parallel.h" +#include "manifold/common.h" +#include "manifold/utils.h" +#include "manifold/vec.h" namespace { template diff --git a/src/utilities/include/svd.h b/src/utilities/include/manifold/svd.h similarity index 99% rename from src/utilities/include/svd.h rename to src/utilities/include/manifold/svd.h index 31edac853..4bb532e47 100644 --- a/src/utilities/include/svd.h +++ b/src/utilities/include/manifold/svd.h @@ -24,12 +24,9 @@ // Modified from https://github.com/wi-re/tbtSVD, removing CUDA dependence and // approximate inverse square roots. -#include #include -#include -#include -#include "public.h" +#include "manifold/common.h" namespace { using manifold::mat3; diff --git a/src/utilities/include/tri_dist.h b/src/utilities/include/manifold/tri_dist.h similarity index 99% rename from src/utilities/include/tri_dist.h rename to src/utilities/include/manifold/tri_dist.h index 7a536eb03..b3d7b19f0 100644 --- a/src/utilities/include/tri_dist.h +++ b/src/utilities/include/manifold/tri_dist.h @@ -17,7 +17,7 @@ #include #include -#include "public.h" +#include "manifold/common.h" namespace manifold { diff --git a/src/utilities/include/utils.h b/src/utilities/include/manifold/utils.h similarity index 98% rename from src/utilities/include/utils.h rename to src/utilities/include/manifold/utils.h index 58b77c0eb..f5fcd4d66 100644 --- a/src/utilities/include/utils.h +++ b/src/utilities/include/manifold/utils.h @@ -23,8 +23,8 @@ #include #endif -#include "par.h" -#include "vec.h" +#include "manifold/parallel.h" +#include "manifold/vec.h" #if __has_include() #include diff --git a/src/utilities/include/vec.h b/src/utilities/include/manifold/vec.h similarity index 99% rename from src/utilities/include/vec.h rename to src/utilities/include/manifold/vec.h index 4d26ba129..db85d8ed3 100644 --- a/src/utilities/include/vec.h +++ b/src/utilities/include/manifold/vec.h @@ -20,8 +20,8 @@ #define TracyFreeS(ptr, n) (void)0 #endif -#include "par.h" -#include "vec_view.h" +#include "manifold/parallel.h" +#include "manifold/vec_view.h" namespace manifold { diff --git a/src/utilities/include/vec_view.h b/src/utilities/include/manifold/vec_view.h similarity index 98% rename from src/utilities/include/vec_view.h rename to src/utilities/include/manifold/vec_view.h index f11ef29b0..f0a310ab9 100644 --- a/src/utilities/include/vec_view.h +++ b/src/utilities/include/manifold/vec_view.h @@ -14,7 +14,7 @@ #pragma once -#include "optional_assert.h" +#include "manifold/optional_assert.h" namespace manifold { diff --git a/test-cmake.sh b/test-cmake.sh index 3bf014c64..6db8b04e1 100755 --- a/test-cmake.sh +++ b/test-cmake.sh @@ -11,7 +11,7 @@ target_link_libraries(testing PRIVATE manifold) EOT cat <> test.cpp -#include "manifold.h" +#include "manifold/manifold.h" int main() { manifold::Manifold foo; return 0; } EOT diff --git a/test/boolean_complex_test.cpp b/test/boolean_complex_test.cpp index 88b281abd..7a61acdbf 100644 --- a/test/boolean_complex_test.cpp +++ b/test/boolean_complex_test.cpp @@ -13,10 +13,10 @@ // limitations under the License. #ifdef MANIFOLD_CROSS_SECTION -#include "cross_section.h" +#include "manifold/cross_section.h" #endif -#include "manifold.h" -#include "polygon.h" +#include "manifold/manifold.h" +#include "manifold/polygon.h" #include "test.h" using namespace manifold; diff --git a/test/boolean_test.cpp b/test/boolean_test.cpp index 7812c4df1..3ba1dddf5 100644 --- a/test/boolean_test.cpp +++ b/test/boolean_test.cpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "manifold.h" -#include "polygon.h" +#include "manifold/manifold.h" +#include "manifold/polygon.h" #include "test.h" using namespace manifold; diff --git a/test/cross_section_test.cpp b/test/cross_section_test.cpp index a7035a828..816f504db 100644 --- a/test/cross_section_test.cpp +++ b/test/cross_section_test.cpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cross_section.h" +#include "manifold/cross_section.h" #include #include -#include "manifold.h" -#include "polygon.h" -#include "public.h" +#include "manifold/manifold.h" +#include "manifold/polygon.h" +#include "manifold/common.h" #include "test.h" using namespace manifold; diff --git a/test/hull_test.cpp b/test/hull_test.cpp index 1386dc875..06eccc07e 100644 --- a/test/hull_test.cpp +++ b/test/hull_test.cpp @@ -14,10 +14,10 @@ #include -#include "manifold.h" +#include "manifold/manifold.h" +#include "manifold/tri_dist.h" #include "samples.h" #include "test.h" -#include "tri_dist.h" using namespace manifold; diff --git a/test/manifold_test.cpp b/test/manifold_test.cpp index 481152214..a28ba0424 100644 --- a/test/manifold_test.cpp +++ b/test/manifold_test.cpp @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "manifold.h" +#include "manifold/manifold.h" #include #ifdef MANIFOLD_CROSS_SECTION -#include "cross_section.h" +#include "manifold/cross_section.h" #endif #include "samples.h" #include "test.h" -#include "tri_dist.h" +#include "manifold/tri_dist.h" namespace { diff --git a/test/manifoldc_test.cpp b/test/manifoldc_test.cpp index 38aa310dc..3f172c5de 100644 --- a/test/manifoldc_test.cpp +++ b/test/manifoldc_test.cpp @@ -1,9 +1,9 @@ -#include "manifoldc.h" +#include "manifold/manifoldc.h" #include "gtest/gtest.h" -#include "manifold.h" -#include "polygon.h" -#include "types.h" +#include "manifold/manifold.h" +#include "manifold/polygon.h" +#include "manifold/types.h" TEST(CBIND, sphere) { int n = 25; diff --git a/test/polygon_fuzz.cpp b/test/polygon_fuzz.cpp index 8eac775a4..c7faaff6a 100644 --- a/test/polygon_fuzz.cpp +++ b/test/polygon_fuzz.cpp @@ -18,7 +18,7 @@ #include "fuzztest/fuzztest.h" #include "gtest/gtest.h" -#include "polygon.h" +#include "manifold/polygon.h" using namespace fuzztest; diff --git a/test/polygon_test.cpp b/test/polygon_test.cpp index 2c29b5bee..f433cc656 100644 --- a/test/polygon_test.cpp +++ b/test/polygon_test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "polygon.h" +#include "manifold/polygon.h" #include #include diff --git a/test/properties_test.cpp b/test/properties_test.cpp index ea048f471..2f8cdcf7f 100644 --- a/test/properties_test.cpp +++ b/test/properties_test.cpp @@ -14,10 +14,10 @@ #include -#include "manifold.h" +#include "manifold/manifold.h" #include "samples.h" #include "test.h" -#include "tri_dist.h" +#include "manifold/tri_dist.h" using namespace manifold; diff --git a/test/samples_test.cpp b/test/samples_test.cpp index ace137a77..235152996 100644 --- a/test/samples_test.cpp +++ b/test/samples_test.cpp @@ -15,9 +15,9 @@ #include "samples.h" #ifdef MANIFOLD_CROSS_SECTION -#include "cross_section.h" +#include "manifold/cross_section.h" #endif -#include "polygon.h" +#include "manifold/polygon.h" #include "test.h" using namespace manifold; diff --git a/test/sdf_test.cpp b/test/sdf_test.cpp index 094332031..f0aa0fb98 100644 --- a/test/sdf_test.cpp +++ b/test/sdf_test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "manifold.h" +#include "manifold/manifold.h" #include "test.h" using namespace manifold; diff --git a/test/smooth_test.cpp b/test/smooth_test.cpp index b8448c7df..248aaa41e 100644 --- a/test/smooth_test.cpp +++ b/test/smooth_test.cpp @@ -15,12 +15,12 @@ #include #ifdef MANIFOLD_CROSS_SECTION -#include "cross_section.h" +#include "manifold/cross_section.h" #endif -#include "manifold.h" +#include "manifold/manifold.h" #include "samples.h" #include "test.h" -#include "tri_dist.h" +#include "manifold/tri_dist.h" using namespace manifold; diff --git a/test/test.h b/test/test.h index 11e603151..9f0f20bb2 100644 --- a/test/test.h +++ b/test/test.h @@ -16,11 +16,11 @@ #include #include "gtest/gtest.h" -#include "manifold.h" -#include "public.h" +#include "manifold/manifold.h" +#include "manifold/common.h" #ifdef MANIFOLD_EXPORT -#include "meshIO.h" +#include "manifold/meshIO.h" #endif // somehow gcc11 + gtest 1.11.0 is unable to print ivec3 diff --git a/test/test_main.cpp b/test/test_main.cpp index 477aafccd..e4f166da2 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -13,8 +13,8 @@ // limitations under the License. #include -#include "manifold.h" -#include "polygon.h" +#include "manifold/manifold.h" +#include "manifold/polygon.h" #include "test.h" // we need to call some tracy API to establish the connection From 93cafdd4c4c61a6bc1d5892d9d4bd74ec0e34fa6 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Sun, 8 Sep 2024 13:08:57 +0800 Subject: [PATCH 2/6] expose parallel.h --- src/utilities/CMakeLists.txt | 2 ++ test-cmake.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt index 1b2ad0c99..c973f5352 100644 --- a/src/utilities/CMakeLists.txt +++ b/src/utilities/CMakeLists.txt @@ -76,4 +76,6 @@ install(FILES include/manifold/vec_view.h include/manifold/tri_dist.h include/manifold/optional_assert.h + include/manifold/iters.h + include/manifold/parallel.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) diff --git a/test-cmake.sh b/test-cmake.sh index 6db8b04e1..7f7e662e3 100755 --- a/test-cmake.sh +++ b/test-cmake.sh @@ -12,6 +12,7 @@ EOT cat <> test.cpp #include "manifold/manifold.h" +#include "manifold/parallel.h" int main() { manifold::Manifold foo; return 0; } EOT From cb470c05854595178526521fc7b8ccb3e52313b5 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Sun, 8 Sep 2024 13:16:10 +0800 Subject: [PATCH 3/6] format --- bindings/c/box.cpp | 2 +- bindings/c/conv.cpp | 2 +- bindings/c/cross.cpp | 2 +- bindings/c/rect.cpp | 2 +- bindings/wasm/bindings.cpp | 2 +- format.sh | 5 +++-- src/collider/include/manifold/collider.h | 4 ++-- src/manifold/src/csg_tree.cpp | 2 +- src/manifold/src/impl.cpp | 2 +- src/manifold/src/quickhull.h | 2 +- src/manifold/src/sdf.cpp | 2 +- src/utilities/include/manifold/common.h | 6 ++++-- src/utilities/include/manifold/parallel.h | 2 +- src/utilities/include/manifold/sparse.h | 2 +- test/cross_section_test.cpp | 2 +- test/manifold_test.cpp | 2 +- test/properties_test.cpp | 2 +- test/smooth_test.cpp | 2 +- test/test.h | 2 +- 19 files changed, 25 insertions(+), 22 deletions(-) diff --git a/bindings/c/box.cpp b/bindings/c/box.cpp index dbed876d4..838d9ab59 100644 --- a/bindings/c/box.cpp +++ b/bindings/c/box.cpp @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "manifold/common.h" #include "manifold/conv.h" #include "manifold/manifold.h" -#include "manifold/common.h" #include "manifold/types.h" #ifdef __cplusplus diff --git a/bindings/c/conv.cpp b/bindings/c/conv.cpp index 6b7b5405e..88fb2b0dd 100644 --- a/bindings/c/conv.cpp +++ b/bindings/c/conv.cpp @@ -16,9 +16,9 @@ #include +#include "manifold/common.h" #include "manifold/cross_section.h" #include "manifold/manifold.h" -#include "manifold/common.h" #include "manifold/types.h" ManifoldManifold *to_c(manifold::Manifold *m) { diff --git a/bindings/c/cross.cpp b/bindings/c/cross.cpp index 6e2df7766..095f3fbe0 100644 --- a/bindings/c/cross.cpp +++ b/bindings/c/cross.cpp @@ -14,10 +14,10 @@ #include +#include "manifold/common.h" #include "manifold/conv.h" #include "manifold/cross_section.h" #include "manifold/manifold.h" -#include "manifold/common.h" #include "manifold/types.h" #ifdef __cplusplus diff --git a/bindings/c/rect.cpp b/bindings/c/rect.cpp index df7ede67f..1478b2b56 100644 --- a/bindings/c/rect.cpp +++ b/bindings/c/rect.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "manifold/common.h" #include "manifold/conv.h" #include "manifold/cross_section.h" #include "manifold/manifold.h" -#include "manifold/common.h" #include "manifold/types.h" #ifdef __cplusplus diff --git a/bindings/wasm/bindings.cpp b/bindings/wasm/bindings.cpp index 8e04adc67..07e7323f6 100644 --- a/bindings/wasm/bindings.cpp +++ b/bindings/wasm/bindings.cpp @@ -17,8 +17,8 @@ #include -#include "manifold/cross_section.h" #include "helpers.cpp" +#include "manifold/cross_section.h" #include "manifold/manifold.h" #include "manifold/polygon.h" diff --git a/format.sh b/format.sh index 996089039..fe2295ba2 100755 --- a/format.sh +++ b/format.sh @@ -10,7 +10,8 @@ $CLANG_FORMAT -i meshIO/**/*.{h,cpp} $CLANG_FORMAT -i samples/**/*.{h,cpp} $CLANG_FORMAT -i test/*.{h,cpp} $CLANG_FORMAT -i bindings/*/*.cpp -$CLANG_FORMAT -i bindings/c/include/*.h +$CLANG_FORMAT -i bindings/c/include/manifold/*.h $CLANG_FORMAT -i bindings/wasm/**/*.{js,ts,html} -$CLANG_FORMAT -i src/!(third_party)/*/*.{h,cpp} +$CLANG_FORMAT -i src/*/src/*.{h,cpp} +$CLANG_FORMAT -i src/*/include/manifold/*.h black bindings/python/examples/*.py diff --git a/src/collider/include/manifold/collider.h b/src/collider/include/manifold/collider.h index 2cfc8dfa7..67bab08ee 100644 --- a/src/collider/include/manifold/collider.h +++ b/src/collider/include/manifold/collider.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include "manifold/parallel.h" #include "manifold/common.h" +#include "manifold/parallel.h" #include "manifold/sparse.h" #include "manifold/utils.h" #include "manifold/vec.h" @@ -277,7 +277,7 @@ constexpr inline uint32_t SpreadBits3(uint32_t v) { /** @ingroup Private */ class Collider { public: - Collider() {}; + Collider(){}; Collider(const VecView& leafBB, const VecView& leafMorton) { diff --git a/src/manifold/src/csg_tree.cpp b/src/manifold/src/csg_tree.cpp index be7f17a3a..f62ba5cfa 100644 --- a/src/manifold/src/csg_tree.cpp +++ b/src/manifold/src/csg_tree.cpp @@ -24,8 +24,8 @@ #include "boolean3.h" #include "csg_tree.h" #include "impl.h" -#include "mesh_fixes.h" #include "manifold/parallel.h" +#include "mesh_fixes.h" constexpr int kParallelThreshold = 4096; diff --git a/src/manifold/src/impl.cpp b/src/manifold/src/impl.cpp index 02f5f3f6e..6e9d5292e 100644 --- a/src/manifold/src/impl.cpp +++ b/src/manifold/src/impl.cpp @@ -20,10 +20,10 @@ #include #include "manifold/hashtable.h" -#include "mesh_fixes.h" #include "manifold/parallel.h" #include "manifold/svd.h" #include "manifold/tri_dist.h" +#include "mesh_fixes.h" namespace { using namespace manifold; diff --git a/src/manifold/src/quickhull.h b/src/manifold/src/quickhull.h index 2ed407c66..e2d9ef57a 100644 --- a/src/manifold/src/quickhull.h +++ b/src/manifold/src/quickhull.h @@ -58,8 +58,8 @@ #include #include -#include "shared.h" #include "manifold/vec.h" +#include "shared.h" namespace manifold { diff --git a/src/manifold/src/sdf.cpp b/src/manifold/src/sdf.cpp index 983f961f5..88a31c23f 100644 --- a/src/manifold/src/sdf.cpp +++ b/src/manifold/src/sdf.cpp @@ -14,8 +14,8 @@ #include -#include "manifold/hashtable.h" #include "impl.h" +#include "manifold/hashtable.h" #include "manifold/manifold.h" #include "manifold/parallel.h" #include "manifold/utils.h" diff --git a/src/utilities/include/manifold/common.h b/src/utilities/include/manifold/common.h index 28731b7a6..f9c620658 100644 --- a/src/utilities/include/manifold/common.h +++ b/src/utilities/include/manifold/common.h @@ -689,11 +689,13 @@ inline std::ostream& operator<<(std::ostream& stream, const mat4x3& mat) { } inline std::ostream& operator<<(std::ostream& stream, const Box& box) { - return stream << "min: " << box.min << ", " << "max: " << box.max; + return stream << "min: " << box.min << ", " + << "max: " << box.max; } inline std::ostream& operator<<(std::ostream& stream, const Rect& box) { - return stream << "min: " << box.min << ", " << "max: " << box.max; + return stream << "min: " << box.min << ", " + << "max: " << box.max; } /** diff --git a/src/utilities/include/manifold/parallel.h b/src/utilities/include/manifold/parallel.h index 02f59560d..de88926a0 100644 --- a/src/utilities/include/manifold/parallel.h +++ b/src/utilities/include/manifold/parallel.h @@ -26,8 +26,8 @@ #include #include -#include "manifold/iters.h" #include "manifold/common.h" +#include "manifold/iters.h" namespace manifold { enum class ExecutionPolicy { diff --git a/src/utilities/include/manifold/sparse.h b/src/utilities/include/manifold/sparse.h index 6e24a6337..337490d77 100644 --- a/src/utilities/include/manifold/sparse.h +++ b/src/utilities/include/manifold/sparse.h @@ -15,9 +15,9 @@ #pragma once #include +#include "manifold/common.h" #include "manifold/optional_assert.h" #include "manifold/parallel.h" -#include "manifold/common.h" #include "manifold/utils.h" #include "manifold/vec.h" diff --git a/test/cross_section_test.cpp b/test/cross_section_test.cpp index 816f504db..059b88787 100644 --- a/test/cross_section_test.cpp +++ b/test/cross_section_test.cpp @@ -18,9 +18,9 @@ #include +#include "manifold/common.h" #include "manifold/manifold.h" #include "manifold/polygon.h" -#include "manifold/common.h" #include "test.h" using namespace manifold; diff --git a/test/manifold_test.cpp b/test/manifold_test.cpp index a28ba0424..1d6dd08bb 100644 --- a/test/manifold_test.cpp +++ b/test/manifold_test.cpp @@ -19,9 +19,9 @@ #ifdef MANIFOLD_CROSS_SECTION #include "manifold/cross_section.h" #endif +#include "manifold/tri_dist.h" #include "samples.h" #include "test.h" -#include "manifold/tri_dist.h" namespace { diff --git a/test/properties_test.cpp b/test/properties_test.cpp index 2f8cdcf7f..e56ff9b14 100644 --- a/test/properties_test.cpp +++ b/test/properties_test.cpp @@ -15,9 +15,9 @@ #include #include "manifold/manifold.h" +#include "manifold/tri_dist.h" #include "samples.h" #include "test.h" -#include "manifold/tri_dist.h" using namespace manifold; diff --git a/test/smooth_test.cpp b/test/smooth_test.cpp index 248aaa41e..20f161750 100644 --- a/test/smooth_test.cpp +++ b/test/smooth_test.cpp @@ -18,9 +18,9 @@ #include "manifold/cross_section.h" #endif #include "manifold/manifold.h" +#include "manifold/tri_dist.h" #include "samples.h" #include "test.h" -#include "manifold/tri_dist.h" using namespace manifold; diff --git a/test/test.h b/test/test.h index 9f0f20bb2..764505ed7 100644 --- a/test/test.h +++ b/test/test.h @@ -16,8 +16,8 @@ #include #include "gtest/gtest.h" -#include "manifold/manifold.h" #include "manifold/common.h" +#include "manifold/manifold.h" #ifdef MANIFOLD_EXPORT #include "manifold/meshIO.h" From 0aabc00998d4d2316bdbddfe9ac4426750ccc091 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Sun, 8 Sep 2024 13:16:45 +0800 Subject: [PATCH 4/6] missing functional --- src/polygon/src/polygon.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/polygon/src/polygon.cpp b/src/polygon/src/polygon.cpp index 9ba473d5d..0843db713 100644 --- a/src/polygon/src/polygon.cpp +++ b/src/polygon/src/polygon.cpp @@ -14,6 +14,7 @@ #include "manifold/polygon.h" +#include #include #include From 80dfee48081589828ca482a550cd9822d3bf003f Mon Sep 17 00:00:00 2001 From: pca006132 Date: Sun, 8 Sep 2024 13:29:53 +0800 Subject: [PATCH 5/6] format --- bindings/python/manifold3d.cpp | 8 ++------ src/collider/include/manifold/collider.h | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/bindings/python/manifold3d.cpp b/bindings/python/manifold3d.cpp index ee5f13375..e9000ff46 100644 --- a/bindings/python/manifold3d.cpp +++ b/bindings/python/manifold3d.cpp @@ -257,9 +257,7 @@ NB_MODULE(manifold3d, m) { .def("scale", &Manifold::Scale, nb::arg("v"), manifold__scale__v) .def( "scale", - [](const Manifold &self, double s) { - self.Scale({s, s, s}); - }, + [](const Manifold &self, double s) { self.Scale({s, s, s}); }, nb::arg("s"), "Scale this Manifold in space. This operation can be chained. " "Transforms are combined and applied lazily.\n\n" @@ -648,9 +646,7 @@ NB_MODULE(manifold3d, m) { cross_section__scale__scale) .def( "scale", - [](const CrossSection &self, double s) { - self.Scale({s, s}); - }, + [](const CrossSection &self, double s) { self.Scale({s, s}); }, nb::arg("s"), "Scale this CrossSection in space. This operation can be chained. " "Transforms are combined and applied lazily." diff --git a/src/collider/include/manifold/collider.h b/src/collider/include/manifold/collider.h index 67bab08ee..37a0cb91e 100644 --- a/src/collider/include/manifold/collider.h +++ b/src/collider/include/manifold/collider.h @@ -277,7 +277,7 @@ constexpr inline uint32_t SpreadBits3(uint32_t v) { /** @ingroup Private */ class Collider { public: - Collider(){}; + Collider() {}; Collider(const VecView& leafBB, const VecView& leafMorton) { From 5e5bbcf7be95761594215299fd4b394b6701a5a9 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Sun, 8 Sep 2024 13:30:24 +0800 Subject: [PATCH 6/6] fix install --- src/cross_section/CMakeLists.txt | 2 +- src/manifold/CMakeLists.txt | 2 +- src/polygon/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cross_section/CMakeLists.txt b/src/cross_section/CMakeLists.txt index 00b4fb4f3..600a40b46 100644 --- a/src/cross_section/CMakeLists.txt +++ b/src/cross_section/CMakeLists.txt @@ -33,4 +33,4 @@ target_compile_options(${PROJECT_NAME} PRIVATE ${MANIFOLD_FLAGS}) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) install(TARGETS ${PROJECT_NAME} EXPORT manifoldTargets) -install(FILES include/cross_section.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) +install(FILES include/manifold/cross_section.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) diff --git a/src/manifold/CMakeLists.txt b/src/manifold/CMakeLists.txt index 6b784e71b..00136b5da 100644 --- a/src/manifold/CMakeLists.txt +++ b/src/manifold/CMakeLists.txt @@ -32,4 +32,4 @@ target_compile_features(${PROJECT_NAME} ) install(TARGETS ${PROJECT_NAME} EXPORT manifoldTargets) -install(FILES include/manifold.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) +install(FILES include/manifold/manifold.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) diff --git a/src/polygon/CMakeLists.txt b/src/polygon/CMakeLists.txt index 3e76fd37b..44338336d 100644 --- a/src/polygon/CMakeLists.txt +++ b/src/polygon/CMakeLists.txt @@ -28,4 +28,4 @@ target_compile_options(${PROJECT_NAME} PRIVATE ${MANIFOLD_FLAGS}) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) install(TARGETS ${PROJECT_NAME} EXPORT manifoldTargets) -install(FILES include/polygon.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) +install(FILES include/manifold/polygon.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME})