extrudo

Docs

Sheet reference

What a drawing sheet stores (P6-24, ADR-0143), field by field, as d.toJSON() writes it: the sheet, its views and each kind of item. The calls that make them are in the README. Positions on the sheet are mm from its top-left corner, Y down; an item tied to a view is placed in the view's own mm (model size, x right, y up). Nothing derived is stored: no line of a view, no measured value, no parts list row; they are worked out each time the sheet is drawn. An anchor's ref always carries its fingerprint.

Sheet

Made by d.addSheet(name, options), sheet.update(setup).

Field Type Required What it is
id string yes A UUID, for life.
name string yes Unique among the sheets, compared case-insensitively.
size "A4" | "A3" | "A2" | "A1" | "A0" | "letter" | "legal" | "tabloid" | [number, number] yes A named paper, or two sides in mm; the orientation decides which side is wide.
orientation "landscape" | "portrait" yes Landscape: the long side is horizontal.
scale [number, number] yes The views' scale unless a view has its own.
projection "first" | "third" yes The projection angle projected views follow.
decimals integer yes Decimals dimensions show, 0 to 4.
border { zones: true } Absent: no border.
titleBlock { template, fields } Absent: no title block.

View

Made by sheet.addView(name, options), view.project(side, at), view.update(setup).

Field Type Required What it is
id string yes A UUID, for life; unique in the design.
name string yes "Front"; unique in its sheet, compared case-insensitively.
at [number, number] yes The view's origin on the sheet, mm from the top-left corner, Y down.
from { kind: "base", direction, up } | { kind: "projected", parent, side } yes A direction chosen freely. Or: Projected from another view of the sheet.
scale [number, number] Absent: the sheet's. Never on a projected view.
style "visible" | "hidden" | "shaded" | "shaded-edges" visible: visible edges only; hidden: and hidden edges dashed (the default). Never on a projected view.
bodies string[] The bodies drawn; absent: every shown body. One the design no longer has is skipped.
tangentEdges false Tangent edges left out (only as false).
centreLines false Centre lines left out (only as false).
label true The view's name and scale drawn under it (only as true).

Text

Made by sheet.addText(text, at, options).

Field Type Required What it is
kind "text" yes A text.
id string yes A UUID, for life; unique in the design.
at [number, number] yes The text's top-left corner, mm from the sheet's top-left, Y down.
text string yes Plain text, up to 2000 characters; may contain newlines.
size number The letter height, mm; absent: 3.5.
width number Wraps at this width, mm; absent: no wrapping.

Dimension

Made by view.addDimension(type, anchors, at, options).

Field Type Required What it is
kind "dimension" yes A dimension.
id string yes A UUID, for life; unique in the design.
view string yes The view it measures in, on the same sheet.
type "linear" | "radius" | "diameter" | "angle" yes linear: a distance; radius, diameter: a circle; angle: between two lines.
direction "horizontal" | "vertical" | "aligned" A linear one: horizontal, vertical or aligned; absent: from where it is placed.
anchors ({ ref, at? } | { ref, silhouette } | { free })[] yes What it measures: one or two anchors, as its type takes.
at [number, number] yes Where its text is, in the view's own mm (model size, x right, y up); it follows the anchors when they move.
decimals integer Decimals shown, 0 to 4; absent: the sheet's.
before string Text before the value (and before R or Ø), up to 100 characters.
after string Text after the value, up to 100 characters.
reference true A reference dimension: drawn in brackets (only as true).

Leader note

Made by view.addLeader(anchor, at, text).

Field Type Required What it is
kind "leader" yes A leader note.
id string yes A UUID, for life; unique in the design.
view string yes The view whose geometry it points at, on the same sheet.
anchor { ref, at? } | { ref, silhouette } | { free } yes What the arrow points at: a vertex, an edge or one of its points, a face (a dot), an outline, or a free point.
at [number, number] yes Where the leader line ends and its text starts, in the view's own mm (model size, x right, y up); it follows the anchor when it moves.
text string yes Plain text, up to 2000 characters; may contain newlines.

Sticky note

Made by sheet.addSticky(text, at, options).

Field Type Required What it is
kind "sticky" yes A sticky note.
id string yes A UUID, for life; unique in the design.
at [number, number] yes The note's top-left corner, mm from the sheet's top-left, Y down.
size [number, number] yes The note's width and height, mm, 5 to 1000 each.
text string yes Plain text, up to 2000 characters; may contain newlines. Wraps inside the note.
color "yellow" | "orange" | "pink" | "blue" | "green" yellow, orange, pink, blue or green; absent: yellow.
print true Printed and exported (only as true); absent: on screen only.

Centre mark

Made by view.addCentreMark(anchor).

Field Type Required What it is
kind "centreMark" yes A centre mark.
id string yes A UUID, for life; unique in the design.
view string yes The view it is drawn in, on the same sheet.
anchors ({ ref, at? } | { ref, silhouette } | { free })[] yes The circle: one whole circular edge or a cylinder's face.

Centre line

Made by view.addCentreLine(anchors).

Field Type Required What it is
kind "centreLine" yes A centre line.
id string yes A UUID, for life; unique in the design.
view string yes The view it is drawn in, on the same sheet.
anchors ({ ref, at? } | { ref, silhouette } | { free })[] yes Two parallel lines (whole edges or outlines: it runs midway), or a cylinder's or cone's face (along its axis).

Parts list

Made by view.addPartsList(at, options).

Field Type Required What it is
kind "partsList" yes A parts list.
id string yes A UUID, for life; unique in the design.
view string yes The view whose bodies it lists, on the same sheet.
at [number, number] yes The table's top-left corner, mm from the sheet's top-left, Y down.
columns ("item" | "qty" | "name" | "material" | "size" | "mass")[] The columns shown, in this order, each once: item, qty, name, material, size, mass; absent: all six.
rows Record<string, { name?, material? }> What was typed over a row, by the ID of the row's first body; a body the list no longer shows is ignored.

Balloon

Made by view.addBalloon(anchor, at, list).

Field Type Required What it is
kind "balloon" yes A balloon.
id string yes A UUID, for life; unique in the design.
view string yes The view whose geometry it points at, on the same sheet.
anchor { ref, at? } | { ref, silhouette } | { free } yes What the leader points at, on the body it numbers: a vertex, an edge or one of its points, a face (a dot), or an outline.
at [number, number] yes The circle's centre, in the view's own mm (model size, x right, y up); it follows the anchor when it moves.
list string yes The parts list it takes its number from, on the same sheet.

Table

Made by sheet.addTable(at, rows, options).

Field Type Required What it is
kind "table" yes A free table.
id string yes A UUID, for life; unique in the design.
at [number, number] yes The table's top-left corner, mm from the sheet's top-left, Y down.
columns number[] yes Each column's width, mm, 1 to 1000; 1 to 50 columns.
rows string[][] yes The rows, top to bottom, each one cell text per column (plain, may be empty, may contain newlines); a row's height fits its text.