Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

docs: keep organic helper guidance conditional on intended shape

Matt Kissinger3d6a6ed0a12c
diff --git a/skills/kiln-author-asset/references/geometry-recipes.md b/skills/kiln-author-asset/references/geometry-recipes.md
index dee236ae..169dcf97 100644
--- a/skills/kiln-author-asset/references/geometry-recipes.md
+++ b/skills/kiln-author-asset/references/geometry-recipes.md
@@ -483,22 +483,26 @@ Positive values are inside. Bounds/resolution are required; smaller cells cost m
## Organic curves and blended volumes
-Prefer smooth paths and round profiles before adding detail:
+When the intended shape follows a smooth curve with a round, varying cross-section,
+one option is to sample a spline and sweep it:
```js
const path = catmullRomPath([[0,0,0],[0.2,0.4,0.1],[0.5,0.2,0]], 8);
const radii = path.map((_, i) => 0.06 - 0.04 * i / (path.length - 1));
const limb = taperedTube(path, radii, { radialSegments: 16, creaseAngle: 180 });
-const soft = smoothOrganic(limb, { iterations: 1, creaseAngle: 50 });
```
-Use one radius per sampled station. Closed `catmullRomPath` output omits the
+Use one radius per path station; `taperedTube` also accepts an authored polyline.
+Closed `catmullRomPath` output omits the
repeated endpoint and can feed `taperedTube(path, radii, { closed: true })` directly.
Path helpers reject derived sample counts that exceed safe-integer precision.
-Subdivision changes the shape and increases triangle count; inspect the result
-before adding iterations. `smoothOrganic` drops UVs by default; use `preserveUV: true` when retaining supported corner attributes and material boundaries matters.
+`smoothOrganic(limb, { iterations: 1, creaseAngle: 50 })` is an optional refinement
+when subdivision produces the intended surface. Subdivision changes the shape and
+increases triangle count; inspect the result before adding iterations.
+`smoothOrganic` drops UVs by default; use `preserveUV: true` when retaining supported corner attributes and material boundaries matters.
-`metaballSurface` smooth-unions spheres for torsos, bells and heads without visible CSG seams:
+When a smooth blend of sphere volumes fits the intended shape, `metaballSurface`
+can mesh that field:
```js
const torso = await metaballSurface(
@@ -507,7 +511,7 @@ const torso = await metaballSurface(
);
```
-Compose custom fields with `sphereInside` and `smoothUnion` inside `implicitSurface` when metaballs are not enough.
+For custom fields, `sphereInside` and `smoothUnion` can be composed inside `implicitSurface`.
The default metaball blend is `max(0.35 * smallestRadius, 0.02)` in scene units;
choose an explicit blend when scaling. Include blended junctions inside the
diff --git a/src/discovery/helper-contracts.ts b/src/discovery/helper-contracts.ts
index 14d0eafc..d2d72b93 100644
--- a/src/discovery/helper-contracts.ts
+++ b/src/discovery/helper-contracts.ts
@@ -2471,7 +2471,7 @@ define(
intents: ['limb, tail, tentacle or branch with changing thickness'],
related: [
{ name: 'pipeAlongPath', relation: 'alternative' },
- { name: 'catmullRomPath', relation: 'prerequisite' },
+ { name: 'catmullRomPath', relation: 'companion' },
],
},
);
diff --git a/src/geometry-catalog.ts b/src/geometry-catalog.ts
index ad22a6a0..9f0af2d3 100644
--- a/src/geometry-catalog.ts
+++ b/src/geometry-catalog.ts
@@ -221,7 +221,7 @@ export const geometryPrimitives: readonly HelperSpec[] = [
description:
'Experimental smooth union of spheres meshed through implicitSurface. Uses polynomial blending; output has no UVs.',
promptNotes:
- 'Prefer this over hand-rolling smoothUnion fields for creatures, blobs and rounded junctions. Match edgeLength to feature size.',
+ 'Useful when a smooth union of sphere volumes fits the intended shape. Match edgeLength to feature size.',
example:
'const body = await metaballSurface([{ center: [0,0.4,0], radius: 0.35 }, { center: [0.2,0.55,0], radius: 0.22 }], { bounds: { min: [-0.6,-0.1,-0.5], max: [0.6,1,0.5] }, edgeLength: 0.08 });',
},
@@ -232,7 +232,7 @@ export const geometryPrimitives: readonly HelperSpec[] = [
returns: 'THREE.BufferGeometry',
category: 'curves',
description:
- 'Circular sweep with one radius per path station. Default creaseAngle 180 shades round profiles smoothly; sample splines with catmullRomPath first.',
+ 'Circular sweep along a polyline with one radius per station. Default creaseAngle 180 shades round profiles smoothly. catmullRomPath can supply samples when a spline fits the intended path.',
example:
'const path = catmullRomPath([[0,0.5,0],[0.3,0.7,0],[0.5,0.4,0]], 6); const radii = path.map((_, i) => 0.08 - 0.06 * i / (path.length - 1)); const tail = taperedTube(path, radii);',
},