Default switchSPST type should be open in Circ.asy.
Convert TwoTerminal to a more general MultiTerminal in Circ.asy. This allows me to add switchSPDT, which has three terminals. Label handling is also more flexible in the new system. By default, labels will stay in their current positions (above/below in element coordinates for label/value). However, the label text is no longer rotated along with the element. If you want rotated text, you'll have to rotate it yourself: MultiTerminal Rpos = resistor(..., dir=90, ... label=rotate(90)*Label("my label", align=W), ...); The benefit to this approach is that you can now set your own alignment, which will override the default above/below positioning. This commit also makes some whitespace normalizations and bumps Circ.asy to version 0.2. To upgrade code using Circ 0.1, make the following changes: * Replace TwoTerminal with MultiTerminal. * Replace ang=... with dir=... in MultiTerminal initializations. * Replace x.beg with x.terminal[0] and x.end with x.terminal[1]. * Adjust labeling as described above. * Replace centerto with two_terminal_centerto.
Factor out _two_terminal_circle() from source() and lamp() in Circ.asy. This will make implementing future circle-based symbols easier (for example, motors, voltmeters, ammeters, etc.). Note that we don't use `unitcircle` because that would create a closed path, and TwoTerminal fills in all closed paths.
Add lamp symbols (normal and illuminating) to Circ.asy.
Add spaces after `unrecognized ... type` in Circ.asy. Otherwise you get messages like: Error, unrecognized resistor type-90
Add TwoTerminal.shift() and kirchhoff_loop() to Circ.asy.
Update Copyright years on recently changed Asymptote libs. Also correct wireU -> wire in wire() error message.
Added MakeCirc reference and link to Circ.asy's initial comment.
Added centerto() function to Circ.asy. Syntax is easier than using the .centerto() method when centering one TwoTerminal on another.
Rearranged TwoTerminal generator args beg,type,ang -> beg,ang,type. That way the positioning arguments are together. Also fixed typo in resistor default angle.
Added defaults to TwoTerminal generators in Circ.asy.
Combined Circ.wire() and Circ.wireU(). Also added wire tests to Circ-test.asy.
Use noncyclic unitcircle in Circ.asy's source(). This avoids the filling of cyclic paths in TwoTerminal.draw().
Added TwoTerminal.centerto() method to Circ.asy
Added licensing information to asymptote files
Started versioning my asymptote libraries.