Repository navigation
Open
Labels
area:sketchsketcher and constraint solverin progresssomeone is working on it (see comments)needs-triageno priority yet; a maintainer sorts it with /triage
Milestone
Description
Part of the Drawings plan in #860 (consolidated plan, package W38): sketching on a drawing, on a sheet or on top of a view, with the view's own geometry brought into the sketch.
Supported cases
- Sketches on a sheet or a view:
- a sheet sketch is at paper scale;
- a view sketch belongs to its view: it uses the view's frame and scale, and moves and scales with the view;
- neither ever changes the model or its sketches;
- SolidCraft's own sketch tools, solver and constraints, with dimensions shown on the sheet.
- Projected view geometry: the visible edges of the view a sketch belongs to can be projected into it, as references to the model through W13's references (Drawing W13, W14: references that survive model edits, and updating drawings when the model changes #4892). A projected line follows model edits, times the view's scale. When the model edge is deleted, it keeps its last geometry and reports a lost reference, the way projected sketch links work today (
crates/doc/src/project.rs); it never vanishes. Hidden lines and thread representations aren't projected. - Fills and hatches on closed regions, kept apart from the hatch a section view draws by itself. Also images placed on a sheet.
- Draft views: a view with no model, at its own scale, holding sketches.
- Commands for all of it, starting with
drawing.sketch.create {owner: sheet | view}, with predictable snapping and undo per drawing (Drawing W11, W12, W15: where drawings are saved, their records and their commands #3890).
Non-goals
Section views and their hatch (W34), break-out boundaries (W17), and editing model sketches from a drawing.
Tests
- A 50 mm line in a 1:2 view sketch is 25 mm on paper.
- A line projected from a view edge follows a 10 mm model change at the view's scale.
- Deleting the edge leaves the line at its last geometry, with a lost reference.
- Undo and redo of each sketch edit in the drawing's own history.
- A fill on a closed region exports to SVG and PDF as a fill.
Merge dependencies
W10 (the paper scene, #4890), W12 (drawing records, #3890), W13 (references, #4892), W15 to W18 (commands, the workspace, views and sheets). The sheet sketch can start on records alone; view sketches and projection follow W17's views.
Related: #4563 and #4565 (SS-EN's viewport section hatch) and #2068 (section curves).
Metadata
Metadata
Assignees
Labels
area:sketchsketcher and constraint solverin progresssomeone is working on it (see comments)needs-triageno priority yet; a maintainer sorts it with /triage
Activity
github-actions commentedon Oct 23, 2026
Claimed by @CamWight through #5426. The claim lapses after 14 days without pushes.
CamWight commentedon Oct 23, 2026
The plan
I've claimed this in #5426. Here's how I'd like to build it, posted before any code. It follows the parity study's notes on sketches in drawings, draft views and hatching (the study on #860), and a map of today's sketch code at
main858e599.What a drawing sketch is
Sketch, unchanged, stored in the drawing (Drawing W11, W12, W15: where drawings are saved, their records and their commands #3890's records) with an owner: a sheet or a view. The sketch crate doesn't depend ondoc, so nothing in it changes.add_geometry.The same tools
sketch.*commands and tools work on the active drawing sketch in a drawing session.drawing.sketch.create {owner}anddrawing.sketch.editstart one, andsketch.finishends it.target_sketchandedit_solved), plus about twenty direct reads and writes. They'll go behind one store, chosen by the session's kind, as a small PR tomainwith no change in behaviour, before any drawing slice. About 40 open PRs touch those files, so it's kept small and early.Projecting the view's geometry
Fills and hatches
.patfile import in the same slice. Every number is checked, the counts are capped, a bad line is refused with its line number, and imported patterns are saved in the drawing so it opens anywhere.On paper and in exports
Strokes from the sketch's exact curves, text as filled glyph outlines, fills as fills, and hatches as strokes clipped to their region, all through the paper scene (#4890), so every export gets them. Centre lines wait for the paper scene's line patterns.
The order
main)..patimport..patexport and sketch dimensions shown on the sheet.For anyone working nearby
If anything here clashes with what you're building, tell me and let's fit the two together.
CamWight commentedon Oct 24, 2026
The plan for W38.0, the sketch store: the first slice, its own small PR to
main, with no change in behaviour.Why. The sketch commands find the sketch they work on, and save it back, in about 40 places, each its own way:
target_sketch(16 calls);editandedit_solved(about 50 calls, one store path);active_sketch.ok_or_else(…), with three different refusals;W38a and W38b need these same commands to work on a sheet's or a view's sketch, so first they all go through one door.
The change. One module,
cmd/sketch_store.rs:target: today'starget_sketch, moved;active: each caller keeps its own refusal;readandwrite: the only calls toDocument::sketchandsketch_mutfrom the sketch commands;update: the clone, change and store pattern, written once, doing exactly what the copies do now;checked: the two validatorsedit_solvedandsketch_modifyalready run.editandedit_solvedstay where they are, and load and store through it. Reads and writes that are about the design itself stay as they are, each marked// design-only:: a live drag's display, parameter edits, Redefine Sketch Plane, motion traces and joint references. In W38a,target,readandwritelearn about drawing sessions, and the commands don't change again.What stays the same: behaviour, messages, the file format, every command and parameter, and the solver. So does what each copy checks today: the link and text writes don't start running
checkedhere, because that could refuse an edit that works now.Tests:
navigation.rs's camera-input guard, which names the file and line when a sketch command reaches past the store;Nearby:
sketch_links.rs. If it lands first, W38.0 routes them; if not, the guard test points to them.CamWight commentedon Oct 26, 2026
@0xlillith, a second handover for your team: W38d, fills and hatches on drawing sketches with
.patimport, is yours from now, if you'd like it. Thank you!What it is: a fill or a hatch on any closed region of a drawing sketch, with built-in patterns (solid, ISO's 45° lines and a cross-hatch, angle and spacing editable) and
.patfile import in the same slice..patexport comes later. It stays apart from the hatch a section view draws (W34), which follows material and the standard's angle rules.The plan:
SketchFill { id, sketch, boundary: WholeProfileBoundary, paint }, withpainteitherSolidorHatch { pattern, angle, spacing, offset }. The region is found again from its boundary curves (profile_by_curves) after edits. When those curves are gone, it keeps its last region and reports it, as a lost sketch link does today.Fillitems; hatches as strokes clipped to the region when the scene is built, so every export gets them. New paper kindssketchandfill, on layersSKETCHandFILL..patformat (from the public reference): a header line*NAME, description(the name at most 31 characters, of letters, digits,_,-and$); then one line per family of parallel lines: angle, the x and y of a line through the origin, delta-x (the shift along the line between members), delta-y (the spacing), then up to six dash lengths (positive draws, negative is a gap, zero a dot). At most 80 characters a line; blank lines and text after;are ignored. A.patfile has no units, so import takesunits(millimetres by default) and ascale, and shows the resulting spacing in paper millimetres before it's confirmed: an imperial file read as millimetres comes out 25.4 times too dense.Tests from the plan:
.patwith one 45° family gives the same;One point to settle when you build it: our plan's tests also refuse a file with no blank line after its last pattern (the reference needs one), while the research suggested accepting it with a note. Either is fine with us, as long as it's stated and tested.
What it sits on: fills attach to drawing sketches, which need W38.0 (one sketch store for the sketch commands, #6336, in review on
main) and W38a (sheet sketches: the drawing's sketch record, not built yet). The paper scene is already ondrawings. The pattern model, the.patreader and the hatch lines for a region are plain functions with no drawing record, so they can start straight away, and the record joins them once W38a is in.Claims: please open its own issue and a draft claim from your team, based on
drawings, and link it here. I'll mark the slice as yours in our plan. Happy to help with anything along the way.selun3 commentedon Oct 26, 2026
@CamWight, accepted both handoffs: W38d fills/patterns/PAT and, following your later reply, W38a sheet sketches. Your SVG work and W38b/c/e stay outside our scope. PDF #4890 follows SVG as agreed.
drawings, frozen at4c4f2511. The WIP is now published at53a5dce7for Judit's tool handoff; the PR remains draft and full CI is pending. D1-D3 are locally committed atf4a54531: pattern/PAT model and reader, bounded Line-only clipping/generation and exact dash phase. The actual geom/IO library suites passed 407 tests (119 W38d cases), with 0 failures and 3 existing ignored; fmt, strict scoped Clippy and wasm passed. D484545ae2is now locally committed too: three reader-to-generator integration cases passed within the complete IO suite (144 passed, 0 failed, 2 existing ignored, all 27 PAT cases); formatting and strict scoped Clippy passed. Geom runtime and wasm were not repeated for this test-only delta. D5 now also passes on its exact source: geom289+IO144=433 passed, 0 failed, 3 existing ignored, all145 named W38d cases; fmt, strict scoped Clippy and wasm passed. It adds the documented canonical circles and one concentric hole only. Full CI remains pending the runner question below; W38d is not complete.72dfdb53; independent source review and Engine: one sketch store for the sketch commands (W38.0, #5425) #633607984653integration limits are recorded in Drawing W38a: sheet sketches and read-only source expressions #7082.For W38d we require a real final blank PAT line and document the choice. We ship only original patterns/tests. The later saved-fill resolver will preserve outer-plus-holes identity; today's outer-only
profile_by_curvesmatch must not silently refill a deleted hole. Bounded Line regions plus the documented canonical circles/one concentric hole are implemented and validated; general curves and saved records/paper output remain later slices.One gate prerequisite to coordinate: the frozen
drawingsrunner launches all test binaries plus wasm/doc concurrently. Our machine uses one builder and one heavy command at a time; Cargo/libtest job limits alone do not bound that runner. The existingxtask/src/test.rschange from merged #5494 providesSOLIDCRAFT_TEST_JOBS=1, with the native binaries and wasm/doc in one queue. Its old blob is exactly this branch's runner. Can we bring only that runner change into Drawings as a separate prerequisite, preserving its attribution? We would validate the actual receiver with the normalcargo xtask ci; no foreign runner or substitute gate. Focused library work continues while this is settled.Tool handoff: Judit has asked us to stop and preserve all work. Code, tests, results and next steps are saved in #7064, #6184, #6163, #7082 and the RFC checklist. The local team and automatic follow-up are stopped. Existing questions remain open; no additional execution or gate waiver is implied.
Current follow-up: the same prerequisite on the PDF base
Cam, Judit has resumed the team on the assigned Drawings units; the older tool-stop note above is historical. We are now preparing the independent P2 test-only helpers against the actual #7626 head
506d4190, leaving your B1/text contract pending. The full local gate passed on the separate DXF draftd8e7a869; that result does not qualify this PDF source.The PDF base still has the parallel runner. Source comparison confirms its runner matches the original old blob
799c820f7d1b346bc788c27814a96db29c6355fdfrom #5494. The original one-file change produces blob3837d49e80325598735b540b84dc828d634246b1, including its four original tests, and needs no dependency/main/workflow change. We can preserve its attribution and extract just that file; the aggregate integration commits would not be adopted.Your answer to the existing single-runner prerequisite question above is still pending. We have prepared only a private source proposal and have not changed the PDF runner or used a substitute gate. Real dependency resolution and focused prototype validation can proceed separately; full
cargo xtask cion this receiver remains pending that legitimate serial route. W38 WIP is preserved, while the current delivery priority stays with the assigned W10/W21/W22 and DXF units.For a reviewable source reference, the isolated original #5494 runner delta is now stored in the canonical repository proposal branch, commit
e65a33d3e3dfd36911b782df578e8b491dd1341f. It remains a proposal, unapplied to the PDF candidate and unexecuted. The existing owner question above is still pending; this checkpoint is not a gate waiver or an execution request.56 remaining items
Drawing sheets: edit and export drawing-owned sketches
Drawings: a sketch on a drawing can belong to a sheet or to a view (t…
Drawings: say where a view sketch's coordinates start (tangency-labs#…
Sketch: a link can name a model edge as a drawing view draws it, and …
Drawings: deleting a view says which sketches went with it; texts nam…
Drawings: a sketch on a drawing can belong to a sheet or to a view (t…
Drawings: say where a view sketch's coordinates start (tangency-labs#…
Sketch: read a planar edge into link curves, and apply a found link's…
Drawings: a view sketch's linked edge follows the model and keeps its…
Drawings: a flat pattern view's sketch holds no link to the model's e…
Drawings: a sketch on a view is drawn at its view's scale and moves w…
Drawings: deleting a view says which sketches went with it; texts nam…
Drawings: a sketch on a drawing can belong to a sheet or to a view (t…
Drawings: a sketch on a view is drawn at its view's scale and moves w…
Drawings: deleting a view says which sketches went with it; texts nam…