# tsdraft docs

These pages ship in the npm package, in `node_modules/tsdraft/docs/`, and are published at
[tsdraft.com/docs](https://tsdraft.com/docs). An agent starts with the guide.

## Start here

- [The guide for agents](guide.md) covers the setup, the loop through tsdraft's MCP server, the
  command for when there is no MCP, and what tsdraft cannot draw yet.
- [The `tsdraft` command](command.md) covers `render`, `dev`, `write`, the MCP server's
  tools, the JSON they give, and what happens without the PNG renderer.
- [The Drawing format](format.md) covers format 0, entity ids, `toJSON`
  and `fromJSON`, and what a diagnostic carries.
- [Rules](rules.md) lists what `lint` refuses and what it warns about.

## Drawing

- [Polylines](polylines.md) covers arcs by their bulge, rounded corners, revision clouds,
  widths and donuts, how a wide polyline plots, and what `lint` refuses of them.
- [Ellipses and splines](curves.md) covers ellipses and their arcs, splines through fit
  points and by control points, how they plot and dash, and what `lint` refuses of them.
- [Points](points.md) covers points and the point style, how a figure plots and how big, and
  what `lint` refuses of them.
- [Blocks](blocks.md) covers blocks, inserts and attributes: layers in a
  block, names, handles and what the preview draws.
- [Fills, wipeouts and masks](fills.md) covers hatches with holes, solid, of a pattern
  file's patterns or of a gradient, wipeouts, the masks of paragraphs, leaders and dimensions, the draw order, and
  what `lint` refuses.
- [Colors](colors.md) covers an entity's own color by index or as a true color, ByBlock in
  a block, how each plots under a plot style table, and the color codes of paragraph text.
- [Transparency](transparency.md) covers an entity's own transparency, ByBlock in a block,
  and how it plots when the plot asks for it.
- [Images](images.md) covers raster images: the path and the pixels, clips, frames,
  transparency, how the plot draws one, and what `lint` refuses.
- [Underlays](underlays.md) covers PDF underlays: the path, the page and its size, scale,
  clips, fade, contrast and monochrome, frames, the page's picture the plot draws, and what `lint`
  refuses.
- [Xrefs](xrefs.md) covers references to DWG files: the path, units, a
  missing file, and how the preview draws a referenced drawing.

## Text, dimensions and tables

- [Text](text.md) covers text styles, fonts and justification, how long a
  text plots with `measureText`, the warnings of `inspectText` about text that
  overlaps or leaves its border, what tsdraft escapes in text, and what the leading
  CAD app does with it after a save.
- [Paragraphs](paragraphs.md) covers paragraph text: its width and box, the codes its
  value takes, the helpers that write them, how it is laid out, and what `lint` refuses.
- [Dimensions](dimensions.md) covers dimension styles, linear, aligned, radius, diameter,
  jogged radius, angular, arc length and ordinate dimensions, how a measurement is written, and
  what `lint` refuses.
- [Leaders](leaders.md) covers leader styles, a note or a block on a leader, how a leader
  is drawn, and leaders under a standard.
- [Tables](tables.md) covers table styles, a schedule drawn as one table, how a table is
  laid out, and what `lint` refuses.

## Sheets

- [Layouts](layouts.md) covers sheets: the papers, the page setup, viewports and
  their scale, names, and how the preview draws a sheet as it plots.
- [Title blocks](title-blocks.md) covers a title block whose fields are
  attributes, and a firm's own border placed under a sheet as an xref.
- [Plotting](plotting.md) covers `toPDF` and `svgToPDF`: a PDF for each sheet and for the
  set, what a page holds, and the faces text is set in.

## Standards and checks

- [Standards](standard.md) covers a firm's standard: the document,
  `defineStandard`, the built-in standard, drawing to a standard, what `lint`
  holds a drawing to, and the `standard` a drawing file exports.
- [Layer names](layer-names.md) explains how the leading CAD app compares layer and
  linetype names, and lists the pairs `AUDIT` calls duplicates and the
  characters it refuses.
- [Checks of intent](intent.md) covers `checkIntent`, which warns of a
  footprint that crosses a setback, and the `intent` a drawing file exports.

## A firm's files

- [Reading drawing files](reading.md) covers `readDXF`, the read model it gives of a
  firm's DXF, and the readers a package adds for other formats.
- [Editing a firm's drawing](editing.md) covers the edit file, the edited copy of a DXF, the
  checks of every job and `tsdraft write`.
