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

A .dxf drawing opens as a picture on its file page: lines, circles, arcs and polylines #11861

Closed opened this has it

Landed in pull #11913 · run

opened this

Owner vision: store anything, build the right interface for it; CAD is on his list and the forge has no 2D drawing renderer yet (3D, gcode and STL exist).

Done looks like:

Files: src/web/render/dxf.ts, src/web/render/kinds.ts, src/web/render/renderers.ts, test/render-dxf.test.ts, test/render-kinds.test.ts Risks: an SVG built from untrusted numbers: clamp and reject NaN/Infinity; the page's Content-Security-Policy must stay as is. Brief: a Sonnet builder (Mason or Scout). Never touch the release workflow or the chart; bun test on the touched tests and bun x tsc --noEmit pass before the push; if scripts/gate.ts still lists tests by hand, add the new test there in the same commit.

commented

Reviewed pull #11913 at its head: ticked kinds.ts gains the kind dxf (by name .dxf, and by the 0\nSECTION head) with its cap; renderers.ts registers it; a binary DXF or an unknown entity degrades to the plain text page, never an error.; test/render-dxf.test.ts: a drawing with one of each entity gives the expected element counts; an empty file, a truncated file and a 10 MB file are refused or degraded plainly; layer names are escaped.. left open: Before/after screenshot of one file page at 390 px and 1280 px in the pull; bun scripts/design-lint.ts passes. — design-lint passes, but the screenshots are not in the pull; the builder could not take them from the sandbox..

commented

Left open after pull #11913 landed: 2 unticked items remain (New module src/web/render/dxf.ts, one concept: a pure dxf(text) parses the ASCII DXF ENTITIES section (LINE, CIRCLE, ARC, LWPOLYLINE, TEXT ignored) and returns inline SVG scaled to its bounding box, with the layer names and entity counts as facts. No dependency; parsing bounded by RENDER_CAP; every string escaped.; Before/after screenshot of one file page at 390 px and 1280 px in the pull; bun scripts/design-lint.ts passes.). 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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs