Midnight Grimoire

This is the README that comes in the download. The files it names are in the zip.

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.

assembled

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:

  1. 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.
  2. Process "0.20mm Standard". Under Strength set Wall loops to 3. Leave supports off.
  3. 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

exploded

  1. 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.
  2. 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).
  3. Push the power button through the hole in the back of the pages from outside and tighten its nut inside.
  4. 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.
  5. Drop the fan between the two rails on the back wall, label toward the wall, until it stands on its shelf (see "Fan" below).
  6. Plug the button onto header pins 5 and 6 and the fan's two wires onto pins 4 and 9 (see "Wiring" below).
  7. 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.
  8. 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.
  9. 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

underside

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.

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.

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

inside

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

What has been checked

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