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.
import { Opening } from '@opengeometry/kernel-three';import { Vector3 } from 'opengeometry';import * as THREE from 'three';// Create a window openingconst windowOpening = new Opening({ center: new Vector3(0, 1.5, 0), width: 1.2, height: 1.5, depth: 0.3, color: 0x666666});// Enable outline to visualize the openingwindowOpening.outline = true;// Add to scenescene.add(windowOpening);
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.