Mesmerizing Hex Fidget
You will print a toy that comes off the printer already moving: nested hexagon rings that spin and rock inside each other, no assembly required.

Overview
Until now, everything you've printed has been one solid piece. This toy is five pieces — four rings and a center — and you'll print them already assembled, moving parts and all. That trick is called print-in-place, and the whole secret is a small gap between the pieces so the printer can't weld them together.
To build it, you'll teach Codeblocks a new trick too: a template. A ring is nine blocks, and the toy needs several of them. Instead of placing those nine blocks over and over, you'll write the recipe for a ring once, give it a name, and then ask for a ring whenever you want one. The finished program that draws this whole toy is only four blocks long.
Builds on: sk8board Time! —
variables, math blocks, holes, grouping, loops, and exporting to .STL.
You've got it when…
- You defined a Ring template and a Center template — each a named recipe you wrote once.
- Pressing Play draws nested rings around a solid center, built by Create from Template blocks inside a Repeat loop, not by copies you placed by hand.
- An if/then block decides when the rings stop.
- You customized at least one variable, on purpose, within its range.
- Your
.STLfile is submitted in Google Classroom.
Collaboration & AI
Work: On your own. Ask a neighbor for a hand if you're stuck, but build your own fidget.
AI — AIAS Level 1, No AI: Templates are the new idea in this lab — meet them yourself. What the levels mean.
Create the Project
-
Go to Tinkercad, sign in, click Create, then Codeblocks.
-
Click the random name at the top of the screen and rename your project Hex Fidget.
Variables
Four variables control this whole toy. You'll set them once now, and near the end of the lab you'll come back and turn these knobs to make your fidget yours.
-
Create four number variables (Variables ▸ Create number variable…):
height,number sides,diameter, andtightness. -
Add four Set blocks and set the values shown.

Note
Nothing draws yet — variables only store numbers. What each one does, and how far you can push it, is coming in the Make It Yours section.
What's a Template?
A template is a recipe you write once and reuse. You've seen the idea off the screen: a cookie cutter is a template. You make the cutter one time, then stamp out as many cookies as you want — and if you change the cutter, every cookie you stamp from then on changes too.
In Codeblocks a template has two halves, and they live under the new Templates category:
-
Define Template is where you write the recipe. You give it a name and fill it with the blocks that do the work. Defining a template draws nothing — writing a recipe card isn't the same as cooking dinner.
-
Create from Template
is where you use the recipe. One of these blocks says "make one of those
now," and the shape finally appears.
You'll write two recipes — one for a ring, one for the center — and then a short program that calls them.
Where templates come from
Click Templates in the block drawer, then Create Template, to start a new one. Each template you define shows up in that same drawer as its own Create from Template block, ready to use.
The Ring Template
A ring starts life as a cone with its top cut off — wider at the bottom than the top. That slant is the secret to the whole toy. You'll build the whole ring recipe inside a Define Template so you can stamp out rings later.
-
Make a new template (Templates ▸ Create Template) and name it
Ring. Everything in the next steps goes inside this Define Template Ring block. -
Drop a Comment block in first: This template builds a single ring. A comment is a note to yourself; the program ignores it.
-
Add a Cone and unfold its parameters. Set Sides to the
number sidesvariable and H toheight. Set Bottom Radius to the equationdiameter / 2, and Top Radius todiameter / 2 - tightness.Order of operations, again
Same rule as the sk8board's wheelbase equation: divide first, then subtract — the division block sits inside the subtraction block. Built the other way,
2 - tightnessis negative, and your cone turns inside out. -
Add a Move block set to Z-axis min to 0.0, resting the cone on the Workplane.

-
Right-click your Add Cone block and choose Duplicate — the whole block copies, equations and all. Snap the copy under the Move block. On the copy: click the striped circle to make it a hole, change its Top Radius equation to
diameter / 2 - tightness + 2, and its Bottom Radius todiameter / 2 - 2. Add a Move block set to Z-axis min to 0.0 under it (unless Duplicate already brought one along).
Those 2s are the whole trick
The hole cone is 2 millimeters smaller than the next ring that will grow inside this one. That 2 mm of air is called clearance — a gap big enough that the printer can't fuse the pieces, small enough that the rings can't escape each other. Print-in-place lives or dies on it.
-
Add a Group Selection block. It combines the shapes above it — the hole does its cutting now. Then mirror the ring so an inner ring can't slide out the top: add a Copy, a Rotate around Axis y by 180 degrees from Pivot 0, 0, 0, and a second Group Selection to fuse the ring to its mirror image.

-
Add one last block to the recipe: a Change block from Variables — Change
diameterby -8. This shrinksdiameterby 8 millimeters, so the next ring you stamp comes out smaller than this one.
Your finished Ring template should look like this.

Press Play — nothing happens. That's right.
A Define Template is a recipe card, not a meal. Pressing Play now draws nothing, because you've only written the recipe — you haven't asked for a ring yet. That comes in two more steps.
The Center Template
The bullseye of the toy is a solid piece — a ring without the hole. It's the same recipe, shorter, so this one goes fast.
-
Make a second template (Templates ▸ Create Template) and name it
Center. Inside it: a Comment (This template creates the center), a Cone with the same four parameter equations as before (Duplicate is your friend), a Move to Z-axis min to 0.0, a Group Selection, then the mirror — Copy, Rotate around Axis y by 180 from Pivot 0, 0, 0, and a final Group Selection.
No hole, no Change
The center is solid, so there's no hole cone. And nothing comes after it, so there's no Change diameter — the center is made once, at whatever
diameteris left when the rings are done.
The Program
Two recipes written. Now write the short program that uses them. This part is a separate stack — start it in an empty part of the workspace, below your Set blocks.
-
From Templates, drag a Create from Template Center block into the empty workspace.
Click Play. Your screen should look like this.

Your first template, used
One block, one shape. That's a template working: the recipe you wrote under Define Template Center ran because a Create from Template asked it to. Defining drew nothing; creating drew the center.
-
Now the rings. Drag a Repeat block from Control above your Create from Template Center, and set it to Repeat 10 Times. Drag an if/then block from Control into the Repeat block's mouth.
-
Build the condition
diameter > 28in the if block's slot: drag the comparison block from Math into the slot, change its=to>, drag the rounddiametervariable into the left space, and type28in the right.
-
Drag a Create from Template Ring block into the if block's mouth.

Click Play. Your screen should look like this.

Checkpoint
Look how short the program is: a loop, a question, and two Create from Template blocks. All the real work lives in the two recipes you wrote once. That's what templates buy you.
Where did the other trips go?
The loop offers 10 trips, but you got four rings. Each time
Create from Template Ring runs, its last block counts diameter down
by 8: 60, 52, 44, 36… The if/then only says yes while diameter is
above 28, so once it drops to 28 the remaining trips build nothing. The
loop counts; the conditional decides. Change diameter later and the
same four blocks make more rings or fewer.
Make It Yours
Here's what each variable does, and how far it bends before it breaks. Change one at a time, predict what you'll see, then press Play and check yourself.
| Variable | What it does | Range |
|---|---|---|
height |
Thickness of the toy in millimeters. Thin prints fast and flexes; thick feels chunky in the hand. | 3 – 8 |
number sides |
How many flat sides each ring has. 6 is the hex in hex fidget; 3 is a triangle; past about 24 it looks round. | 3 – 64 |
diameter |
How wide the whole toy is, in millimeters — and, through the if block, how many rings it has. | 40 – 200 |
tightness |
How steep the ring walls slant. Lower numbers are looser — the rings rock farther and feel floppier. Higher numbers are tighter and shorter-travel. | 3 – 12 |
-
Set
number sidesto24. Predict first, then Play.Your screen should look like this.

-
Set
number sidesback to6, then setdiameterto100. Predict: wider, sure — but how many rings now? Play.Your screen should look like this.

About the colors
Tinkercad picks each shape's color for you, so your fidget may not match the pictures. Shapes share one color each time a Group Selection combines them. Shape and position are what to check, not color.
-
Set every variable to the combination you actually want to print — anything you like, inside the ranges. Stay near
60fordiameterunless you want to wait on a very long print.
Outside the ranges
The ranges aren't decoration. Below 40, diameter leaves no room for
even one ring; a tightness below 3 can drop the clearance to nothing
and print as one welded lump. If your Play result looks wrong, check
the table before you blame the blocks.
Preparing for 3D Printing
We need to export the design in a format the 3D printing software can use.
-
Click the Share button
in the upper
right corner. -
Select .STL

-
Submit your downloaded
.STLfile in Google Classroom.
Go Further: Claim the Center
The center of your fidget is a solid hexagon about 20 millimeters across — a blank billboard. Put your initials on it, or a simple logo built from shapes.
Here's the template payoff: these blocks go inside your Center template, after its last Group Selection. Change the recipe once, and the center that comes out of it changes — you don't touch the program at all.
- Add a Text shape from Shapes. Unfold it and replace
TEXTwith your initials — two or three letters fit best. - Add a Set size block: X 16, Y 8, Z 2 fits the center
at the default
diameter. - Add a Move block set to Z-axis min to 4 — your
heightvalue — so the letters sit on the center's top face.
Click Play. The letters rise from the center of the toy. That's the raised finish. For engraved letters instead, click the Text block's hole button and add one more Group Selection at the end of the template — the letters get carved into the face.
A logo works the same way: build it from basic shapes, size it to the center, raise it or sink it. One rule either way — keep your letters or logo on the center piece only. Anything hanging past the center's edge will weld your rings together, and a fidget that doesn't fidget is a coaster.
Turn It In
- Your hex fidget's
.STLfile, submitted in Google Classroom.
Credit: Adapted from Print-in-Place Mesmerizing Hex Fidget Toy.
How It's Graded
This lab is worth up to 4 points. One score covers everything you turn in.
| Score | What it looks like |
|---|---|
| 4 — Excellent | Pressing Play draws the nested rings from a Create from Template Ring inside the Repeat loop, the if/then stops them at the right size, the center comes from a Create from Template Center — and your variables are deliberately set inside the documented ranges, so the toy you exported is one you designed, not just the defaults. The .STL is in Google Classroom. |
| 3 — Above Average | A complete, printable fidget with a slip — the defaults untouched, a value just outside its range, or the Change block's -8 typed as a positive number and corrected at the desk. |
| 2 — Average | A real gap — rings placed as hand-made copies instead of a template in the loop, the if/then missing so tiny rings pile up in the center, or no center piece. |
| 1 — Below Average | A template or a single shape, but the program never produced a fidget; or nothing exported. |
| 0 — Failing | Nothing submitted and no design in your account. |