Threejs structure parser

From XuShuwenn/RedAct · View interactive version

Threejs structure parser is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Parse Three.js object.js file to extract mesh hierarchy, part structure, and export individual part meshes as OBJ files.

How to use this skill

Skill file

Three.js Structure Parser

When to Use

Input

Mandatory parsing discipline

Input

Execution Guardrails

Output Structure

/root/output/
├── part_meshes/
│   ├── <part_name_1>/
│   │   ├── <mesh_name1>.obj
│   │   └── ...
│   └── ...
└── links/
    ├── <part_name_1>.obj
    └── ...

Path rule: write mesh OBJs directly under part_meshes/<part_name>/ and part-level combined files under links/<part_name>.obj.

Requirements for completion:

Approach

  1. Read and inspect the full relevant contents of object.js, including createScene() and related helper code, before naming parts or describing hierarchy
  2. Parse the verified scene structure; do not infer hierarchy from imports, comments, or partial snippets
  3. Enumerate all primitive-defined THREE.Mesh objects and all THREE.Group nodes actually created
  4. Record each mesh and its parent group path; traverse groups recursively rather than checking only top-level children
  5. Derive confirmed part names from the discovered hierarchy and map each mesh to its requested part output
  6. Export individual meshes as OBJ under /root/output/part_meshes/<part_name>/
  7. Create one part-level link OBJ per extracted part under /root/output/links/
  8. If helper code is needed, keep it in an allowed output location
  9. Before finalizing, verify the exported outputs against the parsed source structure: confirm both output trees exist, expected part directories were created, and discovered meshes/parts are represented by the files actually written

Three.js Components

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.