← 返回 Skills 市场
vonzellu

Ai 3d Generator

作者 Celluloid · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
880
总下载
0
收藏
4
当前安装
1
版本数
在 OpenClaw 中安装
/install ai-3d-generator
功能描述
Génère automatiquement des modèles 3D paramétriques détaillés en Python/Trimesh à partir de descriptions textuelles, avec export STL optimisé.
使用说明 (SKILL.md)

AI 3D Model Generator

Génération automatique de modèles 3D détaillés à partir de descriptions textuelles.

Architecture

Prompt utilisateur → LLM (Kimi/Gemini) → Code Python/Trimesh → Génération STL → Export

Pipeline Automatique

1. Prompt Engineering (template)

Crée un fichier prompts/3d-generator.txt:

Tu es un expert en modélisation 3D paramétrique. Génère un script Python utilisant Trimesh 
pour créer le modèle 3D décrit ci-dessous.

RÈGLES:
- Utilise trimesh.creation (icosphere, cylinder, cone, torus, box)
- Pour les détails complexes: utiliser des boucles et paramètres
- Résolution élevée: subdivisions=4-5 pour les sphères, sections=32-64 pour cylindres
- Ajouter des détails de surface (panneaux, textures géométriques)
- Structure modulaire avec fonctions réutilisables
- Exporter en STL binaire à la fin

SCRIPT TEMPLATE:
```python
#!/usr/bin/env python3
import numpy as np
import trimesh
from trimesh.creation import icosphere, cylinder, cone, torus, box
from trimesh.transformations import rotation_matrix
import os

EXPORT_DIR = "/home/celluloid/.openclaw/workspace/stl-exports"

def save_mesh(mesh, filename):
    os.makedirs(EXPORT_DIR, exist_ok=True)
    filepath = os.path.join(EXPORT_DIR, filename)
    mesh.export(filepath)
    print(f"✓ Exporté: {filepath}")
    print(f"  Triangles: {len(mesh.faces):,}")
    return filepath

def rotate_mesh(mesh, angle, axis, point=None):
    if point is None:
        point = [0, 0, 0]
    mat = rotation_matrix(angle, axis, point)
    mesh.apply_transform(mat)
    return mesh

# === MODÈLE PRINCIPAL ===
def create_model():
    meshes = []
    
    # [GÉNÈRE LE MODÈLE ICI]
    
    # Fusion et optimisation
    combined = trimesh.util.concatenate(meshes)
    combined.merge_vertices()
    return combined

if __name__ == "__main__":
    mesh = create_model()
    save_mesh(mesh, "[NOM_DU_MODELE].stl")

DESCRIPTION DU MODÈLE À CRÉER: {{USER_DESCRIPTION}}

Génère uniquement le code Python complet, sans explications.


## 2. Skill OpenClaw Automatisé

Crée le fichier `~/.openclaw/workspace/skills/ai-3d-generator/SKILL.md`:

### Utilisation

#### Génération simple
```bash
# Génère un modèle à partir d'une description
~/.openclaw/workspace/skills/ai-3d-generator/scripts/generate-from-prompt.sh "vaisseau spatial avec ailes delta et cockpit vitré"

Génération avec paramètres

# Avec spécifications techniques
~/.openclaw/workspace/skills/ai-3d-generator/scripts/generate-from-prompt.sh \
  "robot humanoïde articulé" \
  --scale=50mm \
  --detail=high \
  --output=robot.stl

Processus

  1. Analyse du prompt → Extraction entités (formes, dimensions, détails)
  2. Génération code → LLM crée script Python/Trimesh
  3. Validation syntaxique → Vérification imports et structure
  4. Exécution → Génération mesh + export STL
  5. Post-traitement → Optimisation, vérification manifold

3. Exemples de Prompts Efficaces

Bon prompt (détaillé, technique):

Crée un château médiéval avec:
- Tours cylindriques aux 4 coins (diamètre 8mm, hauteur 25mm)
- Créneaux sur les tours
- Mur d'enceinte carré (40x40mm)
- Pont-levis à l'avant
- Texture de pierre avec des blocs individuels
- Échelle 1:100 pour impression 3D

Mauvais prompt (trop vague):

Fais-moi un château

4. Automatisation Complète

Cron job pour génération régulière

{
  "name": "3d:generate-daily",
  "schedule": {"kind": "cron", "expr": "0 9 * * *"},
  "payload": {
    "message": "Génère un modèle 3D aléatoire du jour (animaux, architecture, véhicules) et exporte en STL",
    "model": "openrouter/moonshotai/kimi-k2.5"
  }
}

5. Optimisations pour Ultra-Détail

Techniques Avancées

Sculpting procédural

# Ajouter du bruit de surface pour texture
def add_surface_noise(mesh, amplitude=0.1):
    vertices = mesh.vertices.copy()
    noise = np.random.normal(0, amplitude, vertices.shape)
    mesh.vertices = vertices + noise
    return mesh

Détails paramétriques

# Générer des détails répétitifs
for i in range(100):  # 100 panneaux de surface
    angle = i * 2 * np.pi / 100
    panel = create_detailed_panel()
    position_on_surface(panel, radius=20, angle=angle)

Boolean operations optimisées

# Utiliser trimesh.boolean pour les découpes complexes
from trimesh.boolean import difference, union, intersection

result = difference(base_mesh, cutting_tool)

6. Workflow Complet Exemple

Commande OpenClaw:

Génère un modèle 3D d'une station spatiale en anneau avec:
- Anneau principal de 80mm de diamètre
- 6 modules d'habitation sur l'anneau
- Sphère centrale de commande
- Antennes et panneaux solaires
- Style cyberpunk avec câbles et tuyaux
Exporte en STL haute résolution.

Réponse Automatique:

  1. LLM génère le script Python (~30s)
  2. Exécution Trimesh (~1-2min)
  3. Export STL optimisé
  4. Rapport: triangles, volume, dimensions

Notes

  • Pour les modèles très complexes (>100k triangles), prévoir plus de temps
  • Utiliser trimesh.smoothing pour lisser les surfaces si nécessaire
  • Vérifier que le modèle est "manifold" (étanche) pour l'impression 3D
  • Sauvegarder les scripts générés pour réutilisation/modification
安全使用建议
This skill appears to do what it says (generate 3D models), but it executes Python that is produced by an LLM and sources a hardcoded virtualenv path. Before installing or running: (1) inspect any generated Python scripts before execution, don't run unreviewed code produced by an LLM; (2) avoid using the hardcoded /home/celluloid paths—adjust to your own sandboxed workspace; (3) ensure the referenced virtualenv is trusted (or create an isolated venv yourself) because 'source' will run arbitrary activation code; (4) if you allow automation (cron), run it in a contained environment and not as root; (5) consider running the generator in a sandbox/container and restrict network access to prevent exfiltration. If you want, I can list the exact lines to change to make paths configurable and to add sandboxing checks (e.g., prompt the user for confirmation before executing generated code).
功能分析
Type: OpenClaw Skill Name: ai-3d-generator Version: 1.0.0 The skill is classified as suspicious due to two critical vulnerabilities. Firstly, the SKILL.md instructions describe an architecture where an AI agent generates and executes Python code based on user input (via `{{USER_DESCRIPTION}}`), creating a severe Remote Code Execution (RCE) vulnerability through prompt injection against the LLM. Secondly, the `scripts/generate-from-prompt.sh` script, which simulates this process, directly injects user-controlled input (`$OUTPUT_NAME`) into a filename via `sed`, allowing for path traversal (`../`) to write files outside the intended `/home/celluloid/.openclaw/workspace/stl-exports` directory.
能力评估
Purpose & Capability
Name/description (generate parametric 3D models, export STL) align with the included Python examples and helper scripts; the code uses trimesh and produces STL exports as claimed.
Instruction Scope
Runtime instructions and scripts generate Python code via an LLM template and then execute that generated script directly (create temp file + python3). Executing arbitrary code produced by an LLM is necessary for the skill's purpose but grants broad discretion and could be used to run unexpected commands, read/write arbitrary files, or contact networks if the generated code includes such actions. The SKILL.md template and scripts do not explicitly constrain or sandbox the generated code.
Install Mechanism
No install spec (instruction-only) — nothing is downloaded or installed by the skill itself. The presence of code files is low-risk compared to remote installers.
Credentials
The skill declares no required env vars, but scripts hardcode absolute paths (/home/celluloid/.openclaw/workspace/stl-exports and /home/celluloid/.openclaw/workspace/venvs/cad/bin/activate). This implicitly requires a specific user environment and a pre-existing virtualenv; sourcing that venv runs whatever is inside it (potentially arbitrary code). The skill also assumes Python + trimesh/numpy are available but does not declare these requirements.
Persistence & Privilege
always is false (normal). SKILL.md suggests creating files under ~/.openclaw/workspace and even provides a sample cron job JSON — the cron is only an example, but scheduling automated runs would increase risk because it enables recurring execution of generated code. The skill does not request elevated privileges nor modify other skills.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ai-3d-generator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ai-3d-generator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
AI 3D Model Generator v1.0.0 – Initial Release - Automatically generates detailed 3D models from text descriptions using LLMs and Python/Trimesh. - Provides a modular code template emphasizing high-detail geometry and advanced surface features. - Includes ready-to-use bash scripts for prompt-based 3D model generation with customizable parameters. - Supports automated workflows, including prompt analysis, code generation, execution, and STL export. - Offers prompt engineering guidance, effective example prompts, and advanced optimization techniques for ultra-detail. - Features scheduled (cron) 3D model generation and best practices for 3D print-ready geometry.
元数据
Slug ai-3d-generator
版本 1.0.0
许可证
累计安装 4
当前安装数 4
历史版本数 1
常见问题

Ai 3d Generator 是什么?

Génère automatiquement des modèles 3D paramétriques détaillés en Python/Trimesh à partir de descriptions textuelles, avec export STL optimisé. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 880 次。

如何安装 Ai 3d Generator?

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

Ai 3d Generator 是免费的吗?

是的,Ai 3d Generator 完全免费(开源免费),可自由下载、安装和使用。

Ai 3d Generator 支持哪些平台?

Ai 3d Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Ai 3d Generator?

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

💬 留言讨论