# Struct3D

The 3D Viewer component for StructuresJSON collections.

## Installation

```
npm install @team-geospan/struct3d
```

## Usage

The docs contain a [great example](./docs/src/pages/demo.jsx).

The demo is [also live on GitHub pages](https://team-geospan.github.io/struct3d/).

## Boundary layers

`StructureThreeD` accepts an optional `boundaryLayers` array for CRS84 parcel or
site outlines. Each layer must have a stable supplied `id`, `geoid`,
`projection: "crs84"`, and GeoJSON `Polygon` or `MultiPolygon` `geometry`.
Layers may also set `visible`, `offset`, `style`, and `selectedStyle`; styles
accept `color` and `opacity`. Boundary coordinates use the structure anchor
(or the valid `anchorStructureCollection` fallback) and render at the viewer's
fixed base elevation plus the optional offset.

Boundary layers are non-selectable, remain visible when `showStructures` is
false, and are independent of mesh `visibleLayers`. They are excluded from
camera fitting. A `boundary-root` is always created for the synchronous vector
layout pass. If non-empty input produces no renderable boundaries because its
Structure anchor, Polygon geometry, or coordinates are invalid for the
renderer, the optional `onBoundaryRenderError(error)` callback runs once. Empty
input and valid hidden layers do not trigger the callback.

## License

Apache 2.0. Availabe in [LICENSE](./LICENSE).
