EEVblog Electronics Community Forum

EDA => Eagle => Topic started by: 3roomlab on January 14, 2018, 11:49:03 am

Title: Creating PCB/box templates
Post by: 3roomlab on January 14, 2018, 11:49:03 am
I wish to share this non standard item creation, it is kind of a productivity aid if you are using a fixed few types of boxes to do your DIY projects

example box
https://item.taobao.com/item.htm?&id=18128666680 (find a retailer that shows a good plan view)
(https://1.bp.blogspot.com/-toXdD9yFmew/Wls6YAYzRxI/AAAAAAAAC7E/pIAO9Qsf9HA7GXJseXwpiIFJIR7di5qzwCLcBGAs/s1600/T2IZwEXcXaXXXXXXXX_%2521%25211023620319.jpg)

import into gimp 2.4.7 (compatible with windows BMP format)
tools – transform – crop
image – print size – change size/dimensions to coincide with actual box size (note final DPI = 53.210)
(https://3.bp.blogspot.com/-TPK27J0R21U/Wls7Jn1ROnI/AAAAAAAAC7M/PBubaDJ5rZATx36HHBMwunvvhlHmK-dqACLcBGAs/s1600/T2IZwEXcXaXXXXXXXX_%2521%2521dsfgjdfjgh.bmp)

image – mode – select indexed color – select max color = 4 to 8 (lesser colors = lesser accuracy but less clutter)
save as – bmp
(https://1.bp.blogspot.com/-v4JOKA8Sl5k/Wls9o881d2I/AAAAAAAAC7o/YtR8i-__dNUZxD67Z15OL6ydyvH1QjdsACLcBGAs/s1600/111.gif)

eagle – ULP – insert bmp
scan used colors (option to reduce colors further)
format = select DPI
scale = final DPI of BMP image (in this case = 53.210)
(https://2.bp.blogspot.com/-R111xRkqIe4/Wls-txuyVsI/AAAAAAAAC7w/z5YdyMFMgw0jrUfFufMjlIuIGtON4MUjwCLcBGAs/s1600/sdfhsdh.gif)

run script - rough shape of box will appear

draw appropriate outlines using eagle layers. ie : primary outline of PCB, drill holes, guides and exclusions.
(https://1.bp.blogspot.com/-rkRbHeKJTWs/Wls7ZqrIrzI/AAAAAAAAC7Q/7heqpHsDHU8BbFkQ5fsyUSe0tugFq18gACLcBGAs/s1600/stghjsj.gif)
 
select BMP layers (layer 200-233?) to delete BMP guides/shapes insert eagle labels. now we are left with just your PCB cutting shapes.
save as PCB template
make other templates sized according to box limits

(https://1.bp.blogspot.com/-Zzh4MY5bxSs/Wls7z3A522I/AAAAAAAAC7c/eo8_zic2dF4I0-2Nvq5zoeqv2cJjA77KQCLcBGAs/s1600/dfjsj.gif)

when components are laid together, the enclosure template allows user to have better gauge of what to do with PCB/box/component in the final window laying out parts. ie : the SMA needs a deeper cutout into the PCB (or a very large hole?) or the potentionmeter can fit well when bolted to case.
(https://1.bp.blogspot.com/-i9VL9evd2og/WltCDG6jFdI/AAAAAAAAC78/6FrpiGVftFsqxTAWOyusJ2IBTAsYYbv_QCLcBGAs/s1600/sjsjsykj.gif)

it would be interesting if someone makes a KiCad version of this template "tip"