import type { PcbInternalState } from './pcb_state.js'; import { Pin } from '../pin.js'; /** * PCB Zone Management Module * * This module contains standalone functions for managing copper zones, keepout zones, * and staged outlines. These functions were extracted from the main PCB class to provide * better modularity and reusability. */ /** * Creates a filled zone on copper layers connected to a specific net. * @param pcb - The PCB instance to add the zone to * @param options - Zone configuration options * @param options.pin - The pin object to connect this zone to (determines the net). Use either pin or net, not both. * @param options.net - The net name to connect this zone to (e.g., 'GND', 'VCC'). Use either pin or net, not both. * @param options.layers - Array of layer names (e.g., ['F.Cu', 'B.Cu']) * @param options.x - The x-coordinate of the zone's starting corner * @param options.y - The y-coordinate of the zone's starting corner * @param options.width - The width of the zone * @param options.height - The height of the zone * @param options.fillMode - Fill mode: 'solid' (default) or 'hatched' * @param options.filled - Whether zone should be filled (default: true) * @param options.priority - Zone priority (default: 0) * @param options.locked - Lock zone to prevent editing (default: false) * @param options.name - Optional zone name * @param options.minThickness - Minimum thickness (default: 0.1778mm) * @param options.clearance - Clearance from pads (default: 0.2mm) * @param options.connectPads - Pad connection type (default: thermal relief) * @param options.thermalGap - Thermal relief gap (default: 0.254mm) * @param options.thermalBridgeWidth - Thermal bridge width (default: 0.4064mm) * @param options.hatchStyle - Hatch style for zone outline: 'none', 'edge' (default), or 'full' * @param options.hatchPitch - Hatch pitch/spacing (default: 0.508mm) * @param options.smoothing - Corner smoothing: 'chamfer', 'fillet', or 'none' (default) * @param options.smoothingRadius - Radius for corner smoothing (required if smoothing is set) * @param options.islandRemovalMode - Island removal mode (default: 2) * @param options.islandAreaMin - Minimum island area (default: 0.5) * @param options.hatchThickness - Hatch thickness * @param options.hatchGap - Hatch gap * @param options.hatchOrientation - Hatch orientation * @param options.hatchSmoothingLevel - Hatch smoothing level * @param options.hatchSmoothingValue - Hatch smoothing value * @param options.hatchBorderAlgorithm - Hatch border algorithm * @param options.hatchMinHoleArea - Hatch minimum hole area * @param options.fillArcSegments - Fill arc segments (default: 16) * @param options.filledAreasThickness - Whether filled areas have thickness * @example * ```ts * // Basic ground plane * pcb.zone({ * net: 'GND', * layers: ['F.Cu', 'B.Cu'], * x: 0, y: 0, * width: 50, height: 50 * }); * * // Zone connected to specific pin * pcb.zone({ * pin: pcb.components[0].pins[0], * layers: ['F.Cu'], * x: 10, y: 10, * width: 20, height: 20, * clearance: 0.25, * thermalGap: 0.3, * thermalBridgeWidth: 0.5 * }); * * // Hatched fill zone * pcb.zone({ * net: 'VCC', * layers: ['F.Cu'], * x: 0, y: 0, * width: 40, height: 40, * fillMode: 'hatched', * hatchStyle: 'edge', * hatchPitch: 0.5 * }); * ``` */ export declare function zone(state: PcbInternalState, options: { pin?: Pin; net?: string; layers: string[]; x: number; y: number; width: number; height: number; fillMode?: 'solid' | 'hatched'; filled?: boolean; priority?: number; locked?: boolean; name?: string; minThickness?: number; hatchStyle?: 'none' | 'edge' | 'full'; hatchPitch?: number; clearance?: number; connectPads?: 'thru_hole_only' | 'full' | 'no'; thermalGap?: number; thermalBridgeWidth?: number; smoothing?: 'chamfer' | 'fillet' | 'none'; smoothingRadius?: number; islandRemovalMode?: number; islandAreaMin?: number; hatchThickness?: number; hatchGap?: number; hatchOrientation?: number; hatchSmoothingLevel?: number; hatchSmoothingValue?: number; hatchBorderAlgorithm?: 'hatch_thickness' | 'min_thickness'; hatchMinHoleArea?: number; fillArcSegments?: number; filledAreasThickness?: boolean; }): void; /** * Creates a keepout zone that restricts routing and placement. * @param pcb - The PCB instance to add the keepout zone to * @param options - Keepout zone configuration options * @param options.layers - Array of layer names (e.g., ['F.Cu', 'B.Cu']) * @param options.x - The x-coordinate of the keepout zone's starting corner * @param options.y - The y-coordinate of the keepout zone's starting corner * @param options.width - The width of the keepout zone * @param options.height - The height of the keepout zone * @param options.restrictions - Object specifying what to restrict (all default to true) * @param options.restrictions.tracks - Restrict tracks (default: true) * @param options.restrictions.vias - Restrict vias (default: true) * @param options.restrictions.pads - Restrict pads (default: true) * @param options.restrictions.copperpour - Restrict copper pour (default: true) * @param options.restrictions.footprints - Restrict footprints (default: true) * @param options.priority - Zone priority (default: 0) * @param options.locked - Lock zone to prevent editing (default: false) * @param options.name - Optional zone name * @param options.hatchStyle - Hatch style for zone outline: 'none', 'edge' (default), or 'full' * @param options.hatchPitch - Hatch pitch/spacing (default: 0.508mm) * @param options.smoothing - Corner smoothing: 'chamfer', 'fillet', or 'none' (default) * @param options.smoothingRadius - Radius for corner smoothing (required if smoothing is set) * @example * ```ts * // ============================================ * // BASIC EXAMPLES * // ============================================ * * // Basic keepout (restricts everything) * pcb.keepout({ * layers: ['F.Cu', 'B.Cu'], * x: 0, y: 0, * width: 10, height: 10 * }); * * // ============================================ * // CUSTOM RESTRICTIONS * // ============================================ * * // Restrict only tracks and vias, allow pads * pcb.keepout({ * layers: ['F.Cu'], * x: 5, y: 5, width: 8, height: 8, * restrictions: { * tracks: true, * vias: true, * pads: false, * copperpour: true, * footprints: false * } * }); * * // Restrict only copper pour (allow routing) * pcb.keepout({ * layers: ['F.Cu'], * x: 10, y: 10, width: 15, height: 15, * restrictions: { * tracks: false, * vias: false, * pads: false, * copperpour: true, * footprints: false * } * }); * * // ============================================ * // ZONE MANAGEMENT OPTIONS * // ============================================ * * // Named, locked keepout with priority * pcb.keepout({ * layers: ['F.Cu', 'B.Cu'], * x: 0, y: 0, width: 20, height: 20, * name: 'Antenna Keepout', * locked: true, * priority: 10 * }); * * // High-priority keepout area * pcb.keepout({ * layers: ['F.Cu'], * x: 0, y: 0, width: 30, height: 30, * name: 'Critical Area', * priority: 100 * }); * * // ============================================ * // CORNER SMOOTHING * // ============================================ * * // Filleted corners * pcb.keepout({ * layers: ['F.Cu'], * x: 0, y: 0, width: 15, height: 15, * smoothing: 'fillet', * smoothingRadius: 0.5, * name: 'Smooth Keepout' * }); * * // Chamfered corners * pcb.keepout({ * layers: ['B.Cu'], * x: 0, y: 0, width: 15, height: 15, * smoothing: 'chamfer', * smoothingRadius: 0.3 * }); * ``` */ export declare function keepout(state: PcbInternalState, options: { layers: string[]; x: number; y: number; width: number; height: number; restrictions?: { tracks?: boolean; vias?: boolean; pads?: boolean; copperpour?: boolean; footprints?: boolean; }; priority?: number; locked?: boolean; name?: string; hatchStyle?: 'none' | 'edge' | 'full'; hatchPitch?: number; smoothing?: 'chamfer' | 'fillet' | 'none'; smoothingRadius?: number; }): void; //# sourceMappingURL=pcb_zones.d.ts.map