bitbybit.dev v1.0.0-rc.1
    Preparing search index...

    Class OCCTWIO

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • occWorkerManager: OCCTWorkerManager
      • context: ContextBase

      Returns OCCTWIO

    Properties

    occWorkerManager: OCCTWorkerManager

    assembly

    • Convert a STEP file to glTF format (binary GLB).

      Uses OCCT's native RWGltf_CafWriter for fast conversion with full preservation of:

      • Assembly hierarchy (as glTF node tree)
      • Instance/product names
      • Surface colors and materials
      • Transformations

      The coordinate system is automatically converted from OCCT (Z-up) to glTF (Y-up).

      Parameters

      • inputs: ConvertStepToGltfDto

        STEP file content and mesh precision settings. Accepts File, Blob, string, ArrayBuffer, or Uint8Array.

      Returns Promise<Uint8Array>

      GLB binary data as Uint8Array (can be used directly with Three.js, Babylon.js, etc.)

      step to gltf

      false

    • Convert a STEP file to glTF format with full control over all options.

      This advanced method allows fine-grained control over:

      • STEP reading options (colors, names, materials, layers, props)
      • Mesh generation options (deflection, angle, parallel, threshold)
      • glTF options (merge faces, indices, naming, transforms)

      Use this for performance tuning - disable features you don't need for faster processing.

      Parameters

      Returns Promise<Uint8Array>

      GLB binary data as Uint8Array

      step to gltf advanced

      false

      // Fast conversion - only colors, no names (for large files)
      const glbData = await occt.io.convertStepToGltfAdvanced({
      stepData: stepContent,
      readColors: true,
      readNames: false, // Skip name parsing for speed
      readMaterials: true,
      readLayers: false,
      readProps: false,
      meshDeflection: 0.1,
      meshParallel: true,
      mergeFaces: true
      });
    • Parse a STEP file and return the assembly structure as JSON.

      Uses OCCT's native XCAFPrs_DocumentExplorer for efficient traversal. Runs entirely in C++ for maximum performance.

      Returns an object containing an array of nodes with:

      • id: Unique path identifier for each node
      • name: Part or assembly name
      • isAssembly: Whether this is an assembly node (has children)
      • visible: Visibility flag
      • color: Surface color (if set) with r, g, b, a components
      • transform: 4x4 transformation matrix in column-major order (if not identity)

      Parameters

      Returns Promise<AssemblyJsonResult>

      Parsed assembly structure

      parse step to json

      false

    dxf

    • Adds layer and color information to DXF paths Important - shapes containing wires must lie on XZ plane (Y=0) for correct 2D DXF export.

      Parameters

      Returns Promise<DxfPathsPartDto>

      dxf paths with layer

      false

    • Assembles multiple path parts into a complete DXF file. Important - shapes containing wires must lie on XZ plane (Y=0) for correct 2D DXF export.

      Parameters

      Returns Promise<string>

      dxf create

      false

    io