Skip to content

OCADml/OManifold

Repository files navigation

OManifold

OManifold provides bindings to the Manifold solid modelling (C++) library, with integrations into the OCADml ecosystem. Via Manifold, this library provides a means to verify, smooth, and perform boolean operations (with guaranteed manifold output) upon meshes generated in OCADml.

Manifold menger sponge logo

Notable differences from Manifold

  • Angles are represented in radians (OCADml convention)
  • OCaml runtime lock means that level set mesh generation from signed distance functions cannot take advantage of parallelism (sequential execution still provided)

Usage

open OCADml
open OManifold

let () =
  let s = Manifold.sphere 20.
  and cyl = Manifold.cylinder ~center:true ~height:40. 10. in
  Export.manifold "example.glb" (Manifold.sub s cyl)

External Dependencies

  • libassimp, used for export of meshes from the Manifold.t and [MMesh.t] types
  • OpenMP linkage is ON for the Manifold build
  • The vendored Manifold library is linked with cuda if the library is found on the system, otherwise it is built without

Documentation

Documentation for OManifold is available online, covering the API. Referring to the manual for OCADml is also likely to be helpful. Finally, as many of the usage examples found in the OSCADml documentation are largely OCADml centric, they can serve as a reference until similar efforts are made in this repository.

Building

Manifold is vendored as a git submodule, so make sure to add --recurse-submodules when cloning, or run git submodule update --init --recursive to update the submodule if already cloned.

git clone --recurse-submodules https://github.com/geoffder/OManifold
cd OManifold
dune build