repeat()
Creates linear repeated instances along an axis.
Returns: SceneObject
tip
See the guide for detailed usage examples.
Signatures
repeat(type: "linear", axis: AxisLike, options: LinearRepeatOptions, ...objects: SceneObject[]): SceneObject
Creates linear repeated instances along an axis.
| Parameter | Type | Description |
|---|---|---|
type | "linear" | Must be 'linear' |
axis | AxisLike | The axis to repeat along |
options | LinearRepeatOptions | Repeat count, spacing, etc. |
...objects | SceneObject[] | The objects to repeat (defaults to last object) (optional) |
repeat(type: "linear", axis: AxisLike[], options: LinearRepeatOptions, ...objects: SceneObject[]): SceneObject
Creates linear repeated instances along multiple axes.
| Parameter | Type | Description |
|---|---|---|
type | "linear" | Must be 'linear' |
axis | AxisLike[] | The axes to repeat along |
options | LinearRepeatOptions | Repeat count, spacing, etc. |
...objects | SceneObject[] | The objects to repeat (defaults to last object) (optional) |
LinearRepeatOptions
| Property | Type | Description |
|---|---|---|
count | number | number[] | Number of instances per axis (including the original) |
offset | number | number[] | Spacing between each instance. Cannot be used with length. (optional) |
length | number | number[] | Total span to distribute instances across (evenly spaced). Cannot be used with offset. (optional) |
centered | boolean | When true, centers the pattern around the original object's position (optional) |
skip | number[][] | Index tuples to skip (e.g. [[1], [3]] for single axis, [[1, 2]] for multi-axis) (optional) |
repeat(type: "circular", axis: AxisLike, options: CircularRepeatOptions, ...objects: SceneObject[]): SceneObject
Creates circular repeated instances around an axis.
| Parameter | Type | Description |
|---|---|---|
type | "circular" | Must be 'circular' |
axis | AxisLike | The axis to repeat around |
options | CircularRepeatOptions | Repeat count, angle, etc. |
...objects | SceneObject[] | The objects to repeat (defaults to last object) (optional) |
CircularRepeatOptions
| Property | Type | Description |
|---|---|---|
count | number | Number of instances (including the original) |
angle | number | Total angle to spread across. Cannot be used with offset. (optional) |
offset | number | Angle between each instance. Cannot be used with angle. (optional) |
centered | boolean | When true, centers the pattern around the original object's position (optional) |
skip | number[] | Indices to skip (e.g. [2, 4] to skip the 3rd and 5th instances) (optional) |
repeat(type: "mirror", plane: PlaneLike, ...objects: SceneObject[]): SceneObject
Creates a mirrored instance of objects across a plane.
| Parameter | Type | Description |
|---|---|---|
type | "mirror" | Must be 'mirror' |
plane | PlaneLike | The plane to mirror across |
...objects | SceneObject[] | The objects to mirror (defaults to last object) (optional) |
repeat(type: "rotate", axis: AxisLike, angle?: number, ...objects: SceneObject[]): SceneObject
Creates a rotated clone of objects around an axis.
| Parameter | Type | Description |
|---|---|---|
type | "rotate" | Must be 'rotate' |
axis | AxisLike | The axis to rotate around |
angle | number | The rotation angle in degrees (defaults to 90) (optional) |
...objects | SceneObject[] | The objects to rotate (defaults to last object) (optional) |
repeat(matrix: Matrix4, ...objects: SceneObject[]): SceneObject
Creates a transformed clone of objects using an arbitrary matrix.
| Parameter | Type | Description |
|---|---|---|
matrix | Matrix4 | The transformation matrix to apply |
...objects | SceneObject[] | The objects to transform (defaults to last object) (optional) |