Skip to content
Inside a Developer's Head by Jesús Quintana, home

side project

Leer en español

Sameform

Early prototypeStarted 2026

An iPhone app that scans small objects with the LiDAR Scanner and builds 3D models for makers, fully offline. Right now I am testing if the scans are good and repeatable enough.

What it is

I am building Sameform, an iPhone app that scans small objects with the LiDAR Scanner and turns them into 3D models for makers, fully offline. It needs an iPhone with the LiDAR Scanner: the Pro models from the iPhone 12 Pro on.

Nothing is released yet. I am testing whether capture, repeatability, speed and quality are good enough to keep going, and models cannot be exported yet.

How it's built

Sameform is an iPhone app that scans small objects with the LiDAR Scanner and builds a 3D model from the scan, fully offline. It is an early prototype, in a stage I call Spike 0: the only question for now is whether capture, repeatability, speed and quality are good enough to keep going. The code is a local Swift package with one module per stage, plus a thin app on top. Nothing is released, and models can’t be exported yet.

highlights

  • The same capture gives the same model

    The main promise is that the same capture, preset and pipeline version give identical content hashes on the same device, OS and build. I check this with hashes of the decoded data (the volume and the mesh), not of the files. Goldens are stored per environment, because the Metal compiler ships with the OS, and a missing golden fails the test as a new environment until I record it on purpose.

  • Fusing depth on the GPU without float surprises

    Depth frames are fused into a TSDF volume (a grid of distances to the surface) with Metal kernels, and the surface comes out with marching cubes. A normal GPU pipeline is fast but not repeatable, so the rules are strict: safe math, no float atomics, no SIMD-group sums and no hardware texture filtering, and reductions combine in a fixed order. A CPU version mirrors every Metal operation, so the two can be compared.

  • Rules enforced by scripts, not by memory

    Two scripts guard the rules. One checks every module’s imports against a fixed table, so only the reconstruction module can import Metal. The other scans the shaders and output code for fast math, float atomics, random numbers, clock reads and unsorted file listings. Rules a script can’t see are left to review, and the docs say so.

  • A fingerprint that notices when the math changes

    The pipeline has a manual version and a fingerprint: a SHA-256 over the shader sources, the compile settings, the presets and the marching cubes table. If the fingerprint changes without a version bump, the determinism tests fail. Floats in the canonical JSON are written by my own shortest-decimal formatter, checked against every finite 32-bit float in an exhaustive run, because the system’s own text output could change with the OS.

  • One module per stage, tested on the Mac

    The package has a target per stage. Core, bundle, capture, reconstruction and the design system are built; editing, the pipeline, export and the library are planned. Everything except ARKit capture and the design system builds and tests on the Mac, so most work needs no phone, and a small command-line tool can generate synthetic scenes, check a capture and print its hashes.

  • A capture format that is a contract

    A scan is a folder: a canonical JSON file plus compressed colour, depth and confidence files per frame, each with a SHA-256 in the file table. The JSON has exactly one valid byte sequence, and readers re-encode it and reject any difference. The format is designed so a crash never leaves a half-valid scan, and the fusion settings were picked by measuring real captures and noisy synthetic scenes.

  • Swift 6
  • SwiftUI
  • ARKit
  • LiDAR
  • Metal
  • Swift Package Manager
  • XcodeGen
  • CryptoKit