forked from HEL/circuiteria
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			8c91ccdd54
			...
			ea8277ee5b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ea8277ee5b | |||
| c5e4f8039a | 
| @@ -4,7 +4,7 @@ | ||||
| #set page(width: auto, height: auto, margin: .5cm) | ||||
|  | ||||
| #circuit({ | ||||
|   element.gate-iec-buf( | ||||
|   element.iec-gate-buf( | ||||
|     x: 0, | ||||
|     y: 0, | ||||
|     w: 2, | ||||
| @@ -14,7 +14,7 @@ | ||||
|   ) | ||||
|   wire.stub("iec-buf-port-in0", "west") | ||||
|  | ||||
|   element.gate-iec-not( | ||||
|   element.iec-gate-not( | ||||
|     x: 3, | ||||
|     y: 0, | ||||
|     w: 2, | ||||
| @@ -24,7 +24,7 @@ | ||||
|   ) | ||||
|   wire.stub("iec-not-port-in0", "west") | ||||
|  | ||||
|   element.gate-iec-and( | ||||
|   element.iec-gate-and( | ||||
|     id: "iec-and", | ||||
|     x: 0, | ||||
|     y: -3, | ||||
| @@ -36,7 +36,7 @@ | ||||
|     wire.stub("iec-and-port-in" + str(i), "west") | ||||
|   } | ||||
|  | ||||
|   element.gate-iec-nand( | ||||
|   element.iec-gate-nand( | ||||
|     id: "iec-nand", | ||||
|     x: 3, | ||||
|     y: -3, | ||||
| @@ -48,7 +48,7 @@ | ||||
|     wire.stub("iec-nand-port-in" + str(i), "west") | ||||
|   } | ||||
|  | ||||
|   element.gate-iec-or( | ||||
|   element.iec-gate-or( | ||||
|     id: "iec-or", | ||||
|     x: 0, | ||||
|     y: -6, | ||||
| @@ -60,7 +60,7 @@ | ||||
|     wire.stub("iec-or-port-in" + str(i), "west") | ||||
|   } | ||||
|  | ||||
|   element.gate-iec-nor( | ||||
|   element.iec-gate-nor( | ||||
|     id: "iec-nor", | ||||
|     x: 3, | ||||
|     y: -6, | ||||
| @@ -72,7 +72,7 @@ | ||||
|     wire.stub("iec-nor-port-in" + str(i), "west") | ||||
|   } | ||||
|  | ||||
|   element.gate-iec-xor( | ||||
|   element.iec-gate-xor( | ||||
|     id: "iec-xor", | ||||
|     x: 0, | ||||
|     y: -9, | ||||
| @@ -84,7 +84,7 @@ | ||||
|     wire.stub("iec-xor-port-in" + str(i), "west") | ||||
|   } | ||||
|  | ||||
|   element.gate-iec-nxor( | ||||
|   element.iec-gate-nxor( | ||||
|     id: "iec-nxor", | ||||
|     x: 3, | ||||
|     y: -9, | ||||
|   | ||||
| @@ -12,9 +12,9 @@ | ||||
| #import "elements/logic/xor.typ": gate-xor, gate-xnor | ||||
| #import "elements/logic/buf.typ": gate-buf, gate-not | ||||
| #import "elements/logic/iec_gate.typ": iec-gate | ||||
| #import "elements/logic/iec_and.typ": gate-iec-and, gate-iec-nand | ||||
| #import "elements/logic/iec_buf.typ": gate-iec-buf, gate-iec-not | ||||
| #import "elements/logic/iec_or.typ": gate-iec-or, gate-iec-nor | ||||
| #import "elements/logic/iec_xor.typ": gate-iec-xor, gate-iec-nxor | ||||
| #import "elements/logic/iec_and.typ": iec-gate-and, iec-gate-nand | ||||
| #import "elements/logic/iec_buf.typ": iec-gate-buf, iec-gate-not | ||||
| #import "elements/logic/iec_or.typ": iec-gate-or, iec-gate-nor | ||||
| #import "elements/logic/iec_xor.typ": iec-gate-xor, iec-gate-nxor | ||||
|  | ||||
| #import "elements/group.typ": group | ||||
| @@ -6,8 +6,8 @@ | ||||
| /// Draws an IEC-AND gate. This function is also available as `element.iec-gate-and()` | ||||
| ///  | ||||
| /// For parameters, see #doc-ref("gates.iec-gate") | ||||
| /// #examples.gate-iec-and | ||||
| #let gate-iec-and( | ||||
| /// #examples.iec-gate-and | ||||
| #let iec-gate-and( | ||||
|   x: none, | ||||
|   y: none, | ||||
|   w: none, | ||||
| @@ -40,8 +40,8 @@ | ||||
| /// Draws an IEC-NAND gate. This function is also available as `element.iec-gate-nand()` | ||||
| ///  | ||||
| /// For parameters, see #doc-ref("gates.iec-gate") | ||||
| /// #examples.gate-iec-nand | ||||
| #let gate-iec-nand( | ||||
| /// #examples.iec-gate-nand | ||||
| #let iec-gate-nand( | ||||
|   x: none, | ||||
|   y: none, | ||||
|   w: none, | ||||
| @@ -55,7 +55,7 @@ | ||||
|     ports: false | ||||
|   ), | ||||
| ) = { | ||||
|   gate-iec-and( | ||||
|   iec-gate-and( | ||||
|     x: x, | ||||
|     y: y, | ||||
|     w: w, | ||||
|   | ||||
| @@ -5,8 +5,8 @@ | ||||
| /// Draws an IEC buffer gate. This function is also available as `element.iec-gate-buf()` | ||||
| /// | ||||
| /// For parameters, see #doc-ref("gates.iec-gate") | ||||
| /// #examples.gate-iec-buf | ||||
| #let gate-iec-buf( | ||||
| /// #examples.iec-gate-buf | ||||
| #let iec-gate-buf( | ||||
|   x: none, | ||||
|   y: none, | ||||
|   w: none, | ||||
| @@ -38,8 +38,8 @@ | ||||
| /// Draws an IEC NOT gate. This function is also available as `element.iec-gate-not()` | ||||
| ///  | ||||
| /// For parameters, see #doc-ref("gates.iec-gate") | ||||
| /// #examples.gate-iec-not | ||||
| #let gate-iec-not( | ||||
| /// #examples.iec-gate-not | ||||
| #let iec-gate-not( | ||||
|   x: none, | ||||
|   y: none, | ||||
|   w: none, | ||||
| @@ -53,7 +53,7 @@ | ||||
|     ports: false, | ||||
|   ), | ||||
| ) = { | ||||
|   gate-iec-buf( | ||||
|   iec-gate-buf( | ||||
|     x: x, | ||||
|     y: y, | ||||
|     w: w, | ||||
|   | ||||
| @@ -94,18 +94,15 @@ | ||||
|   let space = 100% / inputs | ||||
|   for i in range(inputs) { | ||||
|     let pct = (i + 0.5) * space | ||||
|     let a = (tl, pct, bl) | ||||
|     let b = (tr, pct, br) | ||||
|     let int-name = id + "i" + str(i) | ||||
|     draw.intersections( | ||||
|       int-name, | ||||
|       func, | ||||
|       draw.hide(draw.line(a, b)) | ||||
|     ) | ||||
|     let port-pos = (tl, pct, bl) | ||||
|     let port-name = "in" + str(i) | ||||
|     let port-pos = int-name + ".0" | ||||
|     if inverted == "all" or port-name in inverted { | ||||
|       draw.circle(port-pos, radius: inverted-radius, anchor: "east", stroke: stroke) | ||||
|       draw.circle( | ||||
|         port-pos, | ||||
|         radius: inverted-radius, | ||||
|         anchor: "east", | ||||
|         stroke: stroke | ||||
|       ) | ||||
|       port-pos = (rel: (-2 * inverted-radius, 0), to: port-pos) | ||||
|     } | ||||
|     add-port( | ||||
|   | ||||
| @@ -4,8 +4,8 @@ | ||||
| /// Draws an IEC-OR gate. This function is also available as `element.iec-gate-or()` | ||||
| ///  | ||||
| /// For parameters, see #doc-ref("gates.iec-gate") | ||||
| /// #examples.gate-iec-or | ||||
| #let gate-iec-or( | ||||
| /// #examples.iec-gate-or | ||||
| #let iec-gate-or( | ||||
|   x: none, | ||||
|   y: none, | ||||
|   w: none, | ||||
| @@ -37,8 +37,8 @@ | ||||
| /// Draws an IEC-NOR gate. This function is also available as `element.iec-gate-nor()` | ||||
| ///  | ||||
| /// For parameters, see #doc-ref("gates.iec-gate") | ||||
| /// #examples.gate-iec-nor | ||||
| #let gate-iec-nor( | ||||
| /// #examples.iec-gate-nor | ||||
| #let iec-gate-nor( | ||||
|   x: none, | ||||
|   y: none, | ||||
|   w: none, | ||||
| @@ -52,7 +52,7 @@ | ||||
|     ports: false | ||||
|   ) | ||||
| ) = { | ||||
|   gate-iec-or( | ||||
|   iec-gate-or( | ||||
|     x: x, | ||||
|     y: y, | ||||
|     w: w, | ||||
|   | ||||
| @@ -4,8 +4,8 @@ | ||||
| /// Draws an IEC-XOR gate. This function is also available as `element.iec-gate-xor()` | ||||
| ///  | ||||
| /// For parameters, see #doc-ref("gates.iec-gate") | ||||
| /// #examples.gate-iec-xor | ||||
| #let gate-iec-xor( | ||||
| /// #examples.iec-gate-xor | ||||
| #let iec-gate-xor( | ||||
|   x: none, | ||||
|   y: none, | ||||
|   w: none, | ||||
| @@ -37,8 +37,8 @@ | ||||
| /// Draws an IEC-NXOR gate. This function is also available as `element.iec-gate-nxor()` | ||||
| ///  | ||||
| /// For parameters, see #doc-ref("gates.iec-gate") | ||||
| /// #examples.gate-iec-nxor | ||||
| #let gate-iec-nxor( | ||||
| /// #examples.iec-gate-nxor | ||||
| #let iec-gate-nxor( | ||||
|   x: none, | ||||
|   y: none, | ||||
|   w: none, | ||||
| @@ -52,7 +52,7 @@ | ||||
|     ports: false | ||||
|   ) | ||||
| ) = { | ||||
|   gate-iec-xor( | ||||
|   iec-gate-xor( | ||||
|     x: x, | ||||
|     y: y, | ||||
|     w: w, | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
| #import "elements/logic/xor.typ": gate-xor, gate-xnor | ||||
| #import "elements/logic/buf.typ": gate-buf, gate-not | ||||
| #import "elements/logic/iec_gate.typ": iec-gate | ||||
| #import "elements/logic/iec_and.typ": gate-iec-and, gate-iec-nand | ||||
| #import "elements/logic/iec_or.typ": gate-iec-or, gate-iec-nor | ||||
| #import "elements/logic/iec_buf.typ": gate-iec-buf, gate-iec-not | ||||
| #import "elements/logic/iec_xor.typ": gate-iec-xor, gate-iec-nxor | ||||
| #import "elements/logic/iec_and.typ": iec-gate-and, iec-gate-nand | ||||
| #import "elements/logic/iec_or.typ": iec-gate-or, iec-gate-nor | ||||
| #import "elements/logic/iec_buf.typ": iec-gate-buf, iec-gate-not | ||||
| #import "elements/logic/iec_xor.typ": iec-gate-xor, iec-gate-nxor | ||||
|   | ||||
		Reference in New Issue
	
	Block a user