/** * EasyEDA Footprint to KiCad Footprint Converter * Complete rewrite to handle all EasyEDA shape types * * Supported shapes: PAD, TRACK, HOLE, CIRCLE, ARC, RECT, VIA, TEXT, SOLIDREGION */ import type { EasyEDAComponentData } from '../types/index.js'; export interface FootprintConversionOptions { libraryName?: string; include3DModel?: boolean; modelPath?: string; } export interface FootprintResult { type: 'reference' | 'generated'; reference?: string; content?: string; name: string; } export declare class FootprintConverter { /** * Convert EasyEDA component data to KiCad footprint format string */ convert(component: EasyEDAComponentData, options?: FootprintConversionOptions): string; /** * Get footprint using hybrid approach: * - Use KiCad standard footprint if available (for common 2-pad passives) * - Generate custom footprint for all other components * * CONSERVATIVE APPROACH: Only uses KiCad built-ins for R/C/L passives. * This prevents pin-flip issues from pad numbering mismatches in ICs/transistors. */ getFootprint(component: EasyEDAComponentData, options?: FootprintConversionOptions): FootprintResult; /** * Generate PAD element * Handles all shapes: RECT, ELLIPSE, OVAL, POLYGON */ private generatePad; /** * Generate custom POLYGON pad using gr_poly primitive * Supports both SMD and through-hole polygon pads * * Note: EasyEDA polygon pads may have holeRadius=0 even for through-hole pads. * We use isPlated=true as a hint and calculate drill size from polygon geometry. */ private generatePolygonPad; /** * Calculate drill radius from polygon points * Uses inscribed circle approximation: smallest distance from center to any edge * Returns radius in EasyEDA units (10mil) */ private calculateDrillRadiusFromPolygon; /** * Generate HOLE as NPTH pad */ private generateHole; /** * Generate VIA as through-hole pad (no number) */ private generateVia; /** * Generate TRACK as fp_line segments */ private generateTrack; /** * Generate CIRCLE as fp_circle */ private generateCircle; /** * Generate ARC as fp_arc (from SVG path) */ private generateArc; /** * Generate RECT as 4 fp_line elements */ private generateRect; /** * Generate TEXT as fp_text (user text, not REF/VAL) */ private generateText; /** * Generate SOLIDREGION as fp_poly (filled polygon) * Parses SVG path with M/L/Z commands and converts to KiCad polygon */ private generateSolidRegion; /** * Parse SVG path string to array of points * Handles M, L, H, V, C, Q, A, Z commands * Curves are simplified to their endpoints (no interpolation) */ private parseSvgPathToPoints; /** * Calculate bounding box from all footprint elements */ private calculateBounds; /** * Generate footprint properties * Positions Reference above courtyard and Value below courtyard */ private generateProperties; /** * Generate fab reference text */ private generateFabReference; /** * Generate courtyard outline */ private generateCourtyard; /** * Generate 3D model reference */ private generate3DModel; private sanitizeName; private escapeString; } export declare const footprintConverter: FootprintConverter; //# sourceMappingURL=footprint.d.ts.map