From 575e24cca7fdf19516aae8bc5776eaf4ad4529dd Mon Sep 17 00:00:00 2001 From: jaseg Date: Tue, 28 Jun 2022 13:46:43 +0200 Subject: Update protoboard index --- README.rst | 4 +++ generate_protoboards.py | 86 ++++++++++++++++++++++++++++++++++++------------- 2 files changed, 68 insertions(+), 22 deletions(-) diff --git a/README.rst b/README.rst index 6b5aaec..c63455e 100644 --- a/README.rst +++ b/README.rst @@ -671,6 +671,9 @@ Gallery .. image:: pics/sample3.jpg :width: 400px +For a demonstration of ``gerbolyze convert``, check out the `Gerbolyze Protoboard Index`_, where you can download gerber +files for over 7.000 SMD and THT protoboard layouts. + Licensing --------- @@ -689,4 +692,5 @@ avoid that so the default license is still AGPL. .. _pcb-tools-extension: https://github.com/opiopan/pcb-tools-extension .. _GIMP: https://gimp.org/ .. _gerbonara: https://gitlab.com/gerbolyze/gerbonara +.. _`Gerbolyze Protoboard Index`: https://dyna.kokoroyukuma.de/protos/ diff --git a/generate_protoboards.py b/generate_protoboards.py index 2183bca..ae56b60 100644 --- a/generate_protoboards.py +++ b/generate_protoboards.py @@ -90,19 +90,20 @@ def write_index(index, outdir): tht_pitches = lambda patterns: [ p.pitch for p in patterns if isinstance(p, THTProtoAreaCircles) ] smd_pitches = lambda patterns: [ min(p.pitch_x, p.pitch_y) for p in patterns if isinstance(p, SMDProtoAreaRectangles) ] has_ground_plane = lambda patterns: any(isinstance(p, EmptyProtoArea) and p.copper for p in patterns) - format_pitches = lambda pitches: ', '.join(f'{p:.2f} mm' for p in sorted(pitches)) + format_pitches = lambda pitches: ', '.join(f'{p:.2f}' for p in sorted(pitches)) format_length = lambda length_or_none, default='': default if length_or_none is None else f'{length_or_none:.2f} mm' + area_count = lambda patterns: len(set(p for p in patterns if not isinstance(p, EmptyProtoArea))) table_rows = [ ('' - f'Gerbers' + f'Gerber' f'Preview' f'SVG' - f'{w:.2f} mm' - f'{h:.2f} mm' + f'{w:.2f}' + f'{h:.2f}' f'{"Yes" if hole_dia is not None else "No"}' - f'{format_length(hole_dia)}' - f'{len(patterns)}' + f'{f"{hole_dia:.2f}" if hole_dia is not None else ""}' + f'{area_count(patterns)}' f'{"Yes" if symmetric else "No"}' f'{"Yes" if has_ground_plane(patterns) else "No"}' f'{format_pitches(tht_pitches(patterns))}' @@ -116,7 +117,7 @@ def write_index(index, outdir): 'Width': sorted(set(w for w, h, *rest in index.values())), 'Height': sorted(set(h for w, h, *rest in index.values())), 'Mounting Hole Diameter': sorted(set(dia for w, h, dia, *rest in index.values() if dia)) + ['None'], - 'Number of Areas': sorted(set(len(patterns) for *_rest, patterns in index.values())), + 'Number of Areas': sorted(set(area_count(patterns) for *_rest, patterns in index.values())), 'Symmetric Top and Bottom?': ['Yes', 'No'], 'Ground Plane?': ['Yes', 'No'], 'THT Pitches': sorted(set(p for *_rest, patterns in index.values() for p in tht_pitches(patterns))) + ['None'], @@ -150,7 +151,7 @@ def write_index(index, outdir): selected = []; for (let checkbox of filter.querySelectorAll('input')) { if (checkbox.checked) { - selected.push(checkbox.nextElementSibling.textContent); + selected.push(checkbox.nextElementSibling.textContent.replace(/ mm$/, '')); } } filters[filter.id.replace(/^filter-/, '')] = selected; @@ -237,9 +238,9 @@ def write_index(index, outdir): } table { - table-layout: fixed; border-collapse: collapse; box-shadow: 0 0 3px gray; + width: 100%; } td { @@ -256,22 +257,63 @@ def write_index(index, outdir): #listing tr:hover { background-color: #ffff80; } + + #listing tr td { + text-align: center; + } + + #listing tr td:nth-child(4), #listing tr td:nth-child(5) { + text-align: right; + } + + #filter { + margin-top: 2em; + } button { margin: 2em 0.2em; padding: .5em 1em; } + + body { + max-width: 80em; + margin: 3em auto; + } + + body > div { + width: 100%; + } '''.strip()) html = textwrap.dedent(f''' - Protoboard Index + Gerbolyze Protoboard Index +

Gerbolyze Protoboard Index

+

+ This page contains gerbers for many different types of prototype circuit boards. Everything from different pitches + of THT hole patterns to SMD pad patterns is included in many different sizes and with several mounting hole options. +

+ +

+ All downloads on this page are licensed under the Unlicense. This means you can + download what you like and do with it whatever you want. Just note that everything here is provided without any + warranty, so if you send files you find here to a pcb board house and what you get back from them is all wrong, + that's your problem. +

+ +

+ All files on this page have been generated automatically from a number of templates using + gerbolyze + (github mirror). If you have any suggestions for additional layouts + or layout options, please feel free to file an issue on + Gerbolyze's issue tracker on github. +

@@ -288,18 +330,18 @@ def write_index(index, outdir):
- - - - - - - - - - - - + + + + + + + + + + + + -- cgit
DownloadPreviewSource SVGWidthHeightHas Mounting Holes?Mounting Hole DiameterNumber of AreasSymmetric Top and Bottom?Ground Plane?THT PitchesSMD PitchesDownloadPreviewSource SVGWidth [mm]Height [mm]Has Mounting Holes?Mounting Hole Diameter [mm]Number of AreasSymmetric Top and Bottom?Ground Plane?THT Pitches [mm]SMD Pitches [mm]