Skip to content

Commit

Permalink
Merge pull request elalish#131 from pca006132/lazy-boolean
Browse files Browse the repository at this point in the history
Lazy boolean
  • Loading branch information
elalish committed Jun 13, 2022
2 parents 925f2ec + 7374d6b commit b8b29ed
Show file tree
Hide file tree
Showing 21 changed files with 832 additions and 379 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/manifold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
cuda_support: [ON, OFF]
parallel_backend: [NONE, OMP, TBB]
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false
container:
image: docker://nvidia/cuda:11.6.0-devel-ubuntu20.04
steps:
Expand Down Expand Up @@ -47,6 +48,7 @@ jobs:
build_wasm:
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false
steps:
- name: Install dependencies
run: |
Expand Down Expand Up @@ -83,6 +85,7 @@ jobs:
cuda_support: [OFF]
max-parallel: 1
runs-on: windows-2019
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -126,6 +129,7 @@ jobs:
matrix:
variant: [none, omp, tbb, none-cuda, omp-cuda, tbb-cuda, js]
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2.4.0
- uses: cachix/install-nix-action@v15
Expand Down
7 changes: 6 additions & 1 deletion clang-format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env -S bash -e
for f in {collider,manifold,meshIO,polygon,samples,utilities}/**/*.{h,cpp} {test,tools}/*.cpp; do
clang-format --dry-run --Werror $f
clang-format --dry-run --Werror $f &
pids[${i}]=$!
done

for pid in ${pids[*]}; do
wait $pid
done
4 changes: 2 additions & 2 deletions manifold/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ project (manifold)

add_library(${PROJECT_NAME} src/manifold.cpp src/constructors.cpp src/impl.cpp
src/properties.cpp src/sort.cpp src/edge_op.cpp src/face_op.cpp
src/smoothing.cpp src/boolean3.cpp src/boolean_result.cpp
src/smoothing.cpp src/boolean3.cpp src/boolean_result.cpp src/csg_tree.cpp
)

if(MANIFOLD_USE_CUDA)
set_source_files_properties(
src/manifold.cpp src/constructors.cpp src/impl.cpp
src/properties.cpp src/sort.cpp src/edge_op.cpp src/face_op.cpp
src/smoothing.cpp src/boolean3.cpp src/boolean_result.cpp
src/manifold_set.cpp
src/manifold_set.cpp src/csg_tree.cpp

PROPERTIES LANGUAGE CUDA
)
Expand Down
28 changes: 18 additions & 10 deletions manifold/include/manifold.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

namespace manifold {

class CsgNode;
class CsgLeafNode;

/** @defgroup Core
* @brief The central classes of the library
* @{
Expand Down Expand Up @@ -104,20 +107,19 @@ class Manifold {
///@{
MeshRelation GetMeshRelation() const;
std::vector<int> GetMeshIDs() const;
int SetAsOriginal();
Manifold AsOriginal() const;
///@}

/** @name Modification
* Change this manifold in-place.
*/
///@{
Manifold& Translate(glm::vec3);
Manifold& Scale(glm::vec3);
Manifold& Rotate(float xDegrees, float yDegrees = 0.0f,
float zDegrees = 0.0f);
Manifold& Transform(const glm::mat4x3&);
Manifold& Warp(std::function<void(glm::vec3&)>);
Manifold& Refine(int);
Manifold Translate(glm::vec3) const;
Manifold Scale(glm::vec3) const;
Manifold Rotate(float xDegrees, float yDegrees = 0.0f,
float zDegrees = 0.0f) const;
Manifold Transform(const glm::mat4x3&) const;
Manifold Warp(std::function<void(glm::vec3&)>) const;
Manifold Refine(int) const;
// Manifold RefineToLength(float);
// Manifold RefineToPrecision(float);
///@}
Expand Down Expand Up @@ -157,7 +159,13 @@ class Manifold {
struct Impl;

private:
std::unique_ptr<Impl> pImpl_;
Manifold(std::shared_ptr<CsgNode> pNode_);
Manifold(std::shared_ptr<Impl> pImpl_);

mutable std::shared_ptr<CsgNode> pNode_;

CsgLeafNode& GetCsgLeafNode() const;

static int circularSegments_;
static float circularAngle_;
static float circularEdgeLength_;
Expand Down

0 comments on commit b8b29ed

Please sign in to comment.