version "2024.1" # 太和殿 golden exemplar(NL2CGA-DEMO-RAG-1113) # 重檐庑殿顶 + 三层台基 + 面阔11间 # 派生自已对齐 demo idioms: # esri-parthenon-native-1016 三层台基 Steps(n) 递归 offset/extrude(crepidoma) # rooftypes-lib-20260927 重檐庑殿顶 DoubleHipAndHipRoof(roofHip 双层) # shenwu-taihe-20260927 柱网/屋身配色与台基参数化 @Range(min=0.8, max=2.0, stepsize=0.1) attr tier_height = 1.2 @Range(min=1.0, max=3.0, stepsize=0.1) attr tier_tread = 1.6 @Range(min=4, max=16, stepsize=0.5) attr column_height = 8 @Range(min=10, max=50, stepsize=1) attr roof_angle = 32 const basecolor = "#E0E0E0" const wallcolor = "#B03A2E" const columncolor = "#A73630" const roofcolor = "#C8A039" const wincolor = "#5A4A3A" const dougongcolor = "#8A6D3A" # 面阔11间 const bays = 11 # 三层台基总高 const podiumH = 3 * tier_height @StartRule @InPolygon TaiheLot --> Podium t(0, podiumH, 0) offset(-2.5, inside) HallBody # 三层台基(Parthenon crepidoma idiom:同地块逐层内收 offset + 叠高) Podium --> color(basecolor) Steps(2) Steps(n) --> case n >= 0 : [ t(0, tier_height, 0) Steps(n-1) ] offset(n * tier_tread, inside) extrude(tier_height) Step. else : NIL # 屋身:柱网 + 红墙 + 斗拱层 HallBody --> extrude(column_height) HallVolume HallVolume --> comp(f){ top : Dougong | side : Facade } # 斗拱层(简化:屋身顶部出挑小檐带) Dougong --> extrude(0.8) color(dougongcolor) DougongBand DougongBand --> comp(f){ top : DoubleHipRoof | side : color(dougongcolor) } Facade --> split(x){ { scope.sx/bays : Bay }* } Bay --> color(wallcolor) split(y){ '0.08 : color(columncolor) | ~0.6 : WallPanel | '0.32 : color(columncolor) } WallPanel --> split(x){ '0.15 : color(columncolor) | ~0.7 : color(wincolor) | '0.15 : color(columncolor) } # 重檐庑殿顶(rooftypes-lib DoubleHipAndHipRoof idiom) DoubleHipRoof --> roofHip(roof_angle, scope.sx/9) split(y){ '0.35 : color(roofcolor) | ~1 : primitiveQuad Clerestory } Clerestory --> extrude(scope.sx/5) color(wallcolor) ClerestoryBox ClerestoryBox --> comp(f){ top : UpperHipRoof | side : color(wallcolor) } UpperHipRoof --> roofHip(roof_angle, scope.sx/15) color(roofcolor)