Skip to content

Commit

Permalink
chip: Generate 3D models for chip capacitors
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Sep 3, 2023
1 parent 18491a5 commit e5cd9f3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
13 changes: 10 additions & 3 deletions generate_chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def add_footprint_variant(
raise ValueError('Either gap or footprints must be set')

# Generate 3D models (for certain package types)
if package_type in ['RESC']:
if package_type in ['RESC', 'CAPC']:
uuid_3d = uuid('pkg', full_name, '3d')
if generate_3d_models:
generate_3d(library, package_type, full_name, uuid_pkg, uuid_3d, config)
Expand Down Expand Up @@ -614,7 +614,7 @@ def generate_3d(
width = config.body.width
height = config.body.height

fillet = width * 0.05
fillet = min(width, height) * 0.05
edge = min(length * 0.15, 0.4)
translation = (0, 0, height / 2)
edge_offset = length / 2 - edge
Expand All @@ -634,8 +634,15 @@ def generate_3d(
.translate(translation) \
.translate((edge_offset + edge / 2, 0, 0))

if package_type == 'RESC':
inner_color = cq.Color('gray16')
elif package_type == 'CAPC':
inner_color = cq.Color('bisque3')
else:
raise RuntimeError(f'Unsupported 3D package type: {package_type}')

assembly = StepAssembly(full_name)
assembly.add_body(inner, 'inner', cq.Color("gray16"))
assembly.add_body(inner, 'inner', inner_color)
assembly.add_body(left, 'left', cq.Color("gainsboro"))
assembly.add_body(right, 'right', cq.Color("gainsboro"))

Expand Down
12 changes: 12 additions & 0 deletions uuid_cache_chip.csv
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dev-resistor~3225~(1210)-dev,a5153d16-a78b-439c-876b-12d12a607237
dev-resistor~3246~(1218)-dev,3a5ce2ef-4c16-459f-a6b8-f914508a17a1
dev-resistor~5025~(2010)-dev,5512ed40-604c-43fd-802c-1da10d419357
dev-resistor~6432~(2512)-dev,52876458-2396-4ade-8280-6a033efa911f
pkg-capc0402~(01005)-3d,73f34ee6-fd11-4980-a03b-127ee8ab9482
pkg-capc0402~(01005)-footprint-density~a,5107f609-8a98-4335-b26f-494b7d2ccd85
pkg-capc0402~(01005)-footprint-density~b,d5cb4794-090f-4c09-b02c-c77dce04ef34
pkg-capc0402~(01005)-line-silkscreen-bot-density~a,6e37bcda-6177-43d3-995c-270c05858ca7
Expand Down Expand Up @@ -48,6 +49,7 @@ pkg-capc0402~(01005)-text-name-density~a,f5a3af16-48de-4d8a-82db-a54d92669de1
pkg-capc0402~(01005)-text-name-density~b,d14bd8c8-c1d0-4270-b149-33aa2ef0847c
pkg-capc0402~(01005)-text-value-density~a,184836d5-620a-4945-ad8f-93206dba81c1
pkg-capc0402~(01005)-text-value-density~b,101f24a8-f1a1-436f-99b3-b0db9bf833ad
pkg-capc0603~(0201)-3d,d79bba4d-d1c9-4629-8bc9-33f3b2d1a1ee
pkg-capc0603~(0201)-footprint-density~a,21a20d7c-a20a-4512-86c4-8b40d5ce63fd
pkg-capc0603~(0201)-footprint-density~b,984d655b-da8b-482f-83f2-17540a9dbe96
pkg-capc0603~(0201)-line-silkscreen-bot-density~a,be48f10f-4f6b-4758-86f7-aaa259c6a92d
Expand Down Expand Up @@ -75,6 +77,7 @@ pkg-capc0603~(0201)-text-name-density~a,f0462255-a3be-4921-bd5f-9e48c91ea237
pkg-capc0603~(0201)-text-name-density~b,ff57428f-9e38-485e-9f59-5a31bc2aaafa
pkg-capc0603~(0201)-text-value-density~a,4f932f5f-84ab-4143-a692-b04a51de17b0
pkg-capc0603~(0201)-text-value-density~b,86ef971a-4694-4670-920e-1d25791393c4
pkg-capc1005~(0402)-3d,351c3b6e-ccf6-4b55-8f82-c32f2ddd35fe
pkg-capc1005~(0402)-footprint-density~a,8b20cda7-50e2-45e6-9f9f-82664d8e6f28
pkg-capc1005~(0402)-footprint-density~b,aecdaa8d-2033-4d4e-aa55-bce599619b07
pkg-capc1005~(0402)-line-silkscreen-bot-density~a,f20a8167-c2e1-42b1-b614-4da97eed979c
Expand Down Expand Up @@ -102,6 +105,7 @@ pkg-capc1005~(0402)-text-name-density~a,617190d6-2ea7-4518-80d8-400be44bada1
pkg-capc1005~(0402)-text-name-density~b,3bbdbe05-14bd-40de-b5cf-bd8892b41cc5
pkg-capc1005~(0402)-text-value-density~a,1a370cc5-f57b-4d09-8161-e5e99804e74d
pkg-capc1005~(0402)-text-value-density~b,69f46c6d-835a-449b-b38f-92af308280b1
pkg-capc1608~(0603)-3d,4a168e10-d86b-4f61-a0c8-1376973ceead
pkg-capc1608~(0603)-footprint-density~a,d61e4907-6a28-4015-a0be-5885f7cc1bc6
pkg-capc1608~(0603)-footprint-density~b,a77e5176-25d1-4b3a-872d-3dd32f6f9cbe
pkg-capc1608~(0603)-line-silkscreen-bot-density~a,7bae5352-667d-4c72-8a6f-0d1c572e0616
Expand Down Expand Up @@ -129,6 +133,7 @@ pkg-capc1608~(0603)-text-name-density~a,bddc4fc9-5a69-4e26-a793-b1c90667ea90
pkg-capc1608~(0603)-text-name-density~b,069597b0-1c19-435c-82e7-0803274ac800
pkg-capc1608~(0603)-text-value-density~a,33c4f671-7cf1-45e7-97a6-3c01f16e421a
pkg-capc1608~(0603)-text-value-density~b,f698f76d-7ec7-4cd5-aa77-b707bfeca833
pkg-capc2012~(0805)-3d,5d053e45-ab76-407c-88ae-d7936dff282b
pkg-capc2012~(0805)-footprint-density~a,328e4ae0-a0f1-4d92-87b5-1695afbe98e1
pkg-capc2012~(0805)-footprint-density~b,2f2ea7e1-052e-4308-abec-85b5d2bd1d65
pkg-capc2012~(0805)-line-silkscreen-bot-density~a,f070706a-cfca-4acf-99f5-1d7776e1fde4
Expand Down Expand Up @@ -156,6 +161,7 @@ pkg-capc2012~(0805)-text-name-density~a,e5af5e70-716a-456f-a595-43b71d7b578c
pkg-capc2012~(0805)-text-name-density~b,3c4417a8-0e5c-48b0-822a-06f6f5df19f6
pkg-capc2012~(0805)-text-value-density~a,53bbc432-323e-4945-8de0-f978d245c6cd
pkg-capc2012~(0805)-text-value-density~b,52f75e24-4492-4616-a8ed-a1c0f3138abe
pkg-capc3216~(1206)-3d,37a28abd-4fb8-4ba6-80cb-f6e9a26a9798
pkg-capc3216~(1206)-footprint-density~a,8f1c52fc-e0ae-4a0a-acae-cb044a6d413c
pkg-capc3216~(1206)-footprint-density~b,0ff03d40-c63a-4add-bd3c-5de12051d696
pkg-capc3216~(1206)-line-silkscreen-bot-density~a,44be424d-f762-46c5-8168-0ab9635832f4
Expand Down Expand Up @@ -183,6 +189,7 @@ pkg-capc3216~(1206)-text-name-density~a,44100be3-927c-4e19-97aa-f1a9bbcf7acd
pkg-capc3216~(1206)-text-name-density~b,a89e5595-0c86-4b3d-ac4f-8dc4edc7d046
pkg-capc3216~(1206)-text-value-density~a,c7f31ff0-c725-4ea1-9256-26903d809749
pkg-capc3216~(1206)-text-value-density~b,42d1737c-8a35-40b5-aa4d-ae690c62bd5d
pkg-capc3225~(1210)-3d,5ac76b31-6b62-4222-9c1c-1c18a81ff3be
pkg-capc3225~(1210)-footprint-density~a,2b9cf5e4-b75a-4462-99cf-1b4fb65400c9
pkg-capc3225~(1210)-footprint-density~b,06e32be2-156c-4456-b124-38864dcec522
pkg-capc3225~(1210)-line-silkscreen-bot-density~a,2e730782-5a81-44c6-a114-33fcf76c7cbf
Expand Down Expand Up @@ -210,6 +217,7 @@ pkg-capc3225~(1210)-text-name-density~a,dc0ae526-36e1-44a3-9aa9-f148c622ec54
pkg-capc3225~(1210)-text-name-density~b,dfb5a519-f228-4c8f-bb74-92d7bd0860b3
pkg-capc3225~(1210)-text-value-density~a,e2f7b384-6005-4c62-976a-a19ee667000e
pkg-capc3225~(1210)-text-value-density~b,16437b16-e13b-48e8-bb60-84e1b835a068
pkg-capc4520~(1808)-3d,39124023-56bf-4eb9-a7ec-d61f1e4e57ba
pkg-capc4520~(1808)-footprint-density~a,d21a931c-9915-4d66-a999-61e715edafc7
pkg-capc4520~(1808)-footprint-density~b,919cb699-73f9-4f96-8781-d40582f1ae8f
pkg-capc4520~(1808)-line-silkscreen-bot-density~a,c0df7575-5da0-45f3-a1ad-95f8aa3985dc
Expand Down Expand Up @@ -237,6 +245,7 @@ pkg-capc4520~(1808)-text-name-density~a,9c808778-d401-4e11-89bc-78d20693e77c
pkg-capc4520~(1808)-text-name-density~b,42eafd19-c520-47a9-a828-fe723d7450dd
pkg-capc4520~(1808)-text-value-density~a,774af680-6557-4f52-aab8-424a482111a7
pkg-capc4520~(1808)-text-value-density~b,d206f51d-a01d-44e9-b8dd-5891f4c9548d
pkg-capc4532~(1812)-3d,691e72c7-d618-46aa-bb14-7513221fffbb
pkg-capc4532~(1812)-footprint-density~a,51c36066-7fa5-48be-adbf-e8b9f2270e75
pkg-capc4532~(1812)-footprint-density~b,cd858bd6-7eaf-4821-9f87-467ba974c076
pkg-capc4532~(1812)-line-silkscreen-bot-density~a,ccc7a8da-95c4-465b-960e-47e21facb8a6
Expand Down Expand Up @@ -264,6 +273,7 @@ pkg-capc4532~(1812)-text-name-density~a,1a87f792-5dc2-4976-a7ab-c4af0ee3f5ea
pkg-capc4532~(1812)-text-name-density~b,29e9bd34-6b94-40a3-bc93-cdaea325ad9d
pkg-capc4532~(1812)-text-value-density~a,259ef008-d9fb-418e-a469-45e27ca32e17
pkg-capc4532~(1812)-text-value-density~b,7ddb7260-d024-481e-a95e-05bda1ce3c23
pkg-capc4564~(1825)-3d,5e8e1dbf-ee30-46b5-9c66-5d66e5b7ed6e
pkg-capc4564~(1825)-footprint-density~a,77b78a8a-1839-42d5-acac-b98479b01d49
pkg-capc4564~(1825)-footprint-density~b,69d0f3d4-2a68-464c-951b-b1526d391c39
pkg-capc4564~(1825)-line-silkscreen-bot-density~a,ac93d4dd-b759-4d39-96f1-3b91afe1d105
Expand Down Expand Up @@ -291,6 +301,7 @@ pkg-capc4564~(1825)-text-name-density~a,c90e5b96-cacc-4afa-a59b-2c26cda21399
pkg-capc4564~(1825)-text-name-density~b,981d282e-d494-49a9-8ecb-9be22bc91ed9
pkg-capc4564~(1825)-text-value-density~a,eb01328d-74bb-45dd-bed2-c093dd1b225a
pkg-capc4564~(1825)-text-value-density~b,d6ba956a-72af-4265-9680-44471d318e98
pkg-capc5750~(2220)-3d,35822b47-c8b0-4596-99d7-b516841f230a
pkg-capc5750~(2220)-footprint-density~a,6c809531-30e2-49b9-864e-abe55ad439b1
pkg-capc5750~(2220)-footprint-density~b,b85aaf35-931a-4acb-be96-d840fba17390
pkg-capc5750~(2220)-line-silkscreen-bot-density~a,45599d4a-7ce4-4548-8767-4cc3fb1ce334
Expand Down Expand Up @@ -318,6 +329,7 @@ pkg-capc5750~(2220)-text-name-density~a,af162e47-14ac-493c-ae88-ed92e191891f
pkg-capc5750~(2220)-text-name-density~b,dd5cefde-2166-4e40-8d82-216594c6f892
pkg-capc5750~(2220)-text-value-density~a,b1141f99-bfa4-4dde-90dd-952260dcd6a2
pkg-capc5750~(2220)-text-value-density~b,97560f20-b638-4a16-951e-14f19e458d18
pkg-capc9210~(3640)-3d,526c94e1-056d-4e6e-8531-64f3e22ca823
pkg-capc9210~(3640)-footprint-density~a,3433314d-f78a-48ba-a434-944bbee5b139
pkg-capc9210~(3640)-footprint-density~b,4b880d27-abf4-403b-99ca-aafbf1e61b5f
pkg-capc9210~(3640)-line-silkscreen-bot-density~a,d1a019e3-0657-4dfb-bf99-d2e03c251738
Expand Down

0 comments on commit e5cd9f3

Please sign in to comment.