CityEngine CGA语法之 shapeL, shapeU, shapeO函数

概要

shapeL(frontWidth, leftWidth) { selectoroperator operations | selector operator operations }
shapeU(frontWidth, rightWidth, leftWidth) { selector operator operations |selector operator operations }
shapeO(frontWidth, rightWidth, backWidth, leftWidth) { selector operatoroperations | selector operator operations }


参数

frontWidth (float):前侧深度
leftWidth (float):左侧宽度 
rightWidth (float):右侧宽度
backWidth (float):后侧深度

selector (keyword):选择符,有两个取值shape和remainder,shape代表后退的那个面,remainder代表剩余的面

operator:运算符,定义如何创建新的形状有两个取值
1.  : :每个多边形都产生一个新的形状
2.  =:所有选择符相一致的多边形组合成一个新的形状

operations:执行在新产生的模型上的一系列操作


示例

shapeL
设置frontWidth =10,leftWidth =20

Lot-->
	shapeL(10,20) { shape :A | remainder: B. }
A-->
	extrude(20)
	color("#ff0000")




shapeU
设置frontWidth =10,rightWidth =5,leftWidth =20

Lot-->
	shapeU(10,5,20) { shape : A | remainder: B. }
A-->
	extrude(20)
	color("#ff0000")


shapeU
设置frontWidth =10,rightWidth =5,backWidth =1,leftWidth =20

Lot-->
	shapeU(10,5,1,20) { shape : A | remainder: B. }
A-->
	extrude(20)
	color("#ff0000")



  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值