Skip to content

Add OGWedge primitive with Three.js wrapper, scene APIs, and example#7

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

Add OGWedge primitive with Three.js wrapper, scene APIs, and example#7
aka-blackboots merged 3 commits into
mainfrom
codex/create-wedge-shape-and-update-three-package-gulhaj

Conversation

@aka-blackboots

Copy link
Copy Markdown
Contributor

Motivation

  • Add wedge to the existing primitive set so wedge geometry can be generated, projected, and consumed by the JS/Three integration like other shapes.
  • Expose wedge in scene management and wasm bindings so it can be added to scenes and exported to 2D projections/PDFs.
  • Provide a Three.js wrapper and a browser example to visualize the wedge from the wasm bindings.

Description

  • Introduced a new kernel primitive OGWedge implemented in main/opengeometry/src/primitives/wedge.rs with center, width, height, depth, geometry generation, outline serialization and to_projected_scene2d support.
  • Exported the primitive in main/opengeometry/src/lib.rs and wired scene APIs in main/opengeometry/src/scenegraph.rs including internal add_wedge_to_scene_internal and wasm-exposed addWedgeToScene / addWedgeToCurrentScene methods.
  • Updated the PDF example main/opengeometry/examples/pdf_primitives_all.rs to create an OGWedge and include a projected wedge PDF export.
  • Added Three.js integration: main/opengeometry-three/src/shapes/wedge.ts implements a Wedge wrapper using OGWedge, exported it in main/opengeometry-three/src/shapes/index.ts, and added a browser demo page at main/opengeometry-three/examples/wedge.html that loads wasm and renders the wedge.

Testing

  • Ran formatting and build checks with cargo fmt -- --check, cargo check, and unit tests with cargo test, and all succeeded.
  • Built wasm bindings and the Three package using npm run build-core and npm run build-three, and both builds completed successfully.

Codex Task

@aka-blackboots aka-blackboots merged commit ae86b92 into main Mar 1, 2026
2 of 3 checks passed
@aka-blackboots aka-blackboots deleted the codex/create-wedge-shape-and-update-three-package-gulhaj 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