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

# Dimension geometry

> Calculate the lines, terminators and text of one dimension.

## Import

```typescript theme={null}
import {
  dimensionGeometry,
  measureDimension,
  resolveMeasure,
  resolveAngular,
  resolveRadial,
  leaderGeometry,
  terminatorGeometry,
} from '@opengeometry/floorkit';
```

## dimensionGeometry

Resolve a linear dimension to vector lines + a label (paper mm).

```typescript theme={null}
function dimensionGeometry(dimension: DimensionInput, style?: DimensionStyle): AnnotationGeometry;
```

## measureDimension

Build a viewport-linked dimension between two saved model points (metres).

```typescript theme={null}
function measureDimension(
  from: Point2,
  to: Point2,
  viewportId: string,
  options: MeasureOptions,
): MeasureAnnotation;
```

## resolveMeasure

Resolve a MeasureAnnotation to vector geometry at render time, using the SAME `viewportTransform` the viewport's drawing uses — so witness lines use the same transform as the drawing.

```typescript theme={null}
function resolveMeasure(
  annotation: MeasureAnnotation,
  viewport: Viewport,
  drawing: VectorDrawing,
  system?: UnitSystem,
): AnnotationGeometry;
```

## resolveAngular

Resolve an AngularMeasureAnnotation at render time.

```typescript theme={null}
function resolveAngular(
  annotation: AngularMeasureAnnotation,
  viewport: Viewport,
  drawing: VectorDrawing,
): AnnotationGeometry;
```

## resolveRadial

Resolve a RadialMeasureAnnotation at render time.

```typescript theme={null}
function resolveRadial(
  annotation: RadialMeasureAnnotation,
  viewport: Viewport,
  drawing: VectorDrawing,
  system?: UnitSystem,
): AnnotationGeometry;
```

## leaderGeometry

Resolve a leader (polyline + arrowhead + text) to vector lines + a label (paper mm).

```typescript theme={null}
function leaderGeometry(leader: LeaderInput, style?: LeaderStyle): AnnotationGeometry;
```

## terminatorGeometry

One terminator at `at`, opening back along `inward`.

```typescript theme={null}
function terminatorGeometry(
  kind: TerminatorKind,
  at: Point2,
  inward: Point2,
  sizeMm: number,
): TerminatorGeometry;
```

## Types

### DimensionInput

The package does not export this type by name.

```typescript theme={null}
interface DimensionInput {
  start: Point2;
  end: Point2;
  offset: number;
  label?: string;
  fontSize: number;
}
```

<ResponseField name="start" type="Point2" required />

<ResponseField name="end" type="Point2" required />

<ResponseField name="offset" type="number" required>
  Perpendicular offset of the dimension line from the start→end segment.
</ResponseField>

<ResponseField name="label" type="string">
  Override text; defaults to the measured paper distance.
</ResponseField>

<ResponseField name="fontSize" type="number" required />

### DimensionStyle

The package does not export this type by name.

```typescript theme={null}
interface DimensionStyle extends StrokeStyle {
  tickLength?: number;
  terminator?: TerminatorKind;
}
```

<ResponseField name="tickLength" type="number">
  Terminator half-length in paper mm. Defaults to `fontSize * 0.5`.
</ResponseField>

<ResponseField name="terminator" type="TerminatorKind">
  Which mark to draw at each end. Defaults to "slash" — the architectural convention this package
  has always drawn, and the only one it could.
</ResponseField>

### AnnotationGeometry

The vector primitives an annotation resolves to (paper mm).

The package does not export this type by name.

```typescript theme={null}
interface AnnotationGeometry {
  lines: VectorLine[];
  label: VectorText;
  fills?: DrawingLoop[];
}
```

<ResponseField name="lines" type="VectorLine[]" required />

<ResponseField name="label" type="VectorText" required />

<ResponseField name="fills" type="DrawingLoop[]">
  Solid areas — a filled arrowhead, a dot terminator. Absent for annotations drawn entirely in
  stroke, which is every one this package emitted before terminators became configurable.
</ResponseField>

### Point2

2D point in the extractor's output.

```typescript theme={null}
type Point2 = PlanVectorPoint;
```

### UnitSystem

Drawing scales: the named ratios a technical drawing is actually plotted at, and the one formatter that turns a ratio into the label printed on the sheet.

```typescript theme={null}
type UnitSystem = 'metric' | 'imperial';
```

### AngularMeasureAnnotation

A viewport-linked angular dimension: `vertex`/`from`/`to` are saved points in the viewport's **model** space (metres).

The package does not export this type by name.

```typescript theme={null}
interface AngularMeasureAnnotation {
  id: string;
  kind: 'angular';
  styleId?: string;
  viewportId: string;
  vertex: Point2;
  from: Point2;
  to: Point2;
  radius: number;
  fontSize: number;
  precision?: number;
  label?: string;
}
```

<ResponseField name="id" type="string" required />

<ResponseField name="kind" type="&#x22;angular&#x22;" required />

<ResponseField name="styleId" type="string">
  Named style in `PaperDocument.dimensionStyles`. Absent uses the default.
</ResponseField>

<ResponseField name="viewportId" type="string" required />

<ResponseField name="vertex" type="Point2" required>
  Angle vertex (model metres).
</ResponseField>

<ResponseField name="from" type="Point2" required>
  A point along the first ray (model metres).
</ResponseField>

<ResponseField name="to" type="Point2" required>
  A point along the second ray (model metres).
</ResponseField>

<ResponseField name="radius" type="number" required>
  Arc radius in paper mm (annotation scale, zoom/scale-independent).
</ResponseField>

<ResponseField name="fontSize" type="number" required />

<ResponseField name="precision" type="number">
  Decimal places on the degree value. Default 0.
</ResponseField>

<ResponseField name="label" type="string">
  Optional label override; default = measured angle in degrees.
</ResponseField>

### RadialMeasureAnnotation

A viewport-linked radial dimension: `center`/`edge` are saved points in a viewport's **model** space (metres), typically an arc/circle centre and edge.

The package does not export this type by name.

```typescript theme={null}
interface RadialMeasureAnnotation {
  id: string;
  kind: 'radial';
  styleId?: string;
  viewportId: string;
  center: Point2;
  edge: Point2;
  mode: 'radius' | 'diameter';
  fontSize: number;
  precision?: number;
  label?: string;
}
```

<ResponseField name="id" type="string" required />

<ResponseField name="kind" type="&#x22;radial&#x22;" required />

<ResponseField name="styleId" type="string">
  Named style in `PaperDocument.dimensionStyles`. Absent uses the default.
</ResponseField>

<ResponseField name="viewportId" type="string" required />

<ResponseField name="center" type="Point2" required>
  Arc/circle centre (model metres).
</ResponseField>

<ResponseField name="edge" type="Point2" required>
  A point on the arc/circle (model metres); `|edge − center|` is the radius.
</ResponseField>

<ResponseField name="mode" type="&#x22;radius&#x22; | &#x22;diameter&#x22;" required>
  `radius` → "R…"; `diameter` → "⌀…" (line spans through the centre).
</ResponseField>

<ResponseField name="fontSize" type="number" required />

<ResponseField name="precision" type="number">
  Decimal places on the measured mm value. Default 0.
</ResponseField>

<ResponseField name="label" type="string">
  Optional label override; default = measured radius/diameter in mm.
</ResponseField>

### LeaderInput

The package does not export this type by name.

```typescript theme={null}
interface LeaderInput {
  target: Point2;
  points: Point2[];
  text: string;
  fontSize: number;
}
```

<ResponseField name="target" type="Point2" required>
  Arrow tip — points at the thing being annotated.
</ResponseField>

<ResponseField name="points" type="Point2[]" required>
  Knee points from the target to the text anchor (last point).
</ResponseField>

<ResponseField name="text" type="string" required />

<ResponseField name="fontSize" type="number" required />

### LeaderStyle

The package does not export this type by name.

```typescript theme={null}
interface LeaderStyle extends StrokeStyle {
  arrowLength?: number;
  arrowAngleDeg?: number;
}
```

<ResponseField name="arrowLength" type="number">
  Arrowhead barb length in paper mm. Defaults to `fontSize`.
</ResponseField>

<ResponseField name="arrowAngleDeg" type="number">
  Half-angle of the arrowhead in degrees. Defaults to 20.
</ResponseField>

### TerminatorKind

```typescript theme={null}
type TerminatorKind = 'slash' | 'arrow' | 'open-arrow' | 'dot' | 'none';
```

### TerminatorGeometry type

A terminator's ink: stroked lines plus any filled loops.

The package does not export this type by name.

```typescript theme={null}
interface TerminatorGeometry {
  lines: VectorLine[];
  fills: DrawingLoop[];
}
```

<ResponseField name="lines" type="VectorLine[]" required />

<ResponseField name="fills" type="DrawingLoop[]" required>
  Solid areas — a filled arrowhead or a dot. Empty for stroked kinds.
</ResponseField>

### StrokeStyle

Shared stroke styling for annotation lines (paper mm).

The package does not export this type by name.

```typescript theme={null}
interface StrokeStyle {
  strokeColor?: PlanVectorColor;
  strokeWidth?: number;
}
```

### PlanVectorPoint

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

### PlanVectorColor

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

## Related

* [`DrawingLoop`](/floorkit/api/drawings/draw-project-view#drawingloop)
* [`MeasureAnnotation`](/floorkit/api/annotations/dimension-strings#measureannotation)
* [`MeasureOptions`](/floorkit/api/annotations/dimension-strings#measureoptions)
* [`VectorDrawing`](/floorkit/api/drawings/draw-project-view#vectordrawing)
* [`VectorLine`](/floorkit/api/drawings/draw-project-view#vectorline)
* [`VectorText`](/floorkit/api/drawings/draw-project-view#vectortext)
* [`Viewport`](/floorkit/api/drawings/sheet-documents#viewport)


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