Repository navigation
Description
What are you trying to do
Lay out a weldment frame, or a frame line that leaves the base plane, in a 3D sketch, and drive its sizes with dimensions and parameters, as a 2D sketch does.
Today a 3D sketch line, arc or point is a set of world points (Wire.fit). The sketch solver never sees it, so none of these work:
- a length, distance or angle dimension on it;
- a parameter expression in its coordinates (
sketch.line3dtakes plain numbers); - a Coincident, Parallel or Perpendicular on it, or keeping it horizontal along an axis;
- attaching its end to a model face, edge or vertex. Snapping while drawing copies the position and keeps no link.
The only way to change it is to move its points (sketch.move3d, or the triad in the view).
For a frame this breaks parametric design. In the 150 SHS beam below, the runner's line is drawn in a 3D sketch at z = 150, on the tube top. After shs changes from 150 to 120, the tube, plates, end cap and gussets follow. The runner stays at z = 150 and floats 30 mm above the tube:
Steps (any frame made from a 3D sketch):
- A parameter
shs = 150 mm; aframe.memberrect tubeshs×shsalong a 2D line on XY, anchored at the bottom. - A 3D sketch with
sketch.line3dfrom[1750, 0, 150]to[3130, 0, 150], then aframe.memberon it. - Change
shsto120 mm.
Expected: the line can be tied to the tube top (on its face, or dimensioned shs above the base) and follows it.
Actual: it stays at z = 150, and nothing in the sketch can tie it.
The workaround is to split a 3D frame into several 2D sketches on planes and faces, each dimensioned on its own. A frame that turns corners in 3D (a chassis, a space frame, a handrail) then needs one sketch per plane, and the lines that join them still can't be dimensioned.
Related: #8042 (#8035) makes the 3D commands reachable from the ribbon and notes that 3D wires are not in the solver. #741 (planar loops of 3D curves as profiles), #7831 and #7832 (3D curves as model geometry) and #4003 (frames, which take 3D sketch lines) are related but don't cover dimensions or constraints.
How you imagine it working
The common parametric CAD convention: a 3D sketch is solved like a 2D one, with points that have x, y and z.
Solved 3D geometry. Drawn 3D lines, arcs and points become solver entities with 3D points. Lines drawn one after another share their joint (a coincident). Fit splines can follow later; their fit points could be solver points too.
Constraints, under the existing sketch.constraint.* commands where the idea is the same:
- Coincident: point to point, point on a 3D line or arc, and point on a plane or planar face (to put a frame corner on a face).
- Fix.
- Parallel, perpendicular, collinear and equal between 3D lines.
- Along an axis: a line parallel to world X, Y or Z, the 3D counterpart of horizontal/vertical, and the constraint frames use most. Also a line parallel to a plane or face.
- Tangent between a 3D line and a 3D arc. That gives a bent tube path (Create bent chassis tubes along connected sketch curves (#9792) #9793) with a dimensioned bend radius.
- Attachment to model geometry: an end on a vertex, edge or face that follows it, using the face anchors plates and gussets already persist.
Dimensions (sketch.dimension with 3D references), each taking expressions:
- the true length of a line, or the distance between two points;
- the distance between two points along X, Y or Z only. A frame is dimensioned mostly by its run along each axis;
- the distance from a point to a plane or planar face;
- the angle between two lines, and between a line and a plane;
- an arc's radius.
Drawing. While a 3D line is drawn, a segment close to an axis direction snaps to it and gets the along-axis constraint, as a 2D line gets horizontal/vertical. The plane being drawn on can be switched. Drawing on a plane inside the 3D sketch adds a constraint keeping those points on it.
Solver. The constructive pass and branch keeping (so edits don't flip the sketch) extend to 3D. Under- and over-constrained 3D sketches are reported as 2D ones are (degrees of freedom, refusal of conflicting constraints).
Format and compatibility. Existing designs keep their 3D wires as fixed points, with no constraints, so they evaluate as before. The design-format change is one pending file. Commands keep their ids; 3D refs are new fields.
Agents and scripts. sketch.line3d and its siblings accept parameter expressions in point coordinates, and constraint/dimension replies use the same created ids as in 2D. A frame can then be built and edited over MCP without face indices.
Suggested order, one PR each: (1) 3D points, lines and arcs in the solver, with coincident joints, fix and the along-axis constraints; (2) dimensions: length, axis distances, point to plane, angle, radius; (3) parallel, perpendicular, equal, tangent, on plane; (4) attachment to model faces, edges and vertices; (5) drawing aids (axis snapping, drawing plane).
Scope
Worked out from the current sketch code (crates/sketch/src/wire.rs, solver.rs, model.rs, and Document::solve_sketch).
How it is built
- What is solved. The fit points of curves drawn in a 3D sketch (
Wire.fit): a point has one, a line two, an arc three (start, through, end), a spline its fit points. Included, projected and intersection wires (those with alink) stay reference geometry and are never moved; a constraint may use their points as fixed. - Its own pass, after the 2D solve.
Document::solve_sketchsolves the planar sketch as today, then solves the 3D constraints with the sketch's 2D points fixed. A 3D point can lean on 2D geometry; 2D geometry never moves because of a 3D constraint. A sketch without 3D constraints solves exactly as before, and every existing 2D sketch is unchanged. - Stored separately.
Sketch.wire_constraintsholds the 3D constraints and dimensions (id,kind,param,driven), so the 2DConstraintKindand its solver are untouched. Ids come from the sketch's own counters, so one constraint or dimension id names either kind. - References. A 3D point is
<wire>.start,<wire>.end,<wire>.through(arc) or<wire>.<n>(fit point n). A whole curve is its wire id. These sit beside the 2D refs (l1.end), and commands take either. - Coordinates. A wire keeps its
space(component or world). Axes and planes mean that space's axes and planes: a sketch in a component is constrained in the component's frame. A constraint between wires in different spaces is refused. - Joints. Curves drawn end to end from now on get an explicit coincident constraint at their joint. Old designs have no 3D constraints, so their wires stay where they were saved and evaluate as before; their joints keep today's rule (points at the same place move together). Moving a point (
sketch.move3d, the triad) solves the constraints and moves what they tie to it. - Solver. A damped least-squares solve on the 3D unknowns, per connected group, using the sketch crate's existing linear algebra. It reports remaining degrees of freedom and conflicting constraints like the 2D solve, and refuses a new constraint that conflicts. From the stored state it keeps branches (which way an angle opens).
- Commands. The existing ids:
sketch.constraint.coincident,.fix,.parallel,.perpendicular,.equal,.tangent,.collinearandsketch.dimensiontake 3D refs. The new ideas get new ids:sketch.constraint.along_axisandsketch.constraint.on_plane. Each has input and output schemas. The design-format change is one pending file per PR that adds stored fields.
Steps (one PR each, stacked, each its own sub-issue)
- Solver and basic constraints: 3D points, lines and arcs as solver geometry; coincident (point to point, point on a 3D line), fix, along X/Y/Z; joints made when drawing; degrees of freedom and conflicts reported;
sketch.move3dsolves. - Dimensions: true length of a line, distance between two points, distance along X, Y or Z, angle between two lines, arc radius. Each driven by an expression or parameter, or driven (reference).
sketch.line3d,.arc3dand.point3dtake expressions in point coordinates. - More relations: parallel, perpendicular, collinear and equal length between 3D lines; tangent between a 3D line and a 3D arc; a line parallel to an origin or construction plane; a point on such a plane, with the distance and angle dimensions to planes.
- Attachment: a 3D point on a model vertex, edge or face, or on a 2D curve or point of the same sketch, following it through edits (the face anchors already used by plates and gussets).
- In the view: 3D constraint glyphs and dimensions drawn and editable in the viewport (double-click a dimension); drawing snaps a segment close to an axis to it and adds along-axis; the drawing plane can be switched.
Steps 1–4 are usable from scripts, MCP and solidcraft-cli, with a basic display of what they add; step 5 makes them comfortable in the view. Not in scope: splines' tangent handles, curvature continuity, 3D sketch patterns and mirrors, and model-level 3D curves (#7831, #7832).
Done when
The 150 SHS beam above is built with its runner on a 3D sketch line constrained to the tube top and dimensioned from the far end, and changing shs or len moves it with the tube, from a script and in the app.
Sub-issues
- 3D sketch: drawn 3D points, lines and arcs as solver geometry, with coincident, fix and along-axis #10613 Step 1: solver geometry, coincident, fix, along-axis
- 3D sketch: dimensions on 3D lines, points and arcs #10614 Step 2: dimensions
- 3D sketch: parallel, perpendicular, equal, tangent and on-plane relations #10615 Step 3: parallel, perpendicular, equal, tangent, on plane
- 3D sketch: attach 3D points to model geometry and to the sketch's 2D curves #10616 Step 4: attachment to model and 2D geometry
- 3D sketch: constraints and dimensions in the view, axis snapping while drawing #10617 Step 5: in the view, axis snapping

Activity
github-actions commentedon Nov 1, 2026
Claimed by @Karl-VonRichter through #10609. The claim lapses after 14 days without pushes.
48 remaining items
3D sketch: full-precision angles, refuse only own 3D failures (tangen…
3D sketch: lines drawn off the sketch plane can be joined, fixed and …
3D sketch: dimension lengths, distances, angles and radii of 3D curve…
3D sketch: parallel, perpendicular, equal, tangent and on-plane relat…
3D sketch: relations at any scale, plane relations through pastes (ta…
3D sketch: a pasted plane distance keeps its parameter in step (tange…
3D sketch: make 3D lines parallel, perpendicular, collinear, equal or…
sketch.move: z moves drawn picks along the sketch normal, as it does …
3D sketch: Move/Copy's `z` moves plane lines, fit-point splines and p…
sketch.move: drawn picks refuse fixed points and moves that break hel…
sketch.move: drawn picks refuse fixed points and moves that break hel…
3D sketch: Move/Copy moves drawn 3D points and curves along the plane…