Dragon Egg

February 2023

An LED dragon’s egg with a 3D-printed shell exterior and a flexible scaffold interior to mount addressable fairy light LEDs.

Dragon egg spiral

Process

Flexible LED Scaffold

I 3D printed a “scaffold” to mount the LEDs to using TPU filament so the structure would be flexible and easier to insert into the rigid exterior shell. To model the scaffold, I used Blender python scripts to calculate evenly spaced positions around a simple egg shape, then use those positions to generate rings with flat faces for each LED and notches for linking the rings together.

3D printed assembled scaffold

Generating vertices, edges, and faces Blender

This YouTube video taught me how to generate mesh objects in Blender. Below is a template to get started. It generates a 2D square. (In Blender, go to the “Scripts” tab, paste this code, and click the “Play” button!)

import bpy


def create_mesh_obj(verts, edges, faces, name="mesh"):
    '''
    creates a new mesh object and adds it to Blender
    '''
    mesh_data = bpy.data.meshes.new(name + "_data")
    mesh_data.from_pydata(verts, edges, faces)
    mesh_obj = bpy.data.objects.new(name, mesh_data)
    bpy.context.collection.objects.link(mesh_obj)
    return mesh_obj


verts = [(0, 0, 0), (0, 1, 0), (1, 1, 0), (1, 0, 0)] # vertices of a square
edges = []
faces = [(0, 1, 2, 3)] # connect the vertices (by index) to make a face

create_mesh_obj(verts, edges, faces, name="square")

A square!

Blender simple square

Space out LEDs evenly across the surface of the egg

Every LED is spaced ~17 millimeters apart vertically, horizontally, and staggered evenly.

Blender vertical spacing
Blender radius and z index


To space vertically, I added vertices one at a time along the edge of the egg, keeping the distance from the last vertex around 17 millimeters. Then use each of those vertices to measure the height and radius for each ring. I measured all these values in Blender and hard-coded them into the python script.

A bird’s eye view of the egg:

Blender circumference spacing

To space horizontally, I use a handy function that finds the (x, y) coordinates of a point along the circumference of a circle. (I post all my math and geometry utility functions here!) My point on circumference (poc) function:

def poc(radius, origin, d):
    '''
    get a point on the circumference of a circle
      d : degrees along the circumference of the circle
      radius : radius of the circle
      origin : (x, y, z) center coordinates of the circle
    '''
    degrees = d + 270 if d - 90 < 0 else d - 90
    radians = (degrees * math.pi) / 180
    x = origin[0] + radius * math.cos(radians)
    y = origin[1] + radius * math.sin(radians)
    return (x, y, origin[2])


Rotate every other ring to make everything evenly staggered.

Rotate rings diff

Add notches to rings for easier assembly

Vertical notches
Horizontal notches

Install LEDs

After gluing each 3D-printed ring together to complete the scaffold, fairy light LEDs are glued to each flat face of the scaffold rings with super glue.

Bare LEDs on scaffold

Code

Much of the code is adapted from my Tree of Light project, with new patterns added, including a lava lamp effect. Read all the code on GitHub!

Thanks for reading!