← 返回 Skills 市场
openlark

Draco3D — 3D Geometry Compression

作者 OpenLark · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
32
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install draco3d
功能描述
Google Draco 3D geometry compression library. Compresses and decompresses 3D meshes and point clouds, with glTF, Three.js, and Unity integration.
使用说明 (SKILL.md)

Draco3D — 3D Geometry Compression

npm i draco3d (WASM codec) | CDN: gstatic.com/draco/versioned/decoders/1.5.7/

Use Cases

Use when compressing 3D models, decoding Draco files, integrating Draco in web projects, using the draco3d npm package, or handling glTF Draco extensions.

Decoding

import DracoDecoderModule from 'draco3d/draco_decoder.js';
const d = await DracoDecoderModule();

const buf = new d.DecoderBuffer();
buf.Init(bytes, bytes.length);
const dec = new d.Decoder();
const type = dec.GetEncodedGeometryType(buf);

const geo = type === d.TRIANGULAR_MESH ? new d.Mesh() : new d.PointCloud();
type === d.TRIANGULAR_MESH
  ? dec.DecodeBufferToMesh(buf, geo)
  : dec.DecodeBufferToPointCloud(buf, geo);

// Read positions
const a = dec.GetAttribute(geo, d.POSITION);
const fa = new d.DracoFloat32Array();
dec.GetAttributeFloatForAllPoints(geo, a, fa);

// Read face indices (mesh only)
const ia = new d.DracoInt32Array();
for (let i = 0; i \x3C geo.num_faces(); i++) {
  dec.GetFaceFromMesh(geo, i, ia); // ia.GetValue(0/1/2)
}

// ⚠️ Must manually release
d.destroy(geo); d.destroy(dec); d.destroy(buf); d.destroy(fa);

Encoding

import DracoEncoderModule from 'draco3d/draco_encoder.js';
const d = await DracoEncoderModule();

const mesh = new d.Mesh();
const b = new d.MeshBuilder();
b.AddFacesToMesh(mesh, numFaces, indices);
b.AddFloatAttributeToMesh(mesh, d.POSITION, numVerts, 3, positions);
b.AddFloatAttributeToMesh(mesh, d.NORMAL, numVerts, 3, normals);

const enc = new d.Encoder();
enc.SetEncodingMethod(d.MESH_EDGEBREAKER_ENCODING);
enc.SetAttributeQuantization(d.POSITION, 11);

const out = new d.DracoInt8Array();
enc.EncodeMeshToDracoBuffer(mesh, out);
d.destroy(mesh); d.destroy(enc); d.destroy(b);

Three.js

import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
const loader = new DRACOLoader();
loader.setDecoderPath('https://www.gstatic.com/draco/versioned/decoders/1.5.7/');
gltfLoader.setDRACOLoader(loader);

Attribute Constants & Quantization Defaults

Constant Quant. Bits Range
POSITION 11 8–14
NORMAL 7 6–10
TEX_COORD 10 8–12
COLOR 8 6–10
GENERIC 8

Encoding methods: MESH_EDGEBREAKER_ENCODING (high compression, default) | MESH_SEQUENTIAL_ENCODING (faster decode)

Key Notes

  • Module returns a Promise — must await
  • All WASM objects must be released via d.destroy(obj), otherwise memory leaks
  • Production: lock CDN version, avoid the unversioned /v1/decoders/ path

Detailed API

references/api-reference.md — Decoder/Encoder/MeshBuilder full method signatures, Metadata, ExpertEncoder, Node.js.

安全使用建议
This appears safe to install as a reference skill. When following its examples, treat draco3d and the CDN decoder as normal third-party dependencies: pin versions, use trusted package sources, and review production dependency policy before adding them to a project.
能力评估
Purpose & Capability
The stated purpose is guidance for Google Draco mesh and point-cloud compression, and the artifacts contain matching decoding, encoding, Three.js, quantization, and API-reference material.
Instruction Scope
Instructions are scoped to user-directed code examples for Draco3D usage; no role changes, hidden agent instructions, broad filesystem access, credential handling, or unrelated automation were found.
Install Mechanism
The skill itself is markdown-only, but examples reference installing the draco3d npm package and using a versioned gstatic CDN decoder, which is disclosed and expected for this library integration.
Credentials
The examples would affect only project code and 3D assets when a user chooses to apply them; there is no evidence of local indexing, private data collection, or network use beyond the documented dependency/CDN.
Persistence & Privilege
No persistence, background workers, privilege escalation, automatic execution, credential/session use, or destructive actions are present in the artifacts.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install draco3d
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /draco3d 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of draco3d skill. - Provides Google Draco 3D geometry compression tools for JavaScript and web projects. - Supports compression and decompression of 3D meshes and point clouds. - Includes code examples for both decoding and encoding workflows. - Details integration with glTF loaders and Three.js via DRACOLoader. - Documents attribute constants, quantization, and memory management practices. - Links to detailed API reference for advanced usage.
元数据
Slug draco3d
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Draco3D — 3D Geometry Compression 是什么?

Google Draco 3D geometry compression library. Compresses and decompresses 3D meshes and point clouds, with glTF, Three.js, and Unity integration. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 32 次。

如何安装 Draco3D — 3D Geometry Compression?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install draco3d」即可一键安装,无需额外配置。

Draco3D — 3D Geometry Compression 是免费的吗?

是的,Draco3D — 3D Geometry Compression 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Draco3D — 3D Geometry Compression 支持哪些平台?

Draco3D — 3D Geometry Compression 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Draco3D — 3D Geometry Compression?

由 OpenLark(@openlark)开发并维护,当前版本 v1.0.0。

💬 留言讨论