Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Support generating two-terminal footprints with IPC density argument #439

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

evanshultz
Copy link
Collaborator

@evanshultz evanshultz commented Oct 5, 2019

Fixes #421.

Branched from #438. Merge that PR first!

This adds a parameter to support IPC density settings. If the user does not enter a value for the density, nominal density is assumed and footprints are generated exactly as they are now (or, rather, would be if the aforementioned PR is merged). Giving an argument to this parameter generates footprints with correspondingly bigger or smaller pads and a suffix on the footprint name which indicates the density.

It appears the density is used during pad calculation for the handsolder footprints and I've left that alone since it gives further options for handsoldering pads. Or, those footprints can be discarded if the density argument is given and only the non-handsolder footprints added to the library. That would be my expectation.

I feel like there might be a better way to sort out the density during argument parsing than what I added at the end of SMD_package_rlc-etc.py, but my brain feels empty now so I may need to come back to this later. Or get suggestions.

I also renamed the function TwoTerminalSMDchip() to TwoTerminalSMD() because the script can generate non-chip footprints.

- File renames to remove 'chip' if file contained more than chip info
- Aligned size definition file names
- Print part type and definition during execution
- Corrected descriptions and keywords in SMD_chip_devices.yaml
- Fixed a few typos in comments
@codeclimate
Copy link

codeclimate bot commented Oct 5, 2019

Code Climate has analyzed commit 3189413 and detected 4 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 4

View more on Code Climate.

parser.add_argument('--force_rectangle_pads', action='store_true', help='Force the generation of rectangle pads instead of rounded rectangle (KiCad 4.x compatibility.)')
args = parser.parse_args()

# if the user requests an IPC density, put that and footprint suffix in a list
# otherwise, use nominal density with no suffix
if args.ipc_density is None or args.ipc_density not in ['l', 'L', 'n', 'N', 'm', 'M']:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if args.ipc_density is None or args.ipc_density not in ['l', 'L', 'n', 'N', 'm', 'M']:
if args.ipc_density is None or args.ipc_density.lower() not in ['l', 'n', 'm']:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's an even better way to do this. I believed this could be improved but my brain was feeling worn out as I mentioned above; hopefully now inspiration has struck.

@poeschlr
Copy link
Collaborator

poeschlr commented Apr 26, 2020

You might have done something wrong with git here. The list of changed files looks strange.


Edit: this might be the result of merging combined with the original branch being different to master. Will simply mean that we need to check this locally with better difftools than github. Plus it will need to be squash merged as it will otherwise make the git history horrible.

@poeschlr
Copy link
Collaborator

Also a general thing: The size definitions used for this script are massive compromises as these sort of devices are not really standardized. I am therefore not really sure the official lib will benefit from having other densities of these footprints in it. I am however not opposed to adding this feature to the script to allow users to generate their own set of footprints with differing density levels (really only makes sense if the user then also adds their own size definition fitting their device)

@cpresser
Copy link
Collaborator

@evanshultz while looking at #438 I also found this PR. The history of this one looks broken. I think its best to fix this branch after #438 is merged.

@evanshultz
Copy link
Collaborator Author

@cpresser
Yes, that was my intent. Maybe that wasn't clear above. Sorry.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chip footprints with varying IPC density
3 participants