Skip to content

shribr/BrickVision

Repository files navigation

BrickVision

A LEGO piece scanner and build suggestion app for iOS. Point your camera at a pile of LEGO bricks, and BrickVision will identify and catalog every piece, then show you awesome things you can build with what you have.

Features

  • Camera Scanning — Live camera feed with real-time object detection using Apple's Vision framework
  • AI Piece Recognition — Hybrid offline (Vision) + cloud (GPT-4o) brick identification
  • AI Build Ideas — GPT-4o generates creative build suggestions from your inventory
  • Piece Catalog — 443 real BrickLink parts with search, filter, and sort
  • Build Suggestions — 51 projects across 12 categories, ranked by inventory match
  • Step-by-Step Instructions — Detailed instructions with piece lists and tips
  • Multi-Scan Merge — Combine multiple scan sessions into a single inventory
  • Favorites — Save and filter your favorite build projects
  • Demo Mode — Try the app with a pre-loaded sample inventory of 200+ pieces
  • Haptic Feedback — Tactile response across all interactions
  • Dark Mode — Full dark mode with adaptive materials and LEGO-themed accent colors
  • Accessibility — VoiceOver labels/hints, Dynamic Type, reduced motion support
  • Scan Confidence UI — Color-coded confidence badges on every detected piece
  • 3D Model Generation — Parametric brick geometry with accurate LEGO dimensions
  • STL Export — Export 3D-printable STL files with recommended print settings
  • Interactive 3D Viewer — Rotate, zoom, and inspect bricks before exporting

For the full feature catalog (86 features), see FEATURES.md.

Documentation

Document Description
FEATURES.md Complete feature catalog with priorities and status
ARCHITECTURE.md System architecture, data models, and build commands
PROJECT_PLAN.md Sprint breakdown with deliverables and test details
ROADMAP.md Product vision, phases, and competitive landscape
CHANGELOG.md Version history and release notes

Requirements

  • iOS 17.0+
  • Xcode 15.0+
  • Swift 5.9+
  • Physical device with camera (for scanning features)

Getting Started

Option A: Using XcodeGen (recommended)

brew install xcodegen
cd BrickVision
xcodegen generate
open BrickVision.xcodeproj

Option B: Manual Xcode Project

  1. Open Xcode → File → New → Project → iOS App
  2. Name it "BrickVision", set to SwiftUI
  3. Delete the generated files and drag in the BrickVision/ source folder
  4. Set the Info.plist path in Build Settings
  5. Build and run on a physical device

How It Works

Scanning Pipeline

  1. Camera frames captured via AVCaptureSession (every 10th frame)
  2. Vision framework: rectangle detection → contour analysis → saliency → stud detection → color classification
  3. Results matched against LegoPartsCatalog (443 parts with real BrickLink IDs)
  4. Optional cloud recognition via Azure OpenAI GPT-4o for unrecognized pieces

Build Matching

BuildSuggestionEngine has 51 projects across 12 categories × 5 difficulty levels. Each project specifies required pieces with optional color flexibility. Your inventory is matched against requirements and ranked by match percentage (>30% threshold).

AI Build Ideas

AzureAIService sends your inventory to GPT-4o and receives creative, custom build suggestions tailored to your specific pieces.

For full architecture details, see ARCHITECTURE.md.

License

MIT

About

iOS app that scans LEGO bricks with AI, catalogs them, and suggests cool things to build. Built with SwiftUI, Vision framework, and CoreML-ready architecture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors