@realsee/five 6.8.0-alpha.9 → 6.8.1

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 (490) hide show
  1. package/AGENTS_READ_ME.md +6 -1
  2. package/AI_CONTEXT.md +6 -1
  3. package/README.md +10 -3
  4. package/ai_guides/README.md +29 -0
  5. package/ai_guides/api.md +92 -21
  6. package/ai_guides/features/3dtile.md +1 -1
  7. package/ai_guides/features/camera-animation.md +18 -1
  8. package/ai_guides/features/clipper.md +2 -2
  9. package/ai_guides/features/coordinate-system.md +20 -2
  10. package/ai_guides/features/event.md +106 -10
  11. package/ai_guides/features/five.md +17 -17
  12. package/ai_guides/features/flowing-light-2d-pass.md +75 -17
  13. package/ai_guides/features/flowing-light-3d-pass.md +76 -17
  14. package/ai_guides/features/gaussian-blur-pass.md +1 -1
  15. package/ai_guides/features/gesture.md +2 -1
  16. package/ai_guides/features/get-screen-pixels.md +2 -2
  17. package/ai_guides/features/image-options.md +2 -2
  18. package/ai_guides/features/load-external-model.md +6 -2
  19. package/ai_guides/features/load-progress.md +1 -1
  20. package/ai_guides/features/material.md +20 -12
  21. package/ai_guides/features/mode.md +1 -1
  22. package/ai_guides/features/model.md +1 -1
  23. package/ai_guides/features/move-pano-effect.md +1 -1
  24. package/ai_guides/features/multi-work.md +1 -1
  25. package/ai_guides/features/pano-filter.md +149 -0
  26. package/ai_guides/features/pano-tile.md +1 -1
  27. package/ai_guides/features/pano-uv.md +1 -1
  28. package/ai_guides/features/parameter.md +26 -2
  29. package/ai_guides/features/plugin.md +1 -1
  30. package/ai_guides/features/postprocessing.md +1 -1
  31. package/ai_guides/features/raycast.md +5 -2
  32. package/ai_guides/features/request-proxy.md +1 -1
  33. package/ai_guides/features/screen-project.md +2 -1
  34. package/ai_guides/features/state.md +23 -3
  35. package/ai_guides/features/view-layer.md +1 -1
  36. package/ai_guides/features/work.md +1 -1
  37. package/ai_guides/glossary.md +4 -4
  38. package/ai_guides/release_notes/6.8.md +190 -58
  39. package/ai_guides/template.md +11 -0
  40. package/docs/00_FOR_AI_AGENTS.md +3 -2
  41. package/docs/README.md +3 -2
  42. package/docs/assets/hierarchy.js +1 -1
  43. package/docs/assets/main.js +1 -1
  44. package/docs/assets/navigation.js +1 -1
  45. package/docs/assets/search.js +1 -1
  46. package/docs/classes/five.AdaptiveLuminancePass.html +7 -6
  47. package/docs/classes/five.AnimationFrameLoop.html +1 -1
  48. package/docs/classes/five.BoundingMesh.html +2 -2
  49. package/docs/classes/five.Camera.html +3 -3
  50. package/docs/classes/five.EyeDomeLightingPass.html +1 -1
  51. package/docs/classes/five.Five.html +77 -76
  52. package/docs/classes/five.FivePass.html +1 -1
  53. package/docs/classes/five.Histogram.html +19 -0
  54. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  55. package/docs/classes/five.Model.html +8 -8
  56. package/docs/classes/five.ModelScene.html +1 -1
  57. package/docs/classes/five.NetworkSubscribe.html +5 -5
  58. package/docs/classes/five.PBMContainer.html +1 -1
  59. package/docs/classes/five.PBMCustomShader.html +42 -3
  60. package/docs/classes/five.PBMGSObject.html +5 -3
  61. package/docs/classes/five.PBMGroup.html +1 -1
  62. package/docs/classes/five.PBMMesh.html +1 -1
  63. package/docs/classes/five.PBMMeshMaterial.html +7 -7
  64. package/docs/classes/five.PBMPanoFilter.html +61 -0
  65. package/docs/classes/five.PBMPointCloud.html +1 -1
  66. package/docs/classes/five.PBMPointCloudMaterial.html +5 -6
  67. package/docs/classes/five.PBMSkinnedMesh.html +1 -1
  68. package/docs/classes/five.PBMUpdateable.html +41 -0
  69. package/docs/classes/five.PanoCircleMesh.html +1 -1
  70. package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
  71. package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
  72. package/docs/classes/five.Parameter.html +57 -55
  73. package/docs/classes/five.Scene.html +1 -1
  74. package/docs/classes/five.Subscribe.html +5 -5
  75. package/docs/classes/five.Tile.html +1 -1
  76. package/docs/classes/five.Tile3D.html +24 -24
  77. package/docs/classes/five.TileNode.html +1 -1
  78. package/docs/classes/five.Tileset.html +3 -2
  79. package/docs/classes/five.TrajectoryNode.html +1 -1
  80. package/docs/classes/five.Work.html +16 -16
  81. package/docs/classes/five.WorkResolvedObserver.html +22 -22
  82. package/docs/classes/gltf-loader.DDSLoader.html +1 -1
  83. package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
  84. package/docs/classes/gltf-loader.GLTFLoader.html +2 -2
  85. package/docs/classes/gltf-loader.GLTFObject.html +1 -1
  86. package/docs/classes/gltf-loader.GLTFParser.html +1 -1
  87. package/docs/classes/gltf-loader.THREEGLTFLoader.html +2 -2
  88. package/docs/classes/line.Line.html +1 -1
  89. package/docs/classes/line.LineGeometry.html +1 -1
  90. package/docs/classes/line.LineMaterial.html +1 -1
  91. package/docs/classes/line.LineSegmentsGeometry.html +1 -1
  92. package/docs/classes/line.THREE_Line2.html +1 -1
  93. package/docs/classes/line.THREE_LineSegments2.html +1 -1
  94. package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
  95. package/docs/classes/plugins.CSS2DObject.html +10 -0
  96. package/docs/classes/plugins.CSS2DRenderer.html +7 -0
  97. package/docs/classes/plugins.CSS3DObject.html +9 -0
  98. package/docs/classes/plugins.CSS3DRenderer.html +4 -2
  99. package/docs/classes/plugins.CSS3DSprite.html +11 -0
  100. package/docs/classes/plugins.Object3DHelperController.html +43 -0
  101. package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
  102. package/docs/classes/sticker.Sticker.html +1 -1
  103. package/docs/classes/vfx.Airflow.html +1 -1
  104. package/docs/classes/vfx.Flame.html +1 -1
  105. package/docs/classes/vfx.Particle.html +6 -6
  106. package/docs/classes/vfx.ParticleGPU.html +3 -3
  107. package/docs/classes/vfx.SpotLight.html +1 -1
  108. package/docs/documents/README.html +122 -1
  109. package/docs/documents/api.html +163 -35
  110. package/docs/documents/features_3dtile.html +1 -1
  111. package/docs/documents/features_camera-animation.html +18 -2
  112. package/docs/documents/features_clipper.html +2 -2
  113. package/docs/documents/features_coordinate-system.html +52 -3
  114. package/docs/documents/features_event.html +44 -8
  115. package/docs/documents/features_five.html +17 -17
  116. package/docs/documents/features_flowing-light-2d-pass.html +41 -125
  117. package/docs/documents/features_flowing-light-3d-pass.html +43 -132
  118. package/docs/documents/features_gaussian-blur-pass.html +6 -6
  119. package/docs/documents/features_gesture.html +2 -1
  120. package/docs/documents/features_get-screen-pixels.html +2 -2
  121. package/docs/documents/features_image-options.html +2 -2
  122. package/docs/documents/features_load-external-model.html +6 -2
  123. package/docs/documents/features_load-progress.html +1 -1
  124. package/docs/documents/features_material.html +11 -4
  125. package/docs/documents/features_mode.html +1 -1
  126. package/docs/documents/features_model.html +1 -1
  127. package/docs/documents/features_move-pano-effect.html +1 -1
  128. package/docs/documents/features_multi-work.html +1 -1
  129. package/docs/documents/features_pano-filter.html +123 -0
  130. package/docs/documents/features_pano-tile.html +1 -1
  131. package/docs/documents/features_pano-uv.html +1 -1
  132. package/docs/documents/features_parameter.html +11 -3
  133. package/docs/documents/features_plugin.html +1 -1
  134. package/docs/documents/features_postprocessing.html +1 -1
  135. package/docs/documents/features_raycast.html +5 -2
  136. package/docs/documents/features_request-proxy.html +1 -1
  137. package/docs/documents/features_screen-project.html +2 -1
  138. package/docs/documents/features_state.html +9 -2
  139. package/docs/documents/features_view-layer.html +1 -1
  140. package/docs/documents/features_work.html +1 -1
  141. package/docs/documents/glossary.html +5 -5
  142. package/docs/documents/release_notes_6.8.html +164 -64
  143. package/docs/documents/template.html +9 -0
  144. package/docs/functions/five.createDebugBoundingMesh.html +1 -1
  145. package/docs/functions/five.parseWork.html +1 -1
  146. package/docs/functions/plugins.CSS2DPlugin.html +1 -0
  147. package/docs/functions/plugins.CSS3DPlugin.html +1 -0
  148. package/docs/functions/plugins.GaussianSplattingEntranceAnimationPlugin.html +1 -0
  149. package/docs/functions/plugins.Object3DHelperPlugin.html +1 -0
  150. package/docs/functions/react.getPlugin.html +2 -0
  151. package/docs/functions/react.setPlugin.html +2 -0
  152. package/docs/functions/react.useFiveCurrentObserver.html +2 -2
  153. package/docs/functions/react.useFiveFloor.html +2 -2
  154. package/docs/functions/react.useFivePlugin.html +8 -0
  155. package/docs/functions/react.useFiveProject2d.html +2 -2
  156. package/docs/functions/react.withFive.html +1 -1
  157. package/docs/functions/vue.useFiveCurrentObserver.html +2 -2
  158. package/docs/functions/vue.useFiveFloor.html +2 -2
  159. package/docs/functions/vue.useFiveWorks.html +2 -2
  160. package/docs/hierarchy.html +1 -1
  161. package/docs/index.html +122 -1
  162. package/docs/interfaces/five.AddableObject.html +1 -1
  163. package/docs/interfaces/five.AjaxOptions.html +1 -1
  164. package/docs/interfaces/five.BaseEvent.html +7 -2
  165. package/docs/interfaces/five.BaseExtendableEvent.html +11 -0
  166. package/docs/interfaces/five.EventCallback.html +58 -54
  167. package/docs/interfaces/five.FiveInitArgs.html +2 -2
  168. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
  169. package/docs/interfaces/five.GestureEvent.html +21 -2
  170. package/docs/interfaces/five.GesturePointer.html +20 -0
  171. package/docs/interfaces/five.ImageOptions.html +1 -1
  172. package/docs/interfaces/five.IntersectEvent.html +10 -2
  173. package/docs/interfaces/five.IntersectMesh.html +1 -1
  174. package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
  175. package/docs/interfaces/five.Intersection.html +1 -1
  176. package/docs/interfaces/five.LooseWorkObserver.html +2 -2
  177. package/docs/interfaces/five.LooseWorkPanorama.html +2 -2
  178. package/docs/interfaces/five.LooseWorkWithExtrinsics.html +6 -6
  179. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +10 -10
  180. package/docs/interfaces/five.ModeChangeEvent.html +9 -2
  181. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  182. package/docs/interfaces/five.ModelEvent.html +7 -2
  183. package/docs/interfaces/five.ModelSceneEvent.html +7 -2
  184. package/docs/interfaces/five.ModelTileEvent.html +7 -2
  185. package/docs/interfaces/five.MovePanoOptions.html +8 -8
  186. package/docs/interfaces/five.NetworkAbortError.html +1 -1
  187. package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
  188. package/docs/interfaces/five.NetworkOptions.html +1 -1
  189. package/docs/interfaces/five.NetworkProxyError.html +1 -1
  190. package/docs/interfaces/five.NetworkResourceEvent.html +7 -2
  191. package/docs/interfaces/five.NetworkResponseError.html +1 -1
  192. package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
  193. package/docs/interfaces/five.ObjectEvent.html +7 -2
  194. package/docs/interfaces/five.PBMClipperParameter.html +2 -2
  195. package/docs/interfaces/five.PBMCustomShaderInitArgs.html +2 -2
  196. package/docs/interfaces/five.PBMCustomShaderSlots.html +2 -2
  197. package/docs/interfaces/five.PBMMaterial.html +1 -1
  198. package/docs/interfaces/five.PBMMeshMaterialParameters.html +5 -3
  199. package/docs/interfaces/five.PBMPanoDepth.html +5 -5
  200. package/docs/interfaces/five.PBMPanoFilterValue.html +6 -0
  201. package/docs/interfaces/five.PBMPanoPicture.html +8 -6
  202. package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +2 -3
  203. package/docs/interfaces/five.PBMRefinedScreen.html +2 -2
  204. package/docs/interfaces/five.PanoCircleMeshInterface.html +2 -2
  205. package/docs/interfaces/five.PanoEvent.html +15 -2
  206. package/docs/interfaces/five.PanoPrepareEvent.html +15 -0
  207. package/docs/interfaces/five.PanoTextureEvent.html +11 -2
  208. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
  209. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
  210. package/docs/interfaces/five.ParameterMaterialValue.html +40 -38
  211. package/docs/interfaces/five.ParameterTilesetValue.html +15 -15
  212. package/docs/interfaces/five.ParameterValue.html +54 -52
  213. package/docs/interfaces/five.Pose.html +1 -1
  214. package/docs/interfaces/five.RenderEvent.html +7 -2
  215. package/docs/interfaces/five.ResolvedParameterValue.html +55 -54
  216. package/docs/interfaces/five.RgbaData.html +7 -0
  217. package/docs/interfaces/five.SplatData.html +2 -2
  218. package/docs/interfaces/five.State.html +1 -1
  219. package/docs/interfaces/five.StateEvent.html +9 -2
  220. package/docs/interfaces/five.TextureOptions.html +1 -1
  221. package/docs/interfaces/five.Tile3DOptions.html +2 -2
  222. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -7
  223. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
  224. package/docs/interfaces/five.ViewLayer.html +24 -24
  225. package/docs/interfaces/five.WorkCubeImage.html +3 -2
  226. package/docs/interfaces/five.WorkImage.html +6 -5
  227. package/docs/interfaces/five.WorkInitial.html +8 -8
  228. package/docs/interfaces/five.WorkModel.html +8 -8
  229. package/docs/interfaces/five.WorkModelLayer.html +6 -6
  230. package/docs/interfaces/five.WorkObserver.html +29 -29
  231. package/docs/interfaces/five.WorkObserverJson.html +2 -2
  232. package/docs/interfaces/five.WorkObserverProto.html +26 -0
  233. package/docs/interfaces/five.WorkPanoramaJson.html +2 -2
  234. package/docs/interfaces/five.WorkTile.html +6 -5
  235. package/docs/interfaces/five.WorkVideo.html +4 -4
  236. package/docs/interfaces/five.WorksEvent.html +7 -2
  237. package/docs/interfaces/five.XRControllerEvent.html +10 -2
  238. package/docs/interfaces/five.XRControllerState.html +8 -0
  239. package/docs/interfaces/five.XRGestureEvent.html +13 -2
  240. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
  241. package/docs/interfaces/five.XRSessionEvent.html +9 -2
  242. package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
  243. package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
  244. package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
  245. package/docs/interfaces/plugins.CSS2DPluginController.html +49 -0
  246. package/docs/interfaces/plugins.CSS2DPluginType.Config.html +2 -0
  247. package/docs/interfaces/plugins.CSS2DPluginType.CreateCSS2DObjectType.html +8 -0
  248. package/docs/interfaces/plugins.CSS2DPluginType.EventMap.html +10 -0
  249. package/docs/interfaces/plugins.CSS2DPluginType.Params.html +4 -0
  250. package/docs/interfaces/plugins.CSS2DPluginType.State.html +8 -0
  251. package/docs/interfaces/plugins.CSS2DRendererParameters.html +2 -0
  252. package/docs/interfaces/plugins.CSS3DPluginController.html +52 -0
  253. package/docs/interfaces/plugins.CSS3DPluginType.Config.html +2 -0
  254. package/docs/interfaces/plugins.CSS3DPluginType.CreateCSS3DObjectType.html +10 -0
  255. package/docs/interfaces/plugins.CSS3DPluginType.EventMap.html +10 -0
  256. package/docs/interfaces/plugins.CSS3DPluginType.Params.html +4 -0
  257. package/docs/interfaces/plugins.CSS3DPluginType.State.html +8 -0
  258. package/docs/interfaces/plugins.CSS3DRendererParameters.html +2 -0
  259. package/docs/interfaces/plugins.DynamicPathLinePluginController.html +3 -3
  260. package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
  261. package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
  262. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationController.html +44 -0
  263. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.BoundingAABB2D.html +3 -0
  264. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.Config.html +8 -0
  265. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.EventMap.html +10 -0
  266. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.Keyframe.html +3 -0
  267. package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.State.html +8 -0
  268. package/docs/interfaces/plugins.ItemMaskController.html +1 -1
  269. package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
  270. package/docs/interfaces/plugins.ItemMaskPluginType.State.html +2 -2
  271. package/docs/interfaces/plugins.Object3DHelperPluginType.BaseController.html +30 -0
  272. package/docs/interfaces/plugins.Object3DHelperPluginType.BaseHelper.html +22 -0
  273. package/docs/interfaces/plugins.Object3DHelperPluginType.BoundingBoxController.html +30 -0
  274. package/docs/interfaces/plugins.Object3DHelperPluginType.HelperOffset.html +4 -0
  275. package/docs/interfaces/plugins.Object3DHelperPluginType.MoveController.html +36 -0
  276. package/docs/interfaces/plugins.Object3DHelperPluginType.MoveHelperAbstract.html +32 -0
  277. package/docs/interfaces/plugins.Object3DHelperPluginType.Object3DHelper.html +12 -0
  278. package/docs/interfaces/plugins.Object3DHelperPluginType.Object3DHelperPluginState.html +4 -0
  279. package/docs/interfaces/plugins.Object3DHelperPluginType.Object3DHelperState.html +4 -0
  280. package/docs/interfaces/plugins.Object3DHelperPluginType.ObjectHelperControllers.html +4 -0
  281. package/docs/interfaces/plugins.Object3DHelperPluginType.RotateController.html +36 -0
  282. package/docs/interfaces/plugins.Object3DHelperPluginType.RotateHelperAbstract.html +28 -0
  283. package/docs/interfaces/plugins.Object3DHelperPluginType.Scissor.html +5 -0
  284. package/docs/interfaces/plugins.Object3DHelperPluginType.Vector2Position.html +3 -0
  285. package/docs/interfaces/plugins.Object3DHelperPluginType.Vector3Position.html +4 -0
  286. package/docs/interfaces/plugins.OrientationPluginController.html +6 -6
  287. package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
  288. package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
  289. package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
  290. package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
  291. package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
  292. package/docs/interfaces/plugins.PlayingState.html +2 -2
  293. package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
  294. package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
  295. package/docs/interfaces/plugins.TrajectoryController.html +8 -8
  296. package/docs/interfaces/react.FiveAppProps.html +11 -0
  297. package/docs/interfaces/react.FiveInjectionTypes.html +21 -21
  298. package/docs/interfaces/sticker.IntersectionLike.html +2 -2
  299. package/docs/interfaces/vfx.ParticleArgs.html +4 -4
  300. package/docs/interfaces/vue.FiveActionVueCallbacks.html +3 -3
  301. package/docs/modules/five.html +1 -1
  302. package/docs/modules/plugins.CSS2DPluginType.html +1 -0
  303. package/docs/modules/plugins.CSS3DPluginType.html +1 -0
  304. package/docs/modules/plugins.GaussianSplattingEntranceAnimationPluginType.html +1 -0
  305. package/docs/modules/plugins.Object3DHelperPluginType.html +1 -0
  306. package/docs/modules/plugins.html +1 -1
  307. package/docs/modules/react.html +1 -1
  308. package/docs/modules.html +1 -1
  309. package/docs/types/five.ControllerEventTypes.html +30 -26
  310. package/docs/types/five.EasingFunction.html +1 -0
  311. package/docs/types/five.EventTypes.html +26 -26
  312. package/docs/types/five.LegacyEventType.html +7 -7
  313. package/docs/types/five.PBMAlphaMode.html +1 -1
  314. package/docs/types/five.PBMColorStyle.html +1 -1
  315. package/docs/types/five.PBMFloorStyle.html +1 -1
  316. package/docs/types/five.PBMMeshShaderType.html +1 -1
  317. package/docs/types/five.PBMPointBack.html +1 -1
  318. package/docs/types/five.PBMPointCloudShaderType.html +1 -1
  319. package/docs/types/five.PBMPointShape.html +1 -1
  320. package/docs/types/five.PBMPointSize.html +1 -1
  321. package/docs/types/five.PBMTransition.html +1 -1
  322. package/docs/types/five.ParseOptions.html +6 -6
  323. package/docs/types/five.Works.html +1 -1
  324. package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
  325. package/docs/types/plugins.CSS2DPluginType.PluginData.html +1 -0
  326. package/docs/types/plugins.CSS2DPluginType.ServerData.html +1 -0
  327. package/docs/types/plugins.CSS3DPluginType.PluginData.html +1 -0
  328. package/docs/types/plugins.CSS3DPluginType.ServerData.html +1 -0
  329. package/docs/types/plugins.Object3DHelperPluginType.AddObject3DHelperConfig.html +13 -0
  330. package/docs/types/plugins.Object3DHelperPluginType.Circle.html +1 -0
  331. package/docs/types/plugins.Object3DHelperPluginType.Color.html +1 -0
  332. package/docs/types/plugins.Object3DHelperPluginType.Direction.html +1 -0
  333. package/docs/types/plugins.Object3DHelperPluginType.Direction4.html +1 -0
  334. package/docs/types/plugins.Object3DHelperPluginType.HelperConfig.html +1 -0
  335. package/docs/types/plugins.Object3DHelperPluginType.HelperEventMap.html +17 -0
  336. package/docs/types/plugins.Object3DHelperPluginType.InternalHelperEventMap.html +8 -0
  337. package/docs/types/plugins.Object3DHelperPluginType.Object3DHelperEventMap.html +1 -0
  338. package/docs/types/plugins.Object3DHelperPluginType.Object3DHelperPluginEventMap.html +7 -0
  339. package/docs/types/plugins.Object3DHelperPluginType.PositionFrom.html +1 -0
  340. package/docs/types/plugins.Object3DHelperPluginType.ScaleCallback.html +1 -0
  341. package/docs/types/plugins.Object3DHelperPluginType.ScalePosition.html +4 -0
  342. package/docs/types/plugins.Object3DHelperPluginType.UseFaceNormalInterface.html +4 -0
  343. package/docs/types/plugins.Object3DHelperPluginType.Vector2WithArray.html +1 -0
  344. package/docs/types/plugins.Object3DHelperPluginType.Vector3WithArray.html +1 -0
  345. package/docs/variables/five.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
  346. package/docs/variables/react.FiveApp.html +3 -0
  347. package/docs/variables/react.FiveAutoCanvas.html +3 -0
  348. package/five/application/events.d.ts +1 -1
  349. package/five/application/five.d.ts +6 -5
  350. package/five/bvh/bvhObject.d.ts +2 -2
  351. package/five/controllers/base.d.ts +1 -0
  352. package/five/controllers/events.d.ts +5 -1
  353. package/five/controllers/mapview.d.ts +1 -0
  354. package/five/controllers/model.d.ts +2 -2
  355. package/five/controllers/panorama.d.ts +3 -2
  356. package/five/controllers/xrPanorama.d.ts +1 -1
  357. package/five/core/camera.d.ts +1 -1
  358. package/five/gaussian-splatting/util/renderData.d.ts +66 -0
  359. package/five/index.d.ts +4 -1
  360. package/five/index.js +272 -782
  361. package/five/index.mjs +26894 -32056
  362. package/five/meshes/boundingMesh.d.ts +1 -0
  363. package/five/model/index.d.ts +2 -2
  364. package/five/model/loaders/glTF-helpers/extensions/KHR_binary_glTF.d.ts +1 -1
  365. package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting.d.ts +26 -0
  366. package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz.d.ts +7 -5
  367. package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz_2.d.ts +13 -0
  368. package/five/model/loaders/glTF-helpers/extensions/base.d.ts +2 -1
  369. package/five/model/loaders/glTF-helpers/index.d.ts +4 -0
  370. package/five/model/loaders/glTF-helpers/parser.d.ts +2 -1
  371. package/five/model/loaders/spz.d.ts +2 -2
  372. package/five/model/materials/pbmMaterial.d.ts +54 -4
  373. package/five/model/materials/pbmMeshMaterial.d.ts +5 -3
  374. package/five/model/materials/pbmPointCloudMaterial.d.ts +0 -2
  375. package/five/model/objects/{pbmGSObject.d.ts → pbmGaussianSplattingObject.d.ts} +4 -1
  376. package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +59 -0
  377. package/five/model/objects/pbmGaussianSplattingTestMesh.d.ts +7 -0
  378. package/five/model/parameter.d.ts +11 -6
  379. package/five/model/tile3d/index.d.ts +5 -3
  380. package/five/model/tile3d/tile-node.d.ts +2 -2
  381. package/five/model/tile3d/tileset.d.ts +1 -0
  382. package/five/renderer/postprocessing/passes/adaptive-luminance-pass.d.ts +9 -7
  383. package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +6 -1
  384. package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +3 -1
  385. package/five/renderer/tools/render-cube-to-equirectangular.d.ts +7 -0
  386. package/five/renderer/tools/render-full-screen.d.ts +1 -1
  387. package/five/texture/histogram.d.ts +54 -0
  388. package/five/texture/loader.d.ts +1 -1
  389. package/five/texture/textureData.d.ts +11 -0
  390. package/five/thirdparty/hammer.d.ts +371 -255
  391. package/five/thirdparty/jsrsasign.d.ts +5 -20
  392. package/five/types/movePanoOptions.d.ts +4 -3
  393. package/five/utils/error.d.ts +1 -0
  394. package/five/utils/event.d.ts +98 -37
  395. package/five/utils/imageURL.d.ts +1 -1
  396. package/five/utils/memoryUsage.d.ts +2 -2
  397. package/five/utils/subscribe.d.ts +2 -2
  398. package/five/webxr/motionHelper.d.ts +1 -1
  399. package/five/work/index.d.ts +1 -0
  400. package/five/work/looseWorkType.d.ts +2 -2
  401. package/five/work/work.d.ts +5 -35
  402. package/five/work/workJsonType.d.ts +2 -2
  403. package/five/work/workObserverProto.d.ts +39 -0
  404. package/gltf-loader/index.js +9 -9
  405. package/gltf-loader/index.mjs +1351 -1451
  406. package/line/index.js +4 -4
  407. package/line/index.mjs +334 -513
  408. package/llms.txt +37 -1
  409. package/package.json +4 -4
  410. package/plugins/CSS2DPlugin/Controller.d.ts +59 -0
  411. package/plugins/CSS2DPlugin/index.d.ts +5 -0
  412. package/plugins/CSS2DPlugin/typing.d.ts +30 -0
  413. package/plugins/CSS3DPlugin/Controller.d.ts +64 -0
  414. package/plugins/CSS3DPlugin/index.d.ts +5 -0
  415. package/plugins/CSS3DPlugin/typing.d.ts +32 -0
  416. package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.d.ts +30 -0
  417. package/plugins/GaussianSplattingEntranceAnimationPlugin/index.d.ts +5 -0
  418. package/plugins/GaussianSplattingEntranceAnimationPlugin/typing.d.ts +28 -0
  419. package/plugins/Object3DHelperPlugin/Controller.d.ts +99 -0
  420. package/plugins/Object3DHelperPlugin/Controllers/BaseController.d.ts +142 -0
  421. package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.d.ts +16 -0
  422. package/plugins/Object3DHelperPlugin/Controllers/MoveController.d.ts +66 -0
  423. package/plugins/Object3DHelperPlugin/Controllers/RotateController.d.ts +61 -0
  424. package/plugins/Object3DHelperPlugin/FiveControllerWrapper.d.ts +17 -0
  425. package/plugins/Object3DHelperPlugin/Helper/BaseHelper.d.ts +97 -0
  426. package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.d.ts +16 -0
  427. package/plugins/Object3DHelperPlugin/Helper/MoveHelper.d.ts +37 -0
  428. package/plugins/Object3DHelperPlugin/Helper/RotateHelper.d.ts +93 -0
  429. package/plugins/Object3DHelperPlugin/constant.d.ts +27 -0
  430. package/plugins/Object3DHelperPlugin/index.d.ts +6 -0
  431. package/plugins/Object3DHelperPlugin/typing.d.ts +143 -0
  432. package/plugins/Object3DHelperPlugin/utils/ArrowGroup.d.ts +22 -0
  433. package/plugins/Object3DHelperPlugin/utils/CenterHandle.d.ts +23 -0
  434. package/plugins/Object3DHelperPlugin/utils/PlaneHandle.d.ts +19 -0
  435. package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.d.ts +5 -0
  436. package/plugins/Object3DHelperPlugin/utils/cameraHooks.d.ts +2 -0
  437. package/plugins/Object3DHelperPlugin/utils/direction.d.ts +14 -0
  438. package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.d.ts +5 -0
  439. package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.d.ts +8 -0
  440. package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.d.ts +8 -0
  441. package/plugins/Object3DHelperPlugin/utils/solidGuide.d.ts +27 -0
  442. package/plugins/Object3DHelperPlugin/utils/tipsDom.d.ts +8 -0
  443. package/plugins/TrajectoryPlugin/Controller.d.ts +1 -1
  444. package/plugins/index.d.ts +6 -1
  445. package/plugins/index.js +55 -21
  446. package/plugins/index.mjs +5582 -4238
  447. package/plugins/thirdParty/CSS2DRenderer.d.ts +37 -0
  448. package/plugins/thirdParty/CSS3DRenderer.d.ts +16 -3
  449. package/plugins/thirdParty/domevents.d.ts +36 -0
  450. package/plugins/utils/uuid.d.ts +1 -4
  451. package/react/autoCanvas.d.ts +9 -0
  452. package/react/context.d.ts +3 -2
  453. package/react/createProvider.d.ts +4 -4
  454. package/react/createStore.d.ts +3 -3
  455. package/react/fiveApp.d.ts +22 -0
  456. package/react/hooks/useFivePlugin.d.ts +26 -0
  457. package/react/hooks/useFiveProject2d.d.ts +1 -1
  458. package/react/index.d.ts +4 -0
  459. package/react/index.js +3 -3
  460. package/react/index.mjs +687 -782
  461. package/react/rendererPool.d.ts +2 -2
  462. package/react/withFive.d.ts +1 -1
  463. package/shader-lib/index.js +13 -14
  464. package/shader-lib/index.mjs +424 -824
  465. package/sticker/index.js +3 -3
  466. package/sticker/index.mjs +102 -142
  467. package/umd/five-gltf-loader.js +9 -9
  468. package/umd/five-line.js +4 -4
  469. package/umd/five-plugins.js +55 -21
  470. package/umd/five-react.js +3 -3
  471. package/umd/five-shader-lib.js +13 -14
  472. package/umd/five-sticker.js +3 -3
  473. package/umd/five-vfx.js +21 -21
  474. package/umd/five-vue.js +3 -3
  475. package/umd/five.js +267 -777
  476. package/vfx/index.js +21 -21
  477. package/vfx/index.mjs +454 -910
  478. package/vue/index.js +3 -3
  479. package/vue/index.mjs +309 -301
  480. package/vue/rendererPool.d.ts +5 -5
  481. package/work-downloader/index.js +3 -3
  482. package/work-downloader/index.mjs +339 -556
  483. package/five/gs/util/renderData.d.ts +0 -32
  484. package/five/model/objects/pbmGSRenderMesh.d.ts +0 -29
  485. package/five/work/workObserverUtils.d.ts +0 -36
  486. /package/five/assets/{realsee-pmg-data-url.d.ts → realsee-png-data-url.d.ts} +0 -0
  487. /package/five/{gs → gaussian-splatting}/wasm/data.d.ts +0 -0
  488. /package/five/{gs → gaussian-splatting}/wasm/sort.d.ts +0 -0
  489. /package/five/{gs → gaussian-splatting}/worker/dataWorker.d.ts +0 -0
  490. /package/five/{gs → gaussian-splatting}/worker/sortWorker.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import * as THREE from "three";
2
2
  declare function getRenderer({ preserveDrawingBuffer, webgl2 }?: {
3
- preserveDrawingBuffer?: boolean;
4
- webgl2?: boolean;
3
+ preserveDrawingBuffer?: boolean | undefined;
4
+ webgl2?: boolean | undefined;
5
5
  }): THREE.WebGLRenderer | undefined;
6
6
  declare function revokeRenderer(renderer?: THREE.WebGLRenderer): void;
7
7
  export { getRenderer, revokeRenderer };
@@ -208,6 +208,6 @@ interface FiveInjectionTypes extends Subscribe<EventTypes> {
208
208
  interface PropTypeOfFiveFeatures<F extends FiveInjectionFeature[]> {
209
209
  [INJECTION_PROPNAME]: Pick<FiveInjectionTypes, F[number]>;
210
210
  }
211
- declare function withFive<F extends FiveInjectionFeature[]>(features: F): <P extends PropTypeOfFiveFeatures<F>, C extends React.ComponentClass<P>>(Component: C & React.ComponentClass<P>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<Omit<P, "$five">> & React.RefAttributes<Omit<InstanceType<C>, "render" | "context" | "state" | "setState" | "componentDidMount" | "shouldComponentUpdate" | "componentWillUnmount" | "componentDidCatch" | "getSnapshotBeforeUpdate" | "componentDidUpdate" | "componentWillMount" | "UNSAFE_componentWillMount" | "componentWillReceiveProps" | "UNSAFE_componentWillReceiveProps" | "componentWillUpdate" | "UNSAFE_componentWillUpdate" | "forceUpdate" | "props" | "refs">>>;
211
+ declare function withFive<F extends FiveInjectionFeature[]>(features: F): <P extends PropTypeOfFiveFeatures<F>, C extends React.ComponentClass<P>>(Component: C & React.ComponentClass<P>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<Omit<P, "$five">> & React.RefAttributes<Omit<InstanceType<C>, "render" | "context" | "state" | "setState" | "forceUpdate" | "componentDidMount" | "shouldComponentUpdate" | "componentWillUnmount" | "componentDidCatch" | "getSnapshotBeforeUpdate" | "componentDidUpdate" | "componentWillMount" | "UNSAFE_componentWillMount" | "componentWillReceiveProps" | "UNSAFE_componentWillReceiveProps" | "componentWillUpdate" | "UNSAFE_componentWillUpdate" | "props" | "refs">>>;
212
212
  declare function createFiveFeature<T extends FiveInjectionFeature>(...features: T[]): T[];
213
213
  export { createFiveFeature, withFive, INJECTION_PROPNAME, PropTypeOfFiveFeatures, FiveInjectionTypes, FiveInjectionFeature, FiveInjectionDataFeature, FiveInjectionActionFeature, };
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/2/26
5
- * Version: 6.8.0-alpha.9
4
+ * Generated: 2026/4/28
5
+ * Version: 6.8.1
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,7 +252,7 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("@realsee/five"),k=require("three");function R(a){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>a[e]})}}return n.default=a,Object.freeze(n)}const l=R(k);var M=function(a,n){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])},M(a,n)};function b(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");M(a,n);function e(){this.constructor=a}a.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}function V(a,n,e,o){function t(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function f(u){try{i(o.next(u))}catch(d){s(d)}}function c(u){try{i(o.throw(u))}catch(d){s(d)}}function i(u){u.done?r(u.value):t(u.value).then(f,c)}i((o=o.apply(a,n||[])).next())})}function W(a,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,t,r,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=f(0),s.throw=f(1),s.return=f(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function f(i){return function(u){return c([i,u])}}function c(i){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,i[0]&&(e=0)),e;)try{if(o=1,t&&(r=i[0]&2?t.return:i[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,i[1])).done)return r;switch(t=0,r&&(i=[i[0]&2,r.value]),i[0]){case 0:case 1:r=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,t=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!r||i[1]>r[0]&&i[1]<r[3])){e.label=i[1];break}if(i[0]===6&&e.label<r[1]){e.label=r[1],r=i;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(i);break}r[2]&&e.ops.pop(),e.trys.pop();continue}i=n.call(a,e)}catch(u){i=[6,u],t=0}finally{o=r=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}function T(a,n,e){if(e||arguments.length===2)for(var o=0,t=n.length,r;o<t;o++)(r||!(o in n))&&(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return a.concat(r||Array.prototype.slice.call(n))}var L=`
255
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@realsee/five`),l=require(`three`);l=s(l);var u={type:[`pointcloud`],fragment:{mainBefore:`
256
256
  #if defined(USE_PLANE_DISTANCE)
257
257
  struct Plane {
258
258
  vec3 normal;
@@ -263,7 +263,7 @@
263
263
  uniform float evennessPlaneConstant;
264
264
  uniform float evennessPlaneDepth;
265
265
  #endif
266
- `,j=`
266
+ `,mainStart:``,mainEnd:`
267
267
  #if defined(USE_PLANE_DISTANCE)
268
268
 
269
269
  bool inside = true;
@@ -283,7 +283,7 @@
283
283
  }
284
284
  }
285
285
  #endif
286
- `,J="",H={type:["pointcloud"],fragment:{mainBefore:L,mainStart:J,mainEnd:j},uniforms:{evennessPlaneNormal:new l.Uniform(new l.Vector3),evennessPlaneConstant:new l.Uniform(0),evennessPlanes:new l.Uniform([]),evennessPlaneDepth:new l.Uniform(0)},defines:{USE_PLANE_DISTANCE:!1}},q=(function(a){b(n,a);function n(){var e=a.call(this,H)||this;return Object.defineProperties(e,{evennessPlane:{get:function(){return{depth:this.uniforms.evennessPlaneDepth.value,points:this.uniforms.evennessPoints.value}},set:function(o){var t=o.points,r=o.depth,s=!1;if(t.length!==0&&t.length%4===0){s=!0;var f=t[0],c=t[1],i=t[2],u=t[3],d=new l.Vector3().subVectors(c,f),h=new l.Vector3().subVectors(i,f),m=new l.Vector3().crossVectors(d,h).normalize(),y=-m.dot(f),p=r,g=f.clone().add(m.clone().negate().multiplyScalar(p)),v=f.clone().add(m.clone().multiplyScalar(p)),x=c.clone().add(m.clone().negate().multiplyScalar(p)),P=c.clone().add(m.clone().multiplyScalar(p)),w=i.clone().add(m.clone().negate().multiplyScalar(p)),C=i.clone().add(m.clone().multiplyScalar(p)),B=u.clone().add(m.clone().negate().multiplyScalar(p)),E=u.clone().add(m.clone().multiplyScalar(p)),S=new l.Plane().setFromCoplanarPoints(v,P,C),_=new l.Plane().setFromCoplanarPoints(w,x,g),z=new l.Plane().setFromCoplanarPoints(P,v,g),O=new l.Plane().setFromCoplanarPoints(B,E,C),N=new l.Plane().setFromCoplanarPoints(C,P,x),D=new l.Plane().setFromCoplanarPoints(g,v,E);this.uniforms.evennessPlanes.value=[{normal:S.normal,constant:S.constant},{normal:_.normal,constant:_.constant},{normal:z.normal,constant:z.constant},{normal:O.normal,constant:O.constant},{normal:N.normal,constant:N.constant},{normal:D.normal,constant:D.constant}],this.uniforms.evennessPlaneDepth.value=r,this.uniforms.evennessPlaneNormal.value=m,this.uniforms.evennessPlaneConstant.value=y}this.defines.USE_PLANE_DISTANCE=s,this.needsUpdate=!0}}}),e.evennessPlane={depth:0,points:[]},e}return n})(F.CustomShader),G=`
286
+ `},uniforms:{evennessPlaneNormal:new l.Uniform(new l.Vector3),evennessPlaneConstant:new l.Uniform(0),evennessPlanes:new l.Uniform([]),evennessPlaneDepth:new l.Uniform(0)},defines:{USE_PLANE_DISTANCE:!1}},d=class extends c.CustomShader{constructor(){super(u),Object.defineProperties(this,{evennessPlane:{get(){return{depth:this.uniforms.evennessPlaneDepth.value,points:this.uniforms.evennessPoints.value}},set(e){let{points:t,depth:n}=e,r=!1;if(t.length!==0&&t.length%4==0){r=!0;let e=t[0],i=t[1],a=t[2],o=t[3],s=new l.Vector3().subVectors(i,e),c=new l.Vector3().subVectors(a,e),u=new l.Vector3().crossVectors(s,c).normalize(),d=-u.dot(e),f=n,p=e.clone().add(u.clone().negate().multiplyScalar(f)),m=e.clone().add(u.clone().multiplyScalar(f)),h=i.clone().add(u.clone().negate().multiplyScalar(f)),g=i.clone().add(u.clone().multiplyScalar(f)),_=a.clone().add(u.clone().negate().multiplyScalar(f)),v=a.clone().add(u.clone().multiplyScalar(f)),y=o.clone().add(u.clone().negate().multiplyScalar(f)),b=o.clone().add(u.clone().multiplyScalar(f)),x=new l.Plane().setFromCoplanarPoints(m,g,v),S=new l.Plane().setFromCoplanarPoints(_,h,p),C=new l.Plane().setFromCoplanarPoints(g,m,p),w=new l.Plane().setFromCoplanarPoints(y,b,v),T=new l.Plane().setFromCoplanarPoints(v,g,h),E=new l.Plane().setFromCoplanarPoints(p,m,b);this.uniforms.evennessPlanes.value=[{normal:x.normal,constant:x.constant},{normal:S.normal,constant:S.constant},{normal:C.normal,constant:C.constant},{normal:w.normal,constant:w.constant},{normal:T.normal,constant:T.constant},{normal:E.normal,constant:E.constant}],this.uniforms.evennessPlaneDepth.value=n,this.uniforms.evennessPlaneNormal.value=u,this.uniforms.evennessPlaneConstant.value=d}this.defines.USE_PLANE_DISTANCE=r,this.needsUpdate=!0}}}),this.evennessPlane={depth:0,points:[]}}},f=`
287
287
  #if NUM_SWEEP_OBJECTS > 0
288
288
  uniform float sweepProgress;
289
289
  uniform float sweepRange;
@@ -296,7 +296,7 @@
296
296
  };
297
297
  uniform SWEEP_OBJECT sweepBoxs[NUM_SWEEP_OBJECTS];
298
298
  #endif
299
- `,$=`
299
+ `,p=`
300
300
 
301
301
  #if NUM_SWEEP_OBJECTS > 0
302
302
  #pragma unroll_loop_start
@@ -329,7 +329,7 @@
329
329
  }
330
330
  #pragma unroll_loop_end
331
331
  #endif
332
- `,Y="",Q=(function(a){b(n,a);function n(){var e=a.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:G,mainStart:Y,mainEnd:$},uniforms:{sweepProgress:new l.Uniform(0),sweepRange:new l.Uniform(0),sweepBoxs:new l.Uniform([]),interval:new l.Uniform(.04),threshold:new l.Uniform(.002)},defines:{NUM_SWEEP_OBJECTS:0}})||this;return Object.defineProperties(e,{sweepBoxs:{get:function(){return this.uniforms.sweepBoxs.value},set:function(o){var t=o.length;t>0&&(this.defines.NUM_SWEEP_OBJECTS=t,this.needsUpdate=!0,this.uniforms.sweepBoxs.value=o)}}}),e.sweepBoxs=[],e}return n.prototype.onBeforeCompile=function(e,o){var t=String(this.sweepBoxs.length);e.vertexShader=e.vertexShader.replace(/NUM_SWEEP_OBJECTS/g,t),e.fragmentShader=e.fragmentShader.replace(/NUM_SWEEP_OBJECTS/g,t)},n})(F.CustomShader),K=`
332
+ `,m=``,h=class extends c.CustomShader{constructor(){super({type:[`basic`,`phong`,`pointcloud`],fragment:{mainBefore:f,mainStart:m,mainEnd:p},uniforms:{sweepProgress:new l.Uniform(0),sweepRange:new l.Uniform(0),sweepBoxs:new l.Uniform([]),interval:new l.Uniform(.04),threshold:new l.Uniform(.002)},defines:{NUM_SWEEP_OBJECTS:0}}),Object.defineProperties(this,{sweepBoxs:{get(){return this.uniforms.sweepBoxs.value},set(e){let t=e.length;t>0&&(this.defines.NUM_SWEEP_OBJECTS=t,this.needsUpdate=!0,this.uniforms.sweepBoxs.value=e)}}}),this.sweepBoxs=[]}onBeforeCompile(e,t){let n=String(this.sweepBoxs.length);e.vertexShader=e.vertexShader.replace(/NUM_SWEEP_OBJECTS/g,n),e.fragmentShader=e.fragmentShader.replace(/NUM_SWEEP_OBJECTS/g,n)}},g=`
333
333
  uniform float pointCloudExpand_progress;
334
334
 
335
335
  vec4 pointCloudExpand_permute(vec4 x) { return mod(((x * 34.0) + 1.0) * x, 289.0); }
@@ -402,7 +402,7 @@ float pointCloudExpand_gln_simplex(vec3 v) {
402
402
  m = m * m;
403
403
  return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));
404
404
  }
405
- `,Z=`
405
+ `,_=`
406
406
  float pointCloudExpand_sizeScale = 1.0;
407
407
  float pointCloudExpand_sizeBasis = 0.0;
408
408
  vec4 pointCloudExpand_basis = vec4((modelBoundingMax + modelBoundingMin) / 2.0, 1.0);
@@ -416,8 +416,7 @@ float pointCloudExpand_progress2 = step(pointCloudExpand_progress, 1.0 - pointCl
416
416
  pointCloudExpand_sizeBasis = mix(0.1 * step(abs(pointCloudExpand_noise), 0.5 / pointCloudExpand_boundingRadius), pointCloudExpand_sizeBasis, pointCloudExpand_progress2);
417
417
  gl_PointSize = gl_PointSize * pointCloudExpand_sizeScale + pointCloudExpand_sizeBasis;
418
418
  vPointSize = gl_PointSize;
419
- `,X=(function(a){b(n,a);function n(){return a.call(this,{type:["pointcloud"],vertex:{mainBefore:K,mainEnd:Z},uniforms:{pointCloudExpand_progress:new l.Uniform(0)}})||this}return Object.defineProperty(n.prototype,"progress",{get:function(){return this.uniforms.pointCloudExpand_progress.value},set:function(e){this.uniforms.pointCloudExpand_progress.value=e},enumerable:!1,configurable:!0}),n})(F.CustomShader);const U=`(function(){"use strict";function P(n){onmessage=function(a){Promise.resolve(a.data).then(function(t){return n(t)}).then(function(t){var v=t.output,r=t.transfer;return postMessage(v,r)}).catch(function(t){return postMessage({$$error:t})})}}function y(n,a,t){var v=new OffscreenCanvas(a,t),r=v.getContext("2d");if(!r)throw new Error("Failed to get canvas context");r.clearRect(0,0,a,t),r.fillStyle="rgba(0,0,0,1.0)",r.beginPath();var o=n[0][0],i=n[0][0],u=n[0][1],m=n[0][1];n.forEach(function(e){var f=e[0],s=e[1];o=Math.min(o,f),i=Math.max(i,f),u=Math.min(u,s),m=Math.max(m,s)});var g=i-o,c=m-u,h=g>=c?a/g:a/c,x=n.map(function(e){var f=e[0]-o,s=e[1]-u;return[f,s]}),l=x.map(function(e){return[e[0]*h,e[1]*h]});return l.forEach(function(e,f){var s=e[0],D=e[1];f===0?r.moveTo(s,D):r.lineTo(s,D)}),r.closePath(),r.fill(),r.getImageData(0,0,a,t)}function M(n,a,t){for(var v=new ImageData(a,t),r=n.map(function(s){return y(s.polygon,s.width,s.height)}),o=0;o<a;o++)for(var i=0;i<t;i++){for(var u=0,m=0,g=0,c=0;c<r.length;c++){var h=r[c].data,x=(o+i*a)*4;if(h[x+3]===255){var l=c%8,e=Math.floor(c/8);e===0?u=u|1<<l:e===1?m=m|1<<l:e===2&&(g=g|1<<l)}}var f=(o+i*a)*4;v.data[f]=u,v.data[f+1]=m,v.data[f+2]=g,v.data[f+3]=255}return v}P(function(n){return Promise.resolve(n).then(function(a){var t=a.canvasDataList,v=a.width,r=a.height,o=M(t,v,r);return{output:{imageData:o},transfer:[o.data.buffer]}})})})();
420
- `,I=typeof self!="undefined"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",U],{type:"text/javascript;charset=utf-8"});function ee(a){let n;try{if(n=I&&(self.URL||self.webkitURL).createObjectURL(I),!n)throw"";const e=new Worker(n,{name:a==null?void 0:a.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),e}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(U),{name:a==null?void 0:a.name})}}var ne=(function(){function a(n,e){this.disposed=!1,this.pool=e,this.workerCreator=n,this.queue=[],this.workers=[],this.workerResolvers=[],this.workerStatus=0}return a.prototype.setWorkerCreator=function(n){this.workerCreator=n},a.prototype.initWorker=function(n){if(!this.workerCreator)throw new Error("workerCreator is not defined");if(!this.workers[n]){var e=this.workerCreator(n);e.addEventListener("message",this.onMessage.bind(this,n)),this.workers[n]=e}},a.prototype.getIdleWorker=function(){for(var n=0;n<this.pool;n++)if(!(this.workerStatus&1<<n))return n;return-1},a.prototype.onMessage=function(n,e){var o=this.workerResolvers[n];if(e.data&&"$$error"in e.data?o==null||o.reject(e.data.$$error):o==null||o.resolve(e.data),this.workerResolvers[n]=void 0,this.queue.length){var t=this.queue.shift(),r=t.resolve,s=t.reject,f=t.input,c=t.transfer;this.workerResolvers[n]={resolve:r,reject:s},this.workers[n].postMessage(f,c)}else this.workerStatus^=1<<n},a.prototype.postMessage=function(n,e){var o=this;return e===void 0&&(e=[]),new Promise(function(t,r){if(o.disposed){r(new Error("disposed"));return}var s=o.getIdleWorker();s!==-1?(o.initWorker(s),o.workerStatus|=1<<s,o.workerResolvers[s]={resolve:t,reject:r},o.workers[s].postMessage(n,e)):o.queue.push({resolve:t,reject:r,input:n,transfer:e})})},a.prototype.dispose=function(){this.disposed=!0,this.workers.forEach(function(n){n.terminate()}),this.workers.length=0,this.workerResolvers.forEach(function(n){n==null||n.reject(new Error("disposed"))}),this.workerResolvers.length=0,this.queue.forEach(function(n){n.reject(new Error("disposed"))}),this.queue.length=0,this.workerStatus=0},a})();function oe(a){if(a.length<3)throw new Error("At least 3 points are required to compute alignment matrix");var n=a[0],e=a[1],o=a[2],t=new l.Vector3().subVectors(e,n),r=new l.Vector3().subVectors(o,n),s=new l.Vector3().crossVectors(t,r);if(s.lengthSq()<1e-4)for(var f=3;f<a.length&&(o=a[f],r=new l.Vector3().subVectors(o,n),s=new l.Vector3().crossVectors(t,r),!(s.lengthSq()>=1e-4));f++);if(s.lengthSq()<1e-4)throw new Error("All points are collinear, cannot compute normal");s.normalize();var c=new l.Vector3;a.forEach(function(w){return c.add(w)}),c.divideScalar(a.length);var i=new l.Vector3(0,1,0),u=new l.Quaternion,d=s.dot(i);if(!(Math.abs(d-1)<1e-4))if(Math.abs(d+1)<1e-4){var h=new l.Vector3(1,0,0);u.setFromAxisAngle(h,Math.PI)}else{var h=new l.Vector3().crossVectors(s,i).normalize(),m=Math.acos(d);u.setFromAxisAngle(h,m)}var y=new l.Matrix4().makeTranslation(-c.x,-c.y,-c.z),p=new l.Matrix4().makeRotationFromQuaternion(u),g=new l.Matrix4;g.multiplyMatrices(p,y);var v=a.map(function(w){var C=w.clone().applyMatrix4(g);return[C.x,C.z]});if(v.length>0){var x=v[0],P=v[v.length-1];(x[0]!==P[0]||x[1]!==P[1])&&v.push([x[0],x[1]])}return{transformMatrix:g,points2D:v}}var te=`
419
+ `,v=class extends c.CustomShader{constructor(){super({type:[`pointcloud`],vertex:{mainBefore:g,mainEnd:_},uniforms:{pointCloudExpand_progress:new l.Uniform(0)}})}get progress(){return this.uniforms.pointCloudExpand_progress.value}set progress(e){this.uniforms.pointCloudExpand_progress.value=e}};function y(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var b="(function(){function e(e){onmessage=t=>{Promise.resolve(t.data).then(t=>e(t)).then(({output:e,transfer:t})=>postMessage(e,t)).catch(e=>postMessage({$$error:e}))}}function t(e,t,n){let r=new OffscreenCanvas(t,n).getContext(`2d`);if(!r)throw Error(`Failed to get canvas context`);r.clearRect(0,0,t,n),r.fillStyle=`rgba(0,0,0,1.0)`,r.beginPath();let i=e[0][0],a=e[0][0],o=e[0][1],s=e[0][1];e.forEach(e=>{let t=e[0],n=e[1];i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n)});let c=a-i,l=s-o,u=c>=l?t/c:t/l;return e.map(e=>[e[0]-i,e[1]-o]).map(e=>[e[0]*u,e[1]*u]).forEach((e,t)=>{let[n,i]=e;t===0?r.moveTo(n,i):r.lineTo(n,i)}),r.closePath(),r.fill(),r.getImageData(0,0,t,n)}function n(e,n,r){let i=new ImageData(n,r),a=e.map(e=>t(e.polygon,e.width,e.height));for(let e=0;e<n;e++)for(let t=0;t<r;t++){let r=0,o=0,s=0;for(let i=0;i<a.length;i++)if(a[i].data[(e+t*n)*4+3]===255){let e=i%8,t=Math.floor(i/8);t===0?r|=1<<e:t===1?o|=1<<e:t===2&&(s|=1<<e)}let c=(e+t*n)*4;i.data[c]=r,i.data[c+1]=o,i.data[c+2]=s,i.data[c+3]=255}return i}e(e=>Promise.resolve(e).then(({canvasDataList:e,width:t,height:r})=>{let i=n(e,t,r);return{output:{imageData:i},transfer:[i.data.buffer]}}))})();",x=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,b],{type:`text/javascript;charset=utf-8`});function S(e){let t;try{if(t=x&&(self.URL||self.webkitURL).createObjectURL(x),!t)throw``;let n=new Worker(t,{name:e==null?void 0:e.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch(t){return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(b),{name:e==null?void 0:e.name})}}var C=class{constructor(e,t){this.disposed=!1,this.pool=t,this.workerCreator=e,this.queue=[],this.workers=[],this.workerResolvers=[],this.workerStatus=0}setWorkerCreator(e){this.workerCreator=e}initWorker(e){if(!this.workerCreator)throw Error(`workerCreator is not defined`);if(!this.workers[e]){let t=this.workerCreator(e);t.addEventListener(`message`,this.onMessage.bind(this,e)),this.workers[e]=t}}getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}onMessage(e,t){let n=this.workerResolvers[e];if(t.data&&`$$error`in t.data?n==null||n.reject(t.data.$$error):n==null||n.resolve(t.data),this.workerResolvers[e]=void 0,this.queue.length){let{resolve:t,reject:n,input:r,transfer:i}=this.queue.shift();this.workerResolvers[e]={resolve:t,reject:n},this.workers[e].postMessage(r,i)}else this.workerStatus^=1<<e}postMessage(e,t=[]){return new Promise((n,r)=>{if(this.disposed){r(Error(`disposed`));return}let i=this.getIdleWorker();i===-1?this.queue.push({resolve:n,reject:r,input:e,transfer:t}):(this.initWorker(i),this.workerStatus|=1<<i,this.workerResolvers[i]={resolve:n,reject:r},this.workers[i].postMessage(e,t))})}dispose(){this.disposed=!0,this.workers.forEach(e=>{e.terminate()}),this.workers.length=0,this.workerResolvers.forEach(e=>{e==null||e.reject(Error(`disposed`))}),this.workerResolvers.length=0,this.queue.forEach(e=>{e.reject(Error(`disposed`))}),this.queue.length=0,this.workerStatus=0}};function w(e){if(e.length<3)throw Error(`At least 3 points are required to compute alignment matrix`);let t=e[0],n=e[1],r=e[2],i=new l.Vector3().subVectors(n,t),a=new l.Vector3().subVectors(r,t),o=new l.Vector3().crossVectors(i,a);if(o.lengthSq()<1e-4)for(let n=3;n<e.length&&(r=e[n],a=new l.Vector3().subVectors(r,t),o=new l.Vector3().crossVectors(i,a),!(o.lengthSq()>=1e-4));n++);if(o.lengthSq()<1e-4)throw Error(`All points are collinear, cannot compute normal`);o.normalize();let s=new l.Vector3;e.forEach(e=>s.add(e)),s.divideScalar(e.length);let c=new l.Vector3(0,1,0),u=new l.Quaternion,d=o.dot(c);if(!(Math.abs(d-1)<1e-4))if(Math.abs(d+1)<1e-4){let e=new l.Vector3(1,0,0);u.setFromAxisAngle(e,Math.PI)}else{let e=new l.Vector3().crossVectors(o,c).normalize(),t=Math.acos(d);u.setFromAxisAngle(e,t)}let f=new l.Matrix4().makeTranslation(-s.x,-s.y,-s.z),p=new l.Matrix4().makeRotationFromQuaternion(u),m=new l.Matrix4;m.multiplyMatrices(p,f);let h=e.map(e=>{let t=e.clone().applyMatrix4(m);return[t.x,t.z]});if(h.length>0){let e=h[0],t=h[h.length-1];(e[0]!==t[0]||e[1]!==t[1])&&h.push([e[0],e[1]])}return{transformMatrix:m,points2D:h}}var T=`
421
420
  uniform sampler2D polygonTexture;
422
421
 
423
422
  struct PolygonClipper {
@@ -432,7 +431,7 @@ vPointSize = gl_PointSize;
432
431
  #if NUM_POLYGON_CLIPPER > 0
433
432
  uniform PolygonClipper polygonClippers[NUM_POLYGON_CLIPPER];
434
433
  #endif
435
- `,re=`
434
+ `,E=`
436
435
 
437
436
  for(int i = 0; i < NUM_POLYGON_CLIPPER; i++){
438
437
  PolygonClipper polygonClipper = polygonClippers[i];
@@ -509,7 +508,7 @@ vPointSize = gl_PointSize;
509
508
  }
510
509
  }
511
510
 
512
- `,A=(function(){function a(){this.canvasCache=new Map,this.canvas=document.createElement("canvas"),this.canvas.width=512,this.canvas.height=512,this.polygonTexture=new l.CanvasTexture(this.canvas),this.polygonCount=0}return a.prototype.setSize=function(n){this.canvas.width=n,this.canvas.height=n},a.prototype.generatePolygonCanvas=function(n){var e=JSON.stringify(n);if(this.canvasCache.has(e))return this.canvasCache.get(e);var o=document.createElement("canvas");o.width=this.canvas.width,o.height=this.canvas.height;var t=o.getContext("2d");if(!t)throw new Error("Failed to get canvas context");if(this.polygonCount>=24)throw new Error("polygon count exceed 24, please clear the canvas");t.clearRect(0,0,this.canvas.width,this.canvas.height),t.fillStyle="rgba(0,0,0,1.0)",t.beginPath();var r=n[0][0],s=n[0][0],f=n[0][1],c=n[0][1];n.forEach(function(p){var g=p[0],v=p[1];r=Math.min(r,g),s=Math.max(s,g),f=Math.min(f,v),c=Math.max(c,v)});var i=s-r,u=c-f,d=this.canvas.width,h=i>=u?d/i:d/u,m=n.map(function(p){var g=p[0]-r,v=p[1]-f;return[g,v]}),y=m.map(function(p){return[p[0]*h,p[1]*h]});return y.forEach(function(p,g){var v=p[0],x=p[1];g===0?t.moveTo(v,x):t.lineTo(v,x)}),t.closePath(),t.fill(),this.polygonCount++,this.canvasCache.set(e,o),o},a.generatePolygonGeometry=function(n,e){for(var o=new l.BufferGeometry,t=n.slice(0,-1),r=t.map(function(h){return[h[0],0,h[1]]}),s=t.map(function(h){return[h[0],e,h[1]]}),f=T(T([],r,!0),s,!0),c=t.length,i=[],u=1;u<c-1;u++)i.push(0,u,u+1);for(var u=1;u<c-1;u++)i.push(c,c+u,c+u+1);for(var u=0;u<c;u++){var d=(u+1)%c;i.push(u,d,c+u),i.push(d,c+d,c+u)}return o.setAttribute("position",new l.Float32BufferAttribute(f.flat(),3)),o.setIndex(i),o.computeVertexNormals(),o},a.prototype.generatePolygonTexture=function(n){var e=this.canvas.getContext("2d",{willReadFrequently:!0});if(!e)throw new Error("Failed to get canvas context");for(var o=e.createImageData(this.canvas.width,this.canvas.height),t=0;t<this.canvas.width;t++)for(var r=0;r<this.canvas.height;r++){for(var s=0,f=0,c=0,i=0;i<n.length;i++){var u=n[i].getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("Failed to get canvas context");var d=u.getImageData(t,r,1,1).data;if(d[3]===255){var h=i%8,m=Math.floor(i/8);m===0?s=s|1<<h:m===1?f=f|1<<h:m===2&&(c=c|1<<h)}}var y=(t+r*this.canvas.width)*4;o.data[y]=s,o.data[y+1]=f,o.data[y+2]=c,o.data[y+3]=255}return e.putImageData(o,0,0),new l.CanvasTexture(this.canvas)},a})(),ae=(function(a){b(n,a);function n(e){e===void 0&&(e=512);var o=a.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:te,mainEnd:re},uniforms:{polygonClippers:new l.Uniform([]),polygonTexture:new l.Uniform(null)}})||this;return o._polygonClippers=[],o.polygonGenerater=new A,o._radio=512,o.radio=e,o.workerPool=new ne(function(){return new ee},1),o}return n.prototype.setPolygonClippersAsync=function(e){return V(this,void 0,void 0,function(){var o,t,r,s,f,c,i=this;return W(this,function(u){switch(u.label){case 0:return this._polygonClippers=e,o=this.uniforms,o.polygonClippers.value=e.map(function(d){var h=new l.Matrix4().getInverse(d.polygonTransform),m=d.polygonHeight,y=d.cutOutSide,p=d.polygon,g=d.floorIndex!==void 0?d.floorIndex:-1,v=p[0][0],x=p[0][0],P=p[0][1],w=p[0][1];p.forEach(function(E){var S=E[0],_=E[1];v=Math.min(v,S),x=Math.max(x,S),P=Math.min(P,_),w=Math.max(w,_)});var C=new l.Vector2(v,P),B=x-v>=w-P?x-v:w-P;return{polygonTransformInverse:h,polygonHeight:m,minPos:C,polygonScale:B,cutOutSide:y,floorIndex:g}}),t=e.map(function(d){return{polygon:d.polygon,width:i.polygonGenerater.canvas.width,height:i.polygonGenerater.canvas.height}}),[4,this.workerPool.postMessage({canvasDataList:t,width:this.polygonGenerater.canvas.width,height:this.polygonGenerater.canvas.height})];case 1:return r=u.sent(),s=document.createElement("canvas"),s.width=this.polygonGenerater.canvas.width,s.height=this.polygonGenerater.canvas.height,f=s.getContext("2d"),f&&(f.putImageData(r.imageData,0,0),c=new l.CanvasTexture(s),c.minFilter=l.NearestFilter,c.magFilter=l.NearestFilter,this.uniforms.polygonTexture.value=c,this.needsUpdate=!0),[2]}})})},Object.defineProperty(n.prototype,"polygonClippers",{get:function(){return this._polygonClippers},set:function(e){this._polygonClippers=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radio",{get:function(){return this._radio},set:function(e){this._radio=e,this.polygonGenerater.setSize(e)},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){this.workerPool.dispose()},n.prototype.onBeforeCompile=function(e,o){var t=String(this.polygonClippers.length);e.vertexShader=e.vertexShader.replace(/NUM_POLYGON_CLIPPER/g,t),e.fragmentShader=e.fragmentShader.replace(/NUM_POLYGON_CLIPPER/g,t)},n})(F.CustomShader),ie=`
511
+ `,D=class{constructor(){this.canvasCache=new Map,this.canvas=document.createElement(`canvas`),this.canvas.width=512,this.canvas.height=512,this.polygonTexture=new l.CanvasTexture(this.canvas),this.polygonCount=0}setSize(e){this.canvas.width=e,this.canvas.height=e}generatePolygonCanvas(e){let t=JSON.stringify(e);if(this.canvasCache.has(t))return this.canvasCache.get(t);{let n=document.createElement(`canvas`);n.width=this.canvas.width,n.height=this.canvas.height;let r=n.getContext(`2d`);if(!r)throw Error(`Failed to get canvas context`);if(this.polygonCount>=24)throw Error(`polygon count exceed 24, please clear the canvas`);r.clearRect(0,0,this.canvas.width,this.canvas.height),r.fillStyle=`rgba(0,0,0,1.0)`,r.beginPath();let i=e[0][0],a=e[0][0],o=e[0][1],s=e[0][1];e.forEach(e=>{let t=e[0],n=e[1];i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n)});let c=a-i,l=s-o,u=this.canvas.width,d=c>=l?u/c:u/l;return e.map(e=>[e[0]-i,e[1]-o]).map(e=>[e[0]*d,e[1]*d]).forEach((e,t)=>{let[n,i]=e;t===0?r.moveTo(n,i):r.lineTo(n,i)}),r.closePath(),r.fill(),this.polygonCount++,this.canvasCache.set(t,n),n}}static generatePolygonGeometry(e,t){let n=new l.BufferGeometry,r=e.slice(0,-1),i=r.map(e=>[e[0],0,e[1]]),a=r.map(e=>[e[0],t,e[1]]),o=[...i,...a],s=r.length,c=[];for(let e=1;e<s-1;e++)c.push(0,e,e+1);for(let e=1;e<s-1;e++)c.push(s,s+e,s+e+1);for(let e=0;e<s;e++){let t=(e+1)%s;c.push(e,t,s+e),c.push(t,s+t,s+e)}return n.setAttribute(`position`,new l.Float32BufferAttribute(o.flat(),3)),n.setIndex(c),n.computeVertexNormals(),n}generatePolygonTexture(e){let t=this.canvas.getContext(`2d`,{willReadFrequently:!0});if(!t)throw Error(`Failed to get canvas context`);let n=t.createImageData(this.canvas.width,this.canvas.height);for(let t=0;t<this.canvas.width;t++)for(let r=0;r<this.canvas.height;r++){let i=0,a=0,o=0;for(let n=0;n<e.length;n++){let s=e[n].getContext(`2d`,{willReadFrequently:!0});if(!s)throw Error(`Failed to get canvas context`);if(s.getImageData(t,r,1,1).data[3]===255){let e=n%8,t=Math.floor(n/8);t===0?i|=1<<e:t===1?a|=1<<e:t===2&&(o|=1<<e)}}let s=(t+r*this.canvas.width)*4;n.data[s]=i,n.data[s+1]=a,n.data[s+2]=o,n.data[s+3]=255}return t.putImageData(n,0,0),new l.CanvasTexture(this.canvas)}},O=class extends c.CustomShader{constructor(e=512){super({type:[`basic`,`phong`,`pointcloud`],fragment:{mainBefore:T,mainEnd:E},uniforms:{polygonClippers:new l.Uniform([]),polygonTexture:new l.Uniform(null)}}),this._polygonClippers=[],this.polygonGenerater=new D,this._radio=512,this.radio=e,this.workerPool=new C(()=>new S,1)}setPolygonClippersAsync(e){return y(this,void 0,void 0,function*(){this._polygonClippers=e;let t=this.uniforms;t.polygonClippers.value=e.map(e=>{let t=new l.Matrix4().getInverse(e.polygonTransform),n=e.polygonHeight,r=e.cutOutSide,i=e.polygon,a=e.floorIndex===void 0?-1:e.floorIndex,o=i[0][0],s=i[0][0],c=i[0][1],u=i[0][1];return i.forEach(e=>{let t=e[0],n=e[1];o=Math.min(o,t),s=Math.max(s,t),c=Math.min(c,n),u=Math.max(u,n)}),{polygonTransformInverse:t,polygonHeight:n,minPos:new l.Vector2(o,c),polygonScale:s-o>=u-c?s-o:u-c,cutOutSide:r,floorIndex:a}});let n=e.map(e=>({polygon:e.polygon,width:this.polygonGenerater.canvas.width,height:this.polygonGenerater.canvas.height})),r=yield this.workerPool.postMessage({canvasDataList:n,width:this.polygonGenerater.canvas.width,height:this.polygonGenerater.canvas.height}),i=document.createElement(`canvas`);i.width=this.polygonGenerater.canvas.width,i.height=this.polygonGenerater.canvas.height;let a=i.getContext(`2d`);if(a){a.putImageData(r.imageData,0,0);let e=new l.CanvasTexture(i);e.minFilter=l.NearestFilter,e.magFilter=l.NearestFilter,this.uniforms.polygonTexture.value=e,this.needsUpdate=!0}})}get polygonClippers(){return this._polygonClippers}set polygonClippers(e){this._polygonClippers=e}get radio(){return this._radio}set radio(e){this._radio=e,this.polygonGenerater.setSize(e)}dispose(){this.workerPool.dispose()}onBeforeCompile(e,t){let n=String(this.polygonClippers.length);e.vertexShader=e.vertexShader.replace(/NUM_POLYGON_CLIPPER/g,n),e.fragmentShader=e.fragmentShader.replace(/NUM_POLYGON_CLIPPER/g,n)}},k=`
513
512
  #if NUM_SHINE_OBJECTS > 0
514
513
  uniform float shineProgress;
515
514
  struct SHINE_OBJECT {
@@ -518,7 +517,7 @@ vPointSize = gl_PointSize;
518
517
  };
519
518
  uniform SHINE_OBJECT shineBoxes[NUM_SHINE_OBJECTS];
520
519
  #endif
521
- `,se=`
520
+ `,A=`
522
521
  #if NUM_SHINE_OBJECTS > 0
523
522
  #pragma unroll_loop_start
524
523
  for ( int i = 0; i < NUM_SHINE_OBJECTS; i ++ ) {
@@ -534,4 +533,4 @@ vPointSize = gl_PointSize;
534
533
  }
535
534
  #pragma unroll_loop_end
536
535
  #endif
537
- `,le="",ue=(function(a){b(n,a);function n(){var e=a.call(this,{type:["basic","phong","none"],fragment:{mainBefore:ie,mainStart:le,mainEnd:se},uniforms:{shineProgress:new l.Uniform(0),shineBoxes:new l.Uniform([])},defines:{NUM_SHINE_OBJECTS:0}})||this;return Object.defineProperties(e,{shineBoxes:{get:function(){return this.uniforms.shineBoxes.value},set:function(o){var t=o.length;t>0&&(this.defines.NUM_SHINE_OBJECTS=t,this.uniforms.shineBoxes.value=o)}}}),e.shineBoxes=[],e}return n.prototype.onBeforeCompile=function(e,o){var t=String(this.shineBoxes.length);e.vertexShader=e.vertexShader.replace(/NUM_SHINE_OBJECTS/g,t),e.fragmentShader=e.fragmentShader.replace(/NUM_SHINE_OBJECTS/g,t)},n})(F.CustomShader);exports.EvenessPlaneShader=q;exports.PointCloudExpandShader=X;exports.PolygonCuterShader=ae;exports.PolygonGenerater=A;exports.ShineModelShader=ue;exports.SweepModelShader=Q;exports.computeAlignmentMatrix=oe;
536
+ `,j=``,M=class extends c.CustomShader{constructor(){super({type:[`basic`,`phong`,`none`],fragment:{mainBefore:k,mainStart:j,mainEnd:A},uniforms:{shineProgress:new l.Uniform(0),shineBoxes:new l.Uniform([])},defines:{NUM_SHINE_OBJECTS:0}}),Object.defineProperties(this,{shineBoxes:{get(){return this.uniforms.shineBoxes.value},set(e){let t=e.length;t>0&&(this.defines.NUM_SHINE_OBJECTS=t,this.uniforms.shineBoxes.value=e)}}}),this.shineBoxes=[]}onBeforeCompile(e,t){let n=String(this.shineBoxes.length);e.vertexShader=e.vertexShader.replace(/NUM_SHINE_OBJECTS/g,n),e.fragmentShader=e.fragmentShader.replace(/NUM_SHINE_OBJECTS/g,n)}};exports.EvenessPlaneShader=d,exports.PointCloudExpandShader=v,exports.PolygonCuterShader=O,exports.PolygonGenerater=D,exports.ShineModelShader=M,exports.SweepModelShader=h,exports.computeAlignmentMatrix=w;