Repository navigation
Description
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
mainhas no drawing document or sheets yet. The nearest thing is the flat-pattern page for sheet metal.- MCP: inspection and verification tools for AI agents, and standard DXF layer lineweights #2968 (@nguyenthanhthe) exports a one-off sheet to DXF: an ISO 5457 / TCVN frame, a title block and views. It isn't saved in the design. Its sizes, frame rules and title block cells are worth sharing with this work rather than duplicating, and I'd be glad to line the two up.
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
- MCP: inspection and verification tools for AI agents, and standard DXF layer lineweights #2968: sheet export to DXF.
- Drawing W24–W26: bill of materials, sheet tables (parts lists) and balloons #3874: the bill of materials, parts lists and balloons (W24 to W26). Sheet tables snap to the drawing border and title block.
Refs #860
Activity
github-actions commentedon Oct 20, 2026
Claimed by @CamWight through #3877. The claim lapses after 14 days without pushes.
CamWight commentedon Oct 20, 2026
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
{source, key, format}and prompted entries.Wave 2: on saved drawings (after #3890)
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.drawing.create {template},drawing.template.save,.list,.apply, with a diff).Tests
Owned paths: a new drawing module below
io(crates/doc/src/drawing/or the name W10 settles), plus its tests.Coordination.
CamWight commentedon Oct 21, 2026
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.
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):
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
wasm32build are clean.Next
The rest of S1: the centring and trimming marks. Then S2, title-block definitions and their fields.
CamWight commentedon Oct 22, 2026
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)
Title blocks (item 2)
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.
CamWight commentedon Oct 22, 2026
Plan update: title blocks (2026-10-22, later)
A follow-up to today's update, with three more decisions:
Text measurement goes to
mainfirst, 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.CamWight commentedon Oct 22, 2026
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.drawing_sheet(in this codebase "sheet" alone means sheet metal), withsheet_borderanddrawing_borderrather 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.
CamWight commentedon Oct 23, 2026
A plan update from a prototype of the sheet in today's app, with the new UI. Three changes to the built-in sheet:
All three go into #5108 as one more commit.
179 remaining items
Drawing title blocks: a logo in a cell, in place of its text (tangenc…
Drawing title blocks: a logo on paper, under the block's lines (tange…
Drawing title blocks: a template brings each logo file in once, and a…
Drawing title blocks: a logo cell shows its label but no value over t…
Drawing title blocks: a cell can show your company logo on every sheet (
Drawing title blocks: Check Drawing's empty fields read each field's …
DevonHope commentedon Nov 12, 2026
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 takesfile,layout?,units?,fields?,pathanddry_run?, and writes an ordinary.jsontemplate.drawing.createanddrawing.template.applythen take that template unchanged. It works in these steps:crates/io/src/dxf.rsskips paper space, which is where AutoCAD-style title blocks usually sit.$INSUNITS, ask forunits.freecad:editablename, or adata-fieldattribute) 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:
I'm happy to take (a) and (b) if the shape works for you.
CamWight commentedon Nov 12, 2026
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
drawingstoday.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,.applyand.listalready 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
editableattribute 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.
CamWight commentedon Nov 13, 2026
Progress for the first drawings build: a title block's cell text is on paper on
drawingsnow (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.Drawing sheets: a grid reference border on the drawing border or at l…
Drawing sheets: a grid reference border on the drawing border or at l…
Drawings: the title block's projection symbol draws its centre lines (t…
Drawing sheets: a grid reference border on the drawing border or at l…
Template import: writes one .scdwg template, a .json name getting it …
zalyaloffb-oss commentedon Nov 23, 2026
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.