Skip to content

Commit

Permalink
Removing QuickHull dependency (#881)
Browse files Browse the repository at this point in the history
* Removed QuickHull Dependency

* Replaced Vector3 with glm::vec3 and VertexDataSource (and formatting)

* Revert nanobind

* Removing Templates (since using glm::vec3 so only need float)

* Formatting

* Converted glm::vec3 to glm::vec3d and float to double

* Fixed Formatting and Removed third_party

* Made requested Changes (m_,comments,removing unnecessary code)

* Resolving Conflict

* Fixed std::move warning (Shouldn't affect performance, ideally)

* Reverted third_party directory in bindings

* Reverting std::move

* Corrected std::move and added glm::dot to calculate distance squared

* Reverted m_epsilon due to epsilon and m_epsilon

* Fixed some Names

* Formatting

* Removed all unecessary m_

* Fixed manifold.yaml

* Added headers and pragma once

* Modified License

* Formatting

* Activated the two failing tests and added the fix for the algorithm

* Modified gitmodules to remove third_party

* Removed nanobind
  • Loading branch information
Kushal-Shah-03 authored Aug 7, 2024
1 parent 75c340f commit af2304d
Show file tree
Hide file tree
Showing 10 changed files with 1,426 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/manifold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
cd ../
lcov --capture --gcov-tool gcov-${{ matrix.gcc }} --ignore-errors mismatch --directory . --output-file ./code_coverage_test.info
lcov --add-tracefile ./code_coverage_init.info --add-tracefile ./code_coverage_test.info --output-file ./code_coverage_total.info
lcov --remove ./code_coverage_total.info '/usr/*' '*/third_party/*' '*/test/*' '*/extras/*' '*/bindings/*' --output-file ./code_coverage.info
lcov --remove ./code_coverage_total.info '/usr/*' '*/test/*' '*/extras/*' '*/bindings/*' --output-file ./code_coverage.info
cd ../
- uses: codecov/codecov-action@v4
if: matrix.parallel_backend == 'NONE'
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "src/third_party/quickhull"]
path = src/third_party/quickhull
url = https://github.com/akuukka/quickhull
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# do not add third_party installations
add_subdirectory(third_party EXCLUDE_FROM_ALL)
add_subdirectory(utilities)
add_subdirectory(collider)
add_subdirectory(cross_section)
Expand Down
2 changes: 1 addition & 1 deletion src/manifold/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
target_link_libraries(${PROJECT_NAME}
PUBLIC utilities
PRIVATE $<BUILD_INTERFACE:collider> polygon ${MANIFOLD_INCLUDE} quickhull
PRIVATE $<BUILD_INTERFACE:collider> polygon ${MANIFOLD_INCLUDE}
)

target_compile_options(${PROJECT_NAME} PRIVATE ${MANIFOLD_FLAGS})
Expand Down
6 changes: 3 additions & 3 deletions src/manifold/src/manifold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
#include <map>
#include <numeric>

#include "QuickHull.hpp"
#include "boolean3.h"
#include "csg_tree.h"
#include "impl.h"
#include "par.h"
#include "quickhull.h"

namespace {
using namespace manifold;
Expand Down Expand Up @@ -919,12 +919,12 @@ Manifold Manifold::Hull(const std::vector<glm::vec3>& pts) {
const int numVert = pts.size();
if (numVert < 4) return Manifold();

std::vector<quickhull::Vector3<double>> vertices(numVert);
std::vector<glm::dvec3> vertices(numVert);
for (int i = 0; i < numVert; i++) {
vertices[i] = {pts[i].x, pts[i].y, pts[i].z};
}

quickhull::QuickHull<double> qh;
QuickHull qh;
// bools: correct triangle winding, and use original indices
auto hull = qh.getConvexHull(vertices, false, true);
const auto& triangles = hull.getIndexBuffer();
Expand Down
Loading

0 comments on commit af2304d

Please sign in to comment.