Coder Social home page Coder Social logo

gosmann / kicad_layout_cloner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tlantela/kicad_layout_cloner

0.0 1.0 0.0 2.88 MB

A python script to clone a part of a layout in Pcbnew. I do not really maintain the code or monitor this repository actively but if you improve the script, feel free to send a pull request so others can also benefit.

License: MIT License

Python 100.00%

kicad_layout_cloner's Introduction

Clone part of a layout in Pcbnew.

Usage

  1. Organize the subschemas to be cloned in hierarchical sheets. Annotate them so that each sheet's components have reference ids starting with a different hundred. Export netlist. Eeschema
  2. Import netlist into Pcbnew. Draw edge cuts. Place and route the components that will not be cloned. Also lay out the lowest-numbered subschema as a template. Surround it with a filled zone in Cmts.User layer (blue box). Tracks must be completely inside the zone. Pcbnew input
  3. Save EXAMPLE_NAME.kicad_pcb. Edit your layout_cloner.py to match your circuit (instructions inside the file). Run it to produce EXAMPLE_NAME_cloned.kicad_pcb file. Open it in Pcbnew. The ratsnest may be wrong; toggle it off and on to fix. Pcbnew output
  4. Clean up the edges of the patterned components. Try to keep this step as short as possible, because this work will be lost if/when you revisit Step 2. Pcbnew output cleaned

Running script on Linux

Open Terminal and run:

python layout_cloner.py

Running script on Windows

Your system Python probably doesn't have dependency pcbnew. Easiest to use KiCad's bundled Python, PyAlaMode.

Edit layout_cloner.py again to make the paths absolute:

inputBoardFile = r'C:\REPLACE_WITH_PATH_TO_YOUR\EXAMPLE_NAME.kicad_pcb'
outputBoardFile = r'C:\REPLACE_WITH_PATH_TO_YOUR\EXAMPLE_NAME_cloned.kicad_pcb'

In Pcbnew, go to Tools > Scripting Console. Paste this command and press Enter.

execfile(r'C:\REPLACE_WITH_PATH_TO_YOUR\layout_cloner.py')

If you have non-ASCII characters in your path, use this command (note double backslashes). Paste and press Enter twice.

with open(u'C:\\RÉPLACE_WÍTH_PÁTH_TO_YǪÚR\\layout_cloner.py') as f: exec(f.read())

kicad_layout_cloner's People

Contributors

nealehardt avatar tlantela avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.