copy()
[2D] Creates linear copies along an axis inside a sketch.
Returns: Copy
See the guide for detailed usage examples.
Signatures
copy(type: "linear", axis: AxisLike, options: LinearCopyOptions, ...objects: SceneObject[]): Copy
[2D] Creates linear copies along an axis inside a sketch.
| Parameter | Type | Description |
|---|---|---|
type | "linear" | Must be 'linear' |
axis | AxisLike | The axis to copy along — xAxis() / yAxis() for the sketch's own axes, a sketched line via axis(l); a bare 'x' is the WORLD axis |
options | LinearCopyOptions | Copy count, spacing, etc. |
...objects | SceneObject[] | The objects to copy (defaults to last object) (optional) |
copy(type: "linear", axis: AxisLike[], options: LinearCopyOptions, ...objects: SceneObject[]): Copy
[2D] Creates linear copies along multiple axes inside a sketch.
| Parameter | Type | Description |
|---|---|---|
type | "linear" | Must be 'linear' |
axis | AxisLike[] | The axes to copy along — xAxis() / yAxis() for the sketch's own axes, a sketched line via axis(l); a bare 'x' is the WORLD axis |
options | LinearCopyOptions | Copy count, spacing, etc. |
...objects | SceneObject[] | The objects to copy (defaults to last object) (optional) |
copy(type: "linear", axis: AxisLike | Connector, options: LinearCopyOptions, ...objects: SceneObject[]): Copy
[3D] Creates linear copies along an axis. A connector among the objects
is copied as a frame: its copies are bolt.instance(1), … (see
IConnector.instance), made inside the connector's own part body. At an
assembly file's top level it copies assembly connectors only:
copy('linear', 'x', { count: 4, offset: 50 }, bay) makes
bay.instance(1) … bay.instance(3), the axis a world axis or an
assembly connector.
| Parameter | Type | Description |
|---|---|---|
type | "linear" | Must be 'linear' |
axis | AxisLike | Connector | The axis to copy along — a world axis, an axis(), an edge, or a connector (its Z axis) |
options | LinearCopyOptions | Copy count, spacing, etc. |
...objects | SceneObject[] | The objects to copy (defaults to last object) (optional) |
copy(type: "linear", axis: (AxisLike | Connector)[], options: LinearCopyOptions, ...objects: SceneObject[]): Copy
[3D] Creates linear copies along multiple axes. A connector among the
objects is copied as a frame, one copy per grid cell — see
IConnector.instance for the numbering.
| Parameter | Type | Description |
|---|---|---|
type | "linear" | Must be 'linear' |
axis | (AxisLike | Connector)[] | The axes to copy along — each a world axis, an axis(), an edge, or a connector (its Z axis) |
options | LinearCopyOptions | Copy count, spacing, etc. |
...objects | SceneObject[] | The objects to copy (defaults to last object) (optional) |
copy(type: "circular", center: Point2DLike, options: CircularCopyOptions, ...objects: SceneObject[]): Copy
[2D] Creates circular copies around a center point inside a sketch.
| Parameter | Type | Description |
|---|---|---|
type | "circular" | Must be 'circular' |
center | Point2DLike | The center point to copy around |
options | CircularCopyOptions | Copy count, angle, etc. |
...objects | SceneObject[] | The objects to copy (defaults to last object) (optional) |
copy(type: "circular", axis: AxisLike | Connector, options: CircularCopyOptions, ...objects: SceneObject[]): Copy
[3D] Creates circular copies around an axis. A connector among the
objects is copied as a frame: copy('circular', 'z', { count: 6, angle: 360 }, bolt) makes bolt.instance(1) … bolt.instance(5). At an
assembly file's top level it copies assembly connectors only, around a
world axis or an assembly connector's Z axis.
| Parameter | Type | Description |
|---|---|---|
type | "circular" | Must be 'circular' |
axis | AxisLike | Connector | The axis to copy around — a world axis, an axis(), an edge, or a connector (its Z axis through its origin) |
options | CircularCopyOptions | Copy count, angle, etc. |
...objects | SceneObject[] | The objects to copy (defaults to last object) (optional) |
copy(pattern: Repeat, ...connectors: Connector[]): Copy
[3D] Copies connectors onto the instances of a linear or circular
repeat(): each copy is the connector's frame moved the way the repeat
moved that instance, so copy(holes, bolt) puts bolt.instance(k) on
holes.instance(k) — the repeat's own slots, skipped ones included, and
a partial arc spaced the repeat's way. Edit the repeat and the copies
follow. Connectors only, inside the part body that declares both the
repeat and the connectors; a mirror, rotate or matrix repeat is refused.
| Parameter | Type | Description |
|---|---|---|
pattern | Repeat | The linear or circular repeat() to follow |
...connectors | Connector[] | The connectors to copy (optional) |