Skip to content

Geometry

Updated

A built-in primitive shape: box, sphere, plane, cylinder, ring and more.

Type
comp-geometry
Script class
GeometryComponent
Per entity
One
Version
1.1.0

Read about it in Models and meshes: what it does, how to use it from a script, and examples.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
params.capSegments 1 ≤ x ≤ 16, integer
params.depth 0 ≤ x ≤ 10000
params.detail 0 ≤ x ≤ 16, integer
params.height 0 ≤ x ≤ 10000
params.heightSegments 2 ≤ x ≤ 32, integer
params.innerRadius 0 ≤ x ≤ 10000
params.length 0 ≤ x ≤ 10000
params.outerRadius 0 ≤ x ≤ 10000
params.radialSegments 3 ≤ x ≤ 64, integer
params.radius 0 ≤ x ≤ 10000
params.radiusBottom 0 ≤ x ≤ 10000
params.radiusTop 0 ≤ x ≤ 10000
params.segments 3 ≤ x ≤ 64, integer
params.thetaLength -6.283185307179586 ≤ x ≤ 6.283185307179586
params.thetaSegments 3 ≤ x ≤ 64, integer
params.tube 0 ≤ x ≤ 10000
params.tubularSegments 3 ≤ x ≤ 128, integer
params.width 0 ≤ x ≤ 10000
params.widthSegments 3 ≤ x ≤ 64, integer

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(GeometryComponent);
if (component) log(component.props);
}