Added default panel files (vscore) to the templates, and made the

rotation maths in the neoden pnp file generation more robust
This commit is contained in:
ac
2024-09-09 10:11:33 +10:00
parent 80765e324f
commit fe9a4eb1e2
4 changed files with 100 additions and 23 deletions

View File

@@ -115,8 +115,8 @@ def comp_format(filt, offset):
t[p] = "{:.2f}".format(abs(float(t[p]) - offset[n])) t[p] = "{:.2f}".format(abs(float(t[p]) - offset[n]))
rotation = float(t[rot]) rotation = float(t[rot])
rotation = rotation + offset[2] rotation = rotation + offset[2]
if rotation > 180.0: # Wrap the phase [-180, 180]
rotation = -1 * (360.0 - rotation) rotation = (rotation + 180.0) % (2 * 180.0) - 180.0
t[rot] = "{:.2f}".format(rotation) t[rot] = "{:.2f}".format(rotation)
out.append(t) out.append(t)
return out return out

View File

@@ -1,42 +1,43 @@
# Dependencies # Dependencies
- [Kicad 6](https://www.kicad.org/) - [Kicad 8](https://www.kicad.org/)
- [git-lfs](https://git-lfs.com/) - [git-lfs](https://git-lfs.com/)
- [kimelon](https://gitlab.com/Micromelon/education/hardware/kimelon)
# Setup # Setup
1. Fork or clone and change origin remote-url. 1. From an empty directory: `kimelon config --init --remote <REMOTE_URL>`; if git is already setup and pointing to the remote then drop `--remote`
2. Checkout dev (branch off dev if desired) 2. Create a kicad project, based off of a template found in this directory
2. Rename/move files to match project name (make sure to update for [CI](#CI) too)
3. Lock the file you want to edit, see [Locking](#Locking) 3. Lock the file you want to edit, see [Locking](#Locking)
4. Start editing. 4. Start editing
# Updating
`kimelon config`
# Locking # Locking
All kicad files are read-only by default, the file will need to be locked to your ssh key/gitlab account for it to be writable. All kicad files are read-only by default, the file will need to be locked to your ssh key/gitlab account for it to be writable.
This can be done using `lock.sh {file name}`. This can be done using `kimelon lock <type> <filter>`.
Once you are done editing the lock can be released using `unlock.sh {file name}`. See `kimelon lock --help` for more info.
Once you are done editing the lock can be released using `kimelon unlock <type> <filter>`.
Lock/unlock can only be done if there are any branches that aren't merged into `dev` (excluding `main`). See `kimelon unlock --help` for more info.
Lock/unlock can't be done if there are any branches apart from `dev` & `main`.
# CI # CI
Edit lines 41 & 42 of .gitlab-ci.yml to match the naming/structure of your project/s.
You can add as many kicad projects as you like, as below:
```
- DIR: 'proj1'
SCHEM: 'proj1.kicad_sch'
- DIR: 'proj2'
SCHEM: 'proj3.kicad_sch'
- DIR: 'proj3'
SCHEM: 'proj3.kicad_sch'
```
The following will be produced on any commit to dev & main branches or any commit on branch that has an active MR with said branches: The following will be produced on any commit to dev & main branches or any commit on branch that has an active MR with said branches:
- DRC & ERC - DRC & ERC
- Step files - Step files
The following will be produced only on commits to main or commits on dev if it has an active MR with main: The following will be produced only on commits to main or commits on dev if it has an active MR with main:
- JLCPCB compatible gerbers - JLCPCB compatible gerbers
- PDFs of Schematic & PCB - PDFs of Schematic & PCB
- BOM - BOM
Currently there are some ERC errors to do with buses (https://gitlab.com/kicad/code/kicad/-/issues/13285), so the docker image used for CI will be run on an older version to avoid them. # Panels
[Kikit](https://github.com/yaqwsx/KiKit) is used to generate panels by placing a `json` file in your kicad project root folder.
The templates in this repository all contain a default panel file with the following features:
- single board
- full frame, no tabs/gap between PCB and frame, vcuts
- Mounting hole + fiducial in each corner
See examples of panel types/options [here](https://yaqwsx.github.io/KiKit/v1.3/panelization/examples/)
See syntax of `json` file [here](https://yaqwsx.github.io/KiKit/v1.3/panelization/cli/)

View File

@@ -0,0 +1,38 @@
{
// There can be C-like comments
"layout": {
"type": "grid",
"rotation": 0,
"rows": 1,
"cols": 1
},
"tabs": {
"type": "full"
},
"cuts": {
"type": "vcuts",
"layer" : "Dwgs.User"
},
"framing": {
"type": "tightframe",
"width": "8mm"
},
"tooling": {
"type": "4hole",
"hoffset": "2.5mm",
"voffset": "4mm",
"size": "1.65mm"
},
"fiducials": {
"type": "4fid",
"hoffset": "7mm",
"voffset": "4mm",
"coppersize": "2mm",
"opening": "4mm"
},
"post": {
"origin": "bl",
"millradius": "1mm"
}
}

View File

@@ -0,0 +1,38 @@
{
// There can be C-like comments
"layout": {
"type": "grid",
"rotation": 0,
"rows": 1,
"cols": 1
},
"tabs": {
"type": "full"
},
"cuts": {
"type": "vcuts",
"layer" : "Dwgs.User"
},
"framing": {
"type": "tightframe",
"width": "8mm"
},
"tooling": {
"type": "4hole",
"hoffset": "2.5mm",
"voffset": "4mm",
"size": "1.65mm"
},
"fiducials": {
"type": "4fid",
"hoffset": "7mm",
"voffset": "4mm",
"coppersize": "2mm",
"opening": "4mm"
},
"post": {
"origin": "bl",
"millradius": "1mm"
}
}