SuperAPI AI 工具集

threejs-geometry

通用与其它

查看项目

更新于 10-16 06:43

技能介绍

用途:面向 Three.js 的几何体创建与操作技能,用于生成 3D 形状、处理顶点数据、构建自定义几何体,并支持高效批量渲染。

主要能力:内置形状包括 BoxGeometry、SphereGeometry、PlaneGeometry、CircleGeometry、CylinderGeometry、ConeGeometry、TorusGeometry、TorusKnotGeometry、RingGeometry、CapsuleGeometry、DodecahedronGeometry、IcosahedronGeometry、OctahedronGeometry、TetrahedronGeometry、PolyhedronGeometry;路径类形状包括 LatheGeometry、ExtrudeGeometry、TubeGeometry;另有 TextGeometry(需经 FontLoader 加载字体)。BufferGeometry 支持自定义 position、index、normal、uv、color 等属性,可修改顶点、重算法线(computeVertexNormals)与包围盒,并提供 InterleavedBuffer 交错缓冲。还可使用 EdgesGeometry、WireframeGeometry、Points 点云、Line/LineLoop/LineSegments 线,以及 InstancedMesh 与 InstancedBufferGeometry 做实例化渲染,配合 BufferGeometryUtils 合并几何体、计算切线、交错属性。

使用方式:从 three 导入 THREE 后创建几何体并配合材质构成 Mesh 加入场景;自定义几何体通过 setAttribute、setIndex 设置数据;修改顶点后需将 needsUpdate 置为 true。TextGeometry 依赖 three/examples/jsm/loaders/FontLoader.js 与 three/examples/jsm/geometries/TextGeometry.js;工具函数来自 three/examples/jsm/utils/BufferGeometryUtils.js。

适用场景:3D 场景建模、程序化形状生成、点云与线条可视化、大量同构物体渲染等。

限制:资料未提供安装命令、价格、平台与性能基准;仅说明较新版本中 TextGeometry 的 depth 参数曾名为 height,以及不再使用的几何体应调用 geometry.dispose()。其余如具体运行环境与依赖版本暂未提供。