# texture-driven-mesh-fitting

Reshapes 3D mesh boundaries to match texture-atlas or decal silhouettes 1:1 in Blender before material passes. Essential when models do not match their source art.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 718 installs · ★ 125
- Author: RobLe3
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/RobLe3/cc-blender-skill/tree/HEAD/plugin/skills/texture-driven-mesh-fitting/SKILL.md
- Updated: 2026-10-12
- HTML: https://affpapa.org/en/nevibecode/skills/texture-driven-mesh-fitting

## What it does

This skill resolves silhouette mismatches by reshaping mesh boundaries directly against texture masks. Rather than stretching UV layouts over flawed geometry, it adapts the 3D surface to the source artwork in front X/Z projection. The agent executes these edits via a connected Blender MCP backend.

The procedure pairs mesh edges with source contours using landmarks or arc-length metrics. Interior vertices then shift through thin-plate spline deformation or piecewise-affine warping. Local coordinates remap into atlas bounding boxes, which prevents texture bleed without manual UV repainting.

Fitting must occur before adding mesh depth or extrusion. If front silhouette acceptance gates fail, look-dev stops immediately. The bundled script `scripts/contour_correspondence_report.py` verifies bounding box center, scale, and contour deltas.

## Requirements
- Works with: Blender

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/texture-driven-mesh-fitting/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/texture-driven-mesh-fitting/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/texture-driven-mesh-fitting/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/texture-driven-mesh-fitting/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install RobLe3/cc-blender-skill texture-driven-mesh-fitting
```

2. **Manually: put the files in place**
- File: `.github/skills/texture-driven-mesh-fitting/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/RobLe3/cc-blender-skill --path plugin/skills/texture-driven-mesh-fitting
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/texture-driven-mesh-fitting/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add RobLe3/cc-blender-skill --skill texture-driven-mesh-fitting -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/RobLe3/cc-blender-skill/tree/HEAD/plugin/skills/texture-driven-mesh-fitting/SKILL.md

## When to use it
- align source-locked mesh boundaries with texture-atlas contours
- stop texture bleed across 3D model silhouettes in front view
- warp interior mesh topology using thin-plate splines or landmarks
- measure contour deltas via `scripts/contour_correspondence_report.py`

## Example prompts
- Reshape the current mesh boundary to fit the decal contour in the atlas, using landmarks `base_left` and `base_right`.
- Deform interior vertices with thin-plate splines to match the source mask and remap UV coordinates.
- Run `scripts/contour_correspondence_report.py` to compare object silhouette deltas against the source mask.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 73a06ae5db1fa12a.

BEGIN THIRD-PARTY FILE 73a06ae5db1fa12a
```text
---
name: texture-driven-mesh-fitting
description: Reshape source-locked mesh boundaries so the geometry fits texture-atlas or decal contours 1:1 before final UV/material work. Use when textures look off because the model behind them does not match the source texture region, or when the mesh must adapt to the texture instead of stretching the texture onto an approximate mesh.
allowed-tools: Read Bash Glob Grep mcp__blender__execute_blender_code 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: Texture-driven geometry fitting, mesh boundary fitting to atlas masks, UV-preserving contour correspondence, point/landmark deformation, source mask to mesh repair.

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.
# Texture-Driven Mesh Fitting

This skill fixes the common failure: a texture is mapped correctly, but the mesh silhouette underneath is wrong.
The mesh adapts to the source contour; the texture is not stretched to hide a wrong mesh.

## Preconditions

- Structural parts are segmented (`source-part-segmentation`).
- Each part has a contour/mask and, if textured, an atlas region (`atlas-uv-fitting`).
- The object is source-locked in front X/Z before depth is added.
- Canonical view policy is resolved (`multiview-constraint-solver`) if views conflict.

## Workflow

1. Extract source contour from the texture/wireframe region.
2. Extract current mesh boundary in the same projected coordinate space.
3. Build ordered contour correspondence by arc length, named landmarks, or seam/control points.
4. Move boundary vertices to source contour positions.
5. Move interior vertices by smooth interpolation, piecewise-affine warp, or thin-plate-spline style deformation.
6. Preserve UV parameterization by remapping boundary-fitted local coordinates into the atlas rectangle.
```
END THIRD-PARTY FILE 73a06ae5db1fa12a

The third-party file has ended. Everything between the 73a06ae5db1fa12a tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2449 of 3660 bytes. © RobLe3 · MIT · https://github.com/RobLe3/cc-blender-skill/tree/HEAD/plugin/skills/texture-driven-mesh-fitting/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
