Inkscape extension to assist creating circuit symbols.
The main features are
- Passive bipoles: resistors, capacitors, inductors, diodes, LEDs, photo diodes, nPnT switches
- Active bipoles: various independent and dependent voltage/current sources
- Operational amplifiers
- Bipolar and FET transistors
- Signal labeling generator with a few commonly used signals predefined
- Each element can be labeled individually. Numeric nominal values are supported with optional unit inclusion
- current and/or voltage arrows can be added to all elements, with custom labels. Their directions are adjustable.
- adjustable orientation is available
- optional LaTeX support
This is a work-in-progress project. New components will be added in the future.
This extension was partially developed in Inkscape 0.48 and partially in 0.91 in Linux (Kubuntu 12.04 and 14.04). It should work on both versions of Inkscape. Also, they should work in different OSs too as long as all requirements are installed.
This extension requires another extension to run, inkscapeMadeEasy https://github.com/fsmMLK/inkscapeMadeEasy, which contains several backstage methods and classes.
In order to use circuitSymbols extension, you must also download inkscapeMadeEasy files and put them inside Inkscape's extension directory. Please refer to inkscapeMadeEasy installation instructions. In the end you must have the following files and directories in your Inkscape extension directory.
inkscape/extensions/
|-- inkscapeMadeEasy_Base.py
|-- inkscapeMadeEasy_Draw.py
|-- inkscapeMadeEasy_Plot.py
|-- textextLib
| |-- __init__.py
| |-- basicLatexPackages.tex
| |-- CircuitSymbolsLatexPreamble.tex <-- add this file to textextLib subdirectoy
| |-- textext.inx
| |-- textext.py
|
|-- circuitSymbols.py
|-- circuitSymbols.py
|-- drawAmpOp.py
|-- drawArrows.py
|-- drawDiodes.py
|-- drawRLC.py
|-- drawSignals.py
|-- drawSources.py
|-- drawSwitches.py
|-- drawTransistors.py
|-- circuitSymbols_semiconductors.inx
`-- circuitSymbols_general.inx
LaTeX package requirement
If LaTeX support is enables (see below), you will need in your system the following packages: amsmath, amsthm, amsbsy, amsfonts, amssymb, siunitx, steinmetz
Disabling LaTeX support of inkscapeMadeEasy
Many of the methods implemented in inkscapeMadeEasy project use LaTeX to generate text. To this end I decided to employ the excellent extension textext from Pauli Virtanen https://pav.iki.fi/software/textext/.
LaTeX support via textext extension requires LaTeX typesetting system in your computer (it's free and awesome! =] ).
Since many people don't use LaTeX and/or don't have it installed, inkscapeMadeEasy's LaTeX support is now optional. By default, LaTeX support is ENABLED.
Please refer to https://fsmmlk.github.io/inkscapeMadeEasy/#installation-and-requirements on how to easily disable LaTeX support.
This extension is presented in two menu entries: General and Semiconductor. Both can be found under extensions > fsmMLK > Circuit symbols
menu.
The first generates symbols of commonly used circuit elements like resistors, capacitors, inductors, 2 way switches and various independent and dependent voltage/current sources
The second generates semiconductor elements like diodes, transistors and operational amplifiers.
Each entry has several tabs. Depending on which tab is on top, the extension will create different elements in your document as soon as you click on Apply
button (or check live preview
).
In addition to these elements, both menu entries has extra tabs to generate signal labels and annotation. They are repeated in both entries to facilitate its use.
Type: You can select the type of bipole. The available types are:
Value: Value of the bipole. If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$. If you type numeric values, you can use M,k,m,u,p
to indicate multiplier unit.
Include unit: If selected, unit will be automatically added to the value. The unit will be selected accordingly with the type (ohm for resistors and generic bipole, farad for capacitors, henry for inductors).
Note: If LaTeX support is enabled, the unit will be inserted using
siunitx
package.
Orientation: Rotation angle in degrees.
Sign convention: switches between passive and active sign conventions.
Add voltage/current arrow: add voltage drop and current arrow indications.
V/I labels: Label of the voltage drop and current arrows. If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$.
Invert V/I directions: invert the directions of the arrows. Keep in mind that they will still follow the sign convention you selected.
Type: You can select the type of source. The available types are:
Value: Value of the bipole. If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$. If you type numeric values, you can use M,k,m,u,p
to indicate multiplier unit.
Include unit: If selected, unit will be automatically added to the value. The unit will be selected accordingly with the type (volt for voltage source and ampere for current source).
Note: If LaTeX support is enabled, the unit will be inserted using
siunitx
package.
Orientation: Rotation angle in degrees. See RLC tab section for examples.
Invert source direction: invert the direction of the source.
Sign convention: switches between passive and active sign conventions. See RLC tab section for examples.
Add voltage/current arrow: add voltage drop and current arrow indications.
V label: (current sources only) Label of the voltage drop arrow in current sources. This parameter does not change the label of the voltage drop across voltage sources (the label matches its Value). If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$.
I label: (voltage sources only) Label of the current in voltage sources. This parameter does not change the label of the current passing in current sources (the label matches its Value). If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$.
Invert V or I directions: invert the directions of the indications. If activated, a negative sign will be automatically added to:
- Voltage annotation in voltage sources
- Current annotation in current sources
Type: You can select the type of source.
Orientation: Rotation angle in degrees. See RLC tab section for examples.
Invert source direction: invert the direction of the source.
Type of control: You can select the type of control.
Note: Together with the source, the extension will create control arrows in all possible directions. This allow you to choose from them the arrow that fits to your situation.
Gain: control gain of the source. If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$. If you type numeric values, you can use M,k,m,u,p
to indicate multiplier unit.
Control name: Label of the control signal (voltage or current, depending on the type of control. If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$. If you type numeric values, you can use M,k,m,u,p
to indicate multiplier unit.
Sign convention: switches between passive and active sign conventions. See RLC tab section for examples.
Add voltage/current arrow: add voltage drop and current arrow indications.
V label: (current sources only) Label of the voltage drop arrow in current sources. This parameter does not change the label of the voltage drop across voltage sources (the label matches its Value). If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$.
I label: (voltage sources only) Label of the current in voltage sources. This parameter does not change the label of the current passing in current sources (the label matches its Value). If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$.
Invert V or I directions: invert the directions of the indications. See Independent source tab section for examples.
Number of poles/throws: select the number of poles (1 to 4) and throws (1 to 8) of the switch (nPmT)
Label: Label of the switch. If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$.
Orientation: Rotation angle in degrees. See RLC tab section for examples.
Commuting arrow: Adds annotation arrow indicating change of state. See image below
Commuting text: Adds text near the commuting arrow. Useful to express the time when the switch changes state. See image below
Orientation: invert commuting arrow direction. Used only if throw number > 1
Push-button: sets the switch to push-button. Used only if single throw. See figure above.
Connecting channel: sets the output channel connected to the input. Used only if throw number > 1
Sign convention: switches between passive and active sign conventions. See RLC tab section for examples.
Add voltage/current arrow: add voltage drop and current arrow indications.
V/I labels: Label of the voltage drop and current arrows. If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$.
Invert V or I directions: invert the directions of the indications. See RLC tab section for examples.
Type: Allows the selection of one type of signal. You can select a few commonly used signal or select Custom
to customize its label. (see below)
Custom label: Label of the signal. Used only if Custom
is selected in Type
. If LaTeX support is enabled (see Installation and requirements
section) the text will be inserted in a mathematical environment
Direction: Direction of the line segment.
Draw line: signal line toggle.
This tab allows you to create custom voltage or current annotation to add to your circuits.
Type: You can select voltage or current annotation
Label: Label of the annotation. If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$.
Orientation: Rotation angle in degrees. See RLC tab section for examples.
Arrow size: size of the arrow. There is one field for voltage annotation and another for current.
Invert arrow direction: invert the directions of the arrows.
Invert disposition: invert disposition of the annotation.
- voltage annotation: inverts the curvature of the arrow
- current annotation: inverts the side of the text
This tab is divided in two sections. The first controls the color of current annotation, the second controls the color of voltage annotation.
In both cases, you have two options in the Color
drop down menu:
- You can select the predefined colors as presented below
- You can select use color picker to choose the color from the color picker widget just below the
Color
drop down menu. Attention: the color selected in the color picker widget will be considered ONLY if you select use color picker in the drop down menu.
Type: You can select the type of semiconductor. The available types are:
Label: Label of the switch. If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$.
Orientation: Rotation angle in degrees. See RLC tab section for examples.
Invert diode direction: invert the direction of the diode.
Sign convention: switches between passive and active sign conventions. See RLC tab section for examples.
Add voltage/current arrow: add voltage drop and current arrow indications.
Invert V/I directions: invert the directions of the arrows. Keep in mind that they will ALWAYS follow the receiver convention (current flows in the direction of the voltage drop).
V/I labels: Label of the voltage drop and current arrows. If LaTeX support is enabled, this text will be included in a math environment $...$. You don't have to enclose your text between $...$.
Type/Phototransistor: You can select the type of transistor.
Orientation: Rotation angle in degrees. See RLC tab section for examples.
Draw Envelope: Draws an envelope circle around the transistor
Switch Emitter/Collector terminals: Switch terminals. Attention: This will not switch between NPN and PNP transistors.
Add E/B/C tags: Add Emitter, base and collector label annotations
Add v_CE/v_CB/v_BE voltage arrows: Add voltage drop annotations across the transistor
Add i_C/i_B/i_E current arrows: Add collector, base and emitter current annotations
v_CE/v_CB/v_BE labels: labels of voltage drop annotations
i_C/i_B/i_E labels: labels of transistor currents
FET Type / Channel type: Type of FET.
Orientation: Rotation angle in degrees. See RLC tab section for examples.
Draw Envelope: Draws an envelope circle around the transistor
Switch Source/Drain terminals: Switch terminals. Attention: This will not switch between different channel types.
Add body diode (3-terminal MOSFET-E only): Draws the body diode of power MOSFETs.
4-terminal MOSFET (MOSFET only): Switch between 3 and 4-terminal MOSFETs.
Move gate towards the source (JFET only): Moves gate terminal.
Add S/G/D tags: Add source, gate and drain label annotations
Add v_GS/v_DS/v_DG voltage arrows: Add voltage drop annotations across the transistor
Add i_D/i_S/i_G current arrows: Add collector, base and emitter current annotations
v_GS/v_DS/v_DG labels: labels of voltage drop annotations
i_D/i_S/i_G labels: labels of transistor currents
Type: You can select the type of operational amplifier. At the moment there is only one type of OpAmp.
Invert inputs: invert the position between inverting and non inverting inputs
Add supply terminals: draw supply terminals.
Add supply values: add values to supply terminals. This parameter has effect only if Add supply terminals
is checked.
Symmetric supply: force symmetric supply. This parameter has effect only if Add supply values
is checked.
+V/-V supply label: positive/negative supply values. -V is used only if Symmetric supply
is unchecked.
Add input voltage labels (v+) (v-): add input nodal voltage annotation.
Add input voltage labels (i+) (i-): add input current annotation.
Add output voltage label (Vout): add output nodal voltage annotation.
Add output current label (Vout): add output current annotation.
Add input differential voltage arrow (Vd): add input differential voltage annotation.
v+/v- label: labels of input nodal voltages
i+/i- label: labels of input currents
Vout/Iout label: labels of the output voltage and current
Vd label: label of the input differential voltage
-
The objects will be created at the center of your screen.
-
In the file
CircuitSymbolsLatexPreamble.tex
you can add LaTeX macros and extra packages. A few of functions were define there: