seam_occlusion
Darkens overlapping seams between same-material masses using a mass map with depth values, adding distance-based contact shadow falloff along a color ramp.
Instructions
Darken the seam where two masses of the same material overlap, along its ramp.
`contact_shadow` does ambient occlusion already and finds the form doing the occluding
by colour, which is the one case a figure never presents. An arm against a torso, a
pauldron over a shoulder, a thigh against a hip: both sides are the same stone under
the same light and no colour separates them, so there is nothing for `occluder_color`
to match. Measured on this project's own golem, an armpit where an artist darkens the
contact came out +131 in luminance, because nothing here could see the seam.
What a colour cannot say, the caller can. The map is the same notation
`draw_pixel_map` and `shade_facets` take, one character per pixel, except that the
legend names **masses** instead of colours or directions, and gives each one a `z`.
Args:
rows: One string per row of the map, one character per pixel. "." is a pixel that
belongs to no mass, and is neither darkened nor treated as an occluder.
legend: {symbol: z}, where a **higher z is nearer the viewer**. `{"a": 1, "b": 0}`
says mass "a" overlaps mass "b", so the seam darkens on "b" and not on "a".
Occlusion is asymmetric and that is the whole point: darken both sides of a
seam and you have drawn brickwork, darken the side behind and you have put one
mass in front of another.
ramp: Colours darkest first. Darkened pixels stay on this ramp, so conformance is
preserved by construction.
radius: How far the darkening reaches from the seam, in pixels. 2 is usually right
and is what gives the falloff somewhere to happen.
depth: How many ramp steps darker, against the seam itself, tapering to nothing at
`radius`. Refused at or above the ramp's length, which would slam the seam to
the darkest entry whatever was there.
tolerance: How close a pixel must be to a ramp entry to be darkened, as a weighted
RGB distance. A pixel further off is left alone, so a seam crossing another
material does not drag it onto this ramp.
x, y: Where the map's top-left corner lands on the canvas.
layer: Target layer (default: top layer).
frame: Target frame, 1-based.
The darkening **falls off with distance** from the seam rather than being a hard line,
on the same curve `contact_shadow` uses so the two cannot disagree about what a contact
falloff is. That matters more here than it does there: the workaround this replaces, in
this project's golem generator, read seam pixels back in Python and slammed them two
steps down at a fixed width, and the result read as masonry. A combination that cannot
produce a falloff, such as `depth=1` over `radius=2`, is reported as a flat band rather
than passed off as one.
Refuses rather than darkening nothing: a map with one mass, a map whose masses all sit
at the same z, masses that do not come within `radius` of each other, and a pass where
every pixel it reached was already at the ramp's darkest step are each their own
refusal, and each one names the counts behind it.
Reports `masses` (pixels per symbol), `depths` (the z each resolved to), `by_steps`
(how many pixels moved how far, which is the falloff) and `darkened_pixels`.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filename": "<filename>",
"rows": "<rows>",
"legend": "<legend>",
"ramp": "<ramp>"
},
"name": "seam_occlusion"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Default: 0. | |
| y | No | Default: 0. | |
| ramp | Yes | ||
| rows | Yes | ||
| depth | No | Default: 2. | |
| frame | No | Default: 1. | |
| layer | No | ||
| legend | Yes | ||
| radius | No | Default: 2. | |
| filename | Yes | ||
| tolerance | No | Default: 24.0. |