平面图
关于平面图
平面图是空间的标准二维建筑视图:具有真实尺寸的房间、以实心填充墙绘制的墙体、带四分之一圆弧摆动的门、玻璃线条表示的窗户,以及平面视图符号表示的家具——这是《建筑图形标准》所记录并被所有专业图纸使用的视觉语言。Schematex 通过文本渲染平面图:您用真实尺寸声明房间、连续开口、墙厚和家具;引擎自动合并共用墙体、计算房间面积、绘制尺寸线、自动排列座位与标签,并检查真实的门扇摆动空间。
与图像生成器不同,输出结果是可量化、可编辑的——每个房间都是带有计算面积的已标记元素,增加第四排桌子只需编辑一行文字。
1. 第一张平面图
一个标题、一个房间、一扇门和一扇窗:
floorplan "Studio"
room main "Studio" at 0,0 size 4x3
door main south at 20%
window main north at 50%三条规则涵盖大多数使用场景:
- 以
floorplan开头,后跟可选的引号标题和unit m(默认)或unit ft。所有数字均使用此单位。 - 房间为矩形:
room id "标签" at x,y size 宽x高。标签和计算面积居中显示在房间内。 - 开口挂在墙上:墙体引用(
main south)按百分比定位在该墙上;between A B自动找到共用墙体。
2. 房间与位置
将第一个房间置于 0,0,其余房间相对定位——相邻房间精确共享一条边,其墙体合并为一条单独的填充带:
room living "Living Room" at 0,0 size 5.2x4.2
room kitchen "Kitchen" right-of living size 3.0x4.2
room hall "Hallway" below living size 2.0x2.6
room bed1 "Bedroom 1" right-of hall size 3.2x2.6right-of/left-of/above/below对齐到参考房间的边缘。align start|center|end对齐横轴(默认start= 顶/左边缘对齐);offset n偏移。fill #e0f2fe为地板着色;nolabel隐藏名称和面积标签(适用于教室等单一空间平面图)。- 坐标系 Y 轴向下:
at 0,0为左上角。
L/T/U 形房间使用 extend——先声明主矩形,再用共边矩形扩展。沿接缝的墙体合并,面积汇总为一个数值(与专业人员测量 L 形房间的方式完全一致),标签居中于最大部分:
room living "Living Room" at 0,0 size 5x4
extend living at 5,2 size 2x2 # L 形:右上角缺口若扩展区域未与房间接触,或与其重叠,将以定量错误信息拒绝。north(可选 north 30 用于旋转平面图)在右上角添加指北针。
3. 门、窗和开口
door hall west at 50% width 1.0 swing in # 外墙门
door between hall bed1 at 50% hinge right # 内墙门,位于共用墙上
door between bed1 bath at 30% type sliding # 推拉门——无圆弧
opening between living kitchen at 35% width 1.2 # 拱形开口,无门扇
window living north at 30% width 1.8between A B解析共用墙体段,并按百分比定位在重叠部分——无需坐标。非相邻房间将以测量间距拒绝。- 门默认宽度:外墙 0.9 m,
between内墙 0.8 m;窗默认 1.2 m。 hinge left|right选择铰链侧;swing in|out翻转四分之一圆弧(默认向第一个命名房间内侧摆动)。- 门
type single|double|sliding|pocket|bifold:double 绘制两个镜像圆弧;sliding/pocket 绘制偏移叶片线但无圆弧;bifold 绘制两扇折叠门的帐篷峰形。 - 窗
type fixed|sliding|casement|bay:sliding = 两个偏移面板,casement 添加向外摆动圆弧,bay 向墙外投影一个展开梯形。 - 开口会被截断以适应其墙体段(并附带警告),而不会溢出。
如果立面来自实测尺寸,可以给第一个开口命名,再依次排列其余开口:
door hall south from start 0.30 width 0.90 id entry
window hall south after entry gap 0.10 width 1.20 id display1
window hall south after display1 gap 0.20 width 1.20 id display2水平墙的 start 是西端,垂直墙的 start 是北端。from start n 量到 opening 的 leading jamb;from end n 从另一端量到 trailing jamb。before / after 只能引用同一面墙上、在前文已经声明的 opening id,因此 AI agent 生成的链条有稳定且可检查的顺序。
墙厚层级
先声明整体规则,再覆盖少数特殊的共用墙:
wall exterior thickness 0.35
wall interior thickness 0.12
wall between kitchen dining thickness 0.20墙体填充、开口和 semantic SVG 共用同一组 resolved wall segments,门窗会继承所在墙的真实厚度。不写任何 wall 语句时,所有墙仍使用原有的 0.20 m 默认值。
4. 家具
家具相对于房间内部左上角定位,可选 size、rotate 和标签:
furniture sofa in living at 0.25,2.9
furniture desk "Teacher" in class at 2,1.5 size 5x2.5 rotate 20
furniture counter "Cubbies" in class at 6,24.4 size 10x1.2当需求是“把这个符号完整放进房间”,可用 fit,无需让 AI 自己计算旋转后的 bounding box:
furniture stairs-l S1 in stairwell fit margin 0.10 size 2.4x3.2 rotate 90 mirror xfit 先应用旋转,仅在需要时等比缩小,然后把最终 envelope 居中放进房间的最大区域。mirror x|y 只镜像 geometry,UP 等文字仍保持正向可读。
目录涵盖住宅、商业和场地规划(尺寸默认为行业标准占地):
| 类别 | 类型 |
|---|---|
| 住宅 | bed-double bed-single bed-queen bed-king bunk-bed crib sofa loveseat sectional armchair ottoman coffee-table side-table tv tv-stand fireplace floor-lamp rug wardrobe dresser nightstand bookshelf plant piano piano-upright pool-table ceiling-fan dining-table |
| 厨房/卫生间 | counter wall-cabinet kitchen-sink stove range-hood fridge dishwasher island bar-stool toilet sink vanity bidet urinal bathtub shower washer dryer |
| 教室/办公室 | desk-chair desk desk-l chair whiteboard smartboard bookcase cubbies filing-cabinet lockers kidney-table round-table-4/6/8/10 conference-table |
| 活动/宴会 | banquet-table head-table stage dance-floor bar dj-booth cocktail-table podium row-chairs |
| 零售/仓库 | shelving checkout clothing-rack fitting-room pallet-rack loading-dock forklift |
| 沙龙/健身房 | salon-chair shampoo-bowl manicure-table treadmill weight-bench power-rack yoga-mat |
| 餐厅/商业厨房 | booth prep-table range walk-in commercial-sink fryer |
| 楼梯/结构 | stairs stairs-l stairs-u spiral-stairs elevator column |
| 场地/室外 | tree car |
自动排座已内置:round-table-8 在圆周上绘制 8 把椅子(60 英寸桌面;round-table-10 使用 72 英寸),dining-table / banquet-table / conference-table 按每 0.65 m 一把椅子的间距在两侧长边排座,head-table 在面向房间的一侧排座,manicure-table 排一位顾客和一位技师,row-chairs 按 0.55 m 间距布置剧院排椅。rug、dance-floor、yoga-mat、counter、island、wall-cabinet、range-hood 和 ceiling-fan 是底层/顶层装饰——其他家具可与其重叠而不触发碰撞警告。
座位图 — 在任意自动排座桌上使用 seats 子句为每位占座者命名,引擎将把每个名字写在相应椅子上(按摆放顺序:圆桌从顶部顺时针;矩形桌先从左到右填充上边,再填充下边)。这将把场地平面图变成宾客实际阅读的座位图:
furniture round-table-8 "Table 3" in hall at 11,4 seats "Alice" "Bob" "Carol" "Dave"
furniture head-table "Head Table" in hall at 5,0.6 size 6x0.9 seats "Bride" "Groom"多余的无名椅子保持空置;超出椅子数量的名字将被忽略。CJK 引号括起的名字(seats "张伟" "李娜")与其他标签一样有效。名字水平显示,因此保持桌子不旋转可获得整洁的座位图。
tree 和 car 为室外设计(树冠圆盘、停车位占地),因此场地规划只需将相邻区域铺排为毗邻房间——前院、建筑占地、车道、后院——再在上面放置树木和停放的汽车即可。
楼梯遵循制图规范:踏步线间距 0.28 m(11 英寸),方向箭头从最低踏步开始标注 UP(给元素一个 "DN" 标签表示下行),以及在假想 4 英尺截面处的 45° 折线断开线,截面以外的踏步用虚线表示。stairs 为直跑楼梯(用 size/rotate 定向),stairs-l 经过平台转 90°,stairs-u 转回 180°,spiral-stairs 为带放射状踏步和中心柱的圆形楼梯。
房间标签不需要额外 syntax。布局会用稳定的 center-out candidates 避让家具的完整可见 envelope(包括餐桌自动生成的椅子)、MEP symbols、hinged-door swing sectors 和 protected-zone captions。狭小的 WC、储物间等自动使用只显示名称的 compact label。
5. 阵列——网格、行、弧
重复家具用一条语句,而非三十条:
grid desk-chair in class rows 5 cols 6 count 27 area 5,8 25,24 itemsize 2x2.5
row round-table-8 in hall cols 3 area 8.8,13.4 15.2,13.4 itemsize 2.3x2.3
arc chair in hall count 13 center 12,8 radius 5 from 200 to 340area x1,y1 x2,y2给出第一个和最后一个元素的中心点;元素在两者之间均匀分布。count按行优先截断——5×6 网格中放 27 张桌子,会删去最后一行的尾部,与真实教室完全一致。arc将元素放置在面向圆心的弧形上——半圆形教室、典礼座位。
6. 单位、面积与尺寸线
unit ft使所有数字以英尺为单位;尺寸线格式为32'/15'1",面积以sq ft表示。内部统一使用公制(1 ft = 0.3048 m)。- 房间面积由引擎根据声明的几何形状计算,无需手动输入。
- 尺寸线在平面图外侧渲染,带有建筑斜线刻度:始终包含总宽度和总高度,以及顶部和左侧外边界上的各房间分段尺寸。
7. 验证
引擎验证 LLM(和人类)实际容易出错的地方,错误信息会指出问题元素并给出修正方向:
错误会阻止渲染,因为文档结构无法被诚实解析。例如:引用不存在的 room id、扩展的对象不是 room、重复的 opening id,或相对 opening 引用了后文 / 另一面墙上的 id。
警告(仍会渲染,列于平面图下方):
- 房间重叠 —
rooms "bed1" and "bath" overlap by 0.40×2.60 m — move "bath" right-of "bed1" or shrink size。 - 非相邻房间之间的门会被跳过并报告实测 gap,建筑其余部分仍然渲染。
- 家具超出房间边界 —
furniture sofa #1 extends 1.7 m outside room "c" — move it or shrink size - 家具碰撞——包含椅圈包络的边界框,因此两张相互接触椅子的宴会圆桌即便桌面不重叠也会被标记。
- 单扇 / 双扇 hinged door 的真实 swept sector 与家具相交时,报告
floorplan/door-swing-obstructed;sliding、pocket、bifold 不占用四分之一圆摆动区。 - 开口被截断以适应其墙体段。
8. 语法(EBNF)
plan ::= "floorplan" string? header-setting* NL statement*
header-setting ::= "unit" ("m"|"ft") | "symbols" ("nec"|"iec")
statement ::= room | extend | wall | north | door | window | opening | furniture | fixture | zone | array | controls
room ::= "room" id string? placement "size" dims ("fill" color)?
("nolabel" | "label-role" ("normal"|"primary"|"secondary"|"hidden"))?
extend ::= "extend" id placement "size" dims
north ::= "north" num?
wall ::= "wall" ("exterior" | "interior" | "between" id id) "thickness" num
placement ::= "at" coord
| ("right-of"|"left-of"|"above"|"below") id ("offset" num)?
("align" ("start"|"center"|"end"))?
opening-placement ::= "at" pct | "from" ("start"|"end") num
| ("before"|"after") id "gap" num
door ::= "door" (wallref | "between" id id) opening-placement
("width" num)? ("hinge" ("left"|"right"))? ("swing" ("in"|"out"))?
("type" ("single"|"double"|"sliding"|"pocket"|"bifold"))? ("id" id)?
window ::= "window" wallref opening-placement ("width" num)?
("type" ("fixed"|"sliding"|"casement"|"bay"))? ("id" id)?
opening ::= "opening" (wallref | "between" id id) opening-placement ("width" num)? ("id" id)?
furniture ::= "furniture" type id? ("in" id) ("at" coord | "fit" ("margin" num)?)
("size" dims)? ("rotate" num)? ("mirror" ("x"|"y"))? string? ("seats" string+)?
fixture ::= "fixture" type id? "in" id "on" ("north"|"south"|"east"|"west") "at" pct
controls ::= "controls" id "->" id ("," id)*
zone ::= "zone" id string? "in" id "at" coord "size" dims ("keep-clear")?
array ::= ("grid"|"row"|"arc") type "in" id
("rows" int)? ("cols" int)? ("count" int)?
("area" coord coord)? ("itemsize" dims)? ("rotate" num)?
("center" coord)? ("radius" num)? ("from" num "to" num)?
wallref ::= id ("north"|"south"|"east"|"west")
coord ::= num "," num dims ::= num "x" num pct ::= num "%"?注释从 # 延伸到行尾。CJK 引号("")被视为 ASCII 引号。
相关示例
- 两居室公寓 — 相对定位、7 扇门、完整家具布置
- 两层 villa — 共享比例尺的楼层 plates,以及自动 fit 到上下楼梯间的 registered stair
- 餐厅与商业厨房 — 不同的外墙 / 内墙厚度与完整 back-of-house equipment line
- 27 张桌子的教室 —
grid … count截断、unit ft - 120 人婚宴 — 自动排座宴会圆桌、舞池
交互编辑
家具和电气设备可以在房间坐标内独立移动。简单房间会显示东侧、南侧和转角 resize handles,用来重写原始尺寸;房间主体本身不能拖动,从而避免家具选择产生歧义。共享墙上的 openings 仍会接受 topology validation。
多楼层平面图
用 floor N "标签" 把同一份 source 分成带边框的楼层 plates。所有 plates 共用一个绘图比例尺;stack horizontal|vertical 控制它们在 sheet 上的拼版方向。
floorplan "两层住宅" unit m stack horizontal
floor 0 "一层"
room hall at 0,0 size 6x4
furniture stairs S1 in hall at 4,0.4
floor 1 "二层"
room landing at 0,0 size 6x4
furniture stairs S1 in landing at 4,0.4可选的 furniture instance ID(S1)会注册跨楼层的同一段楼梯。低层自动标为 UP,高层标为 DN,错位超过 0.1 m 会产生 warning。room references、wall rules、doors、furniture 和 arrays 都是 floor-local,不能泄漏到其他 floor section。
Found this useful?
Schematex is free, fully open source, and zero-dependency. A star helps other developers discover it.