> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ploterr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# View frames

> Convert a point between the model and the frame of a plan, section or elevation.

## Import

```typescript theme={null}
import {
  viewFrameForPlan,
  viewFrameForSection,
  viewFrameForElevation,
  viewFrameForCamera,
  modelToView,
  viewToModel,
} from '@opengeometry/floorkit';
```

## viewFrameForPlan

A horizontal plan: +X right, +Z down, looking along -Y.

```typescript theme={null}
function viewFrameForPlan(storeyElevation: number, cutHeightAboveStorey: number): ViewFrame;
```

## viewFrameForSection

A vertical section.

```typescript theme={null}
function viewFrameForSection(line: SectionLine, lookSide: 'left' | 'right'): ViewFrame;
```

## viewFrameForElevation

A vertical elevation; lookDirection points from the view plane into the model.

```typescript theme={null}
function viewFrameForElevation(origin: WorldXZ, lookDirection: WorldXZ): ViewFrame;
```

## viewFrameForCamera

An orthographic camera frame with its target as the model-space origin.

```typescript theme={null}
function viewFrameForCamera(camera: Camera): ViewFrame;
```

## modelToView

Project one world point into right/down/depth coordinates in metres.

```typescript theme={null}
function modelToView(frame: ViewFrame, worldPoint: Point3D): ViewPoint;
```

## viewToModel

Recover a world point from right/down/depth coordinates in metres.

```typescript theme={null}
function viewToModel(frame: ViewFrame, viewPoint: ViewPoint): Point3D;
```

## Types

### SectionLine

The package does not export this type by name.

```typescript theme={null}
type SectionLine = {
  start: WorldXZ;
  end: WorldXZ;
};
```

### WorldXZ

The package does not export this type by name.

```typescript theme={null}
type WorldXZ = [number, number];
```

### Camera

The package does not export this type by name.

```typescript theme={null}
type Camera = {
  position: Point3D;
  target: Point3D;
  up: Point3D;
};
```

### Point3D

```typescript theme={null}
interface Point3D {
  x: number;
  y: number;
  z: number;
}
```

### ViewPoint

Coordinates in a view frame.

```typescript theme={null}
interface ViewPoint {
  x: number;
  y: number;
  depth: number;
}
```

## Related

* [`ViewFrame`](/floorkit/api/drawings/drawing-helpers#viewframe)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.