Skip to content

Drawing W18: sheets, borders, title blocks and drawing templates #3875

Open

Description

@CamWight

Part of #860: package W18 of the consolidated plan. It covers sheets, their borders and title blocks, and the drawing templates they start from.

What exists today

What this adds

The model is set out in sections 18.3 and 18.10 of the drawings study. In short:

  • Sheets: A0 to A5, US sizes and custom sizes, either orientation; one kind of drawing, whatever it shows.

  • Sheet border and drawing border: the sheet border is the paper's edge. The drawing border is an editable outline inside it, laid out as ISO 5457 describes, with grid references and centring marks.

  • Title block: an object of its own, separate from the drawing border, with typed fields whose sources can be configured. By default:

    • name, description, material and mass come from the sheet's component. Each sheet names the component it documents, set from the first view placed on it, and it never changes by itself.
    • The drawing number defaults to the first sheet's component's name.
    • Scale, sheet n of m, projection symbol and paper size come from the drawing.
    • Revision, designer, checker and date come from the newest row of the revision table.

    An override is marked.

  • Anchors: borders, title blocks and sheet tables keep their places when the sheet size changes. An A3 title block is still in its corner on A2.

  • Drawing templates: sheets, borders, title blocks, notes and any sheet tables to start from. A user can set one default template for drawings of parts and one for drawings of assemblies.

It depends on W12 (saved drawing and sheet records), which follows the storage decision G3 / W11, on W10 (the paper scene) and on W15 (the commands). The plan, with the slices that don't have to wait for those and tests whose values can be worked out by hand, follows here as a comment.

Related

Refs #860

Activity

  1. added
    needs-triage
    in progress
    on Oct 20, 2026
  2. github-actions commented on Oct 20, 2026

    @github-actions
    Contributor

    Claimed by @CamWight through #3877. The claim lapses after 14 days without pushes.

  3. CamWight commented on Oct 20, 2026

    @CamWight
    ContributorAuthor

    Plan

    Sources. Sections 3.1-3.8, 3.21, 3.22, 11.3, 11.4 and 18.10 of the drawings study. The W18 row of the consolidated plan, with its W10, W12 and W40 rows. #2968, a TCVN sheet export that isn't saved in the design.

    Scope. W18: sheet sizes, the sheet border and the editable drawing border, title blocks with typed fields, anchors that keep things in place when the sheet size changes, and drawing templates. W18 depends on W10 (the paper scene), W12 (saved records) and W15 (commands); W12 and W15 are now #3890. So the first wave is definitions and layout as data, below io, and nothing is saved in a design until W12 exists.

    Wave 1: definitions and layout

    1. Sheet sizes and the drawing border.
      • Sizes:
        • ISO A0 to A5, and elongated ISO sizes by name;
        • Letter, Legal, ANSI A to F, and architectural;
        • custom sizes, finite and capped at 5,000 mm.
      • Landscape by default.
      • The border is a rule computed from a profile and the size, not stored lines. In the ISO profile, following ISO 5457:
        • a 20 mm filing margin on the left and 10 mm elsewhere, with a 0.7 mm frame;
        • centring marks;
        • 50 mm grid fields counted from the centring marks, with the leftovers in the corner fields;
        • letters without I and O, and numerals; A4 has the grid on its top and right only;
        • trimming marks.
      • The output is paper primitives (lines with widths, text with heights) for any writer.
      • Tests:
        • A3 landscape is 420 × 297 mm with a 390 × 277 mm drawing space;
        • its long side has four 50 mm fields right of centre, and three plus a 40 mm field to the left; its short side has two 50 mm fields plus 38.5 mm each way;
        • letters run A to F and numerals 1 to 8;
        • zero, negative, non-finite and over-cap sizes are refused.
    2. Title-block definitions and fields.
      • A definition holds cells, fixed text, fields {source, key, format} and prompted entries.
      • Field sources: the sheet's component (name, description, material, mass, finish, properties); the drawing (number, scale, sheet n of m, projection, paper size); and the newest revision row.
      • A missing or stale source shows a marker, never an old value as current. An override is marked. Literal and live text can share one string.
      • Built-ins are generated in code, never copied: an ISO 7200 block, 180 mm wide, in our own layout, holding ISO's mandatory fields. A company example definition follows the questionnaire answers, as the consolidated plan suggests.
      • Tests:
        • the block is 180.000 mm wide;
        • a mass field for a 100 × 50 × 10 steel block reads 392.5 g;
        • sheet 2 of 3 reads "2/3";
        • a 40-character title warns and is never truncated.
    3. Drawing templates as data.

    Wave 2: on saved drawings (after #3890)

    • Sheets in a drawing (drawing.sheet.add, .set, .reorder, .delete). Each sheet names the component it documents: it's set from the first view placed, can be changed, and never switches by itself. The drawing number defaults to the first sheet's component's name.
    • Anchors: changing A3 to A2 regrows the border, keeps the title block in its corner and keeps snapped tables on it. Anything that would fall outside the frame is listed, never moved silently.
    • Templates in use (drawing.create {template}, drawing.template.save, .list, .apply, with a diff).
    • Title-block logos, embedded and refused rather than shrunk.
    • The sheet page (White, Warm or Theme paper with a soft shadow) and the editors for borders, title blocks and templates (W16, W40), after the redesign (Ribbon redesign: implementation tracker #2016).

    Tests

    • Hand-derived values from the ISO 5457 table.
    • Boundary cases: every size in both orientations, custom sizes at the cap and just over it, margins wider than the sheet, and zone letters past Z.
    • Planted faults.
    • Property tests: every frame lies inside its paper, and the grid fields cover the frame exactly.
    • wasm.
    • Screenshots once anything is visible.

    Owned paths: a new drawing module below io (crates/doc/src/drawing/ or the name W10 settles), plus its tests.

    Coordination.

  4. CamWight commented on Oct 21, 2026

    @CamWight
    ContributorAuthor

    Progress: sheet sizes and the drawing border

    As on #3874, the steps stay small and separate, but I'm holding them back from review for now. Until then #3877 stays a draft (the claim) and collects them, one commit per step, and I'll post each one here as it's done.

    Done: sizes and the ISO 5457 border (the first part of S1)

    Commit on #3877: sheet sizes and the border.

    • Sizes. ISO A0 to A5, Letter, Legal, ANSI A to F, architectural A to E1, and a custom size (finite, above 0 and at most 5,000 mm a side). Each sheet is landscape by default, and every size can be turned either way.
    • The border is a rule, not fixed geometry. A border profile is worked out for each sheet: the frame inside the margins, and the reference fields with their labels. The built-in ISO profile:
      • a 20 mm filing margin on the left and 10 mm elsewhere, with a 0.7 mm frame;
      • fields of 50 mm out from the centre lines, with the corner fields taking what's left;
      • rows lettered from the top without I and O (then AA, AB and on, for big custom sheets), and columns numbered from the left;
      • an A4 sheet labelled on its top and right only.
    • A profile can divide the frame into equal fields instead (1 to 200 each way), or have no grid.
    • Where it lives: crates/geom/src/sheet.rs, next to the section records, so saving, rendering and export can all use it. Nothing is saved or drawn yet: there's no command and no format change, so there's nothing to show in the app.

    Tests (11, hand-derived):

    • every size in published millimetres, both ways round;
    • A3 landscape: a 390 x 277 mm frame at (20, 10); columns 40 + 7 x 50 mm, labelled 1 to 8; rows 38.5, 4 x 50, 38.5 mm, labelled A to F;
    • the standard's field counts, A0 24 x 16 to A4 6 x 4, at both orientations; A1's corner fields are 50.5 and 60.5 mm;
    • A4 labelled on its top and right only;
    • an 8 x 6 equal division of A3: 48.75 x 46.17 mm fields;
    • row letters without I and O, past Z;
    • hostile sizes and profiles refused: sides of 0, negative, NaN, infinite or just over 5,000 mm; margins that leave no drawing space or put the centre line outside the frame; a frame line of 0 or over 10 mm; fields under 1 mm or over 1,000 mm; 0 or 201 equal fields. The limits themselves are accepted;
    • unknown JSON fields refused;
    • rounding noise just past a whole number of fields leaves no hair-wide field;
    • a sweep of more than 1,000 sheets, margins and grids: the fields tile every frame exactly, every field is wider than zero, the labels are unique, and with the ISO rule the centre line is always a field edge.

    Thirteen planted faults were each caught (for example rows numbered from the bottom, the filing margin on the right, A4 labelled on every side, the smaller half setting the field count). Clippy and the wasm32 build are clean.

    Next

    The rest of S1: the centring and trimming marks. Then S2, title-block definitions and their fields.

  5. CamWight commented on Oct 22, 2026

    @CamWight
    ContributorAuthor

    Plan update (2026-10-22)

    A few things have changed since the plan, from re-reading the standards first-hand, an architecture review of all the drawing work, and the questionnaire answers. If you're starting anything near sheets, borders, title blocks or templates, this is the plan to follow, and I'd be glad to hear from you here first.

    Sheets and the drawing border (item 1)

    • Centring and trimming marks follow ISO 5457:1999, read in its identical public adoption, IS 10711:2001 (clauses 4.2 to 4.5, figures 4 to 6):
      • the grid reference border sits 5 mm outside the drawing border;
      • centring marks run from it to 10 mm inside the drawing border, on the sheet's centre lines;
      • each corner has two overlapping 10 x 5 mm trimming rectangles, kept in the margin.
    • The labelled sides are a rule for each sheet (ISO's: the top and right of A4, every side of the others), so one profile labels every size correctly when a template changes the sheet.
    • A profile can be checked on its own, when it's read from a template or a saved drawing, as the section records are.
    • The code uses the glossary's words: sheet border and drawing border (not paper and frame).

    Title blocks (item 2)

    • ISO 7200:2004, read in its identical adoption IS 11665:2009:
      • the eight mandatory fields: legal owner, identification number, title, approval person, creator, document type, date of issue, sheet number;
      • its character counts, used as warning lengths and never to cut;
      • 180 mm wide, the same block on every size.
    • A cell holds a list of parts: text, a field (source, key, format) or a formula with parameters. So "Sheet 2 of 3" needs no template syntax.
      • An override keeps its source value.
      • A field with no value shows "-", never an old value.
      • Cells can also hold a picture (a logo), a symbol (the projection symbol, drawn in code) or wrapped multi-line notes.
    • What goes in the block (the questionnaire answers):
      • the projection symbol, a units statement and a general tolerance note;
      • not the scale (only detail and section views carry their scale).
    • Display preferences:
      • mass in the user's unit, kg to 2 decimals by default;
      • dates stored as ISO 8601. A new drawing takes the device's date format: the region set in Windows, macOS or Linux, or the browser's format in the web app, with Unicode CLDR's locale data giving the order for a region. It keeps that format, so it prints the same dates on every computer, and it can be changed per drawing or overridden in the preferences.
    • Built-ins: the ISO 7200 block, plus a fuller company-style example (contract, material and finish rows, a notes box, the general tolerances, the projection symbol, customer, drawing number, sheet n of m, title) with neutral labels.
    • Shared with Drawing W24–W26: bill of materials, sheet tables (parts lists) and balloons #3874's parts lists: one cell module (fields, overrides, the "-" marker, warnings) and font metrics read once.

    Templates (item 3)

    Output

    DXF output for borders, title blocks and tables needs line widths, fills and text alignment, which overlaps W10 on #860. That's being coordinated there first.

    The draft PR #3877 carries the claim, and its commits stay small, one slice each.

  6. CamWight commented on Oct 22, 2026

    @CamWight
    ContributorAuthor

    Plan update: title blocks (2026-10-22, later)

    A follow-up to today's update, with three more decisions:

    • The company-style example gets a new, general layout. The arrangement described above is dropped. A fresh one will be designed and shown from the app before it's committed. The ISO 7200 built-in is unchanged.
    • Created by, Approved by and Date of issue come from the newest row of the revision table. That way the title block and the revision table always agree; ISO 7200 gives the date of issue as each released revision's date. Until revision tables exist, they show "-".
    • Dates: each platform's own setting gives the device's format. Where only a locale name is known, as on Linux, a small table of our own derived from Unicode CLDR gives the order, credited in ATTRIBUTION.md. Scripts and the CLI always use ISO 8601, so their output is the same on every computer.

    Text measurement goes to main first, as its own small PR: #4813, claimed in #4815. Title-block cells and parts-list columns will both measure text with the rule that draws it.

  7. CamWight commented on Oct 22, 2026

    @CamWight
    ContributorAuthor

    Progress: centring and trimming marks

    Done: the rest of item 1

    Commit on #3877: ISO 5457's centring and trimming marks. The branch is rebased onto today's main, so the first part is now sheet sizes and the border.

    • The grid reference border sits 5 mm outside the drawing border, with the field labels between the two.
    • Four centring marks run on the sheet's centre lines, from the grid reference border to 10 mm inside the drawing border.
    • Each corner has a trimming mark of two overlapping 10 × 5 mm rectangles, in the margin outside the grid reference border.
    • Which sides are labelled is now a rule for each sheet: ISO 5457's (the top and right of A4, all four sides of the others), or fixed sides. One profile labels every size correctly when a template changes the sheet.
    • A profile can be checked on its own when it's read, apart from the sheet it's laid out on. Refused: a grid border that isn't finite or is wider than a margin; a centring mark past the sheet's centre lines; a trimming mark wider than it is long, or wider than the margin left.
    • The names follow the glossary: the module is drawing_sheet (in this codebase "sheet" alone means sheet metal), with sheet_border and drawing_border rather than paper and frame.

    Tests: 13 sheet tests, with hand-derived positions for A0 to A4 in both orientations, a drawing border with a deeper bottom margin (so a centre line isn't confused with the border's centre), JSON in every form, and hostile values. 24 planted faults, all caught. Clippy and the wasm build are clean. Nothing is saved or drawn yet, so there's nothing on screen.

    Next

    Title blocks (item 2): the ISO 7200 block and a general company-style example, cells bound to fields with "-" for a missing value, and text measured with the rule that draws it (#4813). The updated plan.

  8. CamWight commented on Oct 23, 2026

    @CamWight
    ContributorAuthor

    A plan update from a prototype of the sheet in today's app, with the new UI. Three changes to the built-in sheet:

    • No trimming marks. The filled corner blocks use a lot of ink for little use, so the built-in sheets draw none. A profile can still ask for them.
    • Centring marks stop at the drawing border. They run from the grid reference border to the drawing border and no longer reach into the drawing area, where on A4 they crossed the tables.
    • Margins are 10 mm all round, with an option to add ISO 5457's 20 mm filing margin on the left for drawings that get bound.

    All three go into #5108 as one more commit.

  9. 179 remaining items

  10. DevonHope commented on Nov 12, 2026

    @DevonHope
    Contributor

    Proposal: import a template from another program's DXF or SVG

    Many users already have a company title block made in another CAD program. They'd like to bring it into SolidCraft instead of redrawing it. Before writing code, I'd like to agree on the shape here, since it touches the title block and template work in this issue.

    Scope: open formats only. We'd read DXF (Autodesk's published DXF reference) and SVG (W3C). Nearly every CAD program can export its sheet format or title block to DXF, and FreeCAD's TechDraw templates are SVG. We wouldn't read proprietary template files (.slddrt, .dwt/.dwg, .idw), and we wouldn't ship third-party templates. Test fixtures would be hand-written from the specs.

    Proposed command: drawing.template.import. It takes file, layout?, units?, fields?, path and dry_run?, and writes an ordinary .json template. drawing.create and drawing.template.apply then take that template unchanged. It works in these steps:

    1. Read. The existing DXF and SVG readers, with two DXF additions: paper space (choosing a layout, the first by default) and ATTDEF/ATTRIB. Today crates/io/src/dxf.rs skips paper space, which is where AutoCAD-style title blocks usually sit.
    2. Size the sheet. Match the drawing's extents to an ISO or ANSI size within 2 mm, or keep a custom size. With no $INSUNITS, ask for units.
    3. Fixed line work and text become a new sheet format graphics layer on the sheet: paths and text in paper mm, painted under the views. This is one drawing-format pending file, and the paper scene draws it, so SVG, PNG and PDF export get it for free.
    4. Fields. DXF attribute tags and SVG text marked as a field (FreeCAD's documented freecad:editable name, or a data-field attribute) become title-block fields. Common tags map to SolidCraft's fields through a small table the caller can override, for example TITLE, DWG_NO, DATE, SCALE, SHEET and REV. Unknown tags become custom drawing properties, so nothing is lost.

    Suggested order, one PR each: (a) sheet format graphics in the record, the paper scene and template save/apply; (b) SVG import; (c) DXF paper space and attributes; (d) a UI entry beside Apply Template, coordinated with the Drawing workspace work.

    Questions:

    • Is a separate sheet-format graphics layer acceptable, or should imported line work go somewhere that already exists (for example the sheet sketches in Drawing W38a: sheet sketches and read-only source expressions #7082)?
    • Should imported fixed text stay editable, or be locked like the line work?
    • Is a custom sheet size fine, or should imports snap to the nearest standard size?

    I'm happy to take (a) and (b) if the shape works for you.

  11. CamWight commented on Nov 12, 2026

    @CamWight
    ContributorAuthor

    Thanks @DevonHope, this is a really useful proposal. Company title blocks come up a lot, and keeping it to open formats is the right line. Here's how it fits what's on drawings today.

    Where things stand. A title block is a grid of cells. Each cell has a label and a value: text with fields, a logo, or the projection symbol. Templates are drawings with no model, so drawing.template.save, .apply and .list already read and write them like drawings. Free line work and free text have no home in a block yet, so your question about a new layer is the right one to start with.

    1. Where the imported line work goes. We'd suggest sheet sketches (#7082) rather than a separate layer. A second kind of line work on the sheet would need its own drawing, export and selection code, beside the sketches. Imported line work fits as a locked sheet sketch, and it exports through the same paper scene. @0xlillith is building #7082. If it isn't close yet, (a) could start as a small locked group that sheet sketches take over. That's worth agreeing with them before (a) starts.

    2. Fixed text. Locked, like the line work. In a title block, editing happens in the fields. Fixed text is part of the format, and the dry run lets people check it before they import. An unknown tag becoming a drawing property, as you suggest, means nothing is lost.

    3. Sheet size. Custom sizes already work (SheetSize::Custom, up to 5000 mm a side). Your rule seems right to us: snap to an ISO or ANSI size within 2 mm, otherwise keep the custom size. The dry run should say which it chose, so a template 3 mm off A3 doesn't surprise anyone.

    DXF. @0xlillith is also reworking DXF: #5318 to #5321, with a layered reader that keeps file metadata (#8515). Paper space and ATTDEF/ATTRIB would sit best on that reader, so (c) should follow it. A short note with them on the order would save a rebase.

    SVG and FreeCAD's templates. Going by the published SVG spec and FreeCAD's documented editable attribute is fine for us. Hand-written fixtures, and no third-party templates shipped, as you say.

    Happy for you to take (a) and (b). If you open a draft PR for (a) as the claim, we'll review the record and paper-scene parts there.

  12. CamWight commented on Nov 13, 2026

    @CamWight
    ContributorAuthor

    Progress for the first drawings build: a title block's cell text is on paper on drawings now (f1cc6e7). That covers the values, the wrapping in each cell and the projection symbol. The warnings that are left (a note when a label is wider than its cell, and two Check Drawing findings) come after the first ship. Their plan is ready for then.

  13. zalyaloffb-oss commented on Nov 23, 2026

    @zalyaloffb-oss

    For exhibition stand and furniture drawings, please support creating, editing and reusing our own drawing templates directly in the app: configurable sheet sizes and orientation, an outer border with adjustable margins, a custom title block and company logo, and optional parts list placement. The template should allow editable and automatically filled project, drawing number, scale, sheet and date fields; Cyrillic text and user-selected fonts, including GOST type A; adjustable line weights and dimension styles; and reliable PDF/DXF export. Reusable variants for assembly and fabrication drawings, and saving one as the default, would save considerable setup time. This would also help users build ESKD-style layouts where needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in progressneeds-triage

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions