A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix(modeling): an outline is a dome with no flat on it, a stroke fades behind what is in front, and a line can bend
yhh8996e557a0b3
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 318cb893e..3cdf97db3 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -24,7 +24,7 @@ published separately; it ships inside the editor.- **A fixed shadow map stays on what casts, and ambient occlusion leaves hair alone.** A sun's `shadowExtent` was centred on every mesh, so a far backdrop with `castShadows: false` took the map away from the character in front of it and her shadows disappeared; it is centred on what casts now, and the docs, which said the camera, say so. `gtao` took a strand in front of a surface for a wall and turned what was behind it black: a horizon now falls back when what lies beyond is lower, and a pixel-wide strand no longer has a normal guessed from depth. On a test head the black went from 1.17% of lit pixels to 0.07%, and shade round a solid block stays.-- **An AI can read a shape off a picture and model it.** `reference_view` takes a `ruler`, a numbered grid of where the picture falls in the world through a camera, so a nose or a fold can be read off as coordinates. An `organic` part can be an `outline`, a closed drawing stood up as a rounded solid, so a traced profile is the silhouette. `sculpt` works a surface stroke by stroke: `press` along a line for a fold or a seam, `inflate`, `move`, `smooth`, and with `from` a stroke or a `stain` line is given in the two axes of a view and lands on what that view sees.+- **An AI can read a shape off a picture and model it.** `reference_view` takes a `ruler`, a numbered grid of where the picture falls in the world through a camera, so a nose or a fold can be read off as coordinates. An `organic` part can be an `outline`, a closed drawing stood up as a smooth dome with no flat on it, so a traced profile is the silhouette. `sculpt` works a surface stroke by stroke: `press` along a line for a fold or a seam, `inflate`, `move`, `smooth`, and with `from` a stroke or a `stain` line is given in the two axes of a view and lands on what that view sees.- **`reference_compare` with a `region` shows the same part of both pictures.** Through a camera it drew the game at the shape of the part, so the cut took another place from another picture. `field_sweep` did the same.diff --git a/desktop b/desktopindex fa1d8c6fe..5ce976576 160000--- a/desktop+++ b/desktop@@ -1 +1 @@-Subproject commit fa1d8c6fe288e7b76038efb7b021bf98214b4ea1+Subproject commit 5ce9765764dd624c18178ce81d056c3b0adf02c7diff --git a/pipeline/src/modeling/modelSource.ts b/pipeline/src/modeling/modelSource.tsindex ffff46f3a..db79c6c59 100644--- a/pipeline/src/modeling/modelSource.ts+++ b/pipeline/src/modeling/modelSource.ts@@ -311,10 +311,11 @@ const KIND_CHECK: Record<Kind, (v: unknown) => string | null> = {vec2: (v) => (isNums(v, 2) ? null : 'must be [u, v]'),line: (v) => {const n = v as { points?: unknown; width?: unknown } | null;- const line = n as { points?: unknown; width?: unknown; from?: unknown } | null;+ const line = n as { points?: unknown; width?: unknown; from?: unknown; curve?: unknown } | null;+ if (line?.curve !== undefined && !(Number.isInteger(line.curve) && (line.curve as number) >= 1 && (line.curve as number) <= 32)) return 'curve must be a whole number, 1..32';if (line?.from !== undefined && !VIEW_NAMES.includes(line.from as string)) return `from must be one of ${VIEW_NAMES.join(', ')}`;const size = line?.from !== undefined ? 2 : 3;- return typeof n === 'object' && n !== null && Array.isArray(n.points) && n.points.length >= 2 && n.points.every((q) => isNums(q, size)) && isNum(n.width) && Object.keys(n).every((k) => k === 'points' || k === 'width' || k === 'from') ? null : (size === 2 ? 'must be { points: [[a, b], ...], width, from }, the points in the two axes of the view' : 'must be { points: [[x, y, z], ...], width }');+ return typeof n === 'object' && n !== null && Array.isArray(n.points) && n.points.length >= 2 && n.points.every((q) => isNums(q, size)) && isNum(n.width) && Object.keys(n).every((k) => k === 'points' || k === 'width' || k === 'from' || k === 'curve') ? null : (size === 2 ? 'must be { points: [[a, b], ...], width, from }, the points in the two axes of the view' : 'must be { points: [[x, y, z], ...], width }');},view: (v) => (VIEW_NAMES.includes(v as string) ? null : `must be one of ${VIEW_NAMES.join(', ')}`),strokes: (v) => (Array.isArray(v) && v.length > 0 && v.every((s) => typeof s === 'object' && s !== null) ? null : 'must be a non-empty array of strokes, each { brush, ... }'),diff --git a/pipeline/src/modeling/organic.ts b/pipeline/src/modeling/organic.tsindex 56d6065f6..cd3d6eb70 100644--- a/pipeline/src/modeling/organic.ts+++ b/pipeline/src/modeling/organic.ts@@ -49,7 +49,7 @@ export interface OrganicPart {points?: readonly (readonly number[])[];/** outline: half how thick it stands, along z. */depth?: number;- /** outline: how far in from its edge it takes to come up to `depth`. Default `depth`, a full roundness; small, a slab with soft edges. */+ /** outline: how far in from its edge it takes to come up to `depth`. Default the whole way to its middle, a dome with no flat on it; small, a slab with soft edges. */round?: number;/** outline: this many segments between points, passing through each. A point given twice keeps a corner there. */curve?: number;@@ -230,8 +230,7 @@ function shapeField(part: OrganicPart): { field: Eval; reach: number; thinnest:need('depth');const depth = part.depth!;if (depth <= 0) throw new Error('depth must be positive');- const round = part.round ?? depth;- if (round <= 0) throw new Error('round must be positive');+ if (part.round !== undefined && part.round <= 0) throw new Error('round must be positive');if (part.points!.length < 3) throw new Error(`an outline needs at least 3 points, not ${part.points!.length}`);if (part.points!.some((p) => p.length !== 2)) throw new Error('every outline point is [x, y]');const drawn = curveThrough(part.points!, part.curve ?? 1, true);@@ -239,24 +238,67 @@ function shapeField(part: OrganicPart): { field: Eval; reach: number; thinnest:const count = pts.length;const [xs, ys] = [new Float64Array(count), new Float64Array(count)];pts.forEach((p, i) => { xs[i] = p[0]!; ys[i] = p[1]!; });+ // How far in a point is. Not the distance to the nearest edge, which creases along the drawing's middle wherever the nearest edge changes, and those creases+ // shade as ridges down a face. The fourth power of the inverse distance, integrated round the outline: smooth everywhere, and exact beside a straight edge.+ const within = (x: number, y: number): number => {+ let sum = 0;+ for (let i = 0, j = count - 1; i < count; j = i, i++) {+ const [ax, ay, ex, ey] = [xs[j]!, ys[j]!, xs[i]! - xs[j]!, ys[i]! - ys[j]!];+ const len = Math.hypot(ex, ey);+ if (len <= 0) continue;+ const [px, py] = [x - ax, y - ay];+ const a = -(px * ex + py * ey) / len, b = a + len;+ const d = Math.abs(px * ey - py * ex) / len;+ if (a * b > 0 && d < 0.02 * Math.min(Math.abs(a), Math.abs(b))) {+ sum += Math.abs(a ** -3 - b ** -3) / 3;+ } else {+ const safe = Math.max(d, 1e-9);+ const primitive = (s: number): number => s / (2 * safe * safe * (safe * safe + s * s)) + Math.atan(s / safe) / (2 * safe * safe * safe);+ sum += primitive(b) - primitive(a);+ }+ }+ return (sum / (Math.PI / 2)) ** (-1 / 3);+ };+ const isInside = (x: number, y: number): boolean => {+ let inside = false;+ for (let i = 0, j = count - 1; i < count; j = i, i++) {+ const [ax, ay, bx, by] = [xs[j]!, ys[j]!, xs[i]!, ys[i]!];+ if ((by > y) !== (ay > y) && x < ax + ((y - ay) * (bx - ax)) / (by - ay)) inside = !inside;+ }+ return inside;+ };+ let round = part.round ?? 0;+ if (part.round === undefined) {+ // The deepest place in the drawing, so that the dome comes up to `depth` only there.+ const [lx, hx, ly, hy] = [Math.min(...xs), Math.max(...xs), Math.min(...ys), Math.max(...ys)];+ for (let i = 0; i <= 32; i++) {+ for (let j = 0; j <= 32; j++) {+ const [x, y] = [lx + ((hx - lx) * i) / 32, ly + ((hy - ly) * j) / 32];+ if (isInside(x, y)) round = Math.max(round, within(x, y));+ }+ }+ round = Math.max(round * 1.02, depth * 0.01);+ }const r2 = round * round, d2 = depth * depth;const reach = Math.max(...pts.map((p) => Math.hypot(p[0]!, p[1]!))) + depth;return {// The drawing's distance, then an ellipse across its edge: the same estimate as an ellipsoid's, in the plane of edge and depth.field: (x, y, z) => {- let best = Infinity;- let inside = false;- for (let i = 0, j = count - 1; i < count; j = i, i++) {- const [ax, ay, bx, by] = [xs[j]!, ys[j]!, xs[i]!, ys[i]!];- const [ex, ey, px, py] = [bx - ax, by - ay, x - ax, y - ay];- const len = ex * ex + ey * ey;- const t = len > 0 ? Math.min(1, Math.max(0, (px * ex + py * ey) / len)) : 0;- const [qx, qy] = [px - ex * t, py - ey * t];- const dist = qx * qx + qy * qy;- if (dist < best) best = dist;- if ((by > y) !== (ay > y) && x < ax + ((y - ay) * (bx - ax)) / (by - ay)) inside = !inside;+ let edge: number;+ if (isInside(x, y)) {+ edge = -within(x, y);+ } else {+ let best = Infinity;+ for (let i = 0, j = count - 1; i < count; j = i, i++) {+ const [ax, ay, ex, ey] = [xs[j]!, ys[j]!, xs[i]! - xs[j]!, ys[i]! - ys[j]!];+ const [px, py] = [x - ax, y - ay];+ const len = ex * ex + ey * ey;+ const t = len > 0 ? Math.min(1, Math.max(0, (px * ex + py * ey) / len)) : 0;+ const [qx, qy] = [px - ex * t, py - ey * t];+ best = Math.min(best, qx * qx + qy * qy);+ }+ edge = Math.sqrt(best);}- const edge = Math.sqrt(best) * (inside ? -1 : 1);const u = edge + round;if (u <= 0) return Math.abs(z) - depth;const k0 = Math.sqrt((u * u) / r2 + (z * z) / d2);diff --git a/pipeline/src/modeling/sculpt.ts b/pipeline/src/modeling/sculpt.tsindex feaa73546..6ba69a434 100644--- a/pipeline/src/modeling/sculpt.ts+++ b/pipeline/src/modeling/sculpt.ts@@ -10,7 +10,7 @@*/import { MAX_DISPLACE_TRIANGLES, refine } from './displace';import { boundsOf, compact, faceArea, faceNormal, selectFaces, type FaceSelector, type PolyMesh, type Vec3 } from './polyMesh';-import { facesInView, lineMeasure, seenFrom, viewOf, type View, type ViewName } from './surfaceLine';+import { drawnLine, facesInView, lineMeasure, seenFrom, viewOf, type View, type ViewName } from './surfaceLine';/** A place: [x, y, z], or with `from` the two axes of the view. */type Place = readonly number[];@@ -29,6 +29,8 @@ export interface PressStroke {round?: boolean;/** The share of its length each end fades over, 0..0.5. Default 0.25; 0 for a seam, which stops dead. */taper?: number;+ /** This many segments between points, passing through each: a line that bends and does not kink. */+ curve?: number;}export interface MoveStroke {@@ -104,6 +106,7 @@ function checkStroke(stroke: SculptStroke, view: View | null): void {if (!Number.isFinite(stroke.depth)) throw new Error('press needs `depth`');if (stroke.lean !== undefined && !(Math.abs(stroke.lean) < 1)) throw new Error(`lean ${stroke.lean} must be between -1 and 1`);if (stroke.taper !== undefined && !(stroke.taper >= 0 && stroke.taper <= 0.5)) throw new Error(`taper ${stroke.taper} must be 0..0.5`);+ if (stroke.curve !== undefined && !(Number.isInteger(stroke.curve) && stroke.curve >= 1 && stroke.curve <= 32)) throw new Error(`curve ${stroke.curve} must be a whole number, 1..32`);return;}if (stroke.brush !== 'move' && stroke.brush !== 'inflate' && stroke.brush !== 'smooth') throw new Error(`unknown brush ${JSON.stringify((stroke as { brush?: unknown }).brush)}; there are press, move, inflate, smooth`);@@ -192,7 +195,7 @@ function applyStroke(mesh: PolyMesh, stroke: SculptStroke, selected: ReadonlySetfor (const v of vertices) {if (seen && !seen[v]) continue;const at = positions[v]!;- const w = smooth01(1 - Math.hypot(...planar(at).map((c, k) => c - stroke.at[k]!)) / stroke.radius) * facing(v);+ const w = smooth01(1 - Math.hypot(...planar(at).map((c, k) => c - stroke.at[k]!)) / stroke.radius) * facing(v) * (seen ? seen[v]! : 1);if (w > 0) {const push = stroke.by * w;positions[v] = [at[0] + normals[v * 3]! * push, at[1] + normals[v * 3 + 1]! * push, at[2] + normals[v * 3 + 2]! * push];@@ -201,7 +204,7 @@ function applyStroke(mesh: PolyMesh, stroke: SculptStroke, selected: ReadonlySetreturn { positions, faces: fine.faces };}- const measure = lineMeasure(stroke.points);+ const measure = lineMeasure(drawnLine(stroke.points, stroke.curve));const lean = stroke.lean ?? 0;const taper = stroke.taper ?? 0.25;for (const v of vertices) {@@ -215,7 +218,7 @@ function applyStroke(mesh: PolyMesh, stroke: SculptStroke, selected: ReadonlySetif (fade <= 0) continue;// A crease comes to an edge along its middle, which is what catches the light; a swell does not.const shape = stroke.round ? (1 - u * u) ** 2 : (1 - u) ** 2;- const push = -stroke.depth * shape * fade * facing(v);+ const push = -stroke.depth * shape * fade * facing(v) * (seen ? seen[v]! : 1);positions[v] = [at[0] + n[0] * push, at[1] + n[1] * push, at[2] + n[2] * push];}return { positions, faces: fine.faces };diff --git a/pipeline/src/modeling/stain.ts b/pipeline/src/modeling/stain.tsindex fc75505cd..a976bac1c 100644--- a/pipeline/src/modeling/stain.ts+++ b/pipeline/src/modeling/stain.ts@@ -10,7 +10,7 @@*/import { DISPLACE_PATTERNS, finestShare, mirroredPoint, nearWeight, patternField, reachedFaces, refine, MAX_DISPLACE_TRIANGLES, type DisplaceParams, type DisplacePattern } from './displace';import { compact, faceArea, faceNormal, normalize, selectFaces, type Face, type FaceSelector, type PolyMesh, type Vec3 } from './polyMesh';-import { facesInView, lineMeasure, seenFrom, viewOf, type ViewName } from './surfaceLine';+import { drawnLine, facesInView, lineMeasure, seenFrom, viewOf, type ViewName } from './surfaceLine';/** How far a mirrored point is from a line of points. */function toLine(points: readonly Vec3[], mirror: StainParams['mirror'], x: number, y: number, z: number): number {@@ -30,7 +30,7 @@ export interface StainParams {/** Only around here. Fades to its edge, or with `hard` stops there: a pupil. */near?: { at: Vec3; radius: number };/** Only along a line drawn on the surface, its points on or near it: an eyelid, a lip, a seam. Fades to `width` either side, or with `hard` stops there. With `from: "+z"` its points are [x, y], and it lands on what that view sees. */- line?: { points: readonly (readonly number[])[]; width: number; from?: ViewName };+ line?: { points: readonly (readonly number[])[]; width: number; from?: ViewName; curve?: number };hard?: boolean;/** Linear [r, g, b], over what is there. */color?: readonly number[];@@ -179,8 +179,9 @@ export function stain(mesh: PolyMesh, p: StainParams, budget = MAX_DISPLACE_TRIAnormals[v * 3]! /= l; normals[v * 3 + 1]! /= l; normals[v * 3 + 2]! /= l;}const shape = p.where ? relief(fine, normals, p.reach) : null;- let lineSeen: Uint8Array | null = null;- const measured = p.line && lineView ? lineMeasure(p.line.points) : null;+ let lineSeen: Float32Array | null = null;+ const drawn = p.line ? drawnLine(p.line.points, p.line.curve) : null;+ const measured = drawn && lineView ? lineMeasure(drawn) : null;if (p.line && lineView) {const vertices: number[] = [];fine.faces.forEach((face, f) => { if (isChosen(f)) vertices.push(...face.v); });@@ -204,8 +205,9 @@ export function stain(mesh: PolyMesh, p: StainParams, budget = MAX_DISPLACE_TRIA}if (p.line) {if (lineSeen && !lineSeen[v]) return 0;- const t = 1 - (measured && lineView ? measured([at[lineView.u], at[lineView.v]], null).distance : toLine(p.line.points as readonly Vec3[], p.mirror, x, y, z)) / p.line.width;+ const t = 1 - (measured && lineView ? measured([at[lineView.u], at[lineView.v]], null).distance : toLine(drawn as readonly Vec3[], p.mirror, x, y, z)) / p.line.width;m *= t <= 0 ? 0 : p.hard ? 1 : t * t * (3 - 2 * t);+ if (lineSeen) m *= lineSeen[v]!;if (m === 0) return 0;}const n: Vec3 = [normals[v * 3]!, normals[v * 3 + 1]!, normals[v * 3 + 2]!];diff --git a/pipeline/src/modeling/surfaceLine.ts b/pipeline/src/modeling/surfaceLine.tsindex 26c932033..29cd2bb6c 100644--- a/pipeline/src/modeling/surfaceLine.ts+++ b/pipeline/src/modeling/surfaceLine.ts@@ -8,6 +8,7 @@* and it lands on whatever faces that view and is nearest it, as a pen on the picture would.*/import { boundsOf, type PolyMesh, type Vec3 } from './polyMesh';+import { curveThrough } from './surfaces';export type ViewName = '+x' | '-x' | '+y' | '-y' | '+z' | '-z';export const VIEW_NAMES: readonly string[] = ['+x', '-x', '+y', '-y', '+z', '-z'];@@ -35,6 +36,9 @@ export interface LineHit {side: number;}+/** A line's points, rounded through by `curve` segments between each; a point given twice keeps a corner. */+export const drawnLine = (points: readonly (readonly number[])[], curve: number | undefined): readonly (readonly number[])[] => (curve && curve > 1 ? curveThrough(points, curve, false) : points);+/** A polyline in any number of coordinates, and what is nearest a point on it. */export function lineMeasure(points: readonly (readonly number[])[]): (at: readonly number[], normal: Vec3 | null) => LineHit {const dims = points[0]!.length;@@ -77,9 +81,9 @@ export function facesInView(mesh: PolyMesh, hit: readonly number[], view: View,});}-/** Which vertices the view sees: facing it, and at the front of what lies along the line of sight there, to within a little. */-export function seenFrom(mesh: PolyMesh, normals: Float64Array, view: View, vertices: readonly number[], cell: number): Uint8Array {- const seen = new Uint8Array(mesh.positions.length);+/** How much of each vertex the view sees, 0..1: facing it, and at the front of what lies along the line of sight there. Fades with depth, as neighbours that split into one moved and one not dent the surface. */+export function seenFrom(mesh: PolyMesh, normals: Float64Array, view: View, vertices: readonly number[], cell: number): Float32Array {+ const seen = new Float32Array(mesh.positions.length);const front = new Map<number, number>();const key = (a: number, b: number): number => a * 1048576 + b;const place = (at: Vec3): [number, number] => [Math.floor(at[view.u] / cell) + 500000, Math.floor(at[view.v] / cell) + 500000];@@ -97,7 +101,9 @@ export function seenFrom(mesh: PolyMesh, normals: Float64Array, view: View, vertconst [a, b] = place(at);let nearest = -Infinity;for (let da = -1; da <= 1; da++) for (let db = -1; db <= 1; db++) nearest = Math.max(nearest, front.get(key(a + da, b + db)) ?? -Infinity);- if (at[view.axis] * view.sign >= nearest - cell * 3) seen[v] = 1;+ const behind = nearest - at[view.axis] * view.sign;+ const t = 1 - (behind - cell * 2) / (cell * 3);+ seen[v] = t >= 1 ? 1 : t <= 0 ? 0 : t * t * (3 - 2 * t);}return seen;}diff --git a/pipeline/tests/modeling-sculpt.test.ts b/pipeline/tests/modeling-sculpt.test.tsindex 819732e82..82c0503be 100644--- a/pipeline/tests/modeling-sculpt.test.ts+++ b/pipeline/tests/modeling-sculpt.test.ts@@ -3,6 +3,7 @@/** What is read off a picture goes into a model: a drawing stands up as a solid, a stroke moves the surface where it says and nowhere else, and a view lands on what it sees. */import { describe, expect, it } from 'vitest';import { bakeModel, validateModelSource, type ModelStep } from '../src/modeling';+import { seenFrom, viewOf } from '../src/modeling/surfaceLine';type Mesh = ReturnType<typeof bakeModel>['poly'];const build = (steps: ModelStep[]): Mesh => bakeModel({ version: 1, steps }).poly;@@ -52,6 +53,17 @@ describe('organic outline', () => {expect(heightAt(wide, 0.1, 0.5, 1, 0.01)!).toBeLessThan(0.095);});+ it('is a dome by default: no flat on it, and no ridge down its middle where the nearest edge changes', () => {+ const dome = build([{ op: 'organic', resolution: 150, parts: [{ shape: 'outline', points: [[0, 0], [1, 0], [1, 0.6], [0, 0.6]], depth: 0.1 }] }]);+ const along = [0.1, 0.2, 0.3, 0.4, 0.5].map((x) => heightAt(dome, x, 0.3, 1, 0.012)!);+ for (let i = 1; i < along.length; i++) expect(along[i]!, `rises to the middle: ${along}`).toBeGreaterThan(along[i - 1]!);+ expect(bounds(dome).max[2]).toBeCloseTo(0.1, 1);+ // Across where a distance-to-the-nearest-edge dome would crease: on the long axis, y 0.3. The slope changes gently there and does not flip at a line.+ const across = [0.24, 0.27, 0.3, 0.33, 0.36].map((y) => heightAt(dome, 0.5, y, 1, 0.01)!);+ const bend = Math.abs(across[0]! - 2 * across[2]! + across[4]!);+ expect(bend).toBeLessThan(0.004);+ });+it('turns with `rotate`, and its bounds go with it', () => {const m = build([{ op: 'organic', resolution: 60, parts: [{ shape: 'outline', points: [[0, 0], [1, 0], [1, 1], [0, 1]], depth: 0.05, rotate: [0, 90, 0] }] }]);const b = bounds(m);@@ -199,6 +211,33 @@ describe('sculpt', () => {expect(heightAt(ball, 0, 0, 1, 0.02)!).toBeLessThan(0.5 - 0.025);});+ it('from a view, fades with depth behind what is in front: neighbours split into one moved and one not would dent the surface', () => {+ const cell = 0.1;+ // A column of points along the line of sight, all facing the eye.+ const depths = [0, -0.1, -0.25, -0.35, -0.45, -0.6];+ const mesh = { positions: depths.map((z) => [0, 0, z] as [number, number, number]), faces: [] };+ const normals = new Float64Array(depths.flatMap(() => [0, 0, 1]));+ const seen = seenFrom(mesh, normals, viewOf('+z'), depths.map((_, v) => v), cell);+ expect(seen[0]).toBe(1);+ expect(seen[1]).toBe(1);+ expect(seen[2]).toBeGreaterThan(0.5);+ expect(seen[2]).toBeLessThan(1);+ expect(seen[3]).toBeGreaterThan(0);+ expect(seen[3]).toBeLessThan(seen[2]!);+ expect(seen[5]).toBe(0);+ // What faces away is not seen, however near.+ normals[2] = -1; normals[5] = -1;+ expect(seenFrom(mesh, normals, viewOf('+z'), [0, 1], cell)[1]).toBe(0);+ });++ it('bends with `curve` where a line would kink', () => {+ const kink = { brush: 'press', points: [[-0.3, 0], [0, 0.2], [0.3, 0]], width: 0.03, depth: 0.03, taper: 0 };+ // A straight run from the first point to the corner leaves this point out of reach, and a curve through the same points bows out over it.+ const place: [number, number] = [-0.16, 0.135];+ expect(heightAt(stroke(kink), place[0], place[1], 1, 0.004)!).toBeGreaterThan(0.095);+ expect(heightAt(stroke({ ...kink, curve: 8 }), place[0], place[1], 1, 0.004)!).toBeLessThan(0.095);+ });+it('does the same every time', () => {expect(stroke(press).positions).toEqual(stroke(press).positions);});diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex 753e09078..43bf03f2e 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -3884,6 +3884,10 @@ export const NOTED = {{"note":"A material's normal and metal-rough maps are read as data in the editor's Play."},"fix(minigame): no mini-game module needs BigInt64Array, so WeChat DevTools boots the game":{"note":"A WeChat mini-game opens in WeChat DevTools."},+ "fix(modeling): an outline is a dome with no flat on it, a stroke fades behind what is in front, and a line can bend":+ {"note":"An AI can read a shape off a picture and model it."},+ "feat(mcp): model_write describes the dome, and a stroke or a stain line that bends":+ {"note":"An AI can read a shape off a picture and model it."},"fix(render): a fixed shadow map stays on what casts, and gtao takes a strand for a strand":{"note":"A fixed shadow map stays on what casts, and ambient occlusion leaves hair alone."},"test(mcp): gtao keeps hair from going black and still shades round a solid block":