Skip to content

Commit

Permalink
deploy: e5e3007
Browse files Browse the repository at this point in the history
  • Loading branch information
cibomahto committed Jun 25, 2024
0 parents commit 6e21b42
Show file tree
Hide file tree
Showing 130 changed files with 8,643 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
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 added .doctrees/advanced_usage.doctree
Binary file not shown.
Binary file added .doctrees/api.doctree
Binary file not shown.
Binary file added .doctrees/concepts.doctree
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/examples.doctree
Binary file not shown.
Binary file added .doctrees/getting_started.doctree
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Binary file added .doctrees/installation.doctree
Binary file not shown.
Binary file added .doctrees/introduction.doctree
Binary file not shown.
Binary file added .doctrees/notes.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
circuitpainter.blinkinlabs.com
Binary file added _images/example-add-led.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/example-connect-led.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/example-led-ring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/example-line-widths.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/example-push-pop-rect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/example-rest-of-owl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/example-rotate-rect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/example-translate-rect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/example-two-lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/example_led_ring_drc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/examples_asterix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/examples_hello_painter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/examples_hex_perfboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/examples_lotus_leds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/examples_perfboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_linux_close_python.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_linux_empty_board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_linux_mkdir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_linux_pip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_linux_preview_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_linux_run_python.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_linux_venv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_windows_close_python.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_windows_empty_board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_windows_kicad_prompt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/install_windows_pip.png
Binary file added _images/install_windows_preview_success.png
Binary file added _images/install_windows_run_python.png
Binary file added _images/lotus_leds.png
77 changes: 77 additions & 0 deletions _sources/advanced_usage.rst.txt
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
9 changes: 9 additions & 0 deletions _sources/api.rst.txt
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:
76 changes: 76 additions & 0 deletions _sources/concepts.rst.txt
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.
43 changes: 43 additions & 0 deletions _sources/examples.rst.txt
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!
Loading

0 comments on commit 6e21b42

Please sign in to comment.