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

Methods

  • Create one group

    Parameters

    • entities: T[]

      Input entities to group together

    Returns T

    Return created group

  • 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