mcpField
T
threejs-geometry

threejs-geometry

github.com/cesartevisualDevelopment11348 installsUpdated 7w ago
Repository

About threejs-geometry

A coding skill for working with geometry and instancing in Three.js projects. It guides developers through geometry choices, dynamic updates, instance management, and verification while respecting the project's installed versions and architecture.

Key features

  1. 01Choosing built-in, custom, or instanced geometry
  2. 02Managing indexed geometry and vertex attributes
  3. 03Updating dynamic buffers and bounds
  4. 04Maintaining instance IDs, transforms, and colors
  5. 05Verifying lighting, culling, seams, and picking

Use cases

  1. 01Building custom or repeated 3D shapes
  2. 02Updating geometry during rendering
  3. 03Implementing per-instance selection and picking

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/cesartevisual/threejs-skills --skill threejs-geometry

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

Details

From the project README

Geometry and Instancing

Use the project's installed versions and existing architecture. These instructions supplement the user's task; they do not authorize unrelated changes or external actions.

Choose built-in geometry for simple shapes, BufferGeometry for custom topology, and instancing for repeated geometry/material combinations. Keep topology density tied to silhouette and deformation, not arbitrary high segment counts.

Define indexed versus non-indexed data deliberately. Attribute vertex counts must agree; triangle winding controls front faces. UV seams and hard normals can require duplicated vertices. Recompute normals after topology changes when appropriate; normals alone do not create missing UVs or tangents.

For dynamic attributes, allocate capacity up front, choose usage before first rendering, mutate typed arrays, and flag needsUpdate. Use supported update ranges for partial writes. Refresh bounding volumes after changes that invalidate culling or picking. A bounding box is not automatically a precise collision shape.

With InstancedMesh, maintain a stable instance ID to application ID mapping. Update instance matrices/colors and their needsUpdate flags; recompute bounds after instance transforms change. Split large instance sets spatially when one enormous bound defeats culling. Plan selection/highlighting without cloning a material for every instance.

Keep generated geometry ownership explicit, reuse immutable assets, and dispose geometry only when its last consumer releases it. Verify normals under directional lighting, seams under a checker texture, culling at camera edges, and per-instance picking after updates.

API reference

Consult the official documentation for exact signatures and revision-specific behavior. If documentation access is unavailable, inspect installed types/source and state any remaining uncertainty.

Comments

Markdown supported