January 10, 2026
Description
Insanity Stack.
Just messing around with AI and blender scripts.
I think trying to stack these things will drive you nuts... Hence the name.
import bpy
import bmesh
import math
def create_complex_stackable_star():
# 1. CLEAN SCENE
# Delete everything to start fresh
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
# 2. SETUP PARAMETERS
name = "StackableStarLattice"
num_arms = 8
radius_inner = 1.5
radius_outer = 4.0
height = 2.0
# 3. CREATE THE MESH DATA
mesh = bpy.data.meshes.new(name)
obj = bpy.data.objects.new(name, mesh)
bpy.context.collection.objects.link(obj)
bpy.context.view_layer.objects.active = obj
obj.select_set(True)
# 4. BUILD GEOMETRY WITH BMESH
# We will build 1/8th of the shape (one arm) and array it.
bm = bmesh.new()
# Define vertices for one arm wedge
# We are creating a "V" shape pointing outward
# Bottom vertices
v1 = bm.verts.new((radius_inner, -0.8, 0)) # Inner Left
v2 = bm.verts.new((radius_inner, 0.8, 0)) # Inner Right
v3 = bm.verts.new((radius_outer, 0, 0)) # Outer Tip
# Top vertices (mirrored on Z axis for height)
v4 = bm.verts.new((radius_inner, -0.8, height))
v5 = bm.verts.new((radius_inner, 0.8, height))
v6 = bm.verts.new((radius_outer, 0, height))
# Create Faces for the basic wedge
# Side walls
f1 = bm.faces.new((v1, v3, v6, v4)) # Side A
f2 = bm.faces.new((v3, v2, v5, v6)) # Side B
# Inner wall (facing the hole)
f3 = bm.faces.new((v1, v4, v5, v2))
# Note: We leave Top and Bottom OPEN so it can be "solidified" later
# and to allow for the truss structure effect.
bmesh.ops.recalc_face_normals(bm, faces=bm.faces)
bm.to_mesh(mesh)
bm.free()
# 5. MODIFY THE GEOMETRY (THE TRUSS LOOK)
# We use modifiers to generate the complex look non-destructively
# A. ARRAY MODIFIER (To make it a star)
# We need an empty object to serve as the rotation pivot
empty = bpy.data.objects.new("ArrayPivot", None)
bpy.context.collection.objects.link(empty)
empty.rotation_euler[2] = math.radians(360 / num_arms) # 45 degrees
mod_array = obj.modifiers.new("Array", 'ARRAY')
mod_array.count = num_arms
mod_array.use_relative_offset = False
mod_array.use_object_offset = True
mod_array.offset_object = empty
mod_array.use_merge_vertices = True
mod_array.merge_threshold = 0.1
# B. DECIMATE (Planar) - Optional
# Helps clean up topology if we add more complexity later
# C. WIREFRAME / SOLIDIFY COMBO
# This creates the lattice/hole effect seen in the image.
# Instead of boolean cutting, we convert the faces to thick wireframes.
# First, let's inset the faces slightly to create the "frame" look
# (Doing this via edit mode context for precision)
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
# Subdivide once to add the "cross" structure seen in the image holes
bpy.ops.mesh.subdivide(number_cuts=1)
# Inset individual faces
bpy.ops.mesh.inset(thickness=0.3, use_individual=True)
# Delete the inset faces to create holes
bpy.ops.mesh.delete(type='FACE')
bpy.ops.object.mode_set(mode='OBJECT')
# D. SOLIDIFY (To give the paper-thin walls thickness)
mod_solid = obj.modifiers.new("Solidify", 'SOLIDIFY')
mod_solid.thickness = 0.3
mod_solid.offset = 0
# E. BEVEL (To catch light and look manufactured)
mod_bevel = obj.modifiers.new("Bevel", 'BEVEL')
mod_bevel.width = 0.05
mod_bevel.segments = 2
mod_bevel.limit_method = 'ANGLE'
# 6. MATERIAL SETUP (Cardboard/Clay look)
mat = bpy.data.materials.new(name="CardboardMat")
mat.use_nodes = True
nodes = mat.node_tree.nodes
bsdf = nodes.get("Principled BSDF")
if bsdf:
bsdf.inputs['Base Color'].default_value = (0.8, 0.7, 0.55, 1) # Beige
bsdf.inputs['Roughness'].default_value = 0.8
obj.data.materials.append(mat)
# 7. LIGHTING AND CAMERA
# Add a camera looking down
cam_data = bpy.data.cameras.new("TopCam")
cam_obj = bpy.data.objects.new("TopCam", cam_data)
bpy.context.collection.objects.link(cam_obj)
cam_obj.location = (0, 0, 15)
cam_obj.rotation_euler = (0, 0, 0)
# Add a Sun light
light_data = bpy.data.lights.new("Sun", type='SUN')
light_obj = bpy.data.objects.new("Sun", light_data)
bpy.context.collection.objects.link(light_obj)
light_obj.location = (5, 5, 10)
light_obj.rotation_euler = (math.radians(45), math.radians(45), 0)
light_data.energy = 5
create_complex_stackable_star()License:
Creative Commons — Attribution — Noncommercial