# Ohmforge Gerber & Drill Viewer with DRC-lite > Gerber X2 and Excellon files in – board render, drill table, trace and clearance checks out. Upload the fabrication data of a printed circuit board – a ZIP of Gerber (RS-274X / X2) layers and Excellon drill files from KiCad, Altium, Eagle, EasyEDA or any CAM tool – and get a rendered board (top and bottom), one SVG per layer with correct dark and clear polarity, the board size from the outline, a drill table per diameter, the narrowest drawn trace, a sampled copper clearance and copper area, and a DRC-lite for annular rings and hole-to-edge distances. Layers are recognised from X2 attributes or file names. A board model with the outline and mounting holes is ready for the enclosure generator. Part of usefulweb.app (https://usefulweb.app/). Part of [Ohmforge](https://ohmforge.usefulweb.app/) (ownerApp: ohmforge). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://ohmforgegerberviewer.usefulweb.app/ (interactive tool at https://ohmforgegerberviewer.usefulweb.app/tool) - JSON API: POST https://ohmforgegerberviewer.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://ohmforgegerberviewer.usefulweb.app/api/v1/tool) - OpenAPI: https://ohmforgegerberviewer.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://ohmforgegerberviewer.usefulweb.app/mcp - tool `ohmforge_gerber_viewer` ## Inputs - file (file): Gerber files (ZIP) or one Gerber or drill file - A ZIP of the fabrication files (layers and drill files) or a single file, up to 25 MB. Files are processed in memory and not kept. - drill (file): Separate drill file (optional) - Add an Excellon drill file when it is not inside the ZIP. - text (textarea): Or paste one Gerber or Excellon file - Used together with any uploaded files. - side (select): Board side for the image - minTraceMm (number): Minimum trace width - Drawn traces narrower than this are reported. - minClearanceMm (number): Minimum copper clearance - Sampled gaps between separate copper islands below this are reported. - minAnnularRingMm (number): Minimum annular ring - Copper left around a plated hole, from the drill edge to the pad edge. - minEdgeMm (number): Minimum hole-to-edge distance - From the hole edge to the nearest board outline. - sampleMm (number): Sampling grid (0 = automatic) - Grid step for the copper area and clearance estimate; automatic keeps about four million points. - mountMinMm (number): Mounting holes from - mountMaxMm (number): Mounting holes up to - Holes in this diameter range are mounting-hole candidates for the enclosure board model. ## Method - Gerber files are read as the Ucamco Gerber Layer Format Specification (2024.05) defines them: format and unit, standard apertures with holes, aperture macros with variables and expressions (primitives 1, 4, 5, 7, 20, 21 and the deprecated 2, 22, 6), linear and circular plotting with G75 (and deprecated G74), regions with several contours, dark/clear polarity, mirroring, rotation and scaling (LM, LR, LS), step and repeat (SR), block apertures (AB) and X2 attributes. Excellon drill files: METRIC/INCH, LZ/TZ or decimal coordinates, tool tables, G85 slots and routed slots. - Layers are identified by their X2 .FileFunction attribute first, then by KiCad, Altium/Protel, Eagle and EasyEDA file names. Plating comes from X2 attributes, the file name (PTH/NPTH) or Altium comments; a hole of unknown plating without a copper pad on the outer layers counts as non-plated. - Exact values: board size, area and perimeter from the closed contour of the profile (edge-cuts) layer, measured on the line centres; drill counts per diameter; the narrowest drawn trace (circular-aperture draws and arcs); annular ring = largest inscribed distance of the flashed pad at the hole centre minus the drill radius (smallest over the outer copper layers); hole-to-edge = distance from the hole centre to the outline minus the radius. - Sampled values: copper is rasterised with dark and clear polarity on a grid (about four million points, at least 0.02 mm). Copper area = copper points inside the outline ÷ outline points. Clearance = smallest gap between separate 8-connected copper islands, found with an exact Euclidean distance transform (Felzenszwalb–Huttenlocher); it is accurate to about one grid step, and islands closer than one step merge. - Mounting-hole candidates are holes between the two diameters (default 2–4.5 mm, M2–M4 clearance holes); non-plated ones and those within 12 mm of the edge are preselected. The board model moves the outline's lower-left corner to (0, 0) and simplifies the contour to at most 200 points. ## Limits - A viewer and a quick check, not a fabricator's CAM or a full design-rule check: clearances are sampled on a grid (± one grid step), only flashed pads count for annular rings, and the default rules are typical values. Check your manufacturer's capabilities and review the files in their own viewer before ordering.