threejs-geometries

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

When to use this skill

何时使用此 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"
  • "几何体", "缓冲几何", "挤出", "文字几何"
当用户提到以下内容时,务必使用此 skill:
  • 构建或修改
    BufferGeometry
    、属性、索引缓冲区、绘制范围
  • 通过
    InstancedBufferAttribute
    /
    InstancedMesh
    几何体部分进行实例化(网格包装器请参阅 threejs-objects)
  • 沿路径挤出
    Shape
    、
    TubeGeometry
    、
    LatheGeometry
    、
    ExtrudeGeometry
  • 文字或 decal 附加几何体
重要:几何体与数学对象
  • threejs-geometries = 可直接用于 GPU 的三角形数据。
  • threejs-math = 无需网格拓扑的
    Box3
    、
    Sphere
    、
    Ray
    测试。
触发短语包括:
  • "BufferGeometry", "BufferAttribute", "ExtrudeGeometry", "Shape", "Curve"
  • "几何体", "缓冲几何", "挤出", "文字几何"

How to use this skill

如何使用此 skill

  1. Prefer built-in primitives when they fit before custom buffers.
  2. For custom meshes: create
    BufferGeometry
    , set
    position
    ,
    normal
    ,
    uv
    , optional
    index
    ; compute bounding volumes for culling.
  3. For instancing attributes, align divisor/count with
    InstancedMesh
    patterns in threejs-objects.
  4. For 2D profiles: build
    Shape
    /
    Path
    , extrude or lathe per docs; consult Extras Curve family for path sampling.
  5. For addon NURBS knots, follow Addons Curves pages sparingly—cite docs instead of copying full APIs.
  6. Dispose geometries when replacing meshes to avoid leaks.
See examples/workflow-extrude-shape.md.
  1. 如果内置基础几何体适用,应优先使用它们,而不是自定义缓冲区。
  2. 对于自定义网格:创建
    BufferGeometry
    ,设置
    position
    、
    normal
    、
    uv
    和可选的
    index
    ;计算包围体以进行剔除。
  3. 对于实例化属性,使 divisor/count 与 threejs-objects 中的
    InstancedMesh
    模式保持一致。
  4. 对于 2D 轮廓:根据文档构建
    Shape
    /
    Path
    并进行挤出或 lathe;路径采样请查阅 Extras Curve 系列。
  5. 对于附加模块中的 NURBS 节点,仅在必要时查阅 Addons Curves 页面——应引用文档,而不是复制完整 API。
  6. 替换网格时,对几何体调用
    dispose()
    ,以避免资源泄漏。
请参阅 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.
  • 范围内: 核心几何体、缓冲区基础功能、曲线/形状/挤出工作流、部分附加几何体。
  • 范围外: 物理碰撞网格烘焙;完整的 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
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.
基础几何体和
BufferGeometry
位于 three.js 文档 的 Geometries 和 BufferGeometry 下。
Curve
、
Shape
和挤出 API 位于 Extras 与 Geometries 下——Addons Curves / Geometries 介绍了 NURBS 和文字网格;应链接这些文档,而不是复制冗长的函数签名。

Agent response checklist

Agent 响应检查清单

When answering under this skill, prefer responses that:
  1. Link
    BufferGeometry
    , a primitive, or
    ExtrudeGeometry
    /
    Shape
    as appropriate.
  2. Point instancing usage to threejs-objects for
    InstancedMesh
    patterns.
  3. Point morph targets and tracks to threejs-animation when deformation is time-driven.
  4. Reference
    BufferGeometryUtils
    (Addons Utils) only by name + docs link when merging/splitting.
  5. Emphasize
    dispose()
    when replacing large custom buffers.
在此 skill 下回答时,优先采用符合以下特点的响应:
  1. 根据实际情况链接
    BufferGeometry
    、基础几何体或
    ExtrudeGeometry
    /
    Shape
    。
  2. 将实例化用法指向 threejs-objects,以了解
    InstancedMesh
    模式。
  3. 当变形由时间驱动时,将变形目标和轨道指向 threejs-animation。
  4. 涉及合并或拆分时,仅通过名称加文档链接引用
    BufferGeometryUtils
    (Addons Utils)。
  5. 强调替换大型自定义缓冲区时应调用
    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