diff --git a/tools/render_sample_sheet_v3.py b/tools/render_sample_sheet_v3.py index b2cd1172..41545ce9 100644 --- a/tools/render_sample_sheet_v3.py +++ b/tools/render_sample_sheet_v3.py @@ -560,11 +560,13 @@ def draw_hero_on_board(board, ox, oy, cell, hx, hy, records, digit=None): records.append(("hero", hx, hy, fx, fy, digit)) +FACADE_FRAC = 0.55 # E 格立面占比(v3.2 档位候选:0.55/0.80/1.00 三档对比,用户挑档) + def draw_facade(board, x0, y0, cell): """v3.1 高墙立面(用户方案:地面格南邻墙 → 南部承接墙面展示,E 格)。 - 南 45% 画墙身:横层理暗砖+口沿高光顶线(与墙顶分界);程序化示意,终稿=E 瓦片素材(词表扩展)。""" + 南部画墙身:横层理暗砖+檐口阴线;程序化示意,终稿=E 瓦片素材(词表扩展)。""" d = ImageDraw.Draw(board) - fy0 = y0 + int(cell * 0.45) # 立面占南 55%(高墙感档,目检候选) + fy0 = y0 + int(cell * (1.0 - FACADE_FRAC)) # 立面基色=墙顶瓦片实测色(E 与南侧墙顶须读作同一堵墙——采样 center 瓦片顶面区) top = WALLS["center"].convert("RGB").crop((4, 4, 28, 14)) px = list(top.getdata()) @@ -572,7 +574,7 @@ def draw_facade(board, x0, y0, cell): face = _gd_darkened(wall_top_rgb, 0.16) # 北立面=受光面,略暗于顶面 16% 分层 d.rectangle([x0, fy0, x0 + cell, y0 + cell], fill=face) for i in range(3): # 横层理(横条纹,禁竖条纹栅栏感——§3.2 高墙条) - ly = fy0 + int((i + 1) * (cell - int(cell * 0.45)) / 4.0) + ly = fy0 + int((i + 1) * (cell * FACADE_FRAC) / 4.0) d.line([(x0 + 2, ly), (x0 + cell - 2, ly)], fill=_gd_darkened(face, 0.30), width=1) for i in range(2): # 层理错缝竖短线(砖缝) for j in range(3): @@ -588,6 +590,23 @@ def is_facade_cell(gmap, x, y): return (0 <= y + 1 < gmap.h) and gmap.grid[y][x] != "W" and gmap.grid[y + 1][x] == "W" +def lift_south_lip(tile): + """v3.2:南向墙格(南邻地)瓦片底部 ~40% 立面暗条提亮——(56,45,39) 极暗拉低整格观感, + 用户指「墙顶面应同色」:顶面本同色(147≈145),观感差系暗条过暗。背光面仍暗于顶面,但不死黑。 + 程序化示意,终稿归瓦片重产(§8.5)。""" + im = tile.convert("RGB") + w, h = im.size + y0 = int(h * 0.60) + band = im.crop((0, y0, w, h)) + lut = [min(255, int(i * 1.75 + 18)) for i in range(256)] + band = band.point(lut * 3) + out = im.copy() + out.paste(band, (0, y0)) + if tile.mode == "RGBA": + out.putalpha(tile.split()[3]) + return out.convert("RGBA") + + def render_board(gmap, cell, overlays=None, scale_note=""): """按方案甲查表拼装渲染样张板。返回 (img, placement, glow_layer)。""" wpx, hpx = gmap.w * cell, gmap.h * cell @@ -604,7 +623,10 @@ def render_board(gmap, cell, overlays=None, scale_note=""): t = WALLS[kind] if flip: t = t.transpose(Image.FLIP_LEFT_RIGHT) - board.paste(t.resize((cell, cell), Image.NEAREST), (x * cell, y * cell)) + t = t.resize((cell, cell), Image.NEAREST) + if overlays and not is_wall(gmap, x, y + 1): # v3.2 南向墙格立面提亮 + t = lift_south_lip(t) + board.paste(t, (x * cell, y * cell)) placement[(x, y)] = (kind, flip) else: vi = floor_variant(x, y)