@realsee/five-webgpu 1.0.0-alpha.13 → 1.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_virtual/_rolldown/runtime.js +3 -3
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/index.AdaptiveLuminancePass.html +1 -1
- package/docs/classes/index.BoundingMesh.html +1 -1
- package/docs/classes/index.Camera.html +1 -1
- package/docs/classes/index.EyeDomeLightingPass.html +1 -1
- package/docs/classes/index.Five.html +65 -64
- package/docs/classes/index.FivePass.html +1 -1
- package/docs/classes/index.FiveRenderer.html +4 -4
- package/docs/classes/index.FlowingFireworks3DPass.html +1 -1
- package/docs/classes/index.FlowingLight2DPass.html +1 -1
- package/docs/classes/index.FlowingLight3DPass.html +1 -1
- package/docs/classes/index.GaussianBlurPass.html +1 -1
- package/docs/classes/index.InternalWebGPURenderer.html +4 -4
- package/docs/classes/index.Model.html +1 -1
- package/docs/classes/index.ModelScene.html +1 -1
- package/docs/classes/index.NetworkSubscribe.html +1 -1
- package/docs/classes/index.PBMCustomNode.html +1 -1
- package/docs/classes/index.PBMGaussianSplattingNodeMaterial.html +1 -1
- package/docs/classes/index.PBMGaussianSplattingObject.html +1 -1
- package/docs/classes/index.PBMGaussianSplattingRenderMesh.html +1 -1
- package/docs/classes/index.PBMGroup.html +1 -1
- package/docs/classes/index.PBMMesh.html +1 -1
- package/docs/classes/index.PBMMeshBasicMaterial.html +1 -1
- package/docs/classes/index.PBMMeshBasicNodeMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPanoOnlyMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPanoOnlyNodeMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPhongMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPhongNodeMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPhysicalMaterial.html +1 -1
- package/docs/classes/index.PBMMeshPhysicalNodeMaterial.html +1 -1
- package/docs/classes/index.PBMPanoFilter.html +1 -1
- package/docs/classes/index.PBMPointCloud.html +1 -1
- package/docs/classes/index.PBMPointCloudMaterial.html +1 -1
- package/docs/classes/index.PBMSkinnedMesh.html +1 -1
- package/docs/classes/index.PBMUpdateable.html +1 -1
- package/docs/classes/index.PanoCircleMesh.html +1 -1
- package/docs/classes/index.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/index.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/index.Parameter.html +1 -1
- package/docs/classes/index.Scene.html +1 -1
- package/docs/classes/index.Subscribe.html +1 -1
- package/docs/classes/index.Tile3D.html +1 -1
- package/docs/classes/index.TileNode.html +1 -1
- package/docs/classes/index.TrajectoryNode.html +1 -1
- package/docs/classes/index.Work.html +15 -22
- package/docs/classes/index.WorkResolvedObserver.html +22 -22
- package/docs/functions/index.createWorks.html +1 -1
- package/docs/functions/index.parseWork.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/index.AddableObject.html +1 -1
- package/docs/interfaces/index.AjaxOptions.html +1 -1
- package/docs/interfaces/index.BaseEvent.html +1 -1
- package/docs/interfaces/index.Clock.html +1 -1
- package/docs/interfaces/index.EventCallback.html +3 -3
- package/docs/interfaces/index.GestureEvent.html +1 -1
- package/docs/interfaces/index.IPBMMaterial.html +1 -1
- package/docs/interfaces/index.ImageOptions.html +1 -1
- package/docs/interfaces/index.IntersectEvent.html +1 -1
- package/docs/interfaces/index.IntersectMesh.html +1 -1
- package/docs/interfaces/index.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/index.Intersection.html +1 -1
- package/docs/interfaces/index.LooseWorkWithExtrinsics.html +8 -8
- package/docs/interfaces/index.ModeChangeEvent.html +1 -1
- package/docs/interfaces/index.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.ModelEvent.html +1 -1
- package/docs/interfaces/index.ModelSceneEvent.html +1 -1
- package/docs/interfaces/index.ModelTileEvent.html +1 -1
- package/docs/interfaces/index.MovePanoOptions.html +1 -1
- package/docs/interfaces/index.NetworkAbortError.html +1 -1
- package/docs/interfaces/index.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/index.NetworkOptions.html +1 -1
- package/docs/interfaces/index.NetworkProxyError.html +1 -1
- package/docs/interfaces/index.NetworkResourceEvent.html +1 -1
- package/docs/interfaces/index.NetworkResponseError.html +1 -1
- package/docs/interfaces/index.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/index.ObjectEvent.html +1 -1
- package/docs/interfaces/index.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/index.PanoEvent.html +1 -1
- package/docs/interfaces/index.PanoPrepareEvent.html +1 -1
- package/docs/interfaces/index.PanoTextureEvent.html +1 -1
- package/docs/interfaces/index.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.ParameterMaterialValue.html +1 -1
- package/docs/interfaces/index.ParameterTilesetValue.html +1 -1
- package/docs/interfaces/index.ParameterValue.html +1 -1
- package/docs/interfaces/index.Pose.html +1 -1
- package/docs/interfaces/index.RenderEvent.html +1 -1
- package/docs/interfaces/index.ResolvedParameterValue.html +1 -1
- package/docs/interfaces/index.State.html +1 -1
- package/docs/interfaces/index.StateEvent.html +1 -1
- package/docs/interfaces/index.TextureOptions.html +1 -1
- package/docs/interfaces/index.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.ViewLayer.html +1 -1
- package/docs/interfaces/index.WorkCubeHdrGainmapImage.html +2 -2
- package/docs/interfaces/index.WorkCubeImage.html +2 -2
- package/docs/interfaces/index.WorkImage.html +5 -5
- package/docs/interfaces/index.WorkInitial.html +8 -8
- package/docs/interfaces/index.WorkInitialJson.html +2 -2
- package/docs/interfaces/index.WorkJson.html +2 -4
- package/docs/interfaces/index.WorkModel.html +8 -8
- package/docs/interfaces/index.WorkModelJson.html +2 -2
- package/docs/interfaces/index.WorkModelLayer.html +6 -6
- package/docs/interfaces/index.WorkModelLayerJson.html +2 -2
- package/docs/interfaces/index.WorkObserver.html +23 -23
- package/docs/interfaces/index.WorkObserverJson.html +2 -2
- package/docs/interfaces/index.WorkPanoramaJson.html +2 -2
- package/docs/interfaces/index.WorkPanoramasJson.html +2 -2
- package/docs/interfaces/index.WorkTile.html +5 -5
- package/docs/interfaces/index.WorkVideo.html +4 -4
- package/docs/interfaces/index.WorksEvent.html +1 -1
- package/docs/interfaces/index.XRControllerEvent.html +1 -1
- package/docs/interfaces/index.XRGestureEvent.html +2 -2
- package/docs/interfaces/index.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/index.XRSessionEvent.html +1 -1
- package/docs/modules/index.html +1 -1
- package/docs/types/index.LegacyEventType.html +3 -3
- package/docs/types/index.OutputTextureDataType.html +1 -1
- package/docs/types/index.ParseOptions.html +8 -8
- package/docs/types/index.PointCloudTransparencyMode.html +2 -0
- package/docs/types/index.Works.html +1 -1
- package/docs/variables/index.loadAt3d.html +2 -0
- package/docs/variables/index.loadDome.html +2 -0
- package/docs/variables/index.loadDomez.html +2 -0
- package/docs/variables/index.loadGltf.html +2 -0
- package/docs/variables/index.loadPbm.html +2 -0
- package/docs/variables/index.loadPly.html +2 -0
- package/five/application/five.d.ts +3 -2
- package/five/chunks/at3d.js +338 -0
- package/five/chunks/at3d.mjs +338 -0
- package/five/chunks/dome.js +338 -0
- package/five/chunks/dome.mjs +338 -0
- package/five/chunks/domez.js +338 -0
- package/five/chunks/domez.mjs +338 -0
- package/five/chunks/fbx.js +338 -0
- package/five/chunks/fbx.mjs +338 -0
- package/five/chunks/fflate.js +338 -0
- package/five/chunks/fflate.mjs +338 -0
- package/five/chunks/glTF-helpers.js +804 -0
- package/five/chunks/glTF-helpers.mjs +804 -0
- package/five/chunks/gltf.js +338 -0
- package/five/chunks/gltf.mjs +338 -0
- package/five/chunks/imageBitmap.js +338 -0
- package/five/chunks/imageBitmap.mjs +338 -0
- package/five/chunks/imageSupport.js +338 -0
- package/five/chunks/imageSupport.mjs +338 -0
- package/five/chunks/lzma.js +383 -0
- package/five/chunks/lzma.mjs +383 -0
- package/five/chunks/memoryUsage.js +339 -0
- package/five/chunks/memoryUsage.mjs +339 -0
- package/five/chunks/minimal.js +338 -0
- package/five/chunks/minimal.mjs +338 -0
- package/five/chunks/pbm.js +338 -0
- package/five/chunks/pbm.mjs +338 -0
- package/five/chunks/pbmGaussianSplattingObject.js +338 -0
- package/five/chunks/pbmGaussianSplattingObject.mjs +338 -0
- package/five/chunks/pbmMeshMaterial.js +338 -0
- package/five/chunks/pbmMeshMaterial.mjs +338 -0
- package/five/chunks/pick.js +338 -0
- package/five/chunks/pick.mjs +338 -0
- package/five/chunks/ply.js +339 -0
- package/five/chunks/ply.mjs +339 -0
- package/five/chunks/spz.js +364 -0
- package/five/chunks/spz.mjs +364 -0
- package/five/core/webglBlendEquationFix.d.ts +41 -0
- package/five/index.d.ts +0 -1
- package/five/index.js +49 -626
- package/five/index.mjs +229 -32052
- package/five/model/index.d.ts +18 -6
- package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz.d.ts +1 -1
- package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz_2.d.ts +1 -1
- package/five/model/loaders/spz.d.ts +1 -2
- package/five/model/loaders/spz.worker.d.ts +37 -0
- package/five/renderer/five-renderer.d.ts +1 -1
- package/five/renderer/index.d.ts +1 -1
- package/five/renderer/postprocessing/passes/pass.js +3 -3
- package/five/renderer/postprocessing/passes/pass.mjs +3 -3
- package/five/renderer/tools/full-screen-quad.js +3 -3
- package/five/renderer/tools/full-screen-quad.mjs +3 -3
- package/five/texture/videoTextureBridge.d.ts +124 -15
- package/five/thirdparty/sha256.d.ts +149 -0
- package/five/utils/calculateThreeMouse.js +3 -3
- package/five/utils/calculateThreeMouse.mjs +3 -3
- package/five/utils/distance.js +3 -3
- package/five/utils/distance.mjs +3 -3
- package/five/utils/isNil.js +3 -3
- package/five/utils/isNil.mjs +3 -3
- package/five/utils/memoryUsage.d.ts +1 -1
- package/five/utils/uuid.js +3 -3
- package/five/utils/uuid.mjs +3 -3
- package/five/work/work.d.ts +0 -7
- package/five/work/workJsonType.d.ts +0 -2
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -50
- package/line/index.js +3 -3
- package/line/index.mjs +3 -88
- package/package.json +1 -1
- package/plugins/BackgroundPlugin/Controller.js +4 -4
- package/plugins/BackgroundPlugin/Controller.mjs +4 -4
- package/plugins/BackgroundPlugin/index.js +3 -3
- package/plugins/BackgroundPlugin/index.mjs +3 -3
- package/plugins/BasePlugin/index.js +3 -3
- package/plugins/BasePlugin/index.mjs +3 -3
- package/plugins/CSS2DPlugin/Controller.js +3 -3
- package/plugins/CSS2DPlugin/Controller.mjs +3 -3
- package/plugins/CSS2DPlugin/index.js +3 -3
- package/plugins/CSS2DPlugin/index.mjs +3 -3
- package/plugins/CSS2DPlugin/style.css_raw.js +4 -4
- package/plugins/CSS2DPlugin/style.css_raw.mjs +4 -4
- package/plugins/CSS3DPlugin/Controller.js +3 -3
- package/plugins/CSS3DPlugin/Controller.mjs +3 -3
- package/plugins/CSS3DPlugin/index.js +3 -3
- package/plugins/CSS3DPlugin/index.mjs +3 -3
- package/plugins/CSS3DPlugin/style.css_raw.js +4 -4
- package/plugins/CSS3DPlugin/style.css_raw.mjs +4 -4
- package/plugins/FloorplanPlugin/Controller.js +3 -3
- package/plugins/FloorplanPlugin/Controller.mjs +3 -3
- package/plugins/FloorplanPlugin/index.js +3 -3
- package/plugins/FloorplanPlugin/index.mjs +3 -3
- package/plugins/FloorplanPlugin/render/assets.js +3 -3
- package/plugins/FloorplanPlugin/render/assets.mjs +3 -3
- package/plugins/FloorplanPlugin/render/index.js +3 -3
- package/plugins/FloorplanPlugin/render/index.mjs +3 -3
- package/plugins/FloorplanPlugin/render/isPointInPolygon.js +3 -3
- package/plugins/FloorplanPlugin/render/isPointInPolygon.mjs +3 -3
- package/plugins/FloorplanPlugin/render/renderFloor.js +3 -3
- package/plugins/FloorplanPlugin/render/renderFloor.mjs +3 -3
- package/plugins/FloorplanPlugin/render/roomLabelVisibility.js +3 -3
- package/plugins/FloorplanPlugin/render/roomLabelVisibility.mjs +3 -3
- package/plugins/FloorplanPlugin/render/style.css_raw.js +4 -4
- package/plugins/FloorplanPlugin/render/style.css_raw.mjs +4 -4
- package/plugins/FloorplanPlugin/utils/changeMode.js +3 -3
- package/plugins/FloorplanPlugin/utils/changeMode.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.js +3 -3
- package/plugins/FloorplanPlugin/utils/changeModelCanvasOpacity.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/correctFiveState.js +3 -3
- package/plugins/FloorplanPlugin/utils/correctFiveState.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/equal.js +3 -3
- package/plugins/FloorplanPlugin/utils/equal.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/filter.js +3 -3
- package/plugins/FloorplanPlugin/utils/filter.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/fiveModelLoad.js +3 -3
- package/plugins/FloorplanPlugin/utils/fiveModelLoad.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/formatData.js +3 -3
- package/plugins/FloorplanPlugin/utils/formatData.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/formatFloorplanJson.js +3 -3
- package/plugins/FloorplanPlugin/utils/formatFloorplanJson.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/formatPosition.js +3 -3
- package/plugins/FloorplanPlugin/utils/formatPosition.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/getDistanceFromModel.js +3 -3
- package/plugins/FloorplanPlugin/utils/getDistanceFromModel.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/getPxmm.js +3 -3
- package/plugins/FloorplanPlugin/utils/getPxmm.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/isTruelyObject.js +3 -3
- package/plugins/FloorplanPlugin/utils/isTruelyObject.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/nearlyEqual.js +3 -3
- package/plugins/FloorplanPlugin/utils/nearlyEqual.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/polylabel.js +3 -3
- package/plugins/FloorplanPlugin/utils/polylabel.mjs +3 -3
- package/plugins/FloorplanPlugin/utils/to.js +3 -3
- package/plugins/FloorplanPlugin/utils/to.mjs +3 -3
- package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.js +3 -3
- package/plugins/GaussianSplattingEntranceAnimationPlugin/Controller.mjs +3 -3
- package/plugins/GaussianSplattingEntranceAnimationPlugin/index.js +3 -3
- package/plugins/GaussianSplattingEntranceAnimationPlugin/index.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Controller.js +3 -3
- package/plugins/Object3DHelperPlugin/Controller.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/BaseController.js +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/BaseController.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.js +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/BoundingBoxController.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/MoveController.js +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/MoveController.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/RotateController.js +3 -3
- package/plugins/Object3DHelperPlugin/Controllers/RotateController.mjs +3 -3
- package/plugins/Object3DHelperPlugin/FiveControllerWrapper.js +3 -3
- package/plugins/Object3DHelperPlugin/FiveControllerWrapper.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Helper/BaseHelper.js +3 -3
- package/plugins/Object3DHelperPlugin/Helper/BaseHelper.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.js +3 -3
- package/plugins/Object3DHelperPlugin/Helper/BoundingBoxHelper.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Helper/MoveHelper.js +3 -3
- package/plugins/Object3DHelperPlugin/Helper/MoveHelper.mjs +3 -3
- package/plugins/Object3DHelperPlugin/Helper/RotateHelper.js +3 -3
- package/plugins/Object3DHelperPlugin/Helper/RotateHelper.mjs +3 -3
- package/plugins/Object3DHelperPlugin/constant.js +3 -3
- package/plugins/Object3DHelperPlugin/constant.mjs +3 -3
- package/plugins/Object3DHelperPlugin/index.js +3 -3
- package/plugins/Object3DHelperPlugin/index.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/ArrowGroup.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/ArrowGroup.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/CenterHandle.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/CenterHandle.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/PlaneHandle.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/PlaneHandle.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/cameraHooks.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/cameraHooks.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/direction.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/direction.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/solidGuide.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/solidGuide.mjs +3 -3
- package/plugins/Object3DHelperPlugin/utils/tipsDom.js +3 -3
- package/plugins/Object3DHelperPlugin/utils/tipsDom.mjs +3 -3
- package/plugins/PanoAnimePlugin/Controller.js +3 -3
- package/plugins/PanoAnimePlugin/Controller.mjs +3 -3
- package/plugins/PanoAnimePlugin/index.js +3 -3
- package/plugins/PanoAnimePlugin/index.mjs +3 -3
- package/plugins/WordPassPlugin/Controller.js +3 -3
- package/plugins/WordPassPlugin/Controller.mjs +3 -3
- package/plugins/WordPassPlugin/hersheyFont.js +3 -3
- package/plugins/WordPassPlugin/hersheyFont.mjs +3 -3
- package/plugins/WordPassPlugin/index.js +3 -3
- package/plugins/WordPassPlugin/index.mjs +3 -3
- package/plugins/WordPassPlugin/textToStrokeOrderStrokes.js +4 -4
- package/plugins/WordPassPlugin/textToStrokeOrderStrokes.mjs +4 -4
- package/plugins/WordPassPlugin/word-pass.js +3 -3
- package/plugins/WordPassPlugin/word-pass.mjs +3 -3
- package/plugins/index.js +3 -3
- package/plugins/index.mjs +3 -3
- package/plugins/thirdParty/CSS2DRenderer.js +3 -3
- package/plugins/thirdParty/CSS2DRenderer.mjs +3 -3
- package/plugins/thirdParty/CSS3DRenderer.js +3 -3
- package/plugins/thirdParty/CSS3DRenderer.mjs +3 -3
- package/plugins/thirdParty/doctorstrange-model.js +75 -75
- package/plugins/thirdParty/doctorstrange-model.mjs +75 -75
- package/plugins/thirdParty/domevents.js +3 -3
- package/plugins/thirdParty/domevents.mjs +3 -3
- package/plugins/utils/absoluteUrl.js +3 -3
- package/plugins/utils/absoluteUrl.mjs +3 -3
- package/plugins/utils/calculatePath.js +3 -3
- package/plugins/utils/calculatePath.mjs +3 -3
- package/plugins/utils/clamp.js +3 -3
- package/plugins/utils/clamp.mjs +3 -3
- package/plugins/utils/uuid.js +3 -3
- package/plugins/utils/uuid.mjs +3 -3
- package/react/hooks/useFiveModelReadyState.d.ts +1 -1
- package/react/index.js +3 -3
- package/react/index.mjs +3 -644
- package/sticker/index.js +13 -4
- package/sticker/index.mjs +43 -260
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-sticker.js +13 -4
- package/umd/five-vfx.js +2 -2
- package/umd/five.js +154 -192
- package/vfx/index.js +3 -3
- package/vfx/index.mjs +3 -486
- package/work-downloader/index.js +3 -3
- package/work-downloader/index.mjs +3 -315
- package/docs/functions/index.loadAt3d.html +0 -1
- package/docs/functions/index.loadDome.html +0 -1
- package/docs/functions/index.loadDomez.html +0 -1
- package/docs/functions/index.loadGltf.html +0 -1
- package/docs/functions/index.loadPbm.html +0 -1
- package/docs/functions/index.loadPly.html +0 -10
- package/five/certificates/hardware.d.ts +0 -1
- package/five/thirdparty/jsrsasign.d.ts +0 -753
- package/five/work/_ALLOW_HOST.d.ts +0 -2
- package/five/work/keychain.d.ts +0 -5
- package/five/work/verify.d.ts +0 -7
- package/five/work/workVerify.d.ts +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/function
|
|
338
|
+
*/function createElement(style,tagName){return setStyle(document.createElement(tagName==null?`div`:tagName),style)}function setStyle(element,style){if(!style)return element;for(let key in style)key&&style[key]&&(element.style[key]=style[key]);return element}function tipsDom(style){let element=createElement(Object.assign({position:`absolute`,display:`block`,borderRadius:`4px`,paddingTop:`1px`,paddingBottom:`1px`,paddingLeft:`4px`,paddingRight:`4px`,pointerEvents:`none`,userSelect:`none`,zIndex:`99999`,backgroundColor:`rgba(0,0,0,0.7)`,fontSize:`12px`,color:`#fff`,letterSpacing:`0`,lineHeight:`18px`},style)),show=()=>{element.style.display!==`block`&&element.style.top&&element.style.left&&(element.style.display=`block`)};return{element,show,hide:()=>{element.style.display=`none`,element.style.top=``,element.style.left=``},setLeftTop:(left,top)=>{element.style.left=left,element.style.top=top,show()}}}exports.createElement=createElement,exports.setStyle=setStyle,exports.tipsDom=tipsDom;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/function
|
|
338
|
+
*/function createElement(style,tagName){return setStyle(document.createElement(tagName==null?`div`:tagName),style)}function setStyle(element,style){if(!style)return element;for(let key in style)key&&style[key]&&(element.style[key]=style[key]);return element}function tipsDom(style){let element=createElement(Object.assign({position:`absolute`,display:`block`,borderRadius:`4px`,paddingTop:`1px`,paddingBottom:`1px`,paddingLeft:`4px`,paddingRight:`4px`,pointerEvents:`none`,userSelect:`none`,zIndex:`99999`,backgroundColor:`rgba(0,0,0,0.7)`,fontSize:`12px`,color:`#fff`,letterSpacing:`0`,lineHeight:`18px`},style)),show=()=>{element.style.display!==`block`&&element.style.top&&element.style.left&&(element.style.display=`block`)};return{element,show,hide:()=>{element.style.display=`none`,element.style.top=``,element.style.left=``},setLeftTop:(left,top)=>{element.style.left=left,element.style.top=top,show()}}}export{createElement,setStyle,tipsDom};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const
|
|
338
|
+
*/const require_runtime=require("../../_virtual/_rolldown/runtime.js"),require_index=require("../BasePlugin/index.js"),require_clamp=require("../utils/clamp.js");let tslib=require("tslib"),_realsee_five_webgpu=require("@realsee/five-webgpu"),three_webgpu=require("three/webgpu");three_webgpu=require_runtime.__toESM(three_webgpu,1);let three_tsl=require("three/tsl");function createPanoAnimeMaterial(){let u={map:(0,three_tsl.texture)(new three_webgpu.Texture),progress:(0,three_tsl.uniform)(0),opacity:(0,three_tsl.uniform)(0)},fragment=(0,three_tsl.Fn)(()=>{let vUv=(0,three_tsl.uv)(),vPosition=(0,three_tsl.varying)(three_tsl.positionGeometry);(0,three_tsl.Discard)(vUv.y.greaterThan(u.progress));let image=u.map.sample(vUv),base=(0,three_tsl.vec4)((0,three_tsl.vec3)(1,1,1),u.progress.sub(vPosition.y).mul(.7)),withImage=base.add((0,three_tsl.vec4)(image.rgb,image.a.mul(vPosition.y.oneMinus()))),color=(0,three_tsl.select)(u.progress.equal(1),withImage,base);return(0,three_tsl.vec4)(color.rgb,color.a.mul(u.opacity))}),material=new three_webgpu.NodeMaterial;return material.fragmentNode=fragment(),material.transparent=!0,material.depthTest=!1,{material,u}}var MULTIPLE=[1,5,2,6,3,7,4,8,9,13,10,14,11,15,12,16],CANVAS_WIDTH=512,CANVAS_HEIGHT=512,LINE_LENGTH=128,Controller=class extends require_index.BasePlugin.Controller{get config(){return Object.assign({},this._config)}updateState(state,userAction){let prevState=this.state;this.state=Object.assign(Object.assign({},this.state),state),this.hooks.emit(`stateChange`,{state:this.state,prevState,userAction})}updateConfig(config,options={}){var _a;let prevConfig=this.config,newConfig=Object.assign(Object.assign({},prevConfig),config);this._config=newConfig,this.hooks.emit(`configChange`,{prevConfig,config:newConfig,userAction:(_a=options.userAction)==null?!0:_a})}constructor(five,params){super(five),this.group=new three_webgpu.Group,this.materialUniforms=createPanoAnimeMaterial(),this.mesh=(()=>{let geometry=new three_webgpu.CylinderGeometry(.12,.12,1,32,1,!0);return geometry.translate(0,.5,0),new three_webgpu.Mesh(geometry,this.materialUniforms.material)})(),this.panoMesh=new _realsee_five_webgpu.PanoCircleMesh({scale:1.5}),this.stop=()=>{},this.drawLine=(index,deltaTime)=>{if(!this.ctx)return;let x=(()=>{var _a;return 32*((_a=MULTIPLE[index])==null?0:_a)})(),y=(1-(deltaTime+index*150)%1200/1200)*640,linearGradient=this.ctx.createLinearGradient(0,y-LINE_LENGTH,0,y);linearGradient.addColorStop(0,`rgba(255,255,255,0)`),linearGradient.addColorStop(.5,`rgba(255,255,255,1)`),linearGradient.addColorStop(1,`rgba(255,255,255,0)`),this.ctx.fillStyle=linearGradient,this.ctx.fillRect(x,y-LINE_LENGTH,3,LINE_LENGTH)},this.anime=time=>{if(!this.ctx||!this.startTime)return;this.ctx.clearRect(0,0,CANVAS_WIDTH,CANVAS_HEIGHT);for(let i=0;i<16;i++)this.drawLine(i,time-this.startTime);let progress=require_clamp.clamp((time-this.startTime)/1e3,0,1),opacity=require_clamp.clamp((time-this.startTime)/300,0,this.config.maxOpacity);this.panoMesh.setOpacity(opacity),this.materialUniforms.u.progress.value=progress,this.materialUniforms.u.opacity.value=opacity,this.canvasTexture&&(this.canvasTexture.needsUpdate=!0),this.five.needsRender=!0},this.dispose=()=>{this.disable()},this.five=five;let defaultState={enabled:!1,visible:!0};this.state=Object.assign(defaultState,params==null?void 0:params.initialState);let config=Object.assign(Object.assign({},params==null?void 0:params.config),{maxOpacity:1});this._config=config,!(typeof document>`u`)&&(this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.canvas.width=CANVAS_WIDTH,this.canvas.height=CANVAS_HEIGHT,this.ctx.shadowColor=`rgba(255,255,255,0.5)`,this.ctx.shadowBlur=6,this.ctx.shadowOffsetX=0,this.ctx.shadowOffsetY=0,this.canvasTexture=new three_webgpu.CanvasTexture(this.canvas),this.materialUniforms.u.map.value=this.canvasTexture,this.group.add(this.mesh),this.panoMesh.setProgress(1),this.panoMesh.setOpacity(0),this.group.add(this.panoMesh),this.state.enabled&&this._enable({userAction:!1}))}load(data){return(0,tslib.__awaiter)(this,void 0,void 0,function*(){})}_enable(options){this.mesh.position.copy(this.five.observers[this.five.state.panoIndex].standingPosition),this.panoMesh.position.copy(this.five.observers[this.five.state.panoIndex].standingPosition),this.five.ready().then(()=>{this.five.scene.add(this.group),this.stop=_realsee_five_webgpu.AnimationFrameLoop.shared.add((time,deltaTime)=>{this.startTime||(this.startTime=time),this.panoMesh.updateTime(time,deltaTime),this.anime(time)})})}_disable(options){this.five.scene.remove(this.group),this.panoMesh.setOpacity(0),this.startTime=void 0,this.stop(),this.five.needsRender=!0}enable(options){var _a;if(!this.ctx||this.state.enabled||!this.five.observers[this.five.state.panoIndex])return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this.updateState({enabled:!0},userAction),this._enable({userAction})}disable(options){var _a;if(this.state.enabled===!1)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this.updateState({enabled:!1},userAction),this._disable({userAction})}setState(state,options={}){let prevState=this.state,userAction=options.userAction===void 0?!0:options.userAction;if(this.updateState(state,userAction),state.enabled!==void 0&&prevState.enabled!==state.enabled){let options={userAction};state.enabled?this._enable(options):this._disable(options)}}};exports.Controller=Controller;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{BasePlugin
|
|
338
|
+
*/import{BasePlugin}from"../BasePlugin/index.mjs";import{clamp as clamp$1}from"../utils/clamp.mjs";import{__awaiter}from"tslib";import{AnimationFrameLoop,PanoCircleMesh}from"@realsee/five-webgpu";import*as THREE from"three/webgpu";import{Discard,Fn,positionGeometry,select,texture,uniform,uv,varying,vec3,vec4}from"three/tsl";function createPanoAnimeMaterial(){let u={map:texture(new THREE.Texture),progress:uniform(0),opacity:uniform(0)},fragment=Fn(()=>{let vUv=uv(),vPosition=varying(positionGeometry);Discard(vUv.y.greaterThan(u.progress));let image=u.map.sample(vUv),base=vec4(vec3(1,1,1),u.progress.sub(vPosition.y).mul(.7)),withImage=base.add(vec4(image.rgb,image.a.mul(vPosition.y.oneMinus()))),color=select(u.progress.equal(1),withImage,base);return vec4(color.rgb,color.a.mul(u.opacity))}),material=new THREE.NodeMaterial;return material.fragmentNode=fragment(),material.transparent=!0,material.depthTest=!1,{material,u}}var MULTIPLE=[1,5,2,6,3,7,4,8,9,13,10,14,11,15,12,16],CANVAS_WIDTH=512,CANVAS_HEIGHT=512,LINE_LENGTH=128,Controller=class extends BasePlugin.Controller{get config(){return Object.assign({},this._config)}updateState(state,userAction){let prevState=this.state;this.state=Object.assign(Object.assign({},this.state),state),this.hooks.emit(`stateChange`,{state:this.state,prevState,userAction})}updateConfig(config,options={}){var _a;let prevConfig=this.config,newConfig=Object.assign(Object.assign({},prevConfig),config);this._config=newConfig,this.hooks.emit(`configChange`,{prevConfig,config:newConfig,userAction:(_a=options.userAction)==null?!0:_a})}constructor(five,params){super(five),this.group=new THREE.Group,this.materialUniforms=createPanoAnimeMaterial(),this.mesh=(()=>{let geometry=new THREE.CylinderGeometry(.12,.12,1,32,1,!0);return geometry.translate(0,.5,0),new THREE.Mesh(geometry,this.materialUniforms.material)})(),this.panoMesh=new PanoCircleMesh({scale:1.5}),this.stop=()=>{},this.drawLine=(index,deltaTime)=>{if(!this.ctx)return;let x=(()=>{var _a;return 32*((_a=MULTIPLE[index])==null?0:_a)})(),y=(1-(deltaTime+index*150)%1200/1200)*640,linearGradient=this.ctx.createLinearGradient(0,y-LINE_LENGTH,0,y);linearGradient.addColorStop(0,`rgba(255,255,255,0)`),linearGradient.addColorStop(.5,`rgba(255,255,255,1)`),linearGradient.addColorStop(1,`rgba(255,255,255,0)`),this.ctx.fillStyle=linearGradient,this.ctx.fillRect(x,y-LINE_LENGTH,3,LINE_LENGTH)},this.anime=time=>{if(!this.ctx||!this.startTime)return;this.ctx.clearRect(0,0,CANVAS_WIDTH,CANVAS_HEIGHT);for(let i=0;i<16;i++)this.drawLine(i,time-this.startTime);let progress=clamp$1((time-this.startTime)/1e3,0,1),opacity=clamp$1((time-this.startTime)/300,0,this.config.maxOpacity);this.panoMesh.setOpacity(opacity),this.materialUniforms.u.progress.value=progress,this.materialUniforms.u.opacity.value=opacity,this.canvasTexture&&(this.canvasTexture.needsUpdate=!0),this.five.needsRender=!0},this.dispose=()=>{this.disable()},this.five=five;let defaultState={enabled:!1,visible:!0};this.state=Object.assign(defaultState,params==null?void 0:params.initialState);let config=Object.assign(Object.assign({},params==null?void 0:params.config),{maxOpacity:1});this._config=config,!(typeof document>`u`)&&(this.canvas=document.createElement(`canvas`),this.ctx=this.canvas.getContext(`2d`),this.canvas.width=CANVAS_WIDTH,this.canvas.height=CANVAS_HEIGHT,this.ctx.shadowColor=`rgba(255,255,255,0.5)`,this.ctx.shadowBlur=6,this.ctx.shadowOffsetX=0,this.ctx.shadowOffsetY=0,this.canvasTexture=new THREE.CanvasTexture(this.canvas),this.materialUniforms.u.map.value=this.canvasTexture,this.group.add(this.mesh),this.panoMesh.setProgress(1),this.panoMesh.setOpacity(0),this.group.add(this.panoMesh),this.state.enabled&&this._enable({userAction:!1}))}load(data){return __awaiter(this,void 0,void 0,function*(){})}_enable(options){this.mesh.position.copy(this.five.observers[this.five.state.panoIndex].standingPosition),this.panoMesh.position.copy(this.five.observers[this.five.state.panoIndex].standingPosition),this.five.ready().then(()=>{this.five.scene.add(this.group),this.stop=AnimationFrameLoop.shared.add((time,deltaTime)=>{this.startTime||(this.startTime=time),this.panoMesh.updateTime(time,deltaTime),this.anime(time)})})}_disable(options){this.five.scene.remove(this.group),this.panoMesh.setOpacity(0),this.startTime=void 0,this.stop(),this.five.needsRender=!0}enable(options){var _a;if(!this.ctx||this.state.enabled||!this.five.observers[this.five.state.panoIndex])return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this.updateState({enabled:!0},userAction),this._enable({userAction})}disable(options){var _a;if(this.state.enabled===!1)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this.updateState({enabled:!1},userAction),this._disable({userAction})}setState(state,options={}){let prevState=this.state,userAction=options.userAction===void 0?!0:options.userAction;if(this.updateState(state,userAction),state.enabled!==void 0&&prevState.enabled!==state.enabled){let options={userAction};state.enabled?this._enable(options):this._disable(options)}}};export{Controller};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const
|
|
338
|
+
*/const require_Controller=require("./Controller.js");var PanoAnimePlugin=(five,params)=>new require_Controller.Controller(five,params);exports.PanoAnimePlugin=PanoAnimePlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{Controller
|
|
338
|
+
*/import{Controller}from"./Controller.mjs";var PanoAnimePlugin=(five,params)=>new Controller(five,params);export{PanoAnimePlugin};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const
|
|
338
|
+
*/const require_runtime=require("../../_virtual/_rolldown/runtime.js"),require_index=require("../BasePlugin/index.js"),require_word_pass=require("./word-pass.js"),require_textToStrokeOrderStrokes=require("./textToStrokeOrderStrokes.js");let tslib=require("tslib"),three_webgpu=require("three/webgpu");three_webgpu=require_runtime.__toESM(three_webgpu,1);var Controller=class extends require_index.BasePlugin.Controller{updateState(state,userAction){let prevState=this.state;this.state=Object.assign(Object.assign({},this.state),state),this.hooks.emit(`stateChange`,{state:this.state,prevState,userAction})}constructor(five,params){var _a,_b;super(five),this.dispose=()=>{this.disable(),this.wordPass.dispose()},this.five=five;let defaultState={enabled:!1,visible:!0};this.state=Object.assign(defaultState,params==null?void 0:params.initialState);let outputType=(_b=(_a=params==null?void 0:params.config)==null?void 0:_a.outputType)==null?five.enableHDR?three_webgpu.HalfFloatType:three_webgpu.UnsignedByteType:_b;this.wordPass=new require_word_pass.WordPass(five.camera,outputType),this.state.enabled&&this._enable()}load(){return(0,tslib.__awaiter)(this,void 0,void 0,function*(){})}_enable(){this.five.addPass(this.wordPass),this.wordPass.enabled=this.state.visible,this.five.needsRender=!0}_disable(){this.five.removePass(this.wordPass),this.wordPass.clearWords(),this.five.needsRender=!0}enable(options){var _a;if(this.state.enabled)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this.updateState({enabled:!0},userAction),this._enable()}disable(options){var _a;if(this.state.enabled===!1)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this.updateState({enabled:!1},userAction),this._disable()}setState(state,options={}){var _a;let prevState=this.state,userAction=(_a=options.userAction)==null?!0:_a;this.updateState(state,userAction),state.enabled!==void 0&&prevState.enabled!==state.enabled&&(state.enabled?this._enable():this._disable()),state.visible!==void 0&&prevState.visible!==state.visible&&(this.wordPass.enabled=state.visible,this.five.needsRender=!0)}setWords(words){let ids=this.wordPass.setWords(words);return this.five.needsRender=!0,ids}addWord(...words){let ids=this.wordPass.addWord(...words);return this.five.needsRender=!0,ids}removeWord(...ids){let removed=this.wordPass.removeWord(...ids);return this.five.needsRender=!0,removed}setWord(params){this.wordPass.setWord(params),this.five.needsRender=!0}clearWords(){this.wordPass.clearWords(),this.five.needsRender=!0}hasWord(id){return this.wordPass.hasWord(id)}setMaxDisplayBoost(value){this.wordPass.setMaxDisplayBoost(value),this.five.needsRender=!0}writeText(text_1){return(0,tslib.__awaiter)(this,arguments,void 0,function*(text,options={}){let{size,letterSpacing,lineSpacing,normal,up,center,position,smooth,smoothSubdivisions,cdnBaseUrl,charDataLoader,latinScale}=options,style=(0,tslib.__rest)(options,[`size`,`letterSpacing`,`lineSpacing`,`normal`,`up`,`center`,`position`,`smooth`,`smoothSubdivisions`,`cdnBaseUrl`,`charDataLoader`,`latinScale`]),strokes=yield require_textToStrokeOrderStrokes.textToStrokeOrderStrokes(text,{size,letterSpacing,lineSpacing,normal,up,center,position,smooth,smoothSubdivisions,cdnBaseUrl,charDataLoader,latinScale});this.state.enabled||this.enable(),style.id!==void 0&&this.hasWord(style.id)&&this.removeWord(style.id);let[wordId]=this.addWord(Object.assign(Object.assign({},style),{strokes}));return wordId})}};exports.Controller=Controller;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{BasePlugin
|
|
338
|
+
*/import{BasePlugin}from"../BasePlugin/index.mjs";import{WordPass}from"./word-pass.mjs";import{textToStrokeOrderStrokes}from"./textToStrokeOrderStrokes.mjs";import{__awaiter,__rest}from"tslib";import*as THREE from"three/webgpu";var Controller=class extends BasePlugin.Controller{updateState(state,userAction){let prevState=this.state;this.state=Object.assign(Object.assign({},this.state),state),this.hooks.emit(`stateChange`,{state:this.state,prevState,userAction})}constructor(five,params){var _a,_b;super(five),this.dispose=()=>{this.disable(),this.wordPass.dispose()},this.five=five;let defaultState={enabled:!1,visible:!0};this.state=Object.assign(defaultState,params==null?void 0:params.initialState);let outputType=(_b=(_a=params==null?void 0:params.config)==null?void 0:_a.outputType)==null?five.enableHDR?THREE.HalfFloatType:THREE.UnsignedByteType:_b;this.wordPass=new WordPass(five.camera,outputType),this.state.enabled&&this._enable()}load(){return __awaiter(this,void 0,void 0,function*(){})}_enable(){this.five.addPass(this.wordPass),this.wordPass.enabled=this.state.visible,this.five.needsRender=!0}_disable(){this.five.removePass(this.wordPass),this.wordPass.clearWords(),this.five.needsRender=!0}enable(options){var _a;if(this.state.enabled)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this.updateState({enabled:!0},userAction),this._enable()}disable(options){var _a;if(this.state.enabled===!1)return;let userAction=(_a=options==null?void 0:options.userAction)==null?!0:_a;this.updateState({enabled:!1},userAction),this._disable()}setState(state,options={}){var _a;let prevState=this.state,userAction=(_a=options.userAction)==null?!0:_a;this.updateState(state,userAction),state.enabled!==void 0&&prevState.enabled!==state.enabled&&(state.enabled?this._enable():this._disable()),state.visible!==void 0&&prevState.visible!==state.visible&&(this.wordPass.enabled=state.visible,this.five.needsRender=!0)}setWords(words){let ids=this.wordPass.setWords(words);return this.five.needsRender=!0,ids}addWord(...words){let ids=this.wordPass.addWord(...words);return this.five.needsRender=!0,ids}removeWord(...ids){let removed=this.wordPass.removeWord(...ids);return this.five.needsRender=!0,removed}setWord(params){this.wordPass.setWord(params),this.five.needsRender=!0}clearWords(){this.wordPass.clearWords(),this.five.needsRender=!0}hasWord(id){return this.wordPass.hasWord(id)}setMaxDisplayBoost(value){this.wordPass.setMaxDisplayBoost(value),this.five.needsRender=!0}writeText(text_1){return __awaiter(this,arguments,void 0,function*(text,options={}){let{size,letterSpacing,lineSpacing,normal,up,center,position,smooth,smoothSubdivisions,cdnBaseUrl,charDataLoader,latinScale}=options,style=__rest(options,[`size`,`letterSpacing`,`lineSpacing`,`normal`,`up`,`center`,`position`,`smooth`,`smoothSubdivisions`,`cdnBaseUrl`,`charDataLoader`,`latinScale`]),strokes=yield textToStrokeOrderStrokes(text,{size,letterSpacing,lineSpacing,normal,up,center,position,smooth,smoothSubdivisions,cdnBaseUrl,charDataLoader,latinScale});this.state.enabled||this.enable(),style.id!==void 0&&this.hasWord(style.id)&&this.removeWord(style.id);let[wordId]=this.addWord(Object.assign(Object.assign({},style),{strokes}));return wordId})}};export{Controller};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/var
|
|
338
|
+
*/var FUTURAL={name:`Sans 1-stroke`,chars:[{d:`M5,1 L5,15 M5,20 L4,21 5,22 6,21 5,20`,o:5},{d:`M4,1 L4,8 M12,1 L12,8`,o:8},{d:`M11,-3 L4,29 M17,-3 L10,29 M4,10 L18,10 M3,16 L17,16`,o:11},{d:`M8,-3 L8,26 M12,-3 L12,26 M17,4 L15,2 12,1 8,1 5,2 3,4 3,6 4,8 5,9 7,10 13,12 15,13 16,14 17,16 17,19 15,21 12,22 8,22 5,21 3,19`,o:10},{d:`M21,1 L3,22 M8,1 L10,3 10,5 9,7 7,8 5,8 3,6 3,4 4,2 6,1 8,1 10,2 13,3 16,3 19,2 21,1 M17,15 L15,16 14,18 14,20 16,22 18,22 20,21 21,19 21,17 19,15 17,15`,o:12},{d:`M23,10 L23,9 22,8 21,8 20,9 19,11 17,16 15,19 13,21 11,22 7,22 5,21 4,20 3,18 3,16 4,14 5,13 12,9 13,8 14,6 14,4 13,2 11,1 9,2 8,4 8,6 9,9 11,12 16,19 18,21 20,22 22,22 23,21 23,20`,o:13},{d:`M5,3 L4,2 5,1 6,2 6,4 5,6 4,7`,o:5},{d:`M11,-3 L9,-1 7,2 5,6 4,11 4,15 5,20 7,24 9,27 11,29`,o:7},{d:`M3,-3 L5,-1 7,2 9,6 10,11 10,15 9,20 7,24 5,27 3,29`,o:7},{d:`M8,7 L8,19 M3,10 L13,16 M13,10 L3,16`,o:8},{d:`M13,4 L13,22 M4,13 L22,13`,o:13},{d:`M5,18 L4,19 3,18 4,17 5,18 5,20 3,22`,o:4},{d:`M4,13 L22,13`,o:13},{d:`M4,17 L3,18 4,19 5,18 4,17`,o:4},{d:`M20,-3 L2,29`,o:11},{d:`M9,1 L6,2 4,5 3,10 3,13 4,18 6,21 9,22 11,22 14,21 16,18 17,13 17,10 16,5 14,2 11,1 9,1`,o:10},{d:`M6,5 L8,4 11,1 11,22`,o:10},{d:`M4,6 L4,5 5,3 6,2 8,1 12,1 14,2 15,3 16,5 16,7 15,9 13,12 3,22 17,22`,o:10},{d:`M5,1 L16,1 10,9 13,9 15,10 16,11 17,14 17,16 16,19 14,21 11,22 8,22 5,21 4,20 3,18`,o:10},{d:`M13,1 L3,15 18,15 M13,1 L13,22`,o:10},{d:`M15,1 L5,1 4,10 5,9 8,8 11,8 14,9 16,11 17,14 17,16 16,19 14,21 11,22 8,22 5,21 4,20 3,18`,o:10},{d:`M16,4 L15,2 12,1 10,1 7,2 5,5 4,10 4,15 5,19 7,21 10,22 11,22 14,21 16,19 17,16 17,15 16,12 14,10 11,9 10,9 7,10 5,12 4,15`,o:10},{d:`M17,1 L7,22 M3,1 L17,1`,o:10},{d:`M8,1 L5,2 4,4 4,6 5,8 7,9 11,10 14,11 16,13 17,15 17,18 16,20 15,21 12,22 8,22 5,21 4,20 3,18 3,15 4,13 6,11 9,10 13,9 15,8 16,6 16,4 15,2 12,1 8,1`,o:10},{d:`M16,8 L15,11 13,13 10,14 9,14 6,13 4,11 3,8 3,7 4,4 6,2 9,1 10,1 13,2 15,4 16,8 16,13 15,18 13,21 10,22 8,22 5,21 4,19`,o:10},{d:`M4,10 L3,11 4,12 5,11 4,10 M4,17 L3,18 4,19 5,18 4,17`,o:4},{d:`M4,10 L3,11 4,12 5,11 4,10 M5,18 L4,19 3,18 4,17 5,18 5,20 3,22`,o:4},{d:`M20,4 L4,13 20,22`,o:12},{d:`M4,10 L22,10 M4,16 L22,16`,o:13},{d:`M4,4 L20,13 4,22`,o:12},{d:`M3,6 L3,5 4,3 5,2 7,1 11,1 13,2 14,3 15,5 15,7 14,9 13,10 9,12 9,15 M9,20 L8,21 9,22 10,21 9,20`,o:9},{d:`M18,9 L17,7 15,6 12,6 10,7 9,8 8,11 8,14 9,16 11,17 14,17 16,16 17,14 M12,6 L10,8 9,11 9,14 10,16 11,17 M18,6 L17,14 17,16 19,17 21,17 23,15 24,12 24,10 23,7 22,5 20,3 18,2 15,1 12,1 9,2 7,3 5,5 4,7 3,10 3,13 4,16 5,18 7,20 9,21 12,22 15,22 18,21 20,20 21,19 M19,6 L18,14 18,16 19,17`,o:14},{d:`M9,1 L1,22 M9,1 L17,22 M4,15 L14,15`,o:9},{d:`M4,1 L4,22 M4,1 L13,1 16,2 17,3 18,5 18,7 17,9 16,10 13,11 M4,11 L13,11 16,12 17,13 18,15 18,18 17,20 16,21 13,22 4,22`,o:10},{d:`M18,6 L17,4 15,2 13,1 9,1 7,2 5,4 4,6 3,9 3,14 4,17 5,19 7,21 9,22 13,22 15,21 17,19 18,17`,o:11},{d:`M4,1 L4,22 M4,1 L11,1 14,2 16,4 17,6 18,9 18,14 17,17 16,19 14,21 11,22 4,22`,o:10},{d:`M4,1 L4,22 M4,1 L17,1 M4,11 L12,11 M4,22 L17,22`,o:9},{d:`M4,1 L4,22 M4,1 L17,1 M4,11 L12,11`,o:8},{d:`M18,6 L17,4 15,2 13,1 9,1 7,2 5,4 4,6 3,9 3,14 4,17 5,19 7,21 9,22 13,22 15,21 17,19 18,17 18,14 M13,14 L18,14`,o:11},{d:`M4,1 L4,22 M18,1 L18,22 M4,11 L18,11`,o:11},{d:`M4,1 L4,22`,o:4},{d:`M12,1 L12,17 11,20 10,21 8,22 6,22 4,21 3,20 2,17 2,15`,o:8},{d:`M4,1 L4,22 M18,1 L4,15 M9,10 L18,22`,o:10},{d:`M4,1 L4,22 M4,22 L16,22`,o:7},{d:`M4,1 L4,22 M4,1 L12,22 M20,1 L12,22 M20,1 L20,22`,o:12},{d:`M4,1 L4,22 M4,1 L18,22 M18,1 L18,22`,o:11},{d:`M9,1 L7,2 5,4 4,6 3,9 3,14 4,17 5,19 7,21 9,22 13,22 15,21 17,19 18,17 19,14 19,9 18,6 17,4 15,2 13,1 9,1`,o:11},{d:`M4,1 L4,22 M4,1 L13,1 16,2 17,3 18,5 18,8 17,10 16,11 13,12 4,12`,o:10},{d:`M9,1 L7,2 5,4 4,6 3,9 3,14 4,17 5,19 7,21 9,22 13,22 15,21 17,19 18,17 19,14 19,9 18,6 17,4 15,2 13,1 9,1 M12,18 L18,24`,o:11},{d:`M4,1 L4,22 M4,1 L13,1 16,2 17,3 18,5 18,7 17,9 16,10 13,11 4,11 M11,11 L18,22`,o:10},{d:`M17,4 L15,2 12,1 8,1 5,2 3,4 3,6 4,8 5,9 7,10 13,12 15,13 16,14 17,16 17,19 15,21 12,22 8,22 5,21 3,19`,o:10},{d:`M8,1 L8,22 M1,1 L15,1`,o:8},{d:`M4,1 L4,16 5,19 7,21 10,22 12,22 15,21 17,19 18,16 18,1`,o:11},{d:`M1,1 L9,22 M17,1 L9,22`,o:9},{d:`M2,1 L7,22 M12,1 L7,22 M12,1 L17,22 M22,1 L17,22`,o:12},{d:`M3,1 L17,22 M17,1 L3,22`,o:10},{d:`M1,1 L9,11 9,22 M17,1 L9,11`,o:9},{d:`M17,1 L3,22 M3,1 L17,1 M3,22 L17,22`,o:10},{d:`M4,-3 L4,29 M5,-3 L5,29 M4,-3 L11,-3 M4,29 L11,29`,o:7},{d:`M0,1 L14,25`,o:7},{d:`M9,-3 L9,29 M10,-3 L10,29 M3,-3 L10,-3 M3,29 L10,29`,o:7},{d:`M8,-1 L0,13 M8,-1 L16,13`,o:8},{d:`M0,29 L18,29`,o:9},{d:`M5,6 L3,8 3,10 4,11 5,10 4,9 3,10`,o:4},{d:`M15,8 L15,22 M15,11 L13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:10},{d:`M4,1 L4,22 M4,11 L6,9 8,8 11,8 13,9 15,11 16,14 16,16 15,19 13,21 11,22 8,22 6,21 4,19`,o:9},{d:`M15,11 L13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:9},{d:`M15,1 L15,22 M15,11 L13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:10},{d:`M3,14 L15,14 15,12 14,10 13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:9},{d:`M10,1 L8,1 6,2 5,5 5,22 M2,8 L9,8`,o:7},{d:`M15,8 L15,24 14,27 13,28 11,29 8,29 6,28 M15,11 L13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:10},{d:`M4,1 L4,22 M4,12 L7,9 9,8 12,8 14,9 15,12 15,22`,o:10},{d:`M3,1 L4,2 5,1 4,0 3,1 M4,8 L4,22`,o:4},{d:`M5,1 L6,2 7,1 6,0 5,1 M6,8 L6,25 5,28 3,29 1,29`,o:5},{d:`M4,1 L4,22 M14,8 L4,18 M8,14 L15,22`,o:8},{d:`M4,1 L4,22`,o:4},{d:`M4,8 L4,22 M4,12 L7,9 9,8 12,8 14,9 15,12 15,22 M15,12 L18,9 20,8 23,8 25,9 26,12 26,22`,o:15},{d:`M4,8 L4,22 M4,12 L7,9 9,8 12,8 14,9 15,12 15,22`,o:10},{d:`M8,8 L6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19 16,16 16,14 15,11 13,9 11,8 8,8`,o:10},{d:`M4,8 L4,29 M4,11 L6,9 8,8 11,8 13,9 15,11 16,14 16,16 15,19 13,21 11,22 8,22 6,21 4,19`,o:9},{d:`M15,8 L15,29 M15,11 L13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:10},{d:`M4,8 L4,22 M4,14 L5,11 7,9 9,8 12,8`,o:6},{d:`M14,11 L13,9 10,8 7,8 4,9 3,11 4,13 6,14 11,15 13,16 14,18 14,19 13,21 10,22 7,22 4,21 3,19`,o:9},{d:`M5,1 L5,18 6,21 8,22 10,22 M2,8 L9,8`,o:7},{d:`M4,8 L4,18 5,21 7,22 10,22 12,21 15,18 M15,8 L15,22`,o:10},{d:`M2,8 L8,22 M14,8 L8,22`,o:8},{d:`M3,8 L7,22 M11,8 L7,22 M11,8 L15,22 M19,8 L15,22`,o:11},{d:`M3,8 L14,22 M14,8 L3,22`,o:9},{d:`M2,8 L8,22 M14,8 L8,22 6,26 4,28 2,29 1,29`,o:8},{d:`M14,8 L3,22 M3,8 L14,8 M3,22 L14,22`,o:9},{d:`M9,-3 L7,-2 6,-1 5,1 5,3 6,5 7,6 8,8 8,10 6,12 M7,-2 L6,0 6,2 7,4 8,5 9,7 9,9 8,11 4,13 8,15 9,17 9,19 8,21 7,22 6,24 6,26 7,28 M6,14 L8,16 8,18 7,20 6,21 5,23 5,25 6,27 7,28 9,29`,o:7},{d:`M4,-3 L4,29`,o:4},{d:`M5,-3 L7,-2 8,-1 9,1 9,3 8,5 7,6 6,8 6,10 8,12 M7,-2 L8,0 8,2 7,4 6,5 5,7 5,9 6,11 10,13 6,15 5,17 5,19 6,21 7,22 8,24 8,26 7,28 M8,14 L6,16 6,18 7,20 8,21 9,23 9,25 8,27 7,28 5,29`,o:7},{d:`M3,16 L3,14 4,11 6,10 8,10 10,11 14,14 16,15 18,15 20,14 21,12 M3,14 L4,12 6,11 8,11 10,12 14,15 16,16 18,16 20,15 21,12 21,10`,o:12},{d:`M0,1 L0,22 1,22 1,1 2,1 2,22 3,22 3,1 4,1 4,22 5,22 5,1 6,1 6,22 7,22 7,1 8,1 8,22 9,22 9,1 10,1 10,22 11,22 11,1 12,1 12,22 13,22 13,1 14,1 14,22 15,22 15,1 16,1 16,22`,o:8}]},cachedMap=null;function parseHersheyPath(d){let polylines=[],cur=null;for(let tok of d.trim().split(/\s+/)){let s=tok,cmd=``;(s[0]===`M`||s[0]===`L`)&&(cmd=s[0],s=s.slice(1));let comma=s.indexOf(`,`);if(comma<0)continue;let x=parseFloat(s.slice(0,comma)),y=parseFloat(s.slice(comma+1));Number.isNaN(x)||Number.isNaN(y)||(cmd===`M`?(cur=[[x,y]],polylines.push(cur)):cur?cur.push([x,y]):(cur=[[x,y]],polylines.push(cur)))}return polylines}function loadHersheyFont(data=FUTURAL){if(cachedMap&&data===FUTURAL)return cachedMap;if(!data||!Array.isArray(data.chars))return null;let rawGlyphs=data.chars.map(c=>({polylines:parseHersheyPath(c.d||``),o:c.o})),capTop=1/0,baseline=-1/0,measure=code=>{let g=rawGlyphs[code-33];if(!g)return!1;let found=!1;for(let pl of g.polylines)for(let p of pl)p[1]<capTop&&(capTop=p[1]),p[1]>baseline&&(baseline=p[1]),found=!0;return found};measure(72)||measure(69)||measure(88)||measure(73),(!Number.isFinite(capTop)||!Number.isFinite(baseline)||baseline<=capTop)&&(capTop=4,baseline=21);let capHeight=baseline-capTop,gap=capHeight*.14,map=new Map;for(let i=0;i<rawGlyphs.length;i++){let g=rawGlyphs[i],minX=1/0,maxX=-1/0;for(let pl of g.polylines)for(let p of pl)p[0]<minX&&(minX=p[0]),p[0]>maxX&&(maxX=p[0]);let hasPoints=Number.isFinite(minX),left=hasPoints?minX:0,width=hasPoints?maxX-minX:g.o,polylines=g.polylines.map(pl=>pl.map(([x,y])=>[(x-left)/capHeight,(baseline-y)/capHeight]));map.set(33+i,{polylines,advance:(width+gap)/capHeight})}return data===FUTURAL&&(cachedMap=map),map}exports.loadHersheyFont=loadHersheyFont;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/var
|
|
338
|
+
*/var FUTURAL={name:`Sans 1-stroke`,chars:[{d:`M5,1 L5,15 M5,20 L4,21 5,22 6,21 5,20`,o:5},{d:`M4,1 L4,8 M12,1 L12,8`,o:8},{d:`M11,-3 L4,29 M17,-3 L10,29 M4,10 L18,10 M3,16 L17,16`,o:11},{d:`M8,-3 L8,26 M12,-3 L12,26 M17,4 L15,2 12,1 8,1 5,2 3,4 3,6 4,8 5,9 7,10 13,12 15,13 16,14 17,16 17,19 15,21 12,22 8,22 5,21 3,19`,o:10},{d:`M21,1 L3,22 M8,1 L10,3 10,5 9,7 7,8 5,8 3,6 3,4 4,2 6,1 8,1 10,2 13,3 16,3 19,2 21,1 M17,15 L15,16 14,18 14,20 16,22 18,22 20,21 21,19 21,17 19,15 17,15`,o:12},{d:`M23,10 L23,9 22,8 21,8 20,9 19,11 17,16 15,19 13,21 11,22 7,22 5,21 4,20 3,18 3,16 4,14 5,13 12,9 13,8 14,6 14,4 13,2 11,1 9,2 8,4 8,6 9,9 11,12 16,19 18,21 20,22 22,22 23,21 23,20`,o:13},{d:`M5,3 L4,2 5,1 6,2 6,4 5,6 4,7`,o:5},{d:`M11,-3 L9,-1 7,2 5,6 4,11 4,15 5,20 7,24 9,27 11,29`,o:7},{d:`M3,-3 L5,-1 7,2 9,6 10,11 10,15 9,20 7,24 5,27 3,29`,o:7},{d:`M8,7 L8,19 M3,10 L13,16 M13,10 L3,16`,o:8},{d:`M13,4 L13,22 M4,13 L22,13`,o:13},{d:`M5,18 L4,19 3,18 4,17 5,18 5,20 3,22`,o:4},{d:`M4,13 L22,13`,o:13},{d:`M4,17 L3,18 4,19 5,18 4,17`,o:4},{d:`M20,-3 L2,29`,o:11},{d:`M9,1 L6,2 4,5 3,10 3,13 4,18 6,21 9,22 11,22 14,21 16,18 17,13 17,10 16,5 14,2 11,1 9,1`,o:10},{d:`M6,5 L8,4 11,1 11,22`,o:10},{d:`M4,6 L4,5 5,3 6,2 8,1 12,1 14,2 15,3 16,5 16,7 15,9 13,12 3,22 17,22`,o:10},{d:`M5,1 L16,1 10,9 13,9 15,10 16,11 17,14 17,16 16,19 14,21 11,22 8,22 5,21 4,20 3,18`,o:10},{d:`M13,1 L3,15 18,15 M13,1 L13,22`,o:10},{d:`M15,1 L5,1 4,10 5,9 8,8 11,8 14,9 16,11 17,14 17,16 16,19 14,21 11,22 8,22 5,21 4,20 3,18`,o:10},{d:`M16,4 L15,2 12,1 10,1 7,2 5,5 4,10 4,15 5,19 7,21 10,22 11,22 14,21 16,19 17,16 17,15 16,12 14,10 11,9 10,9 7,10 5,12 4,15`,o:10},{d:`M17,1 L7,22 M3,1 L17,1`,o:10},{d:`M8,1 L5,2 4,4 4,6 5,8 7,9 11,10 14,11 16,13 17,15 17,18 16,20 15,21 12,22 8,22 5,21 4,20 3,18 3,15 4,13 6,11 9,10 13,9 15,8 16,6 16,4 15,2 12,1 8,1`,o:10},{d:`M16,8 L15,11 13,13 10,14 9,14 6,13 4,11 3,8 3,7 4,4 6,2 9,1 10,1 13,2 15,4 16,8 16,13 15,18 13,21 10,22 8,22 5,21 4,19`,o:10},{d:`M4,10 L3,11 4,12 5,11 4,10 M4,17 L3,18 4,19 5,18 4,17`,o:4},{d:`M4,10 L3,11 4,12 5,11 4,10 M5,18 L4,19 3,18 4,17 5,18 5,20 3,22`,o:4},{d:`M20,4 L4,13 20,22`,o:12},{d:`M4,10 L22,10 M4,16 L22,16`,o:13},{d:`M4,4 L20,13 4,22`,o:12},{d:`M3,6 L3,5 4,3 5,2 7,1 11,1 13,2 14,3 15,5 15,7 14,9 13,10 9,12 9,15 M9,20 L8,21 9,22 10,21 9,20`,o:9},{d:`M18,9 L17,7 15,6 12,6 10,7 9,8 8,11 8,14 9,16 11,17 14,17 16,16 17,14 M12,6 L10,8 9,11 9,14 10,16 11,17 M18,6 L17,14 17,16 19,17 21,17 23,15 24,12 24,10 23,7 22,5 20,3 18,2 15,1 12,1 9,2 7,3 5,5 4,7 3,10 3,13 4,16 5,18 7,20 9,21 12,22 15,22 18,21 20,20 21,19 M19,6 L18,14 18,16 19,17`,o:14},{d:`M9,1 L1,22 M9,1 L17,22 M4,15 L14,15`,o:9},{d:`M4,1 L4,22 M4,1 L13,1 16,2 17,3 18,5 18,7 17,9 16,10 13,11 M4,11 L13,11 16,12 17,13 18,15 18,18 17,20 16,21 13,22 4,22`,o:10},{d:`M18,6 L17,4 15,2 13,1 9,1 7,2 5,4 4,6 3,9 3,14 4,17 5,19 7,21 9,22 13,22 15,21 17,19 18,17`,o:11},{d:`M4,1 L4,22 M4,1 L11,1 14,2 16,4 17,6 18,9 18,14 17,17 16,19 14,21 11,22 4,22`,o:10},{d:`M4,1 L4,22 M4,1 L17,1 M4,11 L12,11 M4,22 L17,22`,o:9},{d:`M4,1 L4,22 M4,1 L17,1 M4,11 L12,11`,o:8},{d:`M18,6 L17,4 15,2 13,1 9,1 7,2 5,4 4,6 3,9 3,14 4,17 5,19 7,21 9,22 13,22 15,21 17,19 18,17 18,14 M13,14 L18,14`,o:11},{d:`M4,1 L4,22 M18,1 L18,22 M4,11 L18,11`,o:11},{d:`M4,1 L4,22`,o:4},{d:`M12,1 L12,17 11,20 10,21 8,22 6,22 4,21 3,20 2,17 2,15`,o:8},{d:`M4,1 L4,22 M18,1 L4,15 M9,10 L18,22`,o:10},{d:`M4,1 L4,22 M4,22 L16,22`,o:7},{d:`M4,1 L4,22 M4,1 L12,22 M20,1 L12,22 M20,1 L20,22`,o:12},{d:`M4,1 L4,22 M4,1 L18,22 M18,1 L18,22`,o:11},{d:`M9,1 L7,2 5,4 4,6 3,9 3,14 4,17 5,19 7,21 9,22 13,22 15,21 17,19 18,17 19,14 19,9 18,6 17,4 15,2 13,1 9,1`,o:11},{d:`M4,1 L4,22 M4,1 L13,1 16,2 17,3 18,5 18,8 17,10 16,11 13,12 4,12`,o:10},{d:`M9,1 L7,2 5,4 4,6 3,9 3,14 4,17 5,19 7,21 9,22 13,22 15,21 17,19 18,17 19,14 19,9 18,6 17,4 15,2 13,1 9,1 M12,18 L18,24`,o:11},{d:`M4,1 L4,22 M4,1 L13,1 16,2 17,3 18,5 18,7 17,9 16,10 13,11 4,11 M11,11 L18,22`,o:10},{d:`M17,4 L15,2 12,1 8,1 5,2 3,4 3,6 4,8 5,9 7,10 13,12 15,13 16,14 17,16 17,19 15,21 12,22 8,22 5,21 3,19`,o:10},{d:`M8,1 L8,22 M1,1 L15,1`,o:8},{d:`M4,1 L4,16 5,19 7,21 10,22 12,22 15,21 17,19 18,16 18,1`,o:11},{d:`M1,1 L9,22 M17,1 L9,22`,o:9},{d:`M2,1 L7,22 M12,1 L7,22 M12,1 L17,22 M22,1 L17,22`,o:12},{d:`M3,1 L17,22 M17,1 L3,22`,o:10},{d:`M1,1 L9,11 9,22 M17,1 L9,11`,o:9},{d:`M17,1 L3,22 M3,1 L17,1 M3,22 L17,22`,o:10},{d:`M4,-3 L4,29 M5,-3 L5,29 M4,-3 L11,-3 M4,29 L11,29`,o:7},{d:`M0,1 L14,25`,o:7},{d:`M9,-3 L9,29 M10,-3 L10,29 M3,-3 L10,-3 M3,29 L10,29`,o:7},{d:`M8,-1 L0,13 M8,-1 L16,13`,o:8},{d:`M0,29 L18,29`,o:9},{d:`M5,6 L3,8 3,10 4,11 5,10 4,9 3,10`,o:4},{d:`M15,8 L15,22 M15,11 L13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:10},{d:`M4,1 L4,22 M4,11 L6,9 8,8 11,8 13,9 15,11 16,14 16,16 15,19 13,21 11,22 8,22 6,21 4,19`,o:9},{d:`M15,11 L13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:9},{d:`M15,1 L15,22 M15,11 L13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:10},{d:`M3,14 L15,14 15,12 14,10 13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:9},{d:`M10,1 L8,1 6,2 5,5 5,22 M2,8 L9,8`,o:7},{d:`M15,8 L15,24 14,27 13,28 11,29 8,29 6,28 M15,11 L13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:10},{d:`M4,1 L4,22 M4,12 L7,9 9,8 12,8 14,9 15,12 15,22`,o:10},{d:`M3,1 L4,2 5,1 4,0 3,1 M4,8 L4,22`,o:4},{d:`M5,1 L6,2 7,1 6,0 5,1 M6,8 L6,25 5,28 3,29 1,29`,o:5},{d:`M4,1 L4,22 M14,8 L4,18 M8,14 L15,22`,o:8},{d:`M4,1 L4,22`,o:4},{d:`M4,8 L4,22 M4,12 L7,9 9,8 12,8 14,9 15,12 15,22 M15,12 L18,9 20,8 23,8 25,9 26,12 26,22`,o:15},{d:`M4,8 L4,22 M4,12 L7,9 9,8 12,8 14,9 15,12 15,22`,o:10},{d:`M8,8 L6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19 16,16 16,14 15,11 13,9 11,8 8,8`,o:10},{d:`M4,8 L4,29 M4,11 L6,9 8,8 11,8 13,9 15,11 16,14 16,16 15,19 13,21 11,22 8,22 6,21 4,19`,o:9},{d:`M15,8 L15,29 M15,11 L13,9 11,8 8,8 6,9 4,11 3,14 3,16 4,19 6,21 8,22 11,22 13,21 15,19`,o:10},{d:`M4,8 L4,22 M4,14 L5,11 7,9 9,8 12,8`,o:6},{d:`M14,11 L13,9 10,8 7,8 4,9 3,11 4,13 6,14 11,15 13,16 14,18 14,19 13,21 10,22 7,22 4,21 3,19`,o:9},{d:`M5,1 L5,18 6,21 8,22 10,22 M2,8 L9,8`,o:7},{d:`M4,8 L4,18 5,21 7,22 10,22 12,21 15,18 M15,8 L15,22`,o:10},{d:`M2,8 L8,22 M14,8 L8,22`,o:8},{d:`M3,8 L7,22 M11,8 L7,22 M11,8 L15,22 M19,8 L15,22`,o:11},{d:`M3,8 L14,22 M14,8 L3,22`,o:9},{d:`M2,8 L8,22 M14,8 L8,22 6,26 4,28 2,29 1,29`,o:8},{d:`M14,8 L3,22 M3,8 L14,8 M3,22 L14,22`,o:9},{d:`M9,-3 L7,-2 6,-1 5,1 5,3 6,5 7,6 8,8 8,10 6,12 M7,-2 L6,0 6,2 7,4 8,5 9,7 9,9 8,11 4,13 8,15 9,17 9,19 8,21 7,22 6,24 6,26 7,28 M6,14 L8,16 8,18 7,20 6,21 5,23 5,25 6,27 7,28 9,29`,o:7},{d:`M4,-3 L4,29`,o:4},{d:`M5,-3 L7,-2 8,-1 9,1 9,3 8,5 7,6 6,8 6,10 8,12 M7,-2 L8,0 8,2 7,4 6,5 5,7 5,9 6,11 10,13 6,15 5,17 5,19 6,21 7,22 8,24 8,26 7,28 M8,14 L6,16 6,18 7,20 8,21 9,23 9,25 8,27 7,28 5,29`,o:7},{d:`M3,16 L3,14 4,11 6,10 8,10 10,11 14,14 16,15 18,15 20,14 21,12 M3,14 L4,12 6,11 8,11 10,12 14,15 16,16 18,16 20,15 21,12 21,10`,o:12},{d:`M0,1 L0,22 1,22 1,1 2,1 2,22 3,22 3,1 4,1 4,22 5,22 5,1 6,1 6,22 7,22 7,1 8,1 8,22 9,22 9,1 10,1 10,22 11,22 11,1 12,1 12,22 13,22 13,1 14,1 14,22 15,22 15,1 16,1 16,22`,o:8}]},cachedMap=null;function parseHersheyPath(d){let polylines=[],cur=null;for(let tok of d.trim().split(/\s+/)){let s=tok,cmd=``;(s[0]===`M`||s[0]===`L`)&&(cmd=s[0],s=s.slice(1));let comma=s.indexOf(`,`);if(comma<0)continue;let x=parseFloat(s.slice(0,comma)),y=parseFloat(s.slice(comma+1));Number.isNaN(x)||Number.isNaN(y)||(cmd===`M`?(cur=[[x,y]],polylines.push(cur)):cur?cur.push([x,y]):(cur=[[x,y]],polylines.push(cur)))}return polylines}function loadHersheyFont(data=FUTURAL){if(cachedMap&&data===FUTURAL)return cachedMap;if(!data||!Array.isArray(data.chars))return null;let rawGlyphs=data.chars.map(c=>({polylines:parseHersheyPath(c.d||``),o:c.o})),capTop=1/0,baseline=-1/0,measure=code=>{let g=rawGlyphs[code-33];if(!g)return!1;let found=!1;for(let pl of g.polylines)for(let p of pl)p[1]<capTop&&(capTop=p[1]),p[1]>baseline&&(baseline=p[1]),found=!0;return found};measure(72)||measure(69)||measure(88)||measure(73),(!Number.isFinite(capTop)||!Number.isFinite(baseline)||baseline<=capTop)&&(capTop=4,baseline=21);let capHeight=baseline-capTop,gap=capHeight*.14,map=new Map;for(let i=0;i<rawGlyphs.length;i++){let g=rawGlyphs[i],minX=1/0,maxX=-1/0;for(let pl of g.polylines)for(let p of pl)p[0]<minX&&(minX=p[0]),p[0]>maxX&&(maxX=p[0]);let hasPoints=Number.isFinite(minX),left=hasPoints?minX:0,width=hasPoints?maxX-minX:g.o,polylines=g.polylines.map(pl=>pl.map(([x,y])=>[(x-left)/capHeight,(baseline-y)/capHeight]));map.set(33+i,{polylines,advance:(width+gap)/capHeight})}return data===FUTURAL&&(cachedMap=map),map}export{loadHersheyFont};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const
|
|
338
|
+
*/const require_hersheyFont=require("./hersheyFont.js"),require_textToStrokeOrderStrokes=require("./textToStrokeOrderStrokes.js"),require_Controller=require("./Controller.js");var WordPassPlugin=(five,params)=>new require_Controller.Controller(five,params);exports.WordPassPlugin=WordPassPlugin,exports.loadHersheyFont=require_hersheyFont.loadHersheyFont,exports.textToStrokeOrderStrokes=require_textToStrokeOrderStrokes.textToStrokeOrderStrokes;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,4 +335,4 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{loadHersheyFont
|
|
338
|
+
*/import{loadHersheyFont}from"./hersheyFont.mjs";import{textToStrokeOrderStrokes}from"./textToStrokeOrderStrokes.mjs";import{Controller}from"./Controller.mjs";var WordPassPlugin=(five,params)=>new Controller(five,params);export{WordPassPlugin,loadHersheyFont,textToStrokeOrderStrokes};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,5 +335,5 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/const
|
|
339
|
-
`){
|
|
338
|
+
*/const require_runtime=require("../../_virtual/_rolldown/runtime.js"),require_hersheyFont=require("./hersheyFont.js");let tslib=require("tslib"),three_webgpu=require("three/webgpu");three_webgpu=require_runtime.__toESM(three_webgpu,1);var HANZI_EM=1024,DEFAULT_CDN=`https://cdn.jsdelivr.net/npm/hanzi-writer-data@latest`;function calculatePath3DLength(points){let length=0;for(let i=1;i<points.length;i++)length+=points[i].distanceTo(points[i-1]);return length}var cache=new Map;function loadHanzi(char,loader,cdnBaseUrl){return(0,tslib.__awaiter)(this,void 0,void 0,function*(){var _a;if(cache.has(char))return cache.get(char);let data=null;try{if(loader)data=(_a=yield loader(char))==null?null:_a;else if(typeof fetch<`u`){let res=yield fetch(`${cdnBaseUrl}/${encodeURIComponent(char)}.json`);res.ok&&(data=yield res.json())}}catch(_b){data=null}return cache.set(char,data),data})}function textToStrokeOrderStrokes(text_1){return(0,tslib.__awaiter)(this,arguments,void 0,function*(text,options={}){var _a;let{size=1,letterSpacing=0,lineSpacing=1.4,normal,up:upOption,center=!0,position,smooth=!0,smoothSubdivisions=4,cdnBaseUrl=DEFAULT_CDN,charDataLoader,latinScale=.72}=options,hershey=require_hersheyFont.loadHersheyFont(),raw=[],cursorX=0,cursorY=0;for(let ch of Array.from(text)){if(ch===`
|
|
339
|
+
`){cursorX=0,cursorY-=lineSpacing;continue}if(ch===` `){cursorX+=.4+letterSpacing;continue}let code=(_a=ch.codePointAt(0))==null?0:_a;if(code>=33&&code<=126){let hg=hershey==null?void 0:hershey.get(code);if(hg){for(let pl of hg.polylines)pl.length<2||raw.push({pts:pl.map(([x,y])=>new three_webgpu.Vector2(cursorX+x*latinScale,cursorY+y*latinScale)),mode:`corner`});cursorX+=hg.advance*latinScale+letterSpacing;continue}console.warn(`textToStrokeOrderStrokes: 无法生成字符 "${ch}"(非浏览器环境或字形为空),按空格处理`),cursorX+=.5*latinScale+letterSpacing;continue}let data=yield loadHanzi(ch,charDataLoader,cdnBaseUrl);if(data&&data.medians&&data.medians.length){for(let median of data.medians)median.length<2||raw.push({pts:median.map(([x,y])=>new three_webgpu.Vector2(cursorX+x/HANZI_EM,cursorY+y/HANZI_EM)),mode:`full`});cursorX+=1+letterSpacing}else console.warn(`textToStrokeOrderStrokes: 未找到 "${ch}" 的笔画数据,按空格处理`),cursorX+=1+letterSpacing}if(raw.length===0)return[];let minX=1/0,minY=1/0,maxX=-1/0,maxY=-1/0;for(let poly of raw)for(let p of poly.pts)p.x<minX&&(minX=p.x),p.x>maxX&&(maxX=p.x),p.y<minY&&(minY=p.y),p.y>maxY&&(maxY=p.y);let cx=center?(minX+maxX)/2:0,cy=center?(minY+maxY)/2:0,origin=position==null?new three_webgpu.Vector3:position,N=(normal==null?new three_webgpu.Vector3(0,0,1):normal).clone();N.lengthSq()<1e-9&&N.set(0,0,1),N.normalize();let up;if(upOption){let projected=upOption.clone().addScaledVector(N,-upOption.dot(N));projected.lengthSq()>1e-9&&(up=projected.normalize())}let right;if(up)right=new three_webgpu.Vector3().crossVectors(up,N).normalize();else{let ref=Math.abs(N.y)>.99?new three_webgpu.Vector3(0,0,-1):new three_webgpu.Vector3(0,1,0);right=new three_webgpu.Vector3().crossVectors(ref,N).normalize(),up=new three_webgpu.Vector3().crossVectors(N,right).normalize()}let toVec3=p=>new three_webgpu.Vector3().copy(origin).addScaledVector(right,(p.x-cx)*size).addScaledVector(up,(p.y-cy)*size);return raw.map(poly=>{let points=poly.pts.map(toVec3);return smooth&&points.length>=2&&(points=poly.mode===`corner`?smoothPreserveCorners(points,smoothSubdivisions):smoothFull(points,smoothSubdivisions)),{points,totalLength:calculatePath3DLength(points)}})})}function smoothFull(points,subdiv){return points.length<3?points:new three_webgpu.CatmullRomCurve3(points,!1,`centripetal`).getPoints(Math.max(points.length*subdiv,8))}var CORNER_COS=.2;function smoothPreserveCorners(points,subdiv){if(points.length<3)return points;let box=new three_webgpu.Box3().setFromPoints(points),diag=box.min.distanceTo(box.max),closed=diag>1e-9&&points[0].distanceTo(points[points.length-1])<diag*.06,pts=closed?points.slice(0,-1):points,n=pts.length;if(n<3)return points;let a=new three_webgpu.Vector3,b=new three_webgpu.Vector3,isCorner=i=>{if(!closed&&(i===0||i===n-1))return!0;let prev=(i-1+n)%n,next=(i+1)%n;a.subVectors(pts[i],pts[prev]),b.subVectors(pts[next],pts[i]);let la=a.length(),lb=b.length();return la<1e-6||lb<1e-6?!1:a.dot(b)/(la*lb)<CORNER_COS},corners=[];for(let i=0;i<n;i++)isCorner(i)&&corners.push(i);if(corners.length===0)return new three_webgpu.CatmullRomCurve3(pts,closed,`centripetal`).getPoints(Math.max(n*subdiv,8));let collectCyclic=(start,end)=>{let seg=[],i=start;for(;seg.push(pts[i]),i!==end;)i=(i+1)%n;return seg},m=corners.length,runCount=closed?m:m-1,out=[];for(let c=0;c<runCount;c++){let seg=collectCyclic(corners[c],corners[(c+1)%m]),smoothed=seg.length>=3?new three_webgpu.CatmullRomCurve3(seg,!1,`centripetal`).getPoints(Math.max((seg.length-1)*subdiv,2)):seg;for(let k=0;k<smoothed.length;k++)c>0&&k===0||out.push(smoothed[k])}return out}exports.textToStrokeOrderStrokes=textToStrokeOrderStrokes;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five-webgpu
|
|
4
|
-
* Generated: 2026/
|
|
5
|
-
* Version: 1.0.0-alpha.
|
|
4
|
+
* Generated: 2026/11/3
|
|
5
|
+
* Version: 1.0.0-alpha.14
|
|
6
6
|
* License:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
|
|
@@ -335,5 +335,5 @@
|
|
|
335
335
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
336
336
|
* Agreement and all related documents shall be drafted in English.
|
|
337
337
|
|
|
338
|
-
*/import{loadHersheyFont
|
|
339
|
-
`){
|
|
338
|
+
*/import{loadHersheyFont}from"./hersheyFont.mjs";import{__awaiter}from"tslib";import*as THREE from"three/webgpu";var HANZI_EM=1024,DEFAULT_CDN=`https://cdn.jsdelivr.net/npm/hanzi-writer-data@latest`;function calculatePath3DLength(points){let length=0;for(let i=1;i<points.length;i++)length+=points[i].distanceTo(points[i-1]);return length}var cache=new Map;function loadHanzi(char,loader,cdnBaseUrl){return __awaiter(this,void 0,void 0,function*(){var _a;if(cache.has(char))return cache.get(char);let data=null;try{if(loader)data=(_a=yield loader(char))==null?null:_a;else if(typeof fetch<`u`){let res=yield fetch(`${cdnBaseUrl}/${encodeURIComponent(char)}.json`);res.ok&&(data=yield res.json())}}catch(_b){data=null}return cache.set(char,data),data})}function textToStrokeOrderStrokes(text_1){return __awaiter(this,arguments,void 0,function*(text,options={}){var _a;let{size=1,letterSpacing=0,lineSpacing=1.4,normal,up:upOption,center=!0,position,smooth=!0,smoothSubdivisions=4,cdnBaseUrl=DEFAULT_CDN,charDataLoader,latinScale=.72}=options,hershey=loadHersheyFont(),raw=[],cursorX=0,cursorY=0;for(let ch of Array.from(text)){if(ch===`
|
|
339
|
+
`){cursorX=0,cursorY-=lineSpacing;continue}if(ch===` `){cursorX+=.4+letterSpacing;continue}let code=(_a=ch.codePointAt(0))==null?0:_a;if(code>=33&&code<=126){let hg=hershey==null?void 0:hershey.get(code);if(hg){for(let pl of hg.polylines)pl.length<2||raw.push({pts:pl.map(([x,y])=>new THREE.Vector2(cursorX+x*latinScale,cursorY+y*latinScale)),mode:`corner`});cursorX+=hg.advance*latinScale+letterSpacing;continue}console.warn(`textToStrokeOrderStrokes: 无法生成字符 "${ch}"(非浏览器环境或字形为空),按空格处理`),cursorX+=.5*latinScale+letterSpacing;continue}let data=yield loadHanzi(ch,charDataLoader,cdnBaseUrl);if(data&&data.medians&&data.medians.length){for(let median of data.medians)median.length<2||raw.push({pts:median.map(([x,y])=>new THREE.Vector2(cursorX+x/HANZI_EM,cursorY+y/HANZI_EM)),mode:`full`});cursorX+=1+letterSpacing}else console.warn(`textToStrokeOrderStrokes: 未找到 "${ch}" 的笔画数据,按空格处理`),cursorX+=1+letterSpacing}if(raw.length===0)return[];let minX=1/0,minY=1/0,maxX=-1/0,maxY=-1/0;for(let poly of raw)for(let p of poly.pts)p.x<minX&&(minX=p.x),p.x>maxX&&(maxX=p.x),p.y<minY&&(minY=p.y),p.y>maxY&&(maxY=p.y);let cx=center?(minX+maxX)/2:0,cy=center?(minY+maxY)/2:0,origin=position==null?new THREE.Vector3:position,N=(normal==null?new THREE.Vector3(0,0,1):normal).clone();N.lengthSq()<1e-9&&N.set(0,0,1),N.normalize();let up;if(upOption){let projected=upOption.clone().addScaledVector(N,-upOption.dot(N));projected.lengthSq()>1e-9&&(up=projected.normalize())}let right;if(up)right=new THREE.Vector3().crossVectors(up,N).normalize();else{let ref=Math.abs(N.y)>.99?new THREE.Vector3(0,0,-1):new THREE.Vector3(0,1,0);right=new THREE.Vector3().crossVectors(ref,N).normalize(),up=new THREE.Vector3().crossVectors(N,right).normalize()}let toVec3=p=>new THREE.Vector3().copy(origin).addScaledVector(right,(p.x-cx)*size).addScaledVector(up,(p.y-cy)*size);return raw.map(poly=>{let points=poly.pts.map(toVec3);return smooth&&points.length>=2&&(points=poly.mode===`corner`?smoothPreserveCorners(points,smoothSubdivisions):smoothFull(points,smoothSubdivisions)),{points,totalLength:calculatePath3DLength(points)}})})}function smoothFull(points,subdiv){return points.length<3?points:new THREE.CatmullRomCurve3(points,!1,`centripetal`).getPoints(Math.max(points.length*subdiv,8))}var CORNER_COS=.2;function smoothPreserveCorners(points,subdiv){if(points.length<3)return points;let box=new THREE.Box3().setFromPoints(points),diag=box.min.distanceTo(box.max),closed=diag>1e-9&&points[0].distanceTo(points[points.length-1])<diag*.06,pts=closed?points.slice(0,-1):points,n=pts.length;if(n<3)return points;let a=new THREE.Vector3,b=new THREE.Vector3,isCorner=i=>{if(!closed&&(i===0||i===n-1))return!0;let prev=(i-1+n)%n,next=(i+1)%n;a.subVectors(pts[i],pts[prev]),b.subVectors(pts[next],pts[i]);let la=a.length(),lb=b.length();return la<1e-6||lb<1e-6?!1:a.dot(b)/(la*lb)<CORNER_COS},corners=[];for(let i=0;i<n;i++)isCorner(i)&&corners.push(i);if(corners.length===0)return new THREE.CatmullRomCurve3(pts,closed,`centripetal`).getPoints(Math.max(n*subdiv,8));let collectCyclic=(start,end)=>{let seg=[],i=start;for(;seg.push(pts[i]),i!==end;)i=(i+1)%n;return seg},m=corners.length,runCount=closed?m:m-1,out=[];for(let c=0;c<runCount;c++){let seg=collectCyclic(corners[c],corners[(c+1)%m]),smoothed=seg.length>=3?new THREE.CatmullRomCurve3(seg,!1,`centripetal`).getPoints(Math.max((seg.length-1)*subdiv,2)):seg;for(let k=0;k<smoothed.length;k++)c>0&&k===0||out.push(smoothed[k])}return out}export{textToStrokeOrderStrokes};
|