@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,527 +0,0 @@
|
|
|
1
|
-
import { $ as e, C as t, Ct as n, E as r, Ft as i, H as a, K as o, U as s, at as c, et as l, f as u, l as d, ot as f, p, rt as m, st as h, u as g, w as _, wt as v } from "./three.module.js";
|
|
2
|
-
import { t as y } from "./fflate.module.js";
|
|
3
|
-
//#region node_modules/.pnpm/three@0.184.0/node_modules/three/examples/jsm/loaders/3MFLoader.js
|
|
4
|
-
var b = v, x = class extends o {
|
|
5
|
-
constructor(e) {
|
|
6
|
-
super(e), this.availableExtensions = [];
|
|
7
|
-
}
|
|
8
|
-
load(e, n, r, i) {
|
|
9
|
-
let a = this, o = new t(a.manager);
|
|
10
|
-
o.setPath(a.path), o.setResponseType("arraybuffer"), o.setRequestHeader(a.requestHeader), o.setWithCredentials(a.withCredentials), o.load(e, function(t) {
|
|
11
|
-
try {
|
|
12
|
-
n(a.parse(t));
|
|
13
|
-
} catch (t) {
|
|
14
|
-
i ? i(t) : console.error(t), a.manager.itemError(e);
|
|
15
|
-
}
|
|
16
|
-
}, r, i);
|
|
17
|
-
}
|
|
18
|
-
parse(t) {
|
|
19
|
-
let v = this, x = new i(this.manager);
|
|
20
|
-
function S(e) {
|
|
21
|
-
let t = null, n = null, r, i, a = [], o = [], s, c = {}, l = {}, u = {}, d = new TextDecoder();
|
|
22
|
-
try {
|
|
23
|
-
t = y(new Uint8Array(e));
|
|
24
|
-
} catch (e) {
|
|
25
|
-
if (e instanceof ReferenceError) return console.error("THREE.3MFLoader: fflate missing and file is compressed."), null;
|
|
26
|
-
}
|
|
27
|
-
let f = null;
|
|
28
|
-
for (n in t) n.match(/\_rels\/.rels$/) ? r = n : n.match(/3D\/_rels\/.*\.model\.rels$/) ? i = n : n.match(/^3D\/[^\/]*\.model$/) ? f = n : n.match(/^3D\/.*\/.*\.model$/) ? a.push(n) : n.match(/^3D\/Textures?\/.*/) && o.push(n);
|
|
29
|
-
if (a.push(f), r === void 0) throw Error("THREE.ThreeMFLoader: Cannot find relationship file `rels` in 3MF archive.");
|
|
30
|
-
let p = t[r], m = C(d.decode(p));
|
|
31
|
-
if (i) {
|
|
32
|
-
let e = t[i];
|
|
33
|
-
s = C(d.decode(e));
|
|
34
|
-
}
|
|
35
|
-
for (let e = 0; e < a.length; e++) {
|
|
36
|
-
let n = a[e], r = t[n], i = d.decode(r), o = new DOMParser().parseFromString(i, "application/xml");
|
|
37
|
-
o.documentElement.nodeName.toLowerCase() !== "model" && console.error("THREE.3MFLoader: Error loading 3MF - no 3MF document found: ", n);
|
|
38
|
-
let s = o.querySelector("model"), l = {};
|
|
39
|
-
for (let e = 0; e < s.attributes.length; e++) {
|
|
40
|
-
let t = s.attributes[e];
|
|
41
|
-
t.name.match(/^xmlns:(.+)$/) && (l[t.value] = RegExp.$1);
|
|
42
|
-
}
|
|
43
|
-
let u = R(s);
|
|
44
|
-
u.xml = s, 0 < Object.keys(l).length && (u.extensions = l), c[n] = u;
|
|
45
|
-
}
|
|
46
|
-
for (let e = 0; e < o.length; e++) {
|
|
47
|
-
let n = o[e];
|
|
48
|
-
u[n] = t[n].buffer;
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
rels: m,
|
|
52
|
-
modelRels: s,
|
|
53
|
-
model: c,
|
|
54
|
-
printTicket: l,
|
|
55
|
-
texture: u
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function C(e) {
|
|
59
|
-
let t = [], n = new DOMParser().parseFromString(e, "application/xml").querySelectorAll("Relationship");
|
|
60
|
-
for (let e = 0; e < n.length; e++) {
|
|
61
|
-
let r = n[e], i = {
|
|
62
|
-
target: r.getAttribute("Target"),
|
|
63
|
-
id: r.getAttribute("Id"),
|
|
64
|
-
type: r.getAttribute("Type")
|
|
65
|
-
};
|
|
66
|
-
t.push(i);
|
|
67
|
-
}
|
|
68
|
-
return t;
|
|
69
|
-
}
|
|
70
|
-
function w(e) {
|
|
71
|
-
let t = {};
|
|
72
|
-
for (let n = 0; n < e.length; n++) {
|
|
73
|
-
let r = e[n], i = r.getAttribute("name");
|
|
74
|
-
0 <= [
|
|
75
|
-
"Title",
|
|
76
|
-
"Designer",
|
|
77
|
-
"Description",
|
|
78
|
-
"Copyright",
|
|
79
|
-
"LicenseTerms",
|
|
80
|
-
"Rating",
|
|
81
|
-
"CreationDate",
|
|
82
|
-
"ModificationDate"
|
|
83
|
-
].indexOf(i) && (t[i] = r.textContent);
|
|
84
|
-
}
|
|
85
|
-
return t;
|
|
86
|
-
}
|
|
87
|
-
function T(e) {
|
|
88
|
-
let t = {
|
|
89
|
-
id: e.getAttribute("id"),
|
|
90
|
-
basematerials: []
|
|
91
|
-
}, n = e.querySelectorAll("base");
|
|
92
|
-
for (let e = 0; e < n.length; e++) {
|
|
93
|
-
let r = n[e], i = A(r);
|
|
94
|
-
i.index = e, t.basematerials.push(i);
|
|
95
|
-
}
|
|
96
|
-
return t;
|
|
97
|
-
}
|
|
98
|
-
function E(e) {
|
|
99
|
-
return {
|
|
100
|
-
id: e.getAttribute("id"),
|
|
101
|
-
path: e.getAttribute("path"),
|
|
102
|
-
contenttype: e.getAttribute("contenttype"),
|
|
103
|
-
tilestyleu: e.getAttribute("tilestyleu"),
|
|
104
|
-
tilestylev: e.getAttribute("tilestylev"),
|
|
105
|
-
filter: e.getAttribute("filter")
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
function ee(e) {
|
|
109
|
-
let t = {
|
|
110
|
-
id: e.getAttribute("id"),
|
|
111
|
-
texid: e.getAttribute("texid"),
|
|
112
|
-
displaypropertiesid: e.getAttribute("displaypropertiesid")
|
|
113
|
-
}, n = e.querySelectorAll("tex2coord"), r = [];
|
|
114
|
-
for (let e = 0; e < n.length; e++) {
|
|
115
|
-
let t = n[e], i = t.getAttribute("u"), a = t.getAttribute("v");
|
|
116
|
-
r.push(parseFloat(i), parseFloat(a));
|
|
117
|
-
}
|
|
118
|
-
return t.uvs = new Float32Array(r), t;
|
|
119
|
-
}
|
|
120
|
-
function te(e) {
|
|
121
|
-
let t = {
|
|
122
|
-
id: e.getAttribute("id"),
|
|
123
|
-
displaypropertiesid: e.getAttribute("displaypropertiesid")
|
|
124
|
-
}, n = e.querySelectorAll("color"), r = [], i = new p();
|
|
125
|
-
for (let e = 0; e < n.length; e++) {
|
|
126
|
-
let t = n[e].getAttribute("color");
|
|
127
|
-
i.setStyle(t.substring(0, 7), b), r.push(i.r, i.g, i.b);
|
|
128
|
-
}
|
|
129
|
-
return t.colors = new Float32Array(r), t;
|
|
130
|
-
}
|
|
131
|
-
function D(e) {
|
|
132
|
-
let t = e.children, n = {};
|
|
133
|
-
for (let e = 0; e < t.length; e++) {
|
|
134
|
-
let r = { type: t[e].nodeName.substring(2) };
|
|
135
|
-
for (let n = 0; n < t[e].attributes.length; n++) {
|
|
136
|
-
let i = t[e].attributes[n];
|
|
137
|
-
i.specified && (r[i.name] = i.value);
|
|
138
|
-
}
|
|
139
|
-
n[t[e].getAttribute("identifier")] = r;
|
|
140
|
-
}
|
|
141
|
-
return n;
|
|
142
|
-
}
|
|
143
|
-
function O(e) {
|
|
144
|
-
let t = {
|
|
145
|
-
id: e.getAttribute("id"),
|
|
146
|
-
displayname: e.getAttribute("displayname")
|
|
147
|
-
}, n = e.children, r = {};
|
|
148
|
-
for (let e = 0; e < n.length; e++) {
|
|
149
|
-
let t = n[e];
|
|
150
|
-
if (t.nodeName === "i:in" || t.nodeName === "i:out") r[t.nodeName === "i:in" ? "inputs" : "outputs"] = D(t);
|
|
151
|
-
else {
|
|
152
|
-
let e = t.children, n = {
|
|
153
|
-
op: t.nodeName.substring(2),
|
|
154
|
-
identifier: t.getAttribute("identifier")
|
|
155
|
-
};
|
|
156
|
-
for (let t = 0; t < e.length; t++) n[e[t].nodeName.substring(2)] = D(e[t]);
|
|
157
|
-
r[n.identifier] = n;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return t.operations = r, t;
|
|
161
|
-
}
|
|
162
|
-
function k(e) {
|
|
163
|
-
let t = { id: e.getAttribute("id") }, n = e.querySelectorAll("pbmetallic"), r = [];
|
|
164
|
-
for (let e = 0; e < n.length; e++) {
|
|
165
|
-
let t = n[e];
|
|
166
|
-
r.push({
|
|
167
|
-
name: t.getAttribute("name"),
|
|
168
|
-
metallicness: parseFloat(t.getAttribute("metallicness")),
|
|
169
|
-
roughness: parseFloat(t.getAttribute("roughness"))
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
return t.data = r, t;
|
|
173
|
-
}
|
|
174
|
-
function A(e) {
|
|
175
|
-
let t = {};
|
|
176
|
-
return t.name = e.getAttribute("name"), t.displaycolor = e.getAttribute("displaycolor"), t.displaypropertiesid = e.getAttribute("displaypropertiesid"), t;
|
|
177
|
-
}
|
|
178
|
-
function j(e) {
|
|
179
|
-
let t = {}, n = [], r = e.querySelectorAll("vertices vertex");
|
|
180
|
-
for (let e = 0; e < r.length; e++) {
|
|
181
|
-
let t = r[e], i = t.getAttribute("x"), a = t.getAttribute("y"), o = t.getAttribute("z");
|
|
182
|
-
n.push(parseFloat(i), parseFloat(a), parseFloat(o));
|
|
183
|
-
}
|
|
184
|
-
t.vertices = new Float32Array(n);
|
|
185
|
-
let i = [], a = [], o = e.querySelectorAll("triangles triangle");
|
|
186
|
-
for (let e = 0; e < o.length; e++) {
|
|
187
|
-
let t = o[e], n = t.getAttribute("v1"), r = t.getAttribute("v2"), s = t.getAttribute("v3"), c = t.getAttribute("p1"), l = t.getAttribute("p2"), u = t.getAttribute("p3"), d = t.getAttribute("pid"), f = {};
|
|
188
|
-
f.v1 = parseInt(n, 10), f.v2 = parseInt(r, 10), f.v3 = parseInt(s, 10), a.push(f.v1, f.v2, f.v3), c && (f.p1 = parseInt(c, 10)), l && (f.p2 = parseInt(l, 10)), u && (f.p3 = parseInt(u, 10)), d && (f.pid = d), 0 < Object.keys(f).length && i.push(f);
|
|
189
|
-
}
|
|
190
|
-
return t.triangleProperties = i, t.triangles = new Uint32Array(a), t;
|
|
191
|
-
}
|
|
192
|
-
function M(e) {
|
|
193
|
-
let t = [], n = e.querySelectorAll("component");
|
|
194
|
-
for (let e = 0; e < n.length; e++) {
|
|
195
|
-
let r = n[e], i = N(r);
|
|
196
|
-
t.push(i);
|
|
197
|
-
}
|
|
198
|
-
return t;
|
|
199
|
-
}
|
|
200
|
-
function N(e) {
|
|
201
|
-
let t = {};
|
|
202
|
-
t.objectId = e.getAttribute("objectid");
|
|
203
|
-
let n = e.getAttribute("transform");
|
|
204
|
-
return n && (t.transform = P(n)), t;
|
|
205
|
-
}
|
|
206
|
-
function P(t) {
|
|
207
|
-
let n = [];
|
|
208
|
-
t.split(" ").forEach(function(e) {
|
|
209
|
-
n.push(parseFloat(e));
|
|
210
|
-
});
|
|
211
|
-
let r = new e();
|
|
212
|
-
return r.set(n[0], n[3], n[6], n[9], n[1], n[4], n[7], n[10], n[2], n[5], n[8], n[11], 0, 0, 0, 1), r;
|
|
213
|
-
}
|
|
214
|
-
function F(e) {
|
|
215
|
-
let t = { type: e.getAttribute("type") }, n = e.getAttribute("id");
|
|
216
|
-
n && (t.id = n);
|
|
217
|
-
let r = e.getAttribute("pid");
|
|
218
|
-
r && (t.pid = r);
|
|
219
|
-
let i = e.getAttribute("pindex");
|
|
220
|
-
i && (t.pindex = i);
|
|
221
|
-
let a = e.getAttribute("thumbnail");
|
|
222
|
-
a && (t.thumbnail = a);
|
|
223
|
-
let o = e.getAttribute("partnumber");
|
|
224
|
-
o && (t.partnumber = o);
|
|
225
|
-
let s = e.getAttribute("name");
|
|
226
|
-
s && (t.name = s);
|
|
227
|
-
let c = e.querySelector("mesh");
|
|
228
|
-
c && (t.mesh = j(c));
|
|
229
|
-
let l = e.querySelector("components");
|
|
230
|
-
return l && (t.components = M(l)), t;
|
|
231
|
-
}
|
|
232
|
-
function I(e) {
|
|
233
|
-
let t = {};
|
|
234
|
-
t.basematerials = {};
|
|
235
|
-
let n = e.querySelectorAll("basematerials");
|
|
236
|
-
for (let e = 0; e < n.length; e++) {
|
|
237
|
-
let r = n[e], i = T(r);
|
|
238
|
-
t.basematerials[i.id] = i;
|
|
239
|
-
}
|
|
240
|
-
t.texture2d = {};
|
|
241
|
-
let r = e.querySelectorAll("texture2d");
|
|
242
|
-
for (let e = 0; e < r.length; e++) {
|
|
243
|
-
let n = r[e], i = E(n);
|
|
244
|
-
t.texture2d[i.id] = i;
|
|
245
|
-
}
|
|
246
|
-
t.colorgroup = {};
|
|
247
|
-
let i = e.querySelectorAll("colorgroup");
|
|
248
|
-
for (let e = 0; e < i.length; e++) {
|
|
249
|
-
let n = i[e], r = te(n);
|
|
250
|
-
t.colorgroup[r.id] = r;
|
|
251
|
-
}
|
|
252
|
-
let a = e.querySelectorAll("implicitfunction");
|
|
253
|
-
a.length > 0 && (t.implicitfunction = {});
|
|
254
|
-
for (let e = 0; e < a.length; e++) {
|
|
255
|
-
let n = a[e], r = O(n);
|
|
256
|
-
t.implicitfunction[r.id] = r;
|
|
257
|
-
}
|
|
258
|
-
t.pbmetallicdisplayproperties = {};
|
|
259
|
-
let o = e.querySelectorAll("pbmetallicdisplayproperties");
|
|
260
|
-
for (let e = 0; e < o.length; e++) {
|
|
261
|
-
let n = o[e], r = k(n);
|
|
262
|
-
t.pbmetallicdisplayproperties[r.id] = r;
|
|
263
|
-
}
|
|
264
|
-
t.texture2dgroup = {};
|
|
265
|
-
let s = e.querySelectorAll("texture2dgroup");
|
|
266
|
-
for (let e = 0; e < s.length; e++) {
|
|
267
|
-
let n = s[e], r = ee(n);
|
|
268
|
-
t.texture2dgroup[r.id] = r;
|
|
269
|
-
}
|
|
270
|
-
t.object = {};
|
|
271
|
-
let c = e.querySelectorAll("object");
|
|
272
|
-
for (let e = 0; e < c.length; e++) {
|
|
273
|
-
let n = c[e], r = F(n);
|
|
274
|
-
t.object[r.id] = r;
|
|
275
|
-
}
|
|
276
|
-
return t;
|
|
277
|
-
}
|
|
278
|
-
function L(e) {
|
|
279
|
-
let t = [], n = e.querySelectorAll("item");
|
|
280
|
-
for (let e = 0; e < n.length; e++) {
|
|
281
|
-
let r = n[e], i = { objectId: r.getAttribute("objectid") }, a = r.getAttribute("transform");
|
|
282
|
-
a && (i.transform = P(a)), t.push(i);
|
|
283
|
-
}
|
|
284
|
-
return t;
|
|
285
|
-
}
|
|
286
|
-
function R(e) {
|
|
287
|
-
let t = { unit: e.getAttribute("unit") || "millimeter" }, n = e.querySelectorAll("metadata");
|
|
288
|
-
n && (t.metadata = w(n));
|
|
289
|
-
let r = e.querySelector("resources");
|
|
290
|
-
r && (t.resources = I(r));
|
|
291
|
-
let i = e.querySelector("build");
|
|
292
|
-
return i && (t.build = L(i)), t;
|
|
293
|
-
}
|
|
294
|
-
function z(e, t, r, i) {
|
|
295
|
-
let o = e.texid, c = r.resources.texture2d[o];
|
|
296
|
-
if (c) {
|
|
297
|
-
let e = i[c.path], t = c.contenttype, r = new Blob([e], { type: t }), o = URL.createObjectURL(r), l = x.load(o, function() {
|
|
298
|
-
URL.revokeObjectURL(o);
|
|
299
|
-
});
|
|
300
|
-
switch (l.colorSpace = b, c.tilestyleu) {
|
|
301
|
-
case "wrap":
|
|
302
|
-
l.wrapS = n;
|
|
303
|
-
break;
|
|
304
|
-
case "mirror":
|
|
305
|
-
l.wrapS = f;
|
|
306
|
-
break;
|
|
307
|
-
case "none":
|
|
308
|
-
case "clamp":
|
|
309
|
-
l.wrapS = u;
|
|
310
|
-
break;
|
|
311
|
-
default: l.wrapS = n;
|
|
312
|
-
}
|
|
313
|
-
switch (c.tilestylev) {
|
|
314
|
-
case "wrap":
|
|
315
|
-
l.wrapT = n;
|
|
316
|
-
break;
|
|
317
|
-
case "mirror":
|
|
318
|
-
l.wrapT = f;
|
|
319
|
-
break;
|
|
320
|
-
case "none":
|
|
321
|
-
case "clamp":
|
|
322
|
-
l.wrapT = u;
|
|
323
|
-
break;
|
|
324
|
-
default: l.wrapT = n;
|
|
325
|
-
}
|
|
326
|
-
switch (c.filter) {
|
|
327
|
-
case "auto":
|
|
328
|
-
l.magFilter = a, l.minFilter = s;
|
|
329
|
-
break;
|
|
330
|
-
case "linear":
|
|
331
|
-
l.magFilter = a, l.minFilter = a, l.generateMipmaps = !1;
|
|
332
|
-
break;
|
|
333
|
-
case "nearest":
|
|
334
|
-
l.magFilter = h, l.minFilter = h, l.generateMipmaps = !1;
|
|
335
|
-
break;
|
|
336
|
-
default: l.magFilter = a, l.minFilter = s;
|
|
337
|
-
}
|
|
338
|
-
return l;
|
|
339
|
-
} else return null;
|
|
340
|
-
}
|
|
341
|
-
function B(e, t, n, r, i, a, o) {
|
|
342
|
-
let s = o.pindex, c = {};
|
|
343
|
-
for (let e = 0, n = t.length; e < n; e++) {
|
|
344
|
-
let n = t[e], r = n.p1 === void 0 ? s : n.p1;
|
|
345
|
-
c[r] === void 0 && (c[r] = []), c[r].push(n);
|
|
346
|
-
}
|
|
347
|
-
let u = Object.keys(c), d = [];
|
|
348
|
-
for (let t = 0, s = u.length; t < s; t++) {
|
|
349
|
-
let s = u[t], f = c[s], p = e.basematerials[s], m = Y(p, r, i, a, o, X), h = new g(), v = [], y = n.vertices;
|
|
350
|
-
for (let e = 0, t = f.length; e < t; e++) {
|
|
351
|
-
let t = f[e];
|
|
352
|
-
v.push(y[t.v1 * 3 + 0]), v.push(y[t.v1 * 3 + 1]), v.push(y[t.v1 * 3 + 2]), v.push(y[t.v2 * 3 + 0]), v.push(y[t.v2 * 3 + 1]), v.push(y[t.v2 * 3 + 2]), v.push(y[t.v3 * 3 + 0]), v.push(y[t.v3 * 3 + 1]), v.push(y[t.v3 * 3 + 2]);
|
|
353
|
-
}
|
|
354
|
-
h.setAttribute("position", new _(v, 3));
|
|
355
|
-
let b = new l(h, m);
|
|
356
|
-
d.push(b);
|
|
357
|
-
}
|
|
358
|
-
return d;
|
|
359
|
-
}
|
|
360
|
-
function V(e, t, n, r, i, a, o) {
|
|
361
|
-
let s = new g(), c = [], u = [], d = n.vertices, f = e.uvs;
|
|
362
|
-
for (let e = 0, n = t.length; e < n; e++) {
|
|
363
|
-
let n = t[e];
|
|
364
|
-
c.push(d[n.v1 * 3 + 0]), c.push(d[n.v1 * 3 + 1]), c.push(d[n.v1 * 3 + 2]), c.push(d[n.v2 * 3 + 0]), c.push(d[n.v2 * 3 + 1]), c.push(d[n.v2 * 3 + 2]), c.push(d[n.v3 * 3 + 0]), c.push(d[n.v3 * 3 + 1]), c.push(d[n.v3 * 3 + 2]), u.push(f[n.p1 * 2 + 0]), u.push(f[n.p1 * 2 + 1]), u.push(f[n.p2 * 2 + 0]), u.push(f[n.p2 * 2 + 1]), u.push(f[n.p3 * 2 + 0]), u.push(f[n.p3 * 2 + 1]);
|
|
365
|
-
}
|
|
366
|
-
return s.setAttribute("position", new _(c, 3)), s.setAttribute("uv", new _(u, 2)), new l(s, new m({
|
|
367
|
-
map: Y(e, r, i, a, o, z),
|
|
368
|
-
flatShading: !0
|
|
369
|
-
}));
|
|
370
|
-
}
|
|
371
|
-
function H(e, t, n, r) {
|
|
372
|
-
let i = new g(), a = [], o = [], s = n.vertices, c = e.colors;
|
|
373
|
-
for (let e = 0, n = t.length; e < n; e++) {
|
|
374
|
-
let n = t[e], i = n.v1, l = n.v2, u = n.v3;
|
|
375
|
-
a.push(s[i * 3 + 0]), a.push(s[i * 3 + 1]), a.push(s[i * 3 + 2]), a.push(s[l * 3 + 0]), a.push(s[l * 3 + 1]), a.push(s[l * 3 + 2]), a.push(s[u * 3 + 0]), a.push(s[u * 3 + 1]), a.push(s[u * 3 + 2]);
|
|
376
|
-
let d = n.p1 === void 0 ? r.pindex : n.p1, f = n.p2 === void 0 ? d : n.p2, p = n.p3 === void 0 ? d : n.p3;
|
|
377
|
-
o.push(c[d * 3 + 0]), o.push(c[d * 3 + 1]), o.push(c[d * 3 + 2]), o.push(c[f * 3 + 0]), o.push(c[f * 3 + 1]), o.push(c[f * 3 + 2]), o.push(c[p * 3 + 0]), o.push(c[p * 3 + 1]), o.push(c[p * 3 + 2]);
|
|
378
|
-
}
|
|
379
|
-
return i.setAttribute("position", new _(a, 3)), i.setAttribute("color", new _(o, 3)), new l(i, new m({
|
|
380
|
-
vertexColors: !0,
|
|
381
|
-
flatShading: !0
|
|
382
|
-
}));
|
|
383
|
-
}
|
|
384
|
-
function U(e) {
|
|
385
|
-
let t = new g();
|
|
386
|
-
return t.setIndex(new d(e.triangles, 1)), t.setAttribute("position", new d(e.vertices, 3)), new l(t, new m({
|
|
387
|
-
name: o.DEFAULT_MATERIAL_NAME,
|
|
388
|
-
color: 16777215,
|
|
389
|
-
flatShading: !0
|
|
390
|
-
}));
|
|
391
|
-
}
|
|
392
|
-
function W(e, t, n, r, i, a) {
|
|
393
|
-
let o = Object.keys(e), s = [];
|
|
394
|
-
for (let c = 0, l = o.length; c < l; c++) {
|
|
395
|
-
let l = o[c], u = e[l];
|
|
396
|
-
switch (G(l, r)) {
|
|
397
|
-
case "material":
|
|
398
|
-
let e = r.resources.basematerials[l], o = B(e, u, t, n, r, i, a);
|
|
399
|
-
for (let e = 0, t = o.length; e < t; e++) s.push(o[e]);
|
|
400
|
-
break;
|
|
401
|
-
case "texture":
|
|
402
|
-
let c = r.resources.texture2dgroup[l];
|
|
403
|
-
s.push(V(c, u, t, n, r, i, a));
|
|
404
|
-
break;
|
|
405
|
-
case "vertexColors":
|
|
406
|
-
let d = r.resources.colorgroup[l];
|
|
407
|
-
s.push(H(d, u, t, a));
|
|
408
|
-
break;
|
|
409
|
-
case "default":
|
|
410
|
-
s.push(U(t));
|
|
411
|
-
break;
|
|
412
|
-
default: console.error("THREE.3MFLoader: Unsupported resource type.");
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
if (a.name) for (let e = 0; e < s.length; e++) s[e].name = a.name;
|
|
416
|
-
return s;
|
|
417
|
-
}
|
|
418
|
-
function G(e, t) {
|
|
419
|
-
if (t.resources.texture2dgroup[e] !== void 0) return "texture";
|
|
420
|
-
if (t.resources.basematerials[e] !== void 0) return "material";
|
|
421
|
-
if (t.resources.colorgroup[e] !== void 0) return "vertexColors";
|
|
422
|
-
if (e === "default") return "default";
|
|
423
|
-
}
|
|
424
|
-
function K(e, t) {
|
|
425
|
-
let n = {}, r = e.triangleProperties, i = t.pid;
|
|
426
|
-
for (let e = 0, t = r.length; e < t; e++) {
|
|
427
|
-
let t = r[e], a = t.pid === void 0 ? i : t.pid;
|
|
428
|
-
a === void 0 && (a = "default"), n[a] === void 0 && (n[a] = []), n[a].push(t);
|
|
429
|
-
}
|
|
430
|
-
return n;
|
|
431
|
-
}
|
|
432
|
-
function q(e, t, n, i, a) {
|
|
433
|
-
let o = new r(), s = W(K(e, a), e, t, n, i, a);
|
|
434
|
-
for (let e = 0, t = s.length; e < t; e++) o.add(s[e]);
|
|
435
|
-
return o;
|
|
436
|
-
}
|
|
437
|
-
function J(e, t, n) {
|
|
438
|
-
if (!e) return;
|
|
439
|
-
let r = [], i = Object.keys(e);
|
|
440
|
-
for (let e = 0; e < i.length; e++) {
|
|
441
|
-
let t = i[e];
|
|
442
|
-
for (let e = 0; e < v.availableExtensions.length; e++) {
|
|
443
|
-
let n = v.availableExtensions[e];
|
|
444
|
-
n.ns === t && r.push(n);
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
for (let i = 0; i < r.length; i++) {
|
|
448
|
-
let a = r[i];
|
|
449
|
-
a.apply(n, e[a.ns], t);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
function Y(e, t, n, r, i, a) {
|
|
453
|
-
return e.build === void 0 && (e.build = a(e, t, n, r, i)), e.build;
|
|
454
|
-
}
|
|
455
|
-
function X(e, t, n) {
|
|
456
|
-
let r, i = e.displaypropertiesid, a = n.resources.pbmetallicdisplayproperties;
|
|
457
|
-
if (i !== null && a[i] !== void 0) {
|
|
458
|
-
let t = a[i].data[e.index];
|
|
459
|
-
r = new c({
|
|
460
|
-
flatShading: !0,
|
|
461
|
-
roughness: t.roughness,
|
|
462
|
-
metalness: t.metallicness
|
|
463
|
-
});
|
|
464
|
-
} else r = new m({ flatShading: !0 });
|
|
465
|
-
r.name = e.name;
|
|
466
|
-
let o = e.displaycolor, s = o.substring(0, 7);
|
|
467
|
-
return r.color.setStyle(s, b), o.length === 9 && (r.opacity = parseInt(o.charAt(7) + o.charAt(8), 16) / 255), r;
|
|
468
|
-
}
|
|
469
|
-
function Z(e, t, n, i) {
|
|
470
|
-
let a = new r();
|
|
471
|
-
for (let r = 0; r < e.length; r++) {
|
|
472
|
-
let o = e[r], s = t[o.objectId];
|
|
473
|
-
s === void 0 && (Q(o.objectId, t, n, i), s = t[o.objectId]);
|
|
474
|
-
let c = s.clone(), l = o.transform;
|
|
475
|
-
l && c.applyMatrix4(l), a.add(c);
|
|
476
|
-
}
|
|
477
|
-
return a;
|
|
478
|
-
}
|
|
479
|
-
function Q(e, t, n, r) {
|
|
480
|
-
let i = n.resources.object[e];
|
|
481
|
-
if (i.mesh) {
|
|
482
|
-
let e = i.mesh, a = n.extensions, o = n.xml;
|
|
483
|
-
J(a, e, o), t[i.id] = Y(e, t, n, r, i, q);
|
|
484
|
-
} else {
|
|
485
|
-
let e = i.components;
|
|
486
|
-
t[i.id] = Y(e, t, n, r, i, Z);
|
|
487
|
-
}
|
|
488
|
-
i.name && (t[i.id].name = i.name), n.resources.implicitfunction && console.warn("THREE.ThreeMFLoader: Implicit Functions are implemented in data-only.", n.resources.implicitfunction);
|
|
489
|
-
}
|
|
490
|
-
function ne(e) {
|
|
491
|
-
let t = e.model, n = e.modelRels, r = {}, i = Object.keys(t), a = {};
|
|
492
|
-
if (n) for (let t = 0, r = n.length; t < r; t++) {
|
|
493
|
-
let r = n[t], i = r.target.substring(1);
|
|
494
|
-
e.texture[i] && (a[r.target] = e.texture[i]);
|
|
495
|
-
}
|
|
496
|
-
for (let e = 0; e < i.length; e++) {
|
|
497
|
-
let n = t[i[e]], o = Object.keys(n.resources.object);
|
|
498
|
-
for (let e = 0; e < o.length; e++) {
|
|
499
|
-
let t = o[e];
|
|
500
|
-
Q(t, r, n, a);
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
return r;
|
|
504
|
-
}
|
|
505
|
-
function re(e) {
|
|
506
|
-
for (let t = 0; t < e.length; t++) {
|
|
507
|
-
let n = e[t];
|
|
508
|
-
if (n.target.split(".").pop().toLowerCase() === "model") return n;
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
function ie(e, t) {
|
|
512
|
-
let n = new r(), i = re(t.rels), a = t.model[i.target.substring(1)].build;
|
|
513
|
-
for (let t = 0; t < a.length; t++) {
|
|
514
|
-
let r = a[t], i = e[r.objectId].clone(), o = r.transform;
|
|
515
|
-
o && i.applyMatrix4(o), n.add(i);
|
|
516
|
-
}
|
|
517
|
-
return n;
|
|
518
|
-
}
|
|
519
|
-
let $ = S(t);
|
|
520
|
-
return ie(ne($), $);
|
|
521
|
-
}
|
|
522
|
-
addExtension(e) {
|
|
523
|
-
this.availableExtensions.push(e);
|
|
524
|
-
}
|
|
525
|
-
};
|
|
526
|
-
//#endregion
|
|
527
|
-
export { x as ThreeMFLoader };
|