skills/threejs-skills/threejs-geometries/SKILL.md
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. Use when building custom buffer geometries, extruding shapes, or using primitive geometry constructors; for animation morph targets see threejs-animation; for merging buffers see BufferGeometryUtils addon.
npx skillsauth add partme-ai/full-stack-skills threejs-geometriesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
ALWAYS use this skill when the user mentions:
BufferGeometry, attributes, index buffers, draw rangesInstancedBufferAttribute / InstancedMesh geometry side (threejs-objects for mesh wrapper)Shape along paths, TubeGeometry, LatheGeometry, ExtrudeGeometryIMPORTANT: geometries vs math
Box3, Sphere, Ray tests without mesh topology.Trigger phrases include:
BoxGeometry, SphereGeometry, etc.) when they fit before custom buffers.position, normal, uv, optional index; compute bounding volumes for frustum culling.InstancedMesh patterns in threejs-objects.Shape/Path, extrude or lathe per docs; consult Extras Curve family for path sampling.geometry.dispose() when replacing meshes to avoid GPU memory leaks.import * as THREE from 'three';
// Create a simple triangle with custom BufferGeometry
const geometry = new THREE.BufferGeometry();
const vertices = new Float32Array([
-1, -1, 0, 1, -1, 0, 0, 1, 0
]);
geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));
geometry.computeVertexNormals(); // Always compute normals for correct lighting
// Validate: ensure bounding sphere exists for frustum culling
geometry.computeBoundingSphere();
if (!geometry.boundingSphere) {
console.warn('Bounding sphere computation failed — check vertex data');
}
const material = new THREE.MeshStandardMaterial({ color: 0x00ff00 });
const mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
// Cleanup when done
// geometry.dispose(); material.dispose();
See examples/workflow-extrude-shape.md.
| 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 |
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.
When answering under this skill, prefer responses that:
BufferGeometry, a primitive, or ExtrudeGeometry / Shape as appropriate.InstancedMesh patterns.BufferGeometryUtils (Addons Utils) only by name + docs link when merging/splitting.dispose() when replacing large custom buffers.English: buffergeometry, extrude, shape, path, curve, primitives, instancing, three.js
中文: 几何体、BufferGeometry、挤出、Shape、曲线、实例化、three.js
development
Provides per-component and per-API examples with cross-platform compatibility details for uni-app, covering built-in components, uni-ui components, and APIs (network, storage, device, UI, navigation, media). Use when the user needs official uni-app components or APIs, wants per-component examples with doc links, or needs platform compatibility checks.
tools
Creates new uni-app projects via the official CLI or HBuilderX with Vue 2/Vue 3 template selection, manifest.json and pages.json configuration, and directory structure setup. Use when the user wants to scaffold a new uni-app project, initialize project files with a single command, or set up the development environment.
tools
Browses, installs, configures, and manages plugins from the uni-app plugin market (ext.dcloud.net.cn) including component plugins, API plugins, and template plugins with dependency handling. Use when the user needs to find and install uni-app plugins, configure plugin settings, manage plugin dependencies, or integrate third-party components.
tools
Develops native Android and iOS plugins for uni-app including module creation, JavaScript-to-native communication, and plugin packaging for distribution. Use when the user needs to build custom native modules, extend uni-app with native capabilities (camera, Bluetooth, sensors), or create publishable native plugins.