/sdfx-isosurface

Primary LanguageRustMIT LicenseMIT

SDFX isosurface

This Go library combines the projects:

  • SDFX: A simple CAD package using Signed Distance Functions.
  • isosurface: implements SDF meshing algorithms

This takes meshing surfaces designed with SDFX and uses the Dual Contouring algorithm implementation of isosurface to create a mesh that preserves sharp features.

In order to avoid Cgo (and easily support all of Go's target platforms), isosurface is compiled to a wasm module and executed using wazero, the zero dependency WebAssembly runtime for Go developers.

DO NOT USE: It is slower (~7x if using fast wasm executor, ~47x if using the compatible executor) than the Dual Contouring implementation from SDFX, and produces worse results.

Then, why build it? Mostly to learn how cross-language interoperability via WebAssembly works: see isosurface.go and lib.rs.