threejs-geometries
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to use this skill
何时使用此 skill
ALWAYS use this skill when the user mentions:
- Building or modifying , attributes, index buffers, draw ranges
BufferGeometry - Instancing via /
InstancedBufferAttributegeometry side (threejs-objects for mesh wrapper)InstancedMesh - Extruding along paths,
Shape,TubeGeometry,LatheGeometryExtrudeGeometry - Text or decal addon geometries
IMPORTANT: geometries vs math
- threejs-geometries = GPU-ready triangle data.
- threejs-math = ,
Box3,Spheretests without mesh topology.Ray
Trigger phrases include:
- "BufferGeometry", "BufferAttribute", "ExtrudeGeometry", "Shape", "Curve"
- "几何体", "缓冲几何", "挤出", "文字几何"
当用户提到以下内容时,务必使用此 skill:
- 构建或修改 、属性、索引缓冲区、绘制范围
BufferGeometry - 通过 /
InstancedBufferAttribute几何体部分进行实例化(网格包装器请参阅 threejs-objects)InstancedMesh - 沿路径挤出 、
Shape、TubeGeometry、LatheGeometryExtrudeGeometry - 文字或 decal 附加几何体
重要:几何体与数学对象
- threejs-geometries = 可直接用于 GPU 的三角形数据。
- threejs-math = 无需网格拓扑的 、
Box3、Sphere测试。Ray
触发短语包括:
- "BufferGeometry", "BufferAttribute", "ExtrudeGeometry", "Shape", "Curve"
- "几何体", "缓冲几何", "挤出", "文字几何"
How to use this skill
如何使用此 skill
- Prefer built-in primitives when they fit before custom buffers.
- For custom meshes: create , set
BufferGeometry,position,normal, optionaluv; compute bounding volumes for culling.index - For instancing attributes, align divisor/count with patterns in threejs-objects.
InstancedMesh - For 2D profiles: build /
Shape, extrude or lathe per docs; consult Extras Curve family for path sampling.Path - 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.
- 如果内置基础几何体适用,应优先使用它们,而不是自定义缓冲区。
- 对于自定义网格:创建 ,设置
BufferGeometry、position、normal和可选的uv;计算包围体以进行剔除。index - 对于实例化属性,使 divisor/count 与 threejs-objects 中的 模式保持一致。
InstancedMesh - 对于 2D 轮廓:根据文档构建 /
Shape并进行挤出或 lathe;路径采样请查阅 Extras Curve 系列。Path - 对于附加模块中的 NURBS 节点,仅在必要时查阅 Addons Curves 页面——应引用文档,而不是复制完整 API。
- 替换网格时,对几何体调用 ,以避免资源泄漏。
dispose()
请参阅 examples/workflow-extrude-shape.md。
Doc map (official)
官方文档映射
| Docs section | Representative links |
|---|---|
| Core | https://threejs.org/docs/BufferGeometry.html |
| Geometries | https://threejs.org/docs/BoxGeometry.html |
| Extrude | https://threejs.org/docs/ExtrudeGeometry.html |
| Shape | https://threejs.org/docs/Shape.html |
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.
- 范围内: 核心几何体、缓冲区基础功能、曲线/形状/挤出工作流、部分附加几何体。
- 范围外: 物理碰撞网格烘焙;完整的 CAD 导入流水线。
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).
- 缺少法线会破坏光照;应统一计算或导入法线。
- 错误的绕序会翻转面——请检查 side/culling。
- 属性数量过大时需要使用 LOD 或进行简化(附加模块中的 modifiers——仅在用户提出要求时提及)。
Documentation and version
文档与版本
Primitives and live under Geometries and BufferGeometry in three.js docs. Curve, , and extrusion APIs appear under Extras and Geometries—Addons Curves / Geometries document NURBS and text meshes; link those instead of copying long signatures.
BufferGeometryShape基础几何体和 位于 three.js 文档 的 Geometries 和 BufferGeometry 下。、 和挤出 API 位于 Extras 与 Geometries 下——Addons Curves / Geometries 介绍了 NURBS 和文字网格;应链接这些文档,而不是复制冗长的函数签名。
BufferGeometryCurveShapeAgent response checklist
Agent 响应检查清单
When answering under this skill, prefer responses that:
- Link , a primitive, or
BufferGeometry/ExtrudeGeometryas appropriate.Shape - Point instancing usage to threejs-objects for patterns.
InstancedMesh - Point morph targets and tracks to threejs-animation when deformation is time-driven.
- Reference (Addons Utils) only by name + docs link when merging/splitting.
BufferGeometryUtils - Emphasize when replacing large custom buffers.
dispose()
在此 skill 下回答时,优先采用符合以下特点的响应:
- 根据实际情况链接 、基础几何体或
BufferGeometry/ExtrudeGeometry。Shape - 将实例化用法指向 threejs-objects,以了解 模式。
InstancedMesh - 当变形由时间驱动时,将变形目标和轨道指向 threejs-animation。
- 涉及合并或拆分时,仅通过名称加文档链接引用 (Addons Utils)。
BufferGeometryUtils - 强调替换大型自定义缓冲区时应调用 。
dispose()
References
参考资料
Keywords
关键词
English: buffergeometry, extrude, shape, path, curve, primitives, instancing, three.js
中文: 几何体、BufferGeometry、挤出、Shape、曲线、实例化、three.js
英文: buffergeometry, extrude, shape, path, curve, primitives, instancing, three.js
中文: 几何体、BufferGeometry、挤出、Shape、曲线、实例化、three.js