← 返回函数库

cleanupGeometry

Geometry Manipulation Recomposition Cleanup 已实现

CityEngine 官方语法

cleanupGeometry(tolerance)

参数说明

参数类型默认值说明
tolerancefloat合并阈值。距离小于此值的顶点会被合并。

描述

清理几何体中的冗余顶点和退化面。合并距离过近的顶点,删除面积为零的面,优化网格结构。

当前实现为简化版本,主要合并重复顶点和删除退化面。完整的拓扑修复(如 T-junction 处理)尚未实现。

官方示例

清理几何体:

Mesh --> cleanupGeometry(0.001)

实现说明

CGA.js 中的 cleanupGeometry 实现基于 CityEngine 2025.1 官方文档。

🎨 3D 预览 — 清理几何体

@StartRule\nLot --> primitiveCube(4, 4, 4)\n        cleanupGeometry(0.001)\n        color(0.7, 0.7, 0.8)