Overview
TheWedge class creates 3D wedge shapes (triangular prisms). A wedge is defined by its center point, width, height, and depth, creating a geometric shape with a rectangular base and a triangular cross-section.
Constructor
IWedgeOptions
Unique identifier for the wedge. Auto-generated if not provided.
Center point of the wedge in 3D space.
Width of the wedge base along the X-axis.
Height of the wedge along the Y-axis.
Depth of the wedge along the Z-axis.
Hexadecimal color value for the wedge.
Methods
setConfig()
Updates the wedge configuration and regenerates geometry.getBrepData()
Returns the B-Rep (Boundary Representation) data as a parsed JSON object.generateGeometry()
Regenerates the THREE.js geometry from the current configuration. Called automatically after setConfig().discardGeometry()
Disposes of the current geometry to free memory.Properties
Unique identifier for the wedge instance.
Current wedge configuration.
Get or set the wedge color.
Enable or disable outline rendering for the wedge edges.
Reference to the outline mesh if outline is enabled.
Usage Examples
Basic Wedge
Ramp or Slope
Wedge with Outline
Roof Section
Array of Wedges
Implementation Details
Geometry Structure
A wedge consists of 6 vertices forming 5 faces:- 1 rectangular bottom face
- 2 triangular end faces (front and back)
- 2 rectangular side faces (left and right)
/workspace/source/main/opengeometry/src/primitives/wedge.rs:67-113
Face Topology
The wedge has 5 faces with specific vertex indices: Source:/workspace/source/main/opengeometry/src/primitives/wedge.rs:108-112
Material Configuration
Wedges use MeshStandardMaterial with transparency: Source:/workspace/source/main/opengeometry/src/shapes/wedge.ts:82-86
Triangulation
Quadrilateral faces are automatically triangulated for rendering: Source:/workspace/source/main/opengeometry/src/primitives/wedge.rs:125-146
Best Practices
Use Cases: Wedges are ideal for creating ramps, roof sections, staircases, and architectural slope elements.
Geometric Properties
Vertex Count
6 verticesEdge Count
9 edgesFace Count
5 faces (2 triangular, 3 quadrilateral)Volume
The volume of a wedge is:Live Demo
Wedge Demo
Try the Wedge shape in the browser
See Also
Cuboid
Rectangular boxes
Polygon
2D triangular shapes
Sweep
Custom extrusions

