Capítulo 206 de 859

Chapter 206: ThreeMFLoader

Core Idea

A loader for the 3D Manufacturing Format (3MF) format.

The following features from the core specification are supported:

  • 3D Models
  • Object Resources (Meshes and Components)
  • Material Resources (Base Materials)

3MF Materials and Properties Extension are only partially supported.

  • Texture 2D
  • Texture 2D Groups
  • Color Groups (Vertex Colors)
  • Metallic Display Properties (PBR)

Key Concepts

  • availableExtensions : Array.<Object>: An array of available extensions.

Code Examples

const loader = new ThreeMFLoader();
const object = await loader.loadAsync( './models/3mf/truck.3mf' );
object.rotation.set( - Math.PI / 2, 0, 0 ); // z-up conversion
scene.add( object );
  • What it demonstrates: Typical usage of ThreeMFLoader.

Reference Tables

Constructor

Signature
new ThreeMFLoader( manager : LoadingManager )

Properties

PropertyDescription
.availableExtensions : Array.<Object>An array of available extensions.

Methods

MethodDescription
.addExtension( extension : Object )Adds a 3MF extension.
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback )Starts loading from the given URL and passes the loaded 3MF asset to the onLoad() callback.
.parse( data : ArrayBuffer ) : GroupParses the given 3MF data and returns the resulting group.

Key Takeaways

  1. ThreeMFLoader extends: Loader
  2. Most relevant properties: availableExtensions.
  3. Key methods: addExtension, load, parse.

Connects To