@motionscript/core 0.1.1-alpha.2 → 0.1.1-alpha.4

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @motionscript/core
2
2
 
3
+ ## 0.1.1-alpha.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 420d5d0: **`Paint3D`**: a custom 3D node paints with the same `fill` and `stroke` entries a 2D shape takes. Spread `...Paint3D.state` and `...Paint3D.commands` (`fillTo`, `strokeTo`), then draw the surface with `Paint3D.material(fill)` (one solid colour stays a tweenable `color` and `opacity`; a gradient or image becomes a texture; `{ type: "standard" }` lights it) and the lines with `Paint3D.lines(g3, stroke, segments, { through, lift })`, one instanced batch of bars per stroke layer. Stroke `weight`, `dash` and `dashOffset` are thousandths of a scene unit; a `square` cap closes outline corners; `through: true` draws hidden lines through solids. Built-in meshes keep `Material.state`.
8
+
9
+ ## 0.1.1-alpha.3
10
+
3
11
  ## 0.1.1-alpha.2
4
12
 
5
13
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/core",
3
- "version": "0.1.1-alpha.1",
3
+ "version": "0.1.1-alpha.3",
4
4
  "exports": {
5
5
  ".": "dist/browser/index.js",
6
6
  "./experimental": "dist/browser/experimental.js",
@@ -1,2 +1,2 @@
1
- import{$ as lo,$a as or,A as Ie,Ac as gr,B as we,Ba as Bo,C as Le,Ca as bo,D as Fe,Da as jo,E as Me,Ea as ko,F as Be,G as je,H as ke,Ha as Go,I as Ge,Ia as _o,J as qe,Ja as zo,K as Ke,Ka as Ho,Kc as Cr,L as Qe,La as qo,Lc as Or,M as Ue,Ma as Ko,Mc as vr,N as Je,Na as Qo,Nc as Tr,O as We,Oc as Ar,P as Ye,Pa as Uo,Pc as Rr,Q as Ze,Qa as Jo,Qc as Er,R as $e,Ra as Wo,T as eo,U as to,Ua as Xo,V as ao,Va as Yo,W as no,X as so,Y as po,Ya as Zo,Z as mo,Za as $o,_ as io,_a as er,_b as dr,aa as fo,ab as rr,ba as xo,ca as co,d as H,da as Do,ea as uo,fa as ho,ga as Po,ha as So,hb as tr,ia as go,j as U,ja as Co,ka as Oo,la as vo,m as J,ma as To,oa as Ao,ob as ar,pa as Ro,pb as nr,qa as Eo,qb as sr,qc as xr,r as xe,ra as yo,rb as pr,rc as cr,s as ve,sa as No,sb as mr,sc as Dr,t as Te,ta as Vo,tb as ir,tc as ur,u as Ae,ua as Io,ub as lr,uc as hr,v as Re,va as wo,vc as Pr,w as Ee,wa as Lo,x as ye,xa as Mo,y as Ne,yb as fr,z as Ve,zc as Sr}from"./chunks/chunk-TL432UO5.js";import{$ as u,$a as j,$c as de,Ac as re,Bd as ce,C as p,Cd as De,D as m,Ec as te,Ed as ue,Ee as He,Fa as E,Fc as ae,Fe as Xe,Gc as ne,Ge as oo,H as i,I as l,Ic as se,J as f,Ka as y,Kd as he,La as V,Lc as pe,Ld as Pe,Ma as I,Mc as me,Nc as ie,Ob as q,Q as d,Qb as K,Re as ro,Sd as Se,Ta as w,Tc as le,Td as ge,Ua as L,Ub as Q,Va as F,We as Fo,Y as x,Ya as M,Yd as Ce,Z as c,Za as B,_ as D,_a as b,_c as fe,a as e,ba as h,ca as P,d as r,e as t,ee as Oe,fa as S,ga as g,ha as C,ib as k,ie as be,jb as G,kb as _,mc as W,n as s,na as O,nc as X,pc as Y,qc as Z,ra as v,rc as $,sa as T,ta as A,te as _e,ua as R,uc as ee,vb as z,vc as oe,ye as ze}from"./chunks/chunk-BPA7KSK2.js";import"./chunks/chunk-GEJEQQER.js";import{b as o,d as a,h as n,m as N}from"./chunks/chunk-5TDMGUXQ.js";export{x as AdjustmentChain,D as Adjustments,be as Aim,Ao as AmbientLight3D,Vo as AreaLight3D,Ze as AudioBus,z as AudioEffects,Me as BooleanGroup,no as Box3D,je as Camera,Io as Camera3D,xe as Canvas2D,Mo as Canvas3D,Do as Capsule3D,xo as Circle3D,le as Clip,io as Cone3D,oe as ContextMap,mo as Cylinder3D,Ko as DOCUMENT_FORMAT_VERSION,Ue as DefaultTextStyle,Eo as DirectionalLight3D,Qo as DocumentTooNewError,l as EffectChain,f as Effects,Te as Ellipse,Lo as Environment3D,ce as ExpressionError,ho as Extrude3D,d as Fills,Se as Flow,wo as Fog3D,ar as Geo,g as Graphics2D,v as Graphics3D,to as Group3D,Ro as HemisphereLight3D,we as Hexagon,go as Instances3D,Po as Lathe3D,Oo as Line3D,Be as MaskGroup,nr as Mat,ro as Material,ao as Mesh3D,To as Model3D,Ke as NumberNode,Le as Octagon,ke as OrbitCamera,Ce as Paint,ye as Path,S as PathBuilder,Ee as PathShape,Ie as Pentagon,po as Plane3D,yo as PointLight3D,Co as Points3D,Ae as Polygon,Re as Polygram,uo as Polyhedron3D,Je as Provider,bo as ROOT_NODE_ID,Er as Random,ve as Rect,Zo as Registry,T as RenderContext3D,Qe as RichText,Ve as RightTriangle,co as Ring3D,Ge as RotatedBox,R as Scene3D,Rr as SeedGenerator,Oe as Shapes,H as Sound,Ye as SoundNode,so as Sphere3D,No as SpotLight3D,vo as Sprite3D,Fe as Star,sr as Tex,qe as Text,_e as TextLayout,We as ThemeProvider,lo as Torus3D,fo as TorusKnot3D,Ne as Triangle,So as Tube3D,He as Typeface,Pe as Types,$e as Video,c as VideoAdjustmentChain,u as VideoAdjustments,Fo as View3D,h as alignmentOps,qo as asProjectDocument,Xo as assertValidDocument,cr as childPlanePointAt,F as clamp,gr as collectBoxes,s as colorOps,$ as commandParallel,Z as commandSequence,_o as commandSpan,ge as commandsFor,he as component2d,oo as component3d,Xe as componentAudio,r as cornerRadiusOps,t as cornerStyleOps,ee as createContext,Ar as createRef,p as describeEffect,zo as documentDuration,Uo as documentFormatVersion,B as easeIn,j as easeInOut,b as easeOut,m as effectDescriptors,ko as effectiveSpan,fr as evaluateParametric,mr as evaluateRoundedBox,De as expressionOps,y as fillOps,fe as findNode2D,te as flowOps,de as frameIn,Tr as generateList,re as getCommandMeta,hr as handleValueAt,Bo as hasTimeline,G as hold,P as insetsOps,W as isCommand,U as isKnownShaderProperty,Ho as isProjectDocument,_ as isRamp,se as lerpEuler3,o as lerpNumber,a as lerpVector2,ne as lerpVector3,M as linear,Y as loopCommand,X as makeCommand,Jo as migrateDocument,ue as migrateNodeProps,Yo as missingNodeOf,Pr as nodeBox,ur as nodeHandlesAt,jo as nodeSpan,$o as nodeTypeIsA,me as normalizeQuaternion,J as normalizeShaderPack,er as parentIssue,xr as parentPlanePointAt,Or as parseCSV,n as parseColor,vr as parseData,N as pathOps,Sr as pickNode,dr as placeTracks,rr as placementIssues,ze as provides,ie as quaternionFromEuler,k as ramp,Dr as reparentPlacementAt,eo as resolveCameraPlacement,e as resolveCorners,E as resolveFill,O as resolveFill3D,Cr as resolveProjectDocument,i as resolveShaderProperties,V as resolveShadow,A as resolveShadows3D,w as resolveStroke,C as resolveSurfaceSource,ae as resolveVector3,pr as segmentsOf,ir as shadowCasts,I as shadowOps,lr as shadowReceives,or as siblingIssue,K as sizeInputOps,pe as slerpQuaternion,q as space3dOps,L as strokeOps,Q as textOps,tr as toPathString,Go as untimed,Wo as validateDocument};
1
+ import{$ as Fo,$a as vt,A as oo,Ac as Ht,B as to,Ba as at,C as ro,Ca as it,D as no,Da as pt,E as so,Ea as ct,F as ao,G as po,H as co,Ha as lt,I as lo,Ia as mt,J as xo,Ja as ft,K as ho,Ka as ut,Kc as Kt,L as Do,La as dt,Lc as Qt,M as go,Ma as xt,Mc as Ut,N as Po,Na as ht,Nc as Wt,O as Oo,Oc as Jt,P as To,Pa as Dt,Pc as Xt,Q as yo,Qa as gt,Qc as Yt,R as Co,Ra as Pt,T as vo,U as Ro,Ua as Ot,V as wo,Va as St,W as Eo,X as Mo,Y as No,Ya as Tt,Z as Io,Za as yt,_ as Vo,_a as Ct,_b as kt,aa as ko,ab as bt,ba as Lo,ca as Bo,d as xe,da as jo,ea as zo,fa as Go,ga as _o,ha as qo,hb as At,ia as Ho,j as Pe,ja as Ko,ka as Qo,la as Uo,m as Oe,ma as Wo,oa as Jo,ob as Rt,pa as Xo,pb as wt,qa as Yo,qb as Et,qc as Lt,r as je,ra as Zo,rb as Mt,rc as Bt,s as Ue,sa as $o,sb as Nt,sc as jt,t as We,ta as et,tb as It,tc as zt,u as Je,ua as ot,ub as Vt,uc as Gt,v as Xe,va as tt,vc as _t,w as Ye,wa as rt,x as Ze,xa as st,y as $e,yb as Ft,z as eo,zc as qt}from"./chunks/chunk-TL432UO5.js";import{$ as q,$a as le,$c as Be,Ac as Re,Bd as ze,C as V,Cd as Ge,D as F,Ec as we,Ed as _e,Ee as uo,Fa as $,Fc as Ee,Fe as So,Gc as Me,Ge as bo,H as k,I as L,Ic as Ne,J as B,Ka as ee,Kd as qe,La as te,Lc as Ie,Ld as u,Ma as re,Mc as Ve,Nc as Fe,Ob as he,Q as j,Qb as De,Re as Ao,Sd as He,Ta as ne,Tc as ke,Td as Ke,Ua as se,Ub as ge,Va as ae,Vd as g,We as nt,Y as z,Ya as ie,Yd as S,Z as G,Za as pe,_,_a as ce,_c as Le,a as A,ba as H,ca as K,d as w,e as E,ee as Qe,fa as Q,ga as U,ha as W,ib as me,ie as io,jb as fe,kb as ue,mc as Se,n as I,na as D,nc as Te,pc as ye,qc as Ce,ra as J,rc as ve,sa as X,ta as Y,te as mo,ua as Z,uc as be,vb as de,vc as Ae,ye as fo}from"./chunks/chunk-BPA7KSK2.js";import"./chunks/chunk-GEJEQQER.js";import{a as b,b as R,d as M,h as N,m as oe}from"./chunks/chunk-5TDMGUXQ.js";var v={};b(v,{BAR:()=>y,STROKE_UNIT:()=>d,bar:()=>P,commands:()=>$t,dashes:()=>C,lines:()=>sr,material:()=>er,state:()=>Zt});var Zt={fill:u.fill,stroke:u.stroke},$t={fillTo:g.fillTo,strokeTo:g.strokeTo},d=.001;function T(e){if(e===void 0||e.type!=="solid"||e.blend!==void 0)return null;let t=e.color;return{color:t,alpha:(t[3]??1)*(e.opacity??1)}}function er(e,t={}){let{type:o="basic",opacity:r,...n}=t,s=r??1;if(e.length===0)return{type:o,...n,visible:!1};let a=e.length===1?T(e[0]):null;if(a!==null){let[c,l,p]=a.color;return{type:o,color:[c,l,p,1],opacity:a.alpha*s,...n}}let i=D(e);return{type:o,...i.color!==void 0?{color:i.color}:{},...i.map!==void 0?{map:i.map}:{},...r!==void 0?{opacity:r}:{},...n}}var y={type:"box",width:1,height:1,depth:1};function or(e,t,o){if(e<=-.9999)return{x:0,y:1,z:0,w:0};let r=-o,n=t,s=1+e,a=Math.hypot(r,n,s);return{x:0,y:r/a,z:n/a,w:s/a}}function P(e,t,o,r=0){let n=t[0]-e[0],s=t[1]-e[1],a=t[2]-e[2],i=Math.hypot(n,s,a)||1e-9;return{position:[(e[0]+t[0])/2,(e[1]+t[1])/2,(e[2]+t[2])/2],quaternion:or(n/i,s/i,a/i),scale:[i+r*2,o,o]}}function tr(e){if(e===void 0||e.length===0)return null;let t=e.map(r=>Math.max(0,r)*d),o=t.length%2===1?[...t,...t]:t;return o.reduce((r,n)=>r+n,0)>1e-9?o:null}function C(e,t,o=0){let r=t.reduce((c,l)=>c+l,0),n=[];if(r<=0||e<=0)return n;let s=-((o%r+r)%r),a=0,i=e-1e-9;for(;s<i;){let c=t[a%t.length];if(a%2===0&&c>0){let l=Math.max(0,s),p=Math.min(e,s+c);p-l>1e-9&&n.push([l,p])}s+=c,a++}return n}function rr(e,t,o){let r=e.weight*d,n=e.cap==="square"?r/2:0,s=tr(e.dash),a=e.dashOffset*d,i=[];for(let[c,l]of t){let p=o?[c[0]+o[0],c[1]+o[1],c[2]+o[2]]:c,m=o?[l[0]+o[0],l[1]+o[1],l[2]+o[2]]:l,x=Math.hypot(m[0]-p[0],m[1]-p[1],m[2]-p[2]);if(x<=1e-9)continue;if(s===null){i.push(P(p,m,r,n));continue}let O=h=>{let f=h/x;return[p[0]+(m[0]-p[0])*f,p[1]+(m[1]-p[1])*f,p[2]+(m[2]-p[2])*f]};for(let[h,f]of C(x,s,a))i.push(P(O(h),O(f),r,n))}return i}function nr(e,t){let o=e.fill.map(T).find(i=>i!==null)??null;if(o===null||o.alpha<=0)return null;let[r,n,s]=o.color,a=o.alpha<1||t;return{type:"basic",color:[r,n,s,1],opacity:o.alpha,...a?{transparent:!0,depthWrite:!1}:{},...t?{depthTest:!1}:{}}}function sr(e,t,o,r={}){let n=r.through??!1;for(let s of t){if(!(s.weight>0))continue;let a=nr(s,n);if(a===null)continue;let i=rr(s,o,r.lift);i.length!==0&&e.instances(y,a,i,r.transform?{transform:r.transform}:void 0)}return e}export{z as AdjustmentChain,_ as Adjustments,io as Aim,Jo as AmbientLight3D,et as AreaLight3D,yo as AudioBus,de as AudioEffects,so as BooleanGroup,Eo as Box3D,po as Camera,ot as Camera3D,je as Canvas2D,st as Canvas3D,jo as Capsule3D,Lo as Circle3D,ke as Clip,Vo as Cone3D,Ae as ContextMap,Io as Cylinder3D,xt as DOCUMENT_FORMAT_VERSION,go as DefaultTextStyle,Yo as DirectionalLight3D,ht as DocumentTooNewError,L as EffectChain,B as Effects,We as Ellipse,rt as Environment3D,ze as ExpressionError,Go as Extrude3D,j as Fills,He as Flow,tt as Fog3D,Rt as Geo,U as Graphics2D,J as Graphics3D,Ro as Group3D,Xo as HemisphereLight3D,to as Hexagon,Ho as Instances3D,_o as Lathe3D,Qo as Line3D,ao as MaskGroup,wt as Mat,Ao as Material,wo as Mesh3D,Wo as Model3D,ho as NumberNode,ro as Octagon,co as OrbitCamera,S as Paint,v as Paint3D,Ze as Path,Q as PathBuilder,Ye as PathShape,oo as Pentagon,No as Plane3D,Zo as PointLight3D,Ko as Points3D,Je as Polygon,Xe as Polygram,zo as Polyhedron3D,Po as Provider,it as ROOT_NODE_ID,Yt as Random,Ue as Rect,Tt as Registry,X as RenderContext3D,Do as RichText,eo as RightTriangle,Bo as Ring3D,lo as RotatedBox,Z as Scene3D,Xt as SeedGenerator,Qe as Shapes,xe as Sound,To as SoundNode,Mo as Sphere3D,$o as SpotLight3D,Uo as Sprite3D,no as Star,Et as Tex,xo as Text,mo as TextLayout,Oo as ThemeProvider,Fo as Torus3D,ko as TorusKnot3D,$e as Triangle,qo as Tube3D,uo as Typeface,u as Types,Co as Video,G as VideoAdjustmentChain,q as VideoAdjustments,nt as View3D,H as alignmentOps,dt as asProjectDocument,Ot as assertValidDocument,Bt as childPlanePointAt,ae as clamp,Ht as collectBoxes,I as colorOps,ve as commandParallel,Ce as commandSequence,mt as commandSpan,Ke as commandsFor,qe as component2d,bo as component3d,So as componentAudio,w as cornerRadiusOps,E as cornerStyleOps,be as createContext,Jt as createRef,V as describeEffect,ft as documentDuration,Dt as documentFormatVersion,pe as easeIn,le as easeInOut,ce as easeOut,F as effectDescriptors,ct as effectiveSpan,Ft as evaluateParametric,Nt as evaluateRoundedBox,Ge as expressionOps,ee as fillOps,Le as findNode2D,we as flowOps,Be as frameIn,Wt as generateList,Re as getCommandMeta,Gt as handleValueAt,at as hasTimeline,fe as hold,K as insetsOps,Se as isCommand,Pe as isKnownShaderProperty,ut as isProjectDocument,ue as isRamp,Ne as lerpEuler3,R as lerpNumber,M as lerpVector2,Me as lerpVector3,ie as linear,ye as loopCommand,Te as makeCommand,gt as migrateDocument,_e as migrateNodeProps,St as missingNodeOf,_t as nodeBox,zt as nodeHandlesAt,pt as nodeSpan,yt as nodeTypeIsA,Ve as normalizeQuaternion,Oe as normalizeShaderPack,Ct as parentIssue,Lt as parentPlanePointAt,Qt as parseCSV,N as parseColor,Ut as parseData,oe as pathOps,qt as pickNode,kt as placeTracks,bt as placementIssues,fo as provides,Fe as quaternionFromEuler,me as ramp,jt as reparentPlacementAt,vo as resolveCameraPlacement,A as resolveCorners,$ as resolveFill,D as resolveFill3D,Kt as resolveProjectDocument,k as resolveShaderProperties,te as resolveShadow,Y as resolveShadows3D,ne as resolveStroke,W as resolveSurfaceSource,Ee as resolveVector3,Mt as segmentsOf,It as shadowCasts,re as shadowOps,Vt as shadowReceives,vt as siblingIssue,De as sizeInputOps,Ie as slerpQuaternion,he as space3dOps,se as strokeOps,ge as textOps,At as toPathString,lt as untimed,Pt as validateDocument};
2
2
  //# sourceMappingURL=sdk.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
3
+ "sources": ["../../src/components/modules/paint3d.ts"],
4
+ "sourcesContent": ["import type { NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport type { StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\nimport { resolveFill3D, type Fill3D } from \"@/render3d/fill3d\";\nimport type { Geometry3D } from \"@/render3d/geometry\";\nimport type { Graphics3D } from \"@/render3d/graphics3d\";\nimport type { BasicMaterial3D, Material3D, StandardMaterial3D } from \"@/render3d/material\";\nimport type { Transform3D } from \"@/render3d/transform\";\nimport type { Quaternion } from \"@/render3d/vector3\";\nimport { Types } from \"@/components/factory/types\";\nimport * as Paint from \"@/components/modules/paint\";\n\n/**\n * A custom 3D node's paint: the same `fill` and `stroke` entries a 2D shape takes, so a 3D component never invents\n * `color`, `lineColor` or `lineWidth`. Spread `...Paint3D.state` and `...Paint3D.commands`, then draw the surface with\n * {@link material} and the lines with {@link lines}. Built-in meshes keep `Material.state`.\n */\nexport const state = {\n fill: Types.fill,\n stroke: Types.stroke,\n};\n\n/** `fillTo` and `strokeTo`, the same commands `Paint` has. */\nexport const commands = {\n fillTo: Paint.commands.fillTo,\n strokeTo: Paint.commands.strokeTo,\n};\n\n/** A point in a node's own 3D space. */\nexport type Vec3 = readonly [number, number, number];\n\n/** A line segment from one point to another. */\nexport type Segment3D = readonly [Vec3, Vec3];\n\n/** A stroke `weight`, `dash` or `dashOffset` of 1 is this many scene units: weights are thousandths of a unit. */\nexport const STROKE_UNIT = 0.001;\n\n/** The surface options {@link material} takes: `type` picks the shading, and every other field is laid over the result. */\nexport type MaterialOptions =\n | ({ readonly type?: \"basic\" } & Partial<Omit<BasicMaterial3D, \"type\">>)\n | ({ readonly type: \"standard\" } & Partial<Omit<StandardMaterial3D, \"type\">>);\n\n/** The colour a fill layer is when it is one flat colour with no blend; `null` for anything else. */\nfunction solidOf(layer: FillResolved | undefined): { color: NormalizedColor; alpha: number } | null {\n if (layer === undefined || layer.type !== \"solid\") return null;\n if (layer.blend !== undefined) return null;\n const color = layer.color;\n return { color, alpha: (color[3] ?? 1) * (layer.opacity ?? 1) };\n}\n\n/**\n * The material a surface painted with `fill` wears. Unlit (`basic`) by default; `{ type: \"standard\" }` lights it.\n *\n * - **One solid layer** becomes `color` with its alpha as `opacity`, so `fillTo` between colours tweens the uniforms\n * and allocates nothing.\n * - **Anything else** (a gradient, an image, a stack of layers) goes through `resolveFill3D` and becomes a `map`.\n * - **An empty fill** gives an invisible material (`visible: false`), as an empty 2D fill paints nothing.\n *\n * Fields in `extra` are laid over the result; its `opacity` multiplies the fill's.\n */\nexport function material(fill: readonly FillResolved[], extra: MaterialOptions = {}): Material3D {\n const { type = \"basic\", opacity: extraOpacity, ...rest } = extra as MaterialOptions & { opacity?: number };\n const scale = extraOpacity ?? 1;\n if (fill.length === 0) return { type, ...rest, visible: false } as Material3D;\n const solid = fill.length === 1 ? solidOf(fill[0]) : null;\n if (solid !== null) {\n const [r, g, b] = solid.color;\n return { type, color: [r, g, b, 1], opacity: solid.alpha * scale, ...rest } as Material3D;\n }\n const resolved = resolveFill3D(fill as unknown as Fill3D);\n return {\n type,\n ...(resolved.color !== undefined ? { color: resolved.color } : {}),\n ...(resolved.map !== undefined ? { map: resolved.map } : {}),\n ...(extraOpacity !== undefined ? { opacity: extraOpacity } : {}),\n ...rest,\n } as Material3D;\n}\n\n/** What {@link lines} takes besides the strokes and segments. */\nexport interface LinesOptions {\n /**\n * Draw through solids: `depthTest: false, depthWrite: false`, and blended so it draws after every opaque mesh. For\n * the hidden lines a CAD view shows dashed through the body.\n */\n readonly through?: boolean;\n /**\n * Added to both ends of every segment: a surface's normal times the gap. A line laid on a face needs a gap of at\n * least the camera distance ÷ 2000 (`docs/3d.md`, Depth rule 2); a bar centred on a solid's edge needs none. Leave\n * it out to place the segments yourself.\n */\n readonly lift?: Vec3;\n /** A transform for the whole draw, as `Graphics3D.instances` takes one. */\n readonly transform?: Transform3D;\n}\n\n/** The unit box each bar scales: 1 long on x, 1 by 1 across. */\nexport const BAR: Geometry3D = { type: \"box\", width: 1, height: 1, depth: 1 };\n\n/** The turn that carries +x onto the unit direction `d`. */\nfunction turnOnto(dx: number, dy: number, dz: number): Quaternion {\n // About +x cross d, by the angle between them; straight back along -x turns half way round y.\n if (dx <= -0.9999) return { x: 0, y: 1, z: 0, w: 0 };\n const qy = -dz;\n const qz = dy;\n const qw = 1 + dx;\n const l = Math.hypot(qy, qz, qw);\n return { x: 0, y: qy / l, z: qz / l, w: qw / l };\n}\n\n/** A square bar from `p` to `q`, `w` across, running `extend` past each end. */\nexport function bar(p: Vec3, q: Vec3, w: number, extend = 0): Transform3D {\n const dx = q[0] - p[0];\n const dy = q[1] - p[1];\n const dz = q[2] - p[2];\n const len = Math.hypot(dx, dy, dz) || 1e-9;\n return {\n position: [(p[0] + q[0]) / 2, (p[1] + q[1]) / 2, (p[2] + q[2]) / 2],\n quaternion: turnOnto(dx / len, dy / len, dz / len),\n scale: [len + extend * 2, w, w],\n };\n}\n\n/** The pattern a `dash` repeats, in scene units: an odd list runs twice, as in SVG; `null` for a solid line. */\nfunction dashPattern(dash: readonly number[] | undefined): number[] | null {\n if (dash === undefined || dash.length === 0) return null;\n const units = dash.map((d) => Math.max(0, d) * STROKE_UNIT);\n const pattern = units.length % 2 === 1 ? [...units, ...units] : units;\n return pattern.reduce((sum, d) => sum + d, 0) > 1e-9 ? pattern : null;\n}\n\n/** The stretches `[from, to]` along a segment `length` long that a dash pattern draws, starting `offset` into it. */\nexport function dashes(length: number, pattern: readonly number[], offset = 0): [number, number][] {\n const period = pattern.reduce((sum, d) => sum + d, 0);\n const out: [number, number][] = [];\n if (period <= 0 || length <= 0) return out;\n // Start at the beginning of the period the offset falls in, before the segment.\n let at = -(((offset % period) + period) % period);\n let i = 0;\n const end = length - 1e-9;\n while (at < end) {\n const d = pattern[i % pattern.length]!;\n if (i % 2 === 0 && d > 0) {\n const from = Math.max(0, at);\n const to = Math.min(length, at + d);\n if (to - from > 1e-9) out.push([from, to]);\n }\n at += d;\n i++;\n }\n return out;\n}\n\n/** The bars one stroke layer draws along `segments`. */\nfunction barsFor(stroke: StrokeResolved, segments: readonly Segment3D[], lift: Vec3 | undefined): Transform3D[] {\n const w = stroke.weight * STROKE_UNIT;\n // `round` has no round end to draw on a box, so it ends flush, as `butt` does.\n const extend = stroke.cap === \"square\" ? w / 2 : 0;\n const pattern = dashPattern(stroke.dash);\n const offset = stroke.dashOffset * STROKE_UNIT;\n const out: Transform3D[] = [];\n for (const [a, b] of segments) {\n const p: Vec3 = lift ? [a[0] + lift[0], a[1] + lift[1], a[2] + lift[2]] : a;\n const q: Vec3 = lift ? [b[0] + lift[0], b[1] + lift[1], b[2] + lift[2]] : b;\n const length = Math.hypot(q[0] - p[0], q[1] - p[1], q[2] - p[2]);\n if (length <= 1e-9) continue;\n if (pattern === null) {\n out.push(bar(p, q, w, extend));\n continue;\n }\n const at = (s: number): Vec3 => {\n const t = s / length;\n return [p[0] + (q[0] - p[0]) * t, p[1] + (q[1] - p[1]) * t, p[2] + (q[2] - p[2]) * t];\n };\n for (const [from, to] of dashes(length, pattern, offset)) out.push(bar(at(from), at(to), w, extend));\n }\n return out;\n}\n\n/** The unlit material one stroke layer draws with, or `null` when it would draw nothing. */\nfunction strokeMaterial(stroke: StrokeResolved, through: boolean): Material3D | null {\n const solid = stroke.fill.map(solidOf).find((s) => s !== null) ?? null;\n if (solid === null || solid.alpha <= 0) return null;\n const [r, g, b] = solid.color;\n const blended = solid.alpha < 1 || through;\n return {\n type: \"basic\",\n color: [r, g, b, 1],\n opacity: solid.alpha,\n ...(blended ? { transparent: true, depthWrite: false } : {}),\n ...(through ? { depthTest: false } : {}),\n } as Material3D;\n}\n\n/**\n * Draws `segments` with each layer of `stroke`, one `g3.instances` call of unit boxes per layer, bottom to top.\n *\n * - **`weight`, `dash` and `dashOffset` are thousandths of a scene unit**: weight 5.5 is a 0.0055-wide bar, a CAD\n * hairline on a model a few units across.\n * - **Caps**: `square` runs each bar (and each dash) half the weight past its ends, so outline corners close; `butt`\n * ends flush. `round` ends flush too, as `butt` does: a box has no round end.\n * - **Colour** is the layer's first solid fill, its alpha the bar's `opacity` (below 1 the bars blend and stop writing\n * depth). A layer with no solid fill, or nothing opaque in it, draws nothing; so does an empty `stroke`.\n * - `align`, `join`, markers and the shape of `startCap`/`endCap` are 2D path ideas and are ignored.\n */\nexport function lines(g3: Graphics3D, stroke: readonly StrokeResolved[], segments: readonly Segment3D[], options: LinesOptions = {}): Graphics3D {\n const through = options.through ?? false;\n for (const layer of stroke) {\n if (!(layer.weight > 0)) continue;\n const ink = strokeMaterial(layer, through);\n if (ink === null) continue;\n const bars = barsFor(layer, segments, options.lift);\n if (bars.length === 0) continue;\n g3.instances(BAR, ink, bars, options.transform ? { transform: options.transform } : undefined);\n }\n return g3;\n}\n"],
5
+ "mappings": "mvDAGA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,SAAAE,EAAA,gBAAAC,EAAA,QAAAC,EAAA,aAAAC,GAAA,WAAAC,EAAA,UAAAC,GAAA,aAAAC,GAAA,UAAAC,KAcO,IAAMC,GAAQ,CACjB,KAAMC,EAAM,KACZ,OAAQA,EAAM,QAILC,GAAW,CACpB,OAAcA,EAAS,OACvB,SAAgBA,EAAS,UAUhBC,EAAc,KAQ3B,SAASC,EAAQC,EAA+B,CAE5C,GADIA,IAAU,QAAaA,EAAM,OAAS,SACtCA,EAAM,QAAU,OAAW,OAAO,KACtC,IAAMC,EAAQD,EAAM,MACpB,MAAO,CAAE,MAAAC,EAAO,OAAQA,EAAM,CAAC,GAAK,IAAMD,EAAM,SAAW,EAAE,CACjE,CAYM,SAAUE,GAASC,EAA+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C,CACxF,EACA,OAAW,CAACR,EAAMC,CAAE,IAAKT,EAAOC,EAAQH,EAASI,CAAM,EAAGE,EAAI,KAAKhB,EAAIiB,EAAGG,CAAI,EAAGH,EAAGI,CAAE,EAAGlB,EAAGC,CAAM,CAAC,CACvG,CACA,OAAOY,CACX,CAGA,SAASa,GAAeN,EAAwBO,EAAgB,CAC5D,IAAM7C,EAAQsC,EAAO,KAAK,IAAIhD,CAAO,EAAE,KAAMoD,GAAMA,IAAM,IAAI,GAAK,KAClE,GAAI1C,IAAU,MAAQA,EAAM,OAAS,EAAG,OAAO,KAC/C,GAAM,CAAC,EAAGE,EAAGC,CAAC,EAAIH,EAAM,MAClB8C,EAAU9C,EAAM,MAAQ,GAAK6C,EACnC,MAAO,CACH,KAAM,QACN,MAAO,CAAC,EAAG3C,EAAGC,EAAG,CAAC,EAClB,QAASH,EAAM,MACf,GAAI8C,EAAU,CAAE,YAAa,GAAM,WAAY,EAAK,EAAK,CAAA,EACzD,GAAID,EAAU,CAAE,UAAW,EAAK,EAAK,CAAA,EAE7C,CAaM,SAAUE,GAAMC,EAAgBV,EAAmCC,EAAgCU,EAAwB,CAAA,EAAE,CAC/H,IAAMJ,EAAUI,EAAQ,SAAW,GACnC,QAAW1D,KAAS+C,EAAQ,CACxB,GAAI,EAAE/C,EAAM,OAAS,GAAI,SACzB,IAAM2D,EAAMN,GAAerD,EAAOsD,CAAO,EACzC,GAAIK,IAAQ,KAAM,SAClB,IAAMC,EAAOd,GAAQ9C,EAAOgD,EAAUU,EAAQ,IAAI,EAC9CE,EAAK,SAAW,GACpBH,EAAG,UAAU1C,EAAK4C,EAAKC,EAAMF,EAAQ,UAAY,CAAE,UAAWA,EAAQ,SAAS,EAAK,MAAS,CACjG,CACA,OAAOD,CACX",
6
+ "names": ["paint3d_exports", "__export", "BAR", "STROKE_UNIT", "bar", "commands", "dashes", "lines", "material", "state", "state", "Types", "commands", "STROKE_UNIT", "solidOf", "layer", "color", "material", "fill", "extra", "type", "extraOpacity", "rest", "scale", "solid", "r", "g", "b", "resolved", "resolveFill3D", "BAR", "turnOnto", "dx", "dy", "dz", "qy", "qz", "qw", "l", "bar", "p", "q", "w", "extend", "len", "dashPattern", "dash", "units", "d", "pattern", "sum", "dashes", "length", "offset", "period", "out", "at", "i", "end", "from", "to", "barsFor", "stroke", "segments", "lift", "a", "s", "t", "strokeMaterial", "through", "blended", "lines", "g3", "options", "ink", "bars"]
7
7
  }
@@ -0,0 +1,84 @@
1
+ import type { FillResolved } from "../../attributes/shape/fill/union.js";
2
+ import type { StrokeResolved } from "../../attributes/shape/stroke/stroke.js";
3
+ import type { Geometry3D } from "../../render3d/geometry.js";
4
+ import type { Graphics3D } from "../../render3d/graphics3d.js";
5
+ import type { BasicMaterial3D, Material3D, StandardMaterial3D } from "../../render3d/material.js";
6
+ import type { Transform3D } from "../../render3d/transform.js";
7
+ /**
8
+ * A custom 3D node's paint: the same `fill` and `stroke` entries a 2D shape takes, so a 3D component never invents
9
+ * `color`, `lineColor` or `lineWidth`. Spread `...Paint3D.state` and `...Paint3D.commands`, then draw the surface with
10
+ * {@link material} and the lines with {@link lines}. Built-in meshes keep `Material.state`.
11
+ */
12
+ export declare const state: {
13
+ fill: import("../../components/factory/types.js").Attribute<import("../../index.js").Fill, FillResolved[]>;
14
+ stroke: import("../../components/factory/types.js").Attribute<import("../../attributes/shape/stroke/stroke.js").Stroke, StrokeResolved[]>;
15
+ };
16
+ /** `fillTo` and `strokeTo`, the same commands `Paint` has. */
17
+ export declare const commands: {
18
+ fillTo: {
19
+ readonly args: readonly ["fill"];
20
+ readonly run?: undefined;
21
+ };
22
+ strokeTo: {
23
+ readonly args: readonly ["stroke"];
24
+ readonly run?: undefined;
25
+ };
26
+ };
27
+ /** A point in a node's own 3D space. */
28
+ export type Vec3 = readonly [number, number, number];
29
+ /** A line segment from one point to another. */
30
+ export type Segment3D = readonly [Vec3, Vec3];
31
+ /** A stroke `weight`, `dash` or `dashOffset` of 1 is this many scene units: weights are thousandths of a unit. */
32
+ export declare const STROKE_UNIT = 0.001;
33
+ /** The surface options {@link material} takes: `type` picks the shading, and every other field is laid over the result. */
34
+ export type MaterialOptions = ({
35
+ readonly type?: "basic";
36
+ } & Partial<Omit<BasicMaterial3D, "type">>) | ({
37
+ readonly type: "standard";
38
+ } & Partial<Omit<StandardMaterial3D, "type">>);
39
+ /**
40
+ * The material a surface painted with `fill` wears. Unlit (`basic`) by default; `{ type: "standard" }` lights it.
41
+ *
42
+ * - **One solid layer** becomes `color` with its alpha as `opacity`, so `fillTo` between colours tweens the uniforms
43
+ * and allocates nothing.
44
+ * - **Anything else** (a gradient, an image, a stack of layers) goes through `resolveFill3D` and becomes a `map`.
45
+ * - **An empty fill** gives an invisible material (`visible: false`), as an empty 2D fill paints nothing.
46
+ *
47
+ * Fields in `extra` are laid over the result; its `opacity` multiplies the fill's.
48
+ */
49
+ export declare function material(fill: readonly FillResolved[], extra?: MaterialOptions): Material3D;
50
+ /** What {@link lines} takes besides the strokes and segments. */
51
+ export interface LinesOptions {
52
+ /**
53
+ * Draw through solids: `depthTest: false, depthWrite: false`, and blended so it draws after every opaque mesh. For
54
+ * the hidden lines a CAD view shows dashed through the body.
55
+ */
56
+ readonly through?: boolean;
57
+ /**
58
+ * Added to both ends of every segment: a surface's normal times the gap. A line laid on a face needs a gap of at
59
+ * least the camera distance ÷ 2000 (`docs/3d.md`, Depth rule 2); a bar centred on a solid's edge needs none. Leave
60
+ * it out to place the segments yourself.
61
+ */
62
+ readonly lift?: Vec3;
63
+ /** A transform for the whole draw, as `Graphics3D.instances` takes one. */
64
+ readonly transform?: Transform3D;
65
+ }
66
+ /** The unit box each bar scales: 1 long on x, 1 by 1 across. */
67
+ export declare const BAR: Geometry3D;
68
+ /** A square bar from `p` to `q`, `w` across, running `extend` past each end. */
69
+ export declare function bar(p: Vec3, q: Vec3, w: number, extend?: number): Transform3D;
70
+ /** The stretches `[from, to]` along a segment `length` long that a dash pattern draws, starting `offset` into it. */
71
+ export declare function dashes(length: number, pattern: readonly number[], offset?: number): [number, number][];
72
+ /**
73
+ * Draws `segments` with each layer of `stroke`, one `g3.instances` call of unit boxes per layer, bottom to top.
74
+ *
75
+ * - **`weight`, `dash` and `dashOffset` are thousandths of a scene unit**: weight 5.5 is a 0.0055-wide bar, a CAD
76
+ * hairline on a model a few units across.
77
+ * - **Caps**: `square` runs each bar (and each dash) half the weight past its ends, so outline corners close; `butt`
78
+ * ends flush. `round` ends flush too, as `butt` does: a box has no round end.
79
+ * - **Colour** is the layer's first solid fill, its alpha the bar's `opacity` (below 1 the bars blend and stop writing
80
+ * depth). A layer with no solid fill, or nothing opaque in it, draws nothing; so does an empty `stroke`.
81
+ * - `align`, `join`, markers and the shape of `startCap`/`endCap` are 2D path ideas and are ignored.
82
+ */
83
+ export declare function lines(g3: Graphics3D, stroke: readonly StrokeResolved[], segments: readonly Segment3D[], options?: LinesOptions): Graphics3D;
84
+ //# sourceMappingURL=paint3d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paint3d.d.ts","sourceRoot":"","sources":["../../../src/components/modules/paint3d.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKxD;;;;GAIG;AACH,eAAO,MAAM,KAAK;;;CAGjB,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,QAAQ;;;;;;;;;CAGpB,CAAC;AAEF,wCAAwC;AACxC,MAAM,MAAM,IAAI,GAAG,SAAS,C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;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,cAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,SAAS,EAAE,EAAE,OAAO,GAAE,YAAiB,GAAG,UAAU,CAW/I"}
@@ -0,0 +1,182 @@
1
+ import { resolveFill3D } from "../../render3d/fill3d.js";
2
+ import { Types } from "../../components/factory/types.js";
3
+ import * as Paint from "../../components/modules/paint.js";
4
+ /**
5
+ * A custom 3D node's paint: the same `fill` and `stroke` entries a 2D shape takes, so a 3D component never invents
6
+ * `color`, `lineColor` or `lineWidth`. Spread `...Paint3D.state` and `...Paint3D.commands`, then draw the surface with
7
+ * {@link material} and the lines with {@link lines}. Built-in meshes keep `Material.state`.
8
+ */
9
+ export const state = {
10
+ fill: Types.fill,
11
+ stroke: Types.stroke,
12
+ };
13
+ /** `fillTo` and `strokeTo`, the same commands `Paint` has. */
14
+ export const commands = {
15
+ fillTo: Paint.commands.fillTo,
16
+ strokeTo: Paint.commands.strokeTo,
17
+ };
18
+ /** A stroke `weight`, `dash` or `dashOffset` of 1 is this many scene units: weights are thousandths of a unit. */
19
+ export const STROKE_UNIT = 0.001;
20
+ /** The colour a fill layer is when it is one flat colour with no blend; `null` for anything else. */
21
+ function solidOf(layer) {
22
+ if (layer === undefined || layer.type !== "solid")
23
+ return null;
24
+ if (layer.blend !== undefined)
25
+ return null;
26
+ const color = layer.color;
27
+ return { color, alpha: (color[3] ?? 1) * (layer.opacity ?? 1) };
28
+ }
29
+ /**
30
+ * The material a surface painted with `fill` wears. Unlit (`basic`) by default; `{ type: "standard" }` lights it.
31
+ *
32
+ * - **One solid layer** becomes `color` with its alpha as `opacity`, so `fillTo` between colours tweens the uniforms
33
+ * and allocates nothing.
34
+ * - **Anything else** (a gradient, an image, a stack of layers) goes through `resolveFill3D` and becomes a `map`.
35
+ * - **An empty fill** gives an invisible material (`visible: false`), as an empty 2D fill paints nothing.
36
+ *
37
+ * Fields in `extra` are laid over the result; its `opacity` multiplies the fill's.
38
+ */
39
+ export function material(fill, extra = {}) {
40
+ const { type = "basic", opacity: extraOpacity, ...rest } = extra;
41
+ const scale = extraOpacity ?? 1;
42
+ if (fill.length === 0)
43
+ return { type, ...rest, visible: false };
44
+ const solid = fill.length === 1 ? solidOf(fill[0]) : null;
45
+ if (solid !== null) {
46
+ const [r, g, b] = solid.color;
47
+ return { type, color: [r, g, b, 1], opacity: solid.alpha * scale, ...rest };
48
+ }
49
+ const resolved = resolveFill3D(fill);
50
+ return {
51
+ type,
52
+ ...(resolved.color !== undefined ? { color: resolved.color } : {}),
53
+ ...(resolved.map !== undefined ? { map: resolved.map } : {}),
54
+ ...(extraOpacity !== undefined ? { opacity: extraOpacity } : {}),
55
+ ...rest,
56
+ };
57
+ }
58
+ /** The unit box each bar scales: 1 long on x, 1 by 1 across. */
59
+ export const BAR = { type: "box", width: 1, height: 1, depth: 1 };
60
+ /** The turn that carries +x onto the unit direction `d`. */
61
+ function turnOnto(dx, dy, dz) {
62
+ // About +x cross d, by the angle between them; straight back along -x turns half way round y.
63
+ if (dx <= -0.9999)
64
+ return { x: 0, y: 1, z: 0, w: 0 };
65
+ const qy = -dz;
66
+ const qz = dy;
67
+ const qw = 1 + dx;
68
+ const l = Math.hypot(qy, qz, qw);
69
+ return { x: 0, y: qy / l, z: qz / l, w: qw / l };
70
+ }
71
+ /** A square bar from `p` to `q`, `w` across, running `extend` past each end. */
72
+ export function bar(p, q, w, extend = 0) {
73
+ const dx = q[0] - p[0];
74
+ const dy = q[1] - p[1];
75
+ const dz = q[2] - p[2];
76
+ const len = Math.hypot(dx, dy, dz) || 1e-9;
77
+ return {
78
+ position: [(p[0] + q[0]) / 2, (p[1] + q[1]) / 2, (p[2] + q[2]) / 2],
79
+ quaternion: turnOnto(dx / len, dy / len, dz / len),
80
+ scale: [len + extend * 2, w, w],
81
+ };
82
+ }
83
+ /** The pattern a `dash` repeats, in scene units: an odd list runs twice, as in SVG; `null` for a solid line. */
84
+ function dashPattern(dash) {
85
+ if (dash === undefined || dash.length === 0)
86
+ return null;
87
+ const units = dash.map((d) => Math.max(0, d) * STROKE_UNIT);
88
+ const pattern = units.length % 2 === 1 ? [...units, ...units] : units;
89
+ return pattern.reduce((sum, d) => sum + d, 0) > 1e-9 ? pattern : null;
90
+ }
91
+ /** The stretches `[from, to]` along a segment `length` long that a dash pattern draws, starting `offset` into it. */
92
+ export function dashes(length, pattern, offset = 0) {
93
+ const period = pattern.reduce((sum, d) => sum + d, 0);
94
+ const out = [];
95
+ if (period <= 0 || length <= 0)
96
+ return out;
97
+ // Start at the beginning of the period the offset falls in, before the segment.
98
+ let at = -(((offset % period) + period) % period);
99
+ let i = 0;
100
+ const end = length - 1e-9;
101
+ while (at < end) {
102
+ const d = pattern[i % pattern.length];
103
+ if (i % 2 === 0 && d > 0) {
104
+ const from = Math.max(0, at);
105
+ const to = Math.min(length, at + d);
106
+ if (to - from > 1e-9)
107
+ out.push([from, to]);
108
+ }
109
+ at += d;
110
+ i++;
111
+ }
112
+ return out;
113
+ }
114
+ /** The bars one stroke layer draws along `segments`. */
115
+ function barsFor(stroke, segments, lift) {
116
+ const w = stroke.weight * STROKE_UNIT;
117
+ // `round` has no round end to draw on a box, so it ends flush, as `butt` does.
118
+ const extend = stroke.cap === "square" ? w / 2 : 0;
119
+ const pattern = dashPattern(stroke.dash);
120
+ const offset = stroke.dashOffset * STROKE_UNIT;
121
+ const out = [];
122
+ for (const [a, b] of segments) {
123
+ const p = lift ? [a[0] + lift[0], a[1] + lift[1], a[2] + lift[2]] : a;
124
+ const q = lift ? [b[0] + lift[0], b[1] + lift[1], b[2] + lift[2]] : b;
125
+ const length = Math.hypot(q[0] - p[0], q[1] - p[1], q[2] - p[2]);
126
+ if (length <= 1e-9)
127
+ continue;
128
+ if (pattern === null) {
129
+ out.push(bar(p, q, w, extend));
130
+ continue;
131
+ }
132
+ const at = (s) => {
133
+ const t = s / length;
134
+ return [p[0] + (q[0] - p[0]) * t, p[1] + (q[1] - p[1]) * t, p[2] + (q[2] - p[2]) * t];
135
+ };
136
+ for (const [from, to] of dashes(length, pattern, offset))
137
+ out.push(bar(at(from), at(to), w, extend));
138
+ }
139
+ return out;
140
+ }
141
+ /** The unlit material one stroke layer draws with, or `null` when it would draw nothing. */
142
+ function strokeMaterial(stroke, through) {
143
+ const solid = stroke.fill.map(solidOf).find((s) => s !== null) ?? null;
144
+ if (solid === null || solid.alpha <= 0)
145
+ return null;
146
+ const [r, g, b] = solid.color;
147
+ const blended = solid.alpha < 1 || through;
148
+ return {
149
+ type: "basic",
150
+ color: [r, g, b, 1],
151
+ opacity: solid.alpha,
152
+ ...(blended ? { transparent: true, depthWrite: false } : {}),
153
+ ...(through ? { depthTest: false } : {}),
154
+ };
155
+ }
156
+ /**
157
+ * Draws `segments` with each layer of `stroke`, one `g3.instances` call of unit boxes per layer, bottom to top.
158
+ *
159
+ * - **`weight`, `dash` and `dashOffset` are thousandths of a scene unit**: weight 5.5 is a 0.0055-wide bar, a CAD
160
+ * hairline on a model a few units across.
161
+ * - **Caps**: `square` runs each bar (and each dash) half the weight past its ends, so outline corners close; `butt`
162
+ * ends flush. `round` ends flush too, as `butt` does: a box has no round end.
163
+ * - **Colour** is the layer's first solid fill, its alpha the bar's `opacity` (below 1 the bars blend and stop writing
164
+ * depth). A layer with no solid fill, or nothing opaque in it, draws nothing; so does an empty `stroke`.
165
+ * - `align`, `join`, markers and the shape of `startCap`/`endCap` are 2D path ideas and are ignored.
166
+ */
167
+ export function lines(g3, stroke, segments, options = {}) {
168
+ const through = options.through ?? false;
169
+ for (const layer of stroke) {
170
+ if (!(layer.weight > 0))
171
+ continue;
172
+ const ink = strokeMaterial(layer, through);
173
+ if (ink === null)
174
+ continue;
175
+ const bars = barsFor(layer, segments, options.lift);
176
+ if (bars.length === 0)
177
+ continue;
178
+ g3.instances(BAR, ink, bars, options.transform ? { transform: options.transform } : undefined);
179
+ }
180
+ return g3;
181
+ }
182
+ //# sourceMappingURL=pa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QACH,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACnB,OAAO,EAAE,KAAK,CAAC,KAAK;QACpB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5D,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7B,CAAC;AACpB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,KAAK,CAAC,EAAc,EAAE,MAAiC,EAAE,QAA8B,EAAE,UAAwB,EAAE;IAC/H,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YAAE,SAAS;QAClC,MAAM,GAAG,GAAG,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC3C,IAAI,GAAG,KAAK,IAAI;YAAE,SAAS;QAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAChC,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACnG,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC","sourcesContent":["import type { NormalizedColor } from \"@/attributes/shape/fill/color/parser\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport type { StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\nimport { resolveFill3D, type Fill3D } from \"@/render3d/fill3d\";\nimport type { Geometry3D } from \"@/render3d/geometry\";\nimport type { Graphics3D } from \"@/render3d/graphics3d\";\nimport type { BasicMaterial3D, Material3D, StandardMaterial3D } from \"@/render3d/material\";\nimport type { Transform3D } from \"@/render3d/transform\";\nimport type { Quaternion } from \"@/render3d/vector3\";\nimport { Types } from \"@/components/factory/types\";\nimport * as Paint from \"@/components/modules/paint\";\n\n/**\n * A custom 3D node's paint: the same `fill` and `stroke` entries a 2D shape takes, so a 3D component never invents\n * `color`, `lineColor` or `lineWidth`. Spread `...Paint3D.state` and `...Paint3D.commands`, then draw the surface with\n * {@link material} and the lines with {@link lines}. Built-in meshes keep `Material.state`.\n */\nexport const state = {\n fill: Types.fill,\n stroke: Types.stroke,\n};\n\n/** `fillTo` and `strokeTo`, the same commands `Paint` has. */\nexport const commands = {\n fillTo: Paint.commands.fillTo,\n strokeTo: Paint.commands.strokeTo,\n};\n\n/** A point in a node's own 3D space. */\nexport type Vec3 = readonly [number, number, number];\n\n/** A line segment from one point to another. */\nexport type Segment3D = readonly [Vec3, Vec3];\n\n/** A stroke `weight`, `dash` or `dashOffset` of 1 is this many scene units: weights are thousandths of a unit. */\nexport const STROKE_UNIT = 0.001;\n\n/** The surface options {@link material} takes: `type` picks the shading, and every other field is laid over the result. */\nexport type MaterialOptions =\n | ({ readonly type?: \"basic\" } & Partial<Omit<BasicMaterial3D, \"type\">>)\n | ({ readonly type: \"standard\" } & Partial<Omit<StandardMaterial3D, \"type\">>);\n\n/** The colour a fill layer is when it is one flat colour with no blend; `null` for anything else. */\nfunction solidOf(layer: FillResolved | undefined): { color: NormalizedColor; alpha: number } | null {\n if (layer === undefined || layer.type !== \"solid\") return null;\n if (layer.blend !== undefined) return null;\n const color = layer.color;\n return { color, alpha: (color[3] ?? 1) * (layer.opacity ?? 1) };\n}\n\n/**\n * The material a surface painted with `fill` wears. Unlit (`basic`) by default; `{ type: \"standard\" }` lights it.\n *\n * - **One solid layer** becomes `color` with its alpha as `opacity`, so `fillTo` between colours tweens the uniforms\n * and allocates nothing.\n * - **Anything else** (a gradient, an image, a stack of layers) goes through `resolveFill3D` and becomes a `map`.\n * - **An empty fill** gives an invisible material (`visible: false`), as an empty 2D fill paints nothing.\n *\n * Fields in `extra` are laid over the result; its `opacity` multiplies the fill's.\n */\nexport function material(fill: readonly FillResolved[], extra: MaterialOptions = {}): Material3D {\n const { type = \"basic\", opacity: extraOpacity, ...rest } = extra as MaterialOptions & { opacity?: number };\n const scale = extraOpacity ?? 1;\n if (fill.length === 0) return { type, ...rest, visible: false } as Material3D;\n const solid = fill.length === 1 ? solidOf(fill[0]) : null;\n if (solid !== null) {\n const [r, g, b] = solid.color;\n return { type, color: [r, g, b, 1], opacity: solid.alpha * scale, ...rest } as Material3D;\n }\n const resolved = resolveFill3D(fill as unknown as Fill3D);\n return {\n type,\n ...(resolved.color !== undefined ? { color: resolved.color } : {}),\n ...(resolved.map !== undefined ? { map: resolved.map } : {}),\n ...(extraOpacity !== undefined ? { opacity: extraOpacity } : {}),\n ...rest,\n } as Material3D;\n}\n\n/** What {@link lines} takes besides the strokes and segments. */\nexport interface LinesOptions {\n /**\n * Draw through solids: `depthTest: false, depthWrite: false`, and blended so it draws after every opaque mesh. For\n * the hidden lines a CAD view shows dashed through the body.\n */\n readonly through?: boolean;\n /**\n * Added to both ends of every segment: a surface's normal times the gap. A line laid on a face needs a gap of at\n * least the camera distance ÷ 2000 (`docs/3d.md`, Depth rule 2); a bar centred on a solid's edge needs none. Leave\n * it out to place the segments yourself.\n */\n readonly lift?: Vec3;\n /** A transform for the whole draw, as `Graphics3D.instances` takes one. */\n readonly transform?: Transform3D;\n}\n\n/** The unit box each bar scales: 1 long on x, 1 by 1 across. */\nexport const BAR: Geometry3D = { type: \"box\", width: 1, height: 1, depth: 1 };\n\n/** The turn that carries +x onto the unit direction `d`. */\nfunction turnOnto(dx: number, dy: number, dz: number): Quaternion {\n // About +x cross d, by the angle between them; straight back along -x turns half way round y.\n if (dx <= -0.9999) return { x: 0, y: 1, z: 0, w: 0 };\n const qy = -dz;\n const qz = dy;\n const qw = 1 + dx;\n const l = Math.hypot(qy, qz, qw);\n return { x: 0, y: qy / l, z: qz / l, w: qw / l };\n}\n\n/** A square bar from `p` to `q`, `w` across, running `extend` past each end. */\nexport function bar(p: Vec3, q: Vec3, w: number, extend = 0): Transform3D {\n const dx = q[0] - p[0];\n const dy = q[1] - p[1];\n const dz = q[2] - p[2];\n const len = Math.hypot(dx, dy, dz) || 1e-9;\n return {\n position: [(p[0] + q[0]) / 2, (p[1] + q[1]) / 2, (p[2] + q[2]) / 2],\n quaternion: turnOnto(dx / len, dy / len, dz / len),\n scale: [len + extend * 2, w, w],\n };\n}\n\n/** The pattern a `dash` repeats, in scene units: an odd list runs twice, as in SVG; `null` for a solid line. */\nfunction dashPattern(dash: readonly number[] | undefined): number[] | null {\n if (dash === undefined || dash.length === 0) return null;\n const units = dash.map((d) => Math.max(0, d) * STROKE_UNIT);\n const pattern = units.length % 2 === 1 ? [...units, ...units] : units;\n return pattern.reduce((sum, d) => sum + d, 0) > 1e-9 ? pattern : null;\n}\n\n/** The stretches `[from, to]` along a segment `length` long that a dash pattern draws, starting `offset` into it. */\nexport function dashes(length: number, pattern: readonly number[], offset = 0): [number, number][] {\n const period = pattern.reduce((sum, d) => sum + d, 0);\n const out: [number, number][] = [];\n if (period <= 0 || length <= 0) return out;\n // Start at the beginning of the period the offset falls in, before the segment.\n let at = -(((offset % period) + period) % period);\n let i = 0;\n const end = length - 1e-9;\n while (at < end) {\n const d = pattern[i % pattern.length]!;\n if (i % 2 === 0 && d > 0) {\n const from = Math.max(0, at);\n const to = Math.min(length, at + d);\n if (to - from > 1e-9) out.push([from, to]);\n }\n at += d;\n i++;\n }\n return out;\n}\n\n/** The bars one stroke layer draws along `segments`. */\nfunction barsFor(stroke: StrokeResolved, segments: readonly Segment3D[], lift: Vec3 | undefined): Transform3D[] {\n const w = stroke.weight * STROKE_UNIT;\n // `round` has no round end to draw on a box, so it ends flush, as `butt` does.\n const extend = stroke.cap === \"square\" ? w / 2 : 0;\n const pattern = dashPattern(stroke.dash);\n const offset = stroke.dashOffset * STROKE_UNIT;\n const out: Transform3D[] = [];\n for (const [a, b] of segments) {\n const p: Vec3 = lift ? [a[0] + lift[0], a[1] + lift[1], a[2] + lift[2]] : a;\n const q: Vec3 = lift ? [b[0] + lift[0], b[1] + lift[1], b[2] + lift[2]] : b;\n const length = Math.hypot(q[0] - p[0], q[1] - p[1], q[2] - p[2]);\n if (length <= 1e-9) continue;\n if (pattern === null) {\n out.push(bar(p, q, w, extend));\n continue;\n }\n const at = (s: number): Vec3 => {\n const t = s / length;\n return [p[0] + (q[0] - p[0]) * t, p[1] + (q[1] - p[1]) * t, p[2] + (q[2] - p[2]) * t];\n };\n for (const [from, to] of dashes(length, pattern, offset)) out.push(bar(at(from), at(to), w, extend));\n }\n return out;\n}\n\n/** The unlit material one stroke layer draws with, or `null` when it would draw nothing. */\nfunction strokeMaterial(stroke: StrokeResolved, through: boolean): Material3D | null {\n const solid = stroke.fill.map(solidOf).find((s) => s !== null) ?? null;\n if (solid === null || solid.alpha <= 0) return null;\n const [r, g, b] = solid.color;\n const blended = solid.alpha < 1 || through;\n return {\n type: \"basic\",\n color: [r, g, b, 1],\n opacity: solid.alpha,\n ...(blended ? { transparent: true, depthWrite: false } : {}),\n ...(through ? { depthTest: false } : {}),\n } as Material3D;\n}\n\n/**\n * Draws `segments` with each layer of `stroke`, one `g3.instances` call of unit boxes per layer, bottom to top.\n *\n * - **`weight`, `dash` and `dashOffset` are thousandths of a scene unit**: weight 5.5 is a 0.0055-wide bar, a CAD\n * hairline on a model a few units across.\n * - **Caps**: `square` runs each bar (and each dash) half the weight past its ends, so outline corners close; `butt`\n * ends flush. `round` ends flush too, as `butt` does: a box has no round end.\n * - **Colour** is the layer's first solid fill, its alpha the bar's `opacity` (below 1 the bars blend and stop writing\n * depth). A layer with no solid fill, or nothing opaque in it, draws nothing; so does an empty `stroke`.\n * - `align`, `join`, markers and the shape of `startCap`/`endCap` are 2D path ideas and are ignored.\n */\nexport function lines(g3: Graphics3D, stroke: readonly StrokeResolved[], segments: readonly Segment3D[], options: LinesOptions = {}): Graphics3D {\n const through = options.through ?? false;\n for (const layer of stroke) {\n if (!(layer.weight > 0)) continue;\n const ink = strokeMaterial(layer, through);\n if (ink === null) continue;\n const bars = barsFor(layer, segments, options.lift);\n if (bars.length === 0) continue;\n g3.instances(BAR, ink, bars, options.transform ? { transform: options.transform } : undefined);\n }\n return g3;\n}\n"]}
@@ -26,6 +26,7 @@ export * as Aim from '../components/modules/aim.js';
26
26
  export * as Typeface from '../components/modules/text-style.js';
27
27
  export * as TextLayout from '../components/modules/text-layout.js';
28
28
  export * as Material from '../components/modules/material.js';
29
+ export * as Paint3D from '../components/modules/paint3d.js';
29
30
  export * as View3D from '../components/modules/view3d.js';
30
31
  export type { Attribute, EntryOptions, NumberOptions, TextOptions } from '../components/factory/types.js';
31
32
  export type { StyleGroups, StyleInput, StyleOptions, StyleShape, StyleValues } from '../components/factory/style.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,OAAO,EACP,YAAY,GACf,MAAM,aAAa,CAAC;AACrB,YAAY,EACR,eAAe,EACf,KAAK,GACR,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EACR,KAAK,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,GACnB,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MAAM,SAAS,CAAC;AAKjB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChG,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EACH,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,GAChB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACR,OAAO,EACP,iBAAiB,GACpB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACR,YAAY,GACf,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACR,SAAS,GACZ,MAAM,YAAY,CAAC"}
package/dist/sdk/index.js CHANGED
@@ -36,6 +36,8 @@ export * as Typeface from '../components/modules/text-style.js';
36
36
  export * as TextLayout from '../components/modules/text-layout.js';
37
37
  // A mesh's surface: the material entries, and the mesh drawn with them.
38
38
  export * as Material from '../components/modules/material.js';
39
+ // A custom 3D node's paint: the 2D `fill` and `stroke` entries, as a material and as lines.
40
+ export * as Paint3D from '../components/modules/paint3d.js';
39
41
  // A viewport onto 3D children: the default camera and lights, the grid, the render settings.
40
42
  export * as View3D from '../components/modules/view3d.js';
41
43
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,sGAAsG;AACtG,wGAAwG;AACxG,iFAAiF;AAEjF,sFAAsF;AACtF,OAAO,EACH,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,OAAO,EACP,YAAY,GACf,MAAM,aAAa,CAAC;AAKrB,0GAA0G;AAC1G,6EAA6E;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAA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5G,4GAA4G;AAC5G,+EAA+E;AAC/E,OAAO,EACH,cAAc,EACd,SAAS,EACT,WAAW,EACX,eAAe,EACf,eAAe,EACf,WAAW,GACd,MAAM,UAAU,CAAC;AAGlB,OAAO,EACH,MAAM,EACN,MAAM,EACN,OAAO,EACP,SAAS,EACZ,MAAM,UAAU,CAAC;AAOlB,OAAO,EACH,SAAS,EACT,KAAK,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,MAAM,EACN,aAAa,EACb,QAAQ,EACR,SAAS,GACZ,MAAM,SAAS,CAAC;AASjB,6GAA6G;AAC7G,6GAA6G;AAC7G,yCAAyC;AACzC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGhG,OAAO,EACH,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,GAChB,MAAM,yBAAyB,CAAC","sourcesContent":["// The curated public surface: published as `@motionscript/sdk`, a one-line passthrough of\n// `@motionscript/core/sdk` (this file). A deliberate subset of core's root barrel (`../index.ts`): no\n// `Engine`/`Session`/platform seams, no `@internal` descriptor plumbing. Every export is named from its\n// declaring sub-barrel, never a wildcard, so nothing internal leaks by accident.\n\n// A lone still or composition is sugar for a one-track project (`asProjectDocument`).\nexport {\n isProjectDocument,\n asProjectDocument,\n documentDuration,\n commandSpan,\n hasTimeline,\n nodeSpan,\n effectiveSpan,\n untimed,\n ROOT_NODE_ID,\n} from '../document';\nexport type {\n ProjectDocument,\n Track,\n} from '../document';\n// `resolveProjectDocument`/`placeTracks` live in `../runtime` but are deep-imported from their files: the\n// runtime barrel also carries `Engine`/`Session` and is never a source here.\nexport { resolveProjectDocument } from '../runtime/session';\nexport { placeTracks } from '../runtime/placement';\nexport type { TrackSpan } from '../runtime/placement';\nexport type {\n Theme,\n ColorTokens,\n Typography,\n TypographyPreset,\n} from '../project';\nexport type { NodeTime, AttachScope } from '../components/trees';\nexport type { BoxBounds, Extents } from '../layout';\n\nexport type {\n ImageMeta,\n VideoMeta,\n AudioMeta,\n FontMeta,\n AssetMeta,\n AssetManifest,\n} from '../assets';\n\nexport {\n validateDocument,\n assertValidDocument,\n // Saved documents carry the format they were written in; these bring one forward, and a host rewriting stored\n // node rows calls `migrateNodeProps`.\n DOCUMENT_FORMAT_VERSION,\n DocumentTooNewError,\n documentFormatVersion,\n migrateDocument,\n migrateNodeProps,\n missingNodeOf,\n // Not a singleton: what a document can name is a property of the registry compiling it.\n Registry,\n} from '../document';\n// The shader-pack vocabulary lives beside the fill/shader attribute machinery, not in `../document`.\nexport {\n normalizeShaderPack,\n resolveShaderProperties,\n isKnownShaderProperty,\n} from '../attributes';\nexport type {\n RegistryOptions,\n NodeTypeMap,\n ShaderPackMap,\n NodeTypeRecord,\n NodeCommandEntry,\n VisualDocument,\n ClipDocument,\n StillDocument,\n CompositionDocument,\n AudioDocument,\n NodeSpec,\n TimedNodeSpec,\n NodeSpan,\n CommandSpec,\n EaseSpec,\n LoopSpec,\n LoopDirection,\n VariableSpec,\n ValidationIssue,\n ValidationResult,\n ValidateOptions,\n DocumentChange,\n DocumentMigrationResult,\n PropMigration,\n PropNote,\n MissingNodeInfo,\n NodeConstructor,\n CommandFactory,\n CommandTypeEntry,\n VariableCommandFactory,\n VariableLerp,\n VariableTarget,\n} from '../document';\nexport type {\n Shader,\n FillShader,\n EffectShader,\n ShaderProperty,\n KnownShaderProperty,\n ShaderPropertyValues,\n} from '../attributes';\n\n// `expressionOps` carries recognition, parsing and compiling, so a host can lint or rewrite an expression\n// without reimplementing the grammar.\nexport { expressionOps, ExpressionError } from '../document';\nexport type {\n ParsedExpression,\n ExpressionNode,\n ExpressionDialect,\n VariableResolver,\n} from '../document';\n\n// A component is one object literal; behaviour is spread in from modules (`...Paint.state`) and their helpers\n// called (`Paint.draw`). See `packages/core/docs/why.md#node-types-are-factory-specs-not-decorated-classes`.\nexport { component2d } from '../components/factory/component2d';\nexport { componentAudio } from '../components/factory/component-audio';\nexport { component3d } from '../components/factory/component3d';\nexport { commandsFor } from '../components/factory/commands-for';\nexport { Types } from '../components/factory/types';\nexport { provides } from '../components/factory/api';\nexport * as Paint from '../components/modules/paint';\nexport * as Flow from '../components/modules/flow';\nexport * as Shapes from '../components/modules/shapes';\nexport * as Aim from '../components/modules/aim';\n// The face text is set in: its entries inherit from the nearest provider.\nexport * as Typeface from '../components/modules/text-style';\nexport * as TextLayout from '../components/modules/text-layout';\n// A mesh's surface: the material entries, and the mesh drawn with them.\nexport * as Material from '../components/modules/material';\n// A viewport onto 3D children: the default camera and lights, the grid, the render settings.\nexport * as View3D from '../components/modules/view3d';\nexport type { Attribute, EntryOptions, NumberOptions, TextOptions } from '../components/factory/types';\nexport type { StyleGroups, StyleInput, StyleOptions, StyleShape, StyleValues } from '../components/factory/style';\nexport type {\n Box2DState, BoxAudioState, CallProps, ChildView, Children2D, Component, Element, Entry, InOf, Inputs, Loader,\n Measurer, MergePaint, NodeOf, NodeView, OutOf, Piece, Placement2D, Provided, SoundOptions, StateSpec,\n Timeline, Type, Values, Writes,\n // Named in every component's type, so a package exporting one can declare it.\n Merge, BuiltNode,\n // What `render` is handed; `RenderContext2D` is the renderer's.\n RenderContext2D as RenderContext,\n CallProps3D, Placement3DProps, Transform3DState, Handle, LayoutBox, NodeFrame,\n // What a 3D `render` is handed; `RenderContext3D` is the renderer's.\n RenderContext3D as SceneContext,\n} from '../components/factory/api';\n\n// Types only: a node type is a component, never a subclass.\nexport type { Node, Node2D } from '../components/trees';\nexport {\n // A clip's root container: layout frame, background paint and camera in\n // one node. Every track builds into one sized to the viewport.\n Canvas2D,\n // Reaching another node by the id a `nodeRef` prop holds, and reading where it sits.\n findNode2D,\n frameIn,\n} from '../components/trees';\nexport { Provider, ThemeProvider } from '../components/builtins/providers/providers';\nexport type {\n NodeProps,\n Node2DProps,\n // A slot a layout puts each child in beyond its box — see `Node2D._placementOf`.\n ChildPlacement,\n // A parent's own coordinates for its children's `x`/`y` — see `Node2D._planeOf`.\n ChildPlane,\n // A point an editor can drag to set a `Vector2` prop — see `Node2D._handles`.\n NodeHandle,\n Canvas2DProps,\n NodeConfig,\n NodeChildren,\n NodeDimension,\n} from '../components/trees';\nexport type { ProviderProps, ThemeProviderProps } from '../components/builtins/providers/providers';\n\nexport {\n Rect,\n Ellipse,\n Path,\n // The document's `\"path\"`: its `data` is in the unit space of its own box,\n // where `Path` draws its `d` at face value.\n PathShape,\n Polygon,\n Polygram,\n Triangle,\n RightTriangle,\n Pentagon,\n Hexagon,\n Octagon,\n Star,\n} from '../components/builtins/geometry/geometry';\nexport { BooleanGroup, MaskGroup } from '../components/builtins/geometry/composite';\nexport type {\n PaintProps,\n ShapeProps,\n RectProps,\n FlexSize,\n EllipseProps,\n PathProps,\n PathShapeProps,\n PolygonProps,\n PolygramProps,\n} from '../components/builtins/geometry/geometry';\nexport type { BooleanGroupProps, MaskGroupProps } from '../components/builtins/geometry/composite';\n// The operation/mode vocabularies behind `Boolean`/`Mask` are attribute types,\n// not node-prop types.\nexport type {\n BooleanOperation,\n MaskMode,\n MaskOptions,\n} from '../attributes';\n\nexport {\n Camera,\n // The stage's 2.5D camera for one subtree: its children orbited in depth.\n OrbitCamera,\n RotatedBox,\n} from '../components/builtins/layout/layout';\nexport type {\n CameraProps,\n OrbitCameraProps,\n} from '../components/builtins/layout/layout';\n\nexport { Text, RichText, NumberNode, DefaultTextStyle } from '../components/builtins/text/text';\nexport type {\n TextProps,\n RichTextProps,\n NumberProps,\n NumberFormat,\n DefaultTextStyleProps,\n} from '../components/builtins/text/text';\nexport { textOps } from '../attributes';\nexport type {\n TextStyle,\n TextAlign,\n VerticalAlign,\n TextDecoration,\n TextCase,\n TextSpan,\n TextRun,\n FontStyle,\n} from '../attributes';\n\nexport { Video } from '../components/builtins/media/media';\nexport type {\n VideoProps,\n VideoSegment,\n} from '../components/builtins/media/media';\n\n// Levels are `Param`, so a fade is a ramp or transition rather than a `to()`: sound is scheduled once, ahead\n// of time.\nexport type { NodeAudio } from '../components/trees';\nexport { AudioBus, SoundNode } from '../components/builtins/audio/audio';\nexport {\n Sound,\n AudioEffects,\n ramp,\n hold,\n isRamp,\n} from '../attributes';\nexport type {\n NodeAudioProps,\n} from '../components/trees';\nexport type { AudioBusProps, SoundNodeProps } from '../components/builtins/audio/audio';\nexport type {\n SoundProps,\n AudioRequest,\n AudioBusStop,\n AudioEffect,\n AudioEffectsInput,\n AudioTransition,\n Param,\n Ramp,\n RampKey,\n} from '../attributes';\n\n// One 3D node; everything inside it is described with `Graphics3D`. `Surface2D` is the 2D to 3D bridge: a\n// child of `Canvas3D` whose 2D content is rasterized offscreen and bound to a material by `Tex.surface(name)`.\nexport { Canvas3D } from '../components/builtins/three/canvas3d';\nexport type { Node3D } from '../components/trees';\n// The 3D scene graph: components, each placed by its transform.\nexport {\n Group3D,\n Mesh3D,\n Box3D, Sphere3D, Plane3D, Cylinder3D, Cone3D, Torus3D, TorusKnot3D,\n Circle3D, Ring3D, Capsule3D, Polyhedron3D, Extrude3D, Lathe3D, Tube3D,\n Instances3D, Points3D, Line3D, Sprite3D, Model3D,\n AmbientLight3D, HemisphereLight3D, DirectionalLight3D,\n PointLight3D, SpotLight3D, AreaLight3D,\n Camera3D,\n Fog3D, Environment3D,\n} from '../components/builtins/three/three';\nexport {\n Graphics3D,\n Scene3D,\n RenderContext3D,\n Geo,\n Mat,\n Tex,\n lerpVector3,\n lerpEuler3,\n slerpQuaternion,\n quaternionFromEuler,\n normalizeQuaternion,\n resolveVector3,\n evaluateParametric,\n evaluateRoundedBox,\n resolveSurfaceSource,\n resolveFill3D,\n segmentsOf,\n resolveCameraPlacement,\n resolveShadows3D,\n shadowCasts,\n shadowReceives,\n} from '../render3d';\nexport type { Canvas3DProps } from '../components/builtins/three/canvas3d';\nexport type {\n // A 3D parent's own coordinates for its children's position: see `Node3D._spaceOf`.\n ChildSpace3D,\n Node3DProps,\n} from '../components/trees';\nexport type {\n Group3DProps, Mesh3DProps, Material3DProps,\n Box3DProps, Sphere3DProps, Plane3DProps, Cylinder3DProps, Cone3DProps,\n Torus3DProps, TorusKnot3DProps, Circle3DProps, Ring3DProps, Capsule3DProps,\n Polyhedron3DProps, Extrude3DProps, Lathe3DProps, Tube3DProps,\n Instances3DProps, Points3DProps, Line3DProps, Sprite3DProps, Model3DProps,\n AmbientLight3DProps, HemisphereLight3DProps, DirectionalLight3DProps,\n PointLight3DProps, SpotLight3DProps, AreaLight3DProps,\n Camera3DProps,\n Fog3DProps, Environment3DProps,\n} from '../components/builtins/three/three';\nexport type {\n Node3DRenderState,\n Graphics3DOp,\n Scene3DOp,\n Vector3,\n Vector3Input,\n Euler3,\n EulerOrder,\n Quaternion,\n Transform3D,\n Shadow3D,\n ShadowOptions3D,\n Faces3D,\n Blend3D,\n Shading3D,\n Segments3D,\n Sweep3D,\n Bevel3D,\n Fill3D,\n Geometry3D,\n BufferGeometry3D,\n Material3D,\n MaterialCommon3D,\n MeshShorthand3D,\n // What `Mesh3D.materialShorthand()` returns: a mesh node of your own overrides it.\n MaterialShorthand3D,\n Uniform3D,\n Texture3D,\n TextureOptions3D,\n SurfaceTexture3D,\n SurfaceSource3D,\n ResolvedSurfaceSource,\n LightData3D,\n CameraData3D,\n FogData3D,\n EnvironmentData3D,\n Shadows3D,\n ShadowSettings3D,\n ToneMapping3D,\n ToneSettings3D,\n PostEffect3D,\n LineMode3D,\n LineStroke3D,\n ModelAnimation3D,\n} from '../render3d';\n\nexport {\n Graphics2D,\n PathBuilder,\n Clip,\n toPathString,\n} from '../render';\nexport type {\n RenderContext2D,\n RenderPass2D,\n MeasureContext2D,\n TextBlockSource,\n // One recorded entry of `Graphics2D.ops()`.\n GraphicsOp,\n PathData,\n PathCommand,\n PathBounds,\n EllipseArc,\n} from '../render';\n// What a node's `declareAssets` declares into, and the async load a `loader` takes.\nexport type { AssetScope, LoaderFn } from '../assets';\n\nexport {\n Fills,\n parseColor,\n resolveFill,\n fillOps,\n colorOps,\n} from '../attributes';\nexport type {\n Fill,\n FillChain,\n FillOptions,\n VideoFillOptions,\n // Placement of an image/video source inside the shape it paints:\n // `crop` -> `fit` -> `zoom` -> `anchor`, plus the raw-matrix escape hatch.\n MediaPlacementOptions,\n ImageFit,\n ImageCrop,\n ImageMatrix,\n FillResolved,\n // A custom WGSL shader as a fill. Uniforms are keyed by their declared\n // name, and a `ShaderTexture` is an image it samples.\n ShaderFillProp,\n ShaderFillResolved,\n ShaderTexture,\n ShaderUniformRecord,\n FractalNoiseBasis,\n // The colour type every fill, stroke, shadow and 3D material accepts —\n // a CSS string (incl. `oklch()`, theme tokens, `\"white/10\"`) or a\n // pre-normalized RGBA tuple.\n Color,\n NormalizedColor,\n BlendMode,\n FillSpace,\n} from '../attributes';\n\nexport {\n resolveStroke,\n strokeOps,\n resolveShadow,\n shadowOps,\n resolveCorners,\n cornerRadiusOps,\n cornerStyleOps,\n // Parsing, measuring, sampling, trimming and morphing a path, and the\n // anchor model (`VectorPath`) a pen tool edits.\n pathOps,\n} from '../attributes';\nexport type {\n PathSampler,\n PathAnchor,\n PathSubpath,\n VectorPath,\n Stroke,\n StrokeProp,\n StrokeAlign,\n StrokeCap,\n StrokeMarker,\n StrokeEnd,\n StrokeJoin,\n StrokeResolved,\n Shadow,\n ShadowProp,\n ShadowResolved,\n Corners,\n CornerStyle,\n CornerStyleResolved,\n CornerRadiusResolved,\n // What a rect's `cornerRadius` and `cornerStyle` take, before they resolve.\n RectCornerRadius,\n RectCornerStyle,\n NodeEffect,\n} from '../attributes';\n\n// `flowOps` is the layout a container runs on its children, as plain data in and boxes out, so a custom node\n// can lay out what it draws the same way.\nexport {\n lerpVector2,\n sizeInputOps,\n insetsOps,\n alignmentOps,\n} from '../attributes';\n// `flowOps` itself is the layout package's, not the attribute layer's —\n// `../attributes`'s own `./layout` only carries Vector2/Size2D/Insets/Alignment.\nexport { flowOps } from '../layout';\nexport type {\n Vector2,\n Size2D,\n Insets,\n // What a `padding`-style prop accepts, before `insetsOps` resolves it.\n InsetsProps,\n InsetsResolved,\n AlignmentKey,\n Alignment,\n} from '../attributes';\nexport type {\n FlowMode,\n GapSize,\n FlowResolved,\n FlowProps,\n FlowSettings,\n LayoutItem,\n FlowSpace,\n FlowMeasure,\n FlowLine,\n // What an overriding `measure(constraints, scope)` is handed.\n SizeConstraints,\n} from '../layout';\n\n// `space3dOps` is the camera's own projection, for a host drawing over the picture rather than keeping a copy.\n// `SpaceCamera` is what a node returns from `_spaceCamera()` to open a 2.5D space.\nexport { space3dOps } from '../attributes/layout/space3d';\nexport type { LookAt, SpaceCamera, SpaceCameraProps, SpacePoint } from '../attributes/layout/space3d';\n\n// `describeEffect`/`effectDescriptors` describe each built-in effect's fields as plain JSON, so a host builds\n// its effect UI from the engine.\nexport { describeEffect, effectDescriptors } from '../attributes';\nexport type {\n EffectDescriptor,\n EffectParamDescriptor,\n EffectParamKind,\n EffectParamUnit,\n EffectParamControl,\n EffectGroup,\n EffectJson,\n} from '../attributes';\nexport {\n Effects,\n EffectChain,\n Adjustments,\n VideoAdjustments,\n AdjustmentChain,\n VideoAdjustmentChain,\n} from '../attributes';\n\nexport type {\n /** The `effects` prop type — what a node actually accepts. */\n Effect,\n EffectMode,\n EffectAxis,\n EffectSurface,\n EffectOptions,\n /** What an image fill's `preset.adjustments` accepts — one, a list, or a chain. */\n ImageAdjustment,\n VideoAdjustment,\n /** The node effects that also work as a media adjustment — see {@link Adjustments}. */\n EffectAdjustment,\n MediaAdjustment,\n VideoOnlyAdjustment,\n} from '../attributes';\n\n/**\n * Per-builder options. Every effect builder takes exactly one argument: one of\n * these, or the dominant scalar it wraps.\n */\nexport type {\n BlurOptions,\n DirectionalBlurOptions,\n GrayscaleOptions,\n PixelateOptions,\n BulgeOptions,\n MagnifyOptions,\n BloomOptions,\n VintageOptions,\n ChromaticAberrationOptions,\n InvertOptions,\n ScatterOptions,\n PosterizeOptions,\n MotionBlurOptions,\n ShaderEffectOptions,\n OutlineOptions,\n VignetteOptions,\n GrainOptions,\n SharpenOptions,\n EdgesOptions,\n ThresholdOptions,\n RadialBlurOptions,\n HalftoneOptions,\n DitherOptions,\n DuotoneOptions,\n CurvesOptions,\n ColorAdjustmentOptions,\n RgbShiftOptions,\n ScanlinesOptions,\n BlockDisplaceOptions,\n BitCrushOptions,\n AsciiOptions,\n StreakOptions,\n GlowOptions,\n OilPaintOptions,\n WaveOptions,\n TwirlOptions,\n ProgressiveBlurOptions,\n KaleidoscopeOptions,\n GlassOptions,\n LutOptions,\n} from '../attributes';\n\n/**\n * Per-builder options for the filters that exist only as filters. Everything\n * else on {@link Adjustments} takes the matching effect options above, minus\n * `mode` — a filter is on the fill's own pixels, so there is no backdrop to\n * point it at.\n */\nexport type {\n BlurFilterOptions,\n GrayscaleFilterOptions,\n AlphaFilterOptions,\n ExposureFilterOptions,\n ColorMatrixFilterOptions,\n CurvesFilterOptions,\n ColorAdjustmentFilterOptions,\n PosterizeTimeFilterOptions,\n VideoEchoFilterOptions,\n} from '../attributes';\n\n/** Effect data types, for naming an effect value or building one by hand. */\nexport type {\n BlurEffect,\n DirectionalBlurEffect,\n GrayscaleEffect,\n PixelateEffect,\n BulgeEffect,\n MagnifyEffect,\n BloomEffect,\n VintageEffect,\n ChromaticAberrationEffect,\n InvertEffect,\n InvertChannel,\n ScatterEffect,\n PosterizeEffect,\n MotionBlurEffect,\n MotionBlurAlignment,\n ShaderEffect,\n ShaderUniform,\n ShaderUniformValue,\n OutlineEffect,\n OutlinePosition,\n VignetteEffect,\n GrainEffect,\n SharpenEffect,\n EdgesEffect,\n EdgeKernel,\n ThresholdEffect,\n RadialBlurEffect,\n RadialBlurStyle,\n HalftoneEffect,\n HalftoneShape,\n HalftoneSeparation,\n DitherEffect,\n DitherMatrix,\n DuotoneEffect,\n CurvesEffect,\n ColorAdjustmentEffect,\n RgbShiftEffect,\n ScanlinesEffect,\n BlockDisplaceEffect,\n BitCrushEffect,\n BitCrushPalette,\n AsciiEffect,\n AsciiCharset,\n StreakEffect,\n GlowEffect,\n GlowChannel,\n GlowLoopStyle,\n GlowOriginal,\n GlowTint,\n OilPaintEffect,\n WaveEffect,\n WaveShape,\n TwirlEffect,\n ProgressiveBlurEffect,\n ProgressiveBlurShape,\n KaleidoscopeEffect,\n GlassEffect,\n LutEffect,\n} from '../attributes';\n\nexport {\n lerpNumber,\n} from '../tween';\nexport type {\n AnimationTarget,\n Steppable,\n TweenStepper,\n LerpFunction,\n TweenOptions,\n} from '../tween';\n\n// An animation as a value: a declared duration plus `at(t)`, so a host can ask what it looks like at a time\n// instead of running it to one. A component's `commands` return one. One command shape, always: `node.to(a,\n// 1)` is a single command, not a builder; sequencing is by timeline placement.\nexport {\n getCommandMeta,\n isCommand,\n makeCommand,\n commandSequence,\n commandParallel,\n loopCommand,\n} from '../tween';\nexport type { Command, CommandArgs, CommandMeta, CommandOptions } from '../tween';\n\nexport {\n linear,\n easeIn,\n easeOut,\n easeInOut\n} from '../tween';\nexport type {\n EasingFunction,\n EaseParams,\n StandardEase\n} from '../tween';\n\nexport {\n createRef,\n clamp,\n generateList,\n createContext,\n ContextMap,\n Random,\n SeedGenerator,\n parseCSV,\n parseData,\n} from '../util';\nexport type {\n Reference,\n RefTarget,\n Context,\n DataRecord,\n ParseCSVOptions,\n} from '../util';\n\n// Pure functions over a scene's node tree, in viewport space (origin at the viewport centre, y-up); a player\n// embedding reaches the same through `useMotionPlayer`. They live in `../runtime` but are deep-imported from\n// their files, never the runtime barrel.\nexport { nodeTypeIsA, parentIssue, placementIssues, siblingIssue } from '../document/placement';\nexport type { PlacementIssue, PlacementOptions } from '../document/placement';\n\nexport {\n nodeBox,\n pickNode,\n collectBoxes,\n parentPlanePointAt,\n childPlanePointAt,\n reparentPlacementAt,\n nodeHandlesAt,\n handleValueAt,\n} from '../runtime/node-picking';\nexport type {\n NodeBox,\n ReparentPlacement,\n} from '../runtime/node-picking';\nexport type {\n NodeOverride,\n} from '../runtime/playback-controller';\nexport type {\n TreeState,\n} from '../project';\n"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AY,EACZ,SAAS,EACT,YAAY,GACf,MAAM,eAAe,CAAC;AACvB,wEAAwE;AACxE,iFAAiF;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBpC,+GAA+G;AAC/G,mFAAmF;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,8GAA8G;AAC9G,iCAAiC;AACjC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAUlE,OAAO,EACH,OAAO,EACP,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACvB,MAAM,eAAe,CAAC;AAiJvB,OAAO,EACH,UAAU,GACb,MAAM,UAAU,CAAC;AASlB,4GAA4G;AAC5G,4GAA4G;AAC5G,+EAA+E;AAC/E,OAAO,EACH,cAAc,EACd,SAAS,EACT,WAAW,EACX,eAAe,EACf,eAAe,EACf,WAAW,GACd,MAAM,UAAU,CAAC;AAGlB,OAAO,EACH,MAAM,EACN,MAAM,EACN,OAAO,EACP,SAAS,EACZ,MAAM,UAAU,CAAC;AAOlB,OAAO,EACH,SAAS,EACT,KAAK,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,MAAM,EACN,aAAa,EACb,QAAQ,EACR,SAAS,GACZ,MAAM,SAAS,CAAC;AASjB,6GAA6G;AAC7G,6GAA6G;AAC7G,yCAAyC;AACzC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGhG,OAAO,EACH,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,GAChB,MAAM,yBAAyB,CAAC","sourcesContent":["// The curated public surface: published as `@motionscript/sdk`, a one-line passthrough of\n// `@motionscript/core/sdk` (this file). A deliberate subset of core's root barrel (`../index.ts`): no\n// `Engine`/`Session`/platform seams, no `@internal` descriptor plumbing. Every export is named from its\n// declaring sub-barrel, never a wildcard, so nothing internal leaks by accident.\n\n// A lone still or composition is sugar for a one-track project (`asProjectDocument`).\nexport {\n isProjectDocument,\n asProjectDocument,\n documentDuration,\n commandSpan,\n hasTimeline,\n nodeSpan,\n effectiveSpan,\n untimed,\n ROOT_NODE_ID,\n} from '../document';\nexport type {\n ProjectDocument,\n Track,\n} from '../document';\n// `resolveProjectDocument`/`placeTracks` live in `../runtime` but are deep-imported from their files: the\n// runtime barrel also carries `Engine`/`Session` and is never a source here.\nexport { resolveProjectDocument } from '../runtime/session';\nexport { placeTracks } from '../runtime/placement';\nexport type { TrackSpan } from '../runtime/placement';\nexport type {\n Theme,\n ColorTokens,\n Typography,\n TypographyPreset,\n} from '../project';\nexport type { NodeTime, AttachScope } from '../components/trees';\nexport type { BoxBounds, Extents } from '../layout';\n\nexport type {\n ImageMeta,\n VideoMeta,\n AudioMeta,\n FontMeta,\n AssetMeta,\n AssetManifest,\n} from '../assets';\n\nexport {\n validateDocument,\n assertValidDocument,\n // Saved documents carry the format they were written in; these bring one forward, and a host rewriting stored\n // node rows calls `migrateNodeProps`.\n DOCUMENT_FORMAT_VERSION,\n DocumentTooNewError,\n documentFormatVersion,\n migrateDocument,\n migrateNodeProps,\n missingNodeOf,\n // Not a singleton: what a document can name is a property of the registry compiling it.\n Registry,\n} from '../document';\n// The shader-pack vocabulary lives beside the fill/shader attribute machinery, not in `../document`.\nexport {\n normalizeShaderPack,\n resolveShaderProperties,\n isKnownShaderProperty,\n} from '../attributes';\nexport type {\n RegistryOptions,\n NodeTypeMap,\n ShaderPackMap,\n NodeTypeRecord,\n NodeCommandEntry,\n VisualDocument,\n ClipDocument,\n StillDocument,\n CompositionDocument,\n AudioDocument,\n NodeSpec,\n TimedNodeSpec,\n NodeSpan,\n CommandSpec,\n EaseSpec,\n LoopSpec,\n LoopDirection,\n VariableSpec,\n ValidationIssue,\n ValidationResult,\n ValidateOptions,\n DocumentChange,\n DocumentMigrationResult,\n PropMigration,\n PropNote,\n MissingNodeInfo,\n NodeConstructor,\n CommandFactory,\n CommandTypeEntry,\n VariableCommandFactory,\n VariableLerp,\n VariableTarget,\n} from '../document';\nexport type {\n Shader,\n FillShader,\n EffectShader,\n ShaderProperty,\n KnownShaderProperty,\n ShaderPropertyValues,\n} from '../attributes';\n\n// `expressionOps` carries recognition, parsing and compiling, so a host can lint or rewrite an expression\n// without reimplementing the grammar.\nexport { expressionOps, ExpressionError } from '../document';\nexport type {\n ParsedExpression,\n ExpressionNode,\n ExpressionDialect,\n VariableResolver,\n} from '../document';\n\n// A component is one object literal; behaviour is spread in from modules (`...Paint.state`) and their helpers\n// called (`Paint.draw`). See `packages/core/docs/why.md#node-types-are-factory-specs-not-decorated-classes`.\nexport { component2d } from '../components/factory/component2d';\nexport { componentAudio } from '../components/factory/component-audio';\nexport { component3d } from '../components/factory/component3d';\nexport { commandsFor } from '../components/factory/commands-for';\nexport { Types } from '../components/factory/types';\nexport { provides } from '../components/factory/api';\nexport * as Paint from '../components/modules/paint';\nexport * as Flow from '../components/modules/flow';\nexport * as Shapes from '../components/modules/shapes';\nexport * as Aim from '../components/modules/aim';\n// The face text is set in: its entries inherit from the nearest provider.\nexport * as Typeface from '../components/modules/text-style';\nexport * as TextLayout from '../components/modules/text-layout';\n// A mesh's surface: the material entries, and the mesh drawn with them.\nexport * as Material from '../components/modules/material';\n// A custom 3D node's paint: the 2D `fill` and `stroke` entries, as a material and as lines.\nexport * as Paint3D from '../components/modules/paint3d';\n// A viewport onto 3D children: the default camera and lights, the grid, the render settings.\nexport * as View3D from '../components/modules/view3d';\nexport type { Attribute, EntryOptions, NumberOptions, TextOptions } from '../components/factory/types';\nexport type { StyleGroups, StyleInput, StyleOptions, StyleShape, StyleValues } from '../components/factory/style';\nexport type {\n Box2DState, BoxAudioState, CallProps, ChildView, Children2D, Component, Element, Entry, InOf, Inputs, Loader,\n Measurer, MergePaint, NodeOf, NodeView, OutOf, Piece, Placement2D, Provided, SoundOptions, StateSpec,\n Timeline, Type, Values, Writes,\n // Named in every component's type, so a package exporting one can declare it.\n Merge, BuiltNode,\n // What `render` is handed; `RenderContext2D` is the renderer's.\n RenderContext2D as RenderContext,\n CallProps3D, Placement3DProps, Transform3DState, Handle, LayoutBox, NodeFrame,\n // What a 3D `render` is handed; `RenderContext3D` is the renderer's.\n RenderContext3D as SceneContext,\n} from '../components/factory/api';\n\n// Types only: a node type is a component, never a subclass.\nexport type { Node, Node2D } from '../components/trees';\nexport {\n // A clip's root container: layout frame, background paint and camera in\n // one node. Every track builds into one sized to the viewport.\n Canvas2D,\n // Reaching another node by the id a `nodeRef` prop holds, and reading where it sits.\n findNode2D,\n frameIn,\n} from '../components/trees';\nexport { Provider, ThemeProvider } from '../components/builtins/providers/providers';\nexport type {\n NodeProps,\n Node2DProps,\n // A slot a layout puts each child in beyond its box — see `Node2D._placementOf`.\n ChildPlacement,\n // A parent's own coordinates for its children's `x`/`y` — see `Node2D._planeOf`.\n ChildPlane,\n // A point an editor can drag to set a `Vector2` prop — see `Node2D._handles`.\n NodeHandle,\n Canvas2DProps,\n NodeConfig,\n NodeChildren,\n NodeDimension,\n} from '../components/trees';\nexport type { ProviderProps, ThemeProviderProps } from '../components/builtins/providers/providers';\n\nexport {\n Rect,\n Ellipse,\n Path,\n // The document's `\"path\"`: its `data` is in the unit space of its own box,\n // where `Path` draws its `d` at face value.\n PathShape,\n Polygon,\n Polygram,\n Triangle,\n RightTriangle,\n Pentagon,\n Hexagon,\n Octagon,\n Star,\n} from '../components/builtins/geometry/geometry';\nexport { BooleanGroup, MaskGroup } from '../components/builtins/geometry/composite';\nexport type {\n PaintProps,\n ShapeProps,\n RectProps,\n FlexSize,\n EllipseProps,\n PathProps,\n PathShapeProps,\n PolygonProps,\n PolygramProps,\n} from '../components/builtins/geometry/geometry';\nexport type { BooleanGroupProps, MaskGroupProps } from '../components/builtins/geometry/composite';\n// The operation/mode vocabularies behind `Boolean`/`Mask` are attribute types,\n// not node-prop types.\nexport type {\n BooleanOperation,\n MaskMode,\n MaskOptions,\n} from '../attributes';\n\nexport {\n Camera,\n // The stage's 2.5D camera for one subtree: its children orbited in depth.\n OrbitCamera,\n RotatedBox,\n} from '../components/builtins/layout/layout';\nexport type {\n CameraProps,\n OrbitCameraProps,\n} from '../components/builtins/layout/layout';\n\nexport { Text, RichText, NumberNode, DefaultTextStyle } from '../components/builtins/text/text';\nexport type {\n TextProps,\n RichTextProps,\n NumberProps,\n NumberFormat,\n DefaultTextStyleProps,\n} from '../components/builtins/text/text';\nexport { textOps } from '../attributes';\nexport type {\n TextStyle,\n TextAlign,\n VerticalAlign,\n TextDecoration,\n TextCase,\n TextSpan,\n TextRun,\n FontStyle,\n} from '../attributes';\n\nexport { Video } from '../components/builtins/media/media';\nexport type {\n VideoProps,\n VideoSegment,\n} from '../components/builtins/media/media';\n\n// Levels are `Param`, so a fade is a ramp or transition rather than a `to()`: sound is scheduled once, ahead\n// of time.\nexport type { NodeAudio } from '../components/trees';\nexport { AudioBus, SoundNode } from '../components/builtins/audio/audio';\nexport {\n Sound,\n AudioEffects,\n ramp,\n hold,\n isRamp,\n} from '../attributes';\nexport type {\n NodeAudioProps,\n} from '../components/trees';\nexport type { AudioBusProps, SoundNodeProps } from '../components/builtins/audio/audio';\nexport type {\n SoundProps,\n AudioRequest,\n AudioBusStop,\n AudioEffect,\n AudioEffectsInput,\n AudioTransition,\n Param,\n Ramp,\n RampKey,\n} from '../attributes';\n\n// One 3D node; everything inside it is described with `Graphics3D`. `Surface2D` is the 2D to 3D bridge: a\n// child of `Canvas3D` whose 2D content is rasterized offscreen and bound to a material by `Tex.surface(name)`.\nexport { Canvas3D } from '../components/builtins/three/canvas3d';\nexport type { Node3D } from '../components/trees';\n// The 3D scene graph: components, each placed by its transform.\nexport {\n Group3D,\n Mesh3D,\n Box3D, Sphere3D, Plane3D, Cylinder3D, Cone3D, Torus3D, TorusKnot3D,\n Circle3D, Ring3D, Capsule3D, Polyhedron3D, Extrude3D, Lathe3D, Tube3D,\n Instances3D, Points3D, Line3D, Sprite3D, Model3D,\n AmbientLight3D, HemisphereLight3D, DirectionalLight3D,\n PointLight3D, SpotLight3D, AreaLight3D,\n Camera3D,\n Fog3D, Environment3D,\n} from '../components/builtins/three/three';\nexport {\n Graphics3D,\n Scene3D,\n RenderContext3D,\n Geo,\n Mat,\n Tex,\n lerpVector3,\n lerpEuler3,\n slerpQuaternion,\n quaternionFromEuler,\n normalizeQuaternion,\n resolveVector3,\n evaluateParametric,\n evaluateRoundedBox,\n resolveSurfaceSource,\n resolveFill3D,\n segmentsOf,\n resolveCameraPlacement,\n resolveShadows3D,\n shadowCasts,\n shadowReceives,\n} from '../render3d';\nexport type { Canvas3DProps } from '../components/builtins/three/canvas3d';\nexport type {\n // A 3D parent's own coordinates for its children's position: see `Node3D._spaceOf`.\n ChildSpace3D,\n Node3DProps,\n} from '../components/trees';\nexport type {\n Group3DProps, Mesh3DProps, Material3DProps,\n Box3DProps, Sphere3DProps, Plane3DProps, Cylinder3DProps, Cone3DProps,\n Torus3DProps, TorusKnot3DProps, Circle3DProps, Ring3DProps, Capsule3DProps,\n Polyhedron3DProps, Extrude3DProps, Lathe3DProps, Tube3DProps,\n Instances3DProps, Points3DProps, Line3DProps, Sprite3DProps, Model3DProps,\n AmbientLight3DProps, HemisphereLight3DProps, DirectionalLight3DProps,\n PointLight3DProps, SpotLight3DProps, AreaLight3DProps,\n Camera3DProps,\n Fog3DProps, Environment3DProps,\n} from '../components/builtins/three/three';\nexport type {\n Node3DRenderState,\n Graphics3DOp,\n Scene3DOp,\n Vector3,\n Vector3Input,\n Euler3,\n EulerOrder,\n Quaternion,\n Transform3D,\n Shadow3D,\n ShadowOptions3D,\n Faces3D,\n Blend3D,\n Shading3D,\n Segments3D,\n Sweep3D,\n Bevel3D,\n Fill3D,\n Geometry3D,\n BufferGeometry3D,\n Material3D,\n MaterialCommon3D,\n MeshShorthand3D,\n // What `Mesh3D.materialShorthand()` returns: a mesh node of your own overrides it.\n MaterialShorthand3D,\n Uniform3D,\n Texture3D,\n TextureOptions3D,\n SurfaceTexture3D,\n SurfaceSource3D,\n ResolvedSurfaceSource,\n LightData3D,\n CameraData3D,\n FogData3D,\n EnvironmentData3D,\n Shadows3D,\n ShadowSettings3D,\n ToneMapping3D,\n ToneSettings3D,\n PostEffect3D,\n LineMode3D,\n LineStroke3D,\n ModelAnimation3D,\n} from '../render3d';\n\nexport {\n Graphics2D,\n PathBuilder,\n Clip,\n toPathString,\n} from '../render';\nexport type {\n RenderContext2D,\n RenderPass2D,\n MeasureContext2D,\n TextBlockSource,\n // One recorded entry of `Graphics2D.ops()`.\n GraphicsOp,\n PathData,\n PathCommand,\n PathBounds,\n EllipseArc,\n} from '../render';\n// What a node's `declareAssets` declares into, and the async load a `loader` takes.\nexport type { AssetScope, LoaderFn } from '../assets';\n\nexport {\n Fills,\n parseColor,\n resolveFill,\n fillOps,\n colorOps,\n} from '../attributes';\nexport type {\n Fill,\n FillChain,\n FillOptions,\n VideoFillOptions,\n // Placement of an image/video source inside the shape it paints:\n // `crop` -> `fit` -> `zoom` -> `anchor`, plus the raw-matrix escape hatch.\n MediaPlacementOptions,\n ImageFit,\n ImageCrop,\n ImageMatrix,\n FillResolved,\n // A custom WGSL shader as a fill. Uniforms are keyed by their declared\n // name, and a `ShaderTexture` is an image it samples.\n ShaderFillProp,\n ShaderFillResolved,\n ShaderTexture,\n ShaderUniformRecord,\n FractalNoiseBasis,\n // The colour type every fill, stroke, shadow and 3D material accepts —\n // a CSS string (incl. `oklch()`, theme tokens, `\"white/10\"`) or a\n // pre-normalized RGBA tuple.\n Color,\n NormalizedColor,\n BlendMode,\n FillSpace,\n} from '../attributes';\n\nexport {\n resolveStroke,\n strokeOps,\n resolveShadow,\n shadowOps,\n resolveCorners,\n cornerRadiusOps,\n cornerStyleOps,\n // Parsing, measuring, sampling, trimming and morphing a path, and the\n // anchor model (`VectorPath`) a pen tool edits.\n pathOps,\n} from '../attributes';\nexport type {\n PathSampler,\n PathAnchor,\n PathSubpath,\n VectorPath,\n Stroke,\n StrokeProp,\n StrokeAlign,\n StrokeCap,\n StrokeMarker,\n StrokeEnd,\n StrokeJoin,\n StrokeResolved,\n Shadow,\n ShadowProp,\n ShadowResolved,\n Corners,\n CornerStyle,\n CornerStyleResolved,\n CornerRadiusResolved,\n // What a rect's `cornerRadius` and `cornerStyle` take, before they resolve.\n RectCornerRadius,\n RectCornerStyle,\n NodeEffect,\n} from '../attributes';\n\n// `flowOps` is the layout a container runs on its children, as plain data in and boxes out, so a custom node\n// can lay out what it draws the same way.\nexport {\n lerpVector2,\n sizeInputOps,\n insetsOps,\n alignmentOps,\n} from '../attributes';\n// `flowOps` itself is the layout package's, not the attribute layer's —\n// `../attributes`'s own `./layout` only carries Vector2/Size2D/Insets/Alignment.\nexport { flowOps } from '../layout';\nexport type {\n Vector2,\n Size2D,\n Insets,\n // What a `padding`-style prop accepts, before `insetsOps` resolves it.\n InsetsProps,\n InsetsResolved,\n AlignmentKey,\n Alignment,\n} from '../attributes';\nexport type {\n FlowMode,\n GapSize,\n FlowResolved,\n FlowProps,\n FlowSettings,\n LayoutItem,\n FlowSpace,\n FlowMeasure,\n FlowLine,\n // What an overriding `measure(constraints, scope)` is handed.\n SizeConstraints,\n} from '../layout';\n\n// `space3dOps` is the camera's own projection, for a host drawing over the picture rather than keeping a copy.\n// `SpaceCamera` is what a node returns from `_spaceCamera()` to open a 2.5D space.\nexport { space3dOps } from '../attributes/layout/space3d';\nexport type { LookAt, SpaceCamera, SpaceCameraProps, SpacePoint } from '../attributes/layout/space3d';\n\n// `describeEffect`/`effectDescriptors` describe each built-in effect's fields as plain JSON, so a host builds\n// its effect UI from the engine.\nexport { describeEffect, effectDescriptors } from '../attributes';\nexport type {\n EffectDescriptor,\n EffectParamDescriptor,\n EffectParamKind,\n EffectParamUnit,\n EffectParamControl,\n EffectGroup,\n EffectJson,\n} from '../attributes';\nexport {\n Effects,\n EffectChain,\n Adjustments,\n VideoAdjustments,\n AdjustmentChain,\n VideoAdjustmentChain,\n} from '../attributes';\n\nexport type {\n /** The `effects` prop type — what a node actually accepts. */\n Effect,\n EffectMode,\n EffectAxis,\n EffectSurface,\n EffectOptions,\n /** What an image fill's `preset.adjustments` accepts — one, a list, or a chain. */\n ImageAdjustment,\n VideoAdjustment,\n /** The node effects that also work as a media adjustment — see {@link Adjustments}. */\n EffectAdjustment,\n MediaAdjustment,\n VideoOnlyAdjustment,\n} from '../attributes';\n\n/**\n * Per-builder options. Every effect builder takes exactly one argument: one of\n * these, or the dominant scalar it wraps.\n */\nexport type {\n BlurOptions,\n DirectionalBlurOptions,\n GrayscaleOptions,\n PixelateOptions,\n BulgeOptions,\n MagnifyOptions,\n BloomOptions,\n VintageOptions,\n ChromaticAberrationOptions,\n InvertOptions,\n ScatterOptions,\n PosterizeOptions,\n MotionBlurOptions,\n ShaderEffectOptions,\n OutlineOptions,\n VignetteOptions,\n GrainOptions,\n SharpenOptions,\n EdgesOptions,\n ThresholdOptions,\n RadialBlurOptions,\n HalftoneOptions,\n DitherOptions,\n DuotoneOptions,\n CurvesOptions,\n ColorAdjustmentOptions,\n RgbShiftOptions,\n ScanlinesOptions,\n BlockDisplaceOptions,\n BitCrushOptions,\n AsciiOptions,\n StreakOptions,\n GlowOptions,\n OilPaintOptions,\n WaveOptions,\n TwirlOptions,\n ProgressiveBlurOptions,\n KaleidoscopeOptions,\n GlassOptions,\n LutOptions,\n} from '../attributes';\n\n/**\n * Per-builder options for the filters that exist only as filters. Everything\n * else on {@link Adjustments} takes the matching effect options above, minus\n * `mode` — a filter is on the fill's own pixels, so there is no backdrop to\n * point it at.\n */\nexport type {\n BlurFilterOptions,\n GrayscaleFilterOptions,\n AlphaFilterOptions,\n ExposureFilterOptions,\n ColorMatrixFilterOptions,\n CurvesFilterOptions,\n ColorAdjustmentFilterOptions,\n PosterizeTimeFilterOptions,\n VideoEchoFilterOptions,\n} from '../attributes';\n\n/** Effect data types, for naming an effect value or building one by hand. */\nexport type {\n BlurEffect,\n DirectionalBlurEffect,\n GrayscaleEffect,\n PixelateEffect,\n BulgeEffect,\n MagnifyEffect,\n BloomEffect,\n VintageEffect,\n ChromaticAberrationEffect,\n InvertEffect,\n InvertChannel,\n ScatterEffect,\n PosterizeEffect,\n MotionBlurEffect,\n MotionBlurAlignment,\n ShaderEffect,\n ShaderUniform,\n ShaderUniformValue,\n OutlineEffect,\n OutlinePosition,\n VignetteEffect,\n GrainEffect,\n SharpenEffect,\n EdgesEffect,\n EdgeKernel,\n ThresholdEffect,\n RadialBlurEffect,\n RadialBlurStyle,\n HalftoneEffect,\n HalftoneShape,\n HalftoneSeparation,\n DitherEffect,\n DitherMatrix,\n DuotoneEffect,\n CurvesEffect,\n ColorAdjustmentEffect,\n RgbShiftEffect,\n ScanlinesEffect,\n BlockDisplaceEffect,\n BitCrushEffect,\n BitCrushPalette,\n AsciiEffect,\n AsciiCharset,\n StreakEffect,\n GlowEffect,\n GlowChannel,\n GlowLoopStyle,\n GlowOriginal,\n GlowTint,\n OilPaintEffect,\n WaveEffect,\n WaveShape,\n TwirlEffect,\n ProgressiveBlurEffect,\n ProgressiveBlurShape,\n KaleidoscopeEffect,\n GlassEffect,\n LutEffect,\n} from '../attributes';\n\nexport {\n lerpNumber,\n} from '../tween';\nexport type {\n AnimationTarget,\n Steppable,\n TweenStepper,\n LerpFunction,\n TweenOptions,\n} from '../tween';\n\n// An animation as a value: a declared duration plus `at(t)`, so a host can ask what it looks like at a time\n// instead of running it to one. A component's `commands` return one. One command shape, always: `node.to(a,\n// 1)` is a single command, not a builder; sequencing is by timeline placement.\nexport {\n getCommandMeta,\n isCommand,\n makeCommand,\n commandSequence,\n commandParallel,\n loopCommand,\n} from '../tween';\nexport type { Command, CommandArgs, CommandMeta, CommandOptions } from '../tween';\n\nexport {\n linear,\n easeIn,\n easeOut,\n easeInOut\n} from '../tween';\nexport type {\n EasingFunction,\n EaseParams,\n StandardEase\n} from '../tween';\n\nexport {\n createRef,\n clamp,\n generateList,\n createContext,\n ContextMap,\n Random,\n SeedGenerator,\n parseCSV,\n parseData,\n} from '../util';\nexport type {\n Reference,\n RefTarget,\n Context,\n DataRecord,\n ParseCSVOptions,\n} from '../util';\n\n// Pure functions over a scene's node tree, in viewport space (origin at the viewport centre, y-up); a player\n// embedding reaches the same through `useMotionPlayer`. They live in `../runtime` but are deep-imported from\n// their files, never the runtime barrel.\nexport { nodeTypeIsA, parentIssue, placementIssues, siblingIssue } from '../document/placement';\nexport type { PlacementIssue, PlacementOptions } from '../document/placement';\n\nexport {\n nodeBox,\n pickNode,\n collectBoxes,\n parentPlanePointAt,\n childPlanePointAt,\n reparentPlacementAt,\n nodeHandlesAt,\n handleValueAt,\n} from '../runtime/node-picking';\nexport type {\n NodeBox,\n ReparentPlacement,\n} from '../runtime/node-picking';\nexport type {\n NodeOverride,\n} from '../runtime/playback-controller';\nexport type {\n TreeState,\n} from '../project';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/core",
3
- "version": "0.1.1-alpha.2",
3
+ "version": "0.1.1-alpha.4",
4
4
  "type": "module",
5
5
  "description": "Engine-agnostic animation library for Motion Script: scenes, nodes, props, tweens and layout.",
6
6
  "repository": {