A drawing app built for agent/human collaboration
Rust
Paint height follows the paint, not the dab: lips at the sides, wet paint pushed aside, relief weaker in the dark
Indicode BV135b46a2f071
diff --git a/crates/brush/src/engine.rs b/crates/brush/src/engine.rsindex c455af0..49b4899 100644--- a/crates/brush/src/engine.rs+++ b/crates/brush/src/engine.rs@@ -11,7 +11,7 @@ use klad_core::stroke::{Mark, Sample, Stroke};const MIN_RADIUS: f32 = 0.6;const SPEED_EASE: f32 = 0.5;-const SQUASH: f32 = 0.55;+const SQUASH: f32 = 0.85;const DEEPEST: f32 = 32.0;#[derive(Clone, Copy, Debug)]@@ -448,12 +448,22 @@ struct Dab {const GROOVES: usize = 256;const RUN: f32 = 8.0;-const LIPS: usize = 64;+const EDGE: f32 = 2.5;+const PROFILE: usize = 128;++struct Profile {+ lips: [f32; PROFILE + 1],+ caps: [f32; PROFILE + 1],+ depth: f32,+ spread: f32,+}struct Bristles {grooves: [f32; GROOVES + 1],- lips: [f32; LIPS + 1],run: f32,+ tall: f32,+ scale: f32,+ radius: f32,}impl Bristles {@@ -469,10 +479,28 @@ impl Bristles {Self {grooves: std::array::from_fn(|k| {let x = k as f32 / GROOVES as f32 * count;- 0.45 + 0.55 * (wave(x, 0) * 0.65 + wave(x * 2.3, 1) * 0.35)+ wave(x, 0) * 0.65 + wave(x * 2.3, 1) * 0.35}),- lips: std::array::from_fn(|k| 0.9 + 0.2 * smoothstep(0.5, 0.9, k as f32 / LIPS as f32)),run: size * RUN,+ tall: libm::sqrtf(size / scale / 24.0).clamp(0.4, 1.6),+ scale,+ radius: size * 0.5,+ }+ }++ fn profile(&self, radius: f32, roundness: f32, load: f32, p: f32) -> Profile {+ let band = (EDGE * self.scale / (radius * roundness).max(1e-3)).clamp(0.35, 0.6);+ let k = load * self.tall * (0.3 + 0.7 * p.clamp(0.0, 1.0));+ let at = |i: usize| i as f32 / PROFILE as f32;+ Profile {+ lips: std::array::from_fn(|i| {+ let across = at(i);+ k * (0.72 + 0.43 * smoothstep(1.0 - 3.0 * band, 1.0 - band, across))+ * (1.0 - smoothstep(1.0 - band, 1.0, across))+ }),+ caps: std::array::from_fn(|i| 1.0 - smoothstep(1.0 - band, 1.0, at(i))),+ depth: 0.3 + 0.3 * ((1.0 - load) / 0.45).clamp(0.0, 1.0),+ spread: radius / self.radius,}}@@ -480,13 +508,21 @@ impl Bristles {1.0 - 0.45 * smoothstep(0.0, self.run.max(1.0), along)}- fn thickness(&self, d: f32, v: f32, load: f32) -> f32 {- let groove = self.grooves[((v.clamp(-1.0, 1.0) * 0.5 + 0.5) * GROOVES as f32) as usize];- let lip = self.lips[(d.min(1.0) * LIPS as f32) as usize];- lip * groove * load+ fn thickness(&self, profile: &Profile, d: f32, v: f32) -> f32 {+ let lateral = (v * profile.spread).clamp(-1.0, 1.0);+ let wave = self.grooves[((lateral * 0.5 + 0.5) * GROOVES as f32) as usize];+ let groove = 1.0 - profile.depth * (1.0 - wave);+ lookup(&profile.lips, v.abs()) * lookup(&profile.caps, d) * groove}}+fn lookup(table: &[f32; PROFILE + 1], at: f32) -> f32 {+ let x = at.clamp(0.0, 1.0) * PROFILE as f32;+ let i = (x as usize).min(PROFILE - 1);+ let f = x - i as f32;+ table[i] + (table[i + 1] - table[i]) * f+}+const RING: [(f32, f32); 8] = [(1.0, 0.0),(0.707, 0.707),@@ -644,6 +680,7 @@ fn stamp(buffer: &mut StrokeBuffer, brush: &Brush, dab: Dab, bristles: Option<(&let inv_round = 1.0 / brush.def.roundness;let cols = buffer.grid().cols;let edge = Edge::of(&brush.tip, radius);+ let profile = bristles.map(|(b, load)| (b, b.profile(radius, brush.def.roundness, load, dab.p)));for ty in y0 / TILE..=(y1 - 1) / TILE {for tx in x0 / TILE..=(x1 - 1) / TILE {if buffer.skip(ty * cols + tx) {@@ -678,11 +715,11 @@ fn stamp(buffer: &mut StrokeBuffer, brush: &Brush, dab: Dab, bristles: Option<(&if let Some(texture) = &brush.grain {a = (a - texture_value(texture, x, y, dab.p)).max(0.0);}- if let (Some(ridge), Some((bristles, load))) = (ridge.as_deref_mut(), bristles)+ if let (Some(ridge), Some((bristles, profile))) = (ridge.as_deref_mut(), &profile)&& a > 0.0{let r = &mut ridge[row + x - ox];- *r = r.max(bristles.thickness(libm::sqrtf(d2), v, load));+ *r = r.max(bristles.thickness(profile, libm::sqrtf(d2), v));}if a > 0.0 && reach > 0.0 {let at = row + x - ox;@@ -1013,7 +1050,7 @@ fn land_body(raster: &mut Raster, buffer: &StrokeBuffer, index: usize, color: Rg}if body > 0.0 {let thick = ridge.map_or(1.0, |r| r[px]);- let laid = (c * (0.5 + 0.5 * alpha)).clamp(0.0, 1.0) * under.as_ref().map_or(1.0, |u| u[px]);+ let laid = smoothstep(0.0, 0.35, c) * (0.5 + 0.5 * alpha) * under.as_ref().map_or(1.0, |u| u[px]);value = value * (1.0 - SQUASH * a) + body * laid * thick;}}@@ -1572,7 +1609,11 @@ mod tests {let mut twice = thick_and("oil-load");twice[1] = coloured("oil-load", 60.0, (130.0, 64.0), (300.0, 64.0), [0.8, 0.6, 0.2, 1.0], 2).into();let two = replay(512, 128, &twice, &brushes).unwrap().raster;- assert!(height(&two, 175, 64) > middle * 1.2, "overlap builds up");+ let overlap = height(&two, 175, 64);+ assert!(+ overlap > middle * 1.02 && overlap < middle * 1.5,+ "new paint pushes most of the wet paint under it aside: {overlap} over {middle}"+ );assert_eq!(two.hash(), replay(512, 128, &twice, &brushes).unwrap().raster.hash());let (mut cel, mut raster, _) = crate::replay::CelReplay::replay(512, 128, twice.clone(), &brushes).unwrap();let mut edited = twice.clone();@@ -1597,16 +1638,18 @@ mod tests {assert!(height(&smudged, 262, 64) > 0.05, "smudge pulls the paint along");let wet = replay(512, 128, &thick_and("wet"), &brushes).unwrap().raster;assert!(height(&wet, 262, 64) > 0.02, "wet paint carries some of it");- let top = height(&thick, 150, 64);- let slope = |r: &Raster| {- (200..280)- .filter(|&x| (0.1 * top..0.9 * top).contains(&height(r, x, 64)))- .count()+ let steepest = |r: &Raster| {+ (60..68)+ .flat_map(|y| (140..280).map(move |x| (x, y)))+ .map(|(x, y)| (height(r, x + 1, y) - height(r, x, y)).abs())+ .fold(0.0, f32::max)};let blended = replay(512, 128, &thick_and("blender"), &brushes).unwrap().raster;assert!(- slope(&blended) > slope(&thick) + 3,- "the blender flattens the paint's end"+ steepest(&blended) < steepest(&thick) * 0.8,+ "the blender flattens the paint: {} against {}",+ steepest(&blended),+ steepest(&thick));}}diff --git a/crates/brush/src/lib.rs b/crates/brush/src/lib.rsindex ca0e9c1..2fe27f1 100644--- a/crates/brush/src/lib.rs+++ b/crates/brush/src/lib.rs@@ -9,7 +9,7 @@ pub mod record;pub mod replay;pub mod tiles;-pub const ENGINE_VERSION: u32 = 4;+pub const ENGINE_VERSION: u32 = 5;pub use brush::{Brush, BrushSet};pub use engine::{diff --git a/crates/render/src/effects.rs b/crates/render/src/effects.rsindex ccbfab6..9678431 100644--- a/crates/render/src/effects.rs+++ b/crates/render/src/effects.rs@@ -152,6 +152,7 @@ pub fn run(effects: &[Effect], img: Img, space: Space, by: Layer, height: Heightconst LIFT: f32 = 0.85;const DROP: f32 = 0.55;+const STACK: f32 = 1.6;pub fn relief(img: &Img, r: &Relief, scale: f32, height: &Img) -> Result<Img> {let [hr, hg, hb, _] = parse_hex(&r.highlight)?;@@ -159,7 +160,8 @@ pub fn relief(img: &Img, r: &Relief, scale: f32, height: &Img) -> Result<Img> {let (high, low) = ([hr, hg, hb], [sr, sg, sb]);let length = r.light[0].hypot(r.light[1]).max(1e-6);let (lx, ly) = (r.light[0] / length, r.light[1] / length);- let soft = blur(height, r.softness * scale);+ let stacked = height.each(|_, _, p| [STACK * libm::tanhf(p[0] / STACK), 0.0, 0.0, p[3]]);+ let soft = blur(&stacked, r.softness * scale);let k = r.strength * scale * 0.5;Ok(img.each(|gx, gy, p| {if p[3] <= 1e-5 {@@ -172,18 +174,20 @@ pub fn relief(img: &Img, r: &Relief, scale: f32, height: &Img) -> Result<Img> {if e.abs() < 1e-5 {return p;}- let (to, t) = match e > 0.0 {- true => (high, (e * LIFT).min(1.0)),- false => (low, (-e * DROP).min(1.0)),- };let a = p[3];let un = [p[0] / a, p[1] / a, p[2] / a];- [- (un[0] + (to[0] - un[0]) * t) * a,- (un[1] + (to[1] - un[1]) * t) * a,- (un[2] + (to[2] - un[2]) * t) * a,- a,- ]+ let lit = libm::sqrtf((0.2126 * un[0] + 0.7152 * un[1] + 0.0722 * un[2]).clamp(0.0, 1.0));+ let out: [f32; 3] = match e > 0.0 {+ true => {+ let t = (e * LIFT * lit).min(1.0);+ std::array::from_fn(|i| un[i] + (high[i] - un[i]) * t)+ }+ false => {+ let t = (-e * DROP).min(1.0);+ std::array::from_fn(|i| un[i] * (1.0 + (low[i] - 1.0) * t))+ }+ };+ [out[0] * a, out[1] * a, out[2] * a, a]}))}diff --git a/docs/DESIGN.md b/docs/DESIGN.mdindex 5a50d50..ce59276 100644--- a/docs/DESIGN.md+++ b/docs/DESIGN.md@@ -294,7 +294,7 @@ The editor keeps this record per paint cel. The CLI keeps the final tiles in `.c- **Grain.** A canvas-space texture modulates dab alpha (paper tooth).- **Stroke buffer.** Dabs build up in an f32 coverage buffer towards a cap, the brush opacity times its opacity curve (flow vs opacity, as in Photoshop: one stroke never darkens itself past the cap, overlapping strokes do). A round tip's coverage is its profile averaged over the pixel, so a hard tip has a one pixel antialiased edge. Where the tip's falloff is under about a pixel wide (hard tips), a pixel builds up only to the coverage the dab gives it, not past it: dabs are placed a few per pixel, and building up towards the cap turned the half covered pixels along a line's edge solid, so hard lines lost their antialiasing and lines under 2 px were drawn heavier than their size. Tips with a falloff of 2 px or more build up as before, with a blend between. The stroke then composites into the layer at the stroke's opacity with the brush's blend (normal, erase).- **Wet paint, smudge and blend (M5).** A brush's `paint` is `wet` (wetness, pickup, dilution), `smudge` (strength) or `blend` (strength). They read only the drawing they paint into (its pixels before the stroke, and the stroke's own work so far), never other layers. The stroke buffer gains a colour layer: per-dab colour (colour dynamics and wet pickup, weighted by the coverage each dab adds) or, for smudge and blend, the replaced pixels (smudge takes each pixel from where the dab was before, blend averages a ring around it at 0.3 of the radius); landing a stroke lays its per-pixel colour over the layer or moves the layer's pixels towards the replaced ones. Replay is in stroke order, so a reading stroke sees what was under it; a tile-local update rebuilds the drawing when a reading stroke comes after the first changed mark (a test checks an edit under a smudge against a full replay). Live painting reads the active drawing too, so what is drawn is what replays.-- **Paint with body (M5, S5.23).** A brush's `body` (0 to 1, 0 by default; `oil` 0.45, `oil-load` 0.8) makes its strokes lay paint height. A drawing's raster (`klad_brush::Raster`) is its colour tiles plus an optional height channel (one f16 per pixel, in the same tiles), made the first time a stroke with body lands, so drawings without body cost nothing and keep their hash. While a stroke with body is drawn, each dab keeps the highest thickness it reaches per pixel (a lip rising towards the tip's edge times a groove profile across the stroke, fixed per stroke from its seed and size, so grooves follow the stroke; thinning to 55% after eight sizes of travel as the brush runs dry); when it lands, the height becomes `h (1 - 0.55 a) + body a' t`, with `a` the stroke's coverage times opacity, `a'` the coverage times half to all of it (thin strokes still have body) and `t` that thickness, so new paint partly squashes what is under it and the last few strokes' texture shows. Lock alpha lays height only where there is paint; the eraser scales it down by its coverage; smudge and blend carry height with the pixels they move, and wet paint takes it into its reservoir like colour. Height is kept in replay checkpoints and in the drawing cache (a height section after the colour tiles; engine version 4). The `relief` effect samples the height of the layer's drawings (a group: of all its paint layers) into the effect window at the view scale, blurs it by `softness`, and for each pixel moves the colour towards `highlight` where the slope faces `light` and towards `shade` where it faces away (an emboss, by the slope's share of `strength`); flat paint stays as it is. Costs on a 2048 canvas with 600 big oil-load strokes: replay 854 ms instead of 712 ms without body, 8 MB of height, a whole compose 127 ms instead of 15 ms, one dirty tile 1.8 ms.+- **Paint with body (M5, S5.23).** A brush's `body` (0 to 1, 0 by default; `oil` 0.45, `oil-load` 0.8) makes its strokes lay paint height. A drawing's raster (`klad_brush::Raster`) is its colour tiles plus an optional height channel (one f16 per pixel, in the same tiles), made the first time a stroke with body lands, so drawings without body cost nothing and keep their hash. While a stroke with body is drawn, each dab keeps the highest thickness it reaches per pixel. The thickness is measured across the stroke, not from the dab's centre (the maximum over overlapping dabs would otherwise make every pixel a lip): a flat middle rising to lips where the paint is pushed to the sides, falling to nothing over an edge band of 2.5 px or a third of the half-width, whichever is wider (0.6 at most), with the same falloff at the ends of the stroke. Grooves come from a profile fixed per stroke from its seed, about one bristle per 3.5 px, placed by the distance in px from the stroke's line so the dabs' size jitter does not fill them in; they cut 30% into a loaded stroke and up to 60% as the brush runs dry (the paint thins to 55% after eight sizes of travel). The thickness grows with the square root of the brush size (a 24 px brush is 1, from 0.4 to 1.6), so a small brush lays a thin film and a big one tall ridges, and with the pressure (30% at none). When the stroke lands, the height becomes `h (1 - 0.85 a) + body a' t`, with `a` the stroke's coverage times opacity, `a'` half to all of the opacity where the coverage passes 0.35 (falling off below it, so the height has the shape of the paint, not of a soft dab's dome) and `t` that thickness: new paint pushes most of the wet paint under it aside instead of stacking on it, so the newest strokes do not stand up as separate ridges. Lock alpha lays height only where there is paint; the eraser scales it down by its coverage; smudge and blend carry height with the pixels they move, and wet paint takes it into its reservoir like colour. Height is kept in replay checkpoints and in the drawing cache (a height section after the colour tiles; engine version 5). The `relief` effect samples the height of the layer's drawings (a group: of all its paint layers) into the effect window at the view scale, eases the tallest stacks (`1.6 tanh(h / 1.6)`), blurs it by `softness`, and for each pixel moves the colour towards `highlight` where the slope faces `light`, less in dark paint (by the square root of its luminance, as a lamp shows the ridges of the lit side more than those in shadow), and multiplies it towards `shade` where the slope faces away; flat paint stays as it is. Costs on a 2048 canvas with 600 big oil-load strokes: replay 980 ms instead of 760 ms without body (the edge band, lips and caps are tables made per dab and read with interpolation), 8 MB of height, a whole compose 136 ms instead of 15 ms, one dirty tile 2.2 ms.- **Reshaping (M5).** A stroke's `path` can be set (`set`, `klad reshape`, A in the editor): every sample keeps its pressure, tilt and timing and moves to the same fraction of the new path's length as it had of the old one. The editor and `klad strokes --json` fit a few points to a stroke (`pathedit::fit_polyline`, the simplification `klad path` uses, at 0.12 of the stroke's size between 1 and 6 px); A edits those points and writes the bent path as one `set`.### Brushes as datadiff --git a/docs/skill/SKILL.md b/docs/skill/SKILL.mdindex 5b49dd8..e837559 100644--- a/docs/skill/SKILL.md+++ b/docs/skill/SKILL.md@@ -193,7 +193,7 @@ klad paint art.draw paint --in pillar --form cylinder --axis 90 --lamp 200,600,1klad prepare art.draw # buffer every drawing before the user opens it```-- Painting a form: after the flats, `klad paint` paints each shape as a form. `--form round` (default) bulges any closed shape like a pillow, its height growing with the distance to the outline; `flat` is a plane facing `--facing x,y,z` (z toward the viewer, y down); `cylinder` is round across `--axis` degrees. The light model is a key light from `--light x,y` at `--elevation` (or `--lamp x,y,height` in canvas px: the shape nearest the lamp gets the full key light, farther ones less by inverse square, so paint a cluster in one op), cool fill from above (`--fill`, `--fill-strength`), warm bounce from below (`--bounce`, `--bounce-strength`) and a darker core just past the terminator (`--core`); `--color` is the local colour in full light, so the lit side comes out at that colour and the shadow side about four value steps under it. The lights multiply the local colour, so a warm colour goes darker and browner in shadow; `--shadow <colour>` (`"shadow"` in `apply`) turns the side out of the key light towards that colour's hue and chroma while keeping the values the model gives it, by `--shadow-mix` (default 0.7) and less in the halftones, with the chroma lowered in the darkest parts. A cool lavender or blue grey keeps shadows from going brown or grey; raise `--fill-strength` (0.3 or so) for lighter shadow sides. Every colour option of `paint` takes palette names. Strokes follow the form (along bands of equal light on round forms, along the axis on cylinders, at `--angle` on planes), take their colour from the model where they lie and stop where the light changes, so none carries the lit colour into the shadow. Thick paint: `oil` and `oil-load` have `body` (a brush key, 0 to 1), so their strokes lay paint height with bristle grooves and a lip at the edge, building up where they cross; `smudge` and `wet` drag it, `blender` flattens it, the eraser takes it. It shows only through a `relief` effect on the layer (`klad effect art.draw <layer> relief strength=3 light=-1,-1`): about 4 for fruit or a figure, 1 to 2 for a table or a wall, whose short decisive strokes otherwise stand out like stickers. Without the effect body changes no pixel. Passes go from twice `--weight` down to half of it (the small ones only where the form turns), then a decisive pass with `--bold` (`oil-load`) in the lights and a few quiet strokes in the shadows (`--decisive 0` skips both); `--vary` lets each stroke stray in value and temperature. Paint on a layer clipped to the flats, or lock the flats layer and paint into it: strokes then run past the outline and short strokes along it cut the edge in; on a plain layer they stay inside it and the flats show at the rim.+- Painting a form: after the flats, `klad paint` paints each shape as a form. `--form round` (default) bulges any closed shape like a pillow, its height growing with the distance to the outline; `flat` is a plane facing `--facing x,y,z` (z toward the viewer, y down); `cylinder` is round across `--axis` degrees. The light model is a key light from `--light x,y` at `--elevation` (or `--lamp x,y,height` in canvas px: the shape nearest the lamp gets the full key light, farther ones less by inverse square, so paint a cluster in one op), cool fill from above (`--fill`, `--fill-strength`), warm bounce from below (`--bounce`, `--bounce-strength`) and a darker core just past the terminator (`--core`); `--color` is the local colour in full light, so the lit side comes out at that colour and the shadow side about four value steps under it. The lights multiply the local colour, so a warm colour goes darker and browner in shadow; `--shadow <colour>` (`"shadow"` in `apply`) turns the side out of the key light towards that colour's hue and chroma while keeping the values the model gives it, by `--shadow-mix` (default 0.7) and less in the halftones, with the chroma lowered in the darkest parts. A cool lavender or blue grey keeps shadows from going brown or grey; raise `--fill-strength` (0.3 or so) for lighter shadow sides. Every colour option of `paint` takes palette names. Strokes follow the form (along bands of equal light on round forms, along the axis on cylinders, at `--angle` on planes), take their colour from the model where they lie and stop where the light changes, so none carries the lit colour into the shadow. Thick paint: `oil` and `oil-load` have `body` (a brush key, 0 to 1), so their strokes lay paint height: flat in the middle with bristle grooves, lips at the sides, thinner at light pressure, taller for bigger brushes; new paint pushes most of the wet paint under it aside, so it builds up only a little where strokes cross. `smudge` and `wet` drag it, `blender` flattens it, the eraser takes it. It shows only through a `relief` effect on the layer (`klad effect art.draw <layer> relief strength=4 softness=3.5 light=-1,-1`): strength about 4 to 5 for fruit or a figure, 1 to 2 for a table or a wall; softness about a fifth of the stroke size (3 to 4.5 for strokes of 15 to 20 px). Below 1, a surface built from many small strokes shows every stroke's ridges and reads as wrinkled leather, not paint. Without the effect body changes no pixel. Passes go from twice `--weight` down to half of it (the small ones only where the form turns), then a decisive pass with `--bold` (`oil-load`) in the lights and a few quiet strokes in the shadows (`--decisive 0` skips both); `--vary` lets each stroke stray in value and temperature. Paint on a layer clipped to the flats, or lock the flats layer and paint into it: strokes then run past the outline and short strokes along it cut the edge in; on a plain layer they stay inside it and the flats show at the rim.- Every stroke the shape ops make is drawn like a hand (`--hand 1`, the default; `0` gives the old even strokes): its own pressure curve (a press-in, a peak, a longer lift-off), tapers that are a share of its length, a width that varies from stroke to stroke, and a slight bow on hatching and flat planes. Brushes for it: `oil` (soft edge, size and opacity from pressure) for building forms, `oil-load` (harder edge, more grain) for strokes that should stay visible.- `klad light` takes `--lamp x,y,height` too: each shape is shaded away from the lamp instead of one direction for all.- `klad prepare art.draw [--from 0 --to 23]` replays every painted drawing of those frames into the cache after a big CLI change, so the editor opens and plays it without replaying strokes. The editor still makes its frame pictures itself, quickly, from the cached drawings.@@ -273,7 +273,7 @@ klad arcs art.draw --track 'lines:near leg' --track 'far:far leg' --clip walk --klad render art.draw --frame 20 --track 'lines:near leg' --region 420,720,200,120 --scale 4 # the paths drawnklad render art.draw --sheet walk --drawings --overlay partsklad fill art.draw colour --like colour0 --frames all-klad gaps art.draw colour --sheet all # closed regions no fill covers, with a render marking them+klad gaps art.draw colour --sheet all # closed regions no fill covers, with a render marking them; naming the lines layer checks the layer that fills from itklad retime art.draw 0-11 --on 2 # or --on 1, --fit 16, --reverse, --pingpong; [--layers l3]```diff --git a/samples/lemons/generate.py b/samples/lemons/generate.pyindex f0de3bd..1a96139 100644--- a/samples/lemons/generate.py+++ b/samples/lemons/generate.py@@ -31,7 +31,7 @@ SHAPES = {"C 820 509 704 540 560 540 C 416 540 300 509 300 470 Z"},"lemon-c": {"type": "path", "d": lemon(905, 706, 102, 70, -8)},}-RELIEF_STRENGTH = {"table": 1.2, "inside": 2, "lemon-a": 4, "lemon-b": 4, "bowl": 2.5, "lemon-c": 4}+RELIEF_LOOK = {"table": (1.2, 1.8), "inside": (2, 0.8), "lemon-a": (4, 3.5), "lemon-b": (3.7, 3.3), "bowl": (1.7, 2.05), "lemon-c": (5.1, 4.4)}PAINT = {"table": dict(color="table", form="flat", facing=[0, -1, 0.9], angle=2, weight=20, decisive=0.6),"inside": dict(color="clay inside", form="flat", facing=[0.35, 0.5, 1], angle=0, weight=12),@@ -64,7 +64,8 @@ def ops():out.append(paint)out.append({"op": "set", "id": f"{id}-layer", "lockAlpha": False})if RELIEF:- out.append({"op": "set", "id": f"{id}-layer", "effects": [{"relief": {"light": LIGHT, "highlight": KEY, "strength": RELIEF_STRENGTH[id]}}]})+ strength, softness = RELIEF_LOOK[id]+ out.append({"op": "set", "id": f"{id}-layer", "effects": [{"relief": {"light": LIGHT, "highlight": KEY, "strength": strength, "softness": softness}}]})shadows = [("cast", 650, 704, 285, 40, COLOURS["cast"], 16), ("cast", 610, 694, 200, 16, COLOURS["contact"], 6),("cast-front", 948, 768, 110, 20, COLOURS["cast"], 10), ("cast-front", 925, 768, 70, 8, COLOURS["contact"], 4)]out += [{"op": "add", "node": {"type": "ellipse", "cx": x, "cy": y, "rx": rx, "ry": ry, "fill": c, "blur": b}, "in": f"{l}-layer"}