A Seal That Survives the Cut
A seal print begins with a reversal: the design on the stone must be mirrored so its impression reads correctly. Then comes a second choice. Which parts of the surface will remain raised to carry the red paste, and which will be carved away?
Before putting a blade to stone, imagine testing the raised parts of a small design by shaving a little from every exposed edge. Mathematical morphology calls this operation erosion. It emerged in the 1960s as a way to study shapes by probing them with smaller shapes.
Here, # represents raised stone and . represents a recess. Our probe is a cross: a cell survives only if it and its four immediate neighbours are raised. Everything beyond the grid counts as a recess.
let seal = [| "....."; ".###."; ".###."; ".###."; "....." |]
let height = Array.length seal
let width = String.length seal.(0)
let raised y x =
y >= 0 && y < height && x >= 0 && x < width && seal.(y).[x] = '#'
let offsets = [| (0, 0); (-1, 0); (1, 0); (0, -1); (0, 1) |]
let () =
for y = 0 to height - 1 do
for x = 0 to width - 1 do
print_char (if Array.for_all (fun (dy, dx) -> raised (y + dy) (x + dx)) offsets then '#' else '.')
done;
print_newline ()
done
The OCaml version checks the whole cross with Array.for_all. Kotlin gives us the same idea with all:
fun main() {
val seal = listOf(".....", ".###.", ".###.", ".###.", ".....")
val offsets = listOf(0 to 0, -1 to 0, 1 to 0, 0 to -1, 0 to 1)
fun raised(y: Int, x: Int) =
y in seal.indices && x in seal[0].indices && seal[y][x] == '#'
for (y in seal.indices) {
val row = seal[0].indices.map { x ->
if (offsets.all { (dy, dx) -> raised(y + dy, x + dx) }) '#' else '.'
}
println(row.joinToString(""))
}
}
Both print a single raised cell at the centre. The outer cells disappear because each touches a recess. A one-cell-wide stroke would disappear entirely, making erosion a useful way to spot delicate features before committing a design to stone.
This is a rough digital test, not a simulation of a knife or seal paste. A different probe changes what survives, and real stone grain, carving depth and printing pressure all matter. Still, the little cross gives us a practical question to ask of a design: how much shape remains when its margins get smaller?