```python
import bpy, math, random
import numpy as np
from mathutils import Vector

random.seed(18)
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)

# Materials
def principled(name, color, metallic=0, rough=.4, transmission=0, ior=1.5, emission=None):
    m=bpy.data.materials.new(name); m.use_nodes=True
    p=m.node_tree.nodes.get('Principled BSDF')
    p.inputs['Base Color'].default_value=(*color,1)
    p.inputs['Metallic'].default_value=metallic
    p.inputs['Roughness'].default_value=rough
    p.inputs['Transmission Weight'].default_value=transmission
    p.inputs['IOR'].default_value=ior
    if emission:
        p.inputs['Emission Color'].default_value=(*color,1)
        p.inputs['Emission Strength'].default_value=emission
    return m

brass=principled('Oxidised instrument brass',(.32,.19,.065),.82,.32)
n=brass.node_tree.nodes; l=brass.node_tree.links; p=n.get('Principled BSDF')
noise=n.new('ShaderNodeTexNoise'); noise.inputs['Scale'].default_value=8
noise.inputs['Detail'].default_value=4
r=n.new('ShaderNodeValToRGB')
r.color_ramp.elements[0].position=.2; r.color_ramp.elements[0].color=(.065,.044,.018,1)
r.color_ramp.elements[1].position=.8; r.color_ramp.elements[1].color=(.53,.32,.11,1)
l.new(noise.outputs['Fac'],r.inputs[0]); l.new(r.outputs[0],p.inputs['Base Color'])
bright=principled('Edges polished by handling',(.66,.42,.16),.87,.2)
darkmetal=principled('Blackened steel',(.021,.029,.033),.8,.26)
stone=principled('Basalt plinth',(.033,.041,.046),.2,.28)
concrete=principled('Boardless cast concrete',(.105,.123,.134),0,.86)
n=concrete.node_tree.nodes; l=concrete.node_tree.links
noise=n.new('ShaderNodeTexNoise'); noise.inputs['Scale'].default_value=5; noise.inputs['Detail'].default_value=5
r=n.new('ShaderNodeValToRGB'); r.color_ramp.elements[0].color=(.047,.058,.065,1); r.color_ramp.elements[1].color=(.16,.18,.19,1)
l.new(noise.outputs['Fac'],r.inputs[0]); l.new(r.outputs[0],n.get('Principled BSDF').inputs['Base Color'])
b=n.new('ShaderNodeBump'); b.inputs['Strength'].default_value=.25; b.inputs['Distance'].default_value=.055
l.new(noise.outputs['Fac'],b.inputs['Height']); l.new(b.outputs[0],n.get('Principled BSDF').inputs['Normal'])
floor=principled('Honed charcoal concrete',(.038,.05,.059),.15,.36)
velvet=principled('Oxblood velvet',(.23,.008,.024),0,.85)
velvet.node_tree.nodes.get('Principled BSDF').inputs['Sheen Weight'].default_value=.65
glass=principled('Optical crown glass • IOR 1.52',(.89,.97,1),0,.035,1,1.52)
crystalmat=principled('Refractive anomalous quartz • IOR 1.76',(.79,.92,1),0,.025,1,1.76)
cyan=principled('Dispersed cyan',(.08,.8,1),.18,.2,emission=4)
violet=principled('Dispersed violet',(.42,.055,1),.15,.22,emission=3)
amber=principled('Dispersed amber',(1,.39,.065),.2,.2,emission=3)
white=principled('Core white',(.72,.94,1),0,.2,emission=14)
ink=principled('Placard engraved lettering',(.014,.02,.022),.2,.55)
letter=principled('Gallery lettering',(.36,.46,.49),.15,.6)

def apply(obj,mat):
    obj.data.materials.append(mat); return obj
def bevel(obj,width=.035,segments=3):
    mod=obj.modifiers.new('Machined arris','BEVEL'); mod.width=width; mod.segments=segments
    obj.modifiers.new('Weighted corner normals','WEIGHTED_NORMAL')
    return obj
def cube(name,loc,scale,mat,bev=0):
    bpy.ops.mesh.primitive_cube_add(size=1,location=loc)
    o=bpy.context.object; o.name=name; o.dimensions=scale
    bpy.ops.object.transform_apply(location=False,rotation=False,scale=True)
    apply(o,mat)
    if bev: bevel(o,bev)
    return o
def cylinder(name,a,b,r,mat,vertices=48,r2=None):
    a,b=Vector(a),Vector(b); d=b-a
    if r2 is None:
        bpy.ops.mesh.primitive_cylinder_add(vertices=vertices,radius=r,depth=d.length,location=(a+b)/2)
    else:
        bpy.ops.mesh.primitive_cone_add(vertices=vertices,radius1=r,radius2=r2,depth=d.length,location=(a+b)/2)
    o=bpy.context.object; o.name=name; o.rotation_mode='QUATERNION'; o.rotation_quaternion=d.to_track_quat('Z','Y')
    apply(o,mat)
    for f in o.data.polygons: f.use_smooth=True
    return o
def sphere(name,loc,r,mat):
    bpy.ops.mesh.primitive_uv_sphere_add(segments=24,ring_count=12,radius=r,location=loc)
    o=bpy.context.object; o.name=name; apply(o,mat)
    for f in o.data.polygons:f.use_smooth=True
    return o
def tube(name,pts,r,mat):
    cu=bpy.data.curves.new(name,'CURVE'); cu.dimensions='3D'; cu.resolution_u=1
    cu.bevel_depth=r; cu.bevel_resolution=3
    s=cu.splines.new('POLY'); s.points.add(len(pts)-1)
    for p,v in zip(s.points,pts):p.co=(*v,1)
    o=bpy.data.objects.new(name,cu); bpy.context.collection.objects.link(o); apply(o,mat)
    bpy.context.view_layer.objects.active=o; o.select_set(True)
    bpy.ops.object.convert(target='MESH'); o.select_set(False)
    return o
def torus(name,c,normal,r,minor,mat):
    bpy.ops.mesh.primitive_torus_add(major_segments=120,minor_segments=12,location=c,major_radius=r,minor_radius=minor)
    o=bpy.context.object; o.name=name
    o.rotation_mode='QUATERNION'; o.rotation_quaternion=Vector(normal).to_track_quat('Z','Y')
    apply(o,mat)
    for f in o.data.polygons:f.use_smooth=True
    return o
def text(name,body,loc,size,mat,rotation=(math.pi/2,0,0),align='CENTER'):
    cu=bpy.data.curves.new(name,'FONT'); cu.body=body; cu.size=size; cu.align_x=align; cu.extrude=.0007
    o=bpy.data.objects.new(name,cu); bpy.context.collection.objects.link(o)
    o.location=loc; o.rotation_euler=rotation; apply(o,mat); return o
def light(name,kind,loc,color,power,target,size=.5,angle=.5):
    data=bpy.data.lights.new(name,kind); data.energy=power; data.color=color
    if kind=='AREA':data.shape='DISK';data.size=size
    if kind=='SPOT':data.spot_size=angle;data.spot_blend=.35;data.shadow_soft_size=.09
    o=bpy.data.objects.new(name,data);bpy.context.collection.objects.link(o);o.location=loc
    o.rotation_euler=(Vector(target)-o.location).to_track_quat('-Z','Y').to_euler()
    return o

# Monolithic containment architecture.
cube('Gallery floor',(0,1,-.16),(19,22,.32),floor,.02)
cube('Projection wall',(0,4.9,4.25),(16,.45,8.5),concrete,.02)
cube('West monolith',(-7.5,.5,4.25),(.65,9,8.5),concrete,.03)
cube('East monolith',(7.5,.5,4.25),(.65,9,8.5),concrete,.03)
for x in [-6,-3,0,3,6]:
    cube('Vertical shutter joint',(x,4.665,4.2),(.014,.012,8.3),darkmetal)
for x in [-6.5,-3.5,3.5,6.5]:
    for z in [1,3,5,7]:
        cylinder('Recessed formwork tie',(x,4.657,z),(x,4.644,z),.036,darkmetal,24)
for x in [-5,5]:
    cube('Ceiling structural fin',(x,.7,7.9),(.45,8.5,.9),concrete,.02)
cube('Wall footing shadow',(0,4.63,.16),(15,.1,.22),darkmetal)

# Waist-high stone pedestal, inscribed brass plaque.
cube('Basalt footing',(0,-.55,.09),(2.05,1.9,.18),darkmetal,.04)
cube('Single dark stone pedestal',(0,-.55,.86),(1.78,1.65,1.46),stone,.045)
cube('Pedestal upper slab',(0,-.55,1.63),(1.98,1.84,.16),stone,.025)
cube('Plaque backing',(0,-1.398,1.24),(1.50,.035,.32),darkmetal,.018)
cube('Brass museum placard',(0,-1.421,1.24),(1.46,.017,.285),bright,.012)
text('Required title','REALITY REPROJECTION',(0,-1.435,1.25),.102,ink)
text('Plaque subline','RR / 07     •     ACTIVE OPTICAL ARTIFACT',(0,-1.436,1.16),.034,ink)
for x in [-.675,.675]:
    sphere('Plaque rivet',(x,-1.439,1.24),.018,brass)

# Gimballed brass instrument.
C=Vector((0,-.48,3.00))
A=Vector((-.16,.915,.37)).normalized()
U=Vector((1,0,0)); U=(U-A*U.dot(A)).normalized()
V=A.cross(U).normalized()
def pos(t,u=0,v=0):return C+A*t+U*u+V*v
cylinder('Instrument foot',(0,-.48,1.71),(0,-.48,1.81),.63,brass)
torus('Foot bright lip',(0,-.48,1.805),(0,0,1),.59,.018,bright)
cylinder('Gimbal support',(0,-.48,1.8),(0,-.48,2.02),.19,brass)
# Outer ring in vertical plane, plus tilted inner ring.
torus('Outer gimbal / heavy aged band',C,(0,1,0),1.17,.069,brass)
for dy in [-.051,.051]:
    torus('Worn outer ring edge',C+Vector((0,dy,0)),(0,1,0),1.17,.012,bright)
torus('Inner concentric gimbal',C,A,.98,.052,brass)
for d in [-.035,.035]:
    torus('Inner ring machined lip',C+A*d,A,.98,.01,bright)
for sign in [-1,1]:
    q=C+U*sign
    cylinder('Gimbal axle',C+U*(sign*.91),C+U*(sign*1.25),.092,bright)
    sphere('Axle end',C+U*(sign*1.25),.105,brass)
for i in range(72):
    ang=2*math.pi*i/72
    p=C+Vector((math.sin(ang)*1.17,-.071,math.cos(ang)*1.17))
    radial=Vector((math.sin(ang),0,math.cos(ang)))
    cylinder('Graduated outer scale',p-radial*(.027 if i%6 else .045),p+radial*.027,.0045,bright,8)
# Fine supporting rails around the optical barrel.
for a in [0,2*math.pi/3,4*math.pi/3]:
    off=U*math.cos(a)+V*math.sin(a)
    cylinder('Optical rail',pos(.23)+off*.64,pos(1.29)+off*.39,.021,brass,24)
    cylinder('Core radial suspension',C+off*.94,C+off*.29,.013,bright,16)

# Mesh lenses: two curved surfaces, closed rim, true transmission.
def lens(name,t,r,thick):
    verts=[]; faces=[]; N=96; R=14
    # Both surfaces include concentric rings with a tiny central ring.
    for side in [-1,1]:
        for j in range(R+1):
            rr=r*max(j/R,.00005)
            sag=thick*(.16+.84*(1-(rr/r)**2))
            for i in range(N):
                a=2*math.pi*i/N
                verts.append(tuple(pos(t+side*sag,rr*math.cos(a),rr*math.sin(a))))
    layer=(R+1)*N
    for s in range(2):
        for j in range(R):
            for i in range(N):
                a=s*layer+j*N+i;b=s*layer+j*N+(i+1)%N
                c=b+N;d=a+N
                faces.append((a,d,c,b) if s==0 else (a,b,c,d))
        faces.append(tuple(s*layer+i for i in (range(N-1,-1,-1) if s==0 else range(N))))
    for i in range(N):
        a=R*N+i;b=R*N+(i+1)%N
        faces.append((a,b,b+layer,a+layer))
    me=bpy.data.meshes.new(name);me.from_pydata(verts,[],faces);me.update()
    ob=bpy.data.objects.new(name,me);bpy.context.collection.objects.link(ob);apply(ob,glass)
    for f in me.polygons:f.use_smooth=True
    torus(name+' brass cell',pos(t),A,r+.022,.033,brass)
    torus(name+' retaining lip',pos(t+.026),A,r+.018,.008,bright)
    # Dispersed short spectral arcs on the actual curved lens edges.
    for k,mat in enumerate([cyan,violet,amber]):
        pts=[]
        for j in range(50):
            a=.2+j/49*1.35+(0 if t<.8 else 2.8)
            rr=r-.008-k*.012
            pts.append(pos(t+.037+k*.004,rr*math.cos(a),rr*math.sin(a)))
        tube('Chromatic lens-edge dispersion',pts,.0045,mat)
    for ang in [0,math.pi/2,math.pi,3*math.pi/2]:
        q=pos(t,r*math.cos(ang),r*math.sin(ang))
        cylinder('Cell retaining screw',q-A*.042,q+A*.057,.018,bright,16)

for t,r,th in [(.38,.59,.078),(.83,.465,.06),(1.24,.345,.048)]:
    lens('Refractive lens %.2f'%t,t,r,th)

# Faceted crystal, with a physical glass shell and tiny suspended internal glints.
verts=[]; faces=[]; N=7
for z,r,phase in [(-.32,.07,0),(-.19,.245,0),(.10,.27,.20),(.32,.09,.20)]:
    for i in range(N):
        a=2*math.pi*i/N+phase
        verts.append(tuple(C+U*(r*math.cos(a))+A*(r*math.sin(a))+V*z))
for j in range(3):
    for i in range(N):
        a=j*N+i;b=j*N+(i+1)%N;c=b+N;d=a+N
        if j==1:faces.extend([(a,b,c),(a,c,d)])
        else:faces.append((a,b,c,d))
faces.append(tuple(reversed(range(N))));faces.append(tuple(3*N+i for i in range(N)))
me=bpy.data.meshes.new('Crystal cut faces');me.from_pydata(verts,[],faces);me.update()
ob=bpy.data.objects.new('Fist-sized refractive crystal core',me);bpy.context.collection.objects.link(ob);apply(ob,crystalmat)
for i in range(12):
    q=C+Vector((random.uniform(-.12,.12),random.uniform(-.1,.1),random.uniform(-.15,.15)))
    bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=1,radius=random.uniform(.008,.022),location=q)
    apply(bpy.context.object,white if i%3 else cyan);bpy.context.object.name='Internal crystal glint'
for i in range(4):
    q=C+U*random.uniform(-.13,.13)+V*random.uniform(-.12,.12)
    tube('Crystal internal fracture',[q-V*.06-A*.025,q,q+V*.075+A*.018],.0025,white)

# Illuminator: one incoming beam, core, three lenses, outgoing reprojection.
cylinder('Rear illuminator housing',pos(-1.38),pos(-.94),.18,brass)
for t in [-1.33,-1.24,-1.15,-1.03]:
    torus('Illuminator cooling rib',pos(t),A,.185,.016,darkmetal)
cylinder('Illuminator luminous aperture',pos(-.935),pos(-.924),.106,white)
def volume_mat(name,color,density,em=.0):
    m=bpy.data.materials.new(name);m.use_nodes=True
    n=m.node_tree.nodes;n.clear();out=n.new('ShaderNodeOutputMaterial');v=n.new('ShaderNodeVolumePrincipled')
    v.inputs['Color'].default_value=(*color,1);v.inputs['Density'].default_value=density
    v.inputs['Anisotropy'].default_value=.25
    v.inputs['Emission Color'].default_value=(*color,1);v.inputs['Emission Strength'].default_value=em
    m.node_tree.links.new(v.outputs['Volume'],out.inputs['Volume']);return m
incoming=volume_mat('Pale incoming light in air',(.48,.8,1),.12,.8)
cylinder('Incoming pencil of light',pos(-.92),pos(-.08),.074,incoming,64,r2=.10)
cylinder('Light through lens train',pos(.12),pos(1.27),.09,volume_mat('Crystal split light',(.27,.66,1),.055,.38),64,r2=.24)

# Procedurally authored other-world image, packed into the blend.
W,H=1100,680
xx,yy=np.meshgrid(np.linspace(0,1,W),np.linspace(0,1,H))
rng=np.random.default_rng(81)
def smoothstep(a,b,x):
    t=np.clip((x-a)/(b-a),0,1);return t*t*(3-2*t)
sky=np.zeros((H,W,3),dtype=np.float32)
sky[:]=np.array([.015,.028,.095])
sky+=np.exp(-((yy-.46)/.23)**2)[...,None]*np.array([.13,.22,.28])
sky+=np.exp(-((yy-.62)/.28)**2)[...,None]*np.array([.10,.016,.13])
# Curling green auroral atmosphere.
aur=.73+.065*np.sin(xx*8)+.024*np.sin(xx*22)
ribbon=np.exp(-((yy-aur)/.047)**2)*(.45+.55*np.sin(xx*11)**2)
sky+=ribbon[...,None]*np.array([.065,.42,.31])
for i in range(260):
    x,y=rng.uniform(.02,.98),rng.uniform(.47,.97)
    rad=rng.uniform(.0006,.0016)
    star=np.exp(-(((xx-x)/rad)**2+((yy-y)/(rad*W/H))**2)*2)
    sky+=star[...,None]*rng.uniform(.3,2)*np.array([.55,.77,1])
# An immense ringed, rose-colored moon.
px,py=.72,.73
dx=(xx-px);dy=(yy-py)*H/W
rad=.092
d=np.sqrt(dx*dx+dy*dy)
planet=d<rad
shade=np.clip((-.6*dx+.5*dy)/rad+.43,.055,1)
bands=.8+.17*np.sin((dy+.14*dx)*370)+.05*np.sin(dy*960)
pc=np.stack([.87*shade*bands,.32*shade*bands,.29*shade*bands],axis=-1)
sky=np.where(planet[...,None],pc,sky)
# Inclined elliptical rings, foreground and background arcs.
rx=dx*.92+dy*.39; ry=-dx*.39+dy*.92
er=np.sqrt((rx/.155)**2+(ry/.028)**2)
ring=(er>1)&(er<1.18)&((~planet)|(ry<0))
sky=np.where(ring[...,None],np.array([.55,.34,.31])*(.8+.2*np.sin(er[...,None]*190)),sky)
# Small impossible sun at the violet horizon.
sun=np.exp(-(((xx-.30)/.022)**2+((yy-.452)/.035)**2)*2)
sky+=sun[...,None]*np.array([2.8,1.2,.48])
# Suspended inverted landscape growing down from the top edge.
hanging=.91-.085*np.sin(xx*11)**2-.052*np.sin(xx*29+1)**2-.024*np.sin(xx*85)**2
mask=yy>hanging
sky=np.where(mask[...,None],np.array([.016,.011,.038])+((yy-hanging)*.16)[...,None]*np.array([.25,.08,.28]),sky)
rim=np.exp(-((yy-hanging)/.0025)**2)
sky+=rim[...,None]*np.array([.20,.11,.32])
# Three geological horizons: violet rock above luminous turquoise salt water.
for k,(base,amp,col) in enumerate([
    (.42,.063,(.125,.045,.19)),(.348,.047,(.058,.095,.16)),(.235,.07,(.018,.052,.078))]):
    terrain=base+amp*(.55*np.sin(xx*(13+k*7)+k)+.24*np.sin(xx*43+2*k)+.15*np.sin(xx*91))
    mask=yy<terrain
    rock=np.empty_like(sky); rock[:]=col
    rock+=(.012*np.sin(xx*150+yy*220))[...,None]
    sky=np.where(mask[...,None],rock,sky)
    edge=np.exp(-((yy-terrain)/.0021)**2)
    sky+=edge[...,None]*np.array([.075,.24,.23])
# Foreground liquid channels and light reflected from a foreign sky.
waterlevel=.175+.018*np.sin(xx*18)
water=yy<waterlevel
watercol=np.zeros_like(sky)
watercol[:]=(.014,.12,.15)
wave=(.5+.5*np.sin(yy*1250+np.sin(xx*70)*2))**12
watercol+=wave[...,None]*np.array([.04,.16,.18])*(.35+.65*np.sin(xx*23)**2)[...,None]
reflect=np.exp(-((xx-(.3+.012*np.sin(yy*175)))/(.012+.16*(.18-yy)))**2)*water
watercol+=reflect[...,None]*np.array([.72,.32,.19])
sky=np.where(water[...,None],watercol,sky)
# Broken color-separated projection boundary, feathered onto bare concrete.
edge=np.minimum.reduce([xx,1-xx,yy*.7,(1-yy)*.7])
feather=smoothstep(.003,.020,edge)
wav=.0025*np.sin(yy*97)+.0015*np.sin(yy*231)
left=np.exp(-((xx-.009-wav)/.003)**2)
right=np.exp(-((xx-.989-wav)/.003)**2)
top=np.exp(-((yy-.989-.002*np.sin(xx*130))/.004)**2)
sky+=left[...,None]*np.array([.19,.035,.65])+right[...,None]*np.array([.04,.55,.33])+top[...,None]*np.array([.3,.055,.12])
sky*=.87+.13*rng.random((H,W,1))
alpha=smoothstep(.001,.009,edge)
pixels=np.concatenate([sky,alpha[...,None]],axis=2).astype(np.float32)
im=bpy.data.images.new('The translated world • original spectral landscape',width=W,height=H,alpha=True)
im.pixels.foreach_set(pixels.ravel());im.pack()

wall_y=4.658
hit=pos((wall_y-C.y)/A.y)
pw,ph=5.50,3.38
# Image is on the wall itself, with no physical display frame.
me=bpy.data.meshes.new('Projected light footprint')
me.from_pydata([(hit.x-pw/2,wall_y,hit.z-ph/2),(hit.x+pw/2,wall_y,hit.z-ph/2),
               (hit.x+pw/2,wall_y,hit.z+ph/2),(hit.x-pw/2,wall_y,hit.z+ph/2)],[],[(0,1,2,3)])
me.uv_layers.new()
for poly in me.polygons:
    for li,uv in zip(poly.loop_indices,[(0,0),(1,0),(1,1),(0,1)]):me.uv_layers[0].data[li].uv=uv
o=bpy.data.objects.new('OTHER WORLD / projected onto concrete',me);bpy.context.collection.objects.link(o)
m=bpy.data.materials.new('Luminous translated world, feathered spectral perimeter');m.use_nodes=True
p=m.node_tree.nodes.get('Principled BSDF');p.inputs['Roughness'].default_value=.95
tex=m.node_tree.nodes.new('ShaderNodeTexImage');tex.image=im
m.node_tree.links.new(tex.outputs['Color'],p.inputs['Base Color'])
m.node_tree.links.new(tex.outputs['Color'],p.inputs['Emission Color']);p.inputs['Emission Strength'].default_value=2.2
m.node_tree.links.new(tex.outputs['Alpha'],p.inputs['Alpha'])
m.surface_render_method='DITHERED'
apply(o,m)

# A faint true volumetric pyramidal projection frustum.
start=pos(1.30)
corners=[(hit.x-pw*.49,wall_y-.018,hit.z-ph*.49),(hit.x+pw*.49,wall_y-.018,hit.z-ph*.49),
         (hit.x+pw*.49,wall_y-.018,hit.z+ph*.49),(hit.x-pw*.49,wall_y-.018,hit.z+ph*.49)]
vs=[tuple(start-U*.19-V*.12),tuple(start+U*.19-V*.12),tuple(start+U*.19+V*.12),tuple(start-U*.19+V*.12)]+corners
fs=[(0,3,2,1),(4,5,6,7),(0,1,5,4),(1,2,6,5),(2,3,7,6),(3,0,4,7)]
me=bpy.data.meshes.new('Divergent beam volume');me.from_pydata(vs,[],fs);me.update()
o=bpy.data.objects.new('Reprojection beam / suspended in air',me);bpy.context.collection.objects.link(o)
apply(o,volume_mat('Extremely faint cyan projection haze',(.18,.48,.58),.018,.033))
# Narrow spectral sub-beams give the crystal's split a direction.
for k,matcol in enumerate([(.15,.65,1),(.46,.12,1),(1,.4,.13)]):
    endpoint=pos(1.29)+U*(k-1)*.09
    cylinder('Split ray through glass',C+U*(k-1)*.017,endpoint,.009,
             volume_mat('Spectral ray %d'%k,matcol,.08,.8),24,r2=.014)

# Caustic spill: irregular focused filaments draped on the pedestal surface.
for k in range(11):
    pts=[]
    cx=random.uniform(-.36,.34); cy=random.uniform(-.86,-.18)
    rad=random.uniform(.13,.45)
    for j in range(95):
        a=j/94*math.pi*random.uniform(1.4,1.42)
        rr=rad*(1+.13*math.sin(a*5+k)+.05*math.sin(a*11))
        x=cx+rr*math.cos(a);y=cy+.52*rr*math.sin(a)
        pts.append((x,y,1.716+random.uniform(0,.0007)))
    tube('Focused caustic on basalt',pts,.0035 if k%3 else .006,[cyan,amber,white][k%3])
light('Caustic spill illumination','AREA',(0,-.5,2.08),(.17,.7,1),32,(0,-.6,1.65),.65)
light('Crystal interior','POINT',C,(.3,.8,1),9,C,.1)

# Red velvet cordon on polished brass stanchions.
posts=[(-1.9,-2.35),(1.9,-2.35),(-1.9,-.45),(1.9,-.45),(-1.9,1.45),(1.9,1.45)]
for x,y in posts:
    cylinder('Stanchion weighted foot',(x,y,.02),(x,y,.09),.24,brass,r2=.20)
    cylinder('Stanchion foot slope',(x,y,.09),(x,y,.17),.20,bright,r2=.08)
    cylinder('Polished brass stanchion',(x,y,.15),(x,y,1.12),.037,bright)
    torus('Rope collar',(x,y,1.04),(0,0,1),.057,.018,brass)
    sphere('Stanchion finial',(x,y,1.16),.083,bright)
for i,j in [(0,1),(0,2),(2,4),(1,3),(3,5),(4,5)]:
    a=Vector((*posts[i],1.08));b=Vector((*posts[j],1.08));pts=[]
    for s in range(65):
        t=s/64;p=a.lerp(b,t);p.z-=.26*4*t*(1-t);pts.append(p)
    tube('Red velvet containment rope',pts,.038,velvet)
    for p in [a,b]:sphere('Rope brass terminal',p,.047,bright)

# Restrained museum typography and inset security details.
text('Wall exhibit number','07',(-4.95,4.64,3.65),.48,letter,align='LEFT')
text('Wall classification','OPTICAL\nCONTAINMENT',(-4.93,4.64,3.15),.115,letter,align='LEFT')
text('Wall status','TRANSLATION IN PROGRESS',(-4.93,4.64,2.77),.069,letter,align='LEFT')
cube('Status slit',(-4.88,4.63,2.57),(.105,.015,.022),cyan)
for x in [-5.8,5.8]:
    cube('Low wall vent',(x,4.64,.55),(.72,.025,.28),darkmetal,.015)
    for z in [.46,.52,.58,.64]:
        cube('Vent louvre',(x,4.61,z),(.65,.025,.012),brass)

# Two clinical ceiling spots, a placard spot, and subtle photographic fill.
for loc,target,power,col,angle in [
    ((-2,-1.8,7.5),(0,-.4,2.6),1500,(.73,.84,1),.52),
    ((2.3,.7,7.5),(0,-.4,2.9),1750,(1,.78,.48),.48),
    ((.1,-3.2,6.8),(0,-1.3,1.3),600,(1,.83,.58),.31)]:
    direction=(Vector(target)-Vector(loc)).normalized()
    cylinder('Ceiling spotlight housing',Vector(loc)-direction*.16,Vector(loc)+direction*.16,.14,darkmetal)
    cylinder('Ceiling spotlight face',Vector(loc)+direction*.161,Vector(loc)+direction*.17,.108,white)
    light('Tight containment spotlight','SPOT',loc,col,power,target,angle=angle)
light('Soft metallic edge fill','AREA',(3,-5,4.8),(.62,.77,1),430,(0,-.3,2.8),4)
light('Warm grazing reflection','AREA',(-3,-1,4.4),(1,.59,.26),320,(0,-.4,2.9),2.4)
light('Projection reflected glow','AREA',(hit.x,4.40,hit.z),(.24,.65,.82),320,(0,0,2.8),3.3)
light('Violet projection side spill','AREA',(hit.x+1.8,4.40,hit.z+.4),(.57,.19,.8),100,(3,2,4),1.5)

# Camera and native Cycles presentation.
bpy.ops.object.camera_add(location=(8.2,-13.6,7.2))
cam=bpy.context.object;cam.name='Presentation / full transmission chain'
target=Vector((-.25,.95,3.05))
cam.rotation_euler=(target-cam.location).to_track_quat('-Z','Y').to_euler()
cam.data.type='PERSP';cam.data.lens=47
bpy.context.scene.camera=cam
scene=bpy.context.scene
scene.render.engine='CYCLES'
scene.cycles.samples=64
scene.cycles.use_denoising=True
scene.cycles.max_bounces=14
scene.cycles.transmission_bounces=10
scene.cycles.volume_bounces=2
scene.render.resolution_x=1536;scene.render.resolution_y=1536;scene.render.resolution_percentage=100
scene.world.color=(.008,.008,.008)
scene.world.use_nodes=True
scene.world.node_tree.nodes.get('Background').inputs['Color'].default_value=(.055,.08,.115,1)
scene.world.node_tree.nodes.get('Background').inputs['Strength'].default_value=.12
scene.view_settings.view_transform='AgX'
scene.view_settings.exposure=.3
scene.use_nodes=True
nt=scene.node_tree;nt.nodes.clear()
rl=nt.nodes.new('CompositorNodeRLayers')
glare=nt.nodes.new('CompositorNodeGlare');glare.glare_type='FOG_GLOW';glare.quality='HIGH';glare.threshold=1.4
comp=nt.nodes.new('CompositorNodeComposite')
nt.links.new(rl.outputs['Image'],glare.inputs['Image']);nt.links.new(glare.outputs['Image'],comp.inputs['Image'])
# Save a self-contained scene, including the authored projection texture.
bpy.ops.wm.save_as_mainfile(filepath='/mnt/data/output.blend')
```