@motionscript/math 0.1.0-alpha.4 → 0.1.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/CHANGELOG.md +132 -92
  2. package/README.md +39 -33
  3. package/dist/annotate/angle-mark.d.ts +52 -27
  4. package/dist/annotate/angle-mark.d.ts.map +1 -1
  5. package/dist/annotate/angle-mark.js +80 -115
  6. package/dist/annotate/angle-mark.js.map +1 -1
  7. package/dist/annotate/curly-brace.d.ts +59 -25
  8. package/dist/annotate/curly-brace.d.ts.map +1 -1
  9. package/dist/annotate/curly-brace.js +85 -100
  10. package/dist/annotate/curly-brace.js.map +1 -1
  11. package/dist/annotate/emphasis-mark.d.ts +43 -9
  12. package/dist/annotate/emphasis-mark.d.ts.map +1 -1
  13. package/dist/annotate/emphasis-mark.js +33 -34
  14. package/dist/annotate/emphasis-mark.js.map +1 -1
  15. package/dist/browser/chunks/chunk-ABYBW64J.js +2 -0
  16. package/dist/browser/chunks/chunk-ABYBW64J.js.map +7 -0
  17. package/dist/browser/chunks/chunk-K77KLQX4.js +2 -0
  18. package/dist/browser/chunks/chunk-K77KLQX4.js.map +7 -0
  19. package/dist/browser/index.js +1 -1
  20. package/dist/browser/index.js.map +3 -3
  21. package/dist/browser/kit.js +1 -1
  22. package/dist/browser/manifest.json +1 -1
  23. package/dist/browser/tex.js +1 -1
  24. package/dist/browser/tex.js.map +2 -2
  25. package/dist/engine.d.ts +26 -19
  26. package/dist/engine.d.ts.map +1 -1
  27. package/dist/engine.js +17 -14
  28. package/dist/engine.js.map +1 -1
  29. package/dist/kit/component.d.ts +51 -0
  30. package/dist/kit/component.d.ts.map +1 -0
  31. package/dist/kit/component.js +30 -0
  32. package/dist/kit/component.js.map +1 -0
  33. package/dist/kit/curve.d.ts +22 -11
  34. package/dist/kit/curve.d.ts.map +1 -1
  35. package/dist/kit/curve.js +25 -18
  36. package/dist/kit/curve.js.map +1 -1
  37. package/dist/kit/field-mark.d.ts +58 -35
  38. package/dist/kit/field-mark.d.ts.map +1 -1
  39. package/dist/kit/field-mark.js +100 -120
  40. package/dist/kit/field-mark.js.map +1 -1
  41. package/dist/kit/follow.d.ts +67 -29
  42. package/dist/kit/follow.d.ts.map +1 -1
  43. package/dist/kit/follow.js +114 -110
  44. package/dist/kit/follow.js.map +1 -1
  45. package/dist/kit/furniture.d.ts +3 -1
  46. package/dist/kit/furniture.d.ts.map +1 -1
  47. package/dist/kit/furniture.js +5 -0
  48. package/dist/kit/furniture.js.map +1 -1
  49. package/dist/kit/graph.d.ts +46 -0
  50. package/dist/kit/graph.d.ts.map +1 -0
  51. package/dist/kit/graph.js +90 -0
  52. package/dist/kit/graph.js.map +1 -0
  53. package/dist/kit/mark.d.ts +64 -39
  54. package/dist/kit/mark.d.ts.map +1 -1
  55. package/dist/kit/mark.js +80 -96
  56. package/dist/kit/mark.js.map +1 -1
  57. package/dist/kit/place.d.ts +10 -8
  58. package/dist/kit/place.d.ts.map +1 -1
  59. package/dist/kit/place.js +28 -30
  60. package/dist/kit/place.js.map +1 -1
  61. package/dist/kit/system.d.ts +27 -29
  62. package/dist/kit/system.d.ts.map +1 -1
  63. package/dist/kit/system.js +62 -58
  64. package/dist/kit/system.js.map +1 -1
  65. package/dist/kit/withdrawn.d.ts +3 -3
  66. package/dist/kit/withdrawn.js +3 -3
  67. package/dist/kit/withdrawn.js.map +1 -1
  68. package/dist/marks/curve-area.d.ts +24 -18
  69. package/dist/marks/curve-area.d.ts.map +1 -1
  70. package/dist/marks/curve-area.js +50 -73
  71. package/dist/marks/curve-area.js.map +1 -1
  72. package/dist/marks/drop-lines.d.ts +28 -10
  73. package/dist/marks/drop-lines.d.ts.map +1 -1
  74. package/dist/marks/drop-lines.js +37 -52
  75. package/dist/marks/drop-lines.js.map +1 -1
  76. package/dist/marks/plot-point.d.ts +37 -20
  77. package/dist/marks/plot-point.d.ts.map +1 -1
  78. package/dist/marks/plot-point.js +65 -91
  79. package/dist/marks/plot-point.js.map +1 -1
  80. package/dist/marks/riemann-sum.d.ts +30 -26
  81. package/dist/marks/riemann-sum.d.ts.map +1 -1
  82. package/dist/marks/riemann-sum.js +57 -85
  83. package/dist/marks/riemann-sum.js.map +1 -1
  84. package/dist/marks/tangent-line.d.ts +38 -14
  85. package/dist/marks/tangent-line.d.ts.map +1 -1
  86. package/dist/marks/tangent-line.js +73 -87
  87. package/dist/marks/tangent-line.js.map +1 -1
  88. package/dist/marks/vector-arrow.d.ts +30 -20
  89. package/dist/marks/vector-arrow.d.ts.map +1 -1
  90. package/dist/marks/vector-arrow.js +58 -78
  91. package/dist/marks/vector-arrow.js.map +1 -1
  92. package/dist/nodes.d.ts +13 -5
  93. package/dist/nodes.d.ts.map +1 -1
  94. package/dist/nodes.js +0 -6
  95. package/dist/nodes.js.map +1 -1
  96. package/dist/plots/function-plot.d.ts +107 -43
  97. package/dist/plots/function-plot.d.ts.map +1 -1
  98. package/dist/plots/function-plot.js +146 -177
  99. package/dist/plots/function-plot.js.map +1 -1
  100. package/dist/plots/points-plot.d.ts +34 -19
  101. package/dist/plots/points-plot.d.ts.map +1 -1
  102. package/dist/plots/points-plot.js +31 -58
  103. package/dist/plots/points-plot.js.map +1 -1
  104. package/dist/plots/stream-lines.d.ts +38 -19
  105. package/dist/plots/stream-lines.d.ts.map +1 -1
  106. package/dist/plots/stream-lines.js +60 -79
  107. package/dist/plots/stream-lines.js.map +1 -1
  108. package/dist/plots/traced-path.d.ts +34 -15
  109. package/dist/plots/traced-path.d.ts.map +1 -1
  110. package/dist/plots/traced-path.js +33 -48
  111. package/dist/plots/traced-path.js.map +1 -1
  112. package/dist/plots/vector-field.d.ts +31 -11
  113. package/dist/plots/vector-field.d.ts.map +1 -1
  114. package/dist/plots/vector-field.js +50 -64
  115. package/dist/plots/vector-field.js.map +1 -1
  116. package/dist/structures/network-graph.d.ts +99 -49
  117. package/dist/structures/network-graph.d.ts.map +1 -1
  118. package/dist/structures/network-graph.js +168 -217
  119. package/dist/structures/network-graph.js.map +1 -1
  120. package/dist/structures/sample-space.d.ts +69 -38
  121. package/dist/structures/sample-space.d.ts.map +1 -1
  122. package/dist/structures/sample-space.js +132 -170
  123. package/dist/structures/sample-space.js.map +1 -1
  124. package/dist/systems/axes2d.d.ts +126 -37
  125. package/dist/systems/axes2d.d.ts.map +1 -1
  126. package/dist/systems/axes2d.js +147 -183
  127. package/dist/systems/axes2d.js.map +1 -1
  128. package/dist/systems/number-line.d.ts +51 -28
  129. package/dist/systems/number-line.d.ts.map +1 -1
  130. package/dist/systems/number-line.js +82 -118
  131. package/dist/systems/number-line.js.map +1 -1
  132. package/dist/systems/number-plane.d.ts +92 -31
  133. package/dist/systems/number-plane.d.ts.map +1 -1
  134. package/dist/systems/number-plane.js +142 -149
  135. package/dist/systems/number-plane.js.map +1 -1
  136. package/dist/systems/polar-plane.d.ts +47 -26
  137. package/dist/systems/polar-plane.d.ts.map +1 -1
  138. package/dist/systems/polar-plane.js +107 -133
  139. package/dist/systems/polar-plane.js.map +1 -1
  140. package/dist/tex/index.d.ts.map +1 -1
  141. package/dist/tex/index.js +1 -0
  142. package/dist/tex/index.js.map +1 -1
  143. package/dist/tex/matrix.d.ts +56 -18
  144. package/dist/tex/matrix.d.ts.map +1 -1
  145. package/dist/tex/matrix.js +33 -50
  146. package/dist/tex/matrix.js.map +1 -1
  147. package/dist/tex/node.d.ts +55 -201
  148. package/dist/tex/node.d.ts.map +1 -1
  149. package/dist/tex/node.js +23 -593
  150. package/dist/tex/node.js.map +1 -1
  151. package/dist/tex/typeset.d.ts +133 -0
  152. package/dist/tex/typeset.d.ts.map +1 -0
  153. package/dist/tex/typeset.js +403 -0
  154. package/dist/tex/typeset.js.map +1 -0
  155. package/dist/three/axes3d.d.ts +140 -54
  156. package/dist/three/axes3d.d.ts.map +1 -1
  157. package/dist/three/axes3d.js +159 -204
  158. package/dist/three/axes3d.js.map +1 -1
  159. package/dist/three/curve-plot3d.d.ts +70 -42
  160. package/dist/three/curve-plot3d.d.ts.map +1 -1
  161. package/dist/three/curve-plot3d.js +97 -132
  162. package/dist/three/curve-plot3d.js.map +1 -1
  163. package/dist/three/entries.d.ts +17 -0
  164. package/dist/three/entries.d.ts.map +1 -0
  165. package/dist/three/entries.js +15 -0
  166. package/dist/three/entries.js.map +1 -0
  167. package/dist/three/plot-point3d.d.ts +57 -12
  168. package/dist/three/plot-point3d.d.ts.map +1 -1
  169. package/dist/three/plot-point3d.js +27 -53
  170. package/dist/three/plot-point3d.js.map +1 -1
  171. package/dist/three/space.d.ts +17 -2
  172. package/dist/three/space.d.ts.map +1 -1
  173. package/dist/three/space.js +19 -8
  174. package/dist/three/space.js.map +1 -1
  175. package/dist/three/surface-plot3d.d.ts +131 -49
  176. package/dist/three/surface-plot3d.d.ts.map +1 -1
  177. package/dist/three/surface-plot3d.js +227 -261
  178. package/dist/three/surface-plot3d.js.map +1 -1
  179. package/dist/three/vector-arrow3d.d.ts +58 -16
  180. package/dist/three/vector-arrow3d.d.ts.map +1 -1
  181. package/dist/three/vector-arrow3d.js +48 -67
  182. package/dist/three/vector-arrow3d.js.map +1 -1
  183. package/package.json +4 -4
  184. package/src/annotate/angle-mark.ts +95 -105
  185. package/src/annotate/curly-brace.ts +107 -85
  186. package/src/annotate/emphasis-mark.ts +55 -26
  187. package/src/engine.ts +35 -21
  188. package/src/kit/component.ts +57 -0
  189. package/src/kit/curve.ts +38 -20
  190. package/src/kit/field-mark.ts +124 -108
  191. package/src/kit/follow.ts +146 -120
  192. package/src/kit/furniture.ts +6 -1
  193. package/src/kit/graph.ts +116 -0
  194. package/src/kit/mark.ts +135 -114
  195. package/src/kit/place.ts +32 -56
  196. package/src/kit/system.ts +77 -71
  197. package/src/kit/withdrawn.ts +3 -3
  198. package/src/marks/curve-area.ts +65 -65
  199. package/src/marks/drop-lines.ts +50 -42
  200. package/src/marks/plot-point.ts +77 -82
  201. package/src/marks/riemann-sum.ts +73 -72
  202. package/src/marks/tangent-line.ts +87 -71
  203. package/src/marks/vector-arrow.ts +73 -73
  204. package/src/nodes.ts +41 -5
  205. package/src/plots/function-plot.ts +155 -171
  206. package/src/plots/points-plot.ts +46 -50
  207. package/src/plots/stream-lines.ts +75 -66
  208. package/src/plots/traced-path.ts +51 -33
  209. package/src/plots/vector-field.ts +68 -49
  210. package/src/structures/network-graph.ts +168 -185
  211. package/src/structures/sample-space.ts +149 -148
  212. package/src/systems/axes2d.ts +165 -156
  213. package/src/systems/number-line.ts +91 -92
  214. package/src/systems/number-plane.ts +149 -120
  215. package/src/systems/polar-plane.ts +117 -116
  216. package/src/tex/index.ts +2 -1
  217. package/src/tex/matrix.ts +62 -40
  218. package/src/tex/node.ts +54 -621
  219. package/src/tex/typeset.ts +461 -0
  220. package/src/three/axes3d.ts +182 -161
  221. package/src/three/curve-plot3d.ts +107 -110
  222. package/src/three/entries.ts +42 -0
  223. package/src/three/plot-point3d.ts +42 -45
  224. package/src/three/space.ts +34 -9
  225. package/src/three/surface-plot3d.ts +312 -323
  226. package/src/three/vector-arrow3d.ts +65 -54
  227. package/dist/browser/chunks/chunk-3GJB6AVO.js +0 -2
  228. package/dist/browser/chunks/chunk-3GJB6AVO.js.map +0 -7
  229. package/dist/browser/chunks/chunk-D5WHCVBC.js +0 -2
  230. package/dist/browser/chunks/chunk-D5WHCVBC.js.map +0 -7
  231. package/dist/browser/chunks/chunk-WL4KEX7Y.js +0 -2
  232. package/dist/browser/chunks/chunk-WL4KEX7Y.js.map +0 -7
  233. package/src/kit/placement.ts +0 -8
@@ -1,4 +1,4 @@
1
- import { Graphics3D, Mesh3D, type AssetScope, type Color, type Geometry3D, type Mesh3DProps, type NodeConfig } from "@motionscript/sdk";
1
+ import { type Color, type Mesh3DProps, type NodeOf, type Blend3D as _Blend3D, type Faces3D as _Faces3D, type Fill3D as _Fill3D, type Geometry3D as _Geometry3D, type Material3D as _Material3D, type Node3D as _Node3D, type Node3DProps as _Node3DProps, type NormalizedColor as _NormalizedColor, type Shading3D as _Shading3D, type Texture3D as _Texture3D } from "@motionscript/sdk";
2
2
  export interface PlotPoint3dProps extends Mesh3DProps {
3
3
  radius?: number;
4
4
  label?: string;
@@ -10,17 +10,62 @@ export interface PlotPoint3dProps extends Mesh3DProps {
10
10
  * A dot at graph coordinates in a 3D graph, with an optional label. Put inside
11
11
  * a surface it rides it: its `x` and `y` say where, and its height is the surface's.
12
12
  */
13
- export declare class PlotPoint3d extends Mesh3D<PlotPoint3dProps> {
13
+ export declare const PlotPoint3d: import("@motionscript/sdk").Component<"plotPoint3d", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Transform3DState, {
14
14
  /** In scene units, so a point is the same size whatever the axes show. */
15
- radius: number;
16
- label: string;
15
+ readonly radius: import("@motionscript/sdk").Type<number, number, false>;
16
+ readonly label: import("@motionscript/sdk").Type<string, string, false>;
17
17
  /** The height of the label's text, in scene units. */
18
- labelSize: number;
19
- labelColor: Color;
20
- fontFamily: string;
21
- constructor(props?: NodeConfig<PlotPoint3d, PlotPoint3dProps>);
22
- declareAssets(assets: AssetScope): void;
23
- protected buildGeometry(): Geometry3D | undefined;
24
- protected buildGraphics3D(): Graphics3D;
25
- }
18
+ readonly labelSize: import("@motionscript/sdk").Type<number, number, false>;
19
+ readonly labelColor: import("@motionscript/sdk").Type<Color, _NormalizedColor, false>;
20
+ readonly fontFamily: import("@motionscript/sdk").Type<string, string, false>;
21
+ readonly fill: import("@motionscript/sdk").Type<_Fill3D, _Fill3D, false>;
22
+ readonly opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
23
+ readonly blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
24
+ readonly geometry: import("@motionscript/sdk").Type<_Geometry3D | undefined, _Geometry3D | undefined, false>;
25
+ readonly material: import("@motionscript/sdk").Type<_Material3D | readonly _Material3D[] | undefined, _Material3D | readonly _Material3D[] | undefined, false>;
26
+ readonly roughness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
27
+ readonly metalness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
28
+ readonly emission: import("@motionscript/sdk").Type<Color | undefined, _NormalizedColor | undefined, false>;
29
+ readonly emissionStrength: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
30
+ readonly normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
31
+ readonly roughnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
32
+ readonly metalnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
33
+ readonly aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
34
+ readonly alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
35
+ readonly envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
36
+ readonly wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
37
+ readonly shading: import("@motionscript/sdk").Type<_Shading3D | undefined, _Shading3D | undefined, false>;
38
+ readonly faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
39
+ readonly vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
40
+ readonly unlit: import("@motionscript/sdk").Type<boolean, boolean, false>;
41
+ }>, {}, null, _Node3D<_Node3DProps>, import("@motionscript/sdk").CallProps3D<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Transform3DState, {
42
+ /** In scene units, so a point is the same size whatever the axes show. */
43
+ readonly radius: import("@motionscript/sdk").Type<number, number, false>;
44
+ readonly label: import("@motionscript/sdk").Type<string, string, false>;
45
+ /** The height of the label's text, in scene units. */
46
+ readonly labelSize: import("@motionscript/sdk").Type<number, number, false>;
47
+ readonly labelColor: import("@motionscript/sdk").Type<Color, _NormalizedColor, false>;
48
+ readonly fontFamily: import("@motionscript/sdk").Type<string, string, false>;
49
+ readonly fill: import("@motionscript/sdk").Type<_Fill3D, _Fill3D, false>;
50
+ readonly opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
51
+ readonly blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
52
+ readonly geometry: import("@motionscript/sdk").Type<_Geometry3D | undefined, _Geometry3D | undefined, false>;
53
+ readonly material: import("@motionscript/sdk").Type<_Material3D | readonly _Material3D[] | undefined, _Material3D | readonly _Material3D[] | undefined, false>;
54
+ readonly roughness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
55
+ readonly metalness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
56
+ readonly emission: import("@motionscript/sdk").Type<Color | undefined, _NormalizedColor | undefined, false>;
57
+ readonly emissionStrength: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
58
+ readonly normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
59
+ readonly roughnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
60
+ readonly metalnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
61
+ readonly aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
62
+ readonly alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
63
+ readonly envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
64
+ readonly wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
65
+ readonly shading: import("@motionscript/sdk").Type<_Shading3D | undefined, _Shading3D | undefined, false>;
66
+ readonly faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
67
+ readonly vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
68
+ readonly unlit: import("@motionscript/sdk").Type<boolean, boolean, false>;
69
+ }>>>;
70
+ export type PlotPoint3d = NodeOf<typeof PlotPoint3d>;
26
71
  //# sourceMappingURL=plot-point3d.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plot-point3d.d.ts","sourceRoot":"","sources":["../../src/three/plot-point3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,UAAU,EACV,MAAM,EAGN,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EAClB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,qBAOa,WAAY,SAAQ,MAAM,CAAC,gBAAgB,CAAC;IACrD,0EAA0E;IAClB,MAAM,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACpE,sDAAsD;IACM,SAAS,EAAE,MAAM,CAAC;IAC/B,UAAU,EAAE,KAAK,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;gBAE7D,KAAK,CAAC,EAAE,UAAU,CAAC,WAAW,EAAE,gBAAgB,CAAC;IAIpD,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;cAK7B,aAAa,IAAI,UAAU,GAAG,SAAS;cAIvC,eAAe,IAAI,UAAU;CASnD"}
1
+ {"version":3,"file":"plot-point3d.d.ts","sourceRoot":"","sources":["../../src/three/plot-point3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,MAAM,EAEX,KAAK,OAAO,IAAI,QAAQ,EAExB,KAAK,OAAO,IAAI,QAAQ,EACxB,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,UAAU,IAAI,WAAW,EAC9B,KAAK,UAAU,IAAI,WAAW,EAC9B,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,eAAe,IAAI,gBAAgB,EACxC,KAAK,SAAS,IAAI,UAAU,EAC5B,KAAK,SAAS,IAAI,UAAU,EAC/B,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW;IAIhB,0EAA0E;;;IAG1E,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;IAHtD,0EAA0E;;;IAG1E,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;IAiB5D,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -1,60 +1,34 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { colorProperty, Geo, Mesh3D, node, property, } from "@motionscript/sdk";
1
+ import { component3d, Geo, Material, Types, } from "@motionscript/sdk";
2
+ import { meshEntries } from "./entries.js";
8
3
  import { drawLabel3D } from "./label3d.js";
9
4
  /**
10
5
  * A dot at graph coordinates in a 3D graph, with an optional label. Put inside
11
6
  * a surface it rides it: its `x` and `y` say where, and its height is the surface's.
12
7
  */
13
- let PlotPoint3d = class PlotPoint3d extends Mesh3D {
14
- constructor(props) {
15
- super(props ?? {});
16
- }
17
- declareAssets(assets) {
18
- super.declareAssets(assets);
19
- if (this.fontFamily !== "")
20
- assets.font(this.fontFamily);
21
- }
22
- buildGeometry() {
23
- return this.radius > 0 ? Geo.sphere({ radius: this.radius, segments: [24, 16] }) : undefined;
24
- }
25
- buildGraphics3D() {
26
- const g3 = super.buildGraphics3D();
27
- drawLabel3D(g3, this.label, { x: 0, y: this.radius + this.labelSize * 0.85, z: 0 }, {
28
- size: this.labelSize,
29
- color: this.labelColor,
30
- fontFamily: this.fontFamily,
8
+ export const PlotPoint3d = component3d({
9
+ key: "plotPoint3d",
10
+ state: {
11
+ ...meshEntries,
12
+ /** In scene units, so a point is the same size whatever the axes show. */
13
+ radius: Types.number(0.1, { min: 0, step: 0.01 }),
14
+ label: Types.text("", { animatable: false }),
15
+ /** The height of the label's text, in scene units. */
16
+ labelSize: Types.number(0.26, { min: 0.01, step: 0.01 }),
17
+ labelColor: Types.color("#e5e7eb"),
18
+ fontFamily: Types.text("", { animatable: false }),
19
+ },
20
+ load: (loader, s) => {
21
+ if (s.fontFamily !== "")
22
+ loader.font(s.fontFamily);
23
+ },
24
+ render: (ctx, s) => {
25
+ const g3 = Material.mesh(s, s.radius > 0 ? Geo.sphere({ radius: s.radius, segments: [24, 16] }) : undefined);
26
+ drawLabel3D(g3, s.label, { x: 0, y: s.radius + s.labelSize * 0.85, z: 0 }, {
27
+ size: s.labelSize,
28
+ color: s.labelColor,
29
+ fontFamily: s.fontFamily,
31
30
  });
32
- return g3;
33
- }
34
- };
35
- __decorate([
36
- property({ default: 0.1, min: 0, step: 0.01 })
37
- ], PlotPoint3d.prototype, "radius", void 0);
38
- __decorate([
39
- property({ default: "", animatable: false })
40
- ], PlotPoint3d.prototype, "label", void 0);
41
- __decorate([
42
- property({ default: 0.26, min: 0.01, step: 0.01 })
43
- ], PlotPoint3d.prototype, "labelSize", void 0);
44
- __decorate([
45
- colorProperty({ default: "#e5e7eb" })
46
- ], PlotPoint3d.prototype, "labelColor", void 0);
47
- __decorate([
48
- property({ default: "", animatable: false })
49
- ], PlotPoint3d.prototype, "fontFamily", void 0);
50
- PlotPoint3d = __decorate([
51
- node({
52
- key: "plotPoint3d",
53
- within: ["axes3d", "surfacePlot3d"],
54
- forkable: true,
55
- layout: { acceptsChildren: false },
56
- seed: { fill: "#facc15" },
57
- })
58
- ], PlotPoint3d);
59
- export { PlotPoint3d };
31
+ ctx.draw(g3);
32
+ },
33
+ });
60
34
  //# sourceMappingURL=plot-point3d.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plot-point3d.js","sourceRoot":"","sources":["../../src/three/plot-point3d.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACH,aAAa,EACb,GAAG,EAEH,MAAM,EACN,IAAI,EACJ,QAAQ,GAMX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAUxC;;;GAGG;AAQI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,MAAwB;IASrD,YAAY,KAAiD;QACzD,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IACvB,CAAC;IAEQ,aAAa,CAAC,MAAkB;QACrC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC5B,IAAI,IAAI,CAAC,UAAU,KAAK,EAAE;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEkB,aAAa;QAC5B,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjG,CAAC;IAEkB,eAAe;QAC9B,MAAM,EAAE,GAAG,KAAK,CAAC,eAAe,EAAE,CAAC;QACnC,WAAW,C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\n type NodeConfig,\r\n} from \"@motionscript/sdk\";\r\nimport { drawLabel3D } from \"./label3d\";\r\n\r\nexport interface PlotPoint3dProps extends Mesh3DProps {\r\n radius?: number;\r\n label?: string;\r\n labelSize?: number;\r\n labelColor?: Color;\r\n fontFamily?: string;\r\n}\r\n\r\n/**\r\n * A dot at graph coordinates in a 3D graph, with an optional label. Put inside\r\n * a surface it rides it: its `x` and `y` say where, and its height is the surface's.\r\n */\r\n@node({\r\n key: \"plotPoint3d\",\r\n within: [\"axes3d\", \"surfacePlot3d\"],\r\n forkable: true,\r\n layout: { acceptsChildren: false },\r\n seed: { fill: \"#facc15\" },\r\n})\r\nexport class PlotPoint3d extends Mesh3D<PlotPoint3dProps> {\r\n /** In scene units, so a point is the same size whatever the axes show. */\r\n @property({ default: 0.1, min: 0, step: 0.01 }) declare radius: number;\r\n @property({ default: \"\", animatable: false }) declare label: string;\r\n /** The height of the label's text, in scene units. */\r\n @property({ default: 0.26, min: 0.01, step: 0.01 }) declare labelSize: number;\r\n @colorProperty({ default: \"#e5e7eb\" }) declare labelColor: Color;\r\n @property({ default: \"\", animatable: false }) declare fontFamily: string;\r\n\r\n constructor(props?: NodeConfig<PlotPoint3d, PlotPoint3dProps>) {\r\n super(props ?? {});\r\n }\r\n\r\n override declareAssets(assets: AssetScope): void {\r\n super.declareAssets(assets);\r\n if (this.fontFamily !== \"\") assets.font(this.fontFamily);\r\n }\r\n\r\n protected override buildGeometry(): Geometry3D | undefined {\r\n return this.radius > 0 ? Geo.sphere({ radius: this.radius, segments: [24, 16] }) : undefined;\r\n }\r\n\r\n protected override buildGraphics3D(): Graphics3D {\r\n const g3 = super.buildGraphics3D();\r\n drawLabel3D(g3, this.label, { x: 0, y: this.radius + this.labelSize * 0.85, z: 0 }, {\r\n size: this.labelSize,\r\n color: this.labelColor,\r\n fontFamily: this.fontFamily,\r\n });\r\n return g3;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"plot-point3d.js","sourceRoot":"","sources":["../../src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,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC7G,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,SAAS,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;YACvE,IAAI,EAAE,CAAC,CAAC,SAAS;YACjB,KAAK,EAAE,CAAC,CAAC,UAAU;YACnB,UAAU,EAAE,CAAC,CAAC,UAAU;SAC3B,CAAC,CAAC;QACH,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;CACJ,CAAC,CAAC","sourcesContent":["import {\r\n component3d,\r\n Geo,\r\n Material,\r\n Types,\r\n type Color,\r\n type Mesh3DProps,\r\n type NodeOf,\r\n // Named so the emitted declaration reaches these through the sdk, not core.\r\n type Blend3D as _Blend3D,\r\n type Color as _Color,\r\n type Faces3D as _Faces3D,\r\n type Fill3D as _Fill3D,\r\n type Geometry3D as _Geometry3D,\r\n type Material3D as _Material3D,\r\n type Node3D as _Node3D,\r\n type Node3DProps as _Node3DProps,\r\n type NormalizedColor as _NormalizedColor,\r\n type Shading3D as _Shading3D,\r\n type Texture3D as _Texture3D,\r\n} from \"@motionscript/sdk\";\r\nimport { meshEntries } from \"./entries\";\r\nimport { drawLabel3D } from \"./label3d\";\r\n\r\nexport interface PlotPoint3dProps extends Mesh3DProps {\r\n radius?: number;\r\n label?: string;\r\n labelSize?: number;\r\n labelColor?: Color;\r\n fontFamily?: string;\r\n}\r\n\r\n/**\r\n * A dot at graph coordinates in a 3D graph, with an optional label. Put inside\r\n * a surface it rides it: its `x` and `y` say where, and its height is the surface's.\r\n */\r\nexport const PlotPoint3d = component3d({\r\n key: \"plotPoint3d\",\r\n state: {\r\n ...meshEntries,\r\n /** In scene units, so a point is the same size whatever the axes show. */\r\n radius: Types.number(0.1, { min: 0, step: 0.01 }),\r\n label: Types.text(\"\", { animatable: false }),\r\n /** The height of the label's text, in scene units. */\r\n labelSize: Types.number(0.26, { min: 0.01, step: 0.01 }),\r\n labelColor: Types.color(\"#e5e7eb\"),\r\n fontFamily: Types.text(\"\", { animatable: false }),\r\n },\r\n load: (loader, s) => {\r\n if (s.fontFamily !== \"\") loader.font(s.fontFamily);\r\n },\r\n render: (ctx, s) => {\r\n const g3 = Material.mesh(s, s.radius > 0 ? Geo.sphere({ radius: s.radius, segments: [24, 16] }) : undefined);\r\n drawLabel3D(g3, s.label, { x: 0, y: s.radius + s.labelSize * 0.85, z: 0 }, {\r\n size: s.labelSize,\r\n color: s.labelColor,\r\n fontFamily: s.fontFamily,\r\n });\r\n ctx.draw(g3);\r\n },\r\n});\r\n\r\nexport type PlotPoint3d = NodeOf<typeof PlotPoint3d>;\r\n"]}
@@ -1,4 +1,4 @@
1
- import { Node3D, type ChildSpace3D, type Vector3 } from "@motionscript/sdk";
1
+ import { type ChildSpace3D, type Node3D, type Type, type Vector3, type Context as _Context } from "@motionscript/sdk";
2
2
  import type { Interval } from "../kit/coords.js";
3
3
  /**
4
4
  * A 3D graph's coordinates, as its axes' local space sees them. A graph is
@@ -16,7 +16,22 @@ export interface GraphSpace extends ChildSpace3D {
16
16
  }
17
17
  /** The space of a box `lengths` on a side, in scene units, showing the three ranges, centred on its node. */
18
18
  export declare function graphSpace(xRange: Interval, yRange: Interval, zRange: Interval, lengths: Vector3): GraphSpace;
19
- /** The graph a 3D mark is drawn in: its nearest ancestor that has one, up to and including the viewport. */
19
+ /** A 3D graph, as the marks inside it see it: its coordinates as they stand now. */
20
+ export interface Graph3D {
21
+ space(): GraphSpace;
22
+ }
23
+ /** The graph a mark is inside: `axes3d` provides itself to everything in it. */
24
+ export declare const GRAPH_3D: _Context<Graph3D | null>;
25
+ /**
26
+ * The entry a mark reads the graph it is drawn in through, set from the nearest
27
+ * `axes3d` above it, through any 3D node between; `null` outside one.
28
+ */
29
+ export declare function graphEntry(): Type<Graph3D | null, Graph3D | null, true>;
30
+ /** The graph space a mark with a {@link graphEntry} is drawn in, or `null` outside a graph. */
31
+ export declare function graphOf(mark: {
32
+ readonly graph: Graph3D | null;
33
+ }): GraphSpace | null;
34
+ /** The graph a 3D node is drawn in: what the nearest `axes3d` above it provides, once it is in the tree. */
20
35
  export declare function spaceOf(mark: Node3D): GraphSpace | null;
21
36
  /** A unit quaternion turning the scene's +y, the way a cylinder or a cone points, onto `direction`. */
22
37
  export declare function aim(direction: Vector3): {
@@ -1 +1 @@
1
- {"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../src/three/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC5C,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wGAAwG;IACxG,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACpD;AAED,6GAA6G;AAC7G,wBAAgB,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,CAe7G;AAWD,4GAA4G;AAC5G,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAMvD;AAED,uGAAuG;AACvG,wBAAgB,GAAG,CAAC,SAAS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,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,GAAG,UAAU,GAAG,IAAI,CAEnF;AAED,4GAA4G;AAC5G,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAEvD;AAED,uGAAuG;AACvG,wBAAgB,GAAG,CAAC,SAAS,EAAE,OAAO,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAWtF"}
@@ -1,4 +1,4 @@
1
- import { Node3D } from "@motionscript/sdk";
1
+ import { createContext, Types, } from "@motionscript/sdk";
2
2
  /** The space of a box `lengths` on a side, in scene units, showing the three ranges, centred on its node. */
3
3
  export function graphSpace(xRange, yRange, zRange, lengths) {
4
4
  const ux = unit(xRange, lengths.x);
@@ -20,14 +20,25 @@ function unit([min, max], length) {
20
20
  const span = max - min;
21
21
  return span > 0 ? length / span : 0;
22
22
  }
23
- /** The graph a 3D mark is drawn in: its nearest ancestor that has one, up to and including the viewport. */
23
+ /** The graph a mark is inside: `axes3d` provides itself to everything in it. */
24
+ export const GRAPH_3D = createContext(null, "math:graph3d");
25
+ /**
26
+ * The entry a mark reads the graph it is drawn in through, set from the nearest
27
+ * `axes3d` above it, through any 3D node between; `null` outside one.
28
+ */
29
+ export function graphEntry() {
30
+ return Types.custom(null, {
31
+ private: true,
32
+ inherit: (use) => use(GRAPH_3D),
33
+ });
34
+ }
35
+ /** The graph space a mark with a {@link graphEntry} is drawn in, or `null` outside a graph. */
36
+ export function graphOf(mark) {
37
+ return mark.graph?.space() ?? null;
38
+ }
39
+ /** The graph a 3D node is drawn in: what the nearest `axes3d` above it provides, once it is in the tree. */
24
40
  export function spaceOf(mark) {
25
- for (let at = mark.parent; at; at = at instanceof Node3D ? at.parent : null) {
26
- const spaced = at;
27
- if (typeof spaced._graphSpace === "function")
28
- return spaced._graphSpace();
29
- }
30
- return null;
41
+ return mark.useContext(GRAPH_3D)?.space() ?? null;
31
42
  }
32
43
  /** A unit quaternion turning the scene's +y, the way a cylinder or a cone points, onto `direction`. */
33
44
  export function aim(direction) {
@@ -1 +1 @@
1
- {"version":3,"file":"space.js","sourceRoot":"","sources":["../../src/three/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAmC,MAAM,mBAAmB,CAAC;AAkB5E,6GAA6G;AAC7G,MAAM,UAAU,UAAU,CAAC,MAAgB,EAAE,MAAgB,EAAE,MAAgB,EAAE,OAAgB;IAC7F,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO;QACH,MAAM;QACN,MAAM;QACN,MAAM;QACN,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC7E,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAA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CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACrD,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC;IAChC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC;IAChC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC;IAChC,sFAAsF;IACtF,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI;QAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACjB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACnC,OAAO,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC;AAC9D,CAAC","sourcesContent":["import { Node3D, type ChildSpace3D, type Vector3 } from \"@motionscript/sdk\";\r\nimport type { Interval } from \"../kit/coords\";\r\n\r\n/**\r\n * A 3D graph's coordinates, as its axes' local space sees them. A graph is\r\n * right-handed with z up, and the scene has y up, so graph x, y and z run along\r\n * the scene's z, x and y: looked at head-on, y is to the right and z is up.\r\n */\r\nexport interface GraphSpace extends ChildSpace3D {\r\n readonly xRange: Interval;\r\n readonly yRange: Interval;\r\n readonly zRange: Interval;\r\n /** Changes exactly when the mapping does: what a mark's geometry is cached under. */\r\n readonly revision: string;\r\n /** A step from one graph point to another, as the local one: what a mark's own geometry is drawn in. */\r\n offset(x: number, y: number, z: number): Vector3;\r\n}\r\n\r\n/** The space of a box `lengths` on a side, in scene units, showing the three ranges, centred on its node. */\r\nexport function graphSpace(xRange: Interval, yRange: Interval, zRange: Interval, lengths: Vector3): GraphSpace {\r\n const ux = unit(xRange, lengths.x);\r\n const uy = unit(yRange, lengths.y);\r\n const uz = unit(zRange, lengths.z);\r\n const cx = (xRange[0] + xRange[1]) / 2;\r\n const cy = (yRange[0] + yRange[1]) / 2;\r\n const cz = (zRange[0] + zRange[1]) / 2;\r\n return {\r\n xRange,\r\n yRange,\r\n zRange,\r\n revision: [xRange, yRange, zRange, lengths.x, lengths.y, lengths.z].join(\"|\"),\r\n toLocal: (x, y, z) => ({ x: (y - cy) * uy, y: (z - cz) * uz, z: (x - cx) * ux }),\r\n offset: (x, y, z) => ({ x: y * uy, y: z * uz, z: x * ux }),\r\n };\r\n}\r\n\r\nfunction unit([min, max]: Interval, length: number): number {\r\n const span = max - min;\r\n return span > 0 ? length / span : 0;\r\n}\r\n\r\ninterface Spaced {\r\n _graphSpace(): GraphSpace;\r\n}\r\n\r\n/** The graph a 3D mark is drawn in: its nearest ancestor that has one, up to and including the viewport. */\r\nexport function spaceOf(mark: Node3D): GraphSpace | null {\r\n for (let at = mark.parent; at; at = at instanceof Node3D ? at.parent : null) {\r\n const spaced = at as Partial<Spaced>;\r\n if (typeof spaced._graphSpace === \"function\") return spaced._graphSpace();\r\n }\r\n return null;\r\n}\r\n\r\n/** A unit quaternion turning the scene's +y, the way a cylinder or a cone points, onto `direction`. */\r\nexport function aim(direction: Vector3): { x: number; y: number; z: number; w: number } {\r\n const length = Math.hypot(direction.x, direction.y, direction.z);\r\n if (!(length > 0)) return { x: 0, y: 0, z: 0, w: 1 };\r\n const dx = direction.x / length;\r\n const dy = direction.y / length;\r\n const dz = direction.z / length;\r\n // Straight down is the one turn with no single axis: any in the ground plane will do.\r\n if (dy < -1 + 1e-9) return { x: 1, y: 0, z: 0, w: 0 };\r\n const w = 1 + dy;\r\n const norm = Math.hypot(dz, dx, w);\r\n return { x: dz / norm, y: 0, z: -dx / norm, w: w / norm };\r\n}\r\n"]}
1
+ {"version":3,"file":"space.js","sourceRoot":"","sources":["../../src/three/space.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,KAAK,GAOR,MAAM,mBAAmB,CAAC;AAkB3B,6GAA6G;AAC7G,MAAM,UAAU,UAAU,CAAC,MAAgB,EAAE,MAAgB,EAAE,MAAgB,EAAE,OAAgB;IAC7F,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO;QACH,MAAM;QACN,MAAM;QACN,MAAM;QACN,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC7E,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,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,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACjE,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACrD,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC;IAChC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC;IAChC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC;IAChC,sFAAsF;IACtF,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI;QAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACjB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACnC,OAAO,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC;AAC9D,CAAC","sourcesContent":["import {\r\n createContext,\r\n Types,\r\n type ChildSpace3D,\r\n type Node3D,\r\n type Type,\r\n type Vector3,\r\n // Named so the emitted declaration reaches these through the sdk, not core.\r\n type Context as _Context,\r\n} from \"@motionscript/sdk\";\r\nimport type { Interval } from \"../kit/coords\";\r\n\r\n/**\r\n * A 3D graph's coordinates, as its axes' local space sees them. A graph is\r\n * right-handed with z up, and the scene has y up, so graph x, y and z run along\r\n * the scene's z, x and y: looked at head-on, y is to the right and z is up.\r\n */\r\nexport interface GraphSpace extends ChildSpace3D {\r\n readonly xRange: Interval;\r\n readonly yRange: Interval;\r\n readonly zRange: Interval;\r\n /** Changes exactly when the mapping does: what a mark's geometry is cached under. */\r\n readonly revision: string;\r\n /** A step from one graph point to another, as the local one: what a mark's own geometry is drawn in. */\r\n offset(x: number, y: number, z: number): Vector3;\r\n}\r\n\r\n/** The space of a box `lengths` on a side, in scene units, showing the three ranges, centred on its node. */\r\nexport function graphSpace(xRange: Interval, yRange: Interval, zRange: Interval, lengths: Vector3): GraphSpace {\r\n const ux = unit(xRange, lengths.x);\r\n const uy = unit(yRange, lengths.y);\r\n const uz = unit(zRange, lengths.z);\r\n const cx = (xRange[0] + xRange[1]) / 2;\r\n const cy = (yRange[0] + yRange[1]) / 2;\r\n const cz = (zRange[0] + zRange[1]) / 2;\r\n return {\r\n xRange,\r\n yRange,\r\n zRange,\r\n revision: [xRange, yRange, zRange, lengths.x, lengths.y, lengths.z].join(\"|\"),\r\n toLocal: (x, y, z) => ({ x: (y - cy) * uy, y: (z - cz) * uz, z: (x - cx) * ux }),\r\n offset: (x, y, z) => ({ x: y * uy, y: z * uz, z: x * ux }),\r\n };\r\n}\r\n\r\nfunction unit([min, max]: Interval, length: number): number {\r\n const span = max - min;\r\n return span > 0 ? length / span : 0;\r\n}\r\n\r\n/** A 3D graph, as the marks inside it see it: its coordinates as they stand now. */\r\nexport interface Graph3D {\r\n space(): GraphSpace;\r\n}\r\n\r\n/** The graph a mark is inside: `axes3d` provides itself to everything in it. */\r\nexport const GRAPH_3D = createContext<Graph3D | null>(null, \"math:graph3d\");\r\n\r\n/**\r\n * The entry a mark reads the graph it is drawn in through, set from the nearest\r\n * `axes3d` above it, through any 3D node between; `null` outside one.\r\n */\r\nexport function graphEntry(): Type<Graph3D | null, Graph3D | null, true> {\r\n return Types.custom<Graph3D | null, Graph3D | null, { readonly private: true }>(null, {\r\n private: true,\r\n inherit: (use) => use(GRAPH_3D),\r\n });\r\n}\r\n\r\n/** The graph space a mark with a {@link graphEntry} is drawn in, or `null` outside a graph. */\r\nexport function graphOf(mark: { readonly graph: Graph3D | null }): GraphSpace | null {\r\n return mark.graph?.space() ?? null;\r\n}\r\n\r\n/** The graph a 3D node is drawn in: what the nearest `axes3d` above it provides, once it is in the tree. */\r\nexport function spaceOf(mark: Node3D): GraphSpace | null {\r\n return mark.useContext(GRAPH_3D)?.space() ?? null;\r\n}\r\n\r\n/** A unit quaternion turning the scene's +y, the way a cylinder or a cone points, onto `direction`. */\r\nexport function aim(direction: Vector3): { x: number; y: number; z: number; w: number } {\r\n const length = Math.hypot(direction.x, direction.y, direction.z);\r\n if (!(length > 0)) return { x: 0, y: 0, z: 0, w: 1 };\r\n const dx = direction.x / length;\r\n const dy = direction.y / length;\r\n const dz = direction.z / length;\r\n // Straight down is the one turn with no single axis: any in the ground plane will do.\r\n if (dy < -1 + 1e-9) return { x: 1, y: 0, z: 0, w: 0 };\r\n const w = 1 + dy;\r\n const norm = Math.hypot(dz, dx, w);\r\n return { x: dz / norm, y: 0, z: -dx / norm, w: w / norm };\r\n}\r\n"]}
@@ -1,4 +1,4 @@
1
- import { Graphics3D, Mesh3D, type ChildSpace3D, type Color, type Command, type CommandArgs, type Geometry3D, type MaterialShorthand3D, type Mesh3DProps, type NodeConfig } from "@motionscript/sdk";
1
+ import { type Color, type Geometry3D, type Material3D, type Mesh3DProps, type NodeOf, type NormalizedColor, type Values, type Blend3D as _Blend3D, type Faces3D as _Faces3D, type Fill3D as _Fill3D, type Node3D as _Node3D, type Node3DProps as _Node3DProps, type Shading3D as _Shading3D, type Texture3D as _Texture3D } from "@motionscript/sdk";
2
2
  import type { Interval } from "../kit/coords.js";
3
3
  import type { ExpressionScope } from "../kit/expression.js";
4
4
  import { type PlotSource } from "../kit/source.js";
@@ -13,68 +13,150 @@ export interface SurfacePlot3dProps extends Mesh3DProps {
13
13
  meshColor?: Color;
14
14
  floorShadow?: number;
15
15
  }
16
+ declare const state: {
17
+ expression: import("@motionscript/sdk").Type<string | PlotSource, PlotSource, false>;
18
+ /**
19
+ * The span of each variable that is drawn: x and y for a height, which run
20
+ * the width of the axes when left out, u and v for a parametric surface,
21
+ * which run from 0 to 1.
22
+ */
23
+ uDomain: import("@motionscript/sdk").Type<Interval | null, Interval | null, false>;
24
+ vDomain: import("@motionscript/sdk").Type<Interval | null, Interval | null, false>;
25
+ /** The equation's named values: any name in it that is not a variable, a function or a constant. */
26
+ params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
27
+ /** How finely the surface is sampled, each way. */
28
+ segments: import("@motionscript/sdk").Type<number, number, false>;
29
+ /** Colours by height, lowest first, over the axes' z range. Empty paints the surface in its fill. */
30
+ colorScale: import("@motionscript/sdk").Type<Color[], NormalizedColor[], false>;
31
+ /** How many lines are drawn across the surface each way; zero leaves it bare. */
32
+ meshLines: import("@motionscript/sdk").Type<number, number, false>;
33
+ meshColor: import("@motionscript/sdk").Type<Color, Color, false>;
34
+ /** The opacity of the surface's shadow, laid flat on the floor of the axes and coloured by height; zero draws none. */
35
+ floorShadow: import("@motionscript/sdk").Type<number, number, false>;
36
+ graph: import("@motionscript/sdk").Type<import("./space.js").Graph3D | null, import("./space.js").Graph3D | null, true>;
37
+ fill: import("@motionscript/sdk").Type<_Fill3D, _Fill3D, false>;
38
+ opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
39
+ blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
40
+ geometry: import("@motionscript/sdk").Type<Geometry3D | undefined, Geometry3D | undefined, false>;
41
+ material: import("@motionscript/sdk").Type<Material3D | readonly Material3D[] | undefined, Material3D | readonly Material3D[] | undefined, false>;
42
+ roughness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
43
+ metalness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
44
+ emission: import("@motionscript/sdk").Type<Color | undefined, NormalizedColor | undefined, false>;
45
+ emissionStrength: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
46
+ normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
47
+ roughnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
48
+ metalnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
49
+ aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
50
+ alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
51
+ envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
52
+ wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
53
+ shading: import("@motionscript/sdk").Type<_Shading3D | undefined, _Shading3D | undefined, false>;
54
+ faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
55
+ vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
56
+ unlit: import("@motionscript/sdk").Type<boolean, boolean, false>;
57
+ };
58
+ /** What a surface is drawn from: its own entries, as its node and its helpers read them. */
59
+ export type SurfaceValues = Values<typeof state> & {
60
+ readonly x: number;
61
+ readonly y: number;
62
+ readonly z: number;
63
+ };
16
64
  /**
17
65
  * A surface in a 3D graph: a height over x and y (`sin(x) * cos(y)`), or three
18
66
  * parts in u and v. A point put inside it rides it.
19
67
  */
20
- export declare class SurfacePlot3d extends Mesh3D<SurfacePlot3dProps> {
21
- expression: PlotSource;
68
+ export declare const SurfacePlot3d: import("@motionscript/sdk").Component<"surfacePlot3d", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Transform3DState, {
69
+ expression: import("@motionscript/sdk").Type<string | PlotSource, PlotSource, false>;
22
70
  /**
23
71
  * The span of each variable that is drawn: x and y for a height, which run
24
72
  * the width of the axes when left out, u and v for a parametric surface,
25
73
  * which run from 0 to 1.
26
74
  */
27
- uDomain: Interval | null;
28
- vDomain: Interval | null;
75
+ uDomain: import("@motionscript/sdk").Type<Interval | null, Interval | null, false>;
76
+ vDomain: import("@motionscript/sdk").Type<Interval | null, Interval | null, false>;
29
77
  /** The equation's named values: any name in it that is not a variable, a function or a constant. */
30
- params: ExpressionScope;
78
+ params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
31
79
  /** How finely the surface is sampled, each way. */
32
- segments: number;
80
+ segments: import("@motionscript/sdk").Type<number, number, false>;
33
81
  /** Colours by height, lowest first, over the axes' z range. Empty paints the surface in its fill. */
34
- colorScale: Color[];
82
+ colorScale: import("@motionscript/sdk").Type<Color[], NormalizedColor[], false>;
35
83
  /** How many lines are drawn across the surface each way; zero leaves it bare. */
36
- meshLines: number;
37
- meshColor: Color;
84
+ meshLines: import("@motionscript/sdk").Type<number, number, false>;
85
+ meshColor: import("@motionscript/sdk").Type<Color, Color, false>;
38
86
  /** The opacity of the surface's shadow, laid flat on the floor of the axes and coloured by height; zero draws none. */
39
- floorShadow: number;
40
- constructor(props?: NodeConfig<SurfacePlot3d, SurfacePlot3dProps>);
41
- /** Change the equation, the surface bending from the one into the other. */
42
- morphTo(args: CommandArgs<{
43
- expression: string;
44
- }> & {
45
- duration: number;
46
- }): Command<SurfacePlot3dProps>;
47
- /** Animate the equation's named values. */
48
- paramsTo(args: CommandArgs<{
49
- params: ExpressionScope;
50
- }> & {
51
- duration: number;
52
- }): Command<SurfacePlot3dProps>;
53
- /** Animate the spans that are drawn. */
54
- domainTo(args: CommandArgs<{
55
- uDomain?: Interval | null;
56
- vDomain?: Interval | null;
57
- }> & {
58
- duration: number;
59
- }): Command<SurfacePlot3dProps>;
87
+ floorShadow: import("@motionscript/sdk").Type<number, number, false>;
88
+ graph: import("@motionscript/sdk").Type<import("./space.js").Graph3D | null, import("./space.js").Graph3D | null, true>;
89
+ fill: import("@motionscript/sdk").Type<_Fill3D, _Fill3D, false>;
90
+ opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
91
+ blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
92
+ geometry: import("@motionscript/sdk").Type<Geometry3D | undefined, Geometry3D | undefined, false>;
93
+ material: import("@motionscript/sdk").Type<Material3D | readonly Material3D[] | undefined, Material3D | readonly Material3D[] | undefined, false>;
94
+ roughness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
95
+ metalness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
96
+ emission: import("@motionscript/sdk").Type<Color | undefined, NormalizedColor | undefined, false>;
97
+ emissionStrength: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
98
+ normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
99
+ roughnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
100
+ metalnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
101
+ aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
102
+ alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
103
+ envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
104
+ wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
105
+ shading: import("@motionscript/sdk").Type<_Shading3D | undefined, _Shading3D | undefined, false>;
106
+ faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
107
+ vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
108
+ unlit: import("@motionscript/sdk").Type<boolean, boolean, false>;
109
+ }>, {
110
+ readonly morphTo: readonly ["expression"];
111
+ readonly paramsTo: readonly ["params"];
112
+ readonly domainTo: readonly ["uDomain", "vDomain"];
113
+ }, null, _Node3D<_Node3DProps>, import("@motionscript/sdk").CallProps3D<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Transform3DState, {
114
+ expression: import("@motionscript/sdk").Type<string | PlotSource, PlotSource, false>;
60
115
  /**
61
- * The surface's height above its own origin at graph `(x, y)`, or `NaN`
62
- * where it has none or is not a height. What a point riding it reads.
116
+ * The span of each variable that is drawn: x and y for a height, which run
117
+ * the width of the axes when left out, u and v for a parametric surface,
118
+ * which run from 0 to 1.
63
119
  */
64
- valueAt(x: number, y: number): number;
65
- /** @internal */
66
- _spaceOf(): ChildSpace3D | null;
67
- protected buildGeometry(): Geometry3D | undefined;
68
- protected materialShorthand(): MaterialShorthand3D;
69
- protected buildGraphics3D(): Graphics3D;
70
- private _linesKey;
71
- private _lines;
72
- private _heightOf;
73
- private _key;
74
- private _sampler;
75
- /** `source` as graph points, measured from this node's own position. */
76
- private _surface;
77
- private _floorShadow;
78
- private _meshLines;
79
- }
120
+ uDomain: import("@motionscript/sdk").Type<Interval | null, Interval | null, false>;
121
+ vDomain: import("@motionscript/sdk").Type<Interval | null, Interval | null, false>;
122
+ /** The equation's named values: any name in it that is not a variable, a function or a constant. */
123
+ params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
124
+ /** How finely the surface is sampled, each way. */
125
+ segments: import("@motionscript/sdk").Type<number, number, false>;
126
+ /** Colours by height, lowest first, over the axes' z range. Empty paints the surface in its fill. */
127
+ colorScale: import("@motionscript/sdk").Type<Color[], NormalizedColor[], false>;
128
+ /** How many lines are drawn across the surface each way; zero leaves it bare. */
129
+ meshLines: import("@motionscript/sdk").Type<number, number, false>;
130
+ meshColor: import("@motionscript/sdk").Type<Color, Color, false>;
131
+ /** The opacity of the surface's shadow, laid flat on the floor of the axes and coloured by height; zero draws none. */
132
+ floorShadow: import("@motionscript/sdk").Type<number, number, false>;
133
+ graph: import("@motionscript/sdk").Type<import("./space.js").Graph3D | null, import("./space.js").Graph3D | null, true>;
134
+ fill: import("@motionscript/sdk").Type<_Fill3D, _Fill3D, false>;
135
+ opacity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
136
+ blend: import("@motionscript/sdk").Type<_Blend3D | undefined, _Blend3D | undefined, false>;
137
+ geometry: import("@motionscript/sdk").Type<Geometry3D | undefined, Geometry3D | undefined, false>;
138
+ material: import("@motionscript/sdk").Type<Material3D | readonly Material3D[] | undefined, Material3D | readonly Material3D[] | undefined, false>;
139
+ roughness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
140
+ metalness: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
141
+ emission: import("@motionscript/sdk").Type<Color | undefined, NormalizedColor | undefined, false>;
142
+ emissionStrength: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
143
+ normalMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
144
+ roughnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
145
+ metalnessMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
146
+ aoMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
147
+ alphaMap: import("@motionscript/sdk").Type<_Texture3D | undefined, _Texture3D | undefined, false>;
148
+ envMapIntensity: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
149
+ wireframe: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
150
+ shading: import("@motionscript/sdk").Type<_Shading3D | undefined, _Shading3D | undefined, false>;
151
+ faces: import("@motionscript/sdk").Type<_Faces3D | undefined, _Faces3D | undefined, false>;
152
+ vertexColors: import("@motionscript/sdk").Type<boolean | undefined, boolean | undefined, false>;
153
+ unlit: import("@motionscript/sdk").Type<boolean, boolean, false>;
154
+ }>>>;
155
+ export type SurfacePlot3d = NodeOf<typeof SurfacePlot3d>;
156
+ /**
157
+ * The surface's height above its own origin at graph `(x, y)`, or `NaN`
158
+ * where it has none or is not a height. What a point riding it reads.
159
+ */
160
+ export declare function surfaceValueAt(surface: Pick<SurfaceValues, "expression" | "params">, x: number, y: number): number;
161
+ export {};
80
162
  //# sourceMappingURL=surface-plot3d.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