Transforms 3D model data between different file formats.

The ModelConverter class manages file format conversions using a set of predefined loaders (parsers for input formats) and exporters (generators for output formats). It uses pipelines to define structured conversion workflows.

For detailed usage, refer to @xeokit/sdk/modelconverter.

Constructors

Properties

exporters: { [key: string]: ModelExporter }

A collection of available exporters, mapped by format identifiers. Each exporter generates output files in a specific format.

loaders: { [key: string]: ModelLoader }

A collection of available loaders, mapped by format identifiers. Each loader is responsible for parsing specific file formats.

pipelines: { [key: string]: ModelConverterPipelineParams }

A collection of conversion pipelines, indexed by pipeline name. Each pipeline defines how input data is processed and converted into output formats.

Methods

  • Clears all pipeline configurations within this ModelConverter instance.

    After calling this method, the converter will not have any conversion pipelines configured. You will need to call setConfigs to add new pipelines before calling convert.

    Returns void

  • Transforms 3D model data using a specified conversion pipeline.

    This method loads the given input file data, constructs scene and data models, and then writes the converted output using the configured exporters.

    Parameters

    Returns Promise<ModelConverterResult>

    A promise that resolves to a ModelConverterResult object containing the output files.

    If required parameters are missing or if an unsupported pipeline is specified.