Analog and digital circuit schematics from SPICE-style netlist or positional DSL. Auto-routed power/ground rails, orthogonal signal wiring, IEEE standard component symbols.
circuit "RC Low-Pass Filter"V1: vsource down label="Vin" value="5V"wire rightR1: resistor right label="R1" value="1kΩ"wire right 20pxdotC1: capacitor down label="C1" value="100nF"wire down 10pxgroundat: C1.startwire right 20pxlabel "Vout" right
DSL 示例:Inverting Op-Amp
circuit "Inverting Amplifier"V1: vsource down value="Vin"wire right 20pxRin: resistor right label="Rin" value="10kΩ"at: Rin.enddotnet: INV_INRf: resistor right label="Rf" value="100kΩ" at: INV_INU1: opamp rightat: U1.minuswire left 10pxat: INV_INat: U1.pluswire down 10pxgroundat: U1.outwire right 20pxlabel "Vout" rightat: Rf.endwire down # connect feedback from Vout back to Rf endat: U1.out
circuit "Voltage Divider"V1: vsource down value="12V"wire right 20pxR1: resistor down label="R1" value="10kΩ"dotR2: resistor down label="R2" value="10kΩ"wire down 10pxgroundat: V1.startwire right 20pxat: R1.startwire right 20pxlabel "Vout" right
circuit "LED Driver"V1: vsource down value="5V"wire rightR1: resistor right label="R1" value="220Ω"D1: led right label="D1"wire down 20pxgroundat: V1.startwire rightat: V1.start
circuit "Common Emitter"# Base resistorRb: resistor down label="Rb" value="100kΩ" at: (0, 0)Q1: npn at: Rb.end# Collector resistor to VCCRc: resistor up label="Rc" value="1kΩ" at: Q1.collectorwire up 10pxlabel "VCC" up# Emitter to groundat: Q1.emitterwire down 10pxground
验证:NPN BJT 符号正确(圆形 + base line + emitter arrow out)。
circuit "LC Filter"V1: acsource down value="Vs"wire rightL1: inductor right label="L1" value="10mH"wire right 10pxdotC1: capacitor down label="C1" value="1µF"wire down 10pxgroundat: L1.startwire downat: V1.start
Pins: 3-pin — start (left), wiper (center/top), end (right)
尺寸: 60px long × 24px tall(含 wiper 箭头)
SVG Path:
/* 基础 zigzag (与 resistor 相同) */M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0/* wiper 箭头从顶部指向中心 */M 25,-22 L 25,-10 /* 垂直线 */M 20,-22 L 25,-16 L 30,-22 /* 箭头头部 */
M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0/* 符号标记 — 在 renderer 中作为 <text> 元素 *//* text: "-t°" at (44, -6), font-size: 8px */
M 0,0 L 10,0 L 13,-8 L 18,8 L 23,-8 L 28,8 L 33,-8 L 38,8 L 40,0 L 50,0/* 左侧光箭头 (从左上到右下) */M 2,-18 L 14,-6 M 11,-6 L 14,-6 L 14,-9 /* arrow1 *//* 右侧光箭头 */M 10,-20 L 22,-8 M 19,-8 L 22,-8 L 22,-11 /* arrow2 */
SVG Path: Resistor zigzag in a rounded box,带 "V" 文字
M 0,0 H 8 M 8,-10 H 42 V 10 H 8 V -10 /* box *//* zigzag inside box — scaled down */M 10,0 L 13,-6 L 17,6 L 21,-6 L 25,6 L 29,-6 L 33,6 L 37,0M 42,0 H 50/* "V" 文字 in renderer at (44, -14) */
M 0,0 H 18 /* lead to negative plate */M 18,-12 V 12 /* negative plate (straight line) */M 22,-12 Q 26,-12 26,0 Q 26,12 22,12 /* positive plate (curved) */M 26,0 H 40 /* positive lead *//* Polarity marks *//* "+" text at (30, -15), font-size: 9px *//* "−" text at (14, -15), font-size: 9px */
/* Gate lead */M -20,0 H -8 /* gate input wire *//* Gate insulation line */M -8,-20 V 20 stroke-width:2/* Channel lines */M -4,-18 V -4 /* upper channel segment */M -4,4 V 18 /* lower channel segment *//* Collector/Emitter base line */M -4,-18 H 8 M -4,18 H 8/* Collector wire (top) */M 8,-18 V -30 /* upward *//* Emitter wire (bottom, with arrow) */M 8,18 V 30 /* downward *//* Emitter arrow (outward = N-type) */M 2,14 L 8,18 L 2,22/* Body diode (anti-parallel) */M 8,-18 L 8,18 /* diode series with emitter path *//* diode symbol: small triangle + bar at midpoint */M 12,-4 L 12,4 L 20,0 Z /* triangle */M 20,-5 V 5 /* bar */
M 0,0 H 16 /* anode lead */M 16,-14 L 32,0 L 16,14 Z /* triangle */M 32,-12 V 12 /* cathode bar */M 32,0 H 50 /* cathode lead */M 32,8 L 32,20 H 50 /* gate lead from cathode junction downward */
M 0,0 H 14/* Upper triangle (T1→T2 direction) */M 14,-12 L 30,0 L 14,12 /* triangle outline */M 14,-12 V 12 /* left bar *//* Lower triangle (T2→T1 direction, inverted) */M 30,-12 L 14,0 L 30,12 /* inverted triangle */M 30,-12 V 12 /* right bar */M 30,0 H 44/* Gate */M 30,8 L 44,20 /* gate lead from right junction */
Pins: base (left), collector (top), emitter (bottom)
符号: 两个 NPN 嵌套,外框矩形
M 0,-20 H 60 V 60 H 0 Z stroke-dashed /* outer box *//* inner NPN1 *//* inner NPN2 — emitter of NPN1 feeds base of NPN2 *//* simplified: show "Darlington" label inside */
/* Rotated 45° diamond outline */M 0,0 L 20,-20 L 40,0 L 20,20 Z stroke dashed (envelope)/* 4 diodes — simplified: arrows pointing from AC to DC rail *//* D1: bottom-left→top (ac1→dc_pos) *//* D2: bottom-right→top (ac2→dc_pos) *//* D3: bottom→bottom-left (dc_neg→ac1) *//* D4: bottom→bottom-right (dc_neg→ac2) *//* In renderer: draw as 40×40px diamond with internal arrows */
M 0,0 H 14M 14,-12 L 28,0 L 14,12 Z /* triangle */M 28,-12 V 12 /* bar */M 28,0 H 42/* incoming light arrows (from upper-left) */M 0,-22 L 10,-10 M 8,-10 L 10,-10 L 10,-13M 6,-26 L 16,-14 M 14,-14 L 16,-14 L 16,-17
Pins: 3-pin — collector (top), base (optional, left), emitter (bottom)
符号: NPN BJT 形状 + 两个向内箭头(光替代 base 偏置)
/* NPN BJT paths (same as npn) *//* incoming light arrows — same as photodiode */M -6,-22 L 4,-10 M 2,-10 L 4,-10 L 4,-13M -2,-26 L 8,-14 M 6,-14 L 8,-14 L 8,-17
Pins: 4-pin — a (LED anode), k (LED cathode), c (transistor collector), e (transistor emitter)
符号: LED + 光箭头 + phototransistor,包围在虚线矩形中
/* dashed isolation box */M 0,-20 H 80 V 60 H 0 V -20 stroke-dasharray:4,3/* LED symbol at x=15 *//* light arrows between LED and transistor */M 30,-5 L 50,15 /* arrow1 */M 30,5 L 50,25 /* arrow2 *//* arrowheads *//* phototransistor at x=55 */
M 0,0 H 14 /* left wire */M 14,0 L 34,-12 /* contact arm (open position, 35° tilt) *//* contact point */M 36,0 H 50 /* right wire *//* contact dot: circle r=2 at (14,0) *//* contact dot: circle r=2 at (36,0) */
Pins: 3-pin — common (left), nc (top-right), no (bottom-right)
符号: 公共接触 + 两个输出端
M 0,0 H 14 /* common wire */M 14,0 L 36,-14 /* arm pointing to NC position */M 38,-16 H 50 /* NC output */M 38,8 H 50 /* NO output (open gap) *//* dots at connection points */
M 0,0 H 14M 14,0 H 22 /* left contact *//* gap (NO state) */M 28,0 H 36 /* right contact */M 36,0 H 50/* actuator (vertical line above gap) */M 25,-4 V -14 /* push rod */M 18,-14 H 32 /* button top */
M 0,0 H 8M 8,-10 H 42 V 10 H 8 V -10 /* coil body rect *//* coil symbol inside */M 10,0 Q 12,-7 14,0 Q 16,7 18,0 Q 20,-7 22,0 Q 24,7 26,0 Q 28,-7 30,0M 42,0 H 50
Pins: 3-pin — in (left), gnd (bottom), out (right)
符号: 矩形 block + "REG" label + 三引脚
M -30,0 H -10 /* input wire */M -10,-20 H 10 V 20 H -10 V -20 /* body rect 20×40px */M 10,0 H 30 /* output wire */M 0,20 V 40 /* ground pin *//* "REG" text inside body *//* IN/OUT/GND labels in renderer */
M -40,-15 H -15 M -40,15 H -15M -15,-25 H 15 V 25 H -15 V -25 /* body 30×50px */M 15,-15 H 40 M 15,15 H 40/* "DC/DC" label in renderer *//* internal arrow: M -8,0 L 8,0 with arrowhead */