kernelcad-fields

A 3D modelling method based on signed-distance fields, which describe how far each point is from a shape's surface. It supports spheres, boxes, cylinders, toruses, smooth blends, and conversion to a standard solid shape.

In plain words
What is it for?
Use it to combine rounded primitives, create smooth transitions, and produce shapes that can continue through boolean operations, fillets, and exports.
Why use it?
It provides smooth joins and organic forms where ordinary solid-model fillets may not work.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/w1ne/kernelcad-web/kernelcad-fields
Any agent
npx skills add w1ne/kernelCAD-web --skill kernelcad-fields
Clone the repo
git clone --depth 1 https://github.com/w1ne/kernelCAD-web

Made for: Claude Code, Codex.

Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,704 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00052 $0.01704
Opus 5 $0.00026 $0.00852
Sonnet 5 $0.00010 $0.00341
Haiku 4.5 $0.00005 $0.00170

Measured 2d ago against content hash 661432f8e0fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

kernelcad-fields scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/agent/skills/kernelcad-fields/SKILL.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.

kernelCAD — signed-distance fields

Compose signed-distance fields (sdf.sphere/.box/.cylinder/.torus), blend them smoothly with sdf.smoothBlend, then call sdf.materialize(field, { resolution }) to obtain a standard Shape that flows through booleans / fillets / exports.

const a = sdf.box([60, 40, 6]);          // base plate, axis-aligned, centred at origin
const b = sdf.cylinder(8, 30);           // pin, axis +Z, centred at origin
const field = sdf.smoothBlend(a, b, 3);  // 3 mm smooth fillet at the junction
return sdf.materialize(field, { resolution: 30 });

sdf primitive math (mm; centred at origin in local frame)

Field Returns
sdf.sphere(r) SdfField (kind 'sphere')
sdf.box([sx, sy, sz]) SdfField (kind 'box', axis-aligned, centred)
sdf.cylinder(r, h) SdfField (kind 'cylinder', axis +Z, centred)
sdf.torus(R, r) SdfField (kind 'torus', ring axis +Z, centred)
sdf.smoothBlend(a, b, k) SdfField (kind 'smoothBlend', polynomial smin with blend radius k mm)
sdf.materialize(field, { resolution? }) Shape (kind sdfMaterialize; default resolution 30, clamped to [10, 200])
sdf.bind(name, field) binds a field on the session so evaluate_sdf can sample it later (side effect; returns void)

Composition rules (slice 1)

  • No field.translate(...). Slice-1 primitives live in their local frame. To position the result, compose primitives whose origins align (e.g. two coaxial spheres), call sdf.materialize, then translate the resulting Shape (.translate(x, y, z)).
  • smoothBlend is union-only. Smooth-intersect / smooth-difference are deferred to slice 2+.
  • materialize is synchronous. It runs marching-cubes on the host (Node + browser) and synchronously sews via OCCT WASM. No async surface.

Resulting Shape limitations

  • The output is polyhedral — thousands of triangular planar faces, not analytic surfaces. Canonical face refs ('top', 'bottom', ...) do not apply (sphere / box face semantics are lost at materialize).
  • fillet({ face: 'top' })-style canonical face calls return feature.face-ref.not-applicable; use inline FaceQuery / EdgeQuery if edge-feature scoping is needed.
  • Downstream fillet / chamfer on materialized SDF edges is supported in principle but quality is poor and OOM risk is real at high resolution; surface as feature.kernel-failed.
  • Booleans (union / subtract / intersect) do work — standard OCCT BREP booleans operate on the polyhedral solid.

Read the full file on GitHub · 103 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 103 lines · 52 tokens per session scan A 661432f8e0fd

Subscribe to this mod's changes

kernelcad-fields is a skill published in the GitHub repository w1ne/kernelCAD-web (17 stars, last pushed 4d ago), licensed MIT. It adds 52 tokens to every session and 1,704 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

simplecadapi

Thin SimpleCAD SDK reference skill focused on the public API surface, core types, and current modeling workflows.

NiJingzhe/SimpleCADAPI · 25 tokens

opengis-skills

Use when AI coding assistant needs GIS/CAD/C#/AI/IoT/3D domain expertise for 72+ open-source projects. One-stop skill index with tag-based search and on-demand loading for GDAL, GeoServer, QGIS, PostGIS, JTS, CesiumJS, FreeCAD, OpenSCAD, OCCT, NPOI, SqlSugar, Furion, Dify, SuperSplat, Go and more.

znlgis/opengis-skills · 97 tokens

cad

Use when doing parametric 3D modeling, 2D drafting, geometric kernel development, BIM/IFC processing, PCB design, or AutoCAD .NET development. Index of 19 skills: FreeCAD, OpenSCAD, OCCT, CadQuery, KiCad, SolveSpace, QCAD, xBIM, Clipper2, TongWen and more.

znlgis/opengis-skills · 79 tokens

cadquery-modeling

Generate CAD models with CadQuery using an adaptive CAD Compiler workflow: plan-mode skill constraint handoff, focused iteration scopes, fail-first challenge review, compact review packets, real-product reference fidelity, visual/functional audits, source-first repair, and STEP/STL export. Use for CadQuery, CQ, 建模…

armpro24-blip/cad-cae-copilot · 97 tokens

aieng-cad-authoring

Active MCP-first CAD authoring skill for AIENG Workbench. Use when the user asks to create, design, draft, model, or iteratively build CAD geometry through the active cad. MCP tools. Do not use for solver/result review, schema/library implementation, or editing legacy IR plans.

armpro24-blip/cad-cae-copilot · 67 tokens

aieng-cad-cae-copilot

MCP-first evidence workflow for AIENG CAD/CAE setup, solver preflight, approval-gated solver execution, and result extraction. Use when the user asks to inspect CAE readiness, patch setup, prepare/run CalculiX, or report stress/displacement evidence.

armpro24-blip/cad-cae-copilot · 65 tokens