Files
novalon-website/deliverables/logo-redesign-2026-10-13/ri.py
T
zhangxiang a57826f710 docs(brand): 品牌全案手册与落库证据入库(判据、门禁、负例都在场)
BRAND-MANUAL.md 收敛识别方案裁定与实测判据;TOKEN-MIGRATION.md 记 P1/P3/P4 迁移面与孪生缺陷;
TEST-PATCH.md 记 P7 的 1→0 实测。随包入库的是结论赖以成立的仪器与证据:check-assets、check-manual、
verify-assets-cross、check-wordmark-copies、check-docsync、check-probes(四段闸,每段带能失败的负例)、
check-baseline-shift.cjs(平移感知基线判据,四合成样本两绿两红自测通过;它取代被证伪的
「diff 包围盒不许越页眉带」)与 measured/baseline-shift-p1.json(第一批 104 张逐张分类,带 _src 出处戳)。

大体积工作件不入库:样机 HTML 与栅格截图 100+MB、字体母版 45MB 留在盘上,入库 690 个文本/矢量件。
2026-10-16 19:23:28 +08:00

224 lines
11 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
字源批 · 第三刀:日 / 目 的正确几何
第二刀的两条结论:
一、H3 日 是十一版里唯一在 16px 后仍然「像一个标志」的字源形——闭合环 + 中心一实,
厚重、朱砂、有字理。它的问题只有一个:环的接缝在正下方,露成一道竖缺口。
二、H1/H2 目 不是设计失败,是我写错了机器。brush-family.curve() 只取首尾两点,
中间点被丢弃,所以三点折线加 bulge 之后左右两弧都退化成 ±7 的浅弯,
眼睛被压成一根纺锤。这一刀用真半椭圆重新画。
画法要点(都是真毛笔的做法,不是装饰):
· 环的接缝移到顶部,收笔以尖尾搭过起笔的钝头——写环本来就是搭接,不是对齐。
· 环用三次谐波做轻微不规则,避免读成圆规画的 O。
· 目用两条半椭圆,两端收尖、中段最粗,所以是「写」出来的眼眶而不是描出来的轮廓。
· 中心一实不接触环内壁:甲骨日本有作中实一点的写法,且小尺寸下接触会并成一整块。
"""
import importlib.util
import math
import os
HERE = os.path.dirname(os.path.abspath(__file__))
def load(name, path):
sp = importlib.util.spec_from_file_location(name, path)
m = importlib.util.module_from_spec(sp)
sp.loader.exec_module(m)
return m
n5 = load("n5", os.path.join(HERE, "n5-refine.py"))
bf = load("bf", os.path.join(HERE, "brush-family.py"))
gl = load("gl", os.path.join(HERE, "glyphs.py"))
g2 = load("g2", os.path.join(HERE, "glyphs2.py"))
RED, INK, WHITE = n5.RED, n5.INK, n5.WHITE
ENV_X, ENV_W = n5.ENV_X, n5.ENV_W
BT, BB, BCY = n5.BLOCK_TOP, n5.BLOCK_BOT, n5.BLOCK_CY
CX = ENV_X + ENV_W / 2
S = gl.S
# 环:起笔钝(搭接处),右下行笔最重,左上收细,尾尖
P_RING = [(0.00, 0.50), (0.05, 0.98), (0.30, 1.03), (0.58, 1.00),
(0.80, 0.80), (0.94, 0.46), (1.00, 0.26)]
# 两端收尖、中段最粗(眼眶、撇捺用)
P_LENS = [(0.00, 0.14), (0.13, 0.82), (0.50, 1.00), (0.87, 0.82), (1.00, 0.14)]
P_BAR = [(0.00, 0.42), (0.12, 1.00), (0.78, 0.96), (0.95, 0.58), (1.00, 0.34)]
def arc_c(cx, cy, rx, ry, a0, sweep, k3=0.0, k2=0.0, n=150):
"""椭圆中心线一段,带三次/二次谐波不规则(角度:SVG y 向下,-90 为正上)。"""
pts = []
for i in range(n + 1):
t = math.radians(a0 + sweep * i / n)
k = 1.0 + k3 * math.sin(3 * t) + k2 * math.cos(2 * t)
pts.append((cx + rx * k * math.cos(t), cy + ry * k * math.sin(t)))
return pts
def ring(rx, ry, w, a0=-90.0, sweep=370.0, k3=0.030, k2=-0.014, prof=None):
return bf.stroke(arc_c(CX, BCY, rx, ry, a0, sweep, k3, k2),
prof or P_RING, w, steps=300)
def lens(rx, ry, w, prof=None):
"""两条半椭圆夹成眼眶:左弧(顶→底经左)、右弧(顶→底经右)。"""
prof = prof or P_LENS
a = bf.stroke(arc_c(CX, BCY, rx, ry, -90, -180, 0.0, 0.0), prof, w, steps=220)
b = bf.stroke(arc_c(CX, BCY, rx, ry, -90, 180, 0.0, 0.0), prof, w, steps=220)
return a + b
def bar(half, w, y=None, prof=None):
return S([(CX - half, y if y is not None else BCY),
(CX + half, y if y is not None else BCY)], w, prof or P_BAR)
# --- 六版 -----------------------------------------------------------------
def k1_ri():
"""日·正:竖环 + 中心横实,不接触内壁。"""
return ring(27.0, 35.0, 12.6) + bar(15.5, 12.0)
def k2_ri_dian():
"""日·中实一点:甲骨日有作中心一短胖点者,更近「瞳」。"""
return ring(27.0, 35.0, 12.6) + \
bf.stroke(arc_c(CX, BCY, 6.5, 5.0, -90, 372, 0.0, 0.0),
[(0, .7), (.5, 1), (1, .7)], 11.0, steps=140)
def k3_ri_bian():
"""日·扁:横环。与「口」的距离更近,与字标的方块更咬得合。"""
return ring(33.0, 29.0, 12.4) + bar(19.0, 11.6)
def k4_mu_v():
"""目·纵(重画):竖眼眶两端收尖,中一横瞳孔。"""
return lens(24.0, 38.0, 12.4) + bar(14.0, 11.6)
def k5_mu_h():
"""目·横(重画):横眼眶,眼裂形。"""
return lens(34.0, 26.0, 12.2) + bar(17.0, 12.0)
def k6_mu_tong():
"""目·同字框变体:眼眶 + 瞳孔 + 上下各一短竖,读成「目」的楷构而非纯象形。"""
return lens(24.0, 38.0, 12.0) + bar(14.0, 11.2) + \
S([(CX, BT + 1), (CX, BT + 11)], 10.5, P_BAR)
ITEMS = [
dict(id="K1", nm="日 · 正", src="甲骨文「日」,环加中心实", body=k1_ri,
note="第二刀 H3 的接缝修在顶部:收笔的尖尾搭过起笔的钝头,这是写真环时本来发生的搭接。"
"中心一实不接触内壁,所以 16px 下环与实仍是两个可分的东西。"),
dict(id="K2", nm="日 · 中实一点", src="同上,中作点", body=k2_ri_dian,
note="把横实换成一颗短胖点。点更近「瞳」,与「睿=深视」的字理更直接;"
"代价是点比横更容易在 16px 与环并成一块。"),
dict(id="K3", nm="日 · 扁", src="同上,横势", body=k3_ri_bian,
note="环压扁。横向余量给了字标更稳的底座,形也更近印章的方;"
"风险是扁环加横实开始读成「口」而不是「日」。"),
dict(id="K4", nm="目 · 纵(重画)", src="甲骨文「目」,纵目", body=k4_mu_v,
note="第二刀 H1 的窄纺锤是我用错了 curve():它只取首尾两点,中间点被丢。"
"这里换成两条真半椭圆,两端收尖、中段最粗——眼眶是写出来的,不是描出来的。"),
dict(id="K5", nm="目 · 横(重画)", src="同上,横势", body=k5_mu_h,
note="同一机器的横势。这才是「眼裂」的形:宽 68、高 52,瞳孔横在中间。"),
dict(id="K6", nm="目 · 上加一竖", src="目与楷构之间", body=k6_mu_tong,
note="在 K4 顶上加一短竖,把纯象形拉回可识字。多出来的一笔同时是全场唯一的不对称来源,"
"也是「目」字头上那一竖的字源残留。"),
]
def lockup(mark, h, color=INK):
return ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 120" '
'style="height:%dpx;width:auto;display:block;color:%s" role="img" '
'aria-label="睿新致远 NOVALON">%s%s</svg>' % (h, color, mark, n5.wordmark_fixed(color)))
def mark_only(mark, px):
return ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 108 120" '
'style="height:%dpx;width:auto;display:block">%s</svg>' % (px, mark))
CSS = gl.CSS
JS = gl.JS
def card(mid, nm, body, note, src):
o = ['<div class="be"><div>',
'<div class="big">%s</div>' % lockup(body, 92),
'<div class="row2">']
for px in (40, 32):
o.append('<div class="u">%s<span>%dpx</span></div>' % (lockup(body, px), px))
o.append('<div class="u"><span class="darkcell">%s</span><span>深底 40px</span></div>'
% lockup(body, 40, WHITE))
for px in (48, 32, 24, 16):
o.append('<div class="u">%s<span>%dpx</span></div>' % (mark_only(body, px), px))
o.append('<div class="u"><span class="darkcell" style="padding:8px">%s</span>'
'<span>深底 32px 反白</span></div>'
% mark_only(body.replace('fill="%s"' % RED, 'fill="%s"' % WHITE), 32))
o.append('</div></div>')
o.append('<div class="meta"><h3><span class="id">%s</span>%s</h3>'
'<div class="src">出处:%s</div>' % (mid, nm, src))
o.append('<div class="fm">%s</div>' % note)
o.append('<div class="small" style="margin-top:7px">红占包络 <b data-m="%s@red">…</b> · '
'16px 实得行程 <b data-m="%s@r16">…</b></div></div></div>' % (mid, mid))
o.append('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 108 120" '
'style="position:absolute;width:0;height:0" data-src="%s">%s</svg>' % (mid, body))
return "".join(o)
def build():
P = []
w = P.append
w('<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8">'
'<meta name="viewport" content="width=device-width,initial-scale=1">'
'<title>字源批 · 第三刀 日/目 · 2026-10-13</title>')
w('<style>' + CSS.replace("__GEIST__", gl.ms.GEIST_B64) + '</style></head><body><div class="wrap">')
w('<header class="top"><div class="eyebrow">Third cut · 2026-10-13 · 评审稿(repo 零改动)</div>')
w('<h1>字源批 · <em>第三刀:日 与 目</em></h1>')
w('<p class="lede">前两刀十一版,眼睛留下的只有两个形:<b>日</b>(闭合环加中心一实)与'
'<b>目</b>(两弧夹瞳孔)。这一刀不再扩面,只把这两个形做对——'
'日的接缝从正下方挪到顶部并改成搭接,目用真半椭圆重画(第二刀的窄纺锤是我用错了函数,'
'不是形不行)。参照栏放八(第二刀唯一另一版可读的)与两版入围,同尺同图。</p></header>')
for it in ITEMS:
w(card(it["id"], it["nm"], it["body"](), it["note"], it["src"]))
w(card("H4", "八(第二刀)", g2.ba(15), "保留参照:两笔相背,顶隙 15。", "八卦之数"))
w(card("E1", "E1 一相圆", bf.E1_BODY, "入围参照。", "已在入围"))
w(card("N5", "N5 竹简", n5.V1, "入围参照。", "已在入围"))
w('<section class="band"><h2 class="band">口径</h2><p>红占包络=红像素 ÷ 符号包络面积'
'(84.3 × 84.07,512 栅格)。16px 实得行程=真栅格化到 16×16 后逐行红色行程取最大值。'
'环类(日)在横向扫描下天然 2 段(环的左右两侧),实心并块会变成 1 段——'
'所以「16px 行程」对环的意义是「还分不分得开」,不是「还剩几笔」。</p></section>')
w(JS)
w('<footer>生成器 <code>ri.py</code> · 前两刀见 <code>glyphs.html</code> 与 <code>glyphs2.html</code>'
'</footer></div></body></html>')
return "".join(P)
def main():
p = os.path.join(HERE, "ri.html")
open(p, "w", encoding="utf-8").write(build())
print("ri.html %s B" % f"{os.path.getsize(p):,}")
d = os.path.join(HERE, "assets-ri")
os.makedirs(d, exist_ok=True)
for it in ITEMS:
body = it["body"]()
for kind, color in (("logo", INK), ("logo-white", WHITE)):
open(os.path.join(d, "%s-%s.svg" % (it["id"], kind)), "w", encoding="utf-8").write(
'<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" '
'viewBox="0 0 480 120" width="480" height="120" role="img" '
'aria-label="睿新致远 NOVALON">%s%s</svg>\n' % (body, n5.wordmark_fixed(color)))
open(os.path.join(d, "%s-mark.svg" % it["id"]), "w", encoding="utf-8").write(
'<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" '
'viewBox="0 0 108 120" width="108" height="120" role="img" '
'aria-label="睿新致远">%s</svg>\n' % body)
print("assets-ri/ →", len(os.listdir(d)), "个文件")
if __name__ == "__main__":
main()