Midnight Grimoire — Raspberry Pi 4 case shaped like a spell book
115 W × 84 D × 43.5 H mm (plus feet). Every part prints without supports.

The covers and spine are navy, the pages cream. The gold and pale blue trim is printed separately and pressed in, so no print changes colour part-way. This case has no camera.
Files
| File | What it is |
|---|---|
3mf/plate_1_navy.3mf |
base (bottom cover + spine) and lid (top cover), in print orientation |
3mf/plate_2_cream.3mf |
the page block |
3mf/plate_3_gold.3mf |
clasp, 3 spine bands, 4 big stars, 2 small stars |
3mf/plate_4_pale_blue.3mf |
the 5 moons |
stl/ |
the same parts one by one. band is printed 3 times, star_big 4, star_small, moon_half and moon_crescent twice each |
step/grimoire_assembly.step |
assembled CAD model incl. a reference Pi, fan and button, for Fusion / FreeCAD / Onshape |
grimoire_case.py |
parametric source. uv run grimoire_case.py regenerates everything above |
preview/ |
renders: assembled, rear, right side, top, inside, underside, exploded, print plates |
Printing
One plate per filament colour.
| Plate | Colour | Parts | Time | Filament |
|---|---|---|---|---|
| 1 | navy | base, lid | 1 h 56 min | 68 g |
| 2 | cream | pages | 41 min | 32 g |
| 3 | gold | clasp, 3 bands, 6 stars | 16 min | 8 g |
| 4 | pale blue | 5 moons | 3 min | 1 g |
Times and weights are Bambu Studio's own estimates for the P2S, 0.4 mm nozzle, "0.20mm Standard" with 3 walls, Bambu PLA Basic.
In Bambu Studio, for each plate:
- File → Import → Import 3MF/STL/STEP… and pick the plate file. It will say the file was not made by Bambu Studio and only the geometry is loaded: that is expected. If it asks whether to load it as one object with multiple parts, answer no.
- Process "0.20mm Standard". Under Strength set Wall loops to 3. Leave supports off.
- Choose the filament, Slice plate, Print plate.
The parts are already turned the right way up. Don't auto-orient them:
| Part | How it lies on the bed |
|---|---|
| base | as it stands, underside down |
| lid | face down, posts pointing up |
| pages | upside-down, so every socket opening is open at the top |
| clasp | on its side |
| band | on its side |
| stars, moons | flat |
The lid prints with its decorated face on the plate, so the cover gets the plate's finish: an even matte grain on the textured plate. The moons that curve the other way are the same parts turned over.
PETG is the safer choice next to a Pi 4. PLA works if the case is not in the sun.
Hardware
| Qty | Screw | Where |
|---|---|---|
| 3 | M3 × 8 pan head | base → lid, from underneath |
| 4 | M2.5 × 6 | Pi → base posts |
| 4 | 12 mm stick-on rubber feet | recesses under the base |
| 1 | 12 mm momentary push button, panel mount (M12 thread) | power button, back of the pages |
| 1 | CanaKit Raspberry Pi Fan (RSP-FAN, 30 × 30 mm) | behind the back vents |
All screws thread straight into the plastic (pilot holes are sized for that). The button, fan and feet are the same ones the other two cases use.
Assembly

- Press the three gold bands into the grooves across the spine, and the stars and moons into their pockets in the lid. They are a press fit. If one is loose, a drop of superglue holds it.
- Screw the Pi to the four posts in the base: microSD end toward the spine, USB-C and HDMI toward the front. The card can go in now or once the case is shut (see "The microSD card" below).
- Push the power button through the hole in the back of the pages from outside and tighten its nut inside.
- Lower the pages over the Pi, inside the rim of the base. Every socket opening is a slot open at the bottom, so the block comes straight down past the sockets.
- Drop the fan between the two rails on the back wall, label toward the wall, until it stands on its shelf (see "Fan" below).
- Plug the button onto header pins 5 and 6 and the fan's two wires onto pins 4 and 9 (see "Wiring" below).
- Lower the lid onto the pages, its three posts going down inside. Hold it shut, turn the case over and fit the 3 screws. Stop when they are snug: they clamp the pages between the two covers.
- Slide the clasp on from the front, its hook into the notch under the base, until the ridge under its strap drops into the groove in the lid.
- Stick on the feet.
To open it again, lift the back end of the clasp's strap with a fingernail, pull the clasp off forward, and take out the 3 screws. The microSD card does not need that.
The microSD card

The card comes out and goes in from underneath, with the case shut. Its end is 6 mm above the underside, beside the spine, over an opening in the floor 18 × 14.5 mm. A slot in the bottom of the pages' wall lets the card pass into the hollow inside the spine. Lift the spine end of the book, or turn the book over, to reach it: standing on its feet, the book leaves no room for a finger underneath.
- To take it out, put a fingernail on the end of the card through the opening and draw it toward the spine. After about 12 mm it is out of its socket, and the far end drops through the opening.
- To put it in, hold it by its contacts end, label toward you. Feed the other end up through the opening, slanting toward the spine, until it stops against the inside of the spine. Lift the contacts end until the card lies flat, then push it away from the spine with a fingertip on its label. It slides under the edge of the board into the socket. It is home when its end stands about 2.4 mm out past the board.
The card is not reached from the side because the way in there is long and passes through the decoration. At the card's height the spine's outside is 17 mm from the card's end, and the card lies partly under the middle gold band. An opening through the spine would cut the band, or the bands would have to move off centre.
Wiring
With the front of the book toward you, the 40-pin header runs along the back edge of the Pi and pin 1 is at its left-hand end (the spine end). The row nearer the back wall holds the even pins, the row nearer the middle of the board the odd ones.
- Button → pins 5 and 6: the third pair from the left, one behind the other. Polarity does not matter.
- Fan red → pin 4 (5 V): back row, second from the left.
- Fan black → pin 9 (ground): inner row, fifth from the left.
Count carefully: the first two pins of the back row (pins 2 and 4) carry 5 V. Bridging
5 V to a GPIO pin can damage the Pi. The Arcade Wedge's README has
the dtoverlay=gpio-shutdown line the button needs and what to expect from it.
Fan

The fan stands upright against the back wall, behind six vent slots, and the processor is straight in front of it. It is held without clips: two L-shaped rails on the wall keep it in place sideways and front to back, a shelf in the base carries it, and a thin bar under the lid presses down on it by about 0.25 mm so it cannot rattle. The bar is printed flat, so it bends along its layers. That is the strong direction, unlike the upright clip that broke on the Arcade Wedge.
With its label toward the wall the fan blows out of the back: air comes in through the slots under the processor and on the right-hand side, crosses the board and leaves. Turned round, it blows outside air onto the board instead.
Check before printing the pages
The rails take a fan 30 × 30 mm square and up to 7.6 mm thick. CanaKit publishes
30 × 30 mm but not the thickness; 7 mm is the figure usually quoted. A 7 mm fan has
0.8 mm of room front to back, which the bar under the lid takes up by holding it down.
If yours is thicker than 7.6 mm, set FAN_T_MAX to its thickness and re-run the
script. Only pages changes.
What differs from the concept picture
- The front has an audio jack where the picture has Ethernet. A Pi 4 has USB-C, two HDMI and audio along one edge, and Ethernet with the four USB sockets on the next. So Ethernet and USB are on the right-hand side, where the picture has vents.
- The vents are at the back, in front of the fan, with four short ones at the back of the right-hand side.
- The sockets sit on the bottom cover, with no strip of pages under them. The page block is lowered over a Pi that is already screwed down, so its openings have to be open at the bottom. The rim of the bottom cover closes them.
- It is thicker for its width: 42 mm of book for 115 mm. The USB sockets are 16 mm tall and the fan 30 mm, standing up.
- The spine's underside is cut back instead of round. It leans out at 42° so it prints without supports. From above it looks round.
- The clasp's lower corners are bevelled, not rounded, and the clasp is one piece. That is what lets it print on its side, where its strap is strongest.
- Stick-on rubber feet, not printed ones: a foot printed under the base would lift the whole floor off the plate.
What has been checked
- In CAD: no printed part overlaps another, or the reference Pi, fan or button. The assembly moves (pages lowered over the Pi, fan dropped in, lid lowered, clasp slid on) were stepped through. Nothing touches except the two things meant to: the bar that presses on the fan, and the clasp's ridge riding over the lid on its way to its groove.
- In the slicer: all four plates slice in Bambu Studio with the P2S profile, no supports, no warnings. Nothing prints in mid-air: the longest bridges are the bar over the fan (17 mm), the pocket under the full moon (14 mm) and the vent slots (13 mm).
- The microSD opening, in CAD: a card 15 × 11 × 1 mm was drawn out of its socket toward the spine, tipped 50 degrees and slid out through the floor, in 40 steps, and touched nothing on the way. It did the same 0.7 mm lower, and 1 mm to either side. Once out of its socket, the card's far end is 0.6 to 1.5 mm short of the inside of the spine: a card that has further to travel than drawn starts to tip just before it is out. The opening leaves 1.5 mm of plastic between it and the middle band's groove, and is 2.4 mm inside the foot of the spine. It is 7 mm from the nearest foot's recess, 8 mm from the nearest lid screw's pad and 12 mm from the nearest Pi post.
- The two parts it changes, as they lie on the bed:
print_check.pyfinds each starting on the bed as one piece and lists nothing it did not list before; there is no new downward face flatter than 45 degrees. The slot in the pages is open at the top as printed, like the socket openings, and the opening in the base has no roof. Plates 1 and 2 slice in Bambu Studio with no warnings, as before. - Not printed with the microSD opening, and no card tried through it. How easily a finger finds the card's end, and pushes a card home from underneath, is unchecked.
- Not printed yet. The fits that depend on the printer are the press fit of the
bands (
TRIM_FIT) and of the stars and moons (INLAY_FIT), the pages inside the two rims (FIT), and the clasp: how hard it is to slide on and how firmly it holds. The lid has three screws and none at the front right, where the Pi leaves no room for a post. The clasp is what holds that corner down.
Parameters worth knowing (top of grimoire_case.py)
| Name | Default | Effect |
|---|---|---|
H, T_COVER |
42 / 6.4 | height of the book / how thick each cover looks |
D |
84 | front to back. The room behind the Pi for the fan and wires comes from this |
OVER |
3.0 | how far the covers stick out past the pages |
FIT |
0.25 | clearance between printed parts; raise it if your printer runs tight |
TRIM_FIT, INLAY_FIT |
0.1 / 0.15 | press fit of the bands / of the stars and moons; raise it if they won't go in |
SPINE_W, SPINE_H |
12 / 43.5 | how far the spine sticks out / its height |
SPINE_LEAN |
42 | how far the spine's underside leans out, in degrees. Keep it under 45 |
FAN_T_MAX |
7.6 | thickest fan the rails take |
SPRING_PRESS |
0.25 | how hard the bar under the lid presses on the fan |
SWITCH_HOLE_D |
12.4 | power button hole (16.4 for a 16 mm button, 0 for no hole) |
SWITCH_X, SWITCH_Z |
18 / 26 | position of the button on the back wall |
CLASP_NUB |
0.6 | height of the ridge that holds the clasp on (less = easier on and off) |
SD_HOLE_W, SD_HOLE_L |
18 / 14.5 | the opening under the microSD card: across the card / along it (0 width = no opening). Keep the length at 15 or under: more brings it within 1 mm of the middle band's groove |
SD_HOLE_UNDER |
2.0 | how far that opening runs in under the Pi's board |
SD_SLOT_TOP |
1.0 | how far the slot in the pages' wall reaches above the board's underside |
STARS |
six | where each star sits on the lid, and its size |
M3_PILOT, PI_SCREW_PILOT |
2.8 / 2.15 | self-tapping hole sizes |
Redrawing the previews
uv run grimoire_case.py --assembled /tmp/grimoire_assembled
/Applications/Blender.app/Contents/MacOS/Blender -b -P render_previews.py -- \
/tmp/grimoire_assembled stl preview
Where the dimensions come from
- Raspberry Pi 4 Model B: official mechanical drawing (https://datasheets.raspberrypi.com/rpi4/raspberry-pi-4-mechanical-drawing.pdf).
- Fan: CanaKit Raspberry Pi Fan product page (https://www.canakit.com/raspberry-pi-fan.html): 30 × 30 mm. The thickness is the usual value for 30 mm fans, not a CanaKit figure.