Build a drone: payload and sizes
The last parts hang under the frame: a camera on its gimbal and the battery in its straps. Then one number shows what the functions were made for.
-
The payload hangs under the frame: a camera on its gimbal at the front, its lens in glass, and the battery in two straps.
- Make the function gimbal:
- set bracket to extrude(shape face from wire(shape fillet 2d(shape polygon wire([point xyz(-4, 19, -4), point xyz(19.5, 19, -4), point xyz(19.5, -7, -4), point xyz(14.5, -7, -4), point xyz(14.5, 15, -4), point xyz(-4, 15, -4)]), radius 1.5), planar true), direction vector xyz(0, 0, 8))
- return translate(shape union(shapes [cylinder(radius 9, height 8, center point xyz(0, 18, 0), direction vector xyz(0, 1, 0)), bracket, cylinder(radius 6, height 5, center point xyz(14.5, 0, 0), direction vector xyz(-1, 0, 0))], keep edges false), translation vector xyz(0, -26, 55))
- Make the function camera:
- return union(shapes [fillet edges(shape box(width 24, length 20, height 18, center point xyz(0, -26, 55)), radius 3), cylinder(radius 6.5, height 9, center point xyz(0, -26, 63), direction vector xyz(0, 0, 1))], keep edges false)
- Make the function lens:
- return cylinder(radius 5.2, height 1.5, center point xyz(0, -26, 71.5), direction vector xyz(0, 0, 1))
- Make the function battery:
- return fillet edges(shape box(width 36, length 72, height 26, center point xyz(0, -16, -20)), radius 3)
- Make the function straps:
- set strap to difference(shape box(width 40, length 10, height 30, center point xyz(0, 0, 0)), shapes [box(width 36.5, length 12, height 26.5, center point xyz(0, 0, 0))], keep edges false)
- return make compound([translate(shape strap, translation vector xyz(0, -16, -42)), translate(shape strap, translation vector xyz(0, -16, 2))])
- Add a stack under the others:
- draw any async no return(entity gimbal(), options aluminium)
- set polymer to look("polymer",
#2a2d31, 0.05, 0.4,#000000,#f2f2f2, 6) - draw any async no return(entity [camera(), battery()], options polymer)
- draw any async no return(entity lens(), options look("glass",
#0c1522, 0.1, 0.05,#000000,#f2f2f2, 4)) - draw any async no return(entity straps(), options accent)
- Run it with Run the code.

- Make the function gimbal:
-
Change one number: with six arms the drone rebuilds, everything around repeats follows, and the propeller shrinks to fit between its neighbours.
- In set arms to 4, change 4 to 6.
- Run it with Run the code.

The finished drone
The script the chapters build, to run here:
The finished script is also the Blockly showcase, to download and open.
Verified against the product in October 2026

