version "2024.1" # 中式四合院参数化骨架(ADAPTIVE-1121 P1-4) # 以 bj100 已验证参数化产物(md5 15d778d4…)为底增强: # 一进四合院——正房(北)+倒座(南)+东西厢房围合中央庭院,硬山顶灰瓦 @Range(min=15, max=80, stepsize=1) attr lotWidth = 40 # 面阔(东西向,米) @Range(min=15, max=80, stepsize=1) attr lotDepth = 30 # 进深(南北向,米) @Range(min=4, max=12, stepsize=0.5) attr mainRoomDepth = 7 # 正房/倒座进深 @Range(min=3, max=10, stepsize=0.5) attr wingWidth = 5 # 厢房面阔 @Range(min=0.3, max=1.5, stepsize=0.1) attr baseHeight = 0.6 # 台基高 @Range(min=2.8, max=6, stepsize=0.1) attr mainWallHeight = 4.2 # 正房檐高 @Range(min=2.4, max=5, stepsize=0.1) attr wingWallHeight = 3.2 # 厢房/倒座檐高 @Range(min=15, max=45, stepsize=1) attr roofAngle = 28 # 硬山顶坡度 const wallcolor = "#B03A2E" # 正房红墙 const graywall = "#9A938A" # 厢房青砖 const roofcolor = "#6E6E6E" # 灰瓦 const basecolor = "#E0E0E0" # 台基石 const courtcolor = "#C9C2B4" # 庭院砖墁 @StartRule @InPolygon Lot --> primitiveQuad(lotWidth, lotDepth) split(z) { mainRoomDepth : MainHouse | ~1 : Middle | mainRoomDepth : SouthHouse } Middle --> split(x) { wingWidth : Wing | ~1 : Courtyard | wingWidth : Wing } # 正房(北):台基 + 高檐 + 硬山顶,红墙 MainHouse --> extrude(baseHeight) comp(f) { top : MainBody | side : Base } MainBody --> extrude(mainWallHeight) comp(f) { top : MainRoof | side : MainWall } MainRoof --> roofGable(roofAngle) color(roofcolor) MainWall --> color(wallcolor) # 倒座(南):形制同正房、体量稍低,青砖 SouthHouse --> extrude(baseHeight) comp(f) { top : SouthBody | side : Base } SouthBody --> extrude(wingWallHeight) comp(f) { top : SouthRoof | side : SouthWall } SouthRoof --> roofGable(roofAngle) color(roofcolor) SouthWall --> color(graywall) # 东西厢房:青砖硬山 Wing --> extrude(baseHeight) comp(f) { top : WingBody | side : Base } WingBody --> extrude(wingWallHeight) comp(f) { top : WingRoof | side : WingWall } WingRoof --> roofGable(roofAngle) color(roofcolor) WingWall --> color(graywall) Base --> color(basecolor) # 中央庭院:砖墁十字甬道 Courtyard --> color(courtcolor) split(x) { ~1 : CourtYard. | 1.2 : PathX | ~1 : CourtYard. } PathX --> color("#B8B0A0") split(z) { ~1 : Path. | 1.2 : PathCross | ~1 : Path. } PathCross --> color("#B8B0A0") Path.