Skip to content

feat(three): add voxel boolean operations and interactive spec example#10

Closed
aka-blackboots wants to merge 1 commit into
mainfrom
codex/implement-boolean-operations-for-shapes-ke6z5t
Closed

feat(three): add voxel boolean operations and interactive spec example#10
aka-blackboots wants to merge 1 commit into
mainfrom
codex/implement-boolean-operations-for-shapes-ke6z5t

Conversation

@aka-blackboots

Copy link
Copy Markdown
Contributor

Motivation

  • Provide an end-to-end boolean workflow that can combine any mesh-backed OpenGeometry shape (cuboid, cylinder, sphere, wedge, opening, sweep, polygon-derived meshes) into a new resulting shape with configurable operation semantics.
  • Prefer a robust, dependency-free approach inspired by the RobustBoolean paper that uses stable occupancy classification to avoid fragile triangle-triangle clipping degeneracies.
  • Expose the capability via the existing JS/Three bindings and the opengeometry-three package so examples and higher-level tooling can consume the result.

Description

  • Added a voxel-backed boolean implementation and API booleanOperation(left, right, options) which returns a BooleanShape (see main/opengeometry-three/src/operations/boolean.ts) and supports union, subtract, and intersect with options gridResolution and constrainResultToPositiveY.
  • Exported the operations via main/opengeometry-three/src/operations/index.ts and updated package entry exports in main/opengeometry-three/index.ts so the API is available from @og-three.
  • Added a runnable Vite example and reusable example builder: examples-vite/operations/boolean.html, examples-vite/src/pages/operations-boolean.ts, and src/examples/boolean.ts, and surfaced a catalog card in examples-vite/index.html.
  • Documented the implementation and handoff in AI-DOCs/2026-03-04-boolean-operations-implementation.md including rationale, how it maps to the RobustBoolean approach, usage notes, and caveats.

Testing

  • Ran cargo fmt --manifest-path main/opengeometry/Cargo.toml --all and it completed successfully.
  • Ran cargo check --manifest-path main/opengeometry/Cargo.toml and it completed successfully (Rust build checks passed with warnings only).
  • Ran cargo test --manifest-path main/opengeometry/Cargo.toml and all repository unit tests passed (14 library tests + 3 primitives smoke tests; all OK).
  • Ran npm --prefix main/opengeometry-three test which executed the package-level test script and returned (note: package-level test is a noop by design and completed successfully), while npm --prefix main/opengeometry-three run build-example-three failed in this environment because the WebAssembly package main/opengeometry/pkg/opengeometry (the built wasm artifacts) is not present so Vite cannot resolve ../opengeometry/pkg/opengeometry, therefore the example build is blocked until the wasm package is produced (residual risk: example bundling and runtime wasm resolution depend on the built wasm artifact).

Codex Task

@aka-blackboots aka-blackboots deleted the codex/implement-boolean-operations-for-shapes-ke6z5t branch April 26, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant