MLightCAD
    Preparing search index...

    Utility class for converting CAD drawings to PNG format.

    This class provides functionality to export the current CAD drawing to PNG format and download it as a file. It renders the current view using WebGLRenderTarget for optimal performance without requiring preserveDrawingBuffer to be enabled on the renderer.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Converts the current CAD drawing to PNG format and initiates download.

      This method:

      • Retrieves the current view, renderer, scene, and camera
      • Creates a WebGLRenderTarget for offscreen rendering
      • Renders the scene to the render target
      • Reads pixel data and flips it vertically to correct WebGL's upside-down rendering
      • Creates a canvas with the pixel data
      • Exports as PNG and downloads with timestamp-based filename

      Parameters

      • Optionalbounds: AcGeBox2d

        Optional world coordinate bounding box to export. If provided, the camera will zoom to fit this region. If not provided, exports the current view.

      • OptionallongSide: number

        Optional maximum dimension (width or height) in pixels.

      Returns void