Interface that all of display objects need to implement.

interface AcGiEntity {
    get basePoint(): undefined | AcGePoint3d;
    set basePoint(value: undefined | AcGePoint3d): void;
    get layerName(): string;
    set layerName(value: string): void;
    get objectId(): string;
    set objectId(value: string): void;
    get ownerId(): string;
    set ownerId(value: string): void;
    get userData(): object;
    set userData(value: object): void;
    get visible(): boolean;
    set visible(value: boolean): void;
    addChild(child: AcGiEntity): void;
    applyMatrix(matrix: AcGeMatrix3d): void;
    bakeTransformToChildren(): void;
    fastDeepClone(): AcGiEntity;
    highlight(): void;
    unhighlight(): void;
}

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 layerName(): string
  • The name of the layer referenced by this entity

    Returns string

  • set layerName(value: string): void
  • Parameters

    • value: string

    Returns void

  • get objectId(): string
  • Object id of the associated entity in drawing database. When adding this entity into scene, do remember setting the value of this property.

    Returns string

  • set objectId(value: string): void
  • Parameters

    • value: string

    Returns void

  • get ownerId(): string
  • The object Id of the owner of the object. When adding this entity into scene, do remember setting the value of this property.

    Returns string

  • set ownerId(value: string): void
  • Parameters

    • value: string

    Returns void

  • get userData(): object
  • An object that can be used to store custom data about the entity.

    Returns object

  • set userData(value: object): void
  • Parameters

    • value: object

    Returns void

  • get visible(): boolean
  • Object's visibility

    Returns boolean

  • set visible(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

Methods

  • Apply the matrix transform to the object and updates the object's position, rotation and scale.

    Parameters

    Returns void

  • Bakes the current object's transformation into all of its children and resets the object itself to an identity transform.

    After calling this function:

    • All children preserve their world-space appearance.
    • The object's local matrix and world matrix become identity.
    • The scene hierarchy remains unchanged.

    This is useful for freezing transforms, flattening transform hierarchies, or ensuring newly added children are not affected by previous transforms.

    Returns void

  • Return a clone of this object and its direct children (not all descendants). So it means that you need to gurantee the object is flatten by call method 'flatten' before calling this function. This function will deeply clone geometry in this object. But materials are reused directly and not deeply cloned.

    Returns AcGiEntity

    Return a clone of this object and optionally all descendants.

  • Unhighlight this entity

    Returns void