Build a drone: arms around the frame
One arm becomes as many as sizes.arms says. Wrapping a part's shape in around is the whole change, and two small functions make the drone fly straight and show which way it faces.
-
aroundmakes the one arm into as many assizes.armssays: wrap each part's shape in it, and the arm, the motor, the stator and the bolts stand around the frame.- Import at the top of
main.ts:
import { around } from "./parts/around";- In
main.ts, changeawait draw(looks.carbon, arm);toawait draw(looks.carbon, await around(arm, sizes.arms));. - In
main.ts, changeawait draw(looks.aluminium, motorParts.motor);toawait draw(looks.aluminium, await around(motorParts.motor, sizes.arms));. - In
main.ts, changeawait draw(looks.copper, motorParts.stator);toawait draw(looks.copper, await around(motorParts.stator, sizes.arms));. - In
main.ts, changeawait draw(looks.steel, bolts);toawait draw(looks.steel, await around(bolts, sizes.arms));. - Run it with Run The Code.

- Import at the top of
-
Neighbouring propellers turn opposite ways, so the drone does not spin.
alternateSpinmirrors every second propeller across its own arm and turns each a little, so the blades do not all line up.- Make
parts/spin.ts:
export async function alternateSpin(propellers: Bit.Inputs.OCCT.TopoDSShapePointer[]) {const spun: Bit.Inputs.OCCT.TopoDSShapePointer[] = [];for (const [i, propeller] of propellers.entries()) {const angle = (i + 0.5) * 360 / propellers.length * Math.PI / 180;const centre = (await bitbybit.occt.analysis.measure.tightBoundingBox({ shape: propeller })).center;const turned = await bitbybit.occt.transforms.rotateAroundCenter({ shape: propeller, angle: i * 37, center: [centre[0], 0, centre[2]], axis: [0, 1, 0] });spun.push(i % 2 === 0? turned: await bitbybit.occt.transforms.mirrorAlongNormal({ shape: turned, origin: [0, 0, 0], normal: [Math.sin(angle), 0, Math.cos(angle)] }));}return spun;}- Import at the top of
main.ts:
import { alternateSpin } from "./parts/spin";- In
main.ts, changeawait draw(looks.accent, blades);toawait draw(looks.accent, await alternateSpin(await around(blades, sizes.arms)));. - Run it with Run The Code.

- Make
-
The lights repeat too, and
bySidesorts them by the side of the drone they are on, so the front ones are drawn green and the back ones red, as on an aircraft.- Make
parts/lights.ts:
export async function bySide(lights: Bit.Inputs.OCCT.TopoDSShapePointer[]) {const front: Bit.Inputs.OCCT.TopoDSShapePointer[] = [];const back: Bit.Inputs.OCCT.TopoDSShapePointer[] = [];for (const lamp of lights) {const centre = (await bitbybit.occt.analysis.measure.tightBoundingBox({ shape: lamp })).center;(centre[2] > 0 ? front : back).push(lamp);}return { front, back };}- Import at the top of
main.ts:
import { bySide } from "./parts/lights";- In
main.ts, change
await draw(looks.green, lamp);to
const lights = await bySide(await around(lamp, sizes.arms));await draw(looks.green, lights.front);await draw(looks.red, lights.back);- Run it with Run The Code.

- Make
Next: canopy and electronics.
Verified against the product in October 2026