brepjs API Reference
    Preparing search index...

    Function importThreeMF

    • Import a 3MF file from a Blob.

      Extracts the model XML from the ZIP archive and builds a shape per placed object by sewing its triangles as importSTL sews a file: a Solid per closed body, a Shell per open one, and each sealed cavity cut from the body around it. Build-item and component transforms are applied, and coordinates are scaled from the model unit to millimeters.

      Parameters

      • blob: Blob

        A Blob or File containing 3MF data (.3mf).

      Returns Promise<Result<UnknownDimShape>>

      A Result wrapping the imported shape (a Compound when the build places several objects or an object holds several bodies), or an error if parsing fails or the build expands to more than 100,000 placed objects or 2,000,000 triangles.

      const file = new File([data], 'model.3mf');
      const shape = unwrap(await importThreeMF(file));