Skip to main content

Overview

The Opening class creates transparent cuboid volumes that represent openings in architectural models, such as doors, windows, or other voids. Openings are rendered with zero opacity but maintain outlines for visualization.

Constructor

options
IOpeningOptions
Configuration options for the opening

Properties

ogid
string
Unique identifier for the opening instance
options
IOpeningOptions
Current configuration options
width
number
Width of the opening (settable property)
height
number
Height of the opening (settable property)
depth
number
Depth of the opening (settable property)
dimensions
object
Get the current dimensions as an object with width, height, and depth
outline
boolean
Enable or disable the outline rendering (settable property)
outlineMesh
THREE.Line | null
Access the outline mesh if enabled

Methods

setConfig()

Update the opening configuration and regenerate geometry.
options
IOpeningOptions
required
New configuration options to apply

getBrepData()

Get the boundary representation (BREP) data for the opening.
Returns the BREP structure as a parsed JSON object, or null if not available.

generateGeometry()

Regenerate the Three.js geometry from the kernel.

discardGeometry()

Dispose of the Three.js geometry to free memory.

Example Usage

Basic Window Opening

Door Opening

Dynamic Resizing

Using BREP Data

Material Properties

The Opening uses a MeshStandardMaterial with these special properties:
  • transparent: true - Enables transparency
  • opacity: 0 - Fully transparent (invisible volume)
  • depthWrite: false - Allows seeing through to elements behind
This makes openings invisible while maintaining their volumetric representation for computational purposes.

Use Cases

Architectural Modeling

Create window and door openings in walls

Space Planning

Define void spaces in floor plans

Boolean Operations

Use as cutting volumes for wall penetrations

Visualization

Mark areas of interest with outlined volumes

Notes

Openings are rendered with zero opacity but can have visible outlines. Enable the outline property to visualize the opening boundaries.
Opening geometry uses depthWrite: false which means it won’t write to the depth buffer. This is intentional to allow seeing through openings, but be aware of this when compositing with other transparent objects.

Live Demo

Opening Demo

Try creating openings in the browser

Cuboid

Solid rectangular boxes

Polygon

2D shapes that can be extruded
Last modified on March 14, 2026