CSG
Updated
Cuts this primitive mesh out of its parent primitive mesh, joins it on, or keeps only their overlap.
- Type
comp-csg- Script class
CSGComponent- Per entity
- One
- Version
- 1.0.0
Read about it in CSG: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
operation |
"subtract" |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Carve with a tweenA tween pushes a sphere tool through a block and back; the CSG re-cuts on every move, so the hollow travels along the block.
Watch the scoop travel through the block and back once. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(CSGComponent); if (component) log(component.props);}