feat: P1批次1 设计域(AI推荐/分享体系/阳光房绘图/量尺标注/逐格指定编辑)

This commit is contained in:
HHY
2026-09-25 06:17:29 -07:00
parent 6726a9fa3a
commit 76fd0ced14
21 changed files with 1154 additions and 20 deletions
+22 -3
View File
@@ -41,6 +41,12 @@ QUICK_SCENE = {
"studio": "studio product shot on a seamless neutral background, softbox lighting, slight floor reflection",
}
# 阳光房场景(对齐目标站 sunnyhouse 平顶/人字顶)
SUNROOM_DESC = {
"sunroom-flat": "a flat-roof glass sunroom attached to the house, slim {frame_word} aluminum posts and glass beams, clear tempered glass roof panels, furnished with rattan chairs and plants, garden view",
"sunroom-gable": "a gable (A-frame pitched) glass sunroom attached to the house, ridge beam with fan-shaped front glass, {frame_word} aluminum structure, clear glass roof, garden view",
}
def _sash_kind(sub: dict) -> str | None:
t = str(sub.get("type", ""))
@@ -134,12 +140,25 @@ def build_prompt(drawing: str | dict, style: str = "modern", time: str = "day",
ratio: portrait/landscape/square → 依据窗型宽高比的构图引导。
"""
info = describe_window(drawing)
dd = parse_drawing(drawing)
finish, style_word = STYLE_FINISH.get(style, STYLE_FINISH["modern"])
light = TIME_LIGHT.get(time, TIME_LIGHT["day"])
scene_tpl = SCENE_DESC.get(scene) or QUICK_SCENE.get(scene) or SCENE_DESC["render"]
scene_text = scene_tpl.replace("{style_word}", style_word)
window_desc = info["summary"] or "a modern aluminum window"
# 阳光房场景: 窗型描述让位于结构描述
frame_word = "anthracite" if style == "modern" else ("bronze" if style == "chinese" else "white")
if scene in SUNROOM_DESC:
scene_text = SUNROOM_DESC[scene].replace("{frame_word}", frame_word)
sr = dd.get("_sunroom") or {}
fw = sr.get("width_mm") or info["width_mm"] or 4000
fd = sr.get("depth_mm") or 3000
fh = sr.get("height_mm") or 2800
bays = max(2, round(fw / (sr.get("bay_mm") or 1000)))
window_desc = (f"Structure: {scene_text}; footprint {fw}×{fd}mm, eave height {fh}mm, "
f"{bays} bays with slim aluminum posts")
else:
scene_tpl = SCENE_DESC.get(scene) or QUICK_SCENE.get(scene) or SCENE_DESC["render"]
scene_text = scene_tpl.replace("{style_word}", style_word)
window_desc = info["summary"] or "a modern aluminum window"
composition = {
"portrait": "vertical composition, window fills most of the frame height",
"landscape": "horizontal composition, generous wall context around the window",