几何标注 Geometry Tagging · 3 个函数
为几何面打标签 / 删标签,供后续规则按标签筛选
tag(name, components)
| 参数 | 类型 | 说明 |
|---|---|---|
| name | string | A string that defines the tag. |
| components | selector |
The tag operation assigns the specified name as a tag to all components. Any valid string is supported as name, except reserved wildcards characters (?, *), which are filtered out. Tags can be hierarchically grouped using the name separator "."
For examples using tags refer to Boolean 3D and Rule inlining.
我方已验证示例:learning case #93(verified_silver)· 点击展开代码 · 示例过大,请复制源码到 demo 运行
extension CurbWall --> CurbWall. extension Surface --> Surface. @Hidden attr shapeType = "" @Hidden attr sidewalkSide = "" @Hidden import Lane_Queries : "Streets/Imports/Lane_Queries.cga" @Hidden import Street_Materials : "Streets/Imports/Elements/Street_Materials.cga" @Order(1) @Range(min=0.0, max=0.5, stepsize=0.01, restricted=false) attr Height = defaultHeight @Order(2) @Range(min=0.0, max=1.0, stepsize=0.01, restricted=false) attr Width = defaultWidth @Order(3) @Enum(valuesAttr=curbSi…
deleteTags(tagQuery)
deleteTags(tagQuery, components)
| 参数 | 类型 | 说明 |
|---|---|---|
| tagQuery | string | The query defining which tags to delete. See also Geometry Tagging: Essential Knowledge |
| components | selector |
The deleteTags operation deletes tags from the geometry. If a tagQuery is provided, only matching tags are deleted. If components are specified, only their tags are deleted.
我方已验证示例:learning case #14(verified_silver)· 点击展开代码 · 示例过大,请复制源码到 demo 运行
##############################################
# Extensions
#
@Order(1)
@Description("Highest horizontal 2D shape on the top of the mass.")
extension Rooftop(ParapetHeight, FloorCount) --> color(0.55,0.65,0.55) Rooftop.
@Order(2)
@Description("Horizontal 2D shapes without any floorplates directly above (but not the roof).")
extension Terrace(FloorHeight, FloorLevel) --> color(0.5,0.7,0.5) Terrace.
@Order(3)
@Description("Horizontal 2D shapes on the actual floor level.")
extension Floorplat…
The setTagsFromEdgeAttrs operation converts string edge attributes stored on the initial shape to edge tags stored on the current shape's geometry. It samples one element from each string attribute array for each face edge of the current geometry and stores them as tags on that edge.
The edge attribute /edgeattr/ attributeName creates tags of the form "edgeattr.attributeName.sampledValue".
官方示例(共 4 个,展示前 3 个) · 点击展开
Visualizer -->
comp(e) { isTagged("edgeattr.orientations.front")
: GreenEdge
| isTagged("edgeattr.orientations.side")
: BlueEdge }
Lot --> setTagsFromEdgeAttrs()
VisualizerLot --> s(10,0,10)
primitiveDisk(12)
setTagsFromEdgeAttrs()
VisualizerLot --> setTagsFromEdgeAttrs()
setback(8) { isTagged("edgeattr.orientations.front")
: Visualizer }我方已验证示例:learning case #224(verified_silver)· 点击展开代码 · 在 demo 中运行 →
/* Misc functions: convert, getTreeKey, getGeoCoord, getMaterial, print, report, label, tag, deleteTags, setTagsFromEdgeAttrs, set, NIL, insert, insertAlongUV */
Lot -->
extrude(10)
print(convert("position", "scope", "world", "x", 0, 0, 0))
print(getTreeKey())
print(getGeoCoord("lon"))
print(getMaterial("shape", "all"))
print("Hello CGA")
report("height", 10)
label("building")
tag("facade")
deleteTags("temp")
setTagsFromEdgeAttrs()
set(material.color.r, 1)
print("Done")…