# Class WasmGeometryProcessor

##### Index

### Constructors

constructor

### Methods

addGeometryBuffer
addGeometryBufferLegacy
clearCache
deflate
dispose
getMemoryUsage
getMeshDescriptorByHash
getOrCreateUrlId
processBatchInto
readEdges
registerTransforms

## Constructors

### constructor

- new WasmGeometryProcessor(
  module: TwinfinityMeshStore,
  blobUrl?: string,
  ): WasmGeometryProcessor

  #### Parameters

  - module: TwinfinityMeshStore
  - `Optional` blobUrl: string

  #### Returns WasmGeometryProcessor

## Methods

### addGeometryBuffer

- addGeometryBuffer(
  buffer: ArrayBuffer,
  descriptors: { hash: string; indexCount: number; vertexCount: number }[],
  ): boolean

  #### Parameters

  - buffer: ArrayBuffer
  - descriptors: { hash: string; indexCount: number; vertexCount: number }[]

  #### Returns boolean

### addGeometryBufferLegacy

- addGeometryBufferLegacy(
  buffer: ArrayBuffer,
  descriptors: MeshDescriptorV1[],
  ): void

  #### Parameters

  - buffer: ArrayBuffer
  - descriptors: MeshDescriptorV1[]

  #### Returns void

### clearCache

- clearCache(): void

  #### Returns void

### deflate

- deflate(
  hash: Uint8Array,
  maxVertexCount: number,
  maxIndexCount: number,
  isV2Format: boolean,
  ):
  | undefined
  | { indices: Uint32Array; normals: Uint16Array; positions: Float32Array }

  #### Parameters

  - hash: Uint8Array
  - maxVertexCount: number
  - maxIndexCount: number
  - isV2Format: boolean

  #### Returns
  | undefined
  | { indices: Uint32Array; normals: Uint16Array; positions: Float32Array }

### dispose

- dispose(): void

  #### Returns void

### getMemoryUsage

- getMemoryUsage(): {
  allocated: number;
  capacity: number;
  outputBuffers: number;
  used: number;
  }

  #### Returns { allocated: number; capacity: number; outputBuffers: number; used: number }

### getMeshDescriptorByHash

- getMeshDescriptorByHash(hash: string): undefined | MeshDescriptor

  #### Parameters

  - hash: string

  #### Returns undefined | MeshDescriptor

### getOrCreateUrlId

- getOrCreateUrlId(indexUrl: string): number

  #### Parameters

  - indexUrl: string

  #### Returns number

### processBatchInto

- processBatchInto(
  requests: MergeRequest[],
  destination: ProcessBatchDestination,
  ): undefined | ProcessBatchIntoResult

  #### Parameters

  - requests: MergeRequest[]
  - destination: ProcessBatchDestination

  #### Returns undefined | ProcessBatchIntoResult

### readEdges

- readEdges(binaryHash: Uint8Array): undefined | Uint32Array<ArrayBufferLike>

  #### Parameters

  - binaryHash: Uint8Array

  #### Returns undefined | Uint32Array<ArrayBufferLike>

### registerTransforms

- registerTransforms(
  url: string,
  transforms: readonly (undefined | TransformData)[],
  ): void

  #### Parameters

  - url: string
  - transforms: readonly (undefined | TransformData)[]

  #### Returns void