Back to deliverables

D2 / Design Document

Architecture and system metaphor

This document records Team E's current design for the Adcut Logo Vectorizer. It describes the planned software structure and the shared metaphor guiding implementation. Client-specific export conventions and acceptance tolerances remain open until the team receives representative files and downstream requirements.

System architecture

1. InterfaceStreamlit upload, scale, settings, preview, and downloads
2. DecodePillow and pypdfium2 normalize raster, GIF, and PDF input
3. TraceVTracer clusters colors and creates spline-mode SVG paths
4. Geometrysvgelements parses paths while retaining lines and Bezier curves
5. Exportezdxf writes scaled layers, polylines, and native SPLINE entities

The design separates the user interface from image processing, geometry construction, validation, and export. This separation allows the processing and export logic to be tested without running the browser interface.

Component responsibilities

ComponentResponsibilityPlanned technology
InterfaceAccept artwork and scale settings, report progress and warnings, and provide the matching download.Streamlit
Input adaptersDecode supported images and retain source metadata. PDF page or region selection remains a later design decision.Pillow and pypdfium2
Region processingCluster colors and trace distinct closed regions into SVG paths.VTracer in spline and cutout modes
GeometryParse SVG path commands, retain Bezier curves, apply scale, and prepare shared-edge and circle/arc recognition work.svgelements and Python geometry modules
Validation and exportReject invalid or degenerate geometry and serialize supported CAD entities.ezdxf
External acceptanceConfirm that exported files import correctly and work in Adcut's downstream process.AutoCAD, IGEMS, and client review

Data flow and design boundaries

  1. The employee selects customer artwork and enters an explicit physical output dimension and units.
  2. The input adapter converts the selected file into a consistent image representation.
  3. Processing creates distinct color regions without merging colors solely because they use the same material.
  4. The geometry stage creates closed boundaries, retains holes and adjacency, and fits native curves where supported.
  5. Validation checks closure, finite coordinates, degenerate entities, scale, and unintended duplicate boundaries.
  6. The export adapter creates a DXF for downstream CAD review. AutoCAD, IGEMS, and the water jet workflow remain outside the application.

DXF is the initial output target. R2000 is only a development default, not a confirmed client requirement. Native DWG export requires a separate feasibility and licensing review. SVG remains a possible fallback.

System metaphor: a digital stencil workshop

Representative illustration of separate colored stencil pieces assembling into one design.

The artwork is the pattern. Each distinct color region becomes a stencil piece. Tracing defines the edge of each piece, curve fitting improves that edge for CAD use, and DXF packages the pieces for downstream preparation.

The metaphor gives the team a consistent vocabulary while preserving the system boundary: the application prepares geometry, but it does not operate the water jet or reconstruct details missing from low-quality artwork. Neighboring stencil pieces also help the team reason about shared boundaries so the design does not create unintended duplicate cuts.

Current design decisions

The current development build accepts JPEG, PNG, WEBP, GIF, and PDF inputs; creates color-separated SVG paths; previews traced curves; and exports SVG plus DXF R2000 with native SPLINE entities. The repository includes three original test images, seventeen passing automated tests, and passing checks on Windows, Linux, and macOS. Native circle and arc recognition, shared-boundary deduplication, manual editing, and downstream acceptance testing remain implementation work.

Open decisions requiring evidence

The team still needs permitted sample artwork, accepted CAD examples, target software versions, units, scale conventions, layers, DXF version, supported entities, and agreed error tolerances. These items are intentionally not presented as approved requirements.