Giter Site home page Giter Site logo

inkscapecircuitsymbols's Introduction

circuitSymbols

This extension will assist you creating electric symbols in Inkscape.

NEWS: See the new section Changelog for new features!

TIP: If you want to create timing diagrams, please take a look at my newest project wavedromScape

main features

The main features of this extension are

  • Passive bipoles: resistors, capacitors, inductors, fuses, transformers, diodes, LEDs, photo diodes, nPnT switches
  • Active bipoles: various independent and dependent voltage/current sources
  • Operational amplifiers
  • Bipolar and FET transistors
  • Signal labeling generator and predefined common signals.
  • Current and/or voltage indication arrows can be added to all elements, with custom labels. Their directions are adjustable.
  • You can choose between active and passive sign convention for all elements
  • adjustable orientation is available
  • optional LaTeX support

This is a work-in-progress project. New components will be added in the future.

Current and older versions

Compatibility table

Inkscape circuitSymbols inkscapeMadeEasy Receive updates?
1.0 1.0 (latest) 1.0 (latest) YES
0.48, 0.91, 0.92 0.9x (obsolete) 0.9x (obsolete) NO

Latest version: The latest version of circuitSymbols is 1.0. This version is compatible with Inkscape 1.0 and up only. It is incompatible with older Inkscape versions!

Older versions: If you have an older version of Inkscape, please use the files under the folder 0.9x on Github.

Important: Only the latest version will receive updates, new features, and bug fixes! The usage section in this documentation describes the latest version. In older versions, the disposition of the elements in the plugin's screen might be different. Some features might not be present or have different behavior.

Installation and requirements

Installation procedures for latest and older versions are described below.

Requirements (all versions)

  • You will need inkscapeMadeEasy plugin installed. Check the compatibility table above to know the version you need.

Installation procedure (v1.0 only)

circuitSymbols was developed using Inkscape 1.0 in Linux (Kubuntu 18.04). It should work in different OSs too as long as all requirements are met.

  1. Install inkscapeMadeEasy, version 1.0 (latest). Follow the instructions in the manual page. Note: LaTeX text is used in circuitSymbols if the support is activated (nicer results), otherwise regular text elements will be used.

  2. circuitSymbols installation

    1. Go to Inkscape's extension directory with a file browser. Your inkscape extension directory can be accessed by opening Inkscape and selecting Edit > Preferences > System. Look for the item User Extensions field. There is a button on the right of the field that will open a file explorer window in that specific folder.

    2. Create a subfolder in the extension directory with the name circuitSymbols. Important: Be careful with upper and lower case letters. You must write as presented above.

    3. Download circuitSymbols files and place them inside the directory you just created.

      You don't have to copy all files from Github. The files you will need are inside the latest folder. In the end you must have the following files and directories in your Inkscape extension directory.

      LaTeX users: the file circuitSymbolsPreamble.tex contains the macros defined in this plugin. You can add your own macros to this file. You can also add macros to inkscapeMadeEasy/basicLatexPackages.tex. In this case the same macros will be accessible by all plugins that employ inkscapeMadeEasy.

      inkscape
       ┣━━extensions
       ┋   ┣━━ inkscapeMadeEasy      <-- inkscapeMadeEasy folder
           ┃    ┣━━ inkscapeMadeEasy_Base.py
           ┃    ┣━━ inkscapeMadeEasy_Draw.py
           ┃    ┣━━ inkscapeMadeEasy_Plot.py
           ┃    ┗━━ basicLatexPackages.tex
           ┃
           ┣━━ textext               <-- texText folder (if you installed textText)
           ┃    ┋
           ┃
           ┣━━ circuitSymbols        <-- circuitSymbols folder
           ┋    ┣━━ circuitSymbolsPreamble.tex
                ┣━━ circuitSymbols_semiconductors.inx
                ┣━━ circuitSymbols_general.inx
                ┣━━ circuitSymbols.py
                ┣━━ drawAmpOp.py
                ┣━━ drawArrows.py
                ┣━━ drawDiodes.py
                ┣━━ drawRLC.py
                ┣━━ drawSignals.py
                ┣━━ drawSources.py
                ┣━━ drawSwitches.py
                ┗━━ drawTransistors.py
      
      NOTE: You might have other sub folders inside the extensions directory. They don't interfere with the plugin.
      

Installation procedure (v0.9x only)

circuitSymbols was developed using Inkscape 0.48 and 0.91 in Linux (Kubuntu 18.04). It should work in different OSs too as long as all requirements are met.

  1. Install inkscapeMadeEasy, version 1.0 (latest). Follow the instructions in the manual page. Note: LaTeX text is used in circuitSymbols if the support is activated (nicer results), otherwise regular text elements will be used.

  2. circuitSymbols installation

    1. Go to Inkscape's extension directory with a file browser.

    2. Download circuitSymbols files and place them inside the directory you just created.

      You don't have to copy all files from Github. The files you will need are inside the 0.9x folder. 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     <-- from repository folder 0.9x!
            ┃    ┣━━ textext.inx
            ┃    ┗━━ textext.py
            ┃
            ┣━━ circuitSymbols.py                  <--
            ┣━━ drawAmpOp.py                       <--
            ┣━━ drawArrows.py                      <--
            ┣━━ drawDiodes.py                      <--
            ┣━━ drawRLC.py                         <--
            ┣━━ drawSignals.py                     <--   from repository folder 0.9x!
            ┣━━ drawSources.py                     <--
            ┣━━ drawSwitches.py                    <--
            ┣━━ drawTransistors.py                 <--
            ┣━━ circuitSymbols_semiconductors.inx  <--
            ┗━━ circuitSymbols_general.inx         <--
      

Usage

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, 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 annotations. They are repeated in both entries to facilitate its use.

GENERAL menu entry

RLC tab

In this tab you can create resistors, capacitors, inductors and fuses. The section Voltage and current indications serves to add voltage or current annotation arrows to the symbol and adjust their orientations.

Type: You can select the type of bipole. The available types are:

Important: 2-terminal potentiometer option was removed. You can have the same symbol with resistor + 'Variable' option turned on.

Standard: Here you can choose the standard. There are two options, IEEE Std 315-1975 (american) and IEC 60167 (europe). This option affects RLC tab only.

Orientation: Rotation angle in degrees.

Extra wire length: You can adjust the length of the wires. You can choose any integer number between -10 and 10. (Defaults is 0).

Note: Keep in mind that negative numbers can cause current arrow indication to overlap other elements of the symbol. You can manually adjust if needed.

Value: Literal or numeric value of the bipole. If you type numeric values, you can use M,k,m,u,n,p to indicate multiplier unit. If LaTeX support is enabled, this text will be included in a math environment $...$. Also for LaTeX, there are a couple of functions to specify values in terms of complex impedances. See image below for examples.

Variable: If selected, adds variable arrow on top of the symbol. This option has no effect in fuses and 3-terminal potentiometers.

Add 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 (impedance), farad for capacitors, henry for inductors).

Note: If LaTeX support is enabled, the unit will be inserted using siunitx package.

Voltage and current indications section

Sign convention: Switches between passive and active sign conventions. This option affects the symbol only if you add voltage and current indications.

Add voltage/current indications: Add voltage drop and current arrow indications. On the side there are fields for the labels of the annotations. If LaTeX support is enabled, this text will be included in a math environment $...$.

Invert V/I directions: invert the directions of the annotations. Keep in mind that they will still follow the sign convention you selected.

Sources tab

In this tab you can create voltage and current sources. The sources can be independent or dependent (contolled).

This tab contains two subtabs, Independent and Dependent. The 'Apply' button will execute the action associated to the subtab that is on the top.

There is also a common section called Voltage and current indications that will serve both types of sources to add voltage or current annotation arrows to the symbol and adjust their orientations.

Independent source subtab

Type: Here you can select the type of source. The available types are presented below.

Standard: Here you can choose the standard. There are two options, IEEE Std 315-1975 (american) and IEC 60167 (europe). This option affects independent sources only. Old current source style (DIN?) is not affected by this option.

Orientation: Rotation angle in degrees. See RLC tab section for examples.

Extra wire length: You can adjust the length of the wires. See RLC tab section for examples.

Invert source direction: invert the direction of the source.

Value: Literal or numeric value of the bipole. If you type numeric values, you can use M,k,m,u,n,p to indicate multiplier unit. If LaTeX support is enabled, this text will be included in a math environment $...$. Also for LaTeX, there are a couple of functions to specify values in terms of phasors. See examples below.

Variable: If selected, adds variable arrow on top of the symbol. See RLC tab section for examples.

Add unit: If selected, unit will be automatically added to the value. The unit will be selected accordingly with the type (V for voltages and A for current).

Note: If LaTeX support is enabled, the unit will be inserted using siunitx package.

Dependent source subtab

Type: Here you can select the type of source. The available types are presented below.

Standard: Here you can choose the standard. There are two options, IEEE Std 315-1975 (american) and IEC 60167 (europe). This option affects dependent sources only.

Orientation: Rotation angle in degrees. See RLC tab section for examples.

Extra wire length: You can adjust the length of the wires. See RLC tab section for examples.

Invert source direction: invert the direction of the source.

Control: You can select the type of control, votage or current.

Gain: control gain of the source. If LaTeX support is enabled, this text will be included in a math environment $...$.

Control signal: 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 $...$.

Draw congtrol indications: If selected, the extension will create control indication arrows in all possible directions. This allow you to choose from them the arrow that fits your situation.

Voltage and current indications section

Sign convention: Switches between passive and active sign conventions. This option affects the symbol only if you add voltage and current indications. See RLC tab section for examples.

Add voltage/current indications: Add voltage drop and current arrow indications. On the side there are fields for the labels of the annotations. If LaTeX support is enabled, this text will be included in a math environment $...$.

  • Voltage label: The contents of the text box affects current sources only. For voltage sources, the label will be the same of the value. If LaTeX support is enabled, this text will be included in a math environment $...$.

  • Current label: The contents of the text box affects voltage sources only. For current sources, the label will be the same of the value. If LaTeX support is enabled, this text will be included in a math environment $...$.

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

Switches tab

In this tab you can create switches. The section Commuting information allows you to configure commutation annotation. The section Voltage and current indications serves to add voltage or current annotation arrows to the symbol and adjust their orientations.

Number of poles/throws: Here you can select the number of poles (1 to 4) and throws (1 to 8) of the switch (nPmT). See examples below.

Orientation: Rotation angle in degrees. See RLC tab section for examples.

Extra wire length: You can adjust the length of the wires. See RLC tab section for examples.

Label: Set the text of the label of the switch. If LaTeX support is enabled, this text will be included in a math environment $...$.

Push-button: Sets the switch to push-button. Activating this option will force number of throws to one (nT=1).

Current state: Here you can select which output channel is connected to the input, if any (open switch). If the number selected here is larger than the number of outputs (nT), the last output will be connected.

Commutating information section

Commutating 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

Direction: invert commuting arrow direction. Used only if nT > 1

Voltage and current indications section

Sign convention: Switches between passive and active sign conventions. This option affects the symbol only if you add voltage and current indications. See RLC tab section for examples.

Add voltage/current indications: Add voltage drop and current arrow indications. On the side there are fields for the labels of the annotations. If LaTeX support is enabled, this text will be included in a math environment $...$. See RLC tab section for examples.

Invert V/I directions: invert the directions of the annotations. Keep in mind that they will still follow the sign convention you selected. See RLC tab section for examples.

Transformers tab

In this tab you can create transformers.

Type: You can select the type of transformer. The available types are:

Orientation: Rotation angle in degrees. See RLC tab section for examples.

Extra wire length: You can adjust the length of the wires. See RLC tab section for examples.

Core type: You can choose between air, iron, and ferrite cores

Step type: You can choose between step up, step down, and one to one. This option affects transformers only.

Add coil polarity: You can add symbol to indicate the polarity of the coils. This option affects transformers only.

Primary/Secondary subtab

The subtabs control each coil of the transformer. Only the Primary subtab affects inductors.

Number of coils: You can choose the number of coils in the primary/secondary. You can choose between 1 or 2 coils. This option has not effect on inductors.

Coil tap: Adds a centra tap to the coil

Flip coil polarity: Flip the polarity indictaion in the coils

Voltage and current indications

Voltage and current indications section

Sign convention: Switches between passive and active sign conventions. This option affects the symbol only if you add voltage and current indications. See RLC tab section for examples.

Add voltage/current indications: Add voltage drop and current arrow indications. On the side there are fields for the labels of the annotations. If LaTeX support is enabled, this text will be included in a math environment $...$. See RLC tab section for examples.

Invert V/I directions: invert the directions of the annotations. Keep in mind that they will still follow the sign convention you selected. See RLC tab section for examples.

Sig./Ind tab

This tab is presented in two subtabs, Signals and Indications. The first create signal nodes to add to your circuit. The second creates custom voltage and current arrow indications to use in your circuit. The 'Apply' button will execute the action associated to the subtab that is on the top

Signals subtab

Type: Allows the selection of the type of signal. You can select a few commonly used signal or select Custom to customize its label. (see below)

Direction: Direction of the signal line. This option is used only if Draw signal line option is enabled.

Label: Label of the signal. This option is used only if Custom or Digital is selected in Signal type. If LaTeX support is enabled the text will be inserted in a mathematical environment $...$

Draw signal line: signal line toggle.

Indication subtab

This tab allows you to create custom voltage or current indications to add to your circuits.

Type: You can select voltage or current indication arrows.

Orientation: Rotation angle in degrees. See RLC tab section for examples.

Invert direction: invert the directions of the arrows.

Invert disposition: invert disposition of the indications. See image below.

  • voltage arrow: inverts the curvature of the arrow
  • current arrow: inverts the side of the text

Label: Label of the indication. If LaTeX support is enabled the text will be inserted in a mathematical environment $...$

Add unit: If selected, unit will be automatically added to the value. The unit will be selected accordingly with the type (V for voltage and A for current).

Indication size: Sizes of the arrows. There is one field for voltage and another for current arrows.

Color Setup section

This section controls the color of current and voltage indications.

In both cases, you have two options in the Color drop down menu:

  • You can select the predefined colors. They are presented below

  • You can select use color picker to choose the color from the color picker widget just to the right of the 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.

SEMICONDUCTOR menu entry

Diodes tab

In this tab you can create diodes and LEDs.

Type: You can select the type of semiconductor. The available types are:

Orientation: Rotation angle in degrees. See RLC tab section for examples.

Extra wire length: You can adjust the length of the wires. See RLC tab section for examples.

Invert diode direction: invert the direction of the diode.

Label: Label of the indication. If LaTeX support is enabled the text will be inserted in a mathematical environment $...$

Voltage and current indications section

Sign convention: Switches between passive and active sign conventions. This option affects the symbol only if you add voltage and current indications. See RLC tab section for examples.

Add voltage/current indications: Add voltage drop and current arrow indications. On the side there are fields for the labels of the annotations. If LaTeX support is enabled, this text will be included in a math environment $...$.

Invert V/I directions: invert the directions of the annotations. Keep in mind that they will still follow the sign convention you selected. See RLC tab section for examples.

BJT tab

In this tab you can create BJT (photo)transistors.

Type/Phototransistor: You can select the type of transistor.

Orientation: Rotation angle in degrees. See RLC tab section for examples.

Extra wire length: You can adjust the length of the wires. See RLC tab section for examples.

Phototransistor: Turns the BJT into a phototransistor. See image above.

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 labels to the symbols. See image below.

Voltage and current indications section

Add v_CE/v_CB/v_BE indications: Add voltage drop indications across the transistor. On the side there are fields for the labels of the annotations. If LaTeX support is enabled, this text will be included in a math environment $...$. See image below.

Add i_C/i_B/i_E indications: Add collector, base and emitter current indications. On the side there are fields for the labels of the annotations. If LaTeX support is enabled, this text will be included in a math environment $...$. See image below.

FET tab

In this tab you can create MOSFET and JFET transistors.

FET Type / Channel type: Specifies the type of FET.

MOSFET symbol type (MOSFET only): Switch between different symbol schemes. See figure below.

Orientation: Rotation angle in degrees. See RLC tab section for examples.

Extra wire length: You can adjust the length of the wires. See RLC tab section for examples.

Add body diode (3-terminal MOSFET-E only): Draws the body diode of power MOSFETs.

Move gate towards the source (JFET only): Moves gate terminal.

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 S/G/D tags: Add source, gate and drain labels. See image below.

Voltage and current indications section

Add v_GS/v_DS/v_DG indications: Add voltage drop indications across the transistor. On the side there are fields for the labels of the indication. If LaTeX support is enabled, this text will be included in a math environment $...$. See image below.

Add i_D/i_S/i_G indications: Add drain, source and gate current indications. On the side there are fields for the labels of the indication. If LaTeX support is enabled, this text will be included in a math environment $...$. See image below.

Operational amplifier tab

In this tab you can create operational amplifiers.

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

Supply section

Add supply terminals: draw power supply terminals. See image below

Add supply values: Add signal nodes to supply terminals. This parameter has effect only if Add supply terminals is checked. See image below

Symmetric supply: Force symmetric supply. This parameter has effect only if Add supply values is checked. See image below

+V/-V supply label: positive/negative supply values. -V is used only if Symmetric supply is unchecked. See image below

Voltage and current indications section

Add (v+) (v-) indications: add input nodal voltage indications. On the side there are fields for the labels of the indications. If LaTeX support is enabled, this text will be included in a math environment $...$. See image below.

Add (i+) (i-) indications: add input current indications. On the side there are fields for the labels of the indications. If LaTeX support is enabled, this text will be included in a math environment $...$. See image below.

Add V_out indication: add output nodal voltage indication. On the side there is a text field for the label of the indication. If LaTeX support is enabled, this text will be included in a math environment $...$. See image below.

Add I_out indication: add output current indication. On the side there is a text field for the label of the indication. If LaTeX support is enabled, this text will be included in a math environment $...$. See image below

Add V_d indication: add input differential voltage indication. On the side there is a text field for the label of the indication. If LaTeX support is enabled, this text will be included in a math environment $...$. See image below

Sig./Ind tab

This tab is identical to the tab with the same name on GENERAL menu entry. Check the documentation there.

Observations

  • The objects will be created in the center of your screen.

  • In the file circuitSymbolsPreamble.tex you can add LaTeX macros and extra packages. A few functions were define there:

Examples

Changelog

2022-02feb-19

  • Added variable RLC components
  • Added variable independent sources
  • Added old current source symbol (two circles)
  • Added insulated gate bipolar transistor (NPN and PNP)
  • Removed 2-terminal potentiometer. Now you can create the same symbol with Resistor + variable indication

inkscapecircuitsymbols's People

Contributors

fsmmlk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inkscapecircuitsymbols's Issues

Problem for a new user

Hi!

I have downloaded Inkscape, inkscapeMadeEasy and CircuitSymbols. I think I followed every step. At this point, I didn't download Latex so I did remove that one # as it was told.

Now I have tried to use CircuitSymbols at Inkscape, but I get this error message, when I click use/apply-button.

Have I done something wrong or is this a bug? Thank you!

Traceback (most recent call last):
File "C:\Users\Käyttäjä\AppData\Roaming\inkscape\extensions\circuitSymbols\circuitSymbols.py", line 645, in
circuit = CircuitSymbols()
File "C:\Users\Käyttäjä\AppData\Roaming\inkscape\extensions\circuitSymbols\circuitSymbols.py", line 60, in init
self.arg_parser.add_argument("--bipoleRLCvariable", type=self.bool, dest="bipoleRLCvariable", default=False)
AttributeError: 'CircuitSymbols' object has no attribute 'bool'

More MOSFET Symbol Options

Hi, thanks for your efforts, it helps me a lot on Mac to draw circuit schematics.
However, I'm an analog IC designer, and the symbols of MOSFET are a little different from those we usually use in conferences like ISSCC shown below. So I mean whether you could add some options to add/move the circle of the MOSFET symbols.
螢幕截圖 2022-10-23 下午5 13 30

Inkscape 0.91 on Mac OS X - Can't draw any symbol

I can't get the extension to work.

The error I receive is:
RuntimeError: Command pdflatex /var/folders/72/msgvrvh51jlbctvzxd9qr8840000gn/T/tmprSk2yD/tmp.tex -interaction=nonstopmode -halt-on-error failed: [Errno 2] No such file or directory

If I comment the remove_temp_files(self) method in textext.py (lines 515 to 518) and run the pdflatex <tempfile.tex> <switches> command in a terminal, I can compile the .tex file correctly.

If I disable Latex altogether, I can get the symbol with the raw string as a value.

I'm using Inkscape 0.91+devel+osxmenu r12922 on Mac OS X 10.11.6.

Full traceback here:
Traceback (most recent call last): File "circuitSymbols.py", line 2264, in <module> circuit.affect() File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex.py", line 269, in affect self.effect() File "circuitSymbols.py", line 247, in effect currName=so.bipoleRLCCurrName,invertArrows=so.bipoleRLCVoltCurrInvert) File "circuitSymbols.py", line 568, in drawResistor inkDraw.text.latex(self,group,value,pos_text,fontSize=self.fontSize,refPoint='bc',preambleFile=self.preambleFile) File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkscapeMadeEasy_Draw.py", line 1230, in latex tex.affect([r'--text=' + LatexCommands + LaTeXtext, '--scale-factor=1', '--preamble-file=' + preambleFile, tempFilePath], output=False) File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/inkex.py", line 269, in affect self.effect() File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/textextLib/textext.py", line 151, in effect self.options.scale_factor, converter_cls, old_node) File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/textextLib/textext.py", line 165, in do_convert new_node = converter.convert(text, preamble_file, scale_factor) File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/textextLib/textext.py", line 532, in convert self.tex_to_pdf(latex_text, preamble_file) File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/textextLib/textext.py", line 509, in tex_to_pdf exec_command(['pdflatex', self.tmp('tex')] + latexOpts) File "/Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/textextLib/textext.py", line 370, in exec_command raise RuntimeError("Command %s failed: %s" % (' '.join(cmd), e)) RuntimeError: Command pdflatex /var/folders/72/msgvrvh51jlbctvzxd9qr8840000gn/T/tmprSk2yD/tmp.tex -interaction=nonstopmode -halt-on-error failed: [Errno 2] No such file or directory

Installation suggestion

Hi! Thank you for the package(s), it seems really cool and I wish I came across it sooner.

I had an issue on installation that might be worth adding a line into the installation instructions. I was lazy and cloned the git repos into .../inkscape/extensions and then created a symbolic link to the files in .../latest. I also tried copying the files up a level to match your tree shown.
This didn't work and I was banging my head trying to figure out why - it just seems Inkscape does not like git repos in its extensions folder. I tried this on Ubuntu and MacOS. Works fine when files are just copied from elsewhere. I'd be happy to submit a PR if you'd like.

Disabling support to avoid latex

Thanks for your awesome work !
You said that LaTeX was used in circuitSymbols if the support is activated.
I don't want to use LaTeX, so I want to disable the support but I don't know how !

Extension greyed out

Hi,
I wanted to use your library for my thesis work, I installed all the plugins and extensions, but the option is greyed out as shown.
image
any suggestions?

Circuit symbols

Hello,
I'm using Inkscape 92.4 (dutch version) on Win10 and installed the extension "Circuit Symbols" (and InkscapeMadeEasy) exactly like indicated in the readme file and as on your website.
I can see the topic in the menu under "fsmMLK" but I got an error by using it. The error = "Traceback (most recent call last):
File "circuitSymbols.py", line 8, in
from drawAmpOp import ampOp
ImportError: No module named drawAmpOp"
I can't find the problem. Does anyone have a solution for that?
Thanks

Works great on ubuntu 16.04, minor comments

Smooth installation on ubuntu 16.04 with tex live, inkscape 0.91, an impressive work and package!
Small remarks:

  • For inkscapeMadeEasy, I had to install steinmetz.sty which was missing, I did it with sudo apt install texlive-science (ref. this tex.stackexchange)

  • For inkscapeCircuitSymbols, in your Installation and requirements directory structure, you forgot to mention circuitSymbols_general.inx, which makes that only the semiconductor menu entry appears.

  • you could mention in your readme that the menu entries are found under extensions > fsmMLK > Circuit symbols.

Cheers!

Issue with siunitx (old version?)

Thanks for the great work! I tried to run the extension as-is but got exceptions about:

  1. There being no "per" parameter in the siunitx package
  2. There being no "\newunit" command

In order to make the extension work in Inkscape 1.1 (I am using MikTex 21.6-x64 on Windows 7) I had to update the circuitSymbolsPreamble.tex as follows: remove the [per=slash] on line 2, and replace \newunit with \DeclareSIUnit

The updated working file is shown below. I'm not sure whether this is an issue with the siunitx 3.x version or whether there is some other breaking change that is causing this.

\usepackage{amsmath,amsthm,amsbsy,amsfonts,amssymb}
\usepackage{siunitx}
\usepackage{steinmetz}
\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}

\newcommand{\micro}{\ensuremath{\mu}}
\newcommand{\phasorName}[1]{ \ensuremath{ \boldsymbol{\hat #1} } }
\newcommand{\impedance}[1]{ \ensuremath{ \boldsymbol{#1} } }
\newcommand{\complexPol}[2]{\ensuremath{#1\phase{#2}}}
\newcommand{\complexPolDeg}[2]{\ensuremath{#1\phase{#2\degree}}}

% new units
\DeclareSIUnit{\Vef}{\volt_{ef}} % volt eficaz
\DeclareSIUnit{\Vrms}{\volt_{rms}} % volt RMS
\DeclareSIUnit{\Vpp}{\volt_{pp}} % volt peak-to-peak

\DeclareSIUnit{\Aef}{\ampere_{ef}} % ampere eficaz
\DeclareSIUnit{\Arms}{\ampere_{rms}} % ampere rms
\DeclareSIUnit{\App}{\ampere_{pp}} % ampere peak-to-peak

% logic Commands
\newcommand{\NOT}[1]{\ensuremath{\overline{\mbox{\ensuremath{#1}}}}}
\newcommand{\AND}{\ensuremath{\cdot}}
\newcommand{\OR}{\ensuremath{+}}
\newcommand{\XOR}{\ensuremath{\oplus}}
\newcommand{\XNOR}{\ensuremath{\odot}}

update needed for Inkscape version 1.0

Hello,
Thank you for providing this extension for Inkscape users!

This is just to let you know that most 3rd party Inkscape extensions, like this one, probably will not work with the upcoming new Inkscape version, the long-awaited version 1.0.

Here is the info you need to update this extension, so that it will work with 1.0 and future versions.
https://wiki.inkscape.org/wiki/index.php?title=Updating_your_Extension_for_1.0

If you have further questions, you can contact Inkscape developers via mailing lists, forum, or the chatroom.

If you have already updated it, please disregard this message.

All best,
brynn

Length of connection pins adjustable

As the title says it would be really nice if the length of the connection pins is adjustable.
For me, it's too long for making compact schematics.

Would be nice if it's possible.

It gives me an error, when I clicked Apply

Error:

Traceback (most recent call last):
File "C:\Users\Apoorav\AppData\Roaming\inkscape\extensions\textext\base.py", line 562, in tex_to_pdf
exec_command([tex_command, self.tmp('tex')] + self.LATEX_OPTIONS)
File "C:\Users\Apoorav\AppData\Roaming\inkscape\extensions\textext\utility.py", line 268, in exec_command
raise TexTextCommandFailed(message="Command %s failed (code %d)" % (' '.join(cmd), p.returncode),
textext.errors.TexTextCommandFailed: Command C:\Users\Apoorav\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe tmp.tex -interaction=nonstopmode -halt-on-error failed (code 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Apoorav\AppData\Roaming\inkscape\extensions\circuitSymbols\circuitSymbols.py", line 646, in
circuit.run()
File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 231, in run
self.save_raw(self.effect())
File "C:\Users\Apoorav\AppData\Roaming\inkscape\extensions\circuitSymbols\circuitSymbols.py", line 307, in effect
self.drawResistor(root_layer, position, value=so.bipoleRLCVal, angleDeg=so.bipoleRLCRot, flagVolt=so.bipoleRLCVolt,
File "C:\Users\Apoorav\AppData\Roaming\inkscape\extensions\circuitSymbols\drawRLC.py", line 64, in drawResistor
inkDraw.text.latex(self, group, value, pos_text, fontSize=self.fontSize, refPoint='bc', preambleFile=self.preambleFile)
File "C:\Users\Apoorav\AppData\Roaming\inkscape\extensions\inkscapeMadeEasy\inkscapeMadeEasy_Draw.py", line 1310, in latex
tex.run([r'--text=' + LatexCommands + LaTeXtext, '--scale-factor=1', '--preamble-file=' + preambleFile, tempFilePath],
File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 231, in run
self.save_raw(self.effect())
File "C:\Users\Apoorav\AppData\Roaming\inkscape\extensions\textext\base.py", line 287, in effect
self.do_convert(new_text,
File "C:\Users\Apoorav\AppData\Roaming\inkscape\extensions\textext\base.py", line 363, in do_convert
converter.tex_to_pdf(tex_executable, text, preamble_file)
File "C:\Users\Apoorav\AppData\Roaming\inkscape\extensions\textext\base.py", line 566, in tex_to_pdf
raise TexTextConversionError(parsed_log, error.return_code, error.stdout, error.stderr)
textext.errors.TexTextConversionError: TeX compilation failed. See stdout output for more details

I am getting this error on the Inskcape Console:

Configuration;

OS: Windows 10
Python: python 3.10.6
MikTex Console Version 4.8
I am using latest version of "textext" and "inkscapeCircuitSymbols"

What I think is that there may be some missing package in MikTex.

Compatibility with siunitx version 2

When trying to use inkscapeCircuitSymbols, I run into the following error:

Traceback (most recent call last):
  File "C:\Users\Bio\AppData\Roaming\inkscape\extensions\textext\base.py", line 538, in tex_to_pdf
    exec_command([tex_command, self.tmp('tex')] + self.LATEX_OPTIONS)
  File "C:\Users\Bio\AppData\Roaming\inkscape\extensions\textext\utility.py", line 252, in exec_command
    raise TexTextCommandFailed(message="Command %s failed (code %d)" % (' '.join(cmd), p.returncode),
textext.errors.TexTextCommandFailed: Command C:\Users\Bio\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe tmp.tex -interaction=nonstopmode -halt-on-error failed (code 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "circuitSymbols.py", line 567, in <module>
    circuit.run()
  File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 140, in run
    self.save_raw(self.effect())
  File "circuitSymbols.py", line 377, in effect
    self.drawSourceV(root_layer, position, value=so.sourceVal, sourceType='general', angleDeg=so.sourceRot, flagVolt=so.sourceVolt,
  File "C:\Users\Bio\AppData\Roaming\inkscape\extensions\circuitSymbols\drawSources.py", line 79, in drawSourceV
    inkDraw.text.latex(self, group, value, pos_text, fontSize=self.fontSize, refPoint='bc', preambleFile=self.preambleFile)
  File "C:\Users\Bio\AppData\Roaming\inkscape\extensions\inkscapeMadeEasy\inkscapeMadeEasy_Draw.py", line 1288, in latex
    tex.run([r'--text=' + LatexCommands + LaTeXtext, '--scale-factor=1', '--preamble-file=' + preambleFile, tempFilePath],
  File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 140, in run
    self.save_raw(self.effect())
  File "C:\Users\Bio\AppData\Roaming\inkscape\extensions\textext\base.py", line 286, in effect
    self.do_convert(new_text,
  File "C:\Users\Bio\AppData\Roaming\inkscape\extensions\textext\base.py", line 362, in do_convert
    converter.tex_to_pdf(tex_executable, text, preamble_file)
  File "C:\Users\Bio\AppData\Roaming\inkscape\extensions\textext\base.py", line 542, in tex_to_pdf
    raise TexTextConversionError(parsed_log, error.return_code, error.stdout, error.stderr)
textext.errors.TexTextConversionError: ! Package keyvalue Error: Unknown option 'per' for package siunitx.

The error suggests that a option "per" for the siunitx Tex-Package is provided, which was used in the version 1 of siunitx.
See https://tex.stackexchange.com/questions/327859/package-siunitx-doesnt-work-with-option

A quick and easy fix is to use version 2 syntax in the preamble definition:
in C:\Users\ yourUserName \AppData\Roaming\inkscape\extensions\circuitSymbols\circuitSymbolsPreamble.tex

\usepackage{amsmath,amsthm,amsbsy,amsfonts,amssymb}
\usepackage[per-mode=symbol]{siunitx} % change this line here.
\usepackage{steinmetz}
\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}

\newcommand{\micro}{\ensuremath{\mu}}
\newcommand{\phasorName}[1]{ \ensuremath{ \boldsymbol{\hat #1} } }
\newcommand{\impedance}[1]{ \ensuremath{ \boldsymbol{#1} } }
\newcommand{\complexPol}[2]{\ensuremath{#1\phase{#2}}}
\newcommand{\complexPolDeg}[2]{\ensuremath{#1\phase{#2\degree}}}

% commend those lines out, they are the old syntax
% new units
%\newunit{\Vef}{\volt_{ef}} % volt eficaz
%\newunit{\Vrms}{\volt_{rms}} % volt RMS
%\newunit{\Vpp}{\volt_{pp}} % volt peak-to-peak

%\newunit{\Aef}{\ampere_{ef}} % ampere eficaz
%\newunit{\Arms}{\ampere_{rms}} % ampere rms
%\newunit{\App}{\ampere_{pp}} % ampere peak-to-peak

% add those lines, they are the new syntax
\DeclareSIUnit\Vef{\volt_{ef}} % volt eficaz
\DeclareSIUnit\Vrms{\volt_{rms}} % volt RMS
\DeclareSIUnit\Vpp{\volt_{pp}} % volt peak-to-peak

\DeclareSIUnit\Aef{\ampere_{ef}} % ampere eficaz
\DeclareSIUnit\Arms{\ampere_{rms}} % ampere rms
\DeclareSIUnit\App{\ampere_{pp}} % ampere peak-to-peak

% logic Commands
\newcommand{\NOT}[1]{\ensuremath{\overline{\mbox{\ensuremath{#1}}}}}
\newcommand{\AND}{\ensuremath{\cdot}}
\newcommand{\OR}{\ensuremath{+}}
\newcommand{\XOR}{\ensuremath{\oplus}}
\newcommand{\XNOR}{\ensuremath{\odot}}

Are there any plans to add siunitx version 2 compatibility?

Doesn't work: Problem with 'parseColorPicker'

Hi, thanks for this extension.

I just installed it on Inkscape 1.0.2-2 but get the following error whenever I try to insert a circuit symbol:

Traceback (most recent call last):
File "circuitSymbols.py", line 567, in
circuit.run()
File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 140, in run
self.save_raw(self.effect())
File "circuitSymbols.py", line 231, in effect
[self.voltageColor, alpha] = inkDraw.color.parseColorPicker(so.voltColor, so.colorPickerVolt)
ValueError: too many values to unpack (expected 2)

I guess it's really a problem with the inkDraw package?

Electric symbol requests

Please leave a message below with electric symbols you would like to have.

Please, if possible, add a picture of the symbol to help my life. =)

  • Add MOSFET 3-terminal (no bulk) symbols
  • Add transformers
  • Add variable components (R L C and sources)
  • Add old current source symbol (two circles) (DIN?)
  • Add insulated gate bipolar transistor (NPN and PNP)
  • Add wavedrom time diagrams (in progress, see my wavedromScape repository
  • RFIC symbols https://github.com/cfriesicke/inkscape-schematic-symbols
  • add option to keep label text always horizontal
  • add option to set no value to components, like resitors, capacitors, etc.
  • change the thickness of the arrow in the transistors

Error when generating symbols

Installed circuitsymbols on Windows 10.
in some cases it works. e.g. to draw the GND symbol.
In most cases a window opens complaining for an error.

As an exmaple when trying to draw a switch.

"
traceback (most recent call last):
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\textext\base.py", line 562, in tex_to_pdf
exec_command([tex_command, self.tmp('tex')] + self.LATEX_OPTIONS)
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\textext\utility.py", line 268, in exec_command
raise TexTextCommandFailed(message="Command %s failed (code %d)" % (' '.join(cmd), p.returncode),
textext.errors.TexTextCommandFailed: Command C:\Users\etnap\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe tmp.tex -interaction=nonstopmode -halt-on-error failed (code 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\textext\base.py", line 562, in tex_to_pdf
exec_command([tex_command, self.tmp('tex')] + self.LATEX_OPTIONS)
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\textext\utility.py", line 268, in exec_command
raise TexTextCommandFailed(message="Command %s failed (code %d)" % (' '.join(cmd), p.returncode),
textext.errors.TexTextCommandFailed: Command C:\Users\etnap\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe tmp.tex -interaction=nonstopmode -halt-on-error failed (code 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\circuitSymbols\circuitSymbols.py", line 646, in
circuit.run()
File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 231, in run
self.save_raw(self.effect())
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\circuitSymbols\circuitSymbols.py", line 477, in effect
self.drawNPST(root_layer, position, value=so.switchVal, angleDeg=so.switchRot, isPushButton=so.switchPushButton,
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\circuitSymbols\drawSwitches.py", line 102, in drawNPST
inkDraw.text.latex(self, group, value, pos_text, fontSize=self.fontSize, refPoint='bl', preambleFile=self.preambleFile)
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\inkscapeMadeEasy\inkscapeMadeEasy_Draw.py", line 1310, in latex
tex.run([r'--text=' + LatexCommands + LaTeXtext, '--scale-factor=1', '--preamble-file=' + preambleFile, tempFilePath],
File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 231, in run
self.save_raw(self.effect())
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\textext\base.py", line 287, in effect
self.do_convert(new_text,
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\textext\base.py", line 363, in do_convert
converter.tex_to_pdf(tex_executable, text, preamble_file)
File "C:\Users\etnap\AppData\Roaming\inkscape\extensions\textext\base.py", line 566, in tex_to_pdf
raise TexTextConversionError(parsed_log, error.return_code, error.stdout, error.stderr)
textext.errors.TexTextConversionError: TeX compilation failed. See stdout output for more details
"

Any hint on what could be wrong?
Thx

Crashes on Ubuntu with 0.48.4

I use the inkscape package 0.48.4-3ubuntu2 and have it installed with inkscapeMadeEasy in ~/.config/inkscape/extensions:

├── extensions
│   ├── circuitSymbols_general.inx
│   ├── circuitSymbols.py
│   ├── circuitSymbols_semiconductors.inx
│   ├── inkscapeMadeEasy_Base.py
│   ├── inkscapeMadeEasy_Draw.py
│   ├── inkscapeMadeEasy_Plot.py
│   └── textextLib
│       ├── basicLatexPackages.tex
│       ├── CircuitSymbolsLatexPreamble.tex
│       ├── __init__.py
│       ├── textext.inx
│       └── textext.py
├── icons
├── keys
├── palettes
├── preferences.xml
└── templates

inkscape crashes immediately and returns:

Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at www.inkscape.org
with a detailed description of the steps leading to the crash, so we can fix it.
zsh: segmentation fault (core dumped)  inkscape

How to troubleshoot

Hi, Have just got Circuit Symbols partially working for the first time on Windows 10.
Originally attempted to use 1.02 x64 MSI install of Inkscape. Could not find the extn in the menu.
Saw reported x64 issue reported by someone else so reverted to Inkscape 1.0 x86 MSI install on a 64 bit Windows 10
Can now see extn listed General and Semiconductor
Selection extension seemed to hang after selecting a diode - fatal.
Restart Inkscape. Had success selecting a resistor.
Attempted to insert an Inductor - extension hung again - fatal.

Grateful for any tips on testing the extension more systematically.

european and ameriсan style

It would be nice to add european and american style to bipoles. Design is very similar to circuitikz. It also would be nice to add circuitikz export. I have been searching for circuitikz gui for 2 weeks and eventually found.

Not working

I can not click on general and semiconductors option under the circuitSymbols

scaling of symbols and fonts ?

Hi,

I've noticed that the symbols generated are somewhat large-ish. When i scale them down the text scales down and then becomes too small to read.

I really did read through the documentation for some sort of scaling setting and did not see one.

Is there a way to set the scaling ?

General does not work but semiconductor works normally

The semiconductor works pretty fine. But when I use the General it returns such an error

Traceback (most recent call last):
File "D:\ProgramData\Inkscape\share\inkscape\extensions\textext\base.py", line 528, in tex_to_pdf
exec_command([tex_command, self.tmp('tex')] + self.LATEX_OPTIONS)
File "D:\ProgramData\Inkscape\share\inkscape\extensions\textext\utility.py", line 253, in exec_command
raise TexTextCommandFailed(message="Command %s failed (code %d)" % (' '.join(cmd), p.returncode),
textext.errors.TexTextCommandFailed: Command D:\ProgramData\Miklatex\miktex\bin\x64\pdflatex.exe tmp.tex -interaction=nonstopmode -halt-on-error failed (code 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "circuitSymbols.py", line 567, in
circuit.run()
File "D:\ProgramData\Inkscape\share\inkscape\extensions\inkex\base.py", line 140, in run
self.save_raw(self.effect())
File "circuitSymbols.py", line 308, in effect
self.drawInductor(root_layer, position, value=so.bipoleRLCVal, angleDeg=so.bipoleRLCRot, flagVolt=so.bipoleRLCVolt,
File "D:\ProgramData\Inkscape\share\inkscape\extensions\circuitSymbols\drawRLC.py", line 256, in drawInductor
inkDraw.text.latex(self, group, value, pos_text, fontSize=self.fontSize, refPoint='bc', preambleFile=self.preambleFile)
File "D:\ProgramData\Inkscape\share\inkscape\extensions\inkscapeMadeEasy\inkscapeMadeEasy_Draw.py", line 1288, in latex
tex.run([r'--text=' + LatexCommands + LaTeXtext, '--scale-factor=1', '--preamble-file=' + preambleFile, tempFilePath],
File "D:\ProgramData\Inkscape\share\inkscape\extensions\inkex\base.py", line 140, in run
self.save_raw(self.effect())
File "D:\ProgramData\Inkscape\share\inkscape\extensions\textext\base.py", line 284, in effect
self.do_convert(new_text,
File "D:\ProgramData\Inkscape\share\inkscape\extensions\textext\base.py", line 357, in do_convert
converter.tex_to_pdf(tex_executable, text, preamble_file)
File "D:\ProgramData\Inkscape\share\inkscape\extensions\textext\base.py", line 532, in tex_to_pdf
raise TexTextConversionError(parsed_log, error.return_code, error.stdout, error.stderr)
textext.errors.TexTextConversionError: TeX compilation failed. See stdout output for more details

any help is appreciated

Nothing happens when inserting symbol

Hi,
On Windows 10 Pro, 64-bit system. Tried to install Inkscape 0.92.4, 32 bit version to use the CircuitSymbols. When trying to insert any symbol in InkScape I see a window flashing by really quickly and then disappears. If I press the Apply button repeatedly I'm able to read the text: 'General' working, please wait.

But nothing happens. No symbol is inserted. I have tried with and without LaTex, doesn't make any difference.

Am I doing something wrong?

Best regards.
David

Inkscape 0.92 -- 64bit on W7 Enterprise

I am getting the following error in Python code:

Traceback (most recent call last):
  File "circuitSymbols.py", line 5, in <module>
    import inkscapeMadeEasy_Base as inkBase
  File "C:\Users\me\AppData\Roaming\inkscape\extensions\inkscapeMadeEasy_Base.py", line 81
    """
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 142-143: truncate

Nothing gets drawn.

latex use is broken with textext 1.3.0 and miktex

After a considerable amount of effort making sure textext was working correctly, I still get an indecipherable error when latex is enabled. The good news is that circuitsymbols works if i disable latex.
I would not be surprised if this is the result of yet another missing package in the latex installation (that was the problem i encountered with textext).

Traceback (most recent call last):
  File "C:\Users\xxxxxx\AppData\Roaming\inkscape\extensions\textext\base.py", line 558, in tex_to_pdf
    exec_command([tex_command, self.tmp('tex')] + self.LATEX_OPTIONS)
  File "C:\Users\xxxxxx\AppData\Roaming\inkscape\extensions\textext\utility.py", line 240, in exec_command
    raise TexTextCommandFailed(message="Command %s failed (code %d)" % (' '.join(cmd), p.returncode),
textext.errors.TexTextCommandFailed: Command C:\Users\xxxxxx\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe tmp.tex -interaction=nonstopmode -halt-on-error failed (code 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "circuitSymbols.py", line 553, in <module>
    circuit.run()
  File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 140, in run
    self.save_raw(self.effect())
  File "circuitSymbols.py", line 272, in effect
    self.drawResistor(root_layer, position, value=so.bipoleRLCVal, angleDeg=so.bipoleRLCRot, flagVolt=so.bipoleRLCVolt,
  File "C:\Users\xxxxxx\AppData\Roaming\inkscape\extensions\circuitSymbols\drawRLC.py", line 95, in drawResistor
    inkDraw.text.latex(self, group, value, pos_text, fontSize=self.fontSize, refPoint='bc', preambleFile=self.preambleFile)
  File "C:\Users\xxxxxx\AppData\Roaming\inkscape\extensions\inkscapeMadeEasy\inkscapeMadeEasy_Draw.py", line 1186, in latex
    tex.run([r'--text=' + LatexCommands + LaTeXtext, '--scale-factor=1', '--preamble-file=' + preambleFile, tempFilePath],
  File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 140, in run
    self.save_raw(self.effect())
  File "C:\Users\xxxxxx\AppData\Roaming\inkscape\extensions\textext\base.py", line 315, in effect
    self.do_convert(new_text,
  File "C:\Users\xxxxxx\AppData\Roaming\inkscape\extensions\textext\base.py", line 388, in do_convert
    converter.tex_to_pdf(tex_executable, text, preamble_file)
  File "C:\Users\xxxxxx\AppData\Roaming\inkscape\extensions\textext\base.py", line 562, in tex_to_pdf
    raise TexTextConversionError(parsed_log, error.return_code, error.stdout, error.stderr)
textext.errors.TexTextConversionError: ! LaTeX Error: File `siunitx.sty' not found.



Type X to quit or <RETURN> to proceed,

Does not work in ubuntu 17.04

I installed various module of fsmMLK (MadeEasy, CircuitSymbols, plot functions, ... following exactly the instructions. All the fsmMLK extensions produce the same error (see below), without displaying anything. The standard python in /usr/bin is 2.7 : can that be a problem ? Do these modules use python 3 ?
System : Ubuntu 17.04
Inkscape : 0.92

I have other extensions installed (such as textext), which work fine.

Here the error message:

Traceback (most recent call last):
File "circuitSymbols.py", line 1956, in
circuit.affect()
File "/usr/share/inkscape/extensions/inkex.py", line 283, in affect
self.effect()
File "circuitSymbols.py", line 251, in effect
currName=so.bipoleRLCCurrName,invertArrows=so.bipoleRLCVoltCurrInvert)
File "circuitSymbols.py", line 575, in drawCapacitor
inkDraw.text.latex(self,group,value,pos_text,fontSize=self.fontSize,refPoint='bc',preambleFile=self.preambleFile)
File "/home/bahram/.config/inkscape/extensions/inkscapeMadeEasy_Draw.py", line 1259, in latex
BboxMin, BboxMax = ExtensionBaseObj.getBoundingBox(groupLatex)
File "/home/bahram/.config/inkscape/extensions/inkscapeMadeEasy_Base.py", line 575, in getBoundingBox
coords = self.getPoints(element)
File "/home/bahram/.config/inkscape/extensions/inkscapeMadeEasy_Base.py", line 541, in getPoints
listPoints = self.getPoints(obj)
File "/home/bahram/.config/inkscape/extensions/inkscapeMadeEasy_Base.py", line 541, in getPoints
listPoints = self.getPoints(obj)
File "/home/bahram/.config/inkscape/extensions/inkscapeMadeEasy_Base.py", line 548, in getPoints
coordsNP = np.hstack((np.array(listCoords), np.ones([len(listCoords), 1]))).transpose()
File "/usr/lib/python2.7/dist-packages/numpy/core/shape_base.py", line 286, in hstack
return _nx.concatenate(arrs, 0)
ValueError: all the input arrays must have same number of dimensions

Does not work

When I click on apply, this error message is reported. Does anyone know what is wrong? Thank you

Traceback (most recent call last):
File "circuitSymbols.py", line 6, in
from drawAmpOp import ampOp
File "C:\Users\Stani\AppData\Roaming\inkscape\extensions\circuitSymbols\drawAmpOp.py", line 3, in
import inkscapeMadeEasy.inkscapeMadeEasy_Base as inkBase
File "C:\Users\Stani\AppData\Roaming\inkscape\extensions\inkscapeMadeEasy\inkscapeMadeEasy_Base.py", line 7

^
SyntaxError: invalid syntax

Error on inserting symbol: all the input arrays must have same number of dimensions

Full error trace:

Traceback (most recent call last):
  File "circuitSymbols.py", line 2264, in <module>
    circuit.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 283, in affect
    self.effect()
  File "circuitSymbols.py", line 257, in effect
    currName=so.bipoleRLCCurrName,invertArrows=so.bipoleRLCVoltCurrInvert)
  File "circuitSymbols.py", line 674, in drawCapacitor
    inkDraw.text.latex(self,group,value,pos_text,fontSize=self.fontSize,refPoint='bc',preambleFile=self.preambleFile)
  File "/usr/share/inkscape/extensions/inkscapeMadeEasy_Draw.py", line 1259, in latex
    BboxMin, BboxMax = ExtensionBaseObj.getBoundingBox(groupLatex)
  File "/usr/share/inkscape/extensions/inkscapeMadeEasy_Base.py", line 860, in getBoundingBox
    coords = self.getPoints(element)
  File "/usr/share/inkscape/extensions/inkscapeMadeEasy_Base.py", line 826, in getPoints
    listPoints = self.getPoints(obj)
  File "/usr/share/inkscape/extensions/inkscapeMadeEasy_Base.py", line 826, in getPoints
    listPoints = self.getPoints(obj)
  File "/usr/share/inkscape/extensions/inkscapeMadeEasy_Base.py", line 833, in getPoints
    coordsNP = np.hstack((np.array(listCoords), np.ones([len(listCoords), 1]))).transpose()
  File "/usr/lib/python2.7/site-packages/numpy/core/shape_base.py", line 338, in hstack
    return _nx.concatenate(arrs, 0)
ValueError: all the input arrays must have same number of dimensions

The extension works correctly if I disable LaTeX support, but I'm creating a diagram for use in a LaTeX document so I'd rather keep it on if at all possible. That suggests that the problem is to do with LaTeX, though.

As per issue #4, I tried installing pstoedit (I didn't have it before), but I still get the same error. Any ideas?

Added MOSFET support

Hi

I added MOSFET support and thought maybe you want the code to include it in you plugin...

regards
KST

  #---------------------------------------------
  #metal oxyde transistors (N and P channel)
  def drawTransistorMOS(self,parent,position=[0, 0],value='T',angleDeg=0,label='MOSFET',mirrorEC=False,
                       drawBCEtags=False,
                       drawEnvelope=False,
                       transistorType='NCH',
                       drawVCE=False,
                       drawVCB=False,
                       drawVBE=False,
                       drawICarrow=False,
                       drawIBarrow=False,
                       drawIEarrow=False,
                       VCEname='V_{DS}',
                       VCBname='V_{DG}',
                       VBEname='V_{GS}',
                       ICname='i_D',
                       IBname='i_G',
                       IEname='i_S'):
    
    """ draws a general MOSFET
    
    parent: parent object
    position: position [x,y]
    label: label of the object (it can be repeated)
    mirrorInput: invert + and - inputs (default: positive above, negative below)
    opampDrawVin: write v+ and v- besides the inputs (default: False)
    opampDrawVd: write vd besides the input terminals
    flagDrawSupply: draw supply terminals
    """
    
    if transistorType == 'NCH':
      isNCH=True
    else:
      isNCH=False

    group = self.createGroup(parent,label)
    elem = self.createGroup(group,label)
    colorBlack=inkDraw.color.defined('black')

    L_arrow=2.5
    markerMOS=inkDraw.marker.createMarker(self, 'MOSArrow', 'M 0,0 l -%f,%f l 0,-%f z'% (L_arrow*1.2, L_arrow/2.0,L_arrow), RenameMode=1, strokeColor=colorBlack, fillColor=colorBlack, lineWidth=0.6)
    lineStyleArrow = inkDraw.lineStyle.set(lineWidth=1, lineColor=colorBlack, markerEnd=markerMOS)

    if mirrorEC:   
        if transistorType == 'NCH':
            inkDraw.line.relCoords(elem, [[-27,0]],[position[0]+17,position[1]-7])   #gate
            
            inkDraw.line.relCoords(elem, [[0,-25]],[position[0]+24,position[1]]) # source line
            inkDraw.line.relCoords(elem, [[-9,0]],[position[0]+28,position[1]+5.25]) # horizontal source line
            
            inkDraw.line.relCoords(elem, [[-4.75,0]],[position[0]+24,position[1]+0],lineStyle=lineStyleArrow) # horizontal arrow line 
            inkDraw.line.relCoords(elem, [[0,19.75]],[position[0]+24,position[1]+5.25]) # drain line
            inkDraw.line.relCoords(elem, [[-9,0]],[position[0]+28,position[1]-5.25]) # horizontal drain line
            
            inkDraw.line.relCoords(elem, [[0,-3.25]],[position[0]+28,position[1]-2]) # diode
            inkDraw.line.relCoords(elem, [[0,+3.25]],[position[0]+28,position[1]+2]) # diode
            inkDraw.line.relCoords(elem, [[4,0]],[position[0]+26,position[1]+2]) # diode
            inkDraw.line.relCoords(elem, [[-4,0],[2,4],[2,-4]],[position[0]+30,position[1]-2]) # diode
            
            pos_Gtag=[position[0]+10,position[1]-4]
            
        else:
            inkDraw.line.relCoords(elem, [[-27,0]],[position[0]+17,position[1]+7])   #gate
            
            inkDraw.line.relCoords(elem, [[0,-19.75]],[position[0]+24,position[1]-5.25]) # drain line
            inkDraw.line.relCoords(elem, [[-9,0]],[position[0]+28,position[1]+5.25]) # horizontal line
            
            inkDraw.line.relCoords(elem, [[0,25]],[position[0]+24,position[1]]) # source line
            inkDraw.line.relCoords(elem, [[4.75,0]],[position[0]+19,position[1]+0],lineStyle=lineStyleArrow) # horizontal arrow line 
            inkDraw.line.relCoords(elem, [[-9,0]],[position[0]+28,position[1]-5.25]) # horizontal line
            
            inkDraw.line.relCoords(elem, [[0,-3.25]],[position[0]+28,position[1]-2]) # diode
            inkDraw.line.relCoords(elem, [[0,+3.25]],[position[0]+28,position[1]+2]) # diode
            inkDraw.line.relCoords(elem, [[4,0]],[position[0]+26,position[1]-2]) # diode
            inkDraw.line.relCoords(elem, [[-4,0],[2,-4],[2,4]],[position[0]+30,position[1]+2]) # diode

            pos_Gtag=[position[0]+10,position[1]+4]

        pos_Etag=[position[0]+26.5,position[1]-12.5]
        pos_Ctag=[position[0]+26.5,position[1]+12.5]
        
    else:
        if transistorType == 'NCH':
            inkDraw.line.relCoords(elem, [[-27,0]],[position[0]+17,position[1]+7])   #gate
            
            inkDraw.line.relCoords(elem, [[0,25]],[position[0]+24,position[1]]) # source line
            inkDraw.line.relCoords(elem, [[-9,0]],[position[0]+28,position[1]+5.25]) # horizontal source line
            inkDraw.line.relCoords(elem, [[-4.75,0]],[position[0]+24,position[1]+0],lineStyle=lineStyleArrow) # horizontal arrow line 
            
            inkDraw.line.relCoords(elem, [[0,-19.75]],[position[0]+24,position[1]-5.25]) # drain line
            inkDraw.line.relCoords(elem, [[-9,0]],[position[0]+28,position[1]-5.25]) # horizontal drain line
            
            inkDraw.line.relCoords(elem, [[0,-3.25]],[position[0]+28,position[1]-2]) # diode
            inkDraw.line.relCoords(elem, [[0,+3.25]],[position[0]+28,position[1]+2]) # diode
            inkDraw.line.relCoords(elem, [[4,0]],[position[0]+26,position[1]-2]) # diode
            inkDraw.line.relCoords(elem, [[-4,0],[2,-4],[2,4]],[position[0]+30,position[1]+2]) # diode

            pos_Gtag=[position[0]+10,position[1]+4]

        else:
            inkDraw.line.relCoords(elem, [[-27,0]],[position[0]+17,position[1]-7])   #gate
            
            inkDraw.line.relCoords(elem, [[0,19.75]],[position[0]+24,position[1]+5.25]) # drain line
            inkDraw.line.relCoords(elem, [[-9,0]],[position[0]+28,position[1]+5.25]) # horizontal line
    
            inkDraw.line.relCoords(elem, [[0,-25]],[position[0]+24,position[1]]) # source line
            inkDraw.line.relCoords(elem, [[4.75,0]],[position[0]+19,position[1]+0],lineStyle=lineStyleArrow) # horizontal arrow line 
            inkDraw.line.relCoords(elem, [[-9,0]],[position[0]+28,position[1]-5.25]) # horizontal line
    
            inkDraw.line.relCoords(elem, [[0,-3.25]],[position[0]+28,position[1]-2]) # diode
            inkDraw.line.relCoords(elem, [[0,+3.25]],[position[0]+28,position[1]+2]) # diode
            inkDraw.line.relCoords(elem, [[4,0]],[position[0]+26,position[1]+2]) # diode
            inkDraw.line.relCoords(elem, [[-4,0],[2,4],[2,-4]],[position[0]+30,position[1]-2]) # diode

            pos_Gtag=[position[0]+10,position[1]-4]
            
        pos_Ctag=[position[0]+26.5,position[1]-12.5]
        pos_Etag=[position[0]+26.5,position[1]+12.5]

    inkDraw.line.relCoords(elem, [[0,14]],[position[0]+17,position[1]-7]) #vertical gate line
    inkDraw.line.relCoords(elem, [[0,3.5]],[position[0]+19,position[1]-7]) #vertical gate line
    inkDraw.line.relCoords(elem, [[0,3.5]],[position[0]+19,position[1]-1.75]) #vertical gate line
    inkDraw.line.relCoords(elem, [[0,3.5]],[position[0]+19,position[1]+3.5]) #vertical gate line

    if drawEnvelope:
      inkDraw.circle.centerRadius(elem, centerPoint=[position[0]+22,position[1]], radius=10, offset=[0, 0], label='circle')

    
    if drawBCEtags:
      tB=inkDraw.text.latex(self,group,'G',position=pos_Gtag,fontSize=self.fontSizeSmall/1.5,refPoint='cc',preambleFile=self.preambleFile,angleDeg=-angleDeg)
      tC=inkDraw.text.latex(self,group,'D',position=pos_Ctag,fontSize=self.fontSizeSmall/1.5,refPoint='cc',preambleFile=self.preambleFile,angleDeg=-angleDeg)
      tE=inkDraw.text.latex(self,group,'S',position=pos_Etag,fontSize=self.fontSizeSmall/1.5,refPoint='cc',preambleFile=self.preambleFile,angleDeg=-angleDeg)
            
    if angleDeg!=0:
      self.rotateElement(group,position,angleDeg)

    if inkDraw.useLatex:
      VCEname='$'+VCEname+'$'
      VCBname='$'+VCBname+'$'
      VBEname='$'+VBEname+'$'
      ICname='$'+ICname+'$'
      IBname='$'+IBname+'$'
      IEname='$'+IEname+'$'
      
    #draw voltage drops
    if drawVCE:
      pos=[position[0]+25+10 ,position[1]]
      self.drawVoltArrowSimple(group,pos,name=VCEname,color=self.voltageColor,angleDeg=90,invertArrows=not mirrorEC ,size=20.0,invertCurvatureDirection=False,extraAngleText=angleDeg)
    
    if drawVCB:
        if transistorType == 'NCH':
            if mirrorEC:
                pos = [position[0]+13,position[1]+6]
                ang = -45
            else:
                pos = [position[0]+13,position[1]-6]
                ang = 45
            self.drawVoltArrowSimple(group,pos,name=VCBname,color=self.voltageColor,angleDeg=ang,invertArrows= isNCH,size=25.0,invertCurvatureDirection=not mirrorEC,extraAngleText=angleDeg)
        else:
            if mirrorEC:
                pos = [position[0]+15,position[1]+15]
                ang = -45
            else:
                pos = [position[0]+15,position[1]-15]
                ang = +45
            self.drawVoltArrowSimple(group,pos,name=VCBname,color=self.voltageColor,angleDeg=ang,invertArrows=not isNCH,size=10.0,invertCurvatureDirection=not mirrorEC,extraAngleText=angleDeg)
 
    if drawVBE:
        if transistorType == 'NCH':
            if mirrorEC:
                pos = [position[0]+15,position[1]-15]
                ang = 45
            else:
                pos = [position[0]+15,position[1]+15]
                ang = -45
            self.drawVoltArrowSimple(group,pos,name=VBEname,color=self.voltageColor,angleDeg= ang,invertArrows=not isNCH,size=10.0,invertCurvatureDirection= mirrorEC,extraAngleText=angleDeg)
        else:
            if mirrorEC:
                pos = [position[0]+13,position[1]-6]
                ang = 45
            else:
                pos = [position[0]+13,position[1]+6]
                ang = -45
            self.drawVoltArrowSimple(group,pos,name=VBEname,color=self.voltageColor,angleDeg= ang,invertArrows= isNCH,size=25.0,invertCurvatureDirection= mirrorEC,extraAngleText=angleDeg)
        	
    # draw terminal currents
    if drawICarrow:
      if mirrorEC:
        self.drawCurrArrowSimple(group,[position[0]+30 ,position[1]+17.5],name=ICname,color=self.currentColor,
                                angleDeg=90,invertArrows=not isNCH,size=7.5,invertTextSide=True,extraAngleText=angleDeg)
      else:
        self.drawCurrArrowSimple(group,[position[0]+30 ,position[1]-17.5],name=ICname,color=self.currentColor,
                                angleDeg=90,invertArrows=isNCH,size=7.5,invertTextSide=True,extraAngleText=angleDeg)
      
    if drawIBarrow:
    	if mirrorEC:
    		self.drawCurrArrowSimple(group,[position[0]+7.5-10 ,position[1]+3],name=IBname,color=self.currentColor,
                               angleDeg=0,invertArrows=not isNCH,size=7.5,invertTextSide=False,extraAngleText=angleDeg) 
        else:
    		self.drawCurrArrowSimple(group,[position[0]+7.5-10 ,position[1]+2],name=IBname,color=self.currentColor,
                               angleDeg=0,invertArrows=not isNCH,size=7.5,invertTextSide=False,extraAngleText=angleDeg) 
      
    if drawIEarrow:
      if mirrorEC:
        self.drawCurrArrowSimple(group,[position[0]+30 ,position[1]-17.5],name=IEname,color=self.currentColor,
                                 angleDeg=90,invertArrows=not isNCH,size=7.5,invertTextSide=True,extraAngleText=angleDeg) 
      else:
        self.drawCurrArrowSimple(group,[position[0]+30 ,position[1]+17.5],name=IEname,color=self.currentColor,
                                angleDeg=90,invertArrows=isNCH,size=7.5,invertTextSide=True,extraAngleText=angleDeg)
    return group;

Connecting Components

Hi, is there a way to connect components with wire that automatically rearranges when the components are moved. I see inkscape has a create diagram connects feature, but the connects stem from the center of the components so it doesn't work. Is there a way to implement this sort of functionality, or is there a different function that i am unaware of? Thanks

BJT arrow disappear

When I have to draw two BJT, after clicking 'Apply' to draw the 2nd one, the arrow on the first one disappear.

Warning everytime image is inserted

I'm new to inkscape and managed to get this to work. However, everything I insert a new symbol, I get the following message:

/usr/share/inkscape/extensions/textext/requirements_check.py:623: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives

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.