contour-to-mesh
Skill2 starsChanged 3 days agoMITView on GitHub
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.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- keysforthewin/thisofficeedited, first seen Jul 24, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- keysforthewin/thisoffice★ 098% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/3d-fabric.mdcCursor rule
- 3d-fabricSkill
- animation-quality-gateSkill
- atlas-uv-fittingSkill
- blender-animationSkill
- blender-camerasSkill
- blender-exportSkill
- blender-lightingSkill
- blender-materialsSkill
- blender-modelingSkill
- blender-pro-workflowSkill
- blender-renderingSkill
- blender-skill-harmonizerSkill
- blender-uv-texturingSkill
- closed-surface-uv-coverageSkill
- fit-repair-optimizerSkill
- landmark-fit-repairSkill
- mascot-logo-reconstructionSkill
- multiview-constraint-solverSkill
- multiview-fit-loopSkill
- orbital-hud-motionSkill
- orthographic-registrationSkill
- quality-refinement-autoloopSkill
- reference-analysis-validatorSkill
- reference-look-calibrationSkill
- reference-to-3dSkill
- source-part-segmentationSkill
- text-to-blenderSkill
- texture-driven-mesh-fittingSkill
- texture-state-animationSkill
- wireframe-to-3dSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use when: Source-locked contour-derived meshes, silhouette-first modeling, triangulated mask/contour surfaces, mesh generation from OpenCV …
- Distinctive: line 12
Before the first Blender call, read ../text-to-blender/references/mcp-backends.md.
- Distinctive: line 15
Use this when a reference silhouette is the contract.
- Very specific: line 21
Run the generated Blender Python to create a named GEO_* mesh.
- Distinctive: line 23
Add depth only as a modifier or vertex displacement that preserves X/Z boundary positions.
- Distinctive: line 28
Do not use radial duplication unless the manifest says the source is symmetric.
- Distinctive: line 29
Do not use a generic ellipse if a contour exists.
- Very specific: line 53
When masks come from source-part-segmentation, preserve the part_inventory.json names in Blender: GEO_<part_name>, MAT_<part_name>, and UV …
- Distinctive: line 74
When a design sheet is painterly/stylized and separate orthographic views are not CAD-consistent, use a front-skin pass before sculptural …
- Distinctive: line 78
create a shallow 2.5D mesh whose X/Z boundary is that contour.
- Distinctive: line 80
add depth only along Y and behind the front surface.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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. 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
- Extract or select a clean contour/mask for one structural part.
- Generate a triangulated mesh recipe with
scripts/mask_to_mesh_recipe.py. - Run the generated Blender Python to create a named
GEO_*mesh. - Assign front-projected UVs immediately.
- Add depth only as a modifier or vertex displacement that preserves X/Z boundary positions.
- 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:
- choose the canonical front/master source;
- extract the visible subject mask as a filled contour;
- create a shallow 2.5D mesh whose X/Z boundary is that contour;
- assign full-image front-projected UVs so the rendered front matches the source pixels;
- add depth only along Y and behind the front surface;
- 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.pyextracts a largest/canonical foreground component and emits a mask + contour mesh recipe using full-image front-projected UV coordinates.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

