Skip to Content
Bear documentation

types

Import from bear/drawings/types.

Interfaces

ComputedDrawingSheet

Defined in: bear/drawings/types.ts:512

Properties

PropertyTypeDescription
blocksComputedSheetBlock[]-
keynotesobject[]The keynotes this sheet's views use, in key order.
numberstring-
titlestring-
viewsComputedDrawingView[]-

ComputedDrawingView

Defined in: bear/drawings/types.ts:482

Properties

PropertyTypeDescription
annotationsResolvedAnnotation[]-
groundnumber | nullWhere grade (the model's z = 0) runs across the view; null where up is not the model's up.
id?string-
kindViewKind-
labelstring-
referencedFromViewRef[]The views whose callouts point at this one.
resultSectionViewResult-
scale?string-
subtitle?string-
viewOmit<ViewDefinition, "query">-

CutPlane

Defined in: bear/drawings/types.ts:65

A cut plane defined by an origin point and a normal direction.

Properties

PropertyTypeDescription
normal[number, number, number]Normal direction of the plane — points toward the camera (away from the geometry being viewed). The "front" side of the plane is the side the normal points to; geometry on the "back" side is what gets projected.
origin[number, number, number]A point on the plane, in project units.

DrawingFirm

Defined in: bear/drawings/types.ts:372

The office that issues the set.

Properties

PropertyTypeDescription
lines?string[]Address and contact lines.
namestring-

DrawingHints

Defined in: bear/drawings/types.ts:32

Drawing metadata provided by a part definition. Controls how the part appears when rendered in 2D drawings.

Properties

PropertyTypeDescription
hatch?HatchPatternHatching pattern when this part is cut through in section.
hidden?booleanIf true, this part is hidden in drawings (e.g., internal fasteners).
keynote?objectThe keynote that names this part on a drawing, e.g. { key: "06 11 00.B", text: "2X6 WOOD STUDS" }. A set can override the text.
keynote.keystring-
keynote.textstring-
openInPlan?booleanA door leaf: plans draw it standing open from its door's handing, so its closed solid is left out of plans (and kept in sections and elevations).
seamless?booleanA sheet good whose joints are not drawn: what is seen of it and its siblings of the same kind is drawn as one surface (sheathing, gypsum).
symbol?(node) => [number, number][][]Custom 2D symbol to use instead of slicing the manifold. Useful for parts like windows or doors that have standard plan symbols. Returns polygons in the cut plane's local coordinate space.

DrawingRevision

Defined in: bear/drawings/types.ts:362

One row of a title block's revision table.

Properties

PropertyTypeDescription
approved?stringInitials of whoever approved the revision.
datestring-
descriptionstring-
revstringRevision mark (e.g., "1", "A").

DrawingSetDef

Defined in: bear/drawings/types.ts:382

Complete drawing set definition. This is the expected default export of a project's drawings.tsx file.

Properties

PropertyTypeDescription
address?stringProject address / location.
checkedBy?string-
client?stringClient / owner.
date?stringIssue date. Defaults to today.
drawnBy?stringDefaults to "BEAR".
firm?DrawingFirmThe architect of record. Defaults to Bear.
keynotes?Record<string, string>Keynote text by key. Adds keys, and overrides the text of keynotes the model's parts declare.
project?stringProject name shown on title blocks.
revisions?DrawingRevision[]-
scale?stringDefault drawing scale for views, e.g. "1/4in". Omit to fit each view at the largest standard scale.
sheetsDrawingSheetDef[]The sheets in the drawing set.
size?| "ANSI B" | "ARCH A" | "ARCH B" | "ARCH C" | "ARCH D" | "ARCH E" | "ARCH E1"Sheet size name. Defaults to "ARCH D".
status?stringStatus disclaimer. Defaults to "PRELIMINARY: NOT FOR CONSTRUCTION".

DrawingSheetDef

Defined in: bear/drawings/types.ts:350

A drawing sheet — one page in the drawing set. Contains one or more views arranged on a sheet.

Properties

PropertyTypeDescription
blocks?SheetBlock[]Text blocks for the notes column. Keynotes used on the sheet are listed automatically.
numberstringSheet number (e.g., "A1.01").
titlestringSheet title (e.g., "FLOOR PLANS").
viewsDrawingViewDef[]Views on this sheet.

DrawingViewDef

Defined in: bear/drawings/types.ts:310

A single view within a drawing sheet. Defines what to show and how to label it.

Properties

PropertyTypeDescription
annotations?Annotation[]-
id?stringNames the view so callouts elsewhere in the set can point at it.
labelstringLabel for this view (e.g., "First Floor Plan").
scale?stringDrawing scale for this view, e.g. "1-1/2in" for a detail. Overrides the set's.
subtitle?stringA second line under the title, e.g. "Below meeting rails".
viewOmit<ViewDefinition, "query">The view definition (cut plane + depth range).

Finding

Defined in: bear/drawings/types.ts:522

Something a plan checker would ask about the set, found by checkDrawingSet.

Properties

PropertyTypeDescription
messagestring-
severity"error" | "warning"An error is missing or wrong; a warning is what a reviewer would likely ask for.
sheet?stringThe sheet it concerns, when it concerns one.

SectionViewResult

Defined in: bear/drawings/types.ts:136

Result of computing a section view.

Properties

PropertyTypeDescription
boundsobjectBounding rectangle of all polygons in the view's local 2D space.
bounds.maxXnumber-
bounds.maxYnumber-
bounds.minXnumber-
bounds.minYnumber-
overhead[number, number][][]In a plan, what is above the cut and reaches past what the plan draws (an eave, a cantilever): drawn dashed, as overhead.
polygonsViewPolygonSet[]Polygon sets, one per contributing tree node.
silhouette[number, number][][]The outline of everything drawn: an elevation is profiled with it.
solid[number, number][][]Everything cut but glass, merged with wall cavities filled: the poché a small-scale view draws, so a wall reads as a solid, not a row of studs.

SheetSize

Defined in: bear/drawings/types.ts:540

Properties

PropertyTypeDescription
heightnumberHeight in project units (32nds of an inch)
namestringSheet name (e.g., "ARCH D")
widthnumberWidth in project units (32nds of an inch)

ViewDefinition

Defined in: bear/drawings/types.ts:85

Defines a 2D view of the 3D model.

A view is defined by a cutting plane and an optional depth range. Geometry at the cut plane produces "cut" polygons (heavy lines, hatching). Geometry beyond the cut plane (up to depthRange) produces "visible" polygons (medium lines, no hatching).

Properties

PropertyTypeDescription
crop?objectCrop the view to a window centered on the cut plane's origin, in project units along the view's right and up axes: how a detail is drawn.
crop.heightnumber-
crop.widthnumber-
cut?booleanFalse for a pure projection (an elevation): nothing is sliced and geometry on both sides of the plane is projected. Defaults to true.
cutPlaneCutPlaneThe cutting plane.
depthRange?numberHow far beyond the cut plane to include visible geometry, in project units. If omitted, all geometry beyond the cut is included.
query?BearQuery<TreeNode>Optional query to limit which tree nodes are included.

ViewPolygonSet

Defined in: bear/drawings/types.ts:112

2D polygon data extracted from a single tree node.

Properties

PropertyTypeDescription
cut[number, number][][]Polygons at the cut plane — heavy lines, hatching applied.
depthnumberDistance beyond the cut plane to this node's nearest point, in project units.
divisionstringCSI MasterFormat division code from the part definition.
drawingHintsDrawingHintsDrawing hints from the part's drawing() callback or defaults.
edges[number, number][][]Creases inside the outline that face the viewer (a sash in its frame, a molding's profile), clipped to what is seen: two-point segments.
nodeIdstringFully qualified name of the source TreeNode.
visible[number, number][][]-

ViewRef

Defined in: bear/drawings/types.ts:420

Where a view sits in the set: its sheet and its number on that sheet.

Properties

PropertyType
numbernumber
sheetstring

Type Aliases

Anchor

type Anchor = ModelPoint | string;

Defined in: bear/drawings/types.ts:252

Where an annotation points: a model point, or a node by its fqn (or the tail of it after a dot, e.g. "W-1.Sheathing.OSB-1"; it must name one member). A node anchors at the middle of its largest outline in the view.


Annotation

type Annotation = 
  | {
  at: Anchor;
  key?: string;
  kind: "keynote";
}
  | {
  at: Anchor;
  kind: "note";
  text: string;
}
  | {
  at: ModelPoint;
  kind: "label";
  subtext?: string;
  text: string;
}
  | {
  kind: "dimension";
  offset: number;
  points: ModelPoint[];
}
  | {
  kind: "level";
  label: string;
  z: number;
}
  | {
  kind: "callout";
  view: string;
}
  | {
  kind: "tags";
  of: "openings" | "walls";
}
  | {
  corners: ModelPoint[];
  kind: "property";
  setbacks?: number[];
}
  | {
  kind: "members";
}
  | {
  kind: "dimensions";
  of: "openings";
  offset: number;
}
  | {
  across: [ModelPoint, ModelPoint];
  kind: "dimensions";
};

Defined in: bear/drawings/types.ts:258

Annotations are authored in model coordinates and projected into each view, so they follow the model as it changes. Text is laid out by the sheet.

Union Members

Type Literal
{
  at: Anchor;
  key?: string;
  kind: "keynote";
}

A keynote tag with a leader. key defaults to the anchored node's own keynote.


Type Literal
{
  at: Anchor;
  kind: "note";
  text: string;
}

A note lettered beside the view with a leader to at.


Type Literal
{
  at: ModelPoint;
  kind: "label";
  subtext?: string;
  text: string;
}

A label lettered on the drawing itself, such as a room name.


Type Literal
{
  kind: "dimension";
  offset: number;
  points: ModelPoint[];
}

A dimension string through points, measured along the line from the first to the last and drawn offset (real length) to its left.


Type Literal
{
  kind: "level";
  label: string;
  z: number;
}

A level datum at height z, for elevations and sections.


Type Literal
{
  kind: "callout";
  view: string;
}

The mark of another view (section, detail or elevation) by its id.


Type Literal
{
  kind: "tags";
  of: "openings" | "walls";
}

Tag what the plan cuts: "openings" letters each door and window's mark (D101, W101), "walls" each wall's type number (see the walls schedule).


Type Literal
{
  corners: ModelPoint[];
  kind: "property";
  setbacks?: number[];
}

The lot, from the survey: its corners in order around it, in model coordinates (north +y), and a setback per line (corner i to i + 1). A site plan letters each line's bearing and distance, draws the setback line, and dimensions the building to each property line.


Type Literal
{
  kind: "members";
}

Call out each field of like members the plan sees (joists, rafters): the member and its spacing over a line from support to support.


Type Literal
{
  kind: "dimensions";
  of: "openings";
  offset: number;
}

Dimension every wall the plan cuts openings in: a string from end to end of its framing through each opening's centerline, offset outside it.


Type Literal
{
  across: [ModelPoint, ModelPoint];
  kind: "dimensions";
}

A string along the line from one point to the other, through every face of the cut it crosses: interior dimensions, wall to wall, on a plan or section.


ComputedDrawingSet

type ComputedDrawingSet = Omit<DrawingSetDef, "sheets" | "keynotes"> & object;

Defined in: bear/drawings/types.ts:530

Type Declaration

NameTypeDescription
findingsFinding[]What the set still lacks for permit and field (see drawings/check.ts).
sheetsComputedDrawingSheet[]-

ComputedSheetBlock

type ComputedSheetBlock = 
  | Exclude<SheetBlock, {
  kind: "schedule" | "index";
}>
  | {
  kind: "index";
  sheets: object[];
}
  | {
  columns: string[];
  kind: "table";
  of: Extract<SheetBlock, {
     kind: "schedule";
  }>["of"];
  rows: string[][];
  title: string;
};

Defined in: bear/drawings/types.ts:501

A sheet block as the sheet sets it, holding everything it letters: schedules become tables and the index lists the set's sheets.


HatchPattern

type HatchPattern = 
  | "wood"
  | "concrete"
  | "steel"
  | "insulation"
  | "gypsum"
  | "earth"
  | "glass"
  | "none";

Defined in: bear/drawings/types.ts:18

Standard architectural hatching patterns for section cuts.


ModelPoint

type ModelPoint = [number, number, number];

Defined in: bear/drawings/types.ts:245

A point in the model, in project units.


ResolvedAnnotation

type ResolvedAnnotation = 
  | {
  anchor: ViewPoint;
  key: string;
  kind: "keynote";
}
  | {
  anchor: ViewPoint;
  kind: "note";
  text: string;
}
  | {
  at: ViewPoint;
  kind: "label";
  subtext?: string;
  text: string;
}
  | {
  kind: "dimension";
  labels: string[];
  line: ViewPoint[];
  points: ViewPoint[];
}
  | {
  elevation: string;
  kind: "level";
  label: string;
  y: number;
}
  | {
  from: ViewPoint;
  kind: "section";
  look: ViewPoint;
  target: ViewRef;
  to: ViewPoint;
}
  | {
  center: ViewPoint;
  kind: "detail";
  radius: [number, number];
  target: ViewRef;
}
  | {
  at: ViewPoint;
  kind: "elevation";
  look: ViewPoint;
  target: ViewRef;
}
  | {
  from: ViewPoint;
  kind: "glazing";
  to: ViewPoint;
}
  | {
  hinge: ViewPoint;
  kind: "swing";
  open: ViewPoint;
  strike: ViewPoint;
}
  | {
  corners: ViewPoint[];
  kind: "property";
  legs: string[];
  setback: ViewPoint[] | null;
}
  | {
  from: ViewPoint;
  kind: "span";
  text: string;
  to: ViewPoint;
}
  | {
  at: ViewPoint;
  kind: "tag";
  out: ViewPoint;
  shape: "window" | "door" | "wall";
  text: string;
};

Defined in: bear/drawings/types.ts:426

An annotation projected into its view, ready to typeset.

Union Members

Type Literal
{
  anchor: ViewPoint;
  key: string;
  kind: "keynote";
}

Type Literal
{
  anchor: ViewPoint;
  kind: "note";
  text: string;
}

Type Literal
{
  at: ViewPoint;
  kind: "label";
  subtext?: string;
  text: string;
}

Type Literal
{
  kind: "dimension";
  labels: string[];
  line: ViewPoint[];
  points: ViewPoint[];
}
NameTypeDescription
kind"dimension"-
labelsstring[]One per span, e.g. 12'-6".
lineViewPoint[]Where each point lands on the dimension line.
pointsViewPoint[]Where each point's extension line starts.

Type Literal
{
  elevation: string;
  kind: "level";
  label: string;
  y: number;
}

Type Literal
{
  from: ViewPoint;
  kind: "section";
  look: ViewPoint;
  target: ViewRef;
  to: ViewPoint;
}

A cut line through this view with bubbles at both ends, looking along look.


Type Literal
{
  center: ViewPoint;
  kind: "detail";
  radius: [number, number];
  target: ViewRef;
}

A boundary around the part of this view that a detail enlarges.


Type Literal
{
  at: ViewPoint;
  kind: "elevation";
  look: ViewPoint;
  target: ViewRef;
}

A marker outside this view pointing at the face an elevation shows.


Type Literal
{
  from: ViewPoint;
  kind: "glazing";
  to: ViewPoint;
}

A window's glazing across its rough opening, on the wall's line.


Type Literal
{
  hinge: ViewPoint;
  kind: "swing";
  open: ViewPoint;
  strike: ViewPoint;
}

A door in plan: its leaf from the hinge, standing open, and the arc it swings back to the strike jamb.


Type Literal
{
  corners: ViewPoint[];
  kind: "property";
  legs: string[];
  setback: ViewPoint[] | null;
}

Property lines lettered with bearing and distance, and the setback line inside them.


Type Literal
{
  from: ViewPoint;
  kind: "span";
  text: string;
  to: ViewPoint;
}

A field of members: its span, end to end, under the member and its spacing.


Type Literal
{
  at: ViewPoint;
  kind: "tag";
  out: ViewPoint;
  shape: "window" | "door" | "wall";
  text: string;
}

A mark: a hexagon for a window, an ellipse for a door, a diamond for a wall type.

NameTypeDescription
atViewPoint-
kind"tag"-
outViewPointAway from the wall, a unit vector: the sheet sets the tag out that way (an opening's to the exterior, a wall type's to its interior).
shape"window" | "door" | "wall"-
textstring-

SheetBlock

type SheetBlock = 
  | {
  items: string[];
  kind: "notes";
  title: string;
}
  | {
  items: [string, string][];
  kind: "abbreviations";
}
  | {
  kind: "index";
}
  | {
  kind: "symbols";
}
  | {
  items: [string, string][];
  kind: "data";
  title: string;
}
  | {
  kind: "schedule";
  of: "openings" | "areas" | "walls";
};

Defined in: bear/drawings/types.ts:325

A block of text set in the sheet's notes column.

Union Members

Type Literal
{
  items: string[];
  kind: "notes";
  title: string;
}

Numbered notes under a heading, e.g. "General notes".


Type Literal
{
  items: [string, string][];
  kind: "abbreviations";
}

Abbreviations as [abbreviation, meaning] pairs.


Type Literal
{
  kind: "index";
}

The set's sheet index, generated from the sheets.


Type Literal
{
  kind: "symbols";
}

The graphic symbols used in the set.


Type Literal
{
  items: [string, string][];
  kind: "data";
  title: string;
}

Project and code data as [item, value] pairs: occupancy, construction type, zoning, codes, what a plan checker reads first.


Type Literal
{
  kind: "schedule";
  of: "openings" | "areas" | "walls";
}

A schedule drawn from the model: "openings" lists every door and window by mark, "areas" each level's gross floor area, "walls" each wall type's construction.


SheetSizeName

type SheetSizeName = keyof typeof SHEET_SIZES;

Defined in: bear/drawings/types.ts:588


ViewKind

type ViewKind = "plan" | "section" | "elevation" | "detail";

Defined in: bear/drawings/types.ts:480


ViewPoint

type ViewPoint = [number, number];

Defined in: bear/drawings/types.ts:417

A point in a view's 2D space: project units, x right, y up.

Variables

SHEET_SIZES

const SHEET_SIZES: object;

Defined in: bear/drawings/types.ts:550

Sheets are landscape, as architectural sets are bound and read.

Type Declaration

NameTypeDefault value
ANSI Bobject-
ANSI B.heightnumber-
ANSI B.name"ANSI B""ANSI B"
ANSI B.widthnumber-
ARCH Aobject-
ARCH A.heightnumber-
ARCH A.name"ARCH A""ARCH A"
ARCH A.widthnumber-
ARCH Bobject-
ARCH B.heightnumber-
ARCH B.name"ARCH B""ARCH B"
ARCH B.widthnumber-
ARCH Cobject-
ARCH C.heightnumber-
ARCH C.name"ARCH C""ARCH C"
ARCH C.widthnumber-
ARCH Dobject-
ARCH D.heightnumber-
ARCH D.name"ARCH D""ARCH D"
ARCH D.widthnumber-
ARCH Eobject-
ARCH E.heightnumber-
ARCH E.name"ARCH E""ARCH E"
ARCH E.widthnumber-
ARCH E1object-
ARCH E1.heightnumber-
ARCH E1.name"ARCH E1""ARCH E1"
ARCH E1.widthnumber-

Functions

detailView()

function detailView(
   origin, 
   normal, 
   size, 
   depthRange?
): ViewDefinition;

Defined in: bear/drawings/types.ts:227

Create a detail view: a section cut cropped to a window around origin, drawn at a large scale.

Parameters

ParameterTypeDescription
origin[number, number, number]Center of the detail, on the cut plane
normal[number, number, number]Normal of the cut plane (points toward camera)
size[number, number]Window width and height along the view's right and up axes
depthRange?numberHow far beyond the cut to show. Defaults to a shallow 1ft.

Returns

ViewDefinition


elevationView()

function elevationView(direction): ViewDefinition;

Defined in: bear/drawings/types.ts:185

Create an elevation view definition — vertical projection from a compass direction.

Parameters

ParameterTypeDescription
direction"north" | "south" | "east" | "west"Which face of the building to view

Returns

ViewDefinition


parseDrawingScale()

function parseDrawingScale(scale): number;

Defined in: bear/drawings/types.ts:601

Parse a drawing scale string like "1/4in" (meaning 1/4" = 1'-0") into a numeric scale factor (paper units / real units).

Parameters

ParameterTypeDescription
scalestringScale string, e.g. "1/4in", "1/8in", "1in", "3/8in"

Returns

number

Scale factor (e.g., 1/48 for "1/4in")


planView()

function planView(elevation, depthRange?): ViewDefinition;

Defined in: bear/drawings/types.ts:170

Create a plan view definition — horizontal cut looking down.

Parameters

ParameterTypeDescription
elevationnumberZ height of the cut in project units
depthRange?numberHow far below the cut to include (project units). Omit for all.

Returns

ViewDefinition


sectionView()

function sectionView(
   origin, 
   normal, 
   depthRange?
): ViewDefinition;

Defined in: bear/drawings/types.ts:207

Create a section view definition — arbitrary cut plane with camera direction.

Parameters

ParameterTypeDescription
origin[number, number, number]Point on the cut plane
normal[number, number, number]Normal of the cut plane (points toward camera)
depthRange?numberHow far beyond the cut to show

Returns

ViewDefinition

On this page