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

# Drawing helpers

> Read, measure and convert drawing primitives.

## Import

```typescript theme={null}
import {
  extractPhysicalWallPlan,
  projectWorldLinework,
  drawingFromProfile,
  toLines,
  boundsOfPrimitives,
  boundaryPoint,
  boundaryBoundsPoints,
  arcSegmentCount,
  validateCurvedRegion,
  flattenCurvedRegion,
  createLiveSourceResolver,
  DEFAULT_ISOMETRIC_CAMERA,
  DEFAULT_ISOMETRIC_HLR,
} from '@opengeometry/floorkit';
```

## extractPhysicalWallPlan

Extract actual horizontal sections of straight planar wall bodies in metres.

```typescript theme={null}
function extractPhysicalWallPlan(
  walls: readonly Wall[],
  worldCutY: number,
  options?: PhysicalWallPlanOptions,
): VectorDrawing;
```

## projectWorldLinework

Orthographically project supplied 3D segments into right/down drawing metres.

```typescript theme={null}
function projectWorldLinework(
  frame: ViewFrame,
  segments: readonly WorldLineSegment[],
): VectorDrawing;
```

## drawingFromProfile

Wrap an element's editable `profile` (a closed cross-section ring + holes, in `[x, z]`) as a single-region VectorDrawing so the 2D engine can render and edit it with the SAME path it uses for plan footprints — i.e.

```typescript theme={null}
function drawingFromProfile(profile: Profile, ogType: string, ogid: string): VectorDrawing;
```

## toLines

Tessellate the standardized primitive vocabulary down to flat line segments: line → 1 segment; arc → N segments; region → outer + hole boundary segments; polyline → its segments (plus the closing one when `closed`); text → none.

```typescript theme={null}
function toLines(
  primitives: DrawingPrimitive[],
  options?: {
    arcSegments?: number;
    deflection?: number;
  },
): VectorLine[];
```

## boundsOfPrimitives

Bounds include analytic arc extrema and text anchors, without tessellation.

```typescript theme={null}
function boundsOfPrimitives(primitives: DrawingPrimitive[]): PlanVectorBounds;
```

## boundaryPoint

```typescript theme={null}
function boundaryPoint(boundary: DrawingBoundary, end?: boolean): Point2;
```

## boundaryBoundsPoints

Includes all angular extrema within a signed sweep, without sampling.

```typescript theme={null}
function boundaryBoundsPoints(boundary: DrawingBoundary): Point2[];
```

## arcSegmentCount

```typescript theme={null}
function arcSegmentCount(arc: DrawingArc, deflection: number): number;
```

## validateCurvedRegion

```typescript theme={null}
function validateCurvedRegion(region: DrawingCurvedRegion): void;
```

## flattenCurvedRegion

Explicit polygon approximation for consumers that require point rings.

```typescript theme={null}
function flattenCurvedRegion(region: DrawingCurvedRegion, deflection: number): DrawingRegion;
```

## createLiveSourceResolver

Build a lookup for the current compilation.

```typescript theme={null}
function createLiveSourceResolver(
  sourceByLiveId: ReadonlyMap<string, BuildingSourceRef>,
): (source: DrawingSourceRef) => string | undefined;
```

## DEFAULT\_ISOMETRIC\_CAMERA

```typescript theme={null}
const DEFAULT_ISOMETRIC_CAMERA: PlanProjectionCamera;
```

## DEFAULT\_ISOMETRIC\_HLR

```typescript theme={null}
const DEFAULT_ISOMETRIC_HLR: PlanProjectionHlr;
```

## Types

### PhysicalWallPlanOptions

```typescript theme={null}
interface PhysicalWallPlanOptions {
  sourceByLiveId?: ReadonlyMap<string, BuildingSourceRef>;
}
```

<ResponseField name="sourceByLiveId" type="ReadonlyMap<string, BuildingSourceRef>">
  Actual compiler registry; only supplied wall identities become selectable.
</ResponseField>

### ViewFrame

Orthographic frame in metres.

```typescript theme={null}
interface ViewFrame {
  origin: Point3D;
  horizontal: Point3D;
  downward: Point3D;
  look: Point3D;
}
```

### WorldLineSegment

A caller-supplied world-space segment and its independent drawing metadata.

```typescript theme={null}
interface WorldLineSegment {
  start: Point3D;
  end: Point3D;
  sourceRef?: DrawingSourceRef;
  style?: DrawingStyle;
  generatedCut?: boolean;
}
```

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

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

<ResponseField name="sourceRef" type="DrawingSourceRef">
  Saved feature identity and interaction policy; never inferred from style.
</ResponseField>

<ResponseField name="style" type="DrawingStyle" />

<ResponseField name="generatedCut" type="boolean">
  The caller identifies generated cut linework; this helper does not find cuts.
</ResponseField>

### PlanProjectionCamera

```typescript theme={null}
interface PlanProjectionCamera {
  position: Point3D;
  target: Point3D;
  up: Point3D;
  near: number;
  projection_mode: 'Orthographic' | 'Perspective';
}
```

### PlanProjectionHlr

```typescript theme={null}
interface PlanProjectionHlr {
  hide_hidden_edges: boolean;
}
```

## Related

* [`Wall`](/floorkit/api/architecture/wall)
* [`BuildingSourceRef`](/floorkit/api/drawings/plan-drawing-extractor#buildingsourceref)
* [`DrawingArc`](/floorkit/api/drawings/draw-project-view#drawingarc)
* [`DrawingBoundary`](/floorkit/api/drawings/draw-project-view#drawingboundary)
* [`DrawingCurvedRegion`](/floorkit/api/drawings/draw-project-view#drawingcurvedregion)
* [`DrawingPrimitive`](/floorkit/api/drawings/draw-project-view#drawingprimitive)
* [`DrawingRegion`](/floorkit/api/drawings/draw-project-view#drawingregion)
* [`DrawingSourceRef`](/floorkit/api/drawings/draw-project-view#drawingsourceref)
* [`DrawingStyle`](/floorkit/api/drawings/draw-project-view#drawingstyle)
* [`PlanVectorBounds`](/floorkit/api/drawings/draw-project-view#planvectorbounds)
* [`Point2`](/floorkit/api/annotations/dimension-geometry#point2)
* [`Point3D`](/floorkit/api/views/view-frames#point3d)
* [`Profile`](/floorkit/api/primitives/line-primitive#profile)
* [`VectorDrawing`](/floorkit/api/drawings/draw-project-view#vectordrawing)
* [`VectorLine`](/floorkit/api/drawings/draw-project-view#vectorline)


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