# Class BimGeometricFeaturesRepository

##### Index

### Constructors

constructor

### Properties

_geometricFeaturesReader
_isGeometricFeaturesUrlAdded

### Methods

assignGeometricFeaturesToProducts
clear
populateFromVertexDataRepository
resolveEdgesForMesh
setDecodedFeatures

## Constructors

### constructor

- new BimGeometricFeaturesRepository(
  _bimApi?: BimCoreApiClient,
  ): BimGeometricFeaturesRepository

  #### Parameters

  - `Optional`_bimApi: BimCoreApiClient

  #### Returns BimGeometricFeaturesRepository

## Properties

### `Readonly`_geometricFeaturesReader

_geometricFeaturesReader: BimGeometricFeaturesReader = ...

### `Readonly`_isGeometricFeaturesUrlAdded

_isGeometricFeaturesUrlAdded: Map<string, Promise<boolean>> = ...

## Methods

### assignGeometricFeaturesToProducts

- assignGeometricFeaturesToProducts(geometricFeaturesUrl: URL): Promise<boolean>

  #### Parameters

  - geometricFeaturesUrl: URL

  #### Returns Promise<boolean>

### clear

- clear(): void

  #### Returns void

### populateFromVertexDataRepository

- populateFromVertexDataRepository(
  products: readonly BimIfcObject[],
  vertexDataRepository: BimVertexDataRepository,
  ): void

  Populate the repository by reading edge indices out of the t8gd buffer managed by the vertex data repository. Edges in t8gd reference the position-deduplicated vertex array — the same array exposed by `BimVertexDataRepository.get` for V2 format — so the indices match the positions used at render time.

  Use this in place of assignGeometricFeaturesToProducts whenever the geometry resource is `.t8gd`. The `.geom-feat` file's edge indices are in the welded-vertex space which does NOT match the t8gd deduplicated layout.

  #### Parameters

  - products: readonly BimIfcObject[]
  - vertexDataRepository: BimVertexDataRepository

  #### Returns void

### resolveEdgesForMesh

- resolveEdgesForMesh(mesh: BimProductMesh): undefined | FlatSegment3[]

  Resolve feature edges for a single mesh on demand. Looks up the mesh's geometry hash in the decoded feature data, resolves vertex indices to world-space coordinates, and caches the result on the mesh as FlatSegment3 tuples — the format consumed directly by `CreateGreasedLine`.

  Returns the edges, or undefined if no feature data exists for this mesh.

  #### Parameters

  - mesh: BimProductMesh

  #### Returns undefined | FlatSegment3[]

### setDecodedFeatures

- setDecodedFeatures(hash: string, features: DecodedGeometricFeatures): void

  Inject pre-decoded feature data for a mesh hash (used by the T8 loader which reads edges from t8gd).

  #### Parameters

  - hash: string
  - features: DecodedGeometricFeatures

  #### Returns void