Repository: elalish/manifold (language: python)

Issue:
Expose Parallel Algorithms
Expose our parallel algorithm API, so other projects such as openscad can use it.


Discussion / hints:

Fix patch:
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
-    $<INSTALL_INTERFACE:include/${CMAKE_PROJECT_NAME}>
+    $<INSTALL_INTERFACE:include>
     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
 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..838d9ab59 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/common.h"
+#include "manifold/conv.h"
+#include "manifold/manifold.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..88fb2b0dd 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 <vector>
 
-#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"
 
 ManifoldManifold *to_c(manifold::Manifold *m) {
   return reinterpret_cast<ManifoldManifold *>(m);
diff --git a/bindings/c/cross.cpp b/bindings/c/cross.cpp
index e5c16fa47..095f3fbe0 100644
--- a/bindings/c/cross.cpp
+++ b/bindings/c/cross.cpp
@@ -14,12 +14,15 @@
 
 #include <vector>
 
-#include "conv.h"
-#include "cross_section.h"
-#include "manifold.h"
-#include "public.h"
-#include "types.h"
-
+#include "manifold/common.h"
+#include "manifold/conv.h"
+#include "manifold/cross_section.h"
+#include "manifold/manifold.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 <cstring>
 #include <vector>
 
-#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<Manifold>;
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 <stddef.h>
 #include <stdint.h>
 
-#include "types.h"
+#include "manifold/types.h"
 
 #ifdef __cplusplus
 #include <cstdint>
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 <conv.h>
-#include <cross_section.h>
-#include <manifold.h>
-#include <manifoldc.h>
-#include <public.h>
+#include "manifold/manifoldc.h"
 
 #include <vector>
 
-#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..1478b2b56 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/common.h"
+#include "manifold/conv.h"
+#include "manifold/cross_section.h"
+#include "manifold/manifold.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..e9000ff46 100644
--- a/bindings/python/manifold3d.cpp
+++ b/bindings/python/manifold3d.cpp
@@ -16,8 +16,9 @@
 #include <string>
 
 #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;
diff --git a/bindings/wasm/bindings.cpp b/bindings/wasm/bindings.cpp
index e867d03eb..07e7323f6 100644
--- a/bindings/wasm/bindings.cpp
+++ b/bindings/wasm/bindings.cpp
@@ -17,10 +17,10 @@
 
 #include <vector>
 
-#include "cross_section.h"
 #include "helpers.cpp"
-#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/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 <vector>
 
-#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 <iostream>
 
-#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/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/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
-    $<INSTALL_INTERFACE:include/${CMAKE_PROJECT_NAME}>
+    $<INSTALL_INTERFACE:include>
     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
 
 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 <string>
 
-#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 <algorithm>
 #include <iostream>
@@ -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
-    $<INSTALL_INTERFACE:include/${CMAKE_PROJECT_NAME}>
+    $<INSTALL_INTERFACE:include>
     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
 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..37a0cb91e 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/common.h"
+#include "manifold/parallel.h"
+#include "manifold/sparse.h"
+#include "manifold/utils.h"
+#include "manifold/vec.h"
 
 #ifdef _MSC_VER
 #include <intrin.h>
diff --git a/src/cross_section/CMakeLists.txt b/src/cross_section/CMakeLists.txt
index 1fe77ebb2..600a40b46 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
-    $<INSTALL_INTERFACE:include/${CMAKE_PROJECT_NAME}>
+    $<INSTALL_INTERFACE:include>
     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
 
 if(TARGET Clipper2::Clipper2)
@@ -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/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 <memory>
 #include <vector>
 
-#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..00136b5da 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
-    $<INSTALL_INTERFACE:include/${CMAKE_PROJECT_NAME}>
+    $<INSTALL_INTERFACE:include>
     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
 target_link_libraries(${PROJECT_NAME}
     PUBLIC utilities
@@ -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/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 <functional>
 #include <memory>
 
-#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 <limits>
 
-#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 <typename K, typename V>
 using concurrent_map = std::map<K, V>;
 #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..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 "manifold/parallel.h"
 #include "mesh_fixes.h"
-#include "par.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 <unordered_set>
 
 #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..6e9d5292e 100644
--- a/src/manifold/src/impl.cpp
+++ b/src/manifold/src/impl.cpp
@@ -19,11 +19,11 @@
 #include <map>
 #include <numeric>
 
-#include "hashtable.h"
+#include "manifold/hashtable.h"
+#include "manifold/parallel.h"
+#include "manifold/svd.h"
+#include "manifold/tri_dist.h"
 #include "mesh_fixes.h"
-#include "par.h"
-#include "svd.h"
-#include "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 <map>
 
-#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 <limits>
 
 #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..e2d9ef57a 100644
--- a/src/manifold/src/quickhull.h
+++ b/src/manifold/src/quickhull.h
@@ -58,8 +58,8 @@
 #include <deque>
 #include <vector>
 
+#include "manifold/vec.h"
 #include "shared.h"
-#include "vec.h"
 
 namespace manifold {
 
diff --git a/src/manifold/src/sdf.cpp b/src/manifold/src/sdf.cpp
index a71f46611..88a31c23f 100644
--- a/src/manifold/src/sdf.cpp
+++ b/src/manifold/src/sdf.cpp
@@ -14,12 +14,12 @@
 
 #include <glm/gtc/integer.hpp>
 
-#include "hashtable.h"
 #include "impl.h"
-#include "manifold.h"
-#include "par.h"
-#include "utils.h"
-#include "vec.h"
+#include "manifold/hashtable.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 <glm/gtx/quaternion.hpp>
 
 #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 <set>
 
 #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<manifold::ivec4> {
diff --git a/src/polygon/CMakeLists.txt b/src/polygon/CMakeLists.txt
index 46274125a..44338336d 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
-    $<INSTALL_INTERFACE:include/${CMAKE_PROJECT_NAME}>
+    $<INSTALL_INTERFACE:include>
     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
 target_link_libraries(${PROJECT_NAME} 
     PUBLIC utilities 
@@ -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})
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 <functional>
-
-#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..0843db713 100644
--- a/src/polygon/src/polygon.cpp
+++ b/src/polygon/src/polygon.cpp
@@ -12,14 +12,15 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include "polygon.h"
+#include "manifold/polygon.h"
 
+#include <functional>
 #include <map>
 #include <set>
 
-#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..c973f5352 100644
--- a/src/utilities/CMakeLists.txt
+++ b/src/utilities/CMakeLists.txt
@@ -53,16 +53,10 @@ else()
 endif()
 
 target_include_directories(${PROJECT_NAME} INTERFACE
-    $<INSTALL_INTERFACE:include/${CMAKE_PROJECT_NAME}>
+    $<INSTALL_INTERFACE:include>
     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
 target_link_libraries(${PROJECT_NAME} INTERFACE glm::glm)
 
-# if(NOT MSVC)
-# target_precompile_headers(${PROJECT_NAME} INTERFACE
-#     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/par.h>
-#     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/public.h>)
-# endif()
-
 if(MANIFOLD_EXCEPTIONS)
     target_compile_options(${PROJECT_NAME} INTERFACE
         -DMANIFOLD_EXCEPTIONS=1
@@ -78,5 +72,10 @@ 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
+    include/manifold/iters.h
+    include/manifold/parallel.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 99%
rename from src/utilities/include/public.h
rename to src/utilities/include/manifold/common.h
index 28731b7a6..f9c620658 100644
--- a/src/utilities/include/public.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/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 <atomic>
 
-#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 <stdexcept>
 #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..de88926a0 100644
--- a/src/utilities/include/par.h
+++ b/src/utilities/include/manifold/parallel.h
@@ -26,8 +26,8 @@
 #include <algorithm>
 #include <numeric>
 
-#include "iters.h"
-#include "public.h"
+#include "manifold/common.h"
+#include "manifold/iters.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..337490d77 100644
--- a/src/utilities/include/sparse.h
+++ b/src/utilities/include/manifold/sparse.h
@@ -15,11 +15,11 @@
 #pragma once
 #include <math.h>
 
-#include "optional_assert.h"
-#include "par.h"
-#include "public.h"
-#include "utils.h"
-#include "vec.h"
+#include "manifold/common.h"
+#include "manifold/optional_assert.h"
+#include "manifold/parallel.h"
+#include "manifold/utils.h"
+#include "manifold/vec.h"
 
 namespace {
 template <typename T>
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 <algorithm>
 #include <cmath>
-#include <tuple>
-#include <utility>
 
-#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 <array>
 #include <glm/glm.hpp>
 
-#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 <iostream>
 #endif
 
-#include "par.h"
-#include "vec.h"
+#include "manifold/parallel.h"
+#include "manifold/vec.h"
 
 #if __has_include(<tracy/Tracy.hpp>)
 #include <tracy/Tracy.hpp>
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 {
 


Test patch:
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 <chrono>
 #include <iostream>
 
-#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 <execution>
 #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 <chrono>
 #include <iostream>
 
-#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 <fstream>
 #include <iostream>
 
-#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 <random>
 #include <vector>
 
-#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 <random>
 #include <sstream>  // 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/test-cmake.sh b/test-cmake.sh
index 3bf014c64..7f7e662e3 100755
--- a/test-cmake.sh
+++ b/test-cmake.sh
@@ -11,7 +11,8 @@ target_link_libraries(testing PRIVATE manifold)
 EOT
 
 cat <<EOT >> test.cpp
-#include "manifold.h"
+#include "manifold/manifold.h"
+#include "manifold/parallel.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..059b88787 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 <gtest/gtest.h>
 
 #include <vector>
 
-#include "manifold.h"
-#include "polygon.h"
-#include "public.h"
+#include "manifold/common.h"
+#include "manifold/manifold.h"
+#include "manifold/polygon.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 <algorithm>
 
-#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..1d6dd08bb 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 <algorithm>
 
 #ifdef MANIFOLD_CROSS_SECTION
-#include "cross_section.h"
+#include "manifold/cross_section.h"
 #endif
+#include "manifold/tri_dist.h"
 #include "samples.h"
 #include "test.h"
-#include "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 <algorithm>
 #include <fstream>
diff --git a/test/properties_test.cpp b/test/properties_test.cpp
index ea048f471..e56ff9b14 100644
--- a/test/properties_test.cpp
+++ b/test/properties_test.cpp
@@ -14,10 +14,10 @@
 
 #include <algorithm>
 
-#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/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..20f161750 100644
--- a/test/smooth_test.cpp
+++ b/test/smooth_test.cpp
@@ -15,12 +15,12 @@
 #include <algorithm>
 
 #ifdef MANIFOLD_CROSS_SECTION
-#include "cross_section.h"
+#include "manifold/cross_section.h"
 #endif
-#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/test.h b/test/test.h
index 11e603151..764505ed7 100644
--- a/test/test.h
+++ b/test/test.h
@@ -16,11 +16,11 @@
 #include <ostream>
 
 #include "gtest/gtest.h"
-#include "manifold.h"
-#include "public.h"
+#include "manifold/common.h"
+#include "manifold/manifold.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 <algorithm>
 
-#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