Introduction
YCircuit aims to be a cross-platform, open-source alternative to the also cross-platform, open-source circuit schematic drawing tool XCircuit. While XCircuit is capable of producing beautiful schematics in vector formats, its interface is dated and has many quirks.
YCircuit is built using Python 3 and uses the extremely versatile PyQt5 GUI framework. It is designed with keyboard and mouse in mind so that most actions can be performed without having to move the right hand from the mouse.
YCircuit is still in its early stages and will likely change quite a bit over time. In its current form, however, it is already quite usable (I might be slightly biased on this) and can produce output that, in my opinion, rivals that of XCircuit’s.
Installation
Binary files
If you’d rather not install anything else and would just like to give the program a shot, you can download binary files for Windows 64 bit and Linux 64 bit. There are versions available built on both master
and develop
branches but the use of the develop
version is strongly recommended. If you would like to build these yourself, make sure you have the required dependencies and then run python setup.py build
Dependencies
YCircuit has the following dependencies:
- Python 3
- PyQt5
- Sympy (for handling LaTeX images)
- A suitable LaTeX backend if you want the LaTeX functionality (TeXLive recommended)
- cxFreeze if you would like to build the code
Getting the code
The easiest way to satisfy all the dependencies for YCircuit is to install Anaconda. Make sure to download and install the latest Python 3 version. After installation, you may have to edit and set your PATH variable to include Anaconda’s installation directory.
Once you have Anaconda, I recommend that you install Git. If for some reason you do not want to do that, you can simply download the latest version of the code here. If you do install Git, you can run the following command to clone the repository:
git clone https://bitbucket.org/siddharthshekar/ycircuit.git
This will create a directory called ycircuit in the directory where you ran the command. Navigate to this newly created directory and start the program by calling:
python top.py
If for some reason, the program does not start, check to make sure that python
starts Python 3 and not a Python 2 session. A quick search should be able to help you figure out how to start Python 3 instead of Python 2.
LaTeX functionality assumes that a suitable backend is already installed. This functionality is optional and you can still use the software if you don’t have a LaTeX backend and don’t wish to use LaTeX in your schematics.
Tutorial
Please check the tutorials for learning how to create a schematic, a symbol using the tool, and for exporting to a TikZ compatible LaTeX file.
Features
This is a (non-exhaustive) list of the features in YCircuit:
- Export to a variety of formats
- Vector formats like PDF, SVG
- Raster formats like PNG, JPEG etc. (this and this are some examples)
- Export to TikZ compatible TEX file (check out this tutorial for an example, PDF file)
- Schematic and symbol previews in the save/load dialog
- In-place rendering of LaTeX equations (if a suitable backend is installed)
- Schematic nets that automatically merge/split when interacting with other nets
- Automatic dot placement!
- Automatic snapping of nets to pins on symbols
- Built-in symbols for commonly used symbols like resistors, capacitors and transistors (NFET, PFET and BJT). Visit the symbol images directory in the code repository for some more symbols.
Code organization
The code is currently organized as follows:
top.py
: Used for launching the GUI.src/
gui/
- The UI file contains the output of Qt Designer while the py file is the exported version of the same.
ycircuit_mainWindow.*
: This defines the main editing interface.ycircuit_optionsWindow.*
: Defines the UI for the options window.textEditor_gui.*
: Defines the UI for the text editor that pops up while editing text items.
drawingitems.py
: Contains the Grid class for creating the background grid in the GUI, the TextEditor class for handling editing of TextBox objects, and custom file dialog and icon provider classes.drawingarea.py
: Handles implementations of functions for responding to UI callbacks. Captures and processes all keyboard and mouse events.mainwindow.py
: Contains mappings from UI callbacks to actual functions in the drawing area.components.py
: Defines item classes for creating and manipulating shapes.commands.py
: Defines command actions including how to handle undoing and redoing.
Resources/Symbols/
Standard/*.sym
: Contains various commonly used standard symbols.Custom/*.sym
: Contains user defined symbols.
- Schematics are currently saved as a
.sch
file while symbols are saved as a.sym
file. The difference between the two is purely cosmetic. Symbols are loaded with the top-level items grouped together whereas schematics are loaded with top-level items existing without a parent group. Try loading schematics from the Resources/Examples directory for examples on how to use the program.
Feedback
This is still very much a work in progress. If you do use it and enjoy/dislike something, please feel free to send me an email. If you encounter bugs/crashes, please report them using the issue tracker. Thanks!
Todos
This is an (incomplete) list of features that I would like to add (in no particular order):
-
Edit shapes- PressE
when a shape is selected to edit it - Create projects each with their own config file
-
Copying items in one schematic should allow pasting into another open schematic- PressV
to paste items copied to the clipboard usingC
-
Scale items- Accessible from the Edit menu and “Scale”