Merge pull request #207 from karu2003/feat/schematic-mirrorY

feat(schematic): add angle and mirrorY to add_schematic_component
This commit is contained in:
mixelpixx
2026-05-30 09:34:45 -04:00
committed by GitHub
2 changed files with 156 additions and 12 deletions

View File

@@ -55,6 +55,14 @@ export function registerSchematicTools(server: McpServer, callKicadScript: Funct
.min(1)
.optional()
.describe("Unit number for multi-unit symbols (1=A, 2=B, 3=C, …). Defaults to 1."),
angle: z
.number()
.optional()
.describe("Rotation angle in degrees (KiCad CCW). 0=vertical resistor, 90=horizontal. Defaults to 0."),
mirrorY: z
.boolean()
.optional()
.describe("Mirror the symbol horizontally (flip left-right). Useful for transistors facing opposite direction."),
},
async (args: {
schematicPath: string;
@@ -64,6 +72,8 @@ export function registerSchematicTools(server: McpServer, callKicadScript: Funct
footprint?: string;
position?: { x: number; y: number };
unit?: number;
angle?: number;
mirrorY?: boolean;
}) => {
// Transform to what Python backend expects
const [library, symbolName] = args.symbol.includes(":")
@@ -82,6 +92,8 @@ export function registerSchematicTools(server: McpServer, callKicadScript: Funct
x: args.position?.x ?? 0,
y: args.position?.y ?? 0,
unit: args.unit ?? 1,
angle: args.angle ?? 0,
mirrorY: args.mirrorY ?? false,
},
};