Prerequisites
Make sure you have completed the installation steps and have both OpenGeometry and Three.js installed.Basic Setup
Let’s create a complete example that renders a 3D cuboid in the browser.Create a 3D shape
Now create a cuboid and add it to the scene:
The
Cuboid class extends THREE.Mesh, so it can be added directly to Three.js scenes. All OpenGeometry shapes work this way.Complete Example
Here’s the completemain.ts file:
Try Other Shapes
OpenGeometry provides many built-in shapes. Try experimenting with different primitives and shapes:Cylinder Example
Sphere Example
2D Primitives
You can also create 2D primitives like lines, arcs, and curves:Next Steps
API Reference
Explore the complete API documentation for all shapes and operations
Live Examples
See interactive examples showcasing all features
For more complex examples including sweep operations, offset curves, and advanced CAD operations, check out the OpenGeometry Examples repository.