Skip to main content

Crate pedalkernel_layout

Crate pedalkernel_layout 

Source
Expand description

Automatic schematic layout engine for PedalKernel .pedal circuits.

Converts a parsed pedalkernel::dsl::PedalDef into a positioned layout suitable for:

  1. Plugin UI — real-time signal flow visualization with monitor-driven glow
  2. KiCad export — properly placed .kicad_sch files for PCB design

§Pipeline

PedalDef
  → LayoutGraph        (directed graph with pin-direction inference)
  → FunctionalGroups   (gain stages, tone stacks, push-pull, etc.)
  → Column assignment  (Sugiyama layering for left-to-right signal flow)
  → Vertical placement (supply → signal path → ground convention)
  → Wire routing       (orthogonal Manhattan paths)
  → Optimization       (crossing minimization, grid snap, symmetry)
  → Layout             (JSON-serializable output)

Modules§

graph
Phase 1: Directed graph construction from the .pedal netlist.
groups
Phase 2: Functional group detection.
kicad
KiCad .kicad_sch schematic export from layout data.
layering
Phase 3: Sugiyama layer (column) assignment.
optimize
Phase 6: Aesthetic optimization pass.
placement
Phase 4: Vertical placement within columns.
routing
Phase 5: Wire routing (orthogonal Manhattan paths).
symbols
Component symbol definitions.
types
Output types for the schematic layout engine.

Functions§

generate_layout
Generate a complete schematic layout from a parsed pedal definition.
to_json
Serialize a layout to .pedal_layout JSON format.
to_kicad_schematic
Export a layout to KiCad .kicad_sch schematic format.