mcpField
T
threejs-geometries

threejs-geometries

github.com/full-stack-skillsDevelopment10379 installsUpdated 4w ago
Repository

About threejs-geometries

threejs-geometries is a skill for building and modifying three.js geometry, from built-in primitives to custom buffer data and extruded shapes. It guides developers through geometry workflows and relevant documentation.

Key features

  1. 01BufferGeometry and attributes
  2. 02Primitive geometry guidance
  3. 03Shape and path extrusion
  4. 04Instancing attribute guidance
  5. 05Geometry disposal and pitfalls

Use cases

  1. 01Creating custom meshes
  2. 02Extruding a 2D profile
  3. 03Adding geometry instancing data
  4. 04Troubleshooting normals or face winding

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/full-stack-skills/threejs-skills --skill threejs-geometries

After installing, type/threejs-geometriesin Claude Code to confirm it loaded.

Bundled filesagents/openai.yamlexamples/workflow-extrude-shape.md

Details

From the project README

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

  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.

Doc map (official)

Docs sectionRepresentative links
Corehttps://threejs.org/docs/BufferGeometry.html
Geometrieshttps://threejs.org/docs/BoxGeometry.html
Extrudehttps://threejs.org/docs/ExtrudeGeometry.html
Shapehttps://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.

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:

  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.

References

Keywords

English: buffergeometry, extrude, shape, path, curve, primitives, instancing, three.js

中文: 几何体、BufferGeometry、挤出、Shape、曲线、实例化、three.js

Comments

Markdown supported