Skip to content

Add OGWedge primitive and three.js Wedge shape support#6

Merged
aka-blackboots merged 2 commits into
mainfrom
codex/create-wedge-shape-and-update-three-package
Mar 1, 2026
Merged

Add OGWedge primitive and three.js Wedge shape support#6
aka-blackboots merged 2 commits into
mainfrom
codex/create-wedge-shape-and-update-three-package

Conversation

@aka-blackboots

Copy link
Copy Markdown
Contributor

Motivation

  • Provide a new wedge primitive consistent with existing solids (cuboid, cylinder) so kernel users can create wedge solids and project them to 2D.
  • Expose wedge to the Three.js integration so UI/visualization code can construct and render wedge geometry from the kernel.

Description

  • Add a new kernel primitive OGWedge with center, width, height, and depth, BRep construction, triangulation-based geometry serialization, and outline serialization (main/opengeometry/src/primitives/wedge.rs).
  • Register the primitive in the kernel exports (pub mod wedge in main/opengeometry/src/lib.rs).
  • Add scene manager plumbing: add_wedge_to_scene_internal and wasm-bindgen bindings addWedgeToScene and addWedgeToCurrentScene in main/opengeometry/src/scenegraph.rs so wedges can be added to scenes like other primitives.
  • Update the kernel example pdf_primitives_all to construct a wedge and export its projected PDF (*_wedge.pdf), and add a Wedge wrapper in opengeometry-three plus export it from the shapes index (main/opengeometry-three/src/shapes/wedge.ts and main/opengeometry-three/src/shapes/index.ts).
  • Add a concise handoff note at AI-DOCs/opengeometry/2026-03-01-wedge-shape-support.md describing changes and local test instructions.

Testing

  • Ran cd main/opengeometry && cargo fmt and it completed successfully.
  • Ran cd main/opengeometry && cargo check and it completed successfully.
  • Ran cd main/opengeometry && cargo test and all unit tests passed.
  • Executed the example with cd main/opengeometry && cargo run --example pdf_primitives_all -- wedge_demo which completed and generated the wedge example PDF (e.g. wedge_demo_wedge.pdf).
  • npm run build-core failed in this environment because wasm-pack is not installed, and npm run build-three failed because main/opengeometry/pkg/opengeometry (wasm bindings) is not present until wasm-pack produces them; these are environment limitations rather than functional regressions.
  • npm run lint:check reported pre-existing lint issues in the three package (main/opengeometry-three/src/utils/event.ts and a console usage warning in polygon.ts) which are unrelated to the wedge code.

Codex Task

@aka-blackboots aka-blackboots added the enhancement New feature or request label Mar 1, 2026
@aka-blackboots aka-blackboots merged commit 707bd96 into main Mar 1, 2026
2 of 3 checks passed
@aka-blackboots aka-blackboots deleted the codex/create-wedge-shape-and-update-three-package 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

codex enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant