Skip to main content

Copy

copy() duplicates a finished solid at several positions, in a row or around an axis. The copies are clones of the shape as it is — no modelling operation is re-run. To re-apply a feature (a cut, an extrude) at each position instead, use Repeat.

In the viewport

  1. Click Copy on the toolbar. The Copy dialog docks on the right.
  2. Pick the kind at the top: Linear copies along one or two axes, Circular around an axis.
  3. Click the solid to copy — any face or edge click in the viewport, or its timeline row. It fills the Solids slot.
  4. Linear: in Direction 1, fill the Axis slot (click a world axis shown in the viewport, an axis() feature, or an edge), enter the Total Count (the original included) and the spacing — the Offset / Total switch decides whether the value is the gap between neighbours or the whole span, spread evenly. Add second direction opens a second axis and count for a grid.
  5. Circular: fill the Axis slot (empty defaults to world Z), the Total Count, and the AngleTotal for the whole sweep, Offset for the degrees between neighbours.
  6. Centered spreads the pattern around the original instead of away from it. Skip lists instance indices to leave out (1, 3).
  7. Click Apply.

Linear copy

Four cylinders in a row

The code behind it

The Copy dialog's Linear kind with world X as the direction, a count of 4 and an offset of 150 writes this statement. No target is passed, so it copies the object built last.

row.part.js
import { circle, copy, extrude, sketch } from 'fluidcad/core';

sketch("xy", () => {
circle([150, 150], 100)
})

// A cylinder; extrude() with no distance uses the default of 25.
extrude()

// Four instances in a row along world X, 150 apart — the original counts.
copy("linear", "x", {
count: 4,
offset: 150
})

Options:

OptionMeaning
counttotal number of instances, the original included
offsetspacing between neighbours
lengththe whole span instead of offset; instances are spread evenly across it
centeredcentre the pattern on the original
skip0-based indices to leave out

Two directions

Pass two axes for a grid. count, offset and skip then take one value per axis:

copy("linear", ["x", "y"], {
count: [4, 3],
offset: [150, 100],
skip: [[2], [1]] // skip index 2 along X, index 1 along Y
})

Circular copy

Six cylinders around Z

The code behind it
ring.part.js
import { sketch, extrude, copy } from 'fluidcad/core';
import { circle } from 'fluidcad/core';

sketch("xy", () => {
circle([80, 0], 30)
})

// One cylinder, 80 from the Z axis.
extrude(25)

// Six instances spread evenly over a full turn around world Z.
copy("circular", "z", {
count: 6,
angle: 360
})

Options:

OptionMeaning
counttotal number of instances, the original included
anglethe whole sweep, spread evenly (default 360)
offsetdegrees between neighbours instead of angle
centeredcentre the sweep on the original
skipindices to leave out

The axis is anything axis-like — a world axis name, an axis() feature, an edge — see Axes.

Code forms

import { copy } from 'fluidcad/core';

copy("linear", "x", { count: 4, offset: 150 }) // the last solid
copy("linear", "x", { count: 4, offset: 150 }, a, b) // specific solids
copy("circular", "z", { count: 6, angle: 360 })
copy("circular", axis(e.sideEdges(0)), { count: 6, angle: 180, centered: true })

Each copy is an independent solid; the result's .instance(i) accessor addresses one of them for later features.

Copy versus repeat

copy() stamps the finished shape. repeat() re-applies a feature so that it interacts with the solid at every position — one solid with four pockets rather than four solids with one pocket each. See Repeat.

Inside a sketch

Called inside sketch(...), copy() duplicates sketch geometry, and the circular form takes a 2D centre point instead of an axis. See Copy in the sketch tools.