diff --git a/.github/workflows/manifold.yml b/.github/workflows/manifold.yml index a89686757..178299d82 100644 --- a/.github/workflows/manifold.yml +++ b/.github/workflows/manifold.yml @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install libglm-dev libgtest-dev libassimp-dev git libtbb-dev libthrust-dev pkg-config libpython3-dev lcov + sudo apt-get install libglm-dev libgtest-dev libassimp-dev git libtbb-dev pkg-config libpython3-dev lcov python -m pip install -U trimesh pytest - uses: actions/checkout@v4 - uses: jwlawson/actions-setup-cmake@v2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 87aa9714a..2607e79f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,8 +227,6 @@ if(MANIFOLD_PAR) endif() if(NOT TBB_FOUND) logmissingdep("TBB" , "Parallel mode") - # TODO - this isn't recommended by the TBB upstream - should we be - # doing it? message(STATUS "TBB not found, downloading from source") set(TBB_TEST OFF CACHE INTERNAL "" FORCE) set(TBB_STRICT OFF CACHE INTERNAL "" FORCE) @@ -343,6 +341,7 @@ endif() message(STATUS "BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") message(STATUS " ") message(STATUS "MANIFOLD_PAR: ${MANIFOLD_PAR}") +message(STATUS "MANIFOLD_CROSS_SECTION: ${MANIFOLD_CROSS_SECTION}") message(STATUS "MANIFOLD_FLAGS: ${MANIFOLD_FLAGS}") message(STATUS "MANIFOLD_EXPORT: ${MANIFOLD_EXPORT}") message(STATUS "MANIFOLD_TEST: ${MANIFOLD_TEST}") diff --git a/README.md b/README.md index 72daf3e86..10749d400 100644 --- a/README.md +++ b/README.md @@ -66,19 +66,22 @@ test/manifold_test ``` CMake flags (usage e.g. `-DMANIFOLD_DEBUG=ON`): -- `MANIFOLD_JSBIND=[OFF, ]`: Build js binding when using emscripten. +- `MANIFOLD_JSBIND=[OFF, ]`: Build js binding (when using the emscripten toolchain). - `MANIFOLD_CBIND=[, ON]`: Build C FFI binding. - `MANIFOLD_PYBIND=[OFF, ]`: Build python binding. -- `MANIFOLD_PAR=[, ON]`: Provides multi-thread parallelization, requires `libtbb-dev` enabled. -- `MANIFOLD_CROSS_SECTION=[OFF, ]`: Build CrossSection for 2D support (needed by language bindings). +- `MANIFOLD_PAR=[, ON]`: Provides multi-thread parallelization, requires `libtbb-dev` if enabled. +- `MANIFOLD_CROSS_SECTION=[OFF, ]`: Build CrossSection for 2D support (needed by language bindings), requires `Clipper2` if enabled. - `MANIFOLD_EXPORT=[, ON]`: Enables GLB export of 3D models from the tests, requires `libassimp-dev`. -- `MANIFOLD_DEBUG=[, ON]`: Enables internal assertions and exceptions. +- `MANIFOLD_DEBUG=[, ON]`: Enables internal assertions and exceptions. This incurs around 20% runtime overhead. - `MANIFOLD_TEST=[OFF, ]`: Build unittests. - `TRACY_ENABLE=[, ON]`: Enable integration with tracy profiler. See profiling section below. -- `BUILD_TEST_CGAL=[, ON]`: Builds a CGAL-based performance [comparison](https://github.com/elalish/manifold/tree/master/extras), requires `libcgal-dev`. +- `BUILD_TEST_CGAL=[, ON]`: Builds a CGAL-based performance [comparison](https://github.com/elalish/manifold/tree/master/extras), requires `libcgal-dev` if enabled. -Offline building: +Offline building (with missing dependencies): +- `MANIFOLD_DOWNLOADS=[OFF, ]`: Automatically download missing dependencies. + Need to set `FETCHCONTENT_SOURCE_DIR_*` if the dependency `*` is missing. +- `FETCHCONTENT_SOURCE_DIR_TBB`: path to tbb source (if `MANIFOLD_PAR` is enabled). - `FETCHCONTENT_SOURCE_DIR_GOOGLETEST`: path to googletest source. The build instructions used by our CI are in [manifold.yml](https://github.com/elalish/manifold/blob/master/.github/workflows/manifold.yml), which is a good source to check if something goes wrong and for instructions specific to other platforms, like Windows. diff --git a/bindings/python/manifold3d.cpp b/bindings/python/manifold3d.cpp index b5d61b8a0..9aaab4815 100644 --- a/bindings/python/manifold3d.cpp +++ b/bindings/python/manifold3d.cpp @@ -228,8 +228,7 @@ NB_MODULE(manifold3d, m) { nb::arg("radius"), get_circular_segments__radius); m.def("triangulate", &Triangulate, nb::arg("polygons"), - nb::arg("precision") = -1, // TODO document - triangulate__polygons__precision); + nb::arg("precision") = -1, triangulate__polygons__precision); nb::class_(m, "Manifold") .def(nb::init<>(), manifold__manifold) @@ -401,7 +400,7 @@ NB_MODULE(manifold3d, m) { }, nb::arg("mesh"), nb::arg("sharpened_edges") = nb::list(), nb::arg("edge_smoothness") = nb::list(), - // todo params slightly diff + // TODO: params slightly diff manifold__smooth__mesh_gl__sharpened_edges) .def_static("batch_boolean", &Manifold::BatchBoolean, nb::arg("manifolds"), nb::arg("op"), diff --git a/include/manifold/linalg.h b/include/manifold/linalg.h index e9251a82f..a26c5eb97 100644 --- a/include/manifold/linalg.h +++ b/include/manifold/linalg.h @@ -1458,7 +1458,7 @@ constexpr vec cross(const vec &a, const vec &b) { } template constexpr T dot(const vec &a, const vec &b) { - return sum(cmul(a, b)); + return sum(a * b); } template constexpr T length2(const vec &a) { diff --git a/include/manifold/manifold.h b/include/manifold/manifold.h index df5dd1956..0737a9ac1 100644 --- a/include/manifold/manifold.h +++ b/include/manifold/manifold.h @@ -140,8 +140,7 @@ using MeshGL64 = MeshGLP; /** * This library's internal representation of an oriented, 2-manifold, triangle * mesh - a simple boundary-representation of a solid object. Use this class to - * store and operate on solids, and use MeshGL for input and output, or - * potentially Mesh if only basic geometry is required. + * store and operate on solids, and use MeshGL for input and output. * * In addition to storing geometric data, a Manifold can also store an arbitrary * number of vertex properties. These could be anything, e.g. normals, UV diff --git a/src/sort.cpp b/src/sort.cpp index 38e6ff81b..ae32c147b 100644 --- a/src/sort.cpp +++ b/src/sort.cpp @@ -265,13 +265,6 @@ void Manifold::Impl::Finish() { logicErr, "faceNormal size = " + std::to_string(faceNormal_.size()) + ", NumTri = " + std::to_string(NumTri())); - // TODO: figure out why this has a flaky failure and then enable reading - // vertNormals from a Mesh. - // DEBUG_ASSERT(vertNormal_.size() == NumVert() || vertNormal_.size() == 0, - // logicErr, - // "vertNormal size = " + std::to_string(vertNormal_.size()) + - // ", NumVert = " + std::to_string(NumVert())); - CalculateNormals(); collider_ = Collider(faceBox, faceMorton); diff --git a/test/manifold_test.cpp b/test/manifold_test.cpp index c0d0a0486..fbc0c922f 100644 --- a/test/manifold_test.cpp +++ b/test/manifold_test.cpp @@ -556,7 +556,6 @@ TEST(Manifold, Merge) { } TEST(Manifold, PinchedVert) { - // TODO MeshGL shape; shape.numProp = 3; shape.vertProperties = {0, 0, 0, // diff --git a/test/samples_test.cpp b/test/samples_test.cpp index 159ef0eb7..dc1dd6548 100644 --- a/test/samples_test.cpp +++ b/test/samples_test.cpp @@ -303,13 +303,9 @@ TEST(Samples, Sponge4) { TEST(Samples, CondensedMatter16) { Manifold cm = CondensedMatter(16); CheckGL(cm); - // FIXME: normals should be correct - // CheckNormals(cm); } TEST(Samples, CondensedMatter64) { Manifold cm = CondensedMatter(64); CheckGL(cm); - // FIXME: normals should be correct - // CheckNormals(cm); }