К основному содержанию
скилл CX Codex

contour-to-mesh — скилл для Claude Code: меш из 2D-контура

Строит меш в Blender прямо из контура или маски, а не из примерных примитивов. Нужен, когда силуэт должен совпасть с шаблоном один в один.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add RobLe3/cc-blender-skill --skill contour-to-mesh -a claude-code
Открыть на GitHub

Что делает contour-to-mesh

Скилл берёт чистый контур одной структурной части и превращает его в триангулированный меш. Сначала генерируется рецепт скриптом scripts/mask_to_mesh_recipe.py, потом запускается Blender Python и создаётся именованный меш GEO_*. UV проецируются с фронта сразу после создания.

Глубина добавляется только модификатором или смещением вершин, которое не двигает границы по X/Z. Границы — это контракт: bevel, solidify, subdivision, shrinkwrap и sculpt не должны менять фронтальный силуэт, пока не появится новая маска. Координаты отображаются так: x картинки в X, y в Z с вертикальным переворотом, Y — только толщина.

Есть отдельный проход front_locked_visual_skin для рисованных листов, где ортографические виды не согласованы между собой: фронтальная кожа становится визуальным критерием приёмки, а объём добавляется позже. Перед первым вызовом Blender нужно прочитать ../text-to-blender/references/mcp-backends.md и дальше держаться выбранного бэкенда. Для работы нужен MCP-сервер Blender: без него скилл не запустит код в сцене.

Какие задачи решает

  • собрать меш по силуэту маскота вместо эллипса
  • сохранить точные границы лепестка или листа
  • сделать заливку из контура OpenCV
  • построить неглубокий барельеф с фронтальной UV-проекцией
  • перенести имена частей из part_inventory.json в Blender

Примеры запросов агенту

  • Построй меш из маски mask.png и назови его GEO_petal, границы по X/Z не двигай
  • Сделай фронтальную UV-проекцию и добавь глубину только по Y
  • Собери front_locked_visual_skin для логотипа и сверь фронтальный рендер с исходной маской

Как установить contour-to-mesh

1Через Skills CLI (Vercel)

npx skills add RobLe3/cc-blender-skill --skill contour-to-mesh -a claude-code

2Вручную: положить файлы

~/.claude/skills/contour-to-mesh/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/contour-to-mesh/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о contour-to-mesh

Как установить contour-to-mesh в Claude?

Выполните npx skills add RobLe3/cc-blender-skill --skill contour-to-mesh -a claude-code. После этого файл скилла лежит в ~/.claude/skills/contour-to-mesh/SKILL.md.

Что делает contour-to-mesh?

Строит триангулированный меш Blender из 2D-контура или маски, назначает фронтальные UV и добавляет глубину так, чтобы фронтальный силуэт остался прежним.

Что нужно для работы скилла?

MCP-сервер Blender с инструментами вроде execute_blender_code и render_viewport_to_path. Перед первым вызовом скилл просит прочитать ../text-to-blender/references/mcp-backends.md и не менять выбранный бэкенд до конца задачи.

Исходный текст

SKILL.md · MIT
---
name: contour-to-mesh
description: Build Blender mesh surfaces directly from extracted 2D contours/masks instead of approximate primitives. Use for 1:1 mascot/logo reconstruction, exact leaf/petal silhouettes, filled wireframe shapes, shallow bas-relief forms, or when the model outline must match a front template before adding depth.
allowed-tools: Read Bash Glob Grep mcp__blender__execute_blender_code mcp__blender__get_scene_info mcp__blender__get_object_info mcp__blender__get_objects_summary mcp__blender__get_object_detail_summary mcp__blender__render_viewport_to_path mcp__blender__search_api_docs mcp__blender_official__execute_blender_code mcp__blender_official__get_objects_summary mcp__blender_official__get_object_detail_summary mcp__blender_official__render_viewport_to_path mcp__blender_official__search_api_docs
---


## MCP backend

Use when: Source-locked contour-derived meshes, silhouette-first modeling, triangulated mask/contour surfaces, mesh generation from OpenCV contours, or replacing generic ellipses/primitives with measured shapes.

Before the first Blender call, read [../text-to-blender/references/mcp-backends.md](../text-to-blender/references/mcp-backends.md). Prefer official MCP for shared capabilities; preserve the selected backend for the whole task. Tool names in recipes are client/legacy examples: map them through that reference and its agent-host guide.
# Contour to Mesh

Use this when a reference silhouette is the contract. The mesh starts as a filled 2D contour in front-view X/Z, then gets shallow Y depth/crown after validation.

## Workflow

1. Extract or select a clean contour/mask for one structural part.
2. Generate a triangulated mesh recipe with `scripts/mask_to_mesh_recipe.py`.
3. Run the generated Blender Python to create a named `GEO_*` mesh.
4. Assign front-projected UVs immediately.
5. Add depth only as a modifier or vertex displacement that preserves X/Z boundary positions.
6. Validate the front render against the source mask.

## Hard rules

- Do not use radial duplication unless the manifest says the source is symmetric.
- Do not use a generic ellipse if a contour exists.
- Boundary vertices must keep source X/Z coordinates.
- Depth deformation may move Y and inner vertices, but must not alter front silhouette.
- One structural source part should become one named structural mesh.

## Blender pattern

Generated mesh coordinates should map image `x` to Blender `X` and image `y` to Blender `Z` with vertical flip. Use `Y` only for thickness/depth.


## Front-plane rotation rule

In this Blender coordinate convention, the front camera looks along the Y axis and the reference silhouette lives in the X/Z plane. Therefore 2D rotations inside the front view are rotations around the **Y axis**, not around Z. Use `rotation_euler = (0, angle, 0)` for 2D component orientation in the front projection. Z rotation spins objects into/out of screen-space incorrectly for X/Z-plane meshes.

## Sources distilled

- Blender Mesh API: create meshes from vertices/faces using `from_pydata`.
- Blender BMesh: use for cleanup, triangulation, normals, smoothing.
- OpenCV contours: detect and simplify boundaries.
- Delaunay triangulation: useful for filled interior meshes when filtered by mask containment.


## Part-inventory handoff

When masks come from `source-part-segmentation`, preserve the `part_inventory.json` names in Blender:
`GEO_<part_name>`, `MAT_<part_name>`, and UV layer names. Mesh generation must record:

- source image size;
- source mask path;
- contour boundary point count;
- boundary landmark points (tip, base-left, base-right, centroid/extrema) when detectable;
- atlas UV rectangle or projection mode.

For exact mascot/logo work, generate boundary vertices from the contour and add interior vertices only for surface support.
The boundary is a contract: bevels, solidify, subdivision, shrinkwrap, or sculpt passes must not move front-view X/Z boundary vertices unless a new source mask is produced.

## Hole and stroke policy

- Filled structural masks become meshes.
- Wireframe strokes guide boundaries/landmarks; they are not structural meshes unless the manifest classifies them as decorative linework.
- Holes/negative regions should be kept as separate cut masks when they affect silhouette; otherwise implement them as decals/material masks.


## Source-locked front-skin fallback

When a design sheet is painterly/stylized and separate orthographic views are not CAD-consistent, use a **front-skin** pass before sculptural interpretation:

1. choose the canonical front/master source;
2. extract the visible subject mask as a filled contour;
3. create a shallow 2.5D mesh whose X/Z boundary is that contour;
4. assign full-image front-projected UVs so the rendered front matches the source pixels;
5. add depth only along Y and behind the front surface;
6. optionally add separate relief/backing parts for side plausibility, but keep the front skin as the visual acceptance gate.

This is a generic fallback for logos/mascots where a faithful front read is more important than speculative volume. Mark it as `front_locked_visual_skin`, not as a fully solved turntable model.

## Script

- `scripts/source_locked_skin_recipe.py` extracts a largest/canonical foreground component and emits a mask + contour mesh recipe using full-image front-projected UV coordinates.

© RobLe3 · MIT · RobLe3/cc-blender-skill

Похожие скиллы

Всё по теме «Геймдев и 3D: Unity, Unreal, Godot, Blender» →
scenario-blender-retopology scenario-labs Помогает превратить плотный скульпт, скан или AI-меш в аккуратную топологию в Blender: петли, полюса, Shrinkwrap, подготовка лоу-поли под запекание. CX Codex +1 384установок scenario-blender-uv-baking scenario-labs Ведёт агента по развёртке UV и запеканию карт в Blender: швы, плотность текселей, упаковка, UDIM и разбор брака на бейке. CX Codex +1 389установок Blender SFKislev Скилл связывает агента с открытым Blender через мост Flue. Он выполняет код в среде bpy без MCP-сервера и возвращает структурированный JSON. CX Codex +1 2 800установок 3d-modeling omer-metin Скилл для работы с 3D-моделями: подсказывает по топологии, развёртке, ретопологии и LOD. Пригодится, когда агент помогает готовить меш под игру или кино. CX Codex +1 1 200установок vgpu vercel-labs Скилл помогает создавать и отлаживать WebGPU-проекты на базе vgpu, опираясь на встроенную документацию установленного в проекте пакета. CX Codex +1 1 600установок cli-anything-blender HKUDS Скилл, который добавляет stateful-интерфейс командной строки для редактирования 3D-сцен в Blender. Пригодится, когда агенту нужно собрать сцену, назначить материалы или отрендерить кадр без ручного кликанья. CX Codex +1 954установок

Из того же набора23

text-to-blender Управляет Blender через MCP-сервер по текстовым запросам. Помогает собирать 3D-сцены, настраивать материалы, свет, камеры и запускать рендер без ручной возни в окне программы. CX Codex +1 1 000установок blender-skill-harmonizer Мета-слой для стека Blender-скиллов: задаёт очерёдность активации, артефакты передачи и правила разрешения конфликтов, когда задача задевает несколько скиллов сразу. CX Codex +1 830установок reference-analysis-validator Скилл измеряет референсы и рендеры Blender и не даёт объявить модель точной копией, пока метрики не сойдутся. CX Codex +1 826установок reference-look-calibration Скилл сравнивает превью продукта с исходным изображением по метрикам цвета, яркости и маски и правит материалы, свет и кадрирование в Blender. CX Codex +1 797установок orthographic-registration Скилл сводит фронтальный, боковой, задний и верхний ортографические виды в одну систему координат Blender. Нужен, когда фронт выглядит нормально, а силуэты сбоку и сзади разъезжаются. CX Codex +1 786установок multiview-fit-loop Закрывает цикл рендер → сравнение → правка → повторный рендер, пока модель не совпадёт с шаблонами вида спереди, сбоку, сзади и сверху. CX Codex +1 784установок wireframe-to-3d Превращает PNG-чертежи в ортогональных проекциях в 3D-модель Blender и выгружает её в .glb. Пригодится, когда есть фронтальный и боковой вид, а меша ещё нет. CX Codex +1 787установок multiview-constraint-solver Проверяет, сходятся ли ортографические виды front, side, back и top в одну жёсткую модель Blender, и выбирает канонический источник до пересборки. CX Codex +1 737установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой