file-viewer3 1.0.8 → 1.0.26
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/LICENSE +160 -0
- package/README.en.md +390 -0
- package/README.md +306 -89
- package/dist/components/3MFLoader.js +527 -0
- package/dist/components/AMFLoader.js +188 -0
- package/dist/components/ArchiveViewer.js +526 -0
- package/dist/components/AudioViewer.js +66 -0
- package/dist/components/CadViewer.js +9040 -0
- package/dist/components/CodeViewer.js +151 -0
- package/dist/components/ColladaLoader.js +2282 -0
- package/dist/components/DrawingViewer.js +295 -0
- package/dist/components/EdaViewer.js +630 -0
- package/dist/components/EmailViewer.js +276 -0
- package/dist/components/EpubViewer.js +172 -0
- package/dist/components/FBXLoader.js +1574 -0
- package/dist/components/GLTFLoader.js +1383 -0
- package/dist/components/ImageViewer.js +1516 -1895
- package/dist/components/KMZLoader.js +45 -0
- package/dist/components/MarkdownViewer.js +1456 -1557
- package/dist/components/ModelViewer.js +797 -0
- package/dist/components/OBJLoader.js +287 -0
- package/dist/components/OfdViewer.js +133 -0
- package/dist/components/PCDLoader.js +141 -0
- package/dist/components/PLYLoader.js +305 -0
- package/dist/components/PdfView.js +27662 -21655
- package/dist/components/PptxRender.js +11170 -21118
- package/dist/components/STLLoader.js +83 -0
- package/dist/components/TDSLoader.js +228 -0
- package/dist/components/TypstViewer.js +1697 -0
- package/dist/components/USDLoader.js +2526 -0
- package/dist/components/UmdViewer.js +1873 -0
- package/dist/components/VRMLLoader.js +6422 -0
- package/dist/components/VTKLoader.js +337 -0
- package/dist/components/XYZLoader.js +30 -0
- package/dist/components/XlsxTable.js +7871 -69873
- package/dist/components/__vite-browser-external.js +7 -0
- package/dist/components/_plugin-vue_export-helper.js +8 -0
- package/dist/components/ar-SA-G6X2FPQ2.js +523 -0
- package/dist/components/arc.js +79 -0
- package/dist/components/architecture-7EHR7CIX.js +3 -0
- package/dist/components/architectureDiagram-3BPJPVTR.js +4096 -0
- package/dist/components/archive.js +24 -0
- package/dist/components/asyncToGenerator.js +29 -0
- package/dist/components/audio.js +19 -0
- package/dist/components/az-AZ-76LH7QW2.js +523 -0
- package/dist/components/bash.js +169 -0
- package/dist/components/bg-BG-XCXSNQG7.js +523 -0
- package/dist/components/blockDiagram-GPEHLZMM.js +3357 -0
- package/dist/components/bn-BD-2XOGV67Q.js +523 -0
- package/dist/components/c4Diagram-AAUBKEIU.js +2957 -0
- package/dist/components/ca-ES-6MX7JW3Y.js +523 -0
- package/dist/components/cad.js +23 -0
- package/dist/components/cfb.js +1174 -0
- package/dist/components/channel.js +5 -0
- package/dist/components/chunk-2J33WTMH.js +26 -0
- package/dist/components/chunk-3OPIFGDE.js +4167 -0
- package/dist/components/chunk-4BX2VUAB.js +19 -0
- package/dist/components/chunk-55IACEB6.js +9 -0
- package/dist/components/chunk-5ZQYHXKU.js +669 -0
- package/dist/components/chunk-6U3AYISY.js +624 -0
- package/dist/components/chunk-727SXJPM.js +3356 -0
- package/dist/components/chunk-AGHRB4JF.js +324 -0
- package/dist/components/chunk-AQP2D5EJ.js +2055 -0
- package/dist/components/chunk-BSJP7CBP.js +83 -0
- package/dist/components/chunk-CSCIHK7Q.js +3500 -0
- package/dist/components/chunk-EIO257PC.js +1836 -0
- package/dist/components/chunk-FMBD7UC4.js +5 -0
- package/dist/components/chunk-K2UTITRG.js +17627 -0
- package/dist/components/chunk-KSCS5N6A.js +572 -0
- package/dist/components/chunk-L5ZTLDWV.js +40 -0
- package/dist/components/chunk-LZXEDZCA.js +60 -0
- package/dist/components/chunk-ND2GUHAM.js +61 -0
- package/dist/components/chunk-NNHCCRGN.js +20425 -0
- package/dist/components/chunk-NZK2D7GU.js +68 -0
- package/dist/components/chunk-O5CBEL6O.js +1894 -0
- package/dist/components/chunk-QZHKN3VN.js +12 -0
- package/dist/components/chunk-SRAX5OIU.js +22 -0
- package/dist/components/chunk-WU5MYG2G.js +14 -0
- package/dist/components/chunk-XPW4576I.js +1146 -0
- package/dist/components/chunk-Z3N5DIM6.js +59 -0
- package/dist/components/chunk-ZUYEQ4TG.js +22 -0
- package/dist/components/chunk.js +23 -0
- package/dist/components/classDiagram-4FO5ZUOK.js +29 -0
- package/dist/components/classDiagram-v2-Q7XG4LA2.js +29 -0
- package/dist/components/compiler.js +2 -0
- package/dist/components/core.js +845 -0
- package/dist/components/cose-bilkent-S5V4N54A.js +2268 -0
- package/dist/components/cpp.js +225 -0
- package/dist/components/cs-CZ-2BRQDIVT.js +523 -0
- package/dist/components/csharp.js +260 -0
- package/dist/components/css.js +140 -0
- package/dist/components/cytoscape.esm.js +18114 -0
- package/dist/components/da-DK-5WZEPLOC.js +523 -0
- package/dist/components/dagre-BM42HDAG.js +325 -0
- package/dist/components/dagre.js +1936 -0
- package/dist/components/de-DE-XR44H4JA.js +523 -0
- package/dist/components/defaultLocale.js +201 -0
- package/dist/components/defineProperty.js +50 -0
- package/dist/components/diagram-2AECGRRQ.js +229 -0
- package/dist/components/diagram-5GNKFQAL.js +108 -0
- package/dist/components/diagram-KO2AKTUF.js +443 -0
- package/dist/components/diagram-LMA3HP47.js +139 -0
- package/dist/components/diagram-OG6HWLK6.js +541 -0
- package/dist/components/diff.js +39 -0
- package/dist/components/directory-open-01563666.js +26 -0
- package/dist/components/directory-open-4ed118d0.js +83 -0
- package/dist/components/dist.js +50 -0
- package/dist/components/dist2.js +3291 -0
- package/dist/components/dist3.js +1593 -0
- package/dist/components/documentSearch.js +378 -0
- package/dist/components/docx-preview.js +3113 -0
- package/dist/components/drawing.js +19 -0
- package/dist/components/ebook.js +16 -0
- package/dist/components/eda.js +20 -0
- package/dist/components/el-GR-BZB4AONW.js +523 -0
- package/dist/components/email.js +21 -0
- package/dist/components/en-B4ZKOASM.js +3 -0
- package/dist/components/erDiagram-TEJ5UH35.js +1719 -0
- package/dist/components/es-ES-U4NZUMDT.js +523 -0
- package/dist/components/eu-ES-A7QVB2H4.js +523 -0
- package/dist/components/eventmodeling-FCH6USID.js +3 -0
- package/dist/components/fa-IR-HGAKTJCU.js +523 -0
- package/dist/components/fflate.module.js +323 -0
- package/dist/components/fi-FI-Z5N7JZ37.js +523 -0
- package/dist/components/file-open-002ab408.js +38 -0
- package/dist/components/file-open-7c801643.js +24 -0
- package/dist/components/file-save-3189631c.js +40 -0
- package/dist/components/file-save-745eba88.js +36 -0
- package/dist/components/flowDiagram-I6XJVG4X.js +4181 -0
- package/dist/components/fr-FR-RHASNOE6.js +523 -0
- package/dist/components/ganttDiagram-6RSMTGT7.js +2182 -0
- package/dist/components/gitGraph-WXDBUCRP.js +3 -0
- package/dist/components/gitGraphDiagram-PVQCEYII.js +788 -0
- package/dist/components/gl-ES-HMX3MZ6V.js +523 -0
- package/dist/components/global-compiler.js +23 -0
- package/dist/components/global-renderer.js +23 -0
- package/dist/components/go.js +140 -0
- package/dist/components/graphlib.js +1267 -0
- package/dist/components/he-IL-6SHJWFNN.js +523 -0
- package/dist/components/hi-IN-IWLTKZ5I.js +523 -0
- package/dist/components/hu-HU-A5ZG7DT2.js +523 -0
- package/dist/components/id-ID-SAP4L64H.js +523 -0
- package/dist/components/image-GAAHSSAO.js +3 -0
- package/dist/components/image-blob-reduce.esm.js +1429 -0
- package/dist/components/image.js +17 -0
- package/dist/components/info-J43DQDTF.js +3 -0
- package/dist/components/infoDiagram-5YYISTIA.js +26 -0
- package/dist/components/ini.js +88 -0
- package/dist/components/init.js +15 -0
- package/dist/components/ishikawaDiagram-YF4QCWOH.js +718 -0
- package/dist/components/it-IT-JPQ66NNP.js +523 -0
- package/dist/components/ja-JP-DBVTYXUO.js +523 -0
- package/dist/components/java.js +169 -0
- package/dist/components/javascript.js +436 -0
- package/dist/components/journeyDiagram-JHISSGLW.js +885 -0
- package/dist/components/json.js +36 -0
- package/dist/components/jszip.min.js +3033 -0
- package/dist/components/kaa-6HZHGXH3.js +523 -0
- package/dist/components/kab-KAB-ZGHBKWFO.js +523 -0
- package/dist/components/kanban-definition-UN3LZRKU.js +986 -0
- package/dist/components/katex.js +21979 -0
- package/dist/components/kk-KZ-P5N5QNE5.js +523 -0
- package/dist/components/km-KH-HSX4SM5Z.js +523 -0
- package/dist/components/ko-KR-MTYHY66A.js +523 -0
- package/dist/components/ku-TR-6OUDTVRD.js +523 -0
- package/dist/components/lib.js +4877 -0
- package/dist/components/libarchive.js +360 -0
- package/dist/components/linear.js +289 -0
- package/dist/components/lt-LT-XHIRWOB4.js +523 -0
- package/dist/components/lv-LV-5QDEKY6T.js +523 -0
- package/dist/components/markdown.js +181 -0
- package/dist/components/md.js +17 -0
- package/dist/components/mermaid-parser.core.js +328 -0
- package/dist/components/mindmap-definition-RKZ34NQL.js +1016 -0
- package/dist/components/model.js +21 -0
- package/dist/components/mp4.js +12 -0
- package/dist/components/mr-IN-CRQNXWMA.js +523 -0
- package/dist/components/my-MM-5M5IBNSE.js +523 -0
- package/dist/components/nb-NO-T6EIAALU.js +523 -0
- package/dist/components/nestedRender.js +158 -0
- package/dist/components/nl-NL-IS3SIHDZ.js +523 -0
- package/dist/components/nn-NO-6E72VCQL.js +523 -0
- package/dist/components/objectSpread2.js +29 -0
- package/dist/components/objectWithoutProperties.js +28 -0
- package/dist/components/oc-FR-POXYY2M6.js +523 -0
- package/dist/components/ofd.js +5261 -0
- package/dist/components/ofd2.js +16 -0
- package/dist/components/ordinal.js +65 -0
- package/dist/components/pa-IN-N4M65BXN.js +523 -0
- package/dist/components/packet-YPE3B663.js +3 -0
- package/dist/components/pdf.js +24 -0
- package/dist/components/percentages-BXMCSKIN.js +3 -0
- package/dist/components/php.js +294 -0
- package/dist/components/pica.js +1009 -0
- package/dist/components/pie-LRSECV5Y.js +3 -0
- package/dist/components/pie.js +47 -0
- package/dist/components/pieDiagram-4H26LBE5.js +130 -0
- package/dist/components/pl-PL-T2D74RX3.js +523 -0
- package/dist/components/postal-mime.js +3146 -0
- package/dist/components/pptx.js +15 -0
- package/dist/components/printLayout.js +42 -0
- package/dist/components/prod.js +21770 -0
- package/dist/components/pt-BR-5N22H2LF.js +523 -0
- package/dist/components/pt-PT-UZXXM6DQ.js +523 -0
- package/dist/components/python.js +238 -0
- package/dist/components/quadrantDiagram-W4KKPZXB.js +1988 -0
- package/dist/components/radar-GUYGQ44K.js +3 -0
- package/dist/components/renderer.js +2 -0
- package/dist/components/requirementDiagram-4Y6WPE33.js +2230 -0
- package/dist/components/ro-RO-JPDTUUEW.js +523 -0
- package/dist/components/rough.esm.js +1355 -0
- package/dist/components/roundRect.js +90 -0
- package/dist/components/ru-RU-B4JR7IUQ.js +523 -0
- package/dist/components/rust.js +169 -0
- package/dist/components/sankeyDiagram-5OEKKPKP.js +972 -0
- package/dist/components/sequenceDiagram-3UESZ5HK.js +4255 -0
- package/dist/components/shared.js +175 -0
- package/dist/components/shared2.js +4 -0
- package/dist/components/si-LK-N5RQ5JYF.js +523 -0
- package/dist/components/sk-SK-C5VTKIMK.js +523 -0
- package/dist/components/sl-SI-NN7IZMDC.js +523 -0
- package/dist/components/sourceLoading.js +134 -0
- package/dist/components/sql.js +118 -0
- package/dist/components/src.js +2664 -0
- package/dist/components/src2.js +10722 -0
- package/dist/components/stateDiagram-AJRCARHV.js +217 -0
- package/dist/components/stateDiagram-v2-BHNVJYJU.js +27 -0
- package/dist/components/subset-shared.chunk.js +3 -0
- package/dist/components/subset-worker.chunk.js +21 -0
- package/dist/components/sv-SE-XGPEYMSR.js +523 -0
- package/dist/components/ta-IN-2NMHFXQM.js +523 -0
- package/dist/components/text.js +20 -0
- package/dist/components/th-TH-HPSO5L25.js +523 -0
- package/dist/components/three.module.js +13134 -0
- package/dist/components/time.js +910 -0
- package/dist/components/timeline-definition-PNZ67QCA.js +1084 -0
- package/dist/components/tr-TR-DEFEU3FU.js +523 -0
- package/dist/components/treeView-BLDUP644.js +3 -0
- package/dist/components/treemap-LRROVOQU.js +3 -0
- package/dist/components/typescript.js +521 -0
- package/dist/components/typst.js +25 -0
- package/dist/components/uk-UA-QMV73CPH.js +523 -0
- package/dist/components/umd.js +16 -0
- package/dist/components/use.js +422 -0
- package/dist/components/util.js +49 -0
- package/dist/components/vennDiagram-CIIHVFJN.js +1880 -0
- package/dist/components/vi-VN-M7AON7JQ.js +523 -0
- package/dist/components/viewerZoom.js +92 -0
- package/dist/components/wardley-L42UT6IY.js +3 -0
- package/dist/components/wardleyDiagram-YWT4CUSO.js +656 -0
- package/dist/components/wasm-pack-shim.js +1711 -0
- package/dist/components/wasm-pack-shim2.js +934 -0
- package/dist/components/wasm.js +97 -0
- package/dist/components/word.js +3055 -0
- package/dist/components/worker-ref.js +15 -20
- package/dist/components/xlsx.js +21 -0
- package/dist/components/xml.js +166 -0
- package/dist/components/xychartDiagram-2RQKCTM6.js +2015 -0
- package/dist/components/yaml.js +144 -0
- package/dist/components/zh-CN-LNUGB5OW.js +523 -0
- package/dist/components/zh-HK-E62DVLB3.js +523 -0
- package/dist/components/zh-TW-RAJ6MFWO.js +523 -0
- package/dist/file-viewer3.css +2 -0
- package/dist/index.mjs +3292 -5
- package/dist/src/App.vue.d.ts +3 -0
- package/dist/src/compare/CompareApp.vue.d.ts +3 -0
- package/dist/src/compare/main.d.ts +0 -0
- package/dist/src/compare/useSynchronizedScroll.d.ts +7 -0
- package/dist/src/components/HelloWorld.vue.d.ts +3 -0
- package/dist/src/components/utils.d.ts +4 -0
- package/dist/src/main.d.ts +0 -0
- package/dist/src/package/common/printCapability.d.ts +27 -0
- package/dist/src/package/common/printLayout.d.ts +16 -0
- package/dist/src/package/common/sourceLoading.d.ts +10 -0
- package/dist/src/package/common/type.d.ts +522 -8
- package/dist/src/package/common/worker-ref.d.ts +1 -1
- package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +74 -24
- package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +9 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +29 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +21 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +8 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +34 -0
- package/dist/src/package/components/FileViewer/index.d.ts +1 -1
- package/dist/src/package/components/FileViewer/util.d.ts +2 -1
- package/dist/src/package/index.d.ts +14 -4
- package/dist/src/package/use/documentLocation.d.ts +15 -0
- package/dist/src/package/use/documentSearch.d.ts +234 -0
- package/dist/src/package/use/index.d.ts +4 -0
- package/dist/src/package/use/loading.d.ts +33 -0
- package/dist/src/package/use/viewerZoom.d.ts +42 -0
- package/dist/src/package/use/worker.d.ts +2 -2
- package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +9 -0
- package/dist/src/package/vendors/archive/cache.d.ts +10 -0
- package/dist/src/package/vendors/archive/fallback.d.ts +9 -0
- package/dist/src/package/vendors/archive/index.d.ts +3 -0
- package/dist/src/package/vendors/archive/shared.d.ts +24 -0
- package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +7 -0
- package/dist/src/package/vendors/audio/index.d.ts +7 -0
- package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +9 -0
- package/dist/src/package/vendors/cad/index.d.ts +8 -0
- package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +15 -0
- package/dist/src/package/vendors/drawing/index.d.ts +7 -0
- package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/ebook/index.d.ts +7 -0
- package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +8 -0
- package/dist/src/package/vendors/eda/index.d.ts +2 -0
- package/dist/src/package/vendors/eda/parser.d.ts +77 -0
- package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +10 -0
- package/dist/src/package/vendors/email/index.d.ts +2 -0
- package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +6 -13
- package/dist/src/package/vendors/image/index.d.ts +1 -1
- package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +6 -13
- package/dist/src/package/vendors/md/index.d.ts +1 -1
- package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +8 -0
- package/dist/src/package/vendors/model/index.d.ts +3 -0
- package/dist/src/package/vendors/model/shared.d.ts +1 -0
- package/dist/src/package/vendors/nestedRender.d.ts +10 -0
- package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/ofd/index.d.ts +7 -0
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +10 -13
- package/dist/src/package/vendors/pdf/index.d.ts +2 -1
- package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
- package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +9 -81
- package/dist/src/package/vendors/pptx/index.d.ts +1 -1
- package/dist/src/package/vendors/renders.d.ts +1 -1
- package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +7 -13
- package/dist/src/package/vendors/text/index.d.ts +6 -2
- package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +15 -0
- package/dist/src/package/vendors/typst/index.d.ts +8 -0
- package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/umd/index.d.ts +7 -0
- package/dist/src/package/vendors/umd/parser.d.ts +30 -0
- package/dist/src/package/vendors/word/doc.d.ts +5 -0
- package/dist/src/package/vendors/word/docx.d.ts +5 -0
- package/dist/src/package/vendors/word/docx.worker.d.ts +1 -0
- package/dist/src/package/vendors/word/index.d.ts +3 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +80 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +25 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +6 -21
- package/dist/src/package/vendors/xlsx/index.d.ts +3 -2
- package/dist/src/package/vendors/xlsx/util.d.ts +0 -5
- package/dist/src/package/vendors/xlsx/worker/index.d.ts +4 -6
- package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +73 -0
- package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +1 -0
- package/dist/style.css +1 -57
- package/dist/wasm/cad/dwfv-render.wasm +0 -0
- package/dist/wasm/cad/dwg-worker.js +24 -0
- package/dist/wasm/cad/libredwg-web.js +15 -0
- package/dist/wasm/cad/libredwg-web.wasm +0 -0
- package/package.json +118 -42
- package/.vscode/extensions.json +0 -3
- package/dist/components/_commonjs-dynamic-modules.js +0 -6
- package/dist/components/_commonjsHelpers.js +0 -36
- package/dist/components/docx-preview.min.js +0 -5287
- package/dist/components/index.js +0 -1717
- package/dist/favicon.ico +0 -0
- package/dist/index.umd.js +0 -436
- package/dist/src/package/vendors/docx/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/render.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/worker/xls/SheetJsModel.d.ts +0 -36
- package/dist/src/package/vendors/xlsx/worker/xlsx/ExcelJsModel.d.ts +0 -39
- package/dist/src/package/vendors/xlsx/worker/xlsx/context.d.ts +0 -7
- package/dist/src/package/vendors/xlsx/worker/xlsx/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/xlsx/util.d.ts +0 -10
- package/dist/worker/pdf.worker.js +0 -66
- package/dist/worker/pptx.worker.js +0 -21
- package/dist/worker/sheet.worker.js +0 -38
- package/dist/worker/xlsx.worker.js +0 -65
- /package/dist/src/package/vendors/xlsx/worker/{xlsx → sheetjs}/color.d.ts +0 -0
- /package/dist/src/package/vendors/xlsx/worker/{xls → sheetjs}/index.d.ts +0 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { C as e, K as t, l as n, p as r, u as i, w as a, wt as o } from "./three.module.js";
|
|
2
|
+
import { n as s } from "./fflate.module.js";
|
|
3
|
+
//#region node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/loaders/VTKLoader.js
|
|
4
|
+
var c = class extends t {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
super(e), console.warn("THREE.VTKLoader: The loader has been deprecated and will be removed with r194. Export your VTK files to glTF before using them on the web.");
|
|
7
|
+
}
|
|
8
|
+
load(t, n, r, i) {
|
|
9
|
+
let a = this, o = new e(a.manager);
|
|
10
|
+
o.setPath(a.path), o.setResponseType("arraybuffer"), o.setRequestHeader(a.requestHeader), o.setWithCredentials(a.withCredentials), o.load(t, function(e) {
|
|
11
|
+
try {
|
|
12
|
+
n(a.parse(e));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
i ? i(e) : console.error(e), a.manager.itemError(t);
|
|
15
|
+
}
|
|
16
|
+
}, r, i);
|
|
17
|
+
}
|
|
18
|
+
parse(e) {
|
|
19
|
+
function t(e) {
|
|
20
|
+
let t = [], n = [], s = [], c = [], l, u = /^[^\d.\s-]+/;
|
|
21
|
+
function d(e) {
|
|
22
|
+
let t = [], n = e.split(/\s+/);
|
|
23
|
+
for (let e = 0; e < n.length; e++) n[e] !== "" && t.push(parseFloat(n[e]));
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
let f = /^(\d+)\s+([\s\d]*)/, p = /^POINTS /, m = /^POLYGONS /, h = /^TRIANGLE_STRIPS /, g = /^POINT_DATA[ ]+(\d+)/, _ = /^CELL_DATA[ ]+(\d+)/, v = /^COLOR_SCALARS[ ]+(\w+)[ ]+3/, y = /^NORMALS[ ]+(\w+)[ ]+(\w+)/, b = !1, x = !1, S = !1, C = !1, w = !1, T = !1, E = !1, D = new r(), O = e.split("\n");
|
|
27
|
+
for (let e in O) {
|
|
28
|
+
let r = O[e].trim();
|
|
29
|
+
if (r.indexOf("DATASET") === 0) {
|
|
30
|
+
let e = r.split(" ")[1];
|
|
31
|
+
if (e !== "POLYDATA") throw Error("Unsupported DATASET type: " + e);
|
|
32
|
+
} else if (b) {
|
|
33
|
+
if (u.exec(r) === null) {
|
|
34
|
+
let e = d(r);
|
|
35
|
+
for (let t = 0; t + 2 < e.length; t += 3) n.push(e[t], e[t + 1], e[t + 2]);
|
|
36
|
+
}
|
|
37
|
+
} else if (x) {
|
|
38
|
+
if ((l = f.exec(r)) !== null) {
|
|
39
|
+
let e = parseInt(l[1]), n = l[2].split(/\s+/);
|
|
40
|
+
if (e >= 3) {
|
|
41
|
+
let r = parseInt(n[0]), i = 1;
|
|
42
|
+
for (let a = 0; a < e - 2; ++a) {
|
|
43
|
+
let e = parseInt(n[i]), a = parseInt(n[i + 1]);
|
|
44
|
+
t.push(r, e, a), i++;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
} else if (S) {
|
|
49
|
+
if ((l = f.exec(r)) !== null) {
|
|
50
|
+
let e = parseInt(l[1]), n = l[2].split(/\s+/);
|
|
51
|
+
if (e >= 3) for (let r = 0; r < e - 2; r++) if (r % 2 == 1) {
|
|
52
|
+
let e = parseInt(n[r]), i = parseInt(n[r + 2]), a = parseInt(n[r + 1]);
|
|
53
|
+
t.push(e, i, a);
|
|
54
|
+
} else {
|
|
55
|
+
let e = parseInt(n[r]), i = parseInt(n[r + 1]), a = parseInt(n[r + 2]);
|
|
56
|
+
t.push(e, i, a);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
} else if (C || w) {
|
|
60
|
+
if (T) {
|
|
61
|
+
if (u.exec(r) === null) {
|
|
62
|
+
let e = d(r);
|
|
63
|
+
for (let t = 0; t + 2 < e.length; t += 3) D.setRGB(e[t], e[t + 1], e[t + 2], o), s.push(D.r, D.g, D.b);
|
|
64
|
+
}
|
|
65
|
+
} else if (E && u.exec(r) === null) {
|
|
66
|
+
let e = d(r);
|
|
67
|
+
for (let t = 0; t + 2 < e.length; t += 3) c.push(e[t], e[t + 1], e[t + 2]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
m.exec(r) === null ? p.exec(r) === null ? h.exec(r) === null ? g.exec(r) === null ? _.exec(r) === null ? v.exec(r) === null ? y.exec(r) !== null && (E = !0, T = !1, b = !1, x = !1, S = !1) : (T = !0, E = !1, b = !1, x = !1, S = !1) : (w = !0, b = !1, x = !1, S = !1) : (C = !0, b = !1, x = !1, S = !1) : (x = !1, b = !1, S = !0) : (x = !1, b = !0, S = !1) : (x = !0, b = !1, S = !1);
|
|
71
|
+
}
|
|
72
|
+
let k = new i();
|
|
73
|
+
if (k.setIndex(t), k.setAttribute("position", new a(n, 3)), c.length === n.length && k.setAttribute("normal", new a(c, 3)), s.length !== t.length) s.length === n.length && k.setAttribute("color", new a(s, 3));
|
|
74
|
+
else {
|
|
75
|
+
k = k.toNonIndexed();
|
|
76
|
+
let e = k.attributes.position.count / 3;
|
|
77
|
+
if (s.length === e * 3) {
|
|
78
|
+
let t = [];
|
|
79
|
+
for (let n = 0; n < e; n++) {
|
|
80
|
+
let e = s[3 * n + 0], r = s[3 * n + 1], i = s[3 * n + 2];
|
|
81
|
+
D.setRGB(e, r, i, o), t.push(D.r, D.g, D.b), t.push(D.r, D.g, D.b), t.push(D.r, D.g, D.b);
|
|
82
|
+
}
|
|
83
|
+
k.setAttribute("color", new a(t, 3));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return k;
|
|
87
|
+
}
|
|
88
|
+
function c(e) {
|
|
89
|
+
let t = new Uint8Array(e), r = new DataView(e), a = [], o = [], s = [], c = 0;
|
|
90
|
+
function l(e, t) {
|
|
91
|
+
let n = t, r = e[n], i = [];
|
|
92
|
+
for (; r !== 10 && n < e.length;) i.push(String.fromCharCode(r)), n++, r = e[n];
|
|
93
|
+
return {
|
|
94
|
+
start: t,
|
|
95
|
+
end: n,
|
|
96
|
+
next: n + 1,
|
|
97
|
+
parsedString: i.join("")
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
let u, d;
|
|
101
|
+
for (;;) {
|
|
102
|
+
if (u = l(t, c), d = u.parsedString, d.indexOf("DATASET") === 0) {
|
|
103
|
+
let e = d.split(" ")[1];
|
|
104
|
+
if (e !== "POLYDATA") throw Error("Unsupported DATASET type: " + e);
|
|
105
|
+
} else if (d.indexOf("POINTS") === 0) {
|
|
106
|
+
let e = parseInt(d.split(" ")[1], 10), t = e * 4 * 3;
|
|
107
|
+
a = new Float32Array(e * 3);
|
|
108
|
+
let n = u.next;
|
|
109
|
+
for (let t = 0; t < e; t++) a[3 * t] = r.getFloat32(n, !1), a[3 * t + 1] = r.getFloat32(n + 4, !1), a[3 * t + 2] = r.getFloat32(n + 8, !1), n += 12;
|
|
110
|
+
u.next = u.next + t + 1;
|
|
111
|
+
} else if (d.indexOf("TRIANGLE_STRIPS") === 0) {
|
|
112
|
+
let e = parseInt(d.split(" ")[1], 10), t = parseInt(d.split(" ")[2], 10), n = t * 4;
|
|
113
|
+
s = new Uint32Array(3 * t - 9 * e);
|
|
114
|
+
let i = 0, a = u.next;
|
|
115
|
+
for (let t = 0; t < e; t++) {
|
|
116
|
+
let e = r.getInt32(a, !1), t = [];
|
|
117
|
+
a += 4;
|
|
118
|
+
for (let n = 0; n < e; n++) t.push(r.getInt32(a, !1)), a += 4;
|
|
119
|
+
for (let n = 0; n < e - 2; n++) n % 2 ? (s[i++] = t[n], s[i++] = t[n + 2], s[i++] = t[n + 1]) : (s[i++] = t[n], s[i++] = t[n + 1], s[i++] = t[n + 2]);
|
|
120
|
+
}
|
|
121
|
+
u.next = u.next + n + 1;
|
|
122
|
+
} else if (d.indexOf("POLYGONS") === 0) {
|
|
123
|
+
let e = parseInt(d.split(" ")[1], 10), t = parseInt(d.split(" ")[2], 10), n = t * 4;
|
|
124
|
+
s = new Uint32Array(3 * t - 9 * e);
|
|
125
|
+
let i = 0, a = u.next;
|
|
126
|
+
for (let t = 0; t < e; t++) {
|
|
127
|
+
let e = r.getInt32(a, !1), t = [];
|
|
128
|
+
a += 4;
|
|
129
|
+
for (let n = 0; n < e; n++) t.push(r.getInt32(a, !1)), a += 4;
|
|
130
|
+
for (let n = 1; n < e - 1; n++) s[i++] = t[0], s[i++] = t[n], s[i++] = t[n + 1];
|
|
131
|
+
}
|
|
132
|
+
u.next = u.next + n + 1;
|
|
133
|
+
} else if (d.indexOf("POINT_DATA") === 0) {
|
|
134
|
+
let e = parseInt(d.split(" ")[1], 10);
|
|
135
|
+
u = l(t, u.next);
|
|
136
|
+
let n = e * 4 * 3;
|
|
137
|
+
o = new Float32Array(e * 3);
|
|
138
|
+
let i = u.next;
|
|
139
|
+
for (let t = 0; t < e; t++) o[3 * t] = r.getFloat32(i, !1), o[3 * t + 1] = r.getFloat32(i + 4, !1), o[3 * t + 2] = r.getFloat32(i + 8, !1), i += 12;
|
|
140
|
+
u.next += n;
|
|
141
|
+
}
|
|
142
|
+
if (c = u.next, c >= t.byteLength) break;
|
|
143
|
+
}
|
|
144
|
+
let f = new i();
|
|
145
|
+
return f.setIndex(new n(s, 1)), f.setAttribute("position", new n(a, 3)), o.length === a.length && f.setAttribute("normal", new n(o, 3)), f;
|
|
146
|
+
}
|
|
147
|
+
function l(e, t) {
|
|
148
|
+
let n = e.length, r = new Float32Array(n + t.length);
|
|
149
|
+
return r.set(e), r.set(t, n), r;
|
|
150
|
+
}
|
|
151
|
+
function u(e, t) {
|
|
152
|
+
let n = e.length, r = new Int32Array(n + t.length);
|
|
153
|
+
return r.set(e), r.set(t, n), r;
|
|
154
|
+
}
|
|
155
|
+
function d(e) {
|
|
156
|
+
function t(e) {
|
|
157
|
+
let n = {};
|
|
158
|
+
if (e.nodeType === 1) {
|
|
159
|
+
if (e.attributes && e.attributes.length > 0) {
|
|
160
|
+
n.attributes = {};
|
|
161
|
+
for (let t = 0; t < e.attributes.length; t++) {
|
|
162
|
+
let r = e.attributes.item(t);
|
|
163
|
+
n.attributes[r.nodeName] = r.nodeValue.trim();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
} else e.nodeType === 3 && (n = e.nodeValue.trim());
|
|
167
|
+
if (e.hasChildNodes()) for (let r = 0; r < e.childNodes.length; r++) {
|
|
168
|
+
let i = e.childNodes.item(r), a = i.nodeName;
|
|
169
|
+
if (n[a] === void 0) {
|
|
170
|
+
let e = t(i);
|
|
171
|
+
e !== "" && (Array.isArray(e["#text"]) && (e["#text"] = e["#text"][0]), n[a] = e);
|
|
172
|
+
} else {
|
|
173
|
+
if (n[a].push === void 0) {
|
|
174
|
+
let e = n[a];
|
|
175
|
+
n[a] = [e];
|
|
176
|
+
}
|
|
177
|
+
let e = t(i);
|
|
178
|
+
e !== "" && (Array.isArray(e["#text"]) && (e["#text"] = e["#text"][0]), n[a].push(e));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return n;
|
|
182
|
+
}
|
|
183
|
+
function r(e) {
|
|
184
|
+
let t = typeof Uint8Array < "u" ? Uint8Array : Array, n = [];
|
|
185
|
+
for (let e = 0; e < 64; ++e) n["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(e)] = e;
|
|
186
|
+
n[45] = 62, n[95] = 63;
|
|
187
|
+
let r = e.length;
|
|
188
|
+
if (r % 4 > 0) throw Error("Invalid string. Length must be a multiple of 4");
|
|
189
|
+
let i = e[r - 2] === "=" ? 2 : +(e[r - 1] === "="), a = new t(r * 3 / 4 - i), o = i > 0 ? r - 4 : r, s = 0, c, l;
|
|
190
|
+
for (c = 0, l = 0; c < o; c += 4, l += 3) {
|
|
191
|
+
let t = n[e.charCodeAt(c)] << 18 | n[e.charCodeAt(c + 1)] << 12 | n[e.charCodeAt(c + 2)] << 6 | n[e.charCodeAt(c + 3)];
|
|
192
|
+
a[s++] = (t & 16711680) >> 16, a[s++] = (t & 65280) >> 8, a[s++] = t & 255;
|
|
193
|
+
}
|
|
194
|
+
if (i === 2) {
|
|
195
|
+
let t = n[e.charCodeAt(c)] << 2 | n[e.charCodeAt(c + 1)] >> 4;
|
|
196
|
+
a[s++] = t & 255;
|
|
197
|
+
} else if (i === 1) {
|
|
198
|
+
let t = n[e.charCodeAt(c)] << 10 | n[e.charCodeAt(c + 1)] << 4 | n[e.charCodeAt(c + 2)] >> 2;
|
|
199
|
+
a[s++] = t >> 8 & 255, a[s++] = t & 255;
|
|
200
|
+
}
|
|
201
|
+
return a;
|
|
202
|
+
}
|
|
203
|
+
function a(e, t) {
|
|
204
|
+
let n = 0;
|
|
205
|
+
c.attributes.header_type === "UInt64" ? n = 8 : c.attributes.header_type === "UInt32" && (n = 4);
|
|
206
|
+
let i, a;
|
|
207
|
+
if (e.attributes.format === "binary" && t) {
|
|
208
|
+
e.attributes.type === "Float32" ? i = new Float32Array() : (e.attributes.type === "Int32" || e.attributes.type === "Int64") && (i = new Int32Array());
|
|
209
|
+
let t = e["#text"], o = r(Array.isArray(t) ? t[0] : t), c = o[0];
|
|
210
|
+
for (let e = 1; e < n - 1; e++) c |= o[e] << e * 8;
|
|
211
|
+
let d = (c + 3) * n, f = d % 3 > 0 ? 3 - d % 3 : 0;
|
|
212
|
+
d += f;
|
|
213
|
+
let p = [], m = d;
|
|
214
|
+
p.push(m);
|
|
215
|
+
let h = 3 * n;
|
|
216
|
+
for (let e = 0; e < c; e++) {
|
|
217
|
+
let t = o[e * n + h];
|
|
218
|
+
for (let r = 1; r < n - 1; r++) t |= o[e * n + h + r] << r * 8;
|
|
219
|
+
m += t, p.push(m);
|
|
220
|
+
}
|
|
221
|
+
for (let t = 0; t < p.length - 1; t++) a = s(o.slice(p[t], p[t + 1])).buffer, e.attributes.type === "Float32" ? (a = new Float32Array(a), i = l(i, a)) : (e.attributes.type === "Int32" || e.attributes.type === "Int64") && (a = new Int32Array(a), i = u(i, a));
|
|
222
|
+
delete e["#text"], e.attributes.type === "Int64" && e.attributes.format === "binary" && (i = i.filter(function(e, t) {
|
|
223
|
+
if (t % 2 != 1) return !0;
|
|
224
|
+
}));
|
|
225
|
+
} else e.attributes.format === "binary" && !t ? (a = r(e["#text"]), a = a.slice(n).buffer) : a = e["#text"] ? e["#text"].split(/\s+/).filter(function(e) {
|
|
226
|
+
if (e !== "") return e;
|
|
227
|
+
}) : new Int32Array().buffer, delete e["#text"], e.attributes.type === "Float32" ? i = new Float32Array(a) : e.attributes.type === "Int32" ? i = new Int32Array(a) : e.attributes.type === "Int64" && (i = new Int32Array(a), e.attributes.format === "binary" && (i = i.filter(function(e, t) {
|
|
228
|
+
if (t % 2 != 1) return !0;
|
|
229
|
+
})));
|
|
230
|
+
return i;
|
|
231
|
+
}
|
|
232
|
+
let o = new DOMParser().parseFromString(e, "application/xml").documentElement, c = t(o), d = [], f = [], p = [];
|
|
233
|
+
if (c.AppendedData) {
|
|
234
|
+
let e = c.AppendedData["#text"].slice(1), t = c.PolyData.Piece, n = [
|
|
235
|
+
"PointData",
|
|
236
|
+
"CellData",
|
|
237
|
+
"Points",
|
|
238
|
+
"Verts",
|
|
239
|
+
"Lines",
|
|
240
|
+
"Strips",
|
|
241
|
+
"Polys"
|
|
242
|
+
], r = 0, i = n.map((e) => {
|
|
243
|
+
let n = t[e];
|
|
244
|
+
return n && n.DataArray ? (Array.isArray(n.DataArray) ? n.DataArray : [n.DataArray]).map((e) => e.attributes.offset) : [];
|
|
245
|
+
}).flat();
|
|
246
|
+
for (let a of n) {
|
|
247
|
+
let n = t[a];
|
|
248
|
+
if (n && n.DataArray) if (Array.isArray(n.DataArray)) for (let t of n.DataArray) t["#text"] = e.slice(i[r], i[r + 1]), t.attributes.format = "binary", r++;
|
|
249
|
+
else n.DataArray["#text"] = e.slice(i[r], i[r + 1]), n.DataArray.attributes.format = "binary", r++;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (c.PolyData) {
|
|
253
|
+
let e = c.PolyData.Piece, t = c.attributes.hasOwnProperty("compressor"), r = [
|
|
254
|
+
"PointData",
|
|
255
|
+
"Points",
|
|
256
|
+
"Strips",
|
|
257
|
+
"Polys"
|
|
258
|
+
], o = 0, s = r.length;
|
|
259
|
+
for (; o < s;) {
|
|
260
|
+
let n = e[r[o]];
|
|
261
|
+
if (n && n.DataArray) {
|
|
262
|
+
let i;
|
|
263
|
+
i = Array.isArray(n.DataArray) ? n.DataArray : [n.DataArray];
|
|
264
|
+
let s = 0, c = i.length;
|
|
265
|
+
for (; s < c;) "#text" in i[s] && i[s]["#text"].length > 0 && (i[s].text = a(i[s], t)), s++;
|
|
266
|
+
switch (r[o]) {
|
|
267
|
+
case "PointData":
|
|
268
|
+
{
|
|
269
|
+
let t = parseInt(e.attributes.NumberOfPoints), r = n.attributes.Normals;
|
|
270
|
+
if (t > 0) {
|
|
271
|
+
for (let e = 0, n = i.length; e < n; e++) if (r === i[e].attributes.Name) {
|
|
272
|
+
let n = i[e].attributes.NumberOfComponents;
|
|
273
|
+
f = new Float32Array(t * n), f.set(i[e].text, 0);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
break;
|
|
278
|
+
case "Points":
|
|
279
|
+
{
|
|
280
|
+
let t = parseInt(e.attributes.NumberOfPoints);
|
|
281
|
+
if (t > 0) {
|
|
282
|
+
let e = n.DataArray.attributes.NumberOfComponents;
|
|
283
|
+
d = new Float32Array(t * e), d.set(n.DataArray.text, 0);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
break;
|
|
287
|
+
case "Strips":
|
|
288
|
+
{
|
|
289
|
+
let t = parseInt(e.attributes.NumberOfStrips);
|
|
290
|
+
if (t > 0) {
|
|
291
|
+
let e = new Int32Array(n.DataArray[0].text.length), r = new Int32Array(n.DataArray[1].text.length);
|
|
292
|
+
e.set(n.DataArray[0].text, 0), r.set(n.DataArray[1].text, 0);
|
|
293
|
+
let i = t + e.length;
|
|
294
|
+
p = new Uint32Array(3 * i - 9 * t);
|
|
295
|
+
let a = 0;
|
|
296
|
+
for (let n = 0, i = t; n < i; n++) {
|
|
297
|
+
let t = [];
|
|
298
|
+
for (let i = 0, a = r[n], o = 0; i < a - o; i++) t.push(e[i]), n > 0 && (o = r[n - 1]);
|
|
299
|
+
for (let e = 0, i = r[n], o = 0; e < i - o - 2; e++) e % 2 ? (p[a++] = t[e], p[a++] = t[e + 2], p[a++] = t[e + 1]) : (p[a++] = t[e], p[a++] = t[e + 1], p[a++] = t[e + 2]), n > 0 && (o = r[n - 1]);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
break;
|
|
304
|
+
case "Polys":
|
|
305
|
+
{
|
|
306
|
+
let t = parseInt(e.attributes.NumberOfPolys);
|
|
307
|
+
if (t > 0) {
|
|
308
|
+
let e = new Int32Array(n.DataArray[0].text.length), r = new Int32Array(n.DataArray[1].text.length);
|
|
309
|
+
e.set(n.DataArray[0].text, 0), r.set(n.DataArray[1].text, 0);
|
|
310
|
+
let i = t + e.length;
|
|
311
|
+
p = new Uint32Array(3 * i - 9 * t);
|
|
312
|
+
let a = 0, o = 0, s = 0, c = 0, l = t;
|
|
313
|
+
for (; s < l;) {
|
|
314
|
+
let t = [], n = 0, i = r[s];
|
|
315
|
+
for (; n < i - c;) t.push(e[o++]), n++;
|
|
316
|
+
let l = 1;
|
|
317
|
+
for (; l < i - c - 1;) p[a++] = t[0], p[a++] = t[l], p[a++] = t[l + 1], l++;
|
|
318
|
+
s++, c = r[s - 1];
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
break;
|
|
323
|
+
default: break;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
o++;
|
|
327
|
+
}
|
|
328
|
+
let l = new i();
|
|
329
|
+
return l.setIndex(new n(p, 1)), l.setAttribute("position", new n(d, 3)), f.length === d.length && l.setAttribute("normal", new n(f, 3)), l;
|
|
330
|
+
} else throw Error("Unsupported DATASET type");
|
|
331
|
+
}
|
|
332
|
+
let f = new TextDecoder(), p = f.decode(new Uint8Array(e, 0, 250)).split("\n");
|
|
333
|
+
return p[0].indexOf("xml") === -1 ? p[2].includes("ASCII") ? t(f.decode(e)) : c(e) : d(f.decode(e));
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
//#endregion
|
|
337
|
+
export { c as VTKLoader };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { C as e, K as t, p as n, u as r, w as i, wt as a } from "./three.module.js";
|
|
2
|
+
//#region node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/loaders/XYZLoader.js
|
|
3
|
+
var o = class extends t {
|
|
4
|
+
load(t, n, r, i) {
|
|
5
|
+
let a = this, o = new e(this.manager);
|
|
6
|
+
o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(t, function(e) {
|
|
7
|
+
try {
|
|
8
|
+
n(a.parse(e));
|
|
9
|
+
} catch (e) {
|
|
10
|
+
i ? i(e) : console.error(e), a.manager.itemError(t);
|
|
11
|
+
}
|
|
12
|
+
}, r, i);
|
|
13
|
+
}
|
|
14
|
+
parse(e) {
|
|
15
|
+
let t = e.split("\n"), o = [], s = [], c = new n();
|
|
16
|
+
for (let e of t) {
|
|
17
|
+
if (e = e.trim(), e.charAt(0) === "#") continue;
|
|
18
|
+
let t = e.split(/\s+/);
|
|
19
|
+
if (t.length === 3 && (o.push(parseFloat(t[0])), o.push(parseFloat(t[1])), o.push(parseFloat(t[2]))), t.length === 6) {
|
|
20
|
+
o.push(parseFloat(t[0])), o.push(parseFloat(t[1])), o.push(parseFloat(t[2]));
|
|
21
|
+
let e = parseFloat(t[3]) / 255, n = parseFloat(t[4]) / 255, r = parseFloat(t[5]) / 255;
|
|
22
|
+
c.setRGB(e, n, r, a), s.push(c.r, c.g, c.b);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
let l = new r();
|
|
26
|
+
return l.setAttribute("position", new i(o, 3)), s.length > 0 && l.setAttribute("color", new i(s, 3)), l;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { o as XYZLoader };
|