zbCAD Documentation

A single-file, browser-based 2D CAD prototype. No install, no account, no server — open the HTML file and start drawing.

zbCAD is a 2D drafting tool modeled on the drawing conventions common to desktop CAD software: a typed command line that accepts abbreviations, keyboard shortcuts, and coordinate expressions like @3,2 or @5<45; object snap to precisely pick existing geometry; layers; and associative dimensions that stay attached to the geometry they measure. If you've used a traditional desktop CAD package before, most of this will already feel familiar.

Everything lives in your browser tab. Drawings are saved to a local .zbCAD.json file you download and re-open yourself, and an autosave copy is kept in the browser's local storage so an accidental tab close doesn't lose your work.

zbCAD is built for a mouse and keyboard on a wide display; it has no touch input handling or small-viewport layout. A narrow window or a touch device shows a dismissible warning to that effect rather than silently breaking — Continue anyway skips it for anyone who wants to try regardless.

The interface

The window is divided into a few fixed regions:

Core concepts

The command line

Click a toolbar button, or click the command-line input and type a command name (or its alias, e.g. L for LINE) and press Enter or Space. You don't need to click into the input first — typing any single character while the canvas has focus jumps into the command line automatically.

While a command is running, the same input accepts, in order of precedence:

  1. A keyword the active command is listening for (its prompt tells you which letters are live, e.g. C to close a polyline, U to undo the last point).
  2. A point, typed as x,y, @x,y (relative to the last point), or @distance<angle (polar, relative).
  3. A command-specific value (an angle for ROTATE, a scale factor for SCALE, etc.).
  4. A bare distance, applied along the direction from the last point toward the current cursor position — type a number right after picking a start point and dragging toward a direction to draw an exact length without doing the trigonometry yourself.

An unrecognized string that matches none of the above is looked up as a new command name.

Space vs. Enter. Space submits the command line exactly like Enter, except while a command is actively capturing free text (currently only TEXT's content), where a space is a literal word break instead.

Entering points & distances

SyntaxMeaning
12,8Absolute point at x=12, y=8, in drawing units.
@4,-2Point 4 right and 2 down from the last point (or the command's current base point).
@5<30Point 5 units away at 30° from the last point (polar/relative).
3.5A bare distance — drives along the current tracked direction from the last point.
6", 150mm, 2mA physical length with an explicit unit suffix, converted into drawing units automatically.
5'6", 5'6-1/2"Feet and inches, including mixed fractions (hyphen-separated, since a bare space is a command terminator).
3/4, 1-1/2A plain or mixed fraction, interpreted in drawing units.

A leading - negates a distance; a leading + is accepted and ignored.

Object snap

With SNAP on (the default), moving the cursor near existing geometry pulls the pick point onto a precise feature of it — essential for drawing connected geometry instead of eyeballing it. Click the snap-type readout in the status bar (next to the SNAP toggle) to choose which snap types are active:

TypeSnaps to
EndpointThe end of a line/arc segment or polyline vertex.
IntersectionWhere two segments, or a segment and a circle/arc, or two circles/arcs, cross.
MidpointThe midpoint of a segment or arc.
CenterThe center of a circle or arc.
QuadrantThe 0°/90°/180°/270° points of a circle or arc.
PerpendicularThe point on a line/circle/arc that forms a right angle with the command's current base point. Only available once a command has a base point.
TangentThe point on a circle/arc that a line from the current base point touches tangentially. Only available once a command has a base point, and only from outside the curve.
NearestThe closest point on any segment/curve to the cursor — the fallback snap, consulted only when nothing more specific is under the pick aperture.

When several snap points coincide on screen, the one listed first above wins, rather than whichever happens to be a pixel closer.

Ortho & polar tracking

ORTHO (F8) constrains the next point to be exactly horizontal or vertical from the current base point. POLAR (F10) instead locks onto the nearest multiple of a chosen angle increment (45° by default — change it via the polar readout in the status bar) whenever the cursor comes close to that alignment ray; move further off the ray and the lock releases. The two are mutually exclusive — ORTHO is really polar tracking at a fixed 90° increment, so turning one on turns the other off. Both only apply to commands that opt into tracked point entry (drawing and most modify commands); commands that ask you to pick a location rather than a measured point (e.g. which side of a line to keep when trimming) ignore both.

Selection & grips

With no command running, click an object to select it, or drag a box: dragging left-to-right selects only objects fully enclosed by the box, dragging right-to-left selects anything the box touches. Hold Shift to add to the current selection instead of replacing it. Delete erases the current selection. Commands that operate on a selection (MOVE, COPY, ERASE, ...) use the same picking and box-selection behavior at their "select objects" prompt.

Selected objects show small square grips at their defining points (endpoints, center, etc.). Click and drag a grip to reshape or reposition that point directly, without starting a command; click a grip without dragging to leave the edit live and then type or pick a destination point.

Layers

Every object lives on exactly one layer. The layers panel lists each with a radio-style "make current" marker, an editable name, a color swatch, a visibility toggle, a lock toggle, and a delete button. New objects are drawn onto the current layer, chosen from the dropdown above the panel or by clicking a layer's marker. Locked layers can't be edited; hidden layers don't render and aren't picked by selection or snap.

Assign selection to current moves the selected objects onto whichever layer is current. Layer 0 can't be renamed or deleted, and the current layer can't be deleted while it's current.

Units & dimension style

Open Units (UN) to set the drawing's physical unit (inches, feet, millimeters, centimeters, meters) and how lengths are displayed:

FormatLooks likeNotes
Decimal18.50Any drawing unit.
Fractional18 1/2Any drawing unit.
Architectural1'-6 1/2"Inches only.
Engineering1'-6.50"Inches only.

The units dialog offers to rescale existing geometry when you change the drawing unit, so switching from inches to millimeters mid-drawing doesn't silently change what your geometry means.

Dim Style (DST) controls how dimension objects are drawn: arrowhead style (tick or arrow), overall scale, text height, arrow size, and text precision (or "follow the document" to always match the current unit precision). New drawings default to arrows in metric units and ticks otherwise, matching common drafting convention.

Associative dimensions. A dimension remembers which geometry it measures, not just the number it displayed when placed — move or resize that geometry and the dimension updates with it. If the referenced geometry is deleted or changed beyond what the reference can resolve, the dimension freezes at its last known value rather than disappearing or erroring.

Files & autosave

Save downloads the current drawing as a <name>.zbCAD.json file through the browser's normal download mechanism. Open loads a .zbCAD.json file back in. New clears the canvas (with a confirmation if it isn't already empty).

Every change is also autosaved to the browser's local storage after a short delay, and the previous autosave is kept as a backup slot. If a drawing is still open in browser storage when you return — a crash, an accidental tab close, forgetting to Save — zbCAD offers to recover it. Recover Backup in the toolbar explicitly restores the older, previously-autosaved slot (rather than the most recent one) if you need to step back one version, and replaces the current drawing when used, so Save first if you want to keep a copy of what's currently open.

Autosave and manual Save are a convenience, not a substitute for keeping your own backups — both live only in this browser's storage or wherever you chose to save the downloaded file.

Plotting to PDF

Plot (PLT) writes the drawing to a PDF as real vector geometry — not a screenshot of the canvas. Lines stay lines, so the sheet can be measured, marked up, and printed at any resolution. Ctrl/Cmd+P opens the same dialog.

The dialog previews the sheet live as sheet size, area and scale are chosen, drawn from the same plot plan the PDF is serialised from, so there is nothing between choosing options and seeing what lands on paper. Anything that falls outside the printable border is shown in amber rather than left off the preview, since a line half on the sheet and half clipped is exactly the mistake this is meant to catch before the file is written. Text too small to read at preview scale is greeked into a bar instead of vanishing — annotation that is really on the sheet shouldn't look absent in the picture of it. The dialog widens to two columns to fit the preview, collapsing back to one on a narrow window.

Sheet size offers the ANSI, ARCH and ISO sizes, in either orientation, with a half-inch margin the plot is fitted inside and clipped to. Plot area is the drawing extents, the current view, or a rectangle you pick on the drawing with Pick window (the dialog steps aside for the two corners and comes back with the window filled in).

Scale is the part that has to be exact. Fit to the sheet works out whatever scale makes the plot area fill the page; Exact scale takes a drawing scale — 1/4" = 1'-0", 1" = 20', 1:100 — and plots at precisely that, so a hundred-foot wall at 1" = 20' measures five inches on the sheet. If an exact scale is too large for the sheet the plot still runs, clipped at the margin, and says so before you commit to it.

Color plots monochrome by default: layer colors are chosen to read on the dark drawing area and several of them are nearly invisible on white paper. Plot layer lineweights uses each layer's millimetre lineweight; turned off, everything plots thin. Objects on hidden layers and on layers marked non-printable are left off the sheet entirely — that is what the layer panel's printable toggle is for.

Dimension and text sizes are set by the dimension style, not by the plot. Dimension text is sized in the drawing (paper height × the style's scale multiplier), so a drawing you intend to plot at 1/4" = 1'-0" wants its Dim Style scale set to 48. Plotting at a scale the dimension style was not set up for produces correct geometry with unreadably small or oversized annotation.

Keyboard shortcuts

KeyAction
Enter / Space / right-clickAccept the active command's default action (finish it), or repeat the last command if idle.
EscCancel the active command. Never commits geometry — use Enter/Space/right-click for that.
DeleteErase the current selection.
F8Toggle ORTHO.
F10Toggle POLAR.
Any letter/digit keyJump focus to the command line and start typing (no need to click it first).
C / Close (typed, mid-command)Close a line/polyline back to its start point, for commands that support it.
U / Undo (typed, mid-command)Undo the last point placed in the current command.
Ctrl/Cmd+ZUndo.
Ctrl/Cmd+YRedo.
Ctrl/Cmd+SSave.
Ctrl/Cmd+OOpen.
Ctrl/Cmd+NNew drawing.
Ctrl/Cmd+POpen the Plot to PDF dialog.
Scroll wheelZoom in/out, centered on the cursor.
Middle-dragPan the view.

Command reference

Every command below can be started by clicking its toolbar button, or by typing its canonical name or alias on the command line and pressing Enter/Space. Commands marked ORTHO/POLAR honor tracking and object snap on the picks noted; picks described as identifying "which object/side/piece" are deliberately unsnapped, since snapping would change which piece of geometry you meant.

Draw

LINEalias L

Draws one or more straight segments as independent LINE entities.

Click a first point, then click each next point (repeats). Each segment is added to the drawing as soon as it's drawn, not only when you finish.

Enter / right-click: finish · C/Close: closes the run back to the start (needs 2+ segments already drawn) · U/Undo: removes the last segment and lets you keep going · a typed number after the first point is a distance along the tracked direction · ORTHO/POLAR apply.

PLINEalias PL, P

Draws a single connected polyline entity (unlike LINE, whose segments are independent objects).

Click a start point, then click each next vertex, Enter to finish (needs 2+ points to create anything).

C/Close: closes the shape (needs 3+ points) and finishes · U/Undo: removes the last vertex · a typed number is a distance along the tracked direction · ORTHO/POLAR apply · a repeated point (same spot twice in a row) is rejected rather than silently producing a zero-length segment.

RECTANGLEalias REC, RECTANG

Draws a closed 4-vertex polyline from two opposite corners.

Click one corner, click the opposite corner.

A degenerate rectangle (zero width or height) is rejected.

CIRCLEalias C

Draws a circle. Three construction methods, chosen before the center is picked.

Center-Radius (default): click the center, then click a point or type a number for the radius.

D/DIA/DIAMETER: switch to Center-Diameter — same picks, but the value sets diameter instead of radius · 2P: switch to two-point mode — click each end of a diameter · 3P: switch to three-point mode — click three non-collinear points on the circumference. Degenerate input (zero size, collinear 3P points) is rejected with a prompt, keeping the command open.

ARCalias A

Draws a three-point arc.

Click the start point, click a point the arc passes through, click the endpoint. The three points must be distinct and non-collinear.

A typed number is a directed distance from the previous point · ORTHO/POLAR apply.

Modify

OFFSETalias O

Creates a parallel copy of a line, polyline, circle, or arc at a fixed distance.

If a single offsettable object is already selected, it becomes the source immediately. Otherwise: type (or otherwise supply) the offset distance, click the source object, then click the side you want the copy to appear on.

The side-pick is unsnapped — it only indicates a direction. Only one offset is produced per run; start OFFSET again for another.

TRIMalias TR  /  EXTENDalias EX

TRIM shortens a line/polyline/circle/arc against boundary geometry; EXTEND lengthens an open end to meet boundary geometry. The two share one command flow.

If objects are selected before starting, those act as the boundary set; otherwise every other visible, editable object in the drawing is a valid boundary. Click the portion to remove (TRIM) or the end to extend (EXTEND) — repeat for as many edits as needed.

Enter / right-click / Esc: finish. Picks are unsnapped, since they name which piece of which object is meant, not a coordinate.

FILLETalias F  /  CHAMFERalias CHA

FILLET rounds a corner between two lines/polyline segments with an arc of a set radius; CHAMFER bevels it with a straight cut at set distance(s). Both work on independent LINE entities and on individual polyline segments/corners, and both remember the last radius/distance(s) you used between separate command runs.

Click the first line/segment, then click the second line/segment to complete that corner. The command loops back to "select the first line," so several corners can be cleaned up in one run.

FILLET: type R/RAD/RADIUS first to set the radius · CHAMFER: type D/DIST/DISTANCE first to set the first distance, then a second (defaults to match the first — give a different value for an asymmetric chamfer) · Enter/right-click/Esc: finish · a zero value squares off the corner; negative values are rejected · picks are unsnapped, since each identifies an edge and a side of the corner.

JOINalias J  /  EXPLODEalias X  /  ERASEalias E, DEL, DELETE

JOIN merges compatible selected entities (e.g. collinear/contiguous lines or polyline segments) into one. EXPLODE breaks a polyline or other composite entity into its independent constituent entities. ERASE deletes the selection (also bound to the Delete key outside of any command).

If objects are already selected when the command starts, it applies immediately. Otherwise it prompts "select objects" and applies once you press Enter/right-click.

STRETCHalias ST

Moves the vertices of selected geometry that fall inside a crossing (partial) selection window, reshaping rather than only translating — an ordinary object pick instead moves that whole entity, matching the conventional CAD STRETCH behavior.

Make a crossing-window selection (or pick whole objects), Enter/right-click to confirm, click a base point, then click a destination.

A typed distance, a relative @ point, and ORTHO/POLAR all apply to the destination pick, same as MOVE.

Transform

MOVEalias M  /  COPYalias CO, CP

MOVE translates the selection; COPY duplicates it at an offset, leaving the originals in place.

Select objects (Enter/right-click to confirm, or start with a preselection to skip straight to the base point), click a base point, then click a destination.

A typed distance or relative @ point works instead of a click · ORTHO/POLAR apply to the destination pick.

ROTATEalias RO

Rotates the selection about a base point.

Select objects, click a base point, then either click a point (angle measured from base point to cursor) or type a number of degrees.

R/REF/REFERENCE: rotate by reference — give a current angle (click/type), then the target absolute angle; the rotation applied is the difference · ORTHO applies to the plain-angle pick only, not to reference picks · a net rotation of exactly 0 is rejected.

SCALEalias SC

Scales the selection about a base point.

Select objects, click a base point, then either click a point (factor = distance from base) or type a factor (a trailing x is accepted, e.g. 2x).

R/REF/REFERENCE: scale by reference — give a current reference length (two clicks or a typed length), then the new length; factor = new ÷ reference · a factor of exactly 1, a non-positive factor, or one that would produce invalid geometry is rejected.

MIRRORalias MI

Reflects the selection across a line.

Select objects, click the first point of the mirror line, click the second point, then answer "Erase source objects? [Yes/No] <No>".

Type Y/YES or N/NO, or press Enter to accept the default (No — keep the originals, so the default behaves like a mirrored copy) · ORTHO applies to the second mirror-line point · a mirrored associative dimension stays linked to its mirrored copy of the geometry, not the original.

Annotate

DIMLINEARalias DLI, DIMLIN  /  DIMALIGNEDalias DAL, DIMALI

DIMLINEAR measures a strictly horizontal or vertical distance; DIMALIGNED measures the true distance along the line between the two points regardless of angle.

Click the first extension-line origin, click the second, then click where the dimension line and text should sit.

ORTHO applies to the first two picks, not the placement pick · both origins are captured associatively when snapped onto real geometry, so the dimension updates if that geometry moves later (see LIST for associativity status) · for DIMLINEAR, the placement pick's offset direction determines whether the result reads as horizontal or vertical — an ambiguous placement is rejected with a prompt · requires the current layer to be unlocked and visible.

DIMRADIUSalias DRA, DIMRAD  /  DIMDIAMETERalias DDI, DIMDIA

Radial and diameter dimensions on a circle or arc. DIMDIAMETER only accepts circles — an arc has no real point opposite its diameter, so it's refused with a message pointing you to DIMRADIUS instead.

Click the circle/arc to measure, then click again to set which way the leader points and how far out the text sits.

Neither pick is snapped: the first names an object, the second is a free direction/distance.

TEXTalias T, DT, DTEXT

Places a single line of text.

Click the insertion point → click a point or type a value for height (Enter accepts the current dimension style's text height) → click a point or type degrees for rotation (Enter accepts 0°) → type the text content and press Enter.

ORTHO applies to the height pick · while typing content, Space is a literal space rather than the command terminator, so multi-word text is typed normally.

DIMSTYLEalias DST, DDIM

Opens the Dimension Style dialog (see Units & dimension style) — a direct action, not a drawing command.

Inquiry

Inquiry commands are read-only: they never modify the drawing or create an undo entry.

DISTalias DI, DISTANCE

Reports the distance and angle between two points.

Click a first point, click a second point → a report panel shows Distance, Angle (in the XY plane), Delta X, Delta Y, and both endpoint coordinates.

ORTHO applies to the picks.

IDalias ID

Reports the coordinate of a single point.

Click a point → a report panel shows its X and Y.

AREAalias AA

Computes an area and perimeter, two ways.

Point mode (default): click points one at a time; once 3+ are picked, Enter reports Area, Perimeter, and point count. The polygon shades live as you add points, with a running preview of the closing segment.

Type O/OBJECT to switch to object mode instead: select a single closed polyline or circle and its Area and Perimeter/Circumference are read directly from the entity. Type P/POINT/POINTS to switch back. Switching modes clears any points picked or selection made so far. Point mode requires 3+ points; object mode requires exactly one closed polyline or circle.

LISTalias LI

Reports full geometric detail for the selected entities.

If nothing is preselected, prompts "select objects," then Enter/right-click reports. If you select first and then type LIST, it reports immediately.

Per-type detail: LINE (endpoints, length, angle) · PLINE (vertex count, open/closed, length or perimeter, area if closed) · CIRCLE (center, radius, diameter, circumference, area) · ARC (center, radius, start/end/included angle, arc length, chord) · TEXT (position, height, rotation, content) · DIM (type, measured text and exact value, endpoints, style name, and associativity: Yes/Partial/No, based on how many of its reference points still resolve to live geometry). A multi-entity selection also gets a summary (object count, total length, total area where applicable); only the first 20 entities are detailed, with a count of how many more weren't listed.

Other commands

CommandAliasEffect
ZOOMEXTENTSZ, ZEFits the view to the drawing extents (same as the Zoom Extents toolbar button).
UNITSUN, DDUNITSOpens the Units dialog.
PLOTPLT, PRINTOpens the Plot to PDF dialog. See Plotting to PDF.
SELECTSThe idle mode everything returns to — click to pick objects, drag for a window/crossing selection. Not a drawing command in its own right.