{
  "version": 3,
  "sources": ["../../../../../src/lib/shapes/shared/freehand/svgInk.ts"],
  "sourcesContent": ["import { VecLike, assert } from '@tldraw/editor'\nimport {\n\tcomputeRadii,\n\tingest,\n\tinputX,\n\tinputY,\n\tloadSrcFromPipeline,\n\tloadSrcPartition,\n\tpointCount,\n\tpointX,\n\tpointY,\n\tradii,\n\tsrcCount,\n\tsrcRadius,\n\tsrcX,\n\tsrcY,\n} from './core'\nimport { finishPath, resetPath, toCenti, writeC, writeCPair, writeStr } from './fmt'\nimport {\n\tbuildTracks,\n\ttrackLeftCount,\n\ttrackLeftX,\n\ttrackLeftY,\n\ttrackRightCount,\n\ttrackRightX,\n\ttrackRightY,\n} from './getStrokeOutlinePoints'\nimport { StrokeOptions } from './types'\n\n/**\n * Render a freehand stroke as svg path data in a single pass, from raw input points to a filled\n * outline with round caps. This is the path used by tldraw's draw shape when drawing with ink.\n *\n * @param rawInputPoints - The raw input points (as `{x, y, z}`, where `z` is pressure).\n * @param options - An object with options.\n * @public\n */\nexport function svgInk(rawInputPoints: VecLike[], options: StrokeOptions = {}) {\n\tconst { start = {}, end = {} } = options\n\tconst { cap: capStart = true } = start\n\tconst { cap: capEnd = true } = end\n\tassert(!start.taper && !end.taper, 'cap taper not supported here')\n\tassert(!start.easing && !end.easing, 'cap easing not supported here')\n\tassert(capStart && capEnd, 'cap must be true')\n\n\tingest(rawInputPoints, options)\n\tcomputeRadii(options)\n\tresetPath()\n\tpartitionAtElbows(options)\n\treturn finishPath()\n}\n\n/**\n * Walk the stroke points in the pipeline buffers, cutting the stroke into partitions at\n * elbows, and render each one. Partitions are index ranges into the pipeline: each runs\n * from the previous boundary point to the next elbow. An acute elbow uses the input point\n * rather than the streamlined point at the boundary (for swooshiness in fast zaggy\n * lines), in which case the next partition's second point keeps the vector it had in the\n * uncut stroke via the vector anchor.\n */\nfunction partitionAtElbows(options: StrokeOptions): void {\n\tconst n = pointCount\n\tif (n === 0) return\n\tif (n <= 2) {\n\t\tloadSrcFromPipeline()\n\t\trenderPartition(options, false, 0, 0)\n\t\treturn\n\t}\n\n\tconst ptX = pointX\n\tconst ptY = pointY\n\tconst rads = radii\n\n\t// The start of the current partition, and whether it is an acute elbow (which reads\n\t// the input coordinates rather than the streamlined ones).\n\tlet a = 0\n\tlet aElbow = false\n\tlet hasAnchor = false\n\tlet anchorX = 0\n\tlet anchorY = 0\n\n\t// Unit direction of the previous segment, computed with scalar math to avoid\n\t// allocating two vectors per point.\n\tlet dx = ptX[1] - ptX[0]\n\tlet dy = ptY[1] - ptY[0]\n\tlet len = Math.sqrt(dx * dx + dy * dy)\n\tlet prevVx = dx / len\n\tlet prevVy = dy / len\n\n\tfor (let i = 1; i < n - 1; i++) {\n\t\tdx = ptX[i + 1] - ptX[i]\n\t\tdy = ptY[i + 1] - ptY[i]\n\t\tlen = Math.sqrt(dx * dx + dy * dy)\n\t\tconst nextVx = dx / len\n\t\tconst nextVy = dy / len\n\t\tconst dpr = prevVx * nextVx + prevVy * nextVy\n\t\tprevVx = nextVx\n\t\tprevVy = nextVy\n\n\t\tif (dpr < -0.8) {\n\t\t\t// always treat such acute angles as elbows\n\t\t\t// and use the extended input point as the elbow point for swooshiness in fast zaggy lines\n\t\t\tfinishPartition(a, aElbow, i, true, false, hasAnchor, anchorX, anchorY, options)\n\t\t\ta = i\n\t\t\taElbow = true\n\t\t\t// The next partition's second point keeps the vector it had in the uncut stroke,\n\t\t\t// which pointed at this point's streamlined position rather than its input.\n\t\t\thasAnchor = true\n\t\t\tanchorX = ptX[i]\n\t\t\tanchorY = ptY[i]\n\t\t\tcontinue\n\t\t}\n\n\t\tif (dpr > 0.7) {\n\t\t\t// Not an elbow\n\t\t\tcontinue\n\t\t}\n\n\t\t// so now we have a reasonably acute angle but it might not be an elbow if it's far\n\t\t// away from it's neighbors, angular dist is a normalized representation of how far away the point is from it's neighbors\n\t\t// (normalized by the radius)\n\t\tconst pdx = ptX[i] - ptX[i - 1]\n\t\tconst pdy = ptY[i] - ptY[i - 1]\n\t\tconst ndx = ptX[i + 1] - ptX[i]\n\t\tconst ndy = ptY[i + 1] - ptY[i]\n\t\tconst meanRadius = (rads[i - 1] + rads[i] + rads[i + 1]) / 3\n\t\tif ((pdx * pdx + pdy * pdy + ndx * ndx + ndy * ndy) / (meanRadius * meanRadius) < 1.5) {\n\t\t\t// if this point is kinda close to its neighbors and it has a reasonably\n\t\t\t// acute angle, it's probably a hard elbow. The boundary point ends its\n\t\t\t// partition twice over (the object pipeline pushed it twice).\n\t\t\tfinishPartition(a, aElbow, i, false, true, hasAnchor, anchorX, anchorY, options)\n\t\t\ta = i\n\t\t\taElbow = false\n\t\t\thasAnchor = false\n\t\t\tcontinue\n\t\t}\n\t}\n\tfinishPartition(a, aElbow, n - 1, false, false, hasAnchor, anchorX, anchorY, options)\n}\n\n/**\n * Clean up a partition's ends (drop inner points too close to the boundary points), load\n * it into the track-source buffers and render it. The partition runs from boundary `a` to\n * boundary `b`; `bDup` marks a hard elbow whose end point is duplicated.\n */\nfunction finishPartition(\n\ta: number,\n\taElbow: boolean,\n\tb: number,\n\tbElbow: boolean,\n\tbDup: boolean,\n\thasAnchor: boolean,\n\tanchorX: number,\n\tanchorY: number,\n\toptions: StrokeOptions\n): void {\n\t// The partition as the object pipeline would have built it: point a, points a+1..b-1,\n\t// point b (twice when bDup). Cleanup only ever removes points adjacent to the ends, so\n\t// it reduces to two skip counters.\n\tconst ptX = pointX\n\tconst ptY = pointY\n\tconst rads = radii\n\n\tconst len = b - a + 1 + (bDup ? 1 : 0)\n\tlet s = 0\n\tlet e = 0\n\n\t// clean up start of partition (remove points that are too close to the start)\n\tconst startX = aElbow ? inputX[a] : ptX[a]\n\tconst startY = aElbow ? inputY[a] : ptY[a]\n\tconst startRadius = rads[a]\n\twhile (len - s > 2) {\n\t\tconst i = a + 1 + s\n\t\tconst dx = startX - ptX[i]\n\t\tconst dy = startY - ptY[i]\n\t\tif (dx * dx + dy * dy < (((startRadius + rads[i]) / 2) * 0.5) ** 2) {\n\t\t\t// The surviving second point's vector keeps pointing at the spliced-out point.\n\t\t\thasAnchor = true\n\t\t\tanchorX = ptX[i]\n\t\t\tanchorY = ptY[i]\n\t\t\ts++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// clean up end of partition in the same fashion\n\tconst endX = bElbow ? inputX[b] : ptX[b]\n\tconst endY = bElbow ? inputY[b] : ptY[b]\n\tconst endRadius = rads[b]\n\twhile (len - s - e > 2) {\n\t\tconst i = bDup ? b - e : b - 1 - e\n\t\tconst dx = endX - ptX[i]\n\t\tconst dy = endY - ptY[i]\n\t\tif (dx * dx + dy * dy < (((endRadius + rads[i]) / 2) * 0.5) ** 2) {\n\t\t\te++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tconst innerStart = a + 1 + s\n\tconst innerEnd = bDup ? b - e : b - 1 - e\n\tloadSrcPartition(a, aElbow, innerStart, innerEnd, b, bElbow, bDup && e === 0)\n\trenderPartition(options, hasAnchor, anchorX, anchorY)\n}\n\nfunction writeCirclePath(cx: number, cy: number, r: number) {\n\tconst ncx = toCenti(cx)\n\tconst ncy = toCenti(cy)\n\tconst nr = toCenti(r)\n\twriteStr('M ')\n\twriteC(ncx)\n\twriteStr(' ')\n\twriteC(ncy)\n\twriteStr(' m -')\n\twriteC(nr)\n\twriteStr(', 0 a ')\n\twriteC(nr)\n\twriteStr(',')\n\twriteC(nr)\n\twriteStr(' 0 1,1 ')\n\twriteC(nr * 2)\n\twriteStr(',0 a ')\n\twriteC(nr)\n\twriteStr(',')\n\twriteC(nr)\n\twriteStr(' 0 1,1 -')\n\twriteC(nr * 2)\n\twriteStr(',0')\n}\n\n/** Append an arc from the current position to the cap's other side: `a r,r 0 0 1 dx,dy`. */\nfunction writeCapArc(nr: number, dx: number, dy: number) {\n\twriteStr('a')\n\twriteC(nr)\n\twriteStr(',')\n\twriteC(nr)\n\twriteStr(' 0 0 1 ')\n\twriteCPair(dx, dy)\n}\n\n/** Render the partition currently loaded in the track-source buffers. */\nfunction renderPartition(\n\toptions: StrokeOptions,\n\thasAnchor: boolean,\n\tanchorX: number,\n\tanchorY: number\n): void {\n\tconst n = srcCount\n\tif (n === 0) return\n\tif (n === 1) {\n\t\twriteCirclePath(srcX[0], srcY[0], srcRadius[0])\n\t\treturn\n\t}\n\n\tbuildTracks(options, hasAnchor, anchorX, anchorY)\n\n\tconst lxs = trackLeftX\n\tconst lys = trackLeftY\n\tconst rxs = trackRightX\n\tconst rys = trackRightY\n\n\t// Current position in integer hundredths; all subsequent commands are relative.\n\tlet cx = toCenti(lxs[0])\n\tlet cy = toCenti(lys[0])\n\twriteStr('M')\n\twriteCPair(cx, cy)\n\twriteStr('t')\n\n\t// draw left track, as quadratic curves through the midpoints of consecutive points\n\tlet prevX = lxs[0]\n\tlet prevY = lys[0]\n\tfor (let i = 1; i < trackLeftCount; i++) {\n\t\tconst ptX = lxs[i]\n\t\tconst ptY = lys[i]\n\t\tconst mx = Math.round((prevX + ptX) * 50)\n\t\tconst my = Math.round((prevY + ptY) * 50)\n\t\twriteCPair(mx - cx, my - cy)\n\t\tcx = mx\n\t\tcy = my\n\t\tprevX = ptX\n\t\tprevY = ptY\n\t}\n\t// draw end cap arc\n\t{\n\t\tconst pointX = srcX[n - 1]\n\t\tconst pointY = srcY[n - 1]\n\t\tconst radius = srcRadius[n - 1]\n\t\t// The cap vector points from the last point back at its nearest neighbor.\n\t\tconst vdx = srcX[n - 2] - pointX\n\t\tconst vdy = srcY[n - 2] - pointY\n\t\tconst vlen = Math.sqrt(vdx * vdx + vdy * vdy)\n\t\t// The arc endpoints sit one radius to each side, perpendicular to the cap vector.\n\t\tconst dx = (-vdy / vlen) * radius\n\t\tconst dy = (vdx / vlen) * radius\n\t\tconst asx = toCenti(pointX + dx)\n\t\tconst asy = toCenti(pointY + dy)\n\t\tconst aex = toCenti(pointX - dx)\n\t\tconst aey = toCenti(pointY - dy)\n\t\twriteCPair(asx - cx, asy - cy)\n\t\twriteCapArc(toCenti(radius), aex - asx, aey - asy)\n\t\twriteStr('t')\n\t\tcx = aex\n\t\tcy = aey\n\t}\n\t// draw right track in reverse, also as quadratic curves through midpoints\n\tprevX = rxs[trackRightCount - 1]\n\tprevY = rys[trackRightCount - 1]\n\tfor (let i = trackRightCount - 2; i >= 0; i--) {\n\t\tconst ptX = rxs[i]\n\t\tconst ptY = rys[i]\n\t\tconst mx = Math.round((prevX + ptX) * 50)\n\t\tconst my = Math.round((prevY + ptY) * 50)\n\t\twriteCPair(mx - cx, my - cy)\n\t\tcx = mx\n\t\tcy = my\n\t\tprevX = ptX\n\t\tprevY = ptY\n\t}\n\t// draw start cap arc\n\t{\n\t\tconst pointX = srcX[0]\n\t\tconst pointY = srcY[0]\n\t\tconst radius = srcRadius[0]\n\t\t// The cap vector points from the first point back past its nearest neighbor.\n\t\tconst vdx = pointX - srcX[1]\n\t\tconst vdy = pointY - srcY[1]\n\t\tconst vlen = Math.sqrt(vdx * vdx + vdy * vdy)\n\t\t// The arc endpoints sit one radius to each side, perpendicular to the cap vector.\n\t\tconst dx = (vdy / vlen) * radius\n\t\tconst dy = (-vdx / vlen) * radius\n\t\tconst asx = toCenti(pointX + dx)\n\t\tconst asy = toCenti(pointY + dy)\n\t\tconst aex = toCenti(pointX - dx)\n\t\tconst aey = toCenti(pointY - dy)\n\t\twriteCPair(asx - cx, asy - cy)\n\t\twriteCapArc(toCenti(radius), aex - asx, aey - asy)\n\t\twriteStr('Z')\n\t}\n}\n"],
  "mappings": "AAAA,SAAkB,cAAc;AAChC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,YAAY,WAAW,SAAS,QAAQ,YAAY,gBAAgB;AAC7E;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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