Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

feat(cursor): model Prism Glow as a mesh traced on its 2D art

EtienneLescot95e9a898eb89
diff --git a/design/cursors/prism-glow/model/build_blend.py b/design/cursors/prism-glow/model/build_blend.py
new file mode 100644
index 000000000..4a941e04c
--- /dev/null
+++ b/design/cursors/prism-glow/model/build_blend.py
@@ -0,0 +1,265 @@
+"""Build the Prism Glow cursor in Blender from prism.json, then save prism-glow.blend and export
+prism-glow.glb next to this script.
+
+ blender --background --python build_blend.py
+
+Per cursor, two objects: the faceted crystal (a closed mesh, one flat face per facet of the 2D art,
+with its colour in the face attribute `concept`) and the navy rim (a filled 2D curve with a hole,
+extruded and rounded). Units: 1 = 1000 px of source.png, origin on the hotspot, y up, z toward the
+viewer, rim top at z = 0, everything's underside at z = -0.04.
+"""
+
+import json
+import math
+import os
+
+import bmesh
+import bpy
+from mathutils import Matrix, Vector
+
+HERE = globals().get("HERE") or os.path.dirname(os.path.abspath(__file__))
+S = 0.001
+T_RIM = 40.0 # rim and crystal-body thickness, px
+BEVEL = 5.0 # rim edge rounding, px
+HAND_AT = ((1220 - 208) * S, -(50 - 42) * S) # the hand stands where it is in source.png
+
+D = json.load(open(os.path.join(HERE, "prism.json")))
+
+
+def srgb_to_linear(c):
+ return c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055) ** 2.4
+
+
+def hex_rgba(h):
+ return tuple(srgb_to_linear(int(h[i : i + 2], 16) / 255) for i in (1, 3, 5)) + (1.0,)
+
+
+def signed_area(pts):
+ return 0.5 * sum(a[0] * b[1] - b[0] * a[1] for a, b in zip(pts, pts[1:] + pts[:1]))
+
+
+def model_xy(sh, x, y):
+ hx, hy = sh["hotspot"]
+ return ((x - hx) * S, -(y - hy) * S)
+
+
+def fresh_collection(name):
+ col = bpy.data.collections.get(name) or bpy.data.collections.new(name)
+ if col.name not in bpy.context.scene.collection.children:
+ bpy.context.scene.collection.children.link(col)
+ for ob in list(col.objects):
+ bpy.data.objects.remove(ob)
+ return col
+
+
+def build_crystal(name, sh):
+ V = sh["verts"]
+ bm = bmesh.new()
+ concept = bm.faces.layers.float_color.new("concept")
+ top = {k: bm.verts.new((*model_xy(sh, x, y), z * S)) for k, (x, y, z) in V.items()}
+ outline = list(sh["outline"])
+ if signed_area([model_xy(sh, *V[k][:2]) for k in outline]) < 0:
+ outline.reverse()
+ bot = {k: bm.verts.new((*model_xy(sh, *V[k][:2]), -T_RIM * S)) for k in outline}
+ for f, hexcol in zip(sh["facets"], sh["colors"]):
+ vs = [top[k] for k in f]
+ if signed_area([v.co.xy[:] for v in vs]) < 0:
+ vs.reverse()
+ bm.faces.new(vs)[concept] = hex_rgba(hexcol)
+ side = hex_rgba("#1a3cc8")
+ for a, b in zip(outline, outline[1:] + outline[:1]):
+ bm.faces.new((top[a], bot[a], bot[b], top[b]))[concept] = side
+ bm.faces.new([bot[k] for k in reversed(outline)])[concept] = side
+ bmesh.ops.triangulate(bm, faces=[f for f in bm.faces if len(f.verts) > 3],
+ quad_method="BEAUTY", ngon_method="BEAUTY")
+ bmesh.ops.recalc_face_normals(bm, faces=bm.faces[:])
+ me = bpy.data.meshes.get(name) or bpy.data.meshes.new(name)
+ bm.to_mesh(me)
+ bm.free()
+ # glTF carries colours per corner: mirror the face colour there
+ corner = me.attributes.get("Col") or me.attributes.new("Col", "FLOAT_COLOR", "CORNER")
+ for p in me.polygons:
+ p.use_smooth = False
+ for li in p.loop_indices:
+ corner.data[li].color = me.attributes["concept"].data[p.index].color
+ me.color_attributes.active_color = corner
+ return bpy.data.objects.new(name, me)
+
+
+def inset(loop, d):
+ """Offset a closed counter-clockwise loop inward by d (mitred)."""
+ out = []
+ for i in range(len(loop)):
+ p0, p1, p2 = Vector(loop[i - 1]), Vector(loop[i]), Vector(loop[(i + 1) % len(loop)])
+ e0, e1 = (p1 - p0).normalized(), (p2 - p1).normalized()
+ n0, n1 = Vector((-e0.y, e0.x)), Vector((-e1.y, e1.x))
+ m = (n0 + n1).normalized() if (n0 + n1).length > 1e-6 else n0
+ out.append(tuple(p1 + m * (d / max(m.dot(n0), 0.25))))
+ return out
+
+
+def build_rim(name, sh):
+ outer = [model_xy(sh, x, y) for x, y in sh["silhouette"]]
+ if signed_area(outer) < 0:
+ outer.reverse()
+ inner = [model_xy(sh, *sh["verts"][k][:2]) for k in sh["outline"]]
+ # the bevel rounds outward from the spline: pull the outer loop in so the silhouette stays exact
+ outer = inset(outer, BEVEL * S)
+ cu = bpy.data.curves.get(name) or bpy.data.curves.new(name, "CURVE")
+ cu.splines.clear()
+ cu.dimensions = "2D"
+ cu.fill_mode = "BOTH"
+ cu.extrude = (T_RIM / 2 - BEVEL) * S
+ cu.bevel_depth = BEVEL * S
+ cu.bevel_resolution = 3
+ for loop in (outer, inner):
+ sp = cu.splines.new("POLY")
+ sp.points.add(len(loop) - 1)
+ for p, (x, y) in zip(sp.points, loop):
+ p.co = (x, y, 0.0, 1.0)
+ sp.use_cyclic_u = True
+ ob = bpy.data.objects.new(name, cu)
+ ob.location.z = -T_RIM / 2 * S
+ return ob
+
+
+def nodes_of(name):
+ m = bpy.data.materials.get(name) or bpy.data.materials.new(name)
+ m.use_nodes = True
+ m.node_tree.nodes.clear()
+ return m, m.node_tree, m.node_tree.nodes.new("ShaderNodeOutputMaterial")
+
+
+def material_crystal():
+ """Clear glass whose facets glow with their colour in the art (the look chosen on 30/09/2026)."""
+ m, nt, out = nodes_of("Prism Crystal")
+ bsdf = nt.nodes.new("ShaderNodeBsdfPrincipled")
+ attr = nt.nodes.new("ShaderNodeAttribute")
+ attr.attribute_name = "concept"
+ nt.links.new(attr.outputs["Color"], bsdf.inputs["Emission Color"])
+ bsdf.inputs["Base Color"].default_value = (1, 1, 1, 1)
+ bsdf.inputs["Emission Strength"].default_value = 0.45
+ bsdf.inputs["Transmission Weight"].default_value = 1.0
+ bsdf.inputs["IOR"].default_value = 1.61
+ bsdf.inputs["Roughness"].default_value = 0.0
+ nt.links.new(bsdf.outputs["BSDF"], out.inputs["Surface"])
+ return m
+
+
+def material_rim():
+ m, nt, out = nodes_of("Prism Rim")
+ bsdf = nt.nodes.new("ShaderNodeBsdfPrincipled")
+ bsdf.inputs["Base Color"].default_value = hex_rgba("#040c5a")
+ bsdf.inputs["Roughness"].default_value = 0.22
+ bsdf.inputs["Coat Weight"].default_value = 1.0
+ bsdf.inputs["Coat Roughness"].default_value = 0.05
+ nt.links.new(bsdf.outputs["BSDF"], out.inputs["Surface"])
+ return m
+
+
+def build():
+ col = fresh_collection("Prism Glow")
+ crystal, rim = material_crystal(), material_rim()
+ obs = []
+ for key, at in (("arrow", (0.0, 0.0)), ("hand", HAND_AT)):
+ c = build_crystal(f"prism_{key}_crystal", D[key])
+ r = build_rim(f"prism_{key}_rim", D[key])
+ c.data.materials.clear()
+ c.data.materials.append(crystal)
+ r.data.materials.clear()
+ r.data.materials.append(rim)
+ for ob in (c, r):
+ ob.location.x, ob.location.y = at
+ col.objects.link(ob)
+ obs += [c, r]
+ return obs
+
+
+def studio():
+ """Studio HDRI for light and reflections, the editor screenshot as the screen, a 3/4 camera."""
+ sc = bpy.context.scene
+ w = sc.world or bpy.data.worlds.new("World")
+ sc.world = w
+ w.use_nodes = True
+ nt = w.node_tree
+ nt.nodes.clear()
+ env = nt.nodes.new("ShaderNodeTexEnvironment")
+ env.image = bpy.data.images.load(os.path.join(bpy.utils.system_resource("DATAFILES"), "studiolights", "world", "studio.exr"), check_existing=True)
+ env.image.pack() # the install path differs per machine; 100 KB inside the .blend does not
+ bg, flat = nt.nodes.new("ShaderNodeBackground"), nt.nodes.new("ShaderNodeBackground")
+ flat.inputs["Color"].default_value = (0.06, 0.06, 0.07, 1)
+ lp, mix, out = nt.nodes.new("ShaderNodeLightPath"), nt.nodes.new("ShaderNodeMixShader"), nt.nodes.new("ShaderNodeOutputWorld")
+ nt.links.new(env.outputs["Color"], bg.inputs["Color"])
+ nt.links.new(lp.outputs["Is Camera Ray"], mix.inputs["Fac"])
+ nt.links.new(bg.outputs["Background"], mix.inputs[1])
+ nt.links.new(flat.outputs["Background"], mix.inputs[2])
+ nt.links.new(mix.outputs["Shader"], out.inputs["Surface"])
+
+ shot = os.path.normpath(os.path.join(HERE, "..", "..", "..", "..", "public", "preview4.png"))
+ screen = bpy.data.objects.get("screen")
+ if screen is None and os.path.exists(shot):
+ me = bpy.data.meshes.new("screen")
+ me.from_pydata([(-3, -1.66, 0), (3, -1.66, 0), (3, 1.66, 0), (-3, 1.66, 0)], [], [(0, 1, 2, 3)])
+ uv = me.uv_layers.new()
+ for li, st in enumerate(((0, 0), (1, 0), (1, 1), (0, 1))):
+ uv.data[li].uv = st
+ m, mnt, mout = nodes_of("screen")
+ em, tex = mnt.nodes.new("ShaderNodeEmission"), mnt.nodes.new("ShaderNodeTexImage")
+ tex.image = bpy.data.images.load(shot, check_existing=True)
+ mnt.links.new(tex.outputs["Color"], em.inputs["Color"])
+ mnt.links.new(em.outputs["Emission"], mout.inputs["Surface"])
+ me.materials.append(m)
+ screen = bpy.data.objects.new("screen", me)
+ screen.location = (1.9, -1.0, -T_RIM * S - 0.0005)
+ sc.collection.objects.link(screen)
+
+ target = Vector((0.679, -0.43, 0.0))
+ cam = bpy.data.objects.get("cam_34") or bpy.data.objects.new("cam_34", bpy.data.cameras.new("cam_34"))
+ if cam.name not in sc.collection.objects:
+ sc.collection.objects.link(cam)
+ eye = target + Matrix.Rotation(math.radians(-28), 3, "Y") @ Matrix.Rotation(math.radians(-38), 3, "X") @ Vector((0, 0, 4.4))
+ f = (target - eye).normalized()
+ r = f.cross(Vector((0, 1, 0))).normalized()
+ cam.location = eye
+ cam.rotation_euler = Matrix((r, r.cross(f), -f)).transposed().to_euler()
+ cam.data.lens = 85
+ sc.camera = cam
+ sc.render.engine = "CYCLES"
+ sc.cycles.device = "GPU"
+ sc.cycles.samples = 128
+ sc.cycles.transmission_bounces = sc.cycles.max_bounces = 24
+ sc.render.resolution_x, sc.render.resolution_y = 1600, 1000
+ sc.view_settings.view_transform = "AgX"
+ sc.view_settings.look = "AgX - Medium High Contrast"
+
+
+def export_glb(obs, path):
+ """The rims are curves; glTF wants meshes: bake them into temporary twins for the export."""
+ dg = bpy.context.evaluated_depsgraph_get()
+ twins = []
+ for ob in obs:
+ if ob.type == "CURVE":
+ name = ob.name
+ me = bpy.data.meshes.new_from_object(ob.evaluated_get(dg))
+ ob.name = name + "_curve" # the twin takes the name the glTF node should carry
+ tw = bpy.data.objects.new(name, me)
+ tw.matrix_world = ob.matrix_world
+ me.materials.append(ob.data.materials[0])
+ bpy.context.scene.collection.objects.link(tw)
+ twins.append((tw, ob, name))
+ bpy.ops.object.select_all(action="DESELECT")
+ for ob in [o for o in obs if o.type == "MESH"] + [tw for tw, _, _ in twins]:
+ ob.select_set(True)
+ bpy.ops.export_scene.gltf(filepath=path, export_format="GLB", use_selection=True,
+ export_vertex_color="ACTIVE", export_apply=True)
+ for tw, ob, name in twins:
+ me = tw.data
+ bpy.data.objects.remove(tw)
+ bpy.data.meshes.remove(me)
+ ob.name = name
+
+
+obs = build()
+studio()
+export_glb(obs, os.path.join(HERE, "prism-glow.glb"))
+bpy.ops.wm.save_as_mainfile(filepath=os.path.join(HERE, "prism-glow.blend"), relative_remap=True)
diff --git a/design/cursors/prism-glow/model/prism-glow.blend b/design/cursors/prism-glow/model/prism-glow.blend
new file mode 100644
index 000000000..8edc4553b
Binary files /dev/null and b/design/cursors/prism-glow/model/prism-glow.blend differ
diff --git a/design/cursors/prism-glow/model/prism-glow.glb b/design/cursors/prism-glow/model/prism-glow.glb
new file mode 100644
index 000000000..2aaa2d145
Binary files /dev/null and b/design/cursors/prism-glow/model/prism-glow.glb differ
diff --git a/design/cursors/prism-glow/model/prism.json b/design/cursors/prism-glow/model/prism.json
new file mode 100644
index 000000000..5aae7a713
--- /dev/null
+++ b/design/cursors/prism-glow/model/prism.json
@@ -0,0 +1,985 @@
+{
+ "arrow": {
+ "hotspot": [
+ 208,
+ 42
+ ],
+ "verts": {
+ "A": [
+ 237,
+ 100,
+ 0.0
+ ],
+ "B": [
+ 443,
+ 290,
+ 0.0
+ ],
+ "F": [
+ 712,
+ 549,
+ 0.0
+ ],
+ "K": [
+ 543,
+ 563,
+ 0.0
+ ],
+ "J": [
+ 612,
+ 744,
+ 0.0
+ ],
+ "I": [
+ 492,
+ 807,
+ 0.0
+ ],
+ "H": [
+ 394,
+ 597,
+ 0.0
+ ],
+ "G": [
+ 241,
+ 732,
+ 0.0
+ ],
+ "D": [
+ 241,
+ 491,
+ 0.0
+ ],
+ "C": [
+ 366,
+ 374,
+ 108.0
+ ],
+ "E": [
+ 458,
+ 539,
+ 76.0
+ ],
+ "X": [
+ 515,
+ 449,
+ 66.0
+ ]
+ },
+ "outline": [
+ "A",
+ "B",
+ "F",
+ "K",
+ "J",
+ "I",
+ "H",
+ "G",
+ "D"
+ ],
+ "facets": [
+ [
+ "A",
+ "C",
+ "D"
+ ],
+ [
+ "A",
+ "B",
+ "C"
+ ],
+ [
+ "B",
+ "X",
+ "C"
+ ],
+ [
+ "B",
+ "F",
+ "X"
+ ],
+ [
+ "C",
+ "X",
+ "E"
+ ],
+ [
+ "X",
+ "F",
+ "E"
+ ],
+ [
+ "E",
+ "F",
+ "K"
+ ],
+ [
+ "C",
+ "E",
+ "H"
+ ],
+ [
+ "C",
+ "H",
+ "G"
+ ],
+ [
+ "C",
+ "G",
+ "D"
+ ],
+ [
+ "E",
+ "I",
+ "H"
+ ],
+ [
+ "E",
+ "J",
+ "I"
+ ],
+ [
+ "E",
+ "K",
+ "J"
+ ]
+ ],
+ "colors": [
+ "#01f8ee",
+ "#cadffc",
+ "#a643fc",
+ "#c348fc",
+ "#033df4",
+ "#002cc0",
+ "#124efb",
+ "#00208a",
+ "#001b80",
+ "#00b7fb",
+ "#0022b7",
+ "#008afc",
+ "#00fbfb"
+ ],
+ "silhouette": [
+ [
+ 214,
+ 40
+ ],
+ [
+ 207,
+ 43
+ ],
+ [
+ 204,
+ 49
+ ],
+ [
+ 204,
+ 793
+ ],
+ [
+ 207,
+ 796
+ ],
+ [
+ 212,
+ 796
+ ],
+ [
+ 229,
+ 784
+ ],
+ [
+ 381,
+ 653
+ ],
+ [
+ 470,
+ 846
+ ],
+ [
+ 475,
+ 853
+ ],
+ [
+ 481,
+ 854
+ ],
+ [
+ 642,
+ 770
+ ],
+ [
+ 654,
+ 762
+ ],
+ [
+ 654,
+ 753
+ ],
+ [
+ 588,
+ 594
+ ],
+ [
+ 628,
+ 588
+ ],
+ [
+ 768,
+ 576
+ ],
+ [
+ 773,
+ 572
+ ],
+ [
+ 773,
+ 568
+ ],
+ [
+ 768,
+ 560
+ ],
+ [
+ 675,
+ 464
+ ],
+ [
+ 604,
+ 393
+ ],
+ [
+ 478,
+ 272
+ ],
+ [
+ 284,
+ 96
+ ],
+ [
+ 221,
+ 42
+ ]
+ ]
+ },
+ "hand": {
+ "hotspot": [
+ 1220,
+ 50
+ ],
+ "verts": {
+ "I1": [
+ 1180,
+ 122,
+ 0.0
+ ],
+ "I2": [
+ 1221,
+ 85,
+ 0.0
+ ],
+ "I3": [
+ 1261,
+ 90,
+ 0.0
+ ],
+ "I4": [
+ 1290,
+ 132,
+ 0.0
+ ],
+ "IT1": [
+ 1224,
+ 118,
+ 46.0
+ ],
+ "IT2": [
+ 1274,
+ 135,
+ 35.0
+ ],
+ "IT3": [
+ 1191,
+ 262,
+ 54.0
+ ],
+ "IL": [
+ 1179,
+ 265,
+ 0.0
+ ],
+ "P1": [
+ 1292,
+ 427,
+ 0.0
+ ],
+ "W1": [
+ 1321,
+ 456,
+ 0.0
+ ],
+ "M1": [
+ 1323,
+ 334,
+ 0.0
+ ],
+ "M2": [
+ 1356,
+ 302,
+ 0.0
+ ],
+ "M3": [
+ 1395,
+ 309,
+ 0.0
+ ],
+ "M4": [
+ 1415,
+ 340,
+ 0.0
+ ],
+ "MT1": [
+ 1354,
+ 334,
+ 46.0
+ ],
+ "MT2": [
+ 1390,
+ 344,
+ 35.0
+ ],
+ "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+ "RL"
+ ],
+ [
+ "R3",
+ "R4",
+ "RT2"
+ ],
+ [
+ "RT2",
+ "R4",
+ "RB2",
+ "RB1",
+ "RB"
+ ],
+ [
+ "KT1",
+ "KT2",
+ "PK"
+ ],
+ [
+ "KT1",
+ "K2",
+ "K3",
+ "KT2"
+ ],
+ [
+ "K1",
+ "K2",
+ "KT1"
+ ],
+ [
+ "K1",
+ "KT1",
+ "PK"
+ ],
+ [
+ "K3",
+ "K4",
+ "KT2"
+ ],
+ [
+ "KT2",
+ "K4",
+ "K5",
+ "PR",
+ "PK"
+ ],
+ [
+ "P2",
+ "MB1",
+ "MB2",
+ "RL",
+ "RB",
+ "RB1",
+ "RB2",
+ "PK",
+ "HC"
+ ],
+ [
+ "HC",
+ "PK",
+ "BR"
+ ],
+ [
+ "PK",
+ "PR",
+ "BR"
+ ],
+ [
+ "HC",
+ "BR",
+ "BL"
+ ],
+ [
+ "Q",
+ "HC",
+ "BL"
+ ],
+ [
+ "TT1",
+ "TH",
+ "TT2"
+ ],
+ [
+ "TL",
+ "TT",
+ "TT1",
+ "TT2"
+ ],
+ [
+ "TT",
+ "TR",
+ "TH",
+ "TT1"
+ ],
+ [
+ "TT2",
+ "TH",
+ "TB"
+ ],
+ [
+ "TH",
+ "Q",
+ "TB"
+ ],
+ [
+ "Q",
+ "BL",
+ "TB"
+ ]
+ ],
+ "colors": [
+ "#b2fcfc",
+ "#01fbfc",
+ "#00faf3",
+ "#01faf4",
+ "#00b7f4",
+ "#00a5eb",
+ "#bf54fc",
+ "#662ffa",
+ "#7237fa",
+ "#7651fc",
+ "#88fbfc",
+ "#00e8ee",
+ "#00f5f4",
+ "#76fafb",
+ "#00beed",
+ "#00b1f0",
+ "#8cfcfc",
+ "#00f3f3",
+ "#00e1ed",
+ "#01edf3",
+ "#00cef6",
+ "#00b7f7",
+ "#82fbfc",
+ "#01f1f5",
+ "#00e0ee",
+ "#01f1f3",
+ "#00c0f2",
+ "#6f31fb",
+ "#0129a6",
+ "#1542fb",
+ "#0021af",
+ "#002eba",
+ "#01f7fc",
+ "#bffcfc",
+ "#01fafc",
+ "#00e3f0",
+ "#00ddee",
+ "#00beef",
+ "#008cf5"
+ ],
+ "silhouette": [
+ [
+ 1209,
+ 50
+ ],
+ [
+ 1169,
+ 85
+ ],
+ [
+ 1145,
+ 109
+ ],
+ [
+ 1143,
+ 113
+ ],
+ [
+ 1142,
+ 404
+ ],
+ [
+ 1137,
+ 404
+ ],
+ [
+ 1073,
+ 360
+ ],
+ [
+ 1066,
+ 361
+ ],
+ [
+ 988,
+ 401
+ ],
+ [
+ 978,
+ 409
+ ],
+ [
+ 976,
+ 477
+ ],
+ [
+ 977,
+ 500
+ ],
+ [
+ 1060,
+ 640
+ ],
+ [
+ 1179,
+ 846
+ ],
+ [
+ 1186,
+ 852
+ ],
+ [
+ 1197,
+ 856
+ ],
+ [
+ 1530,
+ 856
+ ],
+ [
+ 1543,
+ 852
+ ],
+ [
+ 1556,
+ 839
+ ],
+ [
+ 1695,
+ 623
+ ],
+ [
+ 1695,
+ 401
+ ],
+ [
+ 1651,
+ 348
+ ],
+ [
+ 1647,
+ 346
+ ],
+ [
+ 1589,
+ 338
+ ],
+ [
+ 1584,
+ 340
+ ],
+ [
+ 1566,
+ 357
+ ],
+ [
+ 1538,
+ 317
+ ],
+ [
+ 1531,
+ 311
+ ],
+ [
+ 1469,
+ 301
+ ],
+ [
+ 1464,
+ 303
+ ],
+ [
+ 1445,
+ 320
+ ],
+ [
+ 1416,
+ 276
+ ],
+ [
+ 1412,
+ 273
+ ],
+ [
+ 1358,
+ 264
+ ],
+ [
+ 1348,
+ 264
+ ],
+ [
+ 1330,
+ 280
+ ],
+ [
+ 1328,
+ 256
+ ],
+ [
+ 1329,
+ 200
+ ],
+ [
+ 1327,
+ 121
+ ],
+ [
+ 1283,
+ 61
+ ],
+ [
+ 1278,
+ 57
+ ],
+ [
+ 1225,
+ 50
+ ]
+ ]
+ }
+}
diff --git a/design/cursors/prism-glow/model/prism_geo.py b/design/cursors/prism-glow/model/prism_geo.py
new file mode 100644
index 000000000..28a115496
--- /dev/null
+++ b/design/cursors/prism-glow/model/prism_geo.py
@@ -0,0 +1,157 @@
+"""Prism Glow cursor as a faceted mesh: the facets traced from ../source.png, and their heights.
+
+Coordinates are source-PNG pixels (x right, y down); `z` is the height above the navy rim's top in
+the same pixels (unlisted vertices sit on the rim). `outline` is the crystal's edge against the rim,
+`facets` are the flat faces of the 2D art, each an ordered polygon.
+
+ python prism_geo.py # writes prism.json: vertices, facets, their colours in the art, silhouettes
+
+Then build the Blender scene and the glTF from it with build_blend.py.
+"""
+
+import json
+from pathlib import Path
+
+import cv2
+import numpy as np
+
+HERE = Path(__file__).resolve().parent
+
+ARROW = {
+ "hotspot": (208, 42),
+ "verts": {
+ "A": (237, 100), "B": (443, 290), "F": (712, 549), "K": (543, 563), "J": (612, 744),
+ "I": (492, 807), "H": (394, 597), "G": (241, 732), "D": (241, 491),
+ "C": (366, 374), "E": (458, 539), "X": (515, 449),
+ },
+ "outline": ["A", "B", "F", "K", "J", "I", "H", "G", "D"],
+ "z": {"C": 108, "E": 76, "X": 66},
+ "facets": [
+ ["A", "C", "D"], ["A", "B", "C"], ["B", "X", "C"], ["B", "F", "X"],
+ ["C", "X", "E"], ["X", "F", "E"], ["E", "F", "K"],
+ # the notch H sits on the E-G line: one concept facet, folded along C-H
+ ["C", "E", "H"], ["C", "H", "G"], ["C", "G", "D"],
+ ["E", "I", "H"], ["E", "J", "I"], ["E", "K", "J"],
+ ],
+}
+
+HAND = {
+ "hotspot": (1220, 50),
+ "verts": {
+ # index finger
+ "I1": (1180, 122), "I2": (1221, 85), "I3": (1261, 90), "I4": (1290, 132),
+ "IT1": (1224, 118), "IT2": (1274, 135), "IT3": (1191, 262), "IL": (1179, 265),
+ "P1": (1292, 427),
+ # middle finger
+ "W1": (1321, 456), "M1": (1323, 334), "M2": (1356, 302), "M3": (1395, 309),
+ "M4": (1415, 340), "MT1": (1354, 334), "MT2": (1390, 344), "P2": (1339, 479),
+ "MB1": (1386, 481), "MB2": (1415, 462),
+ # ring finger
+ "RL": (1441, 467), "R1": (1443, 368), "R2": (1476, 338), "R3": (1515, 345),
+ "R4": (1536, 377), "RT1": (1480, 367), "RT2": (1513, 381), "RB": (1448, 475),
+ "RB1": (1476, 498), "RB2": (1535, 489),
+ # pinky
+ "PK": (1567, 502), "K1": (1568, 403), "K2": (1600, 375), "K3": (1637, 382),
+ "K4": (1658, 412), "KT1": (1601, 404), "KT2": (1640, 420), "K5": (1658, 608),
+ "PR": (1651, 622),
+ # palm
+ "BR": (1522, 818), "BL": (1208, 820), "HC": (1406, 640), "Q": (1178, 572),
+ # thumb
+ "TB": (1128, 682), "TT2": (1015, 490), "TL": (1013, 427), "TT": (1069, 402),
+ "TR": (1133, 449), "TT1": (1065, 435), "TH": (1144, 541),
+ },
+ # Each fingertip is cut like a gem: a table (the white facet), crown facets down to the rim.
+ # The thumb web (TH, Q) rises above the rim so the thumb's lower facets are not flat.
+ "z": {
+ "IT1": 46, "IT2": 35, "IT3": 54,
+ "MT1": 46, "MT2": 35, "P2": 59, "MB1": 54,
+ "RT1": 43, "RT2": 34, "RB": 57, "RB1": 54,
+ "KT1": 40, "KT2": 30,
+ "TT1": 43, "TH": 40, "Q": 49,
+ "HC": 76,
+ },
+ "outline": [
+ "I1", "I2", "I3", "I4", "P1", "W1", "M1", "M2", "M3", "M4", "MB2", "RL", "R1", "R2",
+ "R3", "R4", "RB2", "PK", "K1", "K2", "K3", "K4", "K5", "PR", "BR", "BL", "TB", "TT2",
+ "TL", "TT", "TR", "TH", "Q", "IL",
+ ],
+ "facets": [
+ # index: table, crown, sides
+ ["IT1", "IT2", "IT3"], ["IT1", "I2", "I3", "IT2"], ["I1", "I2", "IT1"],
+ ["I1", "IT1", "IT3", "IL"], ["I3", "I4", "IT2"], ["IT2", "I4", "P1", "IT3"],
+ ["IL", "IT3", "P1", "Q"],
+ # palm under the index (W1 sits on the P1-P2 line)
+ ["Q", "P1", "W1"], ["Q", "W1", "P2"], ["Q", "P2", "HC"],
+ # middle finger
+ ["MT1", "MT2", "P2"], ["MT1", "M2", "M3", "MT2"], ["M1", "M2", "MT1"],
+ ["M1", "MT1", "P2", "W1"], ["M3", "M4", "MT2"], ["MT2", "M4", "MB2", "MB1", "P2"],
+ # ring finger
+ ["RT1", "RT2", "RB"], ["RT1", "R2", "R3", "RT2"], ["R1", "R2", "RT1"],
+ ["R1", "RT1", "RB", "RL"], ["R3", "R4", "RT2"], ["RT2", "R4", "RB2", "RB1", "RB"],
+ # pinky
+ ["KT1", "KT2", "PK"], ["KT1", "K2", "K3", "KT2"], ["K1", "K2", "KT1"],
+ ["K1", "KT1", "PK"], ["K3", "K4", "KT2"], ["KT2", "K4", "K5", "PR", "PK"],
+ # palm
+ ["P2", "MB1", "MB2", "RL", "RB", "RB1", "RB2", "PK", "HC"],
+ ["HC", "PK", "BR"], ["PK", "PR", "BR"], ["HC", "BR", "BL"], ["Q", "HC", "BL"],
+ # thumb
+ ["TT1", "TH", "TT2"], ["TL", "TT", "TT1", "TT2"], ["TT", "TR", "TH", "TT1"],
+ ["TT2", "TH", "TB"], ["TH", "Q", "TB"], ["Q", "BL", "TB"],
+ ],
+}
+
+
+def area(poly):
+ p = np.asarray(poly, float)
+ return 0.5 * np.sum(p[:, 0] * np.roll(p[:, 1], -1) - np.roll(p[:, 0], -1) * p[:, 1])
+
+
+def check(shape, name):
+ """The facets tile the outline exactly: no gap, no overlap, no stray vertex."""
+ v = shape["verts"]
+ outline = abs(area([v[k] for k in shape["outline"]]))
+ facets = sum(abs(area([v[k] for k in f])) for f in shape["facets"])
+ unused = set(v) - {k for f in shape["facets"] for k in f}
+ assert abs(facets / outline - 1) < 1e-9 and not unused, (name, facets / outline, unused)
+
+
+def facet_colors(shape, img):
+ """Median colour of each facet in the art, away from its edges."""
+ v = shape["verts"]
+ out = []
+ for f in shape["facets"]:
+ mask = np.zeros(img.shape[:2], np.uint8)
+ cv2.fillPoly(mask, [np.array([v[k] for k in f], np.int32)], 255)
+ inner = cv2.erode(mask, np.ones((7, 7), np.uint8))
+ px = img[(inner if inner.any() else mask) > 0][:, :3]
+ b, g, r = np.median(px, axis=0)
+ out.append("#%02x%02x%02x" % (int(r), int(g), int(b)))
+ return out
+
+
+def silhouette(img, x0, x1):
+ """Outer edge of the navy rim, from the art's alpha."""
+ a = (img[:, :, 3] > 127).astype(np.uint8)
+ a[:, :x0] = 0
+ a[:, x1:] = 0
+ contours, _ = cv2.findContours(a, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
+ c = max(contours, key=cv2.contourArea)
+ return cv2.approxPolyDP(c, 1.2, True)[:, 0, :].tolist()
+
+
+if __name__ == "__main__":
+ img = cv2.imread(str(HERE.parent / "source.png"), cv2.IMREAD_UNCHANGED)
+ out = {}
+ for shape, name, (x0, x1) in ((ARROW, "arrow", (0, 887)), (HAND, "hand", (887, 1774))):
+ check(shape, name)
+ z = shape["z"]
+ out[name] = {
+ "hotspot": shape["hotspot"],
+ "verts": {k: [*p, float(z.get(k, 0))] for k, p in shape["verts"].items()},
+ "outline": shape["outline"],
+ "facets": shape["facets"],
+ "colors": facet_colors(shape, img),
+ "silhouette": silhouette(img, x0, x1),
+ }
+ (HERE / "prism.json").write_text(json.dumps(out, indent=1) + "\n", newline="\n")
+ print({k: f"{len(v['facets'])} facets" for k, v in out.items()})