3dSynth

Tutorials / SynthBlocks

Open in the interactive tutorials reader

Tutorial 4: Simple Pyramid

Now that you've made a cube, let's create a shape that changes size as it goes up: a pyramid. You'll use the For Z loop for fine-grained control and Map Range to shrink the rectangle from a wide base to a point at the top.

A 4-sided pyramid tapering to a point

What you'll learn

Prerequisites


Step 1: Define your variables

We'll parameterise the base size and total height so they can be adjusted from the 3D viewport.

Set Variable

Interactive preview is available in the interactive reader.

Step 1

Create two variables

Add two Set Variable blocks to the top of your Path Group:

  1. baseSize = 50

Enable Show in viewport on each one.


Step 2: Centre on the build plate

Translate

Interactive preview is available in the interactive reader.

Step 2

Add a Translate block

Drag a Translate block below the Set Variable blocks.
Set X to Bed Size X / 2 and Y to Bed Size Y / 2.
All remaining blocks go inside the Translate body.


Step 3: Add the For Z loop

The For Z block iterates from a start height to an end height and gives you access to z, normZ, and layerIndex inside the loop. Unlike Stack Layers, it does not move the nozzle automatically — you control Z yourself.

For Z

Interactive preview is available in the interactive reader.

Step 3

Add For Z

From the Structure category, drag a For Z block into the Translate body.
Set Start to Layer Height (the printer-setting block), End to the variable pyramidHeight, and Step to the Layer Height printer-setting block.


Step 4: Draw a shrinking Rectangle

Inside each iteration we draw a square whose size decreases from baseSize at the bottom to 0 at the top.

Map Range

Interactive preview is available in the interactive reader.

Step 4

Add a Rectangle with Map Range

  1. Drag a Rectangle block into the For Z body.

Step 5: Move up one layer

Since For Z doesn't advance the nozzle automatically, we must add a relative Z move after each rectangle.

Step 5

Add Travel (Relative) Z

Drag a Travel (Relative) Z block after the Rectangle (still inside the For Z body).
Set Z to the Layer Height printer-setting block.


Complete block program

Full program — Tutorial 4

Interactive preview is available in the interactive reader.


Final block structure

#BlockWhereValues
1Set Variable baseSizePath Group50 · Show in viewport
2Set Variable pyramidHeightPath Group50 · Show in viewport
3TranslatePath GroupX = Bed Size X / 2, Y = Bed Size Y / 2
4For ZInside TranslateStart = Layer Height, End = pyramidHeight, Step = Layer Height
5  ↳ RectangleInside For Z
6    ↳ Map RangeWidthIn 0–1, Out baseSize–0
7    ↳ Map RangeHeightIn 0–1, Out baseSize–0
8      ↳ VariableMap InputsnormZ
9  ↳ Travel (Relative) ZInside For ZZ = Layer Height

Outcome

You have created a fully parametric pyramid! It starts as a 50×50 mm square at the bottom and linearly shrinks to a point at the configured pyramid height. Drag the sliders in the viewport to try different proportions instantly.


Load this tutorial

Interactive preview is available in the interactive reader.

Interactive preview is available in the interactive reader.


What's Next

Tutorial 5: Twisted Prism — Add a twist! Learn how to use the Rotate block with height-driven variables.