@3driseai/3drise-viewer 0.1.26 → 0.1.28

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 (476) hide show
  1. package/dist/animationsV2/ClipPlayer.d.ts +3 -0
  2. package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
  3. package/dist/animationsV2/ClipPlayer.js +67 -8
  4. package/dist/animationsV2/ClipsRuntime.d.ts +39 -0
  5. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
  6. package/dist/animationsV2/ClipsRuntime.js +245 -14
  7. package/dist/animationsV2/appliers.d.ts +5 -0
  8. package/dist/animationsV2/appliers.d.ts.map +1 -1
  9. package/dist/animationsV2/appliers.js +25 -7
  10. package/dist/animationsV2/index.d.ts +1 -1
  11. package/dist/animationsV2/index.d.ts.map +1 -1
  12. package/dist/animationsV2/normalize.d.ts.map +1 -1
  13. package/dist/animationsV2/normalize.js +18 -7
  14. package/dist/animationsV2/sequenceUtils.d.ts +42 -1
  15. package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
  16. package/dist/animationsV2/sequenceUtils.js +103 -3
  17. package/dist/animationsV2/types.d.ts +20 -0
  18. package/dist/animationsV2/types.d.ts.map +1 -1
  19. package/dist/components/AdvancedGrid.d.ts +8 -2
  20. package/dist/components/AdvancedGrid.d.ts.map +1 -1
  21. package/dist/components/AdvancedGrid.js +31 -14
  22. package/dist/components/AnimatedObject.d.ts.map +1 -1
  23. package/dist/components/AnimatedObject.js +7 -5
  24. package/dist/components/ApollonianGrid.d.ts +25 -0
  25. package/dist/components/ApollonianGrid.d.ts.map +1 -0
  26. package/dist/components/ApollonianGrid.js +80 -0
  27. package/dist/components/Bubbles.d.ts +7 -1
  28. package/dist/components/Bubbles.d.ts.map +1 -1
  29. package/dist/components/Bubbles.js +42 -22
  30. package/dist/components/ChladniGrid.d.ts +8 -4
  31. package/dist/components/ChladniGrid.d.ts.map +1 -1
  32. package/dist/components/ChladniGrid.js +31 -13
  33. package/dist/components/CircuitGrid.d.ts +8 -11
  34. package/dist/components/CircuitGrid.d.ts.map +1 -1
  35. package/dist/components/CircuitGrid.js +31 -13
  36. package/dist/components/CloudsGenerator.d.ts +1 -1
  37. package/dist/components/CloudsGenerator.js +1 -1
  38. package/dist/components/ConformalGrid.d.ts +25 -0
  39. package/dist/components/ConformalGrid.d.ts.map +1 -0
  40. package/dist/components/ConformalGrid.js +97 -0
  41. package/dist/components/ContourGrid.d.ts +8 -14
  42. package/dist/components/ContourGrid.d.ts.map +1 -1
  43. package/dist/components/ContourGrid.js +31 -13
  44. package/dist/components/EffectsGenerator.d.ts +7 -1
  45. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  46. package/dist/components/EffectsGenerator.js +39 -38
  47. package/dist/components/EnvironmentManager.d.ts +4 -4
  48. package/dist/components/EnvironmentManager.d.ts.map +1 -1
  49. package/dist/components/FlowNetGrid.d.ts +8 -4
  50. package/dist/components/FlowNetGrid.d.ts.map +1 -1
  51. package/dist/components/FlowNetGrid.js +31 -13
  52. package/dist/components/FractalGrid.d.ts +8 -12
  53. package/dist/components/FractalGrid.d.ts.map +1 -1
  54. package/dist/components/FractalGrid.js +31 -13
  55. package/dist/components/GirihGrid.d.ts +8 -1
  56. package/dist/components/GirihGrid.d.ts.map +1 -1
  57. package/dist/components/GirihGrid.js +31 -13
  58. package/dist/components/Glyphs.d.ts +7 -1
  59. package/dist/components/Glyphs.d.ts.map +1 -1
  60. package/dist/components/Glyphs.js +40 -34
  61. package/dist/components/GravWaveGrid.d.ts +8 -1
  62. package/dist/components/GravWaveGrid.d.ts.map +1 -1
  63. package/dist/components/GravWaveGrid.js +31 -13
  64. package/dist/components/GridsGenerator.d.ts +9 -3
  65. package/dist/components/GridsGenerator.d.ts.map +1 -1
  66. package/dist/components/GridsGenerator.js +41 -18
  67. package/dist/components/HexGrid.d.ts +8 -10
  68. package/dist/components/HexGrid.d.ts.map +1 -1
  69. package/dist/components/HexGrid.js +31 -13
  70. package/dist/components/HilbertGrid.d.ts +25 -0
  71. package/dist/components/HilbertGrid.d.ts.map +1 -0
  72. package/dist/components/HilbertGrid.js +93 -0
  73. package/dist/components/HyperbolicGrid.d.ts +8 -4
  74. package/dist/components/HyperbolicGrid.d.ts.map +1 -1
  75. package/dist/components/HyperbolicGrid.js +31 -13
  76. package/dist/components/LandscapeBuilder.d.ts +1 -1
  77. package/dist/components/LandscapeBuilder.d.ts.map +1 -1
  78. package/dist/components/LandscapeBuilder.js +1 -1
  79. package/dist/components/LandscapeObject.d.ts +1 -1
  80. package/dist/components/LandscapeObject.d.ts.map +1 -1
  81. package/dist/components/LandscapeObject.js +1 -1
  82. package/dist/components/LensingGrid.d.ts +25 -0
  83. package/dist/components/LensingGrid.d.ts.map +1 -0
  84. package/dist/components/LensingGrid.js +81 -0
  85. package/dist/components/MoireGrid.d.ts +8 -12
  86. package/dist/components/MoireGrid.d.ts.map +1 -1
  87. package/dist/components/MoireGrid.js +31 -13
  88. package/dist/components/ObjectNode.d.ts.map +1 -1
  89. package/dist/components/ObjectNode.js +2 -2
  90. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  91. package/dist/components/ObjectsRenderer.js +37 -3
  92. package/dist/components/OceanBuilder.d.ts +1 -1
  93. package/dist/components/OceanBuilder.js +1 -1
  94. package/dist/components/ParastichyGrid.d.ts +25 -0
  95. package/dist/components/ParastichyGrid.d.ts.map +1 -0
  96. package/dist/components/ParastichyGrid.js +82 -0
  97. package/dist/components/ParticlesGenerator.d.ts.map +1 -1
  98. package/dist/components/ParticlesGenerator.js +6 -0
  99. package/dist/components/PhyllotaxisGrid.d.ts +25 -0
  100. package/dist/components/PhyllotaxisGrid.d.ts.map +1 -0
  101. package/dist/components/PhyllotaxisGrid.js +95 -0
  102. package/dist/components/QuasiGrid.d.ts +8 -11
  103. package/dist/components/QuasiGrid.d.ts.map +1 -1
  104. package/dist/components/QuasiGrid.js +31 -13
  105. package/dist/components/RadarGrid.d.ts +8 -13
  106. package/dist/components/RadarGrid.d.ts.map +1 -1
  107. package/dist/components/RadarGrid.js +31 -13
  108. package/dist/components/ReactionDiffusionGrid.d.ts +8 -1
  109. package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
  110. package/dist/components/ReactionDiffusionGrid.js +33 -139
  111. package/dist/components/SceneBuilder.js +1 -1
  112. package/dist/components/SkySystem.d.ts +1 -1
  113. package/dist/components/SparklesBurst.d.ts +7 -1
  114. package/dist/components/SparklesBurst.d.ts.map +1 -1
  115. package/dist/components/SparklesBurst.js +31 -28
  116. package/dist/components/TerrainBuilder.d.ts +1 -1
  117. package/dist/components/TerrainBuilder.d.ts.map +1 -1
  118. package/dist/components/TerrainBuilder.js +1 -1
  119. package/dist/components/TruchetGrid.d.ts +25 -0
  120. package/dist/components/TruchetGrid.d.ts.map +1 -0
  121. package/dist/components/TruchetGrid.js +82 -0
  122. package/dist/components/VoronoiGrid.d.ts +8 -10
  123. package/dist/components/VoronoiGrid.d.ts.map +1 -1
  124. package/dist/components/VoronoiGrid.js +31 -13
  125. package/dist/components/WallpaperGrid.d.ts +8 -1
  126. package/dist/components/WallpaperGrid.d.ts.map +1 -1
  127. package/dist/components/WallpaperGrid.js +33 -210
  128. package/dist/components/effects/AuraEffect.d.ts +8 -3
  129. package/dist/components/effects/AuraEffect.d.ts.map +1 -1
  130. package/dist/components/effects/AuraEffect.js +49 -24
  131. package/dist/components/effects/AuroraEffect.d.ts +8 -3
  132. package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
  133. package/dist/components/effects/AuroraEffect.js +45 -25
  134. package/dist/components/effects/BlackHoleEffect.d.ts +8 -3
  135. package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
  136. package/dist/components/effects/BlackHoleEffect.js +42 -21
  137. package/dist/components/effects/ConstellationEffect.d.ts +8 -3
  138. package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
  139. package/dist/components/effects/ConstellationEffect.js +49 -23
  140. package/dist/components/effects/DandelionSeedsEffect.d.ts +7 -2
  141. package/dist/components/effects/DandelionSeedsEffect.d.ts.map +1 -1
  142. package/dist/components/effects/DandelionSeedsEffect.js +19 -9
  143. package/dist/components/effects/DataStreamEffect.d.ts +8 -3
  144. package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
  145. package/dist/components/effects/DataStreamEffect.js +54 -26
  146. package/dist/components/effects/DnaHelixEffect.d.ts +8 -3
  147. package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
  148. package/dist/components/effects/DnaHelixEffect.js +62 -30
  149. package/dist/components/effects/FallingLeavesEffect.d.ts +7 -2
  150. package/dist/components/effects/FallingLeavesEffect.d.ts.map +1 -1
  151. package/dist/components/effects/FallingLeavesEffect.js +19 -9
  152. package/dist/components/effects/FieldLinesEffect.d.ts +8 -3
  153. package/dist/components/effects/FieldLinesEffect.d.ts.map +1 -1
  154. package/dist/components/effects/FieldLinesEffect.js +30 -20
  155. package/dist/components/effects/Fire.d.ts +8 -3
  156. package/dist/components/effects/Fire.d.ts.map +1 -1
  157. package/dist/components/effects/Fire.js +47 -10
  158. package/dist/components/effects/FireflySwarmEffect.d.ts +7 -2
  159. package/dist/components/effects/FireflySwarmEffect.d.ts.map +1 -1
  160. package/dist/components/effects/FireflySwarmEffect.js +19 -9
  161. package/dist/components/effects/Flares.d.ts +10 -3
  162. package/dist/components/effects/Flares.d.ts.map +1 -1
  163. package/dist/components/effects/Flares.js +53 -56
  164. package/dist/components/effects/ForcefieldEffect.d.ts +8 -3
  165. package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
  166. package/dist/components/effects/ForcefieldEffect.js +52 -33
  167. package/dist/components/effects/GalaxyEffect.d.ts +7 -2
  168. package/dist/components/effects/GalaxyEffect.d.ts.map +1 -1
  169. package/dist/components/effects/GalaxyEffect.js +19 -9
  170. package/dist/components/effects/HarmonicShellEffect.d.ts +8 -3
  171. package/dist/components/effects/HarmonicShellEffect.d.ts.map +1 -1
  172. package/dist/components/effects/HarmonicShellEffect.js +30 -22
  173. package/dist/components/effects/HologramEffect.d.ts +8 -3
  174. package/dist/components/effects/HologramEffect.d.ts.map +1 -1
  175. package/dist/components/effects/HologramEffect.js +52 -23
  176. package/dist/components/effects/IceCrystalsEffect.d.ts +8 -3
  177. package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
  178. package/dist/components/effects/IceCrystalsEffect.js +36 -21
  179. package/dist/components/effects/IceHaloEffect.d.ts +7 -2
  180. package/dist/components/effects/IceHaloEffect.d.ts.map +1 -1
  181. package/dist/components/effects/IceHaloEffect.js +19 -9
  182. package/dist/components/effects/LichtenbergEffect.d.ts +7 -2
  183. package/dist/components/effects/LichtenbergEffect.d.ts.map +1 -1
  184. package/dist/components/effects/LichtenbergEffect.js +19 -9
  185. package/dist/components/effects/LightningEffect.d.ts +8 -3
  186. package/dist/components/effects/LightningEffect.d.ts.map +1 -1
  187. package/dist/components/effects/LightningEffect.js +54 -32
  188. package/dist/components/effects/MoleculesEffect.d.ts +8 -3
  189. package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
  190. package/dist/components/effects/MoleculesEffect.js +31 -21
  191. package/dist/components/effects/MurmurationEffect.d.ts +7 -2
  192. package/dist/components/effects/MurmurationEffect.d.ts.map +1 -1
  193. package/dist/components/effects/MurmurationEffect.js +19 -9
  194. package/dist/components/effects/NeuralNetworkEffect.d.ts +8 -3
  195. package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
  196. package/dist/components/effects/NeuralNetworkEffect.js +66 -33
  197. package/dist/components/effects/OrbEffect.d.ts +8 -3
  198. package/dist/components/effects/OrbEffect.d.ts.map +1 -1
  199. package/dist/components/effects/OrbEffect.js +89 -42
  200. package/dist/components/effects/PlanetaryRingsEffect.d.ts +7 -2
  201. package/dist/components/effects/PlanetaryRingsEffect.d.ts.map +1 -1
  202. package/dist/components/effects/PlanetaryRingsEffect.js +19 -9
  203. package/dist/components/effects/PortalEffect.d.ts +8 -3
  204. package/dist/components/effects/PortalEffect.d.ts.map +1 -1
  205. package/dist/components/effects/PortalEffect.js +41 -25
  206. package/dist/components/effects/ShockwaveEffect.d.ts +7 -2
  207. package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
  208. package/dist/components/effects/ShockwaveEffect.js +19 -9
  209. package/dist/components/effects/SmokePlumeEffect.d.ts +8 -3
  210. package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
  211. package/dist/components/effects/SmokePlumeEffect.js +30 -20
  212. package/dist/components/effects/SmokeRibbon.d.ts +8 -2
  213. package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
  214. package/dist/components/effects/SmokeRibbon.js +34 -24
  215. package/dist/components/effects/SmokeRingEffect.d.ts +8 -3
  216. package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
  217. package/dist/components/effects/SmokeRingEffect.js +33 -21
  218. package/dist/components/effects/StrangeAttractorEffect.d.ts +8 -3
  219. package/dist/components/effects/StrangeAttractorEffect.d.ts.map +1 -1
  220. package/dist/components/effects/StrangeAttractorEffect.js +30 -20
  221. package/dist/components/effects/VolumetricFogEffect.d.ts +8 -3
  222. package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
  223. package/dist/components/effects/VolumetricFogEffect.js +38 -20
  224. package/dist/components/effects/WaterCausticsEffect.d.ts +7 -2
  225. package/dist/components/effects/WaterCausticsEffect.d.ts.map +1 -1
  226. package/dist/components/effects/WaterCausticsEffect.js +19 -9
  227. package/dist/components/effects/index.d.ts +0 -1
  228. package/dist/components/effects/index.d.ts.map +1 -1
  229. package/dist/components/effects/index.js +0 -1
  230. package/dist/components/index.d.ts +14 -1
  231. package/dist/components/index.d.ts.map +1 -1
  232. package/dist/components/index.js +7 -1
  233. package/dist/components/landscape/LandscapeMesh.js +1 -1
  234. package/dist/components/landscape/types.d.ts +1 -1
  235. package/dist/components/landscape/types.d.ts.map +1 -1
  236. package/dist/components/particles/MagneticBottleParticles.d.ts +17 -0
  237. package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -0
  238. package/dist/components/particles/MagneticBottleParticles.js +618 -0
  239. package/dist/components/particles/ShapeBurstParticles.d.ts +17 -0
  240. package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -0
  241. package/dist/components/particles/ShapeBurstParticles.js +588 -0
  242. package/dist/components/particles/ShapeFlowParticles.d.ts +17 -0
  243. package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -0
  244. package/dist/components/particles/ShapeFlowParticles.js +755 -0
  245. package/dist/components/particles/index.d.ts +6 -0
  246. package/dist/components/particles/index.d.ts.map +1 -1
  247. package/dist/components/particles/index.js +3 -0
  248. package/dist/components/terrain/types.d.ts +1 -1
  249. package/dist/components/terrain/types.d.ts.map +1 -1
  250. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +1 -1
  251. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
  252. package/dist/components/volumetricClouds/types.d.ts +1 -1
  253. package/dist/components/volumetricClouds/types.d.ts.map +1 -1
  254. package/dist/components/water/types.d.ts +1 -1
  255. package/dist/components/water/types.d.ts.map +1 -1
  256. package/dist/hooks/index.d.ts +2 -0
  257. package/dist/hooks/index.d.ts.map +1 -1
  258. package/dist/hooks/index.js +1 -0
  259. package/dist/hooks/useConfigDriver.d.ts +22 -0
  260. package/dist/hooks/useConfigDriver.d.ts.map +1 -0
  261. package/dist/hooks/useConfigDriver.js +43 -0
  262. package/dist/hooks/useConfigLive.d.ts +1 -1
  263. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  264. package/dist/hooks/useLandscapeMaps.d.ts +1 -1
  265. package/dist/hooks/useLandscapeMaps.d.ts.map +1 -1
  266. package/dist/hooks/useOceanMaterial.d.ts +1 -1
  267. package/dist/hooks/useThunder.d.ts +1 -1
  268. package/dist/index.d.ts +1 -2
  269. package/dist/index.d.ts.map +1 -1
  270. package/dist/index.js +1 -2
  271. package/dist/interactions/index.d.ts +2 -1
  272. package/dist/interactions/index.d.ts.map +1 -1
  273. package/dist/interactions/index.js +1 -1
  274. package/dist/interactions/runner.d.ts +18 -3
  275. package/dist/interactions/runner.d.ts.map +1 -1
  276. package/dist/interactions/runner.js +25 -2
  277. package/dist/operations/catalogue/curlSmoke.d.ts +3 -0
  278. package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -0
  279. package/dist/operations/catalogue/curlSmoke.js +178 -0
  280. package/dist/operations/catalogue/displayImage.d.ts.map +1 -1
  281. package/dist/operations/catalogue/displayImage.js +1 -0
  282. package/dist/operations/catalogue/dissolve.d.ts +3 -0
  283. package/dist/operations/catalogue/dissolve.d.ts.map +1 -0
  284. package/dist/operations/catalogue/dissolve.js +57 -0
  285. package/dist/operations/catalogue/emberAsh.d.ts +3 -0
  286. package/dist/operations/catalogue/emberAsh.d.ts.map +1 -0
  287. package/dist/operations/catalogue/emberAsh.js +171 -0
  288. package/dist/operations/catalogue/fade.d.ts.map +1 -1
  289. package/dist/operations/catalogue/fade.js +1 -0
  290. package/dist/operations/catalogue/flip.d.ts +3 -0
  291. package/dist/operations/catalogue/flip.d.ts.map +1 -0
  292. package/dist/operations/catalogue/flip.js +69 -0
  293. package/dist/operations/catalogue/flock.d.ts +3 -0
  294. package/dist/operations/catalogue/flock.d.ts.map +1 -0
  295. package/dist/operations/catalogue/flock.js +163 -0
  296. package/dist/operations/catalogue/focus.d.ts.map +1 -1
  297. package/dist/operations/catalogue/focus.js +1 -0
  298. package/dist/operations/catalogue/frame.d.ts +3 -0
  299. package/dist/operations/catalogue/frame.d.ts.map +1 -0
  300. package/dist/operations/catalogue/frame.js +44 -0
  301. package/dist/operations/catalogue/frost.d.ts +3 -0
  302. package/dist/operations/catalogue/frost.d.ts.map +1 -0
  303. package/dist/operations/catalogue/frost.js +111 -0
  304. package/dist/operations/catalogue/fxInstances.d.ts +21 -0
  305. package/dist/operations/catalogue/fxInstances.d.ts.map +1 -0
  306. package/dist/operations/catalogue/fxInstances.js +47 -0
  307. package/dist/operations/catalogue/fxPoints.d.ts +22 -0
  308. package/dist/operations/catalogue/fxPoints.d.ts.map +1 -0
  309. package/dist/operations/catalogue/fxPoints.js +70 -0
  310. package/dist/operations/catalogue/glow.d.ts.map +1 -1
  311. package/dist/operations/catalogue/glow.js +2 -1
  312. package/dist/operations/catalogue/heatCracks.d.ts +3 -0
  313. package/dist/operations/catalogue/heatCracks.d.ts.map +1 -0
  314. package/dist/operations/catalogue/heatCracks.js +134 -0
  315. package/dist/operations/catalogue/hologram.d.ts +3 -0
  316. package/dist/operations/catalogue/hologram.d.ts.map +1 -0
  317. package/dist/operations/catalogue/hologram.js +118 -0
  318. package/dist/operations/catalogue/inkBloom.d.ts +3 -0
  319. package/dist/operations/catalogue/inkBloom.d.ts.map +1 -0
  320. package/dist/operations/catalogue/inkBloom.js +156 -0
  321. package/dist/operations/catalogue/ivy.d.ts +13 -0
  322. package/dist/operations/catalogue/ivy.d.ts.map +1 -0
  323. package/dist/operations/catalogue/ivy.js +469 -0
  324. package/dist/operations/catalogue/jelly.d.ts +3 -0
  325. package/dist/operations/catalogue/jelly.d.ts.map +1 -0
  326. package/dist/operations/catalogue/jelly.js +50 -0
  327. package/dist/operations/catalogue/kintsugi.d.ts +3 -0
  328. package/dist/operations/catalogue/kintsugi.d.ts.map +1 -0
  329. package/dist/operations/catalogue/kintsugi.js +173 -0
  330. package/dist/operations/catalogue/lidarScan.d.ts +3 -0
  331. package/dist/operations/catalogue/lidarScan.d.ts.map +1 -0
  332. package/dist/operations/catalogue/lidarScan.js +240 -0
  333. package/dist/operations/catalogue/liquidMetal.d.ts +3 -0
  334. package/dist/operations/catalogue/liquidMetal.d.ts.map +1 -0
  335. package/dist/operations/catalogue/liquidMetal.js +122 -0
  336. package/dist/operations/catalogue/metalize.d.ts +3 -0
  337. package/dist/operations/catalogue/metalize.d.ts.map +1 -0
  338. package/dist/operations/catalogue/metalize.js +135 -0
  339. package/dist/operations/catalogue/moveToFront.d.ts.map +1 -1
  340. package/dist/operations/catalogue/moveToFront.js +1 -0
  341. package/dist/operations/catalogue/orbit.d.ts +3 -0
  342. package/dist/operations/catalogue/orbit.d.ts.map +1 -0
  343. package/dist/operations/catalogue/orbit.js +29 -0
  344. package/dist/operations/catalogue/particleSwarm.d.ts +3 -0
  345. package/dist/operations/catalogue/particleSwarm.d.ts.map +1 -0
  346. package/dist/operations/catalogue/particleSwarm.js +138 -0
  347. package/dist/operations/catalogue/petalPeel.d.ts +3 -0
  348. package/dist/operations/catalogue/petalPeel.d.ts.map +1 -0
  349. package/dist/operations/catalogue/petalPeel.js +137 -0
  350. package/dist/operations/catalogue/petrify.d.ts +3 -0
  351. package/dist/operations/catalogue/petrify.d.ts.map +1 -0
  352. package/dist/operations/catalogue/petrify.js +94 -0
  353. package/dist/operations/catalogue/portal.d.ts +3 -0
  354. package/dist/operations/catalogue/portal.d.ts.map +1 -0
  355. package/dist/operations/catalogue/portal.js +224 -0
  356. package/dist/operations/catalogue/print3d.d.ts +3 -0
  357. package/dist/operations/catalogue/print3d.d.ts.map +1 -0
  358. package/dist/operations/catalogue/print3d.js +275 -0
  359. package/dist/operations/catalogue/rainBeads.d.ts +3 -0
  360. package/dist/operations/catalogue/rainBeads.d.ts.map +1 -0
  361. package/dist/operations/catalogue/rainBeads.js +223 -0
  362. package/dist/operations/catalogue/restPose.d.ts +21 -0
  363. package/dist/operations/catalogue/restPose.d.ts.map +1 -0
  364. package/dist/operations/catalogue/restPose.js +55 -0
  365. package/dist/operations/catalogue/rimLight.d.ts +3 -0
  366. package/dist/operations/catalogue/rimLight.d.ts.map +1 -0
  367. package/dist/operations/catalogue/rimLight.js +72 -0
  368. package/dist/operations/catalogue/sandErosion.d.ts +3 -0
  369. package/dist/operations/catalogue/sandErosion.d.ts.map +1 -0
  370. package/dist/operations/catalogue/sandErosion.js +167 -0
  371. package/dist/operations/catalogue/shaderLayers.d.ts +74 -0
  372. package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -0
  373. package/dist/operations/catalogue/shaderLayers.js +322 -0
  374. package/dist/operations/catalogue/shatter.d.ts +3 -0
  375. package/dist/operations/catalogue/shatter.d.ts.map +1 -0
  376. package/dist/operations/catalogue/shatter.js +267 -0
  377. package/dist/operations/catalogue/silkDrape.d.ts +3 -0
  378. package/dist/operations/catalogue/silkDrape.d.ts.map +1 -0
  379. package/dist/operations/catalogue/silkDrape.js +340 -0
  380. package/dist/operations/catalogue/spin.d.ts +3 -0
  381. package/dist/operations/catalogue/spin.d.ts.map +1 -0
  382. package/dist/operations/catalogue/spin.js +42 -0
  383. package/dist/operations/catalogue/surfaceSample.d.ts +17 -0
  384. package/dist/operations/catalogue/surfaceSample.d.ts.map +1 -0
  385. package/dist/operations/catalogue/surfaceSample.js +187 -0
  386. package/dist/operations/catalogue/swirl.d.ts +3 -0
  387. package/dist/operations/catalogue/swirl.d.ts.map +1 -0
  388. package/dist/operations/catalogue/swirl.js +69 -0
  389. package/dist/operations/catalogue/teleport.d.ts +3 -0
  390. package/dist/operations/catalogue/teleport.d.ts.map +1 -0
  391. package/dist/operations/catalogue/teleport.js +213 -0
  392. package/dist/operations/catalogue/transitionField.d.ts +124 -0
  393. package/dist/operations/catalogue/transitionField.d.ts.map +1 -0
  394. package/dist/operations/catalogue/transitionField.js +278 -0
  395. package/dist/operations/catalogue/unweave.d.ts +3 -0
  396. package/dist/operations/catalogue/unweave.d.ts.map +1 -0
  397. package/dist/operations/catalogue/unweave.js +233 -0
  398. package/dist/operations/catalogue/visibility.d.ts.map +1 -1
  399. package/dist/operations/catalogue/visibility.js +1 -0
  400. package/dist/operations/catalogue/voxelize.d.ts +3 -0
  401. package/dist/operations/catalogue/voxelize.d.ts.map +1 -0
  402. package/dist/operations/catalogue/voxelize.js +148 -0
  403. package/dist/operations/catalogue/warmup.d.ts +22 -0
  404. package/dist/operations/catalogue/warmup.d.ts.map +1 -0
  405. package/dist/operations/catalogue/warmup.js +106 -0
  406. package/dist/operations/catalogue/zoom.d.ts.map +1 -1
  407. package/dist/operations/catalogue/zoom.js +1 -0
  408. package/dist/operations/index.d.ts +4 -2
  409. package/dist/operations/index.d.ts.map +1 -1
  410. package/dist/operations/index.js +4 -2
  411. package/dist/operations/objectEffects.d.ts +46 -0
  412. package/dist/operations/objectEffects.d.ts.map +1 -0
  413. package/dist/operations/objectEffects.js +136 -0
  414. package/dist/operations/registry.d.ts +7 -2
  415. package/dist/operations/registry.d.ts.map +1 -1
  416. package/dist/operations/registry.js +45 -3
  417. package/dist/operations/runtime.d.ts +40 -2
  418. package/dist/operations/runtime.d.ts.map +1 -1
  419. package/dist/operations/runtime.js +164 -8
  420. package/dist/operations/types.d.ts +29 -3
  421. package/dist/operations/types.d.ts.map +1 -1
  422. package/dist/operations/types.js +6 -0
  423. package/dist/operations/useObjectEffectLayers.d.ts +4 -0
  424. package/dist/operations/useObjectEffectLayers.d.ts.map +1 -0
  425. package/dist/operations/useObjectEffectLayers.js +42 -0
  426. package/dist/operations/useOperationsRuntime.d.ts.map +1 -1
  427. package/dist/operations/useOperationsRuntime.js +42 -4
  428. package/dist/presets/landscapePresets.d.ts +1 -1
  429. package/dist/presets/landscapePresets.d.ts.map +1 -1
  430. package/dist/presets/landscapePresets.js +1 -1
  431. package/dist/presets/landscapeTypes.d.ts +1 -1
  432. package/dist/presets/landscapeTypes.d.ts.map +1 -1
  433. package/dist/presets/landscapeTypes.js +1 -1
  434. package/dist/presets/oceanSurfacePresets.d.ts +1 -1
  435. package/dist/presets/terrainPresets.d.ts +1 -1
  436. package/dist/presets/terrainPresets.d.ts.map +1 -1
  437. package/dist/presets/volumetricCloudPresets.d.ts +1 -1
  438. package/dist/types/cloudConfigs.d.ts +2 -309
  439. package/dist/types/cloudConfigs.d.ts.map +1 -1
  440. package/dist/types/cloudConfigs.js +2 -339
  441. package/dist/types/gridConfigs.d.ts +103 -0
  442. package/dist/types/gridConfigs.d.ts.map +1 -1
  443. package/dist/types/index.d.ts +9 -9
  444. package/dist/types/index.d.ts.map +1 -1
  445. package/dist/types/index.js +4 -4
  446. package/dist/types/landscapeConfigs.d.ts +2 -217
  447. package/dist/types/landscapeConfigs.d.ts.map +1 -1
  448. package/dist/types/landscapeConfigs.js +2 -256
  449. package/dist/types/oceanConfigs.d.ts +2 -289
  450. package/dist/types/oceanConfigs.d.ts.map +1 -1
  451. package/dist/types/oceanConfigs.js +2 -380
  452. package/dist/types/terrainConfigs.d.ts +2 -250
  453. package/dist/types/terrainConfigs.d.ts.map +1 -1
  454. package/dist/types/terrainConfigs.js +2 -292
  455. package/dist/utils/cloudUniforms.d.ts +1 -1
  456. package/dist/utils/configAnimations.d.ts +6 -0
  457. package/dist/utils/configAnimations.d.ts.map +1 -1
  458. package/dist/utils/configAnimations.js +14 -0
  459. package/dist/utils/gridConfig.d.ts +19 -0
  460. package/dist/utils/gridConfig.d.ts.map +1 -0
  461. package/dist/utils/gridConfig.js +52 -0
  462. package/dist/utils/handleCloudsAnimations.d.ts +1 -1
  463. package/dist/utils/handleCloudsAnimations.js +1 -1
  464. package/dist/utils/hasHoverAnimation.d.ts.map +1 -1
  465. package/dist/utils/hasHoverAnimation.js +0 -2
  466. package/dist/utils/landscapeUniforms.d.ts +1 -1
  467. package/dist/utils/landscapeUniforms.d.ts.map +1 -1
  468. package/dist/utils/oceanUniforms.d.ts +1 -1
  469. package/dist/utils/particleShape.d.ts +33 -0
  470. package/dist/utils/particleShape.d.ts.map +1 -0
  471. package/dist/utils/particleShape.js +207 -0
  472. package/dist/utils/particleTrails.d.ts.map +1 -1
  473. package/dist/utils/particleTrails.js +29 -14
  474. package/dist/utils/terrainUniforms.d.ts +1 -1
  475. package/dist/utils/terrainUniforms.d.ts.map +1 -1
  476. package/package.json +2 -2
@@ -0,0 +1,224 @@
1
+ // Portal — a ring opens around the object and sweeps through it; the object
2
+ // leaves through the ring, cut cleanly at its plane with a glowing rim.
3
+ // The ring is drawn procedurally on one plane in its own polar coordinates, in
4
+ // one of four styles (settings: style, colour, size, thickness, glow, spin):
5
+ // electric a plasma ring with lightning arcs crawling round it and a faint plasma film
6
+ // runes two counter-rotating bands of glowing glyphs inside fine circles
7
+ // horizon an event horizon: a hot, lensed rim (Doppler-bright on one side), a thin
8
+ // photon ring and fine, faint spiral filaments inside — see-through
9
+ // tech segmented arcs rotating both ways, tick marks and a scanning light
10
+ // Reverting brings the object back out of the portal.
11
+ import { AdditiveBlending, Color, Mesh, PlaneGeometry, Quaternion, ShaderMaterial, Vector3 } from 'three';
12
+ import { defineOperation } from '../types.js';
13
+ import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
14
+ import { hideUntilWarm } from './warmup.js';
15
+ import { SWEEP_OPTIONS, createFieldState, fieldGlsl, fieldUniforms, hideMeshes, runProgress, setFieldParams, sweepVector } from './transitionField.js';
16
+ const P = 'Por';
17
+ const KEY = 'portal';
18
+ const STATE = '__opPortal';
19
+ const STYLES = ['electric', 'runes', 'horizon', 'tech'];
20
+ /** The quad is this much larger than the ring, so arcs and glow have room. */
21
+ const PAD = 1.35;
22
+ function cutLayer(st) {
23
+ return {
24
+ uniforms: { ...fieldUniforms(P, st.field), uPorColor: st.color },
25
+ common: `varying vec3 vPorQ;\n${fieldGlsl(P)}`,
26
+ vertex: `vPorQ = PorNorm((uPorRootInv * modelMatrix * vec4(transformed, 1.0)).xyz);`,
27
+ fragment: /* glsl */ `
28
+ {
29
+ float s = PorAlong(vPorQ);
30
+ float fs = mix(-0.04, 1.04, clamp(uPorProgress, 0.0, 1.0));
31
+ if (s < fs) discard;
32
+ float rim = exp(-(s - fs) / 0.012);
33
+ outgoingLight = mix(outgoingLight, uPorColor * 3.0, clamp(rim, 0.0, 1.0));
34
+ }`,
35
+ };
36
+ }
37
+ const RING_FRAG = /* glsl */ `
38
+ uniform vec3 uColor; uniform float uTime; uniform float uStyle; uniform float uThick; uniform float uGlow; uniform float uSpin; uniform float uAlpha;
39
+ varying vec2 vUv;
40
+ float h1(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }
41
+ float n1(vec2 p) { vec2 i = floor(p), f = fract(p); f = f * f * (3.0 - 2.0 * f);
42
+ return mix(mix(h1(i), h1(i + vec2(1.0, 0.0)), f.x), mix(h1(i + vec2(0.0, 1.0)), h1(i + vec2(1.0, 1.0)), f.x), f.y); }
43
+ const float TAU = 6.2831853;
44
+ void main() {
45
+ vec2 p = (vUv - 0.5) * 2.0 * ${PAD.toFixed(2)}; // ring radius = 1
46
+ float r = length(p);
47
+ float a = atan(p.y, p.x);
48
+ float u = a / TAU + 0.5; // 0..1 around
49
+ float t = uTime;
50
+ float th = 0.02 * uThick;
51
+ vec3 col = vec3(0.0);
52
+ if (uStyle < 0.5) {
53
+ // ELECTRIC: bright plasma ring + crawling arcs + faint plasma film
54
+ float ring = exp(-abs(r - 1.0) / th);
55
+ float arcs = 0.0;
56
+ for (int i = 0; i < 4; i++) {
57
+ float fi = float(i);
58
+ float tq = floor(t * 14.0 + fi * 3.1);
59
+ float rr = 1.0 + (n1(vec2(u * 18.0 + fi * 7.0, tq)) - 0.5) * 0.22 + (n1(vec2(u * 60.0, tq + fi)) - 0.5) * 0.05;
60
+ float seg = step(0.45, n1(vec2(u * 5.0 + t * uSpin * 0.5 + fi, fi * 2.0 + floor(t * 3.0))));
61
+ arcs += exp(-abs(r - rr) / (0.004 + 0.3 * th)) * seg;
62
+ }
63
+ float film = smoothstep(1.0, 0.2, r) * n1(vec2(a * 3.0 + r * 6.0 - t * uSpin, r * 4.0)) * 0.12;
64
+ col = uColor * (ring * 2.2 + arcs * 1.6 + film) + vec3(1.0) * pow(ring, 3.0) * 1.2;
65
+ } else if (uStyle < 1.5) {
66
+ // RUNES: two counter-rotating glyph bands between fine circles
67
+ float lines = exp(-abs(r - 1.08) / 0.004) + exp(-abs(r - 0.78) / 0.004) + exp(-abs(r - 0.92) / 0.003);
68
+ float glyph = 0.0;
69
+ for (int b = 0; b < 2; b++) {
70
+ float fb = float(b);
71
+ float r0 = fb < 0.5 ? 1.0 : 0.85;
72
+ float bw = 0.07;
73
+ float band = step(abs(r - r0), bw * 0.5);
74
+ float N = fb < 0.5 ? 36.0 : 28.0;
75
+ float uu = fract(u + (fb < 0.5 ? 1.0 : -1.0) * t * 0.03 * uSpin) * N;
76
+ float cell = floor(uu);
77
+ vec2 g = vec2(fract(uu), (r - (r0 - bw * 0.5)) / bw); // 0..1 inside the glyph cell
78
+ vec2 gc = floor(g * 3.0);
79
+ vec2 gf = fract(g * 3.0);
80
+ // each glyph: a few strokes on a 3×3 grid, chosen by the cell's hash
81
+ float strokeH = step(0.5, h1(vec2(cell, gc.y + fb * 10.0))) * step(abs(gf.y - 0.5), 0.14) * step(0.15, g.x) * step(g.x, 0.85);
82
+ float strokeV = step(0.55, h1(vec2(cell + 50.0, gc.x + fb * 10.0))) * step(abs(gf.x - 0.5), 0.14) * step(0.12, g.y) * step(g.y, 0.88);
83
+ glyph += band * max(strokeH, strokeV);
84
+ }
85
+ float pulse = 0.75 + 0.25 * sin(t * 2.0 + u * TAU * 3.0);
86
+ col = uColor * (lines * 1.6 + glyph * 2.0 * pulse);
87
+ } else if (uStyle < 2.5) {
88
+ // EVENT HORIZON: a hot, lensed rim (Doppler-bright on one side), a thin photon ring,
89
+ // and inside only a few fine, faint spiral filaments falling inward — see-through,
90
+ // so the object stays visible through the portal
91
+ float doppler = 1.0 + 0.6 * cos(a - t * 0.35 * uSpin);
92
+ float rim = exp(-abs(r - 1.0) / (th * 1.6)) * doppler;
93
+ float photon = exp(-abs(r - 1.035) / 0.0035);
94
+ float spiral = pow(0.5 + 0.5 * sin(a * 2.0 + log(max(r, 0.02)) * 13.0 - t * 1.4 * uSpin), 26.0);
95
+ float filaments = spiral * smoothstep(0.3, 0.97, r) * (1.0 - smoothstep(0.97, 1.0, r)) * 0.28;
96
+ col = uColor * (rim * 2.0 + filaments) + vec3(1.0, 0.96, 0.9) * photon * 1.3;
97
+ } else {
98
+ // TECH GATE: segmented arcs both ways, tick marks, a scanning light
99
+ float band1 = step(abs(r - 1.0), th * 1.6) * step(0.3, fract(u * 12.0 + t * 0.05 * uSpin));
100
+ float band2 = step(abs(r - 1.12), th * 0.9) * step(0.6, fract(u * 3.0 - t * 0.08 * uSpin));
101
+ float ticks = step(abs(r - 0.9), 0.025) * step(fract(u * 72.0), 0.12);
102
+ float bigTicks = step(abs(r - 0.9), 0.045) * step(fract(u * 8.0), 0.012);
103
+ float scan = pow(max(0.0, 1.0 - fract(u - t * 0.25 * uSpin)), 12.0) * step(abs(r - 1.0), 0.16);
104
+ col = uColor * (band1 * 1.8 + band2 * 1.2 + ticks * 1.0 + bigTicks * 1.6) + vec3(1.0) * scan * 1.5;
105
+ }
106
+ col *= uGlow * uAlpha;
107
+ float lum = max(col.r, max(col.g, col.b));
108
+ gl_FragColor = vec4(col, clamp(lum, 0.0, 1.0));
109
+ #include <tonemapping_fragment>
110
+ #include <colorspace_fragment>
111
+ }`;
112
+ function makeRingMaterial(st, style) {
113
+ return new ShaderMaterial({
114
+ uniforms: { uColor: st.color, uTime: st.field.time, ...st.uni },
115
+ vertexShader: `varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`,
116
+ fragmentShader: RING_FRAG,
117
+ transparent: true, depthWrite: false, premultipliedAlpha: true,
118
+ blending: AdditiveBlending,
119
+ side: 2,
120
+ });
121
+ }
122
+ export default defineOperation({
123
+ value: 'portal',
124
+ label: 'Portal',
125
+ description: 'Sweep a ring of light through the targets and send them through it — reverting brings them back',
126
+ channel: 'visual',
127
+ multi: true,
128
+ toggles: true,
129
+ usableIn: ['interaction', 'action'],
130
+ params: {
131
+ ring: { type: 'select', label: 'Ring', default: 'electric', options: [{ value: 'electric', label: 'Electric arcs' }, { value: 'runes', label: 'Rune ring' }, { value: 'horizon', label: 'Event horizon' }, { value: 'tech', label: 'Tech gate' }] },
132
+ direction: { type: 'select', label: 'Sweep', default: 'down', options: SWEEP_OPTIONS },
133
+ color: { type: 'color', label: 'Light', default: '#7a8cff' },
134
+ size: { type: 'number', label: 'Ring size', default: 1, min: 0.6, max: 2.5, step: 0.05, unit: '×' },
135
+ thickness: { type: 'number', label: 'Thickness', default: 1, min: 0.3, max: 4, step: 0.05, unit: '×' },
136
+ glow: { type: 'number', label: 'Glow', default: 1, min: 0.2, max: 3, step: 0.05, unit: '×' },
137
+ spin: { type: 'number', label: 'Spin', default: 1, min: 0, max: 5, step: 0.05, unit: '×' },
138
+ duration: { type: 'number', label: 'Duration', default: 2.4, min: 0.3, max: 12, step: 0.1, unit: 's' },
139
+ },
140
+ apply(target, p, ctx) {
141
+ let st = target.userData[STATE];
142
+ if (!st) {
143
+ const field = createFieldState(target);
144
+ const own = {
145
+ field, color: { value: new Color() }, style: '', mats: new Set(),
146
+ uni: { uStyle: { value: 0 }, uThick: { value: 1 }, uGlow: { value: 1 }, uSpin: { value: 1 }, uAlpha: { value: 0 } },
147
+ };
148
+ own.ring = new Mesh(new PlaneGeometry(2 * PAD, 2 * PAD), undefined);
149
+ own.ring.raycast = () => { };
150
+ own.ring.userData.__opFxHelper = true;
151
+ own.ring.frustumCulled = false;
152
+ own.ring.renderOrder = 11;
153
+ target.add(own.ring);
154
+ const layer = cutLayer(own);
155
+ forEachMeshMaterial(target, (mat, mesh) => {
156
+ if (mesh.userData?.__opFxHelper)
157
+ return;
158
+ if (addLayer(mat, KEY, layer))
159
+ own.mats.add(mat);
160
+ });
161
+ st = own;
162
+ target.userData[STATE] = st;
163
+ }
164
+ const s = st;
165
+ setFieldParams(s.field, p, target, ctx);
166
+ s.color.value.set(String(p.color));
167
+ const style = STYLES.includes(String(p.ring)) ? String(p.ring) : 'electric';
168
+ if (style !== s.style) {
169
+ s.ringMat?.dispose();
170
+ s.ringMat = makeRingMaterial(s, style);
171
+ s.ring.material = s.ringMat;
172
+ s.style = style;
173
+ hideUntilWarm(s.ring);
174
+ }
175
+ s.uni.uStyle.value = STYLES.indexOf(style);
176
+ s.uni.uThick.value = Number(p.thickness);
177
+ s.uni.uGlow.value = Number(p.glow);
178
+ s.uni.uSpin.value = Number(p.spin);
179
+ // a ring wide enough to pass around the object's cross-section, across the sweep
180
+ const d = sweepVector(s.field);
181
+ const size = s.field.boundsSize.value;
182
+ const across = new Vector3(size.x * Math.sqrt(1 - d.x * d.x), size.y * Math.sqrt(1 - d.y * d.y), size.z * Math.sqrt(1 - d.z * d.z)).length();
183
+ s.radius = (0.55 * across + 0.04 * s.field.extent.value) * Number(p.size);
184
+ s.ring.quaternion.copy(new Quaternion().setFromUnitVectors(new Vector3(0, 0, 1), d));
185
+ s.ring.visible = true;
186
+ placeRing(s);
187
+ return runProgress(target, s.field, 1, {
188
+ duration: Number(p.duration), ease: 'power1.inOut',
189
+ onUpdate: () => placeRing(s),
190
+ onComplete: () => { hideMeshes(target, KEY, true); s.ring.visible = false; },
191
+ });
192
+ },
193
+ revert(target, p) {
194
+ const s = target.userData[STATE];
195
+ if (!s)
196
+ return;
197
+ hideMeshes(target, KEY, false);
198
+ s.ring.visible = true;
199
+ return runProgress(target, s.field, 0, {
200
+ duration: Number(p.duration), ease: 'power1.inOut',
201
+ onUpdate: () => placeRing(s),
202
+ onComplete: () => {
203
+ s.mats.forEach(m => removeLayer(m, KEY));
204
+ s.ring.removeFromParent();
205
+ s.ring.geometry.dispose();
206
+ s.ringMat?.dispose();
207
+ delete target.userData[STATE];
208
+ },
209
+ });
210
+ },
211
+ });
212
+ /** Put the ring on the moving plane (root-local) and open / close it at the ends. */
213
+ function placeRing(s) {
214
+ const pr = Math.min(1, Math.max(0, s.field.progress.value));
215
+ const fs = -0.04 + 1.08 * pr;
216
+ const d = sweepVector(s.field);
217
+ const min = s.field.boundsMin.value, size = s.field.boundsSize.value;
218
+ const c = min.clone().addScaledVector(size, 0.5);
219
+ const half = (Math.abs(d.x) * size.x + Math.abs(d.y) * size.y + Math.abs(d.z) * size.z) / 2;
220
+ s.ring.position.copy(c).addScaledVector(d, (fs - 0.5) * 2 * half);
221
+ const open = Math.max(0, Math.min(1, pr / 0.08, (1 - pr) / 0.08 + 0.001));
222
+ s.ring.scale.setScalar(s.radius * (0.2 + 0.8 * Math.sqrt(open)));
223
+ s.uni.uAlpha.value = open;
224
+ }
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=print3d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print3d.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/print3d.ts"],"names":[],"mappings":";AA8MA,wBAgFG"}
@@ -0,0 +1,275 @@
1
+ // 3D print — the object is printed, layer by layer, the way an FDM printer
2
+ // builds it. Each layer is traced around the object by a nozzle (a hot point
3
+ // running round the perimeter; every layer starts at the same angle, so it leaves
4
+ // a faint z-seam like a real print), the freshest layers glow and cool along a
5
+ // blackbody ramp, and fine layer lines show on the walls while it prints. Through
6
+ // the open top you see the inside: the top layer's gyroid infill (a cap drawn on
7
+ // the object's back faces, ray-cut at the print height and lit as a flat layer).
8
+ // Applying un-prints it from the top down; reverting prints it back up.
9
+ // With Disappear off (always, as an object effect) the object turns into its
10
+ // slicer preview instead: the nozzle runs up through the layers and, behind it,
11
+ // the surface becomes toolpath — rounded extrusion beads ringing the walls layer
12
+ // by layer, rectilinear skin lines on the top and bottom faces (45°, alternating
13
+ // per layer), in slicer feature colours (or by height, or the object's own).
14
+ // While it holds, a highlighted layer climbs the object with the nozzle tracing
15
+ // it. Reverting runs the nozzle back down and the solid object returns.
16
+ import { BackSide, Color, Mesh, MeshStandardMaterial } from 'three';
17
+ import { defineOperation } from '../types.js';
18
+ import { addLayer, forEachMeshMaterial, removeLayer } from './shaderLayers.js';
19
+ import { createFieldState, fieldGlsl, fieldUniforms, hideMeshes, runProgress } from './transitionField.js';
20
+ import { hideUntilWarm } from './warmup.js';
21
+ const P = 'Prt';
22
+ const KEY = 'print3d';
23
+ const STATE = '__opPrint3d';
24
+ /** The print state at a point (GLSL): is it printed yet, and how long ago (in layers). */
25
+ const PRINT = /* glsl */ `
26
+ float prtH() { return (1.0 - clamp(uPrtProgress, 0.0, 1.0)) * (1.0 + 1.0 / uPrtLayers); }
27
+ float prtAngle(vec3 r) { vec3 c = uPrtMin + 0.5 * uPrtSize; return (atan(r.z - c.z, r.x - c.x) + 3.14159265) / 6.2831853; }
28
+ // age in layers since the nozzle laid this point; < 0 = not printed yet
29
+ float prtAge(vec3 r, vec3 q) {
30
+ float hl = prtH() * uPrtLayers;
31
+ float k = floor(q.y * uPrtLayers);
32
+ return hl - (k + prtAngle(r));
33
+ }
34
+ // slicer preview: the layer-time the conversion front has reached (bottom → top)
35
+ float prtKAge(vec3 r, vec3 q) {
36
+ float hk = clamp(uPrtProgress, 0.0, 1.0) * (1.0 + 1.0 / uPrtLayers) * uPrtLayers;
37
+ return hk - (floor(q.y * uPrtLayers) + prtAngle(r));
38
+ }
39
+ vec3 prtHeat(float h) {
40
+ // blackbody-ish: dark red → orange → pale yellow
41
+ return mix(mix(vec3(0.5, 0.04, 0.0), vec3(1.0, 0.38, 0.06), smoothstep(0.0, 0.5, h)), vec3(1.0, 0.72, 0.42), smoothstep(0.6, 1.0, h));
42
+ }
43
+ `;
44
+ function mainLayer(st) {
45
+ return {
46
+ uniforms: { ...fieldUniforms(P, st.field), uPrtLayers: st.layers, uPrtHot: st.hot, uPrtLines: st.lines, uPrtKeep: st.keep, uPrtPalette: st.palette },
47
+ common: `varying vec3 vPrtQ;\nvarying vec3 vPrtR;\nvarying vec3 vPrtN;\nvarying vec3 vPrtUp;\nvarying vec3 vPrtDA;\nvarying vec3 vPrtDB;\n${fieldGlsl(P)}\n${PRINT}`,
48
+ fragmentPars: PREVIEW,
49
+ vertex: /* glsl */ `
50
+ vPrtR = (uPrtRootInv * modelMatrix * vec4(transformed, 1.0)).xyz;
51
+ vPrtQ = PrtNorm(vPrtR);
52
+ vPrtN = (uPrtRootInv * modelMatrix * vec4(normal, 0.0)).xyz;
53
+ {
54
+ // root axes in view space, to bend the lighting normal across the beads
55
+ mat3 rw = inverse(mat3(uPrtRootInv));
56
+ vPrtUp = normalize(mat3(viewMatrix) * (rw * vec3(0.0, 1.0, 0.0)));
57
+ vPrtDA = normalize(mat3(viewMatrix) * (rw * vec3(0.7071, 0.0, -0.7071)));
58
+ vPrtDB = normalize(mat3(viewMatrix) * (rw * vec3(0.7071, 0.0, 0.7071)));
59
+ }`,
60
+ diffuse: /* glsl */ `
61
+ if (uPrtKeep > 0.5) {
62
+ prtPreview(diffuseColor.rgb);
63
+ if (prtConv > 0.5) diffuseColor.rgb = prtCol * mix(0.22, 1.0, prtGap);
64
+ } else {
65
+ if (prtAge(vPrtR, vPrtQ) < 0.0) discard;
66
+ if (!gl_FrontFacing) discard; // double-sided materials: the cap draws the inside
67
+ // layer lines while it prints (they settle as the print finishes)
68
+ float yl = vPrtQ.y * uPrtLayers;
69
+ float ridge = pow(abs(fract(yl) - 0.5) * 2.0, 4.0);
70
+ diffuseColor.rgb *= 1.0 - 0.22 * ridge * uPrtLines * smoothstep(0.0, 0.06, uPrtProgress);
71
+ }`,
72
+ material: /* glsl */ `
73
+ if (uPrtKeep > 0.5 && prtConv > 0.5) { roughnessFactor = 0.42; metalnessFactor = 0.0; }`,
74
+ emissive: /* glsl */ `
75
+ if (uPrtKeep > 0.5 && prtConv > 0.5) {
76
+ // each extrusion is a round bead: bend the normal across it (up/down on walls, sideways on skin)
77
+ vec3 across = prtSkin > 0.5 ? prtSkinDir : vPrtUp;
78
+ normal = normalize(normal * sqrt(max(1.0 - prtB * prtB, 0.05)) + across * prtB * 0.85);
79
+ }`,
80
+ fragment: /* glsl */ `
81
+ if (uPrtKeep > 0.5) {
82
+ float age = prtKAge(vPrtR, vPrtQ);
83
+ float on = step(0.0001, uPrtProgress) * step(uPrtProgress, 0.9999);
84
+ // the nozzle converting the layers, and the freshly laid toolpath
85
+ float noz = exp(-abs(age) / 0.018) * on;
86
+ float fresh = exp(-max(age, 0.0) / 0.8) * step(0.0, age) * on;
87
+ outgoingLight += prtCol * fresh * 0.6 + vec3(1.0, 0.95, 0.85) * noz * 2.6;
88
+ // holding: a highlighted layer climbs the preview, the nozzle tracing it
89
+ float hw = smoothstep(0.97, 1.0, uPrtProgress) * prtConv;
90
+ float band = fract(uPrtTime * 0.045) * (uPrtLayers + 8.0) - 4.0;
91
+ float yl = vPrtQ.y * uPrtLayers;
92
+ float hl = exp(-abs(yl - band - 0.5) / 0.55);
93
+ float trace = band - (floor(yl) + prtAngle(vPrtR));
94
+ float tip = exp(-abs(trace) / 0.012) * step(abs(floor(yl) - floor(band)), 0.5);
95
+ outgoingLight += (prtCol * hl * 0.55 + vec3(1.0) * tip * 2.2) * hw;
96
+ } else {
97
+ float age = prtAge(vPrtR, vPrtQ);
98
+ float on = step(0.0001, uPrtProgress) * step(uPrtProgress, 0.9999);
99
+ float heat = exp(-age / 1.6) * on;
100
+ // the nozzle: a hot point on the current layer, where the extrusion is now
101
+ float noz = exp(-age / 0.02) * on;
102
+ outgoingLight = mix(outgoingLight, prtHeat(heat) * uPrtHot * 1.5, heat * heat * 0.6);
103
+ outgoingLight += vec3(1.0, 0.93, 0.8) * (noz * 3.0 + exp(-age / 0.08) * on * 0.6);
104
+ }`,
105
+ };
106
+ }
107
+ function capLayer(st) {
108
+ return {
109
+ uniforms: { ...fieldUniforms(P, st.field), uPrtLayers: st.layers, uPrtHot: st.hot, uPrtInfill: st.infill },
110
+ common: `varying vec3 vPrtQ;\nvarying vec3 vPrtR;\nvarying vec3 vPrtUp;\n${fieldGlsl(P)}\n${PRINT}`,
111
+ fragmentPars: 'float prtCap = 0.0; float prtLine = 0.0; float prtGlow = 0.0;',
112
+ vertex: /* glsl */ `
113
+ vPrtR = (uPrtRootInv * modelMatrix * vec4(transformed, 1.0)).xyz;
114
+ vPrtQ = PrtNorm(vPrtR);
115
+ vPrtUp = normalize(mat3(viewMatrix) * (inverse(mat3(uPrtRootInv)) * vec3(0.0, 1.0, 0.0)));`,
116
+ diffuse: /* glsl */ `
117
+ {
118
+ if (prtAge(vPrtR, vPrtQ) < 0.0) discard;
119
+ // where the view ray crosses the print plane before reaching this back face, draw the top layer
120
+ vec3 camR = (uPrtRootInv * vec4(cameraPosition, 1.0)).xyz;
121
+ float planeY = uPrtMin.y + prtH() * uPrtSize.y;
122
+ vec3 dir = vPrtR - camR;
123
+ float tt = (planeY - camR.y) / (abs(dir.y) > 1e-5 ? dir.y : 1e-5);
124
+ if (camR.y > planeY && tt > 0.0 && tt < 1.0) {
125
+ vec3 X = camR + dir * tt;
126
+ vec3 u = (X - uPrtMin) / uPrtExtent * uPrtInfill * 6.2831853;
127
+ float gy = sin(u.x) * cos(u.y) + sin(u.y) * cos(u.z) + sin(u.z) * cos(u.x);
128
+ float fw = fwidth(gy) + 1e-4;
129
+ prtLine = 1.0 - smoothstep(0.2 - fw, 0.2 + fw, abs(gy));
130
+ prtCap = 1.0;
131
+ // the infill being laid: a raster front crossing the layer, alternating 45° per layer
132
+ float layer = floor(prtH() * uPrtLayers);
133
+ vec2 d2 = mod(layer, 2.0) < 0.5 ? vec2(0.7071, 0.7071) : vec2(0.7071, -0.7071);
134
+ vec3 c = uPrtMin + 0.5 * uPrtSize;
135
+ float rast = dot((X - c).xz, d2) / max(length(uPrtSize.xz), 1e-4) + 0.5;
136
+ float ph = fract(prtH() * uPrtLayers);
137
+ prtGlow = prtLine * (0.25 + exp(-abs(rast - ph) / 0.05)) * step(0.0001, uPrtProgress) * step(uPrtProgress, 0.9999);
138
+ diffuseColor.rgb *= mix(0.06, 1.0, prtLine);
139
+ } else {
140
+ diffuseColor.rgb *= 0.05; // the dark inside of the wall
141
+ }
142
+ }`,
143
+ emissive: /* glsl */ `
144
+ if (prtCap > 0.5) normal = vPrtUp;`,
145
+ fragment: /* glsl */ `
146
+ outgoingLight += prtHeat(0.55) * uPrtHot * prtGlow * 1.2;`,
147
+ };
148
+ }
149
+ const PALETTES = [{ value: 'feature', label: 'Feature type' }, { value: 'height', label: 'Layer height' }, { value: 'object', label: "Object's colours" }];
150
+ /** The slicer-preview surface (fragment, computed once in the diffuse anchor). */
151
+ const PREVIEW = /* glsl */ `
152
+ float prtConv = 0.0, prtGap = 1.0, prtB = 0.0, prtSkin = 0.0;
153
+ vec3 prtCol = vec3(1.0), prtSkinDir = vec3(0.0);
154
+ vec3 prtRamp(float t) {
155
+ // a slicer height ramp: deep blue → cyan → green → amber → red
156
+ vec3 a = mix(vec3(0.028, 0.06, 0.687), vec3(0.014, 0.479, 0.745), smoothstep(0.0, 0.3, t));
157
+ a = mix(a, vec3(0.078, 0.651, 0.144), smoothstep(0.3, 0.55, t));
158
+ a = mix(a, vec3(1.0, 0.515, 0.027), smoothstep(0.55, 0.8, t));
159
+ return mix(a, vec3(0.888, 0.06, 0.042), smoothstep(0.8, 1.0, t));
160
+ }
161
+ void prtPreview(vec3 own) {
162
+ if (prtKAge(vPrtR, vPrtQ) < 0.0) return;
163
+ prtConv = 1.0;
164
+ vec3 n = normalize(vPrtN);
165
+ prtSkin = step(0.82, abs(n.y)); // top / bottom faces are solid skin
166
+ float lh = uPrtSize.y / uPrtLayers; // layer height = bead width
167
+ float k = floor(vPrtQ.y * uPrtLayers);
168
+ float u;
169
+ if (prtSkin > 0.5) {
170
+ // rectilinear skin, 45° alternating per layer
171
+ bool alt = mod(k, 2.0) < 0.5;
172
+ vec2 d = alt ? vec2(0.7071, 0.7071) : vec2(0.7071, -0.7071);
173
+ float v = dot(vPrtR.xz, d) / lh;
174
+ u = fract(v);
175
+ prtSkinDir = alt ? vPrtDB : vPrtDA;
176
+ float aa = fwidth(v) * 1.2 + 1e-4;
177
+ prtGap = smoothstep(0.0, 0.1 + aa, u) * smoothstep(0.0, 0.1 + aa, 1.0 - u);
178
+ } else {
179
+ float yl = vPrtQ.y * uPrtLayers;
180
+ u = fract(yl);
181
+ float aa = fwidth(yl) * 1.2 + 1e-4;
182
+ prtGap = smoothstep(0.0, 0.08 + aa, u) * smoothstep(0.0, 0.08 + aa, 1.0 - u);
183
+ }
184
+ prtB = clamp(2.0 * u - 1.0, -1.0, 1.0) * prtGap;
185
+ if (uPrtPalette < 0.5) prtCol = prtSkin > 0.5 ? vec3(0.694, 0.024, 0.06) : vec3(1.0, 0.195, 0.014); // skin · outer wall (linear)
186
+ else if (uPrtPalette < 1.5) prtCol = prtRamp(vPrtQ.y);
187
+ else prtCol = own;
188
+ }
189
+ `;
190
+ const baseColor = (m) => (m.color?.isColor ? m.color.clone() : new Color('#dddddd'));
191
+ export default defineOperation({
192
+ value: 'print3d',
193
+ label: '3D print',
194
+ description: 'Un-print the targets layer by layer, or (Disappear off) turn them into their slicer toolpath preview — reverting prints them back',
195
+ channel: 'visual',
196
+ multi: true,
197
+ toggles: true,
198
+ usableIn: ['interaction', 'action', 'object'],
199
+ params: {
200
+ layers: { type: 'number', label: 'Layers', default: 56, min: 8, max: 240, step: 1 },
201
+ infill: { type: 'number', label: 'Infill', default: 14, min: 2, max: 40, step: 0.5, hint: 'Gyroid cells across the object' },
202
+ hot: { type: 'color', label: 'Heat', default: '#ffffff', hint: 'Tints the glow of the fresh layers' },
203
+ lines: { type: 'number', label: 'Layer lines', default: 1, min: 0, max: 2, step: 0.05, unit: '×' },
204
+ preview: { type: 'select', label: 'Preview colours', default: 'feature', options: PALETTES, hint: 'The slicer preview (Disappear off)' },
205
+ duration: { type: 'number', label: 'Duration', default: 5, min: 0.3, max: 30, step: 0.1, unit: 's' },
206
+ disappear: { type: 'boolean', label: 'Disappear', default: true, hint: 'Off: the object turns into its slicer preview and stays' },
207
+ },
208
+ objectParams: { disappear: false },
209
+ apply(target, p) {
210
+ let st = target.userData[STATE];
211
+ if (!st) {
212
+ const field = createFieldState(target);
213
+ st = {
214
+ field, layers: { value: 56 }, infill: { value: 5 }, hot: { value: new Color() }, lines: { value: 1 },
215
+ keep: { value: 0 }, palette: { value: 0 }, caps: [], mats: new Set(),
216
+ };
217
+ const own = st;
218
+ const layer = mainLayer(own);
219
+ forEachMeshMaterial(target, (mat, mesh) => {
220
+ if (mesh.userData?.__opFxHelper)
221
+ return;
222
+ if (addLayer(mat, KEY, layer))
223
+ own.mats.add(mat);
224
+ });
225
+ // the inside: a back-face twin of every plain mesh, sharing its geometry
226
+ const meshes = [];
227
+ target.traverse((c) => { if (c.isMesh && !c.isSkinnedMesh && !c.isInstancedMesh && !c.userData?.__opFxHelper)
228
+ meshes.push(c); });
229
+ const cap = capLayer(own);
230
+ for (const m of meshes) {
231
+ const src = (Array.isArray(m.material) ? m.material[0] : m.material);
232
+ const mat = new MeshStandardMaterial({ side: BackSide, color: baseColor(src), roughness: 0.6, metalness: 0 });
233
+ addLayer(mat, 'print3dCap', cap, { immediate: true });
234
+ const twin = new Mesh(m.geometry, mat);
235
+ twin.userData.__opFxHelper = true;
236
+ twin.raycast = () => { };
237
+ m.add(twin);
238
+ hideUntilWarm(twin);
239
+ own.caps.push(twin);
240
+ }
241
+ target.userData[STATE] = st;
242
+ }
243
+ const s = st;
244
+ s.layers.value = Math.round(Number(p.layers));
245
+ s.infill.value = Number(p.infill);
246
+ s.hot.value.set(String(p.hot));
247
+ s.lines.value = Number(p.lines);
248
+ s.palette.value = Math.max(0, PALETTES.findIndex(o => o.value === p.preview));
249
+ s.keep.value = p.disappear === false ? 1 : 0;
250
+ // the preview never cuts the object open: the inside is only for the un-print
251
+ s.caps.forEach(c => { c.visible = !s.keep.value; });
252
+ if (s.keep.value) {
253
+ return runProgress(target, s.field, 1, { duration: Number(p.duration), ease: 'none', hold: true });
254
+ }
255
+ return runProgress(target, s.field, 1, {
256
+ duration: Number(p.duration), ease: 'none',
257
+ onComplete: () => { hideMeshes(target, KEY, true); s.caps.forEach(c => { c.visible = false; }); },
258
+ });
259
+ },
260
+ revert(target, p) {
261
+ const s = target.userData[STATE];
262
+ if (!s)
263
+ return;
264
+ hideMeshes(target, KEY, false);
265
+ s.caps.forEach(c => { c.visible = !s.keep.value; });
266
+ return runProgress(target, s.field, 0, {
267
+ duration: Number(p.duration), ease: 'none',
268
+ onComplete: () => {
269
+ s.mats.forEach(m => removeLayer(m, KEY));
270
+ s.caps.forEach(c => { c.removeFromParent(); c.material.dispose(); });
271
+ delete target.userData[STATE];
272
+ },
273
+ });
274
+ },
275
+ });
@@ -0,0 +1,3 @@
1
+ declare const _default: import("..").OperationDefinition;
2
+ export default _default;
3
+ //# sourceMappingURL=rainBeads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rainBeads.d.ts","sourceRoot":"","sources":["../../../src/operations/catalogue/rainBeads.ts"],"names":[],"mappings":";AAkLA,wBAkDG"}