summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-12-16 19:18:35 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2017-12-16 19:18:35 +0100
commite90da11ffd28b10d340184dbeeaa094007b472ec (patch)
tree108bb9711770e2836c6afe7f3ed3704546690c0c
parentbee6fd0f080d36194463e4c41e2d64ebbf76a2d5 (diff)
downloadIPC-7351-footprints-generator-e90da11ffd28b10d340184dbeeaa094007b472ec.tar.gz
IPC-7351-footprints-generator-e90da11ffd28b10d340184dbeeaa094007b472ec.tar.bz2
IPC-7351-footprints-generator-e90da11ffd28b10d340184dbeeaa094007b472ec.tar.xz
IPC-7351-footprints-generator-e90da11ffd28b10d340184dbeeaa094007b472ec.zip
o Moving some code around.
-rwxr-xr-xgen105
-rw-r--r--ipc_sm_782.py28
2 files changed, 67 insertions, 66 deletions
diff --git a/gen b/gen
index 6f21655..bf9c706 100755
--- a/gen
+++ b/gen
@@ -15,42 +15,6 @@ env.globals["rnd2"] = lambda x: round(x, 2)
chip = env.get_template('CHIP.j2')
-resc_heights = {
- "1005": [0.15, 0.35, 0.37, 0.40],
- "1608": [0.40],
- "2012": [0.40],
- "3216": [0.40],
- "3225": [0.40],
- "5025": [0.40],
- "6332": [0.40],
-}
-
-capc_heights = {
- "1005": [0.15, 0.35, 0.37, 0.40],
- "1608": [0.40],
- "2012": [0.40, 1.35],
- "3216": [0.40],
- "3225": [0.40],
- "5025": [0.40],
- "6332": [0.40],
-}
-
-ledsc_heights = {
-# https://www.digikey.com/products/en/optoelectronics/led-indication-discrete/105?k=&pkeyword=&pv16=4&FV=ffe00069%2C1140003&mnonly=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=100
- "1005": [0.25, 0.35, 0.40, 0.45, 0.50, 0.52, 0.55, 0.60, 0.70, 0.71],
- "1608": [0.20, 0.25, 0.28, 0.30, 0.35, 0.39, 0.40, 0.42, 0.45, 0.46, 0.50, 0.52, 0.55, 0.60, 0.65, 0.70, 0.71, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15],
- "2012": [0.40, 0.45, 0.50, 0.70, 0.75, 0.79, 0.80, 0.84, 0.85, 0.90, 1.00, 1.10, 1.20, 1.25, 1.30, 2.10],
-}
-
-def auto_str(cls):
- def __str__(self):
- return '%s(%s)' % (
- type(self).__name__,
- ', '.join('%s=%s' % item for item in vars(self).items())
- )
- cls.__str__ = __str__
- return cls
-
class Value(object):
def __init__(self, typ, mn, mx):
@@ -68,6 +32,15 @@ def parse_courtyard(grid):
(grid_y, grid_x) = grid_re.match(grid).groups()
return (float(grid_x) * 0.5 / 2, float(grid_y) * 0.5 / 2)
+def auto_str(cls):
+ def __str__(self):
+ return '%s(%s)' % (
+ type(self).__name__,
+ ', '.join('%s=%s' % item for item in vars(self).items())
+ )
+ cls.__str__ = __str__
+ return cls
+
@auto_str
class ChipDimensions(object):
@@ -108,12 +81,68 @@ class ChipLandPattern(object):
pad_size_y = float(data["x"]),
courtyard_x = courtyard_x, courtyard_y = courtyard_y)
+resc_heights = {
+ "1005": [0.15, 0.35, 0.37, 0.40],
+ "1608": [0.40],
+ "2012": [0.40],
+ "3216": [0.40],
+ "3225": [0.40],
+ "5025": [0.40],
+ "6332": [0.40],
+ "7142": [0.89],
+}
+
+capc_heights = {
+ "1005": [0.15, 0.35, 0.37, 0.40],
+ "1608": [0.40],
+ "2012": [0.40, 1.35],
+ "3216": [0.40],
+ "3225": [0.40],
+ "5025": [0.40],
+ "6332": [0.40],
+}
+
+ledsc_heights = {
+# https://www.digikey.com/products/en/optoelectronics/led-indication-discrete/105?k=&pkeyword=&pv16=4&FV=ffe00069%2C1140003&mnonly=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=100
+ "1005": [0.25, 0.35, 0.40, 0.45, 0.50, 0.52, 0.55, 0.60, 0.70, 0.71],
+ "1608": [0.20, 0.25, 0.28, 0.30, 0.35, 0.39, 0.40, 0.42, 0.45, 0.46, 0.50, 0.52, 0.55, 0.60, 0.65, 0.70, 0.71, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15],
+ "2012": [0.40, 0.45, 0.50, 0.70, 0.75, 0.79, 0.80, 0.84, 0.85, 0.90, 1.00, 1.10, 1.20, 1.25, 1.30, 2.10],
+}
+
#resc_dims = [ChipDimensions.from_ipc(p) for p in ipc_sm_782.data["resc"]["dimensions"]]
-resc_lp = [ChipLandPattern.from_ipc(p) for p in ipc_sm_782.data["resc"]["land_patterns"]]
+resc_land_patterns = ipc_sm_782.data["resc"]["land_patterns"]
+# Some extra custom patterns
+if False:
+ resc_land_dimensions.append({
+ "size_mm": "710420",
+ "size_in": "2816",
+ "l_min": 7.10 - 0.2,
+ "l_max": 7.10 + 0.2,
+# "s_min":
+# "s_max":
+ "w_min": 4.20 - 0.2,
+ "w_max": 4.20 + 0.2,
+# "t_min":
+# "t_max":
+# "h_max":
+ })
+ resc_land_patterns.append({
+# "rlp_no":
+ "size_mm": "7142",
+ "size_in": "2816",
+# "z":
+# "g":
+# "x":
+# "y":
+# "c":
+ "grid": "10x10",
+ })
+resc_lp = [ChipLandPattern.from_ipc(p) for p in resc_land_patterns]
#capc_dims = [ChipDimensions.from_ipc(p) for p in ipc_sm_782.data["capc"]["dimensions"]]
capc_lp = [ChipLandPattern.from_ipc(p) for p in ipc_sm_782.data["capc"]["land_patterns"]]
-ledsc_lp = [ChipLandPattern.from_ipc(p) for p in ipc_sm_782.data["ledsc"]["land_patterns"]]
+# We borrow the CAPC land patterns
+ledsc_lp = [ChipLandPattern.from_ipc(p) for p in ipc_sm_782.data["capc"]["land_patterns"]]
work = [\
("RESC", resc_lp, resc_heights), \
diff --git a/ipc_sm_782.py b/ipc_sm_782.py
index 8923c09..a5b2f6a 100644
--- a/ipc_sm_782.py
+++ b/ipc_sm_782.py
@@ -53,30 +53,6 @@ capc_land_patterns = make_dicts(["rlp_no", "size_mm", "size_in", "z", "g", "x",
("137A", "4564", "1825", 5.80, 2.00, 6.80, 1.90, 3.90, "14x12"),
)
-# Copied from capc_dimensions
-ledsc_dimensions = make_dicts(["size_mm", "size_in", "l_min", "l_max", "s_min", "s_max", "w_min", "w_max", "t_min", "t_max", "h_max"],
- ("1005", "0402", 0.90, 1.10, 0.30, 0.65, 0.40, 0.60, 0.10, 0.30, 0.60),
- ("1310", "0504", 1.02, 1.32, 0.26, 0.72, 0.77, 1.27, 0.13, 0.38, 1.02),
- ("1608", "0603", 1.45, 1.75, 0.45, 0.97, 0.65, 0.95, 0.20, 0.50, 0.85),
- ("2012", "0805", 1.80, 2.20, 0.30, 1.11, 1.05, 1.45, 0.25, 0.75, 1.10),
- ("3216", "1206", 3.00, 3.40, 1.50, 2.31, 1.40, 1.80, 0.25, 0.75, 1.35),
- ("3225", "1210", 3.00, 3.40, 1.50, 2.31, 2.30, 2.70, 0.25, 0.75, 1.35),
- ("4532", "1812", 4.20, 4.80, 2.30, 3.46, 3.00, 3.40, 0.25, 0.95, 1.35),
- ("4564", "1825", 4.20, 4.80, 2.30, 3.46, 6.00, 6.80, 0.25, 0.95, 1.10),
-)
-
-# Copied from capc_land_patterns
-ledsc_land_patterns = make_dicts(["rlp_no", "size_mm", "size_in", "z", "g", "x", "y", "c", "grid"],
- ("130A", "1005", "0402", 2.20, 0.40, 0.70, 0.90, 1.30, "2x6"),
- ("131A", "1310", "0504", 2.40, 0.40, 1.30, 1.00, 1.40, "4x6"),
- ("132A", "1608", "0603", 2.80, 0.60, 1.00, 1.10, 1.70, "4x6"),
- ("133A", "2012", "0805", 3.20, 0.60, 1.50, 1.30, 1.90, "4x8"),
- ("134A", "3216", "1206", 4.40, 1.20, 1.80, 1.60, 2.80, "4x10"),
- ("135A", "3225", "1210", 4.40, 1.20, 2.70, 1.60, 2.80, "6x10"),
- ("136A", "4532", "1812", 5.80, 2.00, 3.40, 1.90, 3.90, "8x12"),
- ("137A", "4564", "1825", 5.80, 2.00, 6.80, 1.90, 3.90, "14x12"),
-)
-
data = dict(
resc = dict(
dimensions = resc_dimensions,
@@ -86,8 +62,4 @@ data = dict(
dimensions = capc_dimensions,
land_patterns = capc_land_patterns
),
- ledsc = dict(
- dimensions = ledsc_dimensions,
- land_patterns = ledsc_land_patterns
- )
)