Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
lower case, or `@LAYOUT/INDEX` for one without an id: never change one. A dimension is
refused inside a block, where AutoCAD draws nothing for it.
- `examples/site-plan.ts` is the sheet an agent copies, so it must read as a model: the site
in model space at its true size, with the annotation that is read in the plan sized by
`fromPaper`, and everything that belongs to the paper inside `d.layout`, in paper units.
in model space at its true size, with the annotation that is read in the plan sized by the
view it names, and everything that belongs to the paper inside `d.layout`, in paper units.
Its border and title block are one block whose fields are attributes. Never draw a sheet
in model space there.
- A view is drawn only where it can be seen. The clip of a view, the hidden rectangle and
Expand Down Expand Up @@ -175,6 +175,10 @@
through `src/standard/made.ts` and never imports `define.ts`, which draws the plain title
block with the builder as it loads. A drawing without a standard is built as it was before
standards.
- Under a standard, a role's text style and a dimension style of the standard enter the drawing
on first use, under `capitals` of the id, and in model space with the view's scale id after a
dimension style's: `DIMS-1in-10ft`. A view's id is taken when `view()` declares it, and the
one viewport that shows the view takes that id and no other.
- `lint` takes any plain data and never throws, since a `Drawing` can be written by hand.
`src/shape.ts` holds the fields of each object and their types, once, for `fromJSON` and for
`lint`. `lint` checks an object's shape there before a rule reads it, and skips the rules for
Expand Down
10 changes: 10 additions & 0 deletions GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,16 @@ It is drawn to a standard of its own, which extends `BUILT_IN_STANDARD` with the
pen and plot flag, and an entity's `pen` names one of the standard's pens. A layer the standard
lacks is a compile error that says how to add it to `layers` in `defineStandard`.

A text names a `role` of the standard, which gives its text style and the height it plots at.
The plan is a view at one of the standard's scales, `const plan = d.view("plan", { scale:
"1in-10ft" })`, and what model space draws to be read in it names the view:
`d.text(at, "LOT 27", { role: "label", view: plan })`, `d.insert("PROPERTY CORNER", at,
{ view: plan })` for a symbol drawn in inches, and `d.linearDimension(from, to, line, { view:
plan })` in the standard's dimension style. The viewport shows the view, as
`sheet.viewport(corner, width, height, { view: plan, center })`, and `plan.paper(inches)`
turns a gap on paper into drawing units. On the sheet and in a block, a text with a role is at
the role's height and names no view. `sitePlan("1in-20ft")` draws the sheet at 1" = 20'.

## Checking intent

Export `intent` beside the drawing, and each build checks that every footprint keeps out of
Expand Down
32 changes: 18 additions & 14 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ at 1" = 10'. It is the file to copy to start a drawing.
- **Model space** holds the site at its true size, in feet: the lot from its
plat dimensions, the setbacks, the building footprint, the driveway, the
street and the trees. The annotation that is read in the plan is there too:
bearings and distances, dimensions and labels. Each is sized by how
large it plots, with `fromPaper` for the viewport's ratio. The dimensions
are dimension objects in a style with that scale, so CAD measures them.
bearings and distances, dimensions and labels. Each names the view `plan`,
which sizes it by how large it plots at the view's scale. The dimensions
are dimension objects in the standard's dimension style at that scale, so
CAD measures them.
- **The layout `C-101`** holds the sheet, in inches of paper: the border, the
title block, a column of site data, general notes, a legend and
abbreviations, and under the plan the north arrow, the view's title and a
graphic scale. A text there has the height it plots at.

One viewport shows the plan on the layout at the ratio. It is on a layer that
One viewport shows the view on the layout at its scale. It is on a layer that
does not plot, so its border stays off the page. AutoCAD opens the file on the
sheet and plots it at 1" = 10' on a page 36 by 24 inches.

Expand Down Expand Up @@ -93,18 +94,21 @@ radius in the plan and at 3/16 inch in the legend.
The sheet is drawn to a standard of its own, `standard`, which extends
`BUILT_IN_STANDARD` with the layer `V-TREE`. Each layer is named, and its color,
linetype, pen and plot flag are the standard's. The border names the standard's
heavy pen. The standard's linetype scale is a length of paper, 1/2. Change the
ratio from 120 to 240 and nothing on the sheet moves:
the plan is half as large in its viewport, and its text keeps its plotted
height. The sheet holds the plan at 1" = 10' and at 1" = 20'. At a larger
scale, such as 1" = 8', the plan is taller than its viewport.
heavy pen. The standard's linetype scale is a length of paper, 1/2. Each text
names a role of the standard, which gives its text style and the height it
plots at; the title block's texts are in a text style of its own, `NOTES`. The
view `plan` is at a scale of the standard, `1in-10ft`. Draw it at `1in-20ft`
and nothing on the sheet moves: the plan is half as large in its viewport, and
its text keeps its plotted height. The sheet holds the plan at 1" = 10' and at
1" = 20'. At a larger scale the plan is taller than its viewport.

The picture is the layout, as `toSVG(drawing, { layout: "C-101" })` draws the
sheet, in the page's colors. `sitePlan(ratio)` builds the sheet at a ratio and
returns the drawing with where its parts lie: `drawingArea`, `titleBlock`, the
box of each of its `fields` and the `viewport` on the paper, in inches, and
`view`, the part of model space the viewport shows. A test builds it at 120
and at 240. It holds model space inside the view, the sheet inside the border,
sheet, in the page's colors. `sitePlan(scale)` builds the sheet at a scale of
the standard and returns the drawing with where its parts lie: `drawingArea`,
`titleBlock`, the box of each of its `fields` and the `viewport` on the paper,
in inches, and `view`, the part of model space the viewport shows. A test
builds it at `1in-10ft` and at `1in-20ft`. It holds model space inside the
view, the sheet inside the border,
everything but the title block out of the title block's space and off the
viewport, the texts of each space off one another, and each field inside its
box.
Expand Down
Loading
Loading