> ## 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.

# Scales and units

> Standard drawing scales and conversion between millimetres, points and pixels.

## Import

```typescript theme={null}
import {
  scalesFor,
  scaleById,
  nearestStandardScale,
  METRIC_SCALES,
  IMPERIAL_SCALES,
  mmToPdfPoints,
  pdfPointsToMm,
  mmToScreen,
  screenToMm,
} from '@opengeometry/floorkit';
```

## scalesFor

Every scale offered for a unit system — the list a scale picker renders.

```typescript theme={null}
function scalesFor(system: UnitSystem): NamedScale[];
```

## scaleById

Look a registered scale up by the id stored in `Viewport.scaleId`.

```typescript theme={null}
function scaleById(id: string): NamedScale | undefined;
```

## nearestStandardScale

The registered scale matching a ratio in a given system, if there is one.

```typescript theme={null}
function nearestStandardScale(ratio: number, system?: UnitSystem): NamedScale | undefined;
```

## METRIC\_SCALES

ISO 5455 reductions plus the enlargements, and the intermediate architectural scales (1:25, 1:1250, 1:2500) that practice uses alongside them.

```typescript theme={null}
const METRIC_SCALES: NamedScale[];
```

## IMPERIAL\_SCALES

```typescript theme={null}
const IMPERIAL_SCALES: NamedScale[];
```

## mmToPdfPoints

Millimetres → PDF points (1 pt = 1/72 inch).

```typescript theme={null}
function mmToPdfPoints(mm: number): number;
```

## pdfPointsToMm

PDF points → millimetres.

```typescript theme={null}
function pdfPointsToMm(points: number): number;
```

## mmToScreen

Millimetres → screen pixels at a given pixels-per-mm zoom.

```typescript theme={null}
function mmToScreen(mm: number, pixelsPerMm: number): number;
```

## screenToMm

Screen pixels → millimetres at a given pixels-per-mm zoom.

```typescript theme={null}
function screenToMm(pixels: number, pixelsPerMm: number): number;
```

## Types

### NamedScale

A scale a drawing is plotted at, as both a ratio and the way it is written.

```typescript theme={null}
interface NamedScale {
  id: string;
  label: string;
  ratio: number;
  system: UnitSystem;
}
```

<ResponseField name="id" type="string" required>
  Stable key stored in `Viewport.scaleId`, e.g. "1:50" or "1/4in=1ft". Written out rather than
  derived from the label, so it stays readable and cannot collide as the ladder grows.
</ResponseField>

<ResponseField name="label" type="string" required>
  How the scale is written on the sheet.
</ResponseField>

<ResponseField name="ratio" type="number" required>
  Dimensionless paper ÷ real ratio. 1:50 → 0.02.
</ResponseField>

<ResponseField name="system" type="UnitSystem" required />

## Related

* [`UnitSystem`](/floorkit/api/annotations/dimension-geometry#unitsystem)


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