241
总函数
172
已完成
19
部分完成
9
未完成
🧊 几何创建 Geometry Creation
创建基本几何体替代当前形状,常用于规则的起始或分支。
| 函数/操作 | 签名 | 状态 |
|---|---|---|
primitiveCube | primitiveCube(w, h, d) | 完成 |
primitiveSphere | primitiveSphere(radius, subdivisions) | 完成 |
primitiveCylinder | primitiveCylinder(sides, radius, height) | 完成 |
primitiveCone | primitiveCone(sides, radius, height) | 完成 |
primitiveDisk | primitiveDisk(sides, radius) | 完成 |
primitiveQuad | primitiveQuad(w, h) | 完成 |
primitivePyramid | primitivePyramid(w, d, h) | 完成 |
shapeL | shapeL(frontWidth, leftWidth) { ... } | 完成 |
shapeU | shapeU(frontWidth, rightWidth, leftWidth) { ... } | 完成 |
shapeO | shapeO(frontW, rightW, backW, leftW) { ... } | 完成 |
✂️ 几何细分 Geometry Subdivision
将当前形状沿某一轴或周长细分为多个子形状。
| 函数/操作 | 签名 | 状态 |
|---|---|---|
split | split(axis) { size1:... | size2:... } [*] | 完成 |
splitArea | splitArea(axis) { area1:... } [*] | 完成 |
setback | setback(distance) { front:... | side:... | remainder:... } | 部分完成 |
splitAndSetbackPerimeter | splitAndSetbackPerimeter(splitOffset [, firstEdgeIndex, selectedEdgesMask]) { length:depth:ops | ... } [*] { remainder:ops } | 完成 |
innerRectangle | innerRectangle() { ... } | 完成 |
🔧 几何操作 Geometry Operations
修改、查询或重塑当前形状的几何结构。
| 函数/操作 | 签名 | 状态 |
|---|---|---|
extrude | extrude(distance) | 完成 |
comp | comp(f) { front:... | side:... | top:... | bottom:... | all:... } | 完成 |
roofHip | roofHip(height) | 完成 |
roofGable | roofGable(height) | 完成 |
roofPyramid | roofPyramid(height) | 完成 |
roofRidge | roofRidge(height, angle) | 完成 |
roofShed | roofShed(height, index) | 完成 |
offset | offset(distance) | 完成 |
taper | taper(height) | 完成 |
envelope | envelope(height, frontAngle, sideAngle) | 完成 |
center | center(axes) | 完成 |
mirror | mirror(xFlip, yFlip, zFlip) | 完成 |
mirrorScope | mirrorScope(xFlip, yFlip, zFlip) | 完成 |
reverseNormals | reverseNormals() | 完成 |
setNormals | setNormals(mode) | 完成 |
softenNormals | softenNormals(angle) | 完成 |
cleanupGeometry | cleanupGeometry(tolerance) | 完成 |
deleteHoles | deleteHoles() | 完成 |
convexify | convexify() | 完成 |
resetGeometry | resetGeometry() | 完成 |
reduceGeometry | reduceGeometry(tolerance) | 部分完成 |
rectify | rectify(angle) | 完成 |
footprint | footprint() | 完成 |
trim | trim() | 完成 |
modify | modify(component) { ... } | 未完成 |
🧩 规则内联和3D布尔 Rule Inlining & 3D Boolean
内联其他规则文件或执行布尔操作。
| 函数/操作 | 签名 | 状态 |
|---|---|---|
insert / i | insert(filePath) / i(filePath) | 未完成 |
insertAlongUV | insertAlongUV(uvSet, filePath, height) | 未完成 |
union | union { A | B } | 部分完成 |
subtract | subtract { A | B } | 部分完成 |
intersect | intersect { A | B } | 部分完成 |
scatter | scatter(domain, count) | 部分完成 |
inline | inline(mode) { ... } | 部分完成 |
🎨 纹理 Textures
设置颜色、材质和纹理映射。
| 函数/操作 | 签名 | 状态 |
|---|---|---|
color | color("#RRGGBB") / color(r, g, b) | 完成 |
texture | texture(url) | 完成 |
setMaterial | setMaterial("key", "val", ...) | 完成 |
resetMaterial | resetMaterial() | 完成 |
setupProjection | setupProjection(uvSet, axes, texW, texH) | 完成 |
projectUV | projectUV(uvSet) | 完成 |
translateUV | translateUV(uvSet, uOffset, vOffset) | 完成 |
scaleUV | scaleUV(uvSet, uFactor, vFactor) | 完成 |
rotateUV | rotateUV(uvSet, angle) | 完成 |
tileUV | tileUV(uvSet, texW, texH) | 完成 |
normalizeUV | normalizeUV(uvSet) | 完成 |
deleteUV | deleteUV(uvSet) | 完成 |
copyUV | copyUV(src, dst) | 完成 |
🔄 变换 Transformations
平移、旋转、缩放当前形状或 Scope。
| 函数/操作 | 签名 | 状态 |
|---|---|---|
t | t(tx, ty, tz) | 完成 |
translate | translate(tx, ty, tz) | 完成 |
s | s(sx, sy, sz) | 完成 |
scale | scale(sx, sy, sz) | 完成 |
r | r(rx, ry, rz) | 完成 |
rotateScope | rotateScope(rx, ry, rz) | 完成 |
📐 范围 Scope
对齐、修改或设置当前形状的 Scope 坐标系。
| 函数/操作 | 签名 | 状态 |
|---|---|---|
alignScopeToAxes | alignScopeToAxes() | 完成 |
alignScopeToGeometry | alignScopeToGeometry(faceIndex) | 完成 |
alignScopeToGeometryBBox | alignScopeToGeometryBBox(axes) | 完成 |
setPivot | setPivot(ix, iy, iz) | 完成 |
🔀 流程控制 Flow Control
控制规则执行的流程与分支。
| 函数/操作 | 签名 | 状态 |
|---|---|---|
NIL | NIL | 完成 |
p | p(probability) | 完成 |
case / Conditional | case condition : operation | 完成 |
else | else : operation | 完成 |
stop | stop | 完成 |
push / pop | push { ... } pop | 完成 |
🏷️ 属性 Attributes
声明可配置的全局或局部属性。
| 语法 | 说明 | 状态 |
|---|---|---|
attr | attr name = defaultValue | 完成 |
const | const name = value | 完成 |
@Group | 属性分组显示 | 完成 |
@Hidden | 隐藏属性不显示 | 完成 |
@Order | 属性排序 | 完成 |
@Description | 属性描述文本 | 完成 |
@StartRule | 标记起始规则 | 完成 |
@Range | 属性范围限制 | 部分完成 |
📏 形状属性 Shape Attributes
在规则执行过程中访问当前形状的几何与范围信息。
geometry.*
| 属性 | 说明 | 状态 |
|---|---|---|
geometry.area | 当前面面积 | 完成 |
geometry.volume | 当前体体积 | 完成 |
geometry.height | 当前形状高度 (y 范围) | 完成 |
geometry.boundaryLength | 边界总长度 | 完成 |
geometry.nFaces | 面数 | 完成 |
geometry.nEdges | 边数 | 完成 |
geometry.nVertices | 顶点数 | 完成 |
geometry.nHoles | 孔洞数 | 完成 |
geometry.isPlanar | 是否为平面 | 完成 |
geometry.isRectangular | 是否为矩形 | 完成 |
geometry.isConcave | 是否为凹形 | 完成 |
geometry.isClosedSurface | 是否为闭合表面 | 部分完成 |
geometry.isOriented | 是否已定向 | 部分完成 |
geometry.hasTags | 是否有标签 | 完成 |
geometry.hasUVs | 是否有 UV | 完成 |
geometry.uMin / uMax / vMin / vMax | UV 边界 | 完成 |
scope.*
| 属性 | 说明 | 状态 |
|---|---|---|
scope.sx / sy / sz | Scope 尺寸 | 完成 |
scope.tx / ty / tz | Scope 平移 | 完成 |
scope.rx / ry / rz | Scope 旋转 (欧拉角) | 完成 |
scope.eulerRotation.x / y / z | Scope 欧拉旋转 | 完成 |
scope.eulerRotation.pivot | 旋转轴心 | 完成 |
initialShape.*
| 属性 | 说明 | 状态 |
|---|---|---|
initialShape.origin | 初始形状原点 | 完成 |
initialShape.geometry | 初始几何信息 | 部分完成 |
🧮 内置函数 Built-in Functions
数学、字符串、数组、颜色、概率、文件、资产与上下文函数。
数学函数 Math
| 函数 | 签名 | 状态 |
|---|---|---|
abs | abs(x) | 完成 |
acos | acos(x) | 完成 |
asin | asin(x) | 完成 |
atan | atan(x) | 完成 |
atan2 | atan2(y, x) | 完成 |
ceil | ceil(x) | 完成 |
clamp | clamp(v, min, max) | 完成 |
cos | cos(deg) | 完成 |
exp | exp(x) | 完成 |
floor | floor(x) | 完成 |
isinf | isinf(x) | 完成 |
isnan | isnan(x) | 完成 |
ln | ln(x) | 完成 |
log10 | log10(x) | 完成 |
max | max(a, b, ...) | 完成 |
min | min(a, b, ...) | 完成 |
pow | pow(x, y) | 完成 |
rint | rint(x) | 完成 |
sin | sin(deg) | 完成 |
sqrt | sqrt(x) | 完成 |
sum | sum(array) | 完成 |
tan | tan(deg) | 完成 |
sign | sign(x) | 完成 |
frac | frac(x) | 完成 |
trunc | trunc(x) | 完成 |
hypot | hypot(a, b) | 完成 |
normalize | normalize(x, y, z) | 完成 |
dot | dot(x1,y1,z1, x2,y2,z2) | 完成 |
cross | cross(x1,y1,z1, x2,y2,z2) | 完成 |
字符串函数 String
| 函数 | 签名 | 状态 |
|---|---|---|
len | len(str) | 完成 |
count | count(str, match) | 完成 |
find | find(str, match, n) | 完成 |
splitString | splitString(str, delim) | 完成 |
substring | substring(str, start, end) | 完成 |
strreplace | strreplace(str, old, new) | 完成 |
replace | replace(str, pattern, replacement) | 完成 |
toupper | toupper(str) | 完成 |
tolower | tolower(str) | 完成 |
findLast | findLast(str, pattern) | 完成 |
getPrefix | getPrefix(str, sep) | 完成 |
getSuffix | getSuffix(str, sep) | 完成 |
getRange | getRange(str, start, end) | 完成 |
trim | trim(str) | 完成 |
startsWith | startsWith(str, prefix) | 完成 |
endsWith | endsWith(str, suffix) | 完成 |
includes | includes(str, substr) | 完成 |
format | format(fmt, ...args) | 完成 |
数组函数 Array
| 函数 | 签名 | 状态 |
|---|---|---|
size | size(array) | 完成 |
nRows | nRows(array) | 完成 |
nColumns | nColumns(array) | 完成 |
transpose | transpose(array) | 完成 |
findFirst | findFirst(array, value, eps) | 完成 |
findAll | findAll(array, value, eps) | 完成 |
setElems | setElems(array, indices, values) | 完成 |
sortIndices | sortIndices(array) | 完成 |
sortRowIndices | sortRowIndices(array, col) | 完成 |
reverse | reverse(array) | 完成 |
append | append(array, item) | 完成 |
pop | pop(array) | 完成 |
slice | slice(array, start, end) | 完成 |
mean | mean(array) | 完成 |
median | median(array) | 完成 |
std | std(array) | 完成 |
颜色函数 Color
| 函数 | 签名 | 状态 |
|---|---|---|
colorHSVToHex | colorHSVToHex(h, s, v) | 完成 |
colorRGBToHex | colorRGBToHex(r, g, b) | 完成 |
colorHexToR | colorHexToR(hex) | 完成 |
colorHexToG | colorHexToG(hex) | 完成 |
colorHexToB | colorHexToB(hex) | 完成 |
colorRamp | colorRamp(t, c1, c2, ...) | 完成 |
colorHSVOToHex | colorHSVOToHex(h, s, v, o) | 完成 |
colorRGBOToHex | colorRGBOToHex(r, g, b, o) | 完成 |
colorHexToH | colorHexToH(hex) | 完成 |
colorHexToS | colorHexToS(hex) | 完成 |
colorHexToV | colorHexToV(hex) | 完成 |
概率与随机 Probability
| 函数 | 签名 | 状态 |
|---|---|---|
p | p(probability) | 完成 |
rand | rand() / rand(max) / rand(min, max) | 完成 |
rand.int | rand.int(min, max) | 完成 |
rand.gaussian | rand.gaussian(mean, stddev) | 完成 |
文件函数 File
| 函数 | 签名 | 状态 |
|---|---|---|
fileBasename | fileBasename(path) | 完成 |
fileDirectory | fileDirectory(path) | 完成 |
fileExtension | fileExtension(path) | 完成 |
fileName | fileName(path) | 完成 |
fileRandom | fileRandom(path) | 完成 |
fileExists | fileExists(path) | 完成 |
fileSearch | fileSearch(pattern) | 完成 |
filesSearch | filesSearch(pattern) | 完成 |
readFloatTable | readFloatTable(content) | 完成 |
readStringTable | readStringTable(content) | 完成 |
readTextFile | readTextFile(content) | 完成 |
资产函数 Asset
| 函数 | 签名 | 状态 |
|---|---|---|
assetInfo | assetInfo(path, attr) | 部分完成 |
assetMetadata | assetMetadata(path, key) | 未完成 |
assetNamingInfo | assetNamingInfo(path, key) | 未完成 |
assetNamingInfos | assetNamingInfos(paths, key) | 未完成 |
assetsSortRatio | assetsSortRatio(paths, ...) | 完成 |
assetsSortSize | assetsSortSize(paths, ...) | 完成 |
imageInfo | imageInfo(path, attr) | 部分完成 |
imagesSortRatio | imagesSortRatio(paths, ...) | 完成 |
assetApproxRatio | assetApproxRatio(paths, ...) | 完成 |
assetApproxSize | assetApproxSize(paths, ...) | 完成 |
assetBestRatio | assetBestRatio(paths, ...) | 完成 |
assetBestSize | assetBestSize(paths, ...) | 完成 |
assetFitSize | assetFitSize(paths, ...) | 完成 |
imageApproxRatio | imageApproxRatio(paths, ...) | 完成 |
imageBestRatio | imageBestRatio(paths, ...) | 完成 |
上下文函数 Context
| 函数 | 签名 | 状态 |
|---|---|---|
inside | inside() / inside(target, label) | 部分完成 |
overlaps | overlaps() / overlaps(target, label) | 部分完成 |
touches | touches() / touches(target, label) | 部分完成 |
minimumDistance | minimumDistance(target, label) | 部分完成 |
contextCompare | contextCompare(target, label, type) | 部分完成 |
contextCount | contextCount(target, label) | 部分完成 |
边属性函数 Edge Attributes
| 函数 | 签名 | 状态 |
|---|---|---|
edgeAttr.getBool | edgeAttr.getBool(name) | 未完成 |
edgeAttr.getFloat | edgeAttr.getFloat(name) | 未完成 |
edgeAttr.getString | edgeAttr.getString(name) | 未完成 |
🛠️ CGA 实用工具函数 CGA Utility Functions
调试、转换和其他辅助功能。
| 函数/操作 | 签名 | 状态 |
|---|---|---|
print | print(value) | 完成 |
convert | convert(...) | 完成 |
getTreeKey | getTreeKey() | 完成 |