@motionscript/math 0.1.0-alpha.7 → 0.1.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/NOTICE +15 -14
  3. package/dist/annotate/angle-mark.d.ts +6 -6
  4. package/dist/annotate/curly-brace.d.ts +9 -9
  5. package/dist/annotate/emphasis-mark.d.ts +9 -9
  6. package/dist/browser/chunks/{chunk-ABYBW64J.js → chunk-FETQZEN2.js} +2 -2
  7. package/dist/browser/chunks/{chunk-ABYBW64J.js.map → chunk-FETQZEN2.js.map} +2 -2
  8. package/dist/browser/index.js +1 -1
  9. package/dist/browser/index.js.map +3 -3
  10. package/dist/browser/kit.js +1 -1
  11. package/dist/browser/manifest.json +1 -1
  12. package/dist/kit/follow.d.ts +2 -2
  13. package/dist/kit/sampler.js +1 -1
  14. package/dist/kit/sampler.js.map +1 -1
  15. package/dist/marks/drop-lines.d.ts +6 -6
  16. package/dist/marks/plot-point.d.ts +3 -3
  17. package/dist/marks/riemann-sum.d.ts +3 -3
  18. package/dist/marks/tangent-line.d.ts +6 -6
  19. package/dist/marks/vector-arrow.d.ts +6 -6
  20. package/dist/plots/function-plot.d.ts +8 -8
  21. package/dist/tex/matrix.d.ts +2 -2
  22. package/dist/tex/node.d.ts +2 -2
  23. package/dist/tex/typeset.d.ts +4 -4
  24. package/dist/tex/typeset.d.ts.map +1 -1
  25. package/dist/three/curve-plot3d.d.ts +27 -27
  26. package/dist/three/curve-plot3d.d.ts.map +1 -1
  27. package/dist/three/curve-plot3d.js +3 -2
  28. package/dist/three/curve-plot3d.js.map +1 -1
  29. package/dist/three/label3d.d.ts.map +1 -1
  30. package/dist/three/label3d.js +3 -1
  31. package/dist/three/label3d.js.map +1 -1
  32. package/dist/three/plot-point3d.d.ts +27 -27
  33. package/dist/three/surface-plot3d.d.ts +36 -36
  34. package/dist/three/surface-plot3d.js +6 -1
  35. package/dist/three/surface-plot3d.js.map +1 -1
  36. package/dist/three/vector-arrow3d.d.ts +27 -27
  37. package/package.json +5 -4
  38. package/src/kit/sampler.ts +1 -1
  39. package/src/three/curve-plot3d.ts +3 -1
  40. package/src/three/label3d.ts +3 -1
  41. package/src/three/surface-plot3d.ts +7 -1
@@ -1,2 +1,2 @@
1
- import{$ as Ka,$a as Kb,A as ja,Aa as jb,Ab as jc,B as ka,Ba as kb,Bb as kc,C as la,Ca as lb,Cb as lc,D as ma,Da as mb,Db as mc,E as na,Ea as nb,Eb as nc,F as oa,Fa as ob,G as pa,Ga as pb,H as qa,Ha as qb,I as ra,Ia as rb,J as sa,Ja as sb,K as ta,Ka as tb,L as ua,La as ub,M as va,Ma as vb,N as wa,Na as wb,O as xa,Oa as xb,P as ya,Pa as yb,Q as za,Qa as zb,R as Aa,Ra as Ab,S as Ba,Sa as Bb,T as Ca,Ta as Cb,U as Da,Ua as Db,V as Ea,Va as Eb,W as Fa,Wa as Fb,X as Ga,Xa as Gb,Y as Ha,Ya as Hb,Z as Ia,Za as Ib,_ as Ja,_a as Jb,a as L,aa as La,ab as Lb,b as M,ba as Ma,bb as Mb,c as N,ca as Na,cb as Nb,d as O,da as Oa,db as Ob,e as P,ea as Pa,eb as Pb,f as Q,fa as Qa,fb as Qb,g as R,ga as Ra,gb as Rb,h as S,ha as Sa,hb as Sb,i as T,ia as Ta,ib as Tb,j as U,ja as Ua,jb as Ub,k as V,ka as Va,kb as Vb,l as W,la as Wa,lb as Wb,m as X,ma as Xa,mb as Xb,n as Y,na as Ya,nb as Yb,o as Z,oa as Za,ob as Zb,p as _,pa as _a,pb as _b,q as $,qa as $a,qb as $b,r as aa,ra as ab,rb as ac,s as ba,sa as bb,sb as bc,t as ca,ta as cb,tb as cc,u as da,ua as db,ub as dc,v as ea,va as eb,vb as ec,w as fa,wa as fb,wb as fc,x as ga,xa as gb,xb as gc,y as ha,ya as hb,yb as hc,z as ia,za as ib,zb as ic}from"./chunks/chunk-ABYBW64J.js";import{A,B,C,D,E,F,G,H,I,J,K,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunks/chunk-K77KLQX4.js";export{gb as AXES,hb as AXES_COMMANDS,W as AXIS_COLOR,mb as Axes2d,ta as CURVE_KEYS,Yb as EQUATION_KINDS,ia as EQUATION_VARIABLES,Rb as EQUATION_VARIABLES_3D,gc as FIELD_COMMANDS,fc as FIELD_STATE,nb as FIELD_VARIABLES,lc as FILL_PAINT,zb as FOLLOW_COMMANDS,yb as FOLLOW_STATE,wb as FunctionPlot,Mb as GRAPH_3D,jc as GRAPH_LAYOUTS,P as IDENTITY_MATRIX,K as Latex,g as LatexError,f as LatexNotLoaded,b as MATHJAX_LOADER,ea as MATH_DIALECT,u as Morph,nc as OUTLINE_TRIM,Eb as OWN_FRAME,l as PAINT,m as PAINT_COMMANDS,O as PIXEL_MAP,za as PLANE_ENTRY,xa as PLOT,X as PLOT_COLOR,ub as PLOT_COMMANDS,Aa as PLOT_REF,tb as PLOT_STATE,vb as PLOT_STROKE,mc as STROKE_PAINT,wa as SYSTEM,ya as SYSTEM_ENTRY,y as TYPESET,z as TYPESET_COMMANDS,pa as UNSET_PARAM,Fb as add,Qb as aim,ba as along,Wa as anchored,lb as axesFurniture,jb as axesMap,kb as axesOf,M as axisScale,Gb as between,e as blankLatex,Ha as boundsOfRuns,Jb as braceOutline,h as buildLatexPath,N as cartesianMap,Va as castsShadow,Ja as clamp,$b as colorAt,ga as compileExpression,ha as compileExpressionCached,Ab as container,a as createBoundedCache,Ea as curveFor,ua as curveValue,Z as declareFormulas,k as defaultLatexMorph,ec as domainEntry,ic as drawField,E as drawFormula,Kb as drawLabel3D,$ as drawLabels,Ta as drawMark,db as drawSystem,aa as drawn,ka as equationError,la as equationParams,fa as expressionVocabulary,qb as fieldError,ob as fieldParams,cc as fillAt,j as findLatexParts,Cb as followedQuad,fb as formatTick,G as formula,A as formulaFrame,I as formulaOf,Nb as graphEntry,Ob as graphOf,Ra as graphPoint,Lb as graphSpace,Ib as grown,Hb as heading,Ia as inflate,Pa as inkCentre,Oa as inkSize,va as isCurve,H as isFormula,S as isIdentityMatrix,J as latexPartBounds,i as latexPartNames,kc as layOut,C as layoutFormula,oa as lerpDomain,bc as lerpFillScale,ca as lerpInterval,R as lerpMatrix,w as lerpMorph,qa as lerpParams,r as lerpPartFills,_b as lerpScale,na as lerpSource,V as lineThrough,n as listed,ib as loadAxes,D as loadFormula,_ as loadFormulas,c as loadMathJax,Ma as markRuns,Sa as markShape,d as mathJaxLoaded,B as measureFormula,dc as meshEntries,x as morphOf,o as omit,Ya as openPlane,Db as outlineBounds,Qa as ownPoint,p as painted,ja as parseEquation,pb as parseField,Vb as parseSpaceCurve,Ub as parseSurface,F as partBoundsIn,t as partPaint,Xa as placeOnMap,Za as plotArea,Da as plotPlane,ac as readFillScale,da as readInterval,Q as readMatrix,q as readPartFills,Zb as readScale,ma as readSource,Na as reading,Fa as refId,L as resolveInterval,Bb as resting,sa as revisionOf,Ga as runsToPath,sb as sampleCurve,ra as scopeFor,Ca as settle,v as settled,Xb as spaceCurveError,Tb as spaceCurveParams,Pb as spaceOf,Ka as stated,Ua as strokeShape,Wb as surfaceError,Sb as surfaceParams,bb as systemLayout,_a as systemMap,cb as systemOpenPlane,Ba as systemPlane,ab as systemProvides,$a as systemSize,eb as ticksFor,rb as traceContour,hc as traceField,xb as tracePlot,La as traced,T as transformedMap,U as warpedMap,s as withPartFill,Y as withoutTips};
1
+ import{$ as Ka,$a as Kb,A as ja,Aa as jb,Ab as jc,B as ka,Ba as kb,Bb as kc,C as la,Ca as lb,Cb as lc,D as ma,Da as mb,Db as mc,E as na,Ea as nb,Eb as nc,F as oa,Fa as ob,G as pa,Ga as pb,H as qa,Ha as qb,I as ra,Ia as rb,J as sa,Ja as sb,K as ta,Ka as tb,L as ua,La as ub,M as va,Ma as vb,N as wa,Na as wb,O as xa,Oa as xb,P as ya,Pa as yb,Q as za,Qa as zb,R as Aa,Ra as Ab,S as Ba,Sa as Bb,T as Ca,Ta as Cb,U as Da,Ua as Db,V as Ea,Va as Eb,W as Fa,Wa as Fb,X as Ga,Xa as Gb,Y as Ha,Ya as Hb,Z as Ia,Za as Ib,_ as Ja,_a as Jb,a as L,aa as La,ab as Lb,b as M,ba as Ma,bb as Mb,c as N,ca as Na,cb as Nb,d as O,da as Oa,db as Ob,e as P,ea as Pa,eb as Pb,f as Q,fa as Qa,fb as Qb,g as R,ga as Ra,gb as Rb,h as S,ha as Sa,hb as Sb,i as T,ia as Ta,ib as Tb,j as U,ja as Ua,jb as Ub,k as V,ka as Va,kb as Vb,l as W,la as Wa,lb as Wb,m as X,ma as Xa,mb as Xb,n as Y,na as Ya,nb as Yb,o as Z,oa as Za,ob as Zb,p as _,pa as _a,pb as _b,q as $,qa as $a,qb as $b,r as aa,ra as ab,rb as ac,s as ba,sa as bb,sb as bc,t as ca,ta as cb,tb as cc,u as da,ua as db,ub as dc,v as ea,va as eb,vb as ec,w as fa,wa as fb,wb as fc,x as ga,xa as gb,xb as gc,y as ha,ya as hb,yb as hc,z as ia,za as ib,zb as ic}from"./chunks/chunk-FETQZEN2.js";import{A,B,C,D,E,F,G,H,I,J,K,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunks/chunk-K77KLQX4.js";export{gb as AXES,hb as AXES_COMMANDS,W as AXIS_COLOR,mb as Axes2d,ta as CURVE_KEYS,Yb as EQUATION_KINDS,ia as EQUATION_VARIABLES,Rb as EQUATION_VARIABLES_3D,gc as FIELD_COMMANDS,fc as FIELD_STATE,nb as FIELD_VARIABLES,lc as FILL_PAINT,zb as FOLLOW_COMMANDS,yb as FOLLOW_STATE,wb as FunctionPlot,Mb as GRAPH_3D,jc as GRAPH_LAYOUTS,P as IDENTITY_MATRIX,K as Latex,g as LatexError,f as LatexNotLoaded,b as MATHJAX_LOADER,ea as MATH_DIALECT,u as Morph,nc as OUTLINE_TRIM,Eb as OWN_FRAME,l as PAINT,m as PAINT_COMMANDS,O as PIXEL_MAP,za as PLANE_ENTRY,xa as PLOT,X as PLOT_COLOR,ub as PLOT_COMMANDS,Aa as PLOT_REF,tb as PLOT_STATE,vb as PLOT_STROKE,mc as STROKE_PAINT,wa as SYSTEM,ya as SYSTEM_ENTRY,y as TYPESET,z as TYPESET_COMMANDS,pa as UNSET_PARAM,Fb as add,Qb as aim,ba as along,Wa as anchored,lb as axesFurniture,jb as axesMap,kb as axesOf,M as axisScale,Gb as between,e as blankLatex,Ha as boundsOfRuns,Jb as braceOutline,h as buildLatexPath,N as cartesianMap,Va as castsShadow,Ja as clamp,$b as colorAt,ga as compileExpression,ha as compileExpressionCached,Ab as container,a as createBoundedCache,Ea as curveFor,ua as curveValue,Z as declareFormulas,k as defaultLatexMorph,ec as domainEntry,ic as drawField,E as drawFormula,Kb as drawLabel3D,$ as drawLabels,Ta as drawMark,db as drawSystem,aa as drawn,ka as equationError,la as equationParams,fa as expressionVocabulary,qb as fieldError,ob as fieldParams,cc as fillAt,j as findLatexParts,Cb as followedQuad,fb as formatTick,G as formula,A as formulaFrame,I as formulaOf,Nb as graphEntry,Ob as graphOf,Ra as graphPoint,Lb as graphSpace,Ib as grown,Hb as heading,Ia as inflate,Pa as inkCentre,Oa as inkSize,va as isCurve,H as isFormula,S as isIdentityMatrix,J as latexPartBounds,i as latexPartNames,kc as layOut,C as layoutFormula,oa as lerpDomain,bc as lerpFillScale,ca as lerpInterval,R as lerpMatrix,w as lerpMorph,qa as lerpParams,r as lerpPartFills,_b as lerpScale,na as lerpSource,V as lineThrough,n as listed,ib as loadAxes,D as loadFormula,_ as loadFormulas,c as loadMathJax,Ma as markRuns,Sa as markShape,d as mathJaxLoaded,B as measureFormula,dc as meshEntries,x as morphOf,o as omit,Ya as openPlane,Db as outlineBounds,Qa as ownPoint,p as painted,ja as parseEquation,pb as parseField,Vb as parseSpaceCurve,Ub as parseSurface,F as partBoundsIn,t as partPaint,Xa as placeOnMap,Za as plotArea,Da as plotPlane,ac as readFillScale,da as readInterval,Q as readMatrix,q as readPartFills,Zb as readScale,ma as readSource,Na as reading,Fa as refId,L as resolveInterval,Bb as resting,sa as revisionOf,Ga as runsToPath,sb as sampleCurve,ra as scopeFor,Ca as settle,v as settled,Xb as spaceCurveError,Tb as spaceCurveParams,Pb as spaceOf,Ka as stated,Ua as strokeShape,Wb as surfaceError,Sb as surfaceParams,bb as systemLayout,_a as systemMap,cb as systemOpenPlane,Ba as systemPlane,ab as systemProvides,$a as systemSize,eb as ticksFor,rb as traceContour,hc as traceField,xb as tracePlot,La as traced,T as transformedMap,U as warpedMap,s as withPartFill,Y as withoutTips};
2
2
  //# sourceMappingURL=kit.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/math",
3
- "version": "0.1.0-alpha.7",
3
+ "version": "0.1.0-alpha.8",
4
4
  "exports": {
5
5
  ".": "dist/browser/index.js",
6
6
  "./kit": "dist/browser/kit.js",
@@ -41,10 +41,10 @@ export declare const FOLLOW_STATE: {
41
41
  /** The nodes the retarget names, there and where it set out from, read as nodes. */
42
42
  retargetOn: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, true>;
43
43
  retargetFrom: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, true>;
44
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
45
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
46
44
  start: import("@motionscript/sdk").Type<number, number, false>;
47
45
  end: import("@motionscript/sdk").Type<number, number, false>;
46
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
47
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
48
48
  };
49
49
  export declare const FOLLOW_COMMANDS: {
50
50
  retargetTo: {
@@ -1,4 +1,4 @@
1
- /** Skia's path coordinates are 32-bit floats; past this a clamped point still clips to the same edge. */
1
+ /** Path coordinates are 32-bit floats in the renderer; past this a clamped point still clips to the same edge. */
2
2
  const COORD_LIMIT = 16_000;
3
3
  /** How far, in pixels, the drawn chord may stray from the curve. */
4
4
  const TOLERANCE_PX = 0.25;
@@ -1 +1 @@
1
- {"version":3,"file":"sampler.js","sourceRoot":"","sources":["../../src/kit/sampler.ts"],"names":[],"mappings":"AAkBA,yGAAyG;AACzG,MAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,oEAAoE;AACpE,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,wGAAwG;AACxG,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,oDAAoD;AACpD,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,aAAa,GAAG,GAAG,CAAC;AAY1B,gFAAgF;AAChF,yDAAyD;AACzD,MAAM,KAAK,GAAa,EAAE,CAAC;AAC3B,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB,SAAS,UAAU;IACf,IAAI,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;IAC5B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACrB,IAAI,GAAG,KAAK,EAAE,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IACD,SAAS,EAAE,CAAC;IACZ,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,KAAK;IACV,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;AAC3D,CAAC;AAED,MAAM,OAAO,GAAY,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE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EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;QACpC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;KACvC,CAAC;AACN,CAAC","sourcesContent":["import type { Extents, Vector2 } from \"@motionscript/sdk\";\r\n\r\n/**\r\n * Turns a curve into the polylines that draw it: adaptively, so a straight\r\n * stretch costs two points and a tight bend as many as it needs, and broken\r\n * wherever the curve is, at an asymptote or the edge of its domain.\r\n */\r\n\r\n/** A curve's parameter to its pixel, written into `out`. `false` where the curve is undefined. */\r\nexport type CurveProjection = (t: number, out: Vector2) => boolean;\r\n\r\nexport interface SampleOptions {\r\n /** The equal steps the parameter range starts as, before any is split. */\r\n seeds?: number;\r\n /** A parameter step that is not split again, however bent. */\r\n minStep?: number;\r\n}\r\n\r\n/** Skia's path coordinates are 32-bit floats; past this a clamped point still clips to the same edge. */\r\nconst COORD_LIMIT = 16_000;\r\n/** How far, in pixels, the drawn chord may stray from the curve. */\r\nconst TOLERANCE_PX = 0.25;\r\n/** A turn, in radians, a chord is allowed to hide: what keeps a symmetric bump from reading as flat. */\r\nconst ANGLE_TOLERANCE = 0.05;\r\nconst MAX_DEPTH = 12;\r\nconst MAX_EVALUATIONS = 40_000;\r\nconst MAX_POINTS = 24_000;\r\n/** Bisections spent finding where a domain ends. */\r\nconst BOUNDARY_STEPS = 60;\r\nconst DEFAULT_SEEDS = 256;\r\n\r\ninterface Sample {\r\n t: number;\r\n px: number;\r\n py: number;\r\n /** The pixel before clamping: what tells an asymptote from a steep line. */\r\n rx: number;\r\n ry: number;\r\n ok: boolean;\r\n}\r\n\r\n// Midpoints are pooled: a refine is a depth-first walk, so a slot is free again\r\n// as soon as the seed interval it was taken for is done.\r\nconst arena: Sample[] = [];\r\nlet arenaMark = 0;\r\n\r\nfunction takeSample(): Sample {\r\n let slot = arena[arenaMark];\r\n if (slot === undefined) {\r\n slot = blank();\r\n arena.push(slot);\r\n }\r\n arenaMark++;\r\n return slot;\r\n}\r\n\r\nfunction blank(): Sample {\r\n return { t: 0, px: 0, py: 0, rx: 0, ry: 0, ok: false };\r\n}\r\n\r\nconst scratch: Vector2 = { x: 0, y: 0 };\r\n\r\n/** The runs of points that draw `project` over `[t0, t1]`, clipped to `clip`. */\r\nexport function sampleCurve(\r\n project: CurveProjection,\r\n t0: number,\r\n t1: number,\r\n clip: Extents,\r\n { seeds = DEFAULT_SEEDS, minStep = 0 }: SampleOptions = {},\r\n): Vector2[][] {\r\n if (!(t1 > t0) || !Number.isFinite(t0) || !Number.isFinite(t1)) return [];\r\n const pen = new CurvePen(clip);\r\n let spent = 0;\r\n\r\n const write = (slot: Sample, t: number): Sample => {\r\n const defined = project(t, scratch);\r\n spent++;\r\n const ok = defined && Number.isFinite(scratch.x) && Number.isFinite(scratch.y);\r\n slot.t = t;\r\n slot.rx = ok ? scratch.x : 0;\r\n slot.ry = ok ? scratch.y : 0;\r\n slot.px = clampCoord(slot.rx);\r\n slot.py = clampCoord(slot.ry);\r\n slot.ok = ok;\r\n return slot;\r\n };\r\n const at = (t: number): Sample => write(takeSample(), t);\r\n\r\n // The last defined point before `to`, which is not: where `sqrt(x)` meets its axis.\r\n const edgeOf = (from: Sample, to: Sample): Sample => {\r\n let inside = from;\r\n let outsideT = to.t;\r\n for (let i = 0; i < BOUNDARY_STEPS; i++) {\r\n if (spent >= MAX_EVALUATIONS || offFrame(inside, clip)) break;\r\n const midT = (inside.t + outsideT) / 2;\r\n if (midT === inside.t || midT === outsideT) break;\r\n const mid = at(midT);\r\n if (!mid.ok) {\r\n outsideT = midT;\r\n continue;\r\n }\r\n const settled = Math.abs(mid.px - inside.px) < TOLERANCE_PX && Math.abs(mid.py - inside.py) < TOLERANCE_PX;\r\n inside = mid;\r\n if (settled) break;\r\n }\r\n return inside;\r\n };\r\n\r\n const emit = (a: Sample, m: Sample | null, b: Sample, floored: boolean): void => {\r\n if (a.ok && b.ok) {\r\n if (floored && diverges(a, m, b, clip)) pen.break();\r\n else pen.draw(a, b);\r\n return;\r\n }\r\n if (a.ok) {\r\n const edge = edgeOf(a, b);\r\n if (edge.t !== a.t) pen.draw(a, edge);\r\n pen.break();\r\n return;\r\n }\r\n pen.break();\r\n if (b.ok) {\r\n const edge = edgeOf(b, a);\r\n if (edge.t !== b.t) pen.draw(edge, b);\r\n else pen.start(b);\r\n }\r\n };\r\n\r\n const refine = (a: Sample, b: Sample, depth: number): void => {\r\n if (spent >= MAX_EVALUATIONS || pen.points >= MAX_POINTS) {\r\n emit(a, null, b, false);\r\n return;\r\n }\r\n const m = at((a.t + b.t) / 2);\r\n const floored = depth >= MAX_DEPTH || b.t - a.t <= minStep;\r\n if (floored || flat(a, m, b)) {\r\n emit(a, m, b, floored);\r\n return;\r\n }\r\n refine(a, m, depth + 1);\r\n refine(m, b, depth + 1);\r\n };\r\n\r\n const count = Math.max(1, Math.round(seeds));\r\n const step = (t1 - t0) / count;\r\n const ends: [Sample, Sample] = [blank(), blank()];\r\n let previous = write(ends[0], t0);\r\n for (let i = 1; i <= count; i++) {\r\n const next = write(ends[i & 1], i === count ? t1 : t0 + i * step);\r\n arenaMark = 0;\r\n refine(previous, next, 0);\r\n previous = next;\r\n }\r\n arenaMark = 0;\r\n return pen.finish();\r\n}\r\n\r\nfunction flat(a: Sample, m: Sample, b: Sample): boolean {\r\n if (a.ok !== m.ok || m.ok !== b.ok) return false;\r\n if (!a.ok) return true;\r\n const dx = b.px - a.px;\r\n const dy = b.py - a.py;\r\n const length = Math.hypot(dx, dy) || 1;\r\n if (Math.abs((m.px - a.px) * dy - (m.py - a.py) * dx) / length > TOLERANCE_PX) return false;\r\n let turn = Math.abs(Math.atan2(m.py - a.py, m.px - a.px) - Math.atan2(b.py - m.py, b.px - m.px));\r\n if (turn > Math.PI) turn = 2 * Math.PI - turn;\r\n return turn < ANGLE_TOLERANCE;\r\n}\r\n\r\n// Two neighbours on opposite sides of the frame, with nothing between them that\r\n// is between them: an asymptote, not a steep line.\r\nfunction diverges(a: Sample, m: Sample | null, b: Sample, clip: Extents): boolean {\r\n const straddles =\r\n (a.py > clip.maxY && b.py < clip.minY) || (a.py < clip.minY && b.py > clip.maxY) ||\r\n (a.px > clip.maxX && b.px < clip.minX) || (a.px < clip.minX && b.px > clip.maxX);\r\n if (!straddles || m === null) return false;\r\n if (!m.ok) return true;\r\n return (\r\n m.ry < Math.min(a.ry, b.ry) || m.ry > Math.max(a.ry, b.ry) ||\r\n m.rx < Math.min(a.rx, b.rx) || m.rx > Math.max(a.rx, b.rx)\r\n );\r\n}\r\n\r\nfunction offFrame(sample: Sample, clip: Extents): boolean {\r\n return sample.py > clip.maxY || sample.py < clip.minY || sample.px > clip.maxX || sample.px < clip.minX;\r\n}\r\n\r\nfunction clampCoord(value: number): number {\r\n if (value > COORD_LIMIT) return COORD_LIMIT;\r\n if (value < -COORD_LIMIT) return -COORD_LIMIT;\r\n return value;\r\n}\r\n\r\nclass CurvePen {\r\n points = 0;\r\n private readonly runs: Vector2[][] = [];\r\n private open: Vector2[] = [];\r\n private cursor: Vector2 | null = null;\r\n\r\n constructor(private readonly clip: Extents) {}\r\n\r\n draw(a: Sample, b: Sample): void {\r\n const segment = clipSegment(a.px, a.py, b.px, b.py, this.clip);\r\n if (!segment) {\r\n this.break();\r\n return;\r\n }\r\n const [start, end] = segment;\r\n if (this.cursor && samePoint(this.cursor, start)) {\r\n this.push(end);\r\n } else {\r\n this.break();\r\n this.push(start);\r\n this.push(end);\r\n }\r\n this.cursor = end;\r\n }\r\n\r\n start(b: Sample): void {\r\n this.break();\r\n if (!inside(b.px, b.py, this.clip)) return;\r\n this.cursor = { x: b.px, y: b.py };\r\n this.push(this.cursor);\r\n }\r\n\r\n break(): void {\r\n if (this.open.length >= 2) this.runs.push(this.open);\r\n this.open = [];\r\n this.cursor = null;\r\n }\r\n\r\n finish(): Vector2[][] {\r\n this.break();\r\n return this.runs;\r\n }\r\n\r\n private push(point: Vector2): void {\r\n this.open.push(point);\r\n this.points++;\r\n }\r\n}\r\n\r\nfunction samePoint(a: Vector2, b: Vector2): boolean {\r\n return Math.abs(a.x - b.x) < 0.1 && Math.abs(a.y - b.y) < 0.1;\r\n}\r\n\r\nfunction inside(x: number, y: number, clip: Extents): boolean {\r\n return x >= clip.minX && x <= clip.maxX && y >= clip.minY && y <= clip.maxY;\r\n}\r\n\r\n// Liang–Barsky: the part of a segment inside the clip, or null when none is.\r\nfunction clipSegment(ax: number, ay: number, bx: number, by: number, clip: Extents): [Vector2, Vector2] | null {\r\n const dx = bx - ax;\r\n const dy = by - ay;\r\n let t0 = 0;\r\n let t1 = 1;\r\n const edges: [number, number][] = [\r\n [-dx, ax - clip.minX],\r\n [dx, clip.maxX - ax],\r\n [-dy, ay - clip.minY],\r\n [dy, clip.maxY - ay],\r\n ];\r\n for (const [p, q] of edges) {\r\n if (p === 0) {\r\n if (q < 0) return null;\r\n continue;\r\n }\r\n const r = q / p;\r\n if (p < 0) {\r\n if (r > t1) return null;\r\n if (r > t0) t0 = r;\r\n } else {\r\n if (r < t0) return null;\r\n if (r < t1) t1 = r;\r\n }\r\n }\r\n return [\r\n { x: ax + t0 * dx, y: ay + t0 * dy },\r\n { x: ax + t1 * dx, y: ay + t1 * dy },\r\n ];\r\n}\r\n"]}
1
+ {"version":3,"file":"sampler.js","sourceRoot":"","sources":["../../src/kit/sampler.ts"],"names":[],"mappings":"AAkBA,kHAAkH;AAClH,MAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,oEAAoE;AACpE,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,wGAAwG;AACxG,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,oDAAoD;AACpD,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,aAAa,GAAG,GAAG,CAAC;AAY1B,gFAAgF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,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACV,IAAI,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YACvB,SAAS;QACb,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACR,IAAI,CAAC,GAAG,EAAE;gBAAE,OAAO,IAAI,CAAC;YACxB,IAAI,CAAC,GAAG,EAAE;gBAAE,EAAE,GAAG,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,GAAG,EAAE;gBAAE,OAAO,IAAI,CAAC;YACxB,IAAI,CAAC,GAAG,EAAE;gBAAE,EAAE,GAAG,CAAC,CAAC;QACvB,CAAC;IACL,CAAC;IACD,OAAO;QACH,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;QACpC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;KACvC,CAAC;AACN,CAAC","sourcesContent":["import type { Extents, Vector2 } from \"@motionscript/sdk\";\r\n\r\n/**\r\n * Turns a curve into the polylines that draw it: adaptively, so a straight\r\n * stretch costs two points and a tight bend as many as it needs, and broken\r\n * wherever the curve is, at an asymptote or the edge of its domain.\r\n */\r\n\r\n/** A curve's parameter to its pixel, written into `out`. `false` where the curve is undefined. */\r\nexport type CurveProjection = (t: number, out: Vector2) => boolean;\r\n\r\nexport interface SampleOptions {\r\n /** The equal steps the parameter range starts as, before any is split. */\r\n seeds?: number;\r\n /** A parameter step that is not split again, however bent. */\r\n minStep?: number;\r\n}\r\n\r\n/** Path coordinates are 32-bit floats in the renderer; past this a clamped point still clips to the same edge. */\r\nconst COORD_LIMIT = 16_000;\r\n/** How far, in pixels, the drawn chord may stray from the curve. */\r\nconst TOLERANCE_PX = 0.25;\r\n/** A turn, in radians, a chord is allowed to hide: what keeps a symmetric bump from reading as flat. */\r\nconst ANGLE_TOLERANCE = 0.05;\r\nconst MAX_DEPTH = 12;\r\nconst MAX_EVALUATIONS = 40_000;\r\nconst MAX_POINTS = 24_000;\r\n/** Bisections spent finding where a domain ends. */\r\nconst BOUNDARY_STEPS = 60;\r\nconst DEFAULT_SEEDS = 256;\r\n\r\ninterface Sample {\r\n t: number;\r\n px: number;\r\n py: number;\r\n /** The pixel before clamping: what tells an asymptote from a steep line. */\r\n rx: number;\r\n ry: number;\r\n ok: boolean;\r\n}\r\n\r\n// Midpoints are pooled: a refine is a depth-first walk, so a slot is free again\r\n// as soon as the seed interval it was taken for is done.\r\nconst arena: Sample[] = [];\r\nlet arenaMark = 0;\r\n\r\nfunction takeSample(): Sample {\r\n let slot = arena[arenaMark];\r\n if (slot === undefined) {\r\n slot = blank();\r\n arena.push(slot);\r\n }\r\n arenaMark++;\r\n return slot;\r\n}\r\n\r\nfunction blank(): Sample {\r\n return { t: 0, px: 0, py: 0, rx: 0, ry: 0, ok: false };\r\n}\r\n\r\nconst scratch: Vector2 = { x: 0, y: 0 };\r\n\r\n/** The runs of points that draw `project` over `[t0, t1]`, clipped to `clip`. */\r\nexport function sampleCurve(\r\n project: CurveProjection,\r\n t0: number,\r\n t1: number,\r\n clip: Extents,\r\n { seeds = DEFAULT_SEEDS, minStep = 0 }: SampleOptions = {},\r\n): Vector2[][] {\r\n if (!(t1 > t0) || !Number.isFinite(t0) || !Number.isFinite(t1)) return [];\r\n const pen = new CurvePen(clip);\r\n let spent = 0;\r\n\r\n const write = (slot: Sample, t: number): Sample => {\r\n const defined = project(t, scratch);\r\n spent++;\r\n const ok = defined && Number.isFinite(scratch.x) && Number.isFinite(scratch.y);\r\n slot.t = t;\r\n slot.rx = ok ? scratch.x : 0;\r\n slot.ry = ok ? scratch.y : 0;\r\n slot.px = clampCoord(slot.rx);\r\n slot.py = clampCoord(slot.ry);\r\n slot.ok = ok;\r\n return slot;\r\n };\r\n const at = (t: number): Sample => write(takeSample(), t);\r\n\r\n // The last defined point before `to`, which is not: where `sqrt(x)` meets its axis.\r\n const edgeOf = (from: Sample, to: Sample): Sample => {\r\n let inside = from;\r\n let outsideT = to.t;\r\n for (let i = 0; i < BOUNDARY_STEPS; i++) {\r\n if (spent >= MAX_EVALUATIONS || offFrame(inside, clip)) break;\r\n const midT = (inside.t + outsideT) / 2;\r\n if (midT === inside.t || midT === outsideT) break;\r\n const mid = at(midT);\r\n if (!mid.ok) {\r\n outsideT = midT;\r\n continue;\r\n }\r\n const settled = Math.abs(mid.px - inside.px) < TOLERANCE_PX && Math.abs(mid.py - inside.py) < TOLERANCE_PX;\r\n inside = mid;\r\n if (settled) break;\r\n }\r\n return inside;\r\n };\r\n\r\n const emit = (a: Sample, m: Sample | null, b: Sample, floored: boolean): void => {\r\n if (a.ok && b.ok) {\r\n if (floored && diverges(a, m, b, clip)) pen.break();\r\n else pen.draw(a, b);\r\n return;\r\n }\r\n if (a.ok) {\r\n const edge = edgeOf(a, b);\r\n if (edge.t !== a.t) pen.draw(a, edge);\r\n pen.break();\r\n return;\r\n }\r\n pen.break();\r\n if (b.ok) {\r\n const edge = edgeOf(b, a);\r\n if (edge.t !== b.t) pen.draw(edge, b);\r\n else pen.start(b);\r\n }\r\n };\r\n\r\n const refine = (a: Sample, b: Sample, depth: number): void => {\r\n if (spent >= MAX_EVALUATIONS || pen.points >= MAX_POINTS) {\r\n emit(a, null, b, false);\r\n return;\r\n }\r\n const m = at((a.t + b.t) / 2);\r\n const floored = depth >= MAX_DEPTH || b.t - a.t <= minStep;\r\n if (floored || flat(a, m, b)) {\r\n emit(a, m, b, floored);\r\n return;\r\n }\r\n refine(a, m, depth + 1);\r\n refine(m, b, depth + 1);\r\n };\r\n\r\n const count = Math.max(1, Math.round(seeds));\r\n const step = (t1 - t0) / count;\r\n const ends: [Sample, Sample] = [blank(), blank()];\r\n let previous = write(ends[0], t0);\r\n for (let i = 1; i <= count; i++) {\r\n const next = write(ends[i & 1], i === count ? t1 : t0 + i * step);\r\n arenaMark = 0;\r\n refine(previous, next, 0);\r\n previous = next;\r\n }\r\n arenaMark = 0;\r\n return pen.finish();\r\n}\r\n\r\nfunction flat(a: Sample, m: Sample, b: Sample): boolean {\r\n if (a.ok !== m.ok || m.ok !== b.ok) return false;\r\n if (!a.ok) return true;\r\n const dx = b.px - a.px;\r\n const dy = b.py - a.py;\r\n const length = Math.hypot(dx, dy) || 1;\r\n if (Math.abs((m.px - a.px) * dy - (m.py - a.py) * dx) / length > TOLERANCE_PX) return false;\r\n let turn = Math.abs(Math.atan2(m.py - a.py, m.px - a.px) - Math.atan2(b.py - m.py, b.px - m.px));\r\n if (turn > Math.PI) turn = 2 * Math.PI - turn;\r\n return turn < ANGLE_TOLERANCE;\r\n}\r\n\r\n// Two neighbours on opposite sides of the frame, with nothing between them that\r\n// is between them: an asymptote, not a steep line.\r\nfunction diverges(a: Sample, m: Sample | null, b: Sample, clip: Extents): boolean {\r\n const straddles =\r\n (a.py > clip.maxY && b.py < clip.minY) || (a.py < clip.minY && b.py > clip.maxY) ||\r\n (a.px > clip.maxX && b.px < clip.minX) || (a.px < clip.minX && b.px > clip.maxX);\r\n if (!straddles || m === null) return false;\r\n if (!m.ok) return true;\r\n return (\r\n m.ry < Math.min(a.ry, b.ry) || m.ry > Math.max(a.ry, b.ry) ||\r\n m.rx < Math.min(a.rx, b.rx) || m.rx > Math.max(a.rx, b.rx)\r\n );\r\n}\r\n\r\nfunction offFrame(sample: Sample, clip: Extents): boolean {\r\n return sample.py > clip.maxY || sample.py < clip.minY || sample.px > clip.maxX || sample.px < clip.minX;\r\n}\r\n\r\nfunction clampCoord(value: number): number {\r\n if (value > COORD_LIMIT) return COORD_LIMIT;\r\n if (value < -COORD_LIMIT) return -COORD_LIMIT;\r\n return value;\r\n}\r\n\r\nclass CurvePen {\r\n points = 0;\r\n private readonly runs: Vector2[][] = [];\r\n private open: Vector2[] = [];\r\n private cursor: Vector2 | null = null;\r\n\r\n constructor(private readonly clip: Extents) {}\r\n\r\n draw(a: Sample, b: Sample): void {\r\n const segment = clipSegment(a.px, a.py, b.px, b.py, this.clip);\r\n if (!segment) {\r\n this.break();\r\n return;\r\n }\r\n const [start, end] = segment;\r\n if (this.cursor && samePoint(this.cursor, start)) {\r\n this.push(end);\r\n } else {\r\n this.break();\r\n this.push(start);\r\n this.push(end);\r\n }\r\n this.cursor = end;\r\n }\r\n\r\n start(b: Sample): void {\r\n this.break();\r\n if (!inside(b.px, b.py, this.clip)) return;\r\n this.cursor = { x: b.px, y: b.py };\r\n this.push(this.cursor);\r\n }\r\n\r\n break(): void {\r\n if (this.open.length >= 2) this.runs.push(this.open);\r\n this.open = [];\r\n this.cursor = null;\r\n }\r\n\r\n finish(): Vector2[][] {\r\n this.break();\r\n return this.runs;\r\n }\r\n\r\n private push(point: Vector2): void {\r\n this.open.push(point);\r\n this.points++;\r\n }\r\n}\r\n\r\nfunction samePoint(a: Vector2, b: Vector2): boolean {\r\n return Math.abs(a.x - b.x) < 0.1 && Math.abs(a.y - b.y) < 0.1;\r\n}\r\n\r\nfunction inside(x: number, y: number, clip: Extents): boolean {\r\n return x >= clip.minX && x <= clip.maxX && y >= clip.minY && y <= clip.maxY;\r\n}\r\n\r\n// Liang–Barsky: the part of a segment inside the clip, or null when none is.\r\nfunction clipSegment(ax: number, ay: number, bx: number, by: number, clip: Extents): [Vector2, Vector2] | null {\r\n const dx = bx - ax;\r\n const dy = by - ay;\r\n let t0 = 0;\r\n let t1 = 1;\r\n const edges: [number, number][] = [\r\n [-dx, ax - clip.minX],\r\n [dx, clip.maxX - ax],\r\n [-dy, ay - clip.minY],\r\n [dy, clip.maxY - ay],\r\n ];\r\n for (const [p, q] of edges) {\r\n if (p === 0) {\r\n if (q < 0) return null;\r\n continue;\r\n }\r\n const r = q / p;\r\n if (p < 0) {\r\n if (r > t1) return null;\r\n if (r > t0) t0 = r;\r\n } else {\r\n if (r < t0) return null;\r\n if (r < t1) t1 = r;\r\n }\r\n }\r\n return [\r\n { x: ax + t0 * dx, y: ay + t0 * dy },\r\n { x: ax + t1 * dx, y: ay + t1 * dy },\r\n ];\r\n}\r\n"]}
@@ -14,10 +14,10 @@ export declare const DropLines: import("@motionscript/sdk").Component<"dropLines
14
14
  /** Which axis to drop to: `x` draws the vertical line, `y` the horizontal one. */
15
15
  axis: import("@motionscript/sdk").Type<"x" | "y" | "both", "x" | "y" | "both", false>;
16
16
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
17
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
18
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
19
17
  start: import("@motionscript/sdk").Type<number, number, false>;
20
18
  end: import("@motionscript/sdk").Type<number, number, false>;
19
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
20
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
21
21
  }>, {
22
22
  strokeTo: readonly ["stroke"];
23
23
  shadowTo: readonly ["shadow"];
@@ -31,20 +31,20 @@ export declare const DropLines: import("@motionscript/sdk").Component<"dropLines
31
31
  /** Which axis to drop to: `x` draws the vertical line, `y` the horizontal one. */
32
32
  axis: import("@motionscript/sdk").Type<"x" | "y" | "both", "x" | "y" | "both", false>;
33
33
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
34
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
35
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
36
34
  start: import("@motionscript/sdk").Type<number, number, false>;
37
35
  end: import("@motionscript/sdk").Type<number, number, false>;
36
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
37
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
38
38
  }>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
39
39
  /** A plot to take the point's height from, by id. */
40
40
  on: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
41
41
  /** Which axis to drop to: `x` draws the vertical line, `y` the horizontal one. */
42
42
  axis: import("@motionscript/sdk").Type<"x" | "y" | "both", "x" | "y" | "both", false>;
43
43
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
44
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
45
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
46
44
  start: import("@motionscript/sdk").Type<number, number, false>;
47
45
  end: import("@motionscript/sdk").Type<number, number, false>;
46
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
47
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
48
48
  }>, {
49
49
  strokeTo: readonly ["stroke"];
50
50
  shadowTo: readonly ["shadow"];
@@ -18,7 +18,7 @@ export declare const PlotPoint: import("@motionscript/sdk").Component<"plotPoint
18
18
  on: import("@motionscript/sdk").Type<string, import("@motionscript/sdk").NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
19
19
  radius: import("@motionscript/sdk").Type<number, number, false>;
20
20
  label: import("@motionscript/sdk").Type<string, string, false>;
21
- labelSide: import("@motionscript/sdk").Type<"left" | "right" | "below" | "above", "left" | "right" | "below" | "above", false>;
21
+ labelSide: import("@motionscript/sdk").Type<"right" | "left" | "below" | "above", "right" | "left" | "below" | "above", false>;
22
22
  labelSize: import("@motionscript/sdk").Type<number, number, false>;
23
23
  labelColor: import("@motionscript/sdk").Type<Color, NormalizedColor, false>;
24
24
  fontFamily: import("@motionscript/sdk").Type<string, string, false>;
@@ -37,7 +37,7 @@ export declare const PlotPoint: import("@motionscript/sdk").Component<"plotPoint
37
37
  on: import("@motionscript/sdk").Type<string, import("@motionscript/sdk").NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
38
38
  radius: import("@motionscript/sdk").Type<number, number, false>;
39
39
  label: import("@motionscript/sdk").Type<string, string, false>;
40
- labelSide: import("@motionscript/sdk").Type<"left" | "right" | "below" | "above", "left" | "right" | "below" | "above", false>;
40
+ labelSide: import("@motionscript/sdk").Type<"right" | "left" | "below" | "above", "right" | "left" | "below" | "above", false>;
41
41
  labelSize: import("@motionscript/sdk").Type<number, number, false>;
42
42
  labelColor: import("@motionscript/sdk").Type<Color, NormalizedColor, false>;
43
43
  fontFamily: import("@motionscript/sdk").Type<string, string, false>;
@@ -52,7 +52,7 @@ export declare const PlotPoint: import("@motionscript/sdk").Component<"plotPoint
52
52
  on: import("@motionscript/sdk").Type<string, import("@motionscript/sdk").NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
53
53
  radius: import("@motionscript/sdk").Type<number, number, false>;
54
54
  label: import("@motionscript/sdk").Type<string, string, false>;
55
- labelSide: import("@motionscript/sdk").Type<"left" | "right" | "below" | "above", "left" | "right" | "below" | "above", false>;
55
+ labelSide: import("@motionscript/sdk").Type<"right" | "left" | "below" | "above", "right" | "left" | "below" | "above", false>;
56
56
  labelSize: import("@motionscript/sdk").Type<number, number, false>;
57
57
  labelColor: import("@motionscript/sdk").Type<Color, NormalizedColor, false>;
58
58
  fontFamily: import("@motionscript/sdk").Type<string, string, false>;
@@ -14,7 +14,7 @@ export declare const RiemannSum: import("@motionscript/sdk").Component<"riemannS
14
14
  /** Each rectangle's width, in graph units. */
15
15
  dx: import("@motionscript/sdk").Type<number, number, false>;
16
16
  /** Where in its width a rectangle reads the curve's height. */
17
- sample: import("@motionscript/sdk").Type<"center" | "left" | "right", "center" | "left" | "right", false>;
17
+ sample: import("@motionscript/sdk").Type<"center" | "right" | "left", "center" | "right" | "left", false>;
18
18
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
19
19
  fill: import("@motionscript/sdk").Attribute<_Fill, _FillResolved[]>;
20
20
  stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
@@ -31,7 +31,7 @@ export declare const RiemannSum: import("@motionscript/sdk").Component<"riemannS
31
31
  /** Each rectangle's width, in graph units. */
32
32
  dx: import("@motionscript/sdk").Type<number, number, false>;
33
33
  /** Where in its width a rectangle reads the curve's height. */
34
- sample: import("@motionscript/sdk").Type<"center" | "left" | "right", "center" | "left" | "right", false>;
34
+ sample: import("@motionscript/sdk").Type<"center" | "right" | "left", "center" | "right" | "left", false>;
35
35
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
36
36
  fill: import("@motionscript/sdk").Attribute<_Fill, _FillResolved[]>;
37
37
  stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
@@ -42,7 +42,7 @@ export declare const RiemannSum: import("@motionscript/sdk").Component<"riemannS
42
42
  /** Each rectangle's width, in graph units. */
43
43
  dx: import("@motionscript/sdk").Type<number, number, false>;
44
44
  /** Where in its width a rectangle reads the curve's height. */
45
- sample: import("@motionscript/sdk").Type<"center" | "left" | "right", "center" | "left" | "right", false>;
45
+ sample: import("@motionscript/sdk").Type<"center" | "right" | "left", "center" | "right" | "left", false>;
46
46
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
47
47
  fill: import("@motionscript/sdk").Attribute<_Fill, _FillResolved[]>;
48
48
  stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
@@ -20,10 +20,10 @@ export declare const TangentLine: import("@motionscript/sdk").Component<"tangent
20
20
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
21
21
  /** The slope drawn, in graph units: the curve's at `x`, or the secant's when there is a `dx`. A formula reads it back as `[key.slope]`. */
22
22
  slope: import("@motionscript/sdk").Type<number, number, true>;
23
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
24
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
25
23
  start: import("@motionscript/sdk").Type<number, number, false>;
26
24
  end: import("@motionscript/sdk").Type<number, number, false>;
25
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
26
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
27
27
  }>, {
28
28
  strokeTo: readonly ["stroke"];
29
29
  shadowTo: readonly ["shadow"];
@@ -40,10 +40,10 @@ export declare const TangentLine: import("@motionscript/sdk").Component<"tangent
40
40
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
41
41
  /** The slope drawn, in graph units: the curve's at `x`, or the secant's when there is a `dx`. A formula reads it back as `[key.slope]`. */
42
42
  slope: import("@motionscript/sdk").Type<number, number, true>;
43
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
44
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
45
43
  start: import("@motionscript/sdk").Type<number, number, false>;
46
44
  end: import("@motionscript/sdk").Type<number, number, false>;
45
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
46
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
47
47
  }>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
48
48
  on: import("@motionscript/sdk").Type<string, NodeView<import("@motionscript/sdk").Element<string, unknown, unknown>> | null, false>;
49
49
  length: import("@motionscript/sdk").Type<number, number, false>;
@@ -53,10 +53,10 @@ export declare const TangentLine: import("@motionscript/sdk").Component<"tangent
53
53
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
54
54
  /** The slope drawn, in graph units: the curve's at `x`, or the secant's when there is a `dx`. A formula reads it back as `[key.slope]`. */
55
55
  slope: import("@motionscript/sdk").Type<number, number, true>;
56
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
57
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
58
56
  start: import("@motionscript/sdk").Type<number, number, false>;
59
57
  end: import("@motionscript/sdk").Type<number, number, false>;
58
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
59
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
60
60
  }>, {
61
61
  strokeTo: readonly ["stroke"];
62
62
  shadowTo: readonly ["shadow"];
@@ -15,10 +15,10 @@ export declare const VectorArrow: import("@motionscript/sdk").Component<"vectorA
15
15
  /** The arc the arrow sweeps, in degrees: zero is straight, positive bows to its left. */
16
16
  bend: import("@motionscript/sdk").Type<number, number, false>;
17
17
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
18
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
19
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
20
18
  start: import("@motionscript/sdk").Type<number, number, false>;
21
19
  end: import("@motionscript/sdk").Type<number, number, false>;
20
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
21
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
22
22
  }>, {
23
23
  readonly endpointsTo: readonly ["tail", "head"];
24
24
  readonly strokeTo: readonly ["stroke"];
@@ -33,20 +33,20 @@ export declare const VectorArrow: import("@motionscript/sdk").Component<"vectorA
33
33
  /** The arc the arrow sweeps, in degrees: zero is straight, positive bows to its left. */
34
34
  bend: import("@motionscript/sdk").Type<number, number, false>;
35
35
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
36
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
37
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
38
36
  start: import("@motionscript/sdk").Type<number, number, false>;
39
37
  end: import("@motionscript/sdk").Type<number, number, false>;
38
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
39
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
40
40
  }>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
41
41
  tail: import("@motionscript/sdk").Type<Vector2, Vector2, false>;
42
42
  head: import("@motionscript/sdk").Type<Vector2, Vector2, false>;
43
43
  /** The arc the arrow sweeps, in degrees: zero is straight, positive bows to its left. */
44
44
  bend: import("@motionscript/sdk").Type<number, number, false>;
45
45
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
46
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
47
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
48
46
  start: import("@motionscript/sdk").Type<number, number, false>;
49
47
  end: import("@motionscript/sdk").Type<number, number, false>;
48
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
49
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
50
50
  }>, {
51
51
  readonly endpointsTo: readonly ["tail", "head"];
52
52
  readonly strokeTo: readonly ["stroke"];
@@ -23,10 +23,10 @@ export declare const PLOT_STATE: {
23
23
  */
24
24
  params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
25
25
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
26
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
27
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
28
26
  start: import("@motionscript/sdk").Type<number, number, false>;
29
27
  end: import("@motionscript/sdk").Type<number, number, false>;
28
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
29
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
30
30
  };
31
31
  /** A plot's own commands, beside a line's paints. */
32
32
  export declare const PLOT_COMMANDS: {
@@ -92,10 +92,10 @@ export declare const FunctionPlot: import("@motionscript/sdk").Component<"functi
92
92
  */
93
93
  params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
94
94
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
95
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
96
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
97
95
  start: import("@motionscript/sdk").Type<number, number, false>;
98
96
  end: import("@motionscript/sdk").Type<number, number, false>;
97
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
98
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
99
99
  }>, {
100
100
  morphTo: readonly ["expression"];
101
101
  paramsTo: readonly ["params"];
@@ -120,10 +120,10 @@ export declare const FunctionPlot: import("@motionscript/sdk").Component<"functi
120
120
  */
121
121
  params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
122
122
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
123
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
124
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
125
123
  start: import("@motionscript/sdk").Type<number, number, false>;
126
124
  end: import("@motionscript/sdk").Type<number, number, false>;
125
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
126
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
127
127
  }>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
128
128
  expression: import("@motionscript/sdk").Type<string | PlotSource, PlotSource, false>;
129
129
  /**
@@ -138,10 +138,10 @@ export declare const FunctionPlot: import("@motionscript/sdk").Component<"functi
138
138
  */
139
139
  params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
140
140
  graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
141
- stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
142
- shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
143
141
  start: import("@motionscript/sdk").Type<number, number, false>;
144
142
  end: import("@motionscript/sdk").Type<number, number, false>;
143
+ stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
144
+ shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
145
145
  }>, {
146
146
  morphTo: readonly ["expression"];
147
147
  paramsTo: readonly ["params"];
@@ -41,10 +41,10 @@ export declare const LatexMatrix: import("@motionscript/sdk").Component<"latexMa
41
41
  readonly fill: import("@motionscript/sdk").Type<_Fill, _Fill, false>;
42
42
  readonly occurrence: import("@motionscript/sdk").Type<number, number, false>;
43
43
  };
44
+ readonly overlayTo: readonly ["overlay"];
44
45
  readonly fillTo: readonly ["fill"];
45
46
  readonly strokeTo: readonly ["stroke"];
46
47
  readonly shadowTo: readonly ["shadow"];
47
- readonly overlayTo: readonly ["overlay"];
48
48
  }, null, _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
49
49
  latex: import("@motionscript/sdk").Type<string, Morphing<string>, false>;
50
50
  /** A list of rows is a whole value: mid-tween it holds both, and the morph draws the way there. */
@@ -92,10 +92,10 @@ export declare const LatexMatrix: import("@motionscript/sdk").Component<"latexMa
92
92
  readonly fill: import("@motionscript/sdk").Type<_Fill, _Fill, false>;
93
93
  readonly occurrence: import("@motionscript/sdk").Type<number, number, false>;
94
94
  };
95
+ readonly overlayTo: readonly ["overlay"];
95
96
  readonly fillTo: readonly ["fill"];
96
97
  readonly strokeTo: readonly ["stroke"];
97
98
  readonly shadowTo: readonly ["shadow"];
98
- readonly overlayTo: readonly ["overlay"];
99
99
  }, _Node2D<_Node2DProps>>>>;
100
100
  export type LatexMatrix = NodeOf<typeof LatexMatrix>;
101
101
  //# sourceMappingURL=matrix.d.ts.map
@@ -43,10 +43,10 @@ export declare const Latex: import("@motionscript/sdk").Component<"latex", impor
43
43
  readonly fill: import("@motionscript/sdk").Type<_Fill, _Fill, false>;
44
44
  readonly occurrence: import("@motionscript/sdk").Type<number, number, false>;
45
45
  };
46
+ readonly overlayTo: readonly ["overlay"];
46
47
  readonly fillTo: readonly ["fill"];
47
48
  readonly strokeTo: readonly ["stroke"];
48
49
  readonly shadowTo: readonly ["shadow"];
49
- readonly overlayTo: readonly ["overlay"];
50
50
  }, null, _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
51
51
  /** The formula. Mid-tween it holds both ends, and the glyphs morph from the one into the other. */
52
52
  latex: import("@motionscript/sdk").Type<string, Morphing<string>, false>;
@@ -89,10 +89,10 @@ export declare const Latex: import("@motionscript/sdk").Component<"latex", impor
89
89
  readonly fill: import("@motionscript/sdk").Type<_Fill, _Fill, false>;
90
90
  readonly occurrence: import("@motionscript/sdk").Type<number, number, false>;
91
91
  };
92
+ readonly overlayTo: readonly ["overlay"];
92
93
  readonly fillTo: readonly ["fill"];
93
94
  readonly strokeTo: readonly ["stroke"];
94
95
  readonly shadowTo: readonly ["shadow"];
95
- readonly overlayTo: readonly ["overlay"];
96
96
  }, _Node2D<_Node2DProps>>>>;
97
97
  export type Latex = NodeOf<typeof Latex>;
98
98
  //# sourceMappingURL=node.d.ts.map
@@ -60,6 +60,10 @@ export declare const TYPESET_COMMANDS: {
60
60
  };
61
61
  run(timeline: any, state: any, children: any): import("@motionscript/sdk").Piece;
62
62
  };
63
+ overlayTo: {
64
+ readonly args: readonly ["overlay"];
65
+ readonly run?: undefined;
66
+ };
63
67
  fillTo: {
64
68
  readonly args: readonly ["fill"];
65
69
  readonly run?: undefined;
@@ -72,10 +76,6 @@ export declare const TYPESET_COMMANDS: {
72
76
  readonly args: readonly ["shadow"];
73
77
  readonly run?: undefined;
74
78
  };
75
- overlayTo: {
76
- readonly args: readonly ["overlay"];
77
- readonly run?: undefined;
78
- };
79
79
  };
80
80
  type TypesetValues = Values<typeof TYPESET>;
81
81
  /** What is drawn of a formula now: its glyphs, its parts, its centre frame and size, and mid-morph each end's part fills. */
@@ -1 +1 @@
1
- {"version":3,"file":"typeset.d.ts","sourceRoot":"","sources":["../../src/tex/typeset.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,IAAI,EAOJ,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,MAAM,EAEX,KAAK,SAAS,IAAI,UAAU,EAC5B,KAAK,QAAQ,IAAI,SAAS,EAC1B,KAAK,YAAY,IAAI,aAAa,EAClC,KAAK,OAAO,IAAI,QAAQ,EACxB,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,OAAO,IAAI,QAAQ,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAA2F,KAAK,SAAS,EAAyC,MAAM,YAAY,CAAC;AAC5K,OAAO,EAAqB,KAAK,aAAa,EAAE,K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AS,GAAG,IAAI,GAAG,SAAS,CAGxG;AA2CD,YAAY,EAAE,aAAa,EAAE,CAAC"}
@@ -25,25 +25,25 @@ export declare const CurvePlot3d: import("@motionscript/sdk").Component<"curvePl
25
25
  start: import("@motionscript/sdk").Type<number, number, false>;
26
26
  end: import("@motionscript/sdk").Type<number, number, false>;
27
27
  graph: import("@motionscript/sdk").Type<import("./space.js").Graph3D | null, import("./space.js").Graph3D | null, true>;
28
- opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
29
- blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
30
28
  fill: import("@motionscript/sdk").Type<_Fill3D, _Fill3D, false>;
31
- faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
32
- wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
33
- vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
34
- alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
35
- aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
36
- normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
37
- envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
29
+ blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
30
+ opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
38
31
  geometry: import("@motionscript/sdk").Type<Geometry3D | undefined, Geometry3D | undefined, false>;
39
32
  material: import("@motionscript/sdk").Type<_Material3D | readonly _Material3D[] | undefined, _Material3D | readonly _Material3D[] | undefined, false>;
40
33
  roughness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
41
34
  metalness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
42
35
  emission: import("@motionscript/sdk").Type<_Color | undefined, _NormalizedColor | undefined, false>;
43
36
  emissionStrength: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
37
+ normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
44
38
  roughnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
45
39
  metalnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
40
+ aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
41
+ alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
42
+ envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
43
+ wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
46
44
  shading: import("@motionscript/sdk").Type<_Shading3D | undefined, _Shading3D | undefined, false>;
45
+ faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
46
+ vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
47
47
  unlit: import("@motionscript/sdk").Type<boolean, boolean, false>;
48
48
  }>, {
49
49
  readonly morphTo: readonly ["expression"];
@@ -63,25 +63,25 @@ export declare const CurvePlot3d: import("@motionscript/sdk").Component<"curvePl
63
63
  start: import("@motionscript/sdk").Type<number, number, false>;
64
64
  end: import("@motionscript/sdk").Type<number, number, false>;
65
65
  graph: import("@motionscript/sdk").Type<import("./space.js").Graph3D | null, import("./space.js").Graph3D | null, true>;
66
- opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
67
- blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
68
66
  fill: import("@motionscript/sdk").Type<_Fill3D, _Fill3D, false>;
69
- faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
70
- wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
71
- vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
72
- alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
73
- aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
74
- normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
75
- envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
67
+ blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
68
+ opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
76
69
  geometry: import("@motionscript/sdk").Type<Geometry3D | undefined, Geometry3D | undefined, false>;
77
70
  material: import("@motionscript/sdk").Type<_Material3D | readonly _Material3D[] | undefined, _Material3D | readonly _Material3D[] | undefined, false>;
78
71
  roughness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
79
72
  metalness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
80
73
  emission: import("@motionscript/sdk").Type<_Color | undefined, _NormalizedColor | undefined, false>;
81
74
  emissionStrength: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
75
+ normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
82
76
  roughnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
83
77
  metalnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
78
+ aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
79
+ alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
80
+ envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
81
+ wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
84
82
  shading: import("@motionscript/sdk").Type<_Shading3D | undefined, _Shading3D | undefined, false>;
83
+ faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
84
+ vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
85
85
  unlit: import("@motionscript/sdk").Type<boolean, boolean, false>;
86
86
  }>, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Transform3DState, {
87
87
  expression: import("@motionscript/sdk").Type<string | PlotSource, PlotSource, false>;
@@ -96,25 +96,25 @@ export declare const CurvePlot3d: import("@motionscript/sdk").Component<"curvePl
96
96
  start: import("@motionscript/sdk").Type<number, number, false>;
97
97
  end: import("@motionscript/sdk").Type<number, number, false>;
98
98
  graph: import("@motionscript/sdk").Type<import("./space.js").Graph3D | null, import("./space.js").Graph3D | null, true>;
99
- opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
100
- blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
101
99
  fill: import("@motionscript/sdk").Type<_Fill3D, _Fill3D, false>;
102
- faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
103
- wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
104
- vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
105
- alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
106
- aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
107
- normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
108
- envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
100
+ blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
101
+ opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
109
102
  geometry: import("@motionscript/sdk").Type<Geometry3D | undefined, Geometry3D | undefined, false>;
110
103
  material: import("@motionscript/sdk").Type<_Material3D | readonly _Material3D[] | undefined, _Material3D | readonly _Material3D[] | undefined, false>;
111
104
  roughness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
112
105
  metalness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
113
106
  emission: import("@motionscript/sdk").Type<_Color | undefined, _NormalizedColor | undefined, false>;
114
107
  emissionStrength: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
108
+ normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
115
109
  roughnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
116
110
  metalnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
111
+ aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
112
+ alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
113
+ envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
114
+ wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
117
115
  shading: import("@motionscript/sdk").Type<_Shading3D | undefined, _Shading3D | undefined, false>;
116
+ faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
117
+ vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
118
118
  unlit: import("@motionscript/sdk").Type<boolean, boolean, false>;
119
119
  }>, {
120
120
  readonly morphTo: readonly ["expression"];
@@ -1 +1 @@
1
- {"version":3,"file":"curve-plot3d.d.ts","sourceRoot":"","sources":["../../src/three/curve-plot3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,MAAM,EAIX,KAAK,OAAO,IAAI,QAAQ,EACxB,KAAK,KAAK,IAAI,MAAM,EACpB,KAAK,OAAO,IAAI,QAAQ,EACxB,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,UAAU,IAAI,WAAW,EAC9B,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,eAAe,IAAI,gBAAgB,EACx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