Skip to content

Sketch essentials: fillets, chamfers, slots, trim, extend and construction geometry - #253

Merged
andrewbartels1 merged 9 commits into
mainfrom
feat/sketch-essentials
Nov 19, 2026
Merged

andrewbartels1 merged 9 commits into
mainfrom
feat/sketch-essentials

Conversation

@andrewbartels1

Copy link
Copy Markdown
Owner

Sketch essentials (queue item 32)

The sketch operations almost every real part needs after lines and circles: a rounded or bevelled corner, a slot, trimming a profile back to where shapes meet, extending a line to the next one, and construction geometry. Before this, an agent faked a slot from six entities and a rounded corner from lines and a hand-placed arc. Six new tools, 151 in all, all stable after the live demo below.

Tool What it does
add_sketch_fillet Rounds corners of a 2D profile, each picked by its [x, y] (a rectangle's corners have no ids of their own)
add_sketch_chamfer Bevels corners the same way: equal distances, two distances, or a distance and an angle
add_slot A straight slot between two centres, or an arc slot along an arc; the reply gives its area
sketch_trim Removes the piece of an entity at a point, back to where it meets others
sketch_extend Lengthens an entity from its end nearest a point to the next entity
set_construction_geometry Makes entities construction geometry, or normal again, by id

Also:

  • add_arc takes kind: center (as before, the default), three_point (start, end and a point it passes through) or tangent (leaves the end of an existing entity tangent to it).
  • add_rectangle takes from_center: the first point is the centre, the second a corner.

Fixes

  • construction now works on SolidWorks. add_line, add_circle and add_rectangle accepted construction but drew normal geometry, while the reply said "construction": true. The tools now set it on the new entity.
  • Fillets and chamfers last. The server's instructions and the skill's build order now say a solid's fillets and chamfers go after every boss and cut, at the end of the feature tree. The sketch corner tools say they are for 2D profiles.

Found in the live runs

  • A rectangle drawn from its centre has a centre point. A sketch fillet there is refused by SolidWorks; the tool reports it as invalid_input ("it isn't where two entities meet") and changes nothing.
  • SketchTrim returns False even after it trims. Trim and extend are judged by measuring the sketch's total length before and after (a trim shortens it, an extension lengthens it), and the reply gives the change in mm.

The demo: a slotted bracket plate

A bracket plate drawn from its centre, then slots, a keyhole made by extending and trimming, and a window from a tangent and a three-point arc are cut; its corners are filleted and chamfered last

Every new operation in one part, built sharp with its corners filleted and chamfered last; verify_model checks the volume against the hand calculation after each step:

Step Expected, mm³ Measured, mm³
120 x 80 plate drawn from its centre, 8 mm thick 76,800.00 76,800.00
Straight and arc slots, two construction lines across them 71,358.94 71,359.18
Keyhole: lines extended 2.58 mm to a circle, 6.15 mm of arc trimmed, the neck's corners rounded and bevelled in the sketch 68,938.11 68,938.53
Window from a tangent arc and a three-point arc 65,909.79 65,910.22
Last: two corners filleted R10, two chamfered 10 mm 64,766.42 64,766.85

It's on the demos page (Sketching).

Also in this PR

  • Queue items 33 to 40, the next COM-coverage packages (assembly depth with a ballooned drawing, helix and swept cuts, multi-body tools, appearance, drawing sheets, weldments, reference extras), and last a structure review: cutting the repeated per-tool code in the adapter wrappers and splitting the largest modules by topic.

Checks

  • Unit tests: 4,492 pass at 100% coverage; ruff and mypy are clean; the docs build in strict mode; every link checks out.

  • Live, passed 2026-11-19:

    powershell -ExecutionPolicy Bypass -File tests\scripts\live_demo.ps1 -Test tests/live/test_live_sw_sketch_essentials.py

…d, construction geometry; arc kinds and centre rectangle; construction honoured on SolidWorks (queue item 32)
…says the point isn't a corner (found live: a centre rectangle's centre point)
… says which worked (SolidWorks refused the first live)
…m returns False after trimming); fillets and chamfers last in guidance and the demo (the user's rule)
…slowed so every caption shows at least 3.5 s; the demo asks for 5 s per result caption
@andrewbartels1
andrewbartels1 merged commit 53c9f36 into main Nov 19, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant