$ show fritzing/fritzing-app
Fritzing is an open-source electronic design automation (EDA) tool focused on maker and educational use. It provides three interconnected views (breadboard, schematic, PCB) for circuit design, with features including component placement, wiring, autorouting, ngspice simulation, microcontroller code editing/upload (Arduino, PICAXE), and export to Gerber, PDF, SVG, and other formats. The application is built as a monolithic Qt/C++ desktop app with a modular internal architecture: model layer (ModelPart, ModelBase), view layer (SketchWidget subclasses), command pattern for undo/redo, and dedicated subsystems for parts management, SVG rendering, and design rule checking. It relies on external libraries such as Boost (graph algorithms), Clipper (polygon operations), QuaZip (ZIP handling), libgit2 (parts repository updates), and ngspice (simulation). The codebase is actively maintained with ongoing Qt6 migration, though some legacy patterns and workarounds remain.
The LLM identified 7 files worth highlighting for reuse:
Implements the Guillotine bin-packing algorithm with multiple heuristics (best area fit, best short-side fit, best long-side fit, worst fit). Fully self-contained, with only a dependency on the internal Rect class. Can be extracted and reused in any rectangle packing scenario.
Provides cubic BΓ©zier curve utilities: length calculation, splitting at parameter, bounding box, and control point manipulation. Pure math, no external dependencies beyond standard C++. Useful for any vector graphics or path manipulation.
A trie data structure used for keyword matching in syntax highlighting. Supports insertion and prefix-based search. Self-contained, with no internal dependencies, and can be reused in any text processing or autocomplete context.
A Qt widget for editing tags as visual chips/tokens with autocomplete. Features a wrapping flow layout, editable tokens, and customizable removal. Fully self-contained widget that can be extracted and reused in any tag-input scenario.
Implements graph algorithms using Boost: minimum spanning tree (Prim), minimum cut (Edmonds-Karp max flow), and transitive closure. Used for ratsnest optimization and autorouting. The code is modular and depends only on Boost graph; it can be reused for network analysis.
Splits and normalizes SVG files: extracts elements, resolves transforms, clips to viewport, and restructures SVG DOM. Depends on Qt's XML and SVG classes, but otherwise self-contained. Useful for any SVG processing pipeline.
A Qt widget combining a slider, +/- buttons, and step-based zoom. Customizable range and step size. Self-contained and reusable in any graphics application needing zoom controls.