threepipe
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

plugins-extra-importers.md 3.1KB


prev:

text: '@threepipe/plugin-gltf-transform'
link: './plugin-gltf-transform'

next:

text: '@threepipe/plugin-network'
link: './plugin-network'

@threepipe/plugins-extra-importers

Exports several plugins to add support for various file types.

ExampleSource CodeAPI Reference

NPM Package

npm install @threepipe/plugins-extra-importers

This package exports several plugins to add support for several file types using the following plugins

To add all the plugins at once use extraImporters. This adds support for loading all the above file types.

import {ThreeViewer} from 'threepipe'
import {extraImporters} from '@threepipe/plugins-extra-importers'

const viewer = new ThreeViewer({...})
viewer.addPluginsSync(extraImporters)

// Now load any file as is.
const model = await viewer.load<IObject3D>('file.3mf')

// To load the file as a data url, use the correct mimetype
const model1 = await viewer.load<IObject3D>('data:model/3mf;base64,...')

Remove the <IObject3D> if using javascript and not typescript.