Inspiration
A perfectly usable lens should not become waste just because its frame breaks or no matching frame is available. We wanted to reverse the usual process: instead of cutting lenses to fit a standard frame, build a frame around the lenses already here.
OptiFrame explores how local eyewear providers and makers could turn two existing, professionally checked lenses into a personalized frame—even when the two lens shapes are different.
What it does
OptiFrame connects a phone camera to a custom, 3D-printable eyewear workflow:
- Capture both lenses. Place each lens on a printed calibration sheet. Four reference markers correct perspective and convert the outline into millimetres.
- Review the fit. Confirm the outlines, enter pupil distances and measured lens-edge thickness, and adjust orientation, mirroring, spacing, and arm length. Prototype mode lets users explore without pretending that estimated optical centres are verified measurements.
- Make it personal. Choose Classic, Bold, or Brow styling and preview the generated assembly in 3D. A camera-based visual try-on helps explore the appearance.
- Choose how the lens is held. The generator supports screw-fastened retainers, printed push-pin retainers, and an experimental direct clip-in design with flexible retaining features.
- Export a test kit. Download STL parts in millimetres, a build-plate layout, and assembly information. The clip-in option includes test coupons for checking the retention concept before committing to a full print.
The website is available at optiframe.zajalist.com. Visual try-on uses sample frames; protected fabrication features use an approval-based account flow.
How we built it
The frontend uses JavaScript, responsive HTML/CSS, and Three.js for interactive frame previews. MediaPipe-based face tracking supports browser visual try-on. A native iPhone implementation explores ARKit/TrueDepth face estimates, while an Android path explores WebXR/ARCore depth on supported devices. These estimates remain separate from verified fitting measurements.
A Python/FastAPI backend runs on a desktop with GPU capability. OpenCV, NumPy, and SciPy support image processing; the capture pipeline combines marker calibration, perspective rectification, transparent-edge heuristics, and multi-frame evidence to propose a lens boundary. Users review the result rather than accepting an invisible black-box measurement.
Shapely, Trimesh, and Manifold3D turn the measured outlines into parametric rims, bridges, temples, hinges, and retention parts. We added bounded outline smoothing to reduce captured contour jitter while limiting geometric movement, followed by mesh checks and STL export.
Vercel hosts the web experience, with Supabase providing authentication, database storage, and approval controls. Higgsfield helped create product concept imagery and motion assets; the printable geometry itself comes from the CAD pipeline.
Challenges we ran into
Transparent lenses are difficult camera subjects. Shadows and reflections can be stronger than the real edge. We iterated on preprocessing, edge selection, capture guidance, and frame-to-frame consistency, and kept uncertainty visible instead of claiming that every capture is accurate.
A good-looking outline is not automatically a good-fitting part. Small contour steps become visible facets in an STL. Excessive smoothing can change the lens seat, so we bounded the permitted movement and checked the resulting meshes. Bridge transitions and tiny Boolean slivers also required careful geometry work.
Try-on is not metrology. A camera overlay can look convincing while its millimetre estimates drift. We separated appearance previews, face estimates, measured inputs, and physically checked exports. Phone depth is useful to explore, but it does not reliably recover the surface of a clear lens.
Powerful controls can overwhelm a phone screen. We progressively hid rotation, mirroring, and fine adjustments behind optional controls, used measurement visuals, and kept the main workflow focused on one decision at a time.
Accomplishments that we're proud of
- An end-to-end path from two independent lens outlines to a generated frame assembly and exportable STL kit.
- Three frame styles and three retention approaches, including a direct clip-in prototype rather than only a cosmetic style switch.
- Camera-based visual try-on alongside a parametric 3D preview of the generated parts.
- Bounded contour finishing that reduced jitter by approximately 23–32% on our saved lens-outline fixture, with boundary movement below 0.08 mm. This measures smoothing behaviour, not capture accuracy.
- Nine generated example kits whose 90 STL files passed watertight mesh checks. Physical retention and wearer fit still require testing.
What we learned
The important engineering work happens between the image and the printer: preserving scale, distinguishing a shadow from an edge, keeping track of left/right and lens orientation, handling tolerances, and making every assumption visible.
We also learned that the fastest way to improve a technical product is to test its whole journey on a real phone. A correct algorithm still needs clear capture guidance, understandable recovery, and controls people can use with a finger.
What's next for OptiFrame
Our next priority is physical validation across real lens shapes, edge profiles, materials, and printers: calibration comparisons, insertion-force tests, retention tests, and repeated-use testing for the clip-in mechanism. We also want to refine native depth-assisted face fitting, expand the frame catalog, and simplify the provider workflow.
OptiFrame is currently an experimental fabrication prototype. It does not determine a prescription, establish clinical pupil measurements, or certify eyewear. Lens suitability and optical alignment need professional verification, and printed parts need physical fit testing before wear. Our goal is a practical, repairable way to give existing lenses a new frame.
Built With
- arkit
- fastapi
- higgsfield
- javascript
- opencv
- python
- supabase
- three.js
- vercel
Log in or sign up for Devpost to join the conversation.