Skip to content

Commit

Permalink
Add csg boolean operators using elalish/manifold.
Browse files Browse the repository at this point in the history
Check if the results are manifold.

Remove thirdparty manifold.

git subrepo clone --branch=godot --force https://github.com/V-Sekai/manifold.git thirdparty/manifold

subrepo:
  subdir:   "thirdparty/manifold"
  merged:   "d8ddf4bdcb"
upstream:
  origin:   "https://github.com/V-Sekai/manifold.git"
  branch:   "godot"
  commit:   "d8ddf4bdcb"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "110b9eb"

Add thrust.

git subrepo clone --branch=b06b775c1c80af51a1183c0e167f9de3b2351a79 https://github.com/g-truc/glm.git thirdparty/glm

subrepo:
  subdir:   "thirdparty/glm"
  merged:   "b06b775c1c"
upstream:
  origin:   "https://github.com/g-truc/glm.git"
  branch:   "b06b775c1c80af51a1183c0e167f9de3b2351a79"
  commit:   "b06b775c1c"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "110b9eb"

Add thrust again.

git subrepo clone --branch=756c5afc0750f1413da05bd2b6505180e84c53d4 https://github.com/NVIDIA/thrust.git thirdparty/thrust

subrepo:
  subdir:   "thirdparty/thrust"
  merged:   "756c5afc07"
upstream:
  origin:   "https://github.com/NVIDIA/thrust.git"
  branch:   "756c5afc0750f1413da05bd2b6505180e84c53d4"
  commit:   "756c5afc07"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "110b9eb"

git subrepo pull --branch=2.1.0 --force thirdparty/thrust

subrepo:
  subdir:   "thirdparty/thrust"
  merged:   "3cd56842c9"
upstream:
  origin:   "https://github.com/NVIDIA/thrust.git"
  branch:   "2.1.0"
  commit:   "3cd56842c9"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "110b9eb"

Remove thrust

git subrepo clone --branch=master --force https://github.com/elalish/manifold.git thirdparty/manifold

subrepo:
  subdir:   "thirdparty/manifold"
  merged:   "dad73e1bf4"
upstream:
  origin:   "https://github.com/elalish/manifold.git"
  branch:   "master"
  commit:   "dad73e1bf4"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "73a0129"

Remove nanobind.

git subrepo clone https://github.com/akuukka/quickhull thirdparty/quickhull

subrepo:
  subdir:   "thirdparty/quickhull"
  merged:   "4ef66c6895"
upstream:
  origin:   "https://github.com/akuukka/quickhull"
  branch:   "master"
  commit:   "4ef66c6895"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "73a0129"

Update to use the newer manifold without Thrust and without exceptions.

Remove quickhull duplicate.

Try to pass cicd.

Remove unused docs.

Remove samples.

Workaround warnings on ios.

Avoid compiler warnings.

Restore CSGTorus3D and CSGCylinder3D.

Remove unused script.

Build on all platforms.

Remove unused.

Restore code that was deleted.
  • Loading branch information
fire committed Jul 13, 2024
1 parent 82cedc8 commit e28f331
Show file tree
Hide file tree
Showing 576 changed files with 237,912 additions and 161 deletions.
48 changes: 47 additions & 1 deletion modules/csg/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,53 @@ Import("env_modules")

env_csg = env_modules.Clone()

# Godot source files
# Thirdparty source files

thirdparty_obj = []

thirdparty_dir = "#thirdparty/manifold/"
thirdparty_sources = [
"src/polygon/src/polygon.cpp",
"src/manifold/src/constructors.cpp",
"src/manifold/src/edge_op.cpp",
"src/manifold/src/face_op.cpp",
"src/manifold/src/impl.cpp",
"src/manifold/src/boolean_result.cpp",
"src/manifold/src/boolean3.cpp",
"src/manifold/src/manifold.cpp",
"src/manifold/src/properties.cpp",
"src/manifold/src/smoothing.cpp",
"src/manifold/src/sort.cpp",
"src/manifold/src/csg_tree.cpp",
"src/manifold/src/subdivision.cpp",
"src/collider/src/collider.cpp",
]

env_csg.Append(CPPDEFINES=["THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CPP"])
env_csg.Append(LINKFLAGS=["-fno-exceptions"])
env_csg.Append(LINKFLAGS=["-fno-duplicated-branches"])

thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_csg.Prepend(
CPPPATH=[
"#thirdparty/thrust",
"#thirdparty/glm",
"#thirdparty/quickhull",
thirdparty_dir + "src/polygon/include",
thirdparty_dir + "src/manifold/include",
thirdparty_dir + "src/utilities/include",
thirdparty_dir + "src/collider/include",
thirdparty_dir + "src/third_party",
thirdparty_dir + "src/third_party/quickhull",
]
)
env_thirdparty = env_csg.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env_thirdparty.add_source_files(thirdparty_obj, "#thirdparty/quickhull/QuickHull.cpp")
env.modules_sources += thirdparty_obj

# Godot's own source files
env_csg.add_source_files(env.modules_sources, "*.cpp")
if env.editor_build:
env_csg.add_source_files(env.modules_sources, "editor/*.cpp")
Loading

0 comments on commit e28f331

Please sign in to comment.