-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6e21b42
Showing
130 changed files
with
8,643 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 31ae1e12a478ed48155d70bc5acbb7c5 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
circuitpainter.blinkinlabs.com |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
Advanced Usage | ||
============== | ||
|
||
The goal of circuitpainter is to make the most common parts of PCB generation | ||
easy, and you might want to do things that this API doesn't directly support. | ||
|
||
Note that the underlying pcbnew API is not finished, and will likely be | ||
different between even minor KiCad versions. Using the python help() function | ||
on these object references is a good way to explore their options, though it | ||
gets complicated because they are themselves thin wrappers over the C-language | ||
pcbnew library. Eventually, you'll need to dig through the KiCad source | ||
to figure out how things are supposed to work, and don't forget to check the | ||
bug tracker if things aren't working correctly, because it probably is a bug | ||
and there might be a workaround / fix. | ||
|
||
Extended object properties | ||
-------------------------- | ||
|
||
Circuit painter aims to keep circuit creation simple, but there are extra configuration | ||
settings on many objects that you might want access to. To facilitate this, all | ||
functions that create a PCB object will also return a reference to that object, | ||
so that you can modify it. | ||
|
||
For example, create a rectangular zone, and save the reference to it: | ||
|
||
.. code:: python | ||
p = CircuitPainter() | ||
p.layer("F_Cu") | ||
zone = p.rect_zone(0,0,10,10) | ||
Then, modify the zone properties using the pcbnew api: | ||
|
||
.. code:: python | ||
zone.SetIsRuleArea(True) | ||
zone.SetDoNotAllowCopperPour(True) | ||
zone.SetDoNotAllowVias(False) | ||
zone.SetDoNotAllowTracks(False) | ||
zone.SetDoNotAllowPads(False) | ||
Board configuration | ||
------------------- | ||
|
||
Many of the board configuration options (stackup, DRC rules, etc) are | ||
stored in the board design settings. For example, to create a 4-layer board | ||
with some different DRC settings: | ||
|
||
.. code:: python | ||
import pcbnew | ||
settings = p.pcb.GetDesignSettings() | ||
settings.SetCopperLayerCount(4) # Change to a 4-layer board design | ||
settings.m_CopperEdgeClearance = pcbnew.FromMM(0.1) # Set the copper-to-edge spacing to 0.1mm | ||
Note that we are importing 'pcbnew' here, in order to use the FromMM() function | ||
to convert a measurement from mm to KiCad's internal units. | ||
|
||
Updating boards / adding manual edits | ||
------------------------------------- | ||
|
||
Circuit Painter is great for automating parts of designs that are highly repetitive, | ||
but is less effective for more mundane tasks such as wiring up a fancy LED array to | ||
a microcontroller. On this end, everything that CircuitPainter creates is placed into | ||
a single group. When you make manual additions to the board, be sure not to put your | ||
changes into the auto-generated group. Later, if you want to re-generate the automated | ||
portion of your design, you should be able to just delete that group, then start | ||
Circuit Painter by passing it the file name: | ||
|
||
.. code:: python | ||
p = CircuitPainter('my_file.kicad_pcb') | ||
New objects will then be added to that board, in a new group. | ||
|
||
.. autosummary:: | ||
:toctree: generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Function Reference | ||
================== | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
|
||
.. automodule:: circuitpainter | ||
:members: CircuitPainter | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
Core concepts | ||
============= | ||
|
||
Circuit Painter works by drawing objects onto PCB layers. | ||
|
||
PCB layers | ||
---------- | ||
|
||
There are a lot of layers that make up a PCB! Fortunately, we only need to | ||
focus on a few of them: | ||
|
||
* Edge cuts | ||
* Top silkscreen | ||
* Top soldermask | ||
* Top copper | ||
* Bottom copper | ||
* Bottom soldermask | ||
* Bottom silkscreen | ||
|
||
In Circuit Painter, you set the active drawing layer by calling the layer() | ||
function: | ||
|
||
.. code:: python | ||
painter.layer('F_Cu') | ||
Any objects created afterwards will be drawn on that layer, until it is | ||
updated by another layer() call. Note that some objects, particularly the | ||
conductive ones, can only be placed on a copper layer. | ||
|
||
Taxonomy of objects | ||
------------------- | ||
|
||
Circuit Painter allows you to create two categories of objects- conductive, | ||
and non-conductive. Conductive objects are used to carry electricity, and | ||
are assigned to 'nets'. Non-conductive objects are used for making graphics, | ||
markings, and defining the board outline. | ||
|
||
|
||
Conductive: | ||
|
||
* Tracks | ||
* Arc Tracks | ||
* Polygons | ||
* Footprints | ||
* Vias | ||
|
||
Non-Conductive: | ||
|
||
* Lines | ||
* Arcs | ||
* Cirles | ||
* Polygons | ||
* Rect | ||
* Text | ||
|
||
Object attribues | ||
---------------- | ||
|
||
Many objects have attributes that need to be set when calling them. For | ||
example, the width of a line or track is set by the width() function. | ||
|
||
Global attributes are: | ||
|
||
* width | ||
* fill / no fill | ||
* layer | ||
* designators / no designators | ||
|
||
Drawing coordinates | ||
------------------- | ||
|
||
Circuit Painter features a virtual transformation matrix, to make scripting | ||
similar arrangements of objects anywhere on a board. It supports both linear | ||
and rotational transformations for all objects, allowing for example LEDs to | ||
be aligned around a circle. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Example Projects | ||
================ | ||
|
||
Here is a collection of example boards designed using CircuitPainter. | ||
|
||
Click on the photo to see the source code for the board. | ||
|
||
.. list-table:: | ||
|
||
* - .. image:: _static/images/examples_lotus_leds.png | ||
:width: 400 | ||
:target: https://github.com/Blinkinlabs/circuitpainter/blob/main/examples/lotus_leds.py | ||
|
||
Lotus LEDs | ||
|
||
- .. image:: _static/images/examples_hex_perfboard.png | ||
:width: 400 | ||
:target: https://github.com/Blinkinlabs/circuitpainter/blob/main/examples/hex_perfboard.py | ||
|
||
Hex perfboard | ||
|
||
* - .. image:: _static/images/examples_asterix.png | ||
:width: 400 | ||
:target: https://github.com/Blinkinlabs/circuitpainter/blob/main/examples/asterix.py | ||
|
||
Asterix | ||
|
||
- .. image:: _static/images/examples_hello_painter.png | ||
:width: 400 | ||
:target: https://github.com/Blinkinlabs/circuitpainter/blob/main/examples/hello_painter.py | ||
|
||
Hello Painter | ||
|
||
* - .. image:: _static/images/examples_perfboard.png | ||
:width: 400 | ||
:target: https://github.com/Blinkinlabs/circuitpainter/blob/main/examples/perfboard.py | ||
|
||
Perfboard | ||
|
||
- | ||
|
||
Have you made a board with Circuit Painter? Share it with us so that we can | ||
add it to the gallery! |
Oops, something went wrong.