CityEngine CGA语法之包络函数 envelope

概要

envelope(direction, maxHeight, frontBaseHeight, frontAngle)
envelope(direction, maxHeight, frontBaseHeight, frontAngle, backBaseHeight, backAngle)
envelope(direction, maxHeight, frontBaseHeight, frontAngle, backBaseHeight, backAngle, sideBaseHeight, sideAngle)
envelope(direction, maxHeight, frontBaseHeight, frontAngle, backBaseHeight, backAngle, rightBaseHeight, rightAngle, leftBaseHeight, leftAngle)


参数

  • direction (selstring):包络产生的方向
  • 有两个取值:normal和world.up,normal表示按scope的Y轴方向生成包络,world.up表示按世界座标的Y方向生成包络

maxHeight (float):包络的最大高度(米),如果超过了这个高度,超出的几何体部分会被切除,包络顶面封闭为水平

frontBaseHeight (float):前部包络面生成的基准高度值(米)

frontAngle (float):前部包络面生成的倾斜角度(度)

backBaseHeight (float):后部包络面生成的基准高度值(米)

backAngle (float):后部包络面生成的倾斜角度(度)

sideBaseHeight (float):两侧包络面生成的基准高度值(米)

sideAngle (float):两侧包络面生成的倾斜角度(度)

rightBaseHeight (float):右侧包络面生成的基准高度值(米)

rightAngle (float):右侧包络面生成的倾斜角度(度)

leftBaseHeight (float):左侧包络面生成的基准高度值(米)

leftAngle (float):左侧包络面生成的倾斜角度(度)


参数示意图:


注意

无论采用哪个方向(normal或world.up),包络生成的方向都是朝上

示例

envelope(direction, maxHeight, frontBaseHeight, frontAngle)

设置方向为normal,maxHeight=30,frontBaseHeight=10,frontAngle=45

Lot -->
	envelope(normal,30,10,45)
	color("#ffff00")



改变方向为world.up

Lot -->
	envelope(world.up,30,10,45)
	color("#ffff00")


envelope(direction, maxHeight, frontBaseHeight, frontAngle, backBaseHeight, backAngle)

设置方向为normal,maxHeight=30,frontBaseHeight=10,frontAngle=45,backBaseHeight=10,backAngle=60

Lot -->
	envelope(normal,30,10,45,10,60)
	color("#ffff00")



envelope(direction, maxHeight, frontBaseHeight, frontAngle, backBaseHeight, backAngle, sideBaseHeight, sideAngle)

设置方向为normal,maxHeight=30,frontBaseHeight=10,frontAngle=45,backBaseHeight=10,backAngle=60,sideBaseHeight=15,sideAngle=65



envelope(direction, maxHeight, frontBaseHeight, frontAngle, backBaseHeight, backAngle, rightBaseHeight, rightAngle, leftBaseHeight, leftAngle)

设置方向为normal,maxHeight=30,frontBaseHeight=10,frontAngle=45,backBaseHeight=10,backAngle=60,rightBaseHeight=15,rightAngle=65,leftBaseHeight=25,leftAngle=25

Lot -->
	envelope(normal,30,10,45,10,60,15,65,25,25)
	color("#ffff00")


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章