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
@@ -1,7 +1,7 @@
|
||||
"""1:1 cutting templates, US Letter landscape (content also fits A4). Counts come from the manifest."""
|
||||
import os, asyncio
|
||||
"""1:1 cutting templates, US Letter landscape (content also fits A4). Leaf counts come from the manifest."""
|
||||
import asyncio
|
||||
from collections import Counter
|
||||
import geom as G, manifest as M, draw as D
|
||||
import geom as G, manifest as M
|
||||
from draw import f, path, line
|
||||
from geom import TOP
|
||||
import shot, fonts
|
||||
@@ -68,23 +68,23 @@ def base_page(base, n, total):
|
||||
return page(body, title, sub, n, total)
|
||||
|
||||
def leaf_counts():
|
||||
"""(size, variant) -> [as drawn, flipped], from the manifest; spares are added to variant 0 as drawn."""
|
||||
"""(size, variant) -> how many to cut, from the manifest; spares are counted under variant B."""
|
||||
c = Counter()
|
||||
for p in M.PLACEMENTS:
|
||||
if p['part'] in 'LMST': c[(p['part'], p['variant'], bool(p['flip']))] += 1
|
||||
for k, n in M.SPARES.items(): c[(k, 1, False)] += n
|
||||
if p['part'] in 'LMST': c[(p['part'], p['variant'])] += 1
|
||||
for k, n in M.SPARES.items(): c[(k, 1)] += n
|
||||
return c
|
||||
|
||||
def leaf_cell(size, variant, cx, base_y, c):
|
||||
name = {'L': 'Large', 'M': 'Medium', 'S': 'Small', 'T': 'Tip'}[size] + ' ' + 'AB'[variant]
|
||||
leaf = G.oak(size, variant); n0, n1 = c[(size, variant, False)], c[(size, variant, True)]
|
||||
leaf = G.oak(size, variant); n = c[(size, variant)]
|
||||
g = f'<g transform="translate({f(cx)} {f(base_y)})"><path d="{path(leaf)}" fill="none" stroke="{CUT}" stroke-width="0.5" stroke-linejoin="round" class="cut"/>'
|
||||
g += f'<path d="{" ".join(line(l) for l in G.vein_lines(size, variant))}" fill="none" stroke="{GUIDE}" stroke-width="0.25" stroke-dasharray="1.5 1.2"/></g>'
|
||||
y = base_y + G.STEM_L + 6
|
||||
g += T(cx, y, name, 3.3, 700, anchor='middle')
|
||||
box = lambda k: ''.join(f'<rect x="{f(cx - k*2.6 + i*5.2 + 0.6)}" y="{f(y+7.2)}" width="4" height="4" fill="none" stroke="#111" stroke-width="0.3"/>' for i in range(k))
|
||||
g += T(cx, y+4.8, f'cut {n0 + n1}', 2.9, 600, anchor='middle') + box(n0 + n1)
|
||||
return g, n0 + n1
|
||||
g += T(cx, y+4.8, f'cut {n}', 2.9, 600, anchor='middle') + box(n)
|
||||
return g, n
|
||||
|
||||
def leaf_pages(n0, total):
|
||||
c = leaf_counts(); ml = M.make_list(); pages = []
|
||||
|
||||
Reference in new issue
Block a user