@twinfinity/core
    Preparing search index...

    Class GeometryMemoryBlock

    Represents a memory block for storing geometry data. That is vertices, normals and indices.

    Index

    Constructors

    Accessors

    • get byteSize(): number

      Gets the size of the memory block in bytes.

      Returns number

      The size of the memory block in bytes.

    Methods

    • Retrieves the vertex data for a given BimProductMeshDescriptor.

      Parameters

      Returns undefined | BimVertexData

      The BimVertexData associated with the given mesh descriptor. undefined if the mesh descriptor is not found.

    • Imports packed vertex data from V2 (.t8gd) format into the geometry memory block.

      Parameters

      • fileReader: T8gdReader

        The T8gdReader for file-level operations (hash lookup).

      • meshDescriptors: (undefined | BimProductMeshDescriptor)[]

        The mesh descriptors containing information about which meshes to load. Mesh descriptors that are already imported are ignored (so we never store duplicated data).

      Returns Promise<void>

      A Promise that resolves when the vertex data is imported.

    • Removes a cached vertex data entry by hash so it can be re-imported with better data. The old data remains allocated in the parent MemoryBlock buffer but becomes unreachable through the cache. This only happens during initial loading when welded geometry replaces unwelded geometry for the same hash, so the leaked allocations are bounded and small relative to the total geometry budget. Compacting the MemoryBlock is not worth the cost.

      Parameters

      • hash: string

      Returns boolean

    • Resets the GeometryMemoryBlock freeing all the used memory. It is safe to call importPackedVertexData after calling this method.

      Returns void