帖子
|
primitiveCube
s(10,5,5)
color("#ff0000")
CheckPortaloTuris
CheckPortaloTuris -->
case overlaps():
NIL
else:
KeepBuilding
It's also possible to use labels. For example, if you want to only check if they occlude with the white buildings (and it doesn't matter if they occlude with other red buildings), then use a label in the occlusion query, and put a rule onto the white buildings which assigns the label.
-->
是的,可以通过遮挡查询来做到这一点。在PortaloTuris中创建红色建筑后,检查它们是否与其他任何东西重叠。PortaloTuris——> primitiveCube s(10,5,5) color("#ff0000") CheckPortaloTuris CheckPortaloTuris——> case overlaps(): NIL else: KeepBuilding也可以使用标签。例如,如果你只想检查它们是否与白色建筑遮挡(如果它们与其他红色建筑遮挡并不重要),那么在遮挡查询中使用一个标签,并在白色建筑上放置一个分配标签的规则。const occluderLabel = "WhiteBuilding" CheckPortaloTuris——> case overlaps(inter, occluderLabel): NIL else: KeepBuilding //将此规则分配给白色建筑WhiteBuilding——> label(occluderLabel)
...查看更多
|
0
|
0
|
2
|
帖子
|
BlockCenter
SubdivideIntoLots
BlockCenter
with(
centroidInScope := convert(world, scope, pos, centroidInWorld)
) -->
primitiveCube
s(cubeWidth, cubeWidth, cubeWidth)
t(centroidInScope[0]-0.5*cubeWidth, centroidInScope[1]-0.5*cubeWidth, centroidInScope[2]-0.5*cubeWidth)
label(blockCentroidLabel)
NIL
SubdivideIntoLots -->
splitAndSetbackPerimeter(0) { splitDist: splitDist: Lot }*
{ remainder: SubdivideIntoLots }
Lot
with(
distToCentroid := minimumDistance(intra, blockCentroidLabel)
) -->
case distToCentroid < tallBuildingThres:
TallBuilding
else:
House -->
我假设您正在使用动态形状,即CityEngine在街道网络中自动创建的街区和地段。我猜你想让CityEngine自动把街区划分成地段。在这种情况下,不幸的是,我无法在cga中为每个Lot想出一种方法来知道它所属的块的质心或任何信息。我能想到的唯一方法是从动态创建的块开始,不要自动细分它们(选择块,在检查器中设置细分类型=“No Subdivision”),并在你的cga规则中细分它们。下面是一些代码,用于计算块的质心,在质心处放置一个看不见的立方体,并将块细分为多个块。每个批次都在质心处查询其到不可见立方体的minimumDistance。如果你不需要精确的质心,那么跳过质心计算,而是将不可见的立方体置于块的作用域的中心会更简单。您可以用您喜欢的任何算法替换SubdivideIntoLots规则。我知道这并不理想,但也许这能给你一些如何进行的想法。const numBlockVertices = geometry。nVertices const sumOfBlockVertices = [ sum(comp(v) { all: convert(x, scope, world, pos, 0, 0, 0) }), sum(comp(v) { all: convert(y, scope, world, pos, 0, 0, 0) }), sum(comp(v) { all: convert(z, scope, world, pos, 0, 0, 0) }) ] const centroidInWorld = sumOfBlockVertices./numBlockVertices const cubeWidth = 1 const blockCentroidLabel = "BlockCentroid" const splitDist = 30 const tallBuildingThres = 10 Block --> BlockCenter SubdivideIntoLots BlockCenter with( centroidInScope := convert(world, scope, pos, centroidInWorld) ) --> primitiveCube s(cubeWidth, cubeWidth, cubeWidth) t(centroidInScope[0]-0.5*cubeWidth, centroidInScope[1]-0.5*cubeWidth, centroidInScope[2]-0.5*cubeWidth) label(blockCentroidLabel) NIL SubdivideIntoLots --> splitAndSetbackPerimeter(0) { splitDist: splitDist: Lot }* { remainder: SubdivideIntoLots } Lot with( distToCentroid := minimumDistance(intra, blockCentroidLabel) ) --> case distToCentroid < tallBuildingThres: TallBuilding else: House
...查看更多
|
1
|
1
|
26
|
帖子
|
将范围与世界对齐。你的解决方案是在facade被分割之前在facade上执行setupProjection,这是实现它的方法。如果你在setupProjection之前使用alignScopeToAxes(y)将范围对齐到世界y轴,那么无论建筑是否在山上,纹理都不应该倾斜。在上面的示例截图中,山坡上建筑的倾斜纹理是因为瞄准镜的x轴对准了立面的边缘,这遵循了上坡地形。将瞄准镜对准世界y轴可以使瞄准镜垂直伸直。alignScopeToAxes(y) setupProjection(0,范围。xy, 1,1)世界发生了什么。为什么你可能会看到扭曲的纹理与setupProjection(0,世界。xy, 1,1)是因为它将uv投影到世界上。Xy平面,你的建筑立面可能不会与world.xy完全对齐。这意味着当你要纹理的表面与世界完美对齐时,纹理看起来不会扭曲。xy平面。你旋转的建筑越多(围绕y轴),纹理看起来就会被拉伸得越多,直到你达到90度的旋转,此时立面与xz平面对齐,纹理被最大限度地拉伸。 Since buildings usually don't align exactly to world.xy, I would not recommend setting up the projection according to world.xy.
...查看更多
|
1
|
1
|
16
|
的想法
|
这不是您所要求的,但resetGeometry在某些(可能不是所有)情况下可能会有所帮助(尽管它可能很乏味)。https://doc.arcgis.com/en/cityengine/latest/cga/cga-reset-geometry-operation.htm
...查看更多
|
0
|
0
|
77
|
帖子
|
乔纳斯说的没错。还有另一种不使用python的方式来使用csv文件。您可以将属性设置存储在csv文件中。然后,在cga代码中,您可以使用readStringTable()读取csv文件,并根据csv文件中的内容设置规则属性。
...查看更多
10-04-202204:29我
|
0
|
0
|
49
|
的想法
|
有趣的想法。您是否有一个特定的用例?
...查看更多
10-03-2022上午07:22
|
0
|
0
|
138
|
帖子
|
extrude(eave_height) Mass.
comp(f) { top: HangarRoof }
HangarRoof -->
alignScopeToGeometry(zUp, any, longest)
rotateScope(0, 0, 90)
primitiveCylinder(2*num_hangar_divisions)
s('1, '1, 2*roof_height)
t(0, 0, '-0.5)
split(z) { ~1: NIL | ~1: HangarRoof. }
-->
下面是一些代码,执行您建议的操作(旋转和分割圆柱体)。它假设建筑面积是矩形的。@Order(1) @Range(min=0, max=20) attr eave_height = 10 @Order(2) @Range(min=0, max=20) attr roof_height = 5 @Order(3) @Range(min=3, max=32, stepsize=1) attr num_hangar_division = 8 Lot—>挤出(eave_height)质量。comp(f) {top: HangarRoof} HangarRoof——> alignscopegeoometry (zUp, any, longest) rotateScope(0,0,90) primitivec柱体(2*num_hangar_division) s(' 1,2 *屋顶高度)t(0,0, '-0.5) split(z) {~1: NIL | ~1: HangarRoof。}
...查看更多
10-03-202206:59我
|
1
|
0
|
78
|
帖子
|
对于cga工作来说,下划线是不必要的。函数也可以命名为getInitialRightLanes,代码的工作方式完全相同。有时程序员会采用一种惯例,这种惯例可能是许多人遵循的,也可能是只有一个程序员遵循的更独特的惯例。这取决于作者。通常,我会说,在ESRI。Lib中,在名称前加上下划线_意味着该函数或变量被设计为私有的,或者换句话说,仅在该CGA文件中创建用于内部使用。但是,这并不意味着导入文件不能访问它;在cga中访问不受限制。这是因为cga没有私有函数或变量的概念。最后,在cga中,它只是一个名称,就像任何其他名称一样,无论它是否以下划线开头。
...查看更多
07-27-2021上午09:47
|
0
|
1
|
1046
|
帖子
|
对不起,我不明白你的意思。可以为窗口宽度、高度和深度设置单独的属性,更改其中一个属性不会影响其他属性。attr window_width = 1 attr window_height = 2 attr window_depth = 0.5但是,我不认为这回答了你的问题。我不明白你想要什么属性和你想要什么行为(即你想在每个属性的下拉框中出现什么)。
...查看更多
07-27-2021上午09:30
|
0
|
3.
|
2064
|
帖子
|
1)投影setupProjection()和projectUV()是必须的,以便将uv分配给几何。如果没有uv,纹理将无法显示。可以插入已经分配了uv的资产。primitiveX()操作(例如:primitiveCube, primitiveSphere等)插入自动分配uv的原语。如果uv已经存在,则不需要setupProjection()和projectUV()。对于所支持的不同映射,存在不同的UV集。虽然您可能希望为每个映射使用不同的uv(在这种情况下,您需要分别设置它们),但也可能希望为每个其他映射使用用于颜色映射的相同uv。在这种情况下,您只需要确保颜色映射的UV集0存在,而不需要为其他映射设置UV,因为如果它们不存在,它们将默认使用UV集0。https://doc.arcgis.com/en/cityengine/latest/cga/cga-texturing-essential-knowledge.htm 2)纹理包装是的,这是真的,确保uv是正确的3D模型的所有面可能是乏味的。正如你提到的,顶部和底部可能会有不希望出现的纹理结果,如果uv被设置到侧面(例如立面),就会发生这种情况。 One way to avoid that textures are smeared across the top face is to comp(f) every face separately (with the : operator, not the = operator) and apply a setupProjection in scope.xy to each face (or at least to each group of faces that are oriented the same way). This is still a tedious process though, and it might yield disconnected textures between faces, which could also be undesirable. At the moment, I don't think there is a better solution. 3) Mapping PBR maps to material map attributes The doc has a table which maps CE material attributes to PBR terms as they are used in the GLTF material specification (see section "PBR material attributes"). https://doc.arcgis.com/en/cityengine/latest/cga/cga-material-attribute.htm This doc page also lists which material attributes are used when the PBR shader is used (material.shader=CityEnginePBRShader). Yes, you are correct that bumpmap, dirtmap, and specularmap are ignored when the PBR shader is used. As for displacement maps, I wouldn't consider this a PBR material map. Anyway, we don't have them in CE. We only support normal maps and bump maps. Specularity is covered by the PBR metallic and roughness properties. 4) Texturing flow Yes, it is possible to store material information in a csv file and read the csv file in cga using readStringTable(). https://doc.arcgis.com/en/cityengine/latest/cga/cga-read-table-functions.htm In CityEngine 2021.0, the setMaterial() operation can be used to set material attributes that are stored in an array. getMaterial() also exists. I do realize that this doesn't solve all ease-of-workflow problems though. https://doc.arcgis.com/en/cityengine/latest/cga/cga-set-material.htm
...查看更多
07-27-202108:48我
|
0
|
0
|
670
|
标题 | 荣誉 | 发布 |
---|---|---|
1 | 一周前 | |
1 | 一周前 | |
1 | 10-03-202206:59我 | |
1 | 11-13-201705:08我 | |
1 | 05-27-2021上午10:56 |
在线状态 |
离线
|
最后到访日期 |
一周前
|