Refit: a phone measuring agent that never guesses a size

Carson Rodrigues

Carson Rodrigues / November 21, 2026

6 min read • ––– views

hackathonscomputer-vision3d-printing
A white 3D-printed test plate with five holes and five pegs on a dark surface

When a plastic part breaks, you can often print a new one. The trouble is the size. A copy that looks right can be a few tenths of a millimetre off exactly where it has to fit, like a hole that should grip a shaft.

Refit is my answer: a phone measuring agent. Every size is measured, or asked for. Never guessed. The photo above is a test plate I printed for it, with five holes and five pegs.

HackathonMeta Global AI Developer Hackathon
OrganiserMeta, on the Cerebral Valley platform
WhenBuilding period 27 October to 4 November 2026
TrackIndie
Built in15 commits from 28 October to 4 November 2026
TeamSolo, with an AI coding agent under my direction
Money spentNot tracked in total. The two runs I have costs for were $0.12 and $0.04
CodePrivate

What I built

You print a mat, a sheet with a ring of small coded squares called ChArUco markers. You check its scale with a caliper on a 100 mm square. Then you photograph the broken part on it: three photos from above and three from the side.

Three Meta models do the language, vision and listening.

  • SAM 3.1 is a model that finds an object's outline in a photo. It finds the part, and you confirm the outline with one tap.
  • Muse Spark is Meta's language model. It names the part, proposes which sizes matter, and writes the part as a recipe.
  • Muse Voice Transcribe turns speech into text, so you can say a caliper reading out loud.

Code does everything that has to be right. It works out where the camera stood from the markers, refits each edge on the full-size photo, and gives every size a plus-or-minus. A size that has to fit, like a hole, a shaft or a slot, needs plus-or-minus 0.15 mm. Anything else needs 0.5 mm. A phone can't promise 0.15 mm, so for those sizes Refit says "Measure it with the caliper." You hold a button and say "six point two". Refit reads the number back to you before it keeps it.

Muse Spark never writes code that runs, and it never picks a number. It writes a recipe from a short list of allowed steps, such as extrude, hole, pocket and slot. Every value in the recipe has to point at a size that was measured or asked for, and a recipe with a bare number is refused. Code then builds the solid in a CAD library, checks that each hole really is a hole, and sends a failure back to Muse Spark up to twice.

Each size on the report carries a tag: measured, approximate camera, caliper, recovered or assumed. The report says whether the new part fits and gives you STL and STEP files to print. Afterwards, you photograph the print beside the original and Refit checks each size.

Flow diagram: photos on a mat, find the part, measure, gate, build and check, report

Research

Primary research. None with users. I read the hackathon's guide to Meta's rules and judging.

Secondary research. I spent the first day on prior art and on what a phone can do.

On prior art, I read four other Devpost entries in the same space:

  • Kintsugi checks its result against its own spec, and asks for more photos when unsure.
  • Aida checks against a turntable scan and rescans.
  • CADEX checks against its spec and shows where to put the calipers.
  • CAD-View checks against a rebuilt mesh and marks guesses as inferred.

Refit differs in one way. It checks against the photos, then the print against the original part, and a size the camera can't promise goes to your caliper. My notes also cover Phone2CAD and the commercial tool Backflip.

On hardware, my note found phone LiDAR too coarse for a part a few centimetres wide, with published errors of 1 to 2 cm, and no published smartphone study showing 0.5 mm on parts this size. So the plan became the camera, a printed mat and an edge fit. The iPhone 17 Pro Max specs shaped the photo settings.

The measuring method follows my paper Done Is Not Correct. No code is reused.

How I tested it

The repo records 317 tests passing offline on 4 November 2026, under a linter and strict type checking. I didn't re-run them for this post.

  • Six test parts. Muse Spark wrote the recipe for all six, and each built and passed its checks on the first try, for $0.12 on 1 November. The recorded answers are saved as test fixtures.
  • A live run on synthetic photos of a known 60 x 40 x 15 mm block, with geometry standing in where SAM missed. Refit measured 60.01 plus-or-minus 0.12, 40.01 plus-or-minus 0.10 and 15.01 plus-or-minus 0.41 mm, then said "Fits." It took 9 model calls, $0.04 and 37 seconds. That is from my write-up draft. The seed run's STEP file has matching coordinates of 60.011, 40.008 and 15.007.
  • A failure of my own. On 30 October, Muse Spark built a square pocket round, and the recipe passed every check. Now each size carries its shape, the shape goes to Muse Spark with the request, and code refuses a recipe that builds a round size square or a square one round. On 1 November the pocket came out square.

Smaller fixes: SAM found nothing under "dark grey plastic block" but found the block under a plainer name, so code now tries simpler names, then asks you. SAM's outline sits slightly off the true edge and biased widths, so a second fitting pass removed it. Real iPhone files broke my first intake, through photo orientation and macro-lens shots.

What isn't measured. The plus-or-minus bounds are stated, not validated. The edge number is a placeholder until a calibration set fits it, and I ran no pilot, so I claim no failure rate. Without a camera profile, Refit uses approximate values from the photo's metadata and doubles the bounds.

What I learned

A model can be wrong in a way that passes every check you wrote. The round pocket looked fine to the code until I added a shape check. Each failure became a rule.

Asking is part of measuring. The question "are all 5 holes the same size?", asked once, beats five separate questions.

And the hard line, no bare numbers, builds more trust than an accuracy claim. A report where every size shows its source is easy to check.

Links

Available · London / UK · senior AI, AI FDE, contract

Building something with AI?

Voice agents, MCP servers, LLM pipelines, agentic workflows — pick a slot, drop a message, or send your email and I'll reply within a day.

or leave your email

Replies within ~24 hours · London, UK · on-site, hybrid or remote