@flyfish-group/file-viewer3 1.0.26 → 2.0.0
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/README.en.md +3 -388
- package/README.md +3 -364
- package/dist/file-viewer3.css +1 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +22 -126
- package/dist/components/3MFLoader.js +0 -527
- package/dist/components/AMFLoader.js +0 -188
- package/dist/components/ArchiveViewer.js +0 -526
- package/dist/components/AudioViewer.js +0 -66
- package/dist/components/CadViewer.js +0 -9040
- package/dist/components/CodeViewer.js +0 -151
- package/dist/components/ColladaLoader.js +0 -2282
- package/dist/components/DrawingViewer.js +0 -295
- package/dist/components/EdaViewer.js +0 -630
- package/dist/components/EmailViewer.js +0 -276
- package/dist/components/EpubViewer.js +0 -172
- package/dist/components/FBXLoader.js +0 -1574
- package/dist/components/GLTFLoader.js +0 -1383
- package/dist/components/ImageViewer.js +0 -1519
- package/dist/components/KMZLoader.js +0 -45
- package/dist/components/MarkdownViewer.js +0 -1476
- package/dist/components/ModelViewer.js +0 -797
- package/dist/components/OBJLoader.js +0 -287
- package/dist/components/OfdViewer.js +0 -133
- package/dist/components/PCDLoader.js +0 -141
- package/dist/components/PLYLoader.js +0 -305
- package/dist/components/PdfView.js +0 -27667
- package/dist/components/PptxRender.js +0 -11217
- package/dist/components/STLLoader.js +0 -83
- package/dist/components/TDSLoader.js +0 -228
- package/dist/components/TypstViewer.js +0 -1697
- package/dist/components/USDLoader.js +0 -2526
- package/dist/components/UmdViewer.js +0 -1873
- package/dist/components/VRMLLoader.js +0 -6422
- package/dist/components/VTKLoader.js +0 -337
- package/dist/components/XYZLoader.js +0 -30
- package/dist/components/XlsxTable.js +0 -7879
- package/dist/components/__vite-browser-external.js +0 -7
- package/dist/components/_plugin-vue_export-helper.js +0 -8
- package/dist/components/ar-SA-G6X2FPQ2.js +0 -523
- package/dist/components/arc.js +0 -79
- package/dist/components/architecture-7EHR7CIX.js +0 -3
- package/dist/components/architectureDiagram-3BPJPVTR.js +0 -4096
- package/dist/components/archive.js +0 -24
- package/dist/components/asyncToGenerator.js +0 -29
- package/dist/components/audio.js +0 -19
- package/dist/components/az-AZ-76LH7QW2.js +0 -523
- package/dist/components/bash.js +0 -169
- package/dist/components/bg-BG-XCXSNQG7.js +0 -523
- package/dist/components/blockDiagram-GPEHLZMM.js +0 -3357
- package/dist/components/bn-BD-2XOGV67Q.js +0 -523
- package/dist/components/c4Diagram-AAUBKEIU.js +0 -2957
- package/dist/components/ca-ES-6MX7JW3Y.js +0 -523
- package/dist/components/cad.js +0 -23
- package/dist/components/cfb.js +0 -1174
- package/dist/components/channel.js +0 -5
- package/dist/components/chunk-2J33WTMH.js +0 -26
- package/dist/components/chunk-3OPIFGDE.js +0 -4167
- package/dist/components/chunk-4BX2VUAB.js +0 -19
- package/dist/components/chunk-55IACEB6.js +0 -9
- package/dist/components/chunk-5ZQYHXKU.js +0 -669
- package/dist/components/chunk-6U3AYISY.js +0 -624
- package/dist/components/chunk-727SXJPM.js +0 -3356
- package/dist/components/chunk-AGHRB4JF.js +0 -324
- package/dist/components/chunk-AQP2D5EJ.js +0 -2055
- package/dist/components/chunk-BSJP7CBP.js +0 -83
- package/dist/components/chunk-CSCIHK7Q.js +0 -3500
- package/dist/components/chunk-EIO257PC.js +0 -1836
- package/dist/components/chunk-FMBD7UC4.js +0 -5
- package/dist/components/chunk-K2UTITRG.js +0 -17627
- package/dist/components/chunk-KSCS5N6A.js +0 -572
- package/dist/components/chunk-L5ZTLDWV.js +0 -40
- package/dist/components/chunk-LZXEDZCA.js +0 -60
- package/dist/components/chunk-ND2GUHAM.js +0 -61
- package/dist/components/chunk-NNHCCRGN.js +0 -20425
- package/dist/components/chunk-NZK2D7GU.js +0 -68
- package/dist/components/chunk-O5CBEL6O.js +0 -1894
- package/dist/components/chunk-QZHKN3VN.js +0 -12
- package/dist/components/chunk-SRAX5OIU.js +0 -22
- package/dist/components/chunk-WU5MYG2G.js +0 -14
- package/dist/components/chunk-XPW4576I.js +0 -1146
- package/dist/components/chunk-Z3N5DIM6.js +0 -59
- package/dist/components/chunk-ZUYEQ4TG.js +0 -22
- package/dist/components/chunk.js +0 -23
- package/dist/components/classDiagram-4FO5ZUOK.js +0 -29
- package/dist/components/classDiagram-v2-Q7XG4LA2.js +0 -29
- package/dist/components/compiler.js +0 -2
- package/dist/components/core.js +0 -845
- package/dist/components/cose-bilkent-S5V4N54A.js +0 -2268
- package/dist/components/cpp.js +0 -225
- package/dist/components/cs-CZ-2BRQDIVT.js +0 -523
- package/dist/components/csharp.js +0 -260
- package/dist/components/css.js +0 -140
- package/dist/components/cytoscape.esm.js +0 -18114
- package/dist/components/da-DK-5WZEPLOC.js +0 -523
- package/dist/components/dagre-BM42HDAG.js +0 -325
- package/dist/components/dagre.js +0 -1936
- package/dist/components/de-DE-XR44H4JA.js +0 -523
- package/dist/components/defaultLocale.js +0 -201
- package/dist/components/defineProperty.js +0 -50
- package/dist/components/diagram-2AECGRRQ.js +0 -229
- package/dist/components/diagram-5GNKFQAL.js +0 -108
- package/dist/components/diagram-KO2AKTUF.js +0 -443
- package/dist/components/diagram-LMA3HP47.js +0 -139
- package/dist/components/diagram-OG6HWLK6.js +0 -541
- package/dist/components/diff.js +0 -39
- package/dist/components/directory-open-01563666.js +0 -26
- package/dist/components/directory-open-4ed118d0.js +0 -83
- package/dist/components/dist.js +0 -50
- package/dist/components/dist2.js +0 -3291
- package/dist/components/dist3.js +0 -1593
- package/dist/components/documentSearch.js +0 -378
- package/dist/components/docx-preview.js +0 -3113
- package/dist/components/drawing.js +0 -19
- package/dist/components/ebook.js +0 -16
- package/dist/components/eda.js +0 -20
- package/dist/components/el-GR-BZB4AONW.js +0 -523
- package/dist/components/email.js +0 -21
- package/dist/components/en-B4ZKOASM.js +0 -3
- package/dist/components/erDiagram-TEJ5UH35.js +0 -1719
- package/dist/components/es-ES-U4NZUMDT.js +0 -523
- package/dist/components/eu-ES-A7QVB2H4.js +0 -523
- package/dist/components/eventmodeling-FCH6USID.js +0 -3
- package/dist/components/fa-IR-HGAKTJCU.js +0 -523
- package/dist/components/fflate.module.js +0 -323
- package/dist/components/fi-FI-Z5N7JZ37.js +0 -523
- package/dist/components/file-open-002ab408.js +0 -38
- package/dist/components/file-open-7c801643.js +0 -24
- package/dist/components/file-save-3189631c.js +0 -40
- package/dist/components/file-save-745eba88.js +0 -36
- package/dist/components/flowDiagram-I6XJVG4X.js +0 -4181
- package/dist/components/fr-FR-RHASNOE6.js +0 -523
- package/dist/components/ganttDiagram-6RSMTGT7.js +0 -2182
- package/dist/components/gitGraph-WXDBUCRP.js +0 -3
- package/dist/components/gitGraphDiagram-PVQCEYII.js +0 -788
- package/dist/components/gl-ES-HMX3MZ6V.js +0 -523
- package/dist/components/global-compiler.js +0 -23
- package/dist/components/global-renderer.js +0 -23
- package/dist/components/go.js +0 -140
- package/dist/components/graphlib.js +0 -1267
- package/dist/components/he-IL-6SHJWFNN.js +0 -523
- package/dist/components/hi-IN-IWLTKZ5I.js +0 -523
- package/dist/components/hu-HU-A5ZG7DT2.js +0 -523
- package/dist/components/id-ID-SAP4L64H.js +0 -523
- package/dist/components/image-GAAHSSAO.js +0 -3
- package/dist/components/image-blob-reduce.esm.js +0 -1429
- package/dist/components/image.js +0 -17
- package/dist/components/info-J43DQDTF.js +0 -3
- package/dist/components/infoDiagram-5YYISTIA.js +0 -26
- package/dist/components/ini.js +0 -88
- package/dist/components/init.js +0 -15
- package/dist/components/ishikawaDiagram-YF4QCWOH.js +0 -718
- package/dist/components/it-IT-JPQ66NNP.js +0 -523
- package/dist/components/ja-JP-DBVTYXUO.js +0 -523
- package/dist/components/java.js +0 -169
- package/dist/components/javascript.js +0 -436
- package/dist/components/journeyDiagram-JHISSGLW.js +0 -885
- package/dist/components/json.js +0 -36
- package/dist/components/jszip.min.js +0 -3033
- package/dist/components/kaa-6HZHGXH3.js +0 -523
- package/dist/components/kab-KAB-ZGHBKWFO.js +0 -523
- package/dist/components/kanban-definition-UN3LZRKU.js +0 -986
- package/dist/components/katex.js +0 -21979
- package/dist/components/kk-KZ-P5N5QNE5.js +0 -523
- package/dist/components/km-KH-HSX4SM5Z.js +0 -523
- package/dist/components/ko-KR-MTYHY66A.js +0 -523
- package/dist/components/ku-TR-6OUDTVRD.js +0 -523
- package/dist/components/lib.js +0 -4877
- package/dist/components/libarchive.js +0 -360
- package/dist/components/linear.js +0 -289
- package/dist/components/lt-LT-XHIRWOB4.js +0 -523
- package/dist/components/lv-LV-5QDEKY6T.js +0 -523
- package/dist/components/markdown.js +0 -181
- package/dist/components/md.js +0 -17
- package/dist/components/mermaid-parser.core.js +0 -328
- package/dist/components/mindmap-definition-RKZ34NQL.js +0 -1016
- package/dist/components/model.js +0 -21
- package/dist/components/mp4.js +0 -12
- package/dist/components/mr-IN-CRQNXWMA.js +0 -523
- package/dist/components/my-MM-5M5IBNSE.js +0 -523
- package/dist/components/nb-NO-T6EIAALU.js +0 -523
- package/dist/components/nestedRender.js +0 -158
- package/dist/components/nl-NL-IS3SIHDZ.js +0 -523
- package/dist/components/nn-NO-6E72VCQL.js +0 -523
- package/dist/components/objectSpread2.js +0 -29
- package/dist/components/objectWithoutProperties.js +0 -28
- package/dist/components/oc-FR-POXYY2M6.js +0 -523
- package/dist/components/ofd.js +0 -5261
- package/dist/components/ofd2.js +0 -16
- package/dist/components/ordinal.js +0 -65
- package/dist/components/pa-IN-N4M65BXN.js +0 -523
- package/dist/components/packet-YPE3B663.js +0 -3
- package/dist/components/pdf.js +0 -24
- package/dist/components/percentages-BXMCSKIN.js +0 -3
- package/dist/components/php.js +0 -294
- package/dist/components/pica.js +0 -1009
- package/dist/components/pie-LRSECV5Y.js +0 -3
- package/dist/components/pie.js +0 -47
- package/dist/components/pieDiagram-4H26LBE5.js +0 -130
- package/dist/components/pl-PL-T2D74RX3.js +0 -523
- package/dist/components/postal-mime.js +0 -3146
- package/dist/components/pptx.js +0 -15
- package/dist/components/printLayout.js +0 -42
- package/dist/components/prod.js +0 -21770
- package/dist/components/pt-BR-5N22H2LF.js +0 -523
- package/dist/components/pt-PT-UZXXM6DQ.js +0 -523
- package/dist/components/python.js +0 -238
- package/dist/components/quadrantDiagram-W4KKPZXB.js +0 -1988
- package/dist/components/radar-GUYGQ44K.js +0 -3
- package/dist/components/renderer.js +0 -2
- package/dist/components/requirementDiagram-4Y6WPE33.js +0 -2230
- package/dist/components/ro-RO-JPDTUUEW.js +0 -523
- package/dist/components/rough.esm.js +0 -1355
- package/dist/components/roundRect.js +0 -90
- package/dist/components/ru-RU-B4JR7IUQ.js +0 -523
- package/dist/components/rust.js +0 -169
- package/dist/components/sankeyDiagram-5OEKKPKP.js +0 -972
- package/dist/components/sequenceDiagram-3UESZ5HK.js +0 -4255
- package/dist/components/shared.js +0 -175
- package/dist/components/shared2.js +0 -4
- package/dist/components/si-LK-N5RQ5JYF.js +0 -523
- package/dist/components/sk-SK-C5VTKIMK.js +0 -523
- package/dist/components/sl-SI-NN7IZMDC.js +0 -523
- package/dist/components/sourceLoading.js +0 -134
- package/dist/components/sql.js +0 -118
- package/dist/components/src.js +0 -2664
- package/dist/components/src2.js +0 -10722
- package/dist/components/stateDiagram-AJRCARHV.js +0 -217
- package/dist/components/stateDiagram-v2-BHNVJYJU.js +0 -27
- package/dist/components/subset-shared.chunk.js +0 -3
- package/dist/components/subset-worker.chunk.js +0 -21
- package/dist/components/sv-SE-XGPEYMSR.js +0 -523
- package/dist/components/ta-IN-2NMHFXQM.js +0 -523
- package/dist/components/text.js +0 -20
- package/dist/components/th-TH-HPSO5L25.js +0 -523
- package/dist/components/three.module.js +0 -13134
- package/dist/components/time.js +0 -910
- package/dist/components/timeline-definition-PNZ67QCA.js +0 -1084
- package/dist/components/tr-TR-DEFEU3FU.js +0 -523
- package/dist/components/treeView-BLDUP644.js +0 -3
- package/dist/components/treemap-LRROVOQU.js +0 -3
- package/dist/components/typescript.js +0 -521
- package/dist/components/typst.js +0 -25
- package/dist/components/uk-UA-QMV73CPH.js +0 -523
- package/dist/components/umd.js +0 -16
- package/dist/components/use.js +0 -422
- package/dist/components/util.js +0 -49
- package/dist/components/vennDiagram-CIIHVFJN.js +0 -1880
- package/dist/components/vi-VN-M7AON7JQ.js +0 -523
- package/dist/components/viewerZoom.js +0 -92
- package/dist/components/wardley-L42UT6IY.js +0 -3
- package/dist/components/wardleyDiagram-YWT4CUSO.js +0 -656
- package/dist/components/wasm-pack-shim.js +0 -1711
- package/dist/components/wasm-pack-shim2.js +0 -934
- package/dist/components/wasm.js +0 -97
- package/dist/components/word.js +0 -3055
- package/dist/components/worker-ref.js +0 -16
- package/dist/components/xlsx.js +0 -21
- package/dist/components/xml.js +0 -166
- package/dist/components/xychartDiagram-2RQKCTM6.js +0 -2015
- package/dist/components/yaml.js +0 -144
- package/dist/components/zh-CN-LNUGB5OW.js +0 -523
- package/dist/components/zh-HK-E62DVLB3.js +0 -523
- package/dist/components/zh-TW-RAJ6MFWO.js +0 -523
- package/dist/index.mjs +0 -3293
- package/dist/src/App.vue.d.ts +0 -3
- package/dist/src/compare/CompareApp.vue.d.ts +0 -3
- package/dist/src/compare/main.d.ts +0 -0
- package/dist/src/compare/useSynchronizedScroll.d.ts +0 -7
- package/dist/src/components/HelloWorld.vue.d.ts +0 -3
- package/dist/src/components/utils.d.ts +0 -4
- package/dist/src/main.d.ts +0 -0
- package/dist/src/package/common/printCapability.d.ts +0 -27
- package/dist/src/package/common/printLayout.d.ts +0 -16
- package/dist/src/package/common/sourceLoading.d.ts +0 -10
- package/dist/src/package/common/type.d.ts +0 -544
- package/dist/src/package/common/util.d.ts +0 -5
- package/dist/src/package/common/worker-ref.d.ts +0 -12
- package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +0 -75
- package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +0 -9
- package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +0 -29
- package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +0 -21
- package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +0 -8
- package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +0 -34
- package/dist/src/package/components/FileViewer/index.d.ts +0 -2
- package/dist/src/package/components/FileViewer/util.d.ts +0 -3
- package/dist/src/package/index.d.ts +0 -22
- package/dist/src/package/use/documentLocation.d.ts +0 -15
- package/dist/src/package/use/documentSearch.d.ts +0 -234
- package/dist/src/package/use/index.d.ts +0 -5
- package/dist/src/package/use/loading.d.ts +0 -33
- package/dist/src/package/use/viewerZoom.d.ts +0 -42
- package/dist/src/package/use/worker.d.ts +0 -24
- package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +0 -9
- package/dist/src/package/vendors/archive/cache.d.ts +0 -10
- package/dist/src/package/vendors/archive/fallback.d.ts +0 -9
- package/dist/src/package/vendors/archive/index.d.ts +0 -3
- package/dist/src/package/vendors/archive/shared.d.ts +0 -24
- package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +0 -7
- package/dist/src/package/vendors/audio/index.d.ts +0 -7
- package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +0 -9
- package/dist/src/package/vendors/cad/index.d.ts +0 -8
- package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +0 -15
- package/dist/src/package/vendors/drawing/index.d.ts +0 -7
- package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/ebook/index.d.ts +0 -7
- package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +0 -8
- package/dist/src/package/vendors/eda/index.d.ts +0 -2
- package/dist/src/package/vendors/eda/parser.d.ts +0 -77
- package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +0 -10
- package/dist/src/package/vendors/email/index.d.ts +0 -2
- package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/image/index.d.ts +0 -4
- package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/md/index.d.ts +0 -4
- package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +0 -8
- package/dist/src/package/vendors/model/index.d.ts +0 -3
- package/dist/src/package/vendors/model/shared.d.ts +0 -1
- package/dist/src/package/vendors/mp4/index.d.ts +0 -4
- package/dist/src/package/vendors/nestedRender.d.ts +0 -10
- package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/ofd/index.d.ts +0 -7
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +0 -10
- package/dist/src/package/vendors/pdf/index.d.ts +0 -2
- package/dist/src/package/vendors/pdf/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
- package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +0 -9
- package/dist/src/package/vendors/pptx/index.d.ts +0 -6
- package/dist/src/package/vendors/pptx/options.d.ts +0 -39
- package/dist/src/package/vendors/pptx/support/chart.d.ts +0 -4
- package/dist/src/package/vendors/pptx/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/renders.d.ts +0 -3
- package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +0 -7
- package/dist/src/package/vendors/text/index.d.ts +0 -10
- package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +0 -15
- package/dist/src/package/vendors/typst/index.d.ts +0 -8
- package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/umd/index.d.ts +0 -7
- package/dist/src/package/vendors/umd/parser.d.ts +0 -30
- package/dist/src/package/vendors/word/doc.d.ts +0 -5
- package/dist/src/package/vendors/word/docx.d.ts +0 -5
- package/dist/src/package/vendors/word/docx.worker.d.ts +0 -1
- package/dist/src/package/vendors/word/index.d.ts +0 -3
- package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +0 -80
- package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +0 -25
- package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/index.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/util.d.ts +0 -3
- package/dist/src/package/vendors/xlsx/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +0 -73
- package/dist/src/package/vendors/xlsx/worker/sheetjs/color.d.ts +0 -2
- package/dist/src/package/vendors/xlsx/worker/sheetjs/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +0 -1
- package/dist/style.css +0 -1
- package/dist/wasm/cad/dwfv-render.wasm +0 -0
- package/dist/wasm/cad/dwg-worker.js +0 -24
- package/dist/wasm/cad/libredwg-web.js +0 -15
- package/dist/wasm/cad/libredwg-web.wasm +0 -0
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Bt as e, C as t, K as n, l as r, p as i, u as a, w as o, wt as s } from "./three.module.js";
|
|
2
|
-
//#region node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/loaders/STLLoader.js
|
|
3
|
-
var c = class extends n {
|
|
4
|
-
constructor(e) {
|
|
5
|
-
super(e);
|
|
6
|
-
}
|
|
7
|
-
load(e, n, r, i) {
|
|
8
|
-
let a = this, o = new t(this.manager);
|
|
9
|
-
o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(t) {
|
|
10
|
-
try {
|
|
11
|
-
n(a.parse(t));
|
|
12
|
-
} catch (t) {
|
|
13
|
-
i ? i(t) : console.error(t), a.manager.itemError(e);
|
|
14
|
-
}
|
|
15
|
-
}, r, i);
|
|
16
|
-
}
|
|
17
|
-
parse(t) {
|
|
18
|
-
function n(e) {
|
|
19
|
-
let t = new DataView(e);
|
|
20
|
-
if (84 + t.getUint32(80, !0) * 50 === t.byteLength) return !0;
|
|
21
|
-
let n = [
|
|
22
|
-
115,
|
|
23
|
-
111,
|
|
24
|
-
108,
|
|
25
|
-
105,
|
|
26
|
-
100
|
|
27
|
-
];
|
|
28
|
-
for (let e = 0; e < 5; e++) if (c(n, t, e)) return !1;
|
|
29
|
-
return !0;
|
|
30
|
-
}
|
|
31
|
-
function c(e, t, n) {
|
|
32
|
-
for (let r = 0, i = e.length; r < i; r++) if (e[r] !== t.getUint8(n + r)) return !1;
|
|
33
|
-
return !0;
|
|
34
|
-
}
|
|
35
|
-
function l(e) {
|
|
36
|
-
let t = new DataView(e), n = t.getUint32(80, !0), o, c, l, u = !1, d, f, p, m, h;
|
|
37
|
-
for (let e = 0; e < 70; e++) t.getUint32(e, !1) == 1129270351 && t.getUint8(e + 4) == 82 && t.getUint8(e + 5) == 61 && (u = !0, d = new Float32Array(n * 3 * 3), f = t.getUint8(e + 6) / 255, p = t.getUint8(e + 7) / 255, m = t.getUint8(e + 8) / 255, h = t.getUint8(e + 9) / 255);
|
|
38
|
-
let g = new a(), _ = new Float32Array(n * 3 * 3), v = new Float32Array(n * 3 * 3), y = new i();
|
|
39
|
-
for (let e = 0; e < n; e++) {
|
|
40
|
-
let n = 84 + e * 50, r = t.getFloat32(n, !0), i = t.getFloat32(n + 4, !0), a = t.getFloat32(n + 8, !0);
|
|
41
|
-
if (u) {
|
|
42
|
-
let e = t.getUint16(n + 48, !0);
|
|
43
|
-
e & 32768 ? (o = f, c = p, l = m) : (o = (e & 31) / 31, c = (e >> 5 & 31) / 31, l = (e >> 10 & 31) / 31);
|
|
44
|
-
}
|
|
45
|
-
for (let f = 1; f <= 3; f++) {
|
|
46
|
-
let p = n + f * 12, m = e * 3 * 3 + (f - 1) * 3;
|
|
47
|
-
_[m] = t.getFloat32(p, !0), _[m + 1] = t.getFloat32(p + 4, !0), _[m + 2] = t.getFloat32(p + 8, !0), v[m] = r, v[m + 1] = i, v[m + 2] = a, u && (y.setRGB(o, c, l, s), d[m] = y.r, d[m + 1] = y.g, d[m + 2] = y.b);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return g.setAttribute("position", new r(_, 3)), g.setAttribute("normal", new r(v, 3)), u && (g.setAttribute("color", new r(d, 3)), g.hasColors = !0, g.alpha = h), g;
|
|
51
|
-
}
|
|
52
|
-
function u(t) {
|
|
53
|
-
let n = new a(), r = /solid([\s\S]*?)endsolid/g, i = /facet([\s\S]*?)endfacet/g, s = /solid\s(.+)/, c = 0, l = /* @__PURE__ */ RegExp("vertex[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)", "g"), u = /* @__PURE__ */ RegExp("normal[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)", "g"), d = [], f = [], p = [], m = new e(), h, g = 0, _ = 0, v = 0;
|
|
54
|
-
for (; (h = r.exec(t)) !== null;) {
|
|
55
|
-
_ = v;
|
|
56
|
-
let e = h[0], t = (h = s.exec(e)) === null ? "" : h[1];
|
|
57
|
-
for (p.push(t); (h = i.exec(e)) !== null;) {
|
|
58
|
-
let e = 0, t = 0, n = h[0];
|
|
59
|
-
for (; (h = u.exec(n)) !== null;) m.x = parseFloat(h[1]), m.y = parseFloat(h[2]), m.z = parseFloat(h[3]), t++;
|
|
60
|
-
for (; (h = l.exec(n)) !== null;) d.push(parseFloat(h[1]), parseFloat(h[2]), parseFloat(h[3])), f.push(m.x, m.y, m.z), e++, v++;
|
|
61
|
-
t !== 1 && console.error("THREE.STLLoader: Something isn't right with the normal of face number " + c), e !== 3 && console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + c), c++;
|
|
62
|
-
}
|
|
63
|
-
let r = _, a = v - _;
|
|
64
|
-
n.userData.groupNames = p, n.addGroup(r, a, g), g++;
|
|
65
|
-
}
|
|
66
|
-
return n.setAttribute("position", new o(d, 3)), n.setAttribute("normal", new o(f, 3)), n;
|
|
67
|
-
}
|
|
68
|
-
function d(e) {
|
|
69
|
-
return typeof e == "string" ? e : new TextDecoder().decode(e);
|
|
70
|
-
}
|
|
71
|
-
function f(e) {
|
|
72
|
-
if (typeof e == "string") {
|
|
73
|
-
let t = new Uint8Array(e.length);
|
|
74
|
-
for (let n = 0; n < e.length; n++) t[n] = e.charCodeAt(n) & 255;
|
|
75
|
-
return t.buffer || t;
|
|
76
|
-
} else return e;
|
|
77
|
-
}
|
|
78
|
-
let p = f(t);
|
|
79
|
-
return n(p) ? l(p) : u(d(t));
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
//#endregion
|
|
83
|
-
export { c as STLLoader };
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { $ as e, C as t, E as n, Ft as r, K as i, et as a, p as o, q as s, rt as c, u as l, w as u } from "./three.module.js";
|
|
2
|
-
//#region node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/loaders/TDSLoader.js
|
|
3
|
-
var d = class extends i {
|
|
4
|
-
constructor(e) {
|
|
5
|
-
super(e), this.debug = !1, this.group = null, this.materials = [], this.meshes = [];
|
|
6
|
-
}
|
|
7
|
-
load(e, n, r, i) {
|
|
8
|
-
let a = this, o = this.path === "" ? s.extractUrlBase(e) : this.path, c = new t(this.manager);
|
|
9
|
-
c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(e, function(t) {
|
|
10
|
-
try {
|
|
11
|
-
n(a.parse(t, o));
|
|
12
|
-
} catch (t) {
|
|
13
|
-
i ? i(t) : console.error(t), a.manager.itemError(e);
|
|
14
|
-
}
|
|
15
|
-
}, r, i);
|
|
16
|
-
}
|
|
17
|
-
parse(e, t) {
|
|
18
|
-
this.group = new n(), this.materials = [], this.meshes = [], this.readFile(e, t);
|
|
19
|
-
for (let e = 0; e < this.meshes.length; e++) this.group.add(this.meshes[e]);
|
|
20
|
-
return this.group;
|
|
21
|
-
}
|
|
22
|
-
readFile(e, t) {
|
|
23
|
-
let n = new f(new DataView(e), 0, this.debugMessage);
|
|
24
|
-
if (n.id === m || n.id === h || n.id === p) {
|
|
25
|
-
let e = n.readChunk();
|
|
26
|
-
for (; e;) {
|
|
27
|
-
if (e.id === g) {
|
|
28
|
-
let t = e.readDWord();
|
|
29
|
-
this.debugMessage("3DS file version: " + t);
|
|
30
|
-
} else e.id === C ? this.readMeshData(e, t) : this.debugMessage("Unknown main chunk: " + e.hexId);
|
|
31
|
-
e = n.readChunk();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
this.debugMessage("Parsed " + this.meshes.length + " meshes");
|
|
35
|
-
}
|
|
36
|
-
readMeshData(e, t) {
|
|
37
|
-
let n = e.readChunk();
|
|
38
|
-
for (; n;) {
|
|
39
|
-
if (n.id === w) {
|
|
40
|
-
let e = +n.readDWord();
|
|
41
|
-
this.debugMessage("Mesh Version: " + e);
|
|
42
|
-
} else if (n.id === T) {
|
|
43
|
-
let e = n.readFloat();
|
|
44
|
-
this.debugMessage("Master scale: " + e), this.group.scale.set(e, e, e);
|
|
45
|
-
} else n.id === K ? (this.debugMessage("Named Object"), this.readNamedObject(n)) : n.id === E ? (this.debugMessage("Material"), this.readMaterialEntry(n, t)) : this.debugMessage("Unknown MDATA chunk: " + n.hexId);
|
|
46
|
-
n = e.readChunk();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
readNamedObject(e) {
|
|
50
|
-
let t = e.readString(), n = e.readChunk();
|
|
51
|
-
for (; n;) {
|
|
52
|
-
if (n.id === q) {
|
|
53
|
-
let e = this.readMesh(n);
|
|
54
|
-
e.name = t, this.meshes.push(e);
|
|
55
|
-
} else this.debugMessage("Unknown named object chunk: " + n.hexId);
|
|
56
|
-
n = e.readChunk();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
readMaterialEntry(e, t) {
|
|
60
|
-
let n = e.readChunk(), r = new c();
|
|
61
|
-
for (; n;) {
|
|
62
|
-
if (n.id === D) r.name = n.readString(), this.debugMessage(" Name: " + r.name);
|
|
63
|
-
else if (n.id === F) this.debugMessage(" Wireframe"), r.wireframe = !0;
|
|
64
|
-
else if (n.id === I) {
|
|
65
|
-
let e = n.readByte();
|
|
66
|
-
r.wireframeLinewidth = e, this.debugMessage(" Wireframe Thickness: " + e);
|
|
67
|
-
} else if (n.id === N) r.side = 2, this.debugMessage(" DoubleSided");
|
|
68
|
-
else if (n.id === P) this.debugMessage(" Additive Blending"), r.blending = 2;
|
|
69
|
-
else if (n.id === k) this.debugMessage(" Diffuse Color"), r.color = this.readColor(n);
|
|
70
|
-
else if (n.id === A) this.debugMessage(" Specular Color"), r.specular = this.readColor(n);
|
|
71
|
-
else if (n.id === O) this.debugMessage(" Ambient color"), r.color = this.readColor(n);
|
|
72
|
-
else if (n.id === j) {
|
|
73
|
-
let e = this.readPercentage(n);
|
|
74
|
-
r.shininess = e * 100, this.debugMessage(" Shininess : " + e);
|
|
75
|
-
} else if (n.id === M) {
|
|
76
|
-
let e = this.readPercentage(n);
|
|
77
|
-
r.opacity = 1 - e, this.debugMessage(" Transparency : " + e), r.transparent = r.opacity < 1;
|
|
78
|
-
} else n.id === L ? (this.debugMessage(" ColorMap"), r.map = this.readMap(n, t)) : n.id === z ? (this.debugMessage(" BumpMap"), r.bumpMap = this.readMap(n, t)) : n.id === R ? (this.debugMessage(" OpacityMap"), r.alphaMap = this.readMap(n, t)) : n.id === B ? (this.debugMessage(" SpecularMap"), r.specularMap = this.readMap(n, t)) : this.debugMessage(" Unknown material chunk: " + n.hexId);
|
|
79
|
-
n = e.readChunk();
|
|
80
|
-
}
|
|
81
|
-
this.materials[r.name] = r;
|
|
82
|
-
}
|
|
83
|
-
readMesh(t) {
|
|
84
|
-
let n = t.readChunk(), r = new l(), i = new a(r, new c());
|
|
85
|
-
for (i.name = "mesh"; n;) {
|
|
86
|
-
if (n.id === J) {
|
|
87
|
-
let e = n.readWord();
|
|
88
|
-
this.debugMessage(" Vertex: " + e);
|
|
89
|
-
let t = [];
|
|
90
|
-
for (let r = 0; r < e; r++) t.push(n.readFloat()), t.push(n.readFloat()), t.push(n.readFloat());
|
|
91
|
-
r.setAttribute("position", new u(t, 3));
|
|
92
|
-
} else if (n.id === Y) this.readFaceArray(n, i);
|
|
93
|
-
else if (n.id === Z) {
|
|
94
|
-
let e = n.readWord();
|
|
95
|
-
this.debugMessage(" UV: " + e);
|
|
96
|
-
let t = [];
|
|
97
|
-
for (let r = 0; r < e; r++) t.push(n.readFloat()), t.push(n.readFloat());
|
|
98
|
-
r.setAttribute("uv", new u(t, 2));
|
|
99
|
-
} else if (n.id === Q) {
|
|
100
|
-
this.debugMessage(" Transformation Matrix (TODO)");
|
|
101
|
-
let t = [];
|
|
102
|
-
for (let e = 0; e < 12; e++) t[e] = n.readFloat();
|
|
103
|
-
let a = new e();
|
|
104
|
-
a.elements[0] = t[0], a.elements[1] = t[6], a.elements[2] = t[3], a.elements[3] = t[9], a.elements[4] = t[2], a.elements[5] = t[8], a.elements[6] = t[5], a.elements[7] = t[11], a.elements[8] = t[1], a.elements[9] = t[7], a.elements[10] = t[4], a.elements[11] = t[10], a.elements[12] = 0, a.elements[13] = 0, a.elements[14] = 0, a.elements[15] = 1, a.transpose();
|
|
105
|
-
let o = new e();
|
|
106
|
-
o.copy(a).invert(), r.applyMatrix4(o), a.decompose(i.position, i.quaternion, i.scale);
|
|
107
|
-
} else this.debugMessage(" Unknown mesh chunk: " + n.hexId);
|
|
108
|
-
n = t.readChunk();
|
|
109
|
-
}
|
|
110
|
-
return r.computeVertexNormals(), i;
|
|
111
|
-
}
|
|
112
|
-
readFaceArray(e, t) {
|
|
113
|
-
let n = e.readWord();
|
|
114
|
-
this.debugMessage(" Faces: " + n);
|
|
115
|
-
let r = [];
|
|
116
|
-
for (let t = 0; t < n; ++t) r.push(e.readWord(), e.readWord(), e.readWord()), e.readWord();
|
|
117
|
-
t.geometry.setIndex(r);
|
|
118
|
-
let i = 0, a = 0;
|
|
119
|
-
for (; !e.endOfChunk;) {
|
|
120
|
-
let n = e.readChunk();
|
|
121
|
-
if (n.id === X) {
|
|
122
|
-
this.debugMessage(" Material Group");
|
|
123
|
-
let e = this.readMaterialGroup(n), r = e.index.length * 3;
|
|
124
|
-
t.geometry.addGroup(a, r, i), a += r, i++;
|
|
125
|
-
let o = this.materials[e.name];
|
|
126
|
-
Array.isArray(t.material) === !1 && (t.material = []), o !== void 0 && t.material.push(o);
|
|
127
|
-
} else this.debugMessage(" Unknown face array chunk: " + n.hexId);
|
|
128
|
-
}
|
|
129
|
-
t.material.length === 1 && (t.material = t.material[0]);
|
|
130
|
-
}
|
|
131
|
-
readMap(e, t) {
|
|
132
|
-
let n = e.readChunk(), i = {}, a = new r(this.manager);
|
|
133
|
-
for (a.setPath(this.resourcePath || t).setCrossOrigin(this.crossOrigin); n;) {
|
|
134
|
-
if (n.id === V) {
|
|
135
|
-
let e = n.readString();
|
|
136
|
-
i = a.load(e), this.debugMessage(" File: " + t + e);
|
|
137
|
-
} else n.id === W ? (i.offset.x = n.readFloat(), this.debugMessage(" OffsetX: " + i.offset.x)) : n.id === G ? (i.offset.y = n.readFloat(), this.debugMessage(" OffsetY: " + i.offset.y)) : n.id === H ? (i.repeat.x = n.readFloat(), this.debugMessage(" RepeatX: " + i.repeat.x)) : n.id === U ? (i.repeat.y = n.readFloat(), this.debugMessage(" RepeatY: " + i.repeat.y)) : this.debugMessage(" Unknown map chunk: " + n.hexId);
|
|
138
|
-
n = e.readChunk();
|
|
139
|
-
}
|
|
140
|
-
return i;
|
|
141
|
-
}
|
|
142
|
-
readMaterialGroup(e) {
|
|
143
|
-
let t = e.readString(), n = e.readWord();
|
|
144
|
-
this.debugMessage(" Name: " + t), this.debugMessage(" Faces: " + n);
|
|
145
|
-
let r = [];
|
|
146
|
-
for (let t = 0; t < n; ++t) r.push(e.readWord());
|
|
147
|
-
return {
|
|
148
|
-
name: t,
|
|
149
|
-
index: r
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
readColor(e) {
|
|
153
|
-
let t = e.readChunk(), n = new o();
|
|
154
|
-
if (t.id === v || t.id === y) {
|
|
155
|
-
let e = t.readByte(), r = t.readByte(), i = t.readByte();
|
|
156
|
-
n.setRGB(e / 255, r / 255, i / 255), this.debugMessage(" Color: " + n.r + ", " + n.g + ", " + n.b);
|
|
157
|
-
} else if (t.id === _ || t.id === b) {
|
|
158
|
-
let e = t.readFloat(), r = t.readFloat(), i = t.readFloat();
|
|
159
|
-
n.setRGB(e, r, i), this.debugMessage(" Color: " + n.r + ", " + n.g + ", " + n.b);
|
|
160
|
-
} else this.debugMessage(" Unknown color chunk: " + t.hexId);
|
|
161
|
-
return n;
|
|
162
|
-
}
|
|
163
|
-
readPercentage(e) {
|
|
164
|
-
let t = e.readChunk();
|
|
165
|
-
switch (t.id) {
|
|
166
|
-
case x: return t.readShort() / 100;
|
|
167
|
-
case S: return t.readFloat();
|
|
168
|
-
default: return this.debugMessage(" Unknown percentage chunk: " + t.hexId), 0;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
debugMessage(e) {
|
|
172
|
-
this.debug && console.log(e);
|
|
173
|
-
}
|
|
174
|
-
}, f = class e {
|
|
175
|
-
constructor(e, t, n) {
|
|
176
|
-
this.data = e, this.offset = t, this.position = t, this.debugMessage = n, this.debugMessage instanceof Function && (this.debugMessage = function() {}), this.id = this.readWord(), this.size = this.readDWord(), this.end = this.offset + this.size, this.end > e.byteLength && this.debugMessage("Bad chunk size for chunk at " + t);
|
|
177
|
-
}
|
|
178
|
-
readChunk() {
|
|
179
|
-
if (this.endOfChunk) return null;
|
|
180
|
-
try {
|
|
181
|
-
let t = new e(this.data, this.position, this.debugMessage);
|
|
182
|
-
return this.position += t.size, t;
|
|
183
|
-
} catch (e) {
|
|
184
|
-
return this.debugMessage("Unable to read chunk at " + this.position), null;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
get hexId() {
|
|
188
|
-
return this.id.toString(16);
|
|
189
|
-
}
|
|
190
|
-
get endOfChunk() {
|
|
191
|
-
return this.position >= this.end;
|
|
192
|
-
}
|
|
193
|
-
readByte() {
|
|
194
|
-
let e = this.data.getUint8(this.position, !0);
|
|
195
|
-
return this.position += 1, e;
|
|
196
|
-
}
|
|
197
|
-
readFloat() {
|
|
198
|
-
try {
|
|
199
|
-
let e = this.data.getFloat32(this.position, !0);
|
|
200
|
-
return this.position += 4, e;
|
|
201
|
-
} catch (e) {
|
|
202
|
-
return this.debugMessage(e + " " + this.position + " " + this.data.byteLength), 0;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
readInt() {
|
|
206
|
-
let e = this.data.getInt32(this.position, !0);
|
|
207
|
-
return this.position += 4, e;
|
|
208
|
-
}
|
|
209
|
-
readShort() {
|
|
210
|
-
let e = this.data.getInt16(this.position, !0);
|
|
211
|
-
return this.position += 2, e;
|
|
212
|
-
}
|
|
213
|
-
readDWord() {
|
|
214
|
-
let e = this.data.getUint32(this.position, !0);
|
|
215
|
-
return this.position += 4, e;
|
|
216
|
-
}
|
|
217
|
-
readWord() {
|
|
218
|
-
let e = this.data.getUint16(this.position, !0);
|
|
219
|
-
return this.position += 2, e;
|
|
220
|
-
}
|
|
221
|
-
readString() {
|
|
222
|
-
let e = "", t = this.readByte();
|
|
223
|
-
for (; t;) e += String.fromCharCode(t), t = this.readByte();
|
|
224
|
-
return e;
|
|
225
|
-
}
|
|
226
|
-
}, p = 19789, m = 15786, h = 49725, g = 2, _ = 16, v = 17, y = 18, b = 19, x = 48, S = 49, C = 15677, w = 15678, T = 256, E = 45055, D = 40960, O = 40976, k = 40992, A = 41008, j = 41024, M = 41040, N = 41089, P = 41091, F = 41093, I = 41095, L = 41472, R = 41488, z = 41520, B = 41476, V = 41728, H = 41812, U = 41814, W = 41816, G = 41818, K = 16384, q = 16640, J = 16656, Y = 16672, X = 16688, Z = 16704, Q = 16736;
|
|
227
|
-
//#endregion
|
|
228
|
-
export { d as TDSLoader };
|