types
Import from bear/drawings/types.
Interfaces
ComputedDrawingSheet
Defined in: bear/drawings/types.ts:512
Properties
| Property | Type | Description |
|---|---|---|
blocks | ComputedSheetBlock[] | - |
keynotes | object[] | The keynotes this sheet's views use, in key order. |
number | string | - |
title | string | - |
views | ComputedDrawingView[] | - |
ComputedDrawingView
Defined in: bear/drawings/types.ts:482
Properties
| Property | Type | Description |
|---|---|---|
annotations | ResolvedAnnotation[] | - |
ground | number | null | Where grade (the model's z = 0) runs across the view; null where up is not the model's up. |
id? | string | - |
kind | ViewKind | - |
label | string | - |
referencedFrom | ViewRef[] | The views whose callouts point at this one. |
result | SectionViewResult | - |
scale? | string | - |
subtitle? | string | - |
view | Omit<ViewDefinition, "query"> | - |
CutPlane
Defined in: bear/drawings/types.ts:65
A cut plane defined by an origin point and a normal direction.
Properties
DrawingFirm
Defined in: bear/drawings/types.ts:372
The office that issues the set.
Properties
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
| Property | Type | Description |
|---|---|---|
hatch? | HatchPattern | Hatching pattern when this part is cut through in section. |
hidden? | boolean | If true, this part is hidden in drawings (e.g., internal fasteners). |
keynote? | object | The 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.key | string | - |
keynote.text | string | - |
openInPlan? | boolean | A 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? | boolean | A 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
| Property | Type | Description |
|---|---|---|
approved? | string | Initials of whoever approved the revision. |
date | string | - |
description | string | - |
rev | string | Revision 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
| Property | Type | Description |
|---|---|---|
address? | string | Project address / location. |
checkedBy? | string | - |
client? | string | Client / owner. |
date? | string | Issue date. Defaults to today. |
drawnBy? | string | Defaults to "BEAR". |
firm? | DrawingFirm | The 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? | string | Project name shown on title blocks. |
revisions? | DrawingRevision[] | - |
scale? | string | Default drawing scale for views, e.g. "1/4in". Omit to fit each view at the largest standard scale. |
sheets | DrawingSheetDef[] | 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? | string | Status 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
| Property | Type | Description |
|---|---|---|
blocks? | SheetBlock[] | Text blocks for the notes column. Keynotes used on the sheet are listed automatically. |
number | string | Sheet number (e.g., "A1.01"). |
title | string | Sheet title (e.g., "FLOOR PLANS"). |
views | DrawingViewDef[] | 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
| Property | Type | Description |
|---|---|---|
annotations? | Annotation[] | - |
id? | string | Names the view so callouts elsewhere in the set can point at it. |
label | string | Label for this view (e.g., "First Floor Plan"). |
scale? | string | Drawing scale for this view, e.g. "1-1/2in" for a detail. Overrides the set's. |
subtitle? | string | A second line under the title, e.g. "Below meeting rails". |
view | Omit<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
SectionViewResult
Defined in: bear/drawings/types.ts:136
Result of computing a section view.
Properties
| Property | Type | Description |
|---|---|---|
bounds | object | Bounding rectangle of all polygons in the view's local 2D space. |
bounds.maxX | number | - |
bounds.maxY | number | - |
bounds.minX | number | - |
bounds.minY | number | - |
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. |
polygons | ViewPolygonSet[] | 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
| Property | Type | Description |
|---|---|---|
height | number | Height in project units (32nds of an inch) |
name | string | Sheet name (e.g., "ARCH D") |
width | number | Width 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
| Property | Type | Description |
|---|---|---|
crop? | object | Crop 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.height | number | - |
crop.width | number | - |
cut? | boolean | False for a pure projection (an elevation): nothing is sliced and geometry on both sides of the plane is projected. Defaults to true. |
cutPlane | CutPlane | The cutting plane. |
depthRange? | number | How 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
| Property | Type | Description |
|---|---|---|
cut | [number, number][][] | Polygons at the cut plane — heavy lines, hatching applied. |
depth | number | Distance beyond the cut plane to this node's nearest point, in project units. |
division | string | CSI MasterFormat division code from the part definition. |
drawingHints | DrawingHints | Drawing 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. |
nodeId | string | Fully 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
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
| Name | Type | Description |
|---|---|---|
findings | Finding[] | What the set still lacks for permit and field (see drawings/check.ts). |
sheets | ComputedDrawingSheet[] | - |
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[];
}| Name | Type | Description |
|---|---|---|
kind | "dimension" | - |
labels | string[] | One per span, e.g. 12'-6". |
line | ViewPoint[] | Where each point lands on the dimension line. |
points | ViewPoint[] | 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.
| Name | Type | Description |
|---|---|---|
at | ViewPoint | - |
kind | "tag" | - |
out | ViewPoint | Away 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" | - |
text | string | - |
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
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
| Parameter | Type | Description |
|---|---|---|
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? | number | How far beyond the cut to show. Defaults to a shallow 1ft. |
Returns
elevationView()
function elevationView(direction): ViewDefinition;Defined in: bear/drawings/types.ts:185
Create an elevation view definition — vertical projection from a compass direction.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | "north" | "south" | "east" | "west" | Which face of the building to view |
Returns
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
| Parameter | Type | Description |
|---|---|---|
scale | string | Scale 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
| Parameter | Type | Description |
|---|---|---|
elevation | number | Z height of the cut in project units |
depthRange? | number | How far below the cut to include (project units). Omit for all. |
Returns
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
| Parameter | Type | Description |
|---|---|---|
origin | [number, number, number] | Point on the cut plane |
normal | [number, number, number] | Normal of the cut plane (points toward camera) |
depthRange? | number | How far beyond the cut to show |