split operation


 

分割操作

split operation?分割操作

概要

? ? ? ? ? XYZ Split (Cartesian Space) ?// 按XYZ空间轴分割(笛卡尔空间)

类型:

split(splitAxis) { size1 : operations1 | size2 : operations2 | … | sizen-1 : operationsn-1 }

split(splitAxis) { size1 : operations1 | size2 : operations2 | … | sizen-1 : operationsn-1 }*

split(splitAxis, adjustSelector) { size1 : operations1 | … | sizen-1 : operationsn-1 }

split(splitAxis, adjustSelector) { size1 : operations1 | … | sizen-1 : operationsn-1 }*

? ? ? ? ?UV Split (Texture Space贴图空间)UV分割

split(splitDirection, surfaceParameterization, uvSet) { size1 : operations1 | … | sizen-1 :operationsn-1 }*

拆分(分割方向,曲面参数,uvSet){尺寸1:operations1| …|尺寸N-1:操作-1}*

参数

splitAxis (selstring):

有X,Y,Z,splitAxis表示沿哪个轴切割,XYZ轴系为模型轴系。

adjustSelector:

有两个取值:adjust和noAdjust,默认为adjust,adjust表示切割出来的新几何体自动调整scope范围(几何体外接最小长方体)为新几何体的scope,noAdjust表示新几何体的scope保持为切割前的scope。

符号的解释:

size (float):切割的宽度,根据前缀的不同具有不同的含义,沿轴的宽度有以下不同的解释

 

1.没有前缀,size代表绝对宽度,优先级高

2.带有前缀“ ‘ ”,相对值,值在 0 到 1 之间,取整体宽度的百分比,优先级高。

3.带有前缀“~”,取近似值,根据前缀后的值,在带有相同前缀的值间进行比较。Size 值的大小本身没有绝对意义,取同类型比较的百分比。这种类型的宽度总值取前两种类型分割后的剩余值。优先级低

4.“*” 循环重复{ }中的分割内容

5.“:” 解释 相当于等于。

6.“|”分割 ,划分。

注意

相同优先级,在前面的优先程度高。先满足优先级程度高的需求。

如果仅有带前缀~的,那么后面的值按照真实值进行计算,如果整个要分割的长度还有剩余,那么均分到每一个小块。

 

Parameters

XYZ Split (Cartesian Space)
  • splitAxis (selstring)分割轴(按选择的轴向)
    (x | y | z) – Name of axis to split along. This is relative to the local coordinate system (i.e. the scope).
  • 按轴的方向分割。这是相对于所述局部坐标系(I.S.范围)
  • adjustSelector 旋转调整
    (adjust | noAdjust ) – optional selector to control scope calculation of the calculated shapes: the default is to adjust the scope to the geometry’s bounding box; noAdjust avoids this, therefore the scopes of the resulting shapes fill the parent’s scope without gaps.
  • (调整| noAdjust) – 可选的选择来控制计算的形状的范围计算:默认是调整范围,几何图形的边框; noAdjust避免了这种,因此所产生的形状的范围填写父类的范围无间隙。
UV Split (Texture Space)
    • splitDirection (selstring)分割轴(按选择的轴向)
      (u | v ) – Name of axis to split along.
    • surfaceParameterization (selstring)
      (uvSpace | unitSpace) – uvSpace is the planar texture space, defined by the uv coordinates;unitSpace is the 2d space on the 3d geometry surface, measured in units (e.g. meters).
    • 分割轴(按选择的轴向)
      (U | V) – 轴的名称分裂一起。
      surfaceParameterization(selstring)

      (uvSpace| unitSpace) - uvSpace是平面结构的空间,由紫外线所定义坐标; unitSpace是三维几何表面上的二维空间,在单元(例如米)进行测定。

? ? ? ? ? ? ? ? ? ? ?uvSet(float)

    ? ? ? ? ? Number of texture a set/layer (integer number in [0,5]). The numbering corresponds to the texture layers of the material attribute.
    ? ? ? ? ? ?UV集(浮点)的纹理数集/层(整数[0,5])。编号对应于材料属性的纹理层。

See Texturing for information about the texture layer IDs.见纹理有关纹理层ID的信息。

General
  • size (float)
    Split width. Depending on the prefix, the widths along axis are interpreted in the following way:
no prefix (absolute)
the new shape will have exactly size size.
‘ (relative)
the new shape’s size will be size * current scope size.
~ (floating)
with the ~ prefix, the remaining spaces between the split parts with absolute dimensions are automatically adapted. If multiple floating parts are defined within a split, the dimensions are weighed proportionally.
  • operations
    A sequence of shape operations to execute on the newly created shape.
  • *
    Repeat switch: the repeat switch triggers the repetition of the defined split into the current shape’sscope, as many times as possible. The number of repetitions and floating dimensions are adapted to the best solution (best number of repetitions and least stretching).

一般

大小(浮点)
拆分宽度。根据不同的前缀,沿轴线的宽度的解释在下面的方式:
没有前缀(绝对)
新的形状将会有确切的尺寸大小。
‘(相对)
新形状的大小将是尺寸*电流范围的大小。
?(浮动)
同?前缀,以绝对尺寸分割部分之间的剩余空间被自动调整。如果多个浮动部件分裂中定义,其尺寸按比例称重。
操作
形状运算的顺序来执行对新创建的形状。
*
重复开关:重复开关触发定义分裂到当前shape’sscope的重复,多次可能。重复和浮动维度的数量适于最佳的解决方案(重复最佳数目和至少拉伸)。

 

XYZ Split (Cartesian Space)

The split operation subdivides the current shape along the specified scope axis into a set of smaller shapes. For each sizeoperation block inside the curly brackets, a new shape is pushed onto the shape stack, a number of shape operations is executed and the shape on top of the shape stack is popped again.

If the optional repeat switch * is appended to the split operation, the content of {…} is repeated as often as it fully fits into the scope‘s dimension along the selected axis.

The geometry of the current shape is cut with a plane perpendicular to the split axis at every intersection between two blocks (i.e. at size1, size2, … sizen-1). Hollow meshes are closed after the cut, i.e. cutting planes introduce new surfaces to preserve the volume.

Splits can be nested, i.e. a size : operation block can be replaced by a {…} block. In theory, the nested level is unlimited.

UV Split (Texture Space)

Splits can also be applied in the 2d uv texture domain. Texture coordinates define a 2d parameter space on a 3d surface. Examples of such parameterizations are streets (u along thew street direction, v along the width) and facades (generated with setupProjection() and projectUV(), u along the width and v along the height). This permits to operate directly on the surface. In general, uv coordinates are in the [0,1] range and not connected to a unit like meters or yards on the surface (defined by the underlying mesh). Setting the splitDirection parameter to unitSpace permits to operate directly on the surface, i.e. work in units (e.g. meters or yards). Depending on the geometry and type of parameterization there is some inherent distortion in this conversion.
Borders (start, end) of the uv split are defined by the minimal and maximal values found in the selected uv coordinates. The genral syntax of the split is the same as in the carthesian case described above, i.e. relative and floating operators (‘ and ~) can be used as well as the repeat operator (*). Please check out the examples below.

XYZ斯普利特(笛卡尔坐标系)

拆分操作细分沿指定范围轴当前形状为一组小的形状。对大括号内的各大小动作块,一个新的形状被压入形状堆栈,执行数形状的操作和对形状堆栈的顶部的形状再次弹出。
如果可选重复开关*追加到拆分操作,内容{…}作为经常因为它完全适合沿选定的轴范围的尺寸重复。
当前形状的几何形状切割的平面垂直于分割轴线在两个块之间的每个交叉点(即,在尺寸1,size2个,…尺寸N-1)。镂空网格将切后关闭,即切割平面引入新的表面保持音量。
拆分可以嵌套,即大小:操作块可以通过{…}块来代替。在理论上,嵌套级别是无限的。

UV斯普利特(纹理空间)

拆分也可以在二维UV纹理域施加。纹理坐标定义的3D表面二维参数空间。这样的参数化的例子是街道(U沿thew街方向,V沿宽度)及外墙(与setupProjection产生的()和projectUV(),U沿宽度和v沿高度)。这允许直接在表面上进行操作。在一般情况下,紫外坐标是在[0,1]范围并没有连接到像面(由基础网格定义)上米或码的单元。设置splitDirection参数unitSpace允许直接从表面上看,即在单位工作(例如米或码)上进行操作。取决于几何形状和参数的类型有在此转化一些固有的失真。
紫外分割的边界(开始,结束)由在所选择的UV坐标中找到的最小值和最大值限定。分割的GENRAL语法一样在上述carthesian情况下,即相对的和漂浮的运营商(’和?)可以用作以及重复操作者(*)。请看看下面的例子。

 

案例

建立

This is the initial shape before the split. We will present a number of split examples along the x axis,

the current shape’s scope.sx is 10.
Below are the rules used to color and size the shapes created in the split:

X(h)-->
	s('1,'h,'1)
	color("#0000ff")
	
Y(h)-->
	s('1,'h,'1)
	color("#ffff00")
	
Z(h)-->
	s('1,'h,'1)
	color("#00ff00")

Relative Sizes相对大小

A-->
   split(x){ '0.5 : Z |
             '0.1 : Y(2) | 
             '0.2 : X(1) }


This example shows the usage of the relative prefix.

The green Z shape takes half of the initial shape’s size (5 units) and so on.

The total sum of all shape sizes in x-direction is 8, therefore the gap at the end.

Floating Sizes only: Ratios只有浮动尺寸:比率

A-->
   split(x){ ~0.5 : Z |
             ~0.1 : Y(2) | 
             ~0.2 : X(1) }


The same example as above, but all sizes with the floating prefix.

Note how the whole initial scope is filled (no gap at the end), and the ratios are kept.

Absolute and Floating Sizes绝对和浮动尺寸

A-->
   split(x){ 3.3 : Z(1) |
            ~3   : Y(2) | 
             5   : X(1) }			  


Here, a floating sized shape is framed between two absolute sized shapes.

Its size is adjusted from 3 to 1.7 to fulfill the absolute constraints.

Oversized过大的

A-->
   split(x){ '0.5 : Z(1) |
             '0.6 : Y(2) | 
                3 : X(1) }


The first shape Z (green) fits in, but the second one Y (yellow) is cut at size 5.

The X never gets created because there is no space left.

Repeat Split with Absolute Sizes用绝对尺寸重复拆分

A--> 
   split(x){ 2 : X(2) | 
             1 : Y(1) }*


A repeat split example. All sizes are absolute. The XY pattern is repeated 3 times,

and the remaining unit is filled with half a X, i.e. the geometry of the last X is cut off.

Repeat Split with Floating Sizes用绝对尺寸重复拆分

A--> 
   split(x){ ~2 : X(2) | 
             ~1 : Y(1) }*


If floating sizes are used in the repeat split, no shape is cut but the sizes are adjusted such that

the ratio between the elements is kept and the whole scope can be filled.

Interleaved Repeat Split交叉重复拆分

A-->
   split(x){ 1 : X(3) | 
                 {  ~1 : Y(2) | 
                   0.2 : Z(1) | 
                    ~1 : Y(2) }* | 
             1 : X(3) }


A interleaved split consisting of two absolute-sized shapes at both ends and a repeat split in-between.

Note: the green shapes Z have absolute sizes, while the yellow Y shapes have floating sizes which turn out to be 0.9.

Rhythm韵律

A-->
   split(x){ {  1 : X(3) | 
               ~3 : Y(1) }* |
                1 : X(3) }


Here it is demonstrated how a pattern ABABABA etc.

can be achieved. Note the floating size of the yellow Y shapes.

Cutting Geometry切削几何参数

A-->
   i("cylinder.hor.obj")
   t(0,'0.5,0)	


Here it is demonstrated how a the geometry of the current shape is cut into a number of smaller shapes.

A cylinder model is inserted into the current shape.

A-->
   i("cylinder.hor.obj")
   t(0,'0.5,0)
   split(x) { { ~0.75 : XX | ~1 : NIL }*  | ~0.5 : XX }
	


Splitting the shape and using NIL in the split rule results in holes.

Note how the cut surfaces are closed.

UV Split Basics ? ? ? UV基本分割

Init-->
	extrude(scope.sx * 0.5)
	comp(f) { front : Facade }
	
Facade-->
	setupProjection(0, scope.xy, '1, '1)
	projectUV(0)
	texture("builtin:uvtest.png")
	split(u, uvSpace, 0) { 0.5 : X }* 


u split in uvSpace – the split happens at u = 0.5, independent of facade size.

Init-->
	extrude(scope.sx * 0.5)
	comp(f) { front : Facade }
	
Facade-->
	setupProjection(0, scope.xy, '1, '1)
	projectUV(0)
	texture("builtin:uvtest.png")
	split(u, unitSpace, 0) { 5 : X }* 


u split in unitSpace – the splits happen at u = 5, dependent of facade size.

UV Split on StreetsUV拆分街道上

Street-->
texture("builtin:uvtest.png")

 

The test texture on a street with two segments.

The street’s texture coordinates are automatically generated;

note that the two street segments have different

lenghts but are both covered by a [0,1] uv space,

the u axis following the street direction and the v axis,

perpendicular to u, along the width.

Street-->
split(u, unitSpace, 0) 
     { ~10 : NIL 
      | ~3 : color("#ff0000") X  
      |~10 : NIL}*

 

The same street after a u-split in unitSpace.

Every 20 meters a 3 meter wide band is drawn accross the street.

 

 


 

 

innerRect


官方英文链接

 

概念

innerRect()

The innerRect operation finds for each face of the current shape’s geometry the largest rectangle with sides parallel to the scope’s x- and y-axes which is fully inside the face.

不规则多面形的最大内接矩形

参数

()可以没有

案例

Inner Rectangles of Lot Shapes

innerRect01
Lot-->
 innerRect
 color(1,0,0,0.5)
 extrude(20)

This example shows how to use innerRect() to place mass volumes in lots.

在不规则多边形内形成最大的内接矩形的方法。


 

 

eyearth保留所有文章所有权

roofShed


官方英文链接

 

名称

roofShed

Synopsis概要(类型)

roofShed(angle)

roofShed(angle, index)

参数

  • angle (float)
    Angle of the roof plane.
  • index (float)
    Edge index (thus integral value) to specify the orientation of the shed roof.

角度(浮点型)
屋顶平面的夹角。
指数(浮点型)
边缘指标(因而积分值)来指定棚屋顶的方位。

案例

Simple Shed Roof简易的工棚屋顶

A basic shed roof is generated on top of an extruded L-lot.一个基本的棚顶上挤压成L型顶部产生。

roofShed02

Lot --> extrude(10) 
   building
building --> comp(f) { top: Top | all: X }
Top --> roofShed(10, 3) 

 
X-->color(0,1,0,0.5)

A shed roof with roof slope 10 degrees is built on top of an extruded L-lot. The edge index is set to 3. Note the roof orientation and the setting of the pivot and scope.

与屋面坡度10度的坡屋顶是建立在挤压L-大量的顶部。边缘索引被设置为3。注意屋顶方向和枢轴和范围的设置。

roofShed01

Lot --> extrude(10) 
 building
building --> comp(f) { top: Top | all: X }
Top --> roofShed(10, 3) 
 Roof
Roof-->
 comp(f) { side : sideface | top : topface}
sideface--> 
 color(1,0,0,0.5)
topface-->
 color(0,0,1,0.5)
 
X-->color(0,1,0,0.5)

Roof分为两部分:sideface 和topface

 

eyearth保留所有文章所有权


 

roofPyramid


 

官方英文链接

 

名称

roofPyramid(angle) 参数值为角度

参数

角(浮点型)
屋顶平面的角度。

  • angle (float)
    Angle of the roof-planes.

范围

The scope orientation is set in the following way:

  • x-axis direction is kept as much as possible (old x-axis is projected to plane orthogonal to face normal of the first face)
  • y-axis along the face normal of the first face
  • z-axis normal to the two above

The scope’s sizes are adjusted to tighly fit the extruded geometry.

范围方向设置以下列方式:
x轴方向被保持尽可能(旧x轴被投影到平面正交面对正常所述第一面的)
沿面y轴正常的第一面的
z轴垂直于上述两个
范围的大小调整,以适应tighly挤压几何。

 

案例

Simple Pyramid Roof?简单的金字塔顶

A basic pyramid roof is generated on top of an extruded L-lot.?一个基本的金字塔屋顶上挤压L-很多顶部产生。

roofPyramid01

Lot --> extrude(10) 
        building
building --> comp(f) { top: Top | all: X }

Top --> roofPyramid(byAngle, 30)
        Roof

A pyramid roof with roof slope 30 degrees is built on top of an extruded L-lot. Note the setting of the pivot and scope.

与屋面坡度30度的金字塔屋顶,是建立在挤压形成L的夹角。注意枢轴和范围的设置。

Roof --> comp(f) { all : X }

After a component split, each roof face contains trim planes to cut bricks on insertion.

组件拆分后,每个顶面包含面的部分削减插入部件。

 


 

roofHip

 


官方英文链接

名称

roofHip

参数

  • (float) 浮点型
    Angle of the roof-planes. 屋顶的角度
  • overhang (float) 屋檐延伸出来的距离
    Overhang distance, measured perpendicular to the shape edges (on the roof).
  • even (bool) 布尔类型
    Whether to make the ridges even or not. If true, non-planar faces originate.
  • 如果是false 屋脊与形成的屋面是贴合的,如果为true的时候为非平面产生。

scope范围

范围方向设置以下列方式:
x轴方向被保持尽可能(旧x轴被投影到平面正交面对正常所述第一面的)
沿面y轴正常的第一面的
z轴垂直于上述两个
范围的大小调整,以适应tighly挤压几何。

 

The scope orientation is set in the following way:

  • x-axis direction is kept as much as possible (old x-axis is projected to plane orthogonal to face normal of the first face)
  • y-axis along the face normal of the first face
  • z-axis normal to the two above

The scope’s sizes are adjusted to tighly fit the extruded geometry.

案例

Simple Hip Roof

A basic hip roof is generated on top of an extruded L-lot.

roofHip01

Lot --> extrude(10) 
 building
building --> 
 comp(f) { top: Top | all: X }
Top --> roofHip(35, 2) 
 Roof

A hip roof with roof slope 30 degrees is built on top of an extruded L-lot. The overhang distance is set to 2. Note the setting of the pivot and scope.

roofHip02

Roof --> //set(trim.horizontal, false)

 comp(f) { side : sideroofacade }
 
sideroofacade-->
 extrude(y,0.45)
 color(0,1,1,0.5)

组件拆分后,每个顶面可以插入替代。

需要注意的是每默认情况下有在山脊没有水平拆分。要启用它们,设置(trim.horizontal,true真)在组件拆分前使用。

Note that there is exactly one roof face perTop shape edge. Unfortunately in the images it seems like the overlap is in a separate face. However, the simple reason for this is that the edges of the shapes in behind bleed through.

需要注意的是,正是有一个屋檐脸造型perTop边缘。不幸的是在图像好像该重叠是在一个单独的面。然而,简单的原因是,该形状在后面的边缘渗出通过。

Even Hip Roof

This example demonstrates the difference between a standard and an even hip roof built on a trapezoid-lot.

?roofHip03

Lot  --> 
extrude(10) 
Mass
Mass --> comp(f) { top: Top | all: X }

Top  --> roofHip(45, 1, false)

 Roof

A hip roof with roof slope 45 degrees is built on top of an extruded trapezoid-lot. The overhang is set to 1. Note that the ridge is uneven.

roofHip04

Top  --> 
roofHip(45, 1, true)

 Roof

When using the above rule for theTop shape, the ridge vertices are set to the average height, making the hip roof even.

The roof faces are non-planar now.

 

eyearth保留所有文章所有权

i (insert)


官方英文链接

Rule package 购买
  Rule Packages.png

 

概要

i(geometryPath几何路径)

功能

用已有的模型或模型部件替换当前的模型

Parameters(参数)

  • geometryPath (string)
    Name of the geometry asset to insert. See Asset Search for information about search locations andBuilt-in Assets for a list of built-in assets.
  • 几何路径(字符串)
    几何文件的名称插入。在几何文件搜索关于文件的位置和内置的文件项目列表的信息。

Supported Asset Formats(支持的资源格式)

  • 目前,OBJ和COLLADA DAE作为文件支持的格式。
  • 该OBJ格式描述文件(.mtl),也明白负指数(从当前位置向后引用)。它会自动删除不支持的几何/材料的标签和也将删除法线或不一致的网格纹理坐标。
  • 该COLLADA读者进口无限场景图,还读转型的节点。额外的代码会被忽略,它也将删除法线和不一致的网格纹理坐标。
  • 备注:
  • 这两种格式都支持每目和每面材料的任务。
    网格一致性要求:网格的所有面必须有顶点,纹理坐标和顶点的法线相同的使用。如果一个面不使用质地coordantes而其他面做的,所有的纹理坐标从这个网状下降。其它网格不会被修改。
    模型输出相关性:这是多次使用和CGA模型生成过程中不修改几何性质或材料文件可以导出为实例(见网粒度导出设置)。

 

实战案例

Window insertion

?微信截图_20160524163048

微信截图_20160524163017

#i函数的实战用法

Lot-->
   extrude(height)
   comp(f){side : Facade  |
           top :  toproof }	
	
Facade-->
   split(y) { { ~1 : tin | 
                ~4 : Floor }* |
              ~1 : tin }
			   
Floor-->
   split(x) { { ~1 : tin |
                ~5 : Window }* |
              ~1 : tin } 
   
//Window-->
  // i("windows/windowone.obj")

tin-->
   color(1,0,1,0.5)

上述规则产上下的细分质量模型。上图是为使用“i”函数的效果

Window-->
	i("window.obj")

 

 

Insertion and Zero Scope Dimensions

car01

Car–>
s(0,0,0)
i(“car/car.obj”)
导入一个保持原来大小模型的方法。

car01 Lot–>
s(0,0,0)
i(“car/car.obj”)
这里的Lot跟Car的概念一样,所以效果一样。

car02

需要注意的是“s”的用法。

Car–>
s(1,1,1)
i(“car/car.obj”)

模型的长宽高分别是:1,1,1。

单位是米。

car03

Car–>
s(‘1,’1,’1)
i(“car/car.obj”)

模型的大小保持与Lot1:1:1的关系。

Trim Planes and Insertion

Insert a
Lot-->
	i("builtin:cube")
	s(10,40,10)
	t(-5, 0, -5)
	comp(f) { side: Side }
	
Side-->
	t(0,0,-5)
	s('1,'1,10)			 
	i("cylinder.vert.obj") 

The cylinder model, shown on the left, is inserted at the four side-faces of a cube.

圆筒模型,在左边示出,被插入在一个立方体的四个侧面。

Insert a The inserted cylinders are cut with the trim planes generated by the component split.
In the picture on the left, the geometry of one Side shape (i.e. the cut cylinder) and its trim planes are highlighted.
On the right is the smae scene from top view (top), and a close-up of the upper area (bottom).
插入缸切断与由组件分裂产生的修整面。
在左侧的图像,一面形(即,切割缸)和它的装饰面的几何形状被突出显示。
在右边是从俯视图(顶)的SMAE景点和上部区域(底部)的特写。
Insert a
Lot-->
	i("builtin:cube")
	s(10,40,10)
	t(-5, 0, -5)
	comp(f) { side: Side }
	
Side-->
	t(0,0,-5)
	s('1,'1,10)			 
	set(trim.vertical, false)
	i("cylinder.vert.obj") 

Note how disabling the trim planes just before the insert operation changes the resulting geometry.

注意,如何禁用装饰面插入操作的变化所产生的几何之前。


eyearth保留所有文章所有权


 

CityEngine(2010-2016)软件下载


CityEngine2016软件下载

链接:http://pan.baidu.com/s/1nu5MXh3 密码:6jns


功能介绍
CityEngine与Arcgis10.2共存破解版
CityEngine_2015

包含两个版本

CityEngine_2015_2_147974

CityEngine_2015_0_1453264

CityEngine_2014_0_140864
CityEngine_2013_1_136371
CityEngine_2012_1_64bit
Esri CityEngine Advanced 2011.2
cityengine2010

包含32位与64位