본문으로 건너뛰기
cccskills
무료GitHub에 공개

obj-exporter

Three.js OBJExporter utility for exporting 3D geometry to Wavefront OBJ format. Use when converting Three.js scenes, meshes, or geometries to OBJ files for use in other 3D software like Blender, Maya, or MeshLab.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Blender
설치 방법 보기

포함된 파일(1)

  • SKILL.md4.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

OBJExporter Guide

Basic Structure

OBJ is a text-based 3D geometry format:

# Comment
v x y z        # Vertex position
vn x y z       # Vertex normal
f v1 v2 v3     # Face (triangle)
f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3  # Face with texture/normal indices

Example:

# Cube
v 0 0 0
v 1 0 0
v 1 1 0
v 0 1 0
f 1 2 3
f 1 3 4

Three.js OBJExporter

Three.js provides OBJExporter in examples:

import { OBJExporter } from 'three/examples/jsm/exporters/OBJExporter.js';

const exporter = new OBJExporter();
const objString = exporter.parse(object3D);

// Write to file (Node.js)
import fs from 'fs';
fs.writeFileSync('output.obj', objString);

Exporting with World Transforms

To export geometry in world coordinates:

// Update world matrices first
root.updateMatrixWorld(true);

// Clone and transform geometry
const worldGeometry = mesh.geometry.clone();
worldGeometry.applyMatrix4(mesh.matrixWorld);

// Create new mesh for export
const exportMesh = new THREE.Mesh(worldGeometry);
const objData = exporter.parse(exportMesh);

Merging Multiple Geometries

import { mergeGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js';

const geometries = [];
root.traverse((obj) => {
  if (obj instanceof THREE.Mesh) {
    const geom = obj.geometry.clone();
    geom.applyMatrix4(obj.matrixWorld);
    geometries.push(geom);
  }
});

const merged = mergeGeometries(geometries);
const mergedMesh = new THREE.Mesh(merged);
const objData = exporter.parse(mergedMesh);

Node.js ES Module Setup

For running Three.js in Node.js:

// package.json
{ "type": "module" }
// script.js
import * as THREE from 'three';
import { OBJExporter } from 'three/examples/jsm/exporters/OBJExporter.js';

OBJ Export for Scene Components

Component Definition (Hierarchy-Aware)

Treat each named THREE.Group as a component/part. Preserve hierarchy by using the nearest named parent group in the ancestor chain as the owning component for each mesh. Call root.updateMatrixWorld(true) before exporting so matrixWorld is correct.

function collectComponentMeshes(root) {
    const componentMap = {};
    root.traverse(obj => {
        if (obj instanceof THREE.Group && obj.name) {
            componentMap[obj.name] = { group: obj, meshes: [] };
        }
    });

    root.traverse(obj => {
        if (obj instanceof THREE.Mesh) {
            let parent = obj.parent;
            while (parent && !(parent instanceof THREE.Group && parent.name)) {
                parent = parent.parent;
            }
            if (parent && componentMap[parent.name]) {
                componentMap[parent.name].meshes.push(obj);
            }
        }
    });

    return Object.fromEntries(
        Object.entries(componentMap).filter(([_, data]) => data.meshes.length > 0)
    );
}

Export Individual Meshes (World Transforms)

import { OBJExporter } from 'three/examples/jsm/exporters/OBJExporter.js';

const exporter = new OBJExporter();

function exportMesh(mesh, filepath) {
    let geom = mesh.geometry.clone();
    geom.applyMatrix4(mesh.matrixWorld);
    if (geom.index) {
        geom = geom.toNonIndexed();
    }
    if (!geom.attributes.normal) {
        geom.computeVertexNormals();
    }
    const tempMesh = new THREE.Mesh(geom);
    tempMesh.name = mesh.name;
    const objData = exporter.parse(tempMesh);
    fs.writeFileSync(filepath, objData);
}

Export Merged Component Meshes (Optional)

import { mergeGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js';

function mergeMeshes(meshes) {
    const geometries = [];
    for (const mesh of meshes) {
        let geom = mesh.geometry.clone();
        geom.applyMatrix4(mesh.matrixWorld);
        if (geom.index) {
            geom = geom.toNonIndexed();
        }
        if (!geom.attributes.normal) {
            geom.computeVertexNormals();
        }
        geometries.push(geom);
    }
    if (geometries.length === 0) return null;
    return new THREE.Mesh(mergeGeometries(geometries, false));
}

Output Paths

Write OBJ files to the paths specified by the task instructions or a provided output root variable. Avoid hardcoding fixed directories in the skill itself.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching `acopf-math-model.md` and MATPOWER branch fields. Use when computing branch flows in either direction, aggregating bus injections for nodal balance, checking MVA (rateA) limits, computing branch loading %, or debugging sign/units issues in AC power flow.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

Redact text from PDF documents for blind review anonymization

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

Use when checking simplified ADA-derived plan-view bathroom accessibility constraints such as turning space, door clear width, toilet centerline, grab bars, and lavatory knee/toe clearance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

Analyze failed GitHub Action jobs for a pull request.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

Use when extracting plan-view architectural geometry from DXF files with semantic CAD layers, especially when outputs must normalize rooms, doors, fixtures, clearances, and grab bars into machine-checkable JSON.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

benchflow-ai/skillsbench1.9천2026년 10월 13일 업데이트

benchflow-ai의 스킬 모두 보기

이 스킬의 문제 신고