interface AcGiRenderer<T extends AcGiEntity = AcGiEntity> {
    get basePoint(): undefined | AcGePoint3d;
    set basePoint(value: undefined | AcGePoint3d): void;
    get subEntityTraits(): AcGiSubEntityTraits;
    area(area: AcGeArea2d): T;
    circularArc(arc: AcGeCircArc3d): T;
    ellipticalArc(ellipseArc: AcGeEllipseArc3d): T;
    group(entities: T[]): T;
    image(blob: Blob, style: AcGiImageStyle): T;
    lines(points: AcGeVector3dLike[]): T;
    lineSegments(
        array: Float32Array,
        itemSize: number,
        indices: Uint16Array,
    ): T;
    mtext(mtext: AcGiMTextData, style: AcGiTextStyle, delay?: boolean): T;
    point(point: AcGePoint3d, style: AcGiPointStyle): T;
    setFontMapping(mapping: AcGiFontMapping): void;
}

Type Parameters

Accessors

  • get basePoint(): undefined | AcGePoint3d
  • JavaScript (and WebGL) use 64‑bit floating point numbers for CPU-side calculations, but GPU shaders typically use 32‑bit floats. A 32-bit float has ~7.2 decimal digits of precision. If passing 64-bit floating vertices data to GPU directly, it will destroy number preciesion.

    So we adopt a simpler but effective version of the “origin-shift” idea. Recompute geometry using re-centered coordinates and apply offset to its position. The base point is extractly offset value.

    Get the rendering base point.

    Returns undefined | AcGePoint3d

    Return the rendering base point.

  • set basePoint(value: undefined | AcGePoint3d): void
  • Parameters

    Returns void

  • get subEntityTraits(): AcGiSubEntityTraits
  • The entity traits object gives the user control of, and access to, the attribute (color, layer, linetype, etc.) settings of the current geometry.

    Returns AcGiSubEntityTraits

Methods

  • Draw one area

    Parameters

    Returns T

    Return an object which can be added to scene

  • Draw a circular arc or full circle.

    Parameters

    Returns T

    Return an object which can be added to scene

  • Draw an elliptical arc or full ellipse.

    Parameters

    Returns T

    Return an object which can be added to scene

  • Create one group

    Parameters

    • entities: T[]

      Input entities to group together

    Returns T

    Return created group

  • Draw image

    Parameters

    • blob: Blob

      Input Blob instance of one image file

    • style: AcGiImageStyle

      Input image style

    Returns T

    Return an object which can be added to scene

  • Draw lines using gl.LINE_STRIP.

    Parameters

    Returns T

    Return an object which can be added to scene

  • Draw lines using gl.LINES.

    Parameters

    • array: Float32Array

      Must be a TypedArray. Used to instantiate the buffer. This array should have itemSize * numVertices elements, where numVertices is the number of vertices.

    • itemSize: number

      The number of values of the array that should be associated with a particular vertex. If the vertex is one 2d point, then itemSize should be 2. If the vertex is one 3d point, then itemSize should be 3.

    • indices: Uint16Array

      Index buffer.

    Returns T

    Return an object which can be added to scene

  • Draw multiple line texts

    Parameters

    • mtext: AcGiMTextData

      Input multiple line text data to draw

    • style: AcGiTextStyle

      Input text style applied to the text string

    • Optionaldelay: boolean

      The flag to delay creating one rendered entity and just create one dummy entity. Renderer can delay heavy calculation operation to avoid blocking UI when this flag is true.

    Returns T

    Return an object which can be added to scene

  • Draw a point.

    Parameters

    Returns T

    Return an object which can be added to scene

  • Set font mapping

    Parameters

    Returns void