diff --git a/surfaces/blender/experiments/mechs/seraph_parts.py b/surfaces/blender/experiments/mechs/seraph_parts.py index 47ff569..b597082 100644 --- a/surfaces/blender/experiments/mechs/seraph_parts.py +++ b/surfaces/blender/experiments/mechs/seraph_parts.py @@ -2,7 +2,9 @@ component. A function takes a mechlib.Build (a Geo per material on a host) and draws in that host's frame, in metres at the sheet's 9.8 m: x to the mech's right, y forward, z up, unless its docstring says otherwise. part_bench.py builds one alone and renders it from the inset's side; compare.py sets it beside the crop. -VIEWS: per component (azimuth, elevation, margin, pitch of the part in degrees) for the bench.""" +VIEWS: per component (azimuth, elevation, margin, pitch of the part in degrees) for the bench. +The pauldron, chest and thigh plates are brokkr_kitbash.shell sheets (M.shell_action), cut by cut_many and framed by ribs: +they are objects on the host, not geometry in the Build.""" import math from mathutils import Matrix, Vector import mechlib as M @@ -15,9 +17,10 @@ ALONG_Y = F((0, 0, 0), (0, 1, 0), (0, 0, 1)) # a frame whose z is VIEWS = {"cockpit": (0, 20, 0.52, 0), "battery": (24, 2, 0.78, 0), "cannon": (-20, 2, 0.6, -20), "emitter": (-32, 0, 0.66, -32), "cooling": (174, 3, 0.8, 0), "hip": (14, 0, 0.7, 0), "knee": (90, 0, 0.8, 0), "foot": (-40, 9, 0.85, 0), - "chest": (18, 3, 0.8, 0), "pauldron": (20, -4, 0.85, 0), "thigh": (18, -5, 0.85, 0), "shin": (18, 0, 0.9, 0)} + "chest": (18, 3, 0.8, 0), "pauldron": (38, -4, 0.85, 0), "thigh": (18, -5, 0.85, 0), "shin": (18, 0, 0.9, 0)} GROUND = {"foot": 0.8} # the bench stands these on the ground: the origin's height MIRROR = Matrix.Diagonal((-1.0, 1.0, 1.0, 1.0)) +FRAMES = {"pauldron": (-118, -14, 0.6, ("pauldron.khaki", "pauldron.gunmetal"))} # (azimuth, elevation, margin, objects hidden): a second bench view, from inboard and below, of the frame a plate stands on def amber(): @@ -288,46 +291,114 @@ def corrugated(g, points, r, pitch=0.09): return g +def block_sheet(front, back): + """The sheet of a boxed block standing proud of a plate: `front` is its face's corners (bottom then top, each + in ring order), `back` the same four where the block meets the plate. A 4 x 4 loft draped over the box: the + middle quad is the face, creased all round; the four sides run back from it to a rim on the plate.""" + (fa, fb), (fc, fd) = [[Vector(p) for p in row] for row in front] + (ba, bb), (bc, bd) = [[Vector(p) for p in row] for row in back] + third = lambda p, q: p.lerp(q, 1 / 3) # noqa: E731 + rings = [[ba, third(ba, bb), third(bb, ba), bb], [third(ba, bc), fa, fb, third(bb, bd)], [third(bc, ba), fc, fd, third(bd, bb)], [bc, third(bc, bd), third(bd, bc), bd]] + return {"rings": [[list(p) for p in ring] for ring in rings], + "creases": [{"ring": 1, "from": 1, "to": 2, "weight": 1.0}, {"ring": 2, "from": 1, "to": 2, "weight": 1.0}, + {"column": 1, "from": 1, "to": 2, "weight": 1.0}, {"column": 2, "from": 1, "to": 2, "weight": 1.0}, + *({"point": [i, j], "weight": 1.0} for i in (1, 2) for j in (1, 2))]} # a closed loop of creases rounds into a disc unless its corners are pinned + + def chest(b): - """CHEST PLATES. Origin at the middle of the chest; the plates' lower edge is z = -0.55. One faceted breast - mass; on its front a centre panel with clipped lower corners (the number goes on it); on the mech's left a - boxed pectoral block standing proud; on its right a pectoral plate lying on the facet; a row of five vent - teeth under the front edge; a two-tier sternum block hung below; under that the dark abdomen column with - three stacked lames and a ribbed hose each side.""" + """CHEST PLATES. Origin at the middle of the chest; the plates' lower edge is z = -0.5. One breast shell, + mirrored: a flat centre panel with clipped lower corners (the number goes on it) between two creases, a pectoral + facet each side turning back to the flank at a second crease, a brow line across where the upper facets lean + back to the collar. Cut into it: two slots in the upper facet, a break under the number, a seam and a ring mark + on the right pectoral. On the mech's left a boxed pectoral block standing proud, a shell of its own with a + recessed panel. A row of five vent teeth under the front edge; a two-tier sternum block hung below; under that + the dark abdomen column with three stacked lames and a ribbed hose each side.""" k, d = b["khaki"], b["gunmetal"] - k.hull([(0.6, 0.7, 0.95), (1.65, 0.3, 0.85), (0.62, 1.28, 0.35), (1.6, 0.82, 0.3), (0.58, 1.24, -0.5), (1.55, 0.78, -0.45), (1.7, -0.5, 0.85), (1.7, -0.5, -0.45), (0.6, -0.6, 0.95)], mirror=True) - front = F((0, 1.27, -0.05), (0, 1, 0.02), (0, 0, 1)) - k.prism(front, M.rect(1.1, 0.84, (0.16, 0.16, 0.0, 0.0)), 0.06, 0.025) - k.prism(F((0, 1.0, 0.66), (0, 0.6, 1), (0, 1, 0)), [(-0.56, -0.26), (0.56, -0.26), (0.5, 0.3), (-0.5, 0.3)], 0.05, 0.02) # the upper panel - k.hull([(-0.72, 1.0, 0.56), (-1.46, 0.78, 0.5), (-0.74, 1.5, 0.42), (-1.4, 1.26, 0.38), (-0.74, 1.46, -0.22), (-1.38, 1.22, -0.26), (-0.72, 1.0, -0.3), (-1.46, 0.78, -0.3)]) # the left pectoral block - k.prism(F((1.1, 1.07, 0.0), (0.42, 1, 0.03), (0, 0, 1)), [(-0.42, -0.42), (0.3, -0.42), (0.46, -0.1), (0.46, 0.36), (-0.42, 0.36)], 0.06, 0.025) # the right pectoral plate + breast = {"mirror": True, "flip": True, "rings": [ + [[0, 1.25, -0.5], [0.36, 1.25, -0.5], [1.1, 0.9, -0.47], [1.56, 0.6, -0.45], [1.7, -0.45, -0.45]], + [[0, 1.3, -0.28], [0.5, 1.3, -0.28], [1.14, 0.94, -0.28], [1.6, 0.62, -0.28], [1.72, -0.45, -0.28]], + [[0, 1.3, 0.15], [0.52, 1.3, 0.15], [1.16, 0.95, 0.15], [1.63, 0.62, 0.15], [1.73, -0.45, 0.15]], + [[0, 0.5, 0.92], [0.56, 0.5, 0.92], [1.08, 0.36, 0.9], [1.58, 0.14, 0.82], [1.7, -0.45, 0.82]], + [[0, -0.55, 0.98], [0.58, -0.55, 0.98], [1.1, -0.55, 0.95], [1.6, -0.52, 0.88], [1.72, -0.62, 0.85]]], + "creases": [{"column": 1, "from": 0, "to": 3, "weight": 1.0}, {"column": 3, "from": 0, "to": 3, "weight": 1.0}, {"ring": 2, "from": 0, "to": 4, "weight": 1.0}, + {"ring": 3, "from": 0, "to": 4, "weight": 0.8}, {"column": 2, "from": 0, "to": 3, "weight": 0.6}, {"ring": 1, "from": 0, "to": 1, "weight": 0.6}]} + name = b.name + ".breast" + M.shell_action(name, breast, b.host, "khaki", thickness=0.1, levels=3, bevel=0.012) + upper = {"direction": [0, -1.0, -1.0]} + M.cuts_action(name, [ + {"name": name + ".slot_a", "part": "box", "params": "width=0.2; height=0.3; depth=0.035", "origin": [-0.34, 2.9, 2.55], **upper}, + {"name": name + ".slot_b", "part": "box", "params": "width=0.2; height=0.3; depth=0.035", "origin": [-0.08, 2.9, 2.55], **upper}, + {"name": name + ".slot_c", "part": "slot", "params": "width=0.36; height=0.07; depth=0.03", "origin": [0.3, 2.8, 2.45], **upper}, + {"name": name + ".break", "part": "slab", "params": "gap=0.022; length=0.84; depth=0.03", "origin": [0, 3, -0.2], "direction": [0, -1, 0], "up": [1, 0, 0]}, + {"name": name + ".seam", "part": "slab", "params": "gap=0.02; length=0.74; depth=0.03", "origin": [1.62, 3, -0.02], "direction": [-0.4, -1, 0], "up": [0.3, 0, 1]}, + {"name": name + ".mark", "part": "cyl", "params": "r=0.075; depth=0.02", "origin": [2.2, 3, -0.16], "direction": [-0.4, -1, 0]}, + {"name": name + ".flank", "part": "slab", "params": "gap=0.02; length=0.7; depth=0.03", "origin": [-3, 0.2, 0.0], "direction": [1, 0, 0], "up": [0, 0, 1]}, + ]) + block = b.name + ".pectoral" # the left pectoral block + M.shell_action(block, block_sheet([[(-0.66, 1.62, -0.26), (-1.5, 1.2, -0.3)], [(-0.68, 1.5, 0.5), (-1.5, 1.1, 0.46)]], + [[(-0.6, 1.1, -0.36), (-1.66, 0.56, -0.4)], [(-0.62, 0.9, 0.62), (-1.66, 0.4, 0.56)]]), b.host, "khaki", thickness=0.08, levels=3, bevel=0.012) + M.cuts_action(block, [{"name": block + ".panel", "part": "box", "params": "width=0.2; height=0.34; depth=0.03", "origin": [-1.28, 3, 0.12], "direction": [0, -1, 0]}, + {"name": block + ".line", "part": "slab", "params": "gap=0.02; length=0.5; depth=0.025", "origin": [-0.9, 3, 0.12], "direction": [0, -1, 0], "up": [0, 0, 1]}]) for j in range(5): k.box(T((-0.44 + 0.22 * j, 1.2, -0.58)), (0.13, 0.12, 0.14)) d.box(T((0, 1.12, -0.58)), (1.1, 0.1, 0.12)) - k.hull([(0.42, 0.7, -0.5), (0.42, 1.22, -0.62), (0.36, 0.7, -0.95), (0.36, 1.16, -0.95)], mirror=True) # the sternum block - k.hull([(0.3, 0.7, -0.95), (0.3, 1.12, -0.98), (0.24, 0.7, -1.22), (0.24, 1.04, -1.22)], mirror=True) + sternum = lambda x0, y0, z0, x1, y1, z1: {"mirror": True, "flip": True, "rings": [ # noqa: E731 a hung block: a front face and a flank each side + [[0, y1, z1], [x1, y1, z1], [x1, 0.7, z1]], [[0, y0, z0], [x0, y0, z0], [x0, 0.7, z0]]], "creases": [{"column": 1, "from": 0, "to": 1, "weight": 1.0}]} + M.shell_action(b.name + ".sternum", sternum(0.42, 1.22, -0.5, 0.36, 1.16, -0.95), b.host, "khaki", thickness=0.08, levels=2, bevel=0.012) + M.shell_action(b.name + ".sternum_low", sternum(0.3, 1.12, -0.95, 0.24, 1.04, -1.22), b.host, "khaki", thickness=0.08, levels=2, bevel=0.012) d.hull([(0.6, -0.5, -0.4), (0.6, 0.75, -0.4), (0.45, -0.4, -2.3), (0.45, 0.6, -2.3)], mirror=True) # the abdomen column for j in range(3): z = -1.36 - 0.3 * j - k.hull([(0.36 - 0.03 * j, 0.6, z), (0.36 - 0.03 * j, 0.92 - 0.05 * j, z + 0.02), (0.32 - 0.03 * j, 0.6, z - 0.26), (0.32 - 0.03 * j, 0.86 - 0.05 * j, z - 0.24)], mirror=True) + lame = {"mirror": True, "flip": True, "rings": [[[0, 0.86 - 0.05 * j, z - 0.24], [0.32 - 0.03 * j, 0.86 - 0.05 * j, z - 0.24], [0.32 - 0.03 * j, 0.6, z - 0.26]], + [[0, 0.92 - 0.05 * j, z + 0.02], [0.36 - 0.03 * j, 0.92 - 0.05 * j, z + 0.02], [0.36 - 0.03 * j, 0.6, z]]], + "creases": [{"column": 1, "from": 0, "to": 1, "weight": 1.0}]} + M.shell_action(f"{b.name}.lame{j}", lame, b.host, "khaki", thickness=0.06, levels=2, bevel=0.01) for s in (-1, 1): corrugated(d, [(s * 0.95, 0.7, -0.5), (s * 0.85, 0.9, -0.95), (s * 0.62, 0.86, -1.5), (s * 0.5, 0.66, -2.0)], 0.13) corrugated(d, [(s * 1.25, 0.5, -0.5), (s * 1.1, 0.62, -1.1), (s * 0.7, 0.5, -1.9)], 0.09) def pauldron(b, arm=True): - """SHOULDER PAULDRON, the mech's left: outboard is -x; origin at the shoulder's pivot. One faceted cap, crowned - along a fore-and-aft ridge, its outer face dropping steeply and its lower edge stepped by two tabs; a hexagonal - applique on the front face (the emblem's plate); a raised band where crown meets outer face; a small ridge - plate on the crown. Under it the upper arm: two boxed tiers and a pair of ringed elbow discs.""" + """SHOULDER PAULDRON, the mech's left: outboard is -x; origin at the shoulder's pivot. One cap shell: a crown + along a fore-and-aft ridge and a steep outer face, two facets of one sheet creased at the shoulder line, a brow + facet fore and aft; its lower edge stepped into tabs by notches cut through the rim; two panel lines and a slot + down the outer face. A raised band over the shoulder line and a ridge plate on the crown, each a small shell. In + front, the emblem's shield: a six-sided plate of its own, bent down its middle, wrapping the front corner. Under + the cap its frame: three ribs with lightening holes and posts. Under that the upper arm.""" k, d = b["khaki"], b["gunmetal"] - k.hull([(0.55, 0.3, 1.25), (0.55, -0.9, 1.2), (-0.45, 0.35, 1.55), (-0.45, -0.85, 1.5), (-1.4, 0.4, 0.95), (-1.4, -0.8, 0.95), (-1.65, 0.5, -0.35), (-1.65, -0.7, -0.35), - (0.45, 1.0, 0.7), (-0.55, 1.2, 0.9), (-1.3, 1.05, 0.3), (-1.25, 1.1, -0.45), (0.35, 1.05, -0.15), (0.5, -1.4, 0.6), (-1.3, -1.4, 0.3), (-1.25, -1.35, -0.4), (0.4, -1.35, -0.1), (0.55, 0.3, -0.1), (0.55, -0.9, -0.1)]) - k.prism(F((-0.4, 1.14, 0.28), (-0.06, 1, 0.12), (0, 0, 1)), [(-0.5, -0.5), (0.3, -0.56), (0.62, -0.1), (0.5, 0.46), (-0.2, 0.56), (-0.6, 0.1)], 0.07, 0.03) # the emblem's plate - k.prism(F((-0.95, 0.3, 1.26), (-0.55, 0.1, 0.85), (0, 1, 0)), M.rect(0.16, 1.5, 0.03), 0.05, 0.02) # the band - k.prism(F((0.1, -0.2, 1.42), (0.28, 0.0, 1), (0, 1, 0)), M.rect(0.5, 0.8, 0.06), 0.06, 0.02) # the ridge plate - for y in (0.45, -0.25): - k.prism(F((-1.66, y, -0.42), (-1, 0, 0.05), (0, 0, 1)), M.rect(0.42, 0.36, (0.06, 0.06, 0, 0)), 0.08, 0.03) # the tabs + across = ((0.55, 1.15), (-0.35, 1.52), (-1.2, 1.15), (-1.55, 0.35), (-1.68, -0.4)) # inboard edge, crown ridge, shoulder line, outer face, lower edge + + def ring(y, sx, sz): + return [[x * sx, y, 0.2 + (z - 0.2) * sz] for x, z in across] + + fore = [[0.5, 1.12, 0.85], [-0.33, 1.2, 1.1], [-1.1, 1.15, 0.9], [-1.46, 1.08, 0.3], [-1.6, 1.0, -0.32]] # the brow facets: the crown turns down, the outer face turns in + aft = [[0.5, -1.4, 0.8], [-0.33, -1.5, 1.05], [-1.1, -1.45, 0.85], [-1.45, -1.38, 0.3], [-1.58, -1.3, -0.3]] + cap = {"rings": [fore, ring(0.95, 1.0, 0.96), ring(0.3, 1.0, 1.0), ring(-0.4, 1.0, 1.0), ring(-1.05, 1.0, 0.95), aft], + "creases": [{"column": 2, "from": 0, "to": 5, "weight": 1.0}, {"ring": 1, "from": 0, "to": 4, "weight": 1.0}, {"ring": 4, "from": 0, "to": 4, "weight": 0.8}, + {"column": 1, "from": 1, "to": 4, "weight": 0.5}, {"column": 3, "from": 1, "to": 3, "weight": 0.4}]} + name = b.name + ".cap" + M.shell_action(name, cap, b.host, "khaki", thickness=0.09, levels=3, bevel=0.012) + side = {"direction": [1, 0, 0], "up": [0, 0, 1]} + M.cuts_action(name, [ + {"name": name + ".line_a", "part": "slab", "params": "gap=0.024; length=0.95; depth=0.03", "origin": [-3, 0.32, 0.42], **side}, + {"name": name + ".line_b", "part": "slab", "params": "gap=0.024; length=0.95; depth=0.03", "origin": [-3, 0.14, 0.42], **side}, + {"name": name + ".slot", "part": "box", "params": "width=0.16; height=0.42; depth=0.04", "origin": [-3, 0.66, 0.72], **side}, + {"name": name + ".aft", "part": "slab", "params": "gap=0.024; length=1.2; depth=0.03", "origin": [-3, -0.62, 0.3], **side}, + {"name": name + ".notch_a", "part": "box", "params": "width=0.34; height=0.3; depth=0.3", "origin": [-3, 0.12, -0.3], **side}, # through the rim: what is left between is a tab + {"name": name + ".notch_b", "part": "box", "params": "width=0.3; height=0.3; depth=0.3", "origin": [-3, -0.78, -0.3], **side}, + {"name": name + ".crown", "part": "slab", "params": "gap=0.022; length=1.5; depth=0.03", "origin": [-0.72, -0.1, 3], "direction": [0, 0, -1], "up": [0, 1, 0]}, + ]) + M.ribs_action(name, [{"origin": [0, y, 0], "normal": [0, 1, 0]} for y in (0.6, -0.05, -0.7)], standoff=0.03, depth=0.14, thickness=0.03, holes=0.34, posts=0.45, post_r=0.022) + band = [[[-1.11, y, 1.244 * s], [-1.242, y, 1.192 * s], [-1.294, y, 1.06 * s]] for y, s in ((0.92, 0.985), (0.3, 1.0), (-0.4, 1.0), (-1.02, 0.975))] + M.shell_action(b.name + ".band", {"rings": band, "creases": [{"column": 1, "from": 0, "to": 3, "weight": 1.0}]}, b.host, "khaki", thickness=0.05, levels=2, bevel=0.008) + M.shell_action(b.name + ".ridge", {"flip": True, "rings": [[[0.352, y, 1.307], [-0.143, y, 1.511]] for y in (-0.6, 0.2)]}, b.host, "khaki", thickness=0.07, levels=1, bevel=0.01) + rows = (((-0.25, -0.6), (0.2, -0.76), (0.62, -0.66)), ((-0.72, -0.3), (0.15, -0.32), (1.0, -0.3)), ((-0.75, 0.35), (0.15, 0.38), (1.05, 0.42)), ((-0.5, 0.62), (0.15, 0.74), (0.82, 0.84))) + shield = {"rings": [[[-0.45 - u, 1.4 - 0.1 * v + (0.07, 0.14, -0.3)[j], 0.3 + v] for j, (u, v) in enumerate(row)] for row in rows], # u runs outboard, v up + "creases": [{"column": 1, "from": 0, "to": 3, "weight": 0.9}, {"ring": 1, "from": 0, "to": 2, "weight": 0.5}, {"ring": 2, "from": 0, "to": 2, "weight": 0.5}]} + plate = b.name + ".shield" + M.shell_action(plate, shield, b.host, "khaki", thickness=0.08, levels=3, bevel=0.012) + M.cuts_action(plate, [{"name": plate + ".bracket", "part": "slot", "params": "width=0.3; height=0.06; depth=0.03", "origin": [-0.62, 3, -0.2], "direction": [0, -1, 0]}, + {"name": plate + ".bolt", "part": "cyl", "params": "r=0.05; depth=0.03", "origin": [-1.05, 3, 0.02], "direction": [0, -1, 0]}]) if arm: upper_arm(b, Matrix.Translation((-0.55, 0, 0))) @@ -346,16 +417,41 @@ def upper_arm(b, at=Matrix.Identity(4)): def thigh(b): - """THIGH PLATE, the mech's left thigh from the front: outboard is -x; origin at the plate's middle, z up. A - tall front plate, broad above and stepping in to a tongue below; over its upper part an applique whose lower - edge drops in a centre tab; a second applique on the tongue; down the outboard side a strip plate turned back - along the leg; the girder behind.""" - k, d = b["khaki"], b["gunmetal"] - main = F((0, 0.5, 0), (0, 1, 0), (0, 0, 1)) - k.prism(main, [(-0.5, -1.3), (0.5, -1.3), (0.56, -0.5), (0.74, -0.3), (0.78, 1.1), (0.6, 1.3), (-0.6, 1.3), (-0.78, 1.1), (-0.74, -0.3), (-0.56, -0.5)], 0.22, 0.07, 0.95) - k.prism(main @ T((0, 0.48, 0.22)), [(-0.66, -0.56), (-0.28, -0.56), (-0.22, -0.82), (0.22, -0.82), (0.28, -0.56), (0.66, -0.56), (0.68, 0.6), (0.52, 0.74), (-0.52, 0.74), (-0.68, 0.6)], 0.06, 0.025) - k.prism(main @ T((0, -0.86, 0.22)), [(-0.4, -0.36), (0.4, -0.36), (0.44, 0.24), (-0.44, 0.24)], 0.05, 0.02) - k.hull([(-0.82, 0.62, 1.05), (-1.0, 0.2, 1.0), (-1.02, -0.5, 0.9), (-0.82, 0.62, -0.4), (-0.98, 0.2, -0.7), (-1.0, -0.5, -0.6), (-0.8, 0.2, 1.0), (-0.8, 0.2, -0.6), (-0.8, -0.5, 0.9), (-0.8, -0.5, -0.6)]) # the side strip + """THIGH PLATE, the mech's left thigh from the front: outboard is -x; origin at the plate's middle, z up. One + tall front shell, mirrored: a flat front between two creases, a facet each side turning back along the leg, broad + above and stepping in at a creased ledge to a tongue below, its top edge chamfered. Over its upper part a second + shell whose lower edge drops in a centre tab; a third on the tongue; down the outboard side a strip plate turned + back along the leg; the girder behind.""" + d = b["gunmetal"] + main = {"mirror": True, "flip": True, "rings": [ + [[0, 0.7, -1.3], [0.3, 0.7, -1.3], [0.5, 0.58, -1.3], [0.54, 0.2, -1.3]], + [[0, 0.72, -0.55], [0.34, 0.72, -0.55], [0.56, 0.6, -0.55], [0.6, 0.2, -0.55]], + [[0, 0.74, -0.3], [0.45, 0.74, -0.3], [0.74, 0.6, -0.3], [0.8, 0.2, -0.3]], + [[0, 0.74, 1.05], [0.45, 0.74, 1.05], [0.78, 0.6, 1.05], [0.84, 0.2, 1.05]], + [[0, 0.62, 1.3], [0.38, 0.62, 1.3], [0.62, 0.5, 1.3], [0.68, 0.2, 1.3]]], + "creases": [{"column": 1, "from": 0, "to": 4, "weight": 0.9}, {"column": 2, "from": 0, "to": 4, "weight": 1.0}, + {"ring": 1, "from": 0, "to": 3, "weight": 1.0}, {"ring": 2, "from": 0, "to": 3, "weight": 1.0}, {"ring": 3, "from": 0, "to": 3, "weight": 1.0}]} + name = b.name + ".plate" + M.shell_action(name, main, b.host, "khaki", thickness=0.12, levels=3, bevel=0.012) + M.cuts_action(name, [{"name": name + ".flank_a", "part": "slab", "params": "gap=0.022; length=0.9; depth=0.03", "origin": [-3, 0.42, 0.4], "direction": [1, 0, 0], "up": [0, 0, 1]}, + {"name": name + ".flank_b", "part": "slab", "params": "gap=0.022; length=0.9; depth=0.03", "origin": [3, 0.42, 0.4], "direction": [-1, 0, 0], "up": [0, 0, 1]}]) + upper = {"mirror": True, "flip": True, "rings": [ # its lower edge is ring 0: the centre tab is drawn in it + [[0, 0.81, -0.36], [0.22, 0.81, -0.36], [0.29, 0.81, -0.08], [0.67, 0.7, -0.08]], + [[0, 0.81, 0.2], [0.22, 0.81, 0.2], [0.29, 0.81, 0.2], [0.68, 0.7, 0.2]], + [[0, 0.81, 1.06], [0.22, 0.81, 1.06], [0.29, 0.81, 1.06], [0.7, 0.7, 1.06]], + [[0, 0.72, 1.22], [0.2, 0.72, 1.22], [0.27, 0.72, 1.22], [0.54, 0.64, 1.22]]], + "creases": [{"ring": 2, "from": 0, "to": 3, "weight": 1.0}, {"column": 2, "from": 0, "to": 3, "weight": 0.35}]} + over = b.name + ".upper" + M.shell_action(over, upper, b.host, "khaki", thickness=0.07, levels=3, bevel=0.012) + M.cuts_action(over, [{"name": over + ".tab", "part": "slab", "params": "gap=0.02; length=0.44; depth=0.025", "origin": [0, 3, -0.04], "direction": [0, -1, 0], "up": [1, 0, 0]}]) + tongue = {"mirror": True, "flip": True, "rings": [[[0, 0.775, -1.22], [0.24, 0.775, -1.22], [0.4, 0.69, -1.22]], [[0, 0.79, -0.64], [0.27, 0.79, -0.64], [0.44, 0.7, -0.64]]], + "creases": [{"column": 1, "from": 0, "to": 1, "weight": 0.9}]} + M.shell_action(b.name + ".tongue", tongue, b.host, "khaki", thickness=0.06, levels=2, bevel=0.01) + strip = {"rings": [[[-0.88, 0.6, -0.42], [-1.02, 0.2, -0.7], [-1.04, -0.5, -0.6]], [[-0.88, 0.6, 0.3], [-1.03, 0.2, 0.3], [-1.05, -0.5, 0.3]], [[-0.86, 0.6, 1.05], [-1.0, 0.2, 1.0], [-1.02, -0.5, 0.9]]], + "creases": [{"column": 1, "from": 0, "to": 2, "weight": 1.0}]} + edge = b.name + ".strip" + M.shell_action(edge, strip, b.host, "khaki", thickness=0.1, levels=3, bevel=0.012) + M.cuts_action(edge, [{"name": f"{edge}.bolt{j}", "part": "cyl", "params": "r=0.045; depth=0.03", "origin": [-3, -0.15, z], "direction": [1, 0, 0]} for j, z in enumerate((0.6, -0.2))]) d.box(T((0, 0.05, 0)), (0.9, 0.9, 2.9))