sketch-to-cad
Skill16 starsChanged 16 days agoMITView on GitHub
Reconstructs a dimensioned parametric CAD model from a hand sketch, photo, screenshot, drawing scan, or video frames — extracts features and dimensions, infers missing ones from scale references, and records confidence for every dimension. Use when the user uploads an image or video of a part or product and wants a CAD model, reverse engineering, or a measured drawing.
In this repository34 other files it gives its agents.
- skills/cadsmith-text-to-cad/references/agents.mdAGENTS.md
- agentscad-fdm-dfamSkill
- am-alloy-screeningSkill
- am-literature-ragSkill
- cadsmith-text-to-cadSkill
- cfd-simulation-setupSkill
- design-review-packageSkill
- dfm-reviewSkill
- drawing-gdt-reviewSkill
- engineering-calc-reportSkill
- equation-discoverySkill
- image2gcodeSkill
- lattice-inverse-designSkill
- linkage-synthesisSkill
- llm-3d-print-monitorSkill
- llm-mechanical-designerSkill
- lpbf-defect-predictionSkill
- lpbf-superresSkill
- machine-element-sizingSkill
- material-selectionSkill
- mechanical-teardownSkill
- mechanics-visualsSkill
- meltpool-geometrySkill
- parametric-part-cadSkill
- query2cad-freecadSkill
- quick-feaSkill
- rocketsmithSkill
- sls-process-optimizationSkill
- stress-field-surrogateSkill
- thermal-fluids-calcSkill
- thermal-porositySkill
- tolerance-stackupSkill
- worked-problem-generatorSkill
- my-new-skillSkill
The file
Files
Sketch / Photo / Video → CAD
Pairs with parametric-part-cad, which builds and exports the final model.
Workflow
- Ingest.
- Images: view each one. For video, pull frames at viewpoint changes:
ffmpeg -i in.mp4 -vf "select='gt(scene,0.25)'" -vsync vfr frames/f_%03d.png, and keep 6–12 frames that cover the main views. - Classify each view: front, side, top, isometric, or oblique. Note perspective distortion. Orthographic sketches are the easiest case.
- Images: view each one. For video, pull frames at viewpoint changes:
- Establish scale. Use, in order of preference: a dimension written on the sketch, then a known-size object in frame (
references/scale_refs.md), then a standard part on the object (bolt head, bearing, USB-C port), then a user-supplied overall size. If none exists, ask for one overall dimension. Don't guess absolute scale. - Feature decomposition. List features in build order: base prism or revolve → bosses and ribs → pockets and holes → patterns → fillets and chamfers. Identify symmetry and patterns explicitly (they cut the number of unknowns).
- Dimension table. For every parameter, record: value, unit, source (
annotated/measured px→mm/standard part/assumed), and confidence (high / medium / low). For pixel measurements, measure along the axis least affected by perspective, and give ±% uncertainty. Round to sensible design values: whole mm, standard hole sizes, and standard thicknesses. - Build with the
parametric-part-cadworkflow, keeping each dimension a named parameter. - Verify by overlay. Render the model from the same viewpoint as the source (CadQuery SVG with a matching
projectionDir), then compare silhouettes side by side. List any mismatches and fix the parameters. Two iterations is usually enough. - Deliver: STEP/STL, the parameter script, the dimension table with confidence, and a "please confirm" list of the 3–5 low-confidence dimensions that matter most.
Multi-part products
Break the product into an assembly tree first: a subassembly → part list with interfaces. Model the interfaces (mating faces, shafts, fastener patterns) at high confidence before cosmetic surfaces. For vehicles and products filmed in motion, use rotating or turntable segments for proportions and close-ups for details.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

