When to use this skill
ALWAYS use this skill when the user mentions:
- Building or modifying
BufferGeometry, attributes, index buffers, draw ranges
- Instancing via
InstancedBufferAttribute / InstancedMesh geometry side (threejs-objects for mesh wrapper)
- Extruding
Shape along paths, TubeGeometry, LatheGeometry, ExtrudeGeometry
- Text or decal addon geometries
IMPORTANT: geometries vs math
- threejs-geometries = GPU-ready triangle data.
- threejs-math =
Box3, Sphere, Ray tests without mesh topology.
Trigger phrases include:
- "BufferGeometry", "BufferAttribute", "ExtrudeGeometry", "Shape", "Curve"
- "几何体", "缓冲几何", "挤出", "文字几何"
How to use this skill
- Prefer built-in primitives when they fit before custom buffers.
- For custom meshes: create
BufferGeometry, set position, normal, uv, optional index; compute bounding volumes for culling.
- For instancing attributes, align divisor/count with
InstancedMesh patterns in threejs-objects.
- For 2D profiles: build
Shape/Path, extrude or lathe per docs; consult Extras Curve family for path sampling.
- For addon NURBS knots, follow Addons Curves pages sparingly—cite docs instead of copying full APIs.
- Dispose geometries when replacing meshes to avoid leaks.
See examples/workflow-extrude-shape.md.
Doc map (official)
Scope
- In scope: Core geometries, buffer core, curve/shape/extrusion workflows, selected addon geometries.
- Out of scope: Physics collision mesh baking; full CAD import pipelines.
Common pitfalls and best practices
- Missing normals break lighting; compute or import consistently.
- Wrong winding order flips faces—check side/culling.
- Huge attribute counts need LOD or simplification (modifiers in addons—mention only if user asks).
Documentation and version
Primitives and BufferGeometry live under Geometries and BufferGeometry in three.js docs. Curve, Shape, and extrusion APIs appear under Extras and Geometries—Addons Curves / Geometries document NURBS and text meshes; link those instead of copying long signatures.
Agent response checklist
When answering under this skill, prefer responses that:
- Link
BufferGeometry, a primitive, or ExtrudeGeometry / Shape as appropriate.
- Point instancing usage to threejs-objects for
InstancedMesh patterns.
- Point morph targets and tracks to threejs-animation when deformation is time-driven.
- Reference
BufferGeometryUtils (Addons Utils) only by name + docs link when merging/splitting.
- Emphasize
dispose() when replacing large custom buffers.
References
Keywords
English: buffergeometry, extrude, shape, path, curve, primitives, instancing, three.js
中文: 几何体、BufferGeometry、挤出、Shape、曲线、实例化、three.js
能力边界
✅ 适用场景
- 当你需要使用此技能对应的技术栈时
- 当项目需要遵循最佳实践时
- 当需要快速上手或深入理解核心概念时
⚠️ 需要注意
- 复杂业务逻辑需要结合具体场景调整
- 性能优化需要根据实际数据量评估
❌ 不适用场景
常见陷阱 (Gotchas)
- 版本兼容性:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异
- 配置文件格式:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查
- 环境变量:确保所有必要的环境变量已正确设置,敏感信息不要硬编码
- 依赖冲突:多版本共存时注意依赖冲突,使用 lock 文件锁定版本
- 性能陷阱:大数据量场景下注意性能优化,避免 N+1 查询等常见问题
使用流程
Step 1: 环境准备
确保开发环境已安装必要的依赖和工具。
Step 2: 配置初始化
根据项目需求进行基础配置。
Step 3: 核心功能使用
按照示例代码实现核心功能。
Step 4: 测试验证
运行测试确保功能正常。
Step 5: 部署上线
完成开发后进行部署和监控。
1---2name: threejs-geometries3description: three.js geometry authoring: BufferGeometry, typed BufferAttribute and interleaved layouts, InstancedBufferGeometry, primitive Geometries (box/sphere/torus/etc.), ExtrudeGeometry and Shape/Path/Curve from Extras, WireframeGeometry, and addon geometries such as TextGeometry, DecalGeometry, RoundedBoxGeometry. Covers merged scope of procedural curves and extrusion formerly split as extras-curves; for animation morph targets see threejs-animation; for merging buffers utilities see official BufferGeometryUtils module in docs Utils addons.4---56## When to use this skill78**ALWAYS use this skill when the user mentions:**910- Building or modifying `BufferGeometry`, attributes, index buffers, draw ranges11- Instancing via `InstancedBufferAttribute` / `InstancedMesh` geometry side (**threejs-objects** for mesh wrapper)12- Extruding `Shape` along paths, `TubeGeometry`, `LatheGeometry`, `ExtrudeGeometry`13- Text or decal addon geometries1415**IMPORTANT: geometries vs math**1617- **threejs-geometries** = GPU-ready triangle data.18- **threejs-math** = `Box3`, `Sphere`, `Ray` tests without mesh topology.1920**Trigger phrases include:**2122- "BufferGeometry", "BufferAttribute", "ExtrudeGeometry", "Shape", "Curve"23- "几何体", "缓冲几何", "挤出", "文字几何"2425## How to use this skill26271. Prefer built-in primitives when they fit before custom buffers.282. For custom meshes: create `BufferGeometry`, set `position`, `normal`, `uv`, optional `index`; compute bounding volumes for culling.293. For instancing attributes, align divisor/count with `InstancedMesh` patterns in **threejs-objects**.304. For 2D profiles: build `Shape`/`Path`, extrude or lathe per docs; consult Extras **Curve** family for path sampling.315. For addon NURBS knots, follow Addons **Curves** pages sparingly—cite docs instead of copying full APIs.326. Dispose geometries when replacing meshes to avoid leaks.3334See [examples/workflow-extrude-shape.md](examples/workflow-extrude-shape.md).3536## Doc map (official)3738| Docs section | Representative links |39|--------------|----------------------|40| Core | https://threejs.org/docs/BufferGeometry.html |41| Geometries | https://threejs.org/docs/BoxGeometry.html |42| Extrude | https://threejs.org/docs/ExtrudeGeometry.html |43| Shape | https://threejs.org/docs/Shape.html |4445## Scope4647- **In scope:** Core geometries, buffer core, curve/shape/extrusion workflows, selected addon geometries.48- **Out of scope:** Physics collision mesh baking; full CAD import pipelines.4950## Common pitfalls and best practices5152- Missing normals break lighting; compute or import consistently.53- Wrong winding order flips faces—check side/culling.54- Huge attribute counts need LOD or simplification (modifiers in addons—mention only if user asks).5556## Documentation and version5758Primitives and `BufferGeometry` live under [Geometries](https://threejs.org/docs/#Geometries) and [BufferGeometry](https://threejs.org/docs/BufferGeometry.html) in [three.js docs](https://threejs.org/docs/). Curve, `Shape`, and extrusion APIs appear under **Extras** and **Geometries**—Addons **Curves** / **Geometries** document NURBS and text meshes; link those instead of copying long signatures.5960## Agent response checklist6162When answering under this skill, prefer responses that:63641. Link `BufferGeometry`, a primitive, or `ExtrudeGeometry` / `Shape` as appropriate.652. Point **instancing** usage to **threejs-objects** for `InstancedMesh` patterns.663. Point morph targets and tracks to **threejs-animation** when deformation is time-driven.674. Reference `BufferGeometryUtils` (Addons **Utils**) only by name + docs link when merging/splitting.685. Emphasize `dispose()` when replacing large custom buffers.6970## References7172- https://threejs.org/docs/#Geometries73- https://threejs.org/docs/BufferGeometry.html74- https://threejs.org/docs/ExtrudeGeometry.html7576## Keywords7778**English:** buffergeometry, extrude, shape, path, curve, primitives, instancing, three.js7980**中文:** 几何体、BufferGeometry、挤出、Shape、曲线、实例化、three.js8182## 能力边界8384### ✅ 适用场景85- 当你需要使用此技能对应的技术栈时86- 当项目需要遵循最佳实践时87- 当需要快速上手或深入理解核心概念时8889### ⚠️ 需要注意90- 复杂业务逻辑需要结合具体场景调整91- 性能优化需要根据实际数据量评估9293### ❌ 不适用场景94- 不相关的技术栈或框架95- 需要完全自定义的特殊场景9697## 常见陷阱 (Gotchas)98991. **版本兼容性**:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异1002. **配置文件格式**:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查1013. **环境变量**:确保所有必要的环境变量已正确设置,敏感信息不要硬编码1024. **依赖冲突**:多版本共存时注意依赖冲突,使用 lock 文件锁定版本1035. **性能陷阱**:大数据量场景下注意性能优化,避免 N+1 查询等常见问题104105## 使用流程106107### Step 1: 环境准备108确保开发环境已安装必要的依赖和工具。109110### Step 2: 配置初始化111根据项目需求进行基础配置。112113### Step 3: 核心功能使用114按照示例代码实现核心功能。115116### Step 4: 测试验证117运行测试确保功能正常。118119### Step 5: 部署上线120完成开发后进行部署和监控。