Skip to content

mbumpus/Dx3D-public

Repository files navigation

Dx3D β€” 3D Print Diagnostic Tool

AI-powered diagnostic tool for analyzing failed 3D prints. Upload photos of your print failure, provide print parameters, and get detailed analysis with specific fixes.

License Next.js TypeScript

Features

  • πŸ“± Progressive Web App: Installable on mobile devices, works offline
  • πŸ“Έ Camera Integration: Direct camera capture for quick diagnostics
  • πŸ–ΌοΈ Multi-Image Analysis: Upload 1-5 photos of your failed print
  • πŸ€– Dual AI Support: Works with Anthropic Claude or OpenAI GPT-4V
  • πŸ“Š Expert Diagnostics: Built-in knowledge base of 20 common 3D print failures
  • πŸ” BYOK (Bring Your Own Key): Your API key stays in your browser
  • 🌊 Streaming Responses: Real-time diagnosis as the AI thinks
  • πŸŒ™ Dark Mode: Default dark theme perfect for workshop use
  • πŸ‘† Touch-Optimized: Large tap targets, mobile-first design
  • πŸš€ Fast: Edge functions, app shell caching, instant loading

Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/yourusername/dx3d.git
cd dx3d

# Install dependencies
npm install

# Run development server
npm run dev

Open http://localhost:3000 in your browser.

Usage

Mobile (Recommended)

  1. Install PWA: Visit Dx3D.app and tap "Add to Home Screen"
  2. At Your Printer: Open the app from your home screen
  3. Take Photos: Tap "Take Photo" to capture failed print (1-5 images)
  4. Configure: Enter API key first time (saved for later)
  5. Fill Form: Quick form with print parameters
  6. Diagnose: Get instant AI analysis

Desktop

  1. Visit: Open Dx3D.app in your browser
  2. Upload Photos: Drag-and-drop or click to upload images
  3. Enter Details: Fill print parameters
  4. Get Diagnosis: Streaming AI analysis with specific fixes

Full Workflow

  1. Select AI Provider: Choose between Anthropic (Claude) or OpenAI (GPT-4V)
  2. Enter API Key: Your key is stored locally and never sent to our servers
  3. Fill Print Info:
    • Printer model (e.g., "Ender 3 Pro")
    • Filament type (PLA, PETG, ABS, TPU, Nylon, Other)
    • Nozzle temperature (Β°C)
    • Bed temperature (Β°C)
    • Layer height (mm)
    • Print speed (mm/s)
    • Problem description
  4. Capture/Upload Photos: Take photos or upload from gallery (1-5 images)
  5. Click Diagnose: Get streaming AI analysis with specific fixes

Diagnostic Coverage

Dx3D can identify and provide fixes for 20 common 3D print failures:

  1. Layer Separation / Delamination
  2. Stringing / Oozing
  3. Warping / Lifting Corners
  4. Poor Bed Adhesion
  5. Elephant Foot
  6. Z-Banding / Layer Lines
  7. Under-Extrusion
  8. Over-Extrusion
  9. Blobs / Zits
  10. Ghosting / Ringing
  11. Clogged Nozzle
  12. Layer Shifting
  13. Pillowing (Top Surface Gaps)
  14. Bridging Failures
  15. Support Removal Damage
  16. Dimensional Inaccuracy
  17. Brittle Prints
  18. Nozzle Crashes / Dragging
  19. Wet Filament Symptoms
  20. Retraction Issues

Each diagnosis includes:

  • Symptoms: Visual identification
  • Causes: Root cause analysis
  • Fixes: Specific, actionable steps with exact settings
  • Prevention: Long-term improvements

Deployment

Deploy to Vercel

Deploy with Vercel

Or manually:

# Install Vercel CLI
npm install -g vercel

# Deploy
vercel

# Deploy to production with custom domain
vercel --prod

PWA Icon Generation

Before deploying, generate PWA icons:

cd public
node generate-icons.js
# Then convert SVG to PNG using ImageMagick or online tool
# See public/ICONS.md for instructions

Or use placeholder SVG icons (included).

Environment Variables

No environment variables needed! This is a completely client-side PWA with edge functions.

Architecture

  • Frontend: Next.js 14 (App Router), React 19, TypeScript
  • Styling: Tailwind CSS with dark mode
  • API Route: Edge function at /api/diagnose
  • AI Integration: Direct API calls to Anthropic or OpenAI
  • Image Handling: Base64 encoding for vision API compatibility
  • Deployment: Vercel (or any Next.js-compatible platform)

Privacy & Security

  • βœ… API keys stored locally only (localStorage)
  • βœ… No backend database (zero data retention)
  • βœ… No user accounts (no authentication needed)
  • βœ… Images processed in-browser (base64 encoding)
  • βœ… Edge functions only (no server-side storage)
  • βœ… Open source (audit the code yourself)

Your API key is only sent to the AI provider you select (Anthropic or OpenAI). We never see your key or images.

Development

Project Structure

dx3d/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ page.tsx              # Main page
β”‚   β”œβ”€β”€ layout.tsx            # Root layout
β”‚   β”œβ”€β”€ globals.css           # Global styles
β”‚   └── api/
β”‚       └── diagnose/
β”‚           └── route.ts      # Edge function for AI calls
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ DiagnosisForm.tsx     # Main form component
β”‚   β”œβ”€β”€ ImageUpload.tsx       # Image upload with preview
β”‚   └── DiagnosisResult.tsx   # Streaming result display
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ types.ts              # TypeScript types
β”‚   └── prompts.ts            # System prompt with RCA database
└── public/                   # Static assets

Tech Stack

  • Next.js 16: App Router, Edge Runtime
  • React 19: Latest features
  • TypeScript 5.9: Type safety
  • Tailwind CSS 4: Styling
  • Vercel AI SDK: (Future: streaming utilities)

Build

# Development
npm run dev

# Production build
npm run build
npm start

# Lint
npm run lint

Contributing

Contributions welcome! This is an open-source project.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Roadmap

  • PWA support for mobile camera access
  • Mobile-first responsive design
  • Offline app shell caching
  • Export diagnosis as PDF
  • Compare before/after prints
  • Community-contributed failure database
  • Multi-language support
  • Offline mode with local LLM
  • Print history (optional local storage)
  • Push notifications for long diagnoses
  • Share diagnosis via link

License

MIT License - see LICENSE file for details.

Credits

Built with ❀️ for the 3D printing community.

Support


Disclaimer: This tool provides diagnostic suggestions based on AI analysis. Always use your judgment and follow proper safety procedures when adjusting printer settings.

About

AI-powered 3D print failure diagnosis. BYOK, PWA, open source.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors