Skip to content

"Subtraction & Union Sculpting Modelling Application": Freeform 3D sculpting with signed distance functions

Notifications You must be signed in to change notification settings

jaaamesey/SUSMA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SUSMA: Subtraction & Union Sculpting Modelling Application

Download

Precompiled release builds for Windows can be found at https://github.com/jaaamesey/SUSMA/releases.

Demonstration video (keyboard & mouse version)

https://www.youtube.com/watch?v=RAlXO2y42c0

Thesis paper

https://github.com/jaaamesey/SUSMA/blob/main/13203260_Thesis.pdf

Application architecture

This application is a Godot project that hooks into custom C++ code through the GDExtension API.

The OpenVDB C++ library is used for rasterizing the internal SDF representation of the sculpt to a grid, and converting it to a polygonal mesh that Godot can display. It is also used for converting meshes to SDF

C++ code is located inside /cpp/src/, with the Godot project sitting at the root of the repository.

In general, C++ is only used for:

  • Handling the internal SDF representation of the sculpt
  • Rasterizing that representation to a grid and mesh through OpenVDB

Godot and GDScript (its bespoke scripting language) is used for everything else, including:

  • Rendering the rasterized mesh
  • UI
  • Handling input
  • VR support

Build steps

The following steps assume you're on Windows (x86_64). This project has not been tested on other platforms, but should in theory still compile with some tweaking.

Ensure the repository is cloned recursively, i.e. submodules such as godot-cpp are included: git clone --recursive https://github.com/jaaamesey/ImplicitSurfaceSculpting

Initial build steps

  1. Install scons with pip install scons - this requires python3
  2. Ensure VS build tools are installed, with "Desktop development with C++" selected during installation
    • If not on Windows, just ensure you have g++ or clang installed
  3. Install OpenVDB and its dependencies, preferably through vcpkg like so:
    1. Clone https://github.com/microsoft/vcpkg to ./_ignore/
    2. Run the included bootstrap script (./_ignore/vcpkg/bootstrap-vcpkg.bat on Windows)
    3. Install openvdb through vcpkg:
      ./_ignore/vcpkg/vcpkg install openvdb:x64-windows # Use the relevant version for your OS 
      If you're not on Windows, not using vcpkg to install openvdb, or not installing it to /_ignore/, you may also need to modify the paths defined in cpp/SConstruct to reflect its actual install location.
    4. Copy the contents of ./_ignore/vcpkg/installed/x64-windows/bin to ./bin/.
  4. From the root of the repository, run:
    cd ./cpp/godot-cpp
    scons
    This will generate C++ bindings for Godot.
  5. Run:
    cd ../ # Navigates to cpp/
    scons
    This will build the necessary C++ code for the application.
  6. Download Godot 4.1. It might be easiest to move the executable to ./_ignore/, and rename it to something like godot.exe.
  7. From the root of the repository, run the Godot editor:
    ./_ignore/godot.exe --editor
    It will then take some time to import assets.
  8. Once the editor has finished importing, click the play button in the top right to confirm that the application works.

Once these steps are complete, you can run the project without the editor with ./_ignore/godot.exe.

Re-building during development

  • When any files inside cpp/src/ are modified, you will need to run scons in that directory to re-build the C++ code. The Godot editor should probably be closed whilst this is happening.
  • If for some reason files inside cpp/godot-cpp/ have been modified, you will need to run scons again in both cpp/godot-cpp/ and cpp/src/.
  • Changes to standard Godot files (.gd, .tscn, etc) will not require a re-build, as GDScript is an interpreted language.

About

"Subtraction & Union Sculpting Modelling Application": Freeform 3D sculpting with signed distance functions

Resources

Stars

Watchers

Forks

Packages

No packages published