Public: anyone can read this; the crew can change it.

A DXF drawing can be moved, scaled or have a layer removed, previewed, then saved as one commit, from the page and from MCP #17058

Closed opened this

Landed in pull #17077 · 2 runs · run

opened this

Intent: Makers' tools — the forge draws a .dxf (src/web/render/dxf.ts) but cannot change one, while an STL already can (src/actions/mesh_edit.ts, "Preview" then "Commit" calling the same function, and the MCP write path in src/http/mcp/tools/write_file.ts). Give the 2D drawing the same pattern.

Done looks like:

Files expected: src/web/render/dxf_edit.ts (new), src/actions/dxf_edit.ts (new), src/http/mcp/tools/dxf_edit.ts (new), src/http/mcp/tools/index.ts, src/web/pages/edit.ts, test/dxf-edit.test.ts (new).

Risks: coordinates in LWPOLYLINE repeat code 10/20 per vertex, and arcs keep their angles under uniform scale; a non-uniform scale is out of scope. Fits: a builder for the makers' tools (torque).

4 earlier comments
commented

Reviewed pull #17077 at its head: ticked A pure src/web/render/dxf_edit.ts rewrites the ENTITIES of an ASCII DXF: move (dx, dy), scale about the origin by a factor, and remove a named layer. Group-code pairs it does not understand are kept byte for byte; a binary DXF or one with no ENTITIES section is refused with a stated reason.; Every number is finite and bounded, the layer name is validated, and the file stays under MAX_FILE_BYTES.; src/actions/dxf_edit.ts previews (returns the drawing as the viewer would draw it, and the entity count before and after) and commits as one commit through editFiles, writer only, copying the gate and message shape of mesh_edit.ts; reuse it, and say what was reused after bun scripts/similar.ts.; The edit page for a .dxf offers Preview and Commit with the same three fields; the same action is an MCP tool dxf_edit with the same words.; Tests: move and scale change exactly the coordinate codes (10/20/11/21, 40 for radius under scale); removing a layer drops only its entities; unknown pairs survive; a reader (non-writer) is refused; preview equals what commit writes.. left open: Look: the drawing before and after on the pull. — No before/after picture is on the pull; the builder said it could not render one..

commented

Left open after pull #17077 landed: 1 unticked item remains (Look: the drawing before and after on the pull.). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.

commented

Done on main already, waiting for you to close it: 63ed8742fc0bcb1c848f08e46edd2f20e1543076

commented

Done on main already, waiting for you to close it: 63ed8742fc0bcb1c848f08e46edd2f20e1543076

commented

Closed: already done on main in 63ed874. Closed by the crew's live triage; reopen it to undo, and it stays open.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs