cgs-mold
Turn a gun scan into a handoff-ready custom-gear.ch (René Spatz) holster split-mold, fully inside Blender via blender-mcp. Use when the owner says "make a mold from this scan", "cgs-mold", "turn <gun> scan into a mold", or provides a gun scan + active Blender MCP and asks for a holster mold. Blender-only — no FreeCAD.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- cgs-mold
- triggers
- [ "cgs-mold", "/cgs-mold", "holster mold", "gun scan to mold", "make a mold from this scan", "turn this scan into a mold" ]
- description
- Turn a gun scan into a handoff-ready custom-gear.ch (René Spatz) holster split-mold, fully inside Blender via blender-mcp. Use when the owner says "make a mold from this scan", "cgs-mold", "turn <gun> scan into a mold", or provides a gun scan + active Blender MCP and asks for a holster mold. Blender-only — no FreeCAD.
02 资源文件 3
- 参考文档METHOD-NOTES.md13.5 KB
- 参考文档params/hk45.json1.7 KB
- 脚本scripts/cgs_mold.py15.5 KB
03 SKILL.md 正文
cgs-mold — gun scan → holster split-mold (Blender-only)
Pipeline that reproduces René Spatz's custom-gear.ch holster blocking inside Blender, driven over blender-mcp. Input: a gun-scan mesh already in the Blender file (or an STL to import) + the MCP server live. Output: a cut, smoothed, offset mold object ready for STL export + handoff.
★ SOURCE OF TRUTH =
METHOD-NOTES.md. It holds the live, owner-validated gun-dip method + the root-cause findings. The pipeline below is the current method; the OLD heightfield-sweep / hammer-cut pipeline is superseded (kept only in git history).
Failure-anchored rules (verified 2026-06-29/30):
- Never round the SCAN's detail (no voxel/marching-cubes to retopo the scan surface — it washes the sharp swept edges; the recurring 2026-06-28 failure).
- The mold MUST be a FILLED SOLID before any boolean cut. A swept mold often comes out as a
closed shell with internal walls (
nonmanifold>0withboundary==0). A boolean can't read inside-vs-outside through internal walls → it tears / empties / leaves the cut piece. Fix = voxel-remesh the MOLD (not the scan) into one filled solid (manifold 0/0, single island), THEN cut. Detail softened by the fill is recovered by the feature-preserving smooth (step 4). <!-- @anchor: v2 | failure: blender holster sessions 1–3 + 2026-06-28 retopo breakage + 2026-06-29 boolean-tears-on-hollow-shell | regression: METHOD-NOTES.md ★ROOT CAUSE; solidify-then-cut (voxel-fill → FLOAT cube DIFFERENCE) -->
Pipeline (owner gun-dip method — validated)
- Swept solid (the dip) — gun-solid drawn continuously along the draw axis (+Y) through a block carves a continuous cavity; invert + solidify → the swept-gun positive = the mold. No stepping (union-of-copies = steps = rejected).
- Solidify / fill — voxel-remesh the mold into ONE filled solid (manifold 0/0, single island, bbox preserved). This is the precondition for a clean cut (see failure-rule 2). [VALIDATED]
- Grip cut — separate CUBE cutter,
BOOLEAN DIFFERENCE,solver='FLOAT'on the solid (EXACT empties on heavy voxel meshes). Diagonal plane through two owner-set points: first = trigger-guard/grip corner,corner_below_mm(20) BELOW; second = beavertail,beavertail_below_mm(10) BELOW. Cube top face on that line, body on the grip side; delete cube. [VALIDATED] - Smooth / retouch (
smooth_mold) — feature-preserving denoise of the voxel surface; smooth AND sharp (keeps edges, bevels, grooves, corners crisp, no global rounding). 4 sub-passes: flat Taubin denoise (sharp creases frozen) → crease-line de-zigzag (1D midpoint along the crease, corners frozen — this is what makes a jagged edge smooth and still sharp) → roughness deburr (melt voxel stair-steps by Laplacian magnitude, topology-agnostic) → crease re-straighten. [VALIDATED] 4b. Overhang cleanup (remove_overhang) — strong local collapse of any stray flap/hook "hanging over" the cut edge (e.g. the beavertail remnant). Gentle smoothing won't shift a flap; a tight high-iteration local Laplacian pulls it flush while the flat cut verts hold. [VALIDATED] - Offset +0.4 mm — SLIDE REGION ONLY (
offset_mold) — owner corrected (2026-06-30): the +0.4mm Kydex-shrink comp goes on the barrel + slide + beavertail only (the top assembly above the slide/frame parting line,z_line≈14mm), NOT everywhere — the grip/frame/trigger guard stay put. Push the region verts outward along normals, feathered ~2mm at the line (no ridge). Verify the region bbox grew outward (else normals were inward). [VALIDATED] - Split into clamshell halves (
split_mold) — owner spec (2026-06-30): a clean SPLIT, NOT a material-removing saw cut.bisect_plane+holes_fillon each side → two capped, closed, manifold halves that together reconstitute the whole mold (verified 0.006% volume loss = float noise). The seam is a VERTICAL plane through the barrel BORE axis — circle-fit the muzzle crown (_bore_center_x), NOT the mold symmetry plane/centroid (one-sided controls pull that off the bore; "center of the barrel, not the centre of the entire mold"). [VALIDATED]- alignment pins on the mating faces — [TODO]
- Done — export STL, hand to René. [TODO]
Invocation (blender-mcp must be live on :9876)
Run the engine inside Blender via execute_blender_code; it execs the on-disk module so the
heavy logic stays version-controlled:
import json
exec(open("/Users/marcelspatz/YURI-OS-MUSUBI/skills/cgs-mold/scripts/cgs_mold.py").read(), globals())
params = json.load(open("/Users/marcelspatz/YURI-OS-MUSUBI/skills/cgs-mold/params/hk45.json"))
build_mold("<MOLD_SHELL_OBJECT>", params) # solidify -> cut -> 4-stage smooth; never edits the input
build_mold runs the validated CORE (solidify → cut → smooth) on a swept-mold shell object. The
stages are also callable individually — solidify_mold, cut_grip, smooth_mold, remove_overhang
— so the owner can tune one stage and render between. Each returns (object, summary_dict) and is
non-destructive (every stage builds a NEW object). build_mold writes /tmp/cgs_mold_summary.json.
Verify by rendering the result object after each stage (bpy.ops.render.opengl(view_context=True)
to a PNG, then Read it). The owner's eye sets cut placement + smooth strength — don't trust counts alone.
Parameters (per-gun preset JSON in params/)
solidify.voxel_size(0.7) — voxel-fill resolution; finer = less stepping, heavier mesh.grip_cut:solver(FLOAT),corner_below_mm(20),beavertail_below_mm(10) — the two cut points.smooth(optional overrides) —feature_angle(50), pass counts,deburr_thr; defaults are baked intosmooth_mold.out_name,render.
Cut points are auto-detected then tuned visually per scan — _find_cut_points locates the
trigger-guard/grip corner (knee of the bottom-Z profile) + the beavertail (rearmost mid-height vert),
the owner's eye sets the final *_below_mm. New gun → copy hk45.json, adjust the two offsets.
Safety conventions (born from 2026-06-28)
- Non-destructive: reads only the scan's verts; the source object is never mutated; every run creates a NEW object and hides the scan. No in-place edits, no booleans on the scan.
- Render-verify every run before claiming done; tune against the PNG, don't trust counts.
- If a mesh op would mutate existing geometry, snapshot/duplicate first.
Status / scope
- VALIDATED (owner-confirmed 2026-06-30, "this is successful"): solidify (voxel-fill) → grip cut
(FLOAT cube DIFFERENCE, corner−20/beavertail−10) → 4-stage feature-preserving smooth → overhang cleanup.
Manifold 0/0 throughout. Deliverable on HK45 =
CGS_MOLD_FINAL. - TODO: +0.4mm offset, un-subdivide/decimate, X/Y split into clamshell halves + alignment pins, STL export gate.
- Upstream not re-validated this session: the seal→dip/sweep stages that produce the mold shell (this run started from a pre-existing swept shell). Those need their own validation pass + functions.
Session Notes
2026-07-06
- session: 54m | peak ctx: 0% | compacts: 0
- tools: Bash×601, Read×198, Edit×56, WebFetch×28, Write×17, Agent×13, WebSearch×9, StructuredOutput×9, ToolSearch×8, mcp×2, ReportFindings×2, TaskList×1, TaskOutput×1, Workflow×1, CronCreate×1
- corrections: none
- errors: none
2026-06-30
- session: 1167m | peak ctx: 0% | compacts: 0
- tools: Read×2267, Shell×951, Grep×328, Write×271, mcp×54, Bash×38, Edit×18
- corrections: that was successful, we need to clean the back face up before we continue otherwise we will run into issues again.
- errors: none
04 同仓库更多 Skills
executing-plans
Use when you have a written implementation plan to execute in a separate session with review checkpoints
using-git-worktrees
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback
triage
Triage issues through a state machine driven by triage roles. Use when user wants to create an issue, triage issues, review incoming bugs or feature requests, prepare issues for an AFK agent, or manage issue workflow.
trade-edge-audit
The EDGE LENS for trading peers — recalls EVERY factor/indicator running from the live forecast ledger (no enumeration) and renders the whole pile through the edge arsenal off ONE call: multi-horizon scoring (the ladder) + deflated Sharpe (overfit) + Benjamini-Hochberg FDR (multiple-testing across the fleet) + spread-bounce + maker-fee falsification, then ranks only what survives ALL of it. Use when a peer must answer "does ANY running factor have real, overfit-corrected, multiple-testing-corrected, fee-surviving edge, and at which horizon" without hand-assembling 6 tools. The trade-engine analog of quantum-hypothesis-simulation.
trade-decision-sim
The DECISION LENS for trading peers — recalls the CURRENT signal snapshot per market from the live ledger and renders it through the sim arsenal off ONE call: quantum factor-circuit order-optimal sequencing + decision-sim CVaR-robust sizing, sized against the MEASURED per-factor edge (from the edge-audit), correlation-aware. Emits an actionable call per market {side, sizePct, confidence, sequence}. Flat/zero-size when there is no measured edge after cost — the honest default. Sibling of trade-edge-audit (the EDGE lens); the trade-engine analog of quantum-hypothesis-simulation for a live decision.
to-issues
Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices. Use when user wants to convert a plan into issues, create implementation tickets, or break down work into issues.