# aryansaraogi/dxfconvertor architecture

> Architecture diagram of the GitHub repository aryansaraogi/dxfconvertor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aryansaraogi/dxfconvertor
- Repository: https://github.com/aryansaraogi/dxfconvertor

## Overview

img2dxf turns raster artwork into millimetre-scale laser paths, with both a GUI preview/export workflow and a headless CLI. The GUI accepts artwork and settings, schedules the shared tracing pipeline, displays the resulting paths, then exports DXF or SVG; CLI uses the same engine for batchable conversion. Core stages include framing and image preparation, thresholding, contour geometry and sizing, finishing and machine-aware layout/order, then file writing. README capabilities such as calibration, saved jobs, photo tone layers and settings are represented where tree paths support them; unsampled wiring is not inferred.

Main entry points: [`img2dxf/pipeline.py`](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/pipeline.py) (Trace pipeline), [`img2dxf/gui/app.py`](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/app.py) (Desktop GUI), [`img2dxf/cli.py`](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/cli.py) (Command line), [`img2dxf/gui/worker.py`](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/worker.py) (Trace worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interfaces"]
  node_gui["Desktop GUI<br/>[app.py]"]
  node_controls["Settings controls<br/>[controls.py]"]
  node_worker["Trace worker<br/>[worker.py]"]
  node_preview["Live preview<br/>[preview.py]"]
  node_cli["Command line<br/>[cli.py]"]
end

subgraph group_processing["Image to paths"]
  node_params["Trace parameters<br/>[params.py]"]
  node_pipeline["Trace pipeline<br/>[pipeline.py]"]
  node_preprocess["Image preparation<br/>[preprocess.py]"]
  node_transform["Framing and scale<br/>[transform.py]"]
  node_trace["Contour tracing<br/>[trace.py]"]
  node_geometry["Path geometry<br/>[geometry.py]"]
  node_detail["Detail smoothing<br/>[detail.py]"]
  node_straighten["Path straightening<br/>[straighten.py]"]
  node_arcfit["Arc fitting<br/>[arcfit.py]"]
end

subgraph group_machine["Laser preparation"]
  node_kerf["Kerf offset<br/>[kerf.py]"]
  node_tabs["Holding tabs<br/>[tabs.py]"]
  node_tile["Sheet tiling<br/>[tile.py]"]
  node_order["Cut ordering<br/>[order.py]"]
end

subgraph group_output["Export and persistence"]
  node_dxf["DXF writer<br/>[dxfwrite.py]"]
  node_svg["SVG writer<br/>[svgwrite.py]"]
  node_settings[("Saved settings<br/>[settings.py]")]
  node_recent[("Recent files<br/>[recent.py]")]
  node_calibrate["Calibration output<br/>[calibrate.py]"]
end

node_operator(("Operator"))
node_laser(("Laser software"))

node_operator -->|"opens artwork"| node_gui
node_operator -->|"submits job"| node_cli
node_gui -->|"edits settings"| node_controls
node_controls -->|"builds parameters"| node_params
node_cli -->|"builds parameters"| node_params
node_gui -->|"requests trace"| node_worker
node_worker -->|"runs trace"| node_pipeline
node_cli -->|"runs trace"| node_pipeline
node_pipeline -->|"frames and scales"| node_transform
node_pipeline -->|"prepares pixels"| node_preprocess
node_pipeline -->|"traces masks"| node_trace
node_trace -->|"creates paths"| node_geometry
node_pipeline -->|"smooths paths"| node_detail
node_pipeline -->|"straightens paths"| node_straighten
node_pipeline -->|"offsets paths"| node_kerf
node_pipeline -->|"fits arcs"| node_arcfit
node_pipeline -->|"duplicates paths"| node_tile
node_pipeline -->|"orders cuts"| node_order
node_worker -->|"returns result"| node_gui
node_gui -->|"renders result"| node_preview
node_preview -->|"shows tab gaps"| node_tabs
node_gui -->|"exports DXF"| node_dxf
node_gui -->|"exports SVG"| node_svg
node_cli -->|"writes DXF"| node_dxf
node_operator -.->|"saves job"| node_settings
node_gui -->|"updates history"| node_recent
node_operator -->|"generates test"| node_calibrate
node_dxf -->|"provides drawing"| node_laser
node_svg -->|"provides drawing"| node_laser

click node_gui "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/app.py"
click node_controls "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/controls.py"
click node_worker "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/worker.py"
click node_preview "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/preview.py"
click node_cli "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/cli.py"
click node_params "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/params.py"
click node_pipeline "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/pipeline.py"
click node_preprocess "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/preprocess.py"
click node_transform "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/transform.py"
click node_trace "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/trace.py"
click node_geometry "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/geometry.py"
click node_detail "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/detail.py"
click node_straighten "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/straighten.py"
click node_arcfit "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/arcfit.py"
click node_kerf "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/kerf.py"
click node_tabs "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/tabs.py"
click node_tile "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/tile.py"
click node_order "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/order.py"
click node_dxf "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/dxfwrite.py"
click node_svg "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/svgwrite.py"
click node_settings "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/settings.py"
click node_recent "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/recent.py"
click node_calibrate "https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/calibrate.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gui,node_controls,node_worker,node_preview,node_cli toneBlue
class node_params,node_pipeline,node_preprocess,node_transform,node_trace,node_geometry,node_detail,node_straighten,node_arcfit toneAmber
class node_kerf,node_tabs,node_tile,node_order toneMint
class node_dxf,node_svg,node_settings,node_recent,node_calibrate toneRose
class node_operator,node_laser toneIndigo
```

## Components

### User interfaces

- [Desktop GUI](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/app.py): `img2dxf/gui/app.py`
- [Settings controls](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/controls.py): `img2dxf/gui/controls.py`
- [Trace worker](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/worker.py): `img2dxf/gui/worker.py`
- [Live preview](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/preview.py): `img2dxf/gui/preview.py`
- [Command line](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/cli.py): `img2dxf/cli.py`

### Image to paths

- [Trace parameters](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/params.py): `img2dxf/params.py`
- [Trace pipeline](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/pipeline.py): `img2dxf/pipeline.py`
- [Image preparation](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/preprocess.py): `img2dxf/preprocess.py`
- [Framing and scale](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/transform.py): `img2dxf/transform.py`
- [Contour tracing](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/trace.py): `img2dxf/trace.py`
- [Path geometry](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/geometry.py): `img2dxf/geometry.py`
- [Detail smoothing](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/detail.py): `img2dxf/detail.py`
- [Path straightening](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/straighten.py): `img2dxf/straighten.py`
- [Arc fitting](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/arcfit.py): `img2dxf/arcfit.py`

### Laser preparation

- [Kerf offset](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/kerf.py): `img2dxf/kerf.py`
- [Holding tabs](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/tabs.py): `img2dxf/tabs.py`
- [Sheet tiling](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/tile.py): `img2dxf/tile.py`
- [Cut ordering](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/order.py): `img2dxf/order.py`

### Export and persistence

- [DXF writer](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/dxfwrite.py): `img2dxf/dxfwrite.py`
- [SVG writer](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/svgwrite.py): `img2dxf/svgwrite.py`
- [Saved settings](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/settings.py): `img2dxf/settings.py`
- [Recent files](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/gui/recent.py): `img2dxf/gui/recent.py`
- [Calibration output](https://github.com/aryansaraogi/dxfconvertor/blob/main/img2dxf/calibrate.py): `img2dxf/calibrate.py`

### Other components

- **Operator**
- **Laser software**

## Connections

- Operator → Desktop GUI: opens artwork
- Operator → Command line: submits job
- Desktop GUI → Settings controls: edits settings
- Settings controls → Trace parameters: builds parameters
- Command line → Trace parameters: builds parameters
- Desktop GUI → Trace worker: requests trace
- Trace worker → Trace pipeline: runs trace
- Command line → Trace pipeline: runs trace
- Trace pipeline → Framing and scale: frames and scales
- Trace pipeline → Image preparation: prepares pixels
- Trace pipeline → Contour tracing: traces masks
- Contour tracing → Path geometry: creates paths
- Trace pipeline → Detail smoothing: smooths paths
- Trace pipeline → Path straightening: straightens paths
- Trace pipeline → Kerf offset: offsets paths
- Trace pipeline → Arc fitting: fits arcs
- Trace pipeline → Sheet tiling: duplicates paths
- Trace pipeline → Cut ordering: orders cuts
- Trace worker → Desktop GUI: returns result
- Desktop GUI → Live preview: renders result
- Live preview → Holding tabs: shows tab gaps
- Desktop GUI → DXF writer: exports DXF
- Desktop GUI → SVG writer: exports SVG
- Command line → DXF writer: writes DXF
- Operator → Saved settings: saves job
- Desktop GUI → Recent files: updates history
- Operator → Calibration output: generates test
- DXF writer → Laser software: provides drawing
- SVG writer → Laser software: provides drawing
