Credibility pass over the Green Man generator
Turn audit.py into a run() function and drop audit_run.py, which only existed to import it quietly. Remove unused parameters, keys, helpers and imports from draw.py, manifest.py and stl_build.py, and the source file names in stl_build.FILES that pointed at nothing. Keep the brow strip's taper and knob positions in geom.py only. Correct comments and docstrings that disagreed with the code, and the README's claim about counts. The page changes only in markup: no stray spaces in class attributes, and three CSS declarations that did nothing are gone. Guide HTML, templates and print files are byte-identical apart from that. Credibility pass over a7c04e5..HEAD; the next one can scope from here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
b86153a9fd
commit
f2bb87caeb
15 files changed
+148
-151
No files matched your search
+11
-4
@@ -62,6 +62,7 @@ def arm_zones(): return [box(min(s*(FRAME_W/2-2), s*(FRAME_W/2+40)), TOP-6, max
|
||||
# ---- oak leaves ----
|
||||
LEAF = {'L': (95, 65), 'M': (70, 48), 'S': (48, 33), 'T': (30, 21)} # blade length, width
|
||||
STEM_L, STEM_W = 12.0, 5.0
|
||||
def _stem_w(size): return 4.0 if size == 'T' else STEM_W # the tip leaf has a narrower stem
|
||||
# Two deliberately different leaf shapes per size, so a crown of them does not look stamped out.
|
||||
# A: broad white-oak leaf, four shallow rounded lobes a side, nearly symmetric.
|
||||
# B: slimmer leaf with three long lobes a side cut almost to the midrib, the lobes alternating left and right,
|
||||
@@ -91,7 +92,7 @@ def oak(size, variant=0):
|
||||
cr, cl = _CTRL[variant]
|
||||
xr, yr = _half(L, W, cr, rng, 0.04); xl, yl = _half(L, W, cl, rng, 0.04)
|
||||
blade = Polygon(list(zip(xr, yr)) + [(-a, b) for a, b in reversed(list(zip(xl, yl)))][1:]).buffer(0)
|
||||
sw = STEM_W if size != 'T' else 4.0
|
||||
sw = _stem_w(size)
|
||||
stem = box(-sw/2, -STEM_L, sw/2, L*0.06)
|
||||
leaf = unary_union([blade, stem]).buffer(0.6, join_style=1).buffer(-0.6, join_style=1)
|
||||
assert leaf.geom_type == 'Polygon' and leaf.is_valid, f'leaf {size}{variant} is not one piece'
|
||||
@@ -108,7 +109,7 @@ def vein_lines(size, variant=0):
|
||||
return out
|
||||
|
||||
def stem_tab(size):
|
||||
sw = STEM_W if size != 'T' else 4.0
|
||||
sw = _stem_w(size)
|
||||
return box(-sw/2, -STEM_L, sw/2, 0)
|
||||
|
||||
def place(geom, x, y, angle=0.0, flip=False):
|
||||
@@ -118,15 +119,21 @@ def place(geom, x, y, angle=0.0, flip=False):
|
||||
|
||||
# ---- printed parts, front-view outlines ----
|
||||
STRIP_L = 136.0
|
||||
STRIP_KNOB_X = (-52, -26, -5, 16, 40, 58) # knobs along the strip's centre line
|
||||
|
||||
def strip_half(x, L=STRIP_L):
|
||||
"""Half the strip's height at x: 11 mm at the centre, tapering to 6 mm at the ends."""
|
||||
return 11 - 5*(np.abs(x)/(L/2))**1.6
|
||||
|
||||
def strip_poly(L=STRIP_L):
|
||||
"""Brow strip as printed: straight, 22 mm tall at the centre tapering to 12 mm. Centre at (0,0)."""
|
||||
x = np.linspace(-L/2, L/2, 120); half = 11 - 5*(np.abs(x)/(L/2))**1.6
|
||||
x = np.linspace(-L/2, L/2, 120); half = strip_half(x, L)
|
||||
top = half + 1.2*np.sin(x*0.22) + 0.6*np.sin(x*0.53+1); bot = -half + 1.0*np.sin(x*0.19+2)
|
||||
return Polygon(list(zip(x, top)) + list(zip(x[::-1], bot[::-1]))).buffer(1.5, join_style=1).buffer(-1.5, join_style=1)
|
||||
|
||||
STRIP_Y = TOP + 16 # strip centre line on the band
|
||||
KNOT_R = 21.0
|
||||
KNOT_C = (0.0, TOP + 16 + 11 + 1 + KNOT_R) # sits on the band just above the strip, touching its top edge
|
||||
KNOT_C = (0.0, STRIP_Y + 11 + 1 + KNOT_R) # sits on the band just above the strip, touching its top edge
|
||||
ACORN = {'AL': (30.0, 37.0), 'AS': (22.0, 29.0), 'AF': (27.0, 31.0)} # width, length as printed
|
||||
|
||||
def acorn_poly(kind):
|
||||
|
||||
Reference in new issue
Block a user